@pipeline-builder/pipeline-manager 4.1.23 → 4.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/health.d.ts.map +1 -1
- package/dist/agent/health.js +4 -4
- package/dist/commands/provision-steps.d.ts +174 -0
- package/dist/commands/provision-steps.d.ts.map +1 -0
- package/dist/commands/provision-steps.js +597 -0
- package/dist/commands/provision.d.ts +7 -144
- package/dist/commands/provision.d.ts.map +1 -1
- package/dist/commands/provision.js +18 -593
- package/dist/utils/device-auth.d.ts.map +1 -1
- package/dist/utils/device-auth.js +3 -6
- package/package.json +4 -4
|
@@ -1,149 +1,12 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { type AiOptions } from '../agent/ai.js';
|
|
3
|
-
import { type BootstrapSpec } from '../agent/bootstrap.js';
|
|
4
|
-
import { type PostStep, type SkippedStep } from '../agent/post-steps.js';
|
|
5
|
-
import { type PrereqCheck } from '../agent/prereqs.js';
|
|
6
|
-
import { type AssembleResult, type TargetId, type TargetSpec } from '../agent/targets.js';
|
|
7
|
-
/**
|
|
8
|
-
* Post-deploy initialization mode (the single `--init <mode>` flag):
|
|
9
|
-
* - `auto` — init-platform runs once the platform is up (register admin + load plugins/
|
|
10
|
-
* compliance/samples). On ec2 the instance does it itself on first boot; on
|
|
11
|
-
* local/minikube/eks `provision` runs it for you. This is the DEFAULT.
|
|
12
|
-
* - `manual` — don't self-init; surface the exact step for you to run yourself.
|
|
13
|
-
* - `skip` — don't initialize at all (no register, no loads).
|
|
14
|
-
*/
|
|
15
|
-
export type InitMode = 'auto' | 'manual' | 'skip';
|
|
16
|
-
/**
|
|
17
|
-
* Resolve the init mode from `--init <mode>`, defaulting to `auto` when the flag is absent.
|
|
18
|
-
* Returns `null` when `--init` was given an invalid value (caller errors).
|
|
19
|
-
*/
|
|
20
|
-
export declare function resolveInitMode(options: {
|
|
21
|
-
init?: unknown;
|
|
22
|
-
}): InitMode | null;
|
|
23
|
-
/**
|
|
24
|
-
* Host-port pre-flight (local/minikube). Ports are DERIVED from the target's cloned
|
|
25
|
-
* deploy source (compose / setup.sh) so the list can't drift — hence this runs AFTER
|
|
26
|
-
* the clone. A taken port makes a container/forward fail to bind mid-deploy (for the
|
|
27
|
-
* gateway, a silent unreachable hang). Prints a ✓/✗ summary and returns false ONLY
|
|
28
|
-
* when the caller must ABORT (a fatal local conflict). minikube ports are managed
|
|
29
|
-
* forwards (setup.sh pkills/restarts them), so a conflict there warns but proceeds.
|
|
30
|
-
* Remote targets (ec2/eks) bind nothing locally → returns true.
|
|
31
|
-
*/
|
|
32
|
-
export declare function preflightPorts(spec: TargetSpec, target: TargetId, cwd: string): Promise<boolean>;
|
|
33
|
-
/**
|
|
34
|
-
* Teardown mode — the destroy counterpart of provisioning, gated HARDER than deploy:
|
|
35
|
-
* AWS targets are irreversible, so the operator must TYPE the target id (--force
|
|
36
|
-
* bypasses for CI; --yes alone does NOT). Terminal: owns its output + exitCode.
|
|
37
|
-
*/
|
|
38
|
-
export declare function runTeardown(spec: TargetSpec, target: TargetId, cwd: string, executionId: string, opts: {
|
|
39
|
-
stackName?: string;
|
|
40
|
-
clusterName?: string;
|
|
41
|
-
region?: string;
|
|
42
|
-
domain?: string;
|
|
43
|
-
hostedZoneId?: string;
|
|
44
|
-
force?: boolean;
|
|
45
|
-
yes?: boolean;
|
|
46
|
-
json?: boolean;
|
|
47
|
-
}): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Run the deploy command (real, secrets unmasked, streamed + captured) with a
|
|
50
|
-
* bounded auto-fix + retry loop — the deploy scripts are idempotent, so a fixed
|
|
51
|
-
* re-run resumes rather than starting over. Returns whether it succeeded plus the
|
|
52
|
-
* (possibly fix-adjusted) params, which the caller needs for SES guidance.
|
|
53
|
-
*/
|
|
54
|
-
export declare function runDeployWithRetry(spec: TargetSpec, url: string | null, cwd: string, params: Record<string, unknown>, aiOpts: {
|
|
55
|
-
provider?: string;
|
|
56
|
-
model?: string;
|
|
57
|
-
}, opts: {
|
|
58
|
-
retries?: string;
|
|
59
|
-
yes?: boolean;
|
|
60
|
-
}): Promise<{
|
|
61
|
-
succeeded: boolean;
|
|
62
|
-
runParams: Record<string, unknown>;
|
|
63
|
-
}>;
|
|
64
|
-
/**
|
|
65
|
-
* Execute the post-install steps (register → loads → smoke → events → custom). On
|
|
66
|
-
* EC2/EKS the register step + the events bundle (store-token → setup-events) are
|
|
67
|
-
* SURFACED as ordered manual next-steps instead of auto-run: ec2 register must run
|
|
68
|
-
* ON the box (the minikube user owns the cluster), and the events bundle needs a
|
|
69
|
-
* registered platform + AWS creds. (eks register itself port-forwards, so it runs
|
|
70
|
-
* from anywhere with kubectl access.) Sets exitCode on a step failure.
|
|
71
|
-
*/
|
|
72
|
-
export declare function runPostSteps(postSteps: PostStep[], skippedSteps: SkippedStep[], target: TargetId, cwd: string, adminEnv: Record<string, string>, opts: {
|
|
73
|
-
yes?: boolean;
|
|
74
|
-
autoRun?: boolean;
|
|
75
|
-
autoInit?: boolean;
|
|
76
|
-
}): Promise<void>;
|
|
77
1
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
|
|
84
|
-
export declare function bootstrapAndLocate(spec: TargetSpec, bootstrap: BootstrapSpec, bootstrapCmd: string | null, sparsePaths: readonly string[], startCwd: string, opts: {
|
|
85
|
-
yes?: boolean;
|
|
86
|
-
}): Promise<{
|
|
87
|
-
cwd: string;
|
|
88
|
-
bootstrapped: boolean;
|
|
89
|
-
ok: boolean;
|
|
90
|
-
}>;
|
|
91
|
-
/**
|
|
92
|
-
* Interactive opt-in loads, offered AFTER the clone (so we only ask once the operator
|
|
93
|
-
* has agreed to proceed). Prompts per load, additively sparse-fetches the picked
|
|
94
|
-
* folders into a bootstrapped sparse clone, then re-resolves the post-install steps
|
|
95
|
-
* with the selections. Returns the chosen ids + the recomputed steps.
|
|
96
|
-
*/
|
|
97
|
-
export declare function resolveLoadsInteractively(target: TargetId, url: string | null, region: string | undefined, cwd: string, bootstrapped: boolean, bootstrap: BootstrapSpec, postStepFlags: {
|
|
98
|
-
init: boolean;
|
|
99
|
-
autoInit: boolean;
|
|
100
|
-
buildBootstrap: boolean;
|
|
101
|
-
smokeTest: boolean;
|
|
102
|
-
events: boolean;
|
|
103
|
-
steps: string[];
|
|
104
|
-
}): Promise<{
|
|
105
|
-
enabledLoadIds: string[];
|
|
106
|
-
steps: PostStep[];
|
|
107
|
-
skipped: SkippedStep[];
|
|
108
|
-
}>;
|
|
109
|
-
/**
|
|
110
|
-
* Assemble deploy params from explicit flags (flags always win over the NL
|
|
111
|
-
* parse, which only fills gaps).
|
|
112
|
-
*/
|
|
113
|
-
export declare function buildParams(options: Record<string, unknown>, selfInit: boolean): Record<string, unknown>;
|
|
114
|
-
/**
|
|
115
|
-
* `--diagnose <file>`: explain a deploy failure with the configured model. A
|
|
116
|
-
* read-only inspection mode — the caller returns afterwards whether or not a
|
|
117
|
-
* target was given, so it never falls through into a (possibly --yes) deploy.
|
|
118
|
-
*/
|
|
119
|
-
export declare function runDiagnose(file: string, json: boolean, aiOpts: AiOptions, executionId: string): Promise<void>;
|
|
120
|
-
/** Print the provision plan (shown before the gated execution). */
|
|
121
|
-
export declare function printPlan(p: {
|
|
122
|
-
spec: TargetSpec;
|
|
123
|
-
target: TargetId;
|
|
124
|
-
prereqs: PrereqCheck[];
|
|
125
|
-
missing: AssembleResult['missing'];
|
|
126
|
-
bootstrap: BootstrapSpec;
|
|
127
|
-
bootstrapCmd: string | null;
|
|
128
|
-
sparsePaths: string[];
|
|
129
|
-
command: string;
|
|
130
|
-
postSteps: PostStep[];
|
|
131
|
-
skippedSteps: SkippedStep[];
|
|
132
|
-
}): void;
|
|
133
|
-
/**
|
|
134
|
-
* local/minikube's setup.sh REQUIRES a `.env` and aborts without it — create
|
|
135
|
-
* it from .env.example with generated secrets so the deploy is non-interactive.
|
|
136
|
-
* ec2 and eks don't need a local `.env`: ec2 bootstraps its secrets on the
|
|
137
|
-
* instance, and eks's setup.sh creates the k8s secrets itself.
|
|
138
|
-
*/
|
|
139
|
-
export declare function ensureLocalEnvFile(target: TargetId, spec: TargetSpec, cwd: string, yes: boolean): Promise<void>;
|
|
140
|
-
/**
|
|
141
|
-
* Any missing required prereq that's a single static binary (e.g. yq) can be
|
|
142
|
-
* fetched into the tools cache instead of a system install — no brew/apt.
|
|
143
|
-
* Offer it, then re-check (the cache dir is already on PATH). Returns the
|
|
144
|
-
* (possibly refreshed) prereq list.
|
|
2
|
+
* The `provision` command: its ~40-option table, and the sequencing narrative
|
|
3
|
+
* that runs a provision end to end.
|
|
4
|
+
*
|
|
5
|
+
* The phases themselves live in `./provision-steps.ts` — one exported function
|
|
6
|
+
* each — so this file can be read as what it is: which flags exist, and in what
|
|
7
|
+
* order the steps run behind which gates.
|
|
145
8
|
*/
|
|
146
|
-
|
|
9
|
+
import { Command } from 'commander';
|
|
147
10
|
/**
|
|
148
11
|
* Registers the `provision` command — an AI-assisted installer for the Pipeline
|
|
149
12
|
* Builder PLATFORM (local/minikube/EC2/EKS). It prints the assembled plan
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provision.d.ts","sourceRoot":"","sources":["../../src/commands/provision.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provision.d.ts","sourceRoot":"","sources":["../../src/commands/provision.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6CpC;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2ShD"}
|