@kici-dev/orchestrator 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/__test-helpers__/mock-db-query.d.ts +4 -5
  2. package/dist/agent/agent-version.d.ts +5 -5
  3. package/dist/agent/dispatcher.d.ts +26 -0
  4. package/dist/agent/registry.d.ts +7 -9
  5. package/dist/agent-packaging/node-runtime-members.d.ts +14 -0
  6. package/dist/app.d.ts +3 -3
  7. package/dist/approvals/apply-decision.d.ts +1 -1
  8. package/dist/audit/access-log.d.ts +2 -3
  9. package/dist/cli/commands/access-log.d.ts +3 -3
  10. package/dist/cli/commands/agent-service/agent-env.d.ts +20 -0
  11. package/dist/cli/commands/agent-service/status.d.ts +3 -3
  12. package/dist/cli/commands/attestations.d.ts +1 -1
  13. package/dist/cli/commands/context.d.ts +2 -2
  14. package/dist/cli/commands/event-dlq.d.ts +5 -6
  15. package/dist/cli/commands/event-log.d.ts +2 -3
  16. package/dist/cli/commands/execution.d.ts +1 -3
  17. package/dist/cli/commands/orchestrator-service/status.d.ts +10 -3
  18. package/dist/cli/commands/queue.d.ts +1 -2
  19. package/dist/cli/commands/runs.d.ts +2 -3
  20. package/dist/cli/commands/service-health.d.ts +68 -0
  21. package/dist/cli/commands/shared/env-file-mode.d.ts +3 -2
  22. package/dist/cli/commands/shared/upgrade-safety.d.ts +11 -5
  23. package/dist/cli/commands/shared/versioned-upgrade.d.ts +119 -7
  24. package/dist/cli/commands/workflow.d.ts +3 -4
  25. package/dist/cli/open-browser.d.ts +1 -1
  26. package/dist/cli/service/entrypoint.d.ts +18 -0
  27. package/dist/cli/service/image-digests.d.ts +10 -0
  28. package/dist/cli/service/index.d.ts +4 -2
  29. package/dist/cli/service/instance/manifest.d.ts +39 -0
  30. package/dist/cli/service/launchd.d.ts +45 -10
  31. package/dist/cli/service/shutdown-grace.d.ts +35 -0
  32. package/dist/cli/service/types.d.ts +9 -0
  33. package/dist/cli/service/windows-acl.d.ts +40 -0
  34. package/dist/cli/service/windows-env-file.d.ts +45 -0
  35. package/dist/cli/service/windows.d.ts +13 -0
  36. package/dist/cli.js +1620 -551
  37. package/dist/cluster/cluster-identity.d.ts +4 -4
  38. package/dist/cluster/join-token.d.ts +2 -2
  39. package/dist/cluster/leader-gated-scheduler.d.ts +7 -1
  40. package/dist/cluster/peer-credentials.d.ts +1 -1
  41. package/dist/cluster/raft-state.d.ts +6 -0
  42. package/dist/cluster/raft.d.ts +16 -2
  43. package/dist/cold-store/load-access-log-range.d.ts +3 -3
  44. package/dist/cold-store/load-event-log-range.d.ts +1 -1
  45. package/dist/cold-store/load-secret-audit-log-range.d.ts +2 -2
  46. package/dist/cold-store/orchestrator-cold-store.d.ts +9 -11
  47. package/dist/cold-store/tables/access-log.d.ts +2 -2
  48. package/dist/cold-store/tables/event-log.d.ts +4 -10
  49. package/dist/cold-store/tables/execution-jobs.d.ts +1 -1
  50. package/dist/cold-store/tables/execution-runs.d.ts +4 -4
  51. package/dist/cold-store/tables/execution-steps.d.ts +1 -1
  52. package/dist/cold-store/tables/secret-audit-log.d.ts +3 -3
  53. package/dist/config.d.ts +3 -1
  54. package/dist/contexts/held-runs.d.ts +2 -2
  55. package/dist/dashboard/attestation-filters.d.ts +1 -1
  56. package/dist/dashboard/handler.d.ts +8 -8
  57. package/dist/db/deferred-indexes.d.ts +2 -2
  58. package/dist/db/migrations/005_cold_store_chunk_counter.d.ts +2 -4
  59. package/dist/db/migrations/006_runs_jobs_steps_archived_at.d.ts +4 -4
  60. package/dist/db/migrations/007_audit_logs_archived_at.d.ts +6 -9
  61. package/dist/db/migrations/008_event_log_archived_at.d.ts +4 -6
  62. package/dist/db/migrations/010_cold_store_chunks.d.ts +2 -2
  63. package/dist/db/migrations/012_peer_credentials_active_uniq.d.ts +2 -4
  64. package/dist/db/migrations/016_org_settings_allow_http_npm.d.ts +2 -2
  65. package/dist/db/migrations/045_host_properties.d.ts +1 -1
  66. package/dist/db/migrations/046_join_token_consumed_by_instance.d.ts +1 -1
  67. package/dist/db/migrations/048_host_reboot_pending.d.ts +1 -1
  68. package/dist/db/migrations/049_held_runs_payload.d.ts +1 -1
  69. package/dist/db/migrations/050_sources_slug.d.ts +1 -1
  70. package/dist/db/migrations/051_binding_host_pattern.d.ts +1 -1
  71. package/dist/db/migrations/052_host_reach_metadata.d.ts +1 -1
  72. package/dist/db/migrations/053_agent_token_single_use.d.ts +1 -1
  73. package/dist/db/migrations/054_local_working_tree.d.ts +1 -1
  74. package/dist/db/migrations/055_agent_token_mandatory_labels.d.ts +1 -1
  75. package/dist/db/migrations/056_execution_jobs_environments.d.ts +1 -1
  76. package/dist/db/migrations/064_execution_jobs_skipped_environments.d.ts +1 -1
  77. package/dist/db/types.d.ts +12 -13
  78. package/dist/events/types.d.ts +1 -1
  79. package/dist/fault-injection-types.d.ts +2 -2
  80. package/dist/firecracker/host-network.d.ts +21 -3
  81. package/dist/firecracker/net-interfaces.d.ts +1 -1
  82. package/dist/helpers/run-detached.d.ts +12 -0
  83. package/dist/index.js +50 -14
  84. package/dist/oidc/db-signer.d.ts +1 -1
  85. package/dist/pipeline/global-eval-round.d.ts +2 -2
  86. package/dist/pipeline/processor.d.ts +2 -2
  87. package/dist/provenance/retrier-mint.d.ts +1 -1
  88. package/dist/provenance/trust-root.d.ts +3 -3
  89. package/dist/providers/universal-git/clone-token.d.ts +9 -13
  90. package/dist/providers/universal-git/index.d.ts +1 -2
  91. package/dist/providers/universal-git/normalizer.d.ts +2 -3
  92. package/dist/providers/universal-git/ssh-auth.d.ts +4 -4
  93. package/dist/queue/cleanup.d.ts +2 -2
  94. package/dist/queue/job-queue.d.ts +6 -6
  95. package/dist/queue/scheduled-job.d.ts +5 -7
  96. package/dist/registration/extractor.d.ts +1 -1
  97. package/dist/registration/registration-index.d.ts +1 -1
  98. package/dist/reporting/execution-tracker.d.ts +3 -3
  99. package/dist/routes/admin-access-log.d.ts +1 -1
  100. package/dist/routes/admin-auth.d.ts +2 -2
  101. package/dist/routes/admin-event-log.d.ts +2 -2
  102. package/dist/routes/admin-runs.d.ts +3 -3
  103. package/dist/routes/admin-scheduled-jobs.d.ts +2 -3
  104. package/dist/routes/health.d.ts +9 -0
  105. package/dist/scaler/container-backend.d.ts +1 -1
  106. package/dist/scaler/firecracker-backend.d.ts +15 -10
  107. package/dist/scaler/firecracker-extra-hosts.d.ts +20 -0
  108. package/dist/scaler/machine-ledger.d.ts +3 -4
  109. package/dist/scaler/scaler-state-store.d.ts +1 -1
  110. package/dist/scaler/types.d.ts +4 -1
  111. package/dist/secrets/audit-logger.d.ts +2 -2
  112. package/dist/security/reduced-privilege-note.d.ts +2 -3
  113. package/dist/security/trust-policy-store.d.ts +3 -3
  114. package/dist/server.d.ts +2 -1
  115. package/dist/server.js +2736 -2211
  116. package/dist/stale-detector/stale-run-detector.d.ts +1 -1
  117. package/dist/standalone.d.ts +1 -1
  118. package/dist/standalone.js +2105 -1629
  119. package/dist/storage/filesystem.d.ts +1 -1
  120. package/dist/storage/index.d.ts +1 -1
  121. package/dist/storage/sign-url.d.ts +2 -1
  122. package/dist/storage/types.d.ts +2 -2
  123. package/dist/ws/agent-handler.d.ts +34 -3
  124. package/dist/ws/agent-heartbeat.d.ts +2 -3
  125. package/dist/ws/dashboard-context-handler.d.ts +1 -1
  126. package/dist/ws/platform-client.d.ts +44 -32
  127. package/dist/ws/server-options.d.ts +1 -1
  128. package/dist/ws/test-relay-handlers.d.ts +1 -1
  129. package/installer-image-digests.json +3 -3
  130. package/package.json +4 -4
  131. package/sbom.spdx.json +53 -53
@@ -6,7 +6,7 @@
6
6
  * are replaced by HMAC-signed `http://<orchUrl>/api/v1/cache/blob/...` URLs
7
7
  * — see `sign-url.ts` for the token mechanics and `app.ts` for the route.
8
8
  *
9
- * Intended for single-host deployments and E2E sandboxes where standing up
9
+ * Intended for single-host deployments and test sandboxes where standing up
10
10
  * an S3-compatible service is overkill. Production should still use S3.
11
11
  *
12
12
  * Metadata is co-located as a sibling JSON file (`<key>.meta.json`) so the
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Pluggable storage backends:
5
5
  * - S3CacheStorage — production / multi-host
6
- * - FilesystemCacheStorage — single-host / E2E sandbox
6
+ * - FilesystemCacheStorage — single-host / test sandbox
7
7
  *
8
8
  * Use createCacheStorage() to instantiate from a discriminated config.
9
9
  */
@@ -10,7 +10,8 @@
10
10
  * Signature input: `${method}:${key}:${expiresUnixMs}` with HMAC-SHA256 keyed
11
11
  * by a per-orchestrator-process secret (random 32-byte hex at boot, persists
12
12
  * for the lifetime of the process). Tokens become invalid on orchestrator
13
- * restart — fine for the filesystem backend's E2E / single-host use case.
13
+ * restart — fine for the filesystem backend's single-host / test-sandbox use
14
+ * case.
14
15
  */
15
16
  /** Default URL lifetime: 1 hour (matches S3 backend's PUT-URL lifetime). */
16
17
  export declare const DEFAULT_SIGN_URL_TTL_MS: number;
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Backends:
9
9
  * - `S3CacheStorage` for production / multi-host deployments
10
- * - `FilesystemCacheStorage` for single-host / E2E sandboxes
10
+ * - `FilesystemCacheStorage` for single-host / test sandboxes
11
11
  */
12
12
  /**
13
13
  * Metadata tracked alongside each cached item.
@@ -119,7 +119,7 @@ export type S3CacheStorageConfig = SharedS3Config & {
119
119
  * mints HMAC-signed `http://baseUrl<routePrefix>...` URLs that the
120
120
  * orchestrator's `/api/v1/cache/blob/*` route verifies before serving.
121
121
  *
122
- * Intended for single-host / E2E sandboxes where standing up an
122
+ * Intended for single-host / test sandboxes where standing up an
123
123
  * S3-compatible service is overkill.
124
124
  */
125
125
  export interface FilesystemCacheStorageConfig {
@@ -19,7 +19,7 @@
19
19
  * frame is accepted there and answered with auth.success without reading the
20
20
  * token, and the agent then registers as normal.
21
21
  */
22
- import type { WSEvents } from 'hono/ws';
22
+ import type { WSContext, WSEvents, WSMessageReceive } from 'hono/ws';
23
23
  import { LogStream } from '@kici-dev/engine';
24
24
  import type { RateLimiterConfig, AttestationVerifyStatus } from '@kici-dev/engine';
25
25
  import type { ProvenanceTrustRoot } from '../provenance/trust-root.js';
@@ -74,6 +74,26 @@ import type { FleetAgentCollector } from './fleet-agent-collector.js';
74
74
  * trailing partial multi-byte char.
75
75
  */
76
76
  export declare function truncateCloseReason(reason: string): string;
77
+ /** What a failed frame is about, for the failure log. */
78
+ export interface FrameIdentity {
79
+ messageType?: string;
80
+ agentId?: string;
81
+ runId?: string;
82
+ jobId?: string;
83
+ }
84
+ /**
85
+ * Read the type and ids from a raw agent frame, for logging a failure. Only
86
+ * string fields are copied, each capped at 128 characters; anything that is
87
+ * not a JSON object yields nothing. Runs on the failure path only.
88
+ */
89
+ export declare function frameIdentity(data: unknown): FrameIdentity;
90
+ /**
91
+ * The agent WebSocket handler. `onMessage` resolves once the frame is handled
92
+ * and never rejects: the WebSocket server does not await it.
93
+ */
94
+ export interface AgentWsEvents extends Omit<WSEvents, 'onMessage'> {
95
+ onMessage(evt: MessageEvent<WSMessageReceive>, ws: WSContext): Promise<void>;
96
+ }
77
97
  export interface AgentWsHandlerDeps {
78
98
  registry: AgentRegistry;
79
99
  dispatcher: Dispatcher;
@@ -383,7 +403,6 @@ export interface AgentWsHandlerDeps {
383
403
  * SYNC INVARIANT: This manual validator MUST match the Zod schema
384
404
  * `agentLogChunkSchema` in packages/engine/src/protocol/messages/orchestrator-agent.ts.
385
405
  * If you change the schema, update this validator in the same commit.
386
- * See CLAUDE.md rule: "Zod fast-path sync invariant".
387
406
  */
388
407
  export declare function isValidLogChunk(raw: unknown): raw is {
389
408
  type: 'log.chunk';
@@ -405,5 +424,17 @@ export interface AgentLogChunkInput {
405
424
  /** Absent when the agent does not report a stream; read as `stdout`. */
406
425
  stream?: LogStream;
407
426
  }
408
- export declare function createAgentWsHandler(deps: AgentWsHandlerDeps): WSEvents;
427
+ /**
428
+ * Create a Hono WS event handler for agent connections.
429
+ *
430
+ * Flow:
431
+ * 1. onOpen: start 10-second register timer
432
+ * 2. First onMessage: must be agent.register with labels and capacity
433
+ * 3. Subsequent onMessage: validated against protocol schemas, routed by type
434
+ * 4. onClose: cleanup from pending registration or dispatcher
435
+ *
436
+ * A frame whose handling fails is logged with its type and ids; the
437
+ * connection stays open.
438
+ */
439
+ export declare function createAgentWsHandler(deps: AgentWsHandlerDeps): AgentWsEvents;
409
440
  //# sourceMappingURL=agent-handler.d.ts.map
@@ -5,9 +5,8 @@
5
5
  * - Logs warnings for agents past the unhealthy threshold (90s).
6
6
  * - Forcibly disconnects agents past the disconnect threshold (180s).
7
7
  *
8
- * Follows the same pattern as the Platform HeartbeatMonitor
9
- * (packages/platform/src/ws/heartbeat.ts) for consistency across
10
- * the three-tier architecture.
8
+ * Follows the same pattern as the Platform's heartbeat monitor, for
9
+ * consistency across the three-tier architecture.
11
10
  */
12
11
  import type { AgentRegistry } from '../agent/registry.js';
13
12
  import type { Dispatcher } from '../agent/dispatcher.js';
@@ -67,7 +67,7 @@ export interface DashboardContextHandlerDeps {
67
67
  /** Dependencies enabling the resolver-backed approve/reject + resume path. */
68
68
  export interface ApprovalHandlerDeps {
69
69
  store: HeldRunStore;
70
- /** Team name → member user ids (Plan-1 trust-policy cache). */
70
+ /** Team name → member user ids (trust-policy cache). */
71
71
  teamMembershipLookup: TeamMembershipLookup;
72
72
  /** Re-dispatch a released job hold (consumes its pending context). */
73
73
  resumeJob: (signal: ReleaseSignal) => Promise<void>;
@@ -51,6 +51,12 @@ import type { ProviderSource } from '../entry-helpers.js';
51
51
  * is exactly the pair that drifts.
52
52
  */
53
53
  export declare const ADMITTED_PIPELINE_LIFETIME_MS: number;
54
+ /**
55
+ * A handler for one Platform frame. It may be async: the client runs it
56
+ * through {@link PlatformClient.runFrameHandler}, which logs a failure and
57
+ * keeps the connection.
58
+ */
59
+ export type FrameHandler<M> = (msg: M) => void | Promise<void>;
54
60
  export interface PlatformClientOptions {
55
61
  /** WebSocket URL of the Platform relay. */
56
62
  url: string;
@@ -99,14 +105,14 @@ export interface PlatformClientOptions {
99
105
  /** Maximum event buffer size. Default: 10000. */
100
106
  maxBufferSize?: number;
101
107
  /** Optional callback for log pull requests from Platform. */
102
- onLogPullRequest?: (msg: {
108
+ onLogPullRequest?: FrameHandler<{
103
109
  messageId: string;
104
110
  executionId: string;
105
111
  jobName?: string;
106
112
  stepIndex?: number;
107
113
  cursor?: number;
108
114
  limit?: number;
109
- }) => void;
115
+ }>;
110
116
  /** Optional callback for peer discovery (from Platform matchmaker). */
111
117
  onPeerDiscover?: (peer: {
112
118
  connectionId: string;
@@ -116,7 +122,7 @@ export interface PlatformClientOptions {
116
122
  orchRole?: OrchRole;
117
123
  }) => void;
118
124
  /** Optional callback invoked after successful authentication and source registration. */
119
- onAuthenticated?: () => void;
125
+ onAuthenticated?: () => void | Promise<void>;
120
126
  /**
121
127
  * Returns this coordinator's currently-connected worker peers for the
122
128
  * `cluster.membership` snapshot. Undefined on a non-coordinator (or when
@@ -156,66 +162,66 @@ export interface PlatformClientOptions {
156
162
  */
157
163
  onProvenanceIssuer?: (issuer: string | null) => void;
158
164
  /** Optional callback for dashboard run detail requests from Platform. */
159
- onDashboardRunDetail?: (msg: DashboardRunDetailRequest) => void;
165
+ onDashboardRunDetail?: FrameHandler<DashboardRunDetailRequest>;
160
166
  /** Optional callback for dashboard structured run-result requests from Platform. */
161
- onDashboardRunStructured?: (msg: DashboardRunStructuredRequest) => void;
167
+ onDashboardRunStructured?: FrameHandler<DashboardRunStructuredRequest>;
162
168
  /** Optional callback for the run-state system reconciliation read from Platform. */
163
- onDashboardRunState?: (msg: DashboardRunStateRequest) => void;
169
+ onDashboardRunState?: FrameHandler<DashboardRunStateRequest>;
164
170
  /** Optional callback for dashboard runs.list (operator console) requests from Platform. */
165
- onDashboardRunsList?: (msg: DashboardRunsListRequest) => void;
171
+ onDashboardRunsList?: FrameHandler<DashboardRunsListRequest>;
166
172
  /** Optional callback for dashboard runs.filters (operator console) requests from Platform. */
167
- onDashboardRunsFilters?: (msg: DashboardRunsFiltersRequest) => void;
173
+ onDashboardRunsFilters?: FrameHandler<DashboardRunsFiltersRequest>;
168
174
  /** Optional callback for dashboard sources.list (operator console) requests from Platform. */
169
- onDashboardSourcesList?: (msg: DashboardSourcesListRequest) => void;
175
+ onDashboardSourcesList?: FrameHandler<DashboardSourcesListRequest>;
170
176
  /** Optional callback for dashboard admin-tokens.list (RBAC drift report) requests from Platform. */
171
- onDashboardAdminTokensList?: (msg: DashboardAdminTokensListRequest) => void;
177
+ onDashboardAdminTokensList?: FrameHandler<DashboardAdminTokensListRequest>;
172
178
  /** Optional callback for dashboard step logs requests from Platform. */
173
- onDashboardStepLogs?: (msg: DashboardStepLogsRequest) => void;
179
+ onDashboardStepLogs?: FrameHandler<DashboardStepLogsRequest>;
174
180
  /** Optional callback for dashboard attestations-list requests from Platform. */
175
- onDashboardAttestationsList?: (msg: DashboardAttestationsListRequest) => void;
181
+ onDashboardAttestationsList?: FrameHandler<DashboardAttestationsListRequest>;
176
182
  /** Optional callback for org-wide attestations list (browser) requests from Platform. */
177
- onDashboardAttestationsListAll?: (msg: DashboardAttestationsListAllRequest) => void;
183
+ onDashboardAttestationsListAll?: FrameHandler<DashboardAttestationsListAllRequest>;
178
184
  /** Optional callback for single-attestation detail requests from Platform. */
179
- onDashboardAttestationGet?: (msg: DashboardAttestationGetRequest) => void;
180
- onDashboardAttestationRetry?: (msg: DashboardAttestationRetryRequest) => void;
185
+ onDashboardAttestationGet?: FrameHandler<DashboardAttestationGetRequest>;
186
+ onDashboardAttestationRetry?: FrameHandler<DashboardAttestationRetryRequest>;
181
187
  /** Optional callback for dashboard artifacts-list requests from Platform. */
182
- onDashboardArtifactsList?: (msg: DashboardArtifactsListRequest) => void;
188
+ onDashboardArtifactsList?: FrameHandler<DashboardArtifactsListRequest>;
183
189
  /** Optional callback for run re-run requests from Platform (dashboard action). */
184
- onRunRerun?: (msg: RunRerunRequest) => void;
190
+ onRunRerun?: FrameHandler<RunRerunRequest>;
185
191
  /** Optional callback for manual schedule trigger requests from Platform (dashboard action). */
186
- onManualSchedule?: (msg: ManualScheduleRequest) => void;
192
+ onManualSchedule?: FrameHandler<ManualScheduleRequest>;
187
193
  /** Optional callback for run cancel requests from Platform (dashboard action). */
188
- onRunCancel?: (msg: RunCancelRequest) => void;
194
+ onRunCancel?: FrameHandler<RunCancelRequest>;
189
195
  /** Optional callback for dashboard payload requests from Platform. */
190
- onDashboardPayload?: (msg: DashboardPayloadRequest) => void;
196
+ onDashboardPayload?: FrameHandler<DashboardPayloadRequest>;
191
197
  /** Optional callback for dashboard orchestration logs requests from Platform. */
192
- onDashboardOrchLogs?: (msg: DashboardOrchLogsRequest) => void;
198
+ onDashboardOrchLogs?: FrameHandler<DashboardOrchLogsRequest>;
193
199
  /** Optional callback for dashboard environment/held-run messages from Platform. */
194
- onDashboardEnvMessage?: (msg: DashboardPlatformToOrchMessage) => void;
200
+ onDashboardEnvMessage?: FrameHandler<DashboardPlatformToOrchMessage>;
195
201
  /**
196
202
  * Optional callback for Platform-first `kici run remote` control-plane relay
197
203
  * requests (upload-init, trigger, status, logs, cancel). The handler performs
198
204
  * the action and replies over the WS keyed by `requestId`.
199
205
  */
200
- onTestRelay?: (msg: TestRelayRequest) => void;
206
+ onTestRelay?: FrameHandler<TestRelayRequest>;
201
207
  /** Optional callback for dashboard diagnostics requests from Platform. */
202
- onDashboardDiagnostics?: (msg: DashboardDiagnosticsRequest) => void;
208
+ onDashboardDiagnostics?: FrameHandler<DashboardDiagnosticsRequest>;
203
209
  /** Optional callback for dashboard scaler capacity requests from Platform. */
204
- onDashboardScalerCapacity?: (msg: DashboardScalerCapacityRequest) => void;
210
+ onDashboardScalerCapacity?: FrameHandler<DashboardScalerCapacityRequest>;
205
211
  /** Optional callback for dashboard scaler agents requests from Platform. */
206
- onDashboardScalerAgents?: (msg: DashboardScalerAgentsRequest) => void;
212
+ onDashboardScalerAgents?: FrameHandler<DashboardScalerAgentsRequest>;
207
213
  /** Optional callback for fleet roster requests from Platform. */
208
- onFleetHosts?: (msg: DashboardFleetHostsRequest) => void;
214
+ onFleetHosts?: FrameHandler<DashboardFleetHostsRequest>;
209
215
  /** Optional callback for fleet host-detail requests from Platform. */
210
- onFleetHost?: (msg: DashboardFleetHostRequest) => void;
216
+ onFleetHost?: FrameHandler<DashboardFleetHostRequest>;
211
217
  /** Optional callback for fleet runsOnAll-preview requests from Platform. */
212
- onFleetPreview?: (msg: DashboardFleetPreviewRequest) => void;
218
+ onFleetPreview?: FrameHandler<DashboardFleetPreviewRequest>;
213
219
  /** Optional callback for fleet workflows-for-host requests from Platform. */
214
- onFleetWorkflowsForHost?: (msg: DashboardFleetWorkflowsForHostRequest) => void;
220
+ onFleetWorkflowsForHost?: FrameHandler<DashboardFleetWorkflowsForHostRequest>;
215
221
  /** Optional callback for trust policy updates pushed from Platform. */
216
- onTrustPolicyUpdate?: (msg: TrustPolicyUpdate) => void;
222
+ onTrustPolicyUpdate?: FrameHandler<TrustPolicyUpdate>;
217
223
  /** Optional callback for stale check run cleanup requests from Platform. */
218
- onStaleCheckrunCleanup?: (msg: StaleCheckrunCleanup) => void;
224
+ onStaleCheckrunCleanup?: FrameHandler<StaleCheckrunCleanup>;
219
225
  /** Optional callback for join requests relayed via Platform. */
220
226
  onJoinRequest?: (msg: JoinRequest) => Promise<JoinResponse>;
221
227
  /** Custom orchestrator capabilities to merge with ORCH_CAPABILITIES in auth.request. */
@@ -540,6 +546,12 @@ export declare class PlatformClient {
540
546
  * not a recognisable dashboard request (let the caller log a warning).
541
547
  */
542
548
  private respondToInvalidDashboardRequest;
549
+ /**
550
+ * Run the handler for one Platform frame. Nothing awaits a frame, so a throw
551
+ * or a rejection is logged with the frame's type and request id and the
552
+ * connection carries on; left unhandled it would stop the orchestrator.
553
+ */
554
+ private runFrameHandler;
543
555
  /**
544
556
  * Dispatch a parsed platform message to the appropriate per-area
545
557
  * handler. Each `case` either inlines a tiny dispatch (for one-line
@@ -6,7 +6,7 @@ import type { WebSocketServer } from 'ws';
6
6
  * here so it is unit-testable independently of the heavy `createApp` dependency
7
7
  * graph.
8
8
  *
9
- * The (`permessage-deflate` compression bombs) invariant lives here: any
9
+ * The `permessage-deflate` compression-bomb invariant lives here: any
10
10
  * field added to defend against compression-bomb DoS — `maxPayload`,
11
11
  * `serverNoContextTakeover`, etc. — MUST be set inside this helper so the
12
12
  * neighbouring test file can assert it.
@@ -118,7 +118,7 @@ export interface TestRunLogsPayload {
118
118
  }
119
119
  /**
120
120
  * Return the next chunk of a run's logs from a monotonic line-offset cursor
121
- * (spec §13a). The orchestrator concatenates every log line in a deterministic
121
+ * The orchestrator concatenates every log line in a deterministic
122
122
  * `(jobName ASC, stepIndex ASC, lineIndex ASC)` order; `cursor` is the count of
123
123
  * lines already delivered. `done` is true only when the run is terminal AND the
124
124
  * cursor has reached the end (the final tail-draining poll). A poll mid-step
@@ -1,7 +1,7 @@
1
1
  {
2
- "version": "0.11.0",
2
+ "version": "0.12.0",
3
3
  "images": {
4
- "kici-agent": "sha256:3a7a387964836acf6f89bdd31a4ee285383349926db21ef90d43905a5bce1dd4",
5
- "kici-orchestrator": "sha256:8ee2909b622f813348506589c25b8b7d4ef2333604e1bc919e15016304822a27"
4
+ "kici-agent": "sha256:eaa1d2270da370f150b149dbf51569b51759d7b62607fe6a1cee8b01babac2e9",
5
+ "kici-orchestrator": "sha256:a1a73e458b0cda327e534b74ba02406fb64170d61a3de34bfbfa8c42ab75d087"
6
6
  }
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kici-dev/orchestrator",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Customer-deployable orchestrator for the KiCI CI/CD stack. Receives webhook events (direct or via Platform relay), matches triggers against the lock file, and dispatches jobs to connected agents.",
5
5
  "keywords": [
6
6
  "ci",
@@ -90,8 +90,8 @@
90
90
  "ws": "^8.21.3",
91
91
  "yaml": "^2.9.1",
92
92
  "zod": "^4.6.5",
93
- "@kici-dev/engine": "0.11.0",
94
- "@kici-dev/shared": "0.11.0"
93
+ "@kici-dev/engine": "0.12.0",
94
+ "@kici-dev/shared": "0.12.0"
95
95
  },
96
96
  "kici": {
97
97
  "metrics": {
@@ -106,7 +106,7 @@
106
106
  "@types/dockerode": "^4.0.1",
107
107
  "@types/ws": "^8.18.1",
108
108
  "kysely-ctl": "^0.21.0",
109
- "@kici-dev/agent": "0.11.0"
109
+ "@kici-dev/agent": "0.12.0"
110
110
  },
111
111
  "scripts": {
112
112
  "build": "node ../../scripts/build-service.mjs && tsc --emitDeclarationOnly",