@elementumai/edk 0.8.0-preview.11 → 0.8.2-alpha.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/README.md +510 -324
- package/dist-sdk/src/catalog/ai-provider-models.d.ts +30 -0
- package/dist-sdk/src/catalog/ai-provider-models.js +63 -0
- package/dist-sdk/src/catalog/factories.d.ts +56 -3
- package/dist-sdk/src/catalog/factories.js +83 -4
- package/dist-sdk/src/catalog/from-authoring.js +19 -2
- package/dist-sdk/src/catalog/index.d.ts +3 -2
- package/dist-sdk/src/catalog/index.js +3 -2
- package/dist-sdk/src/catalog/org.d.ts +1 -1
- package/dist-sdk/src/catalog/org.js +134 -50
- package/dist-sdk/src/catalog/render.d.ts +13 -1
- package/dist-sdk/src/catalog/render.js +21 -4
- package/dist-sdk/src/catalog/token.js +18 -0
- package/dist-sdk/src/catalog/types.d.ts +75 -3
- package/dist-sdk/src/catalog/types.js +3 -0
- package/dist-sdk/src/core/system-fields.d.ts +2 -0
- package/dist-sdk/src/core/system-fields.js +2 -0
- package/dist-sdk/src/core/types/ai-provider.d.ts +10 -23
- package/dist-sdk/src/core/types/ai-provider.js +1 -25
- package/dist-sdk/src/core/types/app.d.ts +26 -1
- package/dist-sdk/src/engine/build/context.d.ts +58 -0
- package/dist-sdk/src/engine/build/context.js +11 -1
- package/dist-sdk/src/engine/build/source-context.d.ts +45 -0
- package/dist-sdk/src/engine/build/source-context.js +23 -0
- package/dist-sdk/src/engine/pull/context.d.ts +15 -0
- package/dist-sdk/src/engine/pull/org.d.ts +10 -0
- package/dist-sdk/src/engine/pull/org.js +34 -4
- package/dist-sdk/src/engine/tf/index.d.ts +2 -2
- package/dist-sdk/src/engine/tf/index.js +2 -2
- package/dist-sdk/src/engine/tf/labels.d.ts +54 -0
- package/dist-sdk/src/engine/tf/labels.js +75 -0
- package/dist-sdk/src/engine/tf/parse.d.ts +15 -0
- package/dist-sdk/src/engine/tf/parse.js +162 -0
- package/dist-sdk/src/entities/access-policy/build.d.ts +26 -0
- package/dist-sdk/src/entities/access-policy/build.js +7 -0
- package/dist-sdk/src/entities/access-policy/filter.d.ts +61 -0
- package/dist-sdk/src/entities/access-policy/filter.js +83 -0
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +66 -0
- package/dist-sdk/src/entities/access-policy/from-tf.js +187 -0
- package/dist-sdk/src/entities/access-policy/module.d.ts +3 -0
- package/dist-sdk/src/entities/access-policy/module.js +17 -0
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +43 -0
- package/dist-sdk/src/entities/access-policy/to-tf.js +164 -0
- package/dist-sdk/src/entities/access-policy/types.d.ts +4 -0
- package/dist-sdk/src/entities/access-policy/types.js +10 -0
- package/dist-sdk/src/entities/agent/build.d.ts +2 -0
- package/dist-sdk/src/entities/agent/build.js +1 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +38 -3
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +257 -32
- package/dist-sdk/src/entities/agent/from-tf.d.ts +29 -9
- package/dist-sdk/src/entities/agent/from-tf.js +146 -19
- package/dist-sdk/src/entities/agent/index.d.ts +1 -1
- package/dist-sdk/src/entities/agent/module.js +14 -4
- package/dist-sdk/src/entities/agent/to-tf.d.ts +46 -1
- package/dist-sdk/src/entities/agent/to-tf.js +160 -14
- package/dist-sdk/src/entities/agent/tools.d.ts +88 -9
- package/dist-sdk/src/entities/agent/tools.js +46 -7
- package/dist-sdk/src/entities/agent-a2a-skill/from-tf.d.ts +17 -0
- package/dist-sdk/src/entities/agent-a2a-skill/from-tf.js +64 -0
- package/dist-sdk/src/entities/agent-a2a-skill/module.d.ts +4 -0
- package/dist-sdk/src/entities/agent-a2a-skill/module.js +14 -0
- package/dist-sdk/src/entities/agent-a2a-skill/to-tf.d.ts +40 -0
- package/dist-sdk/src/entities/agent-a2a-skill/to-tf.js +47 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +51 -4
- package/dist-sdk/src/entities/agent-tool/from-tf.js +131 -35
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +11 -4
- package/dist-sdk/src/entities/agent-tool/to-tf.js +176 -30
- package/dist-sdk/src/entities/agent-tool/types.d.ts +5 -4
- package/dist-sdk/src/entities/agent-tool/types.js +38 -6
- package/dist-sdk/src/entities/app/build.d.ts +91 -13
- package/dist-sdk/src/entities/app/build.js +63 -5
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +3 -0
- package/dist-sdk/src/entities/app/from-tf.d.ts +1 -1
- package/dist-sdk/src/entities/app/from-tf.js +32 -22
- package/dist-sdk/src/entities/app/index.d.ts +4 -1
- package/dist-sdk/src/entities/app/index.js +2 -1
- package/dist-sdk/src/entities/app/module.js +10 -2
- package/dist-sdk/src/entities/app/to-tf.d.ts +5 -0
- package/dist-sdk/src/entities/app/to-tf.js +45 -4
- package/dist-sdk/src/entities/automation/build.d.ts +57 -13
- package/dist-sdk/src/entities/automation/build.js +62 -42
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +25 -8
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +16 -1
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +206 -47
- package/dist-sdk/src/entities/automation/filter.d.ts +37 -3
- package/dist-sdk/src/entities/automation/filter.js +54 -3
- package/dist-sdk/src/entities/automation/from-tf.d.ts +26 -27
- package/dist-sdk/src/entities/automation/from-tf.js +1344 -222
- package/dist-sdk/src/entities/automation/index.d.ts +4 -0
- package/dist-sdk/src/entities/automation/index.js +4 -0
- package/dist-sdk/src/entities/automation/module.js +29 -32
- package/dist-sdk/src/entities/automation/operators.d.ts +29 -2
- package/dist-sdk/src/entities/automation/operators.js +27 -1
- package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +19 -0
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +24 -0
- package/dist-sdk/src/entities/automation/script-code.d.ts +10 -21
- package/dist-sdk/src/entities/automation/script-code.js +272 -5
- package/dist-sdk/src/entities/automation/tasks.d.ts +125 -19
- package/dist-sdk/src/entities/automation/tasks.js +83 -15
- package/dist-sdk/src/entities/automation/to-tf.d.ts +10 -29
- package/dist-sdk/src/entities/automation/to-tf.js +1291 -230
- package/dist-sdk/src/entities/automation/triggers.d.ts +9 -1
- package/dist-sdk/src/entities/automation/types.d.ts +29 -4
- package/dist-sdk/src/entities/automation/types.js +76 -46
- package/dist-sdk/src/entities/element/build.d.ts +44 -13
- package/dist-sdk/src/entities/element/build.js +45 -3
- package/dist-sdk/src/entities/element/from-tf.d.ts +1 -1
- package/dist-sdk/src/entities/element/from-tf.js +28 -14
- package/dist-sdk/src/entities/element/index.d.ts +4 -1
- package/dist-sdk/src/entities/element/index.js +2 -1
- package/dist-sdk/src/entities/element/module.js +4 -1
- package/dist-sdk/src/entities/element/to-tf.js +26 -3
- package/dist-sdk/src/entities/field/build.d.ts +61 -14
- package/dist-sdk/src/entities/field/build.js +10 -0
- package/dist-sdk/src/entities/field/calc/runtime.js +4 -0
- package/dist-sdk/src/entities/field/from-tf.d.ts +5 -3
- package/dist-sdk/src/entities/field/from-tf.js +118 -7
- package/dist-sdk/src/entities/field/module.js +3 -2
- package/dist-sdk/src/entities/field/to-tf.d.ts +46 -11
- package/dist-sdk/src/entities/field/to-tf.js +166 -17
- package/dist-sdk/src/entities/field/types.d.ts +26 -0
- package/dist-sdk/src/entities/field/types.js +34 -12
- package/dist-sdk/src/entities/file-reader/build.d.ts +108 -50
- package/dist-sdk/src/entities/file-reader/build.js +23 -23
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +6 -0
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +109 -0
- package/dist-sdk/src/entities/file-reader/from-tf.d.ts +13 -0
- package/dist-sdk/src/entities/file-reader/from-tf.js +172 -0
- package/dist-sdk/src/entities/file-reader/index.d.ts +8 -3
- package/dist-sdk/src/entities/file-reader/index.js +7 -2
- package/dist-sdk/src/entities/file-reader/module.d.ts +3 -0
- package/dist-sdk/src/entities/file-reader/module.js +115 -0
- package/dist-sdk/src/entities/file-reader/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/file-reader/to-tf.js +84 -0
- package/dist-sdk/src/entities/file-reader/types.d.ts +32 -0
- package/dist-sdk/src/entities/file-reader/types.js +30 -0
- package/dist-sdk/src/entities/org/ai-provider.d.ts +13 -0
- package/dist-sdk/src/entities/org/ai-provider.js +46 -0
- package/dist-sdk/src/entities/org/connector.d.ts +8 -1
- package/dist-sdk/src/entities/org/connector.js +12 -14
- package/dist-sdk/src/entities/org/group.js +10 -1
- package/dist-sdk/src/entities/org/index.d.ts +1 -0
- package/dist-sdk/src/entities/org/index.js +1 -0
- package/dist-sdk/src/entities/org/user.js +10 -1
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +59 -9
- package/dist-sdk/src/entities/shared/filters/types.d.ts +1 -1
- package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +17 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.js +46 -0
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +10 -1
- package/dist-sdk/src/entities/shared/types/field-types.js +9 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +19 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +128 -11
- package/dist-sdk/src/entities/skill/from-tf.js +4 -3
- package/dist-sdk/src/entities/skill/index.d.ts +1 -1
- package/dist-sdk/src/entities/skill/module.js +7 -1
- package/dist-sdk/src/entities/skill/to-tf.d.ts +26 -0
- package/dist-sdk/src/entities/skill/to-tf.js +65 -4
- package/dist-sdk/src/entities/skill/tools.d.ts +37 -8
- package/dist-sdk/src/entities/skill/tools.js +43 -1
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +34 -4
- package/dist-sdk/src/entities/skill-tool/from-tf.js +128 -18
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +13 -1
- package/dist-sdk/src/entities/skill-tool/to-tf.js +164 -25
- package/dist-sdk/src/entities/skill-tool/types.d.ts +5 -7
- package/dist-sdk/src/entities/skill-tool/types.js +47 -11
- package/dist-sdk/src/entities/view/from-tf.d.ts +6 -2
- package/dist-sdk/src/entities/view/from-tf.js +11 -9
- package/dist-sdk/src/entities/view/to-tf.d.ts +9 -7
- package/dist-sdk/src/entities/view/to-tf.js +39 -18
- package/dist-sdk/src/entities/view/types.d.ts +1 -1
- package/dist-sdk/src/entities/view/types.js +1 -1
- package/dist-sdk/src/graph/deferred-catalog-render.d.ts +0 -5
- package/dist-sdk/src/graph/deferred-catalog-render.js +1 -20
- package/dist-sdk/src/graph/index.d.ts +8 -0
- package/dist-sdk/src/graph/index.js +13 -9
- package/dist-sdk/src/graph/modules.js +8 -1
- package/dist-sdk/src/graph/types.d.ts +98 -4
- package/package.json +49 -16
- package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +0 -76
- package/dist-sdk/src/entities/automation/value-ref-tf.js +0 -190
package/README.md
CHANGED
|
@@ -1,409 +1,595 @@
|
|
|
1
1
|
# @elementumai/edk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Statically typed TypeScript SDK for authoring Elementum apps, elements,
|
|
4
|
+
automations, agents, skills, flows, search tables, and related configuration as
|
|
5
|
+
code. `@elementumai/edk` is SDK-only; the standalone `elementum` CLI is
|
|
6
|
+
distributed separately as part of the signed toolchain.
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
This repository is the canonical source for the public SDK, the standalone
|
|
9
|
+
`elementum` CLI, the OpenTofu provider under `provider/`, and the temporary
|
|
10
|
+
private bridge under `cmd/elementum/`. The installed toolchain manages
|
|
11
|
+
the bridge and OpenTofu; neither is a separate public executable or checkout.
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
npm install @elementumai/edk
|
|
9
|
-
```
|
|
13
|
+
## Installation
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
Install the authenticated macOS or Linux x64 toolchain:
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
```sh
|
|
18
|
+
curl -fsSL https://elementum-toolchain-distribution.vercel.app | sh
|
|
19
|
+
elementum init
|
|
20
|
+
```
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
The installer places `elementum` in `~/.elementum/bin` and adds that directory
|
|
23
|
+
to PATH via your shell profile (`~/.zprofile` for zsh, otherwise the applicable
|
|
24
|
+
profile file). The current shell won't see it until the profile reloads.
|
|
17
25
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
```
|
|
26
|
+
Install the SDK in the package workspace that contains your Elementum org
|
|
27
|
+
folders:
|
|
21
28
|
|
|
22
|
-
|
|
29
|
+
```sh
|
|
30
|
+
npm install @elementumai/edk
|
|
31
|
+
```
|
|
23
32
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
edk plan
|
|
33
|
+
Use Node 24 or newer. The npm package is the authoring SDK; the only public
|
|
34
|
+
executable is `elementum`.
|
|
27
35
|
|
|
28
|
-
|
|
29
|
-
edk plan --organization <organization> --environment <environment> --instance <instance> \
|
|
30
|
-
--client-id "$ELEMENTUM_CLIENT_ID" --client-secret "$ELEMENTUM_CLIENT_SECRET"
|
|
36
|
+
### Platform support
|
|
31
37
|
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
The authenticated `elementum` toolchain targets macOS Apple Silicon
|
|
39
|
+
(`darwin-arm64`), macOS Intel (`darwin-x64`), and Linux x64
|
|
40
|
+
(`linux-x64`, glibc). Linux distribution work is tracked in
|
|
41
|
+
[#186](https://github.com/elementum-fde/edk/issues/186). The authoring SDK
|
|
42
|
+
(`@elementumai/edk`) remains pure TypeScript and runs anywhere Node 24+ runs.
|
|
34
43
|
|
|
35
|
-
|
|
36
|
-
edk plan --profile-env-file=.env.staging
|
|
37
|
-
```
|
|
44
|
+
## Authentication and profiles
|
|
38
45
|
|
|
39
|
-
|
|
46
|
+
The SDK is credential-free and never calls the platform. Authentication and all
|
|
47
|
+
platform I/O are owned by the managed private bridge:
|
|
40
48
|
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
```sh
|
|
50
|
+
elementum auth login --profile <profile>
|
|
51
|
+
elementum --profile=<profile> auth status
|
|
44
52
|
```
|
|
45
53
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
**Before apply:** run `edk plan`. This validates that the workspace folder's
|
|
51
|
-
instance/org matches `ei auth status`.
|
|
54
|
+
A profile selects the organization, instance, optional organization
|
|
55
|
+
environment, credentials, and custom endpoints. Pass it explicitly before any
|
|
56
|
+
command when reproducibility matters:
|
|
52
57
|
|
|
53
|
-
|
|
58
|
+
```sh
|
|
59
|
+
elementum --profile=<profile> pull org --data-only
|
|
60
|
+
elementum --profile=<profile> plan
|
|
61
|
+
```
|
|
54
62
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
63
|
+
For `plan` and `apply`, `--profile` is optional. The CLI resolves the marked org
|
|
64
|
+
root from the explicit target or current directory, including targets nested
|
|
65
|
+
under `apps/`, `elements/`, or an individual authored file. It reads
|
|
66
|
+
`<instance>/<organization>` from that org root's path and selects the one saved
|
|
67
|
+
profile with the same identity. It does not infer tenant identity from shell
|
|
68
|
+
variables.
|
|
69
|
+
|
|
70
|
+
An explicit `--profile` overrides filesystem selection. The existing safety
|
|
71
|
+
check still rejects that profile if its instance or organization differs from
|
|
72
|
+
the workspace path. If no saved profile matches, or multiple profiles have the
|
|
73
|
+
same filesystem identity, the command fails before planning with the workspace
|
|
74
|
+
identity and tells you to pass `--profile` explicitly. Commands that bootstrap a
|
|
75
|
+
workspace should use an explicit profile because no org root exists yet.
|
|
76
|
+
|
|
77
|
+
## Workspace setup
|
|
78
|
+
|
|
79
|
+
Start from the parent directory that will contain one or more
|
|
80
|
+
`<instance>/<organization>` workspaces:
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
mkdir elementum-workspace
|
|
84
|
+
cd elementum-workspace
|
|
85
|
+
npm init -y
|
|
86
|
+
npm install @elementumai/edk
|
|
87
|
+
elementum auth login --profile <profile>
|
|
88
|
+
elementum --profile=<profile> pull org --data-only
|
|
89
|
+
cd <instance>/<organization>
|
|
90
|
+
elementum --profile=<profile> init
|
|
58
91
|
```
|
|
59
92
|
|
|
60
|
-
`
|
|
61
|
-
|
|
62
|
-
|
|
93
|
+
`pull org --data-only` bootstraps and refreshes org reference identities. It
|
|
94
|
+
creates the package/workspace scaffolding, `org.ts`, the `@catalog` path alias,
|
|
95
|
+
and the Terraform input/output skeleton:
|
|
63
96
|
|
|
64
97
|
```text
|
|
65
98
|
<workspace>/
|
|
66
99
|
package.json
|
|
67
|
-
.npmrc
|
|
68
100
|
<instance>/
|
|
69
|
-
<
|
|
101
|
+
<organization>/
|
|
102
|
+
org.ts
|
|
103
|
+
tsconfig.json
|
|
104
|
+
backend.tf # optional locking backend; user-owned and committed
|
|
105
|
+
terraform.tfstate # committed local state when backend.tf is absent
|
|
70
106
|
apps/
|
|
71
107
|
elements/
|
|
72
|
-
tables/
|
|
73
108
|
generated/
|
|
74
109
|
catalog.ts
|
|
75
|
-
|
|
110
|
+
.tf/ # generated and ignored
|
|
111
|
+
in/ # bridge export input
|
|
112
|
+
out/ # SDK build output
|
|
76
113
|
```
|
|
77
114
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
115
|
+
`elementum init` is an idempotent installation/workspace convergence command.
|
|
116
|
+
It verifies the managed compatibility train, auth, SDK namespace/version,
|
|
117
|
+
workspace layout, and provider identity. It never logs in or silently migrates
|
|
118
|
+
Terraform state.
|
|
81
119
|
|
|
82
|
-
|
|
83
|
-
|
|
120
|
+
Do not hand-edit `org.ts`, `generated/`, or `.tf/`. Refresh those through their
|
|
121
|
+
owning commands.
|
|
84
122
|
|
|
85
|
-
|
|
86
|
-
to `<cwd>/<instance>/<org>` from `ei auth`: for example, from `edk-project`,
|
|
87
|
-
the `edk` org on instance `dev` writes `dev/edk/generated/...` and
|
|
88
|
-
`dev/edk/apps/...`. Plan/apply refuse a folder that doesn't match the active
|
|
89
|
-
ei profile.
|
|
123
|
+
## Recommended flow
|
|
90
124
|
|
|
91
|
-
|
|
125
|
+
Pull first when editing an object that already exists:
|
|
92
126
|
|
|
93
|
-
|
|
127
|
+
```sh
|
|
128
|
+
cd <workspace>/<instance>/<organization>
|
|
129
|
+
elementum --profile=<profile> pull org --data-only
|
|
130
|
+
elementum --profile=<profile> pull app <namespace>
|
|
131
|
+
# or: elementum --profile=<profile> pull element <namespace>
|
|
94
132
|
|
|
95
|
-
|
|
133
|
+
# edit apps/<ref>/... or elements/<ref>/...
|
|
134
|
+
npx tsc --noEmit
|
|
135
|
+
elementum build
|
|
136
|
+
elementum --profile=<profile> plan
|
|
137
|
+
elementum --profile=<profile> apply
|
|
138
|
+
```
|
|
96
139
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
140
|
+
`pull app` and `pull element` reconstruct editable TypeScript, regenerate the
|
|
141
|
+
catalog, then automatically adopt the exported resources into the configured
|
|
142
|
+
Terraform state. Adoption is gated to exactly the expected imports, zero
|
|
143
|
+
create/update/destroy operations, and a clean follow-up plan. Use `--no-adopt`
|
|
144
|
+
only when you deliberately want source without state adoption.
|
|
145
|
+
|
|
146
|
+
Pull commands reserve stdout for one JSON summary. Diagnostics and stream kinds
|
|
147
|
+
that do not yet have an extractor are reported rather than silently discarded.
|
|
148
|
+
|
|
149
|
+
## CLI commands
|
|
150
|
+
|
|
151
|
+
The TypeScript-owned command surface is:
|
|
152
|
+
|
|
153
|
+
```sh
|
|
154
|
+
elementum init [--check] [--json]
|
|
155
|
+
elementum update [--check | --dry-run] [--channel stable|preview] [--version <semver>]
|
|
156
|
+
elementum migrate backend [orgRoot] [--check | --dry-run | --auto-approve] [--reconfigure]
|
|
157
|
+
elementum migrate provider-source [orgRoot] [--check | --dry-run | --auto-approve]
|
|
158
|
+
|
|
159
|
+
elementum pull org --data-only [--root <orgRoot>]
|
|
160
|
+
elementum pull app <namespace> [--root <orgRoot>] [--no-adopt]
|
|
161
|
+
elementum pull element <namespace> [--root <orgRoot>] [--no-adopt]
|
|
162
|
+
elementum clone app <namespace> --as <newName> [--namespace <newns>] [--root <orgRoot>]
|
|
163
|
+
elementum build [orgRoot]
|
|
164
|
+
elementum plan [orgRoot-or-nested-target] [bridge args...]
|
|
165
|
+
elementum apply [orgRoot-or-nested-target] [bridge args...]
|
|
166
|
+
|
|
167
|
+
elementum list apps|elements|users|groups|categories|cloud-links
|
|
168
|
+
elementum list ai-provider-connectors|automations|tables
|
|
169
|
+
elementum new app --name "Support Tickets" --namespace support --category "Operations"
|
|
170
|
+
elementum new element --name "Locations" --namespace locations --category "Operations"
|
|
171
|
+
elementum new agent --app <appRef> --name "Triage Bot"
|
|
172
|
+
elementum new skill --app <appRef> --name "Lookup Ticket"
|
|
173
|
+
elementum new automation --app <appRef> --name "Escalate Ticket"
|
|
174
|
+
elementum generate [path] [--root <orgRoot>]
|
|
175
|
+
elementum canvas <orgRoot-or-file> [--port <port>] [--no-open]
|
|
176
|
+
elementum playbooks list|install|status|path|print
|
|
105
177
|
```
|
|
106
178
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
`
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
edk list users
|
|
119
|
-
edk list groups
|
|
120
|
-
edk list categories
|
|
121
|
-
edk list cloud-links
|
|
122
|
-
edk list ai-provider-connectors
|
|
123
|
-
edk fetch app --aspect-id <uuid> --fields --agents --automations --search-tables
|
|
124
|
-
edk import org
|
|
125
|
-
edk import app --id <uuid>
|
|
126
|
-
edk import element --id <uuid>
|
|
127
|
-
edk import cloud-links
|
|
128
|
-
edk import connectors
|
|
129
|
-
edk import automation --id <uuid> --app-id <uuid>
|
|
130
|
-
edk import agent --id <uuid> --app-id <uuid>
|
|
131
|
-
edk import skill --id <uuid> --app-id <uuid>
|
|
132
|
-
edk new agent --app <appRef> --name "Triage Bot"
|
|
133
|
-
edk new skill --app <appRef> --name "Lookup Ticket"
|
|
134
|
-
edk plan <instance>/<org>
|
|
135
|
-
edk plan <instance>/<org>/apps/<appRef>
|
|
136
|
-
edk apply <instance>/<org>
|
|
137
|
-
edk apply <instance>/<org>/apps/<appRef>
|
|
138
|
-
edk pull app --id <uuid> --all
|
|
139
|
-
edk pull app --aspect-id <uuid>
|
|
140
|
-
edk pull app --aspect-id <uuid> --all
|
|
141
|
-
edk pull element --id <uuid>
|
|
142
|
-
edk pull element --id <uuid> --all
|
|
143
|
-
edk pull automation --workflow <uuid>
|
|
144
|
-
edk pull agent --agent <uuid>
|
|
145
|
-
edk pull skill --skill <uuid>
|
|
146
|
-
edk pull search-table --aspect <uuid> --search-table <uuid>
|
|
147
|
-
edk pull -i
|
|
148
|
-
edk canvas <instance>/<org>/apps/myApp/automations/someAutomation.ts
|
|
149
|
-
edk skills path
|
|
150
|
-
edk skills print
|
|
179
|
+
`auth` and other bridge-owned commands route through the managed bridge. Run
|
|
180
|
+
`elementum --help` for the combined local and bridge command surface.
|
|
181
|
+
|
|
182
|
+
`build` loads app, element, and supported child authoring files and replaces its
|
|
183
|
+
marker-owned files under `.tf/out/`; it never calls the platform. `plan` and
|
|
184
|
+
`apply` run from `.tf/out/`, initialize OpenTofu there when necessary, and
|
|
185
|
+
forward extra arguments:
|
|
186
|
+
|
|
187
|
+
```sh
|
|
188
|
+
elementum plan <instance>/<organization>/apps/myApp/myApp.ts
|
|
189
|
+
elementum --profile=<profile> apply <instance>/<organization> -auto-approve
|
|
151
190
|
```
|
|
152
191
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
`
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
commented-out example call for each of the six skill tool factories
|
|
181
|
-
(`skillSearchAspect`, `skillSearchTable`, `skillCreateRecord`,
|
|
182
|
-
`skillUpdateRecord`, `skillAutomation`, `skillRunAgent`) with the app's own
|
|
183
|
-
handle already filled in — uncomment whichever kinds you need, add the
|
|
184
|
-
matching import, and autocomplete the remaining `catalog.` refs.
|
|
185
|
-
|
|
186
|
-
Ignore legacy top-level files such as `generated/apps/aspects-catalog.ts`
|
|
187
|
-
(sometimes remembered as `aspect-catalog.ts`) if you find them in an older
|
|
188
|
-
workspace. Current catalogs live under each instance/org folder, for example
|
|
189
|
-
`<instance>/<organization>/generated/catalog.ts` and
|
|
190
|
-
`<instance>/<organization>/apps/<appRef>/generated/catalog.ts`.
|
|
191
|
-
|
|
192
|
-
## Canvas — explore your workspace
|
|
193
|
-
|
|
194
|
-
`edk canvas` opens a local, fully offline explorer for an org workspace:
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
edk canvas <instance>/<org> # explore a workspace directory
|
|
198
|
-
edk canvas # same, resolved from ei auth / org workspace cwd
|
|
192
|
+
The optional path may be the org root or anything nested beneath it. Run from
|
|
193
|
+
any directory inside the marked org workspace to omit it. The CLI always runs
|
|
194
|
+
the bridge/OpenTofu pass-through from that root's `.tf/out/`; it does not scan
|
|
195
|
+
or deploy an individual target file.
|
|
196
|
+
|
|
197
|
+
`new app` and `new element` create offline org-root scaffolds — the initial
|
|
198
|
+
authoring file for a brand-new app or element with no existing platform
|
|
199
|
+
counterpart — and immediately register the new entity in the org's generated
|
|
200
|
+
catalog. `new agent`, `new skill`, and `new automation` create offline
|
|
201
|
+
app-owned scaffolds without overwriting an existing ref (automations are
|
|
202
|
+
app-owned only, for now). Here, `skill` means an Elementum
|
|
203
|
+
**agentic skill** attached to an agent.
|
|
204
|
+
|
|
205
|
+
`generate` resyncs `generated/catalog.ts` files with whatever authoring
|
|
206
|
+
source is currently on disk — the fix for hand-editing an existing file
|
|
207
|
+
(e.g. adding an automation's `onDemand` trigger parameter or an `.outputs()`
|
|
208
|
+
key) rather than running one of the `new`/`pull`/`clone` commands that
|
|
209
|
+
regenerate the catalog as a side effect of writing a brand-new file. Pass a
|
|
210
|
+
path to scope it to one app/element; omit it to resync the whole workspace.
|
|
211
|
+
It always refreshes the org-level barrel too.
|
|
212
|
+
|
|
213
|
+
Coding-agent guidance is packaged separately as
|
|
214
|
+
**playbooks** (Agent Skills-standard `SKILL.md` directories):
|
|
215
|
+
|
|
216
|
+
```sh
|
|
217
|
+
elementum playbooks list
|
|
218
|
+
elementum playbooks install --yes
|
|
199
219
|
```
|
|
200
220
|
|
|
201
|
-
The
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
221
|
+
The installed slash commands are `/elementum`, `/elementum-uat`,
|
|
222
|
+
`/elementum-debug`, `/elementum-deployments`, and `/elementum-design`.
|
|
223
|
+
`elementum skills ...` remains the platform command family for agentic-skill
|
|
224
|
+
operations.
|
|
225
|
+
|
|
226
|
+
## Canvas
|
|
227
|
+
|
|
228
|
+
Canvas is an offline, live-reloading view of authored source:
|
|
229
|
+
|
|
230
|
+
```sh
|
|
231
|
+
elementum canvas <instance>/<organization>
|
|
232
|
+
elementum canvas apps/myApp/flows/someFlow.ts
|
|
233
|
+
```
|
|
209
234
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
235
|
+
A directory target opens the workspace explorer at `http://localhost:3456`,
|
|
236
|
+
covering pulled org identities, apps, fields, status/stages, agents and their
|
|
237
|
+
tools, and supported automations. A file target renders the first export with
|
|
238
|
+
`toUI()` (or `.build().toUI()`). Use `--port <port>` to choose another port or
|
|
239
|
+
`--no-open` to suppress browser launch.
|
|
214
240
|
|
|
215
|
-
## Package
|
|
241
|
+
## Package imports
|
|
216
242
|
|
|
217
|
-
|
|
218
|
-
trigger/task/tool factories, and types all live under one subpath:
|
|
243
|
+
Import public package subpaths, not repository-relative modules:
|
|
219
244
|
|
|
220
245
|
```ts
|
|
221
|
-
import {
|
|
222
|
-
import {
|
|
223
|
-
import {
|
|
246
|
+
import { calc, defineApp } from "@elementumai/edk/app";
|
|
247
|
+
import { defineElement } from "@elementumai/edk/elements";
|
|
248
|
+
import {
|
|
249
|
+
defineAutomation,
|
|
250
|
+
defineWorkflow,
|
|
251
|
+
executeScript,
|
|
252
|
+
onDemand,
|
|
253
|
+
} from "@elementumai/edk/automations";
|
|
254
|
+
import {
|
|
255
|
+
agentCreateRecord,
|
|
256
|
+
agentRunAutomation,
|
|
257
|
+
agentSearchAspect,
|
|
258
|
+
defineAgent,
|
|
259
|
+
} from "@elementumai/edk/agents";
|
|
224
260
|
import { defineSkill } from "@elementumai/edk/agents/skills";
|
|
225
261
|
import { defineFlow } from "@elementumai/edk/flows";
|
|
226
262
|
import { defineSearchTable } from "@elementumai/edk/searchTables";
|
|
227
263
|
import { defineApprovalChain } from "@elementumai/edk/approvalChains";
|
|
228
264
|
import { defineTable } from "@elementumai/edk/tables";
|
|
229
265
|
import { eq } from "@elementumai/edk/core/filters";
|
|
266
|
+
import catalog from "@catalog";
|
|
230
267
|
```
|
|
231
268
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
```
|
|
269
|
+
The package exports and `typesVersions` map are kept in lockstep. Generated
|
|
270
|
+
source uses the same public subpaths.
|
|
271
|
+
|
|
272
|
+
## Authoring model
|
|
273
|
+
|
|
274
|
+
EDK uses names and typed tokens in source, with the configured OpenTofu state
|
|
275
|
+
backend providing platform identity:
|
|
276
|
+
|
|
277
|
+
1. `pull org --data-only` writes org reference bags to `org.ts`, including
|
|
278
|
+
cloud links, categories, connectors, and groups.
|
|
279
|
+
2. `pull app` or `pull element` writes editable source and adopts existing
|
|
280
|
+
resources into the required locking remote backend.
|
|
281
|
+
3. `generated/catalog.ts` is a pure barrel derived from the authored file tree.
|
|
282
|
+
Import app/entity tokens from `@catalog`; import org tokens from `org.ts`.
|
|
283
|
+
4. `build` converts TypeScript to the one supported HCL dialect in `.tf/out/`.
|
|
284
|
+
5. OpenTofu resolves references and computes create/update/replace/destroy
|
|
285
|
+
behavior during `plan` and `apply`.
|
|
286
|
+
|
|
287
|
+
There are no UUIDs or minted handles in authored source. The TypeScript bag key
|
|
288
|
+
is the Terraform label in camelCase through a lossless label conversion. For
|
|
289
|
+
example, a field's key in `fields: {}` is its identity; its display `name` can
|
|
290
|
+
change.
|
|
291
|
+
|
|
292
|
+
Configured builders such as `defineAgent` and `defineAutomation` return
|
|
293
|
+
`{ ref(refName), def(refName) }`. Workspace discovery supplies the ref name from
|
|
294
|
+
the file path. There is no `.deploy()` method.
|
|
295
|
+
|
|
296
|
+
## Automation example
|
|
297
|
+
|
|
298
|
+
The Terraform path currently round-trips on-demand triggers plus execute-script
|
|
299
|
+
and create-variable tasks. Other typed trigger/task factories remain available
|
|
300
|
+
to the authoring API but are reported as unsupported by `build` until their
|
|
301
|
+
Terraform mappings land.
|
|
266
302
|
|
|
267
303
|
```ts
|
|
268
|
-
import { defineAutomation,
|
|
269
|
-
import
|
|
304
|
+
import { defineAutomation, onDemand } from "@elementumai/edk/automations";
|
|
305
|
+
import { template } from "@elementumai/edk/core";
|
|
270
306
|
|
|
271
307
|
export default defineAutomation({
|
|
272
|
-
name: "
|
|
273
|
-
parent: "
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
308
|
+
name: "Greet New Student",
|
|
309
|
+
parent: "students",
|
|
310
|
+
workflowRevision: "1.0.0",
|
|
311
|
+
workflow: onDemand({ STUDENT_NAME: "text" })
|
|
312
|
+
.setVariable("GREETING", {
|
|
313
|
+
value: (ctx) => template("Welcome, ", ctx.trigger.STUDENT_NAME),
|
|
314
|
+
})
|
|
315
|
+
.executeScript("FORMAT_GREETING", {
|
|
316
|
+
inputs: (ctx) => ({ greeting: ctx.variables.GREETING }),
|
|
317
|
+
code: (input) => ({
|
|
318
|
+
message: `${input.parameters.greeting}!`,
|
|
319
|
+
}),
|
|
320
|
+
})
|
|
321
|
+
.outputs((ctx) => ({
|
|
322
|
+
message: ctx.tasks.FORMAT_GREETING.result.message,
|
|
280
323
|
})),
|
|
281
324
|
});
|
|
282
325
|
```
|
|
283
326
|
|
|
284
|
-
|
|
327
|
+
The file path supplies the automation ref; `parent` is the owning app ref.
|
|
328
|
+
`workflowRevision` is required SemVer and is the explicit publish gate. Editing
|
|
329
|
+
tasks or triggers updates the draft; bump the revision only when that draft
|
|
330
|
+
should be published.
|
|
331
|
+
|
|
332
|
+
## Agent example
|
|
285
333
|
|
|
286
|
-
|
|
287
|
-
org catalog
|
|
288
|
-
`tools:` array) and returns a configured entity:
|
|
334
|
+
Agents live under `apps/<appRef>/agents/<agentRef>.ts`. Their connector comes
|
|
335
|
+
from the org catalog, while app and field targets come from `@catalog`:
|
|
289
336
|
|
|
290
337
|
```ts
|
|
291
|
-
import {
|
|
338
|
+
import { agentSearchAspect, defineAgent } from "@elementumai/edk/agents";
|
|
292
339
|
import catalog from "@catalog";
|
|
340
|
+
import { org } from "../../../org.js";
|
|
293
341
|
|
|
294
342
|
export default defineAgent({
|
|
295
343
|
name: "Support Agent",
|
|
296
|
-
parent: "
|
|
297
|
-
connector:
|
|
298
|
-
description: "
|
|
299
|
-
instructions: "Search records and summarize next
|
|
300
|
-
temperature: 0.2,
|
|
301
|
-
maxLength: 2000,
|
|
344
|
+
parent: "support",
|
|
345
|
+
connector: org.connectors.claudeSonnet,
|
|
346
|
+
description: "Finds support records.",
|
|
347
|
+
instructions: "Search records and summarize the next action.",
|
|
302
348
|
tools: [
|
|
303
349
|
agentSearchAspect({
|
|
304
|
-
name: "
|
|
305
|
-
description: "
|
|
306
|
-
aspect: catalog.
|
|
307
|
-
queryDescription: "Describe the record
|
|
350
|
+
name: "find_records",
|
|
351
|
+
description: "Searches support records.",
|
|
352
|
+
aspect: catalog.support,
|
|
353
|
+
queryDescription: "Describe the record to find.",
|
|
354
|
+
fields: [
|
|
355
|
+
{
|
|
356
|
+
field: catalog.support.fields.status,
|
|
357
|
+
description: "Current status",
|
|
358
|
+
},
|
|
359
|
+
],
|
|
308
360
|
}),
|
|
309
361
|
],
|
|
310
362
|
});
|
|
311
363
|
```
|
|
312
364
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
365
|
+
The Terraform path currently round-trips create-record, search-aspect, and
|
|
366
|
+
run-automation agent tools. Unsupported tools and runtime-only knobs are
|
|
367
|
+
reported as build diagnostics instead of being emitted as partial resources.
|
|
368
|
+
Authored tool names use 1–64 letters, digits, or underscores, with no doubled
|
|
369
|
+
underscores.
|
|
370
|
+
|
|
371
|
+
## Plan and apply
|
|
372
|
+
|
|
373
|
+
Always build before planning:
|
|
374
|
+
|
|
375
|
+
```sh
|
|
376
|
+
cd <workspace>/<instance>/<organization>
|
|
377
|
+
elementum build
|
|
378
|
+
elementum plan
|
|
379
|
+
elementum apply
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
`plan` and `apply` are pass-throughs to the managed bridge with inherited
|
|
383
|
+
stdio. With no explicit profile, the CLI selects the unique saved profile
|
|
384
|
+
matching the org root's `<instance>/<organization>` path. Review destroy and
|
|
385
|
+
replacement actions just as you would in any Terraform plan.
|
|
386
|
+
|
|
387
|
+
## Identity and state recovery
|
|
388
|
+
|
|
389
|
+
Terraform state is the durable binding between authored labels and live
|
|
390
|
+
platform objects. For backwards compatibility, a workspace without
|
|
391
|
+
`<orgRoot>/backend.tf` continues to use the committed root
|
|
392
|
+
`terraform.tfstate` through a generated local backend. This preserves existing
|
|
393
|
+
single-author workspaces, but it provides no state locking; avoid concurrent
|
|
394
|
+
plan/apply operations in that mode.
|
|
395
|
+
|
|
396
|
+
Shared workspaces and CI should commit one user-owned, non-secret
|
|
397
|
+
`<orgRoot>/backend.tf` containing a complete
|
|
398
|
+
`terraform { backend "TYPE" { ... } }` declaration with verified locking.
|
|
399
|
+
`elementum build` projects either that declaration or the compatibility local
|
|
400
|
+
backend into `.tf/out/backend.tf`. Never commit `.terraform/`, `.tf/`, backend
|
|
401
|
+
credential files, or saved plan files. After migrating to remote state, remove
|
|
402
|
+
and stop committing the root `terraform.tfstate`.
|
|
403
|
+
|
|
404
|
+
For example, an S3 backend with native locking can be declared as:
|
|
405
|
+
|
|
406
|
+
```hcl
|
|
407
|
+
terraform {
|
|
408
|
+
backend "s3" {
|
|
409
|
+
bucket = "elementum-team-state"
|
|
410
|
+
key = "prod/acme/terraform.tfstate"
|
|
411
|
+
region = "us-east-1"
|
|
412
|
+
dynamodb_table = "elementum-state-locks"
|
|
413
|
+
encrypt = true
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
The backend body remains native OpenTofu HCL, but EDK validates the locking
|
|
419
|
+
contract. Native-locking backends `azurerm`, `cos`, `gcs`, `kubernetes`, `pg`,
|
|
420
|
+
and `remote` are accepted. `consul` must omit `lock` (the default is true) or
|
|
421
|
+
set `lock = true`. `s3` must set `use_lockfile = true` or `dynamodb_table`;
|
|
422
|
+
`http` must set both
|
|
423
|
+
`lock_address` and `unlock_address`; `oss` must set both
|
|
424
|
+
`tablestore_endpoint` and `tablestore_table`. Optional-backend lock settings
|
|
425
|
+
must be literal so EDK can verify them before state access. An explicitly
|
|
426
|
+
authored `local` backend, unlocked/unknown backends, and configurations EDK
|
|
427
|
+
cannot verify fail closed; the generated local compatibility backend is the
|
|
428
|
+
only local exception.
|
|
429
|
+
The storage and locking infrastructure and access policies must already exist;
|
|
430
|
+
EDK does not provision them.
|
|
431
|
+
|
|
432
|
+
Backend authentication must use that backend's standard environment or
|
|
433
|
+
workload-identity chain: for example AWS/GCP/Azure OIDC, an IAM role, or
|
|
434
|
+
environment variables supplied by CI. Do not put access keys, passwords,
|
|
435
|
+
tokens, secret-manager data sources, or credential paths in `backend.tf`.
|
|
436
|
+
Backend initialization happens before providers and data sources, so it cannot
|
|
437
|
+
read a Terraform-managed secret. EDK does not accept `-backend-config` secrets
|
|
438
|
+
and never writes backend credentials into generated HCL.
|
|
439
|
+
|
|
440
|
+
OpenTofu owns locking. EDK does not implement a weaker parallel lock or disable
|
|
441
|
+
native locking: `plan`, `apply`, adoption imports, rename `state mv`, and
|
|
442
|
+
state-repair operations use the declared backend. Standard options such as
|
|
443
|
+
`-lock-timeout=5m` pass through:
|
|
444
|
+
|
|
445
|
+
```sh
|
|
446
|
+
elementum --profile=<profile> plan <orgRoot> -lock-timeout=5m
|
|
447
|
+
elementum --profile=<profile> apply <orgRoot> -auto-approve -lock-timeout=5m
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
Backend initialization is lazy and noninteractive. A per-working-directory
|
|
451
|
+
fingerprint prevents ordinary plan/apply/state commands from silently
|
|
452
|
+
re-binding a changed backend; use the guarded migration command instead.
|
|
453
|
+
|
|
454
|
+
### Migrate committed local state to a remote backend
|
|
455
|
+
|
|
456
|
+
Create the backend infrastructure first, then add and review `backend.tf`.
|
|
457
|
+
The migration uses native `tofu init -migrate-state`, takes an ignored recovery
|
|
458
|
+
snapshot, refuses to overwrite unrelated destination state, verifies
|
|
459
|
+
lineage/resources, removes the obsolete root copy, and requires a final
|
|
460
|
+
zero-change plan:
|
|
461
|
+
|
|
462
|
+
```sh
|
|
463
|
+
elementum migrate backend <orgRoot> --check
|
|
464
|
+
elementum migrate backend <orgRoot> --dry-run
|
|
465
|
+
elementum migrate backend <orgRoot> --auto-approve
|
|
466
|
+
elementum --profile=<profile> plan <orgRoot>
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
For a remote-to-remote change, edit `backend.tf` and run the same migration.
|
|
470
|
+
Use `--reconfigure` only to bind an already-populated destination without
|
|
471
|
+
copying the currently bound state. It is rejected while local committed state
|
|
472
|
+
still exists.
|
|
473
|
+
|
|
474
|
+
Recovery snapshots and exact rollback commands are printed on failure and kept
|
|
475
|
+
under `.tf/migration-backups/backend/`. The command updates `.gitignore` but
|
|
476
|
+
does not rewrite Git history or mutate the index. After a successful
|
|
477
|
+
local-to-remote migration, commit the root-state deletion with `backend.tf` and
|
|
478
|
+
`.gitignore`; review the diff before pushing:
|
|
479
|
+
|
|
480
|
+
```sh
|
|
481
|
+
git add backend.tf .gitignore
|
|
482
|
+
git add -u terraform.tfstate
|
|
483
|
+
git commit
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
If state is lost, do not apply the built configuration: OpenTofu would see the
|
|
487
|
+
live objects as new. Restore/push the recovery snapshot or re-adopt each stream
|
|
488
|
+
with:
|
|
489
|
+
|
|
490
|
+
```sh
|
|
491
|
+
elementum --profile=<profile> pull org --data-only
|
|
492
|
+
elementum --profile=<profile> pull app <namespace>
|
|
493
|
+
elementum --profile=<profile> pull element <namespace>
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
After an update reports an old provider identity, inspect and explicitly
|
|
497
|
+
migrate the configured state:
|
|
498
|
+
|
|
499
|
+
```sh
|
|
500
|
+
elementum migrate provider-source <orgRoot> --check
|
|
501
|
+
elementum migrate provider-source <orgRoot> --auto-approve
|
|
502
|
+
elementum --profile=<profile> plan <orgRoot>
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
The migration reads the configured local or remote state, creates an ignored
|
|
506
|
+
recovery snapshot, runs backend-bound OpenTofu `state replace-provider`,
|
|
507
|
+
refreshes generated provider configuration, and never applies infrastructure.
|
|
508
|
+
|
|
509
|
+
### CI/CD
|
|
510
|
+
|
|
511
|
+
Use a serialized protected deployment job and let the backend lock arbitrate
|
|
512
|
+
all writers. Supply Elementum auth through the bridge's CI profile setup and
|
|
513
|
+
backend auth through workload identity/environment variables. A current
|
|
514
|
+
GitHub Actions job (the public signed toolchain is macOS-only today) looks like:
|
|
515
|
+
|
|
516
|
+
```yaml
|
|
517
|
+
jobs:
|
|
518
|
+
apply:
|
|
519
|
+
runs-on: macos-14
|
|
520
|
+
concurrency:
|
|
521
|
+
group: elementum-prod
|
|
522
|
+
cancel-in-progress: false
|
|
523
|
+
permissions:
|
|
524
|
+
contents: read
|
|
525
|
+
id-token: write
|
|
526
|
+
steps:
|
|
527
|
+
- uses: actions/checkout@v4
|
|
528
|
+
- run: npm ci
|
|
529
|
+
- run: elementum build ./us/acme
|
|
530
|
+
- run: elementum --profile=ci plan ./us/acme -lock-timeout=5m
|
|
531
|
+
- run: elementum --profile=ci apply ./us/acme -auto-approve -lock-timeout=5m
|
|
336
532
|
```
|
|
337
533
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
## Create Vs Update
|
|
359
|
-
|
|
360
|
-
`plan`/`apply` resolve each entity's handle-tokens against `generated/state.<env>.json`, then
|
|
361
|
-
decide per entity:
|
|
362
|
-
|
|
363
|
-
- **create** — no binding recorded for this `kind::refName` → POST.
|
|
364
|
-
- **skip** — bound, and a structural diff against the recorded baseline is
|
|
365
|
-
empty → no wire call.
|
|
366
|
-
- **update** — bound, and the payload differs → PUT against the bound id,
|
|
367
|
-
carrying the changed fields. (A bound-but-baseline-less entity — e.g. one
|
|
368
|
-
imported reference-only and now being managed — diffs as all-changed and
|
|
369
|
-
reconciles the platform to local source.)
|
|
370
|
-
- **update-unsupported** — bound and changed, but the kind has no platform
|
|
371
|
-
PUT. Apply reports `DeployUpdateUnsupportedError`; delete the entity on the
|
|
372
|
-
platform and re-create.
|
|
373
|
-
- **blocked** — a referenced handle isn't bound yet (import the app/entity it
|
|
374
|
-
points at). Apply surfaces the miss rather than POSTing a dangling reference.
|
|
375
|
-
|
|
376
|
-
Support today:
|
|
377
|
-
|
|
378
|
-
- **Automations, agents, skills** support create, update, and skip.
|
|
379
|
-
- **Flows, search tables, tables** are create-only — a change to a deployed one
|
|
380
|
-
is `update-unsupported` until the platform ships PUT.
|
|
381
|
-
|
|
382
|
-
There are no source-level ids and no `.deploy()` seed refs anymore: identity
|
|
383
|
-
lives entirely in state. On disk, state is consolidated into
|
|
384
|
-
`generated/state.<env>.json` in the org workspace; it contains org bindings,
|
|
385
|
-
the app registry, per-app bindings, and baselines. Override the generated-state
|
|
386
|
-
directory with `EDK_STATE_DIR`. Commit the state file to share identity across
|
|
387
|
-
machines; gitignore it for per-developer state.
|
|
388
|
-
|
|
389
|
-
If a state file is corrupt or schema-incompatible, the loader throws
|
|
390
|
-
`DeployStateCorruptError` rather than silently rebuilding it — re-import the
|
|
391
|
-
owning app to rebuild bindings.
|
|
392
|
-
|
|
393
|
-
### Recovering identity
|
|
394
|
-
|
|
395
|
-
Lost `generated/state.<env>.json` (fresh clone, deleted by accident) means EDK no longer knows
|
|
396
|
-
which platform entities your handle-tokens map to. Re-run `edk import org` for
|
|
397
|
-
org references, then pull the app/entity again or use `edk import app --id
|
|
398
|
-
<uuid>` as a reference-only bootstrap when you only need bindings. Author files
|
|
399
|
-
keep working unchanged because they only reference handles, never ids.
|
|
534
|
+
The command sequence and environment contract are identical on a noninteractive
|
|
535
|
+
Linux runner when your organization supplies the Linux toolchain artifact;
|
|
536
|
+
the public installer does not yet distribute Linux binaries.
|
|
537
|
+
|
|
538
|
+
## Create and update semantics
|
|
539
|
+
|
|
540
|
+
Terraform owns lifecycle decisions; EDK has no second deployment state machine:
|
|
541
|
+
|
|
542
|
+
- Configured resource absent from state: create.
|
|
543
|
+
- Resource present in config and state with changed attributes: update in place
|
|
544
|
+
or replace, according to provider schema.
|
|
545
|
+
- Resource present in state but absent from built config: destroy.
|
|
546
|
+
- Existing platform resource mapped into state by pull: adopt.
|
|
547
|
+
|
|
548
|
+
Pull adoption's zero-write gates prevent an existing resource from being
|
|
549
|
+
mistaken for a create. Build diagnostics are part of the safety contract:
|
|
550
|
+
unsupported stream kinds are never silently adopted or emitted. Renames that
|
|
551
|
+
change an exported Terraform label are guarded during adoption and rebound with
|
|
552
|
+
state moves when the existing platform identity can be proven.
|
|
400
553
|
|
|
401
554
|
## Development
|
|
402
555
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
556
|
+
The repository builds three distinct output trees:
|
|
557
|
+
|
|
558
|
+
- `dist-sdk/` — `tsc -p tsconfig.sdk.json` output, the sole source tree packed
|
|
559
|
+
into the `@elementumai/edk` SDK package;
|
|
560
|
+
- `dist-cli/` — Node-compatible `tsc -p tsconfig.cli.json` output used by local
|
|
561
|
+
development, tests, integration tooling, and the binary build script; it is
|
|
562
|
+
not part of the SDK package or the final release payload;
|
|
563
|
+
- `dist-bin/` — standalone `elementum` executables produced from `dist-cli` by
|
|
564
|
+
the locked local Bun dependency; these are the CLI release inputs distributed
|
|
565
|
+
separately from npm.
|
|
566
|
+
|
|
567
|
+
The repository's principal source roots are siblings:
|
|
568
|
+
|
|
569
|
+
```text
|
|
570
|
+
src/ # TypeScript SDK and public CLI
|
|
571
|
+
cmd/elementum/ # temporary private Go bridge module
|
|
572
|
+
provider/ # OpenTofu provider module
|
|
573
|
+
distribution/ # registry and installer package
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
Contributor setup, change-specific tests, Go/provider checks, and pull-request
|
|
577
|
+
verification are documented in [CONTRIBUTING.md](CONTRIBUTING.md). The shortest
|
|
578
|
+
local CLI path is:
|
|
579
|
+
|
|
580
|
+
```sh
|
|
581
|
+
npm run local:setup
|
|
582
|
+
npm run elementum -- --help
|
|
583
|
+
npm run test:cli
|
|
409
584
|
```
|
|
585
|
+
|
|
586
|
+
See [binary validation](docs/edk-binary.md) for release and
|
|
587
|
+
compatibility-train checks.
|
|
588
|
+
|
|
589
|
+
## Contributor integration harness
|
|
590
|
+
|
|
591
|
+
The Preston High harness creates, mutates, renames, and deletes live resources.
|
|
592
|
+
Use only a dedicated test organization and profile. The complete setup,
|
|
593
|
+
required org identities, golden-workspace flow, command flags, and failure
|
|
594
|
+
semantics live in the
|
|
595
|
+
[Golden integration test](CONTRIBUTING.md#golden-integration-test).
|