@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,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent-tool extraction (M3): one `elementum_agent_*_tool` block → the
|
|
3
|
+
* normalized shape the agent printer consumes. The owning agent's from-tf
|
|
4
|
+
* drives the pass and says who the owners are — this module never names the
|
|
5
|
+
* agent or app resource types.
|
|
6
|
+
*/
|
|
7
|
+
import { EntityTfError } from "../../engine/entity.js";
|
|
8
|
+
import { optionalString, resourceRefLabel } from "../../engine/pull/context.js";
|
|
9
|
+
import { isTfExpr, scopedLabelToBagKey } from "../../engine/tf/index.js";
|
|
10
|
+
import { resolveToolFieldKey } from "../shared/tool-field-ref.js";
|
|
11
|
+
import { KNOWN_TOOL_ATTRS, TOOL_SUB_TYPE_BY_RESOURCE } from "./types.js";
|
|
12
|
+
/**
|
|
13
|
+
* One tool block → its normalized shape; undefined = skipped with a
|
|
14
|
+
* diagnostic (unimplemented sub-type, wrong owner, unresolvable target).
|
|
15
|
+
*/
|
|
16
|
+
export function toolFromTf(block, owner, ctx) {
|
|
17
|
+
const subType = TOOL_SUB_TYPE_BY_RESOURCE.get(block.type ?? "");
|
|
18
|
+
if (subType === undefined) {
|
|
19
|
+
ctx.diagnostics.push(`resource "${block.type}" is not a known agent tool resource; skipped`);
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
const label = block.label;
|
|
23
|
+
if (label === undefined || label === "") {
|
|
24
|
+
throw new EntityTfError(`${block.type} block is missing its label`);
|
|
25
|
+
}
|
|
26
|
+
const attrs = block.attrs;
|
|
27
|
+
const name = optionalString(attrs, "name", `tool "${label}"`, ctx) ?? "";
|
|
28
|
+
const where = `agent tool "${name}" (${block.type}.${label})`;
|
|
29
|
+
if (subType.implemented !== true) {
|
|
30
|
+
ctx.diagnostics.push(`${where}: tool kind is not supported on the terraform path yet; skipped`);
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
const known = KNOWN_TOOL_ATTRS[subType.typeKey];
|
|
34
|
+
for (const key of Object.keys(attrs)) {
|
|
35
|
+
if (!known.has(key)) {
|
|
36
|
+
ctx.diagnostics.push(`${where}: unhandled attribute "${key}" — the export dialect grew; extend toolFromTf deliberately`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (resourceRefLabel(attrs["agent_id"], owner.agentType) !== owner.agentLabel) {
|
|
40
|
+
ctx.diagnostics.push(`${where}: agent_id does not reference ${owner.agentType}.${owner.agentLabel}; skipped`);
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
if (subType.typeKey === "executeWorkflow") {
|
|
44
|
+
return executeWorkflowFromTf(block, name, where, owner, ctx);
|
|
45
|
+
}
|
|
46
|
+
// Target: the owning app's resource ref = self; a data.elementum_app ref =
|
|
47
|
+
// a foreign app, resolved to its display name via the stream's data block.
|
|
48
|
+
// searchTable is the one sub-type where target_id can be absent entirely
|
|
49
|
+
// (confirmed live: a search table tool searches the table itself, with no
|
|
50
|
+
// "live record" target required) — every other implemented sub-type
|
|
51
|
+
// requires it.
|
|
52
|
+
const targetAttr = attrs["target_id"];
|
|
53
|
+
let target;
|
|
54
|
+
// The tool's fields are scoped under the RESOLVED target aspect, not
|
|
55
|
+
// always the owning app (board issue #169) — a field on a foreign
|
|
56
|
+
// app/element carries that aspect's own label, mirroring the
|
|
57
|
+
// foreignApp/foreignElement resolution below.
|
|
58
|
+
let fieldScopeLabel = owner.ownerTfLabel;
|
|
59
|
+
let fieldScope = "app";
|
|
60
|
+
if (targetAttr === undefined) {
|
|
61
|
+
if (subType.typeKey !== "searchTable") {
|
|
62
|
+
ctx.diagnostics.push(`${where}: target_id is missing; skipped`);
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
const selfLabel = resourceRefLabel(targetAttr, owner.appType);
|
|
68
|
+
if (selfLabel === owner.appLabel) {
|
|
69
|
+
target = { kind: "self" };
|
|
70
|
+
}
|
|
71
|
+
else if (isTfExpr(targetAttr) && targetAttr.$expr === "data-attr" && targetAttr.type === "elementum_app") {
|
|
72
|
+
const appName = ctx.dataName("elementum_app", targetAttr.label);
|
|
73
|
+
if (appName === undefined) {
|
|
74
|
+
ctx.diagnostics.push(`${where}: target_id references data.elementum_app.${targetAttr.label} but the stream has no such data block; skipped`);
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
target = { kind: "foreignApp", name: appName };
|
|
78
|
+
fieldScopeLabel = targetAttr.label;
|
|
79
|
+
}
|
|
80
|
+
else if (isTfExpr(targetAttr) && targetAttr.$expr === "data-attr" && targetAttr.type === "elementum_element") {
|
|
81
|
+
// Board issue #42: an aspect target can be an element, not just an app —
|
|
82
|
+
// same shape as the foreignApp branch, just the other data type.
|
|
83
|
+
const elementName = ctx.dataName("elementum_element", targetAttr.label);
|
|
84
|
+
if (elementName === undefined) {
|
|
85
|
+
ctx.diagnostics.push(`${where}: target_id references data.elementum_element.${targetAttr.label} but the stream has no such data block; skipped`);
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
target = { kind: "foreignElement", name: elementName };
|
|
89
|
+
fieldScopeLabel = targetAttr.label;
|
|
90
|
+
fieldScope = "element";
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
ctx.diagnostics.push(`${where}: target_id has an unrecognized shape (${JSON.stringify(targetAttr)}); skipped`);
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
let fields;
|
|
98
|
+
let searchTableFields;
|
|
99
|
+
const rawFields = attrs["fields"];
|
|
100
|
+
if (Array.isArray(rawFields)) {
|
|
101
|
+
if (subType.typeKey === "searchTable") {
|
|
102
|
+
searchTableFields = [];
|
|
103
|
+
for (const item of rawFields) {
|
|
104
|
+
if (typeof item !== "object" || item === null || Array.isArray(item) || isTfExpr(item)) {
|
|
105
|
+
ctx.diagnostics.push(`${where}: fields item has an unrecognized shape; dropped`);
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
const rec = item;
|
|
109
|
+
if (typeof rec["field_id"] !== "string" || rec["field_id"] === "") {
|
|
110
|
+
ctx.diagnostics.push(`${where}: fields item has no field_id; dropped`);
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
searchTableFields.push({
|
|
114
|
+
fieldId: rec["field_id"],
|
|
115
|
+
...(typeof rec["name"] === "string" && { name: rec["name"] }),
|
|
116
|
+
...(typeof rec["description"] === "string" && { description: rec["description"] }),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
if (searchTableFields.length === 0)
|
|
120
|
+
searchTableFields = undefined;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
fields = [];
|
|
124
|
+
for (const item of rawFields) {
|
|
125
|
+
if (typeof item !== "object" || item === null || Array.isArray(item) || isTfExpr(item)) {
|
|
126
|
+
ctx.diagnostics.push(`${where}: fields item has an unrecognized shape; dropped`);
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
const rec = item;
|
|
130
|
+
const fieldKey = resolveToolFieldKey(rec["field_id"], fieldScopeLabel, fieldScope);
|
|
131
|
+
// A field on a foreign/out-of-scope aspect has no field resource ei
|
|
132
|
+
// can reference — it falls back to a bare platform id, confirmed
|
|
133
|
+
// live (board issue #169). Preserve it (raw-id TODO placeholder)
|
|
134
|
+
// rather than silently dropping the field.
|
|
135
|
+
const rawFieldId = fieldKey === undefined && typeof rec["field_id"] === "string" && rec["field_id"] !== "" ? rec["field_id"] : undefined;
|
|
136
|
+
if (fieldKey === undefined && rawFieldId === undefined) {
|
|
137
|
+
ctx.diagnostics.push(`${where}: fields item's field_id is not a field resource reference; dropped`);
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
fields.push({
|
|
141
|
+
...(fieldKey !== undefined ? { key: fieldKey } : { rawFieldId: rawFieldId }),
|
|
142
|
+
...(typeof rec["name"] === "string" && { name: rec["name"] }),
|
|
143
|
+
...(typeof rec["description"] === "string" && { description: rec["description"] }),
|
|
144
|
+
...(typeof rec["required"] === "boolean" && { required: rec["required"] }),
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
if (fields.length === 0)
|
|
148
|
+
fields = undefined;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
else if (rawFields !== undefined) {
|
|
152
|
+
ctx.diagnostics.push(`${where}: fields is not a list; dropped`);
|
|
153
|
+
}
|
|
154
|
+
// searchTable's field_id is ALWAYS a raw platform id, never a resource
|
|
155
|
+
// reference (confirmed live, 161/161 real captures) — these describe
|
|
156
|
+
// columns of the search table's own schema, not app/element fields, so
|
|
157
|
+
// there's no elementum_*_field resource (and no catalog bag key) to
|
|
158
|
+
// resolve them to.
|
|
159
|
+
let returnFields;
|
|
160
|
+
const rawReturnFields = attrs["return_fields"];
|
|
161
|
+
if (Array.isArray(rawReturnFields)) {
|
|
162
|
+
returnFields = [];
|
|
163
|
+
for (const item of rawReturnFields) {
|
|
164
|
+
if (typeof item !== "object" || item === null || Array.isArray(item) || isTfExpr(item)) {
|
|
165
|
+
ctx.diagnostics.push(`${where}: return_fields item has an unrecognized shape; dropped`);
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
const rec = item;
|
|
169
|
+
if (typeof rec["field_id"] !== "string" || rec["field_id"] === "") {
|
|
170
|
+
ctx.diagnostics.push(`${where}: return_fields item has no field_id; dropped`);
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
returnFields.push({
|
|
174
|
+
fieldId: rec["field_id"],
|
|
175
|
+
...(typeof rec["name"] === "string" && { name: rec["name"] }),
|
|
176
|
+
...(typeof rec["display_name"] === "string" && { displayName: rec["display_name"] }),
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
if (returnFields.length === 0)
|
|
180
|
+
returnFields = undefined;
|
|
181
|
+
}
|
|
182
|
+
else if (rawReturnFields !== undefined) {
|
|
183
|
+
ctx.diagnostics.push(`${where}: return_fields is not a list; dropped`);
|
|
184
|
+
}
|
|
185
|
+
if (subType.typeKey === "searchAspect" && attrs["filter_variables"] !== undefined) {
|
|
186
|
+
ctx.diagnostics.push(`${where}: filter_variables are not supported on the terraform path yet; a rebuilt stream will omit them`);
|
|
187
|
+
}
|
|
188
|
+
const startMessage = optionalString(attrs, "start_message", where, ctx);
|
|
189
|
+
return {
|
|
190
|
+
typeKey: subType.typeKey,
|
|
191
|
+
name,
|
|
192
|
+
description: optionalString(attrs, "description", where, ctx) ?? "",
|
|
193
|
+
...(startMessage !== undefined && { startMessage }),
|
|
194
|
+
...(target !== undefined && { target }),
|
|
195
|
+
...(fields !== undefined && { fields }),
|
|
196
|
+
...(searchTableFields !== undefined && { searchTableFields }),
|
|
197
|
+
...(returnFields !== undefined && { returnFields }),
|
|
198
|
+
...((subType.typeKey === "searchAspect" || subType.typeKey === "searchTable") && {
|
|
199
|
+
queryDescription: optionalString(attrs, "query_description", where, ctx) ?? "",
|
|
200
|
+
}),
|
|
201
|
+
...(typeof attrs["result_limit"] === "number" && { limit: attrs["result_limit"] }),
|
|
202
|
+
...(subType.typeKey === "updateRecord" && {
|
|
203
|
+
handleDescription: optionalString(attrs, "handle_description", where, ctx) ?? "",
|
|
204
|
+
}),
|
|
205
|
+
...(subType.typeKey === "searchTable" && typeof attrs["search_table_id"] === "string" && {
|
|
206
|
+
searchTableId: attrs["search_table_id"],
|
|
207
|
+
}),
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Run-automation (executeWorkflow) tool extraction. `automation_id` may
|
|
212
|
+
* reference the publish block (ei's uuid→ref winner — the publish import is
|
|
213
|
+
* generated after the automation's, and both carry the same platform id) or
|
|
214
|
+
* the automation resource itself; both labels are the automation's.
|
|
215
|
+
*/
|
|
216
|
+
function executeWorkflowFromTf(block, name, where, owner, ctx) {
|
|
217
|
+
const attrs = block.attrs;
|
|
218
|
+
const autoRef = attrs["automation_id"];
|
|
219
|
+
const autoLabel = isTfExpr(autoRef) &&
|
|
220
|
+
autoRef.$expr === "resource-attr" &&
|
|
221
|
+
(autoRef.type === "elementum_workflow_publish" || autoRef.type === "elementum_automation")
|
|
222
|
+
? autoRef.label
|
|
223
|
+
: undefined;
|
|
224
|
+
if (autoLabel === undefined) {
|
|
225
|
+
ctx.diagnostics.push(`${where}: automation_id is not an automation/workflow_publish resource reference (${JSON.stringify(autoRef)}); skipped`);
|
|
226
|
+
return undefined;
|
|
227
|
+
}
|
|
228
|
+
const inputs = [];
|
|
229
|
+
for (const item of Array.isArray(attrs["inputs"]) ? attrs["inputs"] : []) {
|
|
230
|
+
const rec = (typeof item === "object" && item !== null && !isTfExpr(item) ? item : {});
|
|
231
|
+
if (typeof rec["parameter_name"] !== "string" || rec["parameter_name"] === "") {
|
|
232
|
+
ctx.diagnostics.push(`${where}: inputs item has no parameter_name; dropped`);
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
inputs.push({
|
|
236
|
+
parameterName: rec["parameter_name"],
|
|
237
|
+
...(typeof rec["name"] === "string" && { name: rec["name"] }),
|
|
238
|
+
...(typeof rec["description"] === "string" && { description: rec["description"] }),
|
|
239
|
+
...(typeof rec["required"] === "boolean" && { required: rec["required"] }),
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
const outputs = [];
|
|
243
|
+
for (const item of Array.isArray(attrs["outputs"]) ? attrs["outputs"] : []) {
|
|
244
|
+
const rec = (typeof item === "object" && item !== null && !isTfExpr(item) ? item : {});
|
|
245
|
+
if (typeof rec["workflow_property_name"] !== "string" || rec["workflow_property_name"] === "") {
|
|
246
|
+
ctx.diagnostics.push(`${where}: outputs item has no workflow_property_name; dropped`);
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
outputs.push({
|
|
250
|
+
workflowPropertyName: rec["workflow_property_name"],
|
|
251
|
+
...(typeof rec["name"] === "string" && { name: rec["name"] }),
|
|
252
|
+
...(typeof rec["description"] === "string" && { description: rec["description"] }),
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
const startMessage = optionalString(attrs, "start_message", where, ctx);
|
|
256
|
+
return {
|
|
257
|
+
typeKey: "executeWorkflow",
|
|
258
|
+
name,
|
|
259
|
+
description: optionalString(attrs, "description", where, ctx) ?? "",
|
|
260
|
+
...(startMessage !== undefined && { startMessage }),
|
|
261
|
+
automationKey: scopedLabelToBagKey(owner.ownerTfLabel, autoLabel),
|
|
262
|
+
...(inputs.length > 0 && { inputs }),
|
|
263
|
+
...(outputs.length > 0 && { outputs }),
|
|
264
|
+
};
|
|
265
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** The agent-tool entity's registry entry (see src/graph/). */
|
|
2
|
+
import { NO_CATALOG, NO_DATA, NO_LIFECYCLE, } from "../../graph/types.js";
|
|
3
|
+
import { AUTOMATION_RESOURCE_TYPE, WORKFLOW_PUBLISH_RESOURCE_TYPE, } from "../automation/types.js";
|
|
4
|
+
import { AGENT_TOOL_SUB_TYPES, RUN_AUTOMATION_TOOL_RESOURCE_TYPE, } from "./types.js";
|
|
5
|
+
export const agentToolModule = {
|
|
6
|
+
kind: "agent-tool",
|
|
7
|
+
stream: { role: "streamMember" },
|
|
8
|
+
authoring: { unit: "inline", bag: "tools" },
|
|
9
|
+
parents: [{ parent: "agent", child: "agent-tool" }],
|
|
10
|
+
resource: {
|
|
11
|
+
shape: "subTypes",
|
|
12
|
+
rows: AGENT_TOOL_SUB_TYPES.map((t) => ({
|
|
13
|
+
key: t.typeKey,
|
|
14
|
+
resourceType: t.resourceType,
|
|
15
|
+
implemented: t.implemented === true,
|
|
16
|
+
})),
|
|
17
|
+
},
|
|
18
|
+
data: NO_DATA,
|
|
19
|
+
lifecycle: NO_LIFECYCLE,
|
|
20
|
+
canvas: { participates: true, label: "Tools", glyph: "⚒", component: "toolCard" },
|
|
21
|
+
catalog: NO_CATALOG,
|
|
22
|
+
roundtrip: {
|
|
23
|
+
referenceAliases: [
|
|
24
|
+
{
|
|
25
|
+
blockType: RUN_AUTOMATION_TOOL_RESOURCE_TYPE,
|
|
26
|
+
attribute: "automation_id",
|
|
27
|
+
fromType: WORKFLOW_PUBLISH_RESOURCE_TYPE,
|
|
28
|
+
toType: AUTOMATION_RESOURCE_TYPE,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent-tool emission (M3): one authored tool → one
|
|
3
|
+
* `elementum_agent_*_tool` resource block, in ei's dialect. The owning
|
|
4
|
+
* AGENT's to-tf drives the pass and supplies both back-references
|
|
5
|
+
* (`agent_id`, `app_id`) — this module never names the agent or app
|
|
6
|
+
* resource types.
|
|
7
|
+
*
|
|
8
|
+
* Reference dialect (verified live, docs/design/m3-agent-dialect.md):
|
|
9
|
+
* - self-app target → the app's own resource ref;
|
|
10
|
+
* - cross-app target → a name-keyed `data.elementum_app` lookup whose
|
|
11
|
+
* label derives from the app NAME (ei's sanitize rule);
|
|
12
|
+
* - tool fields → the field resource's ref (`elementum_*_field.<label>.id`),
|
|
13
|
+
* derivable purely from the FieldRef token (fieldType + refName).
|
|
14
|
+
*/
|
|
15
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
16
|
+
export interface ToolToTfContext {
|
|
17
|
+
/** The owning app's refName + tfLabel (namespace) — self-target detection + app_id. */
|
|
18
|
+
readonly appRefName: string;
|
|
19
|
+
readonly appTfLabel: string;
|
|
20
|
+
/** The owning agent's bare tfLabel (before apps_ prefix). */
|
|
21
|
+
readonly agentBareTfLabel: string;
|
|
22
|
+
/** Records a foreign-app data lookup for data.tf; returns its tfLabel. */
|
|
23
|
+
foreignAppRef(tfLabel: string, name: string): void;
|
|
24
|
+
/** Records a foreign-ELEMENT data lookup for data.tf (board issue #42). */
|
|
25
|
+
foreignElementRef(tfLabel: string, name: string): void;
|
|
26
|
+
/** Degradations land here — reported by the caller, never silent. */
|
|
27
|
+
readonly diagnostics: string[];
|
|
28
|
+
}
|
|
29
|
+
export interface ToolToTfResult {
|
|
30
|
+
readonly block: TfBlock;
|
|
31
|
+
/** `<resourceType>.<tfLabel>` — bookkeeping for the agent catalog. */
|
|
32
|
+
readonly address: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* One authored tool entry (`{ createRecord: {...} }`) → its resource block;
|
|
36
|
+
* undefined = degraded with a diagnostic (unimplemented sub-type, missing
|
|
37
|
+
* target). The one hard error is an invalid tool name — the platform would
|
|
38
|
+
* reject it at apply with an opaque message, so fail at build time instead.
|
|
39
|
+
*/
|
|
40
|
+
export declare function toolToTf(entry: Record<string, unknown>, ctx: ToolToTfContext): ToolToTfResult | undefined;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent-tool emission (M3): one authored tool → one
|
|
3
|
+
* `elementum_agent_*_tool` resource block, in ei's dialect. The owning
|
|
4
|
+
* AGENT's to-tf drives the pass and supplies both back-references
|
|
5
|
+
* (`agent_id`, `app_id`) — this module never names the agent or app
|
|
6
|
+
* resource types.
|
|
7
|
+
*
|
|
8
|
+
* Reference dialect (verified live, docs/design/m3-agent-dialect.md):
|
|
9
|
+
* - self-app target → the app's own resource ref;
|
|
10
|
+
* - cross-app target → a name-keyed `data.elementum_app` lookup whose
|
|
11
|
+
* label derives from the app NAME (ei's sanitize rule);
|
|
12
|
+
* - tool fields → the field resource's ref (`elementum_*_field.<label>.id`),
|
|
13
|
+
* derivable purely from the FieldRef token (fieldType + refName).
|
|
14
|
+
*/
|
|
15
|
+
import { appScopedResourceLabel, expr, sanitizeName, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
16
|
+
import { EntityTfError } from "../../engine/entity.js";
|
|
17
|
+
import { fieldRefToTfValue } from "../field/to-tf.js";
|
|
18
|
+
import { TOOL_SUB_TYPE_BY_TYPE_KEY } from "./types.js";
|
|
19
|
+
/** authoring FieldRef token → the field resource address, derived purely from the token. */
|
|
20
|
+
function fieldRefValue(token, where, ctx) {
|
|
21
|
+
const refName = token.refName ?? "";
|
|
22
|
+
if (refName === "") {
|
|
23
|
+
ctx.diagnostics.push(`${where}: field token has no refName; dropped`);
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
if (token.parent !== undefined && token.parent !== ctx.appRefName) {
|
|
27
|
+
ctx.diagnostics.push(`${where}: field token "${refName}" belongs to app "${token.parent}", not this workspace's config — cross-app field refs are not supported on the terraform path yet; dropped`);
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
// Delegates to field/to-tf.ts's shared resolver (system-field local alias
|
|
31
|
+
// vs. real field resource, by authoring type) rather than reimplementing
|
|
32
|
+
// it here — see fieldRefToTfValue's doc comment for the system-field
|
|
33
|
+
// ordering rationale.
|
|
34
|
+
const value = fieldRefToTfValue(token.fieldType ?? "", refName, ctx.appTfLabel);
|
|
35
|
+
if (value === undefined) {
|
|
36
|
+
ctx.diagnostics.push(`${where}: field token "${refName}" has no terraform field resource mapping (fieldType ${JSON.stringify(token.fieldType ?? "")}); dropped`);
|
|
37
|
+
}
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
/** authoring AspectRef token → target_id value (self resource ref or foreign data ref). */
|
|
41
|
+
function targetIdValue(token, ctx) {
|
|
42
|
+
if (token.__kind !== "element" && (token.refName ?? "") === ctx.appRefName) {
|
|
43
|
+
return expr.resourceAttr("elementum_app", ctx.appTfLabel, ["id"]);
|
|
44
|
+
}
|
|
45
|
+
// ei derives foreign-app/foreign-element data labels from the display NAME.
|
|
46
|
+
const name = token.name ?? token.refName ?? "";
|
|
47
|
+
const tfLabel = sanitizeName(name);
|
|
48
|
+
// Board issue #42: an aspect token can be an element, not just an app —
|
|
49
|
+
// must emit `data.elementum_element`, never `data.elementum_app`, or the
|
|
50
|
+
// provider looks up the wrong resource type entirely.
|
|
51
|
+
if (token.__kind === "element") {
|
|
52
|
+
ctx.foreignElementRef(tfLabel, name);
|
|
53
|
+
return expr.dataAttr("elementum_element", tfLabel, ["id"]);
|
|
54
|
+
}
|
|
55
|
+
ctx.foreignAppRef(tfLabel, name);
|
|
56
|
+
return expr.dataAttr("elementum_app", tfLabel, ["id"]);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* One authored tool entry (`{ createRecord: {...} }`) → its resource block;
|
|
60
|
+
* undefined = degraded with a diagnostic (unimplemented sub-type, missing
|
|
61
|
+
* target). The one hard error is an invalid tool name — the platform would
|
|
62
|
+
* reject it at apply with an opaque message, so fail at build time instead.
|
|
63
|
+
*/
|
|
64
|
+
export function toolToTf(entry, ctx) {
|
|
65
|
+
const typeKey = Object.keys(entry)[0];
|
|
66
|
+
if (typeKey === undefined)
|
|
67
|
+
return undefined;
|
|
68
|
+
const subType = TOOL_SUB_TYPE_BY_TYPE_KEY.get(typeKey);
|
|
69
|
+
const inner = entry[typeKey];
|
|
70
|
+
const name = inner?.name ?? "";
|
|
71
|
+
if (subType === undefined) {
|
|
72
|
+
ctx.diagnostics.push(`agent tool "${name}": unknown tool kind "${typeKey}"; dropped`);
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
if (subType.implemented !== true) {
|
|
76
|
+
ctx.diagnostics.push(`agent tool "${name}": tool kind "${typeKey}" is not supported on the terraform path yet; dropped`);
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
if (inner === undefined || typeof inner !== "object") {
|
|
80
|
+
ctx.diagnostics.push(`agent tool entry "${typeKey}" has a non-object body; dropped`);
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
// Tool-name validity is enforced in the authoring builders (entities/agent/
|
|
84
|
+
// tools.ts), not here — from-tf/to-tf must round-trip whatever the platform
|
|
85
|
+
// holds, including a hyphenated name deployed outside EDK.
|
|
86
|
+
if (inner.runAs !== undefined) {
|
|
87
|
+
ctx.diagnostics.push(`agent tool "${name}": runAs is not supported on the terraform path yet; dropped`);
|
|
88
|
+
}
|
|
89
|
+
const where = `agent tool "${name}"`;
|
|
90
|
+
const agentTfLabel = appScopedResourceLabel(ctx.appTfLabel, ctx.agentBareTfLabel);
|
|
91
|
+
const tfLabel = appScopedResourceLabel(ctx.appTfLabel, sanitizeName(`${ctx.agentBareTfLabel}_${name}`));
|
|
92
|
+
const attrs = {
|
|
93
|
+
agent_id: expr.resourceAttr("elementum_agent", agentTfLabel, ["id"]),
|
|
94
|
+
app_id: expr.resourceAttr("elementum_app", ctx.appTfLabel, ["id"]),
|
|
95
|
+
name,
|
|
96
|
+
description: inner.description ?? "",
|
|
97
|
+
};
|
|
98
|
+
if (inner.startMessage !== undefined)
|
|
99
|
+
attrs["start_message"] = inner.startMessage;
|
|
100
|
+
if (typeKey === "executeWorkflow") {
|
|
101
|
+
const auto = inner.automationId;
|
|
102
|
+
// Identity is the token's refName (the bag key — its tfLabel image IS the
|
|
103
|
+
// automation's label, per the bijection); the display name is a fallback
|
|
104
|
+
// for hand-written tokens. Generated catalog tokens carry no name.
|
|
105
|
+
const autoTfLabel = typeof auto?.refName === "string" && auto.refName !== ""
|
|
106
|
+
? tsLabelToTfLabel(auto.refName)
|
|
107
|
+
: typeof auto?.name === "string" && auto.name !== ""
|
|
108
|
+
? sanitizeName(auto.name)
|
|
109
|
+
: undefined;
|
|
110
|
+
if (auto === undefined || autoTfLabel === undefined) {
|
|
111
|
+
ctx.diagnostics.push(`${where}: no target automation token; dropped`);
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
if (auto.parent !== undefined && auto.parent !== ctx.appRefName) {
|
|
115
|
+
ctx.diagnostics.push(`${where}: automation "${auto.refName ?? auto.name}" belongs to app "${auto.parent}" — cross-app run-automation tools are not supported on the terraform path yet; dropped`);
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
// The automation and workflow-publish resources carry the same platform
|
|
119
|
+
// id. Reference the publish block so Terraform cannot create the tool
|
|
120
|
+
// until the provider has published the workflow whose bindings it reads.
|
|
121
|
+
// ei export normalizes this back to elementum_automation.<label>.id; the
|
|
122
|
+
// live round-trip comparator treats only those two references as equal.
|
|
123
|
+
attrs["automation_id"] = expr.resourceAttr("elementum_workflow_publish", appScopedResourceLabel(ctx.appTfLabel, autoTfLabel), ["id"]);
|
|
124
|
+
if (inner.inputs !== undefined && inner.inputs.length > 0) {
|
|
125
|
+
attrs["inputs"] = inner.inputs.map((i) => ({
|
|
126
|
+
parameter_name: i.triggerParameterId?.name ?? "",
|
|
127
|
+
...(i.description !== undefined && i.description !== "" && { description: i.description }),
|
|
128
|
+
...(i.required !== undefined && { required: i.required }),
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
if (inner.outputs !== undefined && inner.outputs.length > 0) {
|
|
132
|
+
attrs["outputs"] = inner.outputs.map((o) => ({
|
|
133
|
+
workflow_property_name: o.workflowPropertyName ?? "",
|
|
134
|
+
...(o.description !== undefined && o.description !== "" && { description: o.description }),
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
// Write-only on the backend (no read resolver): ei exports the provider
|
|
138
|
+
// schema default statically, and a fresh import seeds the same — any
|
|
139
|
+
// other value would plan an eternal diff. Pinned, not authorable.
|
|
140
|
+
attrs["timeout"] = "PT5M";
|
|
141
|
+
const block = { kind: "resource", type: subType.resourceType, label: tfLabel, attrs };
|
|
142
|
+
return { block, address: `${subType.resourceType}.${tfLabel}` };
|
|
143
|
+
}
|
|
144
|
+
// searchTable is the one sub-type where a target aspect is optional
|
|
145
|
+
// (confirmed live — see toolFromTf's matching comment).
|
|
146
|
+
if (inner.aspectId === undefined && typeKey !== "searchTable") {
|
|
147
|
+
ctx.diagnostics.push(`${where}: no target aspect token; dropped`);
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
if (inner.aspectId !== undefined)
|
|
151
|
+
attrs["target_id"] = targetIdValue(inner.aspectId, ctx);
|
|
152
|
+
if (typeKey === "updateRecord") {
|
|
153
|
+
if (inner.handleDescription === undefined || inner.handleDescription === "") {
|
|
154
|
+
// The provider requires a non-empty handle_description and rejects an
|
|
155
|
+
// empty one at apply with an opaque "Unable to validate" error — fail
|
|
156
|
+
// loud at build time instead (same discipline as the tool-name check).
|
|
157
|
+
throw new EntityTfError(`${where}: agentUpdateRecord requires a non-empty \`handleDescription\` — the platform ` +
|
|
158
|
+
`uses it to identify which record to update and rejects an empty value at apply.`);
|
|
159
|
+
}
|
|
160
|
+
attrs["handle_description"] = inner.handleDescription;
|
|
161
|
+
}
|
|
162
|
+
if (typeKey === "searchAspect" || typeKey === "searchTable") {
|
|
163
|
+
attrs["query_description"] = inner.queryDescription ?? "";
|
|
164
|
+
if (inner.limit !== undefined)
|
|
165
|
+
attrs["result_limit"] = inner.limit;
|
|
166
|
+
if (inner.filter !== undefined || inner.sort !== undefined) {
|
|
167
|
+
ctx.diagnostics.push(`${where}: filter/sort are not supported on the terraform path yet; dropped`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (typeKey === "searchTable") {
|
|
171
|
+
if (inner.searchTableId === undefined || inner.searchTableId === "") {
|
|
172
|
+
ctx.diagnostics.push(`${where}: no searchTableId; dropped`);
|
|
173
|
+
return undefined;
|
|
174
|
+
}
|
|
175
|
+
// Always a raw platform id — see ReturnFieldWire's sibling comment on
|
|
176
|
+
// searchTableId. There is no data-source/reference form to resolve
|
|
177
|
+
// against; ei itself never exports one for this attribute.
|
|
178
|
+
attrs["search_table_id"] = inner.searchTableId;
|
|
179
|
+
}
|
|
180
|
+
if (inner.fields !== undefined && inner.fields.length > 0) {
|
|
181
|
+
const fieldValues = [];
|
|
182
|
+
for (const f of inner.fields) {
|
|
183
|
+
// A raw-id fallback field (board issue #169) is echoed straight
|
|
184
|
+
// through — ei never resolves it to a reference either, so there's
|
|
185
|
+
// nothing to re-derive.
|
|
186
|
+
const ref = typeof f.fieldId === "string"
|
|
187
|
+
? f.fieldId
|
|
188
|
+
: f.fieldId === undefined
|
|
189
|
+
? undefined
|
|
190
|
+
: fieldRefValue(f.fieldId, where, ctx);
|
|
191
|
+
if (ref === undefined)
|
|
192
|
+
continue;
|
|
193
|
+
fieldValues.push({
|
|
194
|
+
field_id: ref,
|
|
195
|
+
// The wire duplicates the display name; the dialect carries one.
|
|
196
|
+
...(f.name !== undefined && { name: f.name }),
|
|
197
|
+
...(f.description !== undefined && { description: f.description }),
|
|
198
|
+
// Always emit `required` (defaulting false) rather than omitting it:
|
|
199
|
+
// the provider's own Create/Read round trip normalizes a missing
|
|
200
|
+
// value to `false` and returns it, so a config that omits the key
|
|
201
|
+
// plans an eternal `required: false -> null` diff on every apply
|
|
202
|
+
// after the first (confirmed live 2026-08-05). Pin it, like
|
|
203
|
+
// executeWorkflow's `timeout`, so config and state agree.
|
|
204
|
+
required: f.required ?? false,
|
|
205
|
+
});
|
|
206
|
+
if (f.defaultValue !== undefined) {
|
|
207
|
+
ctx.diagnostics.push(`${where}: field default values are not supported on the terraform path yet; dropped`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (fieldValues.length > 0)
|
|
211
|
+
attrs["fields"] = fieldValues;
|
|
212
|
+
}
|
|
213
|
+
// searchTable's own field shapes: field_id is always a raw platform id
|
|
214
|
+
// (see SearchTableFieldWire/ReturnFieldWire's comments) - no
|
|
215
|
+
// fieldRefValue resolution, unlike the shared `fields` block above.
|
|
216
|
+
if (inner.searchTableFields !== undefined && inner.searchTableFields.length > 0) {
|
|
217
|
+
const values = [];
|
|
218
|
+
for (const f of inner.searchTableFields) {
|
|
219
|
+
if (f.fieldId === undefined || f.fieldId === "") {
|
|
220
|
+
ctx.diagnostics.push(`${where}: fields item has no fieldId; dropped`);
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
values.push({
|
|
224
|
+
field_id: f.fieldId,
|
|
225
|
+
...(f.name !== undefined && { name: f.name }),
|
|
226
|
+
...(f.description !== undefined && { description: f.description }),
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
if (values.length > 0)
|
|
230
|
+
attrs["fields"] = values;
|
|
231
|
+
}
|
|
232
|
+
if (inner.returnFields !== undefined && inner.returnFields.length > 0) {
|
|
233
|
+
const returnFieldValues = [];
|
|
234
|
+
for (const f of inner.returnFields) {
|
|
235
|
+
if (f.fieldId === undefined || f.fieldId === "") {
|
|
236
|
+
ctx.diagnostics.push(`${where}: return_fields item has no fieldId; dropped`);
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
returnFieldValues.push({
|
|
240
|
+
field_id: f.fieldId,
|
|
241
|
+
...(f.name !== undefined && { name: f.name }),
|
|
242
|
+
...(f.displayName !== undefined && { display_name: f.displayName }),
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
if (returnFieldValues.length > 0)
|
|
246
|
+
attrs["return_fields"] = returnFieldValues;
|
|
247
|
+
}
|
|
248
|
+
const block = { kind: "resource", type: subType.resourceType, label: tfLabel, attrs };
|
|
249
|
+
return { block, address: `${subType.resourceType}.${tfLabel}` };
|
|
250
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The agent-tool entity's sub-type table (M3). Agent tools are a real
|
|
3
|
+
* sub-entity — nine terraform resource types sharing one ownership shape
|
|
4
|
+
* (agent_id + app_id + name/description) — so per-sub-type knowledge is one
|
|
5
|
+
* ROW here, exactly like `entities/field/types.ts`.
|
|
6
|
+
*
|
|
7
|
+
* M3 implements createRecord, searchAspect, executeWorkflow, and updateRecord
|
|
8
|
+
* end to end; the other rows are declared so streams REPORT them by name
|
|
9
|
+
* (plan §6) instead of "unknown resource", and adoption scopes ONLY the
|
|
10
|
+
* implemented ones — an adopted type the printer can't reconstruct would
|
|
11
|
+
* plan as a destroy on rebuild.
|
|
12
|
+
*/
|
|
13
|
+
/** One agent-tool sub-type: authoring variant key ↔ resource type. */
|
|
14
|
+
export interface AgentToolSubType {
|
|
15
|
+
/** The `AgentToolCreateInput` variant key — the tool factory's discriminant ("createRecord"). */
|
|
16
|
+
readonly typeKey: string;
|
|
17
|
+
/** Terraform resource type ("elementum_agent_create_record_tool"). */
|
|
18
|
+
readonly resourceType: string;
|
|
19
|
+
/** Implemented on the terraform path (to-tf + from-tf + printer). */
|
|
20
|
+
readonly implemented?: true;
|
|
21
|
+
}
|
|
22
|
+
export declare const RUN_AUTOMATION_TOOL_RESOURCE_TYPE = "elementum_agent_run_automation_tool";
|
|
23
|
+
export declare const AGENT_TOOL_SUB_TYPES: readonly AgentToolSubType[];
|
|
24
|
+
export declare const TOOL_SUB_TYPE_BY_TYPE_KEY: ReadonlyMap<string, AgentToolSubType>;
|
|
25
|
+
export declare const TOOL_SUB_TYPE_BY_RESOURCE: ReadonlyMap<string, AgentToolSubType>;
|
|
26
|
+
/** The resource types the terraform path round-trips today (adoption scope). */
|
|
27
|
+
export declare const IMPLEMENTED_TOOL_RESOURCE_TYPES: readonly string[];
|
|
28
|
+
/** Every declared tool resource type — stream partition recognizes these by name. */
|
|
29
|
+
export declare const ALL_TOOL_RESOURCE_TYPES: readonly string[];
|
|
30
|
+
/**
|
|
31
|
+
* EDK's tool-name rule — enforced in the authoring builders (see
|
|
32
|
+
* `entities/agent/tools.ts`), never in the tf passes. It is deliberately
|
|
33
|
+
* STRICTER than the platform's own (`[A-Za-z0-9_-]`, which also tolerates
|
|
34
|
+
* hyphens): EDK requires underscores so an authored name maps 1:1 to its
|
|
35
|
+
* terraform label — a hyphenated name sanitizes to a different label and breaks
|
|
36
|
+
* the name↔label correspondence. 1–64 chars of letters, digits, and
|
|
37
|
+
* underscores; no consecutive underscores (the platform rejects those, opaquely).
|
|
38
|
+
* `from-tf` does NOT apply this — a hyphenated tool deployed outside EDK must
|
|
39
|
+
* still be pullable.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isValidToolName(name: string): boolean;
|
|
42
|
+
/** Attributes `toolFromTf` understands per implemented sub-type — growth is reported loudly. */
|
|
43
|
+
export declare const KNOWN_TOOL_ATTRS: Readonly<Record<string, ReadonlySet<string>>>;
|