@elementumai/edk 0.8.2-alpha.6 → 0.9.2
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 +18 -14
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +3 -3
- package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +3 -11
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +2 -10
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +1 -1
- package/dist-sdk/fs/entity.d.ts +2 -2
- package/dist-sdk/fs/entity.js +1 -1
- package/dist-sdk/pull/missing-report.d.ts +81 -0
- package/dist-sdk/pull/missing-report.js +52 -0
- package/dist-sdk/src/catalog/factories.d.ts +53 -19
- package/dist-sdk/src/catalog/factories.js +51 -12
- package/dist-sdk/src/catalog/from-authoring.js +13 -3
- package/dist-sdk/src/catalog/index.d.ts +2 -2
- package/dist-sdk/src/catalog/index.js +1 -1
- package/dist-sdk/src/catalog/org.js +1 -0
- package/dist-sdk/src/catalog/render.js +6 -0
- package/dist-sdk/src/catalog/token.js +7 -0
- package/dist-sdk/src/catalog/types.d.ts +34 -23
- package/dist-sdk/src/catalog/types.js +7 -4
- package/dist-sdk/src/core/app-to-ui.d.ts +6 -6
- package/dist-sdk/src/core/app-to-ui.js +7 -9
- package/dist-sdk/src/core/index.d.ts +1 -0
- package/dist-sdk/src/core/index.js +1 -0
- package/dist-sdk/src/core/platform-id.d.ts +11 -0
- package/dist-sdk/src/core/platform-id.js +8 -0
- package/dist-sdk/src/{entities/flow/activities/render-catalog.d.ts → core/render-tree.d.ts} +2 -2
- package/dist-sdk/src/{entities/flow/activities/render-catalog.js → core/render-tree.js} +6 -8
- package/dist-sdk/src/core/types/app.d.ts +13 -23
- package/dist-sdk/src/core/types/app.js +0 -1
- package/dist-sdk/src/engine/build/context.d.ts +3 -3
- package/dist-sdk/src/engine/pull/attrs.d.ts +4 -0
- package/dist-sdk/src/engine/pull/attrs.js +17 -0
- package/dist-sdk/src/engine/pull/context.d.ts +39 -0
- package/dist-sdk/src/engine/pull/org.d.ts +1 -0
- package/dist-sdk/src/engine/pull/org.js +2 -0
- package/dist-sdk/src/engine/tf/expr.d.ts +1 -1
- package/dist-sdk/src/engine/tf/expr.js +10 -3
- package/dist-sdk/src/engine/workspace/authoring-layout.js +4 -2
- package/dist-sdk/src/entities/access-policy/build.d.ts +4 -13
- package/dist-sdk/src/entities/access-policy/build.js +1 -1
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +12 -38
- package/dist-sdk/src/entities/access-policy/from-tf.js +16 -74
- package/dist-sdk/src/entities/access-policy/principal.d.ts +29 -0
- package/dist-sdk/src/entities/access-policy/principal.js +13 -0
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +20 -5
- package/dist-sdk/src/entities/access-policy/to-tf.js +26 -54
- package/dist-sdk/src/entities/agent/build.d.ts +39 -8
- package/dist-sdk/src/entities/agent/build.js +36 -15
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +5 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +121 -36
- package/dist-sdk/src/entities/agent/from-tf.js +5 -8
- package/dist-sdk/src/entities/agent/index.d.ts +5 -2
- package/dist-sdk/src/entities/agent/index.js +4 -2
- package/dist-sdk/src/entities/agent/module.js +5 -2
- package/dist-sdk/src/entities/agent/run-as.d.ts +16 -0
- package/dist-sdk/src/entities/agent/run-as.js +1 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +2 -1
- package/dist-sdk/src/entities/agent/to-tf.js +2 -1
- package/dist-sdk/src/entities/agent/tools.d.ts +60 -48
- package/dist-sdk/src/entities/agent/tools.js +44 -38
- package/dist-sdk/src/entities/agent-a2a-skill/from-tf.js +1 -1
- package/dist-sdk/src/entities/agent-a2a-skill/to-tf.js +4 -4
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +17 -8
- package/dist-sdk/src/entities/agent-tool/from-tf.js +127 -37
- package/dist-sdk/src/entities/agent-tool/module.js +6 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +5 -5
- package/dist-sdk/src/entities/agent-tool/to-tf.js +93 -20
- package/dist-sdk/src/entities/agent-tool/types.d.ts +4 -5
- package/dist-sdk/src/entities/agent-tool/types.js +36 -8
- package/dist-sdk/src/entities/app/build.d.ts +137 -25
- package/dist-sdk/src/entities/app/build.js +104 -53
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +173 -1
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.d.ts +59 -0
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.js +68 -0
- package/dist-sdk/src/entities/app/display-blocks.d.ts +2 -1
- package/dist-sdk/src/entities/app/display-blocks.js +1 -1
- package/dist-sdk/src/entities/app/from-tf.d.ts +11 -1
- package/dist-sdk/src/entities/app/from-tf.js +30 -2
- package/dist-sdk/src/entities/app/index.d.ts +13 -4
- package/dist-sdk/src/entities/app/index.js +8 -1
- package/dist-sdk/src/entities/app/module.js +27 -2
- package/dist-sdk/src/entities/app/to-tf.js +75 -1
- package/dist-sdk/src/entities/approval-chain/build.d.ts +31 -16
- package/dist-sdk/src/entities/approval-chain/build.js +49 -49
- package/dist-sdk/src/entities/approval-chain/from-tf.d.ts +17 -0
- package/dist-sdk/src/entities/approval-chain/from-tf.js +57 -0
- package/dist-sdk/src/entities/approval-chain/index.d.ts +2 -3
- package/dist-sdk/src/entities/approval-chain/index.js +2 -3
- package/dist-sdk/src/entities/approval-chain/module.d.ts +3 -0
- package/dist-sdk/src/entities/approval-chain/module.js +51 -0
- package/dist-sdk/src/entities/approval-chain/printer.d.ts +2 -0
- package/dist-sdk/src/entities/approval-chain/printer.js +21 -0
- package/dist-sdk/src/entities/approval-chain/to-tf.d.ts +9 -0
- package/dist-sdk/src/entities/approval-chain/to-tf.js +43 -0
- package/dist-sdk/src/entities/automation/build.d.ts +10 -6
- package/dist-sdk/src/entities/automation/build.js +5 -4
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +10 -8
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +51 -114
- package/dist-sdk/src/entities/automation/filter.d.ts +1 -115
- package/dist-sdk/src/entities/automation/filter.js +1 -197
- package/dist-sdk/src/entities/automation/from-tf.d.ts +4 -0
- package/dist-sdk/src/entities/automation/from-tf.js +202 -119
- package/dist-sdk/src/entities/automation/index.d.ts +4 -2
- package/dist-sdk/src/entities/automation/index.js +3 -1
- package/dist-sdk/src/entities/automation/module.js +10 -4
- package/dist-sdk/src/entities/automation/script-code.js +94 -6
- package/dist-sdk/src/entities/automation/tasks.d.ts +20 -19
- package/dist-sdk/src/entities/automation/tasks.js +2 -2
- package/dist-sdk/src/entities/automation/to-tf.d.ts +34 -2
- package/dist-sdk/src/entities/automation/to-tf.js +273 -98
- package/dist-sdk/src/entities/automation/triggers.d.ts +18 -17
- package/dist-sdk/src/entities/automation/triggers.js +1 -1
- package/dist-sdk/src/entities/dashboard/build.d.ts +17 -0
- package/dist-sdk/src/entities/dashboard/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/dashboard/from-tf.js +95 -0
- package/dist-sdk/src/entities/dashboard/module.d.ts +3 -0
- package/dist-sdk/src/entities/dashboard/module.js +16 -0
- package/dist-sdk/src/entities/dashboard/to-tf.d.ts +30 -0
- package/dist-sdk/src/entities/dashboard/to-tf.js +94 -0
- package/dist-sdk/src/entities/dashboard-widget/module.d.ts +3 -0
- package/dist-sdk/src/entities/dashboard-widget/module.js +10 -0
- package/dist-sdk/src/entities/data-lookup/module.d.ts +3 -0
- package/dist-sdk/src/entities/data-lookup/module.js +22 -0
- package/dist-sdk/src/entities/datamine/build.d.ts +22 -0
- package/dist-sdk/src/entities/datamine/build.js +1 -0
- package/dist-sdk/src/entities/datamine/from-tf.d.ts +17 -0
- package/dist-sdk/src/entities/datamine/from-tf.js +98 -0
- package/dist-sdk/src/entities/datamine/module.d.ts +3 -0
- package/dist-sdk/src/entities/datamine/module.js +23 -0
- package/dist-sdk/src/entities/datamine/to-tf.d.ts +11 -0
- package/dist-sdk/src/entities/datamine/to-tf.js +53 -0
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +303 -0
- package/dist-sdk/src/entities/dynamic-layout/build.js +4 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +2 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.js +9 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +10 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +233 -0
- package/dist-sdk/src/entities/dynamic-layout/module.d.ts +3 -0
- package/dist-sdk/src/entities/dynamic-layout/module.js +13 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +26 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +267 -0
- package/dist-sdk/src/entities/element/build.d.ts +31 -14
- package/dist-sdk/src/entities/element/build.js +12 -4
- package/dist-sdk/src/entities/element/from-tf.d.ts +9 -1
- package/dist-sdk/src/entities/element/from-tf.js +31 -2
- package/dist-sdk/src/entities/element/index.d.ts +8 -3
- package/dist-sdk/src/entities/element/index.js +4 -1
- package/dist-sdk/src/entities/element/module.js +19 -2
- package/dist-sdk/src/entities/element/to-tf.js +57 -1
- package/dist-sdk/src/entities/field/build.d.ts +4 -3
- package/dist-sdk/src/entities/field/calculation-types.d.ts +6 -0
- package/dist-sdk/src/entities/field/calculation-types.js +42 -0
- package/dist-sdk/src/entities/field/from-tf.js +90 -11
- package/dist-sdk/src/entities/field/module.d.ts +1 -0
- package/dist-sdk/src/entities/field/module.js +5 -2
- package/dist-sdk/src/entities/field/record-shape.d.ts +1 -1
- package/dist-sdk/src/entities/field/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/field/to-tf.js +22 -6
- package/dist-sdk/src/entities/field/types.js +3 -0
- package/dist-sdk/src/entities/file-reader/build.d.ts +66 -19
- package/dist-sdk/src/entities/file-reader/build.js +49 -4
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +1 -0
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +11 -9
- package/dist-sdk/src/entities/file-reader/from-tf.d.ts +1 -1
- package/dist-sdk/src/entities/file-reader/from-tf.js +31 -2
- package/dist-sdk/src/entities/file-reader/index.d.ts +3 -3
- package/dist-sdk/src/entities/file-reader/index.js +3 -3
- package/dist-sdk/src/entities/file-reader/module.js +6 -5
- package/dist-sdk/src/entities/file-reader/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/file-reader/to-tf.js +5 -2
- package/dist-sdk/src/entities/file-reader/types.d.ts +3 -4
- package/dist-sdk/src/entities/file-reader/types.js +4 -5
- package/dist-sdk/src/entities/org/category.js +4 -5
- package/dist-sdk/src/entities/org/group.js +4 -5
- package/dist-sdk/src/entities/org/index.d.ts +1 -0
- package/dist-sdk/src/entities/org/index.js +1 -0
- package/dist-sdk/src/entities/org/phone-provider.d.ts +4 -0
- package/dist-sdk/src/entities/org/phone-provider.js +33 -0
- package/dist-sdk/src/entities/org/role.d.ts +3 -3
- package/dist-sdk/src/entities/org/role.js +9 -6
- package/dist-sdk/src/entities/organization/build.d.ts +29 -0
- package/dist-sdk/src/entities/organization/build.js +24 -0
- package/dist-sdk/src/entities/organization/index.d.ts +2 -0
- package/dist-sdk/src/entities/organization/index.js +2 -0
- package/dist-sdk/src/entities/organization/module.d.ts +2 -0
- package/dist-sdk/src/entities/organization/module.js +18 -0
- package/dist-sdk/src/entities/organization/to-tf.d.ts +6 -0
- package/dist-sdk/src/entities/organization/to-tf.js +37 -0
- package/dist-sdk/src/entities/phone-service/build.d.ts +17 -0
- package/dist-sdk/src/entities/phone-service/build.js +31 -0
- package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.d.ts +4 -0
- package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +54 -0
- package/dist-sdk/src/entities/phone-service/from-tf.d.ts +25 -0
- package/dist-sdk/src/entities/phone-service/from-tf.js +75 -0
- package/dist-sdk/src/entities/phone-service/index.d.ts +2 -0
- package/dist-sdk/src/entities/phone-service/index.js +2 -0
- package/dist-sdk/src/entities/phone-service/module.d.ts +3 -0
- package/dist-sdk/src/entities/phone-service/module.js +55 -0
- package/dist-sdk/src/entities/phone-service/to-tf.d.ts +12 -0
- package/dist-sdk/src/entities/phone-service/to-tf.js +54 -0
- package/dist-sdk/src/entities/phone-service/types.d.ts +35 -0
- package/dist-sdk/src/entities/phone-service/types.js +22 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.d.ts +11 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.js +74 -0
- package/dist-sdk/src/entities/record-create-form/module.d.ts +11 -0
- package/dist-sdk/src/entities/record-create-form/module.js +24 -0
- package/dist-sdk/src/entities/record-create-form/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/record-create-form/to-tf.js +80 -0
- package/dist-sdk/src/entities/relationship/build.d.ts +16 -0
- package/dist-sdk/src/entities/relationship/build.js +1 -0
- package/dist-sdk/src/entities/relationship/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/relationship/from-tf.js +109 -0
- package/dist-sdk/src/entities/relationship/module.d.ts +3 -0
- package/dist-sdk/src/entities/relationship/module.js +16 -0
- package/dist-sdk/src/entities/relationship/to-tf.d.ts +31 -0
- package/dist-sdk/src/entities/relationship/to-tf.js +153 -0
- package/dist-sdk/src/entities/role/build.d.ts +65 -0
- package/dist-sdk/src/entities/role/build.js +33 -0
- package/dist-sdk/src/entities/role/from-tf.d.ts +13 -0
- package/dist-sdk/src/entities/role/from-tf.js +138 -0
- package/dist-sdk/src/entities/role/to-tf.d.ts +13 -0
- package/dist-sdk/src/entities/role/to-tf.js +69 -0
- package/dist-sdk/src/entities/search-table/build.d.ts +67 -28
- package/dist-sdk/src/entities/search-table/build.js +110 -56
- package/dist-sdk/src/entities/search-table/from-tf.d.ts +37 -0
- package/dist-sdk/src/entities/search-table/from-tf.js +113 -0
- package/dist-sdk/src/entities/search-table/index.d.ts +2 -2
- package/dist-sdk/src/entities/search-table/index.js +2 -2
- package/dist-sdk/src/entities/search-table/module.js +88 -10
- package/dist-sdk/src/entities/search-table/printer.d.ts +2 -0
- package/dist-sdk/src/entities/search-table/printer.js +52 -0
- package/dist-sdk/src/entities/search-table/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/search-table/to-tf.js +104 -0
- package/dist-sdk/src/entities/search-table/types.d.ts +8 -0
- package/dist-sdk/src/entities/search-table/types.js +21 -0
- package/dist-sdk/src/entities/service-account/build.d.ts +32 -0
- package/dist-sdk/src/entities/service-account/build.js +9 -0
- package/dist-sdk/src/entities/service-account/from-tf.d.ts +10 -0
- package/dist-sdk/src/entities/service-account/from-tf.js +109 -0
- package/dist-sdk/src/entities/service-account/module.d.ts +4 -0
- package/dist-sdk/src/entities/service-account/module.js +21 -0
- package/dist-sdk/src/entities/service-account/ref.d.ts +11 -0
- package/dist-sdk/src/entities/service-account/ref.js +5 -0
- package/dist-sdk/src/entities/service-account/to-tf.d.ts +11 -0
- package/dist-sdk/src/entities/service-account/to-tf.js +72 -0
- package/dist-sdk/src/entities/shared/connector-from-tf.d.ts +14 -0
- package/dist-sdk/src/entities/shared/connector-from-tf.js +14 -0
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +21 -79
- package/dist-sdk/src/entities/shared/filters/ast.js +5 -2
- package/dist-sdk/src/entities/shared/filters/index.d.ts +94 -206
- package/dist-sdk/src/entities/shared/filters/index.js +189 -341
- package/dist-sdk/src/entities/shared/filters/print.d.ts +11 -0
- package/dist-sdk/src/entities/shared/filters/print.js +122 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +170 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +527 -0
- package/dist-sdk/src/entities/shared/filters/types.d.ts +66 -69
- package/dist-sdk/src/entities/shared/filters/types.js +2 -3
- package/dist-sdk/src/entities/skill/build.d.ts +2 -2
- package/dist-sdk/src/entities/skill/build.js +4 -3
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +10 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +74 -32
- package/dist-sdk/src/entities/skill/index.d.ts +2 -1
- package/dist-sdk/src/entities/skill/index.js +2 -1
- package/dist-sdk/src/entities/skill/module.js +6 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +5 -1
- package/dist-sdk/src/entities/skill/to-tf.js +18 -0
- package/dist-sdk/src/entities/skill/tools.d.ts +46 -31
- package/dist-sdk/src/entities/skill/tools.js +33 -20
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +4 -1
- package/dist-sdk/src/entities/skill-tool/from-tf.js +76 -8
- package/dist-sdk/src/entities/skill-tool/module.js +9 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +6 -1
- package/dist-sdk/src/entities/skill-tool/to-tf.js +94 -42
- package/dist-sdk/src/entities/skill-tool/types.js +18 -1
- package/dist-sdk/src/entities/table/build.d.ts +64 -23
- package/dist-sdk/src/entities/table/build.js +33 -18
- package/dist-sdk/src/entities/table/catalog-render.js +6 -0
- package/dist-sdk/src/entities/table/deserializer/normalize.d.ts +99 -0
- package/dist-sdk/src/entities/table/deserializer/normalize.js +192 -0
- package/dist-sdk/src/entities/table/fields/types.d.ts +86 -0
- package/dist-sdk/src/entities/table/fields/types.js +12 -0
- package/dist-sdk/src/entities/table/fields.d.ts +107 -47
- package/dist-sdk/src/entities/table/fields.js +76 -55
- package/dist-sdk/src/entities/table/from-tf.d.ts +4 -0
- package/dist-sdk/src/entities/table/from-tf.js +261 -0
- package/dist-sdk/src/entities/table/index.d.ts +7 -5
- package/dist-sdk/src/entities/table/index.js +7 -7
- package/dist-sdk/src/entities/table/joins.d.ts +22 -9
- package/dist-sdk/src/entities/table/joins.js +8 -16
- package/dist-sdk/src/entities/table/module.d.ts +2 -1
- package/dist-sdk/src/entities/table/module.js +13 -6
- package/dist-sdk/src/entities/table/to-tf.d.ts +10 -0
- package/dist-sdk/src/entities/table/to-tf.js +230 -0
- package/dist-sdk/src/entities/task/build.d.ts +43 -0
- package/dist-sdk/src/entities/task/build.js +17 -0
- package/dist-sdk/src/entities/task/from-tf.d.ts +28 -0
- package/dist-sdk/src/entities/task/from-tf.js +38 -0
- package/dist-sdk/src/entities/task/index.d.ts +1 -0
- package/dist-sdk/src/entities/task/index.js +1 -0
- package/dist-sdk/src/entities/task/module.d.ts +3 -0
- package/dist-sdk/src/entities/task/module.js +12 -0
- package/dist-sdk/src/entities/task/to-tf.d.ts +9 -0
- package/dist-sdk/src/entities/task/to-tf.js +49 -0
- package/dist-sdk/src/entities/view/from-tf.d.ts +7 -2
- package/dist-sdk/src/entities/view/from-tf.js +209 -25
- package/dist-sdk/src/entities/view/module.js +5 -1
- package/dist-sdk/src/entities/view/to-tf.d.ts +49 -7
- package/dist-sdk/src/entities/view/to-tf.js +155 -18
- package/dist-sdk/src/entities/view/types.d.ts +8 -0
- package/dist-sdk/src/entities/view/types.js +43 -0
- package/dist-sdk/src/entities/visual-flow/build.d.ts +87 -0
- package/dist-sdk/src/entities/visual-flow/build.js +72 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.d.ts +49 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.js +124 -0
- package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -0
- package/dist-sdk/src/entities/visual-flow/index.js +1 -0
- package/dist-sdk/src/entities/visual-flow/module.d.ts +3 -0
- package/dist-sdk/src/entities/visual-flow/module.js +41 -0
- package/dist-sdk/src/entities/visual-flow/printer.d.ts +8 -0
- package/dist-sdk/src/entities/visual-flow/printer.js +92 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.js +101 -0
- package/dist-sdk/src/entities/widget/build.d.ts +55 -0
- package/dist-sdk/src/entities/widget/build.js +1 -0
- package/dist-sdk/src/entities/widget/from-tf.d.ts +11 -0
- package/dist-sdk/src/entities/widget/from-tf.js +209 -0
- package/dist-sdk/src/entities/widget/module.d.ts +3 -0
- package/dist-sdk/src/entities/widget/module.js +16 -0
- package/dist-sdk/src/entities/widget/to-tf.d.ts +44 -0
- package/dist-sdk/src/entities/widget/to-tf.js +204 -0
- package/dist-sdk/src/graph/deferred-catalog-render.d.ts +1 -1
- package/dist-sdk/src/graph/deferred-catalog-render.js +1 -1
- package/dist-sdk/src/graph/index.d.ts +7 -0
- package/dist-sdk/src/graph/index.js +4 -18
- package/dist-sdk/src/graph/modules.js +30 -1
- package/dist-sdk/src/graph/types.d.ts +55 -7
- package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
- package/dist-sdk/src/internal/sdk-package.js +4 -2
- package/package.json +30 -15
- package/dist-sdk/src/entities/access-policy/filter.d.ts +0 -61
- package/dist-sdk/src/entities/access-policy/filter.js +0 -83
- package/dist-sdk/src/entities/approval-chain/steps.d.ts +0 -24
- package/dist-sdk/src/entities/approval-chain/steps.js +0 -20
- package/dist-sdk/src/entities/flow/activities/agent.d.ts +0 -15
- package/dist-sdk/src/entities/flow/activities/agent.js +0 -29
- package/dist-sdk/src/entities/flow/activities/approval.d.ts +0 -9
- package/dist-sdk/src/entities/flow/activities/approval.js +0 -18
- package/dist-sdk/src/entities/flow/activities/automation.d.ts +0 -12
- package/dist-sdk/src/entities/flow/activities/automation.js +0 -22
- package/dist-sdk/src/entities/flow/activities/ctx.d.ts +0 -34
- package/dist-sdk/src/entities/flow/activities/ctx.js +0 -38
- package/dist-sdk/src/entities/flow/activities/form.d.ts +0 -22
- package/dist-sdk/src/entities/flow/activities/form.js +0 -36
- package/dist-sdk/src/entities/flow/activities/index.d.ts +0 -14
- package/dist-sdk/src/entities/flow/activities/index.js +0 -13
- package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +0 -39
- package/dist-sdk/src/entities/flow/activities/input-refs.js +0 -19
- package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +0 -13
- package/dist-sdk/src/entities/flow/activities/prompt-template.js +0 -34
- package/dist-sdk/src/entities/flow/activities/types.d.ts +0 -33
- package/dist-sdk/src/entities/flow/build.d.ts +0 -38
- package/dist-sdk/src/entities/flow/build.js +0 -115
- package/dist-sdk/src/entities/flow/index.d.ts +0 -8
- package/dist-sdk/src/entities/flow/index.js +0 -7
- package/dist-sdk/src/entities/flow/serialize.d.ts +0 -51
- package/dist-sdk/src/entities/flow/serialize.js +0 -94
- package/dist-sdk/src/entities/flow/util.d.ts +0 -27
- package/dist-sdk/src/entities/flow/util.js +0 -38
- package/dist-sdk/src/entities/table/filter.d.ts +0 -41
- package/dist-sdk/src/entities/table/filter.js +0 -89
- /package/dist-sdk/src/entities/{flow/activities/types.js → dashboard/build.js} +0 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { EntityTfError } from "../../engine/entity.js";
|
|
8
8
|
import { optionalString, resourceRefLabel } from "../../engine/pull/context.js";
|
|
9
|
-
import { isTfExpr, scopedLabelToBagKey } from "../../engine/tf/index.js";
|
|
9
|
+
import { isTfExpr, scopedLabelToBagKey, scopedResourceLabel, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
10
10
|
import { resolveToolFieldKey } from "../shared/tool-field-ref.js";
|
|
11
11
|
import { KNOWN_TOOL_ATTRS, TOOL_SUB_TYPE_BY_RESOURCE } from "./types.js";
|
|
12
12
|
/**
|
|
@@ -27,7 +27,9 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
27
27
|
const name = optionalString(attrs, "name", `tool "${label}"`, ctx) ?? "";
|
|
28
28
|
const where = `agent tool "${name}" (${block.type}.${label})`;
|
|
29
29
|
if (subType.implemented !== true) {
|
|
30
|
-
ctx.diagnostics.push(
|
|
30
|
+
ctx.diagnostics.push(subType.typeKey === "selectBotRoute"
|
|
31
|
+
? `${where}: select-bot-route is a platform-internal Nexus routing tool and is not part of the public EDK; skipped`
|
|
32
|
+
: `${where}: tool kind is not supported on the terraform path yet; skipped`);
|
|
31
33
|
return undefined;
|
|
32
34
|
}
|
|
33
35
|
const known = KNOWN_TOOL_ATTRS[subType.typeKey];
|
|
@@ -43,6 +45,58 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
43
45
|
if (subType.typeKey === "executeWorkflow") {
|
|
44
46
|
return executeWorkflowFromTf(block, name, where, owner, ctx);
|
|
45
47
|
}
|
|
48
|
+
const startMessage = optionalString(attrs, "start_message", where, ctx);
|
|
49
|
+
const common = {
|
|
50
|
+
name,
|
|
51
|
+
description: optionalString(attrs, "description", where, ctx) ?? "",
|
|
52
|
+
...(startMessage !== undefined && { startMessage }),
|
|
53
|
+
};
|
|
54
|
+
if (subType.typeKey === "runAgent") {
|
|
55
|
+
const targetLabel = resourceRefLabel(attrs["target_agent_id"], "elementum_agent");
|
|
56
|
+
if (targetLabel === undefined) {
|
|
57
|
+
ctx.diagnostics.push(`${where}: target_agent_id is not an elementum_agent resource reference; skipped`);
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
const targetAgentKey = scopedLabelToBagKey(owner.ownerTfLabel, targetLabel);
|
|
61
|
+
if (scopedResourceLabel(owner.ownerTfLabel, tsLabelToTfLabel(targetAgentKey), "app") !== targetLabel) {
|
|
62
|
+
ctx.diagnostics.push(`${where}: cross-app run-agent targets are not supported; skipped`);
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
typeKey: "runAgent",
|
|
67
|
+
...common,
|
|
68
|
+
targetAgentKey,
|
|
69
|
+
workerTaskPrompt: optionalString(attrs, "worker_task_prompt", where, ctx) ?? "",
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (subType.typeKey === "mcp") {
|
|
73
|
+
const serverUrl = optionalString(attrs, "server_url", where, ctx);
|
|
74
|
+
const mcpToolName = optionalString(attrs, "mcp_tool_name", where, ctx);
|
|
75
|
+
if (serverUrl === undefined || serverUrl === "" || mcpToolName === undefined || mcpToolName === "") {
|
|
76
|
+
ctx.diagnostics.push(`${where}: server_url or mcp_tool_name is missing; skipped`);
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
const headers = [];
|
|
80
|
+
const rawHeaders = attrs["headers"];
|
|
81
|
+
if (Array.isArray(rawHeaders)) {
|
|
82
|
+
for (const item of rawHeaders) {
|
|
83
|
+
if (typeof item !== "object" || item === null || Array.isArray(item) || isTfExpr(item)) {
|
|
84
|
+
ctx.diagnostics.push(`${where}: headers item has an unrecognized shape; dropped`);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const rec = item;
|
|
88
|
+
if (typeof rec["key"] !== "string" || typeof rec["value"] !== "string") {
|
|
89
|
+
ctx.diagnostics.push(`${where}: headers item is missing key or value; dropped`);
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
headers.push({ key: rec["key"], value: rec["value"] });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
else if (rawHeaders !== undefined) {
|
|
96
|
+
ctx.diagnostics.push(`${where}: headers is not a list; dropped`);
|
|
97
|
+
}
|
|
98
|
+
return { typeKey: "mcp", ...common, serverUrl, mcpToolName, ...(headers.length > 0 && { headers }) };
|
|
99
|
+
}
|
|
46
100
|
// Target: the owning app's resource ref = self; a data.elementum_app ref =
|
|
47
101
|
// a foreign app, resolved to its display name via the stream's data block.
|
|
48
102
|
// searchTable is the one sub-type where target_id can be absent entirely
|
|
@@ -64,35 +118,12 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
64
118
|
}
|
|
65
119
|
}
|
|
66
120
|
else {
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
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`);
|
|
121
|
+
const resolved = aspectTargetFromTf(targetAttr, "target_id", owner, ctx, where);
|
|
122
|
+
if (resolved === undefined)
|
|
94
123
|
return undefined;
|
|
95
|
-
|
|
124
|
+
target = resolved.target;
|
|
125
|
+
fieldScopeLabel = resolved.fieldScopeLabel;
|
|
126
|
+
fieldScope = resolved.fieldScope;
|
|
96
127
|
}
|
|
97
128
|
let fields;
|
|
98
129
|
let searchTableFields;
|
|
@@ -185,13 +216,49 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
185
216
|
if (subType.typeKey === "searchAspect" && attrs["filter_variables"] !== undefined) {
|
|
186
217
|
ctx.diagnostics.push(`${where}: filter_variables are not supported on the terraform path yet; a rebuilt stream will omit them`);
|
|
187
218
|
}
|
|
188
|
-
|
|
219
|
+
let searchTableKey;
|
|
220
|
+
let searchTableName;
|
|
221
|
+
if (subType.typeKey === "searchTable") {
|
|
222
|
+
const value = attrs["search_table_id"];
|
|
223
|
+
const resourceTypes = ["elementum_ai_search_table", "elementum_linked_ai_search_table", "elementum_table_search_table"];
|
|
224
|
+
const matched = resourceTypes
|
|
225
|
+
.map((type) => ({ type, label: resourceRefLabel(value, type) }))
|
|
226
|
+
.find((candidate) => candidate.label !== undefined);
|
|
227
|
+
if (matched?.label !== undefined) {
|
|
228
|
+
// A managed or linked search table is owned by an ELEMENT, so its label
|
|
229
|
+
// carries the `elements_<ns>_` prefix — decoding it with app scope leaves
|
|
230
|
+
// the prefix in place and camel-cases the whole label into a bag key that
|
|
231
|
+
// matches nothing. The table variant keeps its existing app-scope
|
|
232
|
+
// handling: a table-owned search table reached through a tool is not
|
|
233
|
+
// modelled end to end yet.
|
|
234
|
+
const scope = matched.type === "elementum_table_search_table" ? "app" : "element";
|
|
235
|
+
searchTableKey = scopedLabelToBagKey(owner.ownerTfLabel, matched.label, scope);
|
|
236
|
+
}
|
|
237
|
+
else if (isTfExpr(value) && value.$expr === "data-attr" && value.type === "elementum_search_table") {
|
|
238
|
+
searchTableName = ctx.dataName(value.type, value.label);
|
|
239
|
+
if (searchTableName === undefined) {
|
|
240
|
+
ctx.diagnostics.push(`${where}: search_table_id references data.${value.type}.${value.label} without a matching name lookup; skipped`);
|
|
241
|
+
return undefined;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
ctx.diagnostics.push(`${where}: search_table_id is not a supported search-table reference; skipped`);
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
let relatedTarget;
|
|
250
|
+
if (subType.typeKey === "relateRecord") {
|
|
251
|
+
const relatedAttr = attrs["related_target_id"];
|
|
252
|
+
const resolved = aspectTargetFromTf(relatedAttr, "related_target_id", owner, ctx, where);
|
|
253
|
+
if (resolved === undefined)
|
|
254
|
+
return undefined;
|
|
255
|
+
relatedTarget = resolved.target;
|
|
256
|
+
}
|
|
189
257
|
return {
|
|
190
258
|
typeKey: subType.typeKey,
|
|
191
|
-
|
|
192
|
-
description: optionalString(attrs, "description", where, ctx) ?? "",
|
|
193
|
-
...(startMessage !== undefined && { startMessage }),
|
|
259
|
+
...common,
|
|
194
260
|
...(target !== undefined && { target }),
|
|
261
|
+
...(relatedTarget !== undefined && { relatedTarget }),
|
|
195
262
|
...(fields !== undefined && { fields }),
|
|
196
263
|
...(searchTableFields !== undefined && { searchTableFields }),
|
|
197
264
|
...(returnFields !== undefined && { returnFields }),
|
|
@@ -202,11 +269,34 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
202
269
|
...(subType.typeKey === "updateRecord" && {
|
|
203
270
|
handleDescription: optionalString(attrs, "handle_description", where, ctx) ?? "",
|
|
204
271
|
}),
|
|
205
|
-
...(
|
|
206
|
-
|
|
207
|
-
}),
|
|
272
|
+
...(searchTableKey !== undefined && { searchTableKey }),
|
|
273
|
+
...(searchTableName !== undefined && { searchTableName }),
|
|
208
274
|
};
|
|
209
275
|
}
|
|
276
|
+
function aspectTargetFromTf(value, attrName, owner, ctx, where) {
|
|
277
|
+
if (value === undefined) {
|
|
278
|
+
ctx.diagnostics.push(`${where}: ${attrName} is missing; skipped`);
|
|
279
|
+
return undefined;
|
|
280
|
+
}
|
|
281
|
+
if (value !== undefined && resourceRefLabel(value, owner.appType) === owner.appLabel) {
|
|
282
|
+
return { target: { kind: "self" }, fieldScopeLabel: owner.ownerTfLabel, fieldScope: "app" };
|
|
283
|
+
}
|
|
284
|
+
for (const [type, kind, scope] of [
|
|
285
|
+
["elementum_app", "foreignApp", "app"],
|
|
286
|
+
["elementum_element", "foreignElement", "element"],
|
|
287
|
+
]) {
|
|
288
|
+
if (!isTfExpr(value) || value.$expr !== "data-attr" || value.type !== type)
|
|
289
|
+
continue;
|
|
290
|
+
const name = ctx.dataName(type, value.label);
|
|
291
|
+
if (name === undefined) {
|
|
292
|
+
ctx.diagnostics.push(`${where}: ${attrName} references data.${type}.${value.label} but the stream has no such data block; skipped`);
|
|
293
|
+
return undefined;
|
|
294
|
+
}
|
|
295
|
+
return { target: { kind, name }, fieldScopeLabel: value.label, fieldScope: scope };
|
|
296
|
+
}
|
|
297
|
+
ctx.diagnostics.push(`${where}: ${attrName} has an unrecognized shape (${JSON.stringify(value)}); skipped`);
|
|
298
|
+
return undefined;
|
|
299
|
+
}
|
|
210
300
|
/**
|
|
211
301
|
* Run-automation (executeWorkflow) tool extraction. `automation_id` may
|
|
212
302
|
* reference the publish block (ei's uuid→ref winner — the publish import is
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** The agent-tool entity's registry entry (see src/graph/). */
|
|
2
2
|
import { NO_CATALOG, NO_DATA, NO_LIFECYCLE, } from "../../graph/types.js";
|
|
3
3
|
import { AUTOMATION_RESOURCE_TYPE, WORKFLOW_PUBLISH_RESOURCE_TYPE, } from "../automation/types.js";
|
|
4
|
+
import { FIELD_DATA_RESOURCE_TYPE } from "../field/module.js";
|
|
4
5
|
import { AGENT_TOOL_SUB_TYPES, RUN_AUTOMATION_TOOL_RESOURCE_TYPE, } from "./types.js";
|
|
5
6
|
export const agentToolModule = {
|
|
6
7
|
kind: "agent-tool",
|
|
@@ -28,5 +29,10 @@ export const agentToolModule = {
|
|
|
28
29
|
toType: AUTOMATION_RESOURCE_TYPE,
|
|
29
30
|
},
|
|
30
31
|
],
|
|
32
|
+
resolvedDataReferences: [{
|
|
33
|
+
attribute: "fields",
|
|
34
|
+
nestedAttribute: "field_id",
|
|
35
|
+
dataType: FIELD_DATA_RESOURCE_TYPE,
|
|
36
|
+
}],
|
|
31
37
|
},
|
|
32
38
|
};
|
|
@@ -9,12 +9,10 @@
|
|
|
9
9
|
* - self-app target → the app's own resource ref;
|
|
10
10
|
* - cross-app target → a name-keyed `data.elementum_app` lookup whose
|
|
11
11
|
* label derives from the app NAME (ei's sanitize rule);
|
|
12
|
-
* - tool fields →
|
|
13
|
-
*
|
|
14
|
-
* owned by a DIFFERENT app/element resolves via a `data.elementum_field`
|
|
15
|
-
* lookup instead (`parentKind`/`parentName` on the token — see
|
|
16
|
-
* `FieldRef`'s doc comment in `src/catalog/types.ts`).
|
|
12
|
+
* - tool fields → a local field resource ref, or an object-scoped
|
|
13
|
+
* `data.elementum_field` lookup when the typed target is foreign.
|
|
17
14
|
*/
|
|
15
|
+
import { type WorkspaceAspect } from "../../engine/build/context.js";
|
|
18
16
|
import { type TfBlock, type TfValue } from "../../engine/tf/index.js";
|
|
19
17
|
export interface ToolToTfContext {
|
|
20
18
|
/** The owning app's refName + tfLabel (namespace) — self-target detection + app_id. */
|
|
@@ -28,6 +26,8 @@ export interface ToolToTfContext {
|
|
|
28
26
|
foreignElementRef(tfLabel: string, name: string): void;
|
|
29
27
|
/** Records a `data.elementum_field` lookup for a field owned by a foreign app/element. */
|
|
30
28
|
foreignFieldRef(type: string, tfLabel: string, objectId: TfValue, name: string): void;
|
|
29
|
+
/** App/element roots authored in this same workspace. */
|
|
30
|
+
readonly workspaceAspects?: ReadonlyMap<string, WorkspaceAspect>;
|
|
31
31
|
/** Degradations land here — reported by the caller, never silent. */
|
|
32
32
|
readonly diagnostics: string[];
|
|
33
33
|
}
|
|
@@ -9,22 +9,35 @@
|
|
|
9
9
|
* - self-app target → the app's own resource ref;
|
|
10
10
|
* - cross-app target → a name-keyed `data.elementum_app` lookup whose
|
|
11
11
|
* label derives from the app NAME (ei's sanitize rule);
|
|
12
|
-
* - tool fields →
|
|
13
|
-
*
|
|
14
|
-
* owned by a DIFFERENT app/element resolves via a `data.elementum_field`
|
|
15
|
-
* lookup instead (`parentKind`/`parentName` on the token — see
|
|
16
|
-
* `FieldRef`'s doc comment in `src/catalog/types.ts`).
|
|
12
|
+
* - tool fields → a local field resource ref, or an object-scoped
|
|
13
|
+
* `data.elementum_field` lookup when the typed target is foreign.
|
|
17
14
|
*/
|
|
18
|
-
import {
|
|
15
|
+
import { workspaceAspectKey } from "../../engine/build/context.js";
|
|
16
|
+
import { appScopedResourceLabel, expr, sanitizeName, scopedResourceLabel, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
19
17
|
import { EntityTfError } from "../../engine/entity.js";
|
|
20
18
|
import { fieldRefToTfValue } from "../field/to-tf.js";
|
|
21
19
|
import { TOOL_SUB_TYPE_BY_TYPE_KEY } from "./types.js";
|
|
22
|
-
/** authoring
|
|
20
|
+
/** authoring app/element token → its resolved target (workspace resource or foreign data ref). */
|
|
23
21
|
function resolveTarget(token, ctx) {
|
|
24
22
|
const refName = token.refName ?? "";
|
|
25
23
|
const kind = token.__kind === "element" ? "element" : "app";
|
|
26
24
|
if (kind === "app" && refName === ctx.appRefName) {
|
|
27
|
-
return {
|
|
25
|
+
return {
|
|
26
|
+
value: expr.resourceAttr("elementum_app", ctx.appTfLabel, ["id"]),
|
|
27
|
+
refName,
|
|
28
|
+
kind,
|
|
29
|
+
localTfLabel: ctx.appTfLabel,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const sibling = ctx.workspaceAspects?.get(workspaceAspectKey(kind, refName));
|
|
33
|
+
if (sibling !== undefined) {
|
|
34
|
+
const resourceType = kind === "element" ? "elementum_element" : "elementum_app";
|
|
35
|
+
return {
|
|
36
|
+
value: expr.resourceAttr(resourceType, sibling.tfLabel, ["id"]),
|
|
37
|
+
refName,
|
|
38
|
+
kind,
|
|
39
|
+
localTfLabel: sibling.tfLabel,
|
|
40
|
+
};
|
|
28
41
|
}
|
|
29
42
|
// ei derives foreign-app/foreign-element data labels from the display NAME.
|
|
30
43
|
const name = token.name ?? refName;
|
|
@@ -34,10 +47,10 @@ function resolveTarget(token, ctx) {
|
|
|
34
47
|
// provider looks up the wrong resource type entirely.
|
|
35
48
|
if (kind === "element") {
|
|
36
49
|
ctx.foreignElementRef(tfLabel, name);
|
|
37
|
-
return { value: expr.dataAttr("elementum_element", tfLabel, ["id"]), refName, kind,
|
|
50
|
+
return { value: expr.dataAttr("elementum_element", tfLabel, ["id"]), refName, kind, foreignTfLabel: tfLabel };
|
|
38
51
|
}
|
|
39
52
|
ctx.foreignAppRef(tfLabel, name);
|
|
40
|
-
return { value: expr.dataAttr("elementum_app", tfLabel, ["id"]), refName, kind,
|
|
53
|
+
return { value: expr.dataAttr("elementum_app", tfLabel, ["id"]), refName, kind, foreignTfLabel: tfLabel };
|
|
41
54
|
}
|
|
42
55
|
/**
|
|
43
56
|
* A field belonging to the tool's target aspect, when that target is
|
|
@@ -95,10 +108,9 @@ function fieldRefValue(token, where, ctx, target) {
|
|
|
95
108
|
ctx.diagnostics.push(`${where}: field "${refName}" belongs to ${parentKind} "${parent}", not the tool's target ${target.kind} "${target.refName}" — a tool's fields must belong to its own target aspect; dropped`);
|
|
96
109
|
return undefined;
|
|
97
110
|
}
|
|
98
|
-
if (
|
|
111
|
+
if (target.localTfLabel === undefined)
|
|
99
112
|
return foreignTargetFieldRefValue(token, refName, target, ctx);
|
|
100
|
-
// Falls through to the
|
|
101
|
-
// `target.isSelf` already proved this target IS ctx.appTfLabel.
|
|
113
|
+
// Falls through to the local resource-address resolution below.
|
|
102
114
|
}
|
|
103
115
|
else if (token.parent !== undefined && (token.parent !== ctx.appRefName || token.parentKind === "element")) {
|
|
104
116
|
ctx.diagnostics.push(`${where}: field "${refName}" belongs to "${token.parent}", not this tool's app; dropped`);
|
|
@@ -108,7 +120,7 @@ function fieldRefValue(token, where, ctx, target) {
|
|
|
108
120
|
// vs. real field resource, by authoring type) rather than reimplementing
|
|
109
121
|
// it here — see fieldRefToTfValue's doc comment for the system-field
|
|
110
122
|
// ordering rationale.
|
|
111
|
-
const value = fieldRefToTfValue(token.fieldType ?? "", refName, ctx.appTfLabel);
|
|
123
|
+
const value = fieldRefToTfValue(token.fieldType ?? "", refName, target?.localTfLabel ?? ctx.appTfLabel, target?.kind ?? "app");
|
|
112
124
|
if (value === undefined) {
|
|
113
125
|
ctx.diagnostics.push(`${where}: field token "${refName}" has no terraform field resource mapping (fieldType ${JSON.stringify(token.fieldType ?? "")}); dropped`);
|
|
114
126
|
}
|
|
@@ -200,6 +212,42 @@ export function toolToTf(entry, ctx) {
|
|
|
200
212
|
const block = { kind: "resource", type: subType.resourceType, label: tfLabel, attrs };
|
|
201
213
|
return { block, address: `${subType.resourceType}.${tfLabel}` };
|
|
202
214
|
}
|
|
215
|
+
if (typeKey === "runAgent") {
|
|
216
|
+
const target = inner.targetAgentId;
|
|
217
|
+
const targetRefName = target?.refName ?? "";
|
|
218
|
+
if (target === undefined || targetRefName === "") {
|
|
219
|
+
ctx.diagnostics.push(`${where}: no target agent token; dropped`);
|
|
220
|
+
return undefined;
|
|
221
|
+
}
|
|
222
|
+
if (target.parent !== undefined && target.parent !== ctx.appRefName) {
|
|
223
|
+
ctx.diagnostics.push(`${where}: target agent "${targetRefName}" belongs to app "${target.parent}" — cross-app run-agent tools are not supported on the terraform path yet; dropped`);
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
attrs["target_agent_id"] = expr.resourceAttr("elementum_agent", appScopedResourceLabel(ctx.appTfLabel, tsLabelToTfLabel(targetRefName)), ["id"]);
|
|
227
|
+
attrs["worker_task_prompt"] = inner.workerTaskPrompt ?? "";
|
|
228
|
+
const block = { kind: "resource", type: subType.resourceType, label: tfLabel, attrs };
|
|
229
|
+
return { block, address: `${subType.resourceType}.${tfLabel}` };
|
|
230
|
+
}
|
|
231
|
+
if (typeKey === "mcp") {
|
|
232
|
+
if (inner.serverUrl === undefined || inner.serverUrl === "") {
|
|
233
|
+
ctx.diagnostics.push(`${where}: no serverUrl; dropped`);
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
if (inner.mcpToolName === undefined || inner.mcpToolName === "") {
|
|
237
|
+
ctx.diagnostics.push(`${where}: no mcpToolName; dropped`);
|
|
238
|
+
return undefined;
|
|
239
|
+
}
|
|
240
|
+
attrs["server_url"] = inner.serverUrl;
|
|
241
|
+
attrs["mcp_tool_name"] = inner.mcpToolName;
|
|
242
|
+
if (inner.headers !== undefined && inner.headers.length > 0) {
|
|
243
|
+
attrs["headers"] = inner.headers.map((header) => ({
|
|
244
|
+
key: header.key ?? "",
|
|
245
|
+
value: header.value ?? "",
|
|
246
|
+
}));
|
|
247
|
+
}
|
|
248
|
+
const block = { kind: "resource", type: subType.resourceType, label: tfLabel, attrs };
|
|
249
|
+
return { block, address: `${subType.resourceType}.${tfLabel}` };
|
|
250
|
+
}
|
|
203
251
|
// searchTable is the one sub-type where a target aspect is optional
|
|
204
252
|
// (confirmed live — see toolFromTf's matching comment).
|
|
205
253
|
if (inner.aspectId === undefined && typeKey !== "searchTable") {
|
|
@@ -209,6 +257,13 @@ export function toolToTf(entry, ctx) {
|
|
|
209
257
|
const target = inner.aspectId !== undefined ? resolveTarget(inner.aspectId, ctx) : undefined;
|
|
210
258
|
if (target !== undefined)
|
|
211
259
|
attrs["target_id"] = target.value;
|
|
260
|
+
if (typeKey === "relateRecord") {
|
|
261
|
+
if (inner.relatedAspectId === undefined) {
|
|
262
|
+
ctx.diagnostics.push(`${where}: no related aspect token; dropped`);
|
|
263
|
+
return undefined;
|
|
264
|
+
}
|
|
265
|
+
attrs["related_target_id"] = resolveTarget(inner.relatedAspectId, ctx).value;
|
|
266
|
+
}
|
|
212
267
|
if (typeKey === "updateRecord") {
|
|
213
268
|
if (inner.handleDescription === undefined || inner.handleDescription === "") {
|
|
214
269
|
// The provider requires a non-empty handle_description and rejects an
|
|
@@ -228,14 +283,32 @@ export function toolToTf(entry, ctx) {
|
|
|
228
283
|
}
|
|
229
284
|
}
|
|
230
285
|
if (typeKey === "searchTable") {
|
|
231
|
-
|
|
232
|
-
|
|
286
|
+
const table = inner.searchTableId;
|
|
287
|
+
if (table?.refName === undefined || table.refName === "") {
|
|
288
|
+
ctx.diagnostics.push(`${where}: no search table token; dropped`);
|
|
289
|
+
return undefined;
|
|
290
|
+
}
|
|
291
|
+
if (target !== undefined && table.parent !== undefined && table.parent !== "" && table.parent !== target.refName) {
|
|
292
|
+
ctx.diagnostics.push(`${where}: search table belongs to "${table.parent}", not target "${target.refName}"; dropped`);
|
|
293
|
+
return undefined;
|
|
294
|
+
}
|
|
295
|
+
if (target?.localTfLabel !== undefined) {
|
|
296
|
+
const resourceType = table.__variant === "linked"
|
|
297
|
+
? "elementum_linked_ai_search_table"
|
|
298
|
+
: table.__variant === "table"
|
|
299
|
+
? "elementum_table_search_table"
|
|
300
|
+
: "elementum_ai_search_table";
|
|
301
|
+
attrs["search_table_id"] = expr.resourceAttr(resourceType, scopedResourceLabel(target.localTfLabel, tsLabelToTfLabel(table.refName), target.kind), ["id"]);
|
|
302
|
+
}
|
|
303
|
+
else if (target !== undefined) {
|
|
304
|
+
const lookupLabel = sanitizeName(`${target.foreignTfLabel}_${table.name ?? table.refName}`);
|
|
305
|
+
ctx.foreignFieldRef("elementum_search_table", lookupLabel, target.value, table.name ?? table.refName);
|
|
306
|
+
attrs["search_table_id"] = expr.dataAttr("elementum_search_table", lookupLabel, ["id"]);
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
ctx.diagnostics.push(`${where}: search table has no target aspect; dropped`);
|
|
233
310
|
return undefined;
|
|
234
311
|
}
|
|
235
|
-
// Always a raw platform id — see ReturnFieldWire's sibling comment on
|
|
236
|
-
// searchTableId. There is no data-source/reference form to resolve
|
|
237
|
-
// against; ei itself never exports one for this attribute.
|
|
238
|
-
attrs["search_table_id"] = inner.searchTableId;
|
|
239
312
|
}
|
|
240
313
|
if (inner.fields !== undefined && inner.fields.length > 0) {
|
|
241
314
|
const fieldValues = [];
|
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
* (agent_id + app_id + name/description) — so per-sub-type knowledge is one
|
|
5
5
|
* ROW here, exactly like `entities/field/types.ts`.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* end
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* plan as a destroy on rebuild.
|
|
7
|
+
* Every product-facing provider agent-tool resource is implemented end to
|
|
8
|
+
* end. Hydra also exposes its internal select-bot-route transport type in the
|
|
9
|
+
* generic GraphQL tool union; that row remains recognized so pull can report
|
|
10
|
+
* it explicitly, but it is intentionally not authorable or adoptable.
|
|
12
11
|
*/
|
|
13
12
|
/** One agent-tool sub-type: authoring variant key ↔ resource type. */
|
|
14
13
|
export interface AgentToolSubType {
|
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
* (agent_id + app_id + name/description) — so per-sub-type knowledge is one
|
|
5
5
|
* ROW here, exactly like `entities/field/types.ts`.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* end
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* plan as a destroy on rebuild.
|
|
7
|
+
* Every product-facing provider agent-tool resource is implemented end to
|
|
8
|
+
* end. Hydra also exposes its internal select-bot-route transport type in the
|
|
9
|
+
* generic GraphQL tool union; that row remains recognized so pull can report
|
|
10
|
+
* it explicitly, but it is intentionally not authorable or adoptable.
|
|
12
11
|
*/
|
|
13
12
|
export const RUN_AUTOMATION_TOOL_RESOURCE_TYPE = "elementum_agent_run_automation_tool";
|
|
14
13
|
export const AGENT_TOOL_SUB_TYPES = [
|
|
@@ -16,11 +15,11 @@ export const AGENT_TOOL_SUB_TYPES = [
|
|
|
16
15
|
{ typeKey: "searchAspect", resourceType: "elementum_agent_search_records_tool", implemented: true },
|
|
17
16
|
{ typeKey: "updateRecord", resourceType: "elementum_agent_update_record_tool", implemented: true },
|
|
18
17
|
{ typeKey: "searchTable", resourceType: "elementum_agent_ai_search_tool", implemented: true },
|
|
19
|
-
{ typeKey: "relateRecord", resourceType: "elementum_agent_relate_record_tool" },
|
|
18
|
+
{ typeKey: "relateRecord", resourceType: "elementum_agent_relate_record_tool", implemented: true },
|
|
20
19
|
{ typeKey: "executeWorkflow", resourceType: RUN_AUTOMATION_TOOL_RESOURCE_TYPE, implemented: true },
|
|
21
|
-
{ typeKey: "runAgent", resourceType: "elementum_agent_run_agent_tool" },
|
|
20
|
+
{ typeKey: "runAgent", resourceType: "elementum_agent_run_agent_tool", implemented: true },
|
|
22
21
|
{ typeKey: "selectBotRoute", resourceType: "elementum_agent_select_bot_route_tool" },
|
|
23
|
-
{ typeKey: "mcp", resourceType: "elementum_agent_mcp_tool" },
|
|
22
|
+
{ typeKey: "mcp", resourceType: "elementum_agent_mcp_tool", implemented: true },
|
|
24
23
|
];
|
|
25
24
|
export const TOOL_SUB_TYPE_BY_TYPE_KEY = new Map(AGENT_TOOL_SUB_TYPES.map((t) => [t.typeKey, t]));
|
|
26
25
|
export const TOOL_SUB_TYPE_BY_RESOURCE = new Map(AGENT_TOOL_SUB_TYPES.map((t) => [t.resourceType, t]));
|
|
@@ -99,4 +98,33 @@ export const KNOWN_TOOL_ATTRS = {
|
|
|
99
98
|
"fields",
|
|
100
99
|
"return_fields",
|
|
101
100
|
]),
|
|
101
|
+
relateRecord: new Set([
|
|
102
|
+
"agent_id",
|
|
103
|
+
"app_id",
|
|
104
|
+
"name",
|
|
105
|
+
"description",
|
|
106
|
+
"start_message",
|
|
107
|
+
"target_id",
|
|
108
|
+
"related_target_id",
|
|
109
|
+
]),
|
|
110
|
+
runAgent: new Set([
|
|
111
|
+
"agent_id",
|
|
112
|
+
"app_id",
|
|
113
|
+
"name",
|
|
114
|
+
"description",
|
|
115
|
+
"start_message",
|
|
116
|
+
"target_agent_id",
|
|
117
|
+
"worker_task_prompt",
|
|
118
|
+
]),
|
|
119
|
+
selectBotRoute: new Set(["agent_id", "app_id", "name", "description", "start_message", "bot_id"]),
|
|
120
|
+
mcp: new Set([
|
|
121
|
+
"agent_id",
|
|
122
|
+
"app_id",
|
|
123
|
+
"name",
|
|
124
|
+
"description",
|
|
125
|
+
"start_message",
|
|
126
|
+
"server_url",
|
|
127
|
+
"mcp_tool_name",
|
|
128
|
+
"headers",
|
|
129
|
+
]),
|
|
102
130
|
};
|