@tangle-network/agent-interface 0.29.0 → 0.31.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.
@@ -67,20 +67,7 @@ export declare const agentCandidateExperimentSchema: z.ZodObject<{
67
67
  deny: "deny";
68
68
  }>>]>>>;
69
69
  tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
70
- mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
71
- transport: z.ZodOptional<z.ZodLiteral<"stdio">>;
72
- command: z.ZodOptional<z.ZodString>;
73
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
74
- kind: z.ZodLiteral<"public">;
75
- value: z.ZodString;
76
- }, z.core.$strict>>>;
77
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
78
- kind: z.ZodLiteral<"public">;
79
- value: z.ZodString;
80
- }, z.core.$strict>>>;
81
- cwd: z.ZodOptional<z.ZodString>;
82
- enabled: z.ZodOptional<z.ZodBoolean>;
83
- }, z.core.$strict>>>;
70
+ mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./agent-candidate.js").AgentCandidateMcpServer, unknown, z.core.$ZodTypeInternals<import("./agent-candidate.js").AgentCandidateMcpServer, unknown>>>>;
84
71
  subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
85
72
  prompt: z.ZodOptional<z.ZodString>;
86
73
  permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodEnum<{
@@ -593,20 +580,7 @@ export declare const agentCandidateExperimentSchema: z.ZodObject<{
593
580
  deny: "deny";
594
581
  }>>]>>>;
595
582
  tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
596
- mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
597
- transport: z.ZodOptional<z.ZodLiteral<"stdio">>;
598
- command: z.ZodOptional<z.ZodString>;
599
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
600
- kind: z.ZodLiteral<"public">;
601
- value: z.ZodString;
602
- }, z.core.$strict>>>;
603
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
604
- kind: z.ZodLiteral<"public">;
605
- value: z.ZodString;
606
- }, z.core.$strict>>>;
607
- cwd: z.ZodOptional<z.ZodString>;
608
- enabled: z.ZodOptional<z.ZodBoolean>;
609
- }, z.core.$strict>>>;
583
+ mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./agent-candidate.js").AgentCandidateMcpServer, unknown, z.core.$ZodTypeInternals<import("./agent-candidate.js").AgentCandidateMcpServer, unknown>>>>;
610
584
  subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
611
585
  prompt: z.ZodOptional<z.ZodString>;
612
586
  permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodEnum<{
@@ -1484,6 +1458,10 @@ export declare const candidateExecutionEvidenceSchema: z.ZodObject<{
1484
1458
  dimension: string;
1485
1459
  reason: string;
1486
1460
  }[];
1461
+ systemPrompt?: {
1462
+ kind: "public";
1463
+ value: string;
1464
+ } | undefined;
1487
1465
  }, unknown, z.core.$ZodTypeInternals<{
1488
1466
  sourceProfileDigest: `sha256:${string}`;
1489
1467
  harness: "claude-code" | "claude" | "claudish" | "nanoclaw" | "codex" | "opencode" | "kimi-code" | "kimi" | "pi" | "gemini" | "hermes" | "openclaw" | "amp" | "factory-droids" | "acp" | "cli-base";
@@ -1504,6 +1482,10 @@ export declare const candidateExecutionEvidenceSchema: z.ZodObject<{
1504
1482
  dimension: string;
1505
1483
  reason: string;
1506
1484
  }[];
1485
+ systemPrompt?: {
1486
+ kind: "public";
1487
+ value: string;
1488
+ } | undefined;
1507
1489
  }, unknown>>;
1508
1490
  artifact: z.ZodUnion<readonly [z.ZodObject<{
1509
1491
  locator: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -2284,7 +2266,7 @@ export declare const candidateExecutionEvidenceSchema: z.ZodObject<{
2284
2266
  callId: string;
2285
2267
  generationId: string;
2286
2268
  traceSpanId: string;
2287
- status: "succeeded" | "failed";
2269
+ status: "failed" | "succeeded";
2288
2270
  model: string;
2289
2271
  startedAtMs: number;
2290
2272
  endedAtMs: number;
@@ -2319,7 +2301,7 @@ export declare const candidateExecutionEvidenceSchema: z.ZodObject<{
2319
2301
  callId: string;
2320
2302
  generationId: string;
2321
2303
  traceSpanId: string;
2322
- status: "succeeded" | "failed";
2304
+ status: "failed" | "succeeded";
2323
2305
  model: string;
2324
2306
  startedAtMs: number;
2325
2307
  endedAtMs: number;
@@ -2809,20 +2791,7 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
2809
2791
  deny: "deny";
2810
2792
  }>>]>>>;
2811
2793
  tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
2812
- mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2813
- transport: z.ZodOptional<z.ZodLiteral<"stdio">>;
2814
- command: z.ZodOptional<z.ZodString>;
2815
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
2816
- kind: z.ZodLiteral<"public">;
2817
- value: z.ZodString;
2818
- }, z.core.$strict>>>;
2819
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2820
- kind: z.ZodLiteral<"public">;
2821
- value: z.ZodString;
2822
- }, z.core.$strict>>>;
2823
- cwd: z.ZodOptional<z.ZodString>;
2824
- enabled: z.ZodOptional<z.ZodBoolean>;
2825
- }, z.core.$strict>>>;
2794
+ mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./agent-candidate.js").AgentCandidateMcpServer, unknown, z.core.$ZodTypeInternals<import("./agent-candidate.js").AgentCandidateMcpServer, unknown>>>>;
2826
2795
  subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2827
2796
  prompt: z.ZodOptional<z.ZodString>;
2828
2797
  permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodEnum<{
@@ -3335,20 +3304,7 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
3335
3304
  deny: "deny";
3336
3305
  }>>]>>>;
3337
3306
  tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
3338
- mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3339
- transport: z.ZodOptional<z.ZodLiteral<"stdio">>;
3340
- command: z.ZodOptional<z.ZodString>;
3341
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
3342
- kind: z.ZodLiteral<"public">;
3343
- value: z.ZodString;
3344
- }, z.core.$strict>>>;
3345
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3346
- kind: z.ZodLiteral<"public">;
3347
- value: z.ZodString;
3348
- }, z.core.$strict>>>;
3349
- cwd: z.ZodOptional<z.ZodString>;
3350
- enabled: z.ZodOptional<z.ZodBoolean>;
3351
- }, z.core.$strict>>>;
3307
+ mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./agent-candidate.js").AgentCandidateMcpServer, unknown, z.core.$ZodTypeInternals<import("./agent-candidate.js").AgentCandidateMcpServer, unknown>>>>;
3352
3308
  subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3353
3309
  prompt: z.ZodOptional<z.ZodString>;
3354
3310
  permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodEnum<{
@@ -4227,6 +4183,10 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
4227
4183
  dimension: string;
4228
4184
  reason: string;
4229
4185
  }[];
4186
+ systemPrompt?: {
4187
+ kind: "public";
4188
+ value: string;
4189
+ } | undefined;
4230
4190
  }, unknown, z.core.$ZodTypeInternals<{
4231
4191
  sourceProfileDigest: `sha256:${string}`;
4232
4192
  harness: "claude-code" | "claude" | "claudish" | "nanoclaw" | "codex" | "opencode" | "kimi-code" | "kimi" | "pi" | "gemini" | "hermes" | "openclaw" | "amp" | "factory-droids" | "acp" | "cli-base";
@@ -4247,6 +4207,10 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
4247
4207
  dimension: string;
4248
4208
  reason: string;
4249
4209
  }[];
4210
+ systemPrompt?: {
4211
+ kind: "public";
4212
+ value: string;
4213
+ } | undefined;
4250
4214
  }, unknown>>;
4251
4215
  artifact: z.ZodUnion<readonly [z.ZodObject<{
4252
4216
  locator: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -5027,7 +4991,7 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
5027
4991
  callId: string;
5028
4992
  generationId: string;
5029
4993
  traceSpanId: string;
5030
- status: "succeeded" | "failed";
4994
+ status: "failed" | "succeeded";
5031
4995
  model: string;
5032
4996
  startedAtMs: number;
5033
4997
  endedAtMs: number;
@@ -5062,7 +5026,7 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
5062
5026
  callId: string;
5063
5027
  generationId: string;
5064
5028
  traceSpanId: string;
5065
- status: "succeeded" | "failed";
5029
+ status: "failed" | "succeeded";
5066
5030
  model: string;
5067
5031
  startedAtMs: number;
5068
5032
  endedAtMs: number;
@@ -5570,6 +5534,10 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
5570
5534
  dimension: string;
5571
5535
  reason: string;
5572
5536
  }[];
5537
+ systemPrompt?: {
5538
+ kind: "public";
5539
+ value: string;
5540
+ } | undefined;
5573
5541
  }, unknown, z.core.$ZodTypeInternals<{
5574
5542
  sourceProfileDigest: `sha256:${string}`;
5575
5543
  harness: "claude-code" | "claude" | "claudish" | "nanoclaw" | "codex" | "opencode" | "kimi-code" | "kimi" | "pi" | "gemini" | "hermes" | "openclaw" | "amp" | "factory-droids" | "acp" | "cli-base";
@@ -5590,6 +5558,10 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
5590
5558
  dimension: string;
5591
5559
  reason: string;
5592
5560
  }[];
5561
+ systemPrompt?: {
5562
+ kind: "public";
5563
+ value: string;
5564
+ } | undefined;
5593
5565
  }, unknown>>;
5594
5566
  artifact: z.ZodUnion<readonly [z.ZodObject<{
5595
5567
  locator: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -6370,7 +6342,7 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
6370
6342
  callId: string;
6371
6343
  generationId: string;
6372
6344
  traceSpanId: string;
6373
- status: "succeeded" | "failed";
6345
+ status: "failed" | "succeeded";
6374
6346
  model: string;
6375
6347
  startedAtMs: number;
6376
6348
  endedAtMs: number;
@@ -6405,7 +6377,7 @@ export declare const agentImprovementMeasuredComparisonSchema: z.ZodObject<{
6405
6377
  callId: string;
6406
6378
  generationId: string;
6407
6379
  traceSpanId: string;
6408
- status: "succeeded" | "failed";
6380
+ status: "failed" | "succeeded";
6409
6381
  model: string;
6410
6382
  startedAtMs: number;
6411
6383
  endedAtMs: number;
@@ -7077,20 +7049,7 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
7077
7049
  deny: "deny";
7078
7050
  }>>]>>>;
7079
7051
  tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
7080
- mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
7081
- transport: z.ZodOptional<z.ZodLiteral<"stdio">>;
7082
- command: z.ZodOptional<z.ZodString>;
7083
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
7084
- kind: z.ZodLiteral<"public">;
7085
- value: z.ZodString;
7086
- }, z.core.$strict>>>;
7087
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
7088
- kind: z.ZodLiteral<"public">;
7089
- value: z.ZodString;
7090
- }, z.core.$strict>>>;
7091
- cwd: z.ZodOptional<z.ZodString>;
7092
- enabled: z.ZodOptional<z.ZodBoolean>;
7093
- }, z.core.$strict>>>;
7052
+ mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./agent-candidate.js").AgentCandidateMcpServer, unknown, z.core.$ZodTypeInternals<import("./agent-candidate.js").AgentCandidateMcpServer, unknown>>>>;
7094
7053
  subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
7095
7054
  prompt: z.ZodOptional<z.ZodString>;
7096
7055
  permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodEnum<{
@@ -7603,20 +7562,7 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
7603
7562
  deny: "deny";
7604
7563
  }>>]>>>;
7605
7564
  tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
7606
- mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
7607
- transport: z.ZodOptional<z.ZodLiteral<"stdio">>;
7608
- command: z.ZodOptional<z.ZodString>;
7609
- args: z.ZodOptional<z.ZodArray<z.ZodObject<{
7610
- kind: z.ZodLiteral<"public">;
7611
- value: z.ZodString;
7612
- }, z.core.$strict>>>;
7613
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
7614
- kind: z.ZodLiteral<"public">;
7615
- value: z.ZodString;
7616
- }, z.core.$strict>>>;
7617
- cwd: z.ZodOptional<z.ZodString>;
7618
- enabled: z.ZodOptional<z.ZodBoolean>;
7619
- }, z.core.$strict>>>;
7565
+ mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./agent-candidate.js").AgentCandidateMcpServer, unknown, z.core.$ZodTypeInternals<import("./agent-candidate.js").AgentCandidateMcpServer, unknown>>>>;
7620
7566
  subagents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
7621
7567
  prompt: z.ZodOptional<z.ZodString>;
7622
7568
  permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodEnum<{
@@ -8495,6 +8441,10 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
8495
8441
  dimension: string;
8496
8442
  reason: string;
8497
8443
  }[];
8444
+ systemPrompt?: {
8445
+ kind: "public";
8446
+ value: string;
8447
+ } | undefined;
8498
8448
  }, unknown, z.core.$ZodTypeInternals<{
8499
8449
  sourceProfileDigest: `sha256:${string}`;
8500
8450
  harness: "claude-code" | "claude" | "claudish" | "nanoclaw" | "codex" | "opencode" | "kimi-code" | "kimi" | "pi" | "gemini" | "hermes" | "openclaw" | "amp" | "factory-droids" | "acp" | "cli-base";
@@ -8515,6 +8465,10 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
8515
8465
  dimension: string;
8516
8466
  reason: string;
8517
8467
  }[];
8468
+ systemPrompt?: {
8469
+ kind: "public";
8470
+ value: string;
8471
+ } | undefined;
8518
8472
  }, unknown>>;
8519
8473
  artifact: z.ZodUnion<readonly [z.ZodObject<{
8520
8474
  locator: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -9295,7 +9249,7 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
9295
9249
  callId: string;
9296
9250
  generationId: string;
9297
9251
  traceSpanId: string;
9298
- status: "succeeded" | "failed";
9252
+ status: "failed" | "succeeded";
9299
9253
  model: string;
9300
9254
  startedAtMs: number;
9301
9255
  endedAtMs: number;
@@ -9330,7 +9284,7 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
9330
9284
  callId: string;
9331
9285
  generationId: string;
9332
9286
  traceSpanId: string;
9333
- status: "succeeded" | "failed";
9287
+ status: "failed" | "succeeded";
9334
9288
  model: string;
9335
9289
  startedAtMs: number;
9336
9290
  endedAtMs: number;
@@ -9838,6 +9792,10 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
9838
9792
  dimension: string;
9839
9793
  reason: string;
9840
9794
  }[];
9795
+ systemPrompt?: {
9796
+ kind: "public";
9797
+ value: string;
9798
+ } | undefined;
9841
9799
  }, unknown, z.core.$ZodTypeInternals<{
9842
9800
  sourceProfileDigest: `sha256:${string}`;
9843
9801
  harness: "claude-code" | "claude" | "claudish" | "nanoclaw" | "codex" | "opencode" | "kimi-code" | "kimi" | "pi" | "gemini" | "hermes" | "openclaw" | "amp" | "factory-droids" | "acp" | "cli-base";
@@ -9858,6 +9816,10 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
9858
9816
  dimension: string;
9859
9817
  reason: string;
9860
9818
  }[];
9819
+ systemPrompt?: {
9820
+ kind: "public";
9821
+ value: string;
9822
+ } | undefined;
9861
9823
  }, unknown>>;
9862
9824
  artifact: z.ZodUnion<readonly [z.ZodObject<{
9863
9825
  locator: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -10638,7 +10600,7 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
10638
10600
  callId: string;
10639
10601
  generationId: string;
10640
10602
  traceSpanId: string;
10641
- status: "succeeded" | "failed";
10603
+ status: "failed" | "succeeded";
10642
10604
  model: string;
10643
10605
  startedAtMs: number;
10644
10606
  endedAtMs: number;
@@ -10673,7 +10635,7 @@ export declare const agentImprovementProposalSchema: z.ZodObject<{
10673
10635
  callId: string;
10674
10636
  generationId: string;
10675
10637
  traceSpanId: string;
10676
- status: "succeeded" | "failed";
10638
+ status: "failed" | "succeeded";
10677
10639
  model: string;
10678
10640
  startedAtMs: number;
10679
10641
  endedAtMs: number;
@@ -11280,6 +11242,10 @@ export declare const agentImprovementActivationSchema: z.ZodObject<{
11280
11242
  reviewDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
11281
11243
  experimentDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
11282
11244
  candidateBundleDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
11245
+ intent: z.ZodEnum<{
11246
+ "activate-candidate": "activate-candidate";
11247
+ "restore-baseline": "restore-baseline";
11248
+ }>;
11283
11249
  targets: z.ZodTuple<[z.ZodObject<{
11284
11250
  surface: z.ZodEnum<{
11285
11251
  prompt: "prompt";
@@ -11314,5 +11280,130 @@ export declare const agentImprovementActivationSchema: z.ZodObject<{
11314
11280
  fundingOwner: z.ZodString;
11315
11281
  authorizedBy: z.ZodString;
11316
11282
  authorizedAt: z.ZodISODateTime;
11283
+ expiresAt: z.ZodISODateTime;
11284
+ digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
11285
+ }, z.core.$strict>;
11286
+ export declare const agentImprovementActivationResultSchema: z.ZodObject<{
11287
+ kind: z.ZodLiteral<"agent-improvement-activation-result">;
11288
+ idempotencyKey: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
11289
+ attemptedAt: z.ZodISODateTime;
11290
+ completedAt: z.ZodISODateTime;
11291
+ outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{
11292
+ status: z.ZodLiteral<"applied">;
11293
+ transactionId: z.ZodString;
11294
+ targets: z.ZodTuple<[z.ZodObject<{
11295
+ surface: z.ZodEnum<{
11296
+ prompt: "prompt";
11297
+ tools: "tools";
11298
+ mcp: "mcp";
11299
+ subagents: "subagents";
11300
+ hooks: "hooks";
11301
+ skills: "skills";
11302
+ "agent-profile": "agent-profile";
11303
+ memory: "memory";
11304
+ code: "code";
11305
+ knowledge: "knowledge";
11306
+ }>;
11307
+ identity: z.ZodString;
11308
+ beforeDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
11309
+ afterDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
11310
+ }, z.core.$strict>], z.ZodObject<{
11311
+ surface: z.ZodEnum<{
11312
+ prompt: "prompt";
11313
+ tools: "tools";
11314
+ mcp: "mcp";
11315
+ subagents: "subagents";
11316
+ hooks: "hooks";
11317
+ skills: "skills";
11318
+ "agent-profile": "agent-profile";
11319
+ memory: "memory";
11320
+ code: "code";
11321
+ knowledge: "knowledge";
11322
+ }>;
11323
+ identity: z.ZodString;
11324
+ beforeDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
11325
+ afterDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
11326
+ }, z.core.$strict>>;
11327
+ }, z.core.$strict>, z.ZodObject<{
11328
+ status: z.ZodLiteral<"already-applied">;
11329
+ targets: z.ZodTuple<[z.ZodObject<{
11330
+ surface: z.ZodEnum<{
11331
+ prompt: "prompt";
11332
+ tools: "tools";
11333
+ mcp: "mcp";
11334
+ subagents: "subagents";
11335
+ hooks: "hooks";
11336
+ skills: "skills";
11337
+ "agent-profile": "agent-profile";
11338
+ memory: "memory";
11339
+ code: "code";
11340
+ knowledge: "knowledge";
11341
+ }>;
11342
+ identity: z.ZodString;
11343
+ currentDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
11344
+ }, z.core.$strict>], z.ZodObject<{
11345
+ surface: z.ZodEnum<{
11346
+ prompt: "prompt";
11347
+ tools: "tools";
11348
+ mcp: "mcp";
11349
+ subagents: "subagents";
11350
+ hooks: "hooks";
11351
+ skills: "skills";
11352
+ "agent-profile": "agent-profile";
11353
+ memory: "memory";
11354
+ code: "code";
11355
+ knowledge: "knowledge";
11356
+ }>;
11357
+ identity: z.ZodString;
11358
+ currentDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
11359
+ }, z.core.$strict>>;
11360
+ }, z.core.$strict>, z.ZodObject<{
11361
+ status: z.ZodLiteral<"conflict">;
11362
+ targets: z.ZodTuple<[z.ZodObject<{
11363
+ surface: z.ZodEnum<{
11364
+ prompt: "prompt";
11365
+ tools: "tools";
11366
+ mcp: "mcp";
11367
+ subagents: "subagents";
11368
+ hooks: "hooks";
11369
+ skills: "skills";
11370
+ "agent-profile": "agent-profile";
11371
+ memory: "memory";
11372
+ code: "code";
11373
+ knowledge: "knowledge";
11374
+ }>;
11375
+ identity: z.ZodString;
11376
+ currentDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
11377
+ }, z.core.$strict>], z.ZodObject<{
11378
+ surface: z.ZodEnum<{
11379
+ prompt: "prompt";
11380
+ tools: "tools";
11381
+ mcp: "mcp";
11382
+ subagents: "subagents";
11383
+ hooks: "hooks";
11384
+ skills: "skills";
11385
+ "agent-profile": "agent-profile";
11386
+ memory: "memory";
11387
+ code: "code";
11388
+ knowledge: "knowledge";
11389
+ }>;
11390
+ identity: z.ZodString;
11391
+ currentDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
11392
+ }, z.core.$strict>>;
11393
+ }, z.core.$strict>, z.ZodObject<{
11394
+ status: z.ZodLiteral<"expired">;
11395
+ }, z.core.$strict>, z.ZodObject<{
11396
+ status: z.ZodLiteral<"unsupported">;
11397
+ code: z.ZodString;
11398
+ message: z.ZodString;
11399
+ }, z.core.$strict>, z.ZodObject<{
11400
+ status: z.ZodLiteral<"failed">;
11401
+ code: z.ZodString;
11402
+ message: z.ZodString;
11403
+ }, z.core.$strict>, z.ZodObject<{
11404
+ status: z.ZodLiteral<"indeterminate">;
11405
+ code: z.ZodString;
11406
+ message: z.ZodString;
11407
+ }, z.core.$strict>], "status">;
11317
11408
  digest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
11318
11409
  }, z.core.$strict>;
@@ -750,6 +750,13 @@ export const agentImprovementReviewSchema = z
750
750
  })
751
751
  .strict()
752
752
  .refine(isCanonicalJsonValue, "review must contain only RFC 8785 JSON values");
753
+ const improvementActivationTargetSchema = z
754
+ .object({
755
+ surface: improvementSurfaceSchema,
756
+ identity: z.string().min(1).max(500),
757
+ expectedBaseDigest: sha256DigestSchema,
758
+ })
759
+ .strict();
753
760
  export const agentImprovementActivationSchema = z
754
761
  .object({
755
762
  kind: z.literal("agent-improvement-activation"),
@@ -757,26 +764,14 @@ export const agentImprovementActivationSchema = z
757
764
  reviewDigest: sha256DigestSchema,
758
765
  experimentDigest: sha256DigestSchema,
759
766
  candidateBundleDigest: sha256DigestSchema,
767
+ intent: z.enum(["activate-candidate", "restore-baseline"]),
760
768
  targets: z
761
- .tuple([
762
- z
763
- .object({
764
- surface: improvementSurfaceSchema,
765
- identity: z.string().min(1).max(500),
766
- expectedBaseDigest: sha256DigestSchema,
767
- })
768
- .strict(),
769
- ])
770
- .rest(z
771
- .object({
772
- surface: improvementSurfaceSchema,
773
- identity: z.string().min(1).max(500),
774
- expectedBaseDigest: sha256DigestSchema,
775
- })
776
- .strict()),
769
+ .tuple([improvementActivationTargetSchema])
770
+ .rest(improvementActivationTargetSchema),
777
771
  fundingOwner: z.string().min(1).max(500),
778
772
  authorizedBy: z.string().min(1).max(500),
779
773
  authorizedAt: z.iso.datetime(),
774
+ expiresAt: z.iso.datetime(),
780
775
  digest: sha256DigestSchema,
781
776
  })
782
777
  .strict()
@@ -789,7 +784,112 @@ export const agentImprovementActivationSchema = z
789
784
  message: "activation targets must be unique by surface and identity",
790
785
  });
791
786
  }
787
+ if (Date.parse(activation.expiresAt) <= Date.parse(activation.authorizedAt)) {
788
+ ctx.addIssue({
789
+ code: "custom",
790
+ path: ["expiresAt"],
791
+ message: "activation expiry must follow its authorization time",
792
+ });
793
+ }
792
794
  if (!isCanonicalJsonValue(activation)) {
793
795
  ctx.addIssue({ code: "custom", message: "activation must contain only RFC 8785 JSON values" });
794
796
  }
795
797
  });
798
+ const improvementActivationTargetTransitionSchema = z
799
+ .object({
800
+ surface: improvementSurfaceSchema,
801
+ identity: z.string().min(1).max(500),
802
+ beforeDigest: sha256DigestSchema,
803
+ afterDigest: sha256DigestSchema,
804
+ })
805
+ .strict();
806
+ const improvementActivationTargetStateSchema = z
807
+ .object({
808
+ surface: improvementSurfaceSchema,
809
+ identity: z.string().min(1).max(500),
810
+ currentDigest: sha256DigestSchema,
811
+ })
812
+ .strict();
813
+ const improvementActivationOutcomeSchema = z.discriminatedUnion("status", [
814
+ z
815
+ .object({
816
+ status: z.literal("applied"),
817
+ transactionId: z.string().min(1).max(500),
818
+ targets: z
819
+ .tuple([improvementActivationTargetTransitionSchema])
820
+ .rest(improvementActivationTargetTransitionSchema),
821
+ })
822
+ .strict(),
823
+ z
824
+ .object({
825
+ status: z.literal("already-applied"),
826
+ targets: z
827
+ .tuple([improvementActivationTargetStateSchema])
828
+ .rest(improvementActivationTargetStateSchema),
829
+ })
830
+ .strict(),
831
+ z
832
+ .object({
833
+ status: z.literal("conflict"),
834
+ targets: z
835
+ .tuple([improvementActivationTargetStateSchema])
836
+ .rest(improvementActivationTargetStateSchema),
837
+ })
838
+ .strict(),
839
+ z.object({ status: z.literal("expired") }).strict(),
840
+ z
841
+ .object({
842
+ status: z.literal("unsupported"),
843
+ code: z.string().min(1).max(100),
844
+ message: z.string().min(1).max(2_000),
845
+ })
846
+ .strict(),
847
+ z
848
+ .object({
849
+ status: z.literal("failed"),
850
+ code: z.string().min(1).max(100),
851
+ message: z.string().min(1).max(2_000),
852
+ })
853
+ .strict(),
854
+ z
855
+ .object({
856
+ status: z.literal("indeterminate"),
857
+ code: z.string().min(1).max(100),
858
+ message: z.string().min(1).max(2_000),
859
+ })
860
+ .strict(),
861
+ ]);
862
+ export const agentImprovementActivationResultSchema = z
863
+ .object({
864
+ kind: z.literal("agent-improvement-activation-result"),
865
+ idempotencyKey: sha256DigestSchema,
866
+ attemptedAt: z.iso.datetime(),
867
+ completedAt: z.iso.datetime(),
868
+ outcome: improvementActivationOutcomeSchema,
869
+ digest: sha256DigestSchema,
870
+ })
871
+ .strict()
872
+ .superRefine((result, ctx) => {
873
+ if (Date.parse(result.completedAt) < Date.parse(result.attemptedAt)) {
874
+ ctx.addIssue({
875
+ code: "custom",
876
+ path: ["completedAt"],
877
+ message: "activation completion cannot predate its attempt",
878
+ });
879
+ }
880
+ const targets = "targets" in result.outcome ? result.outcome.targets : [];
881
+ const identities = targets.map((target) => `${target.surface}\u0000${target.identity}`);
882
+ if (new Set(identities).size !== identities.length) {
883
+ ctx.addIssue({
884
+ code: "custom",
885
+ path: ["outcome", "targets"],
886
+ message: "activation outcome targets must be unique by surface and identity",
887
+ });
888
+ }
889
+ if (!isCanonicalJsonValue(result)) {
890
+ ctx.addIssue({
891
+ code: "custom",
892
+ message: "activation result must contain only RFC 8785 JSON values",
893
+ });
894
+ }
895
+ });
@@ -215,6 +215,10 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
215
215
  dimension: string;
216
216
  reason: string;
217
217
  }[];
218
+ systemPrompt?: {
219
+ kind: "public";
220
+ value: string;
221
+ } | undefined;
218
222
  }, unknown, z.core.$ZodTypeInternals<{
219
223
  sourceProfileDigest: `sha256:${string}`;
220
224
  harness: "claude-code" | "claude" | "claudish" | "nanoclaw" | "codex" | "opencode" | "kimi-code" | "kimi" | "pi" | "gemini" | "hermes" | "openclaw" | "amp" | "factory-droids" | "acp" | "cli-base";
@@ -235,6 +239,10 @@ export declare const agentCandidateMaterializationReceiptSchema: z.ZodObject<{
235
239
  dimension: string;
236
240
  reason: string;
237
241
  }[];
242
+ systemPrompt?: {
243
+ kind: "public";
244
+ value: string;
245
+ } | undefined;
238
246
  }, unknown>>;
239
247
  artifact: z.ZodUnion<readonly [z.ZodObject<{
240
248
  locator: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1015,7 +1023,7 @@ export declare const agentCandidateRunReceiptSchema: z.ZodObject<{
1015
1023
  callId: string;
1016
1024
  generationId: string;
1017
1025
  traceSpanId: string;
1018
- status: "succeeded" | "failed";
1026
+ status: "failed" | "succeeded";
1019
1027
  model: string;
1020
1028
  startedAtMs: number;
1021
1029
  endedAtMs: number;
@@ -1050,7 +1058,7 @@ export declare const agentCandidateRunReceiptSchema: z.ZodObject<{
1050
1058
  callId: string;
1051
1059
  generationId: string;
1052
1060
  traceSpanId: string;
1053
- status: "succeeded" | "failed";
1061
+ status: "failed" | "succeeded";
1054
1062
  model: string;
1055
1063
  startedAtMs: number;
1056
1064
  endedAtMs: number;