@tangle-network/agent-interface 2.20.1 → 3.1.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.
Files changed (58) hide show
  1. package/README.md +18 -23
  2. package/dist/agent-candidate-artifact-schema.d.ts +0 -4
  3. package/dist/agent-candidate-artifact-schema.js +1 -1
  4. package/dist/agent-candidate-execution-plan-schema.d.ts +52 -52
  5. package/dist/agent-candidate-promotion-schema.d.ts +340 -340
  6. package/dist/agent-candidate-receipt-schema.d.ts +68 -68
  7. package/dist/agent-candidate-schema-common.d.ts +0 -5
  8. package/dist/agent-candidate-schema-common.js +0 -27
  9. package/dist/agent-execution-limits.d.ts +0 -18
  10. package/dist/agent-execution-limits.js +0 -21
  11. package/dist/agent-execution-preparation-receipt.d.ts +2 -0
  12. package/dist/agent-execution-preparation.d.ts +2 -22
  13. package/dist/agent-execution-preparation.js +1 -25
  14. package/dist/agent-improvement-measurement-schema.d.ts +0 -17
  15. package/dist/agent-improvement-measurement-schema.js +3 -3
  16. package/dist/agent-improvement-source.d.ts +0 -2
  17. package/dist/agent-profile-materialization.d.ts +1 -1
  18. package/dist/agent-profile-materialization.js +3 -0
  19. package/dist/agent-profile.d.ts +22 -0
  20. package/dist/agent-workspace-lease.d.ts +0 -23
  21. package/dist/agent-workspace-lease.js +0 -4
  22. package/dist/contract-limits.d.ts +0 -3
  23. package/dist/contract-limits.js +0 -10
  24. package/dist/environment-interactive-control.d.ts +10 -0
  25. package/dist/environment-interactive-start.d.ts +28 -2
  26. package/dist/environment-interactive-start.js +1 -1
  27. package/dist/environment-observation.d.ts +0 -17
  28. package/dist/environment-observation.js +0 -13
  29. package/dist/environment-provider.d.ts +2 -1
  30. package/dist/environment-provider.js +2 -1
  31. package/dist/environment-runtime.d.ts +30 -16
  32. package/dist/environment-runtime.js +1 -5
  33. package/dist/index.d.ts +1 -3
  34. package/dist/index.js +1 -3
  35. package/dist/interaction-fields.d.ts +0 -1
  36. package/dist/interaction-response-validation.d.ts +0 -5
  37. package/dist/interaction-response-validation.js +0 -12
  38. package/dist/parts.d.ts +0 -3
  39. package/dist/parts.js +0 -9
  40. package/dist/plan.d.ts +0 -8
  41. package/dist/plan.js +0 -6
  42. package/dist/profile-diff.d.ts +2 -2
  43. package/dist/profile-diff.js +3 -31
  44. package/dist/profile-kb/index.d.ts +1 -22
  45. package/dist/profile-kb/index.js +1 -23
  46. package/dist/profile-schema.d.ts +58 -0
  47. package/dist/profile-schema.js +45 -0
  48. package/dist/runtime-control.d.ts +0 -61
  49. package/dist/runtime-control.js +0 -76
  50. package/dist/workspace-confidentiality.d.ts +0 -2
  51. package/dist/workspace-confidentiality.js +1 -1
  52. package/package.json +1 -11
  53. package/dist/agent-instance.d.ts +0 -98
  54. package/dist/agent-instance.js +0 -105
  55. package/dist/certified-context.d.ts +0 -118
  56. package/dist/certified-context.js +0 -220
  57. package/dist/environment-interactive.d.ts +0 -2
  58. package/dist/environment-interactive.js +0 -2
@@ -253,11 +253,6 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
253
253
  }[];
254
254
  };
255
255
  artifact: {
256
- encoding: "base64";
257
- content: string;
258
- sha256: `sha256:${string}`;
259
- byteLength: number;
260
- } | {
261
256
  locator: {
262
257
  kind: "s3";
263
258
  bucket: string;
@@ -274,6 +269,11 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
274
269
  };
275
270
  sha256: `sha256:${string}`;
276
271
  byteLength: number;
272
+ } | {
273
+ encoding: "base64";
274
+ content: string;
275
+ sha256: `sha256:${string}`;
276
+ byteLength: number;
277
277
  };
278
278
  }, unknown, z.core.$ZodTypeInternals<{
279
279
  kind: "agent-profile-workspace-plan";
@@ -309,11 +309,6 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
309
309
  }[];
310
310
  };
311
311
  artifact: {
312
- encoding: "base64";
313
- content: string;
314
- sha256: `sha256:${string}`;
315
- byteLength: number;
316
- } | {
317
312
  locator: {
318
313
  kind: "s3";
319
314
  bucket: string;
@@ -330,6 +325,11 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
330
325
  };
331
326
  sha256: `sha256:${string}`;
332
327
  byteLength: number;
328
+ } | {
329
+ encoding: "base64";
330
+ content: string;
331
+ sha256: `sha256:${string}`;
332
+ byteLength: number;
333
333
  };
334
334
  }, unknown>>;
335
335
  files: z.ZodArray<z.ZodObject<{
@@ -377,11 +377,6 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
377
377
  }[];
378
378
  };
379
379
  manifest: {
380
- encoding: "base64";
381
- content: string;
382
- sha256: `sha256:${string}`;
383
- byteLength: number;
384
- } | {
385
380
  locator: {
386
381
  kind: "s3";
387
382
  bucket: string;
@@ -398,13 +393,13 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
398
393
  };
399
394
  sha256: `sha256:${string}`;
400
395
  byteLength: number;
401
- };
402
- archive: {
396
+ } | {
403
397
  encoding: "base64";
404
398
  content: string;
405
399
  sha256: `sha256:${string}`;
406
400
  byteLength: number;
407
- } | {
401
+ };
402
+ archive: {
408
403
  locator: {
409
404
  kind: "s3";
410
405
  bucket: string;
@@ -421,6 +416,11 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
421
416
  };
422
417
  sha256: `sha256:${string}`;
423
418
  byteLength: number;
419
+ } | {
420
+ encoding: "base64";
421
+ content: string;
422
+ sha256: `sha256:${string}`;
423
+ byteLength: number;
424
424
  };
425
425
  } | undefined;
426
426
  profile: {
@@ -517,11 +517,6 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
517
517
  reset: {
518
518
  kind: "fresh";
519
519
  evidence: {
520
- encoding: "base64";
521
- content: string;
522
- sha256: `sha256:${string}`;
523
- byteLength: number;
524
- } | {
525
520
  locator: {
526
521
  kind: "s3";
527
522
  bucket: string;
@@ -538,6 +533,11 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
538
533
  };
539
534
  sha256: `sha256:${string}`;
540
535
  byteLength: number;
536
+ } | {
537
+ encoding: "base64";
538
+ content: string;
539
+ sha256: `sha256:${string}`;
540
+ byteLength: number;
541
541
  };
542
542
  emptyStateDigest: `sha256:${string}`;
543
543
  };
@@ -554,11 +554,6 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
554
554
  }[];
555
555
  };
556
556
  manifest: {
557
- encoding: "base64";
558
- content: string;
559
- sha256: `sha256:${string}`;
560
- byteLength: number;
561
- } | {
562
557
  locator: {
563
558
  kind: "s3";
564
559
  bucket: string;
@@ -575,13 +570,13 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
575
570
  };
576
571
  sha256: `sha256:${string}`;
577
572
  byteLength: number;
578
- };
579
- archive: {
573
+ } | {
580
574
  encoding: "base64";
581
575
  content: string;
582
576
  sha256: `sha256:${string}`;
583
577
  byteLength: number;
584
- } | {
578
+ };
579
+ archive: {
585
580
  locator: {
586
581
  kind: "s3";
587
582
  bucket: string;
@@ -598,6 +593,11 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
598
593
  };
599
594
  sha256: `sha256:${string}`;
600
595
  byteLength: number;
596
+ } | {
597
+ encoding: "base64";
598
+ content: string;
599
+ sha256: `sha256:${string}`;
600
+ byteLength: number;
601
601
  };
602
602
  };
603
603
  seedDigest?: `sha256:${string}` | undefined;
@@ -641,11 +641,6 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
641
641
  }[];
642
642
  };
643
643
  manifest: {
644
- encoding: "base64";
645
- content: string;
646
- sha256: `sha256:${string}`;
647
- byteLength: number;
648
- } | {
649
644
  locator: {
650
645
  kind: "s3";
651
646
  bucket: string;
@@ -662,13 +657,13 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
662
657
  };
663
658
  sha256: `sha256:${string}`;
664
659
  byteLength: number;
665
- };
666
- archive: {
660
+ } | {
667
661
  encoding: "base64";
668
662
  content: string;
669
663
  sha256: `sha256:${string}`;
670
664
  byteLength: number;
671
- } | {
665
+ };
666
+ archive: {
672
667
  locator: {
673
668
  kind: "s3";
674
669
  bucket: string;
@@ -685,6 +680,11 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
685
680
  };
686
681
  sha256: `sha256:${string}`;
687
682
  byteLength: number;
683
+ } | {
684
+ encoding: "base64";
685
+ content: string;
686
+ sha256: `sha256:${string}`;
687
+ byteLength: number;
688
688
  };
689
689
  } | undefined;
690
690
  profile: {
@@ -781,11 +781,6 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
781
781
  reset: {
782
782
  kind: "fresh";
783
783
  evidence: {
784
- encoding: "base64";
785
- content: string;
786
- sha256: `sha256:${string}`;
787
- byteLength: number;
788
- } | {
789
784
  locator: {
790
785
  kind: "s3";
791
786
  bucket: string;
@@ -802,6 +797,11 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
802
797
  };
803
798
  sha256: `sha256:${string}`;
804
799
  byteLength: number;
800
+ } | {
801
+ encoding: "base64";
802
+ content: string;
803
+ sha256: `sha256:${string}`;
804
+ byteLength: number;
805
805
  };
806
806
  emptyStateDigest: `sha256:${string}`;
807
807
  };
@@ -818,11 +818,6 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
818
818
  }[];
819
819
  };
820
820
  manifest: {
821
- encoding: "base64";
822
- content: string;
823
- sha256: `sha256:${string}`;
824
- byteLength: number;
825
- } | {
826
821
  locator: {
827
822
  kind: "s3";
828
823
  bucket: string;
@@ -839,13 +834,13 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
839
834
  };
840
835
  sha256: `sha256:${string}`;
841
836
  byteLength: number;
842
- };
843
- archive: {
837
+ } | {
844
838
  encoding: "base64";
845
839
  content: string;
846
840
  sha256: `sha256:${string}`;
847
841
  byteLength: number;
848
- } | {
842
+ };
843
+ archive: {
849
844
  locator: {
850
845
  kind: "s3";
851
846
  bucket: string;
@@ -862,6 +857,11 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
862
857
  };
863
858
  sha256: `sha256:${string}`;
864
859
  byteLength: number;
860
+ } | {
861
+ encoding: "base64";
862
+ content: string;
863
+ sha256: `sha256:${string}`;
864
+ byteLength: number;
865
865
  };
866
866
  };
867
867
  seedDigest?: `sha256:${string}` | undefined;
@@ -1294,11 +1294,6 @@ export declare const agentCandidateRunReceiptSchema: z.ZodObject<{
1294
1294
  }[];
1295
1295
  };
1296
1296
  manifest: {
1297
- encoding: "base64";
1298
- content: string;
1299
- sha256: `sha256:${string}`;
1300
- byteLength: number;
1301
- } | {
1302
1297
  locator: {
1303
1298
  kind: "s3";
1304
1299
  bucket: string;
@@ -1315,13 +1310,13 @@ export declare const agentCandidateRunReceiptSchema: z.ZodObject<{
1315
1310
  };
1316
1311
  sha256: `sha256:${string}`;
1317
1312
  byteLength: number;
1318
- };
1319
- archive: {
1313
+ } | {
1320
1314
  encoding: "base64";
1321
1315
  content: string;
1322
1316
  sha256: `sha256:${string}`;
1323
1317
  byteLength: number;
1324
- } | {
1318
+ };
1319
+ archive: {
1325
1320
  locator: {
1326
1321
  kind: "s3";
1327
1322
  bucket: string;
@@ -1338,6 +1333,11 @@ export declare const agentCandidateRunReceiptSchema: z.ZodObject<{
1338
1333
  };
1339
1334
  sha256: `sha256:${string}`;
1340
1335
  byteLength: number;
1336
+ } | {
1337
+ encoding: "base64";
1338
+ content: string;
1339
+ sha256: `sha256:${string}`;
1340
+ byteLength: number;
1341
1341
  };
1342
1342
  };
1343
1343
  gitDiff: {
@@ -1416,11 +1416,6 @@ export declare const agentCandidateRunReceiptSchema: z.ZodObject<{
1416
1416
  }[];
1417
1417
  };
1418
1418
  manifest: {
1419
- encoding: "base64";
1420
- content: string;
1421
- sha256: `sha256:${string}`;
1422
- byteLength: number;
1423
- } | {
1424
1419
  locator: {
1425
1420
  kind: "s3";
1426
1421
  bucket: string;
@@ -1437,13 +1432,13 @@ export declare const agentCandidateRunReceiptSchema: z.ZodObject<{
1437
1432
  };
1438
1433
  sha256: `sha256:${string}`;
1439
1434
  byteLength: number;
1440
- };
1441
- archive: {
1435
+ } | {
1442
1436
  encoding: "base64";
1443
1437
  content: string;
1444
1438
  sha256: `sha256:${string}`;
1445
1439
  byteLength: number;
1446
- } | {
1440
+ };
1441
+ archive: {
1447
1442
  locator: {
1448
1443
  kind: "s3";
1449
1444
  bucket: string;
@@ -1460,6 +1455,11 @@ export declare const agentCandidateRunReceiptSchema: z.ZodObject<{
1460
1455
  };
1461
1456
  sha256: `sha256:${string}`;
1462
1457
  byteLength: number;
1458
+ } | {
1459
+ encoding: "base64";
1460
+ content: string;
1461
+ sha256: `sha256:${string}`;
1462
+ byteLength: number;
1463
1463
  };
1464
1464
  };
1465
1465
  gitDiff: {
@@ -40,11 +40,6 @@ export declare const environmentConfigSchema: z.ZodRecord<z.ZodString, z.ZodObje
40
40
  kind: z.ZodLiteral<"public">;
41
41
  value: z.ZodString;
42
42
  }, z.core.$strict>>;
43
- export declare const headerConfigSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
44
- kind: z.ZodLiteral<"public">;
45
- value: z.ZodString;
46
- }, z.core.$strict>>;
47
- export declare const candidateMetadataSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
48
43
  export declare const agentCandidateGitHubRepositorySchema: z.ZodObject<{
49
44
  kind: z.ZodLiteral<"github">;
50
45
  owner: z.ZodString;
@@ -263,33 +263,6 @@ function configRecordSchema(keySchema) {
263
263
  });
264
264
  }
265
265
  export const environmentConfigSchema = configRecordSchema(environmentNameSchema);
266
- export const headerConfigSchema = configRecordSchema(headerNameSchema);
267
- export const candidateMetadataSchema = z
268
- .record(z.string(), z.unknown())
269
- .superRefine((metadata, ctx) => {
270
- if (hasSensitiveMetadataKey(metadata)) {
271
- ctx.addIssue({
272
- code: "custom",
273
- message: "metadata must not contain credential-bearing keys",
274
- });
275
- }
276
- });
277
- function hasSensitiveMetadataKey(value, ancestors = new Set()) {
278
- if (value === null || typeof value !== "object" || ancestors.has(value)) {
279
- return false;
280
- }
281
- const nextAncestors = new Set(ancestors).add(value);
282
- if (Array.isArray(value)) {
283
- return value.some((entry) => hasSensitiveMetadataKey(entry, nextAncestors));
284
- }
285
- for (const [key, entry] of Object.entries(value)) {
286
- if (secretNamePattern.test(key))
287
- return true;
288
- if (hasSensitiveMetadataKey(entry, nextAncestors))
289
- return true;
290
- }
291
- return false;
292
- }
293
266
  export const agentCandidateGitHubRepositorySchema = z
294
267
  .object({
295
268
  kind: z.literal("github"),
@@ -6,27 +6,9 @@ export interface AgentExecutionLimitObservation {
6
6
  steps: number;
7
7
  usage: AgentCandidateFixedSpend;
8
8
  }
9
- export declare const agentExecutionLimitObservationSchema: z.ZodObject<{
10
- durationMs: z.ZodNumber;
11
- steps: z.ZodNumber;
12
- usage: z.ZodObject<{
13
- inputTokens: z.ZodNumber;
14
- outputTokens: z.ZodNumber;
15
- cachedInputTokens: z.ZodNumber;
16
- reasoningTokens: z.ZodNumber;
17
- modelCalls: z.ZodNumber;
18
- costUsdNanos: z.ZodNumber;
19
- costProvenance: z.ZodEnum<{
20
- estimated: "estimated";
21
- observed: "observed";
22
- }>;
23
- }, z.core.$strict>;
24
- }, z.core.$strict>;
25
9
  export interface RefineAgentExecutionWithinLimitsOptions {
26
10
  pathPrefix?: (string | number)[];
27
11
  usagePath?: (string | number)[];
28
12
  }
29
- /** Reject an execution record that cannot satisfy every limit it claims to use. */
30
- export declare function assertAgentExecutionWithinLimits(limits: AgentCandidateExecutionLimits, observation: AgentExecutionLimitObservation): void;
31
13
  /** Add schema issues instead of throwing when a receipt is parsed by Zod. */
32
14
  export declare function refineAgentExecutionWithinLimits(limits: AgentCandidateExecutionLimits, observation: AgentExecutionLimitObservation, ctx: z.RefinementCtx, options?: RefineAgentExecutionWithinLimitsOptions): void;
@@ -1,24 +1,3 @@
1
- import { z } from "zod";
2
- import { agentCandidateExecutionLimitsSchema } from "./agent-candidate-execution-plan-schema.js";
3
- import { agentCandidateFixedSpendSchema } from "./agent-candidate-outcome-schema.js";
4
- export const agentExecutionLimitObservationSchema = z
5
- .object({
6
- durationMs: z.number().finite().nonnegative(),
7
- steps: z.number().int().nonnegative().safe(),
8
- usage: agentCandidateFixedSpendSchema,
9
- })
10
- .strict();
11
- /** Reject an execution record that cannot satisfy every limit it claims to use. */
12
- export function assertAgentExecutionWithinLimits(limits, observation) {
13
- const parsedLimits = agentCandidateExecutionLimitsSchema.parse(limits);
14
- const parsedObservation = agentExecutionLimitObservationSchema.parse(observation);
15
- const violations = executionLimitViolations(parsedLimits, parsedObservation);
16
- if (violations.length === 0)
17
- return;
18
- throw new Error(violations
19
- .map((violation) => `execution ${violation.label} ${violation.actual} exceeds frozen limit ${violation.maximum}`)
20
- .join("; "));
21
- }
22
1
  /** Add schema issues instead of throwing when a receipt is parsed by Zod. */
23
2
  export function refineAgentExecutionWithinLimits(limits, observation, ctx, options = {}) {
24
3
  const pathPrefix = options.pathPrefix ?? [];
@@ -125,6 +125,7 @@ export declare const agentExecutionPreparationAxisResultSchema: z.ZodObject<{
125
125
  resourceFailOnError: "resourceFailOnError";
126
126
  resourceInstructions: "resourceInstructions";
127
127
  resourceTools: "resourceTools";
128
+ seats: "seats";
128
129
  skills: "skills";
129
130
  subagents: "subagents";
130
131
  systemPrompt: "systemPrompt";
@@ -276,6 +277,7 @@ export declare const agentExecutionPreparationReceiptSchema: z.ZodObject<{
276
277
  resourceFailOnError: "resourceFailOnError";
277
278
  resourceInstructions: "resourceInstructions";
278
279
  resourceTools: "resourceTools";
280
+ seats: "seats";
279
281
  skills: "skills";
280
282
  subagents: "subagents";
281
283
  systemPrompt: "systemPrompt";
@@ -4,7 +4,7 @@ import type { AgentProfileActivationEvidence } from "./agent-profile-activation.
4
4
  import { type AgentProfileMaterializationAxis } from "./agent-profile-materialization.js";
5
5
  import { type AgentExecutionPreparationAxisResult, type AgentExecutionPreparationMaterializer, type AgentExecutionPreparationReceipt, type AgentExecutionPreparationResolvedModel } from "./agent-execution-preparation-receipt.js";
6
6
  import type { HarnessType } from "./harness.js";
7
- import { type AgentWorkspaceExecutionBoundLeaseRecord, type AgentWorkspaceSealedLeaseRecord } from "./agent-workspace-lease.js";
7
+ import { type AgentWorkspaceSealedLeaseRecord } from "./agent-workspace-lease.js";
8
8
  export { agentExecutionPreparationAxisResultSchema, agentExecutionPreparationReasoningEffortSchema, agentExecutionPreparationReceiptSchema, type AgentExecutionPreparationAxisResult, type AgentExecutionPreparationDisposition, type AgentExecutionPreparationMaterializer, type AgentExecutionPreparationOwner, type AgentExecutionPreparationReasoningEffort, type AgentExecutionPreparationReceipt, type AgentExecutionPreparationResolvedModel, type AgentExecutionPreparationWorkspace, } from "./agent-execution-preparation-receipt.js";
9
9
  export interface BuildAgentExecutionPreparationReceiptInput {
10
10
  preparationId: string;
@@ -26,23 +26,7 @@ export interface BuildAgentExecutionPreparationReceiptInput {
26
26
  /** Clock used only to refuse already-expired preparations. */
27
27
  nowMs?: number;
28
28
  }
29
- export interface ValidateAgentExecutionPreparationReceiptOptions {
30
- receipt: unknown;
31
- requestDigest: Sha256Digest;
32
- authoredProfile: AgentProfile;
33
- effectiveProfile: AgentProfile;
34
- /** Expected public-plan identity; callers must not derive it from secret values. */
35
- executionPlanDigest: Sha256Digest;
36
- profileActivation: Pick<AgentProfileActivationEvidence, "digest">;
37
- /** Bound lease closes the receipt→workspace link before compute begins. */
38
- workspaceLease: AgentWorkspaceExecutionBoundLeaseRecord;
39
- nowMs?: number;
40
- preparationId?: string;
41
- backend?: string;
42
- harness?: HarnessType;
43
- harnessVersion?: string;
44
- }
45
- export type AgentExecutionPreparationValidationIssueCode = "invalid-receipt" | "invalid-profile" | "invalid-workspace-lease" | "workspace-not-execution-bound" | "execution-binding-mismatch" | "digest-mismatch" | "expectation-mismatch" | "expired" | "missing-coverage" | "ambiguous-coverage" | "duplicate-coverage" | "conflicting-coverage" | "unrequested-coverage" | "invalid-disposition" | "strict-unsupported" | "model-fidelity";
29
+ export type AgentExecutionPreparationValidationIssueCode = "invalid-receipt" | "invalid-profile" | "invalid-workspace-lease" | "workspace-not-execution-bound" | "digest-mismatch" | "expectation-mismatch" | "expired" | "missing-coverage" | "ambiguous-coverage" | "duplicate-coverage" | "conflicting-coverage" | "unrequested-coverage" | "invalid-disposition" | "strict-unsupported" | "model-fidelity";
46
30
  export interface AgentExecutionPreparationValidationIssue {
47
31
  code: AgentExecutionPreparationValidationIssueCode;
48
32
  message: string;
@@ -68,10 +52,6 @@ export type AgentExecutionPreparationValidationResult = {
68
52
  export declare function canonicalAgentProfileDigest(profile: AgentProfile): Sha256Digest;
69
53
  /** Build, self-hash, and cross-check one pre-compute executor acknowledgement. */
70
54
  export declare function buildAgentExecutionPreparationReceipt(input: BuildAgentExecutionPreparationReceiptInput): AgentExecutionPreparationReceipt;
71
- /** Validate structure, bindings, expiry, model fidelity, and exact path coverage. */
72
- export declare function validateAgentExecutionPreparationReceipt(options: ValidateAgentExecutionPreparationReceiptOptions): AgentExecutionPreparationValidationResult;
73
- /** Throw one structured error when a preparation acknowledgement is invalid. */
74
- export declare function assertAgentExecutionPreparationReceipt(options: ValidateAgentExecutionPreparationReceiptOptions): AgentExecutionPreparationReceipt;
75
55
  export declare class AgentExecutionPreparationValidationError extends Error {
76
56
  readonly issues: readonly AgentExecutionPreparationValidationIssue[];
77
57
  constructor(issues: readonly AgentExecutionPreparationValidationIssue[]);
@@ -74,19 +74,11 @@ export function buildAgentExecutionPreparationReceipt(input) {
74
74
  harness: input.harness,
75
75
  harnessVersion: input.harnessVersion,
76
76
  workspaceLease,
77
- requireExecutionBinding: false,
78
77
  });
79
78
  if (validation.ok)
80
79
  return validation.receipt;
81
80
  throw new AgentExecutionPreparationValidationError(validation.issues);
82
81
  }
83
- /** Validate structure, bindings, expiry, model fidelity, and exact path coverage. */
84
- export function validateAgentExecutionPreparationReceipt(options) {
85
- return validateAgentExecutionPreparationReceiptInternal({
86
- ...options,
87
- requireExecutionBinding: true,
88
- });
89
- }
90
82
  function validateAgentExecutionPreparationReceiptInternal(options) {
91
83
  const parsedReceipt = agentExecutionPreparationReceiptSchema.safeParse(options.receipt);
92
84
  if (!parsedReceipt.success) {
@@ -111,9 +103,7 @@ function validateAgentExecutionPreparationReceiptInternal(options) {
111
103
  };
112
104
  }
113
105
  const workspaceLease = workspaceLeaseResult.data;
114
- const expectedPhase = options.requireExecutionBinding
115
- ? "execution-bound"
116
- : "workspace-sealed";
106
+ const expectedPhase = "workspace-sealed";
117
107
  if (workspaceLease.phase !== expectedPhase) {
118
108
  return {
119
109
  ok: false,
@@ -166,13 +156,6 @@ function validateAgentExecutionPreparationReceiptInternal(options) {
166
156
  compareDigest(issues, "execution plan", receipt.executionPlanDigest, options.executionPlanDigest);
167
157
  compareDigest(issues, "profile activation", receipt.workspace.profileActivationDigest, options.profileActivation.digest);
168
158
  compareDigest(issues, "workspace profile activation", receipt.workspace.profileActivationDigest, workspaceLease.profileActivationDigest);
169
- if (workspaceLease.phase === "execution-bound" &&
170
- workspaceLease.executionPreparationDigest !== receipt.digest) {
171
- issues.push({
172
- code: "execution-binding-mismatch",
173
- message: "workspace execution binding does not name this preparation receipt",
174
- });
175
- }
176
159
  compareExpectation(issues, "preparation id", receipt.preparationId, options.preparationId);
177
160
  compareExpectation(issues, "backend", receipt.backend, options.backend);
178
161
  compareExpectation(issues, "harness", receipt.harness, options.harness);
@@ -218,13 +201,6 @@ function validateAgentExecutionPreparationReceiptInternal(options) {
218
201
  ? { ok: true, receipt, issues: [] }
219
202
  : { ok: false, issues };
220
203
  }
221
- /** Throw one structured error when a preparation acknowledgement is invalid. */
222
- export function assertAgentExecutionPreparationReceipt(options) {
223
- const validation = validateAgentExecutionPreparationReceipt(options);
224
- if (validation.ok)
225
- return validation.receipt;
226
- throw new AgentExecutionPreparationValidationError(validation.issues);
227
- }
228
204
  export class AgentExecutionPreparationValidationError extends Error {
229
205
  issues;
230
206
  constructor(issues) {
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
2
  import type { AgentCandidateCostProvenance, AgentCandidateEvaluationPolicy, AgentCandidateJsonValue, AgentImprovementMeasuredComparisonBase } from "./agent-candidate.js";
3
- export declare const canonicalJsonSchema: z.ZodCustom<AgentCandidateJsonValue, AgentCandidateJsonValue>;
4
3
  export declare const canonicalJsonObjectSchema: z.ZodRecord<z.ZodString, z.ZodCustom<AgentCandidateJsonValue, AgentCandidateJsonValue>>;
5
4
  export declare const agentCandidateEvaluationPolicySchema: z.ZodObject<{
6
5
  confidenceLevel: z.ZodNumber;
@@ -12,13 +11,6 @@ export declare const agentCandidateEvaluationPolicySchema: z.ZodObject<{
12
11
  criticalDimensions: z.ZodArray<z.ZodString>;
13
12
  regressionTolerance: z.ZodNumber;
14
13
  }, z.core.$strict>;
15
- export declare const agentImprovementCostSchema: z.ZodObject<{
16
- usd: z.ZodNumber;
17
- provenance: z.ZodEnum<{
18
- estimated: "estimated";
19
- observed: "observed";
20
- }>;
21
- }, z.core.$strict>;
22
14
  export declare const measuredComparisonCommonShape: {
23
15
  overall: z.ZodObject<{
24
16
  baseline: z.ZodNumber;
@@ -219,13 +211,4 @@ export declare function refineMeasuredComparisonSummary<TReceipt>(comparison: Me
219
211
  costProvenance(receipt: TReceipt): AgentCandidateCostProvenance;
220
212
  latency(receipt: TReceipt): number;
221
213
  }, ctx: z.RefinementCtx): void;
222
- export declare function refineEstimate(estimate: {
223
- baseline: number;
224
- candidate: number;
225
- delta: number;
226
- confidenceInterval: {
227
- lower: number;
228
- upper: number;
229
- };
230
- }, path: (string | number)[], ctx: z.RefinementCtx): void;
231
214
  export {};
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { isCanonicalJsonValue, sha256DigestSchema } from "./agent-candidate-schema-common.js";
3
3
  import { numbersApproximatelyEqual } from "./number-validation.js";
4
- export const canonicalJsonSchema = z.custom(isCanonicalJsonValue, "value must be finite, acyclic RFC 8785 JSON");
4
+ const canonicalJsonSchema = z.custom(isCanonicalJsonValue, "value must be finite, acyclic RFC 8785 JSON");
5
5
  export const canonicalJsonObjectSchema = z
6
6
  .record(z.string(), canonicalJsonSchema)
7
7
  .refine(isCanonicalJsonValue, "value must be finite, acyclic RFC 8785 JSON");
@@ -95,7 +95,7 @@ export const agentCandidateEvaluationPolicySchema = z
95
95
  });
96
96
  }
97
97
  });
98
- export const agentImprovementCostSchema = z
98
+ const agentImprovementCostSchema = z
99
99
  .object({
100
100
  usd: z.number().finite().nonnegative(),
101
101
  provenance: z.enum(["observed", "estimated"]),
@@ -357,7 +357,7 @@ export function refineMeasuredComparisonSummary(comparison, policy, expectedN, m
357
357
  }
358
358
  }
359
359
  }
360
- export function refineEstimate(estimate, path, ctx) {
360
+ function refineEstimate(estimate, path, ctx) {
361
361
  const expectedDelta = estimate.candidate - estimate.baseline;
362
362
  const tolerance = Number.EPSILON * Math.max(1, Math.abs(expectedDelta)) * 8;
363
363
  if (Math.abs(estimate.delta - expectedDelta) > tolerance) {
@@ -12,7 +12,6 @@ export declare const agentSourceLicenseSchema: z.ZodDiscriminatedUnion<[z.ZodObj
12
12
  reference: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
13
13
  termsDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
14
14
  }, z.core.$strict>], "kind">;
15
- export type AgentSourceLicense = z.infer<typeof agentSourceLicenseSchema>;
16
15
  /**
17
16
  * One content transition applied while importing a source.
18
17
  *
@@ -32,7 +31,6 @@ export declare const agentSourceTransformationSchema: z.ZodObject<{
32
31
  inputDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
33
32
  outputDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
34
33
  }, z.core.$strict>;
35
- export type AgentSourceTransformation = z.infer<typeof agentSourceTransformationSchema>;
36
34
  /**
37
35
  * Stable reference for the state from which an improvement candidate was made.
38
36
  * `sourceIdentity` identifies the provider object; `sourceDigest` is the exact
@@ -9,7 +9,7 @@ import type { AgentProfile } from "./agent-profile.js";
9
9
  * can only add text must report the requested replacement as unsatisfied rather
10
10
  * than acknowledge it.
11
11
  */
12
- export declare const AGENT_PROFILE_MATERIALIZATION_AXES: readonly ["name", "description", "version", "tags", "systemPrompt", "appendSystemPrompt", "instructions", "modelDefault", "modelSmall", "modelProvider", "modelReasoningEffort", "modelMaxVisibleOutputTokens", "modelMaxReasoningTokens", "modelMaxTotalOutputTokens", "modelMetadata", "harness", "permissions", "tools", "mcp", "connections", "subagents", "files", "resourceTools", "skills", "resourceAgents", "commands", "resourceInstructions", "resourceFailOnError", "hooks", "modes", "confidential", "metadata", "extensions"];
12
+ export declare const AGENT_PROFILE_MATERIALIZATION_AXES: readonly ["name", "description", "version", "tags", "systemPrompt", "appendSystemPrompt", "instructions", "modelDefault", "modelSmall", "modelProvider", "modelReasoningEffort", "modelMaxVisibleOutputTokens", "modelMaxReasoningTokens", "modelMaxTotalOutputTokens", "modelMetadata", "harness", "seats", "permissions", "tools", "mcp", "connections", "subagents", "files", "resourceTools", "skills", "resourceAgents", "commands", "resourceInstructions", "resourceFailOnError", "hooks", "modes", "confidential", "metadata", "extensions"];
13
13
  /** One exact leaf of the public AgentProfile contract. */
14
14
  export type AgentProfileMaterializationAxis = (typeof AGENT_PROFILE_MATERIALIZATION_AXES)[number];
15
15
  /** Compatibility name used by runtimes that distinguish canonical axes. */