@elementumai/edk 0.9.19 → 0.9.20
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 +146 -6
- package/dist-sdk/src/catalog/factories.d.ts +24 -1
- package/dist-sdk/src/catalog/factories.js +30 -0
- 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 +7 -0
- package/dist-sdk/src/catalog/types.d.ts +34 -1
- package/dist-sdk/src/catalog/types.js +11 -0
- package/dist-sdk/src/core/triggers/on-demand.d.ts +39 -3
- package/dist-sdk/src/core/triggers/on-demand.js +10 -2
- package/dist-sdk/src/engine/build/context.d.ts +1 -1
- package/dist-sdk/src/engine/ei/run.d.ts +149 -0
- package/dist-sdk/src/engine/ei/run.js +1132 -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/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 +87 -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 +6 -0
- package/dist-sdk/src/engine/tf/labels.js +9 -0
- package/dist-sdk/src/engine/tf/model.d.ts +22 -1
- package/dist-sdk/src/engine/tf/parse.js +92 -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 +39 -0
- package/dist-sdk/src/engine/validation.js +85 -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.js +4 -2
- package/dist-sdk/src/entities/agent/to-tf.js +6 -3
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +2 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.js +7 -1
- 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/build.d.ts +89 -20
- package/dist-sdk/src/entities/app/build.js +51 -6
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +16 -0
- package/dist-sdk/src/entities/app/from-tf.d.ts +1 -0
- package/dist-sdk/src/entities/app/from-tf.js +7 -2
- package/dist-sdk/src/entities/app/index.d.ts +6 -6
- package/dist-sdk/src/entities/app/index.js +1 -0
- package/dist-sdk/src/entities/app/module.js +5 -2
- package/dist-sdk/src/entities/app/to-tf.js +19 -11
- package/dist-sdk/src/entities/automation/build.d.ts +47 -5
- package/dist-sdk/src/entities/automation/build.js +137 -20
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +24 -1
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +314 -39
- package/dist-sdk/src/entities/automation/from-tf.d.ts +28 -6
- package/dist-sdk/src/entities/automation/from-tf.js +428 -48
- 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.js +37 -8
- 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 +17 -0
- package/dist-sdk/src/entities/automation/script-code.js +91 -5
- package/dist-sdk/src/entities/automation/system-ref-name.js +4 -0
- package/dist-sdk/src/entities/automation/task-output-labels.d.ts +2 -0
- package/dist-sdk/src/entities/automation/task-output-labels.js +9 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +24 -2
- package/dist-sdk/src/entities/automation/tasks.js +38 -9
- package/dist-sdk/src/entities/automation/to-tf.d.ts +4 -0
- package/dist-sdk/src/entities/automation/to-tf.js +489 -83
- package/dist-sdk/src/entities/automation/triggers.d.ts +4 -2
- package/dist-sdk/src/entities/automation/triggers.js +4 -0
- package/dist-sdk/src/entities/chart/to-tf.js +10 -3
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +24 -31
- package/dist-sdk/src/entities/element/build.d.ts +25 -13
- package/dist-sdk/src/entities/element/build.js +4 -1
- package/dist-sdk/src/entities/element/from-tf.d.ts +11 -0
- package/dist-sdk/src/entities/element/from-tf.js +58 -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.js +8 -2
- package/dist-sdk/src/entities/field/build.d.ts +14 -1
- package/dist-sdk/src/entities/field/build.js +3 -0
- package/dist-sdk/src/entities/field/from-tf.d.ts +1 -0
- package/dist-sdk/src/entities/field/from-tf.js +39 -1
- 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 +1 -0
- package/dist-sdk/src/entities/field/to-tf.d.ts +23 -2
- package/dist-sdk/src/entities/field/to-tf.js +130 -14
- 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/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 +17 -5
- 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/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 +8 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +2 -0
- package/dist-sdk/src/entities/shared/filters/index.js +14 -4
- package/dist-sdk/src/entities/shared/filters/print.js +17 -1
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +2 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +5 -1
- package/dist-sdk/src/entities/shared/filters/types.d.ts +9 -1
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +10 -5
- package/dist-sdk/src/entities/shared/types/field-types.js +4 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +2 -1
- package/dist-sdk/src/entities/skill/from-tf.js +66 -13
- 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/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 +8 -2
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +2 -2
- package/dist-sdk/src/entities/skill-tool/to-tf.js +27 -5
- 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/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 +124 -12
- package/dist-sdk/src/entities/view/module.js +30 -3
- package/dist-sdk/src/entities/view/to-tf.d.ts +14 -1
- package/dist-sdk/src/entities/view/to-tf.js +67 -10
- 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/widget/build.d.ts +16 -1
- package/dist-sdk/src/entities/widget/build.js +11 -1
- package/dist-sdk/src/entities/widget/to-tf.js +34 -8
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +16 -5
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
- package/dist-sdk/src/graph/index.d.ts +11 -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 +55 -2
- package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
- package/dist-sdk/src/internal/sdk-package.js +1 -0
- package/package.json +10 -1
|
@@ -27,6 +27,15 @@
|
|
|
27
27
|
export const PROCEDURE_PARAMETER_TYPES = [
|
|
28
28
|
"BOOLEAN", "DATE", "DATETIME", "DECIMAL", "HANDLE", "JSON", "LONG", "TEXT", "UUID",
|
|
29
29
|
];
|
|
30
|
+
/** The kinds of managed view an app or element owns, as their authoring bags name them. */
|
|
31
|
+
export const viewType = {
|
|
32
|
+
list: "list",
|
|
33
|
+
calendar: "calendar",
|
|
34
|
+
kanban: "kanban",
|
|
35
|
+
dashboard: "dashboard",
|
|
36
|
+
agent: "agent",
|
|
37
|
+
custom: "custom",
|
|
38
|
+
};
|
|
30
39
|
/** Platform-owned user attributes accepted by user-search task filters. */
|
|
31
40
|
export const USER_FIELD_KEYS = ["firstName", "email", "jobTitle", "lastName"];
|
|
32
41
|
/** Platform-owned user-group attributes accepted by user-group-search task filters. */
|
|
@@ -54,6 +63,7 @@ export const REF_SCOPE = {
|
|
|
54
63
|
storedFunction: "org",
|
|
55
64
|
procedure: "org",
|
|
56
65
|
field: "app",
|
|
66
|
+
view: "app",
|
|
57
67
|
searchTable: "app",
|
|
58
68
|
datamine: "app",
|
|
59
69
|
documentModel: "app",
|
|
@@ -67,6 +77,7 @@ export const REF_SCOPE = {
|
|
|
67
77
|
app: "registry",
|
|
68
78
|
element: "registry",
|
|
69
79
|
task: "registry",
|
|
80
|
+
portal: "registry",
|
|
70
81
|
triggerParameter: "app",
|
|
71
82
|
outputProperty: "app",
|
|
72
83
|
};
|
|
@@ -18,11 +18,23 @@ interface TriggerInputFieldDefBase {
|
|
|
18
18
|
description?: string;
|
|
19
19
|
}
|
|
20
20
|
export interface ScalarTriggerInputFieldDef extends TriggerInputFieldDefBase {
|
|
21
|
-
type: Exclude<TriggerFieldTypeAlias, "record">;
|
|
21
|
+
type: Exclude<TriggerFieldTypeAlias, "record" | "userId">;
|
|
22
22
|
multiple?: boolean;
|
|
23
23
|
defaultValue?: unknown;
|
|
24
24
|
app?: never;
|
|
25
25
|
}
|
|
26
|
+
/** A user by email, as `userRef("person@example.com")` builds it. */
|
|
27
|
+
export interface OnDemandUserDefault {
|
|
28
|
+
readonly __kind: "user";
|
|
29
|
+
readonly email: string;
|
|
30
|
+
}
|
|
31
|
+
export interface UserIdTriggerInputFieldDef extends TriggerInputFieldDefBase {
|
|
32
|
+
type: "userId";
|
|
33
|
+
multiple?: boolean;
|
|
34
|
+
/** Resolved by email to the platform user id at apply; raw user ids are refused. */
|
|
35
|
+
defaultValue?: OnDemandUserDefault;
|
|
36
|
+
app?: never;
|
|
37
|
+
}
|
|
26
38
|
export interface RecordTriggerInputFieldDef<A extends AppOrElementRef = AppOrElementRef> extends TriggerInputFieldDefBase {
|
|
27
39
|
type: "record";
|
|
28
40
|
/** App or element whose record this input accepts; supplies the HCL default and typed record shape. */
|
|
@@ -30,7 +42,7 @@ export interface RecordTriggerInputFieldDef<A extends AppOrElementRef = AppOrEle
|
|
|
30
42
|
multiple?: false;
|
|
31
43
|
defaultValue?: never;
|
|
32
44
|
}
|
|
33
|
-
export type TriggerInputFieldDef = ScalarTriggerInputFieldDef | RecordTriggerInputFieldDef;
|
|
45
|
+
export type TriggerInputFieldDef = ScalarTriggerInputFieldDef | UserIdTriggerInputFieldDef | RecordTriggerInputFieldDef;
|
|
34
46
|
/**
|
|
35
47
|
* Schema object mapping field names to their definitions.
|
|
36
48
|
* Example:
|
|
@@ -46,9 +58,33 @@ export type TriggerInputSchema = Record<string, TriggerInputFieldDef>;
|
|
|
46
58
|
* app/element, so `ctx.trigger.<name>` has that target's RecordShape.
|
|
47
59
|
*/
|
|
48
60
|
type TriggerInputFieldToTS<D extends TriggerInputFieldDef> = D extends RecordTriggerInputFieldDef<infer A> ? RecordShape<A> : FieldTypeToTS<D["type"]>;
|
|
61
|
+
/** The user who ran an on-demand automation (the platform's "Triggered By" refs). */
|
|
62
|
+
export interface OnDemandTriggeredBy {
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly email: string;
|
|
65
|
+
readonly name: string;
|
|
66
|
+
}
|
|
49
67
|
export type InferTriggerType<S extends TriggerInputSchema> = {
|
|
50
68
|
[K in keyof S]: TriggerInputFieldToTS<S[K]>;
|
|
51
69
|
};
|
|
70
|
+
/** Inputs the platform publishes no reference for: a userId input is only a Run Automation button binding. */
|
|
71
|
+
type UnreadableInputKeys<S> = {
|
|
72
|
+
[K in keyof S]: S[K] extends {
|
|
73
|
+
readonly type: "userId";
|
|
74
|
+
} ? K : never;
|
|
75
|
+
}[keyof S];
|
|
76
|
+
/**
|
|
77
|
+
* The on-demand `ctx.trigger`: readable inputs plus the user who ran the
|
|
78
|
+
* automation. `S` is the normalized authored schema. `triggeredBy` is
|
|
79
|
+
* reserved, so no input can shadow it. A schema with a `userId` input also
|
|
80
|
+
* loses the open string index, which would otherwise still type
|
|
81
|
+
* `ctx.trigger.<thatInput>` as a ref a task input accepts.
|
|
82
|
+
*/
|
|
83
|
+
export type WithOnDemandTriggeredBy<T, S> = {
|
|
84
|
+
[K in keyof T as K extends UnreadableInputKeys<S> ? never : string extends K ? [UnreadableInputKeys<S>] extends [never] ? K : never : K]: T[K];
|
|
85
|
+
} & {
|
|
86
|
+
readonly triggeredBy: OnDemandTriggeredBy;
|
|
87
|
+
};
|
|
52
88
|
export interface OnDemandTriggerDef<T, S extends TriggerInputSchema = TriggerInputSchema> {
|
|
53
89
|
readonly kind: "onDemand";
|
|
54
90
|
readonly schema: S;
|
|
@@ -103,7 +139,7 @@ type WireDefaultValue = {
|
|
|
103
139
|
} | {
|
|
104
140
|
datetime: string;
|
|
105
141
|
} | {
|
|
106
|
-
userId:
|
|
142
|
+
userId: OnDemandUserDefault;
|
|
107
143
|
} | {
|
|
108
144
|
attachmentId: string;
|
|
109
145
|
};
|
|
@@ -77,8 +77,16 @@ function wrapDefaultValueForWire(alias, value) {
|
|
|
77
77
|
// Expected wire form: ISO-8601 instant — Jackson's Instant parser.
|
|
78
78
|
return { datetime: value };
|
|
79
79
|
case "user":
|
|
80
|
+
case "userId": {
|
|
80
81
|
// Mobius's record field is named `userId`, not `user`.
|
|
81
|
-
|
|
82
|
+
const user = value;
|
|
83
|
+
if (typeof user !== "object" || user === null || user.__kind !== "user" || typeof user.email !== "string" || !user.email.includes("@")) {
|
|
84
|
+
throw new TypeError(`onDemand input default value for type "userId" must be userRef("person@example.com") ` +
|
|
85
|
+
`(got ${JSON.stringify(value)}). Raw platform user ids are not portable between orgs; ` +
|
|
86
|
+
`the email is resolved to the user's id at apply.`);
|
|
87
|
+
}
|
|
88
|
+
return { userId: { __kind: "user", email: user.email } };
|
|
89
|
+
}
|
|
82
90
|
case "attachmentId":
|
|
83
91
|
return { attachmentId: value };
|
|
84
92
|
case "record":
|
|
@@ -88,7 +96,7 @@ function wrapDefaultValueForWire(alias, value) {
|
|
|
88
96
|
case "object":
|
|
89
97
|
throw new Error(`onDemand input default values are not supported for type "${alias}". ` +
|
|
90
98
|
`Defaults are only accepted for text / number / decimal / boolean / ` +
|
|
91
|
-
`date / datetime /
|
|
99
|
+
`date / datetime / userId. Drop the defaultValue, or pick a supported ` +
|
|
92
100
|
`type for this input.`);
|
|
93
101
|
}
|
|
94
102
|
}
|
|
@@ -82,7 +82,7 @@ export interface OrgRefLookup {
|
|
|
82
82
|
* since it's usually the same value also used for the sibling
|
|
83
83
|
* `related_object_id` attribute.
|
|
84
84
|
*/
|
|
85
|
-
foreignField(type: string, tfLabel: string, objectId: TfValue, name: string): void;
|
|
85
|
+
foreignField(type: string, tfLabel: string, objectId: TfValue, name: string, extraAttrs?: Readonly<Record<string, TfValue>>): void;
|
|
86
86
|
}
|
|
87
87
|
/** A stream root discovered elsewhere in THIS workspace build, keyed by {@link workspaceAspectKey}. */
|
|
88
88
|
export interface WorkspaceAspect {
|
|
@@ -0,0 +1,149 @@
|
|
|
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
|
+
constructor(message: string, exitCode: number | null, stderr?: string);
|
|
26
|
+
}
|
|
27
|
+
export declare function configureBridgeProfile(profile: string | undefined): void;
|
|
28
|
+
export declare function configuredBridgeProfile(): string | undefined;
|
|
29
|
+
export declare function managedElementumRoot(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Resolve the private Go bridge.
|
|
32
|
+
*
|
|
33
|
+
* 1. `ELEMENTUM_BRIDGE_PATH` — explicit pin, always honored (relative paths
|
|
34
|
+
* resolve against cwd). Empty/whitespace is treated as unset.
|
|
35
|
+
* 2. Managed libexec — `~/.elementum/libexec/elementum/ei` (or `$ELEMENTUM_HOME/...`).
|
|
36
|
+
* Installed toolchains keep `ei` here, not on PATH (`~/.elementum/bin` only
|
|
37
|
+
* has `elementum`). Preferring this over PATH keeps the CLI on the
|
|
38
|
+
* version-locked train when a source-built or leftover `ei` is also on PATH.
|
|
39
|
+
* 3. PATH — OS-native lookup for `ei`. Used when there is no managed install
|
|
40
|
+
* (source-built bridge on PATH, no installer).
|
|
41
|
+
*/
|
|
42
|
+
export declare function resolveEiBinary(): string;
|
|
43
|
+
/**
|
|
44
|
+
* Resolve the OpenTofu binary shipped in the same managed Elementum train.
|
|
45
|
+
* Source development may explicitly select an engine for tests/local work;
|
|
46
|
+
* installed executions never fall back to a globally installed tofu binary.
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveOpenTofuBinary(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the bridge will resolve the plan engine to OpenTofu. OpenTofu is
|
|
51
|
+
* the only supported engine for `-target-file`; keep the adoption fallback
|
|
52
|
+
* conservative when an explicit Terraform command or a PATH-only install is
|
|
53
|
+
* in use.
|
|
54
|
+
*/
|
|
55
|
+
export declare function usesOpenTofuTargetFile(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The OpenTofu the bridge plans with: `ELEMENTUM_TERRAFORM_COMMAND`, else the
|
|
58
|
+
* managed OpenTofu, else `tofu` on PATH. Undefined when none is executable.
|
|
59
|
+
*/
|
|
60
|
+
export declare function resolveBridgeOpenTofu(): string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Read Cobra's root help without auth/profile resolution. This deliberately
|
|
63
|
+
* bypasses bridgeArgs: root discovery must stay local even when the Elementum
|
|
64
|
+
* invocation includes a global --profile.
|
|
65
|
+
*/
|
|
66
|
+
export declare function runEiLocalHelp(): Promise<string>;
|
|
67
|
+
/**
|
|
68
|
+
* Run a local (no auth, no profile) bridge command that reads `input` on stdin
|
|
69
|
+
* and returns stdout. Non-zero exit rejects with the captured stderr.
|
|
70
|
+
*/
|
|
71
|
+
export declare function runEiLocalWithInput(args: readonly string[], input: string): Promise<string>;
|
|
72
|
+
/**
|
|
73
|
+
* Run `ei` with EDK-owned streaming and return its exit code. The caller (a
|
|
74
|
+
* CLI pass-through) should `process.exit(code)` with it. Output is streamed
|
|
75
|
+
* rather than buffered so large OpenTofu plans do not hit a capture limit or
|
|
76
|
+
* deadlock the child. An interactive terminal run hands the child the
|
|
77
|
+
* terminal instead (see {@link passthroughNeedsTerminal}).
|
|
78
|
+
*/
|
|
79
|
+
export declare function runEiPassthrough(args: readonly string[], opts?: {
|
|
80
|
+
cwd?: string;
|
|
81
|
+
stdout?: NodeJS.WritableStream;
|
|
82
|
+
stderr?: NodeJS.WritableStream;
|
|
83
|
+
bridge?: boolean;
|
|
84
|
+
progressTotal?: number;
|
|
85
|
+
}): Promise<number>;
|
|
86
|
+
/** Returns and clears the partial reads reported by `runEiWithStatus` exports. */
|
|
87
|
+
export declare function takePartialReads(): PartialReadEvent[];
|
|
88
|
+
/**
|
|
89
|
+
* Run `ei` with EDK-owned streaming: stdout (status text) is routed to OUR
|
|
90
|
+
* progress stream and stderr to the diagnostics sink. For file-mode export
|
|
91
|
+
* calls — the caller's own stdout stays a single JSON summary whenever it is
|
|
92
|
+
* piped.
|
|
93
|
+
*/
|
|
94
|
+
export declare function runEiWithStatus(args: readonly string[], opts?: {
|
|
95
|
+
cwd?: string;
|
|
96
|
+
bridge?: boolean;
|
|
97
|
+
env?: NodeJS.ProcessEnv;
|
|
98
|
+
onProgress?: (event: ProgressEvent) => void;
|
|
99
|
+
userOutput?: NodeJS.WritableStream;
|
|
100
|
+
}): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Run the managed OpenTofu binary while reserving a piped stdout for the
|
|
103
|
+
* Elementum command's single result. Arguments are passed directly, never
|
|
104
|
+
* through a shell, so provider source addresses cannot be reinterpreted.
|
|
105
|
+
*/
|
|
106
|
+
export declare function runOpenTofuWithStatus(args: readonly string[], opts?: {
|
|
107
|
+
cwd?: string;
|
|
108
|
+
}): Promise<void>;
|
|
109
|
+
/** Capture bounded, machine-consumed OpenTofu stdout while preserving stderr. */
|
|
110
|
+
export declare function runOpenTofuCapture(args: readonly string[], opts?: {
|
|
111
|
+
cwd?: string;
|
|
112
|
+
suppressStderr?: boolean;
|
|
113
|
+
binary?: string;
|
|
114
|
+
}): Promise<string>;
|
|
115
|
+
/**
|
|
116
|
+
* Run `ei` capturing stdout (the machine-consumed stream); stderr is routed by
|
|
117
|
+
* EDK to the diagnostics sink. Non-zero exit rejects — partial output must be
|
|
118
|
+
* discarded.
|
|
119
|
+
*
|
|
120
|
+
* `echoStdout` additionally tees stdout to OUR stderr as it arrives, for long
|
|
121
|
+
* captured commands whose output is also the user's only progress signal
|
|
122
|
+
* (adoption's `ei plan`). It never moves anything onto our stdout, so the
|
|
123
|
+
* caller's single-JSON-summary contract holds.
|
|
124
|
+
*/
|
|
125
|
+
export declare function runEiCapture(args: readonly string[], opts?: {
|
|
126
|
+
cwd?: string;
|
|
127
|
+
suppressStderr?: boolean;
|
|
128
|
+
echoStdout?: boolean;
|
|
129
|
+
tofuJsonProgress?: {
|
|
130
|
+
readonly expectedAddresses: ReadonlySet<string>;
|
|
131
|
+
};
|
|
132
|
+
}): Promise<string>;
|
|
133
|
+
export type TofuJsonEvent = {
|
|
134
|
+
readonly type: "refresh_start" | "refresh_complete";
|
|
135
|
+
readonly address: string;
|
|
136
|
+
readonly message?: string;
|
|
137
|
+
} | {
|
|
138
|
+
readonly type: "diagnostic";
|
|
139
|
+
readonly level: "INFO" | "WARN" | "ERROR";
|
|
140
|
+
readonly message: string;
|
|
141
|
+
} | {
|
|
142
|
+
readonly type: "other";
|
|
143
|
+
};
|
|
144
|
+
/** Parse the stable subset of OpenTofu's line-delimited JSON UI used by adoption. */
|
|
145
|
+
export declare function parseTofuJsonEvent(line: string): TofuJsonEvent;
|
|
146
|
+
/** Capture both bridge output streams for small machine-inspection commands. */
|
|
147
|
+
export declare function runEiCaptureCombined(args: readonly string[], opts?: {
|
|
148
|
+
cwd?: string;
|
|
149
|
+
}): Promise<string>;
|