@kici-dev/engine 0.8.0 → 0.9.1

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 (47) hide show
  1. package/dist/context/hold-reason.d.ts +6 -11
  2. package/dist/context/hold-reason.js +1 -8
  3. package/dist/context/index.d.ts +3 -3
  4. package/dist/context/index.js +3 -3
  5. package/dist/context/types.d.ts +12 -10
  6. package/dist/context/types.js +12 -14
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +6 -5
  9. package/dist/metrics/catalog-policy.js +2 -2
  10. package/dist/protocol/dashboard-write-operations.d.ts +8 -18
  11. package/dist/protocol/dashboard-write-operations.js +5 -26
  12. package/dist/protocol/messages/agent-run-result.d.ts +0 -1
  13. package/dist/protocol/messages/auth.d.ts +3 -3
  14. package/dist/protocol/messages/capabilities.d.ts +3 -5
  15. package/dist/protocol/messages/capabilities.js +4 -10
  16. package/dist/protocol/messages/dashboard-global-workflows.d.ts +10 -24
  17. package/dist/protocol/messages/dashboard-global-workflows.js +9 -15
  18. package/dist/protocol/messages/dashboard.d.ts +2 -23
  19. package/dist/protocol/messages/dashboard.js +2 -21
  20. package/dist/protocol/messages/oidc-token-relay.d.ts +2 -13
  21. package/dist/protocol/messages/oidc-token-relay.js +3 -10
  22. package/dist/protocol/messages/orchestrator-agent.d.ts +10 -9
  23. package/dist/protocol/messages/orchestrator-agent.js +10 -26
  24. package/dist/protocol/messages/peer.d.ts +26 -31
  25. package/dist/protocol/messages/peer.js +18 -38
  26. package/dist/protocol/messages/platform-orchestrator.d.ts +17 -79
  27. package/dist/protocol/messages/platform-orchestrator.js +6 -24
  28. package/dist/protocol/version.d.ts +10 -18
  29. package/dist/protocol/version.js +11 -19
  30. package/dist/provenance/id-token-claim-names.d.ts +13 -0
  31. package/dist/provenance/id-token-claim-names.js +44 -0
  32. package/dist/provenance/id-token-event-claims.d.ts +1 -8
  33. package/dist/provenance/id-token-event-claims.js +2 -7
  34. package/dist/provider/index.d.ts +1 -2
  35. package/dist/provider/index.test-d.d.ts +2 -0
  36. package/dist/provider/index.test-d.js +31 -0
  37. package/dist/provider/webhook-normalizer.d.ts +0 -42
  38. package/dist/trigger/types.d.ts +8 -38
  39. package/dist/trigger/types.js +2 -12
  40. package/dist/trigger/types.test-d.d.ts +2 -0
  41. package/dist/trigger/types.test-d.js +63 -0
  42. package/package.json +7 -11
  43. package/sbom.spdx.json +20 -20
  44. package/dist/protocol/messages/oidc-mint.d.ts +0 -58
  45. package/dist/protocol/messages/oidc-mint.js +0 -62
  46. package/dist/provider/contributor-resolver.d.ts +0 -30
  47. package/dist/provider/contributor-resolver.js +0 -2
@@ -14,15 +14,13 @@
14
14
  * source in the org. When present, it qualifies the entry to a single
15
15
  * webhook source (e.g., `github:42` vs `generic:org:abcd`).
16
16
  *
17
- * Three independent policy axes (see GlobalWorkflowPolicy in the orchestrator):
17
+ * Two independent policy axes (see GlobalWorkflowPolicy in the orchestrator):
18
18
  * - `allowedRepos` restricts which repos may AUTHOR global workflows.
19
19
  * - `deniedRepos` blocks global dispatches for events FROM these SOURCE repos.
20
- * - `elevatedRepos` is DEPRECATED and not enforced — see the field comments
21
- * below and `docs/user/deprecations.md`.
22
20
  */
23
21
  import { z } from 'zod';
24
22
  /**
25
- * One entry in any of the three repo-pattern lists. `routingKey` is the
23
+ * One entry in either repo-pattern list. `routingKey` is the
26
24
  * source-qualifier; when absent the entry applies to any source in the org.
27
25
  */
28
26
  export declare const repoPatternEntrySchema: z.ZodObject<{
@@ -51,7 +49,11 @@ export type RepoPatternEntry = z.infer<typeof repoPatternEntrySchema>;
51
49
  * compiles into a real inversion, and `[!…]`, which it does not.
52
50
  */
53
51
  export declare function invalidRepoPatternReason(pattern: string): string | null;
54
- /** Projected org-level global workflow settings. */
52
+ /**
53
+ * Projected org-level global workflow settings. `.strict()`: the projection
54
+ * once carried an unenforced elevated-access list, so an orchestrator still
55
+ * echoing one is on a build this protocol floor refuses.
56
+ */
55
57
  export declare const globalWorkflowSettingsSchema: z.ZodObject<{
56
58
  customerId: z.ZodString;
57
59
  enabled: z.ZodBoolean;
@@ -63,13 +65,9 @@ export declare const globalWorkflowSettingsSchema: z.ZodObject<{
63
65
  routingKey: z.ZodOptional<z.ZodString>;
64
66
  pattern: z.ZodString;
65
67
  }, z.core.$strip>>>;
66
- elevatedRepos: z.ZodNullable<z.ZodArray<z.ZodObject<{
67
- routingKey: z.ZodOptional<z.ZodString>;
68
- pattern: z.ZodString;
69
- }, z.core.$strip>>>;
70
68
  createdAt: z.ZodNullable<z.ZodString>;
71
69
  updatedAt: z.ZodNullable<z.ZodString>;
72
- }, z.core.$strip>;
70
+ }, z.core.$strict>;
73
71
  export type GlobalWorkflowSettings = z.infer<typeof globalWorkflowSettingsSchema>;
74
72
  /** Request the current global-workflow settings row. */
75
73
  export declare const globalWorkflowsGetRequestSchema: z.ZodObject<{
@@ -150,10 +148,6 @@ export declare const globalWorkflowsUpdateRequestSchema: z.ZodObject<{
150
148
  routingKey: z.ZodOptional<z.ZodString>;
151
149
  pattern: z.ZodString;
152
150
  }, z.core.$strip>>>>;
153
- elevatedRepos: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
154
- routingKey: z.ZodOptional<z.ZodString>;
155
- pattern: z.ZodString;
156
- }, z.core.$strip>>>>;
157
151
  }, z.core.$strict>;
158
152
  export declare const globalWorkflowsGetResponseSchema: z.ZodObject<{
159
153
  type: z.ZodLiteral<"dashboard.global-workflows.get.response">;
@@ -169,13 +163,9 @@ export declare const globalWorkflowsGetResponseSchema: z.ZodObject<{
169
163
  routingKey: z.ZodOptional<z.ZodString>;
170
164
  pattern: z.ZodString;
171
165
  }, z.core.$strip>>>;
172
- elevatedRepos: z.ZodNullable<z.ZodArray<z.ZodObject<{
173
- routingKey: z.ZodOptional<z.ZodString>;
174
- pattern: z.ZodString;
175
- }, z.core.$strip>>>;
176
166
  createdAt: z.ZodNullable<z.ZodString>;
177
167
  updatedAt: z.ZodNullable<z.ZodString>;
178
- }, z.core.$strip>>;
168
+ }, z.core.$strict>>;
179
169
  error: z.ZodOptional<z.ZodString>;
180
170
  }, z.core.$strip>;
181
171
  export declare const globalWorkflowsUpdateResponseSchema: z.ZodObject<{
@@ -192,13 +182,9 @@ export declare const globalWorkflowsUpdateResponseSchema: z.ZodObject<{
192
182
  routingKey: z.ZodOptional<z.ZodString>;
193
183
  pattern: z.ZodString;
194
184
  }, z.core.$strip>>>;
195
- elevatedRepos: z.ZodNullable<z.ZodArray<z.ZodObject<{
196
- routingKey: z.ZodOptional<z.ZodString>;
197
- pattern: z.ZodString;
198
- }, z.core.$strip>>>;
199
185
  createdAt: z.ZodNullable<z.ZodString>;
200
186
  updatedAt: z.ZodNullable<z.ZodString>;
201
- }, z.core.$strip>>;
187
+ }, z.core.$strict>>;
202
188
  error: z.ZodOptional<z.ZodString>;
203
189
  }, z.core.$strip>;
204
190
  export type GlobalWorkflowsGetRequest = z.infer<typeof globalWorkflowsGetRequestSchema>;
@@ -19,14 +19,12 @@ import { z } from "zod";
19
19
  * source in the org. When present, it qualifies the entry to a single
20
20
  * webhook source (e.g., `github:42` vs `generic:org:abcd`).
21
21
  *
22
- * Three independent policy axes (see GlobalWorkflowPolicy in the orchestrator):
22
+ * Two independent policy axes (see GlobalWorkflowPolicy in the orchestrator):
23
23
  * - `allowedRepos` restricts which repos may AUTHOR global workflows.
24
24
  * - `deniedRepos` blocks global dispatches for events FROM these SOURCE repos.
25
- * - `elevatedRepos` is DEPRECATED and not enforced — see the field comments
26
- * below and `docs/user/deprecations.md`.
27
25
  */
28
26
  /**
29
- * One entry in any of the three repo-pattern lists. `routingKey` is the
27
+ * One entry in either repo-pattern list. `routingKey` is the
30
28
  * source-qualifier; when absent the entry applies to any source in the org.
31
29
  */
32
30
  const repoPatternEntrySchema = z.object({
@@ -59,7 +57,11 @@ function invalidRepoPatternReason(pattern) {
59
57
  if (negation) return `${negation} is not allowed on a policy list — the list's direction already encodes allow/deny`;
60
58
  return null;
61
59
  }
62
- /** Projected org-level global workflow settings. */
60
+ /**
61
+ * Projected org-level global workflow settings. `.strict()`: the projection
62
+ * once carried an unenforced elevated-access list, so an orchestrator still
63
+ * echoing one is on a build this protocol floor refuses.
64
+ */
63
65
  const globalWorkflowSettingsSchema = z.object({
64
66
  customerId: z.string(),
65
67
  /**
@@ -71,15 +73,9 @@ const globalWorkflowSettingsSchema = z.object({
71
73
  enabled: z.boolean(),
72
74
  allowedRepos: z.array(repoPatternEntrySchema).nullable(),
73
75
  deniedRepos: z.array(repoPatternEntrySchema).nullable(),
74
- /**
75
- * @deprecated Stored and echoed back, but never enforced: an organization-wide
76
- * workflow's job is dispatched with no secret material at all, so there is no
77
- * secret access for this list to widen. Removal at v1.0.0.
78
- */
79
- elevatedRepos: z.array(repoPatternEntrySchema).nullable(),
80
76
  createdAt: z.string().nullable(),
81
77
  updatedAt: z.string().nullable()
82
- });
78
+ }).strict();
83
79
  /** Request the current global-workflow settings row. */
84
80
  const globalWorkflowsGetRequestSchema = z.object({
85
81
  type: z.literal("dashboard.global-workflows.get"),
@@ -102,9 +98,7 @@ const globalWorkflowsUpdateRequestSchema = z.object({
102
98
  requestId: z.string(),
103
99
  actor: actorPrincipalSchema,
104
100
  allowedRepos: z.array(repoPatternEntrySchema).nullable().optional(),
105
- deniedRepos: z.array(repoPatternEntrySchema).nullable().optional(),
106
- /** @deprecated Accepted and stored, but never enforced. Removal at v1.0.0. */
107
- elevatedRepos: z.array(repoPatternEntrySchema).nullable().optional()
101
+ deniedRepos: z.array(repoPatternEntrySchema).nullable().optional()
108
102
  }).strict();
109
103
  const globalWorkflowsGetResponseSchema = z.object({
110
104
  type: z.literal("dashboard.global-workflows.get.response"),
@@ -102,7 +102,6 @@ export declare const dashboardRunStructuredResponseSchema: z.ZodObject<{
102
102
  completedAt: z.ZodNullable<z.ZodString>;
103
103
  durationMs: z.ZodNullable<z.ZodNumber>;
104
104
  trustTier: z.ZodNullable<z.ZodEnum<{
105
- known: "known";
106
105
  trusted: "trusted";
107
106
  unknown: "unknown";
108
107
  }>>;
@@ -563,7 +562,6 @@ export declare const dashboardRunDetailResponseSchema: z.ZodObject<{
563
562
  }, z.core.$strip>>;
564
563
  trustContext: z.ZodOptional<z.ZodObject<{
565
564
  trustTier: z.ZodNullable<z.ZodEnum<{
566
- known: "known";
567
565
  trusted: "trusted";
568
566
  unknown: "unknown";
569
567
  }>>;
@@ -6746,10 +6744,6 @@ export declare const dashboardPlatformToOrchSchema: z.ZodDiscriminatedUnion<[z.Z
6746
6744
  routingKey: z.ZodOptional<z.ZodString>;
6747
6745
  pattern: z.ZodString;
6748
6746
  }, z.core.$strip>>>>;
6749
- elevatedRepos: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
6750
- routingKey: z.ZodOptional<z.ZodString>;
6751
- pattern: z.ZodString;
6752
- }, z.core.$strip>>>>;
6753
6747
  }, z.core.$strict>, z.ZodObject<{
6754
6748
  type: z.ZodLiteral<"dashboard.access-log.list">;
6755
6749
  requestId: z.ZodString;
@@ -7210,7 +7204,6 @@ export declare const dashboardOrchToPlatformSchema: z.ZodDiscriminatedUnion<[z.Z
7210
7204
  }, z.core.$strip>>;
7211
7205
  trustContext: z.ZodOptional<z.ZodObject<{
7212
7206
  trustTier: z.ZodNullable<z.ZodEnum<{
7213
- known: "known";
7214
7207
  trusted: "trusted";
7215
7208
  unknown: "unknown";
7216
7209
  }>>;
@@ -7275,7 +7268,6 @@ export declare const dashboardOrchToPlatformSchema: z.ZodDiscriminatedUnion<[z.Z
7275
7268
  completedAt: z.ZodNullable<z.ZodString>;
7276
7269
  durationMs: z.ZodNullable<z.ZodNumber>;
7277
7270
  trustTier: z.ZodNullable<z.ZodEnum<{
7278
- known: "known";
7279
7271
  trusted: "trusted";
7280
7272
  unknown: "unknown";
7281
7273
  }>>;
@@ -8488,13 +8480,9 @@ export declare const dashboardOrchToPlatformSchema: z.ZodDiscriminatedUnion<[z.Z
8488
8480
  routingKey: z.ZodOptional<z.ZodString>;
8489
8481
  pattern: z.ZodString;
8490
8482
  }, z.core.$strip>>>;
8491
- elevatedRepos: z.ZodNullable<z.ZodArray<z.ZodObject<{
8492
- routingKey: z.ZodOptional<z.ZodString>;
8493
- pattern: z.ZodString;
8494
- }, z.core.$strip>>>;
8495
8483
  createdAt: z.ZodNullable<z.ZodString>;
8496
8484
  updatedAt: z.ZodNullable<z.ZodString>;
8497
- }, z.core.$strip>>;
8485
+ }, z.core.$strict>>;
8498
8486
  error: z.ZodOptional<z.ZodString>;
8499
8487
  }, z.core.$strip>, z.ZodObject<{
8500
8488
  type: z.ZodLiteral<"dashboard.global-workflows.update.response">;
@@ -8510,13 +8498,9 @@ export declare const dashboardOrchToPlatformSchema: z.ZodDiscriminatedUnion<[z.Z
8510
8498
  routingKey: z.ZodOptional<z.ZodString>;
8511
8499
  pattern: z.ZodString;
8512
8500
  }, z.core.$strip>>>;
8513
- elevatedRepos: z.ZodNullable<z.ZodArray<z.ZodObject<{
8514
- routingKey: z.ZodOptional<z.ZodString>;
8515
- pattern: z.ZodString;
8516
- }, z.core.$strip>>>;
8517
8501
  createdAt: z.ZodNullable<z.ZodString>;
8518
8502
  updatedAt: z.ZodNullable<z.ZodString>;
8519
- }, z.core.$strip>>;
8503
+ }, z.core.$strict>>;
8520
8504
  error: z.ZodOptional<z.ZodString>;
8521
8505
  }, z.core.$strip>, z.ZodObject<{
8522
8506
  type: z.ZodLiteral<"dashboard.access-log.list.response">;
@@ -8873,7 +8857,6 @@ export declare const dashboardRunDetailApiResponseSchema: z.ZodObject<{
8873
8857
  }, z.core.$strip>>;
8874
8858
  trustContext: z.ZodOptional<z.ZodObject<{
8875
8859
  trustTier: z.ZodNullable<z.ZodEnum<{
8876
- known: "known";
8877
8860
  trusted: "trusted";
8878
8861
  unknown: "unknown";
8879
8862
  }>>;
@@ -9383,8 +9366,6 @@ export type RunEvent = z.infer<typeof runEventSchema>;
9383
9366
  */
9384
9367
  export declare const trustPolicyResponseSchema: z.ZodObject<{
9385
9368
  forkPolicy: z.ZodString;
9386
- unknownContributorPolicy: z.ZodString;
9387
- workflowChangePolicy: z.ZodString;
9388
9369
  approvalExpiryHours: z.ZodNumber;
9389
9370
  approvalExpirySeconds: z.ZodOptional<z.ZodNumber>;
9390
9371
  }, z.core.$strip>;
@@ -9434,7 +9415,6 @@ export declare const orgMemberSchema: z.ZodObject<{
9434
9415
  suspendedAt: z.ZodNullable<z.ZodCoercedString<unknown>>;
9435
9416
  joinedAt: z.ZodCoercedString<unknown>;
9436
9417
  ciTrustLevel: z.ZodString;
9437
- ciTrustOverride: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9438
9418
  identityLinks: z.ZodArray<z.ZodObject<{
9439
9419
  provider: z.ZodString;
9440
9420
  providerUsername: z.ZodString;
@@ -9455,7 +9435,6 @@ export declare const memberListResponseSchema: z.ZodObject<{
9455
9435
  suspendedAt: z.ZodNullable<z.ZodCoercedString<unknown>>;
9456
9436
  joinedAt: z.ZodCoercedString<unknown>;
9457
9437
  ciTrustLevel: z.ZodString;
9458
- ciTrustOverride: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9459
9438
  identityLinks: z.ZodArray<z.ZodObject<{
9460
9439
  provider: z.ZodString;
9461
9440
  providerUsername: z.ZodString;
@@ -6,6 +6,7 @@ import { actorPrincipalSchema } from "./actor.js";
6
6
  import { HeldRunStatus } from "../../context/held-run-status.js";
7
7
  import { dashboardSealedEnvelopeSchema } from "./dashboard-sealed-write.js";
8
8
  import { JobKind, StepConcurrencyKind, initFailureSchema, stateReplayRunSchema } from "./execution-status.js";
9
+ import { TrustTierSchema } from "../../context/types.js";
9
10
  import { agentRunResultSchema } from "./agent-run-result.js";
10
11
  import { kiciBundleSchema } from "../../provenance/bundle.js";
11
12
  import { dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema } from "./access-log.js";
@@ -208,11 +209,7 @@ const dashboardJobDetailSchema = z.object({
208
209
  });
209
210
  /** Trust context from orchestrator execution_runs (populated for PR-triggered runs). */
210
211
  const trustContextSchema = z.object({
211
- trustTier: z.enum([
212
- "trusted",
213
- "known",
214
- "unknown"
215
- ]).nullable(),
212
+ trustTier: TrustTierSchema.nullable(),
216
213
  lockFileSource: z.enum(["head", "base"]).nullable(),
217
214
  contributorUsername: z.string().nullable()
218
215
  });
@@ -2526,8 +2523,6 @@ const runEventSchema = z.object({
2526
2523
  */
2527
2524
  const trustPolicyResponseSchema = z.object({
2528
2525
  forkPolicy: z.string(),
2529
- unknownContributorPolicy: z.string(),
2530
- workflowChangePolicy: z.string(),
2531
2526
  approvalExpiryHours: z.number(),
2532
2527
  approvalExpirySeconds: z.number().optional()
2533
2528
  });
@@ -2562,20 +2557,6 @@ const orgMemberSchema = z.object({
2562
2557
  suspendedAt: z.coerce.string().nullable(),
2563
2558
  joinedAt: z.coerce.string(),
2564
2559
  ciTrustLevel: z.string(),
2565
- /**
2566
- * The per-member `ci_trust` override, when one is stored, or `null` when the
2567
- * member's level is entirely role-derived.
2568
- *
2569
- * Carried beside `ciTrustLevel` rather than folded into it, because the two
2570
- * answer different questions. `ciTrustLevel` is the effective level the CI
2571
- * trust gate decides with — the role-derived level with any override applied
2572
- * on top — so it cannot say which half produced it. An override OUTRANKS the
2573
- * roles, so an org that lowered a member by override has no way to see that,
2574
- * and no way to undo it, from a payload that reports only the result.
2575
- *
2576
- * Optional so an older client keeps parsing the response.
2577
- */
2578
- ciTrustOverride: z.string().nullable().optional(),
2579
2560
  identityLinks: z.array(memberIdentityLinkSchema)
2580
2561
  });
2581
2562
  /** Response for org members list endpoint. */
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
- * agent.api method name for the provenance ID-token relay.
3
+ * agent.api method name for the provenance ID-token request.
4
4
  *
5
- * Single source of truth: both the orchestrator's relay-handler registration
5
+ * Single source of truth: both the orchestrator's mint-handler registration
6
6
  * and the SDK `ctx.kici.oidc.token()` wrapper import this constant, so the
7
7
  * wire method name lives in exactly one place.
8
8
  */
@@ -18,8 +18,6 @@ export declare const oidcTokenRequestParamsSchema: z.ZodObject<{
18
18
  audience: z.ZodString;
19
19
  }, z.core.$strip>;
20
20
  export type OidcTokenRequestParams = z.infer<typeof oidcTokenRequestParamsSchema>;
21
- export { OidcMintErrorCode } from './oidc-mint.js';
22
- export type { OidcMintErrorCode as OidcMintErrorCodeType } from './oidc-mint.js';
23
21
  /** A successfully minted ID token bound to a job. */
24
22
  export declare const oidcMintedTokenSchema: z.ZodObject<{
25
23
  token: z.ZodString;
@@ -46,13 +44,4 @@ export declare const oidcTokenResultSchema: z.ZodUnion<readonly [z.ZodObject<{
46
44
  }>;
47
45
  }, z.core.$strip>]>;
48
46
  export type OidcTokenResult = z.infer<typeof oidcTokenResultSchema>;
49
- /** Extra fields a deferred *fulfilment* mint carries (orchestrator -> Platform). */
50
- export declare const deferredMintParamsSchema: z.ZodObject<{
51
- statementHash: z.ZodString;
52
- origin: z.ZodEnum<{
53
- deferred: "deferred";
54
- "offline-backfill": "offline-backfill";
55
- }>;
56
- }, z.core.$strip>;
57
- export type DeferredMintParams = z.infer<typeof deferredMintParamsSchema>;
58
47
  //# sourceMappingURL=oidc-token-relay.d.ts.map
@@ -1,12 +1,10 @@
1
1
  import "../../rolldown-runtime-ClRpJifh.js";
2
- import { AttestationOrigin } from "../../provenance/attestation-origin.js";
3
- import { OidcMintErrorCode } from "./oidc-mint.js";
4
2
  import { z } from "zod";
5
3
  //#region src/protocol/messages/oidc-token-relay.ts
6
4
  /**
7
- * agent.api method name for the provenance ID-token relay.
5
+ * agent.api method name for the provenance ID-token request.
8
6
  *
9
- * Single source of truth: both the orchestrator's relay-handler registration
7
+ * Single source of truth: both the orchestrator's mint-handler registration
10
8
  * and the SDK `ctx.kici.oidc.token()` wrapper import this constant, so the
11
9
  * wire method name lives in exactly one place.
12
10
  */
@@ -38,12 +36,7 @@ const oidcTokenResultSchema = z.union([oidcMintedTokenSchema, z.object({
38
36
  deferred: z.literal(true),
39
37
  code: z.enum(["unavailable", "failed"])
40
38
  })]);
41
- /** Extra fields a deferred *fulfilment* mint carries (orchestrator -> Platform). */
42
- const deferredMintParamsSchema = z.object({
43
- statementHash: z.string(),
44
- origin: AttestationOrigin.extract(["deferred", "offline-backfill"])
45
- });
46
39
  //#endregion
47
- export { OIDC_TOKEN_REQUEST_METHOD, OidcMintErrorCode, deferredMintParamsSchema, oidcMintedTokenSchema, oidcTokenRequestParamsSchema, oidcTokenResultSchema };
40
+ export { OIDC_TOKEN_REQUEST_METHOD, oidcMintedTokenSchema, oidcTokenRequestParamsSchema, oidcTokenResultSchema };
48
41
 
49
42
  //# sourceMappingURL=oidc-token-relay.js.map
@@ -108,7 +108,6 @@ export declare const jobDispatchSchema: z.ZodObject<{
108
108
  maxLogSizeBytes: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
109
109
  concurrencyWaitTimeoutMs: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
110
110
  sourceTarUrl: z.ZodOptional<z.ZodString>;
111
- sourceTarHash: z.ZodOptional<z.ZodString>;
112
111
  sourceTarDigest: z.ZodOptional<z.ZodString>;
113
112
  depsUrl: z.ZodOptional<z.ZodString>;
114
113
  depsHash: z.ZodOptional<z.ZodString>;
@@ -613,16 +612,21 @@ export declare const artifactsUploadResponseSchema: z.ZodObject<{
613
612
  }>>;
614
613
  error: z.ZodOptional<z.ZodString>;
615
614
  }, z.core.$strip>;
616
- /** Agent -> Orchestrator: confirm an artifact upload finished; records the DB row. */
615
+ /**
616
+ * Agent -> Orchestrator: confirm an artifact upload finished; records the DB row.
617
+ *
618
+ * The orchestrator derives the storage key from the server-resolved run and
619
+ * artifact name and reads the real object size back from storage, so the agent
620
+ * asserts neither. `.strict()`: an agent still echoing either is on a build the
621
+ * protocol floor refuses, and a stray field is a version-skew signal.
622
+ */
617
623
  export declare const artifactsUploadCompleteSchema: z.ZodObject<{
618
624
  type: z.ZodLiteral<"artifacts.upload.complete">;
619
625
  messageId: z.ZodString;
620
626
  jobId: z.ZodString;
621
627
  name: z.ZodString;
622
- sizeBytes: z.ZodNumber;
623
628
  sha256: z.ZodString;
624
- storageKey: z.ZodString;
625
- }, z.core.$strip>;
629
+ }, z.core.$strict>;
626
630
  /**
627
631
  * Outcome the orchestrator reports for an artifact commit: the DB row was
628
632
  * written (`committed`) or the commit could not be completed (`failed`).
@@ -893,7 +897,6 @@ export declare const orchestratorToAgentMessageSchema: z.ZodDiscriminatedUnion<[
893
897
  maxLogSizeBytes: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
894
898
  concurrencyWaitTimeoutMs: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
895
899
  sourceTarUrl: z.ZodOptional<z.ZodString>;
896
- sourceTarHash: z.ZodOptional<z.ZodString>;
897
900
  sourceTarDigest: z.ZodOptional<z.ZodString>;
898
901
  depsUrl: z.ZodOptional<z.ZodString>;
899
902
  depsHash: z.ZodOptional<z.ZodString>;
@@ -1337,10 +1340,8 @@ export declare const agentToOrchestratorMessageSchema: z.ZodDiscriminatedUnion<[
1337
1340
  messageId: z.ZodString;
1338
1341
  jobId: z.ZodString;
1339
1342
  name: z.ZodString;
1340
- sizeBytes: z.ZodNumber;
1341
1343
  sha256: z.ZodString;
1342
- storageKey: z.ZodString;
1343
- }, z.core.$strip>, z.ZodObject<{
1344
+ }, z.core.$strict>, z.ZodObject<{
1344
1345
  type: z.ZodLiteral<"artifacts.download.request">;
1345
1346
  messageId: z.ZodString;
1346
1347
  jobId: z.ZodString;
@@ -105,13 +105,6 @@ const jobDispatchSchema = z.object({
105
105
  /** URL or file:// path to a pre-packed `.kici/` source tarball. If present, agent extracts it into workDir instead of cloning the repo. */
106
106
  sourceTarUrl: z.string().optional(),
107
107
  /**
108
- * @deprecated Use `sourceTarDigest`. Despite its name this carries the
109
- * workflow `contentHash`, not a hash of the tarball bytes, so an agent
110
- * could not verify a restored tarball against it. Kept on the wire for
111
- * older agents; removed at v1.0.0.
112
- */
113
- sourceTarHash: z.string().optional(),
114
- /**
115
108
  * SHA-256 of the source tarball's own bytes, for integrity verification
116
109
  * before extraction. The sibling of `depsHash`, which has always carried
117
110
  * the dependency tarball's real digest.
@@ -772,31 +765,22 @@ const artifactsUploadResponseSchema = z.object({
772
765
  */
773
766
  error: z.string().optional()
774
767
  });
775
- /** Agent -> Orchestrator: confirm an artifact upload finished; records the DB row. */
768
+ /**
769
+ * Agent -> Orchestrator: confirm an artifact upload finished; records the DB row.
770
+ *
771
+ * The orchestrator derives the storage key from the server-resolved run and
772
+ * artifact name and reads the real object size back from storage, so the agent
773
+ * asserts neither. `.strict()`: an agent still echoing either is on a build the
774
+ * protocol floor refuses, and a stray field is a version-skew signal.
775
+ */
776
776
  const artifactsUploadCompleteSchema = z.object({
777
777
  type: z.literal("artifacts.upload.complete"),
778
778
  messageId: z.string(),
779
779
  jobId: z.string(),
780
780
  name: z.string(),
781
- /**
782
- * Packed tarball size in bytes.
783
- *
784
- * @deprecated Advisory only — the orchestrator reads the real object size back
785
- * from storage and records that instead. Still sent for backward compatibility
786
- * with older orchestrators; removed at v1.0.0.
787
- */
788
- sizeBytes: z.number().int().nonnegative(),
789
781
  /** SHA-256 (hex) of the tarball bytes. */
790
- sha256: z.string(),
791
- /**
792
- * Storage key echoed from the grant response.
793
- *
794
- * @deprecated Ignored server-side — the orchestrator derives the storage key
795
- * from the server-resolved run and artifact name. Still sent for backward
796
- * compatibility with older orchestrators; removed at v1.0.0.
797
- */
798
- storageKey: z.string()
799
- });
782
+ sha256: z.string()
783
+ }).strict();
800
784
  /**
801
785
  * Outcome the orchestrator reports for an artifact commit: the DB row was
802
786
  * written (`committed`) or the commit could not be completed (`failed`).
@@ -7,7 +7,12 @@ export declare const peerCapabilitiesSchema: z.ZodObject<{
7
7
  direct: "direct";
8
8
  }>>;
9
9
  }, z.core.$strip>;
10
- /** Scaler capacity summary included in peer heartbeat and auth response for routing decisions. */
10
+ /**
11
+ * Scaler capacity summary included in peer heartbeat and auth response for
12
+ * routing decisions. `.strict()`: the entry once carried a scaler-wide taint
13
+ * union a peer on this protocol floor never sends, so a stray field is a
14
+ * version-skew signal rather than something to ignore.
15
+ */
11
16
  declare const scalerCapacitySummarySchema: z.ZodObject<{
12
17
  name: z.ZodOptional<z.ZodString>;
13
18
  type: z.ZodOptional<z.ZodString>;
@@ -15,9 +20,8 @@ declare const scalerCapacitySummarySchema: z.ZodObject<{
15
20
  maxAgents: z.ZodNumber;
16
21
  activeCount: z.ZodNumber;
17
22
  spawnsOnLocalHost: z.ZodOptional<z.ZodBoolean>;
18
- mandatoryLabels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
19
- labelSetMandatoryLabels: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
20
- }, z.core.$strip>;
23
+ labelSetMandatoryLabels: z.ZodArray<z.ZodArray<z.ZodString>>;
24
+ }, z.core.$strict>;
21
25
  /** Peer hello: initiator sends ephemeral X25519 public key and nonce. */
22
26
  export declare const peerHelloSchema: z.ZodObject<{
23
27
  type: z.ZodLiteral<"peer.hello">;
@@ -58,7 +62,7 @@ export declare const peerAuthResponseSchema: z.ZodObject<{
58
62
  maxConcurrency: z.ZodNumber;
59
63
  platform: z.ZodString;
60
64
  arch: z.ZodString;
61
- mandatoryLabels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
65
+ mandatoryLabels: z.ZodArray<z.ZodString>;
62
66
  scalerName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
63
67
  }, z.core.$strip>>>;
64
68
  scalerCapacity: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -68,9 +72,8 @@ export declare const peerAuthResponseSchema: z.ZodObject<{
68
72
  maxAgents: z.ZodNumber;
69
73
  activeCount: z.ZodNumber;
70
74
  spawnsOnLocalHost: z.ZodOptional<z.ZodBoolean>;
71
- mandatoryLabels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
72
- labelSetMandatoryLabels: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
73
- }, z.core.$strip>>>;
75
+ labelSetMandatoryLabels: z.ZodArray<z.ZodArray<z.ZodString>>;
76
+ }, z.core.$strict>>>;
74
77
  capabilities: z.ZodOptional<z.ZodObject<{
75
78
  s3LogAccess: z.ZodBoolean;
76
79
  logRoutingOverride: z.ZodOptional<z.ZodEnum<{
@@ -93,7 +96,7 @@ export declare const peerHeartbeatSchema: z.ZodObject<{
93
96
  maxConcurrency: z.ZodNumber;
94
97
  platform: z.ZodString;
95
98
  arch: z.ZodString;
96
- mandatoryLabels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
99
+ mandatoryLabels: z.ZodArray<z.ZodString>;
97
100
  scalerName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
98
101
  }, z.core.$strip>>;
99
102
  capabilities: z.ZodObject<{
@@ -110,9 +113,8 @@ export declare const peerHeartbeatSchema: z.ZodObject<{
110
113
  maxAgents: z.ZodNumber;
111
114
  activeCount: z.ZodNumber;
112
115
  spawnsOnLocalHost: z.ZodOptional<z.ZodBoolean>;
113
- mandatoryLabels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
114
- labelSetMandatoryLabels: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
115
- }, z.core.$strip>>>;
116
+ labelSetMandatoryLabels: z.ZodArray<z.ZodArray<z.ZodString>>;
117
+ }, z.core.$strict>>>;
116
118
  configVersion: z.ZodOptional<z.ZodNumber>;
117
119
  registryVersion: z.ZodOptional<z.ZodNumber>;
118
120
  clusterSettingsVersion: z.ZodOptional<z.ZodNumber>;
@@ -172,7 +174,6 @@ export declare const jobRerouteSchema: z.ZodObject<{
172
174
  provider: z.ZodOptional<z.ZodString>;
173
175
  providerContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
174
176
  sourceTarUrl: z.ZodOptional<z.ZodString>;
175
- sourceTarHash: z.ZodOptional<z.ZodString>;
176
177
  sourceTarDigest: z.ZodOptional<z.ZodString>;
177
178
  depsUrl: z.ZodOptional<z.ZodString>;
178
179
  depsHash: z.ZodOptional<z.ZodString>;
@@ -488,7 +489,7 @@ export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
488
489
  maxConcurrency: z.ZodNumber;
489
490
  platform: z.ZodString;
490
491
  arch: z.ZodString;
491
- mandatoryLabels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
492
+ mandatoryLabels: z.ZodArray<z.ZodString>;
492
493
  scalerName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
493
494
  }, z.core.$strip>>>;
494
495
  scalerCapacity: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -498,9 +499,8 @@ export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
498
499
  maxAgents: z.ZodNumber;
499
500
  activeCount: z.ZodNumber;
500
501
  spawnsOnLocalHost: z.ZodOptional<z.ZodBoolean>;
501
- mandatoryLabels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
502
- labelSetMandatoryLabels: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
503
- }, z.core.$strip>>>;
502
+ labelSetMandatoryLabels: z.ZodArray<z.ZodArray<z.ZodString>>;
503
+ }, z.core.$strict>>>;
504
504
  capabilities: z.ZodOptional<z.ZodObject<{
505
505
  s3LogAccess: z.ZodBoolean;
506
506
  logRoutingOverride: z.ZodOptional<z.ZodEnum<{
@@ -521,7 +521,7 @@ export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
521
521
  maxConcurrency: z.ZodNumber;
522
522
  platform: z.ZodString;
523
523
  arch: z.ZodString;
524
- mandatoryLabels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
524
+ mandatoryLabels: z.ZodArray<z.ZodString>;
525
525
  scalerName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
526
526
  }, z.core.$strip>>;
527
527
  capabilities: z.ZodObject<{
@@ -538,9 +538,8 @@ export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
538
538
  maxAgents: z.ZodNumber;
539
539
  activeCount: z.ZodNumber;
540
540
  spawnsOnLocalHost: z.ZodOptional<z.ZodBoolean>;
541
- mandatoryLabels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
542
- labelSetMandatoryLabels: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
543
- }, z.core.$strip>>>;
541
+ labelSetMandatoryLabels: z.ZodArray<z.ZodArray<z.ZodString>>;
542
+ }, z.core.$strict>>>;
544
543
  configVersion: z.ZodOptional<z.ZodNumber>;
545
544
  registryVersion: z.ZodOptional<z.ZodNumber>;
546
545
  clusterSettingsVersion: z.ZodOptional<z.ZodNumber>;
@@ -598,7 +597,6 @@ export declare const peerToPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObje
598
597
  provider: z.ZodOptional<z.ZodString>;
599
598
  providerContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
600
599
  sourceTarUrl: z.ZodOptional<z.ZodString>;
601
- sourceTarHash: z.ZodOptional<z.ZodString>;
602
600
  sourceTarDigest: z.ZodOptional<z.ZodString>;
603
601
  depsUrl: z.ZodOptional<z.ZodString>;
604
602
  depsHash: z.ZodOptional<z.ZodString>;
@@ -805,7 +803,7 @@ export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
805
803
  maxConcurrency: z.ZodNumber;
806
804
  platform: z.ZodString;
807
805
  arch: z.ZodString;
808
- mandatoryLabels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
806
+ mandatoryLabels: z.ZodArray<z.ZodString>;
809
807
  scalerName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
810
808
  }, z.core.$strip>>>;
811
809
  scalerCapacity: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -815,9 +813,8 @@ export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
815
813
  maxAgents: z.ZodNumber;
816
814
  activeCount: z.ZodNumber;
817
815
  spawnsOnLocalHost: z.ZodOptional<z.ZodBoolean>;
818
- mandatoryLabels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
819
- labelSetMandatoryLabels: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
820
- }, z.core.$strip>>>;
816
+ labelSetMandatoryLabels: z.ZodArray<z.ZodArray<z.ZodString>>;
817
+ }, z.core.$strict>>>;
821
818
  capabilities: z.ZodOptional<z.ZodObject<{
822
819
  s3LogAccess: z.ZodBoolean;
823
820
  logRoutingOverride: z.ZodOptional<z.ZodEnum<{
@@ -838,7 +835,7 @@ export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
838
835
  maxConcurrency: z.ZodNumber;
839
836
  platform: z.ZodString;
840
837
  arch: z.ZodString;
841
- mandatoryLabels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
838
+ mandatoryLabels: z.ZodArray<z.ZodString>;
842
839
  scalerName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
843
840
  }, z.core.$strip>>;
844
841
  capabilities: z.ZodObject<{
@@ -855,9 +852,8 @@ export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
855
852
  maxAgents: z.ZodNumber;
856
853
  activeCount: z.ZodNumber;
857
854
  spawnsOnLocalHost: z.ZodOptional<z.ZodBoolean>;
858
- mandatoryLabels: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
859
- labelSetMandatoryLabels: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
860
- }, z.core.$strip>>>;
855
+ labelSetMandatoryLabels: z.ZodArray<z.ZodArray<z.ZodString>>;
856
+ }, z.core.$strict>>>;
861
857
  configVersion: z.ZodOptional<z.ZodNumber>;
862
858
  registryVersion: z.ZodOptional<z.ZodNumber>;
863
859
  clusterSettingsVersion: z.ZodOptional<z.ZodNumber>;
@@ -915,7 +911,6 @@ export declare const peerFromPeerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodOb
915
911
  provider: z.ZodOptional<z.ZodString>;
916
912
  providerContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
917
913
  sourceTarUrl: z.ZodOptional<z.ZodString>;
918
- sourceTarHash: z.ZodOptional<z.ZodString>;
919
914
  sourceTarDigest: z.ZodOptional<z.ZodString>;
920
915
  depsUrl: z.ZodOptional<z.ZodString>;
921
916
  depsHash: z.ZodOptional<z.ZodString>;