@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.
@@ -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
- * Sparse-clone the platform repo (when --repo, or accepted via the interactive
79
- * offer), repoint cwd into it, and verify the deploy entrypoint exists. Owns the
80
- * cwd/bootstrapped state. Sets exitCode on a hard failure (clone error / missing
81
- * entrypoint); a plain decline leaves exitCode
82
- * untouched. Returns ok:false when the caller must abort.
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
- export declare function offerToolFetch(prereqs: PrereqCheck[], yes: boolean, recheck: () => PrereqCheck[]): Promise<PrereqCheck[]>;
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":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAA8C,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAsC,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAK/F,OAAO,EAAoB,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAA2E,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAChI,OAAO,EAQL,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAQ7B;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAGlD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE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