@kici-dev/orchestrator 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.
- package/dist/agent/dispatcher.d.ts +44 -0
- package/dist/agent/host-roster-reaper.d.ts +2 -1
- package/dist/agent/host-roster.d.ts +57 -3
- package/dist/agent/token-store.d.ts +29 -0
- package/dist/approvals/step-approval-bridge.d.ts +5 -0
- package/dist/cli/commands/source-manifest.d.ts +8 -0
- package/dist/cli/service/compose.d.ts +13 -0
- package/dist/cli/service/deploy-env.d.ts +31 -0
- package/dist/cli.js +687 -219
- package/dist/config.d.ts +6 -0
- package/dist/dashboard/needs-edges.d.ts +4 -3
- package/dist/db/migrations/047_needs_run_on.d.ts +4 -0
- package/dist/db/migrations/048_host_reboot_pending.d.ts +19 -0
- package/dist/db/migrations/049_held_runs_payload.d.ts +14 -0
- package/dist/db/migrations/050_sources_slug.d.ts +17 -0
- package/dist/db/migrations/051_binding_host_pattern.d.ts +18 -0
- package/dist/db/migrations/052_host_reach_metadata.d.ts +19 -0
- package/dist/db/migrations/053_agent_token_single_use.d.ts +17 -0
- package/dist/db/types.d.ts +50 -4
- package/dist/deployment/deployment-identity.d.ts +9 -0
- package/dist/entry-helpers.d.ts +7 -0
- package/dist/environments/binding-store.d.ts +12 -3
- package/dist/environments/held-runs.d.ts +31 -1
- package/dist/github-app-name-refresher/github-app-name-refresher.d.ts +77 -0
- package/dist/index.js +21 -2
- package/dist/metrics/prometheus.d.ts +2 -0
- package/dist/orchestrator-core.d.ts +13 -1
- package/dist/pipeline/decorating-secret-resolver.d.ts +32 -0
- package/dist/pipeline/dispatch-matched-workflow.d.ts +132 -5
- package/dist/pipeline/install-secrets-resolver.d.ts +2 -2
- package/dist/pipeline/needs-scheduler.d.ts +22 -13
- package/dist/pipeline/processor.d.ts +2 -2
- package/dist/pipeline/test-pipeline.d.ts +37 -59
- package/dist/providers/github/manifest.d.ts +25 -0
- package/dist/reporting/log-writer.d.ts +19 -0
- package/dist/routes/admin-sources.d.ts +7 -0
- package/dist/scaler/manager.d.ts +17 -0
- package/dist/secrets/secret-resolver.d.ts +33 -5
- package/dist/server.js +21664 -19907
- package/dist/sources/source-store.d.ts +4 -0
- package/dist/sources/source-validator.d.ts +2 -0
- package/dist/stale-detector/reboot-deadline-sweep.d.ts +29 -0
- package/dist/standalone.js +25263 -24075
- package/dist/ws/agent-handler.d.ts +11 -6
- package/dist/ws/bringup-api.d.ts +76 -0
- package/dist/ws/dashboard-fleet-handler.d.ts +43 -0
- package/dist/ws/dashboard-fleet-write-handler.d.ts +60 -0
- package/dist/ws/fleet-runs-on-all.d.ts +19 -0
- package/dist/ws/platform-client.d.ts +16 -1
- package/dist/ws/test-relay-handlers.d.ts +13 -2
- package/installer-image-digests.json +3 -3
- package/package.json +4 -4
- package/sbom.spdx.json +50 -50
|
@@ -227,12 +227,13 @@ export interface AgentWsHandlerDeps {
|
|
|
227
227
|
reason?: string;
|
|
228
228
|
}>;
|
|
229
229
|
/**
|
|
230
|
-
* Optional callback when an agent blocks
|
|
231
|
-
* creates a step-scoped hold from the carried clauses and
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
* pending resolver when the
|
|
230
|
+
* Optional callback when an agent blocks an `approval` step. The server
|
|
231
|
+
* creates a step-scoped hold from the carried clauses (and the drift
|
|
232
|
+
* `payload` for a `when: 'drift'` gate) and returns a promise that resolves
|
|
233
|
+
* when the hold is approved, rejected, or expired. The handler relays the
|
|
234
|
+
* resolution back to the originating agent as a `step.approval-resolved`
|
|
235
|
+
* message. The `agentId` lets the server drop the pending resolver when the
|
|
236
|
+
* agent disconnects.
|
|
236
237
|
*/
|
|
237
238
|
onStepApproval?: (agentId: string, msg: {
|
|
238
239
|
runId: string;
|
|
@@ -246,6 +247,10 @@ export interface AgentWsHandlerDeps {
|
|
|
246
247
|
}>;
|
|
247
248
|
reason: string;
|
|
248
249
|
timeoutSeconds?: number;
|
|
250
|
+
payload?: {
|
|
251
|
+
summaryMarkdown: string;
|
|
252
|
+
drift: unknown;
|
|
253
|
+
};
|
|
249
254
|
}) => Promise<{
|
|
250
255
|
outcome: 'approved' | 'rejected' | 'expired';
|
|
251
256
|
reason?: string;
|
|
@@ -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
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orchestrator-side handlers for the fleet-management read path (P2).
|
|
3
|
+
*
|
|
4
|
+
* Each handler answers one Platform->orchestrator read-relay request from
|
|
5
|
+
* `HostRosterStore`, returning the canonical `HostInventoryEntry` shape on the
|
|
6
|
+
* wire. The handlers are pure (they take their dependencies as arguments) so
|
|
7
|
+
* the WS wiring in `server.ts` stays a thin adapter and the logic is unit
|
|
8
|
+
* testable without a live DB / Platform connection.
|
|
9
|
+
*/
|
|
10
|
+
import type { Kysely } from 'kysely';
|
|
11
|
+
import type { Database } from '../db/types.js';
|
|
12
|
+
import { HostRosterStore } from '../agent/host-roster.js';
|
|
13
|
+
import type { RegistrationStore } from '../registration/registration-store.js';
|
|
14
|
+
import type { DashboardFleetHostsResponse, DashboardFleetHostResponse, DashboardFleetPreviewResponse, DashboardFleetWorkflowsForHostResponse, LabelMatcher, OnUnreachableMode } from '@kici-dev/engine';
|
|
15
|
+
/** A workflow's resolved runsOnAll predicate, or null when it has none. */
|
|
16
|
+
export interface ResolvedRunsOnAll {
|
|
17
|
+
include: readonly (readonly LabelMatcher[])[];
|
|
18
|
+
exclude: readonly LabelMatcher[];
|
|
19
|
+
onUnreachable: OnUnreachableMode;
|
|
20
|
+
}
|
|
21
|
+
export interface FleetHandlerDeps {
|
|
22
|
+
db: Kysely<Database>;
|
|
23
|
+
rosterStore: HostRosterStore;
|
|
24
|
+
rosterGraceMs: number;
|
|
25
|
+
/** Resolve a workflow's runsOnAll predicate + onUnreachable, or null. */
|
|
26
|
+
resolveRunsOnAll: (workflowName: string) => Promise<ResolvedRunsOnAll | null>;
|
|
27
|
+
/** All registered workflows (for the host-centric workflows-for-host read). */
|
|
28
|
+
registrationStore: RegistrationStore;
|
|
29
|
+
}
|
|
30
|
+
/** Roster: every declared/live host as a `HostInventoryEntry`. */
|
|
31
|
+
export declare function handleFleetHostsRequest(deps: FleetHandlerDeps, requestId: string): Promise<DashboardFleetHostsResponse>;
|
|
32
|
+
/** Host detail: one host (or null) plus its most-recent pinned runs. */
|
|
33
|
+
export declare function handleFleetHostRequest(deps: FleetHandlerDeps, requestId: string, agentId: string): Promise<DashboardFleetHostResponse>;
|
|
34
|
+
/** runsOnAll preview: matched hosts + the fan-out policy + estimated child count. */
|
|
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>;
|
|
43
|
+
//# sourceMappingURL=dashboard-fleet-handler.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { FleetHostDeclareRequest, FleetHostRemoveRequest } from '@kici-dev/engine';
|
|
2
|
+
import type { Kysely } from 'kysely';
|
|
3
|
+
import type { Database } from '../db/types.js';
|
|
4
|
+
import type { HostRosterStore } from '../agent/host-roster.js';
|
|
5
|
+
import type { AccessLogWriter } from '../audit/access-log.js';
|
|
6
|
+
interface DashboardFleetWriteHandlerDeps {
|
|
7
|
+
/** Send a response message back to Platform over the WS connection. */
|
|
8
|
+
send: (msg: unknown) => void;
|
|
9
|
+
/** The orchestrator host roster store (declare / remove). */
|
|
10
|
+
rosterStore: HostRosterStore;
|
|
11
|
+
/** Database — required for dashboard-write policy lookups. */
|
|
12
|
+
db: Kysely<Database>;
|
|
13
|
+
/** Access log writer — records one row per mutation with actor attribution. */
|
|
14
|
+
accessLog?: AccessLogWriter;
|
|
15
|
+
/** Org ID for access_log rows (null when the orchestrator isn't org-scoped). */
|
|
16
|
+
orgId?: string | null;
|
|
17
|
+
/** Routing key for access_log rows (null when not run-scoped). */
|
|
18
|
+
routingKey?: string | null;
|
|
19
|
+
}
|
|
20
|
+
/** Messages this handler owns. */
|
|
21
|
+
type FleetWriteMessage = FleetHostDeclareRequest | FleetHostRemoveRequest;
|
|
22
|
+
/**
|
|
23
|
+
* Handler for the fleet host-write WS messages. Dispatches by type and calls
|
|
24
|
+
* the host roster store behind the dashboard-write policy gate.
|
|
25
|
+
*/
|
|
26
|
+
export declare class DashboardFleetWriteHandler {
|
|
27
|
+
private readonly deps;
|
|
28
|
+
private orgId;
|
|
29
|
+
private routingKey;
|
|
30
|
+
private readonly accessLog;
|
|
31
|
+
constructor(deps: DashboardFleetWriteHandlerDeps);
|
|
32
|
+
/**
|
|
33
|
+
* Update the bound orgId + routingKey. Called from server.ts after resolving
|
|
34
|
+
* the single tenant org from the `sources` / `generic_webhook_sources` table.
|
|
35
|
+
*/
|
|
36
|
+
setOrgContext(orgId: string | null, routingKey: string | null): void;
|
|
37
|
+
/**
|
|
38
|
+
* Defense-in-depth dashboard-write policy gate. Returns true when the
|
|
39
|
+
* operation is allowed and the caller should proceed. Returns false when the
|
|
40
|
+
* policy is disabled — also records a `denied` access_log row and emits a
|
|
41
|
+
* structured `operation_disabled` envelope on the WS.
|
|
42
|
+
*
|
|
43
|
+
* Fails open when no org is bound — the orch hasn't resolved a customer yet.
|
|
44
|
+
*/
|
|
45
|
+
private enforcePolicy;
|
|
46
|
+
/**
|
|
47
|
+
* Write an access_log row for a handler invocation. Best-effort; the writer
|
|
48
|
+
* swallows failures.
|
|
49
|
+
*/
|
|
50
|
+
private recordAccess;
|
|
51
|
+
/**
|
|
52
|
+
* Route a fleet host-write message to the appropriate handler. Returns true
|
|
53
|
+
* if the message was handled, false otherwise.
|
|
54
|
+
*/
|
|
55
|
+
handleMessage(msg: FleetWriteMessage): Promise<boolean>;
|
|
56
|
+
private handleDeclare;
|
|
57
|
+
private handleRemove;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=dashboard-fleet-write-handler.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a workflow's `runsOnAll` host-fan-out predicate from the orchestrator's
|
|
3
|
+
* persisted registrations, for the fleet runsOnAll-preview read path.
|
|
4
|
+
*
|
|
5
|
+
* The orchestrator stores each registered workflow's full lock entry in
|
|
6
|
+
* `workflow_registrations.lock_entry` (JSON). This reader parses that entry,
|
|
7
|
+
* finds the first static job carrying a `runsOnAll` predicate, and returns its
|
|
8
|
+
* `{ include, exclude, onUnreachable }` — or null when no registered workflow of
|
|
9
|
+
* that name declares a host fan-out.
|
|
10
|
+
*/
|
|
11
|
+
import type { Kysely } from 'kysely';
|
|
12
|
+
import { type LockWorkflow } from '@kici-dev/engine';
|
|
13
|
+
import type { Database } from '../db/types.js';
|
|
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;
|
|
17
|
+
/** Find the resolved runsOnAll predicate for a workflow by name, or null. */
|
|
18
|
+
export declare function resolveWorkflowRunsOnAll(db: Kysely<Database>, workflowName: string): Promise<ResolvedRunsOnAll | null>;
|
|
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 JoinRequest, type JoinResponse, type OrchCapabilities, type OrchRole } from '@kici-dev/engine';
|
|
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 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
|
|
@@ -58,6 +58,8 @@ export interface PlatformClientOptions {
|
|
|
58
58
|
mode?: string;
|
|
59
59
|
/** Scaler backends configured (e.g. ["container", "firecracker"]). Sent in source.register for diagnostics. */
|
|
60
60
|
scalerBackends?: string[];
|
|
61
|
+
/** How the orchestrator process was deployed. Sent in source.register so the dashboard can build the correct kici-admin invocation. */
|
|
62
|
+
deployment?: DeploymentIdentity;
|
|
61
63
|
/** Whether this orchestrator has S3 log storage configured. Sent in source.register for pool validation. */
|
|
62
64
|
s3LogAccess?: boolean;
|
|
63
65
|
/** Queue timeout in ms. Sent in source.register for Platform safety-net GC. */
|
|
@@ -134,6 +136,14 @@ export interface PlatformClientOptions {
|
|
|
134
136
|
onDashboardScalerCapacity?: (msg: DashboardScalerCapacityRequest) => void;
|
|
135
137
|
/** Optional callback for dashboard scaler agents requests from Platform. */
|
|
136
138
|
onDashboardScalerAgents?: (msg: DashboardScalerAgentsRequest) => void;
|
|
139
|
+
/** Optional callback for fleet roster requests from Platform. */
|
|
140
|
+
onFleetHosts?: (msg: DashboardFleetHostsRequest) => void;
|
|
141
|
+
/** Optional callback for fleet host-detail requests from Platform. */
|
|
142
|
+
onFleetHost?: (msg: DashboardFleetHostRequest) => void;
|
|
143
|
+
/** Optional callback for fleet runsOnAll-preview requests from Platform. */
|
|
144
|
+
onFleetPreview?: (msg: DashboardFleetPreviewRequest) => void;
|
|
145
|
+
/** Optional callback for fleet workflows-for-host requests from Platform. */
|
|
146
|
+
onFleetWorkflowsForHost?: (msg: DashboardFleetWorkflowsForHostRequest) => void;
|
|
137
147
|
/** Optional callback for trust policy updates pushed from Platform. */
|
|
138
148
|
onTrustPolicyUpdate?: (msg: TrustPolicyUpdate) => void;
|
|
139
149
|
/** Optional callback for stale check run cleanup requests from Platform. */
|
|
@@ -192,6 +202,7 @@ export declare class PlatformClient {
|
|
|
192
202
|
private readonly version?;
|
|
193
203
|
private readonly mode?;
|
|
194
204
|
private readonly scalerBackends?;
|
|
205
|
+
private readonly deployment?;
|
|
195
206
|
private readonly s3LogAccess?;
|
|
196
207
|
private readonly queueTimeoutMs?;
|
|
197
208
|
private readonly heartbeatIntervalMs;
|
|
@@ -216,6 +227,10 @@ export declare class PlatformClient {
|
|
|
216
227
|
private readonly onDashboardDiagnostics?;
|
|
217
228
|
private readonly onDashboardScalerCapacity?;
|
|
218
229
|
private readonly onDashboardScalerAgents?;
|
|
230
|
+
private readonly onFleetHosts?;
|
|
231
|
+
private readonly onFleetHost?;
|
|
232
|
+
private readonly onFleetPreview?;
|
|
233
|
+
private readonly onFleetWorkflowsForHost?;
|
|
219
234
|
private readonly onTrustPolicyUpdate?;
|
|
220
235
|
private readonly onStaleCheckrunCleanup?;
|
|
221
236
|
private readonly onJoinRequest?;
|
|
@@ -16,12 +16,23 @@ import type { Database } from '../db/types.js';
|
|
|
16
16
|
import type { CacheStorage } from '../storage/types.js';
|
|
17
17
|
import type { LogStorage } from '../reporting/log-storage.js';
|
|
18
18
|
import type { AccessLogWriter } from '../audit/access-log.js';
|
|
19
|
-
import {
|
|
19
|
+
import type { ProcessingDeps } from '../pipeline/processor.js';
|
|
20
20
|
/** Dependencies shared by all five test-relay handlers. */
|
|
21
|
-
export interface TestRelayHandlerDeps extends
|
|
21
|
+
export interface TestRelayHandlerDeps extends ProcessingDeps {
|
|
22
22
|
db: Kysely<Database>;
|
|
23
|
+
/** Agent registry — required here: the cancel handler resolves the job's agent. */
|
|
24
|
+
agentRegistry: NonNullable<ProcessingDeps['agentRegistry']>;
|
|
23
25
|
cacheStorage?: CacheStorage;
|
|
24
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
|
+
};
|
|
25
36
|
accessLog?: AccessLogWriter;
|
|
26
37
|
/** Canonical org id this orchestrator is bound to (for access_log attribution). */
|
|
27
38
|
orgId?: string | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.23",
|
|
3
3
|
"images": {
|
|
4
|
-
"kici-agent": "sha256:
|
|
5
|
-
"kici-orchestrator": "sha256:
|
|
4
|
+
"kici-agent": "sha256:f3b4628262e2ec10d9f0a5b8eed54a1361e4a917728b38a0165a144d1f885653",
|
|
5
|
+
"kici-orchestrator": "sha256:240790924ee73e4b1230deb989d3db6c05141ca4db6376baeb88f5e0aeed19ee"
|
|
6
6
|
}
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kici-dev/orchestrator",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
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",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"ws": "^8.21.0",
|
|
87
87
|
"yaml": "^2.9.0",
|
|
88
88
|
"zod": "^4.4.3",
|
|
89
|
-
"@kici-dev/engine": "0.1.
|
|
90
|
-
"@kici-dev/shared": "0.1.
|
|
89
|
+
"@kici-dev/engine": "0.1.23",
|
|
90
|
+
"@kici-dev/shared": "0.1.23"
|
|
91
91
|
},
|
|
92
92
|
"kici": {
|
|
93
93
|
"metrics": {
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@types/archiver": "^8.0.0",
|
|
102
102
|
"@types/dockerode": "^4.0.1",
|
|
103
103
|
"kysely-ctl": "^0.21.0",
|
|
104
|
-
"@kici-dev/agent": "0.1.
|
|
104
|
+
"@kici-dev/agent": "0.1.23"
|
|
105
105
|
},
|
|
106
106
|
"scripts": {
|
|
107
107
|
"build": "node ../../scripts/build-service.mjs && tsc --emitDeclarationOnly",
|