@kici-dev/engine 0.4.0 → 0.6.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 (81) hide show
  1. package/dist/audit/access-log-policy.js +1 -0
  2. package/dist/audit/retention-policy.js +2 -0
  3. package/dist/context/held-run-job-id.d.ts +26 -10
  4. package/dist/context/held-run-job-id.js +30 -11
  5. package/dist/context/host-match.js +2 -1
  6. package/dist/context/index.d.ts +1 -1
  7. package/dist/context/index.js +3 -3
  8. package/dist/context/types.d.ts +10 -1
  9. package/dist/context/types.js +10 -1
  10. package/dist/index.d.ts +6 -2
  11. package/dist/index.js +17 -12
  12. package/dist/labels/compile.d.ts +2 -7
  13. package/dist/labels/compile.js +1 -10
  14. package/dist/labels.d.ts +74 -12
  15. package/dist/labels.js +82 -17
  16. package/dist/mcp/held-run-resolve.d.ts +40 -0
  17. package/dist/mcp/held-run-resolve.js +68 -15
  18. package/dist/mcp/tool-schemas.d.ts +4 -0
  19. package/dist/mcp/tool-schemas.js +13 -1
  20. package/dist/metrics/catalog-policy.d.ts +17 -3
  21. package/dist/metrics/catalog-policy.js +44 -13
  22. package/dist/metrics/metric-catalog.generated.d.ts +140 -0
  23. package/dist/metrics/metric-catalog.generated.js +168 -0
  24. package/dist/protocol/dashboard-global-workflows.js +2 -2
  25. package/dist/protocol/event-log-payload.js +1 -1
  26. package/dist/protocol/messages/access-log.d.ts +5 -0
  27. package/dist/protocol/messages/access-log.js +1 -0
  28. package/dist/protocol/messages/actor.d.ts +13 -2
  29. package/dist/protocol/messages/actor.js +16 -5
  30. package/dist/protocol/messages/common.js +1 -1
  31. package/dist/protocol/messages/dashboard-global-workflows.d.ts +29 -3
  32. package/dist/protocol/messages/dashboard-global-workflows.js +48 -4
  33. package/dist/protocol/messages/dashboard.d.ts +48 -7
  34. package/dist/protocol/messages/dashboard.js +62 -6
  35. package/dist/protocol/messages/execution-status.d.ts +44 -0
  36. package/dist/protocol/messages/execution-status.js +69 -2
  37. package/dist/protocol/messages/git-credential-relay.d.ts +78 -0
  38. package/dist/protocol/messages/git-credential-relay.js +86 -0
  39. package/dist/protocol/messages/orchestrator-agent.d.ts +138 -0
  40. package/dist/protocol/messages/orchestrator-agent.js +131 -3
  41. package/dist/protocol/messages/peer.d.ts +7 -0
  42. package/dist/protocol/messages/peer.js +18 -1
  43. package/dist/protocol/messages/platform-orchestrator.d.ts +155 -2
  44. package/dist/protocol/messages/platform-orchestrator.js +178 -19
  45. package/dist/protocol/version.d.ts +19 -2
  46. package/dist/protocol/version.js +20 -3
  47. package/dist/provenance/verify.js +11 -10
  48. package/dist/provider/check-status-poster.d.ts +37 -2
  49. package/dist/provider/contributor-resolver.d.ts +11 -3
  50. package/dist/provider/file-contents-fetcher.d.ts +39 -0
  51. package/dist/provider/file-contents-fetcher.js +2 -0
  52. package/dist/provider/git-credential.d.ts +77 -0
  53. package/dist/provider/git-credential.js +10 -0
  54. package/dist/provider/index.d.ts +4 -0
  55. package/dist/provider/index.js +2 -1
  56. package/dist/provider/webhook-normalizer.d.ts +12 -12
  57. package/dist/repo/pattern-negation.d.ts +73 -0
  58. package/dist/repo/pattern-negation.js +86 -0
  59. package/dist/safe-regex.d.ts +16 -0
  60. package/dist/safe-regex.js +24 -0
  61. package/dist/scaler/registry-auth.d.ts +18 -0
  62. package/dist/scaler/registry-auth.js +28 -0
  63. package/dist/scaler/scaler-backend-type.d.ts +35 -0
  64. package/dist/scaler/scaler-backend-type.js +39 -2
  65. package/dist/scaler/scaler-events.d.ts +79 -0
  66. package/dist/scaler/scaler-events.js +87 -0
  67. package/dist/trigger/compiled-matchers.d.ts +21 -1
  68. package/dist/trigger/compiled-matchers.js +30 -3
  69. package/dist/trigger/content-requirements.d.ts +31 -0
  70. package/dist/trigger/content-requirements.js +125 -0
  71. package/dist/trigger/decision-trace.d.ts +168 -0
  72. package/dist/trigger/decision-trace.js +207 -4
  73. package/dist/trigger/jsonpath-matcher.js +5 -1
  74. package/dist/trigger/matcher.js +61 -10
  75. package/dist/trigger/text-match.d.ts +27 -0
  76. package/dist/trigger/text-match.js +86 -0
  77. package/dist/trigger/types.d.ts +265 -23
  78. package/dist/trigger/types.js +37 -5
  79. package/dist/ws/rate-limiter.js +3 -3
  80. package/package.json +20 -3
  81. package/sbom.spdx.json +40 -15
@@ -17,7 +17,8 @@
17
17
  * Three 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` lists workflow-author repos with access to source secrets.
20
+ * - `elevatedRepos` is DEPRECATED and not enforced see the field comments
21
+ * below and `docs/user/deprecations.md`.
21
22
  */
22
23
  import { z } from 'zod';
23
24
  /**
@@ -29,6 +30,27 @@ export declare const repoPatternEntrySchema: z.ZodObject<{
29
30
  pattern: z.ZodString;
30
31
  }, z.core.$strip>;
31
32
  export type RepoPatternEntry = z.infer<typeof repoPatternEntrySchema>;
33
+ /**
34
+ * Why a pattern may not be stored on a global-workflow policy list, or null
35
+ * when it is acceptable.
36
+ *
37
+ * The lists match each entry as a single glob, so a negated pattern inverts to
38
+ * "everything except" — on an allow list that allows almost every repo, on a
39
+ * deny list it denies almost every repo. The list's own direction already
40
+ * encodes allow/deny, so negation forms are rejected at write time.
41
+ *
42
+ * This is deliberately not folded into `repoPatternEntrySchema`: the schema is
43
+ * also the read path for rows already in `org_settings`, which must keep
44
+ * parsing. Evaluation handles a stored negation form by failing closed.
45
+ *
46
+ * Which forms count as a negation is not decided here: it comes from the one
47
+ * classifier in `repo/pattern-negation.js`, shared with the Platform's
48
+ * repo-scope allow-list. Keeping the verdict in one place is what stops this
49
+ * list and that one from reading the same pattern language two different ways —
50
+ * notably the regular-expression assertions `(?!…)` / `(?<!…)`, which picomatch
51
+ * compiles into a real inversion, and `[!…]`, which it does not.
52
+ */
53
+ export declare function invalidRepoPatternReason(pattern: string): string | null;
32
54
  /** Projected org-level global workflow settings. */
33
55
  export declare const globalWorkflowSettingsSchema: z.ZodObject<{
34
56
  customerId: z.ZodString;
@@ -85,6 +107,11 @@ export declare const globalWorkflowsGetRequestSchema: z.ZodObject<{
85
107
  *
86
108
  * Every field is optional. `null` clears the corresponding list column
87
109
  * (e.g., `allowedRepos: null` means "all repos pass the allow-list").
110
+ *
111
+ * The master enable switch is NOT here: it is fleet-wide
112
+ * (`cluster_settings.global_workflows_enabled`, set with `kici-admin
113
+ * cluster-settings`), not per-org. `.strict()` so a client that still sends
114
+ * `enabled` gets a validation failure instead of a silently dropped field.
88
115
  */
89
116
  export declare const globalWorkflowsUpdateRequestSchema: z.ZodObject<{
90
117
  type: z.ZodLiteral<"dashboard.global-workflows.update">;
@@ -115,7 +142,6 @@ export declare const globalWorkflowsUpdateRequestSchema: z.ZodObject<{
115
142
  type: z.ZodLiteral<"system">;
116
143
  component: z.ZodString;
117
144
  }, z.core.$strip>], "type">;
118
- enabled: z.ZodOptional<z.ZodBoolean>;
119
145
  allowedRepos: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
120
146
  routingKey: z.ZodOptional<z.ZodString>;
121
147
  pattern: z.ZodString;
@@ -128,7 +154,7 @@ export declare const globalWorkflowsUpdateRequestSchema: z.ZodObject<{
128
154
  routingKey: z.ZodOptional<z.ZodString>;
129
155
  pattern: z.ZodString;
130
156
  }, z.core.$strip>>>>;
131
- }, z.core.$strip>;
157
+ }, z.core.$strict>;
132
158
  export declare const globalWorkflowsGetResponseSchema: z.ZodObject<{
133
159
  type: z.ZodLiteral<"dashboard.global-workflows.get.response">;
134
160
  requestId: z.ZodString;
@@ -1,5 +1,6 @@
1
1
  import "../../rolldown-runtime-ClRpJifh.js";
2
2
  import { actorPrincipalSchema } from "./actor.js";
3
+ import { negatedPatternReason } from "../../repo/pattern-negation.js";
3
4
  import { z } from "zod";
4
5
  //#region src/protocol/messages/dashboard-global-workflows.ts
5
6
  /**
@@ -21,7 +22,8 @@ import { z } from "zod";
21
22
  * Three independent policy axes (see GlobalWorkflowPolicy in the orchestrator):
22
23
  * - `allowedRepos` restricts which repos may AUTHOR global workflows.
23
24
  * - `deniedRepos` blocks global dispatches for events FROM these SOURCE repos.
24
- * - `elevatedRepos` lists workflow-author repos with access to source secrets.
25
+ * - `elevatedRepos` is DEPRECATED and not enforced see the field comments
26
+ * below and `docs/user/deprecations.md`.
25
27
  */
26
28
  /**
27
29
  * One entry in any of the three repo-pattern lists. `routingKey` is the
@@ -31,12 +33,49 @@ const repoPatternEntrySchema = z.object({
31
33
  routingKey: z.string().min(1).optional(),
32
34
  pattern: z.string().min(1)
33
35
  });
36
+ /**
37
+ * Why a pattern may not be stored on a global-workflow policy list, or null
38
+ * when it is acceptable.
39
+ *
40
+ * The lists match each entry as a single glob, so a negated pattern inverts to
41
+ * "everything except" — on an allow list that allows almost every repo, on a
42
+ * deny list it denies almost every repo. The list's own direction already
43
+ * encodes allow/deny, so negation forms are rejected at write time.
44
+ *
45
+ * This is deliberately not folded into `repoPatternEntrySchema`: the schema is
46
+ * also the read path for rows already in `org_settings`, which must keep
47
+ * parsing. Evaluation handles a stored negation form by failing closed.
48
+ *
49
+ * Which forms count as a negation is not decided here: it comes from the one
50
+ * classifier in `repo/pattern-negation.js`, shared with the Platform's
51
+ * repo-scope allow-list. Keeping the verdict in one place is what stops this
52
+ * list and that one from reading the same pattern language two different ways —
53
+ * notably the regular-expression assertions `(?!…)` / `(?<!…)`, which picomatch
54
+ * compiles into a real inversion, and `[!…]`, which it does not.
55
+ */
56
+ function invalidRepoPatternReason(pattern) {
57
+ if (pattern.trim() === "") return "pattern is empty";
58
+ const negation = negatedPatternReason(pattern);
59
+ if (negation) return `${negation} is not allowed on a policy list — the list's direction already encodes allow/deny`;
60
+ return null;
61
+ }
34
62
  /** Projected org-level global workflow settings. */
35
63
  const globalWorkflowSettingsSchema = z.object({
36
64
  customerId: z.string(),
65
+ /**
66
+ * The effective fleet-wide master switch
67
+ * (`cluster_settings.global_workflows_enabled`, set with `kici-admin
68
+ * cluster-settings`). Read-only here — the dashboard renders it as a status
69
+ * badge; it is not a per-org value and cannot be flipped from the dashboard.
70
+ */
37
71
  enabled: z.boolean(),
38
72
  allowedRepos: z.array(repoPatternEntrySchema).nullable(),
39
73
  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
+ */
40
79
  elevatedRepos: z.array(repoPatternEntrySchema).nullable(),
41
80
  createdAt: z.string().nullable(),
42
81
  updatedAt: z.string().nullable()
@@ -52,16 +91,21 @@ const globalWorkflowsGetRequestSchema = z.object({
52
91
  *
53
92
  * Every field is optional. `null` clears the corresponding list column
54
93
  * (e.g., `allowedRepos: null` means "all repos pass the allow-list").
94
+ *
95
+ * The master enable switch is NOT here: it is fleet-wide
96
+ * (`cluster_settings.global_workflows_enabled`, set with `kici-admin
97
+ * cluster-settings`), not per-org. `.strict()` so a client that still sends
98
+ * `enabled` gets a validation failure instead of a silently dropped field.
55
99
  */
56
100
  const globalWorkflowsUpdateRequestSchema = z.object({
57
101
  type: z.literal("dashboard.global-workflows.update"),
58
102
  requestId: z.string(),
59
103
  actor: actorPrincipalSchema,
60
- enabled: z.boolean().optional(),
61
104
  allowedRepos: z.array(repoPatternEntrySchema).nullable().optional(),
62
105
  deniedRepos: z.array(repoPatternEntrySchema).nullable().optional(),
106
+ /** @deprecated Accepted and stored, but never enforced. Removal at v1.0.0. */
63
107
  elevatedRepos: z.array(repoPatternEntrySchema).nullable().optional()
64
- });
108
+ }).strict();
65
109
  const globalWorkflowsGetResponseSchema = z.object({
66
110
  type: z.literal("dashboard.global-workflows.get.response"),
67
111
  requestId: z.string(),
@@ -75,6 +119,6 @@ const globalWorkflowsUpdateResponseSchema = z.object({
75
119
  error: z.string().optional()
76
120
  });
77
121
  //#endregion
78
- export { globalWorkflowSettingsSchema, globalWorkflowsGetRequestSchema, globalWorkflowsGetResponseSchema, globalWorkflowsUpdateRequestSchema, globalWorkflowsUpdateResponseSchema, repoPatternEntrySchema };
122
+ export { globalWorkflowSettingsSchema, globalWorkflowsGetRequestSchema, globalWorkflowsGetResponseSchema, globalWorkflowsUpdateRequestSchema, globalWorkflowsUpdateResponseSchema, invalidRepoPatternReason, repoPatternEntrySchema };
79
123
 
80
124
  //# sourceMappingURL=dashboard-global-workflows.js.map
@@ -299,6 +299,7 @@ export declare const dashboardRunStateResponseSchema: z.ZodObject<{
299
299
  }>;
300
300
  routingKey: z.ZodOptional<z.ZodString>;
301
301
  repoIdentifier: z.ZodOptional<z.ZodString>;
302
+ workflowRepoIdentifier: z.ZodOptional<z.ZodString>;
302
303
  sha: z.ZodOptional<z.ZodString>;
303
304
  ref: z.ZodOptional<z.ZodString>;
304
305
  triggerEvent: z.ZodOptional<z.ZodString>;
@@ -380,6 +381,12 @@ export declare const dashboardJobDetailSchema: z.ZodObject<{
380
381
  baseJobName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
381
382
  variantKind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
382
383
  variantLabel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
384
+ jobKind: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
385
+ gate: "gate";
386
+ proxy: "proxy";
387
+ standard: "standard";
388
+ }>>>;
389
+ summonedRunId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
383
390
  startedAt: z.ZodNullable<z.ZodNumber>;
384
391
  completedAt: z.ZodNullable<z.ZodNumber>;
385
392
  durationMs: z.ZodNullable<z.ZodNumber>;
@@ -391,7 +398,7 @@ export declare const dashboardJobDetailSchema: z.ZodObject<{
391
398
  contexts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
392
399
  skippedContexts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
393
400
  envWarning: z.ZodOptional<z.ZodNullable<z.ZodString>>;
394
- outputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
401
+ outputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
395
402
  secretOutputKeys: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
396
403
  initFailure: z.ZodOptional<z.ZodObject<{
397
404
  scope: z.ZodEnum<{
@@ -470,6 +477,12 @@ export declare const dashboardRunDetailResponseSchema: z.ZodObject<{
470
477
  baseJobName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
471
478
  variantKind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
472
479
  variantLabel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
480
+ jobKind: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
481
+ gate: "gate";
482
+ proxy: "proxy";
483
+ standard: "standard";
484
+ }>>>;
485
+ summonedRunId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
473
486
  startedAt: z.ZodNullable<z.ZodNumber>;
474
487
  completedAt: z.ZodNullable<z.ZodNumber>;
475
488
  durationMs: z.ZodNullable<z.ZodNumber>;
@@ -481,7 +494,7 @@ export declare const dashboardRunDetailResponseSchema: z.ZodObject<{
481
494
  contexts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
482
495
  skippedContexts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
483
496
  envWarning: z.ZodOptional<z.ZodNullable<z.ZodString>>;
484
- outputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
497
+ outputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
485
498
  secretOutputKeys: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
486
499
  initFailure: z.ZodOptional<z.ZodObject<{
487
500
  scope: z.ZodEnum<{
@@ -3567,6 +3580,7 @@ export declare const dashboardDiagnosticsResponseSchema: z.ZodObject<{
3567
3580
  type: z.ZodEnum<{
3568
3581
  "bare-metal": "bare-metal";
3569
3582
  container: "container";
3583
+ event: "event";
3570
3584
  firecracker: "firecracker";
3571
3585
  kubernetes: "kubernetes";
3572
3586
  }>;
@@ -6616,7 +6630,6 @@ export declare const dashboardPlatformToOrchSchema: z.ZodDiscriminatedUnion<[z.Z
6616
6630
  type: z.ZodLiteral<"system">;
6617
6631
  component: z.ZodString;
6618
6632
  }, z.core.$strip>], "type">;
6619
- enabled: z.ZodOptional<z.ZodBoolean>;
6620
6633
  allowedRepos: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
6621
6634
  routingKey: z.ZodOptional<z.ZodString>;
6622
6635
  pattern: z.ZodString;
@@ -6629,7 +6642,7 @@ export declare const dashboardPlatformToOrchSchema: z.ZodDiscriminatedUnion<[z.Z
6629
6642
  routingKey: z.ZodOptional<z.ZodString>;
6630
6643
  pattern: z.ZodString;
6631
6644
  }, z.core.$strip>>>>;
6632
- }, z.core.$strip>, z.ZodObject<{
6645
+ }, z.core.$strict>, z.ZodObject<{
6633
6646
  type: z.ZodLiteral<"dashboard.access-log.list">;
6634
6647
  requestId: z.ZodString;
6635
6648
  actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -6746,6 +6759,7 @@ export declare const dashboardPlatformToOrchSchema: z.ZodDiscriminatedUnion<[z.Z
6746
6759
  "source_override.set": "source_override.set";
6747
6760
  "sources.list.read": "sources.list.read";
6748
6761
  "step.logs.read": "step.logs.read";
6762
+ "trust_directory.updated": "trust_directory.updated";
6749
6763
  "trust_policy.updated": "trust_policy.updated";
6750
6764
  }>>;
6751
6765
  source: z.ZodOptional<z.ZodEnum<{
@@ -7001,6 +7015,12 @@ export declare const dashboardOrchToPlatformSchema: z.ZodDiscriminatedUnion<[z.Z
7001
7015
  baseJobName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7002
7016
  variantKind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7003
7017
  variantLabel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7018
+ jobKind: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
7019
+ gate: "gate";
7020
+ proxy: "proxy";
7021
+ standard: "standard";
7022
+ }>>>;
7023
+ summonedRunId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7004
7024
  startedAt: z.ZodNullable<z.ZodNumber>;
7005
7025
  completedAt: z.ZodNullable<z.ZodNumber>;
7006
7026
  durationMs: z.ZodNullable<z.ZodNumber>;
@@ -7012,7 +7032,7 @@ export declare const dashboardOrchToPlatformSchema: z.ZodDiscriminatedUnion<[z.Z
7012
7032
  contexts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
7013
7033
  skippedContexts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
7014
7034
  envWarning: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7015
- outputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
7035
+ outputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
7016
7036
  secretOutputKeys: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
7017
7037
  initFailure: z.ZodOptional<z.ZodObject<{
7018
7038
  scope: z.ZodEnum<{
@@ -7296,6 +7316,7 @@ export declare const dashboardOrchToPlatformSchema: z.ZodDiscriminatedUnion<[z.Z
7296
7316
  }>;
7297
7317
  routingKey: z.ZodOptional<z.ZodString>;
7298
7318
  repoIdentifier: z.ZodOptional<z.ZodString>;
7319
+ workflowRepoIdentifier: z.ZodOptional<z.ZodString>;
7299
7320
  sha: z.ZodOptional<z.ZodString>;
7300
7321
  ref: z.ZodOptional<z.ZodString>;
7301
7322
  triggerEvent: z.ZodOptional<z.ZodString>;
@@ -7908,6 +7929,7 @@ export declare const dashboardOrchToPlatformSchema: z.ZodDiscriminatedUnion<[z.Z
7908
7929
  type: z.ZodEnum<{
7909
7930
  "bare-metal": "bare-metal";
7910
7931
  container: "container";
7932
+ event: "event";
7911
7933
  firecracker: "firecracker";
7912
7934
  kubernetes: "kubernetes";
7913
7935
  }>;
@@ -8466,6 +8488,7 @@ export declare const dashboardOrchToPlatformSchema: z.ZodDiscriminatedUnion<[z.Z
8466
8488
  "source_override.set": "source_override.set";
8467
8489
  "sources.list.read": "sources.list.read";
8468
8490
  "step.logs.read": "step.logs.read";
8491
+ "trust_directory.updated": "trust_directory.updated";
8469
8492
  "trust_policy.updated": "trust_policy.updated";
8470
8493
  }>;
8471
8494
  targetType: z.ZodNullable<z.ZodEnum<{
@@ -8635,6 +8658,12 @@ export declare const dashboardRunDetailApiResponseSchema: z.ZodObject<{
8635
8658
  baseJobName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8636
8659
  variantKind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8637
8660
  variantLabel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8661
+ jobKind: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
8662
+ gate: "gate";
8663
+ proxy: "proxy";
8664
+ standard: "standard";
8665
+ }>>>;
8666
+ summonedRunId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8638
8667
  startedAt: z.ZodNullable<z.ZodNumber>;
8639
8668
  completedAt: z.ZodNullable<z.ZodNumber>;
8640
8669
  durationMs: z.ZodNullable<z.ZodNumber>;
@@ -8646,7 +8675,7 @@ export declare const dashboardRunDetailApiResponseSchema: z.ZodObject<{
8646
8675
  contexts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
8647
8676
  skippedContexts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
8648
8677
  envWarning: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8649
- outputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
8678
+ outputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
8650
8679
  secretOutputKeys: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
8651
8680
  initFailure: z.ZodOptional<z.ZodObject<{
8652
8681
  scope: z.ZodEnum<{
@@ -8821,6 +8850,7 @@ export declare const runListItemSchema: z.ZodObject<{
8821
8850
  workflowName: z.ZodString;
8822
8851
  status: z.ZodString;
8823
8852
  repoIdentifier: z.ZodNullable<z.ZodString>;
8853
+ workflowRepoIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8824
8854
  sha: z.ZodNullable<z.ZodString>;
8825
8855
  ref: z.ZodNullable<z.ZodString>;
8826
8856
  triggerEvent: z.ZodNullable<z.ZodString>;
@@ -8878,6 +8908,7 @@ export declare const runListResponseSchema: z.ZodObject<{
8878
8908
  workflowName: z.ZodString;
8879
8909
  status: z.ZodString;
8880
8910
  repoIdentifier: z.ZodNullable<z.ZodString>;
8911
+ workflowRepoIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8881
8912
  sha: z.ZodNullable<z.ZodString>;
8882
8913
  ref: z.ZodNullable<z.ZodString>;
8883
8914
  triggerEvent: z.ZodNullable<z.ZodString>;
@@ -9203,12 +9234,20 @@ export declare const runEventSchema: z.ZodObject<{
9203
9234
  parentSpanId: z.ZodNullable<z.ZodString>;
9204
9235
  }, z.core.$strip>;
9205
9236
  export type RunEvent = z.infer<typeof runEventSchema>;
9206
- /** Trust policy response (from trust_policies table). */
9237
+ /**
9238
+ * Trust policy response (from trust_policies table).
9239
+ *
9240
+ * `approvalExpirySeconds` is the authoritative window and `approvalExpiryHours`
9241
+ * its coarse, rounded-up view, so a client reading only the older field still
9242
+ * gets a usable number. Both are always sent by this build; the seconds field is
9243
+ * optional so a dashboard build reading an older Platform still parses.
9244
+ */
9207
9245
  export declare const trustPolicyResponseSchema: z.ZodObject<{
9208
9246
  forkPolicy: z.ZodString;
9209
9247
  unknownContributorPolicy: z.ZodString;
9210
9248
  workflowChangePolicy: z.ZodString;
9211
9249
  approvalExpiryHours: z.ZodNumber;
9250
+ approvalExpirySeconds: z.ZodOptional<z.ZodNumber>;
9212
9251
  }, z.core.$strip>;
9213
9252
  export type TrustPolicy = z.infer<typeof trustPolicyResponseSchema>;
9214
9253
  /** Single identity link item. */
@@ -9256,6 +9295,7 @@ export declare const orgMemberSchema: z.ZodObject<{
9256
9295
  suspendedAt: z.ZodNullable<z.ZodCoercedString<unknown>>;
9257
9296
  joinedAt: z.ZodCoercedString<unknown>;
9258
9297
  ciTrustLevel: z.ZodString;
9298
+ ciTrustOverride: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9259
9299
  identityLinks: z.ZodArray<z.ZodObject<{
9260
9300
  provider: z.ZodString;
9261
9301
  providerUsername: z.ZodString;
@@ -9276,6 +9316,7 @@ export declare const memberListResponseSchema: z.ZodObject<{
9276
9316
  suspendedAt: z.ZodNullable<z.ZodCoercedString<unknown>>;
9277
9317
  joinedAt: z.ZodCoercedString<unknown>;
9278
9318
  ciTrustLevel: z.ZodString;
9319
+ ciTrustOverride: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9279
9320
  identityLinks: z.ZodArray<z.ZodObject<{
9280
9321
  provider: z.ZodString;
9281
9322
  providerUsername: z.ZodString;
@@ -5,7 +5,7 @@ import { AttestationOrigin } from "../../provenance/attestation-origin.js";
5
5
  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
- import { StepConcurrencyKind, initFailureSchema, stateReplayRunSchema } from "./execution-status.js";
8
+ import { JobKind, StepConcurrencyKind, initFailureSchema, stateReplayRunSchema } from "./execution-status.js";
9
9
  import { agentRunResultSchema } from "./agent-run-result.js";
10
10
  import { kiciBundleSchema } from "../../provenance/bundle.js";
11
11
  import { dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema } from "./access-log.js";
@@ -126,6 +126,19 @@ const dashboardJobDetailSchema = z.object({
126
126
  variantKind: z.string().nullable().optional(),
127
127
  /** Fan-out label for a child: matrix suffix or hostname; null for non-fanned jobs. */
128
128
  variantLabel: z.string().nullable().optional(),
129
+ /**
130
+ * Job kind: `standard` runs steps on an agent, `gate` is an invoke gate, and
131
+ * `proxy` mirrors a summoned source-repo run. Absent/null for a standard job.
132
+ *
133
+ * OPTIONAL, and must stay optional: the wire protocol is compatibility-
134
+ * protected, so an orchestrator that predates invoke gates omits it.
135
+ */
136
+ jobKind: JobKind.nullable().optional(),
137
+ /**
138
+ * For a `proxy` job, the summoned source-repo run this job mirrors; the
139
+ * dashboard links the proxy node through to it. null/absent otherwise.
140
+ */
141
+ summonedRunId: z.string().nullable().optional(),
129
142
  startedAt: z.number().nullable(),
130
143
  completedAt: z.number().nullable(),
131
144
  durationMs: z.number().nullable(),
@@ -138,7 +151,7 @@ const dashboardJobDetailSchema = z.object({
138
151
  * a matching agent or scaler backend appears.
139
152
  *
140
153
  * OPTIONAL, and must stay optional: the wire protocol is compatibility-
141
- * protected, so an orchestrator that predates the unroutable probe simply
154
+ * protected, so an orchestrator that predates the unroutable probe
142
155
  * omits it.
143
156
  */
144
157
  routingReason: z.string().nullable().optional(),
@@ -157,8 +170,22 @@ const dashboardJobDetailSchema = z.object({
157
170
  skippedContexts: z.array(z.string()).nullable().optional(),
158
171
  /** User-visible warning naming the skipped test-run contexts. null/absent when none. */
159
172
  envWarning: z.string().nullable().optional(),
160
- /** Aggregated step outputs (step-keyed map). Present when job completed successfully with outputs. */
161
- outputs: z.record(z.string(), z.record(z.string(), z.unknown())).nullable().optional(),
173
+ /**
174
+ * A job's non-secret outputs. Present when the job completed successfully with
175
+ * outputs.
176
+ *
177
+ * The value is intentionally `z.record(z.string(), z.unknown())` — the same
178
+ * loose shape the wire (`job.status.data.outputs`) and `InvokeResult.outputs`
179
+ * use — because two job kinds populate it with two different shapes:
180
+ * - a **standard** job carries the agent's step-keyed map
181
+ * (`{ <stepName>: { <outputKey>: value } }`), so each value is itself a map;
182
+ * - a **proxy** job mirrors a summoned run, and a run's outputs are FLAT
183
+ * (`{ <outputKey>: value }`, values scalar), matching `InvokeResult.outputs`.
184
+ *
185
+ * A stricter step-keyed record type rejected the flat proxy shape and failed
186
+ * the whole run-detail response, so the schema accepts either.
187
+ */
188
+ outputs: z.record(z.string(), z.unknown()).nullable().optional(),
162
189
  /** Secret output key names produced by this job (values are NOT included -- display masked). */
163
190
  secretOutputKeys: z.array(z.string()).nullable().optional(),
164
191
  /**
@@ -2203,6 +2230,13 @@ const runListItemSchema = z.object({
2203
2230
  workflowName: z.string(),
2204
2231
  status: z.string(),
2205
2232
  repoIdentifier: z.string().nullable(),
2233
+ /**
2234
+ * The repository that DEFINES this run's workflow. Non-null only when it
2235
+ * differs from `repoIdentifier` — i.e. this is an organization-wide global
2236
+ * run, whose workflow file lives in another repo entirely. Optional so a
2237
+ * client parsing a response from an older Platform still validates.
2238
+ */
2239
+ workflowRepoIdentifier: z.string().nullable().optional(),
2206
2240
  sha: z.string().nullable(),
2207
2241
  ref: z.string().nullable(),
2208
2242
  triggerEvent: z.string().nullable(),
@@ -2403,12 +2437,20 @@ const runEventSchema = z.object({
2403
2437
  spanId: z.string().nullable(),
2404
2438
  parentSpanId: z.string().nullable()
2405
2439
  });
2406
- /** Trust policy response (from trust_policies table). */
2440
+ /**
2441
+ * Trust policy response (from trust_policies table).
2442
+ *
2443
+ * `approvalExpirySeconds` is the authoritative window and `approvalExpiryHours`
2444
+ * its coarse, rounded-up view, so a client reading only the older field still
2445
+ * gets a usable number. Both are always sent by this build; the seconds field is
2446
+ * optional so a dashboard build reading an older Platform still parses.
2447
+ */
2407
2448
  const trustPolicyResponseSchema = z.object({
2408
2449
  forkPolicy: z.string(),
2409
2450
  unknownContributorPolicy: z.string(),
2410
2451
  workflowChangePolicy: z.string(),
2411
- approvalExpiryHours: z.number()
2452
+ approvalExpiryHours: z.number(),
2453
+ approvalExpirySeconds: z.number().optional()
2412
2454
  });
2413
2455
  /** Single identity link item. */
2414
2456
  const identityLinkItemSchema = z.object({
@@ -2441,6 +2483,20 @@ const orgMemberSchema = z.object({
2441
2483
  suspendedAt: z.coerce.string().nullable(),
2442
2484
  joinedAt: z.coerce.string(),
2443
2485
  ciTrustLevel: z.string(),
2486
+ /**
2487
+ * The per-member `ci_trust` override, when one is stored, or `null` when the
2488
+ * member's level is entirely role-derived.
2489
+ *
2490
+ * Carried beside `ciTrustLevel` rather than folded into it, because the two
2491
+ * answer different questions. `ciTrustLevel` is the effective level the CI
2492
+ * trust gate decides with — the role-derived level with any override applied
2493
+ * on top — so it cannot say which half produced it. An override OUTRANKS the
2494
+ * roles, so an org that lowered a member by override has no way to see that,
2495
+ * and no way to undo it, from a payload that reports only the result.
2496
+ *
2497
+ * Optional so an older client keeps parsing the response.
2498
+ */
2499
+ ciTrustOverride: z.string().nullable().optional(),
2444
2500
  identityLinks: z.array(memberIdentityLinkSchema)
2445
2501
  });
2446
2502
  /** Response for org members list endpoint. */
@@ -57,6 +57,18 @@ export declare const ExecutionJobStatus: z.ZodEnum<{
57
57
  unroutable: "unroutable";
58
58
  }>;
59
59
  export type ExecutionJobStatus = z.infer<typeof ExecutionJobStatus>;
60
+ /**
61
+ * Job kind on the wire. `standard` runs steps on an agent; `gate` is an invoke
62
+ * gate that summons source-repo runs instead of running steps; `proxy` mirrors
63
+ * one summoned run's lifecycle. The orchestrator's DB `JobKind` enum mirrors
64
+ * these members.
65
+ */
66
+ export declare const JobKind: z.ZodEnum<{
67
+ gate: "gate";
68
+ proxy: "proxy";
69
+ standard: "standard";
70
+ }>;
71
+ export type JobKind = z.infer<typeof JobKind>;
60
72
  /**
61
73
  * The status values a notification subscription may target at the given level.
62
74
  *
@@ -174,6 +186,28 @@ export declare const CacheStepType: z.ZodEnum<{
174
186
  "cache:save": "cache:save";
175
187
  }>;
176
188
  export type CacheStepType = z.infer<typeof CacheStepType>;
189
+ /**
190
+ * `step_type` values for pseudo-steps that run BEFORE a job's real steps.
191
+ *
192
+ * A run's step timeline is ordered by `step_index`, and every pseudo-step index
193
+ * sits ABOVE the real steps (the wire schema requires a non-negative index, and
194
+ * the in-sandbox allocators claim a high block). That is fine for the cache
195
+ * pseudo-steps, which mostly bracket the work — but a job's image build runs
196
+ * strictly first, and rendering it last reads as though it happened last.
197
+ *
198
+ * A reader therefore sorts these types ahead of everything else, by TYPE rather
199
+ * than by index. Keeping the ordering rule here — rather than as a negative
200
+ * index — is deliberate: `step.status` rejects a negative index outright, so an
201
+ * agent that sent one to an older orchestrator would have its connection closed
202
+ * mid-job, and two consumers (the check-run reporter's array write, the
203
+ * dashboard's `stepIndex >= 0` log gate) treat a negative index as absent.
204
+ */
205
+ export declare const SetupStepType: z.ZodEnum<{
206
+ "container:build": "container:build";
207
+ }>;
208
+ export type SetupStepType = z.infer<typeof SetupStepType>;
209
+ /** True when a `step_type` names a pseudo-step that ran before the real steps. */
210
+ export declare function isSetupStepType(stepType: string | null | undefined): boolean;
177
211
  /** `run.event` types emitted for user-facing cache operations. */
178
212
  export declare const CacheRunEventType: z.ZodEnum<{
179
213
  "cache.restore": "cache.restore";
@@ -264,6 +298,8 @@ export declare const executionStatusSchema: z.ZodObject<{
264
298
  }>;
265
299
  routingKey: z.ZodOptional<z.ZodString>;
266
300
  repoIdentifier: z.ZodOptional<z.ZodString>;
301
+ workflowRepoIdentifier: z.ZodOptional<z.ZodString>;
302
+ isGlobalEvalRound: z.ZodOptional<z.ZodBoolean>;
267
303
  repoProvider: z.ZodOptional<z.ZodString>;
268
304
  localWorkingTree: z.ZodOptional<z.ZodBoolean>;
269
305
  sha: z.ZodOptional<z.ZodString>;
@@ -393,6 +429,12 @@ export declare const jobStatusForwardSchema: z.ZodObject<{
393
429
  message: z.ZodString;
394
430
  jobName: z.ZodOptional<z.ZodString>;
395
431
  }, z.core.$strip>>;
432
+ jobKind: z.ZodOptional<z.ZodEnum<{
433
+ gate: "gate";
434
+ proxy: "proxy";
435
+ standard: "standard";
436
+ }>>;
437
+ summonedRunId: z.ZodOptional<z.ZodString>;
396
438
  }, z.core.$strip>;
397
439
  /** State replay sent on orchestrator reconnection -- full snapshot of active runs and jobs. */
398
440
  /**
@@ -417,6 +459,7 @@ export declare const stateReplayRunSchema: z.ZodObject<{
417
459
  }>;
418
460
  routingKey: z.ZodOptional<z.ZodString>;
419
461
  repoIdentifier: z.ZodOptional<z.ZodString>;
462
+ workflowRepoIdentifier: z.ZodOptional<z.ZodString>;
420
463
  sha: z.ZodOptional<z.ZodString>;
421
464
  ref: z.ZodOptional<z.ZodString>;
422
465
  triggerEvent: z.ZodOptional<z.ZodString>;
@@ -468,6 +511,7 @@ export declare const stateReplaySchema: z.ZodObject<{
468
511
  }>;
469
512
  routingKey: z.ZodOptional<z.ZodString>;
470
513
  repoIdentifier: z.ZodOptional<z.ZodString>;
514
+ workflowRepoIdentifier: z.ZodOptional<z.ZodString>;
471
515
  sha: z.ZodOptional<z.ZodString>;
472
516
  ref: z.ZodOptional<z.ZodString>;
473
517
  triggerEvent: z.ZodOptional<z.ZodString>;