@kici-dev/orchestrator 0.4.0 → 0.6.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__/fake-scaler-state-store.d.ts +24 -0
- package/dist/__test-helpers__/mock-db-query.d.ts +130 -0
- package/dist/__test-helpers__/mock-db.d.ts +27 -0
- package/dist/agent/agent-version.d.ts +34 -0
- package/dist/agent/dispatcher.d.ts +151 -13
- package/dist/agent/host-roster.d.ts +37 -5
- package/dist/agent/registry.d.ts +2 -0
- package/dist/app.d.ts +56 -7
- package/dist/approvals/apply-decision.d.ts +67 -19
- package/dist/approvals/held-run-release-wiring.d.ts +45 -0
- package/dist/approvals/independent-wiring.d.ts +55 -0
- package/dist/approvals/resume-router.d.ts +9 -0
- package/dist/approvals/triggerer-subject.d.ts +37 -0
- package/dist/cache/dep-cache.d.ts +54 -10
- package/dist/cache/global-eval-round-cache.d.ts +95 -0
- package/dist/cache/index.d.ts +3 -0
- package/dist/cache/pending-global-evals.d.ts +42 -0
- package/dist/cache/pending-inits.d.ts +10 -0
- package/dist/cli/api-client.d.ts +18 -0
- package/dist/cli/commands/cluster-settings.d.ts +52 -3
- package/dist/cli/commands/diagnose.d.ts +6 -0
- package/dist/cli/commands/held-run.d.ts +58 -0
- package/dist/cli/commands/runs.d.ts +1 -0
- package/dist/cli/commands/trust-policy.d.ts +117 -12
- package/dist/cli/kici-admin.d.ts +10 -0
- package/dist/cli.js +2770 -938
- package/dist/cluster/cluster-identity.d.ts +3 -3
- package/dist/cluster/cluster-settings-reader.d.ts +59 -1
- package/dist/cluster/coordinator.d.ts +44 -0
- package/dist/cluster/index.d.ts +4 -0
- package/dist/cluster/peer-handler.d.ts +19 -0
- package/dist/cluster/peer-registry.d.ts +17 -0
- package/dist/cluster/plan-headroom-store.d.ts +26 -0
- package/dist/cluster/worker-eviction.d.ts +69 -0
- package/dist/cold-store/load-event-log-range.d.ts +10 -3
- package/dist/cold-store/load-secret-audit-log-range.d.ts +4 -3
- package/dist/cold-store/tables/secret-audit-log.d.ts +4 -3
- package/dist/config.d.ts +48 -21
- package/dist/content-requirements-cache.d.ts +55 -0
- package/dist/contexts/held-runs.d.ts +123 -16
- package/dist/contexts/protection/aggregate.d.ts +3 -2
- package/dist/contexts/protection/branch-gate.d.ts +15 -0
- package/dist/contexts/protection/concurrency-gate.d.ts +8 -2
- package/dist/contexts/protection/pipeline.d.ts +18 -0
- package/dist/contexts/release-queued-holds.d.ts +35 -0
- package/dist/dashboard/attestation-filters.d.ts +8 -0
- package/dist/dashboard/handler.d.ts +6 -24
- package/dist/db/migrations/109_cluster_settings_cache_knobs.d.ts +4 -0
- package/dist/db/migrations/110_cluster_settings_global_eval_knobs.d.ts +4 -0
- package/dist/db/migrations/111_cluster_settings_global_eval_wait.d.ts +4 -0
- package/dist/db/migrations/112_execution_runs_workflow_repo.d.ts +4 -0
- package/dist/db/migrations/113_execution_runs_workflow_repo_index.d.ts +30 -0
- package/dist/db/migrations/114_ingest_queue_claim.d.ts +4 -0
- package/dist/db/migrations/115_global_workflows_cluster_switch.d.ts +9 -0
- package/dist/db/migrations/116_org_plan_headroom.d.ts +4 -0
- package/dist/db/migrations/117_invoke_gate_proxy_jobs.d.ts +4 -0
- package/dist/db/migrations/118_invoke_gate_scheduling.d.ts +4 -0
- package/dist/db/migrations/119_scaler_ha_ownership.d.ts +4 -0
- package/dist/db/migrations/120_cluster_settings_scaler_reaper.d.ts +4 -0
- package/dist/db/migrations/121_org_settings_allow_untrusted_dockerfile_builds.d.ts +19 -0
- package/dist/db/migrations/122_host_roster_scaler_managed.d.ts +25 -0
- package/dist/db/migrations/123_workflow_registrations_default_branch.d.ts +24 -0
- package/dist/db/migrations/124_cluster_settings_provision_backoff.d.ts +4 -0
- package/dist/db/migrations/125_org_trust_directory.d.ts +30 -0
- package/dist/db/migrations/126_held_runs_posted_pending_check.d.ts +28 -0
- package/dist/db/migrations/127_org_trust_policy_approval_expiry_seconds.d.ts +26 -0
- package/dist/db/migrations/128_execution_runs_global_eval_round.d.ts +23 -0
- package/dist/db/migrations/129_execution_runs_dispatch_routing_key.d.ts +24 -0
- package/dist/db/migrations/130_scaler_provision_outcomes.d.ts +32 -0
- package/dist/db/types.d.ts +428 -12
- package/dist/entry-helpers.d.ts +28 -0
- package/dist/events/event-emitter.d.ts +22 -0
- package/dist/events/event-router.d.ts +87 -1
- package/dist/events/types.d.ts +2 -23
- package/dist/git/credential-broker.d.ts +94 -0
- package/dist/git/inherited-secret.d.ts +24 -0
- package/dist/git/installation-token.d.ts +38 -0
- package/dist/git/job-context.d.ts +13 -0
- package/dist/index.js +324 -84
- package/dist/metrics/agent-metrics-aggregator.d.ts +4 -4
- package/dist/metrics/prometheus.d.ts +170 -3
- package/dist/oidc/oidc-mint-registration.d.ts +7 -3
- package/dist/orchestrator-core.d.ts +91 -24
- package/dist/pipeline/content-filter.d.ts +71 -0
- package/dist/pipeline/direct-ingress-deps.d.ts +100 -0
- package/dist/pipeline/dispatch-matched-workflow.d.ts +521 -11
- package/dist/pipeline/global-eval-round.d.ts +307 -0
- package/dist/pipeline/internal-event-pipeline.d.ts +140 -0
- package/dist/pipeline/invoke-gate.d.ts +164 -0
- package/dist/pipeline/job-contexts.d.ts +16 -17
- package/dist/pipeline/needs-scheduler.d.ts +13 -0
- package/dist/pipeline/process-webhook.d.ts +126 -31
- package/dist/pipeline/processor.d.ts +282 -23
- package/dist/pipeline/rerun.d.ts +21 -0
- package/dist/pipeline/resume-workflow.d.ts +40 -7
- package/dist/pipeline/route-or-dispatch-jobs.d.ts +15 -0
- package/dist/pipeline/security-hold-check.d.ts +217 -0
- package/dist/pipeline/test-pipeline.d.ts +12 -0
- package/dist/pipeline/undispatched-hold-checks.d.ts +23 -0
- package/dist/pipeline/webhook-payload-store.d.ts +20 -0
- package/dist/policy/dashboard-write-policy-listener.d.ts +62 -0
- package/dist/policy/dashboard-write-policy.d.ts +14 -0
- package/dist/provenance/backfill-run.d.ts +10 -1
- package/dist/provider-registry.d.ts +47 -4
- package/dist/providers/github/check-status-poster.d.ts +33 -3
- package/dist/providers/github/commit-message.d.ts +20 -0
- package/dist/providers/github/file-contents.d.ts +40 -0
- package/dist/providers/github/index.d.ts +2 -2
- package/dist/providers/github/normalizer.d.ts +3 -2
- package/dist/providers/local/normalizer.d.ts +3 -5
- package/dist/providers/universal-git/config.d.ts +2 -0
- package/dist/providers/universal-git/index.d.ts +11 -2
- package/dist/providers/universal-git/normalizer.d.ts +10 -0
- package/dist/queue/cleanup.d.ts +7 -1
- package/dist/queue/job-queue.d.ts +112 -7
- package/dist/queue/terminalize-unroutable.d.ts +13 -0
- package/dist/registration/extractor.d.ts +3 -3
- package/dist/registration/registration-index.d.ts +7 -0
- package/dist/registration/registration-run-match.d.ts +47 -0
- package/dist/registration/registration-store.d.ts +22 -0
- package/dist/reporting/check-run-reporter.d.ts +146 -2
- package/dist/reporting/check-run-summary.d.ts +25 -1
- package/dist/reporting/execution-tracker.d.ts +324 -9
- package/dist/reporting/log-chunk-sink.d.ts +8 -5
- package/dist/reporting/run-aggregator.d.ts +4 -14
- package/dist/reporting/step-display-order.d.ts +43 -0
- package/dist/routes/admin-held-runs.d.ts +142 -0
- package/dist/routes/admin-org-settings.d.ts +5 -0
- package/dist/routes/admin-trust-policy.d.ts +34 -6
- package/dist/routes/admin.d.ts +15 -0
- package/dist/scaler/backend-factory.d.ts +55 -0
- package/dist/scaler/bare-metal-backend.d.ts +43 -5
- package/dist/scaler/claim-store.d.ts +119 -0
- package/dist/scaler/config.d.ts +4 -0
- package/dist/scaler/container-backend.d.ts +18 -4
- package/dist/scaler/container-routing.d.ts +23 -0
- package/dist/scaler/container-spawn.d.ts +28 -0
- package/dist/scaler/event-backend.d.ts +124 -0
- package/dist/scaler/event-provision-reaper.d.ts +350 -0
- package/dist/scaler/failure-tracker.d.ts +1 -1
- package/dist/scaler/firecracker-backend.d.ts +33 -6
- package/dist/scaler/index.d.ts +11 -1
- package/dist/scaler/label-matcher.d.ts +4 -3
- package/dist/scaler/manager.d.ts +905 -76
- package/dist/scaler/resolve-container-auth.d.ts +45 -0
- package/dist/scaler/scaler-events.d.ts +11 -0
- package/dist/scaler/scaler-state-store.d.ts +294 -10
- package/dist/scaler/types.d.ts +131 -13
- package/dist/scaler/warm-pool.d.ts +132 -29
- package/dist/security/comment-handler.d.ts +50 -11
- package/dist/security/global-workflow-policy.d.ts +52 -12
- package/dist/security/identity-link.d.ts +60 -0
- package/dist/security/lock-source.d.ts +11 -13
- package/dist/security/reduced-privilege-note.d.ts +59 -0
- package/dist/security/trust-directory-store.d.ts +233 -0
- package/dist/security/trust-policy-gate.d.ts +94 -59
- package/dist/security/trust-policy-store.d.ts +3 -0
- package/dist/security/trust-resolver.d.ts +14 -98
- package/dist/server.d.ts +11 -1
- package/dist/server.js +56329 -42234
- package/dist/stale-detector/gate-deadline-detector.d.ts +52 -0
- package/dist/stale-detector/stale-run-detector.d.ts +61 -3
- package/dist/standalone.js +37619 -23570
- package/dist/webhook/ingest-accept.d.ts +70 -0
- package/dist/webhook/ingest-overflow-buffer.d.ts +35 -4
- package/dist/webhook/ingest-overflow-replayer.d.ts +50 -6
- package/dist/worker/in-memory-job-queue.d.ts +1 -1
- package/dist/ws/agent-handler.d.ts +31 -4
- package/dist/ws/dashboard-context-handler.d.ts +28 -4
- package/dist/ws/dashboard-global-workflows-handler.d.ts +36 -9
- package/dist/ws/execution-status-frame.d.ts +32 -0
- package/dist/ws/failure-messages.d.ts +2 -0
- package/dist/ws/git-credential-relay.d.ts +39 -0
- package/dist/ws/oidc-token-relay.d.ts +6 -11
- package/dist/ws/platform-client.d.ts +68 -9
- package/dist/ws/test-relay-handlers.d.ts +35 -10
- package/installer-image-digests.json +3 -3
- package/package.json +24 -19
- package/sbom.spdx.json +868 -821
- package/dist/approvals/team-membership-lookup.d.ts +0 -13
- package/dist/pipeline/inline-eval.d.ts +0 -44
- package/dist/providers/github/contributor-resolver.d.ts +0 -30
- package/dist/security/contributor-cache.d.ts +0 -83
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Held-run commands for kici-admin.
|
|
3
|
+
*
|
|
4
|
+
* Subcommand namespace: `kici-admin held-run <list|approve|reject>`.
|
|
5
|
+
*
|
|
6
|
+
* The local answer to a held run, for an orchestrator that has no Platform.
|
|
7
|
+
* Every other release surface is Platform-relayed — the dashboard approval
|
|
8
|
+
* queue, `kici approve` / `kici reject`, and the developer MCP tools all reach
|
|
9
|
+
* the applier over the control-plane connection — and the one surface that is
|
|
10
|
+
* not, a `/kici approve` pull-request comment, releases the `security` queue
|
|
11
|
+
* only. So on an independent orchestrator an approval-queue hold had no answer
|
|
12
|
+
* at all and could only expire.
|
|
13
|
+
*
|
|
14
|
+
* These verbs are therefore the mirror image of `trust-policy set`: they work
|
|
15
|
+
* only where no Platform is attached, and the route refuses with 409 wherever
|
|
16
|
+
* one is. That refusal is surfaced verbatim rather than reworded here, so the
|
|
17
|
+
* CLI cannot drift from what the server actually said.
|
|
18
|
+
*
|
|
19
|
+
* A hold is named the same way `kici approve` names one — `--job` / `--step` /
|
|
20
|
+
* `--hold-type` / `--hold`, resolved by the shared `resolveHeldRunId` — so an
|
|
21
|
+
* operator disambiguating a doubly-held job types the same flags on either
|
|
22
|
+
* surface. That sharing is the point: a job gated by BOTH a reviewer hold and a
|
|
23
|
+
* security hold writes two pending rows requiring two decisions, and a second
|
|
24
|
+
* resolver would be free to disagree about which one `--job` means.
|
|
25
|
+
*/
|
|
26
|
+
import type { Command } from 'commander';
|
|
27
|
+
import { ApprovalDecision, type HeldRunSummary } from '@kici-dev/engine';
|
|
28
|
+
import type { AdminApiClient } from '../api-client.js';
|
|
29
|
+
/** One held-run row as the admin route reports it, with the clause list it adds. */
|
|
30
|
+
type AdminHeldRunSummary = HeldRunSummary & {
|
|
31
|
+
/** Approver clauses the hold's requirement carries; `[]` when it names nobody. */
|
|
32
|
+
clauses?: Array<{
|
|
33
|
+
team: string;
|
|
34
|
+
} | {
|
|
35
|
+
user: string;
|
|
36
|
+
}>;
|
|
37
|
+
};
|
|
38
|
+
/** The decision response the admin route returns. */
|
|
39
|
+
interface DecisionResponse {
|
|
40
|
+
status: string;
|
|
41
|
+
remainingClauses?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Render the pending holds for a run.
|
|
45
|
+
*
|
|
46
|
+
* Per-entry rather than a count: "which hold do I answer, and who may answer
|
|
47
|
+
* it" is the question this command exists to answer, and the hold id it prints
|
|
48
|
+
* is the `--hold <id>` disambiguator the resolver hands back when nothing else
|
|
49
|
+
* separates two holds.
|
|
50
|
+
*/
|
|
51
|
+
export declare function formatHeldRuns(res: {
|
|
52
|
+
heldRuns: AdminHeldRunSummary[];
|
|
53
|
+
}, format: string): string;
|
|
54
|
+
/** Say what the applier did, in the vocabulary `ApplyDecisionResult.status` uses. */
|
|
55
|
+
export declare function formatDecision(res: DecisionResponse, decision: ApprovalDecision): string;
|
|
56
|
+
export declare function registerHeldRunCommands(program: Command, getClient: () => AdminApiClient): void;
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=held-run.d.ts.map
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* runs list List execution runs (table or JSON)
|
|
10
10
|
* runs show <runId> Show run detail with jobs and steps
|
|
11
11
|
* runs jobs <runId> List jobs for a run (optional steps)
|
|
12
|
+
* runs logs <runId> --job <jobId> Print a page of one step's log lines
|
|
12
13
|
* runs ephemeral-key <runId> Show scrub status of the run's key
|
|
13
14
|
* runs secret-outputs <runId> List secret outputs (masked / reveal)
|
|
14
15
|
*
|
|
@@ -1,26 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Org trust-policy commands for kici-admin.
|
|
3
3
|
*
|
|
4
|
-
* Subcommand namespace:
|
|
4
|
+
* Subcommand namespace:
|
|
5
|
+
* `kici-admin trust-policy <show|set|directory|directory-set|directory-remove>`.
|
|
5
6
|
*
|
|
6
7
|
* Talks to the orchestrator admin API directly (not the Platform dashboard
|
|
7
8
|
* proxy), so the CLI stays operable even when Platform is unavailable. Backed
|
|
8
9
|
* by `packages/orchestrator/src/routes/admin-trust-policy.ts`.
|
|
9
10
|
*
|
|
10
|
-
* `
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* `show` and `directory` read, in every mode. `set`, `directory-set`, and
|
|
12
|
+
* `directory-remove` write, and only work on an independent orchestrator:
|
|
13
|
+
* wherever a Platform is attached it owns both the policy and the approval
|
|
14
|
+
* directory, and the route refuses with 409. That message is surfaced verbatim
|
|
15
|
+
* rather than reworded here, so the CLI cannot drift from what the server
|
|
16
|
+
* actually said.
|
|
17
|
+
*
|
|
18
|
+
* The two directory writers live in this namespace rather than one of their
|
|
19
|
+
* own because they are the same org-trust concept as the policy, gated by the
|
|
20
|
+
* same mode rule against the same `--customer-id`, and reached through the same
|
|
21
|
+
* admin route file. Splitting them out would put half of "who may approve" in a
|
|
22
|
+
* second top-level command with its own copy of that story. They are siblings
|
|
23
|
+
* of the `directory` reader rather than subcommands under it, because turning
|
|
24
|
+
* that leaf into a group would break `kici-admin trust-policy directory` for
|
|
25
|
+
* anyone already running it.
|
|
14
26
|
*/
|
|
15
27
|
import type { Command } from 'commander';
|
|
16
|
-
import { TrustPolicyEnforcement } from '../../security/trust-policy-gate.js';
|
|
17
28
|
import type { AdminApiClient } from '../api-client.js';
|
|
18
29
|
/**
|
|
19
30
|
* The policy shape the admin route returns.
|
|
20
31
|
*
|
|
21
|
-
* The four policy fields are OPTIONAL because
|
|
22
|
-
*
|
|
23
|
-
*
|
|
32
|
+
* The four policy fields are OPTIONAL because a **v0.5.0 independent**
|
|
33
|
+
* orchestrator omits them: there, and only there, no policy row and no attached
|
|
34
|
+
* Platform meant no policy was resolved at all, and it reported
|
|
35
|
+
* `enforcement: 'legacy'` with the fields absent. A v0.5.0 Platform-attached
|
|
36
|
+
* orchestrator with no row still sent the fail-closed values. This build's route
|
|
37
|
+
* always sends them in every mode, so the `unknown` fallbacks below — and the
|
|
38
|
+
* `no policy stored` provenance wording — render only against that older
|
|
39
|
+
* independent orchestrator.
|
|
40
|
+
*
|
|
41
|
+
* The route also sends a deprecated `enforcement` field. Nothing here reads it —
|
|
42
|
+
* on this build it is always `policy` — so it is absent from this shape;
|
|
43
|
+
* `--format json` stringifies the parsed policy object, so the field still
|
|
44
|
+
* reaches the operator verbatim.
|
|
24
45
|
*/
|
|
25
46
|
export interface TrustPolicyView {
|
|
26
47
|
customerId: string;
|
|
@@ -28,15 +49,39 @@ export interface TrustPolicyView {
|
|
|
28
49
|
unknownContributorPolicy?: string;
|
|
29
50
|
workflowChangePolicy?: string;
|
|
30
51
|
approvalExpiryHours?: number;
|
|
31
|
-
/**
|
|
32
|
-
|
|
52
|
+
/**
|
|
53
|
+
* The authoritative hold window. Absent from any orchestrator that predates
|
|
54
|
+
* it, in which case `approvalExpiryHours` is the only window on offer.
|
|
55
|
+
*/
|
|
56
|
+
approvalExpirySeconds?: number;
|
|
33
57
|
source: string | null;
|
|
34
58
|
updatedAt: string | null;
|
|
35
59
|
effectiveDefault?: boolean;
|
|
36
60
|
platformManaged?: boolean;
|
|
37
61
|
}
|
|
38
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Render the policy as an aligned table, or as JSON when asked.
|
|
64
|
+
*
|
|
65
|
+
* The two deprecated arms are deliberately absent from the table: no dispatch
|
|
66
|
+
* decision reads either one, so a row claiming `Unknown contributor policy:
|
|
67
|
+
* hold` would assert an enforcement that is not happening. They are still
|
|
68
|
+
* stored and still echoed back, and `--format json` prints the policy object the
|
|
69
|
+
* route returned, so the values remain reachable for anyone who needs them.
|
|
70
|
+
*/
|
|
39
71
|
export declare function formatPolicy(policy: TrustPolicyView, format: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* Render the enforced hold window.
|
|
74
|
+
*
|
|
75
|
+
* A whole number of hours still prints as `72 h`, exactly as it always did, so
|
|
76
|
+
* no existing policy's output moves. Anything finer prints in seconds, because
|
|
77
|
+
* the hours spelling cannot express it and rounding would report a window the
|
|
78
|
+
* orchestrator is not applying.
|
|
79
|
+
*
|
|
80
|
+
* A policy carrying neither field is an orchestrator old enough to have
|
|
81
|
+
* resolved no policy at all (see {@link TrustPolicyView}); one carrying only
|
|
82
|
+
* hours is an orchestrator that predates the seconds window.
|
|
83
|
+
*/
|
|
84
|
+
export declare function formatExpiry(policy: TrustPolicyView): string;
|
|
40
85
|
/**
|
|
41
86
|
* Turn CLI flags into a PATCH body, exiting on an unknown value.
|
|
42
87
|
*
|
|
@@ -44,5 +89,65 @@ export declare function formatPolicy(policy: TrustPolicyView, format: string): s
|
|
|
44
89
|
* clear local message naming the accepted values instead of a 400 from the API.
|
|
45
90
|
*/
|
|
46
91
|
export declare function buildPolicyPatch(opts: Record<string, string | undefined>): Record<string, string | number>;
|
|
92
|
+
/**
|
|
93
|
+
* Warn when a patch names both spellings of the hold window.
|
|
94
|
+
*
|
|
95
|
+
* The route resolves this deterministically — the more specific seconds value
|
|
96
|
+
* wins — but an operator who passed both asked for two different things, so the
|
|
97
|
+
* one that is not applied is named rather than dropped in silence.
|
|
98
|
+
*
|
|
99
|
+
* Returns the lines rather than printing them so the check is unit-testable,
|
|
100
|
+
* matching `policyDeprecationWarnings` below.
|
|
101
|
+
*/
|
|
102
|
+
export declare function policyExpiryWarnings(patch: Record<string, string | number>): string[];
|
|
103
|
+
/**
|
|
104
|
+
* Warn about deprecated flags and deprecated values in an already-built patch.
|
|
105
|
+
*
|
|
106
|
+
* Every one of these still PATCHes through unchanged — the orchestrator stores
|
|
107
|
+
* what it is given, and an older Platform or CLI keeps seeing the value it
|
|
108
|
+
* expects. The warning says what the value does now, which for all three is
|
|
109
|
+
* nothing the fork switch reads.
|
|
110
|
+
*
|
|
111
|
+
* Returns the lines rather than printing them so the check is unit-testable,
|
|
112
|
+
* matching `unpairedEvalTimeoutWarnings` in `cluster-settings.ts`.
|
|
113
|
+
*/
|
|
114
|
+
export declare function policyDeprecationWarnings(patch: Record<string, string | number>): string[];
|
|
115
|
+
/** One identity link as the directory route reports it. */
|
|
116
|
+
interface DirectoryIdentityLink {
|
|
117
|
+
userId: string;
|
|
118
|
+
provider: string;
|
|
119
|
+
providerUsername: string;
|
|
120
|
+
providerUserId?: string | null;
|
|
121
|
+
}
|
|
122
|
+
/** One operator-defined team as the directory route reports it. */
|
|
123
|
+
interface DirectoryTeam {
|
|
124
|
+
teamName: string;
|
|
125
|
+
memberUserIds: string[];
|
|
126
|
+
}
|
|
127
|
+
/** The cached approval directory as the admin route returns it. */
|
|
128
|
+
export interface TrustDirectoryView {
|
|
129
|
+
customerId: string;
|
|
130
|
+
identityLinks: DirectoryIdentityLink[];
|
|
131
|
+
memberCiTrustLevels: Record<string, string>;
|
|
132
|
+
teamMemberships: DirectoryTeam[];
|
|
133
|
+
updatedAt: string;
|
|
134
|
+
}
|
|
135
|
+
interface DirectoryResponse {
|
|
136
|
+
directory: TrustDirectoryView | null;
|
|
137
|
+
platformManaged: boolean;
|
|
138
|
+
/** Present on `directory-remove`: false when the member held nothing. */
|
|
139
|
+
removed?: boolean;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Render the stored approval directory, or say why there is nothing to render.
|
|
143
|
+
*
|
|
144
|
+
* The directory is what `/kici approve` is resolved against: a commenter is
|
|
145
|
+
* matched to a KiCI user through the identity links, that user's CI trust level
|
|
146
|
+
* decides whether the approval counts, and a `{team}` clause is matched against
|
|
147
|
+
* the team memberships. So the listing is per-entry rather than a set of counts
|
|
148
|
+
* — "who can approve right now" is the question this command exists to answer.
|
|
149
|
+
*/
|
|
150
|
+
export declare function formatDirectory(res: DirectoryResponse, format: string): string;
|
|
47
151
|
export declare function registerTrustPolicyCommands(program: Command, getClient: () => AdminApiClient): void;
|
|
152
|
+
export {};
|
|
48
153
|
//# sourceMappingURL=trust-policy.d.ts.map
|
package/dist/cli/kici-admin.d.ts
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
* --token / -t Admin API token (env: KICI_ADMIN_TOKEN, required)
|
|
11
11
|
*/
|
|
12
12
|
import { Command } from 'commander';
|
|
13
|
+
/**
|
|
14
|
+
* The version `kici-admin --version` reports.
|
|
15
|
+
*
|
|
16
|
+
* `scripts/build-service.mjs` defines `KICI_PKG_VERSION` for every orchestrator
|
|
17
|
+
* build entry, `cli.js` included, so a shipped binary reports the package
|
|
18
|
+
* version it was built from. The fallback covers a source run (tests, `tsx`),
|
|
19
|
+
* where no bundler substituted the constant — the same shape `server.ts` and
|
|
20
|
+
* `standalone.ts` use for `ORCHESTRATOR_VERSION`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const CLI_VERSION: string;
|
|
13
23
|
/**
|
|
14
24
|
* Build the kici-admin Commander program with every command group registered.
|
|
15
25
|
* Exported so the surface registry can walk the real command tree without
|