@elementumai/edk 0.9.19 → 0.10.1
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/README.md +159 -7
- package/dist-sdk/src/catalog/factories.d.ts +33 -2
- package/dist-sdk/src/catalog/factories.js +40 -1
- package/dist-sdk/src/catalog/from-authoring.d.ts +13 -8
- package/dist-sdk/src/catalog/from-authoring.js +34 -9
- package/dist-sdk/src/catalog/index.d.ts +2 -2
- package/dist-sdk/src/catalog/index.js +2 -2
- package/dist-sdk/src/catalog/render.js +6 -6
- package/dist-sdk/src/catalog/token.js +11 -0
- package/dist-sdk/src/catalog/types.d.ts +40 -1
- package/dist-sdk/src/catalog/types.js +12 -0
- package/dist-sdk/src/core/triggers/on-demand.d.ts +40 -4
- package/dist-sdk/src/core/triggers/on-demand.js +17 -2
- package/dist-sdk/src/core/types/app.d.ts +2 -2
- package/dist-sdk/src/engine/build/context.d.ts +1 -1
- package/dist-sdk/src/engine/coverage-gaps.d.ts +86 -0
- package/dist-sdk/src/engine/coverage-gaps.js +156 -0
- package/dist-sdk/src/engine/ei/run.d.ts +169 -0
- package/dist-sdk/src/engine/ei/run.js +1219 -0
- package/dist-sdk/src/engine/logging.d.ts +17 -0
- package/dist-sdk/src/engine/logging.js +18 -0
- package/dist-sdk/src/engine/pull/catalog-ref.d.ts +16 -0
- package/dist-sdk/src/engine/pull/catalog-ref.js +24 -0
- package/dist-sdk/src/engine/pull/context.d.ts +68 -6
- package/dist-sdk/src/engine/pull/context.js +40 -1
- package/dist-sdk/src/engine/pull/procedure-refs.d.ts +8 -0
- package/dist-sdk/src/engine/pull/procedure-refs.js +28 -0
- package/dist-sdk/src/engine/pull/ref-only.d.ts +5 -0
- package/dist-sdk/src/engine/pull/ref-only.js +10 -7
- package/dist-sdk/src/engine/pull/result-output.d.ts +6 -0
- package/dist-sdk/src/engine/pull/result-output.js +113 -3
- package/dist-sdk/src/engine/tf/expr.js +1 -1
- package/dist-sdk/src/engine/tf/index.d.ts +2 -2
- package/dist-sdk/src/engine/tf/index.js +1 -1
- package/dist-sdk/src/engine/tf/labels.d.ts +28 -5
- package/dist-sdk/src/engine/tf/labels.js +54 -3
- package/dist-sdk/src/engine/tf/model.d.ts +22 -1
- package/dist-sdk/src/engine/tf/parse.js +93 -4
- package/dist-sdk/src/engine/tf/render.d.ts +4 -2
- package/dist-sdk/src/engine/tf/render.js +41 -7
- package/dist-sdk/src/engine/validation.d.ts +44 -0
- package/dist-sdk/src/engine/validation.js +95 -0
- package/dist-sdk/src/entities/access-policy/from-tf.js +38 -1
- package/dist-sdk/src/entities/access-policy/principal.d.ts +2 -0
- package/dist-sdk/src/entities/access-policy/to-tf.js +5 -2
- package/dist-sdk/src/entities/agent/build.d.ts +4 -16
- package/dist-sdk/src/entities/agent/build.js +40 -5
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +3 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +46 -21
- package/dist-sdk/src/entities/agent/from-tf.js +11 -3
- package/dist-sdk/src/entities/agent/module.js +2 -0
- package/dist-sdk/src/entities/agent/to-tf.js +20 -6
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +10 -1
- package/dist-sdk/src/entities/agent-tool/from-tf.js +18 -6
- package/dist-sdk/src/entities/agent-tool/module.js +3 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +2 -2
- package/dist-sdk/src/entities/agent-tool/to-tf.js +27 -5
- package/dist-sdk/src/entities/app/auto-share.d.ts +38 -0
- package/dist-sdk/src/entities/app/auto-share.js +49 -0
- package/dist-sdk/src/entities/app/build.d.ts +105 -22
- package/dist-sdk/src/entities/app/build.js +107 -10
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +22 -1
- package/dist-sdk/src/entities/app/from-tf.d.ts +1 -0
- package/dist-sdk/src/entities/app/from-tf.js +11 -2
- package/dist-sdk/src/entities/app/index.d.ts +7 -6
- package/dist-sdk/src/entities/app/index.js +2 -8
- package/dist-sdk/src/entities/app/module.js +5 -2
- package/dist-sdk/src/entities/app/to-tf.d.ts +6 -0
- package/dist-sdk/src/entities/app/to-tf.js +40 -13
- package/dist-sdk/src/entities/automation/build.d.ts +56 -6
- package/dist-sdk/src/entities/automation/build.js +230 -26
- package/dist-sdk/src/entities/automation/calculation-expression.d.ts +7 -7
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +41 -5
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +470 -58
- package/dist-sdk/src/entities/automation/from-tf.d.ts +37 -8
- package/dist-sdk/src/entities/automation/from-tf.js +791 -131
- package/dist-sdk/src/entities/automation/generated/task-output-contracts.d.ts +33 -0
- package/dist-sdk/src/entities/automation/generated/task-output-contracts.js +183 -0
- package/dist-sdk/src/entities/automation/index.d.ts +2 -2
- package/dist-sdk/src/entities/automation/index.js +1 -1
- package/dist-sdk/src/entities/automation/module.d.ts +3 -0
- package/dist-sdk/src/entities/automation/module.js +107 -15
- package/dist-sdk/src/entities/automation/output-field-types.d.ts +7 -0
- package/dist-sdk/src/entities/automation/output-field-types.js +36 -0
- package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +9 -0
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +13 -0
- package/dist-sdk/src/entities/automation/script-code.d.ts +20 -0
- package/dist-sdk/src/entities/automation/script-code.js +109 -5
- package/dist-sdk/src/entities/automation/system-ref-name.js +4 -0
- package/dist-sdk/src/entities/automation/task-output-labels.d.ts +39 -0
- package/dist-sdk/src/entities/automation/task-output-labels.js +85 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +116 -22
- package/dist-sdk/src/entities/automation/tasks.js +86 -24
- package/dist-sdk/src/entities/automation/to-tf.d.ts +24 -3
- package/dist-sdk/src/entities/automation/to-tf.js +1082 -132
- package/dist-sdk/src/entities/automation/triggers.d.ts +12 -6
- package/dist-sdk/src/entities/automation/triggers.js +4 -0
- package/dist-sdk/src/entities/automation/types.d.ts +9 -0
- package/dist-sdk/src/entities/automation/types.js +19 -0
- package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +1 -1
- package/dist-sdk/src/entities/automation/value-ref-tf.js +1 -1
- package/dist-sdk/src/entities/chart/from-tf.js +9 -1
- package/dist-sdk/src/entities/chart/to-tf.js +10 -3
- package/dist-sdk/src/entities/data-lookup/module.js +2 -0
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +24 -31
- package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +7 -5
- package/dist-sdk/src/entities/element/build.d.ts +28 -13
- package/dist-sdk/src/entities/element/build.js +5 -1
- package/dist-sdk/src/entities/element/from-tf.d.ts +11 -0
- package/dist-sdk/src/entities/element/from-tf.js +62 -1
- package/dist-sdk/src/entities/element/index.d.ts +5 -3
- package/dist-sdk/src/entities/element/index.js +1 -0
- package/dist-sdk/src/entities/element/module.js +9 -3
- package/dist-sdk/src/entities/element/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/element/to-tf.js +16 -16
- package/dist-sdk/src/entities/field/build.d.ts +17 -3
- package/dist-sdk/src/entities/field/build.js +3 -0
- package/dist-sdk/src/entities/field/calc.d.ts +7 -7
- package/dist-sdk/src/entities/field/from-tf.d.ts +5 -4
- package/dist-sdk/src/entities/field/from-tf.js +244 -49
- package/dist-sdk/src/entities/field/media-types.d.ts +6 -0
- package/dist-sdk/src/entities/field/media-types.js +30 -0
- package/dist-sdk/src/entities/field/module.js +2 -0
- package/dist-sdk/src/entities/field/options.js +6 -1
- package/dist-sdk/src/entities/field/to-tf.d.ts +26 -5
- package/dist-sdk/src/entities/field/to-tf.js +137 -15
- package/dist-sdk/src/entities/field/types.d.ts +2 -0
- package/dist-sdk/src/entities/field/types.js +27 -0
- package/dist-sdk/src/entities/file-reader/from-tf.js +14 -5
- package/dist-sdk/src/entities/file-reader/module.js +1 -0
- package/dist-sdk/src/entities/file-reader/types.d.ts +2 -0
- package/dist-sdk/src/entities/file-reader/types.js +1 -1
- package/dist-sdk/src/entities/portal/build.d.ts +26 -0
- package/dist-sdk/src/entities/portal/build.js +37 -0
- package/dist-sdk/src/entities/portal/from-tf.d.ts +27 -0
- package/dist-sdk/src/entities/portal/from-tf.js +75 -0
- package/dist-sdk/src/entities/portal/index.d.ts +1 -0
- package/dist-sdk/src/entities/portal/index.js +1 -0
- package/dist-sdk/src/entities/portal/module.d.ts +3 -0
- package/dist-sdk/src/entities/portal/module.js +28 -0
- package/dist-sdk/src/entities/portal/to-tf.d.ts +12 -0
- package/dist-sdk/src/entities/portal/to-tf.js +73 -0
- package/dist-sdk/src/entities/portal/types.d.ts +1 -0
- package/dist-sdk/src/entities/portal/types.js +1 -0
- package/dist-sdk/src/entities/relationship/module.js +2 -0
- package/dist-sdk/src/entities/relationship/pair-check.d.ts +7 -0
- package/dist-sdk/src/entities/relationship/pair-check.js +68 -0
- package/dist-sdk/src/entities/relationship/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/relationship/to-tf.js +12 -3
- package/dist-sdk/src/entities/role/from-tf.js +3 -3
- package/dist-sdk/src/entities/role/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/role/to-tf.js +12 -4
- package/dist-sdk/src/entities/search-table/module.js +1 -0
- package/dist-sdk/src/entities/search-table/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/search-table/to-tf.js +1 -1
- package/dist-sdk/src/entities/service-account/build.d.ts +15 -2
- package/dist-sdk/src/entities/service-account/from-tf.d.ts +2 -4
- package/dist-sdk/src/entities/service-account/from-tf.js +20 -8
- package/dist-sdk/src/entities/service-account/role-fidelity.d.ts +56 -0
- package/dist-sdk/src/entities/service-account/role-fidelity.js +243 -0
- package/dist-sdk/src/entities/service-account/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/service-account/to-tf.js +17 -0
- package/dist-sdk/src/entities/service-account/workspace-owner.d.ts +16 -0
- package/dist-sdk/src/entities/service-account/workspace-owner.js +22 -0
- package/dist-sdk/src/entities/shared/aspect-target-from-tf.d.ts +1 -1
- package/dist-sdk/src/entities/shared/aspect-target-from-tf.js +5 -2
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +23 -1
- package/dist-sdk/src/entities/shared/filters/ast.js +2 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +7 -0
- package/dist-sdk/src/entities/shared/filters/index.js +19 -4
- package/dist-sdk/src/entities/shared/filters/print.js +24 -3
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +7 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +46 -7
- package/dist-sdk/src/entities/shared/filters/types.d.ts +15 -2
- package/dist-sdk/src/entities/shared/ref.d.ts +5 -7
- package/dist-sdk/src/entities/shared/ref.js +5 -7
- package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +9 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.js +35 -2
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +20 -5
- package/dist-sdk/src/entities/shared/types/field-types.js +8 -0
- package/dist-sdk/src/entities/skill/access-policy.js +3 -3
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +3 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +14 -6
- package/dist-sdk/src/entities/skill/from-tf.js +70 -15
- package/dist-sdk/src/entities/skill/input-coverage.d.ts +7 -0
- package/dist-sdk/src/entities/skill/input-coverage.js +11 -0
- package/dist-sdk/src/entities/skill/module.js +2 -0
- package/dist-sdk/src/entities/skill/to-tf.js +14 -4
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +2 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +49 -10
- package/dist-sdk/src/entities/skill-tool/module.js +3 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +2 -8
- package/dist-sdk/src/entities/skill-tool/to-tf.js +49 -14
- package/dist-sdk/src/entities/table/catalog.d.ts +14 -0
- package/dist-sdk/src/entities/table/catalog.js +66 -0
- package/dist-sdk/src/entities/table/module.js +2 -1
- package/dist-sdk/src/entities/table/to-tf.js +2 -2
- package/dist-sdk/src/entities/task/build.d.ts +8 -0
- package/dist-sdk/src/entities/task/build.js +10 -1
- package/dist-sdk/src/entities/task/from-tf.d.ts +4 -2
- package/dist-sdk/src/entities/task/from-tf.js +7 -2
- package/dist-sdk/src/entities/task/module.js +2 -2
- package/dist-sdk/src/entities/task/to-tf.d.ts +8 -4
- package/dist-sdk/src/entities/task/to-tf.js +28 -1
- package/dist-sdk/src/entities/view/agent-view-layout-from-tf.d.ts +49 -9
- package/dist-sdk/src/entities/view/agent-view-layout-from-tf.js +71 -18
- package/dist-sdk/src/entities/view/agent-view-layout-to-tf.d.ts +19 -4
- package/dist-sdk/src/entities/view/agent-view-layout-to-tf.js +82 -10
- package/dist-sdk/src/entities/view/agent-view-layout.d.ts +53 -23
- package/dist-sdk/src/entities/view/agent-view-layout.js +1 -1
- package/dist-sdk/src/entities/view/from-tf.d.ts +3 -2
- package/dist-sdk/src/entities/view/from-tf.js +133 -13
- package/dist-sdk/src/entities/view/module.js +30 -3
- package/dist-sdk/src/entities/view/to-tf.d.ts +20 -8
- package/dist-sdk/src/entities/view/to-tf.js +86 -18
- package/dist-sdk/src/entities/view/types.d.ts +4 -15
- package/dist-sdk/src/entities/view/types.js +15 -15
- package/dist-sdk/src/entities/visual-flow/build.d.ts +16 -1
- package/dist-sdk/src/entities/visual-flow/build.js +9 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.d.ts +14 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.js +51 -3
- package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -1
- package/dist-sdk/src/entities/visual-flow/index.js +1 -1
- package/dist-sdk/src/entities/visual-flow/printer.js +19 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.js +87 -3
- package/dist-sdk/src/entities/widget/build.d.ts +16 -1
- package/dist-sdk/src/entities/widget/build.js +11 -1
- package/dist-sdk/src/entities/widget/from-tf.js +3 -3
- package/dist-sdk/src/entities/widget/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/widget/to-tf.js +41 -14
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +148 -13
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
- package/dist-sdk/src/graph/index.d.ts +12 -0
- package/dist-sdk/src/graph/index.js +21 -0
- package/dist-sdk/src/graph/modules.js +2 -0
- package/dist-sdk/src/graph/types.d.ts +83 -4
- package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
- package/dist-sdk/src/internal/sdk-package.js +1 -0
- package/package.json +16 -3
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subprocess rules for the `ei` Go CLI (plan §4.8):
|
|
3
|
+
*
|
|
4
|
+
* - Pass-throughs (plan/apply/list): EDK owns both child streams and routes
|
|
5
|
+
* incoming messages to the output layer. stdio remains the transport to the
|
|
6
|
+
* user, but never bypasses EDK's timing/renderer boundary. One exception: a
|
|
7
|
+
* non-bridge pass-through with no caller-supplied streams, whose stdin and
|
|
8
|
+
* stdout are both a terminal, inherits the terminal so interactive `ei`
|
|
9
|
+
* prompts can draw themselves (#1146). Bridge mode (`plan`'s progress) and
|
|
10
|
+
* captures keep the pipes.
|
|
11
|
+
* - Export calls (file mode, results land in `.tf/in/`): ei's stdout is
|
|
12
|
+
* status text — routed to OUR progress stream (see `engine/progress.ts`), so
|
|
13
|
+
* an Elementum command's stdout stays one pure JSON summary whenever anything
|
|
14
|
+
* is actually reading it.
|
|
15
|
+
* - Capture calls (machine-consumed stdout, e.g. adoption's plan output):
|
|
16
|
+
* stdout captured bounded, stderr routed through EDK's diagnostics sink.
|
|
17
|
+
*
|
|
18
|
+
* ei owns auth (`ei auth login`) — Elementum sets no credentials and never talks
|
|
19
|
+
* to the platform itself.
|
|
20
|
+
*/
|
|
21
|
+
import { type PartialReadEvent, type ProgressEvent } from "../logging.js";
|
|
22
|
+
export declare class EiRunError extends Error {
|
|
23
|
+
readonly exitCode: number | null;
|
|
24
|
+
readonly stderr?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Captured stdout of the failed run, when the caller asked for it to be
|
|
27
|
+
* captured (runEiCapture). For `plan -json` this carries OpenTofu's
|
|
28
|
+
* `diagnostic` events — the actual reason the plan failed (edk#1402).
|
|
29
|
+
*/
|
|
30
|
+
readonly stdout?: string;
|
|
31
|
+
constructor(message: string, exitCode: number | null, stderr?: string, stdout?: string);
|
|
32
|
+
}
|
|
33
|
+
export declare function configureBridgeProfile(profile: string | undefined): void;
|
|
34
|
+
export declare function configuredBridgeProfile(): string | undefined;
|
|
35
|
+
export declare function managedElementumRoot(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve the private Go bridge.
|
|
38
|
+
*
|
|
39
|
+
* 1. `ELEMENTUM_BRIDGE_PATH` — explicit pin, always honored (relative paths
|
|
40
|
+
* resolve against cwd). Empty/whitespace is treated as unset.
|
|
41
|
+
* 2. Managed libexec — `~/.elementum/libexec/elementum/ei` (or `$ELEMENTUM_HOME/...`).
|
|
42
|
+
* Installed toolchains keep `ei` here, not on PATH (`~/.elementum/bin` only
|
|
43
|
+
* has `elementum`). Preferring this over PATH keeps the CLI on the
|
|
44
|
+
* version-locked train when a source-built or leftover `ei` is also on PATH.
|
|
45
|
+
* 3. PATH — OS-native lookup for `ei`. Used when there is no managed install
|
|
46
|
+
* (source-built bridge on PATH, no installer).
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveEiBinary(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Resolve the OpenTofu binary shipped in the same managed Elementum train.
|
|
51
|
+
* Source development may explicitly select an engine for tests/local work;
|
|
52
|
+
* installed executions never fall back to a globally installed tofu binary.
|
|
53
|
+
*/
|
|
54
|
+
export declare function resolveOpenTofuBinary(): string;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the bridge will resolve the plan engine to OpenTofu. OpenTofu is
|
|
57
|
+
* the only supported engine for `-target-file`; keep the adoption fallback
|
|
58
|
+
* conservative when an explicit Terraform command or a PATH-only install is
|
|
59
|
+
* in use.
|
|
60
|
+
*/
|
|
61
|
+
export declare function usesOpenTofuTargetFile(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The OpenTofu the bridge plans with: `ELEMENTUM_TERRAFORM_COMMAND`, else the
|
|
64
|
+
* managed OpenTofu, else `tofu` on PATH. Undefined when none is executable.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveBridgeOpenTofu(): string | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Read Cobra's root help without auth/profile resolution. This deliberately
|
|
69
|
+
* bypasses bridgeArgs: root discovery must stay local even when the Elementum
|
|
70
|
+
* invocation includes a global --profile.
|
|
71
|
+
*/
|
|
72
|
+
export declare function runEiLocalHelp(): Promise<string>;
|
|
73
|
+
/**
|
|
74
|
+
* Run a local (no auth, no profile) bridge command that reads `input` on stdin
|
|
75
|
+
* and returns stdout. Non-zero exit rejects with the captured stderr.
|
|
76
|
+
*/
|
|
77
|
+
export declare function runEiLocalWithInput(args: readonly string[], input: string): Promise<string>;
|
|
78
|
+
/**
|
|
79
|
+
* Run `ei` with EDK-owned streaming and return its exit code. The caller (a
|
|
80
|
+
* CLI pass-through) should `process.exit(code)` with it. Output is streamed
|
|
81
|
+
* rather than buffered so large OpenTofu plans do not hit a capture limit or
|
|
82
|
+
* deadlock the child. An interactive terminal run hands the child the
|
|
83
|
+
* terminal instead (see {@link passthroughNeedsTerminal}).
|
|
84
|
+
*/
|
|
85
|
+
export declare function runEiPassthrough(args: readonly string[], opts?: {
|
|
86
|
+
cwd?: string;
|
|
87
|
+
stdout?: NodeJS.WritableStream;
|
|
88
|
+
stderr?: NodeJS.WritableStream;
|
|
89
|
+
bridge?: boolean;
|
|
90
|
+
progressTotal?: number;
|
|
91
|
+
}): Promise<number>;
|
|
92
|
+
/** Returns and clears the partial reads reported by `runEiWithStatus` exports. */
|
|
93
|
+
export declare function takePartialReads(): PartialReadEvent[];
|
|
94
|
+
/**
|
|
95
|
+
* Run `ei` with EDK-owned streaming: stdout (status text) is routed to OUR
|
|
96
|
+
* progress stream and stderr to the diagnostics sink. For file-mode export
|
|
97
|
+
* calls — the caller's own stdout stays a single JSON summary whenever it is
|
|
98
|
+
* piped.
|
|
99
|
+
*/
|
|
100
|
+
export declare function runEiWithStatus(args: readonly string[], opts?: {
|
|
101
|
+
cwd?: string;
|
|
102
|
+
bridge?: boolean;
|
|
103
|
+
env?: NodeJS.ProcessEnv;
|
|
104
|
+
onProgress?: (event: ProgressEvent) => void;
|
|
105
|
+
userOutput?: NodeJS.WritableStream;
|
|
106
|
+
}): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Run the managed OpenTofu binary while reserving a piped stdout for the
|
|
109
|
+
* Elementum command's single result. Arguments are passed directly, never
|
|
110
|
+
* through a shell, so provider source addresses cannot be reinterpreted.
|
|
111
|
+
*/
|
|
112
|
+
export declare function runOpenTofuWithStatus(args: readonly string[], opts?: {
|
|
113
|
+
cwd?: string;
|
|
114
|
+
}): Promise<void>;
|
|
115
|
+
/** Capture bounded, machine-consumed OpenTofu stdout while preserving stderr. */
|
|
116
|
+
export declare function runOpenTofuCapture(args: readonly string[], opts?: {
|
|
117
|
+
cwd?: string;
|
|
118
|
+
suppressStderr?: boolean;
|
|
119
|
+
binary?: string;
|
|
120
|
+
}): Promise<string>;
|
|
121
|
+
/**
|
|
122
|
+
* Run `ei` capturing stdout (the machine-consumed stream); stderr is routed by
|
|
123
|
+
* EDK to the diagnostics sink. Non-zero exit rejects — partial output must be
|
|
124
|
+
* discarded.
|
|
125
|
+
*
|
|
126
|
+
* `echoStdout` additionally tees stdout to OUR stderr as it arrives, for long
|
|
127
|
+
* captured commands whose output is also the user's only progress signal
|
|
128
|
+
* (adoption's `ei plan`). It never moves anything onto our stdout, so the
|
|
129
|
+
* caller's single-JSON-summary contract holds.
|
|
130
|
+
*/
|
|
131
|
+
export declare function runEiCapture(args: readonly string[], opts?: {
|
|
132
|
+
cwd?: string;
|
|
133
|
+
env?: NodeJS.ProcessEnv;
|
|
134
|
+
suppressStderr?: boolean;
|
|
135
|
+
echoStdout?: boolean;
|
|
136
|
+
tofuJsonProgress?: {
|
|
137
|
+
readonly expectedAddresses: ReadonlySet<string>;
|
|
138
|
+
};
|
|
139
|
+
}): Promise<string>;
|
|
140
|
+
export type TofuJsonEvent = {
|
|
141
|
+
readonly type: "refresh_start" | "refresh_complete";
|
|
142
|
+
readonly address: string;
|
|
143
|
+
readonly message?: string;
|
|
144
|
+
} | {
|
|
145
|
+
readonly type: "diagnostic";
|
|
146
|
+
readonly level: "INFO" | "WARN" | "ERROR";
|
|
147
|
+
readonly message: string;
|
|
148
|
+
} | {
|
|
149
|
+
readonly type: "other";
|
|
150
|
+
};
|
|
151
|
+
/** Parse the stable subset of OpenTofu's line-delimited JSON UI used by adoption. */
|
|
152
|
+
export declare function parseTofuJsonEvent(line: string): TofuJsonEvent;
|
|
153
|
+
/** Capture both bridge output streams for small machine-inspection commands. */
|
|
154
|
+
export declare function runEiCaptureCombined(args: readonly string[], opts?: {
|
|
155
|
+
cwd?: string;
|
|
156
|
+
}): Promise<string>;
|
|
157
|
+
/** Max characters kept per diagnostic (edk#1402). */
|
|
158
|
+
export declare const TOFU_DIAGNOSTIC_MAX_CHARS = 1000;
|
|
159
|
+
/** Max diagnostics reported after a failed plan (edk#1402). */
|
|
160
|
+
export declare const TOFU_DIAGNOSTIC_MAX_ENTRIES = 50;
|
|
161
|
+
/** Cap a diagnostic list to `max` entries, adding an "… and N more" line. */
|
|
162
|
+
export declare function capTofuDiagnostics(diagnostics: readonly string[], max?: number): string[];
|
|
163
|
+
/**
|
|
164
|
+
* Error diagnostics from a failed OpenTofu run: `diagnostic` events with
|
|
165
|
+
* severity error from `-json` stdout, plus human `Error:` blocks from stderr.
|
|
166
|
+
* Deduplicated, in order. Used to explain why `ei plan` failed instead of
|
|
167
|
+
* discarding its output (edk#1402).
|
|
168
|
+
*/
|
|
169
|
+
export declare function tofuErrorDiagnostics(stdout: string | undefined, stderr: string | undefined): string[];
|