@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
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { AgentRef, ConnectorRef, SkillRef } from "../../catalog/index.js";
|
|
1
|
+
import type { AgentRef, CatalogRef, ConnectorRef, SkillRef } from "../../catalog/index.js";
|
|
2
2
|
import type { DeployableEntity, EntityDeployOptions } from "../../engine/entity.js";
|
|
3
|
+
import type { UnsafePlatformId } from "../../core/platform-id.js";
|
|
3
4
|
import type { AgentTool, AgentToolRunAs } from "./tools.js";
|
|
4
5
|
/** JWT authentication config (Hydra's `AgentAuthenticationInput`). */
|
|
5
6
|
export interface AgentAuthentication {
|
|
@@ -52,9 +53,41 @@ export type SkillAccess = {
|
|
|
52
53
|
readonly skills: readonly SkillRef[];
|
|
53
54
|
readonly preloadedSkills?: readonly SkillRef[];
|
|
54
55
|
};
|
|
56
|
+
export declare const agentStartingActionVariableType: {
|
|
57
|
+
readonly number: "NUMBER";
|
|
58
|
+
readonly select: "SELECT";
|
|
59
|
+
readonly text: "TEXT";
|
|
60
|
+
};
|
|
61
|
+
export type AgentStartingActionVariableType = (typeof agentStartingActionVariableType)[keyof typeof agentStartingActionVariableType];
|
|
62
|
+
export interface AgentStartingActionVariable {
|
|
63
|
+
readonly key: string;
|
|
64
|
+
readonly label: string;
|
|
65
|
+
readonly placeholder?: string;
|
|
66
|
+
readonly type: AgentStartingActionVariableType;
|
|
67
|
+
readonly required?: boolean;
|
|
68
|
+
readonly options?: readonly {
|
|
69
|
+
readonly value: string;
|
|
70
|
+
readonly label: string;
|
|
71
|
+
}[];
|
|
72
|
+
readonly validation?: {
|
|
73
|
+
readonly pattern?: string;
|
|
74
|
+
readonly minLength?: number;
|
|
75
|
+
readonly maxLength?: number;
|
|
76
|
+
readonly errorMessage?: string;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export interface AgentStartingAction {
|
|
80
|
+
readonly id?: UnsafePlatformId;
|
|
81
|
+
readonly name: string;
|
|
82
|
+
readonly prompt: string;
|
|
83
|
+
readonly icon?: string;
|
|
84
|
+
readonly order: number;
|
|
85
|
+
readonly enabled?: boolean;
|
|
86
|
+
readonly variables?: readonly AgentStartingActionVariable[];
|
|
87
|
+
}
|
|
55
88
|
export interface AgentV2Options extends EntityDeployOptions {
|
|
56
89
|
readonly name: string;
|
|
57
|
-
readonly
|
|
90
|
+
readonly app: CatalogRef<"app">;
|
|
58
91
|
/** AI provider connector backing the agent (`connectors.<key>`). */
|
|
59
92
|
readonly connector: ConnectorRef;
|
|
60
93
|
readonly description: string;
|
|
@@ -64,11 +97,11 @@ export interface AgentV2Options extends EntityDeployOptions {
|
|
|
64
97
|
readonly temperature?: number;
|
|
65
98
|
readonly maxLength?: number;
|
|
66
99
|
readonly reasoningEffort?: "minimal" | "low" | "medium" | "high" | "MINIMAL" | "LOW" | "MEDIUM" | "HIGH";
|
|
67
|
-
readonly avatarAttachmentId?:
|
|
68
|
-
readonly managedById?:
|
|
69
|
-
readonly serviceAccountId?:
|
|
100
|
+
readonly avatarAttachmentId?: UnsafePlatformId;
|
|
101
|
+
readonly managedById?: UnsafePlatformId;
|
|
102
|
+
readonly serviceAccountId?: UnsafePlatformId;
|
|
70
103
|
readonly runAs?: AgentToolRunAs;
|
|
71
|
-
readonly startingActions?: readonly
|
|
104
|
+
readonly startingActions?: readonly AgentStartingAction[];
|
|
72
105
|
readonly a2aStreaming?: boolean;
|
|
73
106
|
/** Enable A2A record creation — when set, allows A2A conversations to create records through this agent. */
|
|
74
107
|
readonly a2aCreateRecordEnabled?: boolean;
|
|
@@ -76,8 +109,6 @@ export interface AgentV2Options extends EntityDeployOptions {
|
|
|
76
109
|
readonly skillAccess?: SkillAccess;
|
|
77
110
|
readonly agentAuthentication?: AgentAuthentication;
|
|
78
111
|
readonly a2aSkills?: readonly A2ASkill[];
|
|
79
|
-
/** Escape hatch for `AgentElementumCreateInput` fields not surfaced yet. */
|
|
80
|
-
readonly extra?: Record<string, unknown>;
|
|
81
112
|
readonly tools?: readonly AgentTool[];
|
|
82
113
|
}
|
|
83
114
|
/**
|
|
@@ -9,10 +9,33 @@
|
|
|
9
9
|
* automation refs. The tokens resolve to ids at deploy via `resolvePayload`;
|
|
10
10
|
* nothing here reads an `.id`.
|
|
11
11
|
*
|
|
12
|
-
* Identity (handle) and the owning app
|
|
13
|
-
*
|
|
12
|
+
* Identity (handle) comes from the authored key, and the owning app comes from
|
|
13
|
+
* the typed `app` reference, exactly like `defineAutomation`.
|
|
14
14
|
*/
|
|
15
15
|
import { slimTokens } from "../../catalog/index.js";
|
|
16
|
+
export const agentStartingActionVariableType = {
|
|
17
|
+
number: "NUMBER",
|
|
18
|
+
select: "SELECT",
|
|
19
|
+
text: "TEXT",
|
|
20
|
+
};
|
|
21
|
+
function serializeRunAs(runAs) {
|
|
22
|
+
if ("currentUser" in runAs)
|
|
23
|
+
return { currentUser: true };
|
|
24
|
+
if ("publisher" in runAs)
|
|
25
|
+
return { publisher: true };
|
|
26
|
+
return { serviceAccount: runAs.serviceAccount };
|
|
27
|
+
}
|
|
28
|
+
function serializeStartingAction(action) {
|
|
29
|
+
return {
|
|
30
|
+
...(action.id !== undefined ? { id: action.id.value } : {}),
|
|
31
|
+
name: action.name,
|
|
32
|
+
prompt: action.prompt,
|
|
33
|
+
...(action.icon !== undefined ? { icon: action.icon } : {}),
|
|
34
|
+
order: action.order,
|
|
35
|
+
...(action.enabled !== undefined ? { enabled: action.enabled } : {}),
|
|
36
|
+
...(action.variables !== undefined ? { variables: action.variables } : {}),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
16
39
|
function serializeSkillAccess(access) {
|
|
17
40
|
const preloaded = access.preloadedSkills !== undefined ? { preloadedSkillIds: access.preloadedSkills } : {};
|
|
18
41
|
if (access.mode === "CUSTOM") {
|
|
@@ -28,10 +51,10 @@ function serializeA2ASkill(s) {
|
|
|
28
51
|
return {
|
|
29
52
|
name: s.name,
|
|
30
53
|
description: s.description,
|
|
31
|
-
...(s.tags?.length ? { tags: s.tags } : {}),
|
|
32
|
-
...(s.examples?.length ? { examples: s.examples } : {}),
|
|
33
|
-
...(s.inputModes?.length ? { inputModes: s.inputModes } : {}),
|
|
34
|
-
...(s.outputModes?.length ? { outputModes: s.outputModes } : {}),
|
|
54
|
+
...(s.tags?.length ? { tags: [...s.tags].sort() } : {}),
|
|
55
|
+
...(s.examples?.length ? { examples: [...s.examples].sort() } : {}),
|
|
56
|
+
...(s.inputModes?.length ? { inputModes: [...s.inputModes].sort() } : {}),
|
|
57
|
+
...(s.outputModes?.length ? { outputModes: [...s.outputModes].sort() } : {}),
|
|
35
58
|
};
|
|
36
59
|
}
|
|
37
60
|
/**
|
|
@@ -107,11 +130,11 @@ export function defineAgent(opts) {
|
|
|
107
130
|
...(opts.reasoningEffort !== undefined
|
|
108
131
|
? { reasoningEffort: opts.reasoningEffort.toUpperCase() }
|
|
109
132
|
: {}),
|
|
110
|
-
...(opts.avatarAttachmentId !== undefined ? { avatarAttachmentId: opts.avatarAttachmentId } : {}),
|
|
111
|
-
...(opts.managedById !== undefined ? { managedById: opts.managedById } : {}),
|
|
112
|
-
...(opts.serviceAccountId !== undefined ? { serviceAccountId: opts.serviceAccountId } : {}),
|
|
113
|
-
...(opts.runAs !== undefined ? { runAs: opts.runAs } : {}),
|
|
114
|
-
...(opts.startingActions !== undefined ? { startingActions: opts.startingActions } : {}),
|
|
133
|
+
...(opts.avatarAttachmentId !== undefined ? { avatarAttachmentId: opts.avatarAttachmentId.value } : {}),
|
|
134
|
+
...(opts.managedById !== undefined ? { managedById: opts.managedById.value } : {}),
|
|
135
|
+
...(opts.serviceAccountId !== undefined ? { serviceAccountId: opts.serviceAccountId.value } : {}),
|
|
136
|
+
...(opts.runAs !== undefined ? { runAs: serializeRunAs(opts.runAs) } : {}),
|
|
137
|
+
...(opts.startingActions !== undefined ? { startingActions: opts.startingActions.map(serializeStartingAction) } : {}),
|
|
115
138
|
...(opts.a2aStreaming !== undefined ? { a2aStreaming: opts.a2aStreaming } : {}),
|
|
116
139
|
...(opts.a2aCreateRecordEnabled !== undefined ? { a2aCreateRecordEnabled: opts.a2aCreateRecordEnabled } : {}),
|
|
117
140
|
...(opts.conversationIdleTimeout !== undefined
|
|
@@ -123,18 +146,16 @@ export function defineAgent(opts) {
|
|
|
123
146
|
...(opts.agentAuthentication !== undefined
|
|
124
147
|
? { agentAuthentication: opts.agentAuthentication }
|
|
125
148
|
: {}),
|
|
126
|
-
// Spread last so an `extra` key overrides a surfaced field, matching v1.
|
|
127
|
-
...(opts.extra ?? undefined),
|
|
128
149
|
};
|
|
129
150
|
return {
|
|
130
151
|
ref(refName) {
|
|
131
|
-
return { __kind: "agent", refName: refName, name: opts.name, parent: opts.
|
|
152
|
+
return { __kind: "agent", refName: refName, name: opts.name, parent: opts.app.refName };
|
|
132
153
|
},
|
|
133
154
|
def(refName) {
|
|
134
155
|
validateAgentTools(opts.name, opts.tools ?? []);
|
|
135
156
|
return {
|
|
136
157
|
kind: "agent",
|
|
137
|
-
parent: opts.
|
|
158
|
+
parent: opts.app.refName,
|
|
138
159
|
refName,
|
|
139
160
|
// Slim every embedded catalog token to its canonical form (drop barrel bags).
|
|
140
161
|
payload: slimTokens({
|
|
@@ -49,5 +49,10 @@ export interface PrintAgentV2Options {
|
|
|
49
49
|
* key here prints `catalog.<refName>` instead of the literal stub.
|
|
50
50
|
*/
|
|
51
51
|
readonly foreignElementRefNames?: ReadonlyMap<string, string>;
|
|
52
|
+
/** Aspect/table display-name pair → typed search-table identity. */
|
|
53
|
+
readonly foreignSearchTableRefsByName?: ReadonlyMap<string, {
|
|
54
|
+
readonly ownerRefName: string;
|
|
55
|
+
readonly tableKey: string;
|
|
56
|
+
}>;
|
|
52
57
|
}
|
|
53
58
|
export declare function printAgentV2(agent: NormalizedAgent, opts: PrintAgentV2Options): string;
|
|
@@ -14,10 +14,13 @@ import { quote } from "../../../../pull/util.js";
|
|
|
14
14
|
import { sdkPackageSpecifier } from "../../../internal/sdk-package.js";
|
|
15
15
|
const TOOL_FACTORY_BY_TYPE_KEY = {
|
|
16
16
|
createRecord: "agentCreateRecord",
|
|
17
|
-
searchAspect: "
|
|
17
|
+
searchAspect: "agentSearchRecords",
|
|
18
18
|
updateRecord: "agentUpdateRecord",
|
|
19
19
|
executeWorkflow: "agentRunAutomation",
|
|
20
20
|
searchTable: "agentSearchTable",
|
|
21
|
+
relateRecord: "agentRelateRecord",
|
|
22
|
+
runAgent: "agentRunAgent",
|
|
23
|
+
mcp: "agentMcp",
|
|
21
24
|
};
|
|
22
25
|
/**
|
|
23
26
|
* A safe placeholder `ConnectorRef` literal (board issue — a property-access
|
|
@@ -44,7 +47,16 @@ function printConnectorToken(connectorKey) {
|
|
|
44
47
|
export function printAgentV2(agent, opts) {
|
|
45
48
|
const { appRefName } = opts;
|
|
46
49
|
const crossOrg = opts.crossOrg === true;
|
|
47
|
-
const
|
|
50
|
+
const usesServiceAccountRef = agent.runAs !== undefined && "serviceAccount" in agent.runAs;
|
|
51
|
+
const factories = [
|
|
52
|
+
...new Set([
|
|
53
|
+
...agent.tools.map((t) => TOOL_FACTORY_BY_TYPE_KEY[t.typeKey]).filter(Boolean),
|
|
54
|
+
...(usesServiceAccountRef ? ["serviceAccountRef"] : []),
|
|
55
|
+
]),
|
|
56
|
+
].sort();
|
|
57
|
+
const usesUnsafePlatformId = agent.tools.some((tool) => tool.fields?.some((field) => field.rawFieldId !== undefined) === true ||
|
|
58
|
+
(tool.searchTableFields?.length ?? 0) > 0 ||
|
|
59
|
+
(tool.returnFields?.length ?? 0) > 0);
|
|
48
60
|
const lines = [];
|
|
49
61
|
lines.push("/**");
|
|
50
62
|
lines.push(` * ${agent.name}`);
|
|
@@ -53,7 +65,10 @@ export function printAgentV2(agent, opts) {
|
|
|
53
65
|
lines.push(" * one-shot starting point, not a live-binding view.");
|
|
54
66
|
lines.push(" */");
|
|
55
67
|
lines.push("");
|
|
56
|
-
|
|
68
|
+
const agentImports = [...factories, "defineAgent"];
|
|
69
|
+
lines.push(`import { ${[...new Set(agentImports)].sort().join(", ")} } from "${sdkPackageSpecifier("agents")}";`);
|
|
70
|
+
if (usesUnsafePlatformId)
|
|
71
|
+
lines.push(`import { unsafePlatformId } from "${sdkPackageSpecifier("core")}";`);
|
|
57
72
|
// Always needed: `connector:` is required and always a catalog.aiProviders
|
|
58
73
|
// token (or the TODO placeholder), and the barrel already re-exports
|
|
59
74
|
// org.aiProviders — no separate relative org.js import is needed here.
|
|
@@ -61,7 +76,7 @@ export function printAgentV2(agent, opts) {
|
|
|
61
76
|
lines.push("");
|
|
62
77
|
lines.push(`const ${agent.refName} = defineAgent({`);
|
|
63
78
|
lines.push(` name: ${quote(agent.name)},`);
|
|
64
|
-
lines.push(`
|
|
79
|
+
lines.push(` app: catalog.${appRefName},`);
|
|
65
80
|
const connectorMatchesDestination = agent.connectorKey !== undefined && (opts.destinationConnectorKeys?.has(agent.connectorKey) ?? false);
|
|
66
81
|
if (opts.connectorKeyOverride !== undefined) {
|
|
67
82
|
// Interactively confirmed by the caller — print directly, uncommented,
|
|
@@ -94,7 +109,7 @@ export function printAgentV2(agent, opts) {
|
|
|
94
109
|
lines.push(...printSkillAccess(agent.skillAccess, appRefName, crossOrg).map((l) => ` ${l}`));
|
|
95
110
|
}
|
|
96
111
|
if (agent.runAs !== undefined)
|
|
97
|
-
lines.push(` runAs: ${printRunAs(agent.runAs)},`);
|
|
112
|
+
lines.push(` runAs: ${printRunAs(agent.runAs, appRefName)},`);
|
|
98
113
|
if (agent.agentAuthentication !== undefined) {
|
|
99
114
|
lines.push(...printAgentAuthentication(agent.agentAuthentication).map((l) => ` ${l}`));
|
|
100
115
|
}
|
|
@@ -115,7 +130,7 @@ export function printAgentV2(agent, opts) {
|
|
|
115
130
|
if (agent.tools.length > 0) {
|
|
116
131
|
lines.push(" tools: [");
|
|
117
132
|
for (const tool of agent.tools) {
|
|
118
|
-
lines.push(...printTool(tool, appRefName, crossOrg, opts.foreignAppRefNames, opts.foreignElementRefNames).map((l) => ` ${l}`));
|
|
133
|
+
lines.push(...printTool(tool, appRefName, crossOrg, opts.foreignAppRefNames, opts.foreignElementRefNames, opts.foreignSearchTableRefsByName).map((l) => ` ${l}`));
|
|
119
134
|
}
|
|
120
135
|
lines.push(" ],");
|
|
121
136
|
}
|
|
@@ -178,17 +193,12 @@ function printSkillAccess(access, appRefName, crossOrg) {
|
|
|
178
193
|
lines.push(`},`);
|
|
179
194
|
return lines;
|
|
180
195
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
const serviceAccount = runAs["serviceAccount"];
|
|
188
|
-
if (serviceAccount?.serviceAccount !== undefined) {
|
|
189
|
-
return `{ serviceAccount: { serviceAccount: ${quote(String(serviceAccount.serviceAccount))} } }`;
|
|
190
|
-
}
|
|
191
|
-
return JSON.stringify(runAs);
|
|
196
|
+
function printRunAs(runAs, appRefName) {
|
|
197
|
+
if ("currentUser" in runAs)
|
|
198
|
+
return `{ currentUser: true }`;
|
|
199
|
+
if ("publisher" in runAs)
|
|
200
|
+
return `{ publisher: true }`;
|
|
201
|
+
return `{ serviceAccount: serviceAccountRef({ app: catalog.${appRefName}, name: ${quote(runAs.serviceAccount.name)} }) }`;
|
|
192
202
|
}
|
|
193
203
|
function printAgentAuthentication(auth) {
|
|
194
204
|
const { jwt } = auth;
|
|
@@ -223,14 +233,18 @@ function printA2ASkill(skill) {
|
|
|
223
233
|
const lines = ["{"];
|
|
224
234
|
lines.push(` name: ${quote(skill.name)},`);
|
|
225
235
|
lines.push(` description: ${quote(skill.description)},`);
|
|
226
|
-
|
|
227
|
-
|
|
236
|
+
// The provider schema models tags as a set. GraphQL/export connection order
|
|
237
|
+
// is therefore not authored state, so print one stable, review-friendly
|
|
238
|
+
// representation instead of letting every pull reshuffle this line.
|
|
239
|
+
if (skill.tags !== undefined && skill.tags.length > 0) {
|
|
240
|
+
lines.push(` tags: [${[...skill.tags].sort().map(quote).join(", ")}],`);
|
|
241
|
+
}
|
|
228
242
|
if (skill.examples !== undefined && skill.examples.length > 0)
|
|
229
|
-
lines.push(` examples: [${skill.examples.map(quote).join(", ")}],`);
|
|
243
|
+
lines.push(` examples: [${[...skill.examples].sort().map(quote).join(", ")}],`);
|
|
230
244
|
if (skill.inputModes !== undefined && skill.inputModes.length > 0)
|
|
231
|
-
lines.push(` inputModes: [${skill.inputModes.map(quote).join(", ")}],`);
|
|
245
|
+
lines.push(` inputModes: [${[...skill.inputModes].sort().map(quote).join(", ")}],`);
|
|
232
246
|
if (skill.outputModes !== undefined && skill.outputModes.length > 0)
|
|
233
|
-
lines.push(` outputModes: [${skill.outputModes.map(quote).join(", ")}],`);
|
|
247
|
+
lines.push(` outputModes: [${[...skill.outputModes].sort().map(quote).join(", ")}],`);
|
|
234
248
|
lines.push("},");
|
|
235
249
|
return lines;
|
|
236
250
|
}
|
|
@@ -248,8 +262,8 @@ function fieldOwnerRef(tool, appRefName, foreignAppRefNames, foreignElementRefNa
|
|
|
248
262
|
? { kind: "catalog", expr: `catalog.${foreignRefName}` }
|
|
249
263
|
: { kind: "raw", entityType: "element", name: tool.target.name };
|
|
250
264
|
}
|
|
251
|
-
function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElementRefNames) {
|
|
252
|
-
const factory = TOOL_FACTORY_BY_TYPE_KEY[tool.typeKey] ?? "
|
|
265
|
+
function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElementRefNames, foreignSearchTableRefsByName) {
|
|
266
|
+
const factory = TOOL_FACTORY_BY_TYPE_KEY[tool.typeKey] ?? "agentSearchRecords";
|
|
253
267
|
const lines = [`${factory}({`];
|
|
254
268
|
lines.push(` name: ${quote(tool.name)},`);
|
|
255
269
|
lines.push(` description: ${quote(tool.description)},`);
|
|
@@ -286,8 +300,33 @@ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElemen
|
|
|
286
300
|
lines.push("}),");
|
|
287
301
|
return lines;
|
|
288
302
|
}
|
|
303
|
+
if (tool.typeKey === "runAgent") {
|
|
304
|
+
lines.push(` agent: catalog.${appRefName}.agents${safeMember(tool.targetAgentKey ?? "")},`);
|
|
305
|
+
lines.push(` workerTaskPrompt: ${quote(tool.workerTaskPrompt ?? "")},`);
|
|
306
|
+
lines.push("}),");
|
|
307
|
+
return lines;
|
|
308
|
+
}
|
|
309
|
+
if (tool.typeKey === "mcp") {
|
|
310
|
+
lines.push(` serverUrl: ${quote(tool.serverUrl ?? "")},`);
|
|
311
|
+
lines.push(` mcpToolName: ${quote(tool.mcpToolName ?? "")},`);
|
|
312
|
+
if (tool.headers !== undefined && tool.headers.length > 0) {
|
|
313
|
+
lines.push(" headers: [");
|
|
314
|
+
for (const header of tool.headers) {
|
|
315
|
+
lines.push(` { key: ${quote(header.key)}, value: ${quote(header.value)} },`);
|
|
316
|
+
}
|
|
317
|
+
lines.push(" ],");
|
|
318
|
+
}
|
|
319
|
+
lines.push("}),");
|
|
320
|
+
return lines;
|
|
321
|
+
}
|
|
289
322
|
if (tool.target?.kind === "self") {
|
|
290
|
-
|
|
323
|
+
// A search-table tool targets the ELEMENT that owns the table, so a "self"
|
|
324
|
+
// target means the owning aspect IS that element — emit `element:`, not
|
|
325
|
+
// `app:`. (A foreignApp target on a searchTable tool is malformed input:
|
|
326
|
+
// apps never own search tables. It keeps printing `app:` below so tsc
|
|
327
|
+
// rejects the emitted source loudly instead of mislabelling an app as an
|
|
328
|
+
// element.)
|
|
329
|
+
lines.push(` ${tool.typeKey === "searchTable" ? "element" : "app"}: catalog.${appRefName},`);
|
|
291
330
|
}
|
|
292
331
|
else if (tool.target !== undefined && tool.target.kind === "foreignApp") {
|
|
293
332
|
const foreignRefName = foreignAppRefNames?.get(tool.target.name);
|
|
@@ -295,7 +334,7 @@ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElemen
|
|
|
295
334
|
// The dependency is already pulled into this workspace (board issue
|
|
296
335
|
// #40) — a typed token, not a stub, so tsc catches drift if the
|
|
297
336
|
// foreign app's fields change out from under this tool.
|
|
298
|
-
lines.push(`
|
|
337
|
+
lines.push(` app: catalog.${foreignRefName},`);
|
|
299
338
|
}
|
|
300
339
|
else {
|
|
301
340
|
// The foreign app's catalog may not exist in this workspace — a literal
|
|
@@ -304,7 +343,7 @@ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElemen
|
|
|
304
343
|
const todo = crossOrg
|
|
305
344
|
? ` // TODO: cross-org clone — "${tool.target.name}" was resolved in the SOURCE org; verify it exists (with this name) in the destination org`
|
|
306
345
|
: "";
|
|
307
|
-
lines.push(`
|
|
346
|
+
lines.push(` app: { __kind: "app", refName: ${quote(tool.target.name)}, name: ${quote(tool.target.name)} },${todo}`);
|
|
308
347
|
}
|
|
309
348
|
}
|
|
310
349
|
else if (tool.target !== undefined && tool.target.kind === "foreignElement") {
|
|
@@ -312,13 +351,40 @@ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElemen
|
|
|
312
351
|
// same treatment as foreignApp, distinct stub `__kind`.
|
|
313
352
|
const foreignRefName = foreignElementRefNames?.get(tool.target.name);
|
|
314
353
|
if (foreignRefName !== undefined) {
|
|
315
|
-
lines.push(`
|
|
354
|
+
lines.push(` element: catalog.${foreignRefName},`);
|
|
316
355
|
}
|
|
317
356
|
else {
|
|
318
357
|
const todo = crossOrg
|
|
319
358
|
? ` // TODO: cross-org clone — "${tool.target.name}" was resolved in the SOURCE org; verify it exists (with this name) in the destination org`
|
|
320
359
|
: "";
|
|
321
|
-
lines.push(`
|
|
360
|
+
lines.push(` element: { __kind: "element", refName: ${quote(tool.target.name)}, name: ${quote(tool.target.name)} },${todo}`);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (tool.typeKey === "relateRecord" && tool.relatedTarget?.kind === "self") {
|
|
364
|
+
lines.push(` relatedApp: catalog.${appRefName},`);
|
|
365
|
+
}
|
|
366
|
+
else if (tool.typeKey === "relateRecord" && tool.relatedTarget?.kind === "foreignApp") {
|
|
367
|
+
const foreignRefName = foreignAppRefNames?.get(tool.relatedTarget.name);
|
|
368
|
+
if (foreignRefName !== undefined) {
|
|
369
|
+
lines.push(` relatedApp: catalog.${foreignRefName},`);
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
const todo = crossOrg
|
|
373
|
+
? ` // TODO: cross-org clone — "${tool.relatedTarget.name}" was resolved in the SOURCE org; verify it exists (with this name) in the destination org`
|
|
374
|
+
: "";
|
|
375
|
+
lines.push(` relatedApp: { __kind: "app", refName: ${quote(tool.relatedTarget.name)}, name: ${quote(tool.relatedTarget.name)} },${todo}`);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
else if (tool.typeKey === "relateRecord" && tool.relatedTarget?.kind === "foreignElement") {
|
|
379
|
+
const foreignRefName = foreignElementRefNames?.get(tool.relatedTarget.name);
|
|
380
|
+
if (foreignRefName !== undefined) {
|
|
381
|
+
lines.push(` relatedElement: catalog.${foreignRefName},`);
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
const todo = crossOrg
|
|
385
|
+
? ` // TODO: cross-org clone — "${tool.relatedTarget.name}" was resolved in the SOURCE org; verify it exists (with this name) in the destination org`
|
|
386
|
+
: "";
|
|
387
|
+
lines.push(` relatedElement: { __kind: "element", refName: ${quote(tool.relatedTarget.name)}, name: ${quote(tool.relatedTarget.name)} },${todo}`);
|
|
322
388
|
}
|
|
323
389
|
}
|
|
324
390
|
if (tool.typeKey === "searchAspect" || tool.typeKey === "searchTable") {
|
|
@@ -329,10 +395,29 @@ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElemen
|
|
|
329
395
|
if (tool.typeKey === "updateRecord" && tool.handleDescription !== undefined) {
|
|
330
396
|
lines.push(` handleDescription: ${quote(tool.handleDescription)},`);
|
|
331
397
|
}
|
|
332
|
-
if (tool.typeKey === "searchTable"
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
398
|
+
if (tool.typeKey === "searchTable") {
|
|
399
|
+
const targetRefName = tool.target?.kind === "self"
|
|
400
|
+
? appRefName
|
|
401
|
+
: tool.target?.kind === "foreignApp"
|
|
402
|
+
? foreignAppRefNames?.get(tool.target.name)
|
|
403
|
+
: tool.target?.kind === "foreignElement"
|
|
404
|
+
? foreignElementRefNames?.get(tool.target.name)
|
|
405
|
+
: undefined;
|
|
406
|
+
if (tool.searchTableKey !== undefined) {
|
|
407
|
+
lines.push(` table: catalog.${targetRefName ?? appRefName}.searchTables${safeMember(tool.searchTableKey)},`);
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
const parent = tool.target?.kind === "self" ? appRefName : tool.target?.name ?? "";
|
|
411
|
+
const typedTable = tool.searchTableName === undefined
|
|
412
|
+
? undefined
|
|
413
|
+
: foreignSearchTableRefsByName?.get(JSON.stringify([parent, tool.searchTableName]));
|
|
414
|
+
if (typedTable !== undefined) {
|
|
415
|
+
lines.push(` table: catalog.${typedTable.ownerRefName}.searchTables${safeMember(typedTable.tableKey)},`);
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
lines.push(` table: { __kind: "searchTable", refName: ${quote(tool.searchTableName ?? "")}, name: ${quote(tool.searchTableName ?? "")}, parent: ${quote(parent)} },`);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
336
421
|
}
|
|
337
422
|
if (tool.fields !== undefined && tool.fields.length > 0) {
|
|
338
423
|
const owner = fieldOwnerRef(tool, appRefName, foreignAppRefNames, foreignElementRefNames);
|
|
@@ -347,7 +432,7 @@ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElemen
|
|
|
347
432
|
// owning app — `owner` (self/foreign-resolved/foreign-unresolved)
|
|
348
433
|
// mirrors the `aspect:` resolution just above.
|
|
349
434
|
const parts = isRaw
|
|
350
|
-
? [`fieldId: ${quote(f.rawFieldId ?? "")}`]
|
|
435
|
+
? [`fieldId: unsafePlatformId(${quote(f.rawFieldId ?? "")})`]
|
|
351
436
|
: owner.kind === "catalog"
|
|
352
437
|
? [`field: ${owner.expr}.fields.${f.key}`]
|
|
353
438
|
: [
|
|
@@ -376,7 +461,7 @@ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElemen
|
|
|
376
461
|
if (tool.searchTableFields !== undefined && tool.searchTableFields.length > 0) {
|
|
377
462
|
lines.push(" fields: [");
|
|
378
463
|
for (const f of tool.searchTableFields) {
|
|
379
|
-
const parts = [`fieldId: ${quote(f.fieldId)}`];
|
|
464
|
+
const parts = [`fieldId: unsafePlatformId(${quote(f.fieldId)})`];
|
|
380
465
|
if (f.name !== undefined)
|
|
381
466
|
parts.push(`name: ${quote(f.name)}`);
|
|
382
467
|
if (f.description !== undefined)
|
|
@@ -388,7 +473,7 @@ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElemen
|
|
|
388
473
|
if (tool.returnFields !== undefined && tool.returnFields.length > 0) {
|
|
389
474
|
lines.push(" returnFields: [");
|
|
390
475
|
for (const f of tool.returnFields) {
|
|
391
|
-
const parts = [`fieldId: ${quote(f.fieldId)}`];
|
|
476
|
+
const parts = [`fieldId: unsafePlatformId(${quote(f.fieldId)})`];
|
|
392
477
|
if (f.name !== undefined)
|
|
393
478
|
parts.push(`name: ${quote(f.name)}`);
|
|
394
479
|
if (f.displayName !== undefined)
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { EntityTfError } from "../../engine/entity.js";
|
|
10
10
|
import { optionalBoolean, optionalString, plainObject, resourceRefLabel } from "../../engine/pull/context.js";
|
|
11
|
-
import { isTfExpr, isUuid,
|
|
11
|
+
import { isTfExpr, isUuid, scopedLabelToBagKey, } from "../../engine/tf/index.js";
|
|
12
12
|
import { a2aSkillFromTf } from "../agent-a2a-skill/from-tf.js";
|
|
13
13
|
import { toolFromTf } from "../agent-tool/from-tf.js";
|
|
14
|
+
import { connectorIdentityFromTf } from "../shared/connector-from-tf.js";
|
|
14
15
|
import { APP_RESOURCE_TYPE } from "../app/module.js";
|
|
15
16
|
import { SKILL_RESOURCE_TYPE } from "../skill/module.js";
|
|
16
17
|
import { AGENT_RESOURCE_TYPE } from "./module.js";
|
|
@@ -219,16 +220,12 @@ export function agentFromTf(agentBlock, toolBlocks, appLabel, _appRefName, ctx,
|
|
|
219
220
|
// Deriving providerKey/modelKey this way (not by splitting the
|
|
220
221
|
// connector's combined tfLabel) is the same derivation
|
|
221
222
|
// renderAiProvidersBag uses, so the printed token matches the catalog.
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
const providerName = providerRef !== undefined ? ctx.dataName(providerRef.resourceType, providerRef.tfLabel) : undefined;
|
|
225
|
-
if (modelName === undefined || providerName === undefined) {
|
|
223
|
+
const identity = connectorIdentityFromTf(connectorAttr.type, connectorAttr.label, ctx);
|
|
224
|
+
if (identity.catalogKey === undefined) {
|
|
226
225
|
ctx.diagnostics.push(`${where}: references data.${connectorAttr.type}.${connectorAttr.label} but the stream has no model_name/provider for it; dropped`);
|
|
227
226
|
}
|
|
228
227
|
else {
|
|
229
|
-
|
|
230
|
-
const modelKey = tfLabelToTsLabel(sanitizeName(modelName));
|
|
231
|
-
connectorKey = `${providerKey}.${modelKey}`;
|
|
228
|
+
connectorKey = identity.catalogKey;
|
|
232
229
|
}
|
|
233
230
|
}
|
|
234
231
|
else {
|
|
@@ -3,5 +3,8 @@
|
|
|
3
3
|
* the deploy wire client injects) with `CatalogRef` tokens at every reference
|
|
4
4
|
* position. Standalone from v1.
|
|
5
5
|
*/
|
|
6
|
-
export { defineAgent, type A2ASkill, type AgentAuthentication, type AgentV2Options, type SkillAccess, } from "./build.js";
|
|
7
|
-
export { agentCreateRecord, agentExecuteWorkflow, agentMcp, agentRelateRecord, agentRunAgent, agentRunAutomation,
|
|
6
|
+
export { defineAgent, type A2ASkill, type AgentAuthentication, type AgentV2Options, agentStartingActionVariableType, type AgentStartingAction, type AgentStartingActionVariable, type AgentStartingActionVariableType, type SkillAccess, } from "./build.js";
|
|
7
|
+
export { agentCreateRecord, agentExecuteWorkflow, agentMcp, agentRelateRecord, agentRunAgent, agentRunAutomation, agentSearchRecords, agentSearchTable, agentUpdateRecord, type AgentExecuteWorkflowInput, type AgentExecuteWorkflowOutput, type RunAutomationInputs, type RunAutomationOptionalInput, type RunAutomationOutput, type RunAutomationOutputs, type RunAutomationRequiredInput, type RunAutomationToolV2, type AgentMcpHeader, type AgentRecordField, type AgentRecordFieldInput, type AgentRecordRawIdField, type AgentSearchField, type AgentSearchFieldInput, type AgentSearchRawIdField, type AgentToolRunAs, type AgentTool, } from "./tools.js";
|
|
8
|
+
export { serviceAccountRef, type ServiceAccountRef } from "./run-as.js";
|
|
9
|
+
export * as filter from "../shared/filters/index.js";
|
|
10
|
+
export { type Filter } from "../shared/filters/types.js";
|
|
@@ -3,5 +3,7 @@
|
|
|
3
3
|
* the deploy wire client injects) with `CatalogRef` tokens at every reference
|
|
4
4
|
* position. Standalone from v1.
|
|
5
5
|
*/
|
|
6
|
-
export { defineAgent, } from "./build.js";
|
|
7
|
-
export { agentCreateRecord, agentExecuteWorkflow, agentMcp, agentRelateRecord, agentRunAgent, agentRunAutomation,
|
|
6
|
+
export { defineAgent, agentStartingActionVariableType, } from "./build.js";
|
|
7
|
+
export { agentCreateRecord, agentExecuteWorkflow, agentMcp, agentRelateRecord, agentRunAgent, agentRunAutomation, agentSearchRecords, agentSearchTable, agentUpdateRecord, } from "./tools.js";
|
|
8
|
+
export { serviceAccountRef } from "./run-as.js";
|
|
9
|
+
export * as filter from "../shared/filters/index.js";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** The agent entity's registry entry + resource-type constant (see src/graph/). */
|
|
2
2
|
import { bareFactoryEntry } from "../../catalog/render-helpers.js";
|
|
3
3
|
import { isTfExpr } from "../../engine/tf/index.js";
|
|
4
|
-
import { NO_DATA, } from "../../graph/types.js";
|
|
5
4
|
import { printAgentV2 } from "./deserializer/print-agent-v2.js";
|
|
6
5
|
import { agentFromTf } from "./from-tf.js";
|
|
7
6
|
import { agentToTf } from "./to-tf.js";
|
|
@@ -70,7 +69,7 @@ export const agentModule = {
|
|
|
70
69
|
authoring: { unit: "ownFile", bag: "agents" },
|
|
71
70
|
parents: [{ parent: "app", child: "agent" }],
|
|
72
71
|
resource: { shape: "single", resourceType: AGENT_RESOURCE_TYPE, adoptable: true },
|
|
73
|
-
data:
|
|
72
|
+
data: { participates: true, resourceType: AGENT_RESOURCE_TYPE, lookupAttr: "name", referencedByBuild: false },
|
|
74
73
|
canvas: {
|
|
75
74
|
participates: true,
|
|
76
75
|
label: "Agents",
|
|
@@ -102,6 +101,9 @@ export const agentModule = {
|
|
|
102
101
|
...(opts.connectorKeyOverride !== undefined && { connectorKeyOverride: opts.connectorKeyOverride }),
|
|
103
102
|
...(opts.foreignAppRefNames !== undefined && { foreignAppRefNames: opts.foreignAppRefNames }),
|
|
104
103
|
...(opts.foreignElementRefNames !== undefined && { foreignElementRefNames: opts.foreignElementRefNames }),
|
|
104
|
+
...(opts.foreignSearchTableRefsByName !== undefined && {
|
|
105
|
+
foreignSearchTableRefsByName: opts.foreignSearchTableRefsByName,
|
|
106
|
+
}),
|
|
105
107
|
}),
|
|
106
108
|
};
|
|
107
109
|
},
|
|
@@ -109,6 +111,7 @@ export const agentModule = {
|
|
|
109
111
|
appRefName: ctx.appRefName,
|
|
110
112
|
appTfLabel: ctx.appTfLabel,
|
|
111
113
|
orgRefs: ctx.orgRefs,
|
|
114
|
+
workspaceAspects: ctx.workspaceAspects,
|
|
112
115
|
diagnostics: ctx.diagnostics,
|
|
113
116
|
...(ctx.siblingEntities !== undefined && { siblingEntities: ctx.siblingEntities }),
|
|
114
117
|
}),
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ServiceAccountRef } from "../service-account/ref.js";
|
|
2
|
+
export { serviceAccountRef, type ServiceAccountRef } from "../service-account/ref.js";
|
|
3
|
+
/** Execution identity accepted by agents and their tools. */
|
|
4
|
+
export type AgentToolRunAs = {
|
|
5
|
+
readonly currentUser: true;
|
|
6
|
+
readonly publisher?: never;
|
|
7
|
+
readonly serviceAccount?: never;
|
|
8
|
+
} | {
|
|
9
|
+
readonly publisher: true;
|
|
10
|
+
readonly currentUser?: never;
|
|
11
|
+
readonly serviceAccount?: never;
|
|
12
|
+
} | {
|
|
13
|
+
readonly serviceAccount: ServiceAccountRef;
|
|
14
|
+
readonly currentUser?: never;
|
|
15
|
+
readonly publisher?: never;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { serviceAccountRef } from "../service-account/ref.js";
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* startingActions, …) degrade through `diagnostics` — reported, never
|
|
16
16
|
* silent (plan §4.3).
|
|
17
17
|
*/
|
|
18
|
-
import type { OrgRefLookup } from "../../engine/build/context.js";
|
|
18
|
+
import type { OrgRefLookup, WorkspaceAspect } from "../../engine/build/context.js";
|
|
19
19
|
import { type DeployableEntity } from "../../engine/entity.js";
|
|
20
20
|
import { type TfBlock } from "../../engine/tf/index.js";
|
|
21
21
|
export interface AgentToTfContext {
|
|
@@ -23,6 +23,7 @@ export interface AgentToTfContext {
|
|
|
23
23
|
readonly appRefName: string;
|
|
24
24
|
readonly appTfLabel: string;
|
|
25
25
|
readonly orgRefs: OrgRefLookup;
|
|
26
|
+
readonly workspaceAspects?: ReadonlyMap<string, WorkspaceAspect>;
|
|
26
27
|
/** Degradations land here — reported by the caller, never silent. */
|
|
27
28
|
readonly diagnostics: string[];
|
|
28
29
|
/**
|
|
@@ -48,7 +48,7 @@ const UNSUPPORTED_AGENT_KNOBS = [
|
|
|
48
48
|
* `parseRunAs` in `from-tf.ts`.
|
|
49
49
|
*/
|
|
50
50
|
function runAsValue(runAs, where, diagnostics) {
|
|
51
|
-
if (
|
|
51
|
+
if ("currentUser" in runAs)
|
|
52
52
|
return "current_user";
|
|
53
53
|
diagnostics.push(`${where}: runAs ${JSON.stringify(runAs)} has no terraform-path encoding yet (only { currentUser: true } is supported); dropped`);
|
|
54
54
|
return undefined;
|
|
@@ -248,6 +248,7 @@ export function agentToTf(entity, ctx) {
|
|
|
248
248
|
foreignAppRef: (l, n) => ctx.orgRefs.foreignApp(l, n),
|
|
249
249
|
foreignElementRef: (l, n) => ctx.orgRefs.foreignElement(l, n),
|
|
250
250
|
foreignFieldRef: (t, l, o, n) => ctx.orgRefs.foreignField(t, l, o, n),
|
|
251
|
+
workspaceAspects: ctx.workspaceAspects,
|
|
251
252
|
diagnostics: ctx.diagnostics,
|
|
252
253
|
});
|
|
253
254
|
if (tool !== undefined)
|