stitchkit 0.130.0 → 0.131.0
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/CHANGELOG.md +48 -0
- package/dist/agent-executor/acp/v1-connect.d.ts +40 -26
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-driver.d.ts +10 -4
- package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-handlers.d.ts +6 -2
- package/dist/agent-executor/acp/v1-handlers.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-probe.d.ts +38 -0
- package/dist/agent-executor/acp/v1-probe.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts +15 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts +9 -7
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
- package/dist/agent-executor/claude/cli-driver.d.ts +7 -7
- package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
- package/dist/agent-executor/claude/limits.d.ts +6 -4
- package/dist/agent-executor/claude/limits.d.ts.map +1 -1
- package/dist/agent-executor/claude/session.d.ts +3 -3
- package/dist/agent-executor/claude/session.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/controls.d.ts +1 -0
- package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/driver.d.ts +51 -50
- package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/probe.d.ts +3 -3
- package/dist/agent-executor/claude-sdk/probe.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/query-loop.d.ts +2 -1
- package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
- package/dist/agent-executor/codex/classify.d.ts.map +1 -1
- package/dist/agent-executor/codex/connect.d.ts +9 -7
- package/dist/agent-executor/codex/connect.d.ts.map +1 -1
- package/dist/agent-executor/codex/control-client.d.ts +112 -87
- package/dist/agent-executor/codex/control-client.d.ts.map +1 -1
- package/dist/agent-executor/codex/control-read-methods.d.ts +7 -0
- package/dist/agent-executor/codex/control-read-methods.d.ts.map +1 -0
- package/dist/agent-executor/codex/driver.d.ts +42 -31
- package/dist/agent-executor/codex/driver.d.ts.map +1 -1
- package/dist/agent-executor/codex/event-routing.d.ts +14 -0
- package/dist/agent-executor/codex/event-routing.d.ts.map +1 -0
- package/dist/agent-executor/codex/handlers.d.ts +9 -4
- package/dist/agent-executor/codex/handlers.d.ts.map +1 -1
- package/dist/agent-executor/codex/limits.d.ts +9 -3
- package/dist/agent-executor/codex/limits.d.ts.map +1 -1
- package/dist/agent-executor/codex/notifications.d.ts +183 -0
- package/dist/agent-executor/codex/notifications.d.ts.map +1 -0
- package/dist/agent-executor/codex/pagination.d.ts +54 -0
- package/dist/agent-executor/codex/pagination.d.ts.map +1 -0
- package/dist/agent-executor/codex/protocol.d.ts +586 -144
- package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts +4 -2
- package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
- package/dist/agent-executor/codex/responses.d.ts +855 -0
- package/dist/agent-executor/codex/responses.d.ts.map +1 -0
- package/dist/agent-executor/codex/session-bind.d.ts +410 -0
- package/dist/agent-executor/codex/session-bind.d.ts.map +1 -0
- package/dist/agent-executor/codex/session-controls.d.ts +21 -169
- package/dist/agent-executor/codex/session-controls.d.ts.map +1 -1
- package/dist/agent-executor/codex/session-types.d.ts +190 -0
- package/dist/agent-executor/codex/session-types.d.ts.map +1 -0
- package/dist/agent-executor/codex/session.d.ts +5 -53
- package/dist/agent-executor/codex/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-server.d.ts +7 -5
- package/dist/agent-executor/codex/shared-server.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-thread.d.ts +8 -8
- package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -1
- package/dist/agent-executor/codex/thread-controls.d.ts +61 -36
- package/dist/agent-executor/codex/thread-controls.d.ts.map +1 -1
- package/dist/agent-executor/codex/thread-list-query.d.ts +5 -0
- package/dist/agent-executor/codex/thread-list-query.d.ts.map +1 -0
- package/dist/agent-executor/codex/thread-open.d.ts +66 -0
- package/dist/agent-executor/codex/thread-open.d.ts.map +1 -0
- package/dist/agent-executor/codex/turn-input.d.ts +25 -7
- package/dist/agent-executor/codex/turn-input.d.ts.map +1 -1
- package/dist/agent-executor/codex/unix-socket-target.d.ts +12 -3
- package/dist/agent-executor/codex/unix-socket-target.d.ts.map +1 -1
- package/dist/agent-executor/codex/ws-frame.d.ts +4 -1
- package/dist/agent-executor/codex/ws-frame.d.ts.map +1 -1
- package/dist/agent-executor/contract.d.ts +3 -1
- package/dist/agent-executor/contract.d.ts.map +1 -1
- package/dist/agent-executor/engine-process.d.ts +4 -4
- package/dist/agent-executor/engine-process.d.ts.map +1 -1
- package/dist/agent-executor/engine.d.ts +3 -3
- package/dist/agent-executor/engine.d.ts.map +1 -1
- package/dist/agent-executor/handoff.d.ts.map +1 -1
- package/dist/agent-executor/hello.d.ts +7 -0
- package/dist/agent-executor/hello.d.ts.map +1 -1
- package/dist/agent-executor/json-rpc-peer.d.ts +9 -4
- package/dist/agent-executor/json-rpc-peer.d.ts.map +1 -1
- package/dist/agent-executor/leases.d.ts +1 -1
- package/dist/agent-executor/leases.d.ts.map +1 -1
- package/dist/agent-executor/plan-limits.d.ts +12 -1
- package/dist/agent-executor/plan-limits.d.ts.map +1 -1
- package/dist/agent-executor/profile.d.ts +7 -0
- package/dist/agent-executor/profile.d.ts.map +1 -1
- package/dist/agent-executor/session-primitives.d.ts +8 -0
- package/dist/agent-executor/session-primitives.d.ts.map +1 -1
- package/dist/agent-executor/testing/consumer-stubs.d.ts +45 -0
- package/dist/agent-executor/testing/consumer-stubs.d.ts.map +1 -0
- package/dist/agent-executor/testing/fake-claude-sdk-query.d.ts +88 -0
- package/dist/agent-executor/testing/fake-claude-sdk-query.d.ts.map +1 -0
- package/dist/agent-executor/testing/fake-codex-app-server.d.ts +56 -0
- package/dist/agent-executor/testing/fake-codex-app-server.d.ts.map +1 -0
- package/dist/agent-executor/testing/fixtures.d.ts +26 -0
- package/dist/agent-executor/testing/fixtures.d.ts.map +1 -0
- package/dist/agent-executor/testing/replay-driver.d.ts +8 -8
- package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-runner.d.ts +3 -2
- package/dist/agent-executor/testing/replay-runner.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-transcript.d.ts +5 -3
- package/dist/agent-executor/testing/replay-transcript.d.ts.map +1 -1
- package/dist/agent-runtime/branch-observations.d.ts +5 -5
- package/dist/entrypoints/agent-executor/acp.d.ts +2 -1
- package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +284 -82
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts +4 -0
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/claude-sdk.js +58 -32
- package/dist/entrypoints/agent-executor/claude.d.ts +2 -2
- package/dist/entrypoints/agent-executor/claude.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/claude.js +25 -20
- package/dist/entrypoints/agent-executor/codex.d.ts +11 -6
- package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/codex.js +2223 -1803
- package/dist/entrypoints/agent-executor/testing.d.ts +4 -0
- package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/testing.js +880 -18
- package/dist/entrypoints/agent-executor.d.ts +3 -3
- package/dist/entrypoints/agent-executor.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor.js +42 -8
- package/dist/entrypoints/process.js +3 -3
- package/dist/{index-jrn3prgm.js → index-32vaajec.js} +29 -4
- package/dist/{index-p1qmpq0p.js → index-64e9p079.js} +92 -56
- package/dist/{index-dbp6xemn.js → index-g2d9kws8.js} +199 -3
- package/dist/index-gm9yz82v.js +56 -0
- package/dist/index-j15dhkda.js +749 -0
- package/dist/{index-1q0n6zek.js → index-kwsr7j5k.js} +84 -44
- package/llms/agent-executor-acp.txt +5 -5
- package/llms/agent-executor-claude-sdk.txt +3 -1
- package/llms/agent-executor-claude.txt +2 -2
- package/llms/agent-executor-codex.txt +13 -10
- package/llms/agent-executor-testing.txt +5 -1
- package/llms/agent-executor.txt +4 -4
- package/llms/stitchkit.txt +75 -74
- package/llms/{upgrading-0.128.0-0.130.0.txt → upgrading-0.128.0-0.131.0.txt} +56 -3
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +160 -97
- package/llms.txt +8 -8
- package/package.json +3 -3
- package/dist/index-2s8sy57y.js +0 -229
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
import type { InteractionReply } from '../executor-contract.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DriverImageOptions } from '../image-input.js';
|
|
3
|
+
import type { JsonRpcPeer } from '../json-rpc-peer.js';
|
|
3
4
|
import type { ExecutorProfileConfig } from '../profile.js';
|
|
4
5
|
import type { ExecutorStartupPhase } from '../vocabulary.js';
|
|
5
|
-
import { type
|
|
6
|
+
import { type CodexApprovalPolicy, type CodexCollaborationMode, type CodexSandboxPolicy, type CodexTurnsPage } from './protocol.js';
|
|
7
|
+
import { type CodexAccountReadResponse, type CodexCollaborationModesResponse, type CodexConfigReadResponse, type CodexItemsPage, type CodexLoadedThreadsPage, type CodexMcpServerStatusPage, type CodexModelsPage, type CodexRateLimitsResponse, type CodexReadThreadResponse, type CodexResumeThreadResponse, type CodexSkillsListResponse, type CodexThreadMetadataUpdateResponse, type CodexThreadsPage, type CodexThreadUnarchiveResponse, type CodexThreadUnsubscribeResponse } from './responses.js';
|
|
8
|
+
import { type CodexInjectItemsParams, type CodexInterruptTurnParams, type CodexListLoadedThreadsParams, type CodexListThreadsParams, type CodexRevertThreadParams, type CodexRevertThreadResult, type CodexRpcCallOptions, type CodexSetThreadNameParams, type CodexThreadIdParams, type CodexUpdateThreadMetadataParams } from './thread-controls.js';
|
|
9
|
+
import { type CodexResumeThreadParams } from './thread-open.js';
|
|
10
|
+
import { type CodexTurnInputPart } from './turn-input.js';
|
|
6
11
|
/** Parameters for Codex `thread/read`. */
|
|
7
12
|
export interface CodexReadThreadParams {
|
|
8
13
|
/** Thread identifier to inspect. */
|
|
9
14
|
readonly threadId: string;
|
|
10
15
|
/** When `true`, include full rollout turns (deprecated for large threads). */
|
|
11
|
-
readonly includeTurns?: boolean;
|
|
16
|
+
readonly includeTurns?: boolean | undefined;
|
|
12
17
|
}
|
|
13
18
|
/** Parameters for Codex `thread/turns/list`. */
|
|
14
19
|
export interface CodexListTurnsParams {
|
|
15
20
|
/** Thread identifier whose turns to list. */
|
|
16
21
|
readonly threadId: string;
|
|
17
|
-
/** Opaque continuation cursor returned by a previous page. */
|
|
18
|
-
readonly cursor?: string;
|
|
22
|
+
/** Opaque continuation cursor returned by a previous page, or `null` for the first page. */
|
|
23
|
+
readonly cursor?: string | null | undefined;
|
|
19
24
|
/** Optional page size (`uint32`). */
|
|
20
|
-
readonly limit?: number;
|
|
25
|
+
readonly limit?: number | undefined;
|
|
21
26
|
/** Level of item detail per turn (`notLoaded`, `summary`, or `full`). */
|
|
22
|
-
readonly itemsView?: 'notLoaded' | 'summary' | 'full';
|
|
27
|
+
readonly itemsView?: 'notLoaded' | 'summary' | 'full' | undefined;
|
|
23
28
|
/** Pagination direction (`asc` or `desc`). */
|
|
24
|
-
readonly sortDirection?: 'asc' | 'desc';
|
|
29
|
+
readonly sortDirection?: 'asc' | 'desc' | undefined;
|
|
25
30
|
}
|
|
26
31
|
/** Starting position for a `thread/items/list` page: opaque string cursor or exclusive item anchor. */
|
|
27
32
|
export type CodexThreadItemsCursor = string | {
|
|
@@ -31,138 +36,158 @@ export type CodexThreadItemsCursor = string | {
|
|
|
31
36
|
/** Output deferral preferences accepted by Codex `thread/items/list`. */
|
|
32
37
|
export interface CodexThreadItemsDeferOutput {
|
|
33
38
|
/** Defer nonempty output from successful commands. */
|
|
34
|
-
readonly commandExecution?: boolean;
|
|
39
|
+
readonly commandExecution?: boolean | undefined;
|
|
35
40
|
/** Defer nonempty plain-text results from successful MCP tool calls. */
|
|
36
|
-
readonly mcpToolCall?: boolean;
|
|
41
|
+
readonly mcpToolCall?: boolean | undefined;
|
|
37
42
|
}
|
|
38
43
|
/** Parameters for Codex `thread/items/list`. */
|
|
39
44
|
export interface CodexListItemsParams {
|
|
40
45
|
/** Thread identifier whose items to list. */
|
|
41
46
|
readonly threadId: string;
|
|
42
47
|
/** Optional turn identifier to filter items to one turn. */
|
|
43
|
-
readonly turnId?: string;
|
|
44
|
-
/** Opaque continuation cursor
|
|
45
|
-
readonly cursor?: CodexThreadItemsCursor;
|
|
48
|
+
readonly turnId?: string | undefined;
|
|
49
|
+
/** Opaque continuation cursor, exclusive item anchor within `turnId`, or `null` for the first page. */
|
|
50
|
+
readonly cursor?: CodexThreadItemsCursor | null | undefined;
|
|
46
51
|
/** Optional page size (`uint32`). */
|
|
47
|
-
readonly limit?: number;
|
|
52
|
+
readonly limit?: number | undefined;
|
|
48
53
|
/** Pagination direction (`asc` or `desc`). */
|
|
49
|
-
readonly sortDirection?: 'asc' | 'desc';
|
|
54
|
+
readonly sortDirection?: 'asc' | 'desc' | undefined;
|
|
50
55
|
/** Output deferral flags for single-turn item reads. */
|
|
51
|
-
readonly deferOutput?: CodexThreadItemsDeferOutput;
|
|
56
|
+
readonly deferOutput?: CodexThreadItemsDeferOutput | undefined;
|
|
52
57
|
}
|
|
53
|
-
/**
|
|
58
|
+
/** Parameters for steering an active Codex turn on any thread via {@link CodexControlClient.steerTurn} (`turn/steer`). */
|
|
59
|
+
export interface CodexControlSteerTurnParams {
|
|
60
|
+
/** Thread identifier owning the active turn to steer. */
|
|
61
|
+
readonly threadId: string;
|
|
62
|
+
/** Required active Codex turn identifier precondition (`expectedTurnId`). */
|
|
63
|
+
readonly expectedTurnId: string;
|
|
64
|
+
/** Ordered turn input parts (text, resolved images, `localImage`, and `skill` items). */
|
|
65
|
+
readonly input: readonly CodexTurnInputPart[];
|
|
66
|
+
/** Optional client-generated idempotency identifier (`clientUserMessageId`). */
|
|
67
|
+
readonly clientId?: string | undefined;
|
|
68
|
+
}
|
|
69
|
+
/** Parameters for starting a turn on any thread via {@link CodexControlClient.startThreadTurn} (`turn/start`) without occupying a local session turn slot. */
|
|
70
|
+
export interface CodexControlStartTurnParams {
|
|
71
|
+
/** Thread identifier on which to start the turn. */
|
|
72
|
+
readonly threadId: string;
|
|
73
|
+
/** Required client-generated idempotency identifier (`clientUserMessageId`). */
|
|
74
|
+
readonly clientId: string;
|
|
75
|
+
/** Ordered turn input parts (text, resolved images, `localImage`, and `skill` items). */
|
|
76
|
+
readonly input: readonly CodexTurnInputPart[];
|
|
77
|
+
/** Optional per-turn working directory override forwarded on `turn/start`. */
|
|
78
|
+
readonly cwd?: string | undefined;
|
|
79
|
+
/** Optional per-turn model override forwarded on `turn/start`. */
|
|
80
|
+
readonly model?: string | undefined;
|
|
81
|
+
/** Optional per-turn reasoning effort override (forwarded to Codex as `effort`). */
|
|
82
|
+
readonly reasoningEffort?: string | undefined;
|
|
83
|
+
/** Optional per-turn collaboration mode override (`plan` or `default`). */
|
|
84
|
+
readonly collaborationMode?: CodexCollaborationMode | undefined;
|
|
85
|
+
/** Optional per-turn approval policy override. */
|
|
86
|
+
readonly approvalPolicy?: CodexApprovalPolicy | undefined;
|
|
87
|
+
/** Optional per-turn sandbox policy override (`sandboxPolicy`). */
|
|
88
|
+
readonly sandboxPolicy?: CodexSandboxPolicy | undefined;
|
|
89
|
+
/** Optional per-turn runtime workspace roots override. */
|
|
90
|
+
readonly runtimeWorkspaceRoots?: readonly string[] | undefined;
|
|
91
|
+
}
|
|
92
|
+
/** Thread, turn, inspection, and catalog RPCs exposed during thread setup (`prepareThread` / `verifyThread`), on {@link CodexControlConnection}, {@link CodexSharedServer}, and {@link CodexSession}. */
|
|
54
93
|
export interface CodexControlClient {
|
|
55
94
|
/** Read effective Codex configuration (`config/read`). */
|
|
56
95
|
readConfig(params?: {
|
|
57
|
-
readonly cwd?: string;
|
|
58
|
-
readonly includeLayers?: boolean;
|
|
59
|
-
}): Promise<
|
|
96
|
+
readonly cwd?: string | undefined;
|
|
97
|
+
readonly includeLayers?: boolean | undefined;
|
|
98
|
+
}, options?: CodexRpcCallOptions): Promise<CodexConfigReadResponse>;
|
|
60
99
|
/** Read thread metadata and live status (`thread/read`). */
|
|
61
|
-
readThread(params: CodexReadThreadParams): Promise<
|
|
100
|
+
readThread(params: CodexReadThreadParams, options?: CodexRpcCallOptions): Promise<CodexReadThreadResponse>;
|
|
62
101
|
/** List collaboration mode presets (`collaborationMode/list`). */
|
|
63
|
-
listCollaborationModes(): Promise<
|
|
102
|
+
listCollaborationModes(options?: CodexRpcCallOptions): Promise<CodexCollaborationModesResponse>;
|
|
64
103
|
/** List turns in a thread (`thread/turns/list`). */
|
|
65
|
-
listTurns(params: CodexListTurnsParams): Promise<
|
|
104
|
+
listTurns(params: CodexListTurnsParams, options?: CodexRpcCallOptions): Promise<CodexTurnsPage>;
|
|
66
105
|
/** List items in a thread or single turn (`thread/items/list`). */
|
|
67
|
-
listItems(params: CodexListItemsParams): Promise<
|
|
106
|
+
listItems(params: CodexListItemsParams, options?: CodexRpcCallOptions): Promise<CodexItemsPage>;
|
|
68
107
|
/** List MCP servers and their statuses (`mcpServerStatus/list`). */
|
|
69
108
|
listMcpServerStatus(params?: {
|
|
70
|
-
readonly cursor?: string;
|
|
71
|
-
readonly limit?: number;
|
|
72
|
-
readonly threadId?: string;
|
|
73
|
-
readonly serverName?: string;
|
|
74
|
-
readonly detail?: string;
|
|
75
|
-
}): Promise<
|
|
109
|
+
readonly cursor?: string | undefined;
|
|
110
|
+
readonly limit?: number | undefined;
|
|
111
|
+
readonly threadId?: string | undefined;
|
|
112
|
+
readonly serverName?: string | undefined;
|
|
113
|
+
readonly detail?: string | undefined;
|
|
114
|
+
}, options?: CodexRpcCallOptions): Promise<CodexMcpServerStatusPage>;
|
|
76
115
|
/** List discovered Codex skills (`skills/list`). */
|
|
77
116
|
listSkills(params?: {
|
|
78
|
-
readonly cwds?: readonly string[];
|
|
79
|
-
readonly forceReload?: boolean;
|
|
80
|
-
}): Promise<
|
|
117
|
+
readonly cwds?: readonly string[] | undefined;
|
|
118
|
+
readonly forceReload?: boolean | undefined;
|
|
119
|
+
}, options?: CodexRpcCallOptions): Promise<CodexSkillsListResponse>;
|
|
81
120
|
/** List available models (`model/list`). */
|
|
82
121
|
listModels(params?: {
|
|
83
|
-
readonly cursor?: string;
|
|
84
|
-
readonly limit?: number;
|
|
85
|
-
readonly includeHidden?: boolean;
|
|
86
|
-
readonly modelProvider?: string;
|
|
87
|
-
}): Promise<
|
|
122
|
+
readonly cursor?: string | undefined;
|
|
123
|
+
readonly limit?: number | undefined;
|
|
124
|
+
readonly includeHidden?: boolean | undefined;
|
|
125
|
+
readonly modelProvider?: string | undefined;
|
|
126
|
+
}, options?: CodexRpcCallOptions): Promise<CodexModelsPage>;
|
|
88
127
|
/** Read active account information (`account/read`). */
|
|
89
128
|
readAccount(params?: {
|
|
90
|
-
readonly refreshToken?: boolean;
|
|
91
|
-
}): Promise<
|
|
92
|
-
/** Read the
|
|
93
|
-
readRateLimits(): Promise<
|
|
129
|
+
readonly refreshToken?: boolean | undefined;
|
|
130
|
+
}, options?: CodexRpcCallOptions): Promise<CodexAccountReadResponse>;
|
|
131
|
+
/** Read the `account/rateLimits/read` response envelope. */
|
|
132
|
+
readRateLimits(options?: CodexRpcCallOptions): Promise<CodexRateLimitsResponse>;
|
|
94
133
|
/** Revert a thread's durable history to before `beforeTurnId` (`thread/revert`). */
|
|
95
|
-
revertThread(params: CodexRevertThreadParams): Promise<CodexRevertThreadResult>;
|
|
134
|
+
revertThread(params: CodexRevertThreadParams, options?: CodexRpcCallOptions): Promise<CodexRevertThreadResult>;
|
|
96
135
|
/** Append raw Responses API items to a thread's model-visible history (`thread/inject_items`). */
|
|
97
|
-
injectItems(params: CodexInjectItemsParams): Promise<
|
|
136
|
+
injectItems(params: CodexInjectItemsParams, options?: CodexRpcCallOptions): Promise<void>;
|
|
98
137
|
/** Unsubscribe this connection from a thread (`thread/unsubscribe`). */
|
|
99
|
-
unsubscribeThread(params: CodexThreadIdParams): Promise<
|
|
138
|
+
unsubscribeThread(params: CodexThreadIdParams, options?: CodexRpcCallOptions): Promise<CodexThreadUnsubscribeResponse>;
|
|
100
139
|
/** List threads with pagination and bounded filters (`thread/list`). */
|
|
101
|
-
listThreads(params?: CodexListThreadsParams): Promise<
|
|
140
|
+
listThreads(params?: CodexListThreadsParams, options?: CodexRpcCallOptions): Promise<CodexThreadsPage>;
|
|
102
141
|
/** List thread identifiers currently loaded in memory (`thread/loaded/list`). */
|
|
103
|
-
listLoadedThreads(params?: CodexListLoadedThreadsParams): Promise<
|
|
142
|
+
listLoadedThreads(params?: CodexListLoadedThreadsParams, options?: CodexRpcCallOptions): Promise<CodexLoadedThreadsPage>;
|
|
104
143
|
/** Archive a thread (`thread/archive`). */
|
|
105
|
-
archiveThread(params: CodexThreadIdParams): Promise<
|
|
144
|
+
archiveThread(params: CodexThreadIdParams, options?: CodexRpcCallOptions): Promise<void>;
|
|
106
145
|
/** Unarchive a thread (`thread/unarchive`). */
|
|
107
|
-
unarchiveThread(params: CodexThreadIdParams): Promise<
|
|
146
|
+
unarchiveThread(params: CodexThreadIdParams, options?: CodexRpcCallOptions): Promise<CodexThreadUnarchiveResponse>;
|
|
108
147
|
/** Patch stored metadata (such as Git info) for a thread (`thread/metadata/update`). */
|
|
109
|
-
updateThreadMetadata(params: CodexUpdateThreadMetadataParams): Promise<
|
|
148
|
+
updateThreadMetadata(params: CodexUpdateThreadMetadataParams, options?: CodexRpcCallOptions): Promise<CodexThreadMetadataUpdateResponse>;
|
|
110
149
|
/** Set a thread's display name (`thread/name/set`). */
|
|
111
|
-
setThreadName(params: CodexSetThreadNameParams): Promise<
|
|
150
|
+
setThreadName(params: CodexSetThreadNameParams, options?: CodexRpcCallOptions): Promise<void>;
|
|
151
|
+
/** Resume a thread (`thread/resume`, defaulting `excludeTurns` to `true`); returns the typed response without mutating a session's cached `threadContext`. */
|
|
152
|
+
resumeThread(params: CodexResumeThreadParams, options?: CodexRpcCallOptions): Promise<CodexResumeThreadResponse>;
|
|
153
|
+
/** Start a turn on any thread via `turn/start` without subscribing to deltas or occupying a local session turn slot. */
|
|
154
|
+
startThreadTurn(params: CodexControlStartTurnParams, options?: CodexRpcCallOptions): Promise<{
|
|
155
|
+
readonly turnId: string;
|
|
156
|
+
}>;
|
|
157
|
+
/** Interrupt a running turn on a thread (`turn/interrupt`), including external/TUI or reconnected turns. */
|
|
158
|
+
interruptTurn(params: CodexInterruptTurnParams, options?: CodexRpcCallOptions): Promise<void>;
|
|
159
|
+
/** Steer an active turn on a thread by explicit `expectedTurnId` (`turn/steer`). */
|
|
160
|
+
steerTurn(params: CodexControlSteerTurnParams, options?: CodexRpcCallOptions): Promise<{
|
|
161
|
+
readonly turnId: string;
|
|
162
|
+
}>;
|
|
163
|
+
/** Request context compaction for a thread (`thread/compact/start`). */
|
|
164
|
+
compactThread(params: CodexThreadIdParams, options?: CodexRpcCallOptions): Promise<void>;
|
|
112
165
|
}
|
|
113
166
|
/** Input to {@link CodexDriver.connectControl} for a threadless app-server connection. */
|
|
114
167
|
export interface CodexControlConnectInput {
|
|
115
168
|
readonly profile: ExecutorProfileConfig;
|
|
116
169
|
readonly cwd: string;
|
|
117
170
|
/** Optional observer invoked with startup phases (`spawning`, `initializing`) during connect. */
|
|
118
|
-
readonly onStartupPhase?: (phase: ExecutorStartupPhase) => void;
|
|
119
|
-
readonly signal?: AbortSignal;
|
|
171
|
+
readonly onStartupPhase?: ((phase: ExecutorStartupPhase) => void) | undefined;
|
|
172
|
+
readonly signal?: AbortSignal | undefined;
|
|
120
173
|
}
|
|
121
174
|
/** Threadless connection to a Codex app-server for catalog/config reads and external observation. */
|
|
122
175
|
export interface CodexControlConnection extends CodexControlClient {
|
|
123
176
|
/** OS process id of the spawned `codex app-server`, or `undefined` when attached via `unix-connect`. */
|
|
124
177
|
readonly providerPid: number | undefined;
|
|
178
|
+
/** Server-reported `userAgent` from the `initialize` response, or `undefined` when omitted. */
|
|
179
|
+
readonly userAgent: string | undefined;
|
|
125
180
|
/** Answer a pending external server request received via `onServerRequest`. */
|
|
126
181
|
respond(interactionId: string, reply: InteractionReply['reply']): Promise<void>;
|
|
127
182
|
/** Close the connection cleanly (does not kill an external server in `unix-connect` mode). */
|
|
128
183
|
close(): Promise<void>;
|
|
129
184
|
}
|
|
130
|
-
/** Create the read/inspection control facade backed by an active Codex JSON-RPC peer. */
|
|
185
|
+
/** Create the read/inspection and turn/thread control facade backed by an active Codex JSON-RPC peer. */
|
|
131
186
|
export declare function createCodexControlClient(input: {
|
|
132
187
|
peer: JsonRpcPeer;
|
|
188
|
+
imageOptions: DriverImageOptions;
|
|
189
|
+
signal: AbortSignal;
|
|
133
190
|
ensureAlive(): void;
|
|
191
|
+
onBeforeInterruptTurn?: (threadId: string, turnId: string) => void;
|
|
134
192
|
}): CodexControlClient;
|
|
135
|
-
/** Bind all thread-scoped {@link CodexControlClient} methods to default `threadId` to a session's `nativeThreadId`. */
|
|
136
|
-
export declare function bindCodexSessionThreadControls(controlClient: CodexControlClient, threadId: string): {
|
|
137
|
-
readThread(params?: Omit<CodexReadThreadParams, 'threadId'> & {
|
|
138
|
-
readonly threadId?: string;
|
|
139
|
-
}): Promise<import("zod").JSONType>;
|
|
140
|
-
listTurns(params?: Omit<CodexListTurnsParams, 'threadId'> & {
|
|
141
|
-
readonly threadId?: string;
|
|
142
|
-
}): Promise<import("zod").JSONType>;
|
|
143
|
-
listItems(params?: Omit<CodexListItemsParams, 'threadId'> & {
|
|
144
|
-
readonly threadId?: string;
|
|
145
|
-
}): Promise<import("zod").JSONType>;
|
|
146
|
-
revertThread(params: Omit<CodexRevertThreadParams, 'threadId'> & {
|
|
147
|
-
readonly threadId?: string;
|
|
148
|
-
}): Promise<CodexRevertThreadResult>;
|
|
149
|
-
injectItems(params: Omit<CodexInjectItemsParams, 'threadId'> & {
|
|
150
|
-
readonly threadId?: string;
|
|
151
|
-
}): Promise<import("zod").JSONType>;
|
|
152
|
-
unsubscribeThread(params?: {
|
|
153
|
-
readonly threadId?: string;
|
|
154
|
-
}): Promise<import("zod").JSONType>;
|
|
155
|
-
archiveThread(params?: {
|
|
156
|
-
readonly threadId?: string;
|
|
157
|
-
}): Promise<import("zod").JSONType>;
|
|
158
|
-
unarchiveThread(params?: {
|
|
159
|
-
readonly threadId?: string;
|
|
160
|
-
}): Promise<import("zod").JSONType>;
|
|
161
|
-
updateThreadMetadata(params?: Omit<CodexUpdateThreadMetadataParams, 'threadId'> & {
|
|
162
|
-
readonly threadId?: string;
|
|
163
|
-
}): Promise<import("zod").JSONType>;
|
|
164
|
-
setThreadName(params: Omit<CodexSetThreadNameParams, 'threadId'> & {
|
|
165
|
-
readonly threadId?: string;
|
|
166
|
-
}): Promise<import("zod").JSONType>;
|
|
167
|
-
};
|
|
168
193
|
//# sourceMappingURL=control-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-client.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/control-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"control-client.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/control-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,KAAK,EAAE,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
3
|
+
import { type CodexRpcCallOptions } from './thread-controls.js';
|
|
4
|
+
type CodexRpcCaller = (method: string, params?: Record<string, JsonRpcValue>, rpcOptions?: CodexRpcCallOptions) => Promise<JsonRpcValue>;
|
|
5
|
+
export declare function createCodexReadMethods(call: CodexRpcCaller): Pick<CodexControlClient, 'readConfig' | 'readThread' | 'listCollaborationModes' | 'listTurns' | 'listItems' | 'listMcpServerStatus' | 'listSkills' | 'listModels' | 'readAccount' | 'readRateLimits'>;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=control-read-methods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-read-methods.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/control-read-methods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,kBAAkB,EAA0B,MAAM,kBAAkB,CAAC;AAanF,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAE3B,KAAK,cAAc,GAAG,CACpB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,EACrC,UAAU,CAAC,EAAE,mBAAmB,KAC7B,OAAO,CAAC,YAAY,CAAC,CAAC;AAyB3B,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,cAAc,GACnB,IAAI,CACL,kBAAkB,EAChB,YAAY,GACZ,YAAY,GACZ,wBAAwB,GACxB,WAAW,GACX,WAAW,GACX,qBAAqB,GACrB,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,gBAAgB,CACnB,CAuKA"}
|
|
@@ -1,88 +1,99 @@
|
|
|
1
1
|
import type { JsonRpcValue } from '../json-rpc-peer.js';
|
|
2
2
|
import { type CodexTransportConfig } from './connect.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type CodexControlClient } from './control-client.js';
|
|
4
4
|
import type { CodexNotificationEvent, CodexServerRequestEvent } from './handlers.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import type { CodexApprovalPolicy, CodexSandboxMode, CodexThreadContext } from './protocol.js';
|
|
6
|
+
import type { CodexDriver, CodexOpenForkOptions, CodexThreadPolicyOverrides } from './session-types.js';
|
|
7
7
|
/** Configuration for {@link createCodexDriver}. */
|
|
8
8
|
export interface CodexDriverConfig {
|
|
9
9
|
/** The CLI to run. Default `codex`, found on the engine's `PATH`. */
|
|
10
|
-
executable?: string;
|
|
10
|
+
executable?: string | undefined;
|
|
11
11
|
/** Arguments before the driver's own — a runtime running a script, as a fake engine is run. */
|
|
12
|
-
prefixArgs?: readonly string[];
|
|
12
|
+
prefixArgs?: readonly string[] | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* Transport for `codex app-server`: `'stdio'` (default), `'unix-listen'` (spawns with
|
|
15
15
|
* `--listen unix://<path>` so another client can attach to the same writer), or
|
|
16
16
|
* `'unix-connect'` (attaches to an existing app-server without owning its lifecycle).
|
|
17
17
|
*/
|
|
18
|
-
transport?: CodexTransportConfig;
|
|
18
|
+
transport?: CodexTransportConfig | undefined;
|
|
19
19
|
/** Additional CLI arguments appended to `codex app-server` (for example `-c` overrides); must not include `--listen` or `--stdio`. */
|
|
20
|
-
serverArgs?: readonly string[];
|
|
20
|
+
serverArgs?: readonly string[] | undefined;
|
|
21
21
|
/** Default model id passed to `thread/start` and `thread/resume`. */
|
|
22
|
-
model?: string;
|
|
22
|
+
model?: string | undefined;
|
|
23
23
|
/** Default model provider passed to `thread/start` and `thread/resume`. */
|
|
24
|
-
modelProvider?: string;
|
|
24
|
+
modelProvider?: string | undefined;
|
|
25
25
|
/** `approvalPolicy` of a new or resumed thread. Default `on-request`: the engine asks the host. */
|
|
26
|
-
approvalPolicy?: CodexApprovalPolicy;
|
|
26
|
+
approvalPolicy?: CodexApprovalPolicy | undefined;
|
|
27
27
|
/** `sandbox` of a new or resumed thread. Default `workspace-write`. */
|
|
28
|
-
sandbox?: CodexSandboxMode;
|
|
28
|
+
sandbox?: CodexSandboxMode | undefined;
|
|
29
29
|
/** Developer instructions passed to `thread/start` and `thread/resume`. */
|
|
30
|
-
developerInstructions?: string;
|
|
30
|
+
developerInstructions?: string | undefined;
|
|
31
31
|
/** Additional workspace roots allowed for runtime filesystem access on the thread. */
|
|
32
|
-
runtimeWorkspaceRoots?: readonly string[];
|
|
32
|
+
runtimeWorkspaceRoots?: readonly string[] | undefined;
|
|
33
33
|
/** Codex app-server config overrides passed on `thread/start` and `thread/resume` (writable roots, disabled MCP/plugins/features, network policy). */
|
|
34
|
-
config?: Readonly<Record<string, JsonRpcValue
|
|
34
|
+
config?: Readonly<Record<string, JsonRpcValue>> | undefined;
|
|
35
35
|
/**
|
|
36
36
|
* Optional hook invoked after `initialize` and before `thread/start` or `thread/resume`.
|
|
37
37
|
* May inspect server state (`readConfig`, `listModels`, etc.) and return dynamic per-thread policy overrides;
|
|
38
38
|
* throwing stops the connection cleanly before opening the thread.
|
|
39
39
|
*/
|
|
40
|
-
prepareThread?: (context: {
|
|
40
|
+
prepareThread?: ((context: {
|
|
41
41
|
readonly controls: CodexControlClient;
|
|
42
42
|
readonly cwd: string;
|
|
43
|
-
readonly nativeThreadId?: string;
|
|
44
|
-
readonly forkFrom?: CodexOpenForkOptions;
|
|
45
|
-
}) => Promise<CodexThreadPolicyOverrides | undefined> | CodexThreadPolicyOverrides | undefined;
|
|
43
|
+
readonly nativeThreadId?: string | undefined;
|
|
44
|
+
readonly forkFrom?: CodexOpenForkOptions | undefined;
|
|
45
|
+
}) => Promise<CodexThreadPolicyOverrides | undefined> | CodexThreadPolicyOverrides | undefined) | undefined;
|
|
46
46
|
/**
|
|
47
47
|
* Optional hook invoked immediately after `thread/start`, `thread/resume`, or `thread/fork` succeeds.
|
|
48
48
|
* May inspect the applied `threadContext` or call `listMcpServerStatus`/`listSkills`;
|
|
49
49
|
* throwing fails `open()` and stops the connection cleanly.
|
|
50
50
|
*/
|
|
51
|
-
verifyThread?: (context: {
|
|
51
|
+
verifyThread?: ((context: {
|
|
52
52
|
readonly nativeThreadId: string;
|
|
53
53
|
readonly threadContext: CodexThreadContext;
|
|
54
54
|
readonly controls: CodexControlClient;
|
|
55
|
-
}) => Promise<void> | void;
|
|
55
|
+
}) => Promise<void> | void) | undefined;
|
|
56
56
|
/**
|
|
57
57
|
* Optional observer invoked for every Codex app-server notification (both during `startTurn()`
|
|
58
58
|
* and for external/TUI turns or lifecycle updates like `thread/status/changed` and `turn/started`).
|
|
59
59
|
*/
|
|
60
|
-
onNotification?: (event: CodexNotificationEvent) => void;
|
|
60
|
+
onNotification?: ((event: CodexNotificationEvent) => void) | undefined;
|
|
61
61
|
/**
|
|
62
62
|
* Optional handler for known server requests (`commandExecution`, `fileChange`, `permissions`
|
|
63
|
-
* approvals, `requestUserInput`, and `mcpServer/elicitation/request`)
|
|
64
|
-
* outside
|
|
63
|
+
* approvals, `requestUserInput`, and `mcpServer/elicitation/request`). By default invoked only
|
|
64
|
+
* outside `startTurn()` (for example from an attached TUI client); set `serverRequestDelivery: 'all'`
|
|
65
|
+
* to also deliver requests arriving during a driver-initiated `startTurn()`.
|
|
65
66
|
* When omitted, requests outside `startTurn()` are refused `-32601`.
|
|
66
67
|
*/
|
|
67
|
-
onServerRequest?: (event: CodexServerRequestEvent) => void;
|
|
68
|
+
onServerRequest?: ((event: CodexServerRequestEvent) => void) | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Controls which server requests reach `onServerRequest`: `'external-only'` (default, only
|
|
71
|
+
* requests outside `startTurn()`) or `'all'` (also notifies `onServerRequest` during active
|
|
72
|
+
* `startTurn()` runs with `duringActiveTurn: true`, backed by the same single-shot `turn.pending`
|
|
73
|
+
* slot). Setting `'all'` requires `onServerRequest`.
|
|
74
|
+
*/
|
|
75
|
+
serverRequestDelivery?: 'external-only' | 'all' | undefined;
|
|
68
76
|
/**
|
|
69
77
|
* Optional callback invoked immediately when an established session or control connection drops
|
|
70
78
|
* unexpectedly before `close()` or caller signal abort (including idle socket disconnects).
|
|
71
79
|
*/
|
|
72
|
-
onDisconnect?: (error: Error) => void;
|
|
80
|
+
onDisconnect?: ((error: Error) => void) | undefined;
|
|
81
|
+
/** Maximum incoming JSON-RPC frame/line size in bytes (WebSocket default 16 MiB, stdio default 8 MiB). */
|
|
82
|
+
maxFrameBytes?: number | undefined;
|
|
73
83
|
/** Read the bytes behind a `file` part's `reference`; without it a file part is refused. */
|
|
74
|
-
resolveFile?: (reference: string) => Promise<Uint8Array
|
|
84
|
+
resolveFile?: ((reference: string) => Promise<Uint8Array>) | undefined;
|
|
75
85
|
/** Maximum decoded size of one image attachment in bytes. Default 5 MiB. */
|
|
76
|
-
maxImageBytes?: number;
|
|
77
|
-
|
|
86
|
+
maxImageBytes?: number | undefined;
|
|
87
|
+
/** Environment variables inherited by the spawned Codex CLI process. */
|
|
88
|
+
ambient?: Readonly<Record<string, string | undefined>> | undefined;
|
|
78
89
|
}
|
|
79
90
|
/**
|
|
80
91
|
* Codex through its app-server over stdio or WebSocket-over-Unix-socket: a thread
|
|
81
92
|
* per session, policy and delegation overrides, `turn/start` under the executor's
|
|
82
93
|
* `clientUserMessageId`, per-turn overrides, live session controls (`turn/steer`,
|
|
83
|
-
* `thread/fork`, `thread/compact/start`,
|
|
84
|
-
* multi-bucket `account/rateLimits/read`,
|
|
85
|
-
* `thread/turns/list`.
|
|
94
|
+
* `turn/interrupt`, `thread/resume`, `thread/fork`, `thread/compact/start`,
|
|
95
|
+
* config/MCP/skills/models/account reads), multi-bucket `account/rateLimits/read`,
|
|
96
|
+
* and reconcile by client id in `thread/turns/list`.
|
|
86
97
|
*/
|
|
87
98
|
export declare function createCodexDriver(config?: CodexDriverConfig): CodexDriver;
|
|
88
99
|
//# sourceMappingURL=driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/driver.ts"],"names":[],"mappings":"
|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A4F;IAC5F,WAAW,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,SAAS,CAAC;IACvE,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,wEAAwE;IACxE,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC;CACpE;AA6ED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,iBAAsB,GAAG,WAAW,CAkL7E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { JsonRpcValue } from '../json-rpc-peer.js';
|
|
2
|
+
import type { CodexTurnSlot } from './request-answers.js';
|
|
3
|
+
export declare function codexThreadIdOf(params: unknown): string | undefined;
|
|
4
|
+
export declare function codexTurnIdOf(params: unknown): string | undefined;
|
|
5
|
+
/** Hold candidate events only until the authoritative turn/start reply identifies their owner. */
|
|
6
|
+
export declare class CodexStartingTurn {
|
|
7
|
+
private readonly waiting;
|
|
8
|
+
private bytes;
|
|
9
|
+
private failure?;
|
|
10
|
+
defer(params: JsonRpcValue | undefined, deliver: () => void): void;
|
|
11
|
+
flush(): void;
|
|
12
|
+
}
|
|
13
|
+
export declare function codexEventTurn(current: CodexTurnSlot | undefined, params: unknown): CodexTurnSlot | undefined;
|
|
14
|
+
//# sourceMappingURL=event-routing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-routing.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/event-routing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMvD,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAQnE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAGjE;AAED,kGAAkG;AAClG,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IACjD,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,OAAO,CAAC,CAAQ;IAExB,KAAK,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI,CAQjE;IAED,KAAK,IAAI,IAAI,CAGZ;CACF;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,MAAM,EAAE,OAAO,GACd,aAAa,GAAG,SAAS,CAiB3B"}
|
|
@@ -14,19 +14,23 @@ export interface CodexNotificationEvent {
|
|
|
14
14
|
/** Normalized executor deltas produced by the classifier, including for external/TUI turns. */
|
|
15
15
|
readonly deltas: readonly ExecutorDelta[];
|
|
16
16
|
}
|
|
17
|
-
/** Server request received from Codex outside
|
|
17
|
+
/** Server request received from Codex (outside `startTurn()`, or also during `startTurn()` when `serverRequestDelivery` is `'all'`). */
|
|
18
18
|
export interface CodexServerRequestEvent {
|
|
19
19
|
/** JSON-RPC request identifier as a string, also carried on `delta.interactionId`. */
|
|
20
20
|
readonly interactionId: string;
|
|
21
|
+
/** Original JSON-RPC request identifier preserving numeric vs string wire type. */
|
|
22
|
+
readonly requestId: string | number;
|
|
21
23
|
/** Codex server request method (`requestApproval`, `requestUserInput`, or `mcpServer/elicitation/request`). */
|
|
22
24
|
readonly method: CodexServerRequestMethod;
|
|
23
25
|
/** Raw JSON-RPC request params as received from the server. */
|
|
24
26
|
readonly params: JsonRpcValue | undefined;
|
|
27
|
+
/** `true` when a driver-initiated `startTurn()` owned the thread as this request arrived. */
|
|
28
|
+
readonly duringActiveTurn: boolean;
|
|
25
29
|
/** Normalized executor `request` delta preserving approval, permissions, question, or elicitation metadata. */
|
|
26
30
|
readonly delta: Extract<ExecutorDelta, {
|
|
27
31
|
type: 'request';
|
|
28
32
|
}>;
|
|
29
|
-
/** Answer this
|
|
33
|
+
/** Answer this server request once; throws `TypeError` if already resolved or invalid. */
|
|
30
34
|
respond(reply: InteractionReply['reply']): Promise<void>;
|
|
31
35
|
}
|
|
32
36
|
interface CodexHandlersState {
|
|
@@ -37,11 +41,12 @@ interface CodexHandlersState {
|
|
|
37
41
|
clearTurn: () => void;
|
|
38
42
|
onNotification?: (event: CodexNotificationEvent) => void;
|
|
39
43
|
onServerRequest?: (event: CodexServerRequestEvent) => void;
|
|
44
|
+
serverRequestDelivery?: 'external-only' | 'all';
|
|
40
45
|
}
|
|
41
46
|
/** Create JSON-RPC notification and server-request handlers for a Codex session or control link. */
|
|
42
47
|
export declare function createCodexHandlers(state: CodexHandlersState): {
|
|
43
|
-
onNotification
|
|
44
|
-
onRequest
|
|
48
|
+
onNotification(method: string, params: JsonRpcValue | undefined): void;
|
|
49
|
+
onRequest(method: string, params: JsonRpcValue | undefined, id: string | number): Promise<import("zod").JSONType>;
|
|
45
50
|
};
|
|
46
51
|
export {};
|
|
47
52
|
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/handlers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAA2C,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAG9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/handlers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,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AAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAChC,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;IAC1D,OAAO,EAAE,MAAM,aAAa,GAAG,SAAS,CAAC;IACzC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzD,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC3D,qBAAqB,CAAC,EAAE,eAAe,GAAG,KAAK,CAAC;CACjD;AAyQD,oGAAoG;AACpG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB;IAEzD,cAAc,SAAS,MAAM,UAAU,YAAY,GAAG,SAAS;IAM/D,SAAS,SAAS,MAAM,UAAU,YAAY,GAAG,SAAS,MAAM,MAAM,GAAG,MAAM;EAelF"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type PlanWindow } from '../hello.js';
|
|
1
|
+
import { type PlanLimits, type PlanWindow } from '../hello.js';
|
|
2
2
|
/**
|
|
3
|
-
* Normalize Codex's `account/rateLimits/read` envelope (
|
|
4
|
-
* `
|
|
3
|
+
* Normalize Codex's `account/rateLimits/read` envelope (camelCase or snake_case rollout
|
|
4
|
+
* `token_count` payloads, including multi-bucket `rateLimitsByLimitId`) or a single
|
|
5
|
+
* `RateLimitSnapshot` into {@link PlanWindow} entries.
|
|
5
6
|
*
|
|
6
7
|
* Each window is keyed as `<limitId|limit>:<windowDurationMins>m` (falling back to
|
|
7
8
|
* `<limitId|limit>:<slot>` when duration is absent, or adding `:<slot>` when both slots
|
|
@@ -10,4 +11,9 @@ import { type PlanWindow } from '../hello.js';
|
|
|
10
11
|
* deterministically, and the list is capped at 32 windows to match {@link PlanWindowSchema}.
|
|
11
12
|
*/
|
|
12
13
|
export declare function codexPlanWindows(reported: unknown): PlanWindow[];
|
|
14
|
+
/**
|
|
15
|
+
* Normalize a Codex `account/rateLimits/read` response or rollout `token_count` payload into a
|
|
16
|
+
* complete {@link PlanLimits} snapshot, preserving `plan` (`planType` / `plan_type`) when present.
|
|
17
|
+
*/
|
|
18
|
+
export declare function codexPlanLimits(reported: unknown, now?: Date): PlanLimits;
|
|
13
19
|
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/limits.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/codex/limits.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,UAAU,EAEhB,MAAM,UAAU,CAAC;AAkMlB;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,UAAU,EAAE,CAEhE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,GAAE,IAAiB,GAAG,UAAU,CAQrF"}
|