@kici-dev/orchestrator 0.15.0 → 0.17.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.
- package/dist/__test-helpers__/scratch-db.d.ts +16 -0
- package/dist/agent/registry.d.ts +1 -8
- package/dist/app-on-error.d.ts +1 -1
- package/dist/approvals/apply-decision.d.ts +12 -1
- package/dist/artifacts/artifact-store.d.ts +0 -2
- package/dist/audit/access-log.d.ts +1 -1
- package/dist/cache/source-cache.d.ts +1 -1
- package/dist/cache/user-cache.d.ts +0 -28
- package/dist/cli/api-client.d.ts +35 -1
- package/dist/cli/commands/access-log.d.ts +1 -1
- package/dist/cli/commands/api-key.d.ts +11 -4
- package/dist/cli/commands/cold-store-impl.d.ts +7 -84
- package/dist/cli/commands/db.d.ts +1 -0
- package/dist/cli/commands/orchestrator-service/status.d.ts +2 -0
- package/dist/cli/commands/org.d.ts +12 -0
- package/dist/cli/commands/scaler.d.ts +14 -0
- package/dist/cli/commands/secret.d.ts +1 -45
- package/dist/cli/commands/service-health.d.ts +21 -13
- package/dist/cli/commands/shared/cli-action.d.ts +17 -0
- package/dist/cli/commands/shared/db.d.ts +5 -5
- package/dist/cli/commands/shared/org-id.d.ts +5 -0
- package/dist/cli/commands/shared/service-verbs.d.ts +19 -0
- package/dist/cli/commands/shared/table.d.ts +3 -0
- package/dist/cli/commands/shared/unbound-context-warning.d.ts +2 -22
- package/dist/cli/commands/trust-policy.d.ts +7 -31
- package/dist/cli/kici-admin.d.ts +1 -1
- package/dist/cli.js +9865 -8203
- package/dist/cluster/coordinator.d.ts +2 -2
- package/dist/cluster/peer-client.d.ts +27 -1
- package/dist/cluster/peer-forget.d.ts +4 -9
- package/dist/cluster/peer-handler.d.ts +11 -1
- package/dist/cluster/peer-request-waiters.d.ts +26 -0
- package/dist/cluster/scaler-orphans-peer.d.ts +4 -9
- package/dist/cluster/scaler-reload-fanout.d.ts +29 -0
- package/dist/cluster/scaler-reload-peer.d.ts +16 -0
- package/dist/cluster/worker-cluster-settings.d.ts +1 -0
- package/dist/cold-store/load-access-log-range.d.ts +3 -3
- package/dist/cold-store/tables/access-log.d.ts +4 -12
- package/dist/cold-store/tables/event-log.d.ts +8 -19
- package/dist/cold-store/tables/execution-jobs.d.ts +7 -24
- package/dist/cold-store/tables/execution-runs.d.ts +6 -20
- package/dist/cold-store/tables/execution-steps.d.ts +8 -26
- package/dist/cold-store/tables/secret-audit-log.d.ts +4 -11
- package/dist/config/env-overlay.d.ts +3 -8
- package/dist/config/reload.d.ts +9 -2
- package/dist/config/schema.d.ts +2 -2
- package/dist/config/types.d.ts +2 -2
- package/dist/config.d.ts +13 -17
- package/dist/contexts/held-runs.d.ts +3 -6
- package/dist/dashboard/cursor.d.ts +12 -0
- package/dist/dashboard/handler.d.ts +5 -12
- package/dist/db/deferred-index-build.d.ts +42 -0
- package/dist/db/deferred-indexes.d.ts +3 -37
- package/dist/db/migrations/100_held_runs_hold_type_vocabulary.d.ts +3 -5
- package/dist/db/migrations/158_normalize_legacy_values.d.ts +4 -0
- package/dist/db/repos/org-ids-repo.d.ts +87 -0
- package/dist/db/schema-snapshot.generated.d.ts +3 -0
- package/dist/db/types.d.ts +5 -22
- package/dist/fault-injection-types.d.ts +0 -6
- package/dist/git/dispatch-git-auth.d.ts +6 -12
- package/dist/helpers/json.d.ts +3 -0
- package/dist/index.js +144 -140
- package/dist/metrics/prometheus.d.ts +0 -5
- package/dist/oidc/id-token-claims.d.ts +1 -1
- package/dist/oidc/resolve-signer.d.ts +2 -4
- package/dist/orchestrator-core.d.ts +10 -3
- package/dist/pipeline/global-eval-round.d.ts +2 -26
- package/dist/pipeline/install-secrets-resolver.d.ts +0 -3
- package/dist/pipeline/manual-schedule.d.ts +1 -7
- package/dist/pipeline/test-pipeline.d.ts +8 -7
- package/dist/provenance/dispatch-context.d.ts +5 -7
- package/dist/provenance/pending-attestations-repo.d.ts +1 -1
- package/dist/provenance/trust-root.d.ts +4 -5
- package/dist/provenance/verify-deferred-capture.d.ts +3 -3
- package/dist/provider-registry.d.ts +13 -40
- package/dist/providers/universal-git/ssh-auth.d.ts +0 -5
- package/dist/queue/terminalize-unroutable.d.ts +5 -0
- package/dist/reporting/check-run-reporter.d.ts +8 -21
- package/dist/reporting/check-run-summary.d.ts +2 -2
- package/dist/reporting/execution-tracker.d.ts +1 -1
- package/dist/reporting/log-chunk-sink.d.ts +1 -1
- package/dist/reporting/run-summary-fields.d.ts +25 -0
- package/dist/reporting/s3-log-storage.d.ts +2 -2
- package/dist/routes/admin-access-log.d.ts +2 -9
- package/dist/routes/admin-auth.d.ts +2 -0
- package/dist/routes/admin-backends.d.ts +2 -9
- package/dist/routes/admin-cluster-name.d.ts +2 -8
- package/dist/routes/admin-cluster-settings.d.ts +2 -8
- package/dist/routes/admin-config.d.ts +0 -3
- package/dist/routes/admin-contexts.d.ts +3 -11
- package/dist/routes/admin-db.d.ts +2 -9
- package/dist/routes/admin-env.d.ts +33 -0
- package/dist/routes/admin-event-dlq.d.ts +2 -9
- package/dist/routes/admin-event-inspect.d.ts +2 -9
- package/dist/routes/admin-event-log.d.ts +2 -9
- package/dist/routes/admin-events.d.ts +3 -13
- package/dist/routes/admin-held-runs.d.ts +2 -8
- package/dist/routes/admin-list-limit.d.ts +3 -0
- package/dist/routes/admin-maintenance.d.ts +2 -9
- package/dist/routes/admin-orchestrator-drain.d.ts +2 -9
- package/dist/routes/admin-org-settings.d.ts +2 -8
- package/dist/routes/admin-orgs.d.ts +27 -0
- package/dist/routes/admin-peer-forget.d.ts +2 -9
- package/dist/routes/admin-queue-execution.d.ts +3 -10
- package/dist/routes/admin-registrations.d.ts +3 -14
- package/dist/routes/admin-runs.d.ts +3 -14
- package/dist/routes/admin-scaler-orphans.d.ts +2 -9
- package/dist/routes/admin-scaler-reload.d.ts +41 -0
- package/dist/routes/admin-scheduled-jobs.d.ts +2 -9
- package/dist/routes/admin-signing-keys.d.ts +2 -9
- package/dist/routes/admin-sources.d.ts +2 -9
- package/dist/routes/admin-trust-policy.d.ts +2 -8
- package/dist/routes/admin.d.ts +15 -13
- package/dist/routes/caller-identity.d.ts +52 -0
- package/dist/routes/test-direct.d.ts +46 -0
- package/dist/routes/uploads.d.ts +12 -11
- package/dist/scaler/config.d.ts +12 -84
- package/dist/scaler/file-reload.d.ts +48 -0
- package/dist/scaler/manager.d.ts +47 -33
- package/dist/scaler/scaler-state-store.d.ts +5 -0
- package/dist/scaler/types.d.ts +1 -4
- package/dist/secrets/job-secret-gate.d.ts +2 -5
- package/dist/secrets/rbac.d.ts +5 -1
- package/dist/secrets/routing-key-scope.d.ts +1 -0
- package/dist/secrets/secret-resolver.d.ts +2 -4
- package/dist/secrets/token-manager.d.ts +1 -0
- package/dist/security/trust-policy-gate.d.ts +0 -4
- package/dist/server.d.ts +6 -17
- package/dist/server.js +9890 -10851
- package/dist/standalone.js +6928 -6576
- package/dist/storage/s3.d.ts +7 -7
- package/dist/storage/types.d.ts +4 -4
- package/dist/worker/reroute-dispatch.d.ts +1 -0
- package/dist/worker/reroute-spawn-control.d.ts +1 -3
- package/dist/worker-core.d.ts +9 -2
- package/dist/ws/agent-handler.d.ts +3 -3
- package/dist/ws/dashboard-access.d.ts +57 -0
- package/dist/ws/dashboard-backends-handler.d.ts +1 -6
- package/dist/ws/dashboard-context-handler.d.ts +10 -15
- package/dist/ws/dashboard-fleet-write-handler.d.ts +1 -6
- package/dist/ws/dashboard-global-workflows-handler.d.ts +1 -6
- package/dist/ws/dashboard-registrations-handler.d.ts +1 -7
- package/dist/ws/platform-client.d.ts +85 -330
- package/dist/ws/test-relay-handlers.d.ts +16 -9
- package/installer-image-digests.json +3 -3
- package/package.json +4 -4
- package/sbom.spdx.json +53 -53
- package/dist/cache/legacy-prefixes.d.ts +0 -19
- package/dist/cli/commands/agent-service/logs.d.ts +0 -14
- package/dist/cli/commands/agent-service/restart.d.ts +0 -12
- package/dist/cli/commands/agent-service/start.d.ts +0 -12
- package/dist/cli/commands/agent-service/stop.d.ts +0 -12
- package/dist/cli/commands/agent-service/uninstall.d.ts +0 -13
- package/dist/cli/commands/cache.d.ts +0 -51
- package/dist/cli/commands/orchestrator-service/logs.d.ts +0 -14
- package/dist/cli/commands/orchestrator-service/restart.d.ts +0 -12
- package/dist/cli/commands/orchestrator-service/start.d.ts +0 -12
- package/dist/cli/commands/orchestrator-service/stop.d.ts +0 -12
- package/dist/cli/commands/orchestrator-service/uninstall.d.ts +0 -13
- package/dist/git/inherited-secret.d.ts +0 -29
- package/dist/scaler/container-spawn.d.ts +0 -28
|
@@ -41,13 +41,7 @@ export declare function buildManualJobConfig(workflow: LockWorkflow, mat: Materi
|
|
|
41
41
|
source: import("@kici-dev/engine").LockSource | undefined;
|
|
42
42
|
workflowName: string;
|
|
43
43
|
steps: readonly import("@kici-dev/engine").LockStepEntry[];
|
|
44
|
-
needs: readonly (string |
|
|
45
|
-
name: string;
|
|
46
|
-
runOn: ("cancelled" | "cancelling" | "drift_dropped" | "failed" | "pending" | "queued" | "recovering" | "running" | "skipped" | "success" | "timed_out_stale" | "unroutable")[];
|
|
47
|
-
} | {
|
|
48
|
-
group: string;
|
|
49
|
-
runOn: ("cancelled" | "cancelling" | "drift_dropped" | "failed" | "pending" | "queued" | "recovering" | "running" | "skipped" | "success" | "timed_out_stale" | "unroutable")[];
|
|
50
|
-
})[];
|
|
44
|
+
needs: readonly (string | import("@kici-dev/engine").LockNeedsEntry | import("@kici-dev/engine").LockNeedsGroupEntry)[];
|
|
51
45
|
rules: readonly import("@kici-dev/engine").LockRule[] | undefined;
|
|
52
46
|
gitCredentials?: Readonly<Record<string, Readonly<Record<string, string>>>> | undefined;
|
|
53
47
|
dispatchInputs?: Record<string, unknown> | undefined;
|
|
@@ -60,14 +60,15 @@ export interface TestTriggerInput {
|
|
|
60
60
|
/** Request trace ID from the HTTP request. */
|
|
61
61
|
requestId: string;
|
|
62
62
|
/**
|
|
63
|
-
* The principal that initiated this run
|
|
64
|
-
* `test.relay.trigger
|
|
63
|
+
* The principal that initiated this run: the one the Platform relays on
|
|
64
|
+
* `test.relay.trigger`, or the admin token's service account on the direct
|
|
65
|
+
* test-run routes.
|
|
65
66
|
*
|
|
66
|
-
* Required rather than optional: the relay handler
|
|
67
|
-
*
|
|
68
|
-
* optional field would let a future caller silently drop attribution
|
|
69
|
-
*
|
|
70
|
-
*
|
|
67
|
+
* Required rather than optional: the relay handler and the direct test-run
|
|
68
|
+
* routes are the production callers and both always pass an actor, and an
|
|
69
|
+
* optional field would let a future caller silently drop attribution, which
|
|
70
|
+
* leaves `execution_runs.triggered_by` NULL while the column claims to hold
|
|
71
|
+
* the initiator.
|
|
71
72
|
*/
|
|
72
73
|
actor: ActorPrincipal;
|
|
73
74
|
/** JSON-stringified lock file content for local repos with no remote. */
|
|
@@ -31,13 +31,11 @@ import type { Database } from '../db/types.js';
|
|
|
31
31
|
* `repository` / `ref` / `sha` / `workflowRef` / `runId` / `jobId`, none of
|
|
32
32
|
* which depends on who signs the token. Only the statement's `builder.id`
|
|
33
33
|
* needs an issuer, and an unset one reproduces the `/orchestrator/unknown`
|
|
34
|
-
* builder the local guess has always recorded.
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* workflow name where the claim is `<name>@<sha>` — and the capture check
|
|
40
|
-
* then refused every one of its deferred attestations.
|
|
34
|
+
* builder the local guess has always recorded. Gating on the issuer would send
|
|
35
|
+
* an orchestrator without one back to the local guess —
|
|
36
|
+
* `repository: 'unknown/unknown'` for a `file://` clone, and a bare workflow
|
|
37
|
+
* name where the claim is `<name>@<sha>` — and the capture check would refuse
|
|
38
|
+
* every one of its deferred attestations.
|
|
41
39
|
*/
|
|
42
40
|
export declare function loadProvenanceContext(db: Kysely<Database>, runId: string, jobId: string, opts: {
|
|
43
41
|
issuer: string | undefined;
|
|
@@ -26,7 +26,7 @@ export declare class PendingAttestationsRepo {
|
|
|
26
26
|
/**
|
|
27
27
|
* List pending rows oldest-first, optionally scoped to a run. Terminally
|
|
28
28
|
* rejected rows (`rejected_at IS NOT NULL`) are excluded — the retrier never
|
|
29
|
-
* re-picks a row the
|
|
29
|
+
* re-picks a row the orchestrator definitively cannot mint.
|
|
30
30
|
*/
|
|
31
31
|
list(opts?: {
|
|
32
32
|
runId?: string;
|
|
@@ -6,15 +6,14 @@ import type { JSONWebKeySet } from 'jose';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function deriveJwksUri(issuer: string): string;
|
|
8
8
|
/**
|
|
9
|
-
* The orchestrator's view of the provenance trust root. The issuer
|
|
10
|
-
* the
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* The orchestrator's view of the provenance trust root. The issuer is fixed at
|
|
10
|
+
* construction: the orchestrator's own signing issuer, the local dev plane's
|
|
11
|
+
* `kici-local`, or the configured `KICI_PROVENANCE_ISSUER`. The JWKS is fetched
|
|
12
|
+
* lazily and cached with a single refetch-on-`kid`-miss.
|
|
13
13
|
*/
|
|
14
14
|
export interface ProvenanceTrustRoot {
|
|
15
15
|
getIssuer(): string | null;
|
|
16
16
|
getJwks(kid?: string): Promise<JSONWebKeySet | null>;
|
|
17
|
-
setIssuer(issuer: string | null): void;
|
|
18
17
|
}
|
|
19
18
|
/**
|
|
20
19
|
* A trust root backed by the orchestrator's OWN signing keys
|
|
@@ -27,9 +27,9 @@ export type DeferredCaptureVerdict = {
|
|
|
27
27
|
* A rejection is a DROP: the job stays green and has no attestation.
|
|
28
28
|
* That is a degradation, whereas storing an unchecked statement re-introduces
|
|
29
29
|
* the forgery primitive — every gate that lets one through is the hole again.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
30
|
+
* A dispatch that carried no `provenanceContext` makes the agent freeze its
|
|
31
|
+
* local statement, which is dropped for the same reason, with the mismatched
|
|
32
|
+
* field named.
|
|
33
33
|
*/
|
|
34
34
|
export declare function checkDeferredCapture(deps: {
|
|
35
35
|
db: Kysely<Database>;
|
|
@@ -75,9 +75,9 @@ export interface ProviderBundle {
|
|
|
75
75
|
* registry.registerByRoutingKey('github:67890', bundleForApp2);
|
|
76
76
|
* const bundle = registry.getByRoutingKey('github:12345');
|
|
77
77
|
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
78
|
+
* A provider-wide default bundle, registered with `register(type)`, stands in
|
|
79
|
+
* for every routing key of that type that has no bundle of its own:
|
|
80
|
+
* registry.register('generic', genericBundle);
|
|
81
81
|
*/
|
|
82
82
|
export declare class ProviderRegistry {
|
|
83
83
|
private readonly bundles;
|
|
@@ -89,26 +89,16 @@ export declare class ProviderRegistry {
|
|
|
89
89
|
*/
|
|
90
90
|
registerByRoutingKey(routingKey: string, bundle: ProviderBundle): void;
|
|
91
91
|
/**
|
|
92
|
-
* Register
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* "{type}:default". Only works for single-app scenarios.
|
|
96
|
-
*
|
|
97
|
-
* For multi-app support, use registerByRoutingKey() instead.
|
|
92
|
+
* Register the provider-wide default bundle for `type`, stored under the
|
|
93
|
+
* synthetic routing key "{type}:default". It answers every routing key of
|
|
94
|
+
* that type that has no bundle of its own.
|
|
98
95
|
*/
|
|
99
96
|
register(type: ProviderType, bundle: ProviderBundle): void;
|
|
100
|
-
/**
|
|
101
|
-
* Get the provider bundle for a given type.
|
|
102
|
-
*
|
|
103
|
-
* Backward-compatible: returns the first bundle matching the provider type
|
|
104
|
-
* prefix. For multi-app, use getByRoutingKey() instead.
|
|
105
|
-
*/
|
|
106
|
-
get(type: ProviderType): ProviderBundle | undefined;
|
|
107
97
|
/**
|
|
108
98
|
* Whether a bundle is registered at EXACTLY this routing key.
|
|
109
99
|
*
|
|
110
|
-
* `getByRoutingKey` cannot answer this: it falls back to
|
|
111
|
-
*
|
|
100
|
+
* `getByRoutingKey` cannot answer this: it falls back to the type's default
|
|
101
|
+
* bundle, so it returns a bundle for a key it has never seen. A caller that
|
|
112
102
|
* needs to know whether the source's OWN bundle is present — rather than
|
|
113
103
|
* whether some bundle can be produced — has to ask here.
|
|
114
104
|
*/
|
|
@@ -117,17 +107,11 @@ export declare class ProviderRegistry {
|
|
|
117
107
|
* Get the provider bundle by routing key.
|
|
118
108
|
* Routing keys have the format "{provider}:{id}" (e.g., "github:12345").
|
|
119
109
|
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* `get()` cannot be a "the single configured app" shortcut the way it is for
|
|
126
|
-
* `github:` — it returns whichever `generic:`-prefixed bundle happens to sit
|
|
127
|
-
* first in insertion order, which may belong to a different source, or to a
|
|
128
|
-
* different ORGANIZATION. Only the shared default bundle (`generic:default`,
|
|
129
|
-
* the one that genuinely stands in for every plain generic source) is an
|
|
130
|
-
* acceptable stand-in, so that is the only fallback offered here.
|
|
110
|
+
* A key with no bundle of its own falls back only to its type's default
|
|
111
|
+
* bundle (`{type}:default`, e.g. `generic:default`, which stands in for every
|
|
112
|
+
* plain generic source). It never falls back to another key's bundle: that
|
|
113
|
+
* bundle belongs to a different App or source, possibly in a different
|
|
114
|
+
* organization.
|
|
131
115
|
*/
|
|
132
116
|
getByRoutingKey(routingKey: string): ProviderBundle | undefined;
|
|
133
117
|
/**
|
|
@@ -139,21 +123,10 @@ export declare class ProviderRegistry {
|
|
|
139
123
|
* Iterate over all registered bundles.
|
|
140
124
|
*/
|
|
141
125
|
getAll(): IterableIterator<[string, ProviderBundle]>;
|
|
142
|
-
/**
|
|
143
|
-
* Check if a provider type has at least one registered bundle.
|
|
144
|
-
*/
|
|
145
|
-
has(type: ProviderType): boolean;
|
|
146
126
|
/**
|
|
147
127
|
* Get all registered routing keys.
|
|
148
128
|
*/
|
|
149
129
|
getRoutingKeys(): string[];
|
|
150
|
-
/**
|
|
151
|
-
* Get routing keys matching a specific provider type.
|
|
152
|
-
*
|
|
153
|
-
* @param type - Provider type (e.g., "github")
|
|
154
|
-
* @returns Array of routing keys matching the type prefix
|
|
155
|
-
*/
|
|
156
|
-
getRoutingKeysForProvider(type: ProviderType): string[];
|
|
157
130
|
/**
|
|
158
131
|
* Remove a routing key and its bundle.
|
|
159
132
|
* Used during config reload when apps are removed.
|
|
@@ -86,9 +86,4 @@ export declare function prepareSshAuthSync(opts: PrepareSshAuthOptions): SshAuth
|
|
|
86
86
|
* orchestrator's runtime user may have a populated ssh-agent.
|
|
87
87
|
*/
|
|
88
88
|
export declare function composeGitSshCommand(privateKeyPath: string, policy: SshHostKeyPolicy, knownHostsPath: string): string;
|
|
89
|
-
/**
|
|
90
|
-
* Shell-quote a path for embedding in `GIT_SSH_COMMAND`. Single-quotes the
|
|
91
|
-
* string and escapes embedded single quotes — matches POSIX shell parsing.
|
|
92
|
-
*/
|
|
93
|
-
export declare function quoteShell(path: string): string;
|
|
94
89
|
//# sourceMappingURL=ssh-auth.d.ts.map
|
|
@@ -70,6 +70,11 @@ export declare enum UnroutableCause {
|
|
|
70
70
|
*/
|
|
71
71
|
OnlyOtherJobImageAgents = "only-other-job-image-agents"
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* The operator-facing reason a job is `unroutable`, naming the exact selectors
|
|
75
|
+
* that went unmatched. Regex matchers are rendered as their source so the
|
|
76
|
+
* message stays readable rather than printing `[object Object]`.
|
|
77
|
+
*/
|
|
73
78
|
export declare function unroutableMessage(job: JobRoutingFacts, cause?: UnroutableCause): string;
|
|
74
79
|
/**
|
|
75
80
|
* Split the two reasons a queued job never ran: nothing in the fleet matched
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
* This CheckRunReporter handles execution lifecycle checks (queued, in_progress, completed per job/workflow).
|
|
26
26
|
* Future cleanup may unify both under CheckStatusPoster, but they serve different purposes today.
|
|
27
27
|
*/
|
|
28
|
-
import { type GitHubAppConfig } from '../providers/github/auth.js';
|
|
29
28
|
import type { ProviderRegistry } from '../provider-registry.js';
|
|
30
29
|
import type { StepLogBuffer } from './step-log-buffer.js';
|
|
31
30
|
import { type SourceLocationData } from './check-run-summary.js';
|
|
@@ -36,17 +35,11 @@ import { CheckRunConclusion, type TerminalJobStatus } from '@kici-dev/engine';
|
|
|
36
35
|
*/
|
|
37
36
|
interface CheckRunReporterDeps {
|
|
38
37
|
/**
|
|
39
|
-
* Provider registry for per-routing-key credential lookup
|
|
40
|
-
*
|
|
41
|
-
*
|
|
38
|
+
* Provider registry for per-routing-key credential lookup: the reporter
|
|
39
|
+
* resolves GitHub App credentials by routing key from the registry's
|
|
40
|
+
* CloneTokenProvider config.
|
|
42
41
|
*/
|
|
43
42
|
providerRegistry?: ProviderRegistry;
|
|
44
|
-
/**
|
|
45
|
-
* GitHub App config for creating Octokit instances.
|
|
46
|
-
* Fallback for backward compatibility when providerRegistry is not provided
|
|
47
|
-
* or when no routing key is available.
|
|
48
|
-
*/
|
|
49
|
-
githubConfig?: GitHubAppConfig;
|
|
50
43
|
/** Step log buffer for enriched failure summaries. */
|
|
51
44
|
stepLogBuffer?: StepLogBuffer;
|
|
52
45
|
/**
|
|
@@ -73,8 +66,7 @@ interface CheckRunReporterDeps {
|
|
|
73
66
|
* Resolver for the orchestrator's owning org public alias. Typically
|
|
74
67
|
* wired to `PlatformClient.getOrgPublicAlias()`. Returns the
|
|
75
68
|
* `oal_<12-char>` alias supplied by Platform on `auth.success`, or
|
|
76
|
-
* `undefined` before auth completes
|
|
77
|
-
* Platform that predates the alias plumbing.
|
|
69
|
+
* `undefined` before auth completes.
|
|
78
70
|
*/
|
|
79
71
|
getOrgPublicAlias?: () => string | undefined;
|
|
80
72
|
}
|
|
@@ -254,7 +246,7 @@ interface UpdateStepProgressOptions {
|
|
|
254
246
|
jobName: string;
|
|
255
247
|
stepIndex: number;
|
|
256
248
|
stepName: string;
|
|
257
|
-
state: 'running' | 'success' | 'failed' | 'skipped' | 'cancelled'
|
|
249
|
+
state: 'running' | 'success' | 'failed' | 'skipped' | 'cancelled';
|
|
258
250
|
durationMs?: number;
|
|
259
251
|
installationId?: number;
|
|
260
252
|
/** Routing key for per-app credential lookup (e.g., "github:12345"). */
|
|
@@ -526,14 +518,9 @@ export declare class CheckRunReporter {
|
|
|
526
518
|
*/
|
|
527
519
|
private persistBuildCreationPending;
|
|
528
520
|
/**
|
|
529
|
-
* Resolve GitHub App credentials for a given routing key
|
|
530
|
-
*
|
|
531
|
-
*
|
|
532
|
-
* 1. If providerRegistry is provided AND routingKey is given, look up the bundle
|
|
533
|
-
* by routing key and extract config from the CloneTokenProvider's getAppConfig().
|
|
534
|
-
* 2. Fall back to the direct githubConfig dep (backward compatible).
|
|
535
|
-
*
|
|
536
|
-
* Returns undefined if no config is available.
|
|
521
|
+
* Resolve GitHub App credentials for a given routing key from the bundle's
|
|
522
|
+
* CloneTokenProvider `getAppConfig()`. Returns undefined when no routing key,
|
|
523
|
+
* registry, bundle or GitHub provider is available.
|
|
537
524
|
*/
|
|
538
525
|
private resolveGithubConfig;
|
|
539
526
|
/**
|
|
@@ -17,7 +17,7 @@ import type { StepLogBuffer } from './step-log-buffer.js';
|
|
|
17
17
|
/** Step result data as sent by the agent in job.status data.stepResults. */
|
|
18
18
|
export interface StepResultData {
|
|
19
19
|
name: string;
|
|
20
|
-
status: 'success' | 'failed' | '
|
|
20
|
+
status: 'success' | 'failed' | 'skipped' | 'cancelled';
|
|
21
21
|
durationMs?: number;
|
|
22
22
|
error?: string;
|
|
23
23
|
exitCode?: number;
|
|
@@ -43,7 +43,7 @@ export interface CheckAnnotation {
|
|
|
43
43
|
/** Step progress entry for live updates. */
|
|
44
44
|
export interface StepProgressEntry {
|
|
45
45
|
name: string;
|
|
46
|
-
status: 'pending' | 'running' | 'success' | 'failed' | '
|
|
46
|
+
status: 'pending' | 'running' | 'success' | 'failed' | 'skipped' | 'cancelled';
|
|
47
47
|
durationMs?: number;
|
|
48
48
|
}
|
|
49
49
|
interface BuildCheckRunSummaryOptions {
|
|
@@ -24,7 +24,7 @@ export interface NormalizedLogChunk {
|
|
|
24
24
|
stepIndex: number;
|
|
25
25
|
lines: string[];
|
|
26
26
|
timestamp: number;
|
|
27
|
-
stream
|
|
27
|
+
stream: LogStream;
|
|
28
28
|
}
|
|
29
29
|
/** Which ingress produced the chunk. Stamped onto the two log counters. */
|
|
30
30
|
export type LogChunkSource = 'local' | 'peer';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The run fields every `onExecutionStatusChange` context built from an
|
|
3
|
+
* in-memory run carries, in one place so a new column cannot be forwarded from
|
|
4
|
+
* some status transitions and silently dropped from others.
|
|
5
|
+
*/
|
|
6
|
+
import type { ExecutionContext } from './execution-tracker.js';
|
|
7
|
+
type RunSummaryKey = 'workflowName' | 'provider' | 'repoIdentifier' | 'workflowRepoIdentifier' | 'sha' | 'installationId' | 'requestId' | 'routingKey' | 'ref' | 'triggerEvent' | 'commitMessage' | 'parentRunId' | 'originalRunId' | 'triggeredBy' | 'triggeredByAgentLabel' | 'triggerActorUsername' | 'triggerActorUserId';
|
|
8
|
+
/** The slice of a tracked run {@link runSummaryFields} reads. */
|
|
9
|
+
export type RunSummarySource = Pick<ExecutionContext, RunSummaryKey> & {
|
|
10
|
+
statusEpoch?: number | null;
|
|
11
|
+
};
|
|
12
|
+
/** The `statusEpoch` context field for a run, omitted at 0 (its default). */
|
|
13
|
+
export declare function statusEpochField(epoch: number | null | undefined): {
|
|
14
|
+
statusEpoch?: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The shared part of a run's status-change context.
|
|
18
|
+
*
|
|
19
|
+
* `workflowRepoIdentifier` is copied only when set, because its presence is
|
|
20
|
+
* what marks a cross-repository global run downstream. `localWorkingTree` is
|
|
21
|
+
* left to the caller: only some transitions forward it.
|
|
22
|
+
*/
|
|
23
|
+
export declare function runSummaryFields(run: RunSummarySource): Pick<ExecutionContext, RunSummaryKey | 'statusEpoch'>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=run-summary-fields.d.ts.map
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* finalize(path) at run completion.
|
|
23
23
|
*
|
|
24
24
|
* - finalize() seals the remaining tail buffer for a step key.
|
|
25
|
-
* - read() lists sealed segments (plus any
|
|
25
|
+
* - read() lists sealed segments (plus any single object written by
|
|
26
26
|
* append()) and streams them via the byte-offset cursor.
|
|
27
27
|
* - exists()/list() are segment-aware: `exists` is true when a single object or
|
|
28
28
|
* any segment is present; `list` collapses segment keys to their logical step
|
|
@@ -113,7 +113,7 @@ export declare class S3LogStorage implements LogStorage {
|
|
|
113
113
|
/**
|
|
114
114
|
* Single-object size (or null) + sealed segments in ascending seq order for a
|
|
115
115
|
* key. The single object is the content written by append() (single-shot
|
|
116
|
-
* writers)
|
|
116
|
+
* writers).
|
|
117
117
|
*/
|
|
118
118
|
private layout;
|
|
119
119
|
/** Fetch an inclusive byte range from one object. */
|
|
@@ -18,19 +18,12 @@
|
|
|
18
18
|
import { Hono } from 'hono';
|
|
19
19
|
import type { AccessLogWriter } from '../audit/access-log.js';
|
|
20
20
|
import type { TokenManager } from '../secrets/token-manager.js';
|
|
21
|
-
import type { RbacEnforcer
|
|
21
|
+
import type { RbacEnforcer } from '../secrets/rbac.js';
|
|
22
|
+
import { type AdminEnv } from './admin-env.js';
|
|
22
23
|
export interface AdminAccessLogRoutesDeps {
|
|
23
24
|
accessLog: AccessLogWriter;
|
|
24
25
|
tokenManager: TokenManager;
|
|
25
26
|
rbac: RbacEnforcer;
|
|
26
27
|
}
|
|
27
|
-
type AdminEnv = {
|
|
28
|
-
Variables: {
|
|
29
|
-
role: Role;
|
|
30
|
-
userId: string;
|
|
31
|
-
routingKey: string | null;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
28
|
export declare function createAdminAccessLogRoutes(deps: AdminAccessLogRoutesDeps): Hono<AdminEnv>;
|
|
35
|
-
export {};
|
|
36
29
|
//# sourceMappingURL=admin-access-log.d.ts.map
|
|
@@ -40,6 +40,8 @@ export interface AuthTokenInfo {
|
|
|
40
40
|
role: Role;
|
|
41
41
|
routingKey: string | null;
|
|
42
42
|
label: string;
|
|
43
|
+
/** The intended holder recorded at `token create --subject`, when one was. */
|
|
44
|
+
subject?: string | null;
|
|
43
45
|
}
|
|
44
46
|
/** The slice of TokenManager this middleware needs (keeps tests trivial to fake). */
|
|
45
47
|
export interface AuthTokenValidator {
|
|
@@ -12,14 +12,7 @@ import { Hono } from 'hono';
|
|
|
12
12
|
import type { BackendSyncManager } from '@kici-dev/engine';
|
|
13
13
|
import type { BackendRegistry } from '../secrets/backend-registry.js';
|
|
14
14
|
import type { BackendHealthChecker } from '../secrets/backend-health.js';
|
|
15
|
-
import type
|
|
16
|
-
type AdminBackendsEnv = {
|
|
17
|
-
Variables: {
|
|
18
|
-
role: Role;
|
|
19
|
-
userId: string;
|
|
20
|
-
routingKey: string | null;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
15
|
+
import { type AdminEnv } from './admin-env.js';
|
|
23
16
|
interface BackendRouteDeps {
|
|
24
17
|
registry: BackendRegistry;
|
|
25
18
|
healthChecker: BackendHealthChecker;
|
|
@@ -31,6 +24,6 @@ interface BackendRouteDeps {
|
|
|
31
24
|
* @param deps - Backend route dependencies (registry, health checker, sync manager)
|
|
32
25
|
* @returns Hono app with backend routes
|
|
33
26
|
*/
|
|
34
|
-
export declare function createBackendRoutes(deps: BackendRouteDeps): Hono<
|
|
27
|
+
export declare function createBackendRoutes(deps: BackendRouteDeps): Hono<AdminEnv>;
|
|
35
28
|
export {};
|
|
36
29
|
//# sourceMappingURL=admin-backends.d.ts.map
|
|
@@ -25,8 +25,9 @@ import { Hono } from 'hono';
|
|
|
25
25
|
import type { Kysely } from 'kysely';
|
|
26
26
|
import { CLUSTER_NAME_REGEX } from '@kici-dev/engine/protocol/cluster-name';
|
|
27
27
|
import type { Database } from '../db/types.js';
|
|
28
|
-
import type { RbacEnforcer
|
|
28
|
+
import type { RbacEnforcer } from '../secrets/rbac.js';
|
|
29
29
|
import type { AccessLogWriter } from '../audit/access-log.js';
|
|
30
|
+
import { type AdminEnv } from './admin-env.js';
|
|
30
31
|
interface ClusterNameRouteDeps {
|
|
31
32
|
db: Kysely<Database>;
|
|
32
33
|
rbac: RbacEnforcer;
|
|
@@ -38,13 +39,6 @@ interface ClusterNameRouteDeps {
|
|
|
38
39
|
*/
|
|
39
40
|
accessLog?: AccessLogWriter;
|
|
40
41
|
}
|
|
41
|
-
type AdminEnv = {
|
|
42
|
-
Variables: {
|
|
43
|
-
role: Role;
|
|
44
|
-
userId: string;
|
|
45
|
-
routingKey: string | null;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
42
|
export declare function createClusterNameRoutes(deps: ClusterNameRouteDeps): Hono<AdminEnv>;
|
|
49
43
|
export { CLUSTER_NAME_REGEX };
|
|
50
44
|
//# sourceMappingURL=admin-cluster-name.d.ts.map
|
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
import { Hono } from 'hono';
|
|
17
17
|
import { type Kysely } from 'kysely';
|
|
18
18
|
import type { Database } from '../db/types.js';
|
|
19
|
-
import type { RbacEnforcer
|
|
19
|
+
import type { RbacEnforcer } from '../secrets/rbac.js';
|
|
20
20
|
import type { PeerRegistry } from '../cluster/peer-registry.js';
|
|
21
|
+
import { type AdminEnv } from './admin-env.js';
|
|
21
22
|
/** The live view behind `GET /cluster-settings/propagation`. */
|
|
22
23
|
export interface ClusterSettingsPropagationSource {
|
|
23
24
|
instanceId: string;
|
|
@@ -31,13 +32,6 @@ interface ClusterSettingsRouteDeps {
|
|
|
31
32
|
/** Mounts `GET /cluster-settings/propagation` when set. */
|
|
32
33
|
propagation?: ClusterSettingsPropagationSource;
|
|
33
34
|
}
|
|
34
|
-
type AdminEnv = {
|
|
35
|
-
Variables: {
|
|
36
|
-
role: Role;
|
|
37
|
-
userId: string;
|
|
38
|
-
routingKey: string | null;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
35
|
export declare function createClusterSettingsRoutes(deps: ClusterSettingsRouteDeps): Hono<AdminEnv>;
|
|
42
36
|
export {};
|
|
43
37
|
//# sourceMappingURL=admin-cluster-settings.d.ts.map
|
|
@@ -28,9 +28,6 @@ import type { LocalConfig } from '../config/types.js';
|
|
|
28
28
|
export interface PeerReloadForwardResult {
|
|
29
29
|
result: ReloadResult | null;
|
|
30
30
|
}
|
|
31
|
-
/**
|
|
32
|
-
* Dependencies for config admin routes.
|
|
33
|
-
*/
|
|
34
31
|
export interface ConfigRouteDeps {
|
|
35
32
|
sharedStore: SharedConfigStore;
|
|
36
33
|
configReloader: ConfigReloader;
|
|
@@ -29,25 +29,17 @@
|
|
|
29
29
|
*/
|
|
30
30
|
import { Hono } from 'hono';
|
|
31
31
|
import { type Kysely } from 'kysely';
|
|
32
|
-
import type { RbacEnforcer
|
|
32
|
+
import type { RbacEnforcer } from '../secrets/rbac.js';
|
|
33
|
+
import { type AdminEnv } from './admin-env.js';
|
|
33
34
|
export interface AdminContextRoutesDeps {
|
|
34
35
|
db: Kysely<any>;
|
|
35
36
|
rbac: RbacEnforcer;
|
|
36
37
|
}
|
|
37
|
-
/** Hono env type for admin-contexts routes with context variables. */
|
|
38
|
-
type AdminEnvEnv = {
|
|
39
|
-
Variables: {
|
|
40
|
-
role: Role;
|
|
41
|
-
userId: string;
|
|
42
|
-
routingKey: string | null;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
38
|
/**
|
|
46
39
|
* Create admin API routes for context management.
|
|
47
40
|
*
|
|
48
41
|
* @param deps - db (Kysely) + rbac enforcer
|
|
49
42
|
* @returns Hono app mounted at /api/v1/admin
|
|
50
43
|
*/
|
|
51
|
-
export declare function createAdminContextRoutes(deps: AdminContextRoutesDeps): Hono<
|
|
52
|
-
export {};
|
|
44
|
+
export declare function createAdminContextRoutes(deps: AdminContextRoutesDeps): Hono<AdminEnv>;
|
|
53
45
|
//# sourceMappingURL=admin-contexts.d.ts.map
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { Hono } from 'hono';
|
|
12
12
|
import type { Kysely } from 'kysely';
|
|
13
13
|
import type pg from 'pg';
|
|
14
|
-
import type
|
|
14
|
+
import { type AdminEnv } from './admin-env.js';
|
|
15
15
|
interface DbRouteDeps {
|
|
16
16
|
db: Kysely<any>;
|
|
17
17
|
pool: pg.Pool;
|
|
@@ -21,13 +21,6 @@ interface DbRouteDeps {
|
|
|
21
21
|
*/
|
|
22
22
|
databaseUrl?: string;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
Variables: {
|
|
26
|
-
role: Role;
|
|
27
|
-
userId: string;
|
|
28
|
-
routingKey: string | null;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
export declare function createDbRoutes(deps: DbRouteDeps): Hono<AdminDbEnv>;
|
|
24
|
+
export declare function createDbRoutes(deps: DbRouteDeps): Hono<AdminEnv>;
|
|
32
25
|
export {};
|
|
33
26
|
//# sourceMappingURL=admin-db.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Hono env, app factory and routing-key guard every admin route file shares.
|
|
3
|
+
*/
|
|
4
|
+
import { Hono, type Env, type MiddlewareHandler } from 'hono';
|
|
5
|
+
import type { Role } from '../secrets/rbac.js';
|
|
6
|
+
/** Context variables the admin auth middleware sets for every admin route. */
|
|
7
|
+
export type AdminEnv = {
|
|
8
|
+
Variables: {
|
|
9
|
+
role: Role;
|
|
10
|
+
userId: string;
|
|
11
|
+
routingKey: string | null;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type ErrorLogger = {
|
|
15
|
+
error: (msg: string, meta?: Record<string, unknown>) => void;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Build an admin sub-app whose thrown errors map through `handleAdminError`.
|
|
19
|
+
*
|
|
20
|
+
* Hono runs a routed sub-app's own error handler, so the parent app's generic
|
|
21
|
+
* 500 never answers an admin route. An `HTTPException` (Hono's deliberate
|
|
22
|
+
* control-flow response) passes through unchanged, as it does on the parent.
|
|
23
|
+
*
|
|
24
|
+
* @param logger - Receives the unmapped-error log line.
|
|
25
|
+
* @param opts.logBeforeHandling - When set, every error is first logged under this message.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createAdminApp<E extends Env = AdminEnv>(logger: ErrorLogger, opts?: {
|
|
28
|
+
logBeforeHandling?: string;
|
|
29
|
+
}): Hono<E>;
|
|
30
|
+
/** Refuse a routing-key-scoped token with 403 before the handler runs. */
|
|
31
|
+
export declare const requireUnscoped: MiddlewareHandler<AdminEnv>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=admin-env.d.ts.map
|
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
import { Hono } from 'hono';
|
|
20
20
|
import type { EventStore } from '../events/event-store.js';
|
|
21
21
|
import type { TokenManager } from '../secrets/token-manager.js';
|
|
22
|
-
import type { RbacEnforcer
|
|
22
|
+
import type { RbacEnforcer } from '../secrets/rbac.js';
|
|
23
23
|
import type { AccessLogWriter } from '../audit/access-log.js';
|
|
24
|
+
import { type AdminEnv } from './admin-env.js';
|
|
24
25
|
export interface AdminEventDlqRoutesDeps {
|
|
25
26
|
eventStore: EventStore;
|
|
26
27
|
tokenManager: TokenManager;
|
|
@@ -28,13 +29,5 @@ export interface AdminEventDlqRoutesDeps {
|
|
|
28
29
|
/** Required so retry/discard mutations land in the access log. */
|
|
29
30
|
accessLog?: AccessLogWriter;
|
|
30
31
|
}
|
|
31
|
-
type AdminEnv = {
|
|
32
|
-
Variables: {
|
|
33
|
-
role: Role;
|
|
34
|
-
userId: string;
|
|
35
|
-
routingKey: string | null;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
32
|
export declare function createAdminEventDlqRoutes(deps: AdminEventDlqRoutesDeps): Hono<AdminEnv>;
|
|
39
|
-
export {};
|
|
40
33
|
//# sourceMappingURL=admin-event-dlq.d.ts.map
|
|
@@ -17,20 +17,13 @@ import type { Kysely } from 'kysely';
|
|
|
17
17
|
import type { Database } from '../db/types.js';
|
|
18
18
|
import type { EventStore } from '../events/event-store.js';
|
|
19
19
|
import type { TokenManager } from '../secrets/token-manager.js';
|
|
20
|
-
import type { RbacEnforcer
|
|
20
|
+
import type { RbacEnforcer } from '../secrets/rbac.js';
|
|
21
|
+
import { type AdminEnv } from './admin-env.js';
|
|
21
22
|
export interface AdminEventInspectRoutesDeps {
|
|
22
23
|
db: Kysely<Database>;
|
|
23
24
|
eventStore: EventStore;
|
|
24
25
|
tokenManager: TokenManager;
|
|
25
26
|
rbac: RbacEnforcer;
|
|
26
27
|
}
|
|
27
|
-
type AdminEnv = {
|
|
28
|
-
Variables: {
|
|
29
|
-
role: Role;
|
|
30
|
-
userId: string;
|
|
31
|
-
routingKey: string | null;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
28
|
export declare function createAdminEventInspectRoutes(deps: AdminEventInspectRoutesDeps): Hono<AdminEnv>;
|
|
35
|
-
export {};
|
|
36
29
|
//# sourceMappingURL=admin-event-inspect.d.ts.map
|