@kici-dev/orchestrator 0.1.2 → 0.1.5
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 +26 -0
- package/dist/agent/ownership-tracker.d.ts +45 -3
- package/dist/audit/access-log.d.ts +7 -0
- package/dist/cli/api-client.d.ts +14 -0
- package/dist/cli/commands/cluster-name.d.ts +18 -0
- package/dist/cli/commands/db.d.ts +9 -6
- package/dist/cli/commands/org-settings.d.ts +2 -1
- package/dist/cli/commands/shared/secret-input.d.ts +46 -0
- package/dist/cli/commands/variable.d.ts +18 -0
- package/dist/cli/service/index.d.ts +1 -0
- package/dist/cli/service/launchd.d.ts +19 -0
- package/dist/cli/service/privilege.d.ts +21 -0
- package/dist/cli/wizard/orchestrator-wizard.d.ts +4 -2
- package/dist/cli.js +1056 -236
- package/dist/cluster/join-token.d.ts +21 -13
- package/dist/cluster/peer-client.d.ts +9 -0
- package/dist/config/cluster-id.d.ts +23 -0
- package/dist/config/cluster-name.d.ts +39 -0
- package/dist/config.d.ts +6 -0
- package/dist/dashboard/handler.d.ts +54 -2
- package/dist/db/migrations/019_generic_sources_change_notify.d.ts +25 -0
- package/dist/db/migrations/020_org_settings_dashboard_write_policy.d.ts +17 -0
- package/dist/db/migrations/021_check_run_tracking.d.ts +26 -0
- package/dist/db/migrations/022_scaler_manager_state.d.ts +29 -0
- package/dist/db/migrations/023_dispatch_queue_recovery_deadline.d.ts +26 -0
- package/dist/db/types.d.ts +137 -0
- package/dist/events/event-store.d.ts +9 -2
- package/dist/events/trust-store.d.ts +7 -0
- package/dist/events/types.d.ts +33 -0
- package/dist/metrics/scheduled-jobs.d.ts +26 -5
- package/dist/orchestrator-core.d.ts +7 -0
- package/dist/policy/dashboard-write-policy.d.ts +115 -0
- package/dist/queue/job-queue.d.ts +54 -1
- package/dist/reporting/check-run-tracking-store.d.ts +133 -0
- package/dist/reporting/commit-status.d.ts +87 -9
- package/dist/routes/admin-access-log.d.ts +1 -0
- package/dist/routes/admin-backends.d.ts +9 -1
- package/dist/routes/admin-cluster-name.d.ts +50 -0
- package/dist/routes/admin-db.d.ts +9 -1
- package/dist/routes/admin-environments.d.ts +10 -6
- package/dist/routes/admin-event-dlq.d.ts +1 -0
- package/dist/routes/admin-event-log.d.ts +1 -0
- package/dist/routes/admin-events.d.ts +19 -0
- package/dist/routes/admin-maintenance.d.ts +9 -1
- package/dist/routes/admin-org-settings.d.ts +10 -1
- package/dist/routes/admin-queue-execution.d.ts +1 -0
- package/dist/routes/admin-registrations.d.ts +1 -0
- package/dist/routes/admin-runs.d.ts +1 -0
- package/dist/routes/admin-scheduled-jobs.d.ts +1 -0
- package/dist/routes/admin-sources.d.ts +9 -1
- package/dist/routes/admin.d.ts +8 -0
- package/dist/scaler/manager.d.ts +38 -0
- package/dist/scaler/scaler-state-store.d.ts +102 -0
- package/dist/secrets/routing-key-scope.d.ts +43 -0
- package/dist/server.js +9846 -6884
- package/dist/stale-detector/stale-run-detector.d.ts +14 -2
- package/dist/standalone.js +6120 -3838
- package/dist/webhook/generic-sources-listener.d.ts +74 -0
- package/dist/webhook/register-source-bundle.d.ts +57 -0
- package/dist/ws/dashboard-backends-handler.d.ts +14 -0
- package/dist/ws/dashboard-env-handler.d.ts +7 -0
- package/dist/ws/dashboard-global-workflows-handler.d.ts +6 -0
- package/dist/ws/dashboard-registrations-handler.d.ts +7 -0
- package/dist/ws/platform-client.d.ts +30 -1
- package/package.json +3 -3
- package/sbom.spdx.json +40 -35
|
@@ -206,6 +206,32 @@ export declare class Dispatcher {
|
|
|
206
206
|
* from a previous orchestrator instance.
|
|
207
207
|
*/
|
|
208
208
|
startRecoveryTimer(jobId: string, agentId: string, runId: string): Promise<void>;
|
|
209
|
+
/**
|
|
210
|
+
* Rebuild the in-memory `recoveringJobs` Map from persisted
|
|
211
|
+
* `dispatch_queue` rows after a coord boot / Raft leader switch.
|
|
212
|
+
*
|
|
213
|
+
* For each `status='recovering'` row:
|
|
214
|
+
* - if `recovery_deadline` is in the future, recreate a setTimeout
|
|
215
|
+
* with the remaining window so the local sweep still fires.
|
|
216
|
+
* - if the deadline is already in the past, leave the row alone —
|
|
217
|
+
* the leader-gated `sweepExpiredRecoveries()` will pick it up on
|
|
218
|
+
* its next tick (which avoids two coords racing to mark the same
|
|
219
|
+
* job failed during recovery).
|
|
220
|
+
* - rows with NULL deadline (pre-migration recovering jobs) are
|
|
221
|
+
* fast-failed by the sweep on its first run.
|
|
222
|
+
*/
|
|
223
|
+
recoverState(): Promise<void>;
|
|
224
|
+
/**
|
|
225
|
+
* Leader-gated sweep: mark every `recovering` row whose
|
|
226
|
+
* `recovery_deadline < now` as `failed` and fire the per-job
|
|
227
|
+
* `onRecoveryTimeout` hook. Intended to run on the Raft leader at a
|
|
228
|
+
* fixed interval so jobs whose owning coord crashed mid-recovery
|
|
229
|
+
* still reach a terminal state.
|
|
230
|
+
*
|
|
231
|
+
* Safe to call on non-leaders (idempotent due to the WHERE clause)
|
|
232
|
+
* but skipping the call on followers avoids redundant DB updates.
|
|
233
|
+
*/
|
|
234
|
+
sweepExpiredRecoveries(): Promise<number>;
|
|
209
235
|
/**
|
|
210
236
|
* Stop all recovery timers. Called during graceful shutdown.
|
|
211
237
|
*/
|
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
interface OwnershipTrackerOpts {
|
|
14
14
|
/** Check if a job is owned by the given agent (active or in grace window). */
|
|
15
15
|
isJobOwnedByAgent: (agentId: string, jobId: string) => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Optional DB-backed fallback. Returns true when the orchestrator
|
|
18
|
+
* DB shows the (agent, job) pair as previously owned by this coord
|
|
19
|
+
* OR a sibling coord — i.e. either currently `dispatched`/`recovering`
|
|
20
|
+
* with the same `agent_id` / `recovery_agent_id`, or recently
|
|
21
|
+
* `completed`/`failed`. When a Raft leader switch wipes the
|
|
22
|
+
* in-memory `agentJobs` Map on the replacement coord, this fallback
|
|
23
|
+
* accepts late `log.chunk` / `step.status` chunks from agents that
|
|
24
|
+
* are still draining instead of rejecting them as ownership
|
|
25
|
+
* violations.
|
|
26
|
+
*/
|
|
27
|
+
isJobOwnedByAgentInDb?: (agentId: string, jobId: string) => Promise<boolean>;
|
|
16
28
|
/** Callback to disconnect an agent after escalation. */
|
|
17
29
|
onDisconnect: (agentId: string, reason: string) => void;
|
|
18
30
|
/** Number of violations before escalation (default: 5). */
|
|
@@ -22,23 +34,53 @@ interface OwnershipTrackerOpts {
|
|
|
22
34
|
}
|
|
23
35
|
export declare class OwnershipTracker {
|
|
24
36
|
private readonly isJobOwnedByAgent;
|
|
37
|
+
private readonly isJobOwnedByAgentInDb?;
|
|
25
38
|
private readonly onDisconnect;
|
|
26
39
|
private readonly violationThreshold;
|
|
27
40
|
private readonly violationWindowMs;
|
|
28
41
|
private readonly violations;
|
|
42
|
+
/**
|
|
43
|
+
* L1 cache of `(agentId, jobId)` pairs proven by a positive DB
|
|
44
|
+
* fallback. Pre-empts a synchronous warn-and-reject for the very
|
|
45
|
+
* next chunk on the same pair, since `checkOwnership` is called
|
|
46
|
+
* once per inbound message and the local Map repopulation lags
|
|
47
|
+
* behind. The cache is intentionally small (per-agent capped) and
|
|
48
|
+
* is cleaned on agent disconnect via `cleanup(agentId)`.
|
|
49
|
+
*/
|
|
50
|
+
private readonly dbAccepted;
|
|
29
51
|
constructor(opts: OwnershipTrackerOpts);
|
|
30
52
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
53
|
+
* Synchronous ownership check. Returns true if ownership is valid
|
|
54
|
+
* per the in-memory dispatcher OR a previously-accepted DB fallback.
|
|
55
|
+
*
|
|
56
|
+
* Returns false WITHOUT recording a violation when a DB fallback is
|
|
57
|
+
* configured: the caller is expected to invoke `validateAsync` to
|
|
58
|
+
* confirm or reject the ownership before treating it as a real
|
|
59
|
+
* violation. This makes the writer idempotent across HA failover —
|
|
60
|
+
* a `log.chunk` arriving on the replacement coord doesn't get
|
|
61
|
+
* counted as a violation just because the local Map is empty.
|
|
33
62
|
*/
|
|
34
63
|
checkOwnership(agentId: string, jobId: string, messageType: string): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Async fallback used by message handlers that want HA-safe
|
|
66
|
+
* acceptance of post-failover chunks. Returns true if the DB shows
|
|
67
|
+
* the (agent, job) pair as currently or recently owned by any coord
|
|
68
|
+
* in the cluster. On true, caches the result so subsequent same-pair
|
|
69
|
+
* chunks return true synchronously via `checkOwnership`. On false,
|
|
70
|
+
* records a violation exactly once (no recursive recordViolation
|
|
71
|
+
* from the synchronous call site — `checkOwnership` skipped it
|
|
72
|
+
* when the DB fallback was configured).
|
|
73
|
+
*/
|
|
74
|
+
validateAsync(agentId: string, jobId: string, messageType: string): Promise<boolean>;
|
|
35
75
|
/**
|
|
36
76
|
* Record a violation for an agent. If threshold is exceeded within the
|
|
37
77
|
* violation window, triggers disconnect escalation.
|
|
38
78
|
*/
|
|
39
79
|
private recordViolation;
|
|
40
80
|
/**
|
|
41
|
-
* Clean up violation tracking for a
|
|
81
|
+
* Clean up violation tracking AND the DB-accepted cache for a
|
|
82
|
+
* disconnected agent. Avoids cross-agent leakage when the same
|
|
83
|
+
* agent id is later reused.
|
|
42
84
|
*/
|
|
43
85
|
cleanup(agentId: string): void;
|
|
44
86
|
}
|
|
@@ -15,6 +15,13 @@ export interface AccessLogRecord {
|
|
|
15
15
|
source: AccessLogSource;
|
|
16
16
|
outcome: AccessLogOutcome;
|
|
17
17
|
errorMessage?: string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Extra key/value pairs merged into `actor_meta` on insert. Lets
|
|
20
|
+
* callers attach action-specific context (e.g. which dashboard-write
|
|
21
|
+
* operation flipped) without overloading other columns. Values must
|
|
22
|
+
* be JSON-serialisable.
|
|
23
|
+
*/
|
|
24
|
+
meta?: Record<string, unknown>;
|
|
18
25
|
}
|
|
19
26
|
export interface AccessLogQueryFilter {
|
|
20
27
|
orgId?: string;
|
package/dist/cli/api-client.d.ts
CHANGED
|
@@ -59,6 +59,10 @@ export declare class AdminApiClient {
|
|
|
59
59
|
* Public PATCH request returning parsed JSON.
|
|
60
60
|
*/
|
|
61
61
|
patch<T>(path: string, body: unknown): Promise<T>;
|
|
62
|
+
/**
|
|
63
|
+
* Public PUT request returning parsed JSON.
|
|
64
|
+
*/
|
|
65
|
+
put<T>(path: string, body: unknown): Promise<T>;
|
|
62
66
|
/**
|
|
63
67
|
* Public DELETE request returning parsed JSON.
|
|
64
68
|
*/
|
|
@@ -75,6 +79,16 @@ export declare class AdminApiClient {
|
|
|
75
79
|
}>;
|
|
76
80
|
setSecret(orgId: string, scope: string, key: string, value: string): Promise<void>;
|
|
77
81
|
deleteSecret(orgId: string, scope: string, key: string): Promise<void>;
|
|
82
|
+
listVariables(orgId: string, environment: string): Promise<{
|
|
83
|
+
variables: Array<{
|
|
84
|
+
key: string;
|
|
85
|
+
value: string;
|
|
86
|
+
locked: boolean;
|
|
87
|
+
updated_at: string;
|
|
88
|
+
}>;
|
|
89
|
+
}>;
|
|
90
|
+
setVariable(orgId: string, environment: string, key: string, value: string, locked?: boolean): Promise<void>;
|
|
91
|
+
deleteVariable(orgId: string, environment: string, key: string): Promise<void>;
|
|
78
92
|
rotateKey(): Promise<{
|
|
79
93
|
reEncrypted: number;
|
|
80
94
|
reEncryptedConfigs: number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cluster-name management commands for kici-admin.
|
|
3
|
+
*
|
|
4
|
+
* Subcommand namespace: `kici-admin cluster-name {get,set}`.
|
|
5
|
+
*
|
|
6
|
+
* The cluster name is the human-friendly identifier that surfaces on
|
|
7
|
+
* Platform's connection registry and in the dashboard's per-orch URL
|
|
8
|
+
* segment. Mutating it requires admin access (RBAC `secret.write`).
|
|
9
|
+
*
|
|
10
|
+
* Talks to the orchestrator admin API directly (not the Platform
|
|
11
|
+
* dashboard proxy), so the CLI stays operable even when Platform is
|
|
12
|
+
* unavailable. Backed by
|
|
13
|
+
* `packages/orchestrator/src/routes/admin-cluster-name.ts`.
|
|
14
|
+
*/
|
|
15
|
+
import type { Command } from 'commander';
|
|
16
|
+
import type { AdminApiClient } from '../api-client.js';
|
|
17
|
+
export declare function registerClusterNameCommands(program: Command, getClient: () => AdminApiClient): void;
|
|
18
|
+
//# sourceMappingURL=cluster-name.d.ts.map
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Database management commands for kici-admin.
|
|
3
3
|
*
|
|
4
|
-
* db migrate
|
|
5
|
-
* db fresh
|
|
6
|
-
* db ensure <name>
|
|
7
|
-
* db create-role
|
|
8
|
-
* db create-readonly-user
|
|
9
|
-
* db check-schema
|
|
4
|
+
* db migrate Run pending migrations (HTTP — orchestrator must be up)
|
|
5
|
+
* db fresh DROP + CREATE + migrate + store content hash (direct DB)
|
|
6
|
+
* db ensure <name> CREATE DATABASE IF NOT EXISTS (direct DB)
|
|
7
|
+
* db create-role CREATE ROLE LOGIN [CREATEDB] (direct DB)
|
|
8
|
+
* db create-readonly-user Read-only role + GRANT SELECT (direct DB)
|
|
9
|
+
* db check-schema Compare bundled migrations vs live schema (direct DB)
|
|
10
|
+
* db collation-check Check pg_database.datcollversion vs running libc (direct DB)
|
|
11
|
+
* db reindex REINDEX DATABASE CONCURRENTLY (direct DB)
|
|
12
|
+
* db refresh-collation-version ALTER DATABASE REFRESH COLLATION VERSION (direct DB)
|
|
10
13
|
*
|
|
11
14
|
* The direct-DB subcommands cannot go through HTTP because the target database
|
|
12
15
|
* may not exist yet or is about to be dropped. They follow the same pattern
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Org-settings management commands for kici-admin.
|
|
3
3
|
*
|
|
4
|
-
* Subcommand namespace: `kici-admin org-settings global-workflows <subcommand
|
|
4
|
+
* Subcommand namespace: `kici-admin org-settings global-workflows <subcommand>`
|
|
5
|
+
* and `kici-admin org-settings dashboard-writes <subcommand>`.
|
|
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
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared input-mode helper for `kici-admin secret set` and
|
|
3
|
+
* `kici-admin variable set`.
|
|
4
|
+
*
|
|
5
|
+
* Resolves a value from exactly one of:
|
|
6
|
+
* --value <plaintext> — argv literal (warned; goes into shell history)
|
|
7
|
+
* --prompt — interactive no-echo prompt (TTY only)
|
|
8
|
+
* --from-stdin — pipe (full stdin until EOF)
|
|
9
|
+
* --from-file <path> — file contents (--trim default-on)
|
|
10
|
+
* --from-env <VAR> — env var contents
|
|
11
|
+
*
|
|
12
|
+
* Default-mode resolution when no flag is provided:
|
|
13
|
+
* TTY -> --prompt
|
|
14
|
+
* non-TTY -> --from-stdin
|
|
15
|
+
*
|
|
16
|
+
* Optional checks:
|
|
17
|
+
* --confirm-fingerprint <hex> — SHA-256 fingerprint guard against
|
|
18
|
+
* paste corruption.
|
|
19
|
+
*
|
|
20
|
+
* The helper does NOT print to stdout (it returns the value). It DOES
|
|
21
|
+
* write to stderr for the `--value` warning, the prompt label, and any
|
|
22
|
+
* "empty value" warning. Stdout is reserved for the caller's confirmation
|
|
23
|
+
* output so the caller's `--dry-run` summary stays clean.
|
|
24
|
+
*/
|
|
25
|
+
export interface SecretInputOptions {
|
|
26
|
+
value?: string;
|
|
27
|
+
fromStdin?: boolean;
|
|
28
|
+
fromFile?: string;
|
|
29
|
+
fromEnv?: string;
|
|
30
|
+
prompt?: boolean;
|
|
31
|
+
trim?: boolean;
|
|
32
|
+
confirmFingerprint?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface SecretInputResult {
|
|
35
|
+
value: string;
|
|
36
|
+
/** Which input mode supplied the value (after default resolution). */
|
|
37
|
+
source: 'value' | 'stdin' | 'file' | 'env' | 'prompt';
|
|
38
|
+
}
|
|
39
|
+
export declare function resolveSecretInput(opts: SecretInputOptions, stderr?: NodeJS.WritableStream, stdin?: NodeJS.ReadStream): Promise<SecretInputResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Compute the canonical SHA-256 fingerprint for a value. Helper for
|
|
42
|
+
* callers (tests, --dry-run output) that want to display the same hex
|
|
43
|
+
* the user would pass to `--confirm-fingerprint`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function fingerprintValue(value: string): string;
|
|
46
|
+
//# sourceMappingURL=secret-input.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment variable management commands for kici-admin.
|
|
3
|
+
*
|
|
4
|
+
* kici-admin variable list <orgId> <environment>
|
|
5
|
+
* kici-admin variable get <orgId> <environment> <key>
|
|
6
|
+
* kici-admin variable set <orgId> <environment> <key> [--value | --from-stdin | --from-file | --from-env | --prompt]
|
|
7
|
+
* kici-admin variable delete <orgId> <environment> <key>
|
|
8
|
+
*
|
|
9
|
+
* Org-level environment variables are plaintext-at-rest in the
|
|
10
|
+
* orchestrator's DB; the dashboard write path is gated by the
|
|
11
|
+
* `variables.set` / `variables.delete` switches in the dashboard-write
|
|
12
|
+
* policy. This CLI is the always-available authority path when the
|
|
13
|
+
* dashboard is disabled for either switch.
|
|
14
|
+
*/
|
|
15
|
+
import type { Command } from 'commander';
|
|
16
|
+
import type { AdminApiClient } from '../api-client.js';
|
|
17
|
+
export declare function registerVariableCommands(program: Command, getClient: () => AdminApiClient): void;
|
|
18
|
+
//# sourceMappingURL=variable.d.ts.map
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
export type { ServiceManager, ServiceConfig, ServiceStatus, ServiceState, ServicePlatform, RestartPolicy, LogOptions, } from './types.js';
|
|
10
10
|
export { DEFAULT_RESTART_POLICY } from './types.js';
|
|
11
11
|
export { detectPlatform, isRoot, getConfigDir, getLogDir, getCacheDir } from './platform-detect.js';
|
|
12
|
+
export { resolveUserLevel, type PrivilegeOpts } from './privilege.js';
|
|
12
13
|
import type { ServiceManager, ServicePlatform } from './types.js';
|
|
13
14
|
/**
|
|
14
15
|
* Create a ServiceManager for the given platform.
|
|
@@ -22,6 +22,25 @@ export declare class LaunchdServiceManager implements ServiceManager {
|
|
|
22
22
|
* Visible for testing.
|
|
23
23
|
*/
|
|
24
24
|
generatePlist(config: ServiceConfig): string;
|
|
25
|
+
/**
|
|
26
|
+
* Resolve the launchctl domain string for a service config.
|
|
27
|
+
*
|
|
28
|
+
* - User-level (LaunchAgent at `~/Library/LaunchAgents/…`) → `gui/<uid>`
|
|
29
|
+
* - System-level (LaunchDaemon at `/Library/LaunchDaemons/…`) → `system`
|
|
30
|
+
*
|
|
31
|
+
* The legacy `launchctl load` / `unload` verbs implicitly inferred the
|
|
32
|
+
* domain from the plist's filesystem location, but they fail silently on
|
|
33
|
+
* headless macOS hosts where no GUI session exists (the `gui/<uid>` domain
|
|
34
|
+
* is not available without a console login). The modern `bootstrap` /
|
|
35
|
+
* `bootout` / `kickstart` / `kill` verbs take the domain explicitly, so a
|
|
36
|
+
* system-level LaunchDaemon loads regardless of whether anyone is logged
|
|
37
|
+
* in at the console — exactly what we need for headless deploy targets.
|
|
38
|
+
*/
|
|
39
|
+
private domain;
|
|
40
|
+
/** `<domain>/<label>` — the target string for kickstart/kill/print/enable. */
|
|
41
|
+
private domainTarget;
|
|
42
|
+
/** Is the service currently loaded in its target domain? */
|
|
43
|
+
private isLoaded;
|
|
25
44
|
install(config: ServiceConfig): Promise<void>;
|
|
26
45
|
uninstall(config: ServiceConfig): Promise<void>;
|
|
27
46
|
start(config: ServiceConfig): Promise<void>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the system-vs-user privilege level for a service lifecycle command.
|
|
3
|
+
*
|
|
4
|
+
* Five CLI verbs (install / start / stop / restart / uninstall) need to agree
|
|
5
|
+
* on whether they're operating against the user-level service
|
|
6
|
+
* (~/Library/LaunchAgents, `systemctl --user`) or the system-level one
|
|
7
|
+
* (/Library/LaunchDaemons, `systemctl`). Default behavior (no flag) is to
|
|
8
|
+
* auto-detect based on UID — non-root → user-level, root → system-level.
|
|
9
|
+
*
|
|
10
|
+
* Explicit `--system` / `--user-level` flags override the auto-detect.
|
|
11
|
+
* They're mutually exclusive: passing both throws. Passing `--system`
|
|
12
|
+
* without root throws with an actionable "re-run under sudo" message.
|
|
13
|
+
*/
|
|
14
|
+
export interface PrivilegeOpts {
|
|
15
|
+
/** Force system-level install/lifecycle. Requires root. */
|
|
16
|
+
system?: boolean;
|
|
17
|
+
/** Force user-level install/lifecycle. */
|
|
18
|
+
userLevel?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare function resolveUserLevel(opts: PrivilegeOpts): boolean;
|
|
21
|
+
//# sourceMappingURL=privilege.d.ts.map
|
|
@@ -11,6 +11,7 @@ interface OrchestratorInstallConfig {
|
|
|
11
11
|
databaseUrl: string;
|
|
12
12
|
port: number;
|
|
13
13
|
secretsKey: string;
|
|
14
|
+
bootstrapAdminToken: string;
|
|
14
15
|
platformUrl?: string;
|
|
15
16
|
platformToken?: string;
|
|
16
17
|
/** Source to add after orchestrator is running. */
|
|
@@ -30,8 +31,9 @@ interface OrchestratorInstallConfig {
|
|
|
30
31
|
* 2. Database URL
|
|
31
32
|
* 3. Port
|
|
32
33
|
* 4. Secrets encryption key
|
|
33
|
-
* 5.
|
|
34
|
-
* 6.
|
|
34
|
+
* 5. Bootstrap admin token (for kici-admin authentication)
|
|
35
|
+
* 6. Platform URL + token (if platform/hybrid mode)
|
|
36
|
+
* 7. Webhook secret (if hybrid/independent mode)
|
|
35
37
|
*/
|
|
36
38
|
export declare function runOrchestratorWizard(): Promise<OrchestratorInstallConfig>;
|
|
37
39
|
export {};
|