@kici-dev/engine 0.1.23 → 0.1.24

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 (49) hide show
  1. package/dist/approval/types.d.ts +1 -1
  2. package/dist/audit/access-log-policy.d.ts +4 -1
  3. package/dist/audit/access-log-policy.js +9 -1
  4. package/dist/audit/activity.d.ts +2 -2
  5. package/dist/audit/retention-policy.js +2 -0
  6. package/dist/environment/index.d.ts +2 -0
  7. package/dist/environment/index.js +3 -1
  8. package/dist/environment/multi-env.d.ts +30 -0
  9. package/dist/environment/multi-env.js +38 -0
  10. package/dist/environment/types.d.ts +8 -2
  11. package/dist/environment/types.js +18 -1
  12. package/dist/index.d.ts +3 -0
  13. package/dist/index.js +14 -8
  14. package/dist/inputs/index.d.ts +1 -0
  15. package/dist/inputs/index.js +2 -1
  16. package/dist/inputs/schedule.d.ts +19 -0
  17. package/dist/inputs/schedule.js +33 -0
  18. package/dist/mcp/tool-schemas.d.ts +41 -0
  19. package/dist/mcp/tool-schemas.js +49 -0
  20. package/dist/metrics/metric-catalog.generated.d.ts +20 -0
  21. package/dist/metrics/metric-catalog.generated.js +24 -0
  22. package/dist/protocol/messages/access-log.d.ts +29 -15
  23. package/dist/protocol/messages/access-log.js +3 -1
  24. package/dist/protocol/messages/actor.d.ts +8 -0
  25. package/dist/protocol/messages/actor.js +17 -3
  26. package/dist/protocol/messages/agent-run-result.d.ts +350 -0
  27. package/dist/protocol/messages/agent-run-result.js +123 -0
  28. package/dist/protocol/messages/auth.d.ts +2 -0
  29. package/dist/protocol/messages/auth.js +10 -1
  30. package/dist/protocol/messages/capabilities.d.ts +2 -0
  31. package/dist/protocol/messages/capabilities.js +15 -2
  32. package/dist/protocol/messages/dashboard-global-workflows.d.ts +8 -0
  33. package/dist/protocol/messages/dashboard.d.ts +1376 -42
  34. package/dist/protocol/messages/dashboard.js +161 -6
  35. package/dist/protocol/messages/execution-status.d.ts +52 -1
  36. package/dist/protocol/messages/execution-status.js +115 -54
  37. package/dist/protocol/messages/orchestrator-agent.d.ts +21 -5
  38. package/dist/protocol/messages/orchestrator-agent.js +5 -1
  39. package/dist/protocol/messages/pat-kind.d.ts +16 -0
  40. package/dist/protocol/messages/pat-kind.js +17 -0
  41. package/dist/protocol/messages/peer.d.ts +7 -7
  42. package/dist/protocol/messages/platform-orchestrator.d.ts +393 -7
  43. package/dist/protocol/messages/platform-orchestrator.js +3 -3
  44. package/dist/protocol/messages/run-events.d.ts +5 -1
  45. package/dist/provider/check-run-conclusion.d.ts +1 -1
  46. package/dist/trigger/types.d.ts +35 -7
  47. package/dist/trigger/types.js +7 -2
  48. package/package.json +1 -1
  49. package/sbom.spdx.json +5 -5
@@ -0,0 +1,350 @@
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
+ run: "run";
106
+ job: "job";
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
+ jobs: z.ZodArray<z.ZodObject<{
233
+ jobId: z.ZodString;
234
+ jobName: z.ZodObject<{
235
+ untrusted: z.ZodLiteral<true>;
236
+ value: z.ZodString;
237
+ }, z.core.$strip>;
238
+ status: z.ZodEnum<{
239
+ skipped: "skipped";
240
+ success: "success";
241
+ pending: "pending";
242
+ running: "running";
243
+ failed: "failed";
244
+ cancelled: "cancelled";
245
+ cancelling: "cancelling";
246
+ queued: "queued";
247
+ recovering: "recovering";
248
+ timed_out_stale: "timed_out_stale";
249
+ drift_dropped: "drift_dropped";
250
+ }>;
251
+ startedAt: z.ZodNullable<z.ZodString>;
252
+ completedAt: z.ZodNullable<z.ZodString>;
253
+ durationMs: z.ZodNullable<z.ZodNumber>;
254
+ agentId: z.ZodNullable<z.ZodString>;
255
+ errorMessage: z.ZodNullable<z.ZodObject<{
256
+ untrusted: z.ZodLiteral<true>;
257
+ value: z.ZodString;
258
+ }, z.core.$strip>>;
259
+ initFailure: z.ZodNullable<z.ZodObject<{
260
+ scope: z.ZodEnum<{
261
+ run: "run";
262
+ job: "job";
263
+ }>;
264
+ category: z.ZodEnum<{
265
+ secret_resolution: "secret_resolution";
266
+ install_secrets: "install_secrets";
267
+ lock_resolution: "lock_resolution";
268
+ build_coordination: "build_coordination";
269
+ environment_rules: "environment_rules";
270
+ dynamic_eval: "dynamic_eval";
271
+ no_agent: "no_agent";
272
+ matrix_expansion: "matrix_expansion";
273
+ }>;
274
+ message: z.ZodObject<{
275
+ untrusted: z.ZodLiteral<true>;
276
+ value: z.ZodString;
277
+ }, z.core.$strip>;
278
+ }, z.core.$strip>>;
279
+ needs: z.ZodArray<z.ZodObject<{
280
+ ref: z.ZodObject<{
281
+ untrusted: z.ZodLiteral<true>;
282
+ value: z.ZodString;
283
+ }, z.core.$strip>;
284
+ runOn: z.ZodArray<z.ZodEnum<{
285
+ skipped: "skipped";
286
+ success: "success";
287
+ pending: "pending";
288
+ running: "running";
289
+ failed: "failed";
290
+ cancelled: "cancelled";
291
+ cancelling: "cancelling";
292
+ queued: "queued";
293
+ recovering: "recovering";
294
+ timed_out_stale: "timed_out_stale";
295
+ drift_dropped: "drift_dropped";
296
+ }>>;
297
+ }, z.core.$strip>>;
298
+ outputs: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
299
+ untrusted: z.ZodLiteral<true>;
300
+ value: z.ZodString;
301
+ }, z.core.$strip>>>;
302
+ secretOutputKeys: z.ZodArray<z.ZodString>;
303
+ steps: z.ZodArray<z.ZodObject<{
304
+ stepIndex: z.ZodNumber;
305
+ stepName: z.ZodObject<{
306
+ untrusted: z.ZodLiteral<true>;
307
+ value: z.ZodString;
308
+ }, z.core.$strip>;
309
+ status: z.ZodEnum<{
310
+ skipped: "skipped";
311
+ success: "success";
312
+ pending: "pending";
313
+ running: "running";
314
+ failed: "failed";
315
+ cancelled: "cancelled";
316
+ }>;
317
+ exitCode: z.ZodNullable<z.ZodNumber>;
318
+ durationMs: z.ZodNullable<z.ZodNumber>;
319
+ startedAt: z.ZodNullable<z.ZodString>;
320
+ completedAt: z.ZodNullable<z.ZodString>;
321
+ errorMessage: z.ZodNullable<z.ZodObject<{
322
+ untrusted: z.ZodLiteral<true>;
323
+ value: z.ZodString;
324
+ }, z.core.$strip>>;
325
+ stepType: z.ZodString;
326
+ checkOutcome: z.ZodNullable<z.ZodEnum<{
327
+ skipped: "skipped";
328
+ applied: "applied";
329
+ declined: "declined";
330
+ "dry-run": "dry-run";
331
+ no_check: "no_check";
332
+ }>>;
333
+ secretsAccessed: z.ZodArray<z.ZodString>;
334
+ }, z.core.$strip>>;
335
+ }, z.core.$strip>>;
336
+ }, z.core.$strip>;
337
+ export type AgentRunResult = z.infer<typeof agentRunResultSchema>;
338
+ export declare const agentStepLogsSchema: z.ZodObject<{
339
+ runId: z.ZodString;
340
+ jobId: z.ZodString;
341
+ stepIndex: z.ZodNumber;
342
+ totalLines: z.ZodNumber;
343
+ lines: z.ZodArray<z.ZodObject<{
344
+ untrusted: z.ZodLiteral<true>;
345
+ value: z.ZodString;
346
+ }, z.core.$strip>>;
347
+ nextCursor: z.ZodNullable<z.ZodString>;
348
+ }, z.core.$strip>;
349
+ export type AgentStepLogs = z.infer<typeof agentStepLogsSchema>;
350
+ //# sourceMappingURL=agent-run-result.d.ts.map
@@ -0,0 +1,123 @@
1
+ import "../../chunk-BTugEXQM.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
+ jobs: z.array(agentJobResultSchema)
110
+ });
111
+ const agentStepLogsSchema = z.object({
112
+ runId: z.string(),
113
+ jobId: z.string(),
114
+ stepIndex: z.number().int(),
115
+ totalLines: z.number().int(),
116
+ /** Every log line is user/process-controlled — each is enveloped untrusted. */
117
+ lines: z.array(untrustedString),
118
+ nextCursor: z.string().nullable()
119
+ });
120
+ //#endregion
121
+ export { AgentFailureCategory, agentJobResultSchema, agentRunResultSchema, agentStepLogsSchema, agentStepResultSchema, untrusted, wrapUntrusted };
122
+
123
+ //# sourceMappingURL=agent-run-result.js.map
@@ -37,6 +37,7 @@ export declare const authRequestSchema: z.ZodObject<{
37
37
  "fleet.host.declare": "fleet.host.declare";
38
38
  "fleet.host.remove": "fleet.host.remove";
39
39
  }> & z.core.$partial, z.ZodBoolean>>;
40
+ supportedDashboardRequests: z.ZodOptional<z.ZodArray<z.ZodString>>;
40
41
  }, z.core.$loose>>;
41
42
  }, z.core.$strip>;
42
43
  /** Auth success response sent by Platform to orchestrator after successful authentication. */
@@ -45,6 +46,7 @@ export declare const authSuccessSchema: z.ZodObject<{
45
46
  connectionId: z.ZodString;
46
47
  orgPublicAlias: z.ZodOptional<z.ZodString>;
47
48
  orgId: z.ZodOptional<z.ZodString>;
49
+ provenanceIssuer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
48
50
  }, z.core.$strip>;
49
51
  /** Auth failure response sent by Platform to orchestrator when authentication fails. */
50
52
  export declare const authFailureSchema: z.ZodObject<{
@@ -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({
@@ -56,12 +56,14 @@ export declare const orchCapabilitiesSchema: z.ZodObject<{
56
56
  "fleet.host.declare": "fleet.host.declare";
57
57
  "fleet.host.remove": "fleet.host.remove";
58
58
  }> & z.core.$partial, z.ZodBoolean>>;
59
+ supportedDashboardRequests: z.ZodOptional<z.ZodArray<z.ZodString>>;
59
60
  }, z.core.$loose>;
60
61
  /** Inferred type for orchestrator capabilities. */
61
62
  export type OrchCapabilities = z.infer<typeof orchCapabilitiesSchema>;
62
63
  /** Default orchestrator capabilities sent in auth.request. */
63
64
  export declare const ORCH_CAPABILITIES: Readonly<{
64
65
  orchRole: "coordinator";
66
+ supportedDashboardRequests: string[];
65
67
  }>;
66
68
  /**
67
69
  * Check whether an orchestrator advertises a specific capability flag.
@@ -1,5 +1,6 @@
1
1
  import "../../chunk-BTugEXQM.js";
2
2
  import { dashboardWritePolicyMap } from "../dashboard-write-operations.js";
3
+ import { DASHBOARD_REQUEST_TYPES } from "./dashboard.js";
3
4
  import { z } from "zod";
4
5
  //#region src/protocol/messages/capabilities.ts
5
6
  /**
@@ -33,10 +34,22 @@ const orchCapabilitiesSchema = z.object({
33
34
  * the standalone `orch.capabilities.update` message on policy
34
35
  * change (see platform-orchestrator.ts).
35
36
  */
36
- dashboardWrites: dashboardWritePolicyMap.optional()
37
+ dashboardWrites: dashboardWritePolicyMap.optional(),
38
+ /**
39
+ * Every `dashboard.*` request type this orchestrator build understands.
40
+ * The Platform pre-flight-checks an incoming dashboard request against this
41
+ * set and refuses (with a precise "upgrade orchestrator" error) when the
42
+ * type is absent. Derived from the orchestrator's own protocol schema, so it
43
+ * cannot drift. Absent on pre-capability builds → treated as "unknown",
44
+ * never as "supports nothing".
45
+ */
46
+ supportedDashboardRequests: z.array(z.string()).optional()
37
47
  }).passthrough();
38
48
  /** Default orchestrator capabilities sent in auth.request. */
39
- const ORCH_CAPABILITIES = Object.freeze({ orchRole: OrchRole.enum.coordinator });
49
+ const ORCH_CAPABILITIES = Object.freeze({
50
+ orchRole: OrchRole.enum.coordinator,
51
+ supportedDashboardRequests: [...DASHBOARD_REQUEST_TYPES]
52
+ });
40
53
  /**
41
54
  * Check whether an orchestrator advertises a specific capability flag.
42
55
  *
@@ -56,6 +56,10 @@ export declare const globalWorkflowsGetRequestSchema: z.ZodObject<{
56
56
  actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
57
57
  type: z.ZodLiteral<"user">;
58
58
  sub: z.ZodString;
59
+ agent: z.ZodOptional<z.ZodObject<{
60
+ patId: z.ZodString;
61
+ label: z.ZodString;
62
+ }, z.core.$strip>>;
59
63
  }, z.core.$strip>, z.ZodObject<{
60
64
  type: z.ZodLiteral<"api_key">;
61
65
  keyId: z.ZodString;
@@ -85,6 +89,10 @@ export declare const globalWorkflowsUpdateRequestSchema: z.ZodObject<{
85
89
  actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
86
90
  type: z.ZodLiteral<"user">;
87
91
  sub: z.ZodString;
92
+ agent: z.ZodOptional<z.ZodObject<{
93
+ patId: z.ZodString;
94
+ label: z.ZodString;
95
+ }, z.core.$strip>>;
88
96
  }, z.core.$strip>, z.ZodObject<{
89
97
  type: z.ZodLiteral<"api_key">;
90
98
  keyId: z.ZodString;