@kici-dev/orchestrator 0.1.23 → 0.1.25
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/token-store.d.ts +4 -0
- package/dist/app.d.ts +27 -0
- package/dist/audit/access-log.d.ts +4 -0
- package/dist/cache/pending-inits.d.ts +3 -2
- package/dist/cancel/cancel-run.d.ts +2 -0
- package/dist/cli/api-client.d.ts +10 -0
- package/dist/cli/commands/attestations-list.d.ts +49 -0
- package/dist/cli/commands/attestations-retry.d.ts +28 -0
- package/dist/cli/commands/attestations-reverify.d.ts +18 -0
- package/dist/cli/commands/attestations.d.ts +4 -0
- package/dist/cli/commands/cluster.d.ts +3 -0
- package/dist/cli/commands/shared/versioned-upgrade.d.ts +52 -0
- package/dist/cli/local-github-ingress-url.d.ts +8 -0
- package/dist/cli.js +3308 -1011
- package/dist/cluster/cluster-identity.d.ts +11 -0
- package/dist/cluster/reconcile-identity.d.ts +50 -0
- package/dist/cold-store/load-access-log-range.d.ts +4 -0
- package/dist/config.d.ts +4 -0
- package/dist/dashboard/attestation-filters.d.ts +131 -0
- package/dist/dashboard/handler.d.ts +56 -4
- package/dist/db/migrations/054_local_working_tree.d.ts +15 -0
- package/dist/db/migrations/055_agent_token_mandatory_labels.d.ts +18 -0
- package/dist/db/migrations/056_execution_jobs_environments.d.ts +17 -0
- package/dist/db/migrations/057_step_concurrency.d.ts +4 -0
- package/dist/db/migrations/058_access_log_agent_label.d.ts +4 -0
- package/dist/db/migrations/059_attestation_verdict.d.ts +4 -0
- package/dist/db/migrations/060_run_trigger_actor.d.ts +4 -0
- package/dist/db/migrations/061_execution_runs_environment_id.d.ts +4 -0
- package/dist/db/migrations/062_execution_runs_agent_label.d.ts +4 -0
- package/dist/db/migrations/063_access_log_agent_label_index.d.ts +10 -0
- package/dist/db/migrations/064_execution_jobs_skipped_environments.d.ts +17 -0
- package/dist/db/migrations/065_pending_attestations.d.ts +22 -0
- package/dist/db/migrations/066_pending_attestations_rejected.d.ts +13 -0
- package/dist/db/types.d.ts +113 -0
- package/dist/environments/protection/aggregate.d.ts +43 -0
- package/dist/environments/protection/satisfiability.d.ts +69 -0
- package/dist/events/circuit-breaker.d.ts +8 -5
- package/dist/events/event-router.d.ts +12 -4
- package/dist/events/event-store.d.ts +21 -3
- package/dist/events/trust-store.d.ts +6 -1
- package/dist/events/types.d.ts +6 -1
- package/dist/helpers/rate-limiter.d.ts +17 -2
- package/dist/index.js +11 -1
- package/dist/metrics/prometheus.d.ts +6 -0
- package/dist/orchestrator-core.d.ts +8 -0
- package/dist/pipeline/dispatch-matched-workflow.d.ts +8 -0
- package/dist/pipeline/flatten-lock-steps.d.ts +11 -0
- package/dist/pipeline/inline-eval.d.ts +2 -1
- package/dist/pipeline/job-environments.d.ts +71 -0
- package/dist/pipeline/manual-schedule.d.ts +23 -1
- package/dist/pipeline/process-webhook.d.ts +14 -1
- package/dist/pipeline/rerun.d.ts +1 -1
- package/dist/pipeline/test-pipeline.d.ts +15 -0
- package/dist/provenance/attestation-retrier.d.ts +92 -0
- package/dist/provenance/backfill-run.d.ts +41 -0
- package/dist/provenance/pending-attestations-repo.d.ts +64 -0
- package/dist/provenance/trust-root.d.ts +24 -0
- package/dist/provenance/verify-at-ingest.d.ts +31 -0
- package/dist/reporting/agent-failure-category.d.ts +27 -0
- package/dist/reporting/agent-run-result-mapper.d.ts +13 -0
- package/dist/reporting/execution-tracker.d.ts +38 -6
- package/dist/reporting/run-aggregator.d.ts +165 -0
- package/dist/reporting/step-log-reader.d.ts +39 -0
- package/dist/routes/admin-access-log.d.ts +2 -1
- package/dist/routes/admin-registrations.d.ts +8 -0
- package/dist/routes/admin-runs.d.ts +7 -0
- package/dist/routes/admin.d.ts +14 -0
- package/dist/routes/github-webhook.d.ts +37 -0
- package/dist/routes/health.d.ts +9 -0
- package/dist/routes/webhooks.d.ts +2 -4
- package/dist/secrets/index.d.ts +1 -1
- package/dist/server.js +5326 -2100
- package/dist/sources/source-store.d.ts +6 -0
- package/dist/stale-detector/workflow-deadline-detector.d.ts +25 -0
- package/dist/standalone.js +19787 -17304
- package/dist/storage/loopback-guard.d.ts +49 -0
- package/dist/webhook/dedup.d.ts +14 -0
- package/dist/ws/agent-handler.d.ts +38 -1
- package/dist/ws/oidc-token-relay.d.ts +31 -21
- package/dist/ws/orch-rpc.d.ts +9 -0
- package/dist/ws/platform-client.d.ts +53 -1
- package/dist/ws/test-relay-handlers.d.ts +2 -0
- package/installer-image-digests.json +3 -3
- package/package.json +6 -8
- package/sbom.spdx.json +62 -57
- 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
|
package/dist/webhook/dedup.d.ts
CHANGED
|
@@ -24,6 +24,20 @@ export declare class DedupCache {
|
|
|
24
24
|
* Idempotent -- duplicate marks are silently ignored.
|
|
25
25
|
*/
|
|
26
26
|
mark(deliveryId: string): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Atomically claim a delivery ID. Returns `true` when this call inserted the
|
|
29
|
+
* row (the caller owns this delivery — proceed), `false` when a row already
|
|
30
|
+
* existed (duplicate — drop it).
|
|
31
|
+
*
|
|
32
|
+
* This replaces the historic `exists()`-then-`mark()` check-then-act, which
|
|
33
|
+
* raced across cluster instances: behind an external load balancer, GitHub's
|
|
34
|
+
* own retries and LB retries can fan the same `X-GitHub-Delivery` to two
|
|
35
|
+
* instances concurrently — both passed `exists()` and both dispatched. The
|
|
36
|
+
* single `INSERT … ON CONFLICT (delivery_id) DO NOTHING` is the atomic
|
|
37
|
+
* arbiter backed by the `dedup_cache` primary key, so exactly one caller
|
|
38
|
+
* wins regardless of how many instances receive the same delivery.
|
|
39
|
+
*/
|
|
40
|
+
claim(deliveryId: string): Promise<boolean>;
|
|
27
41
|
/**
|
|
28
42
|
* Remove expired entries from the database.
|
|
29
43
|
* Also trims the in-memory cache to MAX_MEMORY_CACHE_SIZE.
|
|
@@ -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,7 +209,33 @@ 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;
|
|
215
|
+
}) => Promise<void>;
|
|
216
|
+
/**
|
|
217
|
+
* Optional callback when an agent reports a deferred attestation (transient
|
|
218
|
+
* mint failure). Persists the frozen envelope into the deferred-attestation
|
|
219
|
+
* outbox; the job stays green and the token is minted later.
|
|
220
|
+
*/
|
|
221
|
+
onProvenanceDefer?: (record: {
|
|
222
|
+
runId: string;
|
|
223
|
+
jobId: string;
|
|
224
|
+
subjectName: string;
|
|
225
|
+
subjectDigest: string;
|
|
226
|
+
audience: string;
|
|
227
|
+
mediaType: string;
|
|
228
|
+
statementHash: string;
|
|
229
|
+
dsseEnvelope: unknown;
|
|
230
|
+
publicKey: unknown;
|
|
231
|
+
originKind: 'deferred' | 'offline-backfill';
|
|
201
232
|
}) => Promise<void>;
|
|
233
|
+
/**
|
|
234
|
+
* Classify a deferred attestation's origin from the local run row: a run
|
|
235
|
+
* ingested while the Platform was down is `offline-backfill`, otherwise a
|
|
236
|
+
* transient blip is `deferred`. Defaults to always-`deferred` when unset.
|
|
237
|
+
*/
|
|
238
|
+
classifyDeferOrigin?: (runId: string) => Promise<'deferred' | 'offline-backfill'>;
|
|
202
239
|
/** Optional rate limiter configuration. */
|
|
203
240
|
rateLimiterConfig?: RateLimiterConfig;
|
|
204
241
|
/** Optional ownership tracker for validating job-related messages. */
|
|
@@ -4,39 +4,43 @@
|
|
|
4
4
|
* Backs the `oidc.token.request` agent.api method: an agent asks for a
|
|
5
5
|
* short-lived OIDC ID token for a job it is running; the orchestrator verifies
|
|
6
6
|
* the agent owns that job, resolves its runId from its own dispatch state, and
|
|
7
|
-
* relays a mint request to the Platform
|
|
8
|
-
*
|
|
9
|
-
* credentials and never asserts its own identity claims — the Platform
|
|
10
|
-
* every identity claim from its own run/job rows.
|
|
7
|
+
* relays a mint request to the Platform over the authenticated orchestrator↔
|
|
8
|
+
* Platform WebSocket (orchestrator-initiated RPC). The agent never holds
|
|
9
|
+
* Platform credentials and never asserts its own identity claims — the Platform
|
|
10
|
+
* derives every identity claim from its own run/job rows.
|
|
11
11
|
*/
|
|
12
|
-
import { type OidcTokenResult } from '@kici-dev/engine/protocol/messages/oidc-token-relay';
|
|
13
|
-
/**
|
|
12
|
+
import { type OidcTokenResult, type DeferredMintParams } from '@kici-dev/engine/protocol/messages/oidc-token-relay';
|
|
13
|
+
/** rejected: the run/job is missing on the Platform or the job is terminal. */
|
|
14
14
|
export declare class MintRejectedError extends Error {
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
16
|
+
/** unavailable: provenance signing is not configured / the Platform is unavailable. */
|
|
17
17
|
export declare class MintUnavailableError extends Error {
|
|
18
18
|
}
|
|
19
|
-
/** Any other
|
|
19
|
+
/** Any other failure (transport or Platform-side). */
|
|
20
20
|
export declare class MintRelayError extends Error {
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*/
|
|
27
|
-
export declare function deriveHttpBaseFromWsUrl(wsUrl: string): string;
|
|
22
|
+
/** Minimal surface the relay needs from the Platform WS client. */
|
|
23
|
+
export interface MintPlatformClient {
|
|
24
|
+
sendRequestAndAwait<Res>(type: 'oidc.mint.request', payload: Record<string, unknown>, timeoutMs?: number): Promise<Res>;
|
|
25
|
+
}
|
|
28
26
|
export interface RequestMintArgs {
|
|
29
|
-
|
|
30
|
-
token: string;
|
|
27
|
+
platformClient: MintPlatformClient;
|
|
31
28
|
orchestratorId: string;
|
|
32
29
|
runId: string;
|
|
33
30
|
jobId: string;
|
|
34
31
|
audience: string;
|
|
32
|
+
/**
|
|
33
|
+
* Deferred *fulfilment* mint: when set, the request knowingly targets a
|
|
34
|
+
* completed (terminal) job and binds the frozen statement hash + origin so
|
|
35
|
+
* the Platform relaxes its live-job check and stamps the mint-timing marker.
|
|
36
|
+
* The live agent path never sets this.
|
|
37
|
+
*/
|
|
38
|
+
deferred?: DeferredMintParams;
|
|
35
39
|
}
|
|
36
40
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
41
|
+
* Send a mint request over the WS and map the typed response to either a result
|
|
42
|
+
* or one of the three error classes. The user-facing strings are produced here
|
|
43
|
+
* (client-side) so they stay stable regardless of Platform wording.
|
|
40
44
|
*/
|
|
41
45
|
export declare function requestMint(args: RequestMintArgs): Promise<OidcTokenResult>;
|
|
42
46
|
export interface OidcTokenHandlerDeps {
|
|
@@ -45,9 +49,15 @@ export interface OidcTokenHandlerDeps {
|
|
|
45
49
|
runId: string;
|
|
46
50
|
} | undefined;
|
|
47
51
|
};
|
|
48
|
-
|
|
49
|
-
platformHttpBase: string;
|
|
52
|
+
platformClient: MintPlatformClient;
|
|
50
53
|
orchestratorId: string;
|
|
54
|
+
/** Test-only fault-injection master switch (config.testMode). */
|
|
55
|
+
testMode: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Test-only: force-defer the *initial* agent mint for any job requesting this
|
|
58
|
+
* OIDC audience (config.testMintDeferAudience). Ignored unless `testMode`.
|
|
59
|
+
*/
|
|
60
|
+
testMintDeferAudience?: string;
|
|
51
61
|
}
|
|
52
62
|
/**
|
|
53
63
|
* Build the agent.api handler for `OIDC_TOKEN_REQUEST_METHOD`. Validates the
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Platform->orch message types that resolve a pending orch-initiated request. */
|
|
2
|
+
export declare const ORCH_RPC_RESPONSE_TYPES: ReadonlySet<string>;
|
|
3
|
+
export declare class OrchRpcRegistry {
|
|
4
|
+
private readonly pending;
|
|
5
|
+
register(requestId: string, timeoutMs: number): Promise<unknown>;
|
|
6
|
+
resolve(requestId: string, msg: unknown): void;
|
|
7
|
+
rejectAll(err: Error): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=orch-rpc.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 DashboardFleetWorkflowsForHostRequest, 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 DashboardAttestationRetryRequest, 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,11 @@ 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;
|
|
127
|
+
onDashboardAttestationRetry?: (msg: DashboardAttestationRetryRequest) => void;
|
|
115
128
|
/** Optional callback for run re-run requests from Platform (dashboard action). */
|
|
116
129
|
onRunRerun?: (msg: RunRerunRequest) => void;
|
|
117
130
|
/** Optional callback for manual schedule trigger requests from Platform (dashboard action). */
|
|
@@ -167,6 +180,25 @@ export interface PlatformClientOptions {
|
|
|
167
180
|
*/
|
|
168
181
|
relayBuffer?: RelayBufferRegistry;
|
|
169
182
|
}
|
|
183
|
+
/** Error `*.response` frame shape for a dashboard request that failed validation. */
|
|
184
|
+
export interface DashboardRequestErrorFrame {
|
|
185
|
+
type: string;
|
|
186
|
+
requestId: string;
|
|
187
|
+
error: string;
|
|
188
|
+
code: string;
|
|
189
|
+
orchVersion?: string;
|
|
190
|
+
requestType: string;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Build the error `*.response` frame for a dashboard request that failed schema
|
|
194
|
+
* validation, distinguishing a request type this build has never heard of
|
|
195
|
+
* (version mismatch → upgrade the orchestrator) from a known type with a
|
|
196
|
+
* malformed body (genuine client error).
|
|
197
|
+
*/
|
|
198
|
+
export declare function classifyDashboardRequestError(raw: {
|
|
199
|
+
type: string;
|
|
200
|
+
requestId: string;
|
|
201
|
+
}, knownTypes: ReadonlySet<string>, orchVersion: string | undefined): DashboardRequestErrorFrame;
|
|
170
202
|
/**
|
|
171
203
|
* WebSocket client that connects the orchestrator to the Platform relay.
|
|
172
204
|
*
|
|
@@ -195,6 +227,12 @@ export declare class PlatformClient {
|
|
|
195
227
|
* `source.register.ack` arrives, or rejected on timeout / disconnect.
|
|
196
228
|
*/
|
|
197
229
|
private readonly pendingSourceRegistrations;
|
|
230
|
+
/**
|
|
231
|
+
* Generic orchestrator-initiated RPC correlation (e.g. the provenance OIDC
|
|
232
|
+
* mint). The orchestrator sends a `requestId`-keyed request over the WS and
|
|
233
|
+
* awaits the Platform's matching `.response`; rejected on timeout or close.
|
|
234
|
+
*/
|
|
235
|
+
private readonly orchRpc;
|
|
198
236
|
private readonly instanceId?;
|
|
199
237
|
private readonly clusterName?;
|
|
200
238
|
private readonly clusterId?;
|
|
@@ -211,12 +249,17 @@ export declare class PlatformClient {
|
|
|
211
249
|
private readonly onPeerDiscover?;
|
|
212
250
|
private readonly onAuthenticated?;
|
|
213
251
|
private readonly onOrgIdentified?;
|
|
252
|
+
private readonly onProvenanceIssuer?;
|
|
214
253
|
private readonly onDashboardRunDetail?;
|
|
254
|
+
private readonly onDashboardRunStructured?;
|
|
215
255
|
private readonly onDashboardRunsList?;
|
|
216
256
|
private readonly onDashboardRunsFilters?;
|
|
217
257
|
private readonly onDashboardSourcesList?;
|
|
218
258
|
private readonly onDashboardStepLogs?;
|
|
219
259
|
private readonly onDashboardAttestationsList?;
|
|
260
|
+
private readonly onDashboardAttestationsListAll?;
|
|
261
|
+
private readonly onDashboardAttestationGet?;
|
|
262
|
+
private readonly onDashboardAttestationRetry?;
|
|
220
263
|
private readonly onRunRerun?;
|
|
221
264
|
private readonly onManualSchedule?;
|
|
222
265
|
private readonly onRunCancel?;
|
|
@@ -297,6 +340,15 @@ export declare class PlatformClient {
|
|
|
297
340
|
* NOT in the OrchestratorToPlatformMessage union (they are in the separate log pull schema).
|
|
298
341
|
*/
|
|
299
342
|
sendRaw(data: unknown): void;
|
|
343
|
+
/**
|
|
344
|
+
* Send an orchestrator-initiated request over the Platform WS and await its
|
|
345
|
+
* typed `.response`. The reverse of the Platform's dashboard-RPC pattern: we
|
|
346
|
+
* hold the pending map and resolve on the echoed requestId. Rejects on timeout
|
|
347
|
+
* or connection close; protocol-level errors arrive inside the response body.
|
|
348
|
+
* The request type is a member of the typed orch->Platform union, so it rides
|
|
349
|
+
* the validated `send()` path.
|
|
350
|
+
*/
|
|
351
|
+
sendRequestAndAwait<Res>(type: OrchestratorToPlatformMessage['type'], payload: Record<string, unknown>, timeoutMs?: number): Promise<Res>;
|
|
300
352
|
/**
|
|
301
353
|
* Register a new source at runtime (e.g., after config reload adds a new GitHub app).
|
|
302
354
|
* Separate from the post-auth registration which sends all sources at once.
|
|
@@ -58,6 +58,8 @@ export interface TestTriggerPayload {
|
|
|
58
58
|
status: 'accepted' | 'rejected';
|
|
59
59
|
reason?: string;
|
|
60
60
|
jobIds: string[];
|
|
61
|
+
/** User-visible warnings on acceptance (e.g. skipped non-test bound environments). */
|
|
62
|
+
warnings?: string[];
|
|
61
63
|
}
|
|
62
64
|
/**
|
|
63
65
|
* Resolve the overlay tarball URL + decryption keys from the upload record, then
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.24",
|
|
3
3
|
"images": {
|
|
4
|
-
"kici-agent": "sha256:
|
|
5
|
-
"kici-orchestrator": "sha256:
|
|
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.
|
|
3
|
+
"version": "0.1.25",
|
|
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": "^
|
|
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",
|
|
@@ -74,6 +71,7 @@
|
|
|
74
71
|
"dockerode": "^5.0.0",
|
|
75
72
|
"hashi-vault-js": "^0.5.1",
|
|
76
73
|
"hono": "^4.12.25",
|
|
74
|
+
"jose": "^6.1.0",
|
|
77
75
|
"jsonpath-plus": "^10.4.0",
|
|
78
76
|
"jszip": "^3.10.1",
|
|
79
77
|
"kysely": "^0.29.2",
|
|
@@ -86,8 +84,8 @@
|
|
|
86
84
|
"ws": "^8.21.0",
|
|
87
85
|
"yaml": "^2.9.0",
|
|
88
86
|
"zod": "^4.4.3",
|
|
89
|
-
"@kici-dev/engine": "0.1.
|
|
90
|
-
"@kici-dev/shared": "0.1.
|
|
87
|
+
"@kici-dev/engine": "0.1.25",
|
|
88
|
+
"@kici-dev/shared": "0.1.25"
|
|
91
89
|
},
|
|
92
90
|
"kici": {
|
|
93
91
|
"metrics": {
|
|
@@ -101,7 +99,7 @@
|
|
|
101
99
|
"@types/archiver": "^8.0.0",
|
|
102
100
|
"@types/dockerode": "^4.0.1",
|
|
103
101
|
"kysely-ctl": "^0.21.0",
|
|
104
|
-
"@kici-dev/agent": "0.1.
|
|
102
|
+
"@kici-dev/agent": "0.1.25"
|
|
105
103
|
},
|
|
106
104
|
"scripts": {
|
|
107
105
|
"build": "node ../../scripts/build-service.mjs && tsc --emitDeclarationOnly",
|