@elementumai/edk 0.0.0-oidc-bootstrap → 0.8.0-preview.11
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 +408 -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/factories.d.ts +189 -0
- package/dist-sdk/src/catalog/factories.js +202 -0
- package/dist-sdk/src/catalog/from-authoring.d.ts +103 -0
- package/dist-sdk/src/catalog/from-authoring.js +462 -0
- package/dist-sdk/src/catalog/index.d.ts +11 -0
- package/dist-sdk/src/catalog/index.js +11 -0
- package/dist-sdk/src/catalog/org.d.ts +11 -0
- package/dist-sdk/src/catalog/org.js +211 -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 +36 -0
- package/dist-sdk/src/catalog/render.js +176 -0
- package/dist-sdk/src/catalog/token.d.ts +10 -0
- package/dist-sdk/src/catalog/token.js +62 -0
- package/dist-sdk/src/catalog/types.d.ts +158 -0
- package/dist-sdk/src/catalog/types.js +83 -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 +93 -0
- package/dist-sdk/src/core/system-fields.js +151 -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 +36 -0
- package/dist-sdk/src/core/types/ai-provider.js +32 -0
- package/dist-sdk/src/core/types/app.d.ts +838 -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 +49 -0
- package/dist-sdk/src/engine/build/context.js +6 -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 +23 -0
- package/dist-sdk/src/engine/pull/context.js +44 -0
- package/dist-sdk/src/engine/pull/org.d.ts +44 -0
- package/dist-sdk/src/engine/pull/org.js +104 -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 +31 -0
- package/dist-sdk/src/engine/tf/labels.js +125 -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/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 +18 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +177 -0
- package/dist-sdk/src/entities/agent/from-tf.d.ts +50 -0
- package/dist-sdk/src/entities/agent/from-tf.js +169 -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 +116 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/agent/to-tf.js +136 -0
- package/dist-sdk/src/entities/agent/tools.d.ts +205 -0
- package/dist-sdk/src/entities/agent/tools.js +199 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +63 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.js +169 -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 +38 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.js +164 -0
- package/dist-sdk/src/entities/agent-tool/types.d.ts +42 -0
- package/dist-sdk/src/entities/agent-tool/types.js +70 -0
- package/dist-sdk/src/entities/app/build.d.ts +318 -0
- package/dist-sdk/src/entities/app/build.js +325 -0
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +165 -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 +180 -0
- package/dist-sdk/src/entities/app/index.d.ts +11 -0
- package/dist-sdk/src/entities/app/index.js +10 -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 +59 -0
- package/dist-sdk/src/entities/app/to-tf.d.ts +28 -0
- package/dist-sdk/src/entities/app/to-tf.js +183 -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 +215 -0
- package/dist-sdk/src/entities/automation/build.js +424 -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 +135 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.js +13 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +40 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +1040 -0
- package/dist-sdk/src/entities/automation/filter.d.ts +81 -0
- package/dist-sdk/src/entities/automation/filter.js +146 -0
- package/dist-sdk/src/entities/automation/from-tf.d.ts +36 -0
- package/dist-sdk/src/entities/automation/from-tf.js +252 -0
- package/dist-sdk/src/entities/automation/index.d.ts +18 -0
- package/dist-sdk/src/entities/automation/index.js +21 -0
- package/dist-sdk/src/entities/automation/module.d.ts +3 -0
- package/dist-sdk/src/entities/automation/module.js +153 -0
- package/dist-sdk/src/entities/automation/operators.d.ts +66 -0
- package/dist-sdk/src/entities/automation/operators.js +43 -0
- package/dist-sdk/src/entities/automation/script-code.d.ts +62 -0
- package/dist-sdk/src/entities/automation/script-code.js +366 -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 +535 -0
- package/dist-sdk/src/entities/automation/tasks.js +697 -0
- package/dist-sdk/src/entities/automation/to-tf.d.ts +38 -0
- package/dist-sdk/src/entities/automation/to-tf.js +266 -0
- package/dist-sdk/src/entities/automation/triggers.d.ts +197 -0
- package/dist-sdk/src/entities/automation/triggers.js +202 -0
- package/dist-sdk/src/entities/automation/types.d.ts +53 -0
- package/dist-sdk/src/entities/automation/types.js +101 -0
- package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +76 -0
- package/dist-sdk/src/entities/automation/value-ref-tf.js +190 -0
- package/dist-sdk/src/entities/element/build.d.ts +108 -0
- package/dist-sdk/src/entities/element/build.js +109 -0
- package/dist-sdk/src/entities/element/from-tf.d.ts +19 -0
- package/dist-sdk/src/entities/element/from-tf.js +155 -0
- package/dist-sdk/src/entities/element/index.d.ts +9 -0
- package/dist-sdk/src/entities/element/index.js +9 -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 +63 -0
- package/dist-sdk/src/entities/element/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/element/to-tf.js +151 -0
- package/dist-sdk/src/entities/field/build.d.ts +69 -0
- package/dist-sdk/src/entities/field/build.js +74 -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 +170 -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 +29 -0
- package/dist-sdk/src/entities/field/from-tf.js +73 -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 +49 -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 +55 -0
- package/dist-sdk/src/entities/field/to-tf.js +97 -0
- package/dist-sdk/src/entities/field/types.d.ts +27 -0
- package/dist-sdk/src/entities/field/types.js +46 -0
- package/dist-sdk/src/entities/file-reader/build.d.ts +124 -0
- package/dist-sdk/src/entities/file-reader/build.js +105 -0
- package/dist-sdk/src/entities/file-reader/index.d.ts +5 -0
- package/dist-sdk/src/entities/file-reader/index.js +5 -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/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 +5 -0
- package/dist-sdk/src/entities/org/connector.js +37 -0
- package/dist-sdk/src/entities/org/group.d.ts +5 -0
- package/dist-sdk/src/entities/org/group.js +31 -0
- package/dist-sdk/src/entities/org/index.d.ts +10 -0
- package/dist-sdk/src/entities/org/index.js +10 -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 +21 -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 +242 -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/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 +49 -0
- package/dist-sdk/src/entities/shared/types/field-types.js +48 -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 +20 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +96 -0
- package/dist-sdk/src/entities/skill/from-tf.d.ts +33 -0
- package/dist-sdk/src/entities/skill/from-tf.js +95 -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 +106 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/skill/to-tf.js +58 -0
- package/dist-sdk/src/entities/skill/tools.d.ts +71 -0
- package/dist-sdk/src/entities/skill/tools.js +88 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +47 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +121 -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 +32 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.js +107 -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 +25 -0
- package/dist-sdk/src/entities/view/from-tf.js +233 -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 +63 -0
- package/dist-sdk/src/entities/view/to-tf.js +156 -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 +14 -0
- package/dist-sdk/src/graph/deferred-catalog-render.js +37 -0
- package/dist-sdk/src/graph/index.d.ts +83 -0
- package/dist-sdk/src/graph/index.js +207 -0
- package/dist-sdk/src/graph/modules.d.ts +7 -0
- package/dist-sdk/src/graph/modules.js +37 -0
- package/dist-sdk/src/graph/types.d.ts +301 -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 +173 -8
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { isValidToolName } from "../agent-tool/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Hydra hard-codes the execute-workflow timeout to PT10M and ignores any other
|
|
4
|
+
* value; mirror v1 so pull→edit→redeploy round-trips stay stable.
|
|
5
|
+
*/
|
|
6
|
+
const EXECUTE_WORKFLOW_TIMEOUT = "PT10M";
|
|
7
|
+
function common(opts) {
|
|
8
|
+
// Authoring-layer name check (mirrors defineApp's handle/namespace guards).
|
|
9
|
+
// Every tool factory routes through here, so this is the single enforcement
|
|
10
|
+
// point — the tf passes never re-check.
|
|
11
|
+
if (!isValidToolName(opts.name)) {
|
|
12
|
+
throw new Error(`agent tool name "${opts.name}" must be 1–64 characters of letters, digits, and ` +
|
|
13
|
+
`underscores (A–Z, a–z, 0–9, _) with no consecutive underscores — no hyphens or spaces.`);
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
name: opts.name,
|
|
17
|
+
description: opts.description,
|
|
18
|
+
...(opts.startMessage !== undefined ? { startMessage: opts.startMessage } : {}),
|
|
19
|
+
...(opts.runAs !== undefined ? { runAs: opts.runAs } : {}),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function searchFieldToken(f) {
|
|
23
|
+
return {
|
|
24
|
+
fieldId: f.field, // token → resolved to the field id at deploy
|
|
25
|
+
clientHandle: f.field, // token → resolved to the field clientHandle at deploy
|
|
26
|
+
...(f.name !== undefined ? { name: f.name } : {}),
|
|
27
|
+
...(f.description !== undefined ? { description: f.description } : {}),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function recordFieldToken(f) {
|
|
31
|
+
return {
|
|
32
|
+
fieldId: f.field,
|
|
33
|
+
clientHandle: f.field,
|
|
34
|
+
...(f.name !== undefined ? { name: f.name } : {}),
|
|
35
|
+
...(f.description !== undefined ? { description: f.description } : {}),
|
|
36
|
+
...(f.required !== undefined ? { required: f.required } : {}),
|
|
37
|
+
...(f.defaultValue !== undefined ? { defaultValue: f.defaultValue } : {}),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export function agentSearchAspect(opts) {
|
|
41
|
+
return {
|
|
42
|
+
searchAspect: {
|
|
43
|
+
...common(opts),
|
|
44
|
+
aspectId: opts.aspect,
|
|
45
|
+
queryDescription: opts.queryDescription,
|
|
46
|
+
...(opts.fields !== undefined ? { fields: opts.fields.map(searchFieldToken) } : {}),
|
|
47
|
+
...(opts.filter !== undefined ? { filter: opts.filter } : {}),
|
|
48
|
+
...(opts.sort !== undefined ? { sort: opts.sort } : {}),
|
|
49
|
+
...(opts.limit !== undefined ? { limit: opts.limit } : {}),
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function agentSearchTable(opts) {
|
|
54
|
+
return {
|
|
55
|
+
searchTable: {
|
|
56
|
+
...common(opts),
|
|
57
|
+
aspectId: opts.aspect,
|
|
58
|
+
searchTableId: opts.table,
|
|
59
|
+
queryDescription: opts.queryDescription,
|
|
60
|
+
...(opts.fields !== undefined ? { fields: opts.fields.map(searchFieldToken) } : {}),
|
|
61
|
+
...(opts.filter !== undefined ? { filter: opts.filter } : {}),
|
|
62
|
+
...(opts.limit !== undefined ? { limit: opts.limit } : {}),
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export function agentCreateRecord(opts) {
|
|
67
|
+
return {
|
|
68
|
+
createRecord: {
|
|
69
|
+
...common(opts),
|
|
70
|
+
aspectId: opts.aspect,
|
|
71
|
+
...(opts.fields !== undefined ? { fields: opts.fields.map(recordFieldToken) } : {}),
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function agentUpdateRecord(opts) {
|
|
76
|
+
return {
|
|
77
|
+
updateRecord: {
|
|
78
|
+
...common(opts),
|
|
79
|
+
aspectId: opts.aspect,
|
|
80
|
+
...(opts.fields !== undefined ? { fields: opts.fields.map(recordFieldToken) } : {}),
|
|
81
|
+
...(opts.handleDescription !== undefined
|
|
82
|
+
? { handleDescription: opts.handleDescription }
|
|
83
|
+
: {}),
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
export function agentRelateRecord(opts) {
|
|
88
|
+
return {
|
|
89
|
+
relateRecord: {
|
|
90
|
+
...common(opts),
|
|
91
|
+
aspectId: opts.aspect,
|
|
92
|
+
relatedAspectId: opts.relatedAspect,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export function agentExecuteWorkflow(opts) {
|
|
97
|
+
return {
|
|
98
|
+
executeWorkflow: {
|
|
99
|
+
...common(opts),
|
|
100
|
+
automationId: opts.automation,
|
|
101
|
+
timeout: EXECUTE_WORKFLOW_TIMEOUT,
|
|
102
|
+
...(opts.inputs !== undefined
|
|
103
|
+
? {
|
|
104
|
+
// The ref stays in the id slot for `resolvePayload` to swap for the
|
|
105
|
+
// current-version param id at deploy.
|
|
106
|
+
inputs: opts.inputs.map((i) => ({
|
|
107
|
+
name: i.name,
|
|
108
|
+
description: i.description,
|
|
109
|
+
triggerParameterId: i.triggerParameter,
|
|
110
|
+
...(i.required !== undefined ? { required: i.required } : {}),
|
|
111
|
+
})),
|
|
112
|
+
}
|
|
113
|
+
: {}),
|
|
114
|
+
...(opts.outputs !== undefined
|
|
115
|
+
? {
|
|
116
|
+
// One ref fans out: the property name is read off the ref now; the id
|
|
117
|
+
// slot keeps the ref for `resolvePayload` to resolve at deploy.
|
|
118
|
+
outputs: opts.outputs.map((o) => ({
|
|
119
|
+
name: o.name,
|
|
120
|
+
workflowPropertyName: o.workflowOutputProperty.name,
|
|
121
|
+
workflowOutputPropertyId: o.workflowOutputProperty,
|
|
122
|
+
})),
|
|
123
|
+
}
|
|
124
|
+
: {}),
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Run Automation tool (the product-language name; the wire kind is
|
|
130
|
+
* `executeWorkflow`). Inputs/outputs are TYPE-CONSTRAINED by the selected
|
|
131
|
+
* automation's catalog ref: record keys must be its declared trigger
|
|
132
|
+
* parameter / output property names, every REQUIRED parameter must be
|
|
133
|
+
* mapped (a non-optional key), and a required parameter's input must set
|
|
134
|
+
* `required: true`. The agent-facing name defaults to the record key;
|
|
135
|
+
* override with `name:`. `defineAgent().def()` re-validates at runtime.
|
|
136
|
+
*
|
|
137
|
+
* Reference tokens are synthesized from the record keys alone — the factory
|
|
138
|
+
* never dereferences `automation.trigger`/`outputs`, so agent files load
|
|
139
|
+
* safely against the catalog regen's STUB pass (empty bags). A foreign or
|
|
140
|
+
* hand-written automation token without bags degrades to permissive typing;
|
|
141
|
+
* def() validation skips bag-dependent checks for those.
|
|
142
|
+
*
|
|
143
|
+
* The legacy array surface lives on as {@link agentExecuteWorkflow}.
|
|
144
|
+
*/
|
|
145
|
+
export function agentRunAutomation(opts) {
|
|
146
|
+
const inputEntries = Object.entries((opts.inputs ?? {}));
|
|
147
|
+
const inputs = inputEntries.map(([param, spec]) => ({
|
|
148
|
+
name: spec.name ?? param,
|
|
149
|
+
description: spec.description,
|
|
150
|
+
// Synthesized from the record key — identical slim form to a catalog
|
|
151
|
+
// trigger-bag token (refName = name = param, parent = automation ref).
|
|
152
|
+
triggerParameterId: { __kind: "triggerParameter", refName: param, name: param, parent: opts.automation.refName },
|
|
153
|
+
...(spec.required !== undefined ? { required: spec.required } : {}),
|
|
154
|
+
}));
|
|
155
|
+
const outputEntries = Object.entries((opts.outputs ?? {}));
|
|
156
|
+
const outputs = outputEntries.map(([prop, spec]) => ({
|
|
157
|
+
name: spec?.name ?? prop,
|
|
158
|
+
workflowPropertyName: prop,
|
|
159
|
+
workflowOutputPropertyId: { __kind: "outputProperty", refName: prop, name: prop, parent: opts.automation.refName },
|
|
160
|
+
}));
|
|
161
|
+
return {
|
|
162
|
+
executeWorkflow: {
|
|
163
|
+
...common(opts),
|
|
164
|
+
automationId: opts.automation,
|
|
165
|
+
timeout: EXECUTE_WORKFLOW_TIMEOUT,
|
|
166
|
+
...(inputs.length > 0 ? { inputs } : {}),
|
|
167
|
+
...(outputs.length > 0 ? { outputs } : {}),
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
export function agentRunAgent(opts) {
|
|
172
|
+
return {
|
|
173
|
+
runAgent: {
|
|
174
|
+
...common(opts),
|
|
175
|
+
targetAgentId: opts.agent,
|
|
176
|
+
workerTaskPrompt: opts.workerTaskPrompt,
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
export function agentMcp(opts) {
|
|
181
|
+
return {
|
|
182
|
+
mcp: {
|
|
183
|
+
...common(opts),
|
|
184
|
+
serverUrl: opts.serverUrl,
|
|
185
|
+
mcpToolName: opts.mcpToolName,
|
|
186
|
+
...(opts.headers !== undefined
|
|
187
|
+
? { headers: opts.headers.map((h) => ({ key: h.key, value: h.value })) }
|
|
188
|
+
: {}),
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
export function agentSelectBotRoute(opts) {
|
|
193
|
+
return {
|
|
194
|
+
selectBotRoute: {
|
|
195
|
+
...common(opts),
|
|
196
|
+
botId: opts.botId,
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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 { type FromTfContext } from "../../engine/pull/context.js";
|
|
8
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
9
|
+
export interface NormalizedToolField {
|
|
10
|
+
/** The field's bag key in the owning app's `fields: {}` (bijective image of its label). */
|
|
11
|
+
readonly key: string;
|
|
12
|
+
readonly name?: string;
|
|
13
|
+
readonly description?: string;
|
|
14
|
+
readonly required?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export type NormalizedToolTarget = {
|
|
17
|
+
readonly kind: "self";
|
|
18
|
+
} | {
|
|
19
|
+
/** A foreign app via `data.elementum_app.<label>` — `name` from the stream's data block. */
|
|
20
|
+
readonly kind: "foreignApp";
|
|
21
|
+
readonly name: string;
|
|
22
|
+
};
|
|
23
|
+
export interface NormalizedExecuteWorkflowInput {
|
|
24
|
+
/** The published workflow's declared trigger parameter name. */
|
|
25
|
+
readonly parameterName: string;
|
|
26
|
+
readonly name?: string;
|
|
27
|
+
readonly description?: string;
|
|
28
|
+
readonly required?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface NormalizedExecuteWorkflowOutput {
|
|
31
|
+
/** The published workflow's output property name. */
|
|
32
|
+
readonly workflowPropertyName: string;
|
|
33
|
+
readonly name?: string;
|
|
34
|
+
readonly description?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface NormalizedAgentTool {
|
|
37
|
+
readonly typeKey: "createRecord" | "searchAspect" | "executeWorkflow";
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly description: string;
|
|
40
|
+
readonly startMessage?: string;
|
|
41
|
+
/** absent for executeWorkflow — its target is an automation, not an aspect. */
|
|
42
|
+
readonly target?: NormalizedToolTarget;
|
|
43
|
+
readonly fields?: readonly NormalizedToolField[];
|
|
44
|
+
readonly queryDescription?: string;
|
|
45
|
+
readonly limit?: number;
|
|
46
|
+
/** executeWorkflow: the target automation's bag key (bijective image of its tf label). */
|
|
47
|
+
readonly automationKey?: string;
|
|
48
|
+
readonly inputs?: readonly NormalizedExecuteWorkflowInput[];
|
|
49
|
+
readonly outputs?: readonly NormalizedExecuteWorkflowOutput[];
|
|
50
|
+
}
|
|
51
|
+
export interface ToolOwner {
|
|
52
|
+
/** The owning app's resource type + tfLabel. */
|
|
53
|
+
readonly appType: string;
|
|
54
|
+
readonly appLabel: string;
|
|
55
|
+
/** The owning agent's resource type + tfLabel. */
|
|
56
|
+
readonly agentType: string;
|
|
57
|
+
readonly agentLabel: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* One tool block → its normalized shape; undefined = skipped with a
|
|
61
|
+
* diagnostic (unimplemented sub-type, wrong owner, unresolvable target).
|
|
62
|
+
*/
|
|
63
|
+
export declare function toolFromTf(block: TfBlock, owner: ToolOwner, ctx: FromTfContext): NormalizedAgentTool | undefined;
|
|
@@ -0,0 +1,169 @@
|
|
|
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, tfLabelToTsLabel } from "../../engine/tf/index.js";
|
|
10
|
+
import { SUB_TYPE_BY_RESOURCE as FIELD_SUB_TYPE_BY_RESOURCE } from "../field/types.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, 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
|
+
const targetAttr = attrs["target_id"];
|
|
49
|
+
let target;
|
|
50
|
+
const selfLabel = resourceRefLabel(targetAttr, owner.appType);
|
|
51
|
+
if (selfLabel === owner.appLabel) {
|
|
52
|
+
target = { kind: "self" };
|
|
53
|
+
}
|
|
54
|
+
else if (isTfExpr(targetAttr) && targetAttr.$expr === "data-attr" && targetAttr.type === "elementum_app") {
|
|
55
|
+
const appName = ctx.dataName("elementum_app", targetAttr.label);
|
|
56
|
+
if (appName === undefined) {
|
|
57
|
+
ctx.diagnostics.push(`${where}: target_id references data.elementum_app.${targetAttr.label} but the stream has no such data block; skipped`);
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
target = { kind: "foreignApp", name: appName };
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
ctx.diagnostics.push(`${where}: target_id has an unrecognized shape (${JSON.stringify(targetAttr)}); skipped`);
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
let fields;
|
|
67
|
+
const rawFields = attrs["fields"];
|
|
68
|
+
if (Array.isArray(rawFields)) {
|
|
69
|
+
fields = [];
|
|
70
|
+
for (const item of rawFields) {
|
|
71
|
+
if (typeof item !== "object" || item === null || Array.isArray(item) || isTfExpr(item)) {
|
|
72
|
+
ctx.diagnostics.push(`${where}: fields item has an unrecognized shape; dropped`);
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
const rec = item;
|
|
76
|
+
const fieldRef = rec["field_id"];
|
|
77
|
+
const fieldLabel = isTfExpr(fieldRef) && fieldRef.$expr === "resource-attr" && FIELD_SUB_TYPE_BY_RESOURCE.has(fieldRef.type)
|
|
78
|
+
? fieldRef.label
|
|
79
|
+
: undefined;
|
|
80
|
+
if (fieldLabel === undefined) {
|
|
81
|
+
ctx.diagnostics.push(`${where}: fields item's field_id is not a field resource reference; dropped`);
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
fields.push({
|
|
85
|
+
key: tfLabelToTsLabel(fieldLabel),
|
|
86
|
+
...(typeof rec["name"] === "string" && { name: rec["name"] }),
|
|
87
|
+
...(typeof rec["description"] === "string" && { description: rec["description"] }),
|
|
88
|
+
...(typeof rec["required"] === "boolean" && { required: rec["required"] }),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (fields.length === 0)
|
|
92
|
+
fields = undefined;
|
|
93
|
+
}
|
|
94
|
+
else if (rawFields !== undefined) {
|
|
95
|
+
ctx.diagnostics.push(`${where}: fields is not a list; dropped`);
|
|
96
|
+
}
|
|
97
|
+
if (subType.typeKey === "searchAspect" && attrs["filter_variables"] !== undefined) {
|
|
98
|
+
ctx.diagnostics.push(`${where}: filter_variables are not supported on the terraform path yet; a rebuilt stream will omit them`);
|
|
99
|
+
}
|
|
100
|
+
const startMessage = optionalString(attrs, "start_message", where, ctx);
|
|
101
|
+
return {
|
|
102
|
+
typeKey: subType.typeKey,
|
|
103
|
+
name,
|
|
104
|
+
description: optionalString(attrs, "description", where, ctx) ?? "",
|
|
105
|
+
...(startMessage !== undefined && { startMessage }),
|
|
106
|
+
target,
|
|
107
|
+
...(fields !== undefined && { fields }),
|
|
108
|
+
...(subType.typeKey === "searchAspect" && {
|
|
109
|
+
queryDescription: optionalString(attrs, "query_description", where, ctx) ?? "",
|
|
110
|
+
}),
|
|
111
|
+
...(typeof attrs["result_limit"] === "number" && { limit: attrs["result_limit"] }),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Run-automation (executeWorkflow) tool extraction. `automation_id` may
|
|
116
|
+
* reference the publish block (ei's uuid→ref winner — the publish import is
|
|
117
|
+
* generated after the automation's, and both carry the same platform id) or
|
|
118
|
+
* the automation resource itself; both labels are the automation's.
|
|
119
|
+
*/
|
|
120
|
+
function executeWorkflowFromTf(block, name, where, ctx) {
|
|
121
|
+
const attrs = block.attrs;
|
|
122
|
+
const autoRef = attrs["automation_id"];
|
|
123
|
+
const autoLabel = isTfExpr(autoRef) &&
|
|
124
|
+
autoRef.$expr === "resource-attr" &&
|
|
125
|
+
(autoRef.type === "elementum_workflow_publish" || autoRef.type === "elementum_automation")
|
|
126
|
+
? autoRef.label
|
|
127
|
+
: undefined;
|
|
128
|
+
if (autoLabel === undefined) {
|
|
129
|
+
ctx.diagnostics.push(`${where}: automation_id is not an automation/workflow_publish resource reference (${JSON.stringify(autoRef)}); skipped`);
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
const inputs = [];
|
|
133
|
+
for (const item of Array.isArray(attrs["inputs"]) ? attrs["inputs"] : []) {
|
|
134
|
+
const rec = (typeof item === "object" && item !== null && !isTfExpr(item) ? item : {});
|
|
135
|
+
if (typeof rec["parameter_name"] !== "string" || rec["parameter_name"] === "") {
|
|
136
|
+
ctx.diagnostics.push(`${where}: inputs item has no parameter_name; dropped`);
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
inputs.push({
|
|
140
|
+
parameterName: rec["parameter_name"],
|
|
141
|
+
...(typeof rec["name"] === "string" && { name: rec["name"] }),
|
|
142
|
+
...(typeof rec["description"] === "string" && { description: rec["description"] }),
|
|
143
|
+
...(typeof rec["required"] === "boolean" && { required: rec["required"] }),
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
const outputs = [];
|
|
147
|
+
for (const item of Array.isArray(attrs["outputs"]) ? attrs["outputs"] : []) {
|
|
148
|
+
const rec = (typeof item === "object" && item !== null && !isTfExpr(item) ? item : {});
|
|
149
|
+
if (typeof rec["workflow_property_name"] !== "string" || rec["workflow_property_name"] === "") {
|
|
150
|
+
ctx.diagnostics.push(`${where}: outputs item has no workflow_property_name; dropped`);
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
outputs.push({
|
|
154
|
+
workflowPropertyName: rec["workflow_property_name"],
|
|
155
|
+
...(typeof rec["name"] === "string" && { name: rec["name"] }),
|
|
156
|
+
...(typeof rec["description"] === "string" && { description: rec["description"] }),
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
const startMessage = optionalString(attrs, "start_message", where, ctx);
|
|
160
|
+
return {
|
|
161
|
+
typeKey: "executeWorkflow",
|
|
162
|
+
name,
|
|
163
|
+
description: optionalString(attrs, "description", where, ctx) ?? "",
|
|
164
|
+
...(startMessage !== undefined && { startMessage }),
|
|
165
|
+
automationKey: tfLabelToTsLabel(autoLabel),
|
|
166
|
+
...(inputs.length > 0 && { inputs }),
|
|
167
|
+
...(outputs.length > 0 && { outputs }),
|
|
168
|
+
};
|
|
169
|
+
}
|
|
@@ -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,38 @@
|
|
|
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 tfLabel. */
|
|
21
|
+
readonly agentTfLabel: string;
|
|
22
|
+
/** Records a foreign-app data lookup for data.tf; returns its tfLabel. */
|
|
23
|
+
foreignAppRef(tfLabel: string, name: string): void;
|
|
24
|
+
/** Degradations land here — reported by the caller, never silent. */
|
|
25
|
+
readonly diagnostics: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface ToolToTfResult {
|
|
28
|
+
readonly block: TfBlock;
|
|
29
|
+
/** `<resourceType>.<tfLabel>` — bookkeeping for the agent catalog. */
|
|
30
|
+
readonly address: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* One authored tool entry (`{ createRecord: {...} }`) → its resource block;
|
|
34
|
+
* undefined = degraded with a diagnostic (unimplemented sub-type, missing
|
|
35
|
+
* target). The one hard error is an invalid tool name — the platform would
|
|
36
|
+
* reject it at apply with an opaque message, so fail at build time instead.
|
|
37
|
+
*/
|
|
38
|
+
export declare function toolToTf(entry: Record<string, unknown>, ctx: ToolToTfContext): ToolToTfResult | undefined;
|
|
@@ -0,0 +1,164 @@
|
|
|
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 { expr, sanitizeName, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
16
|
+
import { SUB_TYPE_BY_TYPE_KEY as FIELD_SUB_TYPE_BY_TYPE_KEY } from "../field/types.js";
|
|
17
|
+
import { TOOL_SUB_TYPE_BY_TYPE_KEY } from "./types.js";
|
|
18
|
+
/** authoring FieldRef token → the field resource address, derived purely from the token. */
|
|
19
|
+
function fieldRefValue(token, where, ctx) {
|
|
20
|
+
const refName = token.refName ?? "";
|
|
21
|
+
const authoringType = token.fieldType ?? "";
|
|
22
|
+
const subType = [...FIELD_SUB_TYPE_BY_TYPE_KEY.values()].find((t) => t.authoringType === authoringType);
|
|
23
|
+
if (refName === "" || subType === undefined) {
|
|
24
|
+
ctx.diagnostics.push(`${where}: field token "${refName}" has no terraform field resource mapping (fieldType ${JSON.stringify(authoringType)}); dropped`);
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
if (token.parent !== undefined && token.parent !== ctx.appRefName) {
|
|
28
|
+
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`);
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
return expr.resourceAttr(subType.resourceType, tsLabelToTfLabel(refName), ["id"]);
|
|
32
|
+
}
|
|
33
|
+
/** authoring AspectRef token → target_id value (self resource ref or foreign data ref). */
|
|
34
|
+
function targetIdValue(token, ctx) {
|
|
35
|
+
if ((token.refName ?? "") === ctx.appRefName) {
|
|
36
|
+
return expr.resourceAttr("elementum_app", ctx.appTfLabel, ["id"]);
|
|
37
|
+
}
|
|
38
|
+
// ei derives foreign-app data labels from the display NAME.
|
|
39
|
+
const name = token.name ?? token.refName ?? "";
|
|
40
|
+
const tfLabel = sanitizeName(name);
|
|
41
|
+
ctx.foreignAppRef(tfLabel, name);
|
|
42
|
+
return expr.dataAttr("elementum_app", tfLabel, ["id"]);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* One authored tool entry (`{ createRecord: {...} }`) → its resource block;
|
|
46
|
+
* undefined = degraded with a diagnostic (unimplemented sub-type, missing
|
|
47
|
+
* target). The one hard error is an invalid tool name — the platform would
|
|
48
|
+
* reject it at apply with an opaque message, so fail at build time instead.
|
|
49
|
+
*/
|
|
50
|
+
export function toolToTf(entry, ctx) {
|
|
51
|
+
const typeKey = Object.keys(entry)[0];
|
|
52
|
+
if (typeKey === undefined)
|
|
53
|
+
return undefined;
|
|
54
|
+
const subType = TOOL_SUB_TYPE_BY_TYPE_KEY.get(typeKey);
|
|
55
|
+
const inner = entry[typeKey];
|
|
56
|
+
const name = inner?.name ?? "";
|
|
57
|
+
if (subType === undefined) {
|
|
58
|
+
ctx.diagnostics.push(`agent tool "${name}": unknown tool kind "${typeKey}"; dropped`);
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
if (subType.implemented !== true) {
|
|
62
|
+
ctx.diagnostics.push(`agent tool "${name}": tool kind "${typeKey}" is not supported on the terraform path yet; dropped`);
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
if (inner === undefined || typeof inner !== "object") {
|
|
66
|
+
ctx.diagnostics.push(`agent tool entry "${typeKey}" has a non-object body; dropped`);
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
// Tool-name validity is enforced in the authoring builders (entities/agent/
|
|
70
|
+
// tools.ts), not here — from-tf/to-tf must round-trip whatever the platform
|
|
71
|
+
// holds, including a hyphenated name deployed outside EDK.
|
|
72
|
+
if (inner.runAs !== undefined) {
|
|
73
|
+
ctx.diagnostics.push(`agent tool "${name}": runAs is not supported on the terraform path yet; dropped`);
|
|
74
|
+
}
|
|
75
|
+
const where = `agent tool "${name}"`;
|
|
76
|
+
const tfLabel = sanitizeName(`${ctx.agentTfLabel}_${name}`);
|
|
77
|
+
const attrs = {
|
|
78
|
+
agent_id: expr.resourceAttr("elementum_agent", ctx.agentTfLabel, ["id"]),
|
|
79
|
+
app_id: expr.resourceAttr("elementum_app", ctx.appTfLabel, ["id"]),
|
|
80
|
+
name,
|
|
81
|
+
description: inner.description ?? "",
|
|
82
|
+
};
|
|
83
|
+
if (inner.startMessage !== undefined)
|
|
84
|
+
attrs["start_message"] = inner.startMessage;
|
|
85
|
+
if (typeKey === "executeWorkflow") {
|
|
86
|
+
const auto = inner.automationId;
|
|
87
|
+
// Identity is the token's refName (the bag key — its tfLabel image IS the
|
|
88
|
+
// automation's label, per the bijection); the display name is a fallback
|
|
89
|
+
// for hand-written tokens. Generated catalog tokens carry no name.
|
|
90
|
+
const autoTfLabel = typeof auto?.refName === "string" && auto.refName !== ""
|
|
91
|
+
? tsLabelToTfLabel(auto.refName)
|
|
92
|
+
: typeof auto?.name === "string" && auto.name !== ""
|
|
93
|
+
? sanitizeName(auto.name)
|
|
94
|
+
: undefined;
|
|
95
|
+
if (auto === undefined || autoTfLabel === undefined) {
|
|
96
|
+
ctx.diagnostics.push(`${where}: no target automation token; dropped`);
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
if (auto.parent !== undefined && auto.parent !== ctx.appRefName) {
|
|
100
|
+
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`);
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
// The automation and workflow-publish resources carry the same platform
|
|
104
|
+
// id. Reference the publish block so Terraform cannot create the tool
|
|
105
|
+
// until the provider has published the workflow whose bindings it reads.
|
|
106
|
+
// ei export normalizes this back to elementum_automation.<label>.id; the
|
|
107
|
+
// live round-trip comparator treats only those two references as equal.
|
|
108
|
+
attrs["automation_id"] = expr.resourceAttr("elementum_workflow_publish", autoTfLabel, ["id"]);
|
|
109
|
+
if (inner.inputs !== undefined && inner.inputs.length > 0) {
|
|
110
|
+
attrs["inputs"] = inner.inputs.map((i) => ({
|
|
111
|
+
parameter_name: i.triggerParameterId?.name ?? "",
|
|
112
|
+
...(i.description !== undefined && i.description !== "" && { description: i.description }),
|
|
113
|
+
...(i.required !== undefined && { required: i.required }),
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
if (inner.outputs !== undefined && inner.outputs.length > 0) {
|
|
117
|
+
attrs["outputs"] = inner.outputs.map((o) => ({
|
|
118
|
+
workflow_property_name: o.workflowPropertyName ?? "",
|
|
119
|
+
...(o.description !== undefined && o.description !== "" && { description: o.description }),
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
// Write-only on the backend (no read resolver): ei exports the provider
|
|
123
|
+
// schema default statically, and a fresh import seeds the same — any
|
|
124
|
+
// other value would plan an eternal diff. Pinned, not authorable.
|
|
125
|
+
attrs["timeout"] = "PT5M";
|
|
126
|
+
const block = { kind: "resource", type: subType.resourceType, label: tfLabel, attrs };
|
|
127
|
+
return { block, address: `${subType.resourceType}.${tfLabel}` };
|
|
128
|
+
}
|
|
129
|
+
if (inner.aspectId === undefined) {
|
|
130
|
+
ctx.diagnostics.push(`${where}: no target aspect token; dropped`);
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
attrs["target_id"] = targetIdValue(inner.aspectId, ctx);
|
|
134
|
+
if (typeKey === "searchAspect") {
|
|
135
|
+
attrs["query_description"] = inner.queryDescription ?? "";
|
|
136
|
+
if (inner.limit !== undefined)
|
|
137
|
+
attrs["result_limit"] = inner.limit;
|
|
138
|
+
if (inner.filter !== undefined || inner.sort !== undefined) {
|
|
139
|
+
ctx.diagnostics.push(`${where}: filter/sort are not supported on the terraform path yet; dropped`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (inner.fields !== undefined && inner.fields.length > 0) {
|
|
143
|
+
const fieldValues = [];
|
|
144
|
+
for (const f of inner.fields) {
|
|
145
|
+
const ref = f.fieldId === undefined ? undefined : fieldRefValue(f.fieldId, where, ctx);
|
|
146
|
+
if (ref === undefined)
|
|
147
|
+
continue;
|
|
148
|
+
fieldValues.push({
|
|
149
|
+
field_id: ref,
|
|
150
|
+
// The wire duplicates the display name; the dialect carries one.
|
|
151
|
+
...(f.name !== undefined && { name: f.name }),
|
|
152
|
+
...(f.description !== undefined && { description: f.description }),
|
|
153
|
+
...(f.required !== undefined && { required: f.required }),
|
|
154
|
+
});
|
|
155
|
+
if (f.defaultValue !== undefined) {
|
|
156
|
+
ctx.diagnostics.push(`${where}: field default values are not supported on the terraform path yet; dropped`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (fieldValues.length > 0)
|
|
160
|
+
attrs["fields"] = fieldValues;
|
|
161
|
+
}
|
|
162
|
+
const block = { kind: "resource", type: subType.resourceType, label: tfLabel, attrs };
|
|
163
|
+
return { block, address: `${subType.resourceType}.${tfLabel}` };
|
|
164
|
+
}
|