@peakflo/agent-harness 0.0.0-stage → 0.2.1-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +38 -2
- package/dist/adapters/acp-adapter.d.ts +177 -0
- package/dist/adapters/acp-adapter.js +1732 -0
- package/dist/adapters/claude-code-adapter.d.ts +171 -0
- package/dist/adapters/claude-code-adapter.js +1918 -0
- package/dist/adapters/codex-adapter.d.ts +67 -0
- package/dist/adapters/codex-adapter.js +681 -0
- package/dist/adapters/codex-app-server-adapter.d.ts +105 -0
- package/dist/adapters/codex-app-server-adapter.js +1309 -0
- package/dist/adapters/coding-agent-adapter.d.ts +289 -0
- package/dist/adapters/coding-agent-adapter.js +31 -0
- package/dist/adapters/index.d.ts +17 -0
- package/dist/adapters/index.js +35 -0
- package/dist/adapters/model-gateway.d.ts +84 -0
- package/dist/adapters/model-gateway.js +270 -0
- package/dist/adapters/opencode-adapter.d.ts +403 -0
- package/dist/adapters/opencode-adapter.js +2710 -0
- package/dist/adapters/opencode-config.d.ts +41 -0
- package/dist/adapters/opencode-config.js +147 -0
- package/dist/adapters/opencode-server-policy.d.ts +82 -0
- package/dist/adapters/opencode-server-policy.js +148 -0
- package/dist/adapters/pi-adapter.d.ts +168 -0
- package/dist/adapters/pi-adapter.js +1468 -0
- package/dist/capabilities.d.ts +58 -0
- package/dist/capabilities.js +161 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +231 -0
- package/dist/contract.d.ts +273 -0
- package/dist/contract.js +357 -0
- package/dist/control-plane.d.ts +178 -0
- package/dist/control-plane.js +431 -0
- package/dist/credential-store.d.ts +110 -0
- package/dist/credential-store.js +181 -0
- package/dist/enrol/browser-enrol.d.ts +85 -0
- package/dist/enrol/browser-enrol.js +387 -0
- package/dist/github-command-guards.d.ts +20 -0
- package/dist/github-command-guards.js +330 -0
- package/dist/github-proxy-certificates.d.ts +25 -0
- package/dist/github-proxy-certificates.js +145 -0
- package/dist/github-proxy.d.ts +37 -0
- package/dist/github-proxy.js +476 -0
- package/dist/github-workspace.d.ts +55 -0
- package/dist/github-workspace.js +537 -0
- package/dist/harness.d.ts +333 -0
- package/dist/harness.js +1414 -0
- package/dist/health.d.ts +45 -0
- package/dist/health.js +116 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +123 -0
- package/dist/model-probe.d.ts +96 -0
- package/dist/model-probe.js +195 -0
- package/dist/options.d.ts +15 -0
- package/dist/options.js +212 -0
- package/dist/ports-default.d.ts +212 -0
- package/dist/ports-default.js +333 -0
- package/dist/ports.d.ts +436 -0
- package/dist/ports.js +27 -0
- package/dist/runtime/attachments.d.ts +92 -0
- package/dist/runtime/attachments.js +377 -0
- package/dist/runtime/child-stream-guards.d.ts +45 -0
- package/dist/runtime/child-stream-guards.js +111 -0
- package/dist/runtime/conversation.d.ts +87 -0
- package/dist/runtime/conversation.js +156 -0
- package/dist/runtime/lease-renewal.d.ts +169 -0
- package/dist/runtime/lease-renewal.js +433 -0
- package/dist/runtime/mcp-auth-proxy.d.ts +82 -0
- package/dist/runtime/mcp-auth-proxy.js +300 -0
- package/dist/runtime/permission-mode.d.ts +116 -0
- package/dist/runtime/permission-mode.js +146 -0
- package/dist/runtime/projection.d.ts +71 -0
- package/dist/runtime/projection.js +211 -0
- package/dist/runtime/session-runner.d.ts +520 -0
- package/dist/runtime/session-runner.js +2122 -0
- package/dist/shared/reasoning-effort.d.ts +11 -0
- package/dist/shared/reasoning-effort.js +20 -0
- package/dist/store/conversation-store.d.ts +100 -0
- package/dist/store/conversation-store.js +305 -0
- package/dist/store/sqlite-store.d.ts +120 -0
- package/dist/store/sqlite-store.js +346 -0
- package/dist/types.d.ts +952 -0
- package/dist/types.js +55 -0
- package/dist/version.d.ts +32 -0
- package/dist/version.js +77 -0
- package/package.json +53 -4
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex App Server adapter.
|
|
3
|
+
*
|
|
4
|
+
* Experimental replacement path for Codex ACP. This talks to `codex app-server`
|
|
5
|
+
* over JSON-RPC stdio and maps the app-server thread/turn/item protocol onto
|
|
6
|
+
* 20x's CodingAgentAdapter contract.
|
|
7
|
+
*/
|
|
8
|
+
import type { CodingAgentAdapter, SessionConfig, SessionStatus, SessionMessage, MessagePart } from './coding-agent-adapter';
|
|
9
|
+
interface PendingApproval {
|
|
10
|
+
requestId: string | number;
|
|
11
|
+
toolCallId: string;
|
|
12
|
+
question: string;
|
|
13
|
+
options: Array<{
|
|
14
|
+
optionId: string;
|
|
15
|
+
name: string;
|
|
16
|
+
kind: string;
|
|
17
|
+
}>;
|
|
18
|
+
responseKind: 'execCommand' | 'commandExecution' | 'fileChange' | 'permissions' | 'elicitation' | 'userInput' | 'generic';
|
|
19
|
+
}
|
|
20
|
+
export declare class CodexAppServerAdapter implements CodingAgentAdapter {
|
|
21
|
+
private sessions;
|
|
22
|
+
private codexExecutablePath;
|
|
23
|
+
onDataAvailable?: (sessionId: string) => void;
|
|
24
|
+
initialize(): Promise<void>;
|
|
25
|
+
createSession(config: SessionConfig): Promise<string>;
|
|
26
|
+
resumeSession(sessionId: string, config: SessionConfig): Promise<SessionMessage[]>;
|
|
27
|
+
sendPrompt(sessionId: string, parts: MessagePart[], config: SessionConfig): Promise<void>;
|
|
28
|
+
getStatus(sessionId: string, _config: SessionConfig): Promise<SessionStatus>;
|
|
29
|
+
pollMessages(sessionId: string, seenMessageIds: Set<string>, seenPartIds: Set<string>, partContentLengths: Map<string, string>, _config: SessionConfig): Promise<MessagePart[]>;
|
|
30
|
+
getAllMessages(sessionId: string, _config: SessionConfig): Promise<SessionMessage[]>;
|
|
31
|
+
abortPrompt(sessionId: string, _config: SessionConfig): Promise<void>;
|
|
32
|
+
destroySession(sessionId: string, _config: SessionConfig): Promise<void>;
|
|
33
|
+
registerMcpServer(_serverName: string, _mcpConfig: {
|
|
34
|
+
type: 'local' | 'remote';
|
|
35
|
+
command?: string[];
|
|
36
|
+
args?: string[];
|
|
37
|
+
url?: string;
|
|
38
|
+
headers?: Record<string, string>;
|
|
39
|
+
environment?: Record<string, string>;
|
|
40
|
+
}, _workspaceDir?: string): Promise<void>;
|
|
41
|
+
checkHealth(): Promise<{
|
|
42
|
+
available: boolean;
|
|
43
|
+
reason?: string;
|
|
44
|
+
}>;
|
|
45
|
+
getPendingApproval(sessionId: string): PendingApproval | null;
|
|
46
|
+
respondToApproval(sessionId: string, approved: boolean, optionId?: string): Promise<void>;
|
|
47
|
+
getRunningTools(sessionId: string, _config: SessionConfig): Promise<Array<{
|
|
48
|
+
partId: string;
|
|
49
|
+
toolName: string;
|
|
50
|
+
startTime?: number;
|
|
51
|
+
input?: Record<string, unknown>;
|
|
52
|
+
}>>;
|
|
53
|
+
private startAppServerProcess;
|
|
54
|
+
private initializeAppServer;
|
|
55
|
+
private findCodexExecutable;
|
|
56
|
+
private execFileAsync;
|
|
57
|
+
private buildEnvironment;
|
|
58
|
+
private buildConfigOverrides;
|
|
59
|
+
private buildRuntimeWorkspaceRoots;
|
|
60
|
+
private resolveExternalGitRoots;
|
|
61
|
+
private convertMcpServers;
|
|
62
|
+
private logMcpServerInventory;
|
|
63
|
+
private setupStdoutParser;
|
|
64
|
+
private handleRpcMessage;
|
|
65
|
+
private handleServerRequest;
|
|
66
|
+
private handleNotification;
|
|
67
|
+
private handleApprovalRequest;
|
|
68
|
+
private buildApprovalResponse;
|
|
69
|
+
private getApprovalResponseKind;
|
|
70
|
+
private resolveSandboxMode;
|
|
71
|
+
private buildSandboxPolicy;
|
|
72
|
+
private addEvent;
|
|
73
|
+
private bufferThreadItems;
|
|
74
|
+
/**
|
|
75
|
+
* Buffers a single thread item from a reconcile pass, skipping it if it has
|
|
76
|
+
* already been buffered. reconcileCompletedTurn() re-lists the entire thread on
|
|
77
|
+
* every turn/completed, so this MUST be idempotent for every item — including
|
|
78
|
+
* the many Codex item types that carry no top-level `id` (function_call_output,
|
|
79
|
+
* custom_tool_call_output, tool_search_output, user/developer messages). We key
|
|
80
|
+
* off a stable identity (id/itemId/call_id) or, failing that, a deterministic
|
|
81
|
+
* content hash, and forward that key as `itemId` so the derived part id stays
|
|
82
|
+
* stable across passes. Without this, id-less items were re-emitted with a fresh
|
|
83
|
+
* id on every idle and the transcript repeated older messages.
|
|
84
|
+
*/
|
|
85
|
+
private bufferReconciledThreadItem;
|
|
86
|
+
private computeThreadItemKey;
|
|
87
|
+
private bufferAllThreadItems;
|
|
88
|
+
private bufferAllThreadTurns;
|
|
89
|
+
private reconcileCompletedTurn;
|
|
90
|
+
private markIdleIfSettled;
|
|
91
|
+
private convertEventToMessageParts;
|
|
92
|
+
private convertOutputDeltaEvent;
|
|
93
|
+
private convertThreadItem;
|
|
94
|
+
private hasSeenAssistantTextForTurn;
|
|
95
|
+
private markAssistantTextForTurn;
|
|
96
|
+
private extractTurnKey;
|
|
97
|
+
private extractAssistantTextScopeKeys;
|
|
98
|
+
private buildAssistantTextKey;
|
|
99
|
+
private sendRpcRequest;
|
|
100
|
+
private sendRpcResponse;
|
|
101
|
+
private sendRpcNotification;
|
|
102
|
+
private writeJson;
|
|
103
|
+
private requireSession;
|
|
104
|
+
}
|
|
105
|
+
export {};
|