@kici-dev/engine 0.1.24 → 0.1.26
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.
- package/dist/approval/types.d.ts +1 -1
- package/dist/approval/types.js +1 -1
- package/dist/audit/access-log-policy.js +3 -2
- package/dist/audit/activity.d.ts +2 -0
- package/dist/audit/activity.js +15 -1
- package/dist/audit/retention-policy.js +3 -3
- package/dist/bundler/index.js +1 -1
- package/dist/bundler/rolldown-config.js +1 -1
- package/dist/check-mode.js +1 -1
- package/dist/dev-ops/operations.d.ts +56 -0
- package/dist/dev-ops/operations.js +135 -0
- package/dist/env/environment-allowlist.js +1 -1
- package/dist/environment/host-match.js +1 -1
- package/dist/environment/index.js +1 -1
- package/dist/environment/multi-env.js +1 -1
- package/dist/environment/scope-resolver.js +1 -1
- package/dist/environment/scope-template.js +1 -1
- package/dist/environment/types.js +1 -1
- package/dist/fanout/materialize.js +3 -3
- package/dist/index.d.ts +7 -1
- package/dist/index.js +16 -10
- package/dist/inputs/build.js +1 -1
- package/dist/inputs/coerce.js +1 -1
- package/dist/inputs/descriptor.js +1 -1
- package/dist/inputs/extract.js +1 -1
- package/dist/inputs/index.js +1 -1
- package/dist/inputs/schedule.js +1 -1
- package/dist/inventory.js +1 -1
- package/dist/labels/compile.js +1 -1
- package/dist/labels-match.js +1 -1
- package/dist/labels.js +2 -2
- package/dist/matrix/expand.js +1 -1
- package/dist/matrix/format.js +1 -1
- package/dist/mcp/fence.d.ts +22 -0
- package/dist/mcp/fence.js +65 -0
- package/dist/mcp/held-run-resolve.d.ts +52 -0
- package/dist/mcp/held-run-resolve.js +53 -0
- package/dist/mcp/tool-schemas.d.ts +38 -5
- package/dist/mcp/tool-schemas.js +38 -9
- package/dist/metrics/catalog-policy.js +1 -1
- package/dist/metrics/metric-catalog.generated.d.ts +85 -0
- package/dist/metrics/metric-catalog.generated.js +103 -1
- package/dist/protocol/analytics-events.js +1 -1
- package/dist/protocol/cluster-name.js +1 -1
- package/dist/protocol/dashboard-global-workflows.js +1 -1
- package/dist/protocol/dashboard-write-operations.d.ts +5 -1
- package/dist/protocol/dashboard-write-operations.js +13 -2
- package/dist/protocol/event-log-payload.js +1 -1
- package/dist/protocol/messages/access-log.d.ts +14 -5
- package/dist/protocol/messages/access-log.js +13 -1
- package/dist/protocol/messages/actor.d.ts +13 -0
- package/dist/protocol/messages/actor.js +25 -5
- package/dist/protocol/messages/agent-dev-ops.d.ts +118 -0
- package/dist/protocol/messages/agent-dev-ops.js +89 -0
- package/dist/protocol/messages/agent-run-result.d.ts +77 -2
- package/dist/protocol/messages/agent-run-result.js +44 -2
- package/dist/protocol/messages/auth.d.ts +1 -0
- package/dist/protocol/messages/auth.js +1 -1
- package/dist/protocol/messages/browser.js +1 -1
- package/dist/protocol/messages/capabilities.d.ts +1 -0
- package/dist/protocol/messages/capabilities.js +1 -1
- package/dist/protocol/messages/common.js +1 -1
- package/dist/protocol/messages/dashboard-global-workflows.d.ts +6 -0
- package/dist/protocol/messages/dashboard-global-workflows.js +1 -1
- package/dist/protocol/messages/dashboard.d.ts +634 -18
- package/dist/protocol/messages/dashboard.js +111 -12
- package/dist/protocol/messages/deployment-identity.js +1 -1
- package/dist/protocol/messages/event-log.js +1 -1
- package/dist/protocol/messages/execution-status.d.ts +15 -3
- package/dist/protocol/messages/execution-status.js +19 -4
- package/dist/protocol/messages/join.js +1 -1
- package/dist/protocol/messages/log-pull.js +1 -1
- package/dist/protocol/messages/oidc-mint.d.ts +51 -0
- package/dist/protocol/messages/oidc-mint.js +55 -0
- package/dist/protocol/messages/oidc-token-relay.d.ts +31 -4
- package/dist/protocol/messages/oidc-token-relay.js +22 -7
- package/dist/protocol/messages/orchestrator-agent.d.ts +45 -0
- package/dist/protocol/messages/orchestrator-agent.js +30 -2
- package/dist/protocol/messages/pat-kind.js +1 -1
- package/dist/protocol/messages/peer.js +1 -1
- package/dist/protocol/messages/platform-orchestrator.d.ts +292 -10
- package/dist/protocol/messages/platform-orchestrator.js +5 -2
- package/dist/protocol/messages/run-events.d.ts +3 -0
- package/dist/protocol/messages/run-events.js +1 -1
- package/dist/protocol/messages/scaler-event.js +1 -1
- package/dist/protocol/messages/source-registration.js +1 -1
- package/dist/protocol/source-origin.d.ts +20 -0
- package/dist/protocol/source-origin.js +21 -0
- package/dist/protocol/version.js +1 -1
- package/dist/provenance/attestation-origin.d.ts +18 -0
- package/dist/provenance/attestation-origin.js +22 -0
- package/dist/provenance/bundle.js +1 -1
- package/dist/provenance/dsse.js +1 -1
- package/dist/provenance/schema.d.ts +48 -0
- package/dist/provenance/schema.js +21 -7
- package/dist/provenance/statement-hash.d.ts +9 -0
- package/dist/provenance/statement-hash.js +17 -0
- package/dist/provenance/verify.d.ts +7 -0
- package/dist/provenance/verify.js +49 -10
- package/dist/provider/changed-files-fetcher.js +1 -1
- package/dist/provider/check-run-conclusion.js +1 -1
- package/dist/provider/check-status-poster.js +1 -1
- package/dist/provider/clone-token-provider.js +1 -1
- package/dist/provider/contributor-resolver.js +1 -1
- package/dist/provider/index.js +1 -1
- package/dist/provider/lock-file-fetcher.js +1 -1
- package/dist/provider/lock-file-parse-error.js +1 -1
- package/dist/provider/repo-url-builder.js +1 -1
- package/dist/provider/types.js +1 -1
- package/dist/provider/webhook-normalizer.js +1 -1
- package/dist/registration/registerable-trigger-type.d.ts +1 -1
- package/dist/registration/registerable-trigger-type.js +1 -1
- package/dist/{chunk-BTugEXQM.js → rolldown-runtime-ClRpJifh.js} +0 -1
- package/dist/scaler/resource-types.js +1 -1
- package/dist/scaler/scaler-backend-type.js +1 -1
- package/dist/secrets/index.d.ts +1 -1
- package/dist/secrets/index.js +1 -1
- package/dist/secrets/types.d.ts +0 -24
- package/dist/secrets/types.js +1 -1
- package/dist/state-machine/index.js +1 -1
- package/dist/state-machine/machine.js +1 -1
- package/dist/state-machine/types.js +1 -1
- package/dist/trigger/decision-trace.js +1 -1
- package/dist/trigger/jsonpath-matcher.js +1 -1
- package/dist/trigger/matcher.js +1 -1
- package/dist/trigger/trigger-event-type.js +1 -1
- package/dist/trigger/types.js +1 -1
- package/dist/webhook/signature.js +1 -1
- package/dist/webhook/webhook-url-format.d.ts +7 -0
- package/dist/webhook/webhook-url-format.js +11 -2
- package/dist/ws/close-codes.d.ts +8 -2
- package/dist/ws/close-codes.js +10 -4
- package/dist/ws/rate-limiter.js +1 -1
- package/dist/ws/ws-like.js +1 -1
- package/package.json +9 -1
- package/sbom.spdx.json +5 -5
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import "../../
|
|
1
|
+
import "../../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { CheckMode, CheckStepOutcome } from "../../check-mode.js";
|
|
3
|
+
import { SourceOrigin } from "../source-origin.js";
|
|
4
|
+
import { AttestationOrigin } from "../../provenance/attestation-origin.js";
|
|
3
5
|
import { actorPrincipalSchema } from "./actor.js";
|
|
4
6
|
import { StepConcurrencyKind, initFailureSchema } from "./execution-status.js";
|
|
5
7
|
import { agentRunResultSchema } from "./agent-run-result.js";
|
|
@@ -49,7 +51,17 @@ const dashboardStepLogsRequestSchema = z.object({
|
|
|
49
51
|
actor: actorPrincipalSchema,
|
|
50
52
|
runId: z.string(),
|
|
51
53
|
jobId: z.string(),
|
|
52
|
-
stepIndex: z.number()
|
|
54
|
+
stepIndex: z.number(),
|
|
55
|
+
/**
|
|
56
|
+
* Optional line-offset cursor (a prior response's `nextCursor`). Absent reads
|
|
57
|
+
* from the start.
|
|
58
|
+
*/
|
|
59
|
+
cursor: z.string().optional(),
|
|
60
|
+
/**
|
|
61
|
+
* Optional max lines to return. Absent = unbounded (the human dashboard relies
|
|
62
|
+
* on this); the MCP layer opts into paging by sending an explicit limit.
|
|
63
|
+
*/
|
|
64
|
+
limit: z.number().int().positive().optional()
|
|
53
65
|
});
|
|
54
66
|
/** Step detail within a job response. */
|
|
55
67
|
const dashboardStepDetailSchema = z.object({
|
|
@@ -100,6 +112,13 @@ const dashboardJobDetailSchema = z.object({
|
|
|
100
112
|
* entry marks an element resolved at runtime. null/absent = no binding.
|
|
101
113
|
*/
|
|
102
114
|
environments: z.array(z.string()).nullable().optional(),
|
|
115
|
+
/**
|
|
116
|
+
* Bound environments skipped on a test/local run (non-test or unconfigured).
|
|
117
|
+
* null/absent when nothing was skipped.
|
|
118
|
+
*/
|
|
119
|
+
skippedEnvironments: z.array(z.string()).nullable().optional(),
|
|
120
|
+
/** User-visible warning naming the skipped test-run environments. null/absent when none. */
|
|
121
|
+
envWarning: z.string().nullable().optional(),
|
|
103
122
|
/** Aggregated step outputs (step-keyed map). Present when job completed successfully with outputs. */
|
|
104
123
|
outputs: z.record(z.string(), z.record(z.string(), z.unknown())).nullable().optional(),
|
|
105
124
|
/** Secret output key names produced by this job (values are NOT included -- display masked). */
|
|
@@ -151,6 +170,8 @@ const dashboardStepLogsResponseSchema = z.object({
|
|
|
151
170
|
requestId: z.string(),
|
|
152
171
|
lines: z.array(z.string()),
|
|
153
172
|
totalLines: z.number(),
|
|
173
|
+
/** Next line-offset cursor, or null when the page reached the end. */
|
|
174
|
+
nextCursor: z.string().nullable().optional(),
|
|
154
175
|
error: z.string().optional()
|
|
155
176
|
});
|
|
156
177
|
/** Request the build-provenance attestations for a run. */
|
|
@@ -199,7 +220,19 @@ const attestationListItemSchema = z.object({
|
|
|
199
220
|
/** Stored server-side verdict — populated by the detail get (omitted per-run). */
|
|
200
221
|
verifyStatus: attestationVerifyStatusSchema.optional(),
|
|
201
222
|
/** First failure reason for the stored verdict, when failed (detail get only). */
|
|
202
|
-
verifyReason: z.string().nullable().optional()
|
|
223
|
+
verifyReason: z.string().nullable().optional(),
|
|
224
|
+
/**
|
|
225
|
+
* Source-origin brand: triggered vs kici run remote (local working-tree
|
|
226
|
+
* overlay). Read from the signed statement's internalParameters.
|
|
227
|
+
*/
|
|
228
|
+
sourceOrigin: SourceOrigin.optional(),
|
|
229
|
+
/** Authoritative origin: the customer's public org id (from the signed statement). */
|
|
230
|
+
originOrgId: z.string().optional(),
|
|
231
|
+
/**
|
|
232
|
+
* Mint-timing origin: live / deferred / offline-backfill. Read from the token
|
|
233
|
+
* claim or the signed statement's internalParameters; absent defaults to live.
|
|
234
|
+
*/
|
|
235
|
+
attestationOrigin: AttestationOrigin.optional()
|
|
203
236
|
});
|
|
204
237
|
/** Response with the run's attestations (correlates to dashboard.attestations.list). */
|
|
205
238
|
const dashboardAttestationsListResponseSchema = z.object({
|
|
@@ -226,7 +259,19 @@ const attestationListSummarySchema = z.object({
|
|
|
226
259
|
verifyStatus: attestationVerifyStatusSchema,
|
|
227
260
|
verifyReason: z.string().nullable(),
|
|
228
261
|
repository: z.string().nullable(),
|
|
229
|
-
workflow: z.string().nullable()
|
|
262
|
+
workflow: z.string().nullable(),
|
|
263
|
+
/**
|
|
264
|
+
* Source-origin brand: triggered vs kici run remote (local working-tree
|
|
265
|
+
* overlay). Derived from the run's local_working_tree flag.
|
|
266
|
+
*/
|
|
267
|
+
sourceOrigin: SourceOrigin.optional(),
|
|
268
|
+
/** Mint-timing origin: live / deferred / offline-backfill. */
|
|
269
|
+
attestationOrigin: AttestationOrigin.optional(),
|
|
270
|
+
/**
|
|
271
|
+
* True for a row still in the deferred-attestation outbox (not yet minted):
|
|
272
|
+
* `verifyStatus: 'pending'`, no bundle. The page offers a retry action.
|
|
273
|
+
*/
|
|
274
|
+
pending: z.boolean().optional()
|
|
230
275
|
});
|
|
231
276
|
/** Filters for the org-wide attestations list. */
|
|
232
277
|
const attestationListFiltersSchema = z.object({
|
|
@@ -272,6 +317,22 @@ const dashboardAttestationGetResponseSchema = z.object({
|
|
|
272
317
|
attestation: attestationListItemSchema.nullable(),
|
|
273
318
|
error: z.string().optional()
|
|
274
319
|
});
|
|
320
|
+
/** Request an on-demand drain of the deferred-attestation outbox (optionally one run). */
|
|
321
|
+
const dashboardAttestationRetryRequestSchema = z.object({
|
|
322
|
+
type: z.literal("dashboard.attestation.retry"),
|
|
323
|
+
requestId: z.string(),
|
|
324
|
+
actor: actorPrincipalSchema,
|
|
325
|
+
/** Scope to a single run; omitted drains every pending attestation. */
|
|
326
|
+
runId: z.string().optional()
|
|
327
|
+
});
|
|
328
|
+
/** Response with the drain counts. */
|
|
329
|
+
const dashboardAttestationRetryResponseSchema = z.object({
|
|
330
|
+
type: z.literal("dashboard.attestation.retry.response"),
|
|
331
|
+
requestId: z.string(),
|
|
332
|
+
minted: z.number().int(),
|
|
333
|
+
stillPending: z.number().int(),
|
|
334
|
+
error: z.string().optional()
|
|
335
|
+
});
|
|
275
336
|
/**
|
|
276
337
|
* Run-summary projection from the orchestrator's execution_runs table.
|
|
277
338
|
*
|
|
@@ -301,7 +362,9 @@ const dashboardRunSummarySchema = z.object({
|
|
|
301
362
|
parentRunId: z.string().optional(),
|
|
302
363
|
originalRunId: z.string().optional(),
|
|
303
364
|
triggeredBy: z.string().optional(),
|
|
365
|
+
triggeredByAgentLabel: z.string().nullable().optional(),
|
|
304
366
|
cancelledBy: z.string().optional(),
|
|
367
|
+
cancelledByAgentLabel: z.string().nullable().optional(),
|
|
305
368
|
failureReason: z.string().optional(),
|
|
306
369
|
hadCompileJob: z.boolean().optional(),
|
|
307
370
|
compileJobId: z.string().optional(),
|
|
@@ -411,7 +474,9 @@ const manualScheduleRequestSchema = z.object({
|
|
|
411
474
|
type: z.literal("run.manual_schedule.request"),
|
|
412
475
|
requestId: z.string(),
|
|
413
476
|
actor: actorPrincipalSchema,
|
|
414
|
-
registrationId: z.string()
|
|
477
|
+
registrationId: z.string(),
|
|
478
|
+
/** Agent provenance label when triggered through an agent credential. */
|
|
479
|
+
triggeredByAgentLabel: z.string().nullable().optional()
|
|
415
480
|
});
|
|
416
481
|
/** Response to a manual schedule trigger request. */
|
|
417
482
|
const manualScheduleResponseSchema = z.object({
|
|
@@ -1055,12 +1120,12 @@ const envSecretScopeDeleteResponseSchema = z.object({
|
|
|
1055
1120
|
requestId: z.string(),
|
|
1056
1121
|
error: z.string().optional()
|
|
1057
1122
|
});
|
|
1058
|
-
/** Fetch runs that targeted a specific environment. */
|
|
1123
|
+
/** Fetch runs that targeted a specific environment, keyed by environment id. */
|
|
1059
1124
|
const envHistoryRequestSchema = z.object({
|
|
1060
1125
|
type: z.literal("dashboard.environments.history"),
|
|
1061
1126
|
requestId: z.string(),
|
|
1062
1127
|
actor: actorPrincipalSchema,
|
|
1063
|
-
|
|
1128
|
+
environmentId: z.string(),
|
|
1064
1129
|
limit: z.number().optional(),
|
|
1065
1130
|
offset: z.number().optional()
|
|
1066
1131
|
});
|
|
@@ -1096,7 +1161,17 @@ const heldRunsListRequestSchema = z.object({
|
|
|
1096
1161
|
actor: actorPrincipalSchema,
|
|
1097
1162
|
status: HeldRunStatus.optional(),
|
|
1098
1163
|
queueType: HeldRunQueueType.optional(),
|
|
1099
|
-
runId: z.string().optional()
|
|
1164
|
+
runId: z.string().optional(),
|
|
1165
|
+
/**
|
|
1166
|
+
* Target org the read must be scoped to, carried per-request by the Platform
|
|
1167
|
+
* (the validated `:orgId` path param). The orchestrator honors this over its
|
|
1168
|
+
* static connection-level org so a Platform-first `kici run remote` org —
|
|
1169
|
+
* anchored only by `remote_sources` — sees its own held runs even when the
|
|
1170
|
+
* orchestrator's connection also serves a webhook source for a different org.
|
|
1171
|
+
* Absent on the legacy customer-dashboard path, where the connection org is
|
|
1172
|
+
* already the request org.
|
|
1173
|
+
*/
|
|
1174
|
+
orgId: z.string().optional()
|
|
1100
1175
|
});
|
|
1101
1176
|
const heldRunsListResponseSchema = z.object({
|
|
1102
1177
|
type: z.literal("dashboard.held-runs.list.response"),
|
|
@@ -1148,7 +1223,15 @@ const heldRunApproveRequestSchema = z.object({
|
|
|
1148
1223
|
* is still enforced (this only changes the audit action to
|
|
1149
1224
|
* `held_run.auto_approve`); it is never a bypass.
|
|
1150
1225
|
*/
|
|
1151
|
-
autoApprove: z.boolean().optional()
|
|
1226
|
+
autoApprove: z.boolean().optional(),
|
|
1227
|
+
/**
|
|
1228
|
+
* Target org the decision must be scoped to, carried per-request by the
|
|
1229
|
+
* Platform (the validated `:orgId` path param). Honored over the static
|
|
1230
|
+
* connection-level org so a remote run's hold — recorded under the run's own
|
|
1231
|
+
* `remote_sources` org — is resolvable even when the orchestrator's
|
|
1232
|
+
* connection also serves a webhook source for a different org.
|
|
1233
|
+
*/
|
|
1234
|
+
orgId: z.string().optional()
|
|
1152
1235
|
});
|
|
1153
1236
|
const heldRunApproveResponseSchema = z.object({
|
|
1154
1237
|
type: z.literal("dashboard.held-runs.approve.response"),
|
|
@@ -1161,7 +1244,15 @@ const heldRunRejectRequestSchema = z.object({
|
|
|
1161
1244
|
requestId: z.string(),
|
|
1162
1245
|
actor: actorPrincipalSchema,
|
|
1163
1246
|
heldRunId: z.string(),
|
|
1164
|
-
reason: z.string().optional()
|
|
1247
|
+
reason: z.string().optional(),
|
|
1248
|
+
/**
|
|
1249
|
+
* Target org the decision must be scoped to, carried per-request by the
|
|
1250
|
+
* Platform (the validated `:orgId` path param). Honored over the static
|
|
1251
|
+
* connection-level org so a remote run's hold — recorded under the run's own
|
|
1252
|
+
* `remote_sources` org — is resolvable even when the orchestrator's
|
|
1253
|
+
* connection also serves a webhook source for a different org.
|
|
1254
|
+
*/
|
|
1255
|
+
orgId: z.string().optional()
|
|
1165
1256
|
});
|
|
1166
1257
|
const heldRunRejectResponseSchema = z.object({
|
|
1167
1258
|
type: z.literal("dashboard.held-runs.reject.response"),
|
|
@@ -1705,6 +1796,8 @@ const testRelayTriggerResponseSchema = z.object({
|
|
|
1705
1796
|
status: z.enum(["accepted", "rejected"]).optional(),
|
|
1706
1797
|
reason: z.string().optional(),
|
|
1707
1798
|
jobIds: z.array(z.string()).optional(),
|
|
1799
|
+
/** User-visible warnings on acceptance (e.g. skipped non-test bound environments). */
|
|
1800
|
+
warnings: z.array(z.string()).optional(),
|
|
1708
1801
|
error: z.string().optional()
|
|
1709
1802
|
});
|
|
1710
1803
|
/** Request a snapshot of a run's status. */
|
|
@@ -1770,6 +1863,7 @@ const dashboardPlatformToOrchSchema = z.discriminatedUnion("type", [
|
|
|
1770
1863
|
dashboardAttestationsListRequestSchema,
|
|
1771
1864
|
dashboardAttestationsListAllRequestSchema,
|
|
1772
1865
|
dashboardAttestationGetRequestSchema,
|
|
1866
|
+
dashboardAttestationRetryRequestSchema,
|
|
1773
1867
|
dashboardRunsListRequestSchema,
|
|
1774
1868
|
dashboardRunsFiltersRequestSchema,
|
|
1775
1869
|
dashboardSourcesListRequestSchema,
|
|
@@ -1843,6 +1937,7 @@ const dashboardOrchToPlatformSchema = z.discriminatedUnion("type", [
|
|
|
1843
1937
|
dashboardAttestationsListResponseSchema,
|
|
1844
1938
|
dashboardAttestationsListAllResponseSchema,
|
|
1845
1939
|
dashboardAttestationGetResponseSchema,
|
|
1940
|
+
dashboardAttestationRetryResponseSchema,
|
|
1846
1941
|
dashboardRunsListResponseSchema,
|
|
1847
1942
|
dashboardRunsFiltersResponseSchema,
|
|
1848
1943
|
dashboardSourcesListResponseSchema,
|
|
@@ -1925,7 +2020,9 @@ const dashboardRunDetailApiResponseSchema = z.object({
|
|
|
1925
2020
|
/** REST API response for step logs. */
|
|
1926
2021
|
const dashboardStepLogsApiResponseSchema = z.object({
|
|
1927
2022
|
lines: z.array(z.string()),
|
|
1928
|
-
totalLines: z.number()
|
|
2023
|
+
totalLines: z.number(),
|
|
2024
|
+
/** Next line-offset cursor, or null when the page reached the end. */
|
|
2025
|
+
nextCursor: z.string().nullable().optional()
|
|
1929
2026
|
});
|
|
1930
2027
|
/**
|
|
1931
2028
|
* REST API response for the run attestations list. The orchestrator-relayed
|
|
@@ -1972,8 +2069,10 @@ const runListItemSchema = z.object({
|
|
|
1972
2069
|
parentRunId: z.string().nullable(),
|
|
1973
2070
|
originalRunId: z.string().nullable(),
|
|
1974
2071
|
triggeredBy: z.string().nullable(),
|
|
2072
|
+
triggeredByAgentLabel: z.string().nullable().optional(),
|
|
1975
2073
|
triggeredByUser: runListPrincipalUserSchema.nullable(),
|
|
1976
2074
|
cancelledBy: z.string().nullable(),
|
|
2075
|
+
cancelledByAgentLabel: z.string().nullable().optional(),
|
|
1977
2076
|
cancelledByUser: runListPrincipalUserSchema.nullable(),
|
|
1978
2077
|
failureReason: z.string().optional(),
|
|
1979
2078
|
hadCompileJob: z.boolean(),
|
|
@@ -2186,6 +2285,6 @@ const DashboardResponseErrorCode = z.enum([
|
|
|
2186
2285
|
"internal_error"
|
|
2187
2286
|
]);
|
|
2188
2287
|
//#endregion
|
|
2189
|
-
export { DASHBOARD_REQUEST_TYPES, DASHBOARD_REQUEST_TYPE_SET, DashboardResponseErrorCode, EnvDeleteErrorCode, EventLogPayloadStreamError, FleetHostDisposition, HeldRunQueueType, HeldRunStatus, TestRelayType, attestationListFiltersSchema, attestationListItemSchema, attestationListSummarySchema, attestationVerifyStatusSchema, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserEventLogPayloadChunkSchema, dashboardAttestationGetRequestSchema, dashboardAttestationGetResponseSchema, dashboardAttestationsApiResponseSchema, dashboardAttestationsListAllRequestSchema, dashboardAttestationsListAllResponseSchema, dashboardAttestationsListRequestSchema, dashboardAttestationsListResponseSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardFleetHostRequestSchema, dashboardFleetHostResponseSchema, dashboardFleetHostsRequestSchema, dashboardFleetHostsResponseSchema, dashboardFleetPreviewRequestSchema, dashboardFleetPreviewResponseSchema, dashboardFleetWorkflowsForHostRequestSchema, dashboardFleetWorkflowsForHostResponseSchema, dashboardJobDetailSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunStructuredRequestSchema, dashboardRunStructuredResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, diagnosticsInfrastructureResponseSchema, diagnosticsSummaryResponseSchema, envBindingEntrySchema, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, eventLogListItemSchema, fleetHostDeclareRequestSchema, fleetHostDeclareResponseSchema, fleetHostRemoveRequestSchema, fleetHostRemoveResponseSchema, fleetHostWorkflowSchema, fleetPinnedRunSchema, fleetPreviewHostSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, identityLinkItemSchema, identityLinkListResponseSchema, manualScheduleRequestSchema, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, orgMemberSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, runCancelRequestSchema, runEventSchema, runLineageResponseSchema, runListItemSchema, runListResponseSchema, runRerunRequestSchema, testRelayCancelRequestSchema, testRelayCancelResponseSchema, testRelayRunLogsRequestSchema, testRelayRunLogsResponseSchema, testRelayRunStatusRequestSchema, testRelayRunStatusResponseSchema, testRelayTriggerRequestSchema, testRelayTriggerResponseSchema, testRelayUploadsInitRequestSchema, testRelayUploadsInitResponseSchema, trustPolicyResponseSchema };
|
|
2288
|
+
export { DASHBOARD_REQUEST_TYPES, DASHBOARD_REQUEST_TYPE_SET, DashboardResponseErrorCode, EnvDeleteErrorCode, EventLogPayloadStreamError, FleetHostDisposition, HeldRunQueueType, HeldRunStatus, TestRelayType, attestationListFiltersSchema, attestationListItemSchema, attestationListSummarySchema, attestationVerifyStatusSchema, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserEventLogPayloadChunkSchema, dashboardAttestationGetRequestSchema, dashboardAttestationGetResponseSchema, dashboardAttestationRetryRequestSchema, dashboardAttestationRetryResponseSchema, dashboardAttestationsApiResponseSchema, dashboardAttestationsListAllRequestSchema, dashboardAttestationsListAllResponseSchema, dashboardAttestationsListRequestSchema, dashboardAttestationsListResponseSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardFleetHostRequestSchema, dashboardFleetHostResponseSchema, dashboardFleetHostsRequestSchema, dashboardFleetHostsResponseSchema, dashboardFleetPreviewRequestSchema, dashboardFleetPreviewResponseSchema, dashboardFleetWorkflowsForHostRequestSchema, dashboardFleetWorkflowsForHostResponseSchema, dashboardJobDetailSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunStructuredRequestSchema, dashboardRunStructuredResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, diagnosticsInfrastructureResponseSchema, diagnosticsSummaryResponseSchema, envBindingEntrySchema, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, eventLogListItemSchema, fleetHostDeclareRequestSchema, fleetHostDeclareResponseSchema, fleetHostRemoveRequestSchema, fleetHostRemoveResponseSchema, fleetHostWorkflowSchema, fleetPinnedRunSchema, fleetPreviewHostSchema, heldRunApproveRequestSchema, heldRunRejectRequestSchema, heldRunsListRequestSchema, identityLinkItemSchema, identityLinkListResponseSchema, manualScheduleRequestSchema, memberIdentityLinkSchema, memberListResponseSchema, memberRoleAssignmentSchema, orgMemberSchema, registrationDeleteRequestSchema, registrationDisableRequestSchema, registrationItemSchema, registrationsListRequestSchema, registrationsListResponseSchema, runCancelRequestSchema, runEventSchema, runLineageResponseSchema, runListItemSchema, runListResponseSchema, runRerunRequestSchema, testRelayCancelRequestSchema, testRelayCancelResponseSchema, testRelayRunLogsRequestSchema, testRelayRunLogsResponseSchema, testRelayRunStatusRequestSchema, testRelayRunStatusResponseSchema, testRelayTriggerRequestSchema, testRelayTriggerResponseSchema, testRelayUploadsInitRequestSchema, testRelayUploadsInitResponseSchema, trustPolicyResponseSchema };
|
|
2190
2289
|
|
|
2191
2290
|
//# sourceMappingURL=dashboard.js.map
|
|
@@ -48,6 +48,16 @@ export declare const ExecutionJobStatus: z.ZodEnum<{
|
|
|
48
48
|
drift_dropped: "drift_dropped";
|
|
49
49
|
}>;
|
|
50
50
|
export type ExecutionJobStatus = z.infer<typeof ExecutionJobStatus>;
|
|
51
|
+
/**
|
|
52
|
+
* The status values a notification subscription may target at the given level.
|
|
53
|
+
*
|
|
54
|
+
* A run-level subscription matches against an `ExecutionRunStatus`; a job-level
|
|
55
|
+
* subscription matches against an `ExecutionJobStatus` (which carries job-only
|
|
56
|
+
* terminal states like `timed_out_stale` / `drift_dropped` / `skipped`). Both
|
|
57
|
+
* the Platform validation and the dashboard editor derive their allowed set
|
|
58
|
+
* from this single helper so server validation and UI options cannot diverge.
|
|
59
|
+
*/
|
|
60
|
+
export declare function statusOptionsForLevel(level: 'run' | 'job'): readonly string[];
|
|
51
61
|
/**
|
|
52
62
|
* Status values for execution steps (execution_steps table + step.status protocol messages).
|
|
53
63
|
*
|
|
@@ -158,8 +168,8 @@ export type CacheOutcome = z.infer<typeof CacheOutcome>;
|
|
|
158
168
|
/** Structured init-failure signal. Presence on a run/job means "never started". */
|
|
159
169
|
export declare const initFailureSchema: z.ZodObject<{
|
|
160
170
|
scope: z.ZodEnum<{
|
|
161
|
-
run: "run";
|
|
162
171
|
job: "job";
|
|
172
|
+
run: "run";
|
|
163
173
|
}>;
|
|
164
174
|
category: z.ZodEnum<{
|
|
165
175
|
secret_resolution: "secret_resolution";
|
|
@@ -209,6 +219,7 @@ export declare const executionStatusSchema: z.ZodObject<{
|
|
|
209
219
|
parentRunId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
210
220
|
originalRunId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
211
221
|
triggeredBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
222
|
+
triggeredByAgentLabel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
212
223
|
triggerActorProvider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
213
224
|
triggerActorUsername: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
214
225
|
triggerActorUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -216,8 +227,8 @@ export declare const executionStatusSchema: z.ZodObject<{
|
|
|
216
227
|
logBytes: z.ZodOptional<z.ZodNumber>;
|
|
217
228
|
initFailure: z.ZodOptional<z.ZodObject<{
|
|
218
229
|
scope: z.ZodEnum<{
|
|
219
|
-
run: "run";
|
|
220
230
|
job: "job";
|
|
231
|
+
run: "run";
|
|
221
232
|
}>;
|
|
222
233
|
category: z.ZodEnum<{
|
|
223
234
|
secret_resolution: "secret_resolution";
|
|
@@ -293,8 +304,8 @@ export declare const jobStatusForwardSchema: z.ZodObject<{
|
|
|
293
304
|
timestamp: z.ZodNumber;
|
|
294
305
|
initFailure: z.ZodOptional<z.ZodObject<{
|
|
295
306
|
scope: z.ZodEnum<{
|
|
296
|
-
run: "run";
|
|
297
307
|
job: "job";
|
|
308
|
+
run: "run";
|
|
298
309
|
}>;
|
|
299
310
|
category: z.ZodEnum<{
|
|
300
311
|
secret_resolution: "secret_resolution";
|
|
@@ -339,6 +350,7 @@ export declare const stateReplaySchema: z.ZodObject<{
|
|
|
339
350
|
parentRunId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
340
351
|
originalRunId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
341
352
|
triggeredBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
353
|
+
triggeredByAgentLabel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
342
354
|
failureReason: z.ZodOptional<z.ZodString>;
|
|
343
355
|
jobs: z.ZodArray<z.ZodObject<{
|
|
344
356
|
jobId: z.ZodString;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../
|
|
1
|
+
import "../../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/protocol/messages/execution-status.ts
|
|
4
4
|
/** Max length for ids and short identifier fields (runId, jobId, sha, ref, …). */
|
|
@@ -49,6 +49,18 @@ const ExecutionJobStatus = z.enum([
|
|
|
49
49
|
"drift_dropped"
|
|
50
50
|
]);
|
|
51
51
|
/**
|
|
52
|
+
* The status values a notification subscription may target at the given level.
|
|
53
|
+
*
|
|
54
|
+
* A run-level subscription matches against an `ExecutionRunStatus`; a job-level
|
|
55
|
+
* subscription matches against an `ExecutionJobStatus` (which carries job-only
|
|
56
|
+
* terminal states like `timed_out_stale` / `drift_dropped` / `skipped`). Both
|
|
57
|
+
* the Platform validation and the dashboard editor derive their allowed set
|
|
58
|
+
* from this single helper so server validation and UI options cannot diverge.
|
|
59
|
+
*/
|
|
60
|
+
function statusOptionsForLevel(level) {
|
|
61
|
+
return level === "job" ? ExecutionJobStatus.options : ExecutionRunStatus.options;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
52
64
|
* Status values for execution steps (execution_steps table + step.status protocol messages).
|
|
53
65
|
*
|
|
54
66
|
* - `pending` — a parallel-group child queued behind `maxParallel`, not yet launched.
|
|
@@ -149,13 +161,13 @@ const initFailureSchema = z.object({
|
|
|
149
161
|
jobName: z.string().max(128).optional()
|
|
150
162
|
});
|
|
151
163
|
/** Terminal run states that indicate the run has completed. */
|
|
152
|
-
const TERMINAL_RUN_STATES = new Set([
|
|
164
|
+
const TERMINAL_RUN_STATES = /* @__PURE__ */ new Set([
|
|
153
165
|
ExecutionRunStatus.enum.success,
|
|
154
166
|
ExecutionRunStatus.enum.failed,
|
|
155
167
|
ExecutionRunStatus.enum.cancelled
|
|
156
168
|
]);
|
|
157
169
|
/** Terminal job states that indicate the job is no longer running. */
|
|
158
|
-
const TERMINAL_JOB_STATES = new Set([
|
|
170
|
+
const TERMINAL_JOB_STATES = /* @__PURE__ */ new Set([
|
|
159
171
|
ExecutionJobStatus.enum.success,
|
|
160
172
|
ExecutionJobStatus.enum.failed,
|
|
161
173
|
ExecutionJobStatus.enum.cancelled,
|
|
@@ -197,6 +209,8 @@ const executionStatusSchema = z.object({
|
|
|
197
209
|
originalRunId: z.string().max(128).nullable().optional(),
|
|
198
210
|
/** User identity that triggered this re-run (null/undefined for webhook-triggered). */
|
|
199
211
|
triggeredBy: z.string().max(128).nullable().optional(),
|
|
212
|
+
/** Agent provenance label when the run was triggered through an agent credential. */
|
|
213
|
+
triggeredByAgentLabel: z.string().max(128).nullable().optional(),
|
|
200
214
|
/**
|
|
201
215
|
* Triggering-actor identity captured from the provider event (the pusher / PR
|
|
202
216
|
* author), distinct from `triggeredBy` (the KiCI re-run user). Provider
|
|
@@ -294,6 +308,7 @@ const stateReplaySchema = z.object({
|
|
|
294
308
|
parentRunId: z.string().max(128).nullable().optional(),
|
|
295
309
|
originalRunId: z.string().max(128).nullable().optional(),
|
|
296
310
|
triggeredBy: z.string().max(128).nullable().optional(),
|
|
311
|
+
triggeredByAgentLabel: z.string().max(128).nullable().optional(),
|
|
297
312
|
/** Human-readable reason why the run failed (only present for failed runs). */
|
|
298
313
|
failureReason: z.string().max(STATUS_FREE_TEXT_MAX).optional(),
|
|
299
314
|
jobs: z.array(z.object({
|
|
@@ -312,6 +327,6 @@ const stateReplaySchema = z.object({
|
|
|
312
327
|
timestamp: z.number()
|
|
313
328
|
});
|
|
314
329
|
//#endregion
|
|
315
|
-
export { CacheOutcome, CacheRunEventType, CacheStepType, ENVIRONMENTS_MAX, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, InitFailureCategory, MAX_JOBS_PER_RUN, REPO_IDENTIFIER_MAX, RUNS_ON_LABELS_MAX, STATE_REPLAY_MAX_RUNS, STATUS_FREE_TEXT_MAX, STATUS_ID_MAX, StepConcurrencyKind, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, TimeoutReason, executionStatusSchema, initFailureSchema, jobStatusForwardSchema, stateReplaySchema, stepStatusForwardSchema };
|
|
330
|
+
export { CacheOutcome, CacheRunEventType, CacheStepType, ENVIRONMENTS_MAX, ExecutionJobStatus, ExecutionRunStatus, ExecutionStepStatus, InitFailureCategory, MAX_JOBS_PER_RUN, REPO_IDENTIFIER_MAX, RUNS_ON_LABELS_MAX, STATE_REPLAY_MAX_RUNS, STATUS_FREE_TEXT_MAX, STATUS_ID_MAX, StepConcurrencyKind, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, TimeoutReason, executionStatusSchema, initFailureSchema, jobStatusForwardSchema, stateReplaySchema, statusOptionsForLevel, stepStatusForwardSchema };
|
|
316
331
|
|
|
317
332
|
//# sourceMappingURL=execution-status.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Error discriminator for a failed provenance mint, carried on
|
|
4
|
+
* `oidc.mint.response.error.code`. Mirrors the three orchestrator-side error
|
|
5
|
+
* classes that consume it:
|
|
6
|
+
* rejected -> run/job missing or job terminal (MintRejectedError)
|
|
7
|
+
* unavailable -> the Platform signer/issuer is not configured (MintUnavailableError)
|
|
8
|
+
* failed -> any other Platform-side failure (MintRelayError)
|
|
9
|
+
*/
|
|
10
|
+
export declare const OidcMintErrorCode: z.ZodEnum<{
|
|
11
|
+
failed: "failed";
|
|
12
|
+
rejected: "rejected";
|
|
13
|
+
unavailable: "unavailable";
|
|
14
|
+
}>;
|
|
15
|
+
export type OidcMintErrorCode = z.infer<typeof OidcMintErrorCode>;
|
|
16
|
+
/** orchestrator -> Platform: request a short-lived OIDC ID token for a job. */
|
|
17
|
+
export declare const oidcMintRequestSchema: z.ZodObject<{
|
|
18
|
+
type: z.ZodLiteral<"oidc.mint.request">;
|
|
19
|
+
requestId: z.ZodString;
|
|
20
|
+
orchestratorId: z.ZodString;
|
|
21
|
+
runId: z.ZodString;
|
|
22
|
+
jobId: z.ZodString;
|
|
23
|
+
audience: z.ZodString;
|
|
24
|
+
deferred: z.ZodOptional<z.ZodLiteral<true>>;
|
|
25
|
+
statementHash: z.ZodOptional<z.ZodString>;
|
|
26
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
deferred: "deferred";
|
|
28
|
+
"offline-backfill": "offline-backfill";
|
|
29
|
+
}>>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export type OidcMintRequest = z.infer<typeof oidcMintRequestSchema>;
|
|
32
|
+
/** Platform -> orchestrator: the minted token or a typed error (exactly one). */
|
|
33
|
+
export declare const oidcMintResponseSchema: z.ZodObject<{
|
|
34
|
+
type: z.ZodLiteral<"oidc.mint.response">;
|
|
35
|
+
requestId: z.ZodString;
|
|
36
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
token: z.ZodString;
|
|
38
|
+
expiresIn: z.ZodNumber;
|
|
39
|
+
jti: z.ZodString;
|
|
40
|
+
}, z.core.$strip>>;
|
|
41
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
code: z.ZodEnum<{
|
|
43
|
+
failed: "failed";
|
|
44
|
+
rejected: "rejected";
|
|
45
|
+
unavailable: "unavailable";
|
|
46
|
+
}>;
|
|
47
|
+
message: z.ZodString;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export type OidcMintResponse = z.infer<typeof oidcMintResponseSchema>;
|
|
51
|
+
//# sourceMappingURL=oidc-mint.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import "../../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { AttestationOrigin } from "../../provenance/attestation-origin.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/protocol/messages/oidc-mint.ts
|
|
5
|
+
/**
|
|
6
|
+
* Error discriminator for a failed provenance mint, carried on
|
|
7
|
+
* `oidc.mint.response.error.code`. Mirrors the three orchestrator-side error
|
|
8
|
+
* classes that consume it:
|
|
9
|
+
* rejected -> run/job missing or job terminal (MintRejectedError)
|
|
10
|
+
* unavailable -> the Platform signer/issuer is not configured (MintUnavailableError)
|
|
11
|
+
* failed -> any other Platform-side failure (MintRelayError)
|
|
12
|
+
*/
|
|
13
|
+
const OidcMintErrorCode = z.enum([
|
|
14
|
+
"rejected",
|
|
15
|
+
"unavailable",
|
|
16
|
+
"failed"
|
|
17
|
+
]);
|
|
18
|
+
/** orchestrator -> Platform: request a short-lived OIDC ID token for a job. */
|
|
19
|
+
const oidcMintRequestSchema = z.object({
|
|
20
|
+
type: z.literal("oidc.mint.request"),
|
|
21
|
+
requestId: z.string().min(1),
|
|
22
|
+
orchestratorId: z.string().min(1),
|
|
23
|
+
runId: z.string().min(1),
|
|
24
|
+
jobId: z.string().min(1),
|
|
25
|
+
audience: z.string().min(1).max(255),
|
|
26
|
+
/**
|
|
27
|
+
* Deferred fulfilment (attest-later): when true, the mint knowingly targets a
|
|
28
|
+
* completed job and binds `statementHash` + `origin` into the token. Absent
|
|
29
|
+
* for the live agent path. `orgId` is never on the wire — the Platform derives
|
|
30
|
+
* it from the authenticated connection.
|
|
31
|
+
*/
|
|
32
|
+
deferred: z.literal(true).optional(),
|
|
33
|
+
/** SHA-256 of the frozen DSSE statement the deferred token binds to. */
|
|
34
|
+
statementHash: z.string().optional(),
|
|
35
|
+
/** Mint-timing origin for a deferred fulfilment (never `live` here). */
|
|
36
|
+
origin: AttestationOrigin.extract(["deferred", "offline-backfill"]).optional()
|
|
37
|
+
});
|
|
38
|
+
/** Platform -> orchestrator: the minted token or a typed error (exactly one). */
|
|
39
|
+
const oidcMintResponseSchema = z.object({
|
|
40
|
+
type: z.literal("oidc.mint.response"),
|
|
41
|
+
requestId: z.string().min(1),
|
|
42
|
+
result: z.object({
|
|
43
|
+
token: z.string().min(1),
|
|
44
|
+
expiresIn: z.number().int().positive(),
|
|
45
|
+
jti: z.string().min(1)
|
|
46
|
+
}).optional(),
|
|
47
|
+
error: z.object({
|
|
48
|
+
code: OidcMintErrorCode,
|
|
49
|
+
message: z.string()
|
|
50
|
+
}).optional()
|
|
51
|
+
}).refine((m) => m.result === void 0 !== (m.error === void 0), { message: "oidc.mint.response must carry exactly one of result | error" });
|
|
52
|
+
//#endregion
|
|
53
|
+
export { OidcMintErrorCode, oidcMintRequestSchema, oidcMintResponseSchema };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=oidc-mint.js.map
|
|
@@ -18,14 +18,41 @@ export declare const oidcTokenRequestParamsSchema: z.ZodObject<{
|
|
|
18
18
|
audience: z.ZodString;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
20
|
export type OidcTokenRequestParams = z.infer<typeof oidcTokenRequestParamsSchema>;
|
|
21
|
+
export { OidcMintErrorCode } from './oidc-mint.js';
|
|
22
|
+
export type { OidcMintErrorCode as OidcMintErrorCodeType } from './oidc-mint.js';
|
|
23
|
+
/** A successfully minted ID token bound to a job. */
|
|
24
|
+
export declare const oidcMintedTokenSchema: z.ZodObject<{
|
|
25
|
+
token: z.ZodString;
|
|
26
|
+
expiresIn: z.ZodNumber;
|
|
27
|
+
jti: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type OidcMintedToken = z.infer<typeof oidcMintedTokenSchema>;
|
|
21
30
|
/**
|
|
22
|
-
* Result the orchestrator returns to the agent: the minted short-lived
|
|
23
|
-
*
|
|
31
|
+
* Result the orchestrator returns to the agent: either the minted short-lived
|
|
32
|
+
* JWT, or — when the mint failed transiently (`unavailable`/`failed`, never
|
|
33
|
+
* `rejected`) — a `deferred` signal so the agent freezes the statement and
|
|
34
|
+
* reports it for later fulfilment. A permanent `rejected` is thrown, never
|
|
35
|
+
* returned, so it is not part of this union.
|
|
24
36
|
*/
|
|
25
|
-
export declare const oidcTokenResultSchema: z.ZodObject<{
|
|
37
|
+
export declare const oidcTokenResultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
26
38
|
token: z.ZodString;
|
|
27
39
|
expiresIn: z.ZodNumber;
|
|
28
40
|
jti: z.ZodString;
|
|
29
|
-
}, z.core.$strip
|
|
41
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
42
|
+
deferred: z.ZodLiteral<true>;
|
|
43
|
+
code: z.ZodEnum<{
|
|
44
|
+
failed: "failed";
|
|
45
|
+
unavailable: "unavailable";
|
|
46
|
+
}>;
|
|
47
|
+
}, z.core.$strip>]>;
|
|
30
48
|
export type OidcTokenResult = z.infer<typeof oidcTokenResultSchema>;
|
|
49
|
+
/** Extra fields a deferred *fulfilment* mint carries (orchestrator -> Platform). */
|
|
50
|
+
export declare const deferredMintParamsSchema: z.ZodObject<{
|
|
51
|
+
statementHash: z.ZodString;
|
|
52
|
+
origin: z.ZodEnum<{
|
|
53
|
+
deferred: "deferred";
|
|
54
|
+
"offline-backfill": "offline-backfill";
|
|
55
|
+
}>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export type DeferredMintParams = z.infer<typeof deferredMintParamsSchema>;
|
|
31
58
|
//# sourceMappingURL=oidc-token-relay.d.ts.map
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import "../../
|
|
1
|
+
import "../../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { AttestationOrigin } from "../../provenance/attestation-origin.js";
|
|
3
|
+
import { OidcMintErrorCode } from "./oidc-mint.js";
|
|
2
4
|
import { z } from "zod";
|
|
3
5
|
//#region src/protocol/messages/oidc-token-relay.ts
|
|
4
6
|
/**
|
|
@@ -19,16 +21,29 @@ const oidcTokenRequestParamsSchema = z.object({
|
|
|
19
21
|
jobId: z.string().min(1),
|
|
20
22
|
audience: z.string().min(1).max(255)
|
|
21
23
|
});
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
* plus its lifetime and identifier.
|
|
25
|
-
*/
|
|
26
|
-
const oidcTokenResultSchema = z.object({
|
|
24
|
+
/** A successfully minted ID token bound to a job. */
|
|
25
|
+
const oidcMintedTokenSchema = z.object({
|
|
27
26
|
token: z.string(),
|
|
28
27
|
expiresIn: z.number().int().positive(),
|
|
29
28
|
jti: z.string()
|
|
30
29
|
});
|
|
30
|
+
/**
|
|
31
|
+
* Result the orchestrator returns to the agent: either the minted short-lived
|
|
32
|
+
* JWT, or — when the mint failed transiently (`unavailable`/`failed`, never
|
|
33
|
+
* `rejected`) — a `deferred` signal so the agent freezes the statement and
|
|
34
|
+
* reports it for later fulfilment. A permanent `rejected` is thrown, never
|
|
35
|
+
* returned, so it is not part of this union.
|
|
36
|
+
*/
|
|
37
|
+
const oidcTokenResultSchema = z.union([oidcMintedTokenSchema, z.object({
|
|
38
|
+
deferred: z.literal(true),
|
|
39
|
+
code: z.enum(["unavailable", "failed"])
|
|
40
|
+
})]);
|
|
41
|
+
/** Extra fields a deferred *fulfilment* mint carries (orchestrator -> Platform). */
|
|
42
|
+
const deferredMintParamsSchema = z.object({
|
|
43
|
+
statementHash: z.string(),
|
|
44
|
+
origin: AttestationOrigin.extract(["deferred", "offline-backfill"])
|
|
45
|
+
});
|
|
31
46
|
//#endregion
|
|
32
|
-
export { OIDC_TOKEN_REQUEST_METHOD, oidcTokenRequestParamsSchema, oidcTokenResultSchema };
|
|
47
|
+
export { OIDC_TOKEN_REQUEST_METHOD, OidcMintErrorCode, deferredMintParamsSchema, oidcMintedTokenSchema, oidcTokenRequestParamsSchema, oidcTokenResultSchema };
|
|
33
48
|
|
|
34
49
|
//# sourceMappingURL=oidc-token-relay.js.map
|