@kici-dev/orchestrator 0.1.22 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/agent/host-roster.d.ts +39 -3
  2. package/dist/agent/token-store.d.ts +33 -0
  3. package/dist/app.d.ts +3 -0
  4. package/dist/cache/pending-inits.d.ts +3 -2
  5. package/dist/cli/api-client.d.ts +8 -0
  6. package/dist/cli/commands/attestations-reverify.d.ts +18 -0
  7. package/dist/cli/commands/attestations.d.ts +3 -0
  8. package/dist/cli/commands/shared/versioned-upgrade.d.ts +52 -0
  9. package/dist/cli.js +2284 -442
  10. package/dist/config.d.ts +2 -0
  11. package/dist/dashboard/attestation-filters.d.ts +70 -0
  12. package/dist/dashboard/handler.d.ts +33 -1
  13. package/dist/db/migrations/051_binding_host_pattern.d.ts +18 -0
  14. package/dist/db/migrations/052_host_reach_metadata.d.ts +19 -0
  15. package/dist/db/migrations/053_agent_token_single_use.d.ts +17 -0
  16. package/dist/db/migrations/054_local_working_tree.d.ts +15 -0
  17. package/dist/db/migrations/055_agent_token_mandatory_labels.d.ts +18 -0
  18. package/dist/db/migrations/056_execution_jobs_environments.d.ts +17 -0
  19. package/dist/db/migrations/057_step_concurrency.d.ts +4 -0
  20. package/dist/db/migrations/058_access_log_agent_label.d.ts +4 -0
  21. package/dist/db/migrations/059_attestation_verdict.d.ts +4 -0
  22. package/dist/db/migrations/060_run_trigger_actor.d.ts +4 -0
  23. package/dist/db/types.d.ts +78 -0
  24. package/dist/environments/binding-store.d.ts +12 -3
  25. package/dist/environments/held-runs.d.ts +24 -0
  26. package/dist/environments/protection/aggregate.d.ts +43 -0
  27. package/dist/environments/protection/satisfiability.d.ts +64 -0
  28. package/dist/index.js +9 -0
  29. package/dist/metrics/prometheus.d.ts +2 -0
  30. package/dist/orchestrator-core.d.ts +8 -0
  31. package/dist/pipeline/dispatch-matched-workflow.d.ts +60 -3
  32. package/dist/pipeline/flatten-lock-steps.d.ts +11 -0
  33. package/dist/pipeline/inline-eval.d.ts +2 -1
  34. package/dist/pipeline/job-environments.d.ts +71 -0
  35. package/dist/pipeline/manual-schedule.d.ts +22 -0
  36. package/dist/pipeline/test-pipeline.d.ts +15 -0
  37. package/dist/provenance/trust-root.d.ts +24 -0
  38. package/dist/provenance/verify-at-ingest.d.ts +24 -0
  39. package/dist/reporting/agent-failure-category.d.ts +27 -0
  40. package/dist/reporting/agent-run-result-mapper.d.ts +13 -0
  41. package/dist/reporting/execution-tracker.d.ts +22 -2
  42. package/dist/reporting/log-writer.d.ts +19 -0
  43. package/dist/reporting/run-aggregator.d.ts +161 -0
  44. package/dist/reporting/step-log-reader.d.ts +39 -0
  45. package/dist/routes/admin-registrations.d.ts +8 -0
  46. package/dist/routes/admin-runs.d.ts +7 -0
  47. package/dist/scaler/manager.d.ts +17 -0
  48. package/dist/secrets/index.d.ts +1 -1
  49. package/dist/secrets/secret-resolver.d.ts +19 -6
  50. package/dist/server.js +21535 -19131
  51. package/dist/standalone.js +26544 -24580
  52. package/dist/storage/loopback-guard.d.ts +49 -0
  53. package/dist/ws/agent-handler.d.ts +15 -1
  54. package/dist/ws/bringup-api.d.ts +76 -0
  55. package/dist/ws/dashboard-fleet-handler.d.ts +11 -1
  56. package/dist/ws/fleet-runs-on-all.d.ts +3 -0
  57. package/dist/ws/platform-client.d.ts +39 -1
  58. package/dist/ws/test-relay-handlers.d.ts +9 -0
  59. package/installer-image-digests.json +3 -3
  60. package/package.json +6 -8
  61. package/sbom.spdx.json +57 -57
  62. package/dist/secrets/crypto.d.ts +0 -49
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Startup guard: an orchestrator that runs non-co-located agents (any scaler
3
+ * backend) must not hand them a loopback storage URL. Loopback is only
4
+ * reachable by a co-located process, so a scaled agent would fail with an
5
+ * opaque ECONNREFUSED. This module detects the misconfiguration so the
6
+ * orchestrator can refuse to start with a clear, actionable error.
7
+ */
8
+ import { ScalerBackendType } from '@kici-dev/engine';
9
+ import type { AppConfig } from '../config.js';
10
+ import type { ScalerConfig } from '../scaler/types.js';
11
+ /**
12
+ * Every current scaler backend places the agent outside the orchestrator's
13
+ * loopback (separate netns, microVM, or host). Only a future co-located/"local"
14
+ * backend would be absent from this set. `kubernetes` is included defensively
15
+ * even though `ScalerEntry.type` excludes it today.
16
+ */
17
+ export declare const NON_COLOCATED_BACKENDS: ReadonlySet<ScalerBackendType>;
18
+ /** True for any host an agent in another netns/VM/host cannot reach. */
19
+ export declare function isLoopbackHost(hostname: string): boolean;
20
+ /**
21
+ * Decide whether an agent-facing storage URL is a loopback address that a
22
+ * non-co-located agent could not reach. Returns a remediation message, or null
23
+ * when the configuration is safe.
24
+ */
25
+ export declare function checkLoopbackAgentEndpoint(input: {
26
+ agentFacingUrl: string | null;
27
+ endpointSource: string;
28
+ fixEnvVar: string;
29
+ scalerBackends: ScalerBackendType[];
30
+ }): {
31
+ message: string;
32
+ } | null;
33
+ /**
34
+ * Resolve the URL an AGENT would use to reach storage, plus the env var an
35
+ * operator would set to fix a loopback misconfiguration. Returns null when the
36
+ * storage backend has no agent-facing URL to validate.
37
+ */
38
+ export declare function resolveAgentFacingStorage(config: AppConfig): {
39
+ url: string | null;
40
+ source: string;
41
+ fixEnvVar: string;
42
+ } | null;
43
+ /**
44
+ * Refuse to start when this orchestrator runs non-co-located agents (any scaler
45
+ * configured) and the agent-facing storage URL is a loopback address. Logs the
46
+ * remediation (so it reaches `kici-admin orchestrator logs`) then throws.
47
+ */
48
+ export declare function assertAgentReachableStorage(config: AppConfig, scalerConfig: ScalerConfig | null): void;
49
+ //# sourceMappingURL=loopback-guard.d.ts.map
@@ -16,7 +16,8 @@
16
16
  * When agentAuthMode === 'none', the auth phase is skipped (legacy behavior).
17
17
  */
18
18
  import type { WSEvents } from 'hono/ws';
19
- import type { RateLimiterConfig } from '@kici-dev/engine';
19
+ import type { RateLimiterConfig, AttestationVerifyStatus } from '@kici-dev/engine';
20
+ import type { ProvenanceTrustRoot } from '../provenance/trust-root.js';
20
21
  import type { AgentRegistry } from '../agent/registry.js';
21
22
  import type { Dispatcher } from '../agent/dispatcher.js';
22
23
  import type { AgentTokenStore } from '../agent/token-store.js';
@@ -98,6 +99,10 @@ export interface AgentWsHandlerDeps {
98
99
  timestamp: number;
99
100
  data?: Record<string, unknown>;
100
101
  secretsAccessed?: string[];
102
+ /** Parallel step-group concurrency role (`sequential` | `parallel-child` | `parallel-group`). */
103
+ concurrencyKind?: string;
104
+ /** Parallel-group correlation id shared by a group's children. */
105
+ groupId?: string;
101
106
  /** Raw log bytes accumulated by this step's LogStreamer at terminal time. */
102
107
  logBytesStreamed?: number;
103
108
  }) => void;
@@ -187,9 +192,15 @@ export interface AgentWsHandlerDeps {
187
192
  * dep so a deployment can decide whether attestations share the cache bucket.
188
193
  */
189
194
  provenanceStorage?: CacheStorage;
195
+ /**
196
+ * Provenance trust root used to verify each bundle at ingest. When absent (or
197
+ * its issuer is null) the verdict is recorded as `unverifiable`.
198
+ */
199
+ provenanceTrustRoot?: ProvenanceTrustRoot;
190
200
  /**
191
201
  * Record a completed provenance-bundle upload (writes an attestations row).
192
202
  * `runId` is resolved server-side from the job's dispatch ref, never the wire.
203
+ * The verdict fields are computed at ingest (verify-at-ingest).
193
204
  */
194
205
  onProvenanceUpload?: (record: {
195
206
  runId: string;
@@ -198,6 +209,9 @@ export interface AgentWsHandlerDeps {
198
209
  subjectDigest: string;
199
210
  storageKey: string;
200
211
  mediaType: string;
212
+ verifyStatus: AttestationVerifyStatus;
213
+ verifyReason: string | null;
214
+ verifiedAt: Date | null;
201
215
  }) => Promise<void>;
202
216
  /** Optional rate limiter configuration. */
203
217
  rateLimiterConfig?: RateLimiterConfig;
@@ -0,0 +1,76 @@
1
+ import { type HostRosterStore } from '../agent/host-roster.js';
2
+ import type { AgentRegistry } from '../agent/registry.js';
3
+ import type { AgentTokenStore } from '../agent/token-store.js';
4
+ import type { SecretResolver } from '../secrets/secret-resolver.js';
5
+ import type { AccessLogWriter } from '../audit/access-log.js';
6
+ /** Bootstrap token TTL: short by design — a leaked token is inert after it. */
7
+ export declare const BOOTSTRAP_TOKEN_TTL_MS: number;
8
+ /** Default pre-boot dropbear/initramfs SSH port for `preBootSend`. */
9
+ export declare const PRE_BOOT_DEFAULT_PORT = 2222;
10
+ /** Default forced command at a dropbear unlock endpoint (ignored by `-c` forces). */
11
+ export declare const PRE_BOOT_DEFAULT_COMMAND = "cryptroot-unlock";
12
+ /** Shared deps for the bring-up handlers. */
13
+ export interface BringupApiDeps {
14
+ registry: AgentRegistry;
15
+ rosterStore: HostRosterStore;
16
+ tokenStore: AgentTokenStore;
17
+ secretResolver: SecretResolver;
18
+ accessLog: AccessLogWriter;
19
+ graceMs: number;
20
+ /** Resolve the orchestrator's tenant org id (single-tenant ⇒ `__default__`). */
21
+ resolveOrgId: () => string;
22
+ /** Resolve the orchestrator WS URL the init-runner should dial. */
23
+ resolveOrchestratorUrl: () => string;
24
+ }
25
+ /**
26
+ * Reach the calling agent connects to + the resolved private key. Returned to
27
+ * the agent so it can run the SSH transport. The key value transits to the ops
28
+ * agent by design (it custodies the bring-up key), exactly as resolved secrets
29
+ * reach an agent at job dispatch.
30
+ */
31
+ export interface BringupReach {
32
+ agentId: string;
33
+ address: string | null;
34
+ sshUser: string | null;
35
+ sshPort: number | null;
36
+ }
37
+ /** Result the agent receives for an `ensureInitRunner` call. */
38
+ export interface EnsureInitRunnerResult {
39
+ broughtUp: boolean;
40
+ reach?: BringupReach;
41
+ privateKey?: string;
42
+ bootstrapToken?: string;
43
+ targetAgentId?: string;
44
+ orchestratorUrl?: string;
45
+ /** The init-runner label set the bootstrap token is bound to. */
46
+ labels?: string[];
47
+ }
48
+ /** Result the agent receives for a `preBootSend` call. */
49
+ export interface PreBootSendResult {
50
+ reach: BringupReach;
51
+ /** The host's bring-up SSH private key — needed to authenticate to dropbear. */
52
+ privateKey: string;
53
+ /** The resolved pre-boot input (e.g. LUKS passphrase) to pipe to the prompt. */
54
+ input: string;
55
+ port: number;
56
+ command: string;
57
+ }
58
+ /** Thrown when the caller lacks `kici:capability:ssh-transport`. */
59
+ export declare class CapabilityDeniedError extends Error {
60
+ constructor(callingAgentId: string);
61
+ }
62
+ /**
63
+ * Build the `kici.ensureInitRunner` handler. No-ops when the target already has
64
+ * a live agent; otherwise gates on the caller's capability, resolves the SSH
65
+ * key, mints a single-use bootstrap token, audits, and returns the material the
66
+ * agent needs to drop + start the init-runner over SSH.
67
+ */
68
+ export declare function createEnsureInitRunnerHandler(deps: BringupApiDeps): (callingAgentId: string, params: Record<string, unknown>) => Promise<EnsureInitRunnerResult>;
69
+ /**
70
+ * Build the `kici.preBootSend` handler. Gates on the caller's capability,
71
+ * resolves the pre-boot input secret (e.g. a LUKS passphrase), audits, and
72
+ * returns the input + reach so the agent can pipe it to the target's pre-boot
73
+ * SSH endpoint.
74
+ */
75
+ export declare function createPreBootSendHandler(deps: BringupApiDeps): (callingAgentId: string, params: Record<string, unknown>) => Promise<PreBootSendResult>;
76
+ //# sourceMappingURL=bringup-api.d.ts.map
@@ -10,7 +10,8 @@
10
10
  import type { Kysely } from 'kysely';
11
11
  import type { Database } from '../db/types.js';
12
12
  import { HostRosterStore } from '../agent/host-roster.js';
13
- import type { DashboardFleetHostsResponse, DashboardFleetHostResponse, DashboardFleetPreviewResponse, LabelMatcher, OnUnreachableMode } from '@kici-dev/engine';
13
+ import type { RegistrationStore } from '../registration/registration-store.js';
14
+ import type { DashboardFleetHostsResponse, DashboardFleetHostResponse, DashboardFleetPreviewResponse, DashboardFleetWorkflowsForHostResponse, LabelMatcher, OnUnreachableMode } from '@kici-dev/engine';
14
15
  /** A workflow's resolved runsOnAll predicate, or null when it has none. */
15
16
  export interface ResolvedRunsOnAll {
16
17
  include: readonly (readonly LabelMatcher[])[];
@@ -23,6 +24,8 @@ export interface FleetHandlerDeps {
23
24
  rosterGraceMs: number;
24
25
  /** Resolve a workflow's runsOnAll predicate + onUnreachable, or null. */
25
26
  resolveRunsOnAll: (workflowName: string) => Promise<ResolvedRunsOnAll | null>;
27
+ /** All registered workflows (for the host-centric workflows-for-host read). */
28
+ registrationStore: RegistrationStore;
26
29
  }
27
30
  /** Roster: every declared/live host as a `HostInventoryEntry`. */
28
31
  export declare function handleFleetHostsRequest(deps: FleetHandlerDeps, requestId: string): Promise<DashboardFleetHostsResponse>;
@@ -30,4 +33,11 @@ export declare function handleFleetHostsRequest(deps: FleetHandlerDeps, requestI
30
33
  export declare function handleFleetHostRequest(deps: FleetHandlerDeps, requestId: string, agentId: string): Promise<DashboardFleetHostResponse>;
31
34
  /** runsOnAll preview: matched hosts + the fan-out policy + estimated child count. */
32
35
  export declare function handleFleetPreviewRequest(deps: FleetHandlerDeps, requestId: string, workflowName: string): Promise<DashboardFleetPreviewResponse>;
36
+ /**
37
+ * workflows-for-host: the host-centric inverse of the preview. Resolves this
38
+ * host's label set once, then tests every registered (non-disabled) workflow's
39
+ * runsOnAll predicate against it, returning each match with the fan-out's
40
+ * `onUnreachable` policy and the host's per-workflow disposition.
41
+ */
42
+ export declare function handleFleetWorkflowsForHostRequest(deps: FleetHandlerDeps, requestId: string, agentId: string): Promise<DashboardFleetWorkflowsForHostResponse>;
33
43
  //# sourceMappingURL=dashboard-fleet-handler.d.ts.map
@@ -9,8 +9,11 @@
9
9
  * that name declares a host fan-out.
10
10
  */
11
11
  import type { Kysely } from 'kysely';
12
+ import { type LockWorkflow } from '@kici-dev/engine';
12
13
  import type { Database } from '../db/types.js';
13
14
  import type { ResolvedRunsOnAll } from './dashboard-fleet-handler.js';
15
+ /** Pull the first static job's runsOnAll predicate from a parsed lock entry, or null. */
16
+ export declare function extractRunsOnAll(workflow: LockWorkflow): ResolvedRunsOnAll | null;
14
17
  /** Find the resolved runsOnAll predicate for a workflow by name, or null. */
15
18
  export declare function resolveWorkflowRunsOnAll(db: Kysely<Database>, workflowName: string): Promise<ResolvedRunsOnAll | null>;
16
19
  //# sourceMappingURL=fleet-runs-on-all.d.ts.map
@@ -1,4 +1,4 @@
1
- import { type OrchestratorToPlatformMessage, type WebhookRelay, type WebhookRelayResult, type TrustPolicyUpdate, type StaleCheckrunCleanup, type DashboardRunDetailRequest, type DashboardRunsListRequest, type DashboardRunsFiltersRequest, type DashboardSourcesListRequest, type DashboardStepLogsRequest, type DashboardAttestationsListRequest, type DashboardOrchLogsRequest, type RunRerunRequest, type ManualScheduleRequest, type RunCancelRequest, type DashboardPayloadRequest, type DashboardPlatformToOrchMessage, type TestRelayRequest, type DashboardDiagnosticsRequest, type DashboardScalerCapacityRequest, type DashboardScalerAgentsRequest, type DashboardFleetHostsRequest, type DashboardFleetHostRequest, type DashboardFleetPreviewRequest, type JoinRequest, type JoinResponse, type DeploymentIdentity, type OrchCapabilities, type OrchRole } from '@kici-dev/engine';
1
+ import { type OrchestratorToPlatformMessage, type WebhookRelay, type WebhookRelayResult, type TrustPolicyUpdate, type StaleCheckrunCleanup, type DashboardRunDetailRequest, type DashboardRunStructuredRequest, type DashboardRunsListRequest, type DashboardRunsFiltersRequest, type DashboardSourcesListRequest, type DashboardStepLogsRequest, type DashboardAttestationsListRequest, type DashboardAttestationsListAllRequest, type DashboardAttestationGetRequest, type DashboardOrchLogsRequest, type RunRerunRequest, type ManualScheduleRequest, type RunCancelRequest, type DashboardPayloadRequest, type DashboardPlatformToOrchMessage, type TestRelayRequest, type DashboardDiagnosticsRequest, type DashboardScalerCapacityRequest, type DashboardScalerAgentsRequest, type DashboardFleetHostsRequest, type DashboardFleetHostRequest, type DashboardFleetPreviewRequest, type DashboardFleetWorkflowsForHostRequest, type JoinRequest, type JoinResponse, type DeploymentIdentity, type OrchCapabilities, type OrchRole } from '@kici-dev/engine';
2
2
  import { RelayBufferRegistry, type RelayStartMeta } from '../webhook/relay-buffer.js';
3
3
  /**
4
4
  * Verification + processing outcome returned by the chunked relay path's
@@ -100,8 +100,16 @@ export interface PlatformClientOptions {
100
100
  orgId: string;
101
101
  clusterId: string | null;
102
102
  }) => void;
103
+ /**
104
+ * Optional callback fired with the provenance trust root (OIDC issuer) the
105
+ * Platform supplies on `auth.success`. The orchestrator uses it to verify
106
+ * provenance bundles at ingest. `null` means provenance is not configured.
107
+ */
108
+ onProvenanceIssuer?: (issuer: string | null) => void;
103
109
  /** Optional callback for dashboard run detail requests from Platform. */
104
110
  onDashboardRunDetail?: (msg: DashboardRunDetailRequest) => void;
111
+ /** Optional callback for dashboard structured run-result requests from Platform. */
112
+ onDashboardRunStructured?: (msg: DashboardRunStructuredRequest) => void;
105
113
  /** Optional callback for dashboard runs.list (operator console) requests from Platform. */
106
114
  onDashboardRunsList?: (msg: DashboardRunsListRequest) => void;
107
115
  /** Optional callback for dashboard runs.filters (operator console) requests from Platform. */
@@ -112,6 +120,10 @@ export interface PlatformClientOptions {
112
120
  onDashboardStepLogs?: (msg: DashboardStepLogsRequest) => void;
113
121
  /** Optional callback for dashboard attestations-list requests from Platform. */
114
122
  onDashboardAttestationsList?: (msg: DashboardAttestationsListRequest) => void;
123
+ /** Optional callback for org-wide attestations list (browser) requests from Platform. */
124
+ onDashboardAttestationsListAll?: (msg: DashboardAttestationsListAllRequest) => void;
125
+ /** Optional callback for single-attestation detail requests from Platform. */
126
+ onDashboardAttestationGet?: (msg: DashboardAttestationGetRequest) => void;
115
127
  /** Optional callback for run re-run requests from Platform (dashboard action). */
116
128
  onRunRerun?: (msg: RunRerunRequest) => void;
117
129
  /** Optional callback for manual schedule trigger requests from Platform (dashboard action). */
@@ -142,6 +154,8 @@ export interface PlatformClientOptions {
142
154
  onFleetHost?: (msg: DashboardFleetHostRequest) => void;
143
155
  /** Optional callback for fleet runsOnAll-preview requests from Platform. */
144
156
  onFleetPreview?: (msg: DashboardFleetPreviewRequest) => void;
157
+ /** Optional callback for fleet workflows-for-host requests from Platform. */
158
+ onFleetWorkflowsForHost?: (msg: DashboardFleetWorkflowsForHostRequest) => void;
145
159
  /** Optional callback for trust policy updates pushed from Platform. */
146
160
  onTrustPolicyUpdate?: (msg: TrustPolicyUpdate) => void;
147
161
  /** Optional callback for stale check run cleanup requests from Platform. */
@@ -165,6 +179,25 @@ export interface PlatformClientOptions {
165
179
  */
166
180
  relayBuffer?: RelayBufferRegistry;
167
181
  }
182
+ /** Error `*.response` frame shape for a dashboard request that failed validation. */
183
+ export interface DashboardRequestErrorFrame {
184
+ type: string;
185
+ requestId: string;
186
+ error: string;
187
+ code: string;
188
+ orchVersion?: string;
189
+ requestType: string;
190
+ }
191
+ /**
192
+ * Build the error `*.response` frame for a dashboard request that failed schema
193
+ * validation, distinguishing a request type this build has never heard of
194
+ * (version mismatch → upgrade the orchestrator) from a known type with a
195
+ * malformed body (genuine client error).
196
+ */
197
+ export declare function classifyDashboardRequestError(raw: {
198
+ type: string;
199
+ requestId: string;
200
+ }, knownTypes: ReadonlySet<string>, orchVersion: string | undefined): DashboardRequestErrorFrame;
168
201
  /**
169
202
  * WebSocket client that connects the orchestrator to the Platform relay.
170
203
  *
@@ -209,12 +242,16 @@ export declare class PlatformClient {
209
242
  private readonly onPeerDiscover?;
210
243
  private readonly onAuthenticated?;
211
244
  private readonly onOrgIdentified?;
245
+ private readonly onProvenanceIssuer?;
212
246
  private readonly onDashboardRunDetail?;
247
+ private readonly onDashboardRunStructured?;
213
248
  private readonly onDashboardRunsList?;
214
249
  private readonly onDashboardRunsFilters?;
215
250
  private readonly onDashboardSourcesList?;
216
251
  private readonly onDashboardStepLogs?;
217
252
  private readonly onDashboardAttestationsList?;
253
+ private readonly onDashboardAttestationsListAll?;
254
+ private readonly onDashboardAttestationGet?;
218
255
  private readonly onRunRerun?;
219
256
  private readonly onManualSchedule?;
220
257
  private readonly onRunCancel?;
@@ -228,6 +265,7 @@ export declare class PlatformClient {
228
265
  private readonly onFleetHosts?;
229
266
  private readonly onFleetHost?;
230
267
  private readonly onFleetPreview?;
268
+ private readonly onFleetWorkflowsForHost?;
231
269
  private readonly onTrustPolicyUpdate?;
232
270
  private readonly onStaleCheckrunCleanup?;
233
271
  private readonly onJoinRequest?;
@@ -24,6 +24,15 @@ export interface TestRelayHandlerDeps extends ProcessingDeps {
24
24
  agentRegistry: NonNullable<ProcessingDeps['agentRegistry']>;
25
25
  cacheStorage?: CacheStorage;
26
26
  logStorage?: LogStorage;
27
+ /**
28
+ * Log writer that owns the in-flight append tracking. The logs cursor
29
+ * handler drains its pending appends for a terminal run before computing the
30
+ * `done` flag, so the final (fire-and-forget) log chunk can't be lost to a
31
+ * race with the run-status transition.
32
+ */
33
+ logWriter?: {
34
+ drain(runId: string): Promise<void>;
35
+ };
27
36
  accessLog?: AccessLogWriter;
28
37
  /** Canonical org id this orchestrator is bound to (for access_log attribution). */
29
38
  orgId?: string | null;
@@ -1,7 +1,7 @@
1
1
  {
2
- "version": "0.1.22",
2
+ "version": "0.1.24",
3
3
  "images": {
4
- "kici-agent": "sha256:7d3b048a45f46f51b843944ce106514094f2aac428ffe3aa35d8a97b174b553f",
5
- "kici-orchestrator": "sha256:98e3b1ef13a3d28844b48ecbfbf26b982fc6fe12292cf138959721c08b48eabe"
4
+ "kici-agent": "sha256:1e02f0cda7f398d72b2e95dd74f9c67fb5a8b041307886ef85a6eae3024c7a4e",
5
+ "kici-orchestrator": "sha256:9aa83c19f39b3f80d62f328af57a38a681670766ed2ec7f46dabecd11e82538b"
6
6
  }
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kici-dev/orchestrator",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
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",
@@ -39,9 +39,6 @@
39
39
  },
40
40
  "main": "dist/index.js",
41
41
  "types": "dist/index.d.ts",
42
- "bin": {
43
- "kici-admin": "./dist/cli.js"
44
- },
45
42
  "exports": {
46
43
  ".": {
47
44
  "import": "./dist/index.js",
@@ -63,7 +60,7 @@
63
60
  "@aws-sdk/client-s3": "^3.1064.0",
64
61
  "@aws-sdk/lib-storage": "^3.1064.0",
65
62
  "@aws-sdk/s3-request-presigner": "^3.1064.0",
66
- "@hono/node-server": "^2.0.4",
63
+ "@hono/node-server": "^1.19.14",
67
64
  "@hono/node-ws": "^1.3.1",
68
65
  "@inquirer/prompts": "^8.5.2",
69
66
  "@octokit/auth-app": "^8.2.0",
@@ -86,8 +83,8 @@
86
83
  "ws": "^8.21.0",
87
84
  "yaml": "^2.9.0",
88
85
  "zod": "^4.4.3",
89
- "@kici-dev/engine": "0.1.22",
90
- "@kici-dev/shared": "0.1.22"
86
+ "@kici-dev/engine": "0.1.24",
87
+ "@kici-dev/shared": "0.1.24"
91
88
  },
92
89
  "kici": {
93
90
  "metrics": {
@@ -100,8 +97,9 @@
100
97
  "devDependencies": {
101
98
  "@types/archiver": "^8.0.0",
102
99
  "@types/dockerode": "^4.0.1",
100
+ "jose": "^6.1.0",
103
101
  "kysely-ctl": "^0.21.0",
104
- "@kici-dev/agent": "0.1.22"
102
+ "@kici-dev/agent": "0.1.24"
105
103
  },
106
104
  "scripts": {
107
105
  "build": "node ../../scripts/build-service.mjs && tsc --emitDeclarationOnly",