@elementumai/edk 0.8.2-alpha.6 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -37
- 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 +3 -11
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +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/pull/util.d.ts +1 -1
- package/dist-sdk/pull/util.js +3 -3
- package/dist-sdk/src/catalog/factories.d.ts +96 -23
- package/dist-sdk/src/catalog/factories.js +141 -21
- package/dist-sdk/src/catalog/from-authoring.d.ts +5 -5
- package/dist-sdk/src/catalog/from-authoring.js +20 -10
- 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 +63 -4
- package/dist-sdk/src/catalog/render-helpers.d.ts +1 -1
- package/dist-sdk/src/catalog/render-helpers.js +1 -1
- package/dist-sdk/src/catalog/render.d.ts +1 -0
- package/dist-sdk/src/catalog/render.js +8 -2
- package/dist-sdk/src/catalog/token.js +18 -4
- package/dist-sdk/src/catalog/types.d.ts +64 -24
- package/dist-sdk/src/catalog/types.js +12 -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 +11 -10
- package/dist-sdk/src/core/index.js +10 -9
- 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} +3 -3
- package/dist-sdk/src/{entities/flow/activities/render-catalog.js → core/render-tree.js} +7 -10
- package/dist-sdk/src/core/types/ai-provider.d.ts +1 -1
- package/dist-sdk/src/core/types/ai-provider.js +1 -1
- package/dist-sdk/src/core/types/app.d.ts +78 -52
- package/dist-sdk/src/core/types/app.js +2 -3
- package/dist-sdk/src/core/types/aspect-category.d.ts +4 -4
- package/dist-sdk/src/core/types/aspect-category.js +4 -4
- package/dist-sdk/src/core/types/cloud-link.d.ts +3 -3
- package/dist-sdk/src/core/types/cloud-link.js +3 -3
- package/dist-sdk/src/core/types/display-block.d.ts +2 -2
- package/dist-sdk/src/core/types/display-block.js +2 -2
- package/dist-sdk/src/core/types/group.d.ts +1 -1
- package/dist-sdk/src/core/types/group.js +1 -1
- package/dist-sdk/src/core/types/user.d.ts +1 -1
- package/dist-sdk/src/core/types/user.js +1 -1
- package/dist-sdk/src/core/wire/ref-serializer.js +3 -3
- package/dist-sdk/src/engine/build/context.d.ts +23 -16
- package/dist-sdk/src/engine/entity.d.ts +1 -1
- 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 +73 -0
- package/dist-sdk/src/engine/pull/context.js +14 -0
- package/dist-sdk/src/engine/pull/org.d.ts +10 -0
- package/dist-sdk/src/engine/pull/org.js +35 -0
- package/dist-sdk/src/engine/pull/ref-only.d.ts +37 -0
- package/dist-sdk/src/engine/pull/ref-only.js +204 -0
- package/dist-sdk/src/engine/tf/expr.d.ts +7 -3
- package/dist-sdk/src/engine/tf/expr.js +27 -15
- package/dist-sdk/src/engine/tf/index.d.ts +1 -1
- package/dist-sdk/src/engine/tf/index.js +1 -1
- package/dist-sdk/src/engine/tf/model.d.ts +8 -1
- package/dist-sdk/src/engine/tf/model.js +4 -0
- package/dist-sdk/src/engine/tf/parse.js +13 -2
- package/dist-sdk/src/engine/tf/render.js +4 -0
- package/dist-sdk/src/engine/workspace/authoring-layout.js +4 -2
- package/dist-sdk/src/entities/access-policy/build.d.ts +6 -16
- package/dist-sdk/src/entities/access-policy/build.js +2 -2
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +14 -40
- package/dist-sdk/src/entities/access-policy/from-tf.js +26 -85
- package/dist-sdk/src/entities/access-policy/principal.d.ts +39 -0
- package/dist-sdk/src/entities/access-policy/principal.js +13 -0
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +33 -6
- package/dist-sdk/src/entities/access-policy/to-tf.js +62 -60
- package/dist-sdk/src/entities/agent/build.d.ts +42 -11
- package/dist-sdk/src/entities/agent/build.js +40 -19
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +11 -1
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +180 -45
- package/dist-sdk/src/entities/agent/from-tf.d.ts +3 -1
- package/dist-sdk/src/entities/agent/from-tf.js +17 -12
- 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 +7 -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 +6 -2
- package/dist-sdk/src/entities/agent/to-tf.js +58 -9
- package/dist-sdk/src/entities/agent/tools.d.ts +97 -70
- package/dist-sdk/src/entities/agent/tools.js +63 -43
- 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-evaluation/build.d.ts +19 -0
- package/dist-sdk/src/entities/agent-evaluation/build.js +41 -0
- package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.d.ts +4 -0
- package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.js +30 -0
- package/dist-sdk/src/entities/agent-evaluation/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/agent-evaluation/from-tf.js +46 -0
- package/dist-sdk/src/entities/agent-evaluation/index.d.ts +1 -0
- package/dist-sdk/src/entities/agent-evaluation/index.js +1 -0
- package/dist-sdk/src/entities/agent-evaluation/module.d.ts +3 -0
- package/dist-sdk/src/entities/agent-evaluation/module.js +58 -0
- package/dist-sdk/src/entities/agent-evaluation/to-tf.d.ts +12 -0
- package/dist-sdk/src/entities/agent-evaluation/to-tf.js +35 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +25 -15
- package/dist-sdk/src/entities/agent-tool/from-tf.js +175 -43
- package/dist-sdk/src/entities/agent-tool/module.js +6 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +15 -7
- package/dist-sdk/src/entities/agent-tool/to-tf.js +169 -48
- package/dist-sdk/src/entities/agent-tool/types.d.ts +4 -6
- package/dist-sdk/src/entities/agent-tool/types.js +30 -29
- package/dist-sdk/src/entities/app/build.d.ts +214 -47
- package/dist-sdk/src/entities/app/build.js +128 -66
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +188 -8
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.d.ts +59 -0
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.js +70 -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 +20 -8
- package/dist-sdk/src/entities/app/index.js +16 -6
- package/dist-sdk/src/entities/app/module.js +29 -4
- package/dist-sdk/src/entities/app/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/app/to-tf.js +97 -7
- 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 +177 -95
- package/dist-sdk/src/entities/automation/build.js +164 -72
- package/dist-sdk/src/entities/automation/calculation-expression.d.ts +191 -0
- package/dist-sdk/src/entities/automation/calculation-expression.js +57 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +18 -9
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +18 -14
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +214 -311
- 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 +28 -0
- package/dist-sdk/src/entities/automation/from-tf.js +695 -182
- package/dist-sdk/src/entities/automation/index.d.ts +9 -10
- package/dist-sdk/src/entities/automation/index.js +11 -11
- package/dist-sdk/src/entities/automation/module.js +82 -8
- package/dist-sdk/src/entities/automation/operators.d.ts +32 -48
- package/dist-sdk/src/entities/automation/operators.js +10 -37
- package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +1 -1
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +1 -1
- package/dist-sdk/src/entities/automation/script-code.js +107 -28
- package/dist-sdk/src/entities/automation/serialize.js +1 -1
- package/dist-sdk/src/entities/automation/tasks.d.ts +167 -102
- package/dist-sdk/src/entities/automation/tasks.js +66 -13
- package/dist-sdk/src/entities/automation/to-tf.d.ts +44 -3
- package/dist-sdk/src/entities/automation/to-tf.js +607 -161
- package/dist-sdk/src/entities/automation/triggers.d.ts +33 -25
- package/dist-sdk/src/entities/automation/triggers.js +8 -2
- package/dist-sdk/src/entities/automation/types.d.ts +3 -2
- package/dist-sdk/src/entities/automation/types.js +3 -2
- package/dist-sdk/src/entities/chart/build.d.ts +95 -0
- package/dist-sdk/src/entities/chart/build.js +42 -0
- package/dist-sdk/src/entities/chart/from-tf.d.ts +55 -0
- package/dist-sdk/src/entities/chart/from-tf.js +269 -0
- package/dist-sdk/src/entities/chart/index.d.ts +4 -0
- package/dist-sdk/src/entities/chart/index.js +3 -0
- package/dist-sdk/src/entities/chart/module.d.ts +3 -0
- package/dist-sdk/src/entities/chart/module.js +61 -0
- package/dist-sdk/src/entities/chart/printer.d.ts +5 -0
- package/dist-sdk/src/entities/chart/printer.js +104 -0
- package/dist-sdk/src/entities/chart/to-tf.d.ts +15 -0
- package/dist-sdk/src/entities/chart/to-tf.js +150 -0
- package/dist-sdk/src/entities/chart/types.d.ts +53 -0
- package/dist-sdk/src/entities/chart/types.js +22 -0
- package/dist-sdk/src/entities/dashboard/build.d.ts +44 -0
- package/dist-sdk/src/entities/dashboard/build.js +16 -0
- package/dist-sdk/src/entities/dashboard/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/dashboard/from-tf.js +113 -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 +43 -0
- package/dist-sdk/src/entities/dashboard/to-tf.js +121 -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/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 +304 -0
- package/dist-sdk/src/entities/dynamic-layout/build.js +4 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +4 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.js +47 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +10 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +239 -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 +48 -38
- package/dist-sdk/src/entities/element/build.js +24 -33
- 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 +14 -7
- package/dist-sdk/src/entities/element/index.js +11 -5
- package/dist-sdk/src/entities/element/module.js +26 -5
- package/dist-sdk/src/entities/element/to-tf.d.ts +2 -1
- package/dist-sdk/src/entities/element/to-tf.js +64 -4
- package/dist-sdk/src/entities/field/build.d.ts +55 -27
- package/dist-sdk/src/entities/field/build.js +31 -6
- package/dist-sdk/src/entities/field/calc/aggregate.d.ts +52 -21
- package/dist-sdk/src/entities/field/calc/aggregate.js +59 -29
- package/dist-sdk/src/entities/field/calc/date.d.ts +78 -29
- package/dist-sdk/src/entities/field/calc/date.js +120 -29
- package/dist-sdk/src/entities/field/calc/index.d.ts +80 -85
- package/dist-sdk/src/entities/field/calc/index.js +82 -139
- package/dist-sdk/src/entities/field/calc/numeric.d.ts +8 -12
- package/dist-sdk/src/entities/field/calc/numeric.js +10 -27
- package/dist-sdk/src/entities/field/calc/runtime.d.ts +19 -2
- package/dist-sdk/src/entities/field/calc/runtime.js +79 -8
- package/dist-sdk/src/entities/field/calc/text.d.ts +32 -23
- package/dist-sdk/src/entities/field/calc/text.js +43 -31
- package/dist-sdk/src/entities/field/calc/types.d.ts +36 -81
- package/dist-sdk/src/entities/field/calc/types.js +1 -22
- package/dist-sdk/src/entities/field/calc.d.ts +71 -48
- package/dist-sdk/src/entities/field/calc.js +5 -15
- package/dist-sdk/src/entities/field/calculation-types.d.ts +6 -0
- package/dist-sdk/src/entities/field/calculation-types.js +49 -0
- package/dist-sdk/src/entities/field/from-tf.js +238 -13
- package/dist-sdk/src/entities/field/locals.d.ts +11 -3
- package/dist-sdk/src/entities/field/locals.js +15 -2
- package/dist-sdk/src/entities/field/module.d.ts +1 -0
- package/dist-sdk/src/entities/field/module.js +27 -7
- package/dist-sdk/src/entities/field/record-shape.d.ts +25 -11
- package/dist-sdk/src/entities/field/to-tf.d.ts +41 -2
- package/dist-sdk/src/entities/field/to-tf.js +314 -40
- package/dist-sdk/src/entities/field/types.d.ts +1 -1
- package/dist-sdk/src/entities/field/types.js +10 -1
- package/dist-sdk/src/entities/file-reader/build.d.ts +71 -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 +12 -10
- 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/cloud-link.js +4 -5
- package/dist-sdk/src/entities/org/email-alias.d.ts +2 -0
- package/dist-sdk/src/entities/org/email-alias.js +12 -0
- package/dist-sdk/src/entities/org/group.js +4 -5
- package/dist-sdk/src/entities/org/index.d.ts +2 -0
- package/dist-sdk/src/entities/org/index.js +2 -0
- package/dist-sdk/src/entities/org/phone-provider.d.ts +4 -0
- package/dist-sdk/src/entities/org/phone-provider.js +30 -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 +241 -0
- package/dist-sdk/src/entities/organization/build.js +165 -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 +21 -0
- package/dist-sdk/src/entities/organization/to-tf.d.ts +7 -0
- package/dist-sdk/src/entities/organization/to-tf.js +154 -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 +56 -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 +88 -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 +32 -0
- package/dist-sdk/src/entities/relationship/to-tf.js +145 -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 +32 -0
- package/dist-sdk/src/entities/service-account/to-tf.js +103 -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/context.d.ts +25 -24
- package/dist-sdk/src/entities/shared/context.js +36 -35
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +30 -81
- package/dist-sdk/src/entities/shared/filters/ast.js +6 -2
- package/dist-sdk/src/entities/shared/filters/index.d.ts +95 -206
- package/dist-sdk/src/entities/shared/filters/index.js +196 -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/shared/foreign-ref.d.ts +14 -0
- package/dist-sdk/src/entities/shared/foreign-ref.js +12 -0
- package/dist-sdk/src/entities/shared/ref.d.ts +26 -11
- package/dist-sdk/src/entities/shared/ref.js +8 -3
- package/dist-sdk/src/entities/shared/types/common.d.ts +2 -2
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +1 -1
- package/dist-sdk/src/entities/shared/types/field-types.js +1 -1
- package/dist-sdk/src/entities/skill/build.d.ts +4 -4
- package/dist-sdk/src/entities/skill/build.js +6 -5
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +11 -1
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +100 -39
- package/dist-sdk/src/entities/skill/index.d.ts +3 -2
- package/dist-sdk/src/entities/skill/index.js +3 -2
- package/dist-sdk/src/entities/skill/module.js +8 -2
- package/dist-sdk/src/entities/skill/to-tf.d.ts +6 -2
- package/dist-sdk/src/entities/skill/to-tf.js +20 -2
- package/dist-sdk/src/entities/skill/tools.d.ts +47 -31
- package/dist-sdk/src/entities/skill/tools.js +37 -23
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +17 -1
- package/dist-sdk/src/entities/skill-tool/from-tf.js +118 -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 +100 -48
- 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 +41 -26
- package/dist-sdk/src/entities/table/catalog-render.js +15 -1
- 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 +222 -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/build.d.ts +46 -0
- package/dist-sdk/src/entities/view/build.js +19 -0
- package/dist-sdk/src/entities/view/from-tf.d.ts +7 -2
- package/dist-sdk/src/entities/view/from-tf.js +264 -30
- package/dist-sdk/src/entities/view/module.d.ts +6 -13
- package/dist-sdk/src/entities/view/module.js +12 -15
- package/dist-sdk/src/entities/view/sharing.d.ts +10 -0
- package/dist-sdk/src/entities/view/sharing.js +6 -0
- package/dist-sdk/src/entities/view/to-tf.d.ts +56 -12
- package/dist-sdk/src/entities/view/to-tf.js +192 -20
- package/dist-sdk/src/entities/view/types.d.ts +8 -0
- package/dist-sdk/src/entities/view/types.js +46 -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 +15 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.js +97 -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 +45 -0
- package/dist-sdk/src/entities/widget/to-tf.js +206 -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 +12 -1
- package/dist-sdk/src/graph/index.js +8 -19
- package/dist-sdk/src/graph/modules.js +35 -1
- package/dist-sdk/src/graph/types.d.ts +106 -7
- package/dist-sdk/src/internal/safe-identifier.d.ts +4 -0
- package/dist-sdk/src/internal/safe-identifier.js +13 -0
- package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
- package/dist-sdk/src/internal/sdk-package.js +5 -2
- package/package.json +39 -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 → datamine/build.js} +0 -0
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { isValidToolName } from "../agent-tool/types.js";
|
|
2
|
+
function targetOf(opts) {
|
|
3
|
+
return ("app" in opts && opts.app !== undefined ? opts.app : opts.element);
|
|
4
|
+
}
|
|
5
|
+
function serializeRunAs(runAs) {
|
|
6
|
+
if ("currentUser" in runAs)
|
|
7
|
+
return { currentUser: true };
|
|
8
|
+
if ("publisher" in runAs)
|
|
9
|
+
return { publisher: true };
|
|
10
|
+
return { serviceAccount: runAs.serviceAccount };
|
|
11
|
+
}
|
|
2
12
|
function common(opts) {
|
|
3
13
|
// Authoring-layer name check (mirrors entities/agent/tools.ts's common()) —
|
|
4
14
|
// every tool factory routes through here, so this is the single
|
|
@@ -12,14 +22,17 @@ function common(opts) {
|
|
|
12
22
|
description: opts.description,
|
|
13
23
|
status: opts.status ?? "ACTIVE",
|
|
14
24
|
...(opts.startMessage !== undefined ? { startMessage: opts.startMessage } : {}),
|
|
15
|
-
...(opts.runAs !== undefined ? { runAs: opts.runAs } : {}),
|
|
25
|
+
...(opts.runAs !== undefined ? { runAs: serializeRunAs(opts.runAs) } : {}),
|
|
16
26
|
};
|
|
17
27
|
}
|
|
28
|
+
function tool(value) {
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
18
31
|
function searchFieldToken(f) {
|
|
19
32
|
if ("fieldId" in f) {
|
|
20
33
|
// Raw platform id fallback — see SkillSearchRawIdField's comment.
|
|
21
34
|
return {
|
|
22
|
-
fieldId: f.fieldId,
|
|
35
|
+
fieldId: f.fieldId.value,
|
|
23
36
|
name: f.name,
|
|
24
37
|
description: f.description,
|
|
25
38
|
};
|
|
@@ -35,10 +48,11 @@ function recordFieldToken(f) {
|
|
|
35
48
|
if ("fieldId" in f) {
|
|
36
49
|
// Raw platform id fallback — see SkillRecordRawIdField's comment.
|
|
37
50
|
return {
|
|
38
|
-
fieldId: f.fieldId,
|
|
51
|
+
fieldId: f.fieldId.value,
|
|
39
52
|
name: f.name,
|
|
40
53
|
description: f.description,
|
|
41
54
|
required: f.required,
|
|
55
|
+
...(f.defaultValue !== undefined ? { defaultValue: f.defaultValue } : {}),
|
|
42
56
|
};
|
|
43
57
|
}
|
|
44
58
|
return {
|
|
@@ -68,63 +82,63 @@ export function skillAutomation(opts) {
|
|
|
68
82
|
workflowPropertyName,
|
|
69
83
|
displayName: spec?.name ?? workflowPropertyName,
|
|
70
84
|
}));
|
|
71
|
-
return {
|
|
85
|
+
return tool({
|
|
72
86
|
automation: {
|
|
73
87
|
...common(opts),
|
|
74
88
|
automationId: opts.automation,
|
|
75
89
|
...(inputs.length > 0 ? { inputs } : {}),
|
|
76
90
|
...(outputs.length > 0 ? { outputs } : {}),
|
|
77
91
|
},
|
|
78
|
-
};
|
|
92
|
+
});
|
|
79
93
|
}
|
|
80
|
-
export function
|
|
81
|
-
return {
|
|
94
|
+
export function skillSearchRecords(opts) {
|
|
95
|
+
return tool({
|
|
82
96
|
searchAspect: {
|
|
83
97
|
...common(opts),
|
|
84
|
-
aspectId: opts
|
|
98
|
+
aspectId: targetOf(opts),
|
|
85
99
|
queryDescription: opts.queryDescription,
|
|
86
|
-
fields: opts.fields.map(searchFieldToken),
|
|
100
|
+
...(opts.fields !== undefined ? { fields: opts.fields.map(searchFieldToken) } : {}),
|
|
87
101
|
...(opts.limit !== undefined ? { limit: opts.limit } : {}),
|
|
88
102
|
},
|
|
89
|
-
};
|
|
103
|
+
});
|
|
90
104
|
}
|
|
91
105
|
export function skillSearchTable(opts) {
|
|
92
|
-
return {
|
|
106
|
+
return tool({
|
|
93
107
|
searchTable: {
|
|
94
108
|
...common(opts),
|
|
95
|
-
aspectId: opts
|
|
109
|
+
aspectId: targetOf(opts),
|
|
96
110
|
searchTableId: opts.table,
|
|
97
111
|
queryDescription: opts.queryDescription,
|
|
98
112
|
fields: opts.fields.map(searchFieldToken),
|
|
99
113
|
...(opts.limit !== undefined ? { limit: opts.limit } : {}),
|
|
100
114
|
},
|
|
101
|
-
};
|
|
115
|
+
});
|
|
102
116
|
}
|
|
103
117
|
export function skillCreateRecord(opts) {
|
|
104
|
-
return {
|
|
118
|
+
return tool({
|
|
105
119
|
createRecord: {
|
|
106
120
|
...common(opts),
|
|
107
|
-
aspectId: opts
|
|
108
|
-
fields: opts.fields.map(recordFieldToken),
|
|
121
|
+
aspectId: targetOf(opts),
|
|
122
|
+
fields: (opts.fields ?? []).map(recordFieldToken),
|
|
109
123
|
},
|
|
110
|
-
};
|
|
124
|
+
});
|
|
111
125
|
}
|
|
112
126
|
export function skillUpdateRecord(opts) {
|
|
113
|
-
return {
|
|
127
|
+
return tool({
|
|
114
128
|
updateRecord: {
|
|
115
129
|
...common(opts),
|
|
116
|
-
aspectId: opts
|
|
117
|
-
fields: opts.fields.map(recordFieldToken),
|
|
130
|
+
aspectId: targetOf(opts),
|
|
131
|
+
fields: (opts.fields ?? []).map(recordFieldToken),
|
|
118
132
|
handleDescription: opts.handleDescription,
|
|
119
133
|
},
|
|
120
|
-
};
|
|
134
|
+
});
|
|
121
135
|
}
|
|
122
136
|
export function skillRunAgent(opts) {
|
|
123
|
-
return {
|
|
137
|
+
return tool({
|
|
124
138
|
runAgent: {
|
|
125
139
|
...common(opts),
|
|
126
140
|
targetAgentId: opts.agent,
|
|
127
141
|
workerTaskPrompt: opts.workerTaskPrompt,
|
|
128
142
|
},
|
|
129
|
-
};
|
|
143
|
+
});
|
|
130
144
|
}
|
|
@@ -20,6 +20,7 @@ export interface NormalizedSkillToolField {
|
|
|
20
20
|
readonly name?: string;
|
|
21
21
|
readonly description?: string;
|
|
22
22
|
readonly required?: boolean;
|
|
23
|
+
readonly defaultValue?: string;
|
|
23
24
|
}
|
|
24
25
|
export type NormalizedSkillToolTarget = {
|
|
25
26
|
readonly kind: "self";
|
|
@@ -33,7 +34,7 @@ export type NormalizedSkillToolTarget = {
|
|
|
33
34
|
readonly name: string;
|
|
34
35
|
};
|
|
35
36
|
export interface NormalizedSkillTool {
|
|
36
|
-
readonly typeKey: "createRecord" | "searchAspect" | "updateRecord" | "runAgent" | "automation";
|
|
37
|
+
readonly typeKey: "createRecord" | "searchAspect" | "searchTable" | "updateRecord" | "runAgent" | "automation";
|
|
37
38
|
readonly name: string;
|
|
38
39
|
readonly description: string;
|
|
39
40
|
/** Present only when it differs from the default ("ACTIVE"). */
|
|
@@ -47,6 +48,9 @@ export interface NormalizedSkillTool {
|
|
|
47
48
|
readonly targetAgentKey?: string;
|
|
48
49
|
readonly workerTaskPrompt?: string;
|
|
49
50
|
readonly automationKey?: string;
|
|
51
|
+
readonly searchTableKey?: string;
|
|
52
|
+
/** Foreign table lookup name when search_table_id is data.elementum_search_table. */
|
|
53
|
+
readonly searchTableName?: string;
|
|
50
54
|
readonly inputs?: readonly {
|
|
51
55
|
readonly parameterName: string;
|
|
52
56
|
readonly displayName?: string;
|
|
@@ -59,6 +63,18 @@ export interface NormalizedSkillTool {
|
|
|
59
63
|
readonly description?: string;
|
|
60
64
|
}[];
|
|
61
65
|
readonly runAs?: AgentToolRunAs;
|
|
66
|
+
/**
|
|
67
|
+
* Names of the target automation's REQUIRED onDemand trigger parameters
|
|
68
|
+
* that this tool's own `inputs` (above) has no mapping for — the platform
|
|
69
|
+
* doesn't enforce that binding at tool-creation time, so a live tool can
|
|
70
|
+
* genuinely have none (edk#483: a Deloitte "sentiment-analysis" skill hit
|
|
71
|
+
* this). `AutomationToolV2` requires every such parameter to be mapped, so
|
|
72
|
+
* the printer needs this to know a type-only escape hatch is required —
|
|
73
|
+
* but the escape hatch must NOT be confused with authored data: unlike
|
|
74
|
+
* `inputs`, this is never fed into `skillToTf`/round-tripped to HCL. See
|
|
75
|
+
* `printTool`'s handling of `typeKey === "automation"`.
|
|
76
|
+
*/
|
|
77
|
+
readonly missingRequiredInputs?: readonly string[];
|
|
62
78
|
}
|
|
63
79
|
export interface SkillToolOwner {
|
|
64
80
|
/** The owning app's resource type + tfLabel. */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* skill or app resource types. Mirrors `entities/agent-tool/from-tf.ts`.
|
|
6
6
|
*/
|
|
7
7
|
import { EntityTfError } from "../../engine/entity.js";
|
|
8
|
-
import { optionalString, resourceRefLabel } from "../../engine/pull/context.js";
|
|
8
|
+
import { dataRefLabel, optionalString, resourceRefLabel } from "../../engine/pull/context.js";
|
|
9
9
|
import { isTfExpr, scopedLabelToBagKey } from "../../engine/tf/index.js";
|
|
10
10
|
import { resolveToolFieldKey } from "../shared/tool-field-ref.js";
|
|
11
11
|
import { KNOWN_SKILL_TOOL_ATTRS, SKILL_TOOL_SUB_TYPE_BY_RESOURCE, UNAUTHORABLE_SKILL_TOOL_ATTRS, } from "./types.js";
|
|
@@ -52,12 +52,48 @@ export function skillToolFromTf(block, owner, ctx) {
|
|
|
52
52
|
else if (runAsValue === "publisher")
|
|
53
53
|
runAs = { publisher: true };
|
|
54
54
|
else if (runAsValue === "service_account") {
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
57
|
-
|
|
55
|
+
const serviceAccountLabel = dataRefLabel(attrs["service_account_id"], "elementum_service_account");
|
|
56
|
+
if (serviceAccountLabel !== undefined) {
|
|
57
|
+
const serviceAccountName = ctx.dataName("elementum_service_account", serviceAccountLabel);
|
|
58
|
+
if (serviceAccountName !== undefined && serviceAccountName !== "") {
|
|
59
|
+
runAs = {
|
|
60
|
+
serviceAccount: {
|
|
61
|
+
__kind: "serviceAccount",
|
|
62
|
+
appRefName: owner.appLabel,
|
|
63
|
+
name: serviceAccountName,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
ctx.diagnostics.push(`${where}: service_account_id references data.elementum_service_account.${serviceAccountLabel}, but the stream has no matching named data block; dropped`);
|
|
69
|
+
}
|
|
58
70
|
}
|
|
59
71
|
else {
|
|
60
|
-
|
|
72
|
+
const resourceLabel = resourceRefLabel(attrs["service_account_id"], "elementum_service_account");
|
|
73
|
+
const imported = typeof attrs["service_account_id"] === "string"
|
|
74
|
+
? ctx.importedResource?.(attrs["service_account_id"])
|
|
75
|
+
: undefined;
|
|
76
|
+
const account = resourceLabel !== undefined
|
|
77
|
+
? ctx.resourceByAddress?.(`elementum_service_account.${resourceLabel}`)
|
|
78
|
+
: imported?.type === "elementum_service_account" ? imported : undefined;
|
|
79
|
+
const explicitName = account?.attrs["name"];
|
|
80
|
+
const firstName = account?.attrs["first_name"];
|
|
81
|
+
const lastName = account?.attrs["last_name"];
|
|
82
|
+
const serviceAccountName = typeof explicitName === "string" && explicitName !== ""
|
|
83
|
+
? explicitName
|
|
84
|
+
: typeof firstName === "string" && typeof lastName === "string" ? `${firstName} ${lastName}` : undefined;
|
|
85
|
+
if (serviceAccountName !== undefined) {
|
|
86
|
+
runAs = {
|
|
87
|
+
serviceAccount: {
|
|
88
|
+
__kind: "serviceAccount",
|
|
89
|
+
appRefName: owner.appLabel,
|
|
90
|
+
name: serviceAccountName,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
ctx.diagnostics.push(`${where}: service_account_id is not a named data.elementum_service_account reference; use a serviceAccountRef({ app, name }); dropped`);
|
|
96
|
+
}
|
|
61
97
|
}
|
|
62
98
|
}
|
|
63
99
|
else if (runAsValue !== undefined) {
|
|
@@ -110,6 +146,45 @@ export function skillToolFromTf(block, owner, ctx) {
|
|
|
110
146
|
...(typeof rec["required"] === "boolean" && { required: rec["required"] }),
|
|
111
147
|
});
|
|
112
148
|
}
|
|
149
|
+
// The tool's own `inputs` attribute can be genuinely absent even when the
|
|
150
|
+
// target automation's onDemand trigger declares required parameters —
|
|
151
|
+
// the platform doesn't enforce that binding at tool-creation time (a
|
|
152
|
+
// live Deloitte "sentiment-analysis" skill hit this: a `run_automation`
|
|
153
|
+
// tool with zero `inputs` targeting an automation whose trigger requires
|
|
154
|
+
// one). `AutomationToolV2` (entities/agent/tools.ts) requires every such
|
|
155
|
+
// parameter to be mapped, so printing nothing here would emit a
|
|
156
|
+
// `skillAutomation({...})` call that can't compile (edk#483). This must
|
|
157
|
+
// NOT be "fixed" by inventing an `inputs` entry that isn't really on the
|
|
158
|
+
// platform — `elementum build` re-serializes whatever `inputs` prints
|
|
159
|
+
// straight back to HCL, so a fabricated entry becomes a genuine plan
|
|
160
|
+
// diff proposing to write fake data onto a live tool (caught live: a
|
|
161
|
+
// rebuilt `run_automation` tool proposed adding an `inputs` block with a
|
|
162
|
+
// literal "TODO: ..." description). Only RECORD which required
|
|
163
|
+
// parameters are unmapped; `printTool` (print-skill-v2.ts) decides how
|
|
164
|
+
// to keep the generated file compiling without asserting any of this as
|
|
165
|
+
// real authored data.
|
|
166
|
+
const mappedParams = new Set(inputs.map((i) => i.parameterName));
|
|
167
|
+
// Found by following the trigger's OWN `automation` reference (mirrors
|
|
168
|
+
// `automationFromTfDocument`'s `references(block.attrs.automation, ...)`
|
|
169
|
+
// in entities/automation/from-tf.ts) rather than guessing that the
|
|
170
|
+
// trigger shares its automation's Terraform label — that label equality
|
|
171
|
+
// holds by observed export convention, not by contract, and a silent
|
|
172
|
+
// miss here would reproduce the exact tsc-failing call this fix is for,
|
|
173
|
+
// with no diagnostic to explain why.
|
|
174
|
+
const trigger = ctx.resourcesOfType?.("elementum_on_demand_trigger").find((block) => {
|
|
175
|
+
const ref = block.attrs["automation"];
|
|
176
|
+
return isTfExpr(ref) && ref.$expr === "resource-attr" && ref.type === "elementum_automation" && ref.label === automationLabel;
|
|
177
|
+
});
|
|
178
|
+
const missingRequiredInputs = [];
|
|
179
|
+
for (const item of Array.isArray(trigger?.attrs["parameters"]) ? trigger.attrs["parameters"] : []) {
|
|
180
|
+
if (typeof item !== "object" || item === null || Array.isArray(item) || isTfExpr(item))
|
|
181
|
+
continue;
|
|
182
|
+
const rec = item;
|
|
183
|
+
if (rec["required"] !== true || typeof rec["name"] !== "string" || mappedParams.has(rec["name"]))
|
|
184
|
+
continue;
|
|
185
|
+
ctx.diagnostics.push(`${where}: target automation's onDemand trigger requires "${rec["name"]}", but this tool has no input mapping for it — printed source will need a human-authored inputs entry before this tool can be adopted`);
|
|
186
|
+
missingRequiredInputs.push(rec["name"]);
|
|
187
|
+
}
|
|
113
188
|
const outputs = [];
|
|
114
189
|
for (const item of Array.isArray(attrs["outputs"]) ? attrs["outputs"] : []) {
|
|
115
190
|
if (typeof item !== "object" || item === null || Array.isArray(item) || isTfExpr(item))
|
|
@@ -131,8 +206,39 @@ export function skillToolFromTf(block, owner, ctx) {
|
|
|
131
206
|
automationKey: scopedLabelToBagKey(owner.ownerTfLabel, automationLabel),
|
|
132
207
|
...(inputs.length > 0 && { inputs }),
|
|
133
208
|
...(outputs.length > 0 && { outputs }),
|
|
209
|
+
...(missingRequiredInputs.length > 0 && { missingRequiredInputs }),
|
|
134
210
|
};
|
|
135
211
|
}
|
|
212
|
+
let searchTableKey;
|
|
213
|
+
let searchTableName;
|
|
214
|
+
if (subType.typeKey === "searchTable") {
|
|
215
|
+
const value = attrs["search_table_id"];
|
|
216
|
+
const resourceTypes = ["elementum_ai_search_table", "elementum_linked_ai_search_table", "elementum_table_search_table"];
|
|
217
|
+
const matched = resourceTypes
|
|
218
|
+
.map((type) => ({ type, label: resourceRefLabel(value, type) }))
|
|
219
|
+
.find((candidate) => candidate.label !== undefined);
|
|
220
|
+
if (matched?.label !== undefined) {
|
|
221
|
+
// A managed or linked search table is owned by an ELEMENT, so its label
|
|
222
|
+
// carries the `elements_<ns>_` prefix — decoding it with app scope leaves
|
|
223
|
+
// the prefix in place and camel-cases the whole label into a bag key that
|
|
224
|
+
// matches nothing. The table variant keeps its existing app-scope
|
|
225
|
+
// handling: a table-owned search table reached through a tool is not
|
|
226
|
+
// modelled end to end yet.
|
|
227
|
+
const scope = matched.type === "elementum_table_search_table" ? "app" : "element";
|
|
228
|
+
searchTableKey = scopedLabelToBagKey(owner.ownerTfLabel, matched.label, scope);
|
|
229
|
+
}
|
|
230
|
+
else if (isTfExpr(value) && value.$expr === "data-attr" && value.type === "elementum_search_table") {
|
|
231
|
+
searchTableName = ctx.dataName(value.type, value.label);
|
|
232
|
+
if (searchTableName === undefined) {
|
|
233
|
+
ctx.diagnostics.push(`${where}: search_table_id references data.${value.type}.${value.label} without a matching name lookup; skipped`);
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
ctx.diagnostics.push(`${where}: search_table_id is not a supported search-table resource reference; skipped`);
|
|
239
|
+
return undefined;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
136
242
|
// Target: the owning app's resource ref = self; a data.elementum_app ref =
|
|
137
243
|
// a foreign app, resolved to its display name via the stream's data block.
|
|
138
244
|
const targetAttr = attrs["target_id"];
|
|
@@ -201,6 +307,8 @@ export function skillToolFromTf(block, owner, ctx) {
|
|
|
201
307
|
// authored source.
|
|
202
308
|
...((subType.typeKey === "createRecord" || subType.typeKey === "updateRecord") &&
|
|
203
309
|
typeof rec["required"] === "boolean" && { required: rec["required"] }),
|
|
310
|
+
...((subType.typeKey === "createRecord" || subType.typeKey === "updateRecord") &&
|
|
311
|
+
typeof rec["default_value"] === "string" && { defaultValue: rec["default_value"] }),
|
|
204
312
|
});
|
|
205
313
|
}
|
|
206
314
|
if (fields.length === 0)
|
|
@@ -209,10 +317,10 @@ export function skillToolFromTf(block, owner, ctx) {
|
|
|
209
317
|
else if (rawFields !== undefined) {
|
|
210
318
|
ctx.diagnostics.push(`${where}: fields is not a list; dropped`);
|
|
211
319
|
}
|
|
212
|
-
if (subType.typeKey === "searchAspect" && attrs["filter"] !== undefined) {
|
|
320
|
+
if ((subType.typeKey === "searchAspect" || subType.typeKey === "searchTable") && attrs["filter"] !== undefined) {
|
|
213
321
|
ctx.diagnostics.push(`${where}: filter is not supported on the terraform path yet; a rebuilt stream will omit it`);
|
|
214
322
|
}
|
|
215
|
-
if (subType.typeKey === "searchAspect" && attrs["filter_variables"] !== undefined) {
|
|
323
|
+
if ((subType.typeKey === "searchAspect" || subType.typeKey === "searchTable") && attrs["filter_variables"] !== undefined) {
|
|
216
324
|
ctx.diagnostics.push(`${where}: filter_variables are not supported on the terraform path yet; a rebuilt stream will omit them`);
|
|
217
325
|
}
|
|
218
326
|
return {
|
|
@@ -220,9 +328,11 @@ export function skillToolFromTf(block, owner, ctx) {
|
|
|
220
328
|
...common,
|
|
221
329
|
target,
|
|
222
330
|
...(fields !== undefined && { fields }),
|
|
223
|
-
...(subType.typeKey === "searchAspect" && {
|
|
331
|
+
...((subType.typeKey === "searchAspect" || subType.typeKey === "searchTable") && {
|
|
224
332
|
queryDescription: optionalString(attrs, "query_description", where, ctx) ?? "",
|
|
225
333
|
}),
|
|
334
|
+
...(searchTableKey !== undefined && { searchTableKey }),
|
|
335
|
+
...(searchTableName !== undefined && { searchTableName }),
|
|
226
336
|
...(typeof attrs["result_limit"] === "number" && { limit: attrs["result_limit"] }),
|
|
227
337
|
...(subType.typeKey === "updateRecord" && {
|
|
228
338
|
handleDescription: optionalString(attrs, "handle_description", where, ctx) ?? "",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** The skill-tool entity's registry entry (see src/graph/). */
|
|
2
2
|
import { NO_CANVAS, NO_CATALOG, NO_DATA, NO_LIFECYCLE } from "../../graph/types.js";
|
|
3
|
+
import { FIELD_DATA_RESOURCE_TYPE } from "../field/module.js";
|
|
3
4
|
import { SKILL_TOOL_SUB_TYPES } from "./types.js";
|
|
4
5
|
export const skillToolModule = {
|
|
5
6
|
kind: "skill-tool",
|
|
@@ -18,4 +19,12 @@ export const skillToolModule = {
|
|
|
18
19
|
lifecycle: NO_LIFECYCLE,
|
|
19
20
|
canvas: NO_CANVAS,
|
|
20
21
|
catalog: NO_CATALOG,
|
|
22
|
+
roundtrip: {
|
|
23
|
+
referenceAliases: [],
|
|
24
|
+
resolvedDataReferences: [{
|
|
25
|
+
attribute: "fields",
|
|
26
|
+
nestedAttribute: "field_id",
|
|
27
|
+
dataType: FIELD_DATA_RESOURCE_TYPE,
|
|
28
|
+
}],
|
|
29
|
+
},
|
|
21
30
|
};
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* (`skill_id`) — this module never names the skill or app resource types.
|
|
7
7
|
* Mirrors `entities/agent-tool/to-tf.ts`.
|
|
8
8
|
*/
|
|
9
|
+
import { type WorkspaceAspect } from "../../engine/build/context.js";
|
|
9
10
|
import { type TfBlock, type TfValue } from "../../engine/tf/index.js";
|
|
10
11
|
export interface SkillToolToTfContext {
|
|
11
12
|
/** The owning app's refName + tfLabel (namespace) — self-target detection + app_id. */
|
|
@@ -25,8 +26,12 @@ export interface SkillToolToTfContext {
|
|
|
25
26
|
foreignAppRef(tfLabel: string, name: string): void;
|
|
26
27
|
/** Records a foreign-ELEMENT data lookup for data.tf (board issue #42). */
|
|
27
28
|
foreignElementRef(tfLabel: string, name: string): void;
|
|
28
|
-
/** Records
|
|
29
|
+
/** Records an object-scoped data lookup owned by a foreign app/element. */
|
|
29
30
|
foreignFieldRef(type: string, tfLabel: string, objectId: TfValue, name: string): void;
|
|
31
|
+
/** App/element roots authored in this same workspace. */
|
|
32
|
+
readonly workspaceAspects?: ReadonlyMap<string, WorkspaceAspect>;
|
|
33
|
+
/** Records an app-scoped service-account lookup by name. */
|
|
34
|
+
serviceAccountRef?(tfLabel: string, name: string): TfValue | void;
|
|
30
35
|
/** Degradations land here — reported by the caller, never silent. */
|
|
31
36
|
readonly diagnostics: string[];
|
|
32
37
|
}
|
|
@@ -6,15 +6,48 @@
|
|
|
6
6
|
* (`skill_id`) — this module never names the skill or app resource types.
|
|
7
7
|
* Mirrors `entities/agent-tool/to-tf.ts`.
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { workspaceAspectKey } from "../../engine/build/context.js";
|
|
10
|
+
import { appScopedResourceLabel, expr, sanitizeName, scopedResourceLabel, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
10
11
|
import { fieldRefToTfValue } from "../field/to-tf.js";
|
|
11
12
|
import { SKILL_TOOL_SUB_TYPE_BY_TYPE_KEY } from "./types.js";
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
function serviceAccountIdValue(token, where, ctx) {
|
|
14
|
+
if (token.__kind !== "serviceAccount" || token.name === undefined || token.name === "") {
|
|
15
|
+
ctx.diagnostics.push(`${where}: serviceAccount must be a serviceAccountRef({ app, name }); dropped`);
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
if (token.appRefName !== ctx.appRefName) {
|
|
19
|
+
ctx.diagnostics.push(`${where}: service account "${token.name}" belongs to app "${token.appRefName ?? ""}", not owning app "${ctx.appRefName}"; dropped`);
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
const tfLabel = appScopedResourceLabel(ctx.appTfLabel, sanitizeName(token.name));
|
|
23
|
+
if (ctx.serviceAccountRef === undefined) {
|
|
24
|
+
ctx.diagnostics.push(`${where}: build context cannot materialize a service-account lookup; dropped`);
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
return ctx.serviceAccountRef(tfLabel, token.name) ??
|
|
28
|
+
expr.dataAttr("elementum_service_account", tfLabel, ["id"]);
|
|
29
|
+
}
|
|
30
|
+
/** authoring AppOrElementRef token → target_id value (workspace resource or foreign data ref). */
|
|
31
|
+
function targetIdValue(token, ctx) {
|
|
14
32
|
const refName = token.refName ?? "";
|
|
15
33
|
const kind = token.__kind === "element" ? "element" : "app";
|
|
16
34
|
if (kind === "app" && refName === ctx.appRefName) {
|
|
17
|
-
return {
|
|
35
|
+
return {
|
|
36
|
+
value: expr.resourceAttr("elementum_app", ctx.appTfLabel, ["id"]),
|
|
37
|
+
refName,
|
|
38
|
+
kind,
|
|
39
|
+
localTfLabel: ctx.appTfLabel,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const sibling = ctx.workspaceAspects?.get(workspaceAspectKey(kind, refName));
|
|
43
|
+
if (sibling !== undefined) {
|
|
44
|
+
const resourceType = kind === "element" ? "elementum_element" : "elementum_app";
|
|
45
|
+
return {
|
|
46
|
+
value: expr.resourceAttr(resourceType, sibling.tfLabel, ["id"]),
|
|
47
|
+
refName,
|
|
48
|
+
kind,
|
|
49
|
+
localTfLabel: sibling.tfLabel,
|
|
50
|
+
};
|
|
18
51
|
}
|
|
19
52
|
// ei derives foreign-app/foreign-element data labels from the display NAME.
|
|
20
53
|
const name = token.name ?? refName;
|
|
@@ -22,10 +55,20 @@ function resolveTarget(token, ctx) {
|
|
|
22
55
|
// Board issue #42: an aspect token can be an element, not just an app.
|
|
23
56
|
if (kind === "element") {
|
|
24
57
|
ctx.foreignElementRef(tfLabel, name);
|
|
25
|
-
return {
|
|
58
|
+
return {
|
|
59
|
+
value: expr.dataAttr("elementum_element", tfLabel, ["id"]),
|
|
60
|
+
refName,
|
|
61
|
+
kind,
|
|
62
|
+
foreignTfLabel: tfLabel,
|
|
63
|
+
};
|
|
26
64
|
}
|
|
27
65
|
ctx.foreignAppRef(tfLabel, name);
|
|
28
|
-
return {
|
|
66
|
+
return {
|
|
67
|
+
value: expr.dataAttr("elementum_app", tfLabel, ["id"]),
|
|
68
|
+
refName,
|
|
69
|
+
kind,
|
|
70
|
+
foreignTfLabel: tfLabel,
|
|
71
|
+
};
|
|
29
72
|
}
|
|
30
73
|
/**
|
|
31
74
|
* A field belonging to the tool's target aspect, when that target is
|
|
@@ -36,7 +79,8 @@ function resolveTarget(token, ctx) {
|
|
|
36
79
|
*/
|
|
37
80
|
function foreignTargetFieldRefValue(token, refName, target, ctx) {
|
|
38
81
|
const fieldName = token.name ?? refName;
|
|
39
|
-
const
|
|
82
|
+
const ownerLabel = target.foreignTfLabel ?? sanitizeName(target.refName);
|
|
83
|
+
const fieldLabel = `${target.kind}_${ownerLabel}_${tsLabelToTfLabel(refName)}`;
|
|
40
84
|
ctx.foreignFieldRef("elementum_field", fieldLabel, target.value, fieldName);
|
|
41
85
|
return expr.dataAttr("elementum_field", fieldLabel, ["id"]);
|
|
42
86
|
}
|
|
@@ -47,37 +91,23 @@ function foreignTargetFieldRefValue(token, refName, target, ctx) {
|
|
|
47
91
|
*/
|
|
48
92
|
function fieldRefValue(token, where, ctx, target) {
|
|
49
93
|
const refName = token.refName ?? "";
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// `.ref()` on ITS OWN app/element stamps `parent` (as a self-reference)
|
|
54
|
-
// without `parentKind` at all (a real, common shape — see
|
|
55
|
-
// `agent-tool/to-tf.ts`'s identical check for the full rationale), so
|
|
56
|
-
// only a parent naming something OTHER than the tool's owning app is
|
|
57
|
-
// genuinely ambiguous.
|
|
58
|
-
if (token.parent !== undefined && token.parent !== ctx.appRefName && token.parentKind === undefined) {
|
|
59
|
-
ctx.diagnostics.push(`${where}: field "${refName}" has a parent ("${token.parent}") but no parentKind — incomplete foreign-field provenance; dropped`);
|
|
60
|
-
return undefined;
|
|
61
|
-
}
|
|
62
|
-
const parent = token.parent ?? ctx.appRefName;
|
|
63
|
-
const parentKind = token.parentKind ?? "app";
|
|
64
|
-
if (parent !== target.refName || parentKind !== target.kind) {
|
|
65
|
-
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`);
|
|
66
|
-
return undefined;
|
|
67
|
-
}
|
|
68
|
-
if (!target.isSelf)
|
|
69
|
-
return foreignTargetFieldRefValue(token, refName, target, ctx);
|
|
94
|
+
if (token.parent !== undefined && token.parent !== ctx.appRefName && token.parentKind === undefined) {
|
|
95
|
+
ctx.diagnostics.push(`${where}: field "${refName}" has a parent ("${token.parent}") but no parentKind — incomplete foreign-field provenance; dropped`);
|
|
96
|
+
return undefined;
|
|
70
97
|
}
|
|
71
|
-
|
|
72
|
-
|
|
98
|
+
const parent = token.parent ?? ctx.appRefName;
|
|
99
|
+
const parentKind = token.parentKind ?? "app";
|
|
100
|
+
if (parent !== target.refName || parentKind !== target.kind) {
|
|
101
|
+
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`);
|
|
73
102
|
return undefined;
|
|
74
103
|
}
|
|
104
|
+
if (target.localTfLabel === undefined) {
|
|
105
|
+
return foreignTargetFieldRefValue(token, refName, target, ctx);
|
|
106
|
+
}
|
|
75
107
|
const authoringType = token.fieldType ?? "";
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
// agent-tool/to-tf.ts's equivalent already passes appTfLabel.
|
|
80
|
-
const ref = refName === "" ? undefined : fieldRefToTfValue(authoringType, refName, ctx.appTfLabel);
|
|
108
|
+
const ref = refName === ""
|
|
109
|
+
? undefined
|
|
110
|
+
: fieldRefToTfValue(authoringType, refName, target.localTfLabel, target.kind);
|
|
81
111
|
if (ref === undefined) {
|
|
82
112
|
ctx.diagnostics.push(`${where}: field token "${refName}" has no terraform field resource mapping (fieldType ${JSON.stringify(authoringType)}); dropped`);
|
|
83
113
|
return undefined;
|
|
@@ -127,13 +157,10 @@ export function skillToolToTf(entry, ctx) {
|
|
|
127
157
|
attrs["run_as"] = "publisher";
|
|
128
158
|
}
|
|
129
159
|
else if (inner.runAs?.["serviceAccount"] !== undefined) {
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
160
|
+
const serviceAccountId = serviceAccountIdValue(inner.runAs["serviceAccount"], where, ctx);
|
|
161
|
+
if (serviceAccountId !== undefined) {
|
|
132
162
|
attrs["run_as"] = "service_account";
|
|
133
|
-
attrs["service_account_id"] =
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
ctx.diagnostics.push(`${where}: service-account runAs has no service account id; dropped`);
|
|
163
|
+
attrs["service_account_id"] = serviceAccountId;
|
|
137
164
|
}
|
|
138
165
|
}
|
|
139
166
|
else if (inner.runAs !== undefined) {
|
|
@@ -192,8 +219,33 @@ export function skillToolToTf(entry, ctx) {
|
|
|
192
219
|
ctx.diagnostics.push(`${where}: no target aspect token; dropped`);
|
|
193
220
|
return undefined;
|
|
194
221
|
}
|
|
195
|
-
const target =
|
|
222
|
+
const target = targetIdValue(inner.aspectId, ctx);
|
|
196
223
|
attrs["target_id"] = target.value;
|
|
224
|
+
if (typeKey === "searchTable") {
|
|
225
|
+
const table = inner.searchTableId;
|
|
226
|
+
if (table?.refName === undefined || table.refName === "") {
|
|
227
|
+
ctx.diagnostics.push(`${where}: no search table token; dropped`);
|
|
228
|
+
return undefined;
|
|
229
|
+
}
|
|
230
|
+
if (table.parent !== undefined && table.parent !== "" && table.parent !== target.refName) {
|
|
231
|
+
ctx.diagnostics.push(`${where}: search table belongs to "${table.parent}", not target "${target.refName}"; dropped`);
|
|
232
|
+
return undefined;
|
|
233
|
+
}
|
|
234
|
+
if (target.localTfLabel === undefined) {
|
|
235
|
+
const targetName = inner.aspectId.name ?? inner.aspectId.refName ?? table.parent;
|
|
236
|
+
const lookupLabel = sanitizeName(`${targetName}_${table.name ?? table.refName}`);
|
|
237
|
+
ctx.foreignFieldRef("elementum_search_table", lookupLabel, target.value, table.name ?? table.refName);
|
|
238
|
+
attrs["search_table_id"] = expr.dataAttr("elementum_search_table", lookupLabel, ["id"]);
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
const resourceType = table.__variant === "linked"
|
|
242
|
+
? "elementum_linked_ai_search_table"
|
|
243
|
+
: table.__variant === "table"
|
|
244
|
+
? "elementum_table_search_table"
|
|
245
|
+
: "elementum_ai_search_table";
|
|
246
|
+
attrs["search_table_id"] = expr.resourceAttr(resourceType, scopedResourceLabel(target.localTfLabel, tsLabelToTfLabel(table.refName), target.kind), ["id"]);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
197
249
|
if (typeKey === "updateRecord") {
|
|
198
250
|
if (inner.handleDescription === undefined || inner.handleDescription === "") {
|
|
199
251
|
ctx.diagnostics.push(`${where}: no handleDescription; dropped`);
|
|
@@ -201,14 +253,14 @@ export function skillToolToTf(entry, ctx) {
|
|
|
201
253
|
}
|
|
202
254
|
attrs["handle_description"] = inner.handleDescription;
|
|
203
255
|
}
|
|
204
|
-
if (typeKey === "searchAspect") {
|
|
256
|
+
if (typeKey === "searchAspect" || typeKey === "searchTable") {
|
|
205
257
|
attrs["query_description"] = inner.queryDescription ?? "";
|
|
206
258
|
if (inner.limit !== undefined)
|
|
207
259
|
attrs["result_limit"] = inner.limit;
|
|
208
260
|
}
|
|
209
|
-
if (inner.fields !== undefined
|
|
261
|
+
if (inner.fields !== undefined || typeKey === "createRecord" || typeKey === "updateRecord") {
|
|
210
262
|
const fieldValues = [];
|
|
211
|
-
for (const f of inner.fields) {
|
|
263
|
+
for (const f of inner.fields ?? []) {
|
|
212
264
|
// A raw-id fallback field (board issue #169) is echoed straight
|
|
213
265
|
// through — ei never resolves it to a reference either, so there's
|
|
214
266
|
// nothing to re-derive.
|
|
@@ -233,13 +285,13 @@ export function skillToolToTf(entry, ctx) {
|
|
|
233
285
|
// hcl_skill.go was fabricating it from Go's zero-value default
|
|
234
286
|
// rather than an actually-discovered value; fixed 2026-08-11.)
|
|
235
287
|
...(typeKey !== "searchAspect" && typeKey !== "searchTable" && { required: f.required ?? false }),
|
|
288
|
+
...(f.defaultValue !== undefined && { default_value: f.defaultValue }),
|
|
236
289
|
});
|
|
237
|
-
if (f.defaultValue !== undefined) {
|
|
238
|
-
ctx.diagnostics.push(`${where}: field default values are not supported on the terraform path yet; dropped`);
|
|
239
|
-
}
|
|
240
290
|
}
|
|
241
|
-
|
|
291
|
+
const requiresExplicitEmptyFields = (typeKey === "createRecord" || typeKey === "updateRecord") && (inner.fields?.length ?? 0) === 0;
|
|
292
|
+
if (fieldValues.length > 0 || requiresExplicitEmptyFields) {
|
|
242
293
|
attrs["fields"] = fieldValues;
|
|
294
|
+
}
|
|
243
295
|
}
|
|
244
296
|
const block = { kind: "resource", type: subType.resourceType, label: tfLabel, attrs };
|
|
245
297
|
return { block, address: `${subType.resourceType}.${tfLabel}` };
|