@titan-design/agent 0.1.0 → 0.2.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/README.md CHANGED
@@ -120,8 +120,112 @@ says. Prefer `allowedTools` wildcards over a permissive mode.
120
120
  This package runs one session. It does not pool, schedule, or retry; that
121
121
  belongs to the workflow tier.
122
122
 
123
+ ## Explicit multi-harness contracts
124
+
125
+ `dispatchHarnessRun(request, adapter)` is the new, explicit contract for Claude
126
+ Code and Codex adapters. It does not replace or reroute `runAgent()`. Every request
127
+ has a discriminating `harness`, a fresh or resume target, and a required positive
128
+ finite `wallTimeMs`. Claude's Anthropic SDK fields live only under the
129
+ `claude-code` branch; Codex model, reasoning, sandbox, approval, and native JSON
130
+ Schema fields live only under the `codex` branch.
131
+
132
+ Optional limits name their unit (`usd`, `model_requests`, `agent_iterations`, or
133
+ `tokens`), scope (`execution` or `conversation`), and enforcement (`hard` or
134
+ `advisory`). These are not interchangeable: an agent iteration is not a model
135
+ request, and an estimated SDK dollar stop is not a hard financial cap.
136
+
137
+ Adapters supply a `HarnessCapabilityDescriptor` that marks every operation and
138
+ declared limit `supported`, `unsupported`, or `unverified`, with evidence or a
139
+ reason. Core declares no adapter capabilities itself. Before invoking an adapter,
140
+ the dispatcher checks the operation, resume identity, structured-output and
141
+ cancellation needs, caller requirements, mandatory hard execution deadline, and
142
+ all optional limits. Unsupported and unverified requirements return an
143
+ `unsupported_requirement` result with no adapter call.
144
+
145
+ Support for the hard `milliseconds` execution limit means the adapter can stop
146
+ the local execution at its deadline. It does not claim that a remote model request
147
+ has stopped unless the adapter separately reports verified cancellation support.
148
+ Normalized progress, results, usage measurements, execution identity, conversation
149
+ identity, and transcript source hints contain no harness-native event types.
150
+
151
+ ## Supervised Codex exec adapter
152
+
153
+ `createCodexExecAdapter({ auth: "cached-cli" })` runs the pinned ChatGPT desktop
154
+ Codex binary through `codex exec --json`. The caller must select a model and an
155
+ absolute working directory. Fresh runs persist a native thread; resumes always use
156
+ the supplied native thread ID and never `--last`. The adapter ignores user config,
157
+ strips API-key credentials from the child environment, accepts only the
158
+ noninteractive `never` approval policy, and leaves persistence enabled so
159
+ `@titan-design/session-read` can discover the rollout by thread ID and namespace.
160
+
161
+ The adapter checks `codex --version` before every launch. The mandatory wall deadline
162
+ covers that check, temporary output-schema setup, and the run itself. Timeout or
163
+ caller abort terminates the owned process group, then sends `SIGKILL` after the
164
+ configured grace period. JSONL output becomes normalized progress, conversation
165
+ identity, final text or locally validated structured output, and token usage with
166
+ Codex event provenance. Hard dollar, request, iteration, and token caps remain
167
+ unsupported and fail preflight before either version probing or process spawn.
168
+
169
+ A zero exit is successful only after Codex emits `turn.completed`. Its usage is a
170
+ turn snapshot: the adapter uses Codex's native turn ID when one is present and an
171
+ execution-correlated synthetic turn ID otherwise. It is never labeled as a
172
+ conversation total. If an abort or wall deadline stops the OS process without a
173
+ native terminal turn event, the result is `cancelled_unknown` and retains the
174
+ requested cause and process exit evidence. Temporary schema cleanup completes
175
+ before the terminal progress event, so cleanup failure cannot follow a reported
176
+ successful finish.
177
+
123
178
  ## Ending a run
124
179
 
125
180
  Every run ends cleanly. The inactivity watchdog resets on each streamed message
126
181
  and, like the caller's `AbortSignal`, ends the run through the SDK's
127
182
  `abortController` and then `query.close()`, so no CLI subprocess is left behind.
183
+
184
+ ## Bounded Claude adapter
185
+
186
+ `createClaudeCodeAdapter({ maxTurns, maxBudgetUsd, inactivityTimeoutMs?, deps? })`
187
+ wraps the existing `runAgent` in the common `HarnessAdapter<"claude-code">`
188
+ contract. Both native circuit breakers remain required. Every request also supplies
189
+ `wallTimeMs`; expiration aborts and closes the owned SDK query. A local stop cannot
190
+ prove that native execution was cancelled, so the durable dispatcher records an
191
+ unknown cancellation unless terminal evidence is available.
192
+
193
+ Fresh and resumed requests keep invocation identity separate from native session
194
+ identity. Native options, permission settings, MCP servers, schema validation, and
195
+ cached-auth handling flow through `runAgent`. Structured output remains validated
196
+ by the caller's Zod schema. SDK query usage is aggregated across its main, subagent, and internal model calls
197
+ into one turn-scoped snapshot with estimated cost. Multiple models yield a null
198
+ model label so their totals do not overwrite each other. Total input includes cache
199
+ reads and cache creation; those subset counters must not be added again.
200
+
201
+ The adapter does not translate SDK `maxTurns` into a generic model-request or
202
+ agent-iteration limit, or treat the SDK budget estimate as an exact monetary cap.
203
+ Generic optional limits remain unsupported until their semantics are verified.
204
+ No process reattachment, visible terminal, or semantic-interrupt capability is
205
+ claimed by this wrapper. Legacy `runAgent` callers retain their existing API.
206
+
207
+ ## Durable harness dispatch
208
+
209
+ `createDurableHarnessDispatcher(adapter, { ledger, supervisorId, leaseMs })`
210
+ wraps either harness adapter with an early durable acknowledgment and a completion
211
+ promise. Apply `executionLedgerMigration(version)` from
212
+ `@titan-design/agent-lifecycle` to the authoritative database before constructing
213
+ the ledger. Each dispatch requires caller-generated `executionId` and `requestKey`
214
+ values. The dispatcher commits `prepare` and `begin_dispatch` before calling the
215
+ adapter, renews its captured owner lease while the call is live, and commits the
216
+ terminal result before resolving completion.
217
+
218
+ `reconcile(executionId)` returns a live handle only in the same dispatcher instance
219
+ while its exact owner generation and lease remain valid. After restart it can read
220
+ back a durable terminal result. An expired record that never committed
221
+ `begin_dispatch` is closed as a retryable failure because the ledger proves the
222
+ adapter was not called. A missing record or any post-dispatch record without an
223
+ attachment handle returns unknown or recovery-required evidence and never
224
+ authorizes resubmission. The dispatcher does not infer liveness from a PID or a
225
+ transcript.
226
+
227
+ Cancellation intent is stored before the local abort signal fires. Without a
228
+ native terminal acknowledgment after a deadline or abort, the ledger records
229
+ `cancellation_unknown`. Lease-renewal, stale-owner, and local persistence failures
230
+ settle completion promptly even when the adapter ignores abort; they cannot write a
231
+ terminal result through a newer owner's fence. Durable results must be JSON-safe.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { PermissionMode, AgentDefinition, McpServerConfig, HookEvent, HookCallbackMatcher, SettingSource, SDKMessage, ModelUsage, query, SDKResultMessage } from '@anthropic-ai/claude-agent-sdk';
2
2
  import { ZodError, ZodType } from 'zod';
3
+ import { ConversationIdentity, ExecutionIdentity, UsageMeasurement, ExecutionRecord, ExecutionTerminal, AgentIdentity, ExecutionReconcileOutcome } from '@titan-design/agent-protocol';
4
+ import { ExecutionLedger } from '@titan-design/agent-lifecycle';
3
5
 
4
6
  /** Why a run ended without a usable answer. One kind per recovery strategy. */
5
7
  type AgentFailure = {
@@ -115,6 +117,259 @@ interface AgentRunDeps {
115
117
  */
116
118
  declare function runAgent<T = string>(config: AgentRunConfig<T>, deps?: AgentRunDeps): Promise<AgentRunResult<T>>;
117
119
 
120
+ type Harness = "claude-code" | "codex";
121
+ declare const CODEX_SANDBOXES: readonly ["read-only", "workspace-write", "danger-full-access"];
122
+ declare const CODEX_APPROVAL_POLICIES: readonly ["untrusted", "on-failure", "on-request", "never"];
123
+ type CodexSandbox = (typeof CODEX_SANDBOXES)[number];
124
+ type CodexApprovalPolicy = (typeof CODEX_APPROVAL_POLICIES)[number];
125
+ declare const EXECUTION_CAPABILITIES: readonly ["fresh_run", "resume", "fork", "structured_output", "interactive_approvals", "external_cancellation", "semantic_interrupt", "active_turn_steering", "idle_turn_submission", "persisted_transcript", "process_reattachment", "token_reporting"];
126
+ type ExecutionCapability = (typeof EXECUTION_CAPABILITIES)[number];
127
+ type CapabilityAssessment = {
128
+ status: "supported";
129
+ evidence: string;
130
+ } | {
131
+ status: "unsupported" | "unverified";
132
+ reason: string;
133
+ };
134
+ type LimitUnit = "milliseconds" | "usd" | "model_requests" | "agent_iterations" | "tokens";
135
+ type OptionalLimitUnit = Exclude<LimitUnit, "milliseconds">;
136
+ type LimitScope = "execution" | "conversation";
137
+ type LimitEnforcement = "hard" | "advisory";
138
+ interface ExecutionLimit {
139
+ unit: OptionalLimitUnit;
140
+ value: number;
141
+ scope: LimitScope;
142
+ enforcement: LimitEnforcement;
143
+ }
144
+ interface LimitCapability {
145
+ unit: LimitUnit;
146
+ scope: LimitScope;
147
+ enforcement: LimitEnforcement;
148
+ assessment: CapabilityAssessment;
149
+ }
150
+ /** A factual report supplied by an adapter implementation, not a promise made by the core. */
151
+ interface HarnessCapabilityDescriptor<H extends Harness = Harness> {
152
+ harness: H;
153
+ adapter: {
154
+ name: string;
155
+ version: string;
156
+ };
157
+ capabilities: Record<ExecutionCapability, CapabilityAssessment>;
158
+ limits: readonly LimitCapability[];
159
+ }
160
+ type RunTarget = {
161
+ kind: "fresh";
162
+ namespace: string;
163
+ } | {
164
+ kind: "resume";
165
+ conversation: ConversationIdentity;
166
+ };
167
+ interface BoundedRunBase {
168
+ prompt: string;
169
+ cwd: string;
170
+ target: RunTarget;
171
+ /** Required hard deadline for this execution. Must be positive and finite. */
172
+ wallTimeMs: number;
173
+ limits?: readonly ExecutionLimit[];
174
+ requires?: readonly ExecutionCapability[];
175
+ signal?: AbortSignal;
176
+ onProgress?: (progress: HarnessRunProgress) => void;
177
+ }
178
+ /** Anthropic SDK configuration remains confined to the Claude Code branch. */
179
+ interface ClaudeCodeNativeOptions<T> {
180
+ model?: string;
181
+ outputSchema?: ZodType<T>;
182
+ allowedTools?: string[];
183
+ disallowedTools?: string[];
184
+ permissionMode?: PermissionMode;
185
+ agents?: Record<string, AgentDefinition>;
186
+ mcpServers?: Record<string, McpServerConfig>;
187
+ hooks?: Partial<Record<HookEvent, HookCallbackMatcher[]>>;
188
+ settingSources?: SettingSource[];
189
+ allowApiKeyBilling?: boolean;
190
+ }
191
+ interface CodexOutputSchema<T> {
192
+ jsonSchema: Record<string, unknown>;
193
+ /** Second validation boundary after Codex applies the native JSON Schema. */
194
+ parse(value: unknown): T;
195
+ }
196
+ interface CodexNativeOptions<T> {
197
+ model?: string;
198
+ /** Adapter validates model/version-specific values; core only requires a nonempty string. */
199
+ reasoningEffort?: string;
200
+ sandbox?: CodexSandbox;
201
+ approvalPolicy?: CodexApprovalPolicy;
202
+ outputSchema?: CodexOutputSchema<T>;
203
+ }
204
+ interface ClaudeCodeRunRequest<T = string> extends BoundedRunBase {
205
+ harness: "claude-code";
206
+ native?: ClaudeCodeNativeOptions<T>;
207
+ }
208
+ interface CodexRunRequest<T = string> extends BoundedRunBase {
209
+ harness: "codex";
210
+ native?: CodexNativeOptions<T>;
211
+ }
212
+ type HarnessRunRequest<T = string> = ClaudeCodeRunRequest<T> | CodexRunRequest<T>;
213
+ type HarnessRunRequestFor<H extends Harness, T = string> = H extends "claude-code" ? ClaudeCodeRunRequest<T> : CodexRunRequest<T>;
214
+ type HarnessRunProgress = {
215
+ harness: Harness;
216
+ atMs: number;
217
+ } & ({
218
+ kind: "execution_started";
219
+ execution: ExecutionIdentity;
220
+ } | {
221
+ kind: "conversation_identified";
222
+ executionId: string;
223
+ conversation: ConversationIdentity;
224
+ } | {
225
+ kind: "assistant_output";
226
+ executionId: string;
227
+ text: string;
228
+ } | {
229
+ kind: "usage";
230
+ executionId: string;
231
+ measurement: UsageMeasurement;
232
+ } | {
233
+ kind: "execution_finished";
234
+ executionId: string;
235
+ outcome: "succeeded" | "failed" | "cancelled";
236
+ });
237
+ type HarnessRunOutput<T> = {
238
+ kind: "text";
239
+ text: string;
240
+ } | {
241
+ kind: "structured";
242
+ value: T;
243
+ };
244
+ interface TranscriptSourceHint {
245
+ format: string;
246
+ namespace: string;
247
+ path?: string;
248
+ }
249
+ type HarnessRunFailure = {
250
+ kind: "invalid_request";
251
+ reason: string;
252
+ } | {
253
+ kind: "harness_mismatch";
254
+ reason: string;
255
+ } | {
256
+ kind: "unsupported_requirement";
257
+ reason: string;
258
+ requirement: {
259
+ kind: "capability";
260
+ capability: ExecutionCapability;
261
+ } | {
262
+ kind: "limit";
263
+ limit: LimitCapability;
264
+ };
265
+ status: "unsupported" | "unverified";
266
+ } | {
267
+ kind: "rate_limited";
268
+ reason: string;
269
+ retryAtMs?: number;
270
+ native?: unknown;
271
+ } | {
272
+ kind: "limit_exceeded";
273
+ reason: string;
274
+ unit: LimitUnit;
275
+ native?: unknown;
276
+ } | {
277
+ kind: "output_invalid";
278
+ reason: string;
279
+ native?: unknown;
280
+ } | {
281
+ kind: "auth_misconfigured";
282
+ reason: string;
283
+ native?: unknown;
284
+ } | {
285
+ kind: "aborted";
286
+ reason: string;
287
+ } | {
288
+ kind: "wall_time_exceeded";
289
+ reason: string;
290
+ wallTimeMs: number;
291
+ } | {
292
+ kind: "cancelled_unknown";
293
+ reason: string;
294
+ native?: unknown;
295
+ } | {
296
+ kind: "runtime_error";
297
+ reason: string;
298
+ native?: unknown;
299
+ };
300
+ type HarnessRunResult<T = string, H extends Harness = Harness> = {
301
+ ok: true;
302
+ harness: H;
303
+ execution: ExecutionIdentity;
304
+ conversation: ConversationIdentity;
305
+ output: HarnessRunOutput<T>;
306
+ usage: readonly UsageMeasurement[];
307
+ transcript?: TranscriptSourceHint;
308
+ } | {
309
+ ok: false;
310
+ harness: H;
311
+ execution?: ExecutionIdentity;
312
+ conversation?: ConversationIdentity;
313
+ failure: HarnessRunFailure;
314
+ usage: readonly UsageMeasurement[];
315
+ };
316
+ interface HarnessAdapter<H extends Harness> {
317
+ descriptor: HarnessCapabilityDescriptor<H>;
318
+ run<T>(request: HarnessRunRequestFor<H, T>): Promise<HarnessRunResult<T, H>>;
319
+ }
320
+
321
+ declare function preflightHarnessRun<H extends Harness, T>(request: HarnessRunRequestFor<H, T>, descriptor: HarnessCapabilityDescriptor<H>): HarnessRunFailure | undefined;
322
+ declare function dispatchHarnessRun<H extends Harness, T>(request: HarnessRunRequestFor<H, T>, adapter: HarnessAdapter<H>): Promise<HarnessRunResult<T, H>>;
323
+
324
+ interface CodexProcessExit {
325
+ exitCode: number | null;
326
+ signal: NodeJS.Signals | null;
327
+ }
328
+ interface SupervisedCodexProcess {
329
+ stdout: AsyncIterable<string>;
330
+ stderr: AsyncIterable<string>;
331
+ completed: Promise<CodexProcessExit>;
332
+ terminate(signal: "SIGTERM" | "SIGKILL"): void;
333
+ }
334
+ interface CodexSchemaFile {
335
+ path: string;
336
+ dispose(): Promise<void>;
337
+ }
338
+ interface CodexProcessInput {
339
+ executablePath: string;
340
+ args: readonly string[];
341
+ cwd: string;
342
+ env: Record<string, string>;
343
+ }
344
+ interface CodexVersionInspectionOptions {
345
+ signal?: AbortSignal;
346
+ timeoutMs: number;
347
+ }
348
+
349
+ declare const DEFAULT_CODEX_EXECUTABLE = "/Applications/ChatGPT.app/Contents/Resources/codex";
350
+ declare const SUPPORTED_CODEX_EXEC_VERSION = "0.154.0-alpha.6.1";
351
+ declare const STRIPPED_CODEX_AUTH_VARS: readonly ["CODEX_API_KEY", "OPENAI_API_KEY", "OPENAI_ACCESS_TOKEN"];
352
+ interface CodexExecAdapterOptions {
353
+ auth: "cached-cli";
354
+ executablePath?: string;
355
+ env?: NodeJS.ProcessEnv;
356
+ killGraceMs?: number;
357
+ }
358
+ interface CodexExecDeps {
359
+ inspectVersion?: (executablePath: string, env: Record<string, string>, options: CodexVersionInspectionOptions) => Promise<string>;
360
+ start?: (input: CodexProcessInput) => SupervisedCodexProcess;
361
+ createSchemaFile?: (schema: Record<string, unknown>) => Promise<CodexSchemaFile>;
362
+ executionId?: () => string;
363
+ now?: () => number;
364
+ deadlineNow?: () => number;
365
+ }
366
+ declare function createCodexExecAdapter(options: CodexExecAdapterOptions, deps?: CodexExecDeps): HarnessAdapter<"codex">;
367
+ declare function prepareCodexEnv(env: NodeJS.ProcessEnv): Record<string, string>;
368
+ declare function codexExecCapabilities(): HarnessCapabilityDescriptor<"codex">;
369
+ declare function buildCodexExecArgs<T>(request: CodexRunRequest<T>, schemaPath?: string): string[];
370
+
371
+ declare const DEFAULT_CODEX_KILL_GRACE_MS = 2000;
372
+
118
373
  interface ClassifyOptions {
119
374
  /** Epoch millis used to turn a relative "retry after Ns" hint into an absolute date. */
120
375
  now?: number;
@@ -185,4 +440,85 @@ declare const FORBIDDEN_API_KEY_SOURCES: ReadonlySet<string>;
185
440
  /** Post-flight on the first `system/init`, the earliest point the real auth route is observable. */
186
441
  declare function assertApiKeySourceAllowed(observed: string | undefined): void;
187
442
 
188
- export { ANTI_NESTING_VARS, type AgentFailure, type AgentFailureKind, type AgentInit, type AgentRunConfig, type AgentRunDeps, type AgentRunResult, type AgentUsage, AuthMisconfiguredError, CLAUDE_CODE_PASSTHROUGH_VARS, type ClassifyOptions, DEFAULT_INACTIVITY_MS, DEFAULT_MAX_RETRIES, FORBIDDEN_API_KEY_SOURCES, type PrepareEnvOptions, STRIPPED_AUTH_VARS, STRIPPED_PROXY_VARS, assertApiKeySourceAllowed, assertAuthEnvOk, classifyResult, prepareEnv, runAgent, sumModelCost, usageFromResult };
443
+ interface DurableHarnessSuccess<T = unknown, H extends Harness = Harness> {
444
+ harness: H;
445
+ adapterExecution: ExecutionIdentity;
446
+ conversation: ConversationIdentity;
447
+ output: HarnessRunOutput<T>;
448
+ usage: readonly UsageMeasurement[];
449
+ transcript?: TranscriptSourceHint;
450
+ }
451
+ type DurableHarnessRecord<H extends Harness = Harness> = ExecutionRecord<DurableHarnessSuccess<unknown, H>>;
452
+ type DurableSettlement<T = unknown, H extends Harness = Harness> = {
453
+ kind: "terminal";
454
+ record: ExecutionRecord<DurableHarnessSuccess<T, H>>;
455
+ terminal: ExecutionTerminal<DurableHarnessSuccess<T, H>>;
456
+ } | {
457
+ kind: "recovery_required";
458
+ record: DurableHarnessRecord<H>;
459
+ evidence: string;
460
+ } | {
461
+ kind: "ownership_lost";
462
+ record?: DurableHarnessRecord<H>;
463
+ evidence: string;
464
+ };
465
+ interface DurableDispatchInput<H extends Harness, T = string> {
466
+ executionId: string;
467
+ requestKey: string;
468
+ agent?: AgentIdentity;
469
+ request: HarnessRunRequestFor<H, T>;
470
+ }
471
+ interface DurableDispatchAck<T = unknown, H extends Harness = Harness> {
472
+ executionId: string;
473
+ requestKey: string;
474
+ runnerRef: string;
475
+ completion: Promise<DurableSettlement<T, H>>;
476
+ }
477
+ interface DurableLiveHandle<T = unknown, H extends Harness = Harness> {
478
+ runnerRef: string;
479
+ completion: Promise<DurableSettlement<T, H>>;
480
+ }
481
+ type DurableReconcileOutcome<H extends Harness = Harness> = ExecutionReconcileOutcome<DurableHarnessSuccess<unknown, H>, DurableLiveHandle<unknown, H>>;
482
+ type DurableCancelResult<H extends Harness = Harness> = {
483
+ kind: "requested";
484
+ record: DurableHarnessRecord<H>;
485
+ } | {
486
+ kind: "not_live";
487
+ evidence: string;
488
+ } | {
489
+ kind: "ownership_lost";
490
+ record?: DurableHarnessRecord<H>;
491
+ evidence: string;
492
+ };
493
+ interface DurableHarnessDispatcher<H extends Harness> {
494
+ readonly adapter: HarnessAdapter<H>;
495
+ dispatch<T>(input: DurableDispatchInput<H, T>): Promise<DurableDispatchAck<T, H>>;
496
+ reconcile(executionId: string): Promise<DurableReconcileOutcome<H>>;
497
+ cancel(executionId: string, reason: string): DurableCancelResult<H>;
498
+ }
499
+ interface DurableHarnessDispatcherOptions<H extends Harness> {
500
+ ledger: ExecutionLedger<DurableHarnessSuccess<unknown, H>>;
501
+ supervisorId: string;
502
+ leaseMs: number;
503
+ renewEveryMs?: number;
504
+ }
505
+ interface DurableHarnessDispatcherDeps {
506
+ eventId?: () => string;
507
+ now?: () => number;
508
+ setInterval?: typeof globalThis.setInterval;
509
+ clearInterval?: typeof globalThis.clearInterval;
510
+ }
511
+
512
+ declare function createDurableHarnessDispatcher<H extends Harness>(adapter: DurableHarnessDispatcher<H>["adapter"], options: DurableHarnessDispatcherOptions<H>, deps?: DurableHarnessDispatcherDeps): DurableHarnessDispatcher<H>;
513
+
514
+ interface ClaudeCodeAdapterOptions {
515
+ maxTurns: number;
516
+ maxBudgetUsd: number;
517
+ inactivityTimeoutMs?: number;
518
+ deps?: AgentRunDeps;
519
+ }
520
+ /** Existing Claude query circuit breakers remain mandatory; their native units stay explicit. */
521
+ declare function createClaudeCodeAdapter(options: ClaudeCodeAdapterOptions): HarnessAdapter<"claude-code">;
522
+ declare function claudeCodeCapabilities(): HarnessCapabilityDescriptor<"claude-code">;
523
+
524
+ export { ANTI_NESTING_VARS, type AgentFailure, type AgentFailureKind, type AgentInit, type AgentRunConfig, type AgentRunDeps, type AgentRunResult, type AgentUsage, AuthMisconfiguredError, type BoundedRunBase, CLAUDE_CODE_PASSTHROUGH_VARS, CODEX_APPROVAL_POLICIES, CODEX_SANDBOXES, type CapabilityAssessment, type ClassifyOptions, type ClaudeCodeAdapterOptions, type ClaudeCodeNativeOptions, type ClaudeCodeRunRequest, type CodexApprovalPolicy, type CodexExecAdapterOptions, type CodexExecDeps, type CodexNativeOptions, type CodexOutputSchema, type CodexProcessExit, type CodexProcessInput, type CodexRunRequest, type CodexSandbox, type CodexSchemaFile, type CodexVersionInspectionOptions, DEFAULT_CODEX_EXECUTABLE, DEFAULT_CODEX_KILL_GRACE_MS, DEFAULT_INACTIVITY_MS, DEFAULT_MAX_RETRIES, type DurableCancelResult, type DurableDispatchAck, type DurableDispatchInput, type DurableHarnessDispatcher, type DurableHarnessDispatcherDeps, type DurableHarnessDispatcherOptions, type DurableHarnessRecord, type DurableHarnessSuccess, type DurableLiveHandle, type DurableReconcileOutcome, type DurableSettlement, EXECUTION_CAPABILITIES, type ExecutionCapability, type ExecutionLimit, FORBIDDEN_API_KEY_SOURCES, type Harness, type HarnessAdapter, type HarnessCapabilityDescriptor, type HarnessRunFailure, type HarnessRunOutput, type HarnessRunProgress, type HarnessRunRequest, type HarnessRunRequestFor, type HarnessRunResult, type LimitCapability, type LimitEnforcement, type LimitScope, type LimitUnit, type OptionalLimitUnit, type PrepareEnvOptions, type RunTarget, STRIPPED_AUTH_VARS, STRIPPED_CODEX_AUTH_VARS, STRIPPED_PROXY_VARS, SUPPORTED_CODEX_EXEC_VERSION, type SupervisedCodexProcess, type TranscriptSourceHint, assertApiKeySourceAllowed, assertAuthEnvOk, buildCodexExecArgs, classifyResult, claudeCodeCapabilities, codexExecCapabilities, createClaudeCodeAdapter, createCodexExecAdapter, createDurableHarnessDispatcher, dispatchHarnessRun, preflightHarnessRun, prepareCodexEnv, prepareEnv, runAgent, sumModelCost, usageFromResult };