@peakflo/agent-harness 0.0.0-stage → 0.2.2-rc.1
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 +68 -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,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex Adapter
|
|
3
|
+
*
|
|
4
|
+
* Implements CodingAgentAdapter for OpenAI Codex via direct CLI integration.
|
|
5
|
+
*
|
|
6
|
+
* Key differences from Claude Code:
|
|
7
|
+
* - Uses JSON-RPC over stdio (like MCP protocol)
|
|
8
|
+
* - Spawns `codex` CLI process per session
|
|
9
|
+
* - Thread-based session model (thread_id instead of session_id)
|
|
10
|
+
*/
|
|
11
|
+
import type { CodingAgentAdapter, SessionConfig, SessionStatus, SessionMessage, MessagePart } from './coding-agent-adapter';
|
|
12
|
+
export declare const DEFAULT_CODEX_MODEL = "gpt-5.6-sol";
|
|
13
|
+
export declare class CodexAdapter implements CodingAgentAdapter {
|
|
14
|
+
private sessions;
|
|
15
|
+
private codexExecutablePath;
|
|
16
|
+
/** Callback set by agent-manager to trigger an immediate poll cycle */
|
|
17
|
+
onDataAvailable?: (sessionId: string) => void;
|
|
18
|
+
initialize(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Find the Codex CLI executable path
|
|
21
|
+
*/
|
|
22
|
+
private findCodexExecutable;
|
|
23
|
+
/**
|
|
24
|
+
* Build environment variables for Codex process
|
|
25
|
+
*/
|
|
26
|
+
private buildCodexEnvironment;
|
|
27
|
+
private buildCodexArgs;
|
|
28
|
+
createSession(config: SessionConfig): Promise<string>;
|
|
29
|
+
resumeSession(sessionId: string, config: SessionConfig): Promise<SessionMessage[]>;
|
|
30
|
+
sendPrompt(sessionId: string, parts: MessagePart[], _config: SessionConfig): Promise<void>;
|
|
31
|
+
getStatus(sessionId: string, _config: SessionConfig): Promise<SessionStatus>;
|
|
32
|
+
pollMessages(sessionId: string, seenMessageIds: Set<string>, seenPartIds: Set<string>, partContentLengths: Map<string, string>, _config: SessionConfig): Promise<MessagePart[]>;
|
|
33
|
+
abortPrompt(sessionId: string, _config: SessionConfig): Promise<void>;
|
|
34
|
+
destroySession(sessionId: string, _config: SessionConfig): Promise<void>;
|
|
35
|
+
registerMcpServer(_serverName: string, _mcpConfig: {
|
|
36
|
+
type: 'local' | 'remote';
|
|
37
|
+
command?: string[];
|
|
38
|
+
args?: string[];
|
|
39
|
+
url?: string;
|
|
40
|
+
headers?: Record<string, string>;
|
|
41
|
+
environment?: Record<string, string>;
|
|
42
|
+
}, _workspaceDir?: string): Promise<void>;
|
|
43
|
+
checkHealth(): Promise<{
|
|
44
|
+
available: boolean;
|
|
45
|
+
reason?: string;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Set up stdout parser for JSON-RPC messages
|
|
49
|
+
*/
|
|
50
|
+
private setupStdoutParser;
|
|
51
|
+
/**
|
|
52
|
+
* Handle incoming JSON-RPC message
|
|
53
|
+
*/
|
|
54
|
+
private handleRpcMessage;
|
|
55
|
+
/**
|
|
56
|
+
* Handle JSON-RPC notification (streaming events)
|
|
57
|
+
*/
|
|
58
|
+
private handleNotification;
|
|
59
|
+
/**
|
|
60
|
+
* Send JSON-RPC request and wait for response
|
|
61
|
+
*/
|
|
62
|
+
private sendRpcRequest;
|
|
63
|
+
/**
|
|
64
|
+
* Convert CodexMessage to MessagePart format
|
|
65
|
+
*/
|
|
66
|
+
private convertCodexMessageToParts;
|
|
67
|
+
}
|