Implement agent hiring, approval workflows, config revisions, LLM reflection, and sidebar badges
Agent management: hire endpoint with permission gates and pending_approval status, config revision tracking with rollback, agent duplicate route, permission CRUD. Block pending_approval agents from auth, heartbeat, and assignments. Approvals: revision request/resubmit flow, approval comments CRUD, issue-approval linking, auto-wake agents on approval decisions with context snapshot. Costs: per-agent breakdown, period filtering (month/week/day/all), cost by agent list endpoint. Adapters: agentConfigurationDoc on all adapters, /llms/agent-configuration.txt reflection routes. Inject PAPERCLIP_APPROVAL_ID, PAPERCLIP_APPROVAL_STATUS, PAPERCLIP_LINKED_ISSUE_IDS into adapter environments. Sidebar badges endpoint for pending approval/inbox counts. Dashboard and company settings extensions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,4 +5,15 @@ export const httpAdapter: ServerAdapterModule = {
|
||||
type: "http",
|
||||
execute,
|
||||
models: [],
|
||||
agentConfigurationDoc: `# http agent configuration
|
||||
|
||||
Adapter: http
|
||||
|
||||
Core fields:
|
||||
- url (string, required): endpoint to invoke
|
||||
- method (string, optional): HTTP method, default POST
|
||||
- headers (object, optional): request headers
|
||||
- payloadTemplate (object, optional): JSON payload template
|
||||
- timeoutSec (number, optional): request timeout in seconds
|
||||
`,
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export { getServerAdapter, listAdapterModels } from "./registry.js";
|
||||
export { getServerAdapter, listAdapterModels, listServerAdapters } from "./registry.js";
|
||||
export type {
|
||||
ServerAdapterModule,
|
||||
AdapterExecutionContext,
|
||||
|
||||
@@ -5,4 +5,18 @@ export const processAdapter: ServerAdapterModule = {
|
||||
type: "process",
|
||||
execute,
|
||||
models: [],
|
||||
agentConfigurationDoc: `# process agent configuration
|
||||
|
||||
Adapter: process
|
||||
|
||||
Core fields:
|
||||
- command (string, required): command to execute
|
||||
- args (string[] | string, optional): command arguments
|
||||
- cwd (string, optional): absolute working directory
|
||||
- env (object, optional): KEY=VALUE environment variables
|
||||
|
||||
Operational fields:
|
||||
- timeoutSec (number, optional): run timeout in seconds
|
||||
- graceSec (number, optional): SIGTERM grace period in seconds
|
||||
`,
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { ServerAdapterModule } from "./types.js";
|
||||
import { execute as claudeExecute } from "@paperclip/adapter-claude-local/server";
|
||||
import { models as claudeModels } from "@paperclip/adapter-claude-local";
|
||||
import { agentConfigurationDoc as claudeAgentConfigurationDoc, models as claudeModels } from "@paperclip/adapter-claude-local";
|
||||
import { execute as codexExecute } from "@paperclip/adapter-codex-local/server";
|
||||
import { models as codexModels } from "@paperclip/adapter-codex-local";
|
||||
import { agentConfigurationDoc as codexAgentConfigurationDoc, models as codexModels } from "@paperclip/adapter-codex-local";
|
||||
import { processAdapter } from "./process/index.js";
|
||||
import { httpAdapter } from "./http/index.js";
|
||||
|
||||
@@ -11,6 +11,7 @@ const claudeLocalAdapter: ServerAdapterModule = {
|
||||
execute: claudeExecute,
|
||||
models: claudeModels,
|
||||
supportsLocalAgentJwt: true,
|
||||
agentConfigurationDoc: claudeAgentConfigurationDoc,
|
||||
};
|
||||
|
||||
const codexLocalAdapter: ServerAdapterModule = {
|
||||
@@ -18,6 +19,7 @@ const codexLocalAdapter: ServerAdapterModule = {
|
||||
execute: codexExecute,
|
||||
models: codexModels,
|
||||
supportsLocalAgentJwt: true,
|
||||
agentConfigurationDoc: codexAgentConfigurationDoc,
|
||||
};
|
||||
|
||||
const adaptersByType = new Map<string, ServerAdapterModule>(
|
||||
@@ -36,3 +38,7 @@ export function getServerAdapter(type: string): ServerAdapterModule {
|
||||
export function listAdapterModels(type: string): { id: string; label: string }[] {
|
||||
return adaptersByType.get(type)?.models ?? [];
|
||||
}
|
||||
|
||||
export function listServerAdapters(): ServerAdapterModule[] {
|
||||
return Array.from(adaptersByType.values());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user