@elementumai/edk 0.0.0-oidc-bootstrap → 0.8.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 +462 -3
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +188 -0
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.js +20 -0
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent.d.ts +245 -0
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent.js +30 -0
- package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.d.ts +18 -0
- package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.js +8 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.d.ts +718 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.js +52 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.d.ts +23 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.d.ts +148 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.js +12 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/format.d.ts +63 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/format.js +17 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +39 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/index.js +35 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +116 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.js +11 -0
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +178 -0
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.js +18 -0
- package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.d.ts +200 -0
- package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.d.ts +1 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.d.ts +141 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.js +22 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +123 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.js +14 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +78 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +23 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/index.d.ts +1 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/index.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.d.ts +265 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.js +15 -0
- package/dist-sdk/elementum-entity-client/errors.d.ts +90 -0
- package/dist-sdk/elementum-entity-client/errors.js +111 -0
- package/dist-sdk/elementum-entity-client/models/connection.d.ts +30 -0
- package/dist-sdk/elementum-entity-client/models/connection.js +16 -0
- package/dist-sdk/elementum-entity-client/types.d.ts +71 -0
- package/dist-sdk/elementum-entity-client/types.js +1 -0
- package/dist-sdk/fs/entity.d.ts +104 -0
- package/dist-sdk/fs/entity.js +52 -0
- package/dist-sdk/pull/util.d.ts +130 -0
- package/dist-sdk/pull/util.js +204 -0
- 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 +242 -0
- package/dist-sdk/src/catalog/factories.js +265 -0
- package/dist-sdk/src/catalog/from-authoring.d.ts +103 -0
- package/dist-sdk/src/catalog/from-authoring.js +467 -0
- package/dist-sdk/src/catalog/index.d.ts +12 -0
- package/dist-sdk/src/catalog/index.js +12 -0
- package/dist-sdk/src/catalog/org.d.ts +11 -0
- package/dist-sdk/src/catalog/org.js +288 -0
- package/dist-sdk/src/catalog/render-helpers.d.ts +35 -0
- package/dist-sdk/src/catalog/render-helpers.js +82 -0
- package/dist-sdk/src/catalog/render.d.ts +48 -0
- package/dist-sdk/src/catalog/render.js +193 -0
- package/dist-sdk/src/catalog/token.d.ts +10 -0
- package/dist-sdk/src/catalog/token.js +76 -0
- package/dist-sdk/src/catalog/types.d.ts +215 -0
- package/dist-sdk/src/catalog/types.js +86 -0
- package/dist-sdk/src/catalog/write.d.ts +43 -0
- package/dist-sdk/src/catalog/write.js +109 -0
- package/dist-sdk/src/core/app-to-ui.d.ts +22 -0
- package/dist-sdk/src/core/app-to-ui.js +75 -0
- package/dist-sdk/src/core/index.d.ts +10 -0
- package/dist-sdk/src/core/index.js +9 -0
- package/dist-sdk/src/core/system-fields.d.ts +95 -0
- package/dist-sdk/src/core/system-fields.js +153 -0
- package/dist-sdk/src/core/triggers/on-demand.d.ts +144 -0
- package/dist-sdk/src/core/triggers/on-demand.js +112 -0
- package/dist-sdk/src/core/types/ai-provider.d.ts +23 -0
- package/dist-sdk/src/core/types/ai-provider.js +8 -0
- package/dist-sdk/src/core/types/app.d.ts +857 -0
- package/dist-sdk/src/core/types/app.js +210 -0
- package/dist-sdk/src/core/types/aspect-category.d.ts +35 -0
- package/dist-sdk/src/core/types/aspect-category.js +33 -0
- package/dist-sdk/src/core/types/cloud-link.d.ts +34 -0
- package/dist-sdk/src/core/types/cloud-link.js +32 -0
- package/dist-sdk/src/core/types/display-block.d.ts +149 -0
- package/dist-sdk/src/core/types/display-block.js +61 -0
- package/dist-sdk/src/core/types/group.d.ts +13 -0
- package/dist-sdk/src/core/types/group.js +6 -0
- package/dist-sdk/src/core/types/platform.d.ts +2 -0
- package/dist-sdk/src/core/types/platform.js +1 -0
- package/dist-sdk/src/core/types/user.d.ts +20 -0
- package/dist-sdk/src/core/types/user.js +8 -0
- package/dist-sdk/src/core/wire/ref-serializer.d.ts +45 -0
- package/dist-sdk/src/core/wire/ref-serializer.js +89 -0
- package/dist-sdk/src/engine/build/context.d.ts +67 -0
- package/dist-sdk/src/engine/build/context.js +6 -0
- 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/entity.d.ts +44 -0
- package/dist-sdk/src/engine/entity.js +15 -0
- package/dist-sdk/src/engine/pull/context.d.ts +38 -0
- package/dist-sdk/src/engine/pull/context.js +44 -0
- package/dist-sdk/src/engine/pull/org.d.ts +54 -0
- package/dist-sdk/src/engine/pull/org.js +134 -0
- package/dist-sdk/src/engine/tf/escape.d.ts +22 -0
- package/dist-sdk/src/engine/tf/escape.js +28 -0
- package/dist-sdk/src/engine/tf/expr.d.ts +25 -0
- package/dist-sdk/src/engine/tf/expr.js +405 -0
- package/dist-sdk/src/engine/tf/index.d.ts +12 -0
- package/dist-sdk/src/engine/tf/index.js +11 -0
- package/dist-sdk/src/engine/tf/labels.d.ts +76 -0
- package/dist-sdk/src/engine/tf/labels.js +196 -0
- package/dist-sdk/src/engine/tf/model.d.ts +84 -0
- package/dist-sdk/src/engine/tf/model.js +49 -0
- package/dist-sdk/src/engine/tf/parse.d.ts +41 -0
- package/dist-sdk/src/engine/tf/parse.js +189 -0
- package/dist-sdk/src/engine/tf/render.d.ts +13 -0
- package/dist-sdk/src/engine/tf/render.js +102 -0
- package/dist-sdk/src/engine/workspace/authoring-layout.d.ts +43 -0
- package/dist-sdk/src/engine/workspace/authoring-layout.js +201 -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 +48 -0
- package/dist-sdk/src/entities/access-policy/from-tf.js +189 -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 +36 -0
- package/dist-sdk/src/entities/access-policy/to-tf.js +149 -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 +108 -0
- package/dist-sdk/src/entities/agent/build.js +148 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +53 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +344 -0
- package/dist-sdk/src/entities/agent/from-tf.d.ts +65 -0
- package/dist-sdk/src/entities/agent/from-tf.js +289 -0
- package/dist-sdk/src/entities/agent/index.d.ts +7 -0
- package/dist-sdk/src/entities/agent/index.js +7 -0
- package/dist-sdk/src/entities/agent/module.d.ts +4 -0
- package/dist-sdk/src/entities/agent/module.js +122 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/agent/to-tf.js +188 -0
- package/dist-sdk/src/entities/agent/tools.d.ts +284 -0
- package/dist-sdk/src/entities/agent/tools.js +238 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +110 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.js +265 -0
- package/dist-sdk/src/entities/agent-tool/module.d.ts +3 -0
- package/dist-sdk/src/entities/agent-tool/module.js +32 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +40 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.js +250 -0
- package/dist-sdk/src/entities/agent-tool/types.d.ts +43 -0
- package/dist-sdk/src/entities/agent-tool/types.js +102 -0
- package/dist-sdk/src/entities/app/build.d.ts +368 -0
- package/dist-sdk/src/entities/app/build.js +372 -0
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +168 -0
- package/dist-sdk/src/entities/app/deserializer/normalize.js +12 -0
- package/dist-sdk/src/entities/app/display-blocks.d.ts +26 -0
- package/dist-sdk/src/entities/app/display-blocks.js +34 -0
- package/dist-sdk/src/entities/app/from-tf.d.ts +23 -0
- package/dist-sdk/src/entities/app/from-tf.js +197 -0
- package/dist-sdk/src/entities/app/index.d.ts +14 -0
- package/dist-sdk/src/entities/app/index.js +11 -0
- package/dist-sdk/src/entities/app/locals.d.ts +11 -0
- package/dist-sdk/src/entities/app/locals.js +31 -0
- package/dist-sdk/src/entities/app/module.d.ts +4 -0
- package/dist-sdk/src/entities/app/module.js +66 -0
- package/dist-sdk/src/entities/app/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/app/to-tf.js +212 -0
- package/dist-sdk/src/entities/approval-chain/build.d.ts +24 -0
- package/dist-sdk/src/entities/approval-chain/build.js +56 -0
- package/dist-sdk/src/entities/approval-chain/index.d.ts +6 -0
- package/dist-sdk/src/entities/approval-chain/index.js +6 -0
- package/dist-sdk/src/entities/approval-chain/steps.d.ts +24 -0
- package/dist-sdk/src/entities/approval-chain/steps.js +20 -0
- package/dist-sdk/src/entities/automation/build.d.ts +259 -0
- package/dist-sdk/src/entities/automation/build.js +436 -0
- package/dist-sdk/src/entities/automation/catalog-render.d.ts +5 -0
- package/dist-sdk/src/entities/automation/catalog-render.js +35 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +152 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.js +13 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +55 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +1176 -0
- package/dist-sdk/src/entities/automation/filter.d.ts +93 -0
- package/dist-sdk/src/entities/automation/filter.js +156 -0
- package/dist-sdk/src/entities/automation/from-tf.d.ts +35 -0
- package/dist-sdk/src/entities/automation/from-tf.js +1258 -0
- package/dist-sdk/src/entities/automation/index.d.ts +22 -0
- package/dist-sdk/src/entities/automation/index.js +25 -0
- package/dist-sdk/src/entities/automation/module.d.ts +3 -0
- package/dist-sdk/src/entities/automation/module.js +150 -0
- package/dist-sdk/src/entities/automation/operators.d.ts +93 -0
- package/dist-sdk/src/entities/automation/operators.js +69 -0
- 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 +51 -0
- package/dist-sdk/src/entities/automation/script-code.js +633 -0
- package/dist-sdk/src/entities/automation/serialize.d.ts +6 -0
- package/dist-sdk/src/entities/automation/serialize.js +41 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +641 -0
- package/dist-sdk/src/entities/automation/tasks.js +765 -0
- package/dist-sdk/src/entities/automation/to-tf.d.ts +19 -0
- package/dist-sdk/src/entities/automation/to-tf.js +1169 -0
- package/dist-sdk/src/entities/automation/triggers.d.ts +205 -0
- package/dist-sdk/src/entities/automation/triggers.js +202 -0
- package/dist-sdk/src/entities/automation/types.d.ts +78 -0
- package/dist-sdk/src/entities/automation/types.js +131 -0
- package/dist-sdk/src/entities/element/build.d.ts +121 -0
- package/dist-sdk/src/entities/element/build.js +110 -0
- package/dist-sdk/src/entities/element/from-tf.d.ts +19 -0
- package/dist-sdk/src/entities/element/from-tf.js +170 -0
- package/dist-sdk/src/entities/element/index.d.ts +12 -0
- package/dist-sdk/src/entities/element/index.js +10 -0
- package/dist-sdk/src/entities/element/locals.d.ts +7 -0
- package/dist-sdk/src/entities/element/locals.js +12 -0
- package/dist-sdk/src/entities/element/module.d.ts +8 -0
- package/dist-sdk/src/entities/element/module.js +65 -0
- package/dist-sdk/src/entities/element/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/element/to-tf.js +169 -0
- package/dist-sdk/src/entities/field/build.d.ts +112 -0
- package/dist-sdk/src/entities/field/build.js +84 -0
- package/dist-sdk/src/entities/field/calc/aggregate.d.ts +60 -0
- package/dist-sdk/src/entities/field/calc/aggregate.js +71 -0
- package/dist-sdk/src/entities/field/calc/date.d.ts +73 -0
- package/dist-sdk/src/entities/field/calc/date.js +109 -0
- package/dist-sdk/src/entities/field/calc/index.d.ts +229 -0
- package/dist-sdk/src/entities/field/calc/index.js +433 -0
- package/dist-sdk/src/entities/field/calc/numeric.d.ts +22 -0
- package/dist-sdk/src/entities/field/calc/numeric.js +67 -0
- package/dist-sdk/src/entities/field/calc/runtime.d.ts +61 -0
- package/dist-sdk/src/entities/field/calc/runtime.js +174 -0
- package/dist-sdk/src/entities/field/calc/text.d.ts +100 -0
- package/dist-sdk/src/entities/field/calc/text.js +208 -0
- package/dist-sdk/src/entities/field/calc/types.d.ts +86 -0
- package/dist-sdk/src/entities/field/calc/types.js +23 -0
- package/dist-sdk/src/entities/field/calc.d.ts +108 -0
- package/dist-sdk/src/entities/field/calc.js +54 -0
- package/dist-sdk/src/entities/field/from-tf.d.ts +31 -0
- package/dist-sdk/src/entities/field/from-tf.js +184 -0
- package/dist-sdk/src/entities/field/locals.d.ts +8 -0
- package/dist-sdk/src/entities/field/locals.js +24 -0
- package/dist-sdk/src/entities/field/module.d.ts +3 -0
- package/dist-sdk/src/entities/field/module.js +50 -0
- package/dist-sdk/src/entities/field/options.d.ts +27 -0
- package/dist-sdk/src/entities/field/options.js +76 -0
- package/dist-sdk/src/entities/field/record-shape.d.ts +57 -0
- package/dist-sdk/src/entities/field/record-shape.js +1 -0
- package/dist-sdk/src/entities/field/to-tf.d.ts +73 -0
- package/dist-sdk/src/entities/field/to-tf.js +142 -0
- package/dist-sdk/src/entities/field/types.d.ts +53 -0
- package/dist-sdk/src/entities/field/types.js +68 -0
- package/dist-sdk/src/entities/file-reader/build.d.ts +182 -0
- package/dist-sdk/src/entities/file-reader/build.js +105 -0
- 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 +10 -0
- package/dist-sdk/src/entities/file-reader/index.js +10 -0
- 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/flow/activities/agent.d.ts +15 -0
- package/dist-sdk/src/entities/flow/activities/agent.js +29 -0
- package/dist-sdk/src/entities/flow/activities/approval.d.ts +9 -0
- package/dist-sdk/src/entities/flow/activities/approval.js +18 -0
- package/dist-sdk/src/entities/flow/activities/automation.d.ts +12 -0
- package/dist-sdk/src/entities/flow/activities/automation.js +22 -0
- package/dist-sdk/src/entities/flow/activities/ctx.d.ts +34 -0
- package/dist-sdk/src/entities/flow/activities/ctx.js +38 -0
- package/dist-sdk/src/entities/flow/activities/form.d.ts +22 -0
- package/dist-sdk/src/entities/flow/activities/form.js +36 -0
- package/dist-sdk/src/entities/flow/activities/index.d.ts +14 -0
- package/dist-sdk/src/entities/flow/activities/index.js +13 -0
- package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +39 -0
- package/dist-sdk/src/entities/flow/activities/input-refs.js +19 -0
- package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +13 -0
- package/dist-sdk/src/entities/flow/activities/prompt-template.js +34 -0
- package/dist-sdk/src/entities/flow/activities/render-catalog.d.ts +140 -0
- package/dist-sdk/src/entities/flow/activities/render-catalog.js +174 -0
- package/dist-sdk/src/entities/flow/activities/types.d.ts +33 -0
- package/dist-sdk/src/entities/flow/activities/types.js +1 -0
- package/dist-sdk/src/entities/flow/build.d.ts +38 -0
- package/dist-sdk/src/entities/flow/build.js +115 -0
- package/dist-sdk/src/entities/flow/index.d.ts +8 -0
- package/dist-sdk/src/entities/flow/index.js +7 -0
- package/dist-sdk/src/entities/flow/serialize.d.ts +51 -0
- package/dist-sdk/src/entities/flow/serialize.js +94 -0
- package/dist-sdk/src/entities/flow/util.d.ts +27 -0
- package/dist-sdk/src/entities/flow/util.js +38 -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/category.d.ts +5 -0
- package/dist-sdk/src/entities/org/category.js +33 -0
- package/dist-sdk/src/entities/org/cloud-link.d.ts +5 -0
- package/dist-sdk/src/entities/org/cloud-link.js +33 -0
- package/dist-sdk/src/entities/org/connector.d.ts +12 -0
- package/dist-sdk/src/entities/org/connector.js +35 -0
- package/dist-sdk/src/entities/org/group.d.ts +5 -0
- package/dist-sdk/src/entities/org/group.js +40 -0
- package/dist-sdk/src/entities/org/index.d.ts +11 -0
- package/dist-sdk/src/entities/org/index.js +11 -0
- package/dist-sdk/src/entities/org/role.d.ts +7 -0
- package/dist-sdk/src/entities/org/role.js +21 -0
- package/dist-sdk/src/entities/org/user.d.ts +7 -0
- package/dist-sdk/src/entities/org/user.js +30 -0
- package/dist-sdk/src/entities/search-table/build.d.ts +41 -0
- package/dist-sdk/src/entities/search-table/build.js +79 -0
- package/dist-sdk/src/entities/search-table/index.d.ts +5 -0
- package/dist-sdk/src/entities/search-table/index.js +5 -0
- package/dist-sdk/src/entities/search-table/module.d.ts +6 -0
- package/dist-sdk/src/entities/search-table/module.js +64 -0
- package/dist-sdk/src/entities/shared/context.d.ts +93 -0
- package/dist-sdk/src/entities/shared/context.js +156 -0
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +277 -0
- package/dist-sdk/src/entities/shared/filters/ast.js +65 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +211 -0
- package/dist-sdk/src/entities/shared/filters/index.js +372 -0
- package/dist-sdk/src/entities/shared/filters/types.d.ts +170 -0
- package/dist-sdk/src/entities/shared/filters/types.js +7 -0
- package/dist-sdk/src/entities/shared/ref.d.ts +160 -0
- package/dist-sdk/src/entities/shared/ref.js +119 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +17 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.js +31 -0
- package/dist-sdk/src/entities/shared/types/common.d.ts +106 -0
- package/dist-sdk/src/entities/shared/types/common.js +64 -0
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +58 -0
- package/dist-sdk/src/entities/shared/types/field-types.js +57 -0
- package/dist-sdk/src/entities/shared/types/platform.d.ts +46 -0
- package/dist-sdk/src/entities/shared/types/platform.js +10 -0
- package/dist-sdk/src/entities/skill/build.d.ts +25 -0
- package/dist-sdk/src/entities/skill/build.js +50 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +39 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +124 -0
- package/dist-sdk/src/entities/skill/from-tf.d.ts +33 -0
- package/dist-sdk/src/entities/skill/from-tf.js +96 -0
- package/dist-sdk/src/entities/skill/index.d.ts +7 -0
- package/dist-sdk/src/entities/skill/index.js +7 -0
- package/dist-sdk/src/entities/skill/module.d.ts +4 -0
- package/dist-sdk/src/entities/skill/module.js +111 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/skill/to-tf.js +59 -0
- package/dist-sdk/src/entities/skill/tools.d.ts +93 -0
- package/dist-sdk/src/entities/skill/tools.js +105 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +60 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +142 -0
- package/dist-sdk/src/entities/skill-tool/module.d.ts +3 -0
- package/dist-sdk/src/entities/skill-tool/module.js +21 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +34 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.js +130 -0
- package/dist-sdk/src/entities/skill-tool/types.d.ts +40 -0
- package/dist-sdk/src/entities/skill-tool/types.js +67 -0
- package/dist-sdk/src/entities/table/build.d.ts +74 -0
- package/dist-sdk/src/entities/table/build.js +339 -0
- package/dist-sdk/src/entities/table/catalog-render.d.ts +5 -0
- package/dist-sdk/src/entities/table/catalog-render.js +39 -0
- package/dist-sdk/src/entities/table/fields.d.ts +81 -0
- package/dist-sdk/src/entities/table/fields.js +70 -0
- package/dist-sdk/src/entities/table/filter.d.ts +41 -0
- package/dist-sdk/src/entities/table/filter.js +89 -0
- package/dist-sdk/src/entities/table/index.d.ts +8 -0
- package/dist-sdk/src/entities/table/index.js +12 -0
- package/dist-sdk/src/entities/table/joins.d.ts +26 -0
- package/dist-sdk/src/entities/table/joins.js +31 -0
- package/dist-sdk/src/entities/table/keys.d.ts +11 -0
- package/dist-sdk/src/entities/table/keys.js +25 -0
- package/dist-sdk/src/entities/table/module.d.ts +5 -0
- package/dist-sdk/src/entities/table/module.js +25 -0
- package/dist-sdk/src/entities/table/state.d.ts +39 -0
- package/dist-sdk/src/entities/table/state.js +43 -0
- package/dist-sdk/src/entities/view/from-tf.d.ts +29 -0
- package/dist-sdk/src/entities/view/from-tf.js +235 -0
- package/dist-sdk/src/entities/view/module.d.ts +24 -0
- package/dist-sdk/src/entities/view/module.js +61 -0
- package/dist-sdk/src/entities/view/to-tf.d.ts +65 -0
- package/dist-sdk/src/entities/view/to-tf.js +171 -0
- package/dist-sdk/src/entities/view/types.d.ts +58 -0
- package/dist-sdk/src/entities/view/types.js +89 -0
- package/dist-sdk/src/graph/deferred-catalog-render.d.ts +9 -0
- package/dist-sdk/src/graph/deferred-catalog-render.js +18 -0
- package/dist-sdk/src/graph/index.d.ts +91 -0
- package/dist-sdk/src/graph/index.js +211 -0
- package/dist-sdk/src/graph/modules.d.ts +7 -0
- package/dist-sdk/src/graph/modules.js +42 -0
- package/dist-sdk/src/graph/types.d.ts +375 -0
- package/dist-sdk/src/graph/types.js +102 -0
- package/dist-sdk/src/internal/sdk-package.d.ts +7 -0
- package/dist-sdk/src/internal/sdk-package.js +23 -0
- package/package.json +201 -8
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ref serializer — converts RefData to the Elementum API's
|
|
3
|
+
* ValueReferenceInput JSON format.
|
|
4
|
+
*/
|
|
5
|
+
import { toRefData } from "../../entities/shared/ref.js";
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Serialization
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
export function serializeRefData(data) {
|
|
10
|
+
switch (data.kind) {
|
|
11
|
+
case "static":
|
|
12
|
+
return { value: data.value };
|
|
13
|
+
case "trigger":
|
|
14
|
+
// Trigger ref names are emitted case-preserving. Built-in triggers
|
|
15
|
+
// (webhook, record*, attachment, commentAdded) register camelCase
|
|
16
|
+
// parameter names on the platform (`contentType`, `recordId`,
|
|
17
|
+
// `aspectReferences`, …), so lowercasing them here breaks the
|
|
18
|
+
// ValueReference UUID-v5 hash lookup and leaves the saved input
|
|
19
|
+
// orphaned in the UI. onDemand triggers, which do lowercase their
|
|
20
|
+
// schema names, have a post-pass in `serializeAutomation` that
|
|
21
|
+
// lowercases the root segment of any trigger ref in the result tree.
|
|
22
|
+
return { triggerReference: { name: data.name } };
|
|
23
|
+
case "task":
|
|
24
|
+
return { taskReference: { taskRefKey: data.taskRefKey, name: data.name } };
|
|
25
|
+
case "forEach":
|
|
26
|
+
return {
|
|
27
|
+
forEachReference: {
|
|
28
|
+
forEachTaskRefKey: data.forEachTaskName,
|
|
29
|
+
name: data.name,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
case "template":
|
|
33
|
+
return serializeTemplate(data);
|
|
34
|
+
case "variableParam":
|
|
35
|
+
return serializeVariableParamMarker(data);
|
|
36
|
+
case "secret":
|
|
37
|
+
return { secretReference: { secretId: data.secretId } };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Characters used to escape a literal `$` that appears immediately before
|
|
42
|
+
* a `{{{pN}}}` placeholder. Without this, the Mobius UI's Lexical editor
|
|
43
|
+
* sees `${{p1}}` and treats it as an escape sequence, rendering the
|
|
44
|
+
* placeholder as literal text instead of as the reference chip.
|
|
45
|
+
*
|
|
46
|
+
* The UI renderer strips matching zero-width joiners before displaying
|
|
47
|
+
* the template, so `$` + joiner + `{{{p1}}}` round-trips visually as
|
|
48
|
+
* `$` + chip. No other characters in template strings should contain
|
|
49
|
+
* U+2060 (word joiner), so the escape is reversible without ambiguity.
|
|
50
|
+
*/
|
|
51
|
+
const DOLLAR_PLACEHOLDER_ESCAPE = "\u2060"; // WORD JOINER
|
|
52
|
+
function serializeTemplate(data) {
|
|
53
|
+
let templateStr = "";
|
|
54
|
+
const parameters = [];
|
|
55
|
+
let paramIndex = 1;
|
|
56
|
+
for (const part of data.parts) {
|
|
57
|
+
if (typeof part === "string") {
|
|
58
|
+
templateStr += part;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
// Defense-in-depth for the `$`-before-placeholder collision (see
|
|
62
|
+
// plans/edk-shortcomings.md #27). `template()` also rejects the
|
|
63
|
+
// literal-string form at the type level; this pass handles dynamic
|
|
64
|
+
// / computed string fragments the type system can't inspect.
|
|
65
|
+
if (templateStr.length > 0 && templateStr.endsWith("$")) {
|
|
66
|
+
templateStr += DOLLAR_PLACEHOLDER_ESCAPE;
|
|
67
|
+
}
|
|
68
|
+
const paramName = `p${paramIndex++}`;
|
|
69
|
+
templateStr += `{{{${paramName}}}}`;
|
|
70
|
+
parameters.push({ value: { name: paramName, value: serializeRefData(part) } });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return { templateReference: { template: templateStr, parameters } };
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Placeholder marker emitted for variableParam refs.
|
|
77
|
+
* Resolved to real `{ variableReference: { id, name } }` by
|
|
78
|
+
* `resolveVariableParamMarkers` after all tasks are serialized.
|
|
79
|
+
*/
|
|
80
|
+
function serializeVariableParamMarker(data) {
|
|
81
|
+
return { __variableParamRef: { variableTaskRefKey: data.variableTaskRefKey, name: data.name } };
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Serialize a ValueOrRef to a ValueReferenceInput JSON.
|
|
85
|
+
* Literal values become { value: ... }.
|
|
86
|
+
*/
|
|
87
|
+
export function serializeValueOrRef(v) {
|
|
88
|
+
return serializeRefData(toRefData(v));
|
|
89
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared EMISSION context every entity's `to-tf` module uses.
|
|
3
|
+
* Entity-agnostic by definition — nothing in here may name a resource type.
|
|
4
|
+
* (The extraction-side twin is src/engine/pull/context.ts.)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Org-catalog lookups: recorded tfLabels for the data references entities emit.
|
|
8
|
+
*
|
|
9
|
+
* Bags are keyed by `DataFacet.orgBag` / catalog bag name (`"cloudLinks"`,
|
|
10
|
+
* `"categories"`, …) — the engine never names a specific org identity kind.
|
|
11
|
+
* Entity to-tf passes the bag it authors against.
|
|
12
|
+
*/
|
|
13
|
+
export interface OrgRefLookup {
|
|
14
|
+
/**
|
|
15
|
+
* Resolve by org.ts bag key (tsLabel). Records a data block when found.
|
|
16
|
+
* Used by token-bearing refs (cloud links, connectors, …).
|
|
17
|
+
*/
|
|
18
|
+
byTsLabel(bag: string, tsLabel: string): {
|
|
19
|
+
readonly tfLabel: string;
|
|
20
|
+
} | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve by display name within a bag. Used when authoring carries a plain
|
|
23
|
+
* name (categories today) rather than a catalog token.
|
|
24
|
+
*/
|
|
25
|
+
byName(bag: string, name: string): {
|
|
26
|
+
readonly tfLabel: string;
|
|
27
|
+
} | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Record a name-keyed `data.elementum_app` lookup for a FOREIGN app (e.g.
|
|
30
|
+
* a cross-app agent-tool target). The label derives from the app NAME
|
|
31
|
+
* (ei's sanitize rule), computed by the caller.
|
|
32
|
+
*/
|
|
33
|
+
foreignApp(tfLabel: string, name: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* Record a name-keyed `data.elementum_agentic_skill` lookup for a FOREIGN
|
|
36
|
+
* skill (an agent's `skillAccess` pointing at a skill owned by a
|
|
37
|
+
* different app). The label derives from the skill's `name` (its
|
|
38
|
+
* platform identifier, already slug-shaped) — same discipline as
|
|
39
|
+
* `foreignApp`.
|
|
40
|
+
*/
|
|
41
|
+
foreignSkill(tfLabel: string, name: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Record an arbitrary data lookup by its EXACT captured label and
|
|
44
|
+
* lookup-attr value, bypassing org.ts bag validation — used when the
|
|
45
|
+
* reference isn't drawn from an org.ts bag at all (a group/user field's
|
|
46
|
+
* round-tripped `default_value`, where ei's own data block label is
|
|
47
|
+
* already known from extraction and must be reproduced byte-for-byte,
|
|
48
|
+
* unlike `byName`'s category precedent which re-derives the label from a
|
|
49
|
+
* hand-authored display name).
|
|
50
|
+
*/
|
|
51
|
+
rawLookup(type: string, tfLabel: string, value: string): void;
|
|
52
|
+
/**
|
|
53
|
+
* Record a name-keyed `data.elementum_element` lookup for a FOREIGN
|
|
54
|
+
* element (e.g. a cross-aspect agent-tool target — board issue #42).
|
|
55
|
+
* Same discipline as `foreignApp`, distinct resource type.
|
|
56
|
+
*/
|
|
57
|
+
foreignElement(tfLabel: string, name: string): void;
|
|
58
|
+
}
|
|
59
|
+
export interface ToTfContext {
|
|
60
|
+
/** The owning app's refName — its authoring directory / catalog key. */
|
|
61
|
+
readonly appRefName: string;
|
|
62
|
+
/** The owning app's tfLabel — its namespace (immutable; ei's namespace-first rule). */
|
|
63
|
+
readonly appTfLabel: string;
|
|
64
|
+
readonly orgRefs: OrgRefLookup;
|
|
65
|
+
/** Degradations land here — reported by the caller, never silent. */
|
|
66
|
+
readonly diagnostics: string[];
|
|
67
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic "what file is jiti currently importing, and what's its own
|
|
3
|
+
* untranspiled text" context for `elementum build`'s own-file-child loader.
|
|
4
|
+
*
|
|
5
|
+
* Entity-agnostic on purpose: `engine/` may not import from `entities/`
|
|
6
|
+
* (`__tests__/engine/no-entity-types-in-engine.test.ts`), so this exists
|
|
7
|
+
* purely as plumbing — it knows nothing about automations or any other
|
|
8
|
+
* entity kind. An entity module (e.g. `entities/automation/script-code.ts`)
|
|
9
|
+
* that needs byte-exact access to its own source text — because jiti/Babel's
|
|
10
|
+
* transpile-then-`toString()` round trip would otherwise reformat it —
|
|
11
|
+
* imports {@link currentSourceText} from here (entities/ importing engine/ is
|
|
12
|
+
* the normal direction; only the reverse is forbidden).
|
|
13
|
+
*
|
|
14
|
+
* State lives on `globalThis` (via a `Symbol.for` registry key), not a plain
|
|
15
|
+
* module-scoped variable, for two independent reasons:
|
|
16
|
+
* - `AsyncLocalStorage` was tried first and rejected: jiti's own `.import()`
|
|
17
|
+
* wraps transform + a dynamic `import()` through its own internal
|
|
18
|
+
* scheduling, which does not reliably propagate ALS continuation context
|
|
19
|
+
* through to where the imported module's top-level code actually runs
|
|
20
|
+
* (confirmed empirically — that version silently lost context there).
|
|
21
|
+
* - A plain module-scoped variable has a SEPARATE failure mode: when jiti
|
|
22
|
+
* transforms a `.ts` file that itself imports this module (as opposed to
|
|
23
|
+
* already-compiled `.js`, which jiti can hand off to Node's native
|
|
24
|
+
* loader), jiti may instantiate its OWN, isolated copy of this module —
|
|
25
|
+
* a different module-registry entry than the one `elementum build`'s own
|
|
26
|
+
* (natively-loaded) code holds, so writes through one are invisible to
|
|
27
|
+
* reads through the other. `globalThis` is the one thing guaranteed
|
|
28
|
+
* shared across however many separate module instances end up loaded in
|
|
29
|
+
* the same process.
|
|
30
|
+
*
|
|
31
|
+
* `elementum build`'s own-file-child loader still imports one file at a time
|
|
32
|
+
* in a sequential loop (never concurrently) — see `discoverOwnFileChildren`
|
|
33
|
+
* in `build.ts`. Do not parallelize that loop without revisiting this.
|
|
34
|
+
*/
|
|
35
|
+
export interface SourceTextContext {
|
|
36
|
+
readonly filePath: string;
|
|
37
|
+
readonly text: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Run `fn` (a jiti module import) with `filePath`'s own text available via
|
|
41
|
+
* {@link currentSourceText} for the duration of the returned promise.
|
|
42
|
+
*/
|
|
43
|
+
export declare function withSourceText<T>(filePath: string, text: string, fn: () => Promise<T>): Promise<T>;
|
|
44
|
+
/** The file/text currently being imported via {@link withSourceText}, or undefined outside that context. */
|
|
45
|
+
export declare function currentSourceText(): SourceTextContext | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const GLOBAL_KEY = Symbol.for("elementumEdk.engine.build.currentSourceText");
|
|
2
|
+
function slot() {
|
|
3
|
+
return globalThis;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Run `fn` (a jiti module import) with `filePath`'s own text available via
|
|
7
|
+
* {@link currentSourceText} for the duration of the returned promise.
|
|
8
|
+
*/
|
|
9
|
+
export async function withSourceText(filePath, text, fn) {
|
|
10
|
+
const g = slot();
|
|
11
|
+
const previous = g[GLOBAL_KEY];
|
|
12
|
+
g[GLOBAL_KEY] = { filePath, text };
|
|
13
|
+
try {
|
|
14
|
+
return await fn();
|
|
15
|
+
}
|
|
16
|
+
finally {
|
|
17
|
+
g[GLOBAL_KEY] = previous;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** The file/text currently being imported via {@link withSourceText}, or undefined outside that context. */
|
|
21
|
+
export function currentSourceText() {
|
|
22
|
+
return slot()[GLOBAL_KEY];
|
|
23
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The deployable-entity shape every builder's `def(refName)` returns — the
|
|
3
|
+
* seam between authoring (`defineX` builders) and everything that consumes
|
|
4
|
+
* authored entities (discovery, `appToTf`, catalog regeneration). Extracted
|
|
5
|
+
* from the deleted REST deploy planner: the SHAPE outlived the engine.
|
|
6
|
+
*/
|
|
7
|
+
import type { CatalogRefKind } from "../catalog/types.js";
|
|
8
|
+
export interface EntityDeployOptions {
|
|
9
|
+
/** Deploy-time enabled control. When false, the entity is ignored (as if omitted). */
|
|
10
|
+
readonly enabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** A deployable entity: its source identity + handle-form payload. */
|
|
13
|
+
export interface DeployableEntity extends EntityDeployOptions {
|
|
14
|
+
readonly kind: CatalogRefKind;
|
|
15
|
+
/** The owning parent's handle (app/element/table) — resolves which per-aspect state it lives in. */
|
|
16
|
+
readonly parent: string;
|
|
17
|
+
/** EDK source/catalog/state identity, usually derived from the authoring file refName. */
|
|
18
|
+
readonly refName: string;
|
|
19
|
+
/** Handle-form payload (cross-entity refs are `CatalogRef` tokens, volatile ids stripped). */
|
|
20
|
+
readonly payload: unknown;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Owning-app refName context for an automation's record-bearing trigger/task
|
|
24
|
+
* refs — `defineAutomation.def()` attaches it as a structural extension on
|
|
25
|
+
* the object it returns (deliberately not a declared property: every other
|
|
26
|
+
* kind would carry a slot that never applies to it). The terraform-path
|
|
27
|
+
* automation emitter (M4) is its consumer.
|
|
28
|
+
*/
|
|
29
|
+
export interface RecordFieldContext {
|
|
30
|
+
/** The trigger's owning app refName, when its `record` output is app-field-typed. */
|
|
31
|
+
readonly triggerAppRefName?: string;
|
|
32
|
+
/** Each record-bearing task's refKey → its owning app refName. */
|
|
33
|
+
readonly taskAppRefNameByRefKey?: Readonly<Record<string, string>>;
|
|
34
|
+
}
|
|
35
|
+
/** Read the `recordFieldContext` extension off an entity, if its producer attached one. */
|
|
36
|
+
export declare function recordFieldContextOf(entity: DeployableEntity): RecordFieldContext | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Structural breakage in an entity's to-tf/from-tf (a missing label, a
|
|
39
|
+
* non-canonical bag key) — loud, never a degradation. Degradations go
|
|
40
|
+
* through the context's `diagnostics` instead.
|
|
41
|
+
*/
|
|
42
|
+
export declare class EntityTfError extends Error {
|
|
43
|
+
constructor(message: string);
|
|
44
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Read the `recordFieldContext` extension off an entity, if its producer attached one. */
|
|
2
|
+
export function recordFieldContextOf(entity) {
|
|
3
|
+
return entity.recordFieldContext;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Structural breakage in an entity's to-tf/from-tf (a missing label, a
|
|
7
|
+
* non-canonical bag key) — loud, never a degradation. Degradations go
|
|
8
|
+
* through the context's `diagnostics` instead.
|
|
9
|
+
*/
|
|
10
|
+
export class EntityTfError extends Error {
|
|
11
|
+
constructor(message) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.name = "EntityTfError";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared EXTRACTION toolkit every entity's `from-tf` module uses: the
|
|
3
|
+
* context the pull orchestrators thread through, plus generic TfValue
|
|
4
|
+
* inspectors. Entity-agnostic by definition — nothing in here may name a
|
|
5
|
+
* resource type. (The emission-side twin is src/engine/build/context.ts.)
|
|
6
|
+
*/
|
|
7
|
+
import { type TfValue } from "../tf/index.js";
|
|
8
|
+
/** A `data-attr` reference recorded on a data block in the same stream. */
|
|
9
|
+
export interface DataRef {
|
|
10
|
+
readonly resourceType: string;
|
|
11
|
+
readonly tfLabel: string;
|
|
12
|
+
}
|
|
13
|
+
/** Extraction context: stream lookups + the diagnostics sink. */
|
|
14
|
+
export interface FromTfContext {
|
|
15
|
+
/** Lookup-attr value of a data block in the same stream: ("elementum_category", "experiments") → "Experiments". */
|
|
16
|
+
dataName(type: string, label: string): string | undefined;
|
|
17
|
+
/** DataFacet.providerRefAttr's resolved reference on a data block in the same stream (connector's `provider_id` → its owning `elementum_<type>_ai_provider` block). */
|
|
18
|
+
dataRef(type: string, label: string): DataRef | undefined;
|
|
19
|
+
/** Platform id recorded by the stream's import blocks, by resource address. */
|
|
20
|
+
importId(address: string): string | undefined;
|
|
21
|
+
/** Degradations land here — reported by the caller, never silent. */
|
|
22
|
+
readonly diagnostics: string[];
|
|
23
|
+
/**
|
|
24
|
+
* Resource addresses that must NOT be adopted - nothing in authored
|
|
25
|
+
* source can reproduce them (e.g. a known-but-unimplemented field
|
|
26
|
+
* sub-type). Excluded from adoption's targeted plan even though ei's own
|
|
27
|
+
* export otherwise carries a valid import block for them - see
|
|
28
|
+
* `field/from-tf.ts`'s `implemented` check for the motivating case.
|
|
29
|
+
*/
|
|
30
|
+
readonly skipped: string[];
|
|
31
|
+
}
|
|
32
|
+
/** `data.<type>.<label>.id` → the label; undefined for any other shape. */
|
|
33
|
+
export declare function dataRefLabel(v: TfValue | undefined, type: string): string | undefined;
|
|
34
|
+
/** `<type>.<label>.id` → the label; undefined for any other shape. */
|
|
35
|
+
export declare function resourceRefLabel(v: TfValue | undefined, type: string): string | undefined;
|
|
36
|
+
export declare function optionalString(attrs: Record<string, TfValue>, key: string, where: string, ctx: FromTfContext): string | undefined;
|
|
37
|
+
export declare function optionalBoolean(attrs: Record<string, TfValue>, key: string, where: string, ctx: FromTfContext): boolean | undefined;
|
|
38
|
+
export declare function plainObject(v: TfValue): Record<string, TfValue> | undefined;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared EXTRACTION toolkit every entity's `from-tf` module uses: the
|
|
3
|
+
* context the pull orchestrators thread through, plus generic TfValue
|
|
4
|
+
* inspectors. Entity-agnostic by definition — nothing in here may name a
|
|
5
|
+
* resource type. (The emission-side twin is src/engine/build/context.ts.)
|
|
6
|
+
*/
|
|
7
|
+
import { isTfExpr } from "../tf/index.js";
|
|
8
|
+
/** `data.<type>.<label>.id` → the label; undefined for any other shape. */
|
|
9
|
+
export function dataRefLabel(v, type) {
|
|
10
|
+
if (v === undefined || !isTfExpr(v) || v.$expr !== "data-attr" || v.type !== type)
|
|
11
|
+
return undefined;
|
|
12
|
+
return v.path.length === 1 && v.path[0] === "id" ? v.label : undefined;
|
|
13
|
+
}
|
|
14
|
+
/** `<type>.<label>.id` → the label; undefined for any other shape. */
|
|
15
|
+
export function resourceRefLabel(v, type) {
|
|
16
|
+
if (v === undefined || !isTfExpr(v) || v.$expr !== "resource-attr" || v.type !== type)
|
|
17
|
+
return undefined;
|
|
18
|
+
return v.path.length === 1 && v.path[0] === "id" ? v.label : undefined;
|
|
19
|
+
}
|
|
20
|
+
export function optionalString(attrs, key, where, ctx) {
|
|
21
|
+
const v = attrs[key];
|
|
22
|
+
if (v === undefined)
|
|
23
|
+
return undefined;
|
|
24
|
+
if (typeof v !== "string") {
|
|
25
|
+
ctx.diagnostics.push(`${where}: expected string "${key}", got ${JSON.stringify(v)}; dropped`);
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
return v;
|
|
29
|
+
}
|
|
30
|
+
export function optionalBoolean(attrs, key, where, ctx) {
|
|
31
|
+
const v = attrs[key];
|
|
32
|
+
if (v === undefined)
|
|
33
|
+
return undefined;
|
|
34
|
+
if (typeof v !== "boolean") {
|
|
35
|
+
ctx.diagnostics.push(`${where}: expected boolean "${key}", got ${JSON.stringify(v)}; dropped`);
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
return v;
|
|
39
|
+
}
|
|
40
|
+
export function plainObject(v) {
|
|
41
|
+
if (typeof v !== "object" || v === null || Array.isArray(v) || isTfExpr(v))
|
|
42
|
+
return undefined;
|
|
43
|
+
return v;
|
|
44
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Org-stream ORCHESTRATOR: the typed blocks of an `ei org export` stream →
|
|
3
|
+
* the org's reference identities (plan §7 M1). Owns traversal, dispatch,
|
|
4
|
+
* loud unknown-kind errors, and assembly — per-kind knowledge lives in
|
|
5
|
+
* src/entities/org/ (data-facet modules assembled in src/graph/modules.ts).
|
|
6
|
+
*
|
|
7
|
+
* The stream is a frozen contract (M0, board item 218): data-source lookups
|
|
8
|
+
* for cloud links / categories / AI provider connectors / groups, plus a
|
|
9
|
+
* locals.org_apps namespace→id map. Anything else in the stream means the
|
|
10
|
+
* contract drifted — loud error, never a silent drop (plan §4.3).
|
|
11
|
+
*
|
|
12
|
+
* Naming: the authoring key (`tsLabel`) is DERIVED from
|
|
13
|
+
* the exported terraform label through the lossless bijection in
|
|
14
|
+
* src/tf/labels.ts — no minting, no tiebreakers (ei guarantees per-type
|
|
15
|
+
* label uniqueness; the bijection preserves it). The label itself is NOT
|
|
16
|
+
* persisted anywhere: the key IS the label in camelCase clothing, and build
|
|
17
|
+
* derives it back via tsLabelToTfLabel. The bijection is the stable naming
|
|
18
|
+
* contract; changing it is an upgrade/migration event.
|
|
19
|
+
*/
|
|
20
|
+
import type { TfDocument } from "../tf/index.js";
|
|
21
|
+
/** A `data-attr` reference to another org identity's own data block. */
|
|
22
|
+
export interface OrgIdentityRef {
|
|
23
|
+
readonly resourceType: string;
|
|
24
|
+
readonly tfLabel: string;
|
|
25
|
+
}
|
|
26
|
+
/** One org-owned reference identity from the export stream. */
|
|
27
|
+
export interface OrgIdentity {
|
|
28
|
+
/** Authoring token key: tsLabel = the bijective camelCase image of tfLabel. */
|
|
29
|
+
readonly tsLabel: string;
|
|
30
|
+
/**
|
|
31
|
+
* Display name — also the data source's lookup key on the platform
|
|
32
|
+
* (`name` for cloud links/categories/groups, `model_name` for connectors).
|
|
33
|
+
*/
|
|
34
|
+
readonly name: string;
|
|
35
|
+
/** The exported terraform label (in-memory provenance; equals tsLabelToTfLabel(tsLabel), never persisted). */
|
|
36
|
+
readonly tfLabel: string;
|
|
37
|
+
/** The data block's own terraform type — a bag can span multiple types (aiProviders: 10 distinct `elementum_<type>_ai_provider` types). */
|
|
38
|
+
readonly resourceType: string;
|
|
39
|
+
/** DataFacet.providerRefAttr's resolved reference (connector's `provider_id` → its owning `elementum_<type>_ai_provider` block), when the kind has one. */
|
|
40
|
+
readonly providerRef?: OrgIdentityRef;
|
|
41
|
+
}
|
|
42
|
+
export interface OrgExtract {
|
|
43
|
+
readonly cloudLinks: readonly OrgIdentity[];
|
|
44
|
+
readonly categories: readonly OrgIdentity[];
|
|
45
|
+
readonly connectors: readonly OrgIdentity[];
|
|
46
|
+
readonly aiProviders: readonly OrgIdentity[];
|
|
47
|
+
readonly groups: readonly OrgIdentity[];
|
|
48
|
+
/** The org app directory (namespace → platform id) from locals.org_apps. */
|
|
49
|
+
readonly apps: Readonly<Record<string, string>>;
|
|
50
|
+
}
|
|
51
|
+
export declare class OrgExtractError extends Error {
|
|
52
|
+
constructor(message: string);
|
|
53
|
+
}
|
|
54
|
+
export declare function extractOrg(doc: TfDocument): OrgExtract;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Org-stream ORCHESTRATOR: the typed blocks of an `ei org export` stream →
|
|
3
|
+
* the org's reference identities (plan §7 M1). Owns traversal, dispatch,
|
|
4
|
+
* loud unknown-kind errors, and assembly — per-kind knowledge lives in
|
|
5
|
+
* src/entities/org/ (data-facet modules assembled in src/graph/modules.ts).
|
|
6
|
+
*
|
|
7
|
+
* The stream is a frozen contract (M0, board item 218): data-source lookups
|
|
8
|
+
* for cloud links / categories / AI provider connectors / groups, plus a
|
|
9
|
+
* locals.org_apps namespace→id map. Anything else in the stream means the
|
|
10
|
+
* contract drifted — loud error, never a silent drop (plan §4.3).
|
|
11
|
+
*
|
|
12
|
+
* Naming: the authoring key (`tsLabel`) is DERIVED from
|
|
13
|
+
* the exported terraform label through the lossless bijection in
|
|
14
|
+
* src/tf/labels.ts — no minting, no tiebreakers (ei guarantees per-type
|
|
15
|
+
* label uniqueness; the bijection preserves it). The label itself is NOT
|
|
16
|
+
* persisted anywhere: the key IS the label in camelCase clothing, and build
|
|
17
|
+
* derives it back via tsLabelToTfLabel. The bijection is the stable naming
|
|
18
|
+
* contract; changing it is an upgrade/migration event.
|
|
19
|
+
*/
|
|
20
|
+
import { DATA_FACET_BY_TYPE } from "../../graph/index.js";
|
|
21
|
+
import { isTfExpr, tfLabelToTsLabel } from "../tf/index.js";
|
|
22
|
+
export class OrgExtractError extends Error {
|
|
23
|
+
constructor(message) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.name = "OrgExtractError";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export function extractOrg(doc) {
|
|
29
|
+
const raw = {
|
|
30
|
+
cloudLinks: [],
|
|
31
|
+
categories: [],
|
|
32
|
+
connectors: [],
|
|
33
|
+
aiProviders: [],
|
|
34
|
+
groups: [],
|
|
35
|
+
};
|
|
36
|
+
let apps;
|
|
37
|
+
for (const block of doc.blocks) {
|
|
38
|
+
if (block.kind === "data") {
|
|
39
|
+
const type = block.type ?? "";
|
|
40
|
+
const kind = DATA_FACET_BY_TYPE.get(type);
|
|
41
|
+
const orgBag = kind?.data.participates === true ? kind.data.orgBag : undefined;
|
|
42
|
+
// A data facet without orgBag (e.g. elementum_user, foreign app) is
|
|
43
|
+
// app-stream-only — presence here is contract drift like an unknown type.
|
|
44
|
+
if (orgBag === undefined || kind?.data.participates !== true) {
|
|
45
|
+
throw new OrgExtractError(`unexpected data source "${block.type}" in org export stream — the M0 contract grew; extend the extractor deliberately`);
|
|
46
|
+
}
|
|
47
|
+
const tfLabel = requireLabel(block);
|
|
48
|
+
raw[orgBag].push({
|
|
49
|
+
name: requireStringAttr(block, kind.data.lookupAttr),
|
|
50
|
+
tfLabel,
|
|
51
|
+
resourceType: type,
|
|
52
|
+
// `provider_id` is a REAL ref only when the connector's provider was
|
|
53
|
+
// also exported (`writeConnectorDataBlocks`, cmd/elementum/export/
|
|
54
|
+
// org_export.go) — otherwise the bridge falls back to a
|
|
55
|
+
// `provider_name` string, or emits neither at all for an orphaned
|
|
56
|
+
// connector (no provider on the platform side). So the attribute's
|
|
57
|
+
// mere absence is a legitimate dialect branch, not contract drift —
|
|
58
|
+
// only demand `requireDataRef`'s shape when the attribute is
|
|
59
|
+
// actually present; malformed-but-present still fails loud.
|
|
60
|
+
providerRef: kind.data.providerRefAttr !== undefined && block.attrs[kind.data.providerRefAttr] !== undefined
|
|
61
|
+
? requireDataRef(block, kind.data.providerRefAttr, tfLabel)
|
|
62
|
+
: undefined,
|
|
63
|
+
});
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (block.kind === "locals") {
|
|
67
|
+
const orgApps = block.attrs["org_apps"];
|
|
68
|
+
if (orgApps === undefined) {
|
|
69
|
+
throw new OrgExtractError(`unexpected locals block (keys: ${Object.keys(block.attrs).join(", ")}) in org export stream`);
|
|
70
|
+
}
|
|
71
|
+
apps = requireStringMap(orgApps);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
throw new OrgExtractError(`unexpected ${block.kind} block in org export stream — org export is identity-level only`);
|
|
75
|
+
}
|
|
76
|
+
if (apps === undefined) {
|
|
77
|
+
throw new OrgExtractError("org export stream has no locals.org_apps — is this really an org export?");
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
cloudLinks: withTsLabels(raw.cloudLinks),
|
|
81
|
+
categories: withTsLabels(raw.categories),
|
|
82
|
+
connectors: withTsLabels(raw.connectors),
|
|
83
|
+
aiProviders: withTsLabels(raw.aiProviders),
|
|
84
|
+
groups: withTsLabels(raw.groups),
|
|
85
|
+
apps,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** Derive each identity's authoring key from its recorded tfLabel — pure,
|
|
89
|
+
* lossless, and unique because ei's tfLabels are unique per type. */
|
|
90
|
+
function withTsLabels(entities) {
|
|
91
|
+
return entities
|
|
92
|
+
.map((e) => ({
|
|
93
|
+
tsLabel: tfLabelToTsLabel(e.tfLabel),
|
|
94
|
+
name: e.name,
|
|
95
|
+
tfLabel: e.tfLabel,
|
|
96
|
+
resourceType: e.resourceType,
|
|
97
|
+
providerRef: e.providerRef,
|
|
98
|
+
}))
|
|
99
|
+
.sort((a, b) => a.tsLabel.localeCompare(b.tsLabel));
|
|
100
|
+
}
|
|
101
|
+
/** A `providerRefAttr` value must be a `data-attr` reference's `.id` — loud otherwise (contract drift, not silent). */
|
|
102
|
+
function requireDataRef(block, attr, tfLabel) {
|
|
103
|
+
const v = block.attrs[attr];
|
|
104
|
+
if (isTfExpr(v) && v.$expr === "data-attr" && v.path.length === 1 && v.path[0] === "id") {
|
|
105
|
+
return { resourceType: v.type, tfLabel: v.label };
|
|
106
|
+
}
|
|
107
|
+
throw new OrgExtractError(`data "${block.type}" "${tfLabel}": expected "${attr}" to be a data source reference, got ${JSON.stringify(v)}`);
|
|
108
|
+
}
|
|
109
|
+
function requireLabel(block) {
|
|
110
|
+
if (!block.label) {
|
|
111
|
+
throw new OrgExtractError(`data "${block.type}" block is missing its label`);
|
|
112
|
+
}
|
|
113
|
+
return block.label;
|
|
114
|
+
}
|
|
115
|
+
function requireStringAttr(block, attr) {
|
|
116
|
+
const v = block.attrs[attr];
|
|
117
|
+
if (typeof v !== "string") {
|
|
118
|
+
throw new OrgExtractError(`data "${block.type}" "${block.label}": expected string attribute "${attr}", got ${JSON.stringify(v)}`);
|
|
119
|
+
}
|
|
120
|
+
return v;
|
|
121
|
+
}
|
|
122
|
+
function requireStringMap(v) {
|
|
123
|
+
if (typeof v !== "object" || v === null || Array.isArray(v)) {
|
|
124
|
+
throw new OrgExtractError("locals.org_apps is not an object");
|
|
125
|
+
}
|
|
126
|
+
const out = {};
|
|
127
|
+
for (const [k, val] of Object.entries(v)) {
|
|
128
|
+
if (typeof val !== "string") {
|
|
129
|
+
throw new OrgExtractError(`locals.org_apps["${k}"] is not a string`);
|
|
130
|
+
}
|
|
131
|
+
out[k] = val;
|
|
132
|
+
}
|
|
133
|
+
return out;
|
|
134
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single string-canonicalization rule (verified in the hcl2json spike):
|
|
3
|
+
* hcl2json returns string values with standard escapes decoded (\n, \" are
|
|
4
|
+
* real characters) but template introducers still doubled ($${, %%{). Our
|
|
5
|
+
* model stores the LOGICAL string (single ${ / %{); render re-doubles them.
|
|
6
|
+
* Encode/decode are inverses — property-tested.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* hcl2json string value → logical string.
|
|
10
|
+
* Callback replacements throughout: in a replacement STRING, `$$` is an
|
|
11
|
+
* escape sequence (so "$${" would silently collapse to "${").
|
|
12
|
+
*/
|
|
13
|
+
export declare function decodeTemplateEscapes(s: string): string;
|
|
14
|
+
/** Logical string → HCL template-safe form (inverse of decode). */
|
|
15
|
+
export declare function encodeTemplateEscapes(s: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Render a logical string as an HCL2 quoted string literal.
|
|
18
|
+
* JSON string escaping is a subset of HCL2's quoted-string escapes
|
|
19
|
+
* (\n, \t, \", \\, \uXXXX are all valid HCL); template introducers are
|
|
20
|
+
* additionally doubled so they stay literal.
|
|
21
|
+
*/
|
|
22
|
+
export declare function quoteHclString(logical: string): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single string-canonicalization rule (verified in the hcl2json spike):
|
|
3
|
+
* hcl2json returns string values with standard escapes decoded (\n, \" are
|
|
4
|
+
* real characters) but template introducers still doubled ($${, %%{). Our
|
|
5
|
+
* model stores the LOGICAL string (single ${ / %{); render re-doubles them.
|
|
6
|
+
* Encode/decode are inverses — property-tested.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* hcl2json string value → logical string.
|
|
10
|
+
* Callback replacements throughout: in a replacement STRING, `$$` is an
|
|
11
|
+
* escape sequence (so "$${" would silently collapse to "${").
|
|
12
|
+
*/
|
|
13
|
+
export function decodeTemplateEscapes(s) {
|
|
14
|
+
return s.replaceAll("$${", () => "${").replaceAll("%%{", () => "%{");
|
|
15
|
+
}
|
|
16
|
+
/** Logical string → HCL template-safe form (inverse of decode). */
|
|
17
|
+
export function encodeTemplateEscapes(s) {
|
|
18
|
+
return s.replaceAll("${", () => "$${").replaceAll("%{", () => "%%{");
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Render a logical string as an HCL2 quoted string literal.
|
|
22
|
+
* JSON string escaping is a subset of HCL2's quoted-string escapes
|
|
23
|
+
* (\n, \t, \", \\, \uXXXX are all valid HCL); template introducers are
|
|
24
|
+
* additionally doubled so they stay literal.
|
|
25
|
+
*/
|
|
26
|
+
export function quoteHclString(logical) {
|
|
27
|
+
return JSON.stringify(encodeTemplateEscapes(logical));
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parser for the CLOSED expression grammar ei export emits (plan §4.1):
|
|
3
|
+
*
|
|
4
|
+
* expr := jsonencode | reference
|
|
5
|
+
* reference := ("data." type "." label | type "." label) ("." ident)* index?
|
|
6
|
+
* | "local." ident
|
|
7
|
+
* index := "[" quoted-string "]"
|
|
8
|
+
* jsonencode:= "jsonencode(" hcl-literal ")"
|
|
9
|
+
*
|
|
10
|
+
* plus templates: strings mixing literal text with ${...} parts.
|
|
11
|
+
* Anything else is a LOUD error — an unknown form in a stream means the
|
|
12
|
+
* dialect grew and the grammar (and its approval) must grow with it.
|
|
13
|
+
*/
|
|
14
|
+
import type { TfExpr } from "./model.js";
|
|
15
|
+
export declare class TfExprError extends Error {
|
|
16
|
+
constructor(message: string, source: string);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Parse a raw hcl2json string value into a logical string or expression.
|
|
20
|
+
* hcl2json encodes every expression attribute as "${...}"; plain strings
|
|
21
|
+
* stay plain (with template escapes still doubled).
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseStringValue(raw: string): string | TfExpr;
|
|
24
|
+
/** Parse the inside of a ${...} interpolation. */
|
|
25
|
+
export declare function parseExpression(src: string): TfExpr;
|