@kici-dev/engine 0.1.23 → 0.1.25

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 (146) hide show
  1. package/dist/approval/types.d.ts +1 -1
  2. package/dist/approval/types.js +1 -1
  3. package/dist/audit/access-log-policy.d.ts +4 -1
  4. package/dist/audit/access-log-policy.js +11 -2
  5. package/dist/audit/activity.d.ts +4 -2
  6. package/dist/audit/activity.js +15 -1
  7. package/dist/audit/retention-policy.js +5 -3
  8. package/dist/bundler/index.js +1 -1
  9. package/dist/bundler/rolldown-config.js +1 -1
  10. package/dist/check-mode.js +1 -1
  11. package/dist/dev-ops/operations.d.ts +56 -0
  12. package/dist/dev-ops/operations.js +135 -0
  13. package/dist/env/environment-allowlist.js +1 -1
  14. package/dist/environment/host-match.js +1 -1
  15. package/dist/environment/index.d.ts +2 -0
  16. package/dist/environment/index.js +4 -2
  17. package/dist/environment/multi-env.d.ts +30 -0
  18. package/dist/environment/multi-env.js +38 -0
  19. package/dist/environment/scope-resolver.js +1 -1
  20. package/dist/environment/scope-template.js +1 -1
  21. package/dist/environment/types.d.ts +8 -2
  22. package/dist/environment/types.js +19 -2
  23. package/dist/fanout/materialize.js +3 -3
  24. package/dist/index.d.ts +10 -1
  25. package/dist/index.js +25 -13
  26. package/dist/inputs/build.js +1 -1
  27. package/dist/inputs/coerce.js +1 -1
  28. package/dist/inputs/descriptor.js +1 -1
  29. package/dist/inputs/extract.js +1 -1
  30. package/dist/inputs/index.d.ts +1 -0
  31. package/dist/inputs/index.js +3 -2
  32. package/dist/inputs/schedule.d.ts +19 -0
  33. package/dist/inputs/schedule.js +33 -0
  34. package/dist/inventory.js +1 -1
  35. package/dist/labels/compile.js +1 -1
  36. package/dist/labels-match.js +1 -1
  37. package/dist/labels.js +2 -2
  38. package/dist/matrix/expand.js +1 -1
  39. package/dist/matrix/format.js +1 -1
  40. package/dist/mcp/fence.d.ts +22 -0
  41. package/dist/mcp/fence.js +65 -0
  42. package/dist/mcp/held-run-resolve.d.ts +52 -0
  43. package/dist/mcp/held-run-resolve.js +53 -0
  44. package/dist/mcp/tool-schemas.d.ts +74 -0
  45. package/dist/mcp/tool-schemas.js +78 -0
  46. package/dist/metrics/catalog-policy.js +1 -1
  47. package/dist/metrics/metric-catalog.generated.d.ts +105 -0
  48. package/dist/metrics/metric-catalog.generated.js +127 -1
  49. package/dist/protocol/analytics-events.js +1 -1
  50. package/dist/protocol/cluster-name.js +1 -1
  51. package/dist/protocol/dashboard-global-workflows.js +1 -1
  52. package/dist/protocol/dashboard-write-operations.d.ts +5 -1
  53. package/dist/protocol/dashboard-write-operations.js +13 -2
  54. package/dist/protocol/event-log-payload.js +1 -1
  55. package/dist/protocol/messages/access-log.d.ts +43 -20
  56. package/dist/protocol/messages/access-log.js +16 -2
  57. package/dist/protocol/messages/actor.d.ts +21 -0
  58. package/dist/protocol/messages/actor.js +42 -8
  59. package/dist/protocol/messages/agent-dev-ops.d.ts +118 -0
  60. package/dist/protocol/messages/agent-dev-ops.js +89 -0
  61. package/dist/protocol/messages/agent-run-result.d.ts +425 -0
  62. package/dist/protocol/messages/agent-run-result.js +165 -0
  63. package/dist/protocol/messages/auth.d.ts +3 -0
  64. package/dist/protocol/messages/auth.js +11 -2
  65. package/dist/protocol/messages/browser.js +1 -1
  66. package/dist/protocol/messages/capabilities.d.ts +3 -0
  67. package/dist/protocol/messages/capabilities.js +16 -3
  68. package/dist/protocol/messages/common.js +1 -1
  69. package/dist/protocol/messages/dashboard-global-workflows.d.ts +14 -0
  70. package/dist/protocol/messages/dashboard-global-workflows.js +1 -1
  71. package/dist/protocol/messages/dashboard.d.ts +1998 -48
  72. package/dist/protocol/messages/dashboard.js +269 -15
  73. package/dist/protocol/messages/deployment-identity.js +1 -1
  74. package/dist/protocol/messages/event-log.js +1 -1
  75. package/dist/protocol/messages/execution-status.d.ts +67 -4
  76. package/dist/protocol/messages/execution-status.js +133 -57
  77. package/dist/protocol/messages/join.js +1 -1
  78. package/dist/protocol/messages/log-pull.js +1 -1
  79. package/dist/protocol/messages/oidc-mint.d.ts +51 -0
  80. package/dist/protocol/messages/oidc-mint.js +55 -0
  81. package/dist/protocol/messages/oidc-token-relay.d.ts +31 -4
  82. package/dist/protocol/messages/oidc-token-relay.js +22 -7
  83. package/dist/protocol/messages/orchestrator-agent.d.ts +66 -5
  84. package/dist/protocol/messages/orchestrator-agent.js +35 -3
  85. package/dist/protocol/messages/pat-kind.d.ts +16 -0
  86. package/dist/protocol/messages/pat-kind.js +17 -0
  87. package/dist/protocol/messages/peer.d.ts +7 -7
  88. package/dist/protocol/messages/peer.js +1 -1
  89. package/dist/protocol/messages/platform-orchestrator.d.ts +685 -17
  90. package/dist/protocol/messages/platform-orchestrator.js +8 -5
  91. package/dist/protocol/messages/run-events.d.ts +8 -1
  92. package/dist/protocol/messages/run-events.js +1 -1
  93. package/dist/protocol/messages/scaler-event.js +1 -1
  94. package/dist/protocol/messages/source-registration.js +1 -1
  95. package/dist/protocol/source-origin.d.ts +20 -0
  96. package/dist/protocol/source-origin.js +21 -0
  97. package/dist/protocol/version.js +1 -1
  98. package/dist/provenance/attestation-origin.d.ts +18 -0
  99. package/dist/provenance/attestation-origin.js +22 -0
  100. package/dist/provenance/bundle.js +1 -1
  101. package/dist/provenance/dsse.js +1 -1
  102. package/dist/provenance/schema.d.ts +48 -0
  103. package/dist/provenance/schema.js +21 -7
  104. package/dist/provenance/statement-hash.d.ts +9 -0
  105. package/dist/provenance/statement-hash.js +17 -0
  106. package/dist/provenance/verify.d.ts +7 -0
  107. package/dist/provenance/verify.js +49 -10
  108. package/dist/provider/changed-files-fetcher.js +1 -1
  109. package/dist/provider/check-run-conclusion.d.ts +1 -1
  110. package/dist/provider/check-run-conclusion.js +1 -1
  111. package/dist/provider/check-status-poster.js +1 -1
  112. package/dist/provider/clone-token-provider.js +1 -1
  113. package/dist/provider/contributor-resolver.js +1 -1
  114. package/dist/provider/index.js +1 -1
  115. package/dist/provider/lock-file-fetcher.js +1 -1
  116. package/dist/provider/lock-file-parse-error.js +1 -1
  117. package/dist/provider/repo-url-builder.js +1 -1
  118. package/dist/provider/types.js +1 -1
  119. package/dist/provider/webhook-normalizer.js +1 -1
  120. package/dist/registration/registerable-trigger-type.d.ts +1 -1
  121. package/dist/registration/registerable-trigger-type.js +1 -1
  122. package/dist/{chunk-BTugEXQM.js → rolldown-runtime-ClRpJifh.js} +0 -1
  123. package/dist/scaler/resource-types.js +1 -1
  124. package/dist/scaler/scaler-backend-type.js +1 -1
  125. package/dist/secrets/index.d.ts +1 -1
  126. package/dist/secrets/index.js +1 -1
  127. package/dist/secrets/types.d.ts +0 -24
  128. package/dist/secrets/types.js +1 -1
  129. package/dist/state-machine/index.js +1 -1
  130. package/dist/state-machine/machine.js +1 -1
  131. package/dist/state-machine/types.js +1 -1
  132. package/dist/trigger/decision-trace.js +1 -1
  133. package/dist/trigger/jsonpath-matcher.js +1 -1
  134. package/dist/trigger/matcher.js +1 -1
  135. package/dist/trigger/trigger-event-type.js +1 -1
  136. package/dist/trigger/types.d.ts +35 -7
  137. package/dist/trigger/types.js +8 -3
  138. package/dist/webhook/signature.js +1 -1
  139. package/dist/webhook/webhook-url-format.d.ts +7 -0
  140. package/dist/webhook/webhook-url-format.js +11 -2
  141. package/dist/ws/close-codes.d.ts +8 -2
  142. package/dist/ws/close-codes.js +10 -4
  143. package/dist/ws/rate-limiter.js +1 -1
  144. package/dist/ws/ws-like.js +1 -1
  145. package/package.json +9 -1
  146. package/sbom.spdx.json +5 -5
@@ -0,0 +1,425 @@
1
+ /**
2
+ * Agent-facing, provenance-tagged run-result schema.
3
+ *
4
+ * A machine-first read shape for a run: the typed job DAG, per-step exit codes,
5
+ * durations, statuses, and a coarse derived failure classification. Every field
6
+ * an agent could be tricked by — names, refs, error text, log lines, job outputs —
7
+ * is wrapped in an {@link untrusted} envelope so a consumer can keep
8
+ * user-controlled content out of an instruction channel. KiCI-generated values
9
+ * (ids, enum statuses, exit codes, durations, hashes, derived categories) stay
10
+ * plain (trusted).
11
+ *
12
+ * Read-only contract — produced by the orchestrator admin run API and consumed by
13
+ * agents / the developer MCP server. Reuses the existing execution status enums;
14
+ * never define a parallel status string.
15
+ */
16
+ import { z } from 'zod';
17
+ /**
18
+ * Wrap a value KiCI does not vouch for — content from the user's repo, the
19
+ * contributor, or a process's output. Trusted fields are left plain. The
20
+ * envelope self-tags so the value survives reshaping / fencing: a renderer that
21
+ * fences untrusted content just refuses to emit any `{ untrusted: true }` value
22
+ * into an instruction channel.
23
+ */
24
+ export declare const untrusted: <T extends z.ZodTypeAny>(v: T) => z.ZodObject<{
25
+ untrusted: z.ZodLiteral<true>;
26
+ value: T;
27
+ }, z.core.$strip>;
28
+ /** Construct an untrusted envelope around a runtime value. */
29
+ export declare function wrapUntrusted<T>(value: T): {
30
+ untrusted: true;
31
+ value: T;
32
+ };
33
+ /** Coarse, derived run-failure classification (trusted — KiCI computes it). */
34
+ export declare const AgentFailureCategory: z.ZodEnum<{
35
+ unknown: "unknown";
36
+ cancelled: "cancelled";
37
+ init_failure: "init_failure";
38
+ timed_out: "timed_out";
39
+ step_failed: "step_failed";
40
+ infra: "infra";
41
+ }>;
42
+ export type AgentFailureCategory = z.infer<typeof AgentFailureCategory>;
43
+ export declare const agentStepResultSchema: z.ZodObject<{
44
+ stepIndex: z.ZodNumber;
45
+ stepName: z.ZodObject<{
46
+ untrusted: z.ZodLiteral<true>;
47
+ value: z.ZodString;
48
+ }, z.core.$strip>;
49
+ status: z.ZodEnum<{
50
+ skipped: "skipped";
51
+ success: "success";
52
+ pending: "pending";
53
+ running: "running";
54
+ failed: "failed";
55
+ cancelled: "cancelled";
56
+ }>;
57
+ exitCode: z.ZodNullable<z.ZodNumber>;
58
+ durationMs: z.ZodNullable<z.ZodNumber>;
59
+ startedAt: z.ZodNullable<z.ZodString>;
60
+ completedAt: z.ZodNullable<z.ZodString>;
61
+ errorMessage: z.ZodNullable<z.ZodObject<{
62
+ untrusted: z.ZodLiteral<true>;
63
+ value: z.ZodString;
64
+ }, z.core.$strip>>;
65
+ stepType: z.ZodString;
66
+ checkOutcome: z.ZodNullable<z.ZodEnum<{
67
+ skipped: "skipped";
68
+ applied: "applied";
69
+ declined: "declined";
70
+ "dry-run": "dry-run";
71
+ no_check: "no_check";
72
+ }>>;
73
+ secretsAccessed: z.ZodArray<z.ZodString>;
74
+ }, z.core.$strip>;
75
+ export type AgentStepResult = z.infer<typeof agentStepResultSchema>;
76
+ export declare const agentJobResultSchema: z.ZodObject<{
77
+ jobId: z.ZodString;
78
+ jobName: z.ZodObject<{
79
+ untrusted: z.ZodLiteral<true>;
80
+ value: z.ZodString;
81
+ }, z.core.$strip>;
82
+ status: z.ZodEnum<{
83
+ skipped: "skipped";
84
+ success: "success";
85
+ pending: "pending";
86
+ running: "running";
87
+ failed: "failed";
88
+ cancelled: "cancelled";
89
+ cancelling: "cancelling";
90
+ queued: "queued";
91
+ recovering: "recovering";
92
+ timed_out_stale: "timed_out_stale";
93
+ drift_dropped: "drift_dropped";
94
+ }>;
95
+ startedAt: z.ZodNullable<z.ZodString>;
96
+ completedAt: z.ZodNullable<z.ZodString>;
97
+ durationMs: z.ZodNullable<z.ZodNumber>;
98
+ agentId: z.ZodNullable<z.ZodString>;
99
+ errorMessage: z.ZodNullable<z.ZodObject<{
100
+ untrusted: z.ZodLiteral<true>;
101
+ value: z.ZodString;
102
+ }, z.core.$strip>>;
103
+ initFailure: z.ZodNullable<z.ZodObject<{
104
+ scope: z.ZodEnum<{
105
+ job: "job";
106
+ run: "run";
107
+ }>;
108
+ category: z.ZodEnum<{
109
+ secret_resolution: "secret_resolution";
110
+ install_secrets: "install_secrets";
111
+ lock_resolution: "lock_resolution";
112
+ build_coordination: "build_coordination";
113
+ environment_rules: "environment_rules";
114
+ dynamic_eval: "dynamic_eval";
115
+ no_agent: "no_agent";
116
+ matrix_expansion: "matrix_expansion";
117
+ }>;
118
+ message: z.ZodObject<{
119
+ untrusted: z.ZodLiteral<true>;
120
+ value: z.ZodString;
121
+ }, z.core.$strip>;
122
+ }, z.core.$strip>>;
123
+ needs: z.ZodArray<z.ZodObject<{
124
+ ref: z.ZodObject<{
125
+ untrusted: z.ZodLiteral<true>;
126
+ value: z.ZodString;
127
+ }, z.core.$strip>;
128
+ runOn: z.ZodArray<z.ZodEnum<{
129
+ skipped: "skipped";
130
+ success: "success";
131
+ pending: "pending";
132
+ running: "running";
133
+ failed: "failed";
134
+ cancelled: "cancelled";
135
+ cancelling: "cancelling";
136
+ queued: "queued";
137
+ recovering: "recovering";
138
+ timed_out_stale: "timed_out_stale";
139
+ drift_dropped: "drift_dropped";
140
+ }>>;
141
+ }, z.core.$strip>>;
142
+ outputs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
143
+ untrusted: z.ZodLiteral<true>;
144
+ value: z.ZodString;
145
+ }, z.core.$strip>>>;
146
+ secretOutputKeys: z.ZodArray<z.ZodString>;
147
+ steps: z.ZodArray<z.ZodObject<{
148
+ stepIndex: z.ZodNumber;
149
+ stepName: z.ZodObject<{
150
+ untrusted: z.ZodLiteral<true>;
151
+ value: z.ZodString;
152
+ }, z.core.$strip>;
153
+ status: z.ZodEnum<{
154
+ skipped: "skipped";
155
+ success: "success";
156
+ pending: "pending";
157
+ running: "running";
158
+ failed: "failed";
159
+ cancelled: "cancelled";
160
+ }>;
161
+ exitCode: z.ZodNullable<z.ZodNumber>;
162
+ durationMs: z.ZodNullable<z.ZodNumber>;
163
+ startedAt: z.ZodNullable<z.ZodString>;
164
+ completedAt: z.ZodNullable<z.ZodString>;
165
+ errorMessage: z.ZodNullable<z.ZodObject<{
166
+ untrusted: z.ZodLiteral<true>;
167
+ value: z.ZodString;
168
+ }, z.core.$strip>>;
169
+ stepType: z.ZodString;
170
+ checkOutcome: z.ZodNullable<z.ZodEnum<{
171
+ skipped: "skipped";
172
+ applied: "applied";
173
+ declined: "declined";
174
+ "dry-run": "dry-run";
175
+ no_check: "no_check";
176
+ }>>;
177
+ secretsAccessed: z.ZodArray<z.ZodString>;
178
+ }, z.core.$strip>>;
179
+ }, z.core.$strip>;
180
+ export type AgentJobResult = z.infer<typeof agentJobResultSchema>;
181
+ export declare const agentRunResultSchema: z.ZodObject<{
182
+ runId: z.ZodString;
183
+ workflowName: z.ZodObject<{
184
+ untrusted: z.ZodLiteral<true>;
185
+ value: z.ZodString;
186
+ }, z.core.$strip>;
187
+ status: z.ZodEnum<{
188
+ success: "success";
189
+ pending: "pending";
190
+ running: "running";
191
+ failed: "failed";
192
+ cancelled: "cancelled";
193
+ cancelling: "cancelling";
194
+ held: "held";
195
+ }>;
196
+ provider: z.ZodString;
197
+ repoIdentifier: z.ZodObject<{
198
+ untrusted: z.ZodLiteral<true>;
199
+ value: z.ZodString;
200
+ }, z.core.$strip>;
201
+ ref: z.ZodObject<{
202
+ untrusted: z.ZodLiteral<true>;
203
+ value: z.ZodString;
204
+ }, z.core.$strip>;
205
+ sha: z.ZodString;
206
+ baseSha: z.ZodNullable<z.ZodString>;
207
+ startedAt: z.ZodNullable<z.ZodString>;
208
+ completedAt: z.ZodNullable<z.ZodString>;
209
+ durationMs: z.ZodNullable<z.ZodNumber>;
210
+ trustTier: z.ZodNullable<z.ZodEnum<{
211
+ unknown: "unknown";
212
+ known: "known";
213
+ trusted: "trusted";
214
+ }>>;
215
+ contributorUsername: z.ZodNullable<z.ZodObject<{
216
+ untrusted: z.ZodLiteral<true>;
217
+ value: z.ZodString;
218
+ }, z.core.$strip>>;
219
+ failureCategory: z.ZodNullable<z.ZodEnum<{
220
+ unknown: "unknown";
221
+ cancelled: "cancelled";
222
+ init_failure: "init_failure";
223
+ timed_out: "timed_out";
224
+ step_failed: "step_failed";
225
+ infra: "infra";
226
+ }>>;
227
+ failureReason: z.ZodNullable<z.ZodObject<{
228
+ untrusted: z.ZodLiteral<true>;
229
+ value: z.ZodString;
230
+ }, z.core.$strip>>;
231
+ triggeredBy: z.ZodNullable<z.ZodString>;
232
+ triggeredByAgentLabel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
233
+ jobs: z.ZodArray<z.ZodObject<{
234
+ jobId: z.ZodString;
235
+ jobName: z.ZodObject<{
236
+ untrusted: z.ZodLiteral<true>;
237
+ value: z.ZodString;
238
+ }, z.core.$strip>;
239
+ status: z.ZodEnum<{
240
+ skipped: "skipped";
241
+ success: "success";
242
+ pending: "pending";
243
+ running: "running";
244
+ failed: "failed";
245
+ cancelled: "cancelled";
246
+ cancelling: "cancelling";
247
+ queued: "queued";
248
+ recovering: "recovering";
249
+ timed_out_stale: "timed_out_stale";
250
+ drift_dropped: "drift_dropped";
251
+ }>;
252
+ startedAt: z.ZodNullable<z.ZodString>;
253
+ completedAt: z.ZodNullable<z.ZodString>;
254
+ durationMs: z.ZodNullable<z.ZodNumber>;
255
+ agentId: z.ZodNullable<z.ZodString>;
256
+ errorMessage: z.ZodNullable<z.ZodObject<{
257
+ untrusted: z.ZodLiteral<true>;
258
+ value: z.ZodString;
259
+ }, z.core.$strip>>;
260
+ initFailure: z.ZodNullable<z.ZodObject<{
261
+ scope: z.ZodEnum<{
262
+ job: "job";
263
+ run: "run";
264
+ }>;
265
+ category: z.ZodEnum<{
266
+ secret_resolution: "secret_resolution";
267
+ install_secrets: "install_secrets";
268
+ lock_resolution: "lock_resolution";
269
+ build_coordination: "build_coordination";
270
+ environment_rules: "environment_rules";
271
+ dynamic_eval: "dynamic_eval";
272
+ no_agent: "no_agent";
273
+ matrix_expansion: "matrix_expansion";
274
+ }>;
275
+ message: z.ZodObject<{
276
+ untrusted: z.ZodLiteral<true>;
277
+ value: z.ZodString;
278
+ }, z.core.$strip>;
279
+ }, z.core.$strip>>;
280
+ needs: z.ZodArray<z.ZodObject<{
281
+ ref: z.ZodObject<{
282
+ untrusted: z.ZodLiteral<true>;
283
+ value: z.ZodString;
284
+ }, z.core.$strip>;
285
+ runOn: z.ZodArray<z.ZodEnum<{
286
+ skipped: "skipped";
287
+ success: "success";
288
+ pending: "pending";
289
+ running: "running";
290
+ failed: "failed";
291
+ cancelled: "cancelled";
292
+ cancelling: "cancelling";
293
+ queued: "queued";
294
+ recovering: "recovering";
295
+ timed_out_stale: "timed_out_stale";
296
+ drift_dropped: "drift_dropped";
297
+ }>>;
298
+ }, z.core.$strip>>;
299
+ outputs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
300
+ untrusted: z.ZodLiteral<true>;
301
+ value: z.ZodString;
302
+ }, z.core.$strip>>>;
303
+ secretOutputKeys: z.ZodArray<z.ZodString>;
304
+ steps: z.ZodArray<z.ZodObject<{
305
+ stepIndex: z.ZodNumber;
306
+ stepName: z.ZodObject<{
307
+ untrusted: z.ZodLiteral<true>;
308
+ value: z.ZodString;
309
+ }, z.core.$strip>;
310
+ status: z.ZodEnum<{
311
+ skipped: "skipped";
312
+ success: "success";
313
+ pending: "pending";
314
+ running: "running";
315
+ failed: "failed";
316
+ cancelled: "cancelled";
317
+ }>;
318
+ exitCode: z.ZodNullable<z.ZodNumber>;
319
+ durationMs: z.ZodNullable<z.ZodNumber>;
320
+ startedAt: z.ZodNullable<z.ZodString>;
321
+ completedAt: z.ZodNullable<z.ZodString>;
322
+ errorMessage: z.ZodNullable<z.ZodObject<{
323
+ untrusted: z.ZodLiteral<true>;
324
+ value: z.ZodString;
325
+ }, z.core.$strip>>;
326
+ stepType: z.ZodString;
327
+ checkOutcome: z.ZodNullable<z.ZodEnum<{
328
+ skipped: "skipped";
329
+ applied: "applied";
330
+ declined: "declined";
331
+ "dry-run": "dry-run";
332
+ no_check: "no_check";
333
+ }>>;
334
+ secretsAccessed: z.ZodArray<z.ZodString>;
335
+ }, z.core.$strip>>;
336
+ }, z.core.$strip>>;
337
+ }, z.core.$strip>;
338
+ export type AgentRunResult = z.infer<typeof agentRunResultSchema>;
339
+ export declare const agentStepLogsSchema: z.ZodObject<{
340
+ runId: z.ZodString;
341
+ jobId: z.ZodString;
342
+ stepIndex: z.ZodNumber;
343
+ totalLines: z.ZodNumber;
344
+ lines: z.ZodArray<z.ZodObject<{
345
+ untrusted: z.ZodLiteral<true>;
346
+ value: z.ZodString;
347
+ }, z.core.$strip>>;
348
+ nextCursor: z.ZodNullable<z.ZodString>;
349
+ }, z.core.$strip>;
350
+ export type AgentStepLogs = z.infer<typeof agentStepLogsSchema>;
351
+ /**
352
+ * Compact run-list row for the agent surface. KiCI ids/status/hashes are trusted
353
+ * (plain); the workflow name, repo identifier, and ref are user-controlled and
354
+ * wrapped untrusted so the fencing renderer keeps them out of the instruction
355
+ * channel.
356
+ */
357
+ export declare const agentRunListItemSchema: z.ZodObject<{
358
+ runId: z.ZodString;
359
+ status: z.ZodEnum<{
360
+ success: "success";
361
+ pending: "pending";
362
+ running: "running";
363
+ failed: "failed";
364
+ cancelled: "cancelled";
365
+ cancelling: "cancelling";
366
+ held: "held";
367
+ }>;
368
+ sha: z.ZodNullable<z.ZodString>;
369
+ createdAt: z.ZodNullable<z.ZodString>;
370
+ workflowName: z.ZodObject<{
371
+ untrusted: z.ZodLiteral<true>;
372
+ value: z.ZodString;
373
+ }, z.core.$strip>;
374
+ repoIdentifier: z.ZodNullable<z.ZodObject<{
375
+ untrusted: z.ZodLiteral<true>;
376
+ value: z.ZodString;
377
+ }, z.core.$strip>>;
378
+ ref: z.ZodNullable<z.ZodObject<{
379
+ untrusted: z.ZodLiteral<true>;
380
+ value: z.ZodString;
381
+ }, z.core.$strip>>;
382
+ }, z.core.$strip>;
383
+ export type AgentRunListItem = z.infer<typeof agentRunListItemSchema>;
384
+ /**
385
+ * Agent-facing workflow registration summary. Ids, flags, the commit sha, the
386
+ * KiCI trigger-type tags, and timestamps are trusted (plain); the workflow name,
387
+ * repo identifier, source repos, source file path, and friendly source name are
388
+ * user-controlled and wrapped untrusted.
389
+ */
390
+ export declare const agentWorkflowSummarySchema: z.ZodObject<{
391
+ id: z.ZodString;
392
+ workflowName: z.ZodObject<{
393
+ untrusted: z.ZodLiteral<true>;
394
+ value: z.ZodString;
395
+ }, z.core.$strip>;
396
+ repoIdentifier: z.ZodObject<{
397
+ untrusted: z.ZodLiteral<true>;
398
+ value: z.ZodString;
399
+ }, z.core.$strip>;
400
+ triggerTypes: z.ZodArray<z.ZodString>;
401
+ sourceRepos: z.ZodArray<z.ZodObject<{
402
+ untrusted: z.ZodLiteral<true>;
403
+ value: z.ZodString;
404
+ }, z.core.$strip>>;
405
+ disabled: z.ZodBoolean;
406
+ commitSha: z.ZodNullable<z.ZodString>;
407
+ sourceFile: z.ZodNullable<z.ZodObject<{
408
+ untrusted: z.ZodLiteral<true>;
409
+ value: z.ZodString;
410
+ }, z.core.$strip>>;
411
+ createdAt: z.ZodString;
412
+ updatedAt: z.ZodString;
413
+ lastTriggeredAt: z.ZodNullable<z.ZodString>;
414
+ nextFireAt: z.ZodNullable<z.ZodString>;
415
+ source: z.ZodNullable<z.ZodObject<{
416
+ routingKey: z.ZodString;
417
+ name: z.ZodNullable<z.ZodObject<{
418
+ untrusted: z.ZodLiteral<true>;
419
+ value: z.ZodString;
420
+ }, z.core.$strip>>;
421
+ provider: z.ZodString;
422
+ }, z.core.$strip>>;
423
+ }, z.core.$strip>;
424
+ export type AgentWorkflowSummary = z.infer<typeof agentWorkflowSummarySchema>;
425
+ //# sourceMappingURL=agent-run-result.d.ts.map
@@ -0,0 +1,165 @@
1
+ import "../../rolldown-runtime-ClRpJifh.js";
2
+ import { CheckStepOutcome } from "../../check-mode.js";
3
+ import { ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, InitFailureCategory } from "./execution-status.js";
4
+ import { TrustTierSchema } from "../../environment/types.js";
5
+ import { z } from "zod";
6
+ //#region src/protocol/messages/agent-run-result.ts
7
+ /**
8
+ * Agent-facing, provenance-tagged run-result schema.
9
+ *
10
+ * A machine-first read shape for a run: the typed job DAG, per-step exit codes,
11
+ * durations, statuses, and a coarse derived failure classification. Every field
12
+ * an agent could be tricked by — names, refs, error text, log lines, job outputs —
13
+ * is wrapped in an {@link untrusted} envelope so a consumer can keep
14
+ * user-controlled content out of an instruction channel. KiCI-generated values
15
+ * (ids, enum statuses, exit codes, durations, hashes, derived categories) stay
16
+ * plain (trusted).
17
+ *
18
+ * Read-only contract — produced by the orchestrator admin run API and consumed by
19
+ * agents / the developer MCP server. Reuses the existing execution status enums;
20
+ * never define a parallel status string.
21
+ */
22
+ /**
23
+ * Wrap a value KiCI does not vouch for — content from the user's repo, the
24
+ * contributor, or a process's output. Trusted fields are left plain. The
25
+ * envelope self-tags so the value survives reshaping / fencing: a renderer that
26
+ * fences untrusted content just refuses to emit any `{ untrusted: true }` value
27
+ * into an instruction channel.
28
+ */
29
+ const untrusted = (v) => z.object({
30
+ untrusted: z.literal(true),
31
+ value: v
32
+ });
33
+ /** Construct an untrusted envelope around a runtime value. */
34
+ function wrapUntrusted(value) {
35
+ return {
36
+ untrusted: true,
37
+ value
38
+ };
39
+ }
40
+ const untrustedString = untrusted(z.string());
41
+ const untrustedStringNullable = untrusted(z.string()).nullable();
42
+ /** Coarse, derived run-failure classification (trusted — KiCI computes it). */
43
+ const AgentFailureCategory = z.enum([
44
+ "init_failure",
45
+ "timed_out",
46
+ "step_failed",
47
+ "cancelled",
48
+ "infra",
49
+ "unknown"
50
+ ]);
51
+ const agentStepResultSchema = z.object({
52
+ stepIndex: z.number().int(),
53
+ stepName: untrustedString,
54
+ status: ExecutionStepStatus,
55
+ exitCode: z.number().int().nullable(),
56
+ durationMs: z.number().nullable(),
57
+ startedAt: z.string().nullable(),
58
+ completedAt: z.string().nullable(),
59
+ errorMessage: untrustedStringNullable,
60
+ /** Existing `step_type` discriminator (e.g. `step`, `hook:cleanup`, `cache:save`). */
61
+ stepType: z.string(),
62
+ checkOutcome: CheckStepOutcome.nullable(),
63
+ /** Secret context key names accessed by this step — names only, never values. */
64
+ secretsAccessed: z.array(z.string())
65
+ });
66
+ const agentJobResultSchema = z.object({
67
+ jobId: z.string(),
68
+ jobName: untrustedString,
69
+ status: ExecutionJobStatus,
70
+ startedAt: z.string().nullable(),
71
+ completedAt: z.string().nullable(),
72
+ durationMs: z.number().nullable(),
73
+ agentId: z.string().nullable(),
74
+ errorMessage: untrustedStringNullable,
75
+ initFailure: z.object({
76
+ scope: z.enum(["run", "job"]),
77
+ category: InitFailureCategory,
78
+ message: untrustedString
79
+ }).nullable(),
80
+ needs: z.array(z.object({
81
+ ref: untrustedString,
82
+ runOn: z.array(ExecutionJobStatus)
83
+ })),
84
+ /** Non-secret job outputs only (secret outputs are surfaced as key names). */
85
+ outputs: z.record(z.string(), untrustedString).nullable(),
86
+ /** Secret output key names produced by this job — names only, never values. */
87
+ secretOutputKeys: z.array(z.string()),
88
+ steps: z.array(agentStepResultSchema)
89
+ });
90
+ const agentRunResultSchema = z.object({
91
+ runId: z.string(),
92
+ workflowName: untrustedString,
93
+ status: ExecutionRunStatus,
94
+ provider: z.string(),
95
+ repoIdentifier: untrustedString,
96
+ ref: untrustedString,
97
+ sha: z.string(),
98
+ /** Best-effort base commit (provider context); null when unavailable. */
99
+ baseSha: z.string().nullable(),
100
+ startedAt: z.string().nullable(),
101
+ completedAt: z.string().nullable(),
102
+ durationMs: z.number().nullable(),
103
+ trustTier: TrustTierSchema.nullable(),
104
+ contributorUsername: untrustedStringNullable,
105
+ failureCategory: AgentFailureCategory.nullable(),
106
+ failureReason: untrustedStringNullable,
107
+ /** Identity that triggered a re-run (null for webhook-triggered runs). */
108
+ triggeredBy: z.string().nullable(),
109
+ /** Agent provenance label when the run was triggered through an agent credential. */
110
+ triggeredByAgentLabel: z.string().nullable().optional(),
111
+ jobs: z.array(agentJobResultSchema)
112
+ });
113
+ const agentStepLogsSchema = z.object({
114
+ runId: z.string(),
115
+ jobId: z.string(),
116
+ stepIndex: z.number().int(),
117
+ totalLines: z.number().int(),
118
+ /** Every log line is user/process-controlled — each is enveloped untrusted. */
119
+ lines: z.array(untrustedString),
120
+ nextCursor: z.string().nullable()
121
+ });
122
+ /**
123
+ * Compact run-list row for the agent surface. KiCI ids/status/hashes are trusted
124
+ * (plain); the workflow name, repo identifier, and ref are user-controlled and
125
+ * wrapped untrusted so the fencing renderer keeps them out of the instruction
126
+ * channel.
127
+ */
128
+ const agentRunListItemSchema = z.object({
129
+ runId: z.string(),
130
+ status: ExecutionRunStatus,
131
+ sha: z.string().nullable(),
132
+ createdAt: z.string().nullable(),
133
+ workflowName: untrustedString,
134
+ repoIdentifier: untrustedStringNullable,
135
+ ref: untrustedStringNullable
136
+ });
137
+ /**
138
+ * Agent-facing workflow registration summary. Ids, flags, the commit sha, the
139
+ * KiCI trigger-type tags, and timestamps are trusted (plain); the workflow name,
140
+ * repo identifier, source repos, source file path, and friendly source name are
141
+ * user-controlled and wrapped untrusted.
142
+ */
143
+ const agentWorkflowSummarySchema = z.object({
144
+ id: z.string(),
145
+ workflowName: untrustedString,
146
+ repoIdentifier: untrustedString,
147
+ triggerTypes: z.array(z.string()),
148
+ sourceRepos: z.array(untrustedString),
149
+ disabled: z.boolean(),
150
+ commitSha: z.string().nullable(),
151
+ sourceFile: untrustedStringNullable,
152
+ createdAt: z.string(),
153
+ updatedAt: z.string(),
154
+ lastTriggeredAt: z.string().nullable(),
155
+ nextFireAt: z.string().nullable(),
156
+ source: z.object({
157
+ routingKey: z.string(),
158
+ name: untrustedStringNullable,
159
+ provider: z.string()
160
+ }).nullable()
161
+ });
162
+ //#endregion
163
+ export { AgentFailureCategory, agentJobResultSchema, agentRunListItemSchema, agentRunResultSchema, agentStepLogsSchema, agentStepResultSchema, agentWorkflowSummarySchema, untrusted, wrapUntrusted };
164
+
165
+ //# sourceMappingURL=agent-run-result.js.map
@@ -28,6 +28,7 @@ export declare const authRequestSchema: z.ZodObject<{
28
28
  "held_runs.reject": "held_runs.reject";
29
29
  "event_dlq.retry": "event_dlq.retry";
30
30
  "event_dlq.discard": "event_dlq.discard";
31
+ "attestations.retry": "attestations.retry";
31
32
  "registration.disable": "registration.disable";
32
33
  "registration.delete": "registration.delete";
33
34
  "global_workflows.update": "global_workflows.update";
@@ -37,6 +38,7 @@ export declare const authRequestSchema: z.ZodObject<{
37
38
  "fleet.host.declare": "fleet.host.declare";
38
39
  "fleet.host.remove": "fleet.host.remove";
39
40
  }> & z.core.$partial, z.ZodBoolean>>;
41
+ supportedDashboardRequests: z.ZodOptional<z.ZodArray<z.ZodString>>;
40
42
  }, z.core.$loose>>;
41
43
  }, z.core.$strip>;
42
44
  /** Auth success response sent by Platform to orchestrator after successful authentication. */
@@ -45,6 +47,7 @@ export declare const authSuccessSchema: z.ZodObject<{
45
47
  connectionId: z.ZodString;
46
48
  orgPublicAlias: z.ZodOptional<z.ZodString>;
47
49
  orgId: z.ZodOptional<z.ZodString>;
50
+ provenanceIssuer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
48
51
  }, z.core.$strip>;
49
52
  /** Auth failure response sent by Platform to orchestrator when authentication fails. */
50
53
  export declare const authFailureSchema: z.ZodObject<{
@@ -1,4 +1,4 @@
1
- import "../../chunk-BTugEXQM.js";
1
+ import "../../rolldown-runtime-ClRpJifh.js";
2
2
  import { orchCapabilitiesSchema } from "./capabilities.js";
3
3
  import { z } from "zod";
4
4
  //#region src/protocol/messages/auth.ts
@@ -32,7 +32,16 @@ const authSuccessSchema = z.object({
32
32
  * that don't yet supply it; when absent, the orchestrator skips
33
33
  * remote-source provisioning.
34
34
  */
35
- orgId: z.string().optional()
35
+ orgId: z.string().optional(),
36
+ /**
37
+ * Provenance trust root (the OIDC issuer) the Platform mints build-provenance
38
+ * tokens under. The orchestrator uses it to verify provenance bundles at
39
+ * ingest: it derives the JWKS URI (`<issuer>/.well-known/jwks.json`) and
40
+ * caches the key set. `null` (or absent) means provenance is not configured —
41
+ * the orchestrator records each attestation's verdict as `unverifiable`
42
+ * rather than silently `verified`.
43
+ */
44
+ provenanceIssuer: z.string().nullable().optional()
36
45
  });
37
46
  /** Auth failure response sent by Platform to orchestrator when authentication fails. */
38
47
  const authFailureSchema = z.object({
@@ -1,4 +1,4 @@
1
- import "../../chunk-BTugEXQM.js";
1
+ import "../../rolldown-runtime-ClRpJifh.js";
2
2
  import { browserJobContextSchema, browserRunEventSchema } from "./run-events.js";
3
3
  import { browserEventLogPayloadChunkSchema } from "./dashboard.js";
4
4
  import { z } from "zod";
@@ -47,6 +47,7 @@ export declare const orchCapabilitiesSchema: z.ZodObject<{
47
47
  "held_runs.reject": "held_runs.reject";
48
48
  "event_dlq.retry": "event_dlq.retry";
49
49
  "event_dlq.discard": "event_dlq.discard";
50
+ "attestations.retry": "attestations.retry";
50
51
  "registration.disable": "registration.disable";
51
52
  "registration.delete": "registration.delete";
52
53
  "global_workflows.update": "global_workflows.update";
@@ -56,12 +57,14 @@ export declare const orchCapabilitiesSchema: z.ZodObject<{
56
57
  "fleet.host.declare": "fleet.host.declare";
57
58
  "fleet.host.remove": "fleet.host.remove";
58
59
  }> & z.core.$partial, z.ZodBoolean>>;
60
+ supportedDashboardRequests: z.ZodOptional<z.ZodArray<z.ZodString>>;
59
61
  }, z.core.$loose>;
60
62
  /** Inferred type for orchestrator capabilities. */
61
63
  export type OrchCapabilities = z.infer<typeof orchCapabilitiesSchema>;
62
64
  /** Default orchestrator capabilities sent in auth.request. */
63
65
  export declare const ORCH_CAPABILITIES: Readonly<{
64
66
  orchRole: "coordinator";
67
+ supportedDashboardRequests: string[];
65
68
  }>;
66
69
  /**
67
70
  * Check whether an orchestrator advertises a specific capability flag.