@gkorepanov/ccodex 0.3.0 → 0.3.4
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/README.md +27 -9
- package/RELEASING.md +14 -15
- package/SSH_VERIFY.md +11 -0
- package/archive/README.md +23 -0
- package/compatibility.json +1 -2
- package/config.example.toml +12 -4
- package/dist/claude/asyncQueue.d.ts +3 -0
- package/dist/claude/asyncQueue.js +13 -2
- package/dist/claude/asyncQueue.js.map +1 -1
- package/dist/claude/commandActions.d.ts +6 -0
- package/dist/claude/commandActions.js +57 -0
- package/dist/claude/commandActions.js.map +1 -0
- package/dist/claude/compactCommand.d.ts +2 -0
- package/dist/claude/compactCommand.js +7 -0
- package/dist/claude/compactCommand.js.map +1 -0
- package/dist/claude/goalTools.d.ts +15 -0
- package/dist/claude/goalTools.js +173 -0
- package/dist/claude/goalTools.js.map +1 -0
- package/dist/claude/hookMapper.d.ts +17 -4
- package/dist/claude/hookMapper.js +7 -5
- package/dist/claude/hookMapper.js.map +1 -1
- package/dist/claude/rateLimits.d.ts +72 -0
- package/dist/claude/rateLimits.js +330 -0
- package/dist/claude/rateLimits.js.map +1 -0
- package/dist/claude/responseItemValidation.d.ts +2 -0
- package/dist/claude/responseItemValidation.js +40 -0
- package/dist/claude/responseItemValidation.js.map +1 -0
- package/dist/claude/resultClassifier.d.ts +8 -2
- package/dist/claude/resultClassifier.js +1 -1
- package/dist/claude/resultClassifier.js.map +1 -1
- package/dist/claude/service.d.ts +108 -28
- package/dist/claude/service.js +1276 -668
- package/dist/claude/service.js.map +1 -1
- package/dist/claude/session/backgroundOutput.d.ts +2 -0
- package/dist/claude/session/backgroundOutput.js +29 -0
- package/dist/claude/session/backgroundOutput.js.map +1 -0
- package/dist/claude/session/commands.d.ts +855 -0
- package/dist/claude/session/commands.js +2 -0
- package/dist/claude/session/commands.js.map +1 -0
- package/dist/claude/session/goalState.d.ts +49 -0
- package/dist/claude/session/goalState.js +407 -0
- package/dist/claude/session/goalState.js.map +1 -0
- package/dist/claude/session/mailbox.d.ts +52 -0
- package/dist/claude/session/mailbox.js +190 -0
- package/dist/claude/session/mailbox.js.map +1 -0
- package/dist/claude/session/outputAdapter.d.ts +11 -0
- package/dist/claude/session/outputAdapter.js +31 -0
- package/dist/claude/session/outputAdapter.js.map +1 -0
- package/dist/claude/session/providerFacts.d.ts +47 -0
- package/dist/claude/session/providerFacts.js +84 -0
- package/dist/claude/session/providerFacts.js.map +1 -0
- package/dist/claude/session/providerRuntime.d.ts +1 -0
- package/dist/claude/session/providerRuntime.js +2 -0
- package/dist/claude/session/providerRuntime.js.map +1 -0
- package/dist/claude/session/providerRuntimeFactory.d.ts +49 -0
- package/dist/claude/session/providerRuntimeFactory.js +127 -0
- package/dist/claude/session/providerRuntimeFactory.js.map +1 -0
- package/dist/claude/session/repository.d.ts +57 -0
- package/dist/claude/session/repository.js +161 -0
- package/dist/claude/session/repository.js.map +1 -0
- package/dist/claude/session/runtime.d.ts +46 -0
- package/dist/claude/session/runtime.js +140 -0
- package/dist/claude/session/runtime.js.map +1 -0
- package/dist/claude/session/scopeState.d.ts +61 -0
- package/dist/claude/session/scopeState.js +74 -0
- package/dist/claude/session/scopeState.js.map +1 -0
- package/dist/claude/session/session.d.ts +281 -0
- package/dist/claude/session/session.js +6664 -0
- package/dist/claude/session/session.js.map +1 -0
- package/dist/claude/session/shellRunner.d.ts +13 -0
- package/dist/claude/session/shellRunner.js +103 -0
- package/dist/claude/session/shellRunner.js.map +1 -0
- package/dist/claude/session/usage.d.ts +2 -0
- package/dist/claude/session/usage.js +10 -0
- package/dist/claude/session/usage.js.map +1 -0
- package/dist/claude/sessionRegistry.d.ts +26 -0
- package/dist/claude/sessionRegistry.js +118 -0
- package/dist/claude/sessionRegistry.js.map +1 -0
- package/dist/claude/shellSupervisor.d.ts +1 -0
- package/dist/claude/shellSupervisor.js +69 -0
- package/dist/claude/shellSupervisor.js.map +1 -0
- package/dist/claude/statusCommand.d.ts +21 -0
- package/dist/claude/statusCommand.js +97 -0
- package/dist/claude/statusCommand.js.map +1 -0
- package/dist/claude/toolMapper.d.ts +9 -1
- package/dist/claude/toolMapper.js +92 -16
- package/dist/claude/toolMapper.js.map +1 -1
- package/dist/claude/transcriptBrancher.d.ts +37 -0
- package/dist/claude/transcriptBrancher.js +103 -0
- package/dist/claude/transcriptBrancher.js.map +1 -0
- package/dist/cli/delegate.js +23 -1
- package/dist/cli/delegate.js.map +1 -1
- package/dist/cli/main.js +28 -12
- package/dist/cli/main.js.map +1 -1
- package/dist/codex/generated/ResponseItemRuntimeSchema.d.ts +8 -0
- package/dist/codex/generated/ResponseItemRuntimeSchema.js +7 -0
- package/dist/codex/generated/ResponseItemRuntimeSchema.js.map +1 -0
- package/dist/compatibility/probe.js +11 -6
- package/dist/compatibility/probe.js.map +1 -1
- package/dist/config/config.d.ts +9 -0
- package/dist/config/config.js +80 -11
- package/dist/config/config.js.map +1 -1
- package/dist/daemon/daemon.js +91 -43
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/ownership.d.ts +15 -0
- package/dist/daemon/ownership.js +185 -0
- package/dist/daemon/ownership.js.map +1 -0
- package/dist/daemon/supervisor.d.ts +3 -0
- package/dist/daemon/supervisor.js +37 -1
- package/dist/daemon/supervisor.js.map +1 -1
- package/dist/gateway/clientConnection.d.ts +7 -1
- package/dist/gateway/clientConnection.js +435 -48
- package/dist/gateway/clientConnection.js.map +1 -1
- package/dist/gateway/remoteRelay.js +0 -1
- package/dist/gateway/remoteRelay.js.map +1 -1
- package/dist/gateway/server.d.ts +1 -1
- package/dist/gateway/server.js +37 -9
- package/dist/gateway/server.js.map +1 -1
- package/dist/gateway/subscriptions.d.ts +9 -2
- package/dist/gateway/subscriptions.js +87 -9
- package/dist/gateway/subscriptions.js.map +1 -1
- package/dist/gateway/transientNotice.d.ts +2 -0
- package/dist/gateway/transientNotice.js +42 -1
- package/dist/gateway/transientNotice.js.map +1 -1
- package/dist/handoff/service.d.ts +32 -3
- package/dist/handoff/service.js +304 -26
- package/dist/handoff/service.js.map +1 -1
- package/dist/handoff/titleGeneration.d.ts +28 -0
- package/dist/handoff/titleGeneration.js +151 -0
- package/dist/handoff/titleGeneration.js.map +1 -0
- package/dist/management/doctor.d.ts +1 -1
- package/dist/management/doctor.js +32 -23
- package/dist/management/doctor.js.map +1 -1
- package/dist/management/lifecycle.js +14 -2
- package/dist/management/lifecycle.js.map +1 -1
- package/dist/management/remoteShim.d.ts +10 -0
- package/dist/management/remoteShim.js +65 -0
- package/dist/management/remoteShim.js.map +1 -0
- package/dist/management/setup.d.ts +4 -0
- package/dist/management/setup.js +108 -39
- package/dist/management/setup.js.map +1 -1
- package/dist/observability/metrics.d.ts +2 -0
- package/dist/observability/metrics.js +6 -0
- package/dist/observability/metrics.js.map +1 -1
- package/dist/protocol/errors.d.ts +1 -0
- package/dist/protocol/errors.js +4 -1
- package/dist/protocol/errors.js.map +1 -1
- package/dist/runtime/dependencies.js +2 -2
- package/dist/runtime/dependencies.js.map +1 -1
- package/dist/runtime/providerAvailability.d.ts +24 -0
- package/dist/runtime/providerAvailability.js +107 -0
- package/dist/runtime/providerAvailability.js.map +1 -0
- package/dist/state/stateCommand.d.ts +21 -0
- package/dist/state/stateCommand.js +198 -0
- package/dist/state/stateCommand.js.map +1 -0
- package/dist/state/stockStateTracker.d.ts +14 -0
- package/dist/state/stockStateTracker.js +120 -0
- package/dist/state/stockStateTracker.js.map +1 -0
- package/dist/store/HybridStore.d.ts +118 -2
- package/dist/store/HybridStore.js +23 -1
- package/dist/store/HybridStore.js.map +1 -1
- package/dist/store/memoryStore.d.ts +57 -7
- package/dist/store/memoryStore.js +337 -5
- package/dist/store/memoryStore.js.map +1 -1
- package/dist/store/sqliteStore.d.ts +30 -4
- package/dist/store/sqliteStore.js +395 -42
- package/dist/store/sqliteStore.js.map +1 -1
- package/install.sh +2 -2
- package/package.json +18 -10
- package/dist/claude/interactions.d.ts +0 -23
- package/dist/claude/interactions.js +0 -77
- package/dist/claude/interactions.js.map +0 -1
- package/dist/claude/sessionRuntime.d.ts +0 -102
- package/dist/claude/sessionRuntime.js +0 -1361
- package/dist/claude/sessionRuntime.js.map +0 -1
- /package/{BUILD_BENCHMARKS.md → archive/BUILD_BENCHMARKS.md} +0 -0
|
@@ -0,0 +1,855 @@
|
|
|
1
|
+
import type { Turn } from "../../codex/generated/v2/Turn.js";
|
|
2
|
+
import type { Thread } from "../../codex/generated/v2/Thread.js";
|
|
3
|
+
import type { ThreadItem } from "../../codex/generated/v2/ThreadItem.js";
|
|
4
|
+
import type { TurnStartParams } from "../../codex/generated/v2/TurnStartParams.js";
|
|
5
|
+
import type { CodexErrorInfo } from "../../codex/generated/v2/CodexErrorInfo.js";
|
|
6
|
+
import type { TokenUsageBreakdown } from "../../codex/generated/v2/TokenUsageBreakdown.js";
|
|
7
|
+
import type { ThreadSettings } from "../../codex/generated/v2/ThreadSettings.js";
|
|
8
|
+
import type { ThreadGoal } from "../../codex/generated/v2/ThreadGoal.js";
|
|
9
|
+
import type { ThreadGoalSetParams } from "../../codex/generated/v2/ThreadGoalSetParams.js";
|
|
10
|
+
import type { ThreadMetadataUpdateParams } from "../../codex/generated/v2/ThreadMetadataUpdateParams.js";
|
|
11
|
+
import type { JsonValue } from "../../codex/generated/serde_json/JsonValue.js";
|
|
12
|
+
import type { ClaudeThreadRecord, InternalGoal, ProviderEventDisposition } from "../../store/HybridStore.js";
|
|
13
|
+
import type { TurnProviderBoundary } from "../../store/HybridStore.js";
|
|
14
|
+
import type { ActiveTool } from "../toolMapper.js";
|
|
15
|
+
import type { ClaudeResultInput } from "../resultClassifier.js";
|
|
16
|
+
export interface SessionBranchSnapshot {
|
|
17
|
+
readonly record: ClaudeThreadRecord;
|
|
18
|
+
readonly boundaries: readonly TurnProviderBoundary[];
|
|
19
|
+
readonly revision: string;
|
|
20
|
+
}
|
|
21
|
+
export interface DesiredSettingsUpdate {
|
|
22
|
+
readonly record: ClaudeThreadRecord;
|
|
23
|
+
readonly changed: boolean;
|
|
24
|
+
readonly conflict: boolean;
|
|
25
|
+
readonly replacementId?: string;
|
|
26
|
+
readonly replay?: {
|
|
27
|
+
readonly resume: boolean;
|
|
28
|
+
readonly batches: JsonValue[][];
|
|
29
|
+
};
|
|
30
|
+
readonly retryAfter?: Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export interface PreparedSessionTurn {
|
|
33
|
+
readonly record: ClaudeThreadRecord;
|
|
34
|
+
readonly turn: Turn;
|
|
35
|
+
}
|
|
36
|
+
export interface RuntimeFactSource {
|
|
37
|
+
readonly providerEventId: string | null;
|
|
38
|
+
readonly providerEventType: string | null;
|
|
39
|
+
}
|
|
40
|
+
export interface ProviderEventAdmission {
|
|
41
|
+
readonly sequence: number;
|
|
42
|
+
readonly source: RuntimeFactSource;
|
|
43
|
+
readonly project: boolean;
|
|
44
|
+
readonly finish: boolean;
|
|
45
|
+
readonly activeTurnId: string | null;
|
|
46
|
+
readonly readOnly: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface RuntimeInspection {
|
|
49
|
+
readonly activeTurnId: string | null;
|
|
50
|
+
readonly lastCompletedTurnId: string | null;
|
|
51
|
+
readonly modelContextWindow: number | null;
|
|
52
|
+
readonly interruptible: boolean;
|
|
53
|
+
readonly ownerThreadId: string;
|
|
54
|
+
readonly ownerTurnId: string | null;
|
|
55
|
+
readonly taskIds: readonly string[];
|
|
56
|
+
readonly childThreadId: string | null;
|
|
57
|
+
readonly taskId: string | null;
|
|
58
|
+
readonly quiescent: boolean;
|
|
59
|
+
readonly canRestartEphemeral: boolean;
|
|
60
|
+
readonly readOnly: boolean;
|
|
61
|
+
readonly lastActivityMs: number;
|
|
62
|
+
}
|
|
63
|
+
export interface RuntimeInputAction {
|
|
64
|
+
readonly messageUuid: string;
|
|
65
|
+
readonly turnId: string | null;
|
|
66
|
+
}
|
|
67
|
+
export interface RuntimeTransportSettings {
|
|
68
|
+
readonly cwd: string;
|
|
69
|
+
readonly model: string;
|
|
70
|
+
readonly settingsGeneration: number;
|
|
71
|
+
readonly approvalPolicy: unknown;
|
|
72
|
+
readonly approvalsReviewer: string;
|
|
73
|
+
readonly sandboxPolicy: unknown;
|
|
74
|
+
readonly serviceTier: string | null;
|
|
75
|
+
readonly reasoningEffort: string | null;
|
|
76
|
+
readonly reasoningSummary: string | null;
|
|
77
|
+
readonly collaborationMode: unknown | null;
|
|
78
|
+
}
|
|
79
|
+
export type RuntimeTurnStage = {
|
|
80
|
+
readonly kind: "staged";
|
|
81
|
+
} | {
|
|
82
|
+
readonly kind: "busy";
|
|
83
|
+
} | {
|
|
84
|
+
readonly kind: "stale";
|
|
85
|
+
readonly reason: "runtime" | "settings";
|
|
86
|
+
readonly settings: RuntimeTransportSettings;
|
|
87
|
+
};
|
|
88
|
+
export type MainStreamFact = {
|
|
89
|
+
readonly kind: "messageStart";
|
|
90
|
+
} | {
|
|
91
|
+
readonly kind: "blockStart";
|
|
92
|
+
readonly index: number;
|
|
93
|
+
readonly block: "text" | "reasoning";
|
|
94
|
+
} | {
|
|
95
|
+
readonly kind: "blockDelta";
|
|
96
|
+
readonly index: number;
|
|
97
|
+
readonly block: "text" | "reasoning";
|
|
98
|
+
readonly delta: string;
|
|
99
|
+
} | {
|
|
100
|
+
readonly kind: "blockStop";
|
|
101
|
+
readonly index: number;
|
|
102
|
+
} | {
|
|
103
|
+
readonly kind: "assistant";
|
|
104
|
+
readonly blocks: readonly ({
|
|
105
|
+
readonly block: "text" | "reasoning";
|
|
106
|
+
readonly text: string;
|
|
107
|
+
} | null)[];
|
|
108
|
+
readonly completeAsCommentary: boolean;
|
|
109
|
+
} | {
|
|
110
|
+
readonly kind: "instantAgent";
|
|
111
|
+
readonly text: string;
|
|
112
|
+
} | {
|
|
113
|
+
readonly kind: "settle";
|
|
114
|
+
readonly phase: "commentary" | "final_answer";
|
|
115
|
+
} | {
|
|
116
|
+
readonly kind: "finish";
|
|
117
|
+
} | {
|
|
118
|
+
readonly kind: "toolStart";
|
|
119
|
+
readonly index: number;
|
|
120
|
+
readonly block: Record<string, unknown>;
|
|
121
|
+
} | {
|
|
122
|
+
readonly kind: "toolInput";
|
|
123
|
+
readonly index: number;
|
|
124
|
+
readonly delta: string;
|
|
125
|
+
} | {
|
|
126
|
+
readonly kind: "toolPrepare";
|
|
127
|
+
readonly providerId: string;
|
|
128
|
+
readonly name: string;
|
|
129
|
+
readonly input: Record<string, unknown>;
|
|
130
|
+
} | {
|
|
131
|
+
readonly kind: "toolBegin";
|
|
132
|
+
readonly providerId: string;
|
|
133
|
+
readonly remember: boolean;
|
|
134
|
+
} | {
|
|
135
|
+
readonly kind: "toolFiles";
|
|
136
|
+
readonly providerId: string;
|
|
137
|
+
readonly changes: Extract<ThreadItem, {
|
|
138
|
+
type: "fileChange";
|
|
139
|
+
}>["changes"];
|
|
140
|
+
} | {
|
|
141
|
+
readonly kind: "toolComplete";
|
|
142
|
+
readonly providerId: string;
|
|
143
|
+
readonly output: string;
|
|
144
|
+
readonly isError: boolean;
|
|
145
|
+
readonly result?: Record<string, unknown>;
|
|
146
|
+
} | {
|
|
147
|
+
readonly kind: "toolProgress";
|
|
148
|
+
readonly providerId: string;
|
|
149
|
+
readonly elapsedMs: number;
|
|
150
|
+
} | {
|
|
151
|
+
readonly kind: "taskStart";
|
|
152
|
+
readonly taskId: string;
|
|
153
|
+
readonly providerId?: string;
|
|
154
|
+
readonly description: string;
|
|
155
|
+
readonly prompt?: string;
|
|
156
|
+
readonly subagentType?: string;
|
|
157
|
+
readonly taskType?: string;
|
|
158
|
+
readonly outputFile?: string;
|
|
159
|
+
readonly confirmed?: boolean;
|
|
160
|
+
} | {
|
|
161
|
+
readonly kind: "taskProgress";
|
|
162
|
+
readonly taskId: string;
|
|
163
|
+
readonly description: string;
|
|
164
|
+
readonly durationMs?: number;
|
|
165
|
+
} | {
|
|
166
|
+
readonly kind: "taskMembership";
|
|
167
|
+
readonly taskIds: readonly string[];
|
|
168
|
+
} | {
|
|
169
|
+
readonly kind: "taskOutput";
|
|
170
|
+
readonly taskId: string;
|
|
171
|
+
readonly delta: string;
|
|
172
|
+
} | {
|
|
173
|
+
readonly kind: "taskComplete";
|
|
174
|
+
readonly taskId: string;
|
|
175
|
+
readonly providerId?: string;
|
|
176
|
+
readonly status: "completed" | "failed" | "stopped";
|
|
177
|
+
readonly summary: string;
|
|
178
|
+
readonly outputFile?: string;
|
|
179
|
+
readonly durationMs?: number;
|
|
180
|
+
readonly outputDrained?: boolean;
|
|
181
|
+
} | {
|
|
182
|
+
readonly kind: "taskStop";
|
|
183
|
+
readonly taskIds?: readonly string[];
|
|
184
|
+
readonly reason: string;
|
|
185
|
+
} | {
|
|
186
|
+
readonly kind: "evict";
|
|
187
|
+
readonly itemIds: readonly string[];
|
|
188
|
+
} | {
|
|
189
|
+
readonly kind: "scopeFinish";
|
|
190
|
+
readonly status: "completed" | "interrupted" | "failed";
|
|
191
|
+
readonly message?: string;
|
|
192
|
+
} | {
|
|
193
|
+
readonly kind: "inspect";
|
|
194
|
+
};
|
|
195
|
+
export interface MainStreamProjection {
|
|
196
|
+
readonly turn: Turn;
|
|
197
|
+
readonly itemIds: readonly (string | null)[];
|
|
198
|
+
readonly handled: boolean;
|
|
199
|
+
readonly tool: ActiveTool | null;
|
|
200
|
+
readonly taskIds: readonly string[];
|
|
201
|
+
readonly outputFile: string | null;
|
|
202
|
+
readonly childThreadId: string | null;
|
|
203
|
+
readonly childThread: Thread | null;
|
|
204
|
+
readonly terminal: boolean;
|
|
205
|
+
readonly terminals: readonly {
|
|
206
|
+
itemId: string;
|
|
207
|
+
processId: string;
|
|
208
|
+
command: string;
|
|
209
|
+
cwd: string;
|
|
210
|
+
osPid: null;
|
|
211
|
+
cpuPercent: null;
|
|
212
|
+
rssKb: null;
|
|
213
|
+
}[];
|
|
214
|
+
}
|
|
215
|
+
export interface CompletedSessionTurn {
|
|
216
|
+
readonly record: ClaudeThreadRecord;
|
|
217
|
+
readonly turn: Turn;
|
|
218
|
+
}
|
|
219
|
+
export interface RestartRecovery {
|
|
220
|
+
readonly recoveredTurnIds: readonly string[];
|
|
221
|
+
readonly abandonedProviderEventTypes: readonly string[];
|
|
222
|
+
}
|
|
223
|
+
export type LifecycleFact = {
|
|
224
|
+
readonly type: "expectedCommand";
|
|
225
|
+
readonly id: string;
|
|
226
|
+
} | {
|
|
227
|
+
readonly type: "command";
|
|
228
|
+
readonly state: "queued" | "started" | "completed" | "cancelled" | "discarded";
|
|
229
|
+
readonly id: string | null;
|
|
230
|
+
} | {
|
|
231
|
+
readonly type: "request";
|
|
232
|
+
readonly messageStarted: boolean;
|
|
233
|
+
} | {
|
|
234
|
+
readonly type: "session";
|
|
235
|
+
readonly state: "idle" | "running" | "requires_action";
|
|
236
|
+
} | {
|
|
237
|
+
readonly type: "result";
|
|
238
|
+
readonly status: "completed" | "interrupted" | "failed";
|
|
239
|
+
readonly errorMessage?: string;
|
|
240
|
+
readonly codexErrorInfo: CodexErrorInfo | null;
|
|
241
|
+
readonly origin: string | null;
|
|
242
|
+
} | {
|
|
243
|
+
readonly type: "taskNotification";
|
|
244
|
+
} | {
|
|
245
|
+
readonly type: "goalQueued";
|
|
246
|
+
} | {
|
|
247
|
+
readonly type: "noQuery" | "noQueryAck";
|
|
248
|
+
} | {
|
|
249
|
+
readonly type: "interrupt" | "interruptAck";
|
|
250
|
+
} | {
|
|
251
|
+
readonly type: "runtimeExit";
|
|
252
|
+
readonly message: string;
|
|
253
|
+
readonly codexErrorInfo: CodexErrorInfo | null;
|
|
254
|
+
} | {
|
|
255
|
+
readonly type: "timer";
|
|
256
|
+
readonly generation: number;
|
|
257
|
+
} | {
|
|
258
|
+
readonly type: "sync";
|
|
259
|
+
};
|
|
260
|
+
export interface SessionLifecycleUpdate {
|
|
261
|
+
readonly completed?: CompletedSessionTurn;
|
|
262
|
+
readonly quiescent: boolean;
|
|
263
|
+
readonly acceptProviderFacts: boolean;
|
|
264
|
+
readonly goalEffects?: readonly GoalEffect[];
|
|
265
|
+
readonly compactionActions?: readonly CompactionTransportAction[];
|
|
266
|
+
}
|
|
267
|
+
export type GoalEffect = {
|
|
268
|
+
readonly kind: "ensureRuntime";
|
|
269
|
+
readonly goalId: string;
|
|
270
|
+
readonly operationId: string;
|
|
271
|
+
} | {
|
|
272
|
+
readonly kind: "steer";
|
|
273
|
+
readonly prompt: string;
|
|
274
|
+
readonly goalId: string;
|
|
275
|
+
readonly runtimeGeneration?: number;
|
|
276
|
+
} | {
|
|
277
|
+
readonly kind: "continue";
|
|
278
|
+
readonly prompt: string;
|
|
279
|
+
readonly goalId: string;
|
|
280
|
+
readonly operationId: string;
|
|
281
|
+
readonly runtimeGeneration: number;
|
|
282
|
+
};
|
|
283
|
+
export type PreparedGoalMutation = {
|
|
284
|
+
readonly kind: "set";
|
|
285
|
+
readonly response: {
|
|
286
|
+
goal: ThreadGoal;
|
|
287
|
+
};
|
|
288
|
+
readonly goal: InternalGoal;
|
|
289
|
+
readonly objectiveChanged: boolean;
|
|
290
|
+
readonly newlyBudgetLimited: boolean;
|
|
291
|
+
readonly mutationId: string;
|
|
292
|
+
} | {
|
|
293
|
+
readonly kind: "clear";
|
|
294
|
+
readonly response: {
|
|
295
|
+
cleared: boolean;
|
|
296
|
+
};
|
|
297
|
+
readonly mutationId: string;
|
|
298
|
+
};
|
|
299
|
+
export type GoalSessionCommand = {
|
|
300
|
+
readonly kind: "get";
|
|
301
|
+
} | {
|
|
302
|
+
readonly kind: "prepareSet";
|
|
303
|
+
readonly params: ThreadGoalSetParams;
|
|
304
|
+
} | {
|
|
305
|
+
readonly kind: "prepareClear";
|
|
306
|
+
} | {
|
|
307
|
+
readonly kind: "finalize";
|
|
308
|
+
readonly mutation: PreparedGoalMutation;
|
|
309
|
+
} | {
|
|
310
|
+
readonly kind: "resume";
|
|
311
|
+
} | {
|
|
312
|
+
readonly kind: "resumeSnapshot";
|
|
313
|
+
readonly reservationId: string;
|
|
314
|
+
} | {
|
|
315
|
+
readonly kind: "reserveTurn";
|
|
316
|
+
} | {
|
|
317
|
+
readonly kind: "cancelTurn";
|
|
318
|
+
} | {
|
|
319
|
+
readonly kind: "usage";
|
|
320
|
+
readonly turnId: string;
|
|
321
|
+
readonly eventId: string;
|
|
322
|
+
readonly tokenDelta: number;
|
|
323
|
+
} | {
|
|
324
|
+
readonly kind: "toolGet";
|
|
325
|
+
} | {
|
|
326
|
+
readonly kind: "toolCreate";
|
|
327
|
+
readonly objective: string;
|
|
328
|
+
readonly tokenBudget?: number;
|
|
329
|
+
} | {
|
|
330
|
+
readonly kind: "toolUpdate";
|
|
331
|
+
readonly status: "complete" | "blocked";
|
|
332
|
+
} | {
|
|
333
|
+
readonly kind: "detach";
|
|
334
|
+
readonly checkpoint: string;
|
|
335
|
+
} | {
|
|
336
|
+
readonly kind: "runtimeReady";
|
|
337
|
+
readonly runtimeGeneration: number;
|
|
338
|
+
} | {
|
|
339
|
+
readonly kind: "recoverRestart";
|
|
340
|
+
readonly turnId: string;
|
|
341
|
+
} | {
|
|
342
|
+
readonly kind: "admitEffect";
|
|
343
|
+
readonly operationId: string;
|
|
344
|
+
} | {
|
|
345
|
+
readonly kind: "effectFailed";
|
|
346
|
+
readonly goalId: string;
|
|
347
|
+
readonly operationId: string;
|
|
348
|
+
readonly runtimeGeneration?: number;
|
|
349
|
+
};
|
|
350
|
+
export interface SessionInteractionRequest {
|
|
351
|
+
readonly threadId: string;
|
|
352
|
+
readonly turnId: string | null;
|
|
353
|
+
readonly claudeRequestId: string | null;
|
|
354
|
+
readonly method: string;
|
|
355
|
+
readonly params: unknown;
|
|
356
|
+
}
|
|
357
|
+
export interface OpenedSessionInteraction {
|
|
358
|
+
readonly requestId: string;
|
|
359
|
+
readonly pending: boolean;
|
|
360
|
+
readonly response: unknown | null;
|
|
361
|
+
}
|
|
362
|
+
export type ThreadRemovalKind = "delete" | "release" | "discard";
|
|
363
|
+
export type ThreadAdminOperation = "rename" | "archive";
|
|
364
|
+
export interface PreparedThreadAdmin {
|
|
365
|
+
readonly operationId: string;
|
|
366
|
+
readonly record: ClaudeThreadRecord;
|
|
367
|
+
readonly providerRename: boolean;
|
|
368
|
+
}
|
|
369
|
+
export interface PreparedThreadRemoval {
|
|
370
|
+
readonly operationId: string;
|
|
371
|
+
readonly kind: ThreadRemovalKind;
|
|
372
|
+
readonly claudeSessionId: string;
|
|
373
|
+
readonly cwd: string;
|
|
374
|
+
}
|
|
375
|
+
export type ThreadAdminCommand = {
|
|
376
|
+
readonly kind: "prepare";
|
|
377
|
+
readonly operation: ThreadAdminOperation;
|
|
378
|
+
readonly name?: string;
|
|
379
|
+
} | {
|
|
380
|
+
readonly kind: "finish" | "abort";
|
|
381
|
+
readonly operationId: string;
|
|
382
|
+
} | {
|
|
383
|
+
readonly kind: "renameProjection";
|
|
384
|
+
readonly threadId: string;
|
|
385
|
+
readonly name: string;
|
|
386
|
+
} | {
|
|
387
|
+
readonly kind: "beginRemoval";
|
|
388
|
+
readonly removalKind: ThreadRemovalKind;
|
|
389
|
+
} | {
|
|
390
|
+
readonly kind: "recoverRemoval";
|
|
391
|
+
} | {
|
|
392
|
+
readonly kind: "providerSucceeded";
|
|
393
|
+
readonly operationId: string;
|
|
394
|
+
} | {
|
|
395
|
+
readonly kind: "providerFailed";
|
|
396
|
+
readonly operationId: string;
|
|
397
|
+
readonly providerAttempted: boolean;
|
|
398
|
+
} | {
|
|
399
|
+
readonly kind: "metadata";
|
|
400
|
+
readonly gitInfo: ThreadMetadataUpdateParams["gitInfo"];
|
|
401
|
+
} | {
|
|
402
|
+
readonly kind: "unarchive";
|
|
403
|
+
};
|
|
404
|
+
export interface StartedShellCommand {
|
|
405
|
+
readonly operationId: string;
|
|
406
|
+
readonly turnId: string;
|
|
407
|
+
readonly cwd: string;
|
|
408
|
+
}
|
|
409
|
+
export interface PreparedShellCancellation {
|
|
410
|
+
readonly kind: "prepared";
|
|
411
|
+
readonly operationId: string;
|
|
412
|
+
readonly turnId: string;
|
|
413
|
+
}
|
|
414
|
+
export type ShellCancellation = PreparedShellCancellation | {
|
|
415
|
+
readonly kind: "terminal";
|
|
416
|
+
readonly turnId: string;
|
|
417
|
+
};
|
|
418
|
+
export type StartedCompaction = Readonly<{
|
|
419
|
+
operationId: string;
|
|
420
|
+
turnId: string;
|
|
421
|
+
turn: Turn;
|
|
422
|
+
}>;
|
|
423
|
+
export type CompactionTerminal = Readonly<{
|
|
424
|
+
status: "interrupted" | "failed";
|
|
425
|
+
message?: string;
|
|
426
|
+
errorInfo: CodexErrorInfo | null;
|
|
427
|
+
}>;
|
|
428
|
+
export type CompactionTransportAction = Readonly<{
|
|
429
|
+
kind: "send";
|
|
430
|
+
operationId: string;
|
|
431
|
+
messageUuid: string;
|
|
432
|
+
runtimeGeneration: number;
|
|
433
|
+
input: string;
|
|
434
|
+
}> | Readonly<{
|
|
435
|
+
kind: "cancel";
|
|
436
|
+
operationId: string;
|
|
437
|
+
messageUuid: string;
|
|
438
|
+
runtimeGeneration: number;
|
|
439
|
+
}>;
|
|
440
|
+
export type CompactionProjection = Readonly<{
|
|
441
|
+
turnId: string;
|
|
442
|
+
terminal: boolean;
|
|
443
|
+
cancelOperationId?: string;
|
|
444
|
+
transportAction?: Extract<CompactionTransportAction, {
|
|
445
|
+
kind: "cancel";
|
|
446
|
+
}>;
|
|
447
|
+
}>;
|
|
448
|
+
export type HookFact = Readonly<{
|
|
449
|
+
kind: "started";
|
|
450
|
+
hookId: string;
|
|
451
|
+
hookName: string;
|
|
452
|
+
hookEvent: string;
|
|
453
|
+
}> | Readonly<{
|
|
454
|
+
kind: "progress";
|
|
455
|
+
hookId: string;
|
|
456
|
+
output: string;
|
|
457
|
+
stdout: string;
|
|
458
|
+
stderr: string;
|
|
459
|
+
}> | Readonly<{
|
|
460
|
+
kind: "response";
|
|
461
|
+
hookId: string;
|
|
462
|
+
output: string;
|
|
463
|
+
stdout: string;
|
|
464
|
+
stderr: string;
|
|
465
|
+
outcome: "success" | "error" | "cancelled";
|
|
466
|
+
exitCode?: number;
|
|
467
|
+
}>;
|
|
468
|
+
export type ClaudeSessionCommand = {
|
|
469
|
+
readonly type: "createThread";
|
|
470
|
+
readonly record: ClaudeThreadRecord;
|
|
471
|
+
} | {
|
|
472
|
+
readonly type: "readThread";
|
|
473
|
+
readonly includeTurns: boolean;
|
|
474
|
+
} | {
|
|
475
|
+
readonly type: "recoverAfterRestart";
|
|
476
|
+
readonly statusCommandEnabled: boolean;
|
|
477
|
+
} | {
|
|
478
|
+
readonly type: "purgeStartupProjection";
|
|
479
|
+
} | {
|
|
480
|
+
readonly type: "snapshotBranch";
|
|
481
|
+
} | {
|
|
482
|
+
readonly type: "commitForkTarget";
|
|
483
|
+
readonly record: ClaudeThreadRecord;
|
|
484
|
+
readonly turns: readonly Turn[];
|
|
485
|
+
readonly sourceBoundaries: readonly TurnProviderBoundary[];
|
|
486
|
+
readonly uuidMap: readonly (readonly [string, string])[];
|
|
487
|
+
} | {
|
|
488
|
+
readonly type: "commitRollback";
|
|
489
|
+
readonly expectedRevision: string;
|
|
490
|
+
readonly replacementSessionId: string;
|
|
491
|
+
readonly keepCount: number;
|
|
492
|
+
readonly sourceBoundaries: readonly TurnProviderBoundary[];
|
|
493
|
+
readonly uuidMap: readonly (readonly [string, string])[];
|
|
494
|
+
} | {
|
|
495
|
+
readonly type: "deleteBranchTarget";
|
|
496
|
+
} | {
|
|
497
|
+
readonly type: "goal";
|
|
498
|
+
readonly command: GoalSessionCommand;
|
|
499
|
+
} | {
|
|
500
|
+
readonly type: "runtimeDetached";
|
|
501
|
+
readonly runtimeGeneration: number;
|
|
502
|
+
readonly requireQuiescent?: boolean;
|
|
503
|
+
readonly ephemeralPrelude?: boolean;
|
|
504
|
+
} | {
|
|
505
|
+
readonly type: "updateDesiredSettings";
|
|
506
|
+
readonly expectedGeneration: number;
|
|
507
|
+
readonly candidate: ClaudeThreadRecord;
|
|
508
|
+
readonly threadSettings: ThreadSettings;
|
|
509
|
+
} | {
|
|
510
|
+
readonly type: "announceThread";
|
|
511
|
+
} | {
|
|
512
|
+
readonly type: "prepareTurn";
|
|
513
|
+
readonly params: TurnStartParams;
|
|
514
|
+
readonly review?: string;
|
|
515
|
+
readonly synthetic?: "status" | "state";
|
|
516
|
+
readonly hiddenInput?: boolean;
|
|
517
|
+
readonly stagedMessageUuid?: string;
|
|
518
|
+
readonly readOnly?: boolean;
|
|
519
|
+
readonly goalOperation?: {
|
|
520
|
+
readonly operationId: string;
|
|
521
|
+
readonly goalId: string;
|
|
522
|
+
readonly runtimeGeneration: number;
|
|
523
|
+
};
|
|
524
|
+
} | {
|
|
525
|
+
readonly type: "announceTurn";
|
|
526
|
+
readonly turnId: string;
|
|
527
|
+
} | {
|
|
528
|
+
readonly type: "completeSynthetic";
|
|
529
|
+
readonly turnId?: string;
|
|
530
|
+
readonly text?: string;
|
|
531
|
+
readonly status: "completed" | "interrupted" | "failed";
|
|
532
|
+
readonly errorMessage?: string;
|
|
533
|
+
readonly codexErrorInfo: CodexErrorInfo | null;
|
|
534
|
+
} | {
|
|
535
|
+
readonly type: "stageInjection";
|
|
536
|
+
readonly runtimeGeneration: number;
|
|
537
|
+
readonly messageUuid: string;
|
|
538
|
+
readonly waitForAcknowledgement: boolean;
|
|
539
|
+
readonly replayablePrelude: boolean;
|
|
540
|
+
readonly items: readonly JsonValue[];
|
|
541
|
+
} | {
|
|
542
|
+
readonly type: "cancelInjection";
|
|
543
|
+
readonly runtimeGeneration: number;
|
|
544
|
+
readonly messageUuid: string;
|
|
545
|
+
readonly previous: string | null;
|
|
546
|
+
readonly reason: string;
|
|
547
|
+
readonly rollbackBoundary: boolean;
|
|
548
|
+
} | {
|
|
549
|
+
readonly type: "acknowledgeInjection";
|
|
550
|
+
readonly runtimeGeneration: number;
|
|
551
|
+
readonly source: RuntimeFactSource;
|
|
552
|
+
} | {
|
|
553
|
+
readonly type: "cancelRuntimeInjections";
|
|
554
|
+
readonly runtimeGeneration: number;
|
|
555
|
+
readonly reason: string;
|
|
556
|
+
} | {
|
|
557
|
+
readonly type: "providerAssistantError";
|
|
558
|
+
readonly runtimeGeneration: number;
|
|
559
|
+
readonly error: string;
|
|
560
|
+
} | {
|
|
561
|
+
readonly type: "classifyProviderResult";
|
|
562
|
+
readonly runtimeGeneration: number;
|
|
563
|
+
readonly result: ClaudeResultInput;
|
|
564
|
+
} | {
|
|
565
|
+
readonly type: "goalAssistantUsage";
|
|
566
|
+
readonly runtimeGeneration: number;
|
|
567
|
+
readonly turnId: string;
|
|
568
|
+
readonly eventId: string;
|
|
569
|
+
readonly tokens: number;
|
|
570
|
+
} | {
|
|
571
|
+
readonly type: "goalResultUsage";
|
|
572
|
+
readonly runtimeGeneration: number;
|
|
573
|
+
readonly turnId: string;
|
|
574
|
+
readonly eventId: string;
|
|
575
|
+
readonly totalTokens: number;
|
|
576
|
+
} | {
|
|
577
|
+
readonly type: "runtimeUsageSnapshot";
|
|
578
|
+
readonly runtimeGeneration: number;
|
|
579
|
+
readonly action: "invalidate" | "claim" | "isCurrent";
|
|
580
|
+
readonly snapshot?: number;
|
|
581
|
+
} | {
|
|
582
|
+
readonly type: "attachRuntime";
|
|
583
|
+
readonly runtimeGeneration: number;
|
|
584
|
+
} | {
|
|
585
|
+
readonly type: "runtimeReady";
|
|
586
|
+
readonly runtimeGeneration: number;
|
|
587
|
+
} | {
|
|
588
|
+
readonly type: "runtimeFailed" | "runtimeExited";
|
|
589
|
+
readonly runtimeGeneration: number;
|
|
590
|
+
readonly message: string;
|
|
591
|
+
readonly codexErrorInfo: CodexErrorInfo | null;
|
|
592
|
+
} | {
|
|
593
|
+
readonly type: "runtimeInitialized";
|
|
594
|
+
readonly runtimeGeneration: number;
|
|
595
|
+
readonly providerSessionId: string;
|
|
596
|
+
readonly model: string;
|
|
597
|
+
readonly cliVersion: string;
|
|
598
|
+
} | {
|
|
599
|
+
readonly type: "providerEventStarted";
|
|
600
|
+
readonly runtimeGeneration: number;
|
|
601
|
+
readonly processEpoch: string;
|
|
602
|
+
readonly providerSequence: number;
|
|
603
|
+
readonly providerEventType: string;
|
|
604
|
+
readonly providerEventId: string | null;
|
|
605
|
+
readonly payload: unknown;
|
|
606
|
+
} | {
|
|
607
|
+
readonly type: "providerEventFinished";
|
|
608
|
+
readonly runtimeGeneration: number;
|
|
609
|
+
readonly sequence: number;
|
|
610
|
+
readonly source: RuntimeFactSource;
|
|
611
|
+
readonly disposition: Exclude<ProviderEventDisposition, "pending">;
|
|
612
|
+
readonly error?: string;
|
|
613
|
+
} | {
|
|
614
|
+
readonly type: "providerBoundary";
|
|
615
|
+
readonly runtimeGeneration: number;
|
|
616
|
+
readonly providerMessageId: string;
|
|
617
|
+
readonly ownerThreadId?: string;
|
|
618
|
+
readonly itemIds?: readonly string[];
|
|
619
|
+
} | {
|
|
620
|
+
readonly type: "providerRetract";
|
|
621
|
+
readonly runtimeGeneration: number;
|
|
622
|
+
readonly providerMessageIds: readonly string[];
|
|
623
|
+
readonly source: RuntimeFactSource;
|
|
624
|
+
} | {
|
|
625
|
+
readonly type: "conversationReset";
|
|
626
|
+
readonly runtimeGeneration: number;
|
|
627
|
+
readonly providerSessionId: string;
|
|
628
|
+
readonly source: RuntimeFactSource;
|
|
629
|
+
} | {
|
|
630
|
+
readonly type: "modelFallback";
|
|
631
|
+
readonly runtimeGeneration: number;
|
|
632
|
+
readonly model: string;
|
|
633
|
+
readonly fromModel: string;
|
|
634
|
+
readonly source: RuntimeFactSource;
|
|
635
|
+
} | {
|
|
636
|
+
readonly type: "systemNotice";
|
|
637
|
+
readonly runtimeGeneration: number;
|
|
638
|
+
readonly text: string;
|
|
639
|
+
readonly noticeKind: "info" | "error";
|
|
640
|
+
readonly ownerThreadId?: string;
|
|
641
|
+
readonly source: RuntimeFactSource;
|
|
642
|
+
} | {
|
|
643
|
+
readonly type: "runtimeNotification";
|
|
644
|
+
readonly runtimeGeneration: number;
|
|
645
|
+
readonly method: string;
|
|
646
|
+
readonly params: unknown;
|
|
647
|
+
readonly ownerThreadId?: string;
|
|
648
|
+
readonly source: RuntimeFactSource;
|
|
649
|
+
} | {
|
|
650
|
+
readonly type: "steer";
|
|
651
|
+
readonly runtimeGeneration: number;
|
|
652
|
+
readonly messageUuid: string;
|
|
653
|
+
readonly expectedTurnId: string;
|
|
654
|
+
readonly clientUserMessageId?: string | null;
|
|
655
|
+
readonly input: TurnStartParams["input"];
|
|
656
|
+
} | {
|
|
657
|
+
readonly type: "stageRuntimeTurn";
|
|
658
|
+
readonly runtimeGeneration: number;
|
|
659
|
+
readonly settingsGeneration: number;
|
|
660
|
+
readonly messageUuid: string;
|
|
661
|
+
} | {
|
|
662
|
+
readonly type: "cancelRuntimeTurnStage";
|
|
663
|
+
readonly runtimeGeneration: number;
|
|
664
|
+
readonly messageUuid: string;
|
|
665
|
+
} | {
|
|
666
|
+
readonly type: "prepareRuntimeInput";
|
|
667
|
+
readonly runtimeGeneration: number;
|
|
668
|
+
readonly messageUuid: string;
|
|
669
|
+
readonly kind: "turn" | "hiddenGoal" | "noQuery";
|
|
670
|
+
readonly turnId?: string;
|
|
671
|
+
} | {
|
|
672
|
+
readonly type: "completeRuntimeInput";
|
|
673
|
+
readonly runtimeGeneration: number;
|
|
674
|
+
readonly messageUuid: string;
|
|
675
|
+
readonly sent: boolean;
|
|
676
|
+
} | {
|
|
677
|
+
readonly type: "claimRuntimeInput";
|
|
678
|
+
readonly runtimeGeneration: number;
|
|
679
|
+
readonly messageUuid: string;
|
|
680
|
+
} | {
|
|
681
|
+
readonly type: "fenceCurrentRuntimeStop";
|
|
682
|
+
readonly expectedTurnId?: string;
|
|
683
|
+
} | {
|
|
684
|
+
readonly type: "runtimeInputQueueChanged";
|
|
685
|
+
readonly runtimeGeneration: number;
|
|
686
|
+
readonly pendingInputs: number;
|
|
687
|
+
} | {
|
|
688
|
+
readonly type: "inspectRuntime";
|
|
689
|
+
readonly runtimeGeneration: number;
|
|
690
|
+
readonly ownerThreadId?: string;
|
|
691
|
+
readonly providerId?: string;
|
|
692
|
+
readonly childThreadId?: string;
|
|
693
|
+
readonly expectedTurnId?: string;
|
|
694
|
+
readonly control?: boolean;
|
|
695
|
+
} | {
|
|
696
|
+
readonly type: "isToolApproved";
|
|
697
|
+
readonly runtimeGeneration: number;
|
|
698
|
+
readonly toolName: string;
|
|
699
|
+
} | {
|
|
700
|
+
readonly type: "mainStream";
|
|
701
|
+
readonly runtimeGeneration: number;
|
|
702
|
+
readonly ownerThreadId?: string;
|
|
703
|
+
readonly source: RuntimeFactSource;
|
|
704
|
+
readonly fact: MainStreamFact;
|
|
705
|
+
} | {
|
|
706
|
+
readonly type: "captureToolFileBefore";
|
|
707
|
+
readonly runtimeGeneration: number;
|
|
708
|
+
readonly providerId: string;
|
|
709
|
+
readonly ownerProviderId?: string;
|
|
710
|
+
readonly toolName: string;
|
|
711
|
+
readonly input: Record<string, unknown>;
|
|
712
|
+
} | {
|
|
713
|
+
readonly type: "captureToolFileAfter";
|
|
714
|
+
readonly runtimeGeneration: number;
|
|
715
|
+
readonly providerId: string;
|
|
716
|
+
} | {
|
|
717
|
+
readonly type: "hook";
|
|
718
|
+
readonly runtimeGeneration: number;
|
|
719
|
+
readonly source: RuntimeFactSource;
|
|
720
|
+
readonly fact: HookFact;
|
|
721
|
+
} | {
|
|
722
|
+
readonly type: "disposeRuntimeOperations";
|
|
723
|
+
} | {
|
|
724
|
+
readonly type: "accountUsage";
|
|
725
|
+
readonly runtimeGeneration: number;
|
|
726
|
+
readonly aggregate: TokenUsageBreakdown;
|
|
727
|
+
readonly costUsd?: number;
|
|
728
|
+
} | {
|
|
729
|
+
readonly type: "accountCost";
|
|
730
|
+
readonly runtimeGeneration: number;
|
|
731
|
+
readonly costUsd: number;
|
|
732
|
+
} | {
|
|
733
|
+
readonly type: "publishUsage";
|
|
734
|
+
readonly runtimeGeneration: number;
|
|
735
|
+
readonly turnId: string;
|
|
736
|
+
readonly last: TokenUsageBreakdown;
|
|
737
|
+
readonly modelContextWindow: number | null;
|
|
738
|
+
} | {
|
|
739
|
+
readonly type: "lifecycle";
|
|
740
|
+
readonly runtimeGeneration: number;
|
|
741
|
+
readonly fact: LifecycleFact;
|
|
742
|
+
readonly source: RuntimeFactSource;
|
|
743
|
+
} | {
|
|
744
|
+
readonly type: "openInteraction";
|
|
745
|
+
readonly runtimeGeneration: number;
|
|
746
|
+
readonly request: SessionInteractionRequest;
|
|
747
|
+
} | {
|
|
748
|
+
readonly type: "announceInteraction";
|
|
749
|
+
readonly runtimeGeneration: number;
|
|
750
|
+
readonly requestId: string;
|
|
751
|
+
} | {
|
|
752
|
+
readonly type: "waitInteraction";
|
|
753
|
+
readonly runtimeGeneration: number;
|
|
754
|
+
readonly requestId: string;
|
|
755
|
+
readonly signal?: AbortSignal;
|
|
756
|
+
} | {
|
|
757
|
+
readonly type: "resolveInteraction";
|
|
758
|
+
readonly requestId: string;
|
|
759
|
+
readonly response: unknown;
|
|
760
|
+
} | {
|
|
761
|
+
readonly type: "cancelInteraction";
|
|
762
|
+
readonly runtimeGeneration: number;
|
|
763
|
+
readonly requestId: string;
|
|
764
|
+
} | {
|
|
765
|
+
readonly type: "cancelInteractions";
|
|
766
|
+
readonly runtimeGeneration: number;
|
|
767
|
+
readonly ownerThreadId?: string;
|
|
768
|
+
} | {
|
|
769
|
+
readonly type: "replayInteractions";
|
|
770
|
+
readonly connectionId?: string;
|
|
771
|
+
} | {
|
|
772
|
+
readonly type: "threadAdmin";
|
|
773
|
+
readonly command: ThreadAdminCommand;
|
|
774
|
+
} | {
|
|
775
|
+
readonly type: "runShell";
|
|
776
|
+
readonly command: string;
|
|
777
|
+
} | {
|
|
778
|
+
readonly type: "startShell";
|
|
779
|
+
readonly command: string;
|
|
780
|
+
} | {
|
|
781
|
+
readonly type: "shellOutput";
|
|
782
|
+
readonly operationId: string;
|
|
783
|
+
readonly delta: string;
|
|
784
|
+
} | {
|
|
785
|
+
readonly type: "admitShellEffect";
|
|
786
|
+
readonly operationId: string;
|
|
787
|
+
} | {
|
|
788
|
+
readonly type: "finishShell";
|
|
789
|
+
readonly operationId: string;
|
|
790
|
+
readonly exitCode: number;
|
|
791
|
+
readonly errorMessage?: string;
|
|
792
|
+
} | {
|
|
793
|
+
readonly type: "prepareShellCancellation";
|
|
794
|
+
readonly turnId?: string;
|
|
795
|
+
} | {
|
|
796
|
+
readonly type: "finalizeShellCancellation";
|
|
797
|
+
readonly operationId: string;
|
|
798
|
+
} | {
|
|
799
|
+
readonly type: "reportError";
|
|
800
|
+
readonly threadId: string;
|
|
801
|
+
readonly requestedTurnId?: string;
|
|
802
|
+
readonly message: string;
|
|
803
|
+
readonly codexErrorInfo: CodexErrorInfo;
|
|
804
|
+
} | {
|
|
805
|
+
readonly type: "startCompact";
|
|
806
|
+
readonly input?: string;
|
|
807
|
+
readonly deferred?: boolean;
|
|
808
|
+
} | {
|
|
809
|
+
readonly type: "announceCompaction";
|
|
810
|
+
readonly operationId: string;
|
|
811
|
+
} | {
|
|
812
|
+
readonly type: "admitCompactTransport";
|
|
813
|
+
readonly action: Extract<CompactionTransportAction, {
|
|
814
|
+
kind: "send";
|
|
815
|
+
}>;
|
|
816
|
+
} | {
|
|
817
|
+
readonly type: "completeCompactTransport";
|
|
818
|
+
readonly operationId: string;
|
|
819
|
+
readonly messageUuid: string;
|
|
820
|
+
readonly runtimeGeneration: number;
|
|
821
|
+
readonly sent: boolean;
|
|
822
|
+
readonly errorMessage?: string;
|
|
823
|
+
readonly codexErrorInfo?: CodexErrorInfo | null;
|
|
824
|
+
} | {
|
|
825
|
+
readonly type: "admitCompactBoundary";
|
|
826
|
+
readonly runtimeGeneration: number;
|
|
827
|
+
readonly trigger: string;
|
|
828
|
+
} | {
|
|
829
|
+
readonly type: "compactBoundary";
|
|
830
|
+
readonly runtimeGeneration: number;
|
|
831
|
+
readonly trigger: string;
|
|
832
|
+
readonly boundary: string;
|
|
833
|
+
readonly source: RuntimeFactSource;
|
|
834
|
+
} | {
|
|
835
|
+
readonly type: "compactFailed";
|
|
836
|
+
readonly runtimeGeneration: number;
|
|
837
|
+
readonly message: string;
|
|
838
|
+
readonly codexErrorInfo: CodexErrorInfo | null;
|
|
839
|
+
readonly source: RuntimeFactSource;
|
|
840
|
+
} | {
|
|
841
|
+
readonly type: "compactWatchdogFired";
|
|
842
|
+
readonly operationId: string;
|
|
843
|
+
} | {
|
|
844
|
+
readonly type: "interruptCompaction";
|
|
845
|
+
readonly turnId?: string;
|
|
846
|
+
} | {
|
|
847
|
+
readonly type: "compactTransportCancelled";
|
|
848
|
+
readonly operationId: string;
|
|
849
|
+
readonly messageUuid: string;
|
|
850
|
+
readonly runtimeGeneration: number;
|
|
851
|
+
} | {
|
|
852
|
+
readonly type: "compactRuntimeExited";
|
|
853
|
+
readonly runtimeGeneration: number;
|
|
854
|
+
readonly message: string;
|
|
855
|
+
};
|