@tangle-network/agent-interface 0.19.0 → 0.21.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.
@@ -0,0 +1,518 @@
1
+ import type { AgentProfile, AgentProfileFileMount, AgentProfileHookCommand, AgentProfileMcpServer, AgentProfileMode, AgentProfileModelHints, AgentProfileResources, AgentSubagentProfile, ReasoningEffort } from "./agent-profile.js";
2
+ import type { HarnessType } from "./harness.js";
3
+ /** Full SHA-256 digest with an explicit algorithm prefix. */
4
+ export type Sha256Digest = `sha256:${string}`;
5
+ /** RFC 8785 JSON Canonicalization Scheme followed by SHA-256. */
6
+ export type AgentCandidateDigestAlgorithm = "rfc8785-sha256";
7
+ export interface AgentCandidateS3Locator {
8
+ kind: "s3";
9
+ bucket: string;
10
+ key: string;
11
+ region?: string;
12
+ }
13
+ export interface AgentCandidateIpfsLocator {
14
+ kind: "ipfs";
15
+ cid: string;
16
+ path?: string;
17
+ }
18
+ /** Closed locator set whose resolvers cannot choose arbitrary URL schemes. */
19
+ export type AgentCandidateArtifactLocator = AgentCandidateS3Locator | AgentCandidateIpfsLocator;
20
+ /** Content-addressed artifact stored outside the candidate manifest. */
21
+ export interface AgentCandidateArtifactRef {
22
+ locator: AgentCandidateArtifactLocator;
23
+ sha256: Sha256Digest;
24
+ byteLength: number;
25
+ }
26
+ /** Bytes embedded directly in a candidate manifest. */
27
+ export interface AgentCandidateEmbeddedArtifact {
28
+ encoding: "base64";
29
+ content: string;
30
+ sha256: Sha256Digest;
31
+ byteLength: number;
32
+ }
33
+ /** Captured bytes are either embedded for portable/local runs or stored by a closed resolver. */
34
+ export type AgentCandidateCapturedArtifact = AgentCandidateArtifactRef | AgentCandidateEmbeddedArtifact;
35
+ /** A deliberately public value; producers remain responsible for secret scanning. */
36
+ export interface AgentCandidatePublicValue {
37
+ kind: "public";
38
+ value: string;
39
+ }
40
+ export type AgentCandidateConfigValue = AgentCandidatePublicValue;
41
+ export interface AgentCandidateGitHubRepository {
42
+ kind: "github";
43
+ owner: string;
44
+ repo: string;
45
+ }
46
+ /** Text embedded in the bundle and checked again by the runtime verifier. */
47
+ export interface AgentCandidateInlineResource {
48
+ kind: "inline";
49
+ name: string;
50
+ content: string;
51
+ sha256: Sha256Digest;
52
+ byteLength: number;
53
+ }
54
+ /** GitHub content pinned to a full Git object id and expected content digest. */
55
+ export interface AgentCandidateGitHubResource {
56
+ kind: "github";
57
+ repository: AgentCandidateGitHubRepository;
58
+ path: string;
59
+ commit: string;
60
+ name?: string;
61
+ sha256: Sha256Digest;
62
+ byteLength: number;
63
+ }
64
+ export type AgentCandidateResourceRef = AgentCandidateInlineResource | AgentCandidateGitHubResource;
65
+ export interface AgentCandidateFileMount extends Omit<AgentProfileFileMount, "resource"> {
66
+ resource: AgentCandidateResourceRef;
67
+ }
68
+ export interface AgentCandidateResources extends Omit<AgentProfileResources, "files" | "tools" | "skills" | "agents" | "commands" | "instructions" | "failOnError"> {
69
+ files?: AgentCandidateFileMount[];
70
+ tools?: AgentCandidateResourceRef[];
71
+ skills?: AgentCandidateResourceRef[];
72
+ agents?: AgentCandidateResourceRef[];
73
+ commands?: AgentCandidateResourceRef[];
74
+ instructions?: string | AgentCandidateResourceRef;
75
+ failOnError: true;
76
+ }
77
+ export interface AgentCandidateMcpServer extends Omit<AgentProfileMcpServer, "transport" | "args" | "env" | "headers" | "url" | "metadata"> {
78
+ transport?: "stdio";
79
+ args?: AgentCandidateConfigValue[];
80
+ env?: Record<string, AgentCandidateConfigValue>;
81
+ }
82
+ export type AgentCandidateModelHints = Omit<AgentProfileModelHints, "metadata">;
83
+ export type AgentCandidateSubagentProfile = Omit<AgentSubagentProfile, "metadata">;
84
+ export type AgentCandidateMode = Omit<AgentProfileMode, "metadata">;
85
+ export interface AgentCandidateHookCommand extends Omit<AgentProfileHookCommand, "command" | "env"> {
86
+ executable: string;
87
+ args?: AgentCandidateConfigValue[];
88
+ env?: Record<string, AgentCandidateConfigValue>;
89
+ }
90
+ /**
91
+ * Recursively strict, immutable form of AgentProfile used inside a candidate.
92
+ * Mutable resource locators and plaintext credential-bearing config are replaced
93
+ * by content-addressed resources and named secret references.
94
+ */
95
+ export interface AgentCandidateProfile extends Omit<AgentProfile, "model" | "mcp" | "connections" | "subagents" | "resources" | "hooks" | "modes" | "metadata" | "extensions"> {
96
+ model?: AgentCandidateModelHints;
97
+ mcp?: Record<string, AgentCandidateMcpServer>;
98
+ subagents?: Record<string, AgentCandidateSubagentProfile>;
99
+ resources?: AgentCandidateResources;
100
+ hooks?: Record<string, AgentCandidateHookCommand[]>;
101
+ modes?: Record<string, AgentCandidateMode>;
102
+ }
103
+ export interface AgentCandidateCodeDisabled {
104
+ kind: "disabled";
105
+ /** `control` marks a comparison arm; `not-applicable` disables only the code surface. */
106
+ reason: "control" | "not-applicable";
107
+ }
108
+ /** A code proposer ran against this exact tree and returned no change. */
109
+ export interface AgentCandidateCodeNoOp {
110
+ kind: "no-op";
111
+ reason: "proposer-no-change";
112
+ repository: AgentCandidateGitHubRepository;
113
+ baseCommit: string;
114
+ baseTree: string;
115
+ }
116
+ /** Immutable Git change produced by a code-surface optimizer. */
117
+ export interface AgentCandidateGitPatch {
118
+ kind: "git-patch";
119
+ repository: AgentCandidateGitHubRepository;
120
+ baseCommit: string;
121
+ baseTree: string;
122
+ candidateTree: string;
123
+ patch: {
124
+ format: "git-diff-binary";
125
+ artifact: AgentCandidateEmbeddedArtifact;
126
+ };
127
+ }
128
+ export type AgentCandidateCode = AgentCandidateCodeDisabled | AgentCandidateCodeNoOp | AgentCandidateGitPatch;
129
+ /** Pinned base image selected by the candidate contract. */
130
+ export interface AgentCandidateContainer {
131
+ image: string;
132
+ indexDigest: Sha256Digest;
133
+ }
134
+ /** Candidate-selected container whose bytes are fixed in the bundle. */
135
+ export interface AgentCandidatePinnedContainerEnvironment {
136
+ kind: "pinned-container";
137
+ container: AgentCandidateContainer;
138
+ }
139
+ /**
140
+ * Benchmark-controlled task container selected per task by the evaluator.
141
+ *
142
+ * The runtime must bind the selected image index, manifest, platform, and task
143
+ * workspace in the per-task execution plan and materialization receipt.
144
+ */
145
+ export interface AgentCandidateEvaluatorTaskEnvironment {
146
+ kind: "evaluator-task-container";
147
+ }
148
+ export type AgentCandidateExecutionEnvironment = AgentCandidatePinnedContainerEnvironment | AgentCandidateEvaluatorTaskEnvironment;
149
+ export interface AgentCandidateWorkingDirectory {
150
+ workspace: "candidate" | "task";
151
+ path: string;
152
+ }
153
+ export interface AgentCandidateContainerLaunch {
154
+ kind: "container-command";
155
+ executable: string;
156
+ args?: AgentCandidateConfigValue[];
157
+ }
158
+ export interface AgentCandidateEntrypointLaunch {
159
+ kind: "candidate-entrypoint";
160
+ entrypoint: string;
161
+ interpreter?: "node" | "python" | "python3" | "bun" | "deno" | "tsx" | "uv";
162
+ args?: AgentCandidateConfigValue[];
163
+ }
164
+ export type AgentCandidateLaunch = AgentCandidateContainerLaunch | AgentCandidateEntrypointLaunch;
165
+ /** Closed delivery modes for the exact agent-visible UTF-8 task instruction. */
166
+ export type AgentCandidateInstructionDelivery =
167
+ /** Append one final argv element after candidate args and materializer flags. */
168
+ {
169
+ kind: "argv-append";
170
+ }
171
+ /** Write the exact bytes to stdin, then close stdin. */
172
+ | {
173
+ kind: "stdin-utf8";
174
+ }
175
+ /** Write exact bytes to the fixed path and expose that path through the fixed env name. */
176
+ | {
177
+ kind: "utf8-file";
178
+ env: "TANGLE_CANDIDATE_TASK_PATH";
179
+ path: "/tangle/input/task.txt";
180
+ };
181
+ /** Shell-free execution contract for replaying a candidate. */
182
+ export interface AgentCandidateExecution {
183
+ harness: HarnessType;
184
+ harnessVersion: string;
185
+ launch: AgentCandidateLaunch;
186
+ instructionDelivery: AgentCandidateInstructionDelivery;
187
+ cwd: AgentCandidateWorkingDirectory;
188
+ env?: Record<string, AgentCandidateConfigValue>;
189
+ environment: AgentCandidateExecutionEnvironment;
190
+ /** Complete executable directory after build, before task execution. */
191
+ workspace?: AgentCandidateWorkspaceSnapshotEvidence;
192
+ isolation: {
193
+ network: "disabled";
194
+ remoteIntegrations: "disabled";
195
+ candidateSecrets: "disabled";
196
+ };
197
+ }
198
+ /** Optional immutable knowledge snapshot mounted with the profile. */
199
+ export interface AgentCandidateKnowledge {
200
+ snapshotId: string;
201
+ manifest: AgentCandidateArtifactRef;
202
+ }
203
+ /** Memory is absent or freshly evaluator-scoped to exactly one task. */
204
+ export type AgentCandidateMemoryPolicy = {
205
+ mode: "disabled";
206
+ } | {
207
+ mode: "isolated";
208
+ scope: "task";
209
+ seed?: AgentCandidateArtifactRef;
210
+ };
211
+ /** Captured model spend for one phase of candidate production. */
212
+ export interface AgentCandidateSpend {
213
+ costUsd: number;
214
+ inputTokens: number;
215
+ outputTokens: number;
216
+ cachedInputTokens?: number;
217
+ modelCalls: number;
218
+ }
219
+ /** Evidence and ancestry that produced the immutable candidate. */
220
+ export interface AgentCandidateLineage {
221
+ source: "optimizer" | "human" | "import" | "compound";
222
+ parentDigests?: Sha256Digest[];
223
+ runIds?: string[];
224
+ profileDiffIds?: string[];
225
+ modelSnapshots?: string[];
226
+ benchmark?: {
227
+ name: string;
228
+ version: string;
229
+ splitDigest: Sha256Digest;
230
+ };
231
+ spend?: {
232
+ proposal: AgentCandidateSpend;
233
+ evaluation: AgentCandidateSpend;
234
+ };
235
+ }
236
+ /**
237
+ * Portable, immutable output of agent improvement.
238
+ *
239
+ * The digest is RFC 8785 canonical JSON hashed with SHA-256 after omitting the
240
+ * digest field itself. Parsing proves structure only. Consumers must use the
241
+ * runtime integrity verifier before materialization; the carried digest and all
242
+ * artifact hashes are untrusted until recomputed.
243
+ */
244
+ export interface AgentCandidateBundleV1 {
245
+ schemaVersion: 1;
246
+ kind: "agent-candidate-bundle";
247
+ digestAlgorithm: AgentCandidateDigestAlgorithm;
248
+ profile: AgentCandidateProfile;
249
+ code: AgentCandidateCode;
250
+ execution: AgentCandidateExecution;
251
+ knowledge?: AgentCandidateKnowledge;
252
+ memory: AgentCandidateMemoryPolicy;
253
+ lineage: AgentCandidateLineage;
254
+ digest: Sha256Digest;
255
+ }
256
+ export type AgentCandidateBundle = AgentCandidateBundleV1;
257
+ export interface AgentCandidateEntrypointReceipt {
258
+ path: string;
259
+ sha256: Sha256Digest;
260
+ byteLength: number;
261
+ }
262
+ export interface AgentCandidateOciPlatform {
263
+ os: string;
264
+ architecture: string;
265
+ variant?: string;
266
+ }
267
+ export interface AgentCandidateResolvedModel {
268
+ requested: string;
269
+ provider: string;
270
+ model: string;
271
+ snapshot: string;
272
+ reasoningEffort: ReasoningEffort;
273
+ }
274
+ /** Canonical, digest-free profile-plan identity document. */
275
+ export interface AgentCandidateProfilePlanMaterialV1 {
276
+ version: 1;
277
+ harness: HarnessType;
278
+ files: Array<{
279
+ relPath: string;
280
+ mode: number;
281
+ contentSha256: Sha256Digest;
282
+ }>;
283
+ env: Record<string, AgentCandidateConfigValue>;
284
+ flags: AgentCandidateConfigValue[];
285
+ unsupported: Array<{
286
+ dimension: string;
287
+ reason: string;
288
+ }>;
289
+ }
290
+ export interface AgentCandidateWorkspaceManifestMaterialV1 {
291
+ schemaVersion: 1;
292
+ kind: "agent-candidate-workspace-manifest";
293
+ files: Array<{
294
+ path: string;
295
+ mode: 0o644 | 0o755;
296
+ sha256: Sha256Digest;
297
+ byteLength: number;
298
+ }>;
299
+ }
300
+ /** Content-addressed manifest of every file uploaded to one workspace. */
301
+ export interface AgentCandidateWorkspaceSnapshotEvidence {
302
+ schemaVersion: 1;
303
+ kind: "agent-candidate-workspace-snapshot";
304
+ digest: Sha256Digest;
305
+ material: AgentCandidateWorkspaceManifestMaterialV1;
306
+ manifest: AgentCandidateCapturedArtifact;
307
+ archive: AgentCandidateCapturedArtifact;
308
+ }
309
+ export interface AgentCandidateMemoryReset {
310
+ kind: "fresh";
311
+ evidence: AgentCandidateCapturedArtifact;
312
+ emptyStateDigest: Sha256Digest;
313
+ }
314
+ export type AgentCandidateEffectiveMemory = {
315
+ mode: "disabled";
316
+ } | {
317
+ mode: "isolated";
318
+ scope: "task";
319
+ effectiveNamespace: string;
320
+ reset: AgentCandidateMemoryReset;
321
+ beforeState: AgentCandidateWorkspaceSnapshotEvidence;
322
+ seedDigest?: Sha256Digest;
323
+ };
324
+ /** The exact evaluator-owned limits applied to every candidate arm. */
325
+ export interface AgentCandidateExecutionLimits {
326
+ timeoutMs: number;
327
+ maxSteps: number;
328
+ maxModelCalls: number;
329
+ maxInputTokens: number;
330
+ maxOutputTokens: number;
331
+ maxCostUsd: number;
332
+ }
333
+ /** Counted attempt identity and the only retry class allowed by the evaluator. */
334
+ export interface AgentCandidateAttemptPolicy {
335
+ number: number;
336
+ maxAttempts: number;
337
+ retryPolicy: "pre-model-infrastructure-only" | "none";
338
+ }
339
+ /** Exact workspace placement of one fully supported profile plan. */
340
+ export interface AgentCandidateProfileApplication {
341
+ planDigest: Sha256Digest;
342
+ targetWorkspace: AgentCandidateWorkingDirectory["workspace"];
343
+ mountPaths: string[];
344
+ }
345
+ /**
346
+ * Canonical, digest-free per-task execution identity document.
347
+ *
348
+ * RFC 8785 serialization of this material is stored verbatim by the receipt;
349
+ * its raw SHA-256 is the execution-plan digest.
350
+ */
351
+ export interface AgentCandidateExecutionPlanMaterialV1 {
352
+ schemaVersion: 1;
353
+ kind: "agent-candidate-execution-plan-material";
354
+ bundleDigest: Sha256Digest;
355
+ executionId: string;
356
+ attempt: AgentCandidateAttemptPolicy;
357
+ task: {
358
+ benchmark: string;
359
+ benchmarkVersion: string;
360
+ taskId: string;
361
+ splitDigest: Sha256Digest;
362
+ instruction: {
363
+ encoding: "utf8";
364
+ sha256: Sha256Digest;
365
+ byteLength: number;
366
+ delivery: AgentCandidateInstructionDelivery;
367
+ };
368
+ repository: {
369
+ identity: string;
370
+ rootIdentity: string;
371
+ baseCommit: string;
372
+ baseTree: string;
373
+ };
374
+ workspace: AgentCandidateWorkspaceSnapshotEvidence;
375
+ };
376
+ workspaces: {
377
+ taskRoot: string;
378
+ candidateRoot?: string;
379
+ };
380
+ codeKind: AgentCandidateCode["kind"];
381
+ candidateWorkspace?: AgentCandidateWorkspaceSnapshotEvidence;
382
+ profile: AgentCandidateProfileApplication;
383
+ harness: HarnessType;
384
+ harnessVersion: string;
385
+ container: {
386
+ source: AgentCandidateExecutionEnvironment["kind"];
387
+ image: string;
388
+ indexDigest: Sha256Digest;
389
+ manifestDigest: Sha256Digest;
390
+ platform: AgentCandidateOciPlatform;
391
+ };
392
+ model: {
393
+ policy: "single";
394
+ resolved: AgentCandidateResolvedModel;
395
+ access: {
396
+ kind: "evaluator-mediated";
397
+ grantDigest: Sha256Digest;
398
+ };
399
+ routes: Array<{
400
+ kind: "primary";
401
+ requested?: string;
402
+ } | {
403
+ kind: "small";
404
+ requested: string;
405
+ } | {
406
+ kind: "mode";
407
+ name: string;
408
+ requested: string;
409
+ } | {
410
+ kind: "subagent";
411
+ name: string;
412
+ requested: string;
413
+ }>;
414
+ };
415
+ launch: {
416
+ executable: string;
417
+ args: AgentCandidateConfigValue[];
418
+ env: Record<string, AgentCandidateConfigValue>;
419
+ cwd: AgentCandidateWorkingDirectory;
420
+ };
421
+ knowledgeManifestDigest?: Sha256Digest;
422
+ memory: AgentCandidateEffectiveMemory;
423
+ limits: AgentCandidateExecutionLimits;
424
+ network: {
425
+ mode: "disabled";
426
+ };
427
+ }
428
+ export interface AgentCandidateProfilePlanEvidence {
429
+ schemaVersion: 1;
430
+ kind: "agent-profile-workspace-plan";
431
+ digest: Sha256Digest;
432
+ material: AgentCandidateProfilePlanMaterialV1;
433
+ artifact: AgentCandidateCapturedArtifact;
434
+ }
435
+ export interface AgentCandidateExecutionPlanEvidence {
436
+ schemaVersion: 1;
437
+ kind: "agent-candidate-execution-plan";
438
+ digest: Sha256Digest;
439
+ material: AgentCandidateExecutionPlanMaterialV1;
440
+ artifact: AgentCandidateCapturedArtifact;
441
+ }
442
+ export interface AgentCandidateTraceEvidence {
443
+ schemaVersion: 1;
444
+ artifact: AgentCandidateCapturedArtifact;
445
+ eventCount: number;
446
+ modelCallCount: number;
447
+ }
448
+ export interface AgentCandidateModelUsage {
449
+ resolved: AgentCandidateResolvedModel;
450
+ usage: AgentCandidateSpend;
451
+ }
452
+ export type AgentCandidateMemoryReceipt = {
453
+ mode: "disabled";
454
+ } | {
455
+ mode: "isolated";
456
+ scope: "task";
457
+ effectiveNamespace: string;
458
+ resetEvidenceDigest: Sha256Digest;
459
+ beforeStateDigest: Sha256Digest;
460
+ afterState: AgentCandidateWorkspaceSnapshotEvidence;
461
+ };
462
+ /** Proof emitted after a runtime materializes, but before it executes, a bundle. */
463
+ export interface AgentCandidateMaterializationReceiptV1 {
464
+ schemaVersion: 1;
465
+ kind: "agent-candidate-materialization";
466
+ digestAlgorithm: AgentCandidateDigestAlgorithm;
467
+ bundleDigest: Sha256Digest;
468
+ profilePlan: AgentCandidateProfilePlanEvidence;
469
+ executionPlan: AgentCandidateExecutionPlanEvidence;
470
+ candidateWorkspace?: AgentCandidateWorkspaceSnapshotEvidence;
471
+ codeKind: AgentCandidateCode["kind"];
472
+ materializedTree?: string;
473
+ harness: HarnessType;
474
+ harnessVersion: string;
475
+ container: {
476
+ source: AgentCandidateExecutionEnvironment["kind"];
477
+ image: string;
478
+ indexDigest: Sha256Digest;
479
+ manifestDigest: Sha256Digest;
480
+ platform: AgentCandidateOciPlatform;
481
+ };
482
+ resolvedModel: AgentCandidateResolvedModel;
483
+ knowledgeManifestDigest?: Sha256Digest;
484
+ entrypoint?: AgentCandidateEntrypointReceipt;
485
+ digest: Sha256Digest;
486
+ }
487
+ export type AgentCandidateMaterializationReceipt = AgentCandidateMaterializationReceiptV1;
488
+ /** How an execution ended, independent of whether protected evidence capture completed. */
489
+ export type AgentCandidateTermination = {
490
+ kind: "exit";
491
+ exitCode: number;
492
+ } | {
493
+ kind: "timeout";
494
+ timeoutMs: number;
495
+ } | {
496
+ kind: "signal";
497
+ signal: string;
498
+ } | {
499
+ kind: "cancelled";
500
+ };
501
+ /** Proof emitted after the exact materialized plan finishes executing. */
502
+ export interface AgentCandidateRunReceiptV1 {
503
+ schemaVersion: 1;
504
+ kind: "agent-candidate-run";
505
+ digestAlgorithm: AgentCandidateDigestAlgorithm;
506
+ bundleDigest: Sha256Digest;
507
+ materializationReceiptDigest: Sha256Digest;
508
+ executionPlanDigest: Sha256Digest;
509
+ memory: AgentCandidateMemoryReceipt;
510
+ usage: AgentCandidateSpend;
511
+ modelUsage: AgentCandidateModelUsage;
512
+ trace: AgentCandidateTraceEvidence;
513
+ termination: AgentCandidateTermination;
514
+ digest: Sha256Digest;
515
+ }
516
+ export type AgentCandidateRunReceipt = AgentCandidateRunReceiptV1;
517
+ /** Declare a candidate bundle while retaining literal inference. */
518
+ export declare function defineAgentCandidateBundle<T extends AgentCandidateBundle>(bundle: T): T;
@@ -0,0 +1,6 @@
1
+ /** Declare a candidate bundle while retaining literal inference. */
2
+ export function defineAgentCandidateBundle(bundle) {
3
+ return bundle;
4
+ }
5
+ const _mutableResourceMustNotSatisfyFrozen = true;
6
+ void _mutableResourceMustNotSatisfyFrozen;
@@ -0,0 +1,160 @@
1
+ export declare const candidateSha: (digit: string) => `sha256:${string}`;
2
+ export declare const candidateGit: (digit: string) => string;
3
+ export declare function candidateFixture(): {
4
+ schemaVersion: 1;
5
+ kind: "agent-candidate-bundle";
6
+ digestAlgorithm: "rfc8785-sha256";
7
+ profile: {
8
+ name: string;
9
+ harness: "codex";
10
+ model: {
11
+ default: string;
12
+ reasoningEffort: "high";
13
+ };
14
+ prompt: {
15
+ systemPrompt: string;
16
+ };
17
+ resources: {
18
+ files: {
19
+ path: string;
20
+ resource: {
21
+ kind: "inline";
22
+ name: string;
23
+ content: string;
24
+ sha256: `sha256:${string}`;
25
+ byteLength: number;
26
+ };
27
+ }[];
28
+ failOnError: true;
29
+ };
30
+ };
31
+ code: {
32
+ kind: "git-patch";
33
+ repository: {
34
+ kind: "github";
35
+ owner: string;
36
+ repo: string;
37
+ };
38
+ baseCommit: string;
39
+ baseTree: string;
40
+ candidateTree: string;
41
+ patch: {
42
+ format: "git-diff-binary";
43
+ artifact: {
44
+ encoding: "base64";
45
+ content: string;
46
+ sha256: `sha256:${string}`;
47
+ byteLength: number;
48
+ };
49
+ };
50
+ };
51
+ execution: {
52
+ harness: "codex";
53
+ harnessVersion: string;
54
+ launch: {
55
+ kind: "candidate-entrypoint";
56
+ interpreter: "node";
57
+ entrypoint: string;
58
+ args: {
59
+ kind: "public";
60
+ value: string;
61
+ }[];
62
+ };
63
+ instructionDelivery: {
64
+ kind: "argv-append";
65
+ };
66
+ cwd: {
67
+ workspace: "candidate";
68
+ path: string;
69
+ };
70
+ env: {
71
+ NODE_ENV: {
72
+ kind: "public";
73
+ value: string;
74
+ };
75
+ };
76
+ environment: {
77
+ kind: "pinned-container";
78
+ container: {
79
+ image: string;
80
+ indexDigest: `sha256:${string}`;
81
+ };
82
+ };
83
+ workspace: {
84
+ schemaVersion: 1;
85
+ kind: "agent-candidate-workspace-snapshot";
86
+ digest: `sha256:${string}`;
87
+ material: {
88
+ schemaVersion: 1;
89
+ kind: "agent-candidate-workspace-manifest";
90
+ files: {
91
+ path: string;
92
+ mode: 493;
93
+ sha256: `sha256:${string}`;
94
+ byteLength: number;
95
+ }[];
96
+ };
97
+ manifest: {
98
+ encoding: "base64";
99
+ content: string;
100
+ sha256: `sha256:${string}`;
101
+ byteLength: number;
102
+ };
103
+ archive: {
104
+ encoding: "base64";
105
+ content: string;
106
+ sha256: `sha256:${string}`;
107
+ byteLength: number;
108
+ };
109
+ };
110
+ isolation: {
111
+ network: "disabled";
112
+ remoteIntegrations: "disabled";
113
+ candidateSecrets: "disabled";
114
+ };
115
+ };
116
+ knowledge: {
117
+ snapshotId: string;
118
+ manifest: {
119
+ locator: {
120
+ kind: "s3";
121
+ bucket: string;
122
+ key: string;
123
+ region: string;
124
+ };
125
+ sha256: `sha256:${string}`;
126
+ byteLength: number;
127
+ };
128
+ };
129
+ memory: {
130
+ mode: "isolated";
131
+ scope: "task";
132
+ };
133
+ lineage: {
134
+ source: "optimizer";
135
+ parentDigests: `sha256:${string}`[];
136
+ runIds: string[];
137
+ profileDiffIds: string[];
138
+ modelSnapshots: string[];
139
+ benchmark: {
140
+ name: string;
141
+ version: string;
142
+ splitDigest: `sha256:${string}`;
143
+ };
144
+ spend: {
145
+ proposal: {
146
+ costUsd: number;
147
+ inputTokens: number;
148
+ outputTokens: number;
149
+ modelCalls: number;
150
+ };
151
+ evaluation: {
152
+ costUsd: number;
153
+ inputTokens: number;
154
+ outputTokens: number;
155
+ modelCalls: number;
156
+ };
157
+ };
158
+ };
159
+ digest: `sha256:${string}`;
160
+ };