2026-02-18 13:53:03 -06:00
|
|
|
import type { ServerAdapterModule } from "./types.js";
|
2026-02-18 14:23:16 -06:00
|
|
|
import { execute as claudeExecute } from "@paperclip/adapter-claude-local/server";
|
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>
2026-02-19 13:02:41 -06:00
|
|
|
import { agentConfigurationDoc as claudeAgentConfigurationDoc, models as claudeModels } from "@paperclip/adapter-claude-local";
|
2026-02-18 14:23:16 -06:00
|
|
|
import { execute as codexExecute } from "@paperclip/adapter-codex-local/server";
|
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>
2026-02-19 13:02:41 -06:00
|
|
|
import { agentConfigurationDoc as codexAgentConfigurationDoc, models as codexModels } from "@paperclip/adapter-codex-local";
|
2026-02-18 13:53:03 -06:00
|
|
|
import { processAdapter } from "./process/index.js";
|
|
|
|
|
import { httpAdapter } from "./http/index.js";
|
|
|
|
|
|
2026-02-18 14:23:16 -06:00
|
|
|
const claudeLocalAdapter: ServerAdapterModule = {
|
|
|
|
|
type: "claude_local",
|
|
|
|
|
execute: claudeExecute,
|
|
|
|
|
models: claudeModels,
|
2026-02-18 16:46:45 -06:00
|
|
|
supportsLocalAgentJwt: true,
|
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>
2026-02-19 13:02:41 -06:00
|
|
|
agentConfigurationDoc: claudeAgentConfigurationDoc,
|
2026-02-18 14:23:16 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const codexLocalAdapter: ServerAdapterModule = {
|
|
|
|
|
type: "codex_local",
|
|
|
|
|
execute: codexExecute,
|
|
|
|
|
models: codexModels,
|
2026-02-18 16:46:45 -06:00
|
|
|
supportsLocalAgentJwt: true,
|
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>
2026-02-19 13:02:41 -06:00
|
|
|
agentConfigurationDoc: codexAgentConfigurationDoc,
|
2026-02-18 14:23:16 -06:00
|
|
|
};
|
|
|
|
|
|
2026-02-18 13:53:03 -06:00
|
|
|
const adaptersByType = new Map<string, ServerAdapterModule>(
|
|
|
|
|
[claudeLocalAdapter, codexLocalAdapter, processAdapter, httpAdapter].map((a) => [a.type, a]),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export function getServerAdapter(type: string): ServerAdapterModule {
|
|
|
|
|
const adapter = adaptersByType.get(type);
|
|
|
|
|
if (!adapter) {
|
|
|
|
|
// Fall back to process adapter for unknown types
|
|
|
|
|
return processAdapter;
|
|
|
|
|
}
|
|
|
|
|
return adapter;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function listAdapterModels(type: string): { id: string; label: string }[] {
|
|
|
|
|
return adaptersByType.get(type)?.models ?? [];
|
|
|
|
|
}
|
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>
2026-02-19 13:02:41 -06:00
|
|
|
|
|
|
|
|
export function listServerAdapters(): ServerAdapterModule[] {
|
|
|
|
|
return Array.from(adaptersByType.values());
|
|
|
|
|
}
|