@kici-dev/engine 0.1.21 → 0.1.23

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 (60) 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.js +9 -0
  4. package/dist/audit/activity.d.ts +3 -1
  5. package/dist/audit/activity.js +8 -16
  6. package/dist/audit/retention-policy.js +12 -0
  7. package/dist/environment/host-match.d.ts +25 -0
  8. package/dist/environment/host-match.js +67 -0
  9. package/dist/environment/index.d.ts +1 -0
  10. package/dist/environment/scope-resolver.d.ts +15 -4
  11. package/dist/environment/scope-resolver.js +55 -15
  12. package/dist/environment/scope-template.d.ts +18 -0
  13. package/dist/environment/scope-template.js +43 -0
  14. package/dist/environment/types.d.ts +7 -0
  15. package/dist/fanout/materialize.d.ts +55 -4
  16. package/dist/fanout/materialize.js +95 -49
  17. package/dist/index.d.ts +4 -2
  18. package/dist/index.js +14 -8
  19. package/dist/inputs/build.d.ts +9 -0
  20. package/dist/inputs/build.js +44 -0
  21. package/dist/inputs/coerce.d.ts +25 -0
  22. package/dist/inputs/coerce.js +51 -0
  23. package/dist/inputs/descriptor.d.ts +53 -0
  24. package/dist/inputs/descriptor.js +42 -0
  25. package/dist/inputs/extract.d.ts +15 -0
  26. package/dist/inputs/extract.js +117 -0
  27. package/dist/inputs/index.d.ts +5 -0
  28. package/dist/inputs/index.js +6 -0
  29. package/dist/inventory.d.ts +2 -2
  30. package/dist/labels/compile.d.ts +9 -0
  31. package/dist/labels/compile.js +10 -1
  32. package/dist/labels-match.d.ts +52 -0
  33. package/dist/labels-match.js +22 -1
  34. package/dist/labels.d.ts +29 -0
  35. package/dist/labels.js +32 -1
  36. package/dist/metrics/catalog-policy.d.ts +7 -0
  37. package/dist/metrics/catalog-policy.js +11 -12
  38. package/dist/metrics/metric-catalog.generated.d.ts +2 -2
  39. package/dist/metrics/metric-catalog.generated.js +10 -2
  40. package/dist/protocol/dashboard-write-operations.d.ts +8 -1
  41. package/dist/protocol/dashboard-write-operations.js +25 -4
  42. package/dist/protocol/messages/access-log.d.ts +40 -0
  43. package/dist/protocol/messages/access-log.js +9 -1
  44. package/dist/protocol/messages/auth.d.ts +2 -0
  45. package/dist/protocol/messages/capabilities.d.ts +2 -0
  46. package/dist/protocol/messages/dashboard.d.ts +766 -25
  47. package/dist/protocol/messages/dashboard.js +173 -9
  48. package/dist/protocol/messages/deployment-identity.d.ts +38 -0
  49. package/dist/protocol/messages/deployment-identity.js +28 -0
  50. package/dist/protocol/messages/orchestrator-agent.d.ts +64 -2
  51. package/dist/protocol/messages/orchestrator-agent.js +26 -7
  52. package/dist/protocol/messages/peer.js +1 -1
  53. package/dist/protocol/messages/platform-orchestrator.d.ts +197 -2
  54. package/dist/protocol/messages/run-events.d.ts +1 -1
  55. package/dist/protocol/messages/source-registration.d.ts +15 -0
  56. package/dist/protocol/messages/source-registration.js +17 -1
  57. package/dist/trigger/types.d.ts +114 -22
  58. package/dist/trigger/types.js +53 -12
  59. package/package.json +9 -1
  60. package/sbom.spdx.json +5 -5
@@ -2,6 +2,7 @@ import "../../chunk-BTugEXQM.js";
2
2
  import { CheckMode, CheckStepOutcome } from "../../check-mode.js";
3
3
  import { actorPrincipalSchema } from "./actor.js";
4
4
  import { initFailureSchema } from "./execution-status.js";
5
+ import { DeploymentContainerRuntimeSchema, DeploymentModeSchema } from "./deployment-identity.js";
5
6
  import { SourceSubtype } from "./source-registration.js";
6
7
  import { kiciBundleSchema } from "../../provenance/bundle.js";
7
8
  import { dashboardAccessLogListRequestSchema, dashboardAccessLogListResponseSchema } from "./access-log.js";
@@ -9,7 +10,9 @@ import { dashboardOrchLogsRequestSchema, dashboardOrchLogsResponseSchema } from
9
10
  import { EventLogSource, EventLogStatus, PayloadOmittedReason } from "./event-log.js";
10
11
  import { ScalerBackendType } from "../../scaler/scaler-backend-type.js";
11
12
  import { ApprovalDecision, HoldScope, approverClauseSchema } from "../../approval/types.js";
12
- import { IfFailedPolicy } from "../../trigger/types.js";
13
+ import { NeedsRunOn, OnUnreachableMode } from "../../trigger/types.js";
14
+ import { HostTargetSelector } from "../../labels-match.js";
15
+ import { HostInventoryEntry } from "../../inventory.js";
13
16
  import { globalWorkflowsGetRequestSchema, globalWorkflowsGetResponseSchema, globalWorkflowsUpdateRequestSchema, globalWorkflowsUpdateResponseSchema } from "./dashboard-global-workflows.js";
14
17
  import { z } from "zod";
15
18
  //#region src/protocol/messages/dashboard.ts
@@ -80,12 +83,13 @@ const dashboardJobDetailSchema = z.object({
80
83
  /**
81
84
  * Upstream dependency edges for this job (one entry per `needs` declaration),
82
85
  * resolved by the orchestrator from execution_job_needs. `upstreamName` is the
83
- * upstream job name; `ifFailed` is the per-edge failure policy. null/absent when
84
- * the job has no upstreams.
86
+ * upstream job name; `runOn` is the per-edge run-on status-set (the upstream
87
+ * terminal statuses that satisfy the edge). null/absent when the job has no
88
+ * upstreams.
85
89
  */
86
90
  needs: z.array(z.object({
87
91
  upstreamName: z.string(),
88
- ifFailed: IfFailedPolicy
92
+ runOn: NeedsRunOn
89
93
  })).nullable().optional(),
90
94
  steps: z.array(dashboardStepDetailSchema)
91
95
  });
@@ -815,6 +819,15 @@ const envSourceOverrideDeleteResponseSchema = z.object({
815
819
  requestId: z.string(),
816
820
  error: z.string().optional()
817
821
  });
822
+ /**
823
+ * A scope→environment binding with its host selector. `hostPattern` is the host
824
+ * the binding applies to (`'**'` = all hosts); exact / glob / regex over a
825
+ * fan-out child's agentId / hostname / labels.
826
+ */
827
+ const envBindingEntrySchema = z.object({
828
+ scopePattern: z.string(),
829
+ hostPattern: z.string()
830
+ });
818
831
  /** List bindings for an environment. */
819
832
  const envBindingsListRequestSchema = z.object({
820
833
  type: z.literal("dashboard.environments.bindings.list"),
@@ -825,16 +838,16 @@ const envBindingsListRequestSchema = z.object({
825
838
  const envBindingsListResponseSchema = z.object({
826
839
  type: z.literal("dashboard.environments.bindings.list.response"),
827
840
  requestId: z.string(),
828
- scopePatterns: z.array(z.string()).optional(),
841
+ bindings: z.array(envBindingEntrySchema).optional(),
829
842
  error: z.string().optional()
830
843
  });
831
- /** Set bindings (scope patterns) for an environment. */
844
+ /** Set bindings (scope + host patterns) for an environment. */
832
845
  const envBindingsSetRequestSchema = z.object({
833
846
  type: z.literal("dashboard.environments.bindings.set"),
834
847
  requestId: z.string(),
835
848
  actor: actorPrincipalSchema,
836
849
  environmentId: z.string(),
837
- scopePatterns: z.array(z.string())
850
+ bindings: z.array(envBindingEntrySchema)
838
851
  });
839
852
  const envBindingsSetResponseSchema = z.object({
840
853
  type: z.literal("dashboard.environments.bindings.set.response"),
@@ -990,6 +1003,10 @@ const heldRunsListResponseSchema = z.object({
990
1003
  clauses: z.array(approverClauseSchema),
991
1004
  reason: z.string().nullable().optional()
992
1005
  }).nullable().optional(),
1006
+ payload: z.object({
1007
+ summaryMarkdown: z.string(),
1008
+ drift: z.unknown()
1009
+ }).nullable().optional(),
993
1010
  decisions: z.array(z.object({
994
1011
  approverUserId: z.string(),
995
1012
  decision: ApprovalDecision,
@@ -1004,7 +1021,14 @@ const heldRunApproveRequestSchema = z.object({
1004
1021
  type: z.literal("dashboard.held-runs.approve"),
1005
1022
  requestId: z.string(),
1006
1023
  actor: actorPrincipalSchema,
1007
- heldRunId: z.string()
1024
+ heldRunId: z.string(),
1025
+ /**
1026
+ * Set by the `kici run --approve-all` breakglass: the approval was issued by
1027
+ * the run's own dispatcher auto-approving every gate of that run. Eligibility
1028
+ * is still enforced (this only changes the audit action to
1029
+ * `held_run.auto_approve`); it is never a bypass.
1030
+ */
1031
+ autoApprove: z.boolean().optional()
1008
1032
  });
1009
1033
  const heldRunApproveResponseSchema = z.object({
1010
1034
  type: z.literal("dashboard.held-runs.approve.response"),
@@ -1032,6 +1056,113 @@ const dashboardDiagnosticsRequestSchema = z.object({
1032
1056
  /** When false or omitted, agents[] is empty and aggregate fields are populated instead. */
1033
1057
  includeAgents: z.boolean().optional()
1034
1058
  });
1059
+ /** A run pinned to a host, for the host-detail "recent runs" list. */
1060
+ const fleetPinnedRunSchema = z.object({
1061
+ runId: z.string(),
1062
+ workflowName: z.string().nullable(),
1063
+ status: z.string(),
1064
+ createdAt: z.string()
1065
+ });
1066
+ /** How a runsOnAll fan-out would treat one host, given its current reachability. */
1067
+ const FleetHostDisposition = z.enum([
1068
+ "target",
1069
+ "unreachable-durable",
1070
+ "skipped-ephemeral"
1071
+ ]);
1072
+ /** A host matched by a runsOnAll preview, plus how the fan-out would treat it. */
1073
+ const fleetPreviewHostSchema = z.object({
1074
+ entry: HostInventoryEntry,
1075
+ disposition: FleetHostDisposition
1076
+ });
1077
+ const dashboardFleetHostsRequestSchema = z.object({
1078
+ type: z.literal("dashboard.fleet.hosts"),
1079
+ requestId: z.string(),
1080
+ actor: actorPrincipalSchema
1081
+ });
1082
+ const dashboardFleetHostRequestSchema = z.object({
1083
+ type: z.literal("dashboard.fleet.host"),
1084
+ requestId: z.string(),
1085
+ actor: actorPrincipalSchema,
1086
+ agentId: z.string()
1087
+ });
1088
+ const dashboardFleetPreviewRequestSchema = z.object({
1089
+ type: z.literal("dashboard.fleet.preview"),
1090
+ requestId: z.string(),
1091
+ actor: actorPrincipalSchema,
1092
+ workflowName: z.string()
1093
+ });
1094
+ const dashboardFleetHostsResponseSchema = z.object({
1095
+ type: z.literal("dashboard.fleet.hosts.response"),
1096
+ requestId: z.string(),
1097
+ hosts: z.array(HostInventoryEntry)
1098
+ });
1099
+ const dashboardFleetHostResponseSchema = z.object({
1100
+ type: z.literal("dashboard.fleet.host.response"),
1101
+ requestId: z.string(),
1102
+ host: HostInventoryEntry.nullable(),
1103
+ runs: z.array(fleetPinnedRunSchema)
1104
+ });
1105
+ const dashboardFleetPreviewResponseSchema = z.object({
1106
+ type: z.literal("dashboard.fleet.preview.response"),
1107
+ requestId: z.string(),
1108
+ matched: z.array(fleetPreviewHostSchema),
1109
+ onUnreachable: OnUnreachableMode,
1110
+ estimatedChildCount: z.number()
1111
+ });
1112
+ /** Request: which registered runsOnAll fan-outs target this host? */
1113
+ const dashboardFleetWorkflowsForHostRequestSchema = z.object({
1114
+ type: z.literal("dashboard.fleet.workflows-for-host"),
1115
+ requestId: z.string(),
1116
+ actor: actorPrincipalSchema,
1117
+ agentId: z.string()
1118
+ });
1119
+ /** One registered runsOnAll workflow whose selector matches the host. */
1120
+ const fleetHostWorkflowSchema = z.object({
1121
+ workflowName: z.string(),
1122
+ repoIdentifier: z.string(),
1123
+ sourceFile: z.string().nullable(),
1124
+ onUnreachable: OnUnreachableMode,
1125
+ disposition: FleetHostDisposition
1126
+ });
1127
+ const dashboardFleetWorkflowsForHostResponseSchema = z.object({
1128
+ type: z.literal("dashboard.fleet.workflows-for-host.response"),
1129
+ requestId: z.string(),
1130
+ workflows: z.array(fleetHostWorkflowSchema)
1131
+ });
1132
+ /** Declare a static host into the roster (wraps HostRosterStore.declareStatic). */
1133
+ const fleetHostDeclareRequestSchema = z.object({
1134
+ type: z.literal("dashboard.fleet.host.declare"),
1135
+ requestId: z.string(),
1136
+ actor: actorPrincipalSchema,
1137
+ agentId: z.string(),
1138
+ labels: z.array(z.string()).optional(),
1139
+ hostname: z.string().optional(),
1140
+ properties: z.record(z.string(), z.union([
1141
+ z.string(),
1142
+ z.number(),
1143
+ z.boolean()
1144
+ ])).optional()
1145
+ });
1146
+ const fleetHostDeclareResponseSchema = z.object({
1147
+ type: z.literal("dashboard.fleet.host.declare.response"),
1148
+ requestId: z.string(),
1149
+ declared: z.boolean().optional(),
1150
+ created: z.boolean().optional(),
1151
+ error: z.string().optional()
1152
+ });
1153
+ /** Remove a host from the roster by agent id (HostRosterStore.removeStatic). */
1154
+ const fleetHostRemoveRequestSchema = z.object({
1155
+ type: z.literal("dashboard.fleet.host.remove"),
1156
+ requestId: z.string(),
1157
+ actor: actorPrincipalSchema,
1158
+ agentId: z.string()
1159
+ });
1160
+ const fleetHostRemoveResponseSchema = z.object({
1161
+ type: z.literal("dashboard.fleet.host.remove.response"),
1162
+ requestId: z.string(),
1163
+ removed: z.boolean().optional(),
1164
+ error: z.string().optional()
1165
+ });
1035
1166
  /** Agent info within the diagnostics response. */
1036
1167
  const diagnosticsAgentSchema = z.object({
1037
1168
  agentId: z.string(),
@@ -1431,6 +1562,17 @@ const testRelayTriggerRequestSchema = z.object({
1431
1562
  fullRepo: z.boolean().optional(),
1432
1563
  /** Run mode for idempotent steps; relayed onto the dispatch event. Omitted = apply. */
1433
1564
  checkMode: CheckMode.optional(),
1565
+ /**
1566
+ * Runtime host narrowing from `kici run --target`. Intersects each runsOnAll
1567
+ * job's matched roster with this selector. Omitted for webhook runs.
1568
+ */
1569
+ target: HostTargetSelector.optional(),
1570
+ /**
1571
+ * Raw operator-supplied `kici run --input KEY=VALUE` pairs (not coerced /
1572
+ * defaulted), relayed verbatim. The orchestrator validates + coerces + applies
1573
+ * defaults authoritatively against the matched workflow's lock descriptor.
1574
+ */
1575
+ dispatchInputs: z.record(z.string(), z.string()).optional(),
1434
1576
  secrets: z.record(z.string(), z.string()).optional(),
1435
1577
  encryptedSecrets: z.string().optional(),
1436
1578
  encryptedSecretsKey: z.string().optional()
@@ -1541,6 +1683,12 @@ const dashboardPlatformToOrchSchema = z.discriminatedUnion("type", [
1541
1683
  registrationDisableRequestSchema,
1542
1684
  registrationDeleteRequestSchema,
1543
1685
  dashboardDiagnosticsRequestSchema,
1686
+ dashboardFleetHostsRequestSchema,
1687
+ dashboardFleetHostRequestSchema,
1688
+ dashboardFleetPreviewRequestSchema,
1689
+ dashboardFleetWorkflowsForHostRequestSchema,
1690
+ fleetHostDeclareRequestSchema,
1691
+ fleetHostRemoveRequestSchema,
1544
1692
  dashboardScalerCapacityRequestSchema,
1545
1693
  dashboardScalerAgentsRequestSchema,
1546
1694
  backendsListRequestSchema,
@@ -1605,6 +1753,12 @@ const dashboardOrchToPlatformSchema = z.discriminatedUnion("type", [
1605
1753
  registrationDisableResponseSchema,
1606
1754
  registrationDeleteResponseSchema,
1607
1755
  dashboardDiagnosticsResponseSchema,
1756
+ dashboardFleetHostsResponseSchema,
1757
+ dashboardFleetHostResponseSchema,
1758
+ dashboardFleetPreviewResponseSchema,
1759
+ dashboardFleetWorkflowsForHostResponseSchema,
1760
+ fleetHostDeclareResponseSchema,
1761
+ fleetHostRemoveResponseSchema,
1608
1762
  dashboardScalerCapacityResponseSchema,
1609
1763
  dashboardScalerAgentsResponseSchema,
1610
1764
  backendsListResponseSchema,
@@ -1755,6 +1909,16 @@ const diagnosticsInfraOrchestratorSchema = z.object({
1755
1909
  raftTerm: z.number().nullable().optional(),
1756
1910
  raftLeaderId: z.string().nullable().optional(),
1757
1911
  scalerBackends: z.array(z.string()),
1912
+ /**
1913
+ * Self-reported deployment shape, used by the dashboard to build the correct
1914
+ * per-orchestrator kici-admin invocation. Orchestrators that never reported
1915
+ * it serialize as `mode: 'unknown'` with null container fields.
1916
+ */
1917
+ deployment: z.object({
1918
+ mode: DeploymentModeSchema,
1919
+ containerName: z.string().nullable(),
1920
+ containerRuntime: DeploymentContainerRuntimeSchema.nullable()
1921
+ }),
1758
1922
  s3LogAccess: z.boolean().nullable().optional(),
1759
1923
  agentCount: z.number(),
1760
1924
  runningJobs: z.number(),
@@ -1867,6 +2031,6 @@ const orgMemberSchema = z.object({
1867
2031
  /** Response for org members list endpoint. */
1868
2032
  const memberListResponseSchema = z.object({ members: z.array(orgMemberSchema) });
1869
2033
  //#endregion
1870
- export { EnvDeleteErrorCode, EventLogPayloadStreamError, HeldRunQueueType, HeldRunStatus, TestRelayType, attestationListItemSchema, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserEventLogPayloadChunkSchema, dashboardAttestationsApiResponseSchema, dashboardAttestationsListRequestSchema, dashboardAttestationsListResponseSchema, dashboardDiagnosticsRequestSchema, dashboardDiagnosticsResponseSchema, dashboardEventDlqCountRequestSchema, dashboardEventDlqDiscardRequestSchema, dashboardEventDlqListItemSchema, dashboardEventDlqListRequestSchema, dashboardEventDlqRetryRequestSchema, dashboardEventLogDetailRequestSchema, dashboardEventLogListRequestSchema, dashboardEventLogPayloadChunkSchema, dashboardEventLogPayloadStreamRequestSchema, dashboardJobDetailSchema, dashboardOrchToPlatformSchema, dashboardPayloadRequestSchema, dashboardPlatformToOrchSchema, dashboardRunDetailApiResponseSchema, dashboardRunDetailRequestSchema, dashboardRunDetailResponseSchema, dashboardRunSummarySchema, dashboardRunsFiltersRequestSchema, dashboardRunsFiltersResponseSchema, dashboardRunsListRequestSchema, dashboardRunsListResponseSchema, dashboardScalerAgentsRequestSchema, dashboardScalerAgentsResponseSchema, dashboardScalerCapacityRequestSchema, dashboardScalerCapacityResponseSchema, dashboardSourceSummarySchema, dashboardSourcesListRequestSchema, dashboardSourcesListResponseSchema, dashboardStepLogsApiResponseSchema, dashboardStepLogsRequestSchema, dashboardStepLogsResponseSchema, diagnosticsInfrastructureResponseSchema, diagnosticsSummaryResponseSchema, envBindingsListRequestSchema, envBindingsSetRequestSchema, envCreateRequestSchema, envDeleteRequestSchema, envGetRequestSchema, envHistoryRequestSchema, envListRequestSchema, envSecretDeleteRequestSchema, envSecretScopeCreateRequestSchema, envSecretScopeDeleteRequestSchema, envSecretScopeRenameRequestSchema, envSecretSetRequestSchema, envSecretsListRequestSchema, envSourceOverrideDeleteRequestSchema, envSourceOverrideSetRequestSchema, envSourceOverridesListRequestSchema, envTestAccessSetRequestSchema, envUpdateRequestSchema, envVarDeleteRequestSchema, envVarSetRequestSchema, envVarsListRequestSchema, eventLogListItemSchema, 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 };
2034
+ export { EnvDeleteErrorCode, EventLogPayloadStreamError, FleetHostDisposition, HeldRunQueueType, HeldRunStatus, TestRelayType, attestationListItemSchema, backendGetRequestSchema, backendGetResponseSchema, backendItemSchema, backendSyncRequestSchema, backendSyncResponseSchema, backendTestRequestSchema, backendTestResponseSchema, backendsListRequestSchema, backendsListResponseSchema, backendsSyncAllRequestSchema, backendsSyncAllResponseSchema, browserEventLogPayloadChunkSchema, dashboardAttestationsApiResponseSchema, 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, 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 };
1871
2035
 
1872
2036
  //# sourceMappingURL=dashboard.js.map
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod';
2
+ /** How the orchestrator process itself was deployed (not how it runs agents). */
3
+ export declare const DeploymentModeSchema: z.ZodEnum<{
4
+ unknown: "unknown";
5
+ systemd: "systemd";
6
+ launchd: "launchd";
7
+ windows: "windows";
8
+ compose: "compose";
9
+ }>;
10
+ export type DeploymentMode = z.infer<typeof DeploymentModeSchema>;
11
+ /** Container runtime that launched a `compose`-mode orchestrator. */
12
+ export declare const DeploymentContainerRuntimeSchema: z.ZodEnum<{
13
+ podman: "podman";
14
+ docker: "docker";
15
+ }>;
16
+ export type DeploymentContainerRuntime = z.infer<typeof DeploymentContainerRuntimeSchema>;
17
+ /**
18
+ * The orchestrator's self-reported deployment shape, used to build the correct
19
+ * kici-admin invocation in the dashboard diagnostics page. Container fields are
20
+ * populated only for the `compose` mode; a hand-run orchestrator reports
21
+ * `mode: 'unknown'` with no container fields.
22
+ */
23
+ export declare const DeploymentIdentitySchema: z.ZodObject<{
24
+ mode: z.ZodEnum<{
25
+ unknown: "unknown";
26
+ systemd: "systemd";
27
+ launchd: "launchd";
28
+ windows: "windows";
29
+ compose: "compose";
30
+ }>;
31
+ containerName: z.ZodOptional<z.ZodString>;
32
+ containerRuntime: z.ZodOptional<z.ZodEnum<{
33
+ podman: "podman";
34
+ docker: "docker";
35
+ }>>;
36
+ }, z.core.$strip>;
37
+ export type DeploymentIdentity = z.infer<typeof DeploymentIdentitySchema>;
38
+ //# sourceMappingURL=deployment-identity.d.ts.map
@@ -0,0 +1,28 @@
1
+ import "../../chunk-BTugEXQM.js";
2
+ import { z } from "zod";
3
+ //#region src/protocol/messages/deployment-identity.ts
4
+ /** How the orchestrator process itself was deployed (not how it runs agents). */
5
+ const DeploymentModeSchema = z.enum([
6
+ "systemd",
7
+ "launchd",
8
+ "windows",
9
+ "compose",
10
+ "unknown"
11
+ ]);
12
+ /** Container runtime that launched a `compose`-mode orchestrator. */
13
+ const DeploymentContainerRuntimeSchema = z.enum(["podman", "docker"]);
14
+ /**
15
+ * The orchestrator's self-reported deployment shape, used to build the correct
16
+ * kici-admin invocation in the dashboard diagnostics page. Container fields are
17
+ * populated only for the `compose` mode; a hand-run orchestrator reports
18
+ * `mode: 'unknown'` with no container fields.
19
+ */
20
+ const DeploymentIdentitySchema = z.object({
21
+ mode: DeploymentModeSchema,
22
+ containerName: z.string().min(1).optional(),
23
+ containerRuntime: DeploymentContainerRuntimeSchema.optional()
24
+ });
25
+ //#endregion
26
+ export { DeploymentContainerRuntimeSchema, DeploymentIdentitySchema, DeploymentModeSchema };
27
+
28
+ //# sourceMappingURL=deployment-identity.js.map
@@ -22,10 +22,25 @@ export type CacheRefScope = z.infer<typeof CacheRefScope>;
22
22
  *
23
23
  * - `jobs` maps an upstream job name to its outputs record.
24
24
  * - `groups` maps a dynamic group name to its ordered member job names.
25
+ * - `statuses` maps an upstream job name to its terminal status, so the
26
+ * generator's `ctx.needs.<job>.status` reflects the frozen upstream outcome.
25
27
  */
26
28
  export declare const upstreamSnapshotSchema: z.ZodObject<{
27
29
  jobs: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
28
30
  groups: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
31
+ statuses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
32
+ skipped: "skipped";
33
+ success: "success";
34
+ pending: "pending";
35
+ running: "running";
36
+ failed: "failed";
37
+ cancelled: "cancelled";
38
+ cancelling: "cancelling";
39
+ queued: "queued";
40
+ recovering: "recovering";
41
+ timed_out_stale: "timed_out_stale";
42
+ drift_dropped: "drift_dropped";
43
+ }>>>;
29
44
  }, z.core.$strip>;
30
45
  export type UpstreamSnapshot = z.infer<typeof upstreamSnapshotSchema>;
31
46
  /**
@@ -79,6 +94,19 @@ export declare const jobDispatchSchema: z.ZodObject<{
79
94
  requestId: z.ZodOptional<z.ZodString>;
80
95
  runPublicKey: z.ZodOptional<z.ZodString>;
81
96
  upstreamJobOutputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
97
+ upstreamJobStatuses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
98
+ skipped: "skipped";
99
+ success: "success";
100
+ pending: "pending";
101
+ running: "running";
102
+ failed: "failed";
103
+ cancelled: "cancelled";
104
+ cancelling: "cancelling";
105
+ queued: "queued";
106
+ recovering: "recovering";
107
+ timed_out_stale: "timed_out_stale";
108
+ drift_dropped: "drift_dropped";
109
+ }>>>;
82
110
  sourceAuth: z.ZodOptional<z.ZodObject<{
83
111
  kind: z.ZodEnum<{
84
112
  basic: "basic";
@@ -491,12 +519,25 @@ export declare const StepApprovalOutcome: z.ZodEnum<{
491
519
  }>;
492
520
  export type StepApprovalOutcome = z.infer<typeof StepApprovalOutcome>;
493
521
  /**
494
- * Agent -> Orchestrator: a step carrying `requireApproval` is about to run and
522
+ * Drift payload carried on a `when: 'drift'` step-approval hold. Captured from
523
+ * the step's check/summarize: `summaryMarkdown` is the author's `summarize(drift)`
524
+ * rendering, `drift` is the structured drift blob. Rendered in the dashboard
525
+ * approval queue + the CLI so the operator sees the computed diff before
526
+ * approving the apply.
527
+ */
528
+ export declare const stepApprovalPayloadSchema: z.ZodObject<{
529
+ summaryMarkdown: z.ZodString;
530
+ drift: z.ZodUnknown;
531
+ }, z.core.$strip>;
532
+ export type StepApprovalPayload = z.infer<typeof stepApprovalPayloadSchema>;
533
+ /**
534
+ * Agent -> Orchestrator: a step carrying an `approval` gate is about to run and
495
535
  * the agent is blocking its step loop until the orchestrator resolves the
496
536
  * approval. The orchestrator creates a step-scoped `held_runs` row from the
497
537
  * normalized requirement and replies with `step.approval-resolved` once the
498
538
  * hold is approved, rejected, or expired. The agent keeps heartbeats flowing
499
- * during the wait so it is not reaped as stale.
539
+ * during the wait so it is not reaped as stale. For a `when: 'drift'` gate the
540
+ * request carries the computed drift `payload`.
500
541
  *
501
542
  * NOT fast-pathed — the `log.chunk` / `heartbeat` manual-validator invariant is
502
543
  * untouched by this message.
@@ -515,6 +556,10 @@ export declare const stepApprovalRequestSchema: z.ZodObject<{
515
556
  }, z.core.$strict>]>>;
516
557
  reason: z.ZodString;
517
558
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
559
+ payload: z.ZodOptional<z.ZodObject<{
560
+ summaryMarkdown: z.ZodString;
561
+ drift: z.ZodUnknown;
562
+ }, z.core.$strip>>;
518
563
  }, z.core.$strip>;
519
564
  export type StepApprovalRequest = z.infer<typeof stepApprovalRequestSchema>;
520
565
  /**
@@ -560,6 +605,19 @@ export declare const orchestratorToAgentMessageSchema: z.ZodDiscriminatedUnion<[
560
605
  requestId: z.ZodOptional<z.ZodString>;
561
606
  runPublicKey: z.ZodOptional<z.ZodString>;
562
607
  upstreamJobOutputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
608
+ upstreamJobStatuses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
609
+ skipped: "skipped";
610
+ success: "success";
611
+ pending: "pending";
612
+ running: "running";
613
+ failed: "failed";
614
+ cancelled: "cancelled";
615
+ cancelling: "cancelling";
616
+ queued: "queued";
617
+ recovering: "recovering";
618
+ timed_out_stale: "timed_out_stale";
619
+ drift_dropped: "drift_dropped";
620
+ }>>>;
563
621
  sourceAuth: z.ZodOptional<z.ZodObject<{
564
622
  kind: z.ZodEnum<{
565
623
  basic: "basic";
@@ -923,6 +981,10 @@ export declare const agentToOrchestratorMessageSchema: z.ZodDiscriminatedUnion<[
923
981
  }, z.core.$strict>]>>;
924
982
  reason: z.ZodString;
925
983
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
984
+ payload: z.ZodOptional<z.ZodObject<{
985
+ summaryMarkdown: z.ZodString;
986
+ drift: z.ZodUnknown;
987
+ }, z.core.$strip>>;
926
988
  }, z.core.$strip>], "type">;
927
989
  export type JobDispatch = z.infer<typeof jobDispatchSchema>;
928
990
  export type JobCancel = z.infer<typeof jobCancelSchema>;
@@ -22,10 +22,13 @@ const CacheRefScope = z.enum(["shared", "isolated"]);
22
22
  *
23
23
  * - `jobs` maps an upstream job name to its outputs record.
24
24
  * - `groups` maps a dynamic group name to its ordered member job names.
25
+ * - `statuses` maps an upstream job name to its terminal status, so the
26
+ * generator's `ctx.needs.<job>.status` reflects the frozen upstream outcome.
25
27
  */
26
28
  const upstreamSnapshotSchema = z.object({
27
29
  jobs: z.record(z.string(), z.record(z.string(), z.unknown())),
28
- groups: z.record(z.string(), z.array(z.string()))
30
+ groups: z.record(z.string(), z.array(z.string())),
31
+ statuses: z.record(z.string(), ExecutionJobStatus).optional()
29
32
  });
30
33
  /**
31
34
  * Structured git-clone auth material. Carries everything the agent needs to
@@ -93,6 +96,8 @@ const jobDispatchSchema = z.object({
93
96
  runPublicKey: z.string().optional(),
94
97
  /** Plain outputs from upstream jobs (keyed by job name, then by step name). Populated for downstream jobs with `needs` dependencies. */
95
98
  upstreamJobOutputs: z.record(z.string(), z.record(z.string(), z.unknown())).optional(),
99
+ /** Terminal status of each upstream job (keyed by job name; per-child for fan-out). Powers `ctx.needs.<job>.status`. */
100
+ upstreamJobStatuses: z.record(z.string(), ExecutionJobStatus).optional(),
96
101
  /**
97
102
  * Structured clone auth for the source repo. Preferred over `token` (which
98
103
  * remains as a backward-compat field for same-provider GitHub App flows
@@ -638,12 +643,24 @@ const StepApprovalOutcome = z.enum([
638
643
  "expired"
639
644
  ]);
640
645
  /**
641
- * Agent -> Orchestrator: a step carrying `requireApproval` is about to run and
646
+ * Drift payload carried on a `when: 'drift'` step-approval hold. Captured from
647
+ * the step's check/summarize: `summaryMarkdown` is the author's `summarize(drift)`
648
+ * rendering, `drift` is the structured drift blob. Rendered in the dashboard
649
+ * approval queue + the CLI so the operator sees the computed diff before
650
+ * approving the apply.
651
+ */
652
+ const stepApprovalPayloadSchema = z.object({
653
+ summaryMarkdown: z.string(),
654
+ drift: z.unknown()
655
+ });
656
+ /**
657
+ * Agent -> Orchestrator: a step carrying an `approval` gate is about to run and
642
658
  * the agent is blocking its step loop until the orchestrator resolves the
643
659
  * approval. The orchestrator creates a step-scoped `held_runs` row from the
644
660
  * normalized requirement and replies with `step.approval-resolved` once the
645
661
  * hold is approved, rejected, or expired. The agent keeps heartbeats flowing
646
- * during the wait so it is not reaped as stale.
662
+ * during the wait so it is not reaped as stale. For a `when: 'drift'` gate the
663
+ * request carries the computed drift `payload`.
647
664
  *
648
665
  * NOT fast-pathed — the `log.chunk` / `heartbeat` manual-validator invariant is
649
666
  * untouched by this message.
@@ -657,14 +674,16 @@ const stepApprovalRequestSchema = z.object({
657
674
  stepName: z.string(),
658
675
  /** AND-list of approver clauses (empty = any approval-capable member). */
659
676
  clauses: z.array(approverClauseSchema),
660
- /** Human label for the gate (from the SDK `requireApproval` reason). */
677
+ /** Human label for the gate (from the SDK `approval` reason). */
661
678
  reason: z.string(),
662
679
  /**
663
- * Per-gate timeout override (seconds) from the SDK `requireApproval.timeout`.
680
+ * Per-gate timeout override (seconds) from the SDK `approval.timeout`.
664
681
  * Absent ⇒ the orchestrator uses the org-default `approval_expiry_seconds`.
665
682
  * The orchestrator owns the authoritative `expiresAt` computation.
666
683
  */
667
- timeoutSeconds: z.number().int().positive().optional()
684
+ timeoutSeconds: z.number().int().positive().optional(),
685
+ /** Computed drift payload, present only for `when: 'drift'` gates. */
686
+ payload: stepApprovalPayloadSchema.optional()
668
687
  });
669
688
  /**
670
689
  * Orchestrator -> Agent: resolution of a step-level approval hold. `requestId`
@@ -729,6 +748,6 @@ const agentToOrchestratorMessageSchema = z.discriminatedUnion("type", [
729
748
  stepApprovalRequestSchema
730
749
  ]);
731
750
  //#endregion
732
- export { CacheRefScope, JobRejectReason, StepApprovalOutcome, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, configAckSchema, eventEmitResponseSchema, eventEmitSchema, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetLogsRequestSchema, gitAuthSchema, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobDispatchSchema, jobRejectSchema, jobStatusSchema, orchestratorToAgentMessageSchema, provenanceUploadCompleteSchema, provenanceUploadRequestSchema, provenanceUploadResponseSchema, registerAckSchema, stepApprovalRequestSchema, stepApprovalResolvedSchema, upstreamSnapshotSchema };
751
+ export { CacheRefScope, JobRejectReason, StepApprovalOutcome, agentApiRequestSchema, agentApiResponseSchema, agentAuthFailureSchema, agentAuthRequestSchema, agentAuthSuccessSchema, agentLogChunkSchema, agentMetricsSchema, agentRegisterSchema, agentStatusSchema, agentStepStatusSchema, agentToOrchestratorMessageSchema, cacheUserRestoreRequestSchema, cacheUserRestoreResponseSchema, cacheUserSaveCompleteSchema, cacheUserSaveRequestSchema, cacheUserSaveResponseSchema, configAckSchema, eventEmitResponseSchema, eventEmitSchema, fleetBundleChunkSchema, fleetBundleErrorSchema, fleetLogsRequestSchema, gitAuthSchema, jobAckSchema, jobCancelSchema, jobConcurrencyAckSchema, jobConcurrencyReportSchema, jobDispatchSchema, jobRejectSchema, jobStatusSchema, orchestratorToAgentMessageSchema, provenanceUploadCompleteSchema, provenanceUploadRequestSchema, provenanceUploadResponseSchema, registerAckSchema, stepApprovalPayloadSchema, stepApprovalRequestSchema, stepApprovalResolvedSchema, upstreamSnapshotSchema };
733
752
 
734
753
  //# sourceMappingURL=orchestrator-agent.js.map
@@ -1,7 +1,7 @@
1
1
  import "../../chunk-BTugEXQM.js";
2
2
  import { ExecutionJobStatus } from "./execution-status.js";
3
- import { ScalerEventType } from "./scaler-event.js";
4
3
  import { LabelMatcher } from "../../labels-match.js";
4
+ import { ScalerEventType } from "./scaler-event.js";
5
5
  import { z } from "zod";
6
6
  //#region src/protocol/messages/peer.ts
7
7
  /** Agent summary included in peer heartbeat and auth response messages. */