@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,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* approvalActivity — a HUMAN/APPROVAL step in a v2 flow. Pauses the flow until
|
|
3
|
-
* the referenced approval chain completes. The chain (referenced by token,
|
|
4
|
-
* resolved to an id at deploy) defines the approver set; no `configuration` is
|
|
5
|
-
* emitted.
|
|
6
|
-
*/
|
|
7
|
-
import { EdkValidationError } from "../../../../elementum-entity-client/errors.js";
|
|
8
|
-
export function approvalActivity(config) {
|
|
9
|
-
if (!config.name || config.name.trim() === "") {
|
|
10
|
-
throw new EdkValidationError("approvalActivity requires a non-empty name.");
|
|
11
|
-
}
|
|
12
|
-
return {
|
|
13
|
-
activityType: "HUMAN",
|
|
14
|
-
activitySubType: "APPROVAL",
|
|
15
|
-
name: config.name,
|
|
16
|
-
reference: config.approvalChain,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { AutomationRef } from "../../../catalog/index.js";
|
|
2
|
-
import type { FlowInputRefV2 } from "./input-refs.js";
|
|
3
|
-
import type { FlowActivityDefV2 } from "./types.js";
|
|
4
|
-
export interface AutomationActivityConfig {
|
|
5
|
-
/** Target automation (resolved to an id at deploy). Must be ACTIVE at run time. */
|
|
6
|
-
readonly automation: AutomationRef;
|
|
7
|
-
/** Display name for this activity in the flow. */
|
|
8
|
-
readonly name: string;
|
|
9
|
-
/** Input mapping keyed by the target automation's trigger parameter names. */
|
|
10
|
-
readonly inputs?: Record<string, FlowInputRefV2>;
|
|
11
|
-
}
|
|
12
|
-
export declare function automationActivity(config: AutomationActivityConfig): FlowActivityDefV2;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* automationActivity — an AUTOMATION step in a v2 flow. References an
|
|
3
|
-
* automation by token; optional `inputs` (the automation's trigger parameters)
|
|
4
|
-
* serialize into `configuration.inputs`.
|
|
5
|
-
*
|
|
6
|
-
* The automation must be ACTIVE for the platform to dispatch it — v2 doesn't
|
|
7
|
-
* carry the automation's status on its token, so this is validated server-side
|
|
8
|
-
* at run time (unlike v1's compile-time `EnsureActiveAutomation`).
|
|
9
|
-
*/
|
|
10
|
-
import { EdkValidationError } from "../../../../elementum-entity-client/errors.js";
|
|
11
|
-
export function automationActivity(config) {
|
|
12
|
-
if (!config.name || config.name.trim() === "") {
|
|
13
|
-
throw new EdkValidationError("automationActivity requires a non-empty name.");
|
|
14
|
-
}
|
|
15
|
-
const configuration = config.inputs && Object.keys(config.inputs).length > 0 ? { inputs: config.inputs } : undefined;
|
|
16
|
-
return {
|
|
17
|
-
activityType: "AUTOMATION",
|
|
18
|
-
name: config.name,
|
|
19
|
-
reference: config.automation,
|
|
20
|
-
...(configuration !== undefined ? { configuration } : {}),
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The typed context a lazy flow-activity factory receives:
|
|
3
|
-
*
|
|
4
|
-
* .activity("review", (ctx) => agentActivity({
|
|
5
|
-
* agent: app.agents.reviewer,
|
|
6
|
-
* name: "Review",
|
|
7
|
-
* inputs: { summary: ctx.activities.intake.outputs.summary },
|
|
8
|
-
* }))
|
|
9
|
-
*
|
|
10
|
-
* `ctx.activities.<key>.outputs.<name>` produces an `ACTIVITY_OUTPUT` ref to a
|
|
11
|
-
* prior activity; `ctx.literal(v)` a `LITERAL`. Record fields come in as
|
|
12
|
-
* `recordField(app.fields.x)` directly (v2 has no live owner-app proxy — the
|
|
13
|
-
* catalog already gives typed `FieldRef` tokens).
|
|
14
|
-
*
|
|
15
|
-
* This mirrors the agnostic intra-entity ctx pattern that automations-v2 reuses
|
|
16
|
-
* from `core/context`, but keyed to flow activities rather than tasks.
|
|
17
|
-
*/
|
|
18
|
-
import { type ActivityOutputRefV2, type LiteralRefV2 } from "./input-refs.js";
|
|
19
|
-
/** The output surface of a single prior activity. */
|
|
20
|
-
export interface FlowActivityOutputProxy {
|
|
21
|
-
/** `outputs.<name>` → an `ACTIVITY_OUTPUT` ref to this activity's named output. */
|
|
22
|
-
readonly outputs: Record<string, ActivityOutputRefV2>;
|
|
23
|
-
}
|
|
24
|
-
/** The typed flow context exposed to lazy activity factories. */
|
|
25
|
-
export interface FlowCtxV2<TActivities extends Record<string, unknown> = Record<string, FlowActivityOutputProxy>> {
|
|
26
|
-
/** Prior activities by key; each exposes `.outputs.<name>`. */
|
|
27
|
-
readonly activities: {
|
|
28
|
-
[K in keyof TActivities]: FlowActivityOutputProxy;
|
|
29
|
-
} & Record<string, FlowActivityOutputProxy>;
|
|
30
|
-
/** A static value baked into the flow. */
|
|
31
|
-
literal(value: string | number | boolean | null): LiteralRefV2;
|
|
32
|
-
}
|
|
33
|
-
/** Build the ctx for a lazy activity factory, given the keys registered so far. */
|
|
34
|
-
export declare function buildFlowCtxV2(priorKeys: readonly string[]): FlowCtxV2;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The typed context a lazy flow-activity factory receives:
|
|
3
|
-
*
|
|
4
|
-
* .activity("review", (ctx) => agentActivity({
|
|
5
|
-
* agent: app.agents.reviewer,
|
|
6
|
-
* name: "Review",
|
|
7
|
-
* inputs: { summary: ctx.activities.intake.outputs.summary },
|
|
8
|
-
* }))
|
|
9
|
-
*
|
|
10
|
-
* `ctx.activities.<key>.outputs.<name>` produces an `ACTIVITY_OUTPUT` ref to a
|
|
11
|
-
* prior activity; `ctx.literal(v)` a `LITERAL`. Record fields come in as
|
|
12
|
-
* `recordField(app.fields.x)` directly (v2 has no live owner-app proxy — the
|
|
13
|
-
* catalog already gives typed `FieldRef` tokens).
|
|
14
|
-
*
|
|
15
|
-
* This mirrors the agnostic intra-entity ctx pattern that automations-v2 reuses
|
|
16
|
-
* from `core/context`, but keyed to flow activities rather than tasks.
|
|
17
|
-
*/
|
|
18
|
-
import { activityOutput, literal } from "./input-refs.js";
|
|
19
|
-
function activityOutputProxy(key) {
|
|
20
|
-
return {
|
|
21
|
-
outputs: new Proxy({}, {
|
|
22
|
-
get: (_t, name) => activityOutput(key, String(name)),
|
|
23
|
-
}),
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
/** Build the ctx for a lazy activity factory, given the keys registered so far. */
|
|
27
|
-
export function buildFlowCtxV2(priorKeys) {
|
|
28
|
-
const known = new Set(priorKeys);
|
|
29
|
-
const activities = new Proxy({}, {
|
|
30
|
-
get: (_t, key) => {
|
|
31
|
-
const k = String(key);
|
|
32
|
-
// Permissive at runtime; the builder's typed keys drive autocomplete.
|
|
33
|
-
void known;
|
|
34
|
-
return activityOutputProxy(k);
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
return { activities, literal };
|
|
38
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { AspectRef, FieldRef } from "../../../catalog/index.js";
|
|
2
|
-
import { type RenderNode, type SerializedRenderTree } from "./render-catalog.js";
|
|
3
|
-
import type { FlowActivityDefV2 } from "./types.js";
|
|
4
|
-
export interface FormActivityConfig {
|
|
5
|
-
/** The app this form writes against (its fields back the bindings). */
|
|
6
|
-
readonly owner: AspectRef;
|
|
7
|
-
/** Display name for this activity in the flow. */
|
|
8
|
-
readonly name: string;
|
|
9
|
-
/** Single root `RenderNode` — build with the render-catalog helpers. */
|
|
10
|
-
readonly layout: RenderNode;
|
|
11
|
-
}
|
|
12
|
-
/** One field binding — `aspectFieldId` holds a FieldRef token (resolved at deploy). */
|
|
13
|
-
export interface SerializedFormFieldBindingV2 {
|
|
14
|
-
readonly elementId: string;
|
|
15
|
-
readonly aspectFieldId: FieldRef;
|
|
16
|
-
readonly statePath: unknown;
|
|
17
|
-
}
|
|
18
|
-
export interface SerializedFormConfigurationV2 {
|
|
19
|
-
readonly renderTree: SerializedRenderTree;
|
|
20
|
-
readonly fieldReferences: readonly SerializedFormFieldBindingV2[];
|
|
21
|
-
}
|
|
22
|
-
export declare function formActivity(config: FormActivityConfig): FlowActivityDefV2;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* formActivity — a HUMAN/FORM step in a v2 flow. The form UI is a json-render
|
|
3
|
-
* tree built from the v2 render-catalog helpers; field-binding leaves carry
|
|
4
|
-
* `FieldRef` tokens (resolved to ids at deploy). The serializer extracts the
|
|
5
|
-
* `fieldReferences` side-table Wolverine cross-checks.
|
|
6
|
-
*
|
|
7
|
-
* FORM is the one activity kind whose `configuration` the `/v1/flows/create`
|
|
8
|
-
* endpoint accepts.
|
|
9
|
-
*/
|
|
10
|
-
import { EdkValidationError } from "../../../../elementum-entity-client/errors.js";
|
|
11
|
-
import { serializeRenderTree, } from "./render-catalog.js";
|
|
12
|
-
export function formActivity(config) {
|
|
13
|
-
if (!config.name || config.name.trim() === "") {
|
|
14
|
-
throw new EdkValidationError("formActivity requires a non-empty name.");
|
|
15
|
-
}
|
|
16
|
-
const fieldReferences = [];
|
|
17
|
-
const renderTree = serializeRenderTree(config.layout, (node, elementId) => {
|
|
18
|
-
if (node.__binding) {
|
|
19
|
-
fieldReferences.push({
|
|
20
|
-
elementId,
|
|
21
|
-
aspectFieldId: node.__binding.aspectFieldId, // FieldRef token → id at deploy
|
|
22
|
-
statePath: node.__binding.statePath,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
if (fieldReferences.length === 0) {
|
|
27
|
-
throw new EdkValidationError(`formActivity "${config.name}" must surface at least one field-binding leaf ` +
|
|
28
|
-
`(inputFor / selectFor / textareaFor / ...). A form with no bindings writes nothing.`);
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
activityType: "HUMAN",
|
|
32
|
-
activitySubType: "FORM",
|
|
33
|
-
name: config.name,
|
|
34
|
-
configuration: { renderTree, fieldReferences },
|
|
35
|
-
};
|
|
36
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v2 flow activity factories + the input-ref / prompt vocabulary. Parallel to
|
|
3
|
-
* v1 `src/flows/activities`. Form activities (the render-catalog DSL) land in a
|
|
4
|
-
* follow-up; agent / automation / approval cover the orchestration core.
|
|
5
|
-
*/
|
|
6
|
-
export { agentActivity, type AgentActivityConfig } from "./agent.js";
|
|
7
|
-
export { automationActivity, type AutomationActivityConfig } from "./automation.js";
|
|
8
|
-
export { approvalActivity, type ApprovalActivityConfig } from "./approval.js";
|
|
9
|
-
export { formActivity, type FormActivityConfig, type SerializedFormConfigurationV2, type SerializedFormFieldBindingV2, } from "./form.js";
|
|
10
|
-
export { card, checkboxFor, email, fieldFor, grid, heading, inputFor, isRenderNode, maxLength, minLength, required, selectFor, separator, serializeRenderTree, stack, switchFor, text, textareaFor, type Check, type RenderNode, type SerializedRenderElement, type SerializedRenderTree, } from "./render-catalog.js";
|
|
11
|
-
export { activityOutput, isFlowInputRef, literal, recordField, type ActivityOutputRefV2, type FlowInputRefKind, type FlowInputRefV2, type LiteralRefV2, type RecordFieldRefV2, } from "./input-refs.js";
|
|
12
|
-
export { isPromptTemplate, literalPrompt, promptTemplate, type PromptTemplate, type PromptTemplateSegment, } from "./prompt-template.js";
|
|
13
|
-
export { buildFlowCtxV2, type FlowActivityOutputProxy, type FlowCtxV2 } from "./ctx.js";
|
|
14
|
-
export { type FlowActivityDefV2, type FlowActivityReferenceV2, type FlowActivitySubType, type FlowActivityType, } from "./types.js";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v2 flow activity factories + the input-ref / prompt vocabulary. Parallel to
|
|
3
|
-
* v1 `src/flows/activities`. Form activities (the render-catalog DSL) land in a
|
|
4
|
-
* follow-up; agent / automation / approval cover the orchestration core.
|
|
5
|
-
*/
|
|
6
|
-
export { agentActivity } from "./agent.js";
|
|
7
|
-
export { automationActivity } from "./automation.js";
|
|
8
|
-
export { approvalActivity } from "./approval.js";
|
|
9
|
-
export { formActivity, } from "./form.js";
|
|
10
|
-
export { card, checkboxFor, email, fieldFor, grid, heading, inputFor, isRenderNode, maxLength, minLength, required, selectFor, separator, serializeRenderTree, stack, switchFor, text, textareaFor, } from "./render-catalog.js";
|
|
11
|
-
export { activityOutput, isFlowInputRef, literal, recordField, } from "./input-refs.js";
|
|
12
|
-
export { isPromptTemplate, literalPrompt, promptTemplate, } from "./prompt-template.js";
|
|
13
|
-
export { buildFlowCtxV2 } from "./ctx.js";
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v2 flow activity input refs — the "where does this input come from?" vocabulary
|
|
3
|
-
* for `inputs:` declarations and `prompt:` segments. Parallel to v1
|
|
4
|
-
* `src/flows/activities/input-refs.ts`, but a record-field ref carries a
|
|
5
|
-
* **FieldRef token** (resolved to the field id at deploy) instead of a baked id.
|
|
6
|
-
*
|
|
7
|
-
* Three ref kinds:
|
|
8
|
-
* - `RECORD_FIELD` — a field on the bound record (`recordField(app.fields.x)`).
|
|
9
|
-
* - `ACTIVITY_OUTPUT` — a named output from a prior activity (usually via
|
|
10
|
-
* `ctx.activities.<key>.outputs.<name>`).
|
|
11
|
-
* - `LITERAL` — a static value baked into the flow.
|
|
12
|
-
*/
|
|
13
|
-
import type { FieldRef } from "../../../catalog/index.js";
|
|
14
|
-
export type FlowInputRefKind = "RECORD_FIELD" | "ACTIVITY_OUTPUT" | "LITERAL";
|
|
15
|
-
export interface RecordFieldRefV2 {
|
|
16
|
-
readonly kind: "RECORD_FIELD";
|
|
17
|
-
/** FieldRef token → the field id at deploy (`resolvePayload`). */
|
|
18
|
-
readonly fieldId: FieldRef;
|
|
19
|
-
}
|
|
20
|
-
export interface ActivityOutputRefV2 {
|
|
21
|
-
readonly kind: "ACTIVITY_OUTPUT";
|
|
22
|
-
/** The upstream activity's slug-key (matches `SerializedFlowActivity.key`). */
|
|
23
|
-
readonly activityKey: string;
|
|
24
|
-
/** Output property name on that activity. */
|
|
25
|
-
readonly outputName: string;
|
|
26
|
-
}
|
|
27
|
-
export interface LiteralRefV2 {
|
|
28
|
-
readonly kind: "LITERAL";
|
|
29
|
-
readonly value: string | number | boolean | null;
|
|
30
|
-
}
|
|
31
|
-
export type FlowInputRefV2 = RecordFieldRefV2 | ActivityOutputRefV2 | LiteralRefV2;
|
|
32
|
-
/** Read a value from a field on the bound record (token resolved at deploy). */
|
|
33
|
-
export declare function recordField(field: FieldRef): RecordFieldRefV2;
|
|
34
|
-
/** Read a named output from a prior activity. */
|
|
35
|
-
export declare function activityOutput(activityKey: string, outputName: string): ActivityOutputRefV2;
|
|
36
|
-
/** A static value baked into the flow. */
|
|
37
|
-
export declare function literal(value: string | number | boolean | null): LiteralRefV2;
|
|
38
|
-
/** Type guard: a value that's already a `FlowInputRefV2`. */
|
|
39
|
-
export declare function isFlowInputRef(value: unknown): value is FlowInputRefV2;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** Read a value from a field on the bound record (token resolved at deploy). */
|
|
2
|
-
export function recordField(field) {
|
|
3
|
-
return { kind: "RECORD_FIELD", fieldId: field };
|
|
4
|
-
}
|
|
5
|
-
/** Read a named output from a prior activity. */
|
|
6
|
-
export function activityOutput(activityKey, outputName) {
|
|
7
|
-
return { kind: "ACTIVITY_OUTPUT", activityKey, outputName };
|
|
8
|
-
}
|
|
9
|
-
/** A static value baked into the flow. */
|
|
10
|
-
export function literal(value) {
|
|
11
|
-
return { kind: "LITERAL", value };
|
|
12
|
-
}
|
|
13
|
-
/** Type guard: a value that's already a `FlowInputRefV2`. */
|
|
14
|
-
export function isFlowInputRef(value) {
|
|
15
|
-
if (typeof value !== "object" || value === null)
|
|
16
|
-
return false;
|
|
17
|
-
const kind = value.kind;
|
|
18
|
-
return kind === "RECORD_FIELD" || kind === "ACTIVITY_OUTPUT" || kind === "LITERAL";
|
|
19
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type FlowInputRefV2 } from "./input-refs.js";
|
|
2
|
-
export type PromptTemplateSegment = string | FlowInputRefV2;
|
|
3
|
-
export interface PromptTemplate {
|
|
4
|
-
readonly kind: "TEMPLATE";
|
|
5
|
-
readonly segments: ReadonlyArray<PromptTemplateSegment>;
|
|
6
|
-
}
|
|
7
|
-
/** Compose a prompt template from alternating string literals and refs. */
|
|
8
|
-
export declare function promptTemplate<T extends ReadonlyArray<PromptTemplateSegment>>(...segments: T): PromptTemplate;
|
|
9
|
-
/** Wrap a plain string as a uniform `PromptTemplate`. */
|
|
10
|
-
export declare function literalPrompt(value: string): PromptTemplate;
|
|
11
|
-
export declare function isPromptTemplate(value: unknown): value is PromptTemplate;
|
|
12
|
-
/** Runtime guard mirroring the compile-time `PromptTemplateSegment` constraint. */
|
|
13
|
-
export declare function validatePromptSegments(segments: ReadonlyArray<unknown>): void;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prompt-template helpers for `agentActivity({ prompt: ... })`. Composes an
|
|
3
|
-
* agent's initial prompt from alternating string literals and `FlowInputRefV2`s.
|
|
4
|
-
* Parallel to v1 `src/flows/activities/prompt-template.ts` (which is agnostic
|
|
5
|
-
* over the ref shape); kept separate so v2 refs (FieldRef-token-bearing) type
|
|
6
|
-
* cleanly.
|
|
7
|
-
*/
|
|
8
|
-
import { EdkValidationError } from "../../../../elementum-entity-client/errors.js";
|
|
9
|
-
import { isFlowInputRef } from "./input-refs.js";
|
|
10
|
-
/** Compose a prompt template from alternating string literals and refs. */
|
|
11
|
-
export function promptTemplate(...segments) {
|
|
12
|
-
return { kind: "TEMPLATE", segments };
|
|
13
|
-
}
|
|
14
|
-
/** Wrap a plain string as a uniform `PromptTemplate`. */
|
|
15
|
-
export function literalPrompt(value) {
|
|
16
|
-
return { kind: "TEMPLATE", segments: [value] };
|
|
17
|
-
}
|
|
18
|
-
export function isPromptTemplate(value) {
|
|
19
|
-
return (typeof value === "object" &&
|
|
20
|
-
value !== null &&
|
|
21
|
-
value.kind === "TEMPLATE" &&
|
|
22
|
-
Array.isArray(value.segments));
|
|
23
|
-
}
|
|
24
|
-
/** Runtime guard mirroring the compile-time `PromptTemplateSegment` constraint. */
|
|
25
|
-
export function validatePromptSegments(segments) {
|
|
26
|
-
for (let i = 0; i < segments.length; i++) {
|
|
27
|
-
const seg = segments[i];
|
|
28
|
-
if (typeof seg === "string")
|
|
29
|
-
continue;
|
|
30
|
-
if (isFlowInputRef(seg))
|
|
31
|
-
continue;
|
|
32
|
-
throw new EdkValidationError(`promptTemplate segment[${i}] must be a string or FlowInputRef, got ${typeof seg}`);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v2 flow activity definitions. Parallel to v1 `src/flows/activities/types.ts`,
|
|
3
|
-
* but an activity's `reference` is a **CatalogRef token** (agent / automation /
|
|
4
|
-
* approval-chain handle) resolved to an id at deploy — not a live `.id`.
|
|
5
|
-
*
|
|
6
|
-
* For HUMAN/FORM activities there is no outbound reference (the form owns its
|
|
7
|
-
* schema via `configuration`); for HUMAN/APPROVAL the reference is the approval
|
|
8
|
-
* chain and there is no configuration.
|
|
9
|
-
*/
|
|
10
|
-
import type { AgentRef, ApprovalChainRef, AutomationRef } from "../../../catalog/index.js";
|
|
11
|
-
export type FlowActivityType = "AGENT" | "AUTOMATION" | "HUMAN";
|
|
12
|
-
/** Sub-type discriminator — only meaningful for HUMAN activities. */
|
|
13
|
-
export type FlowActivitySubType = "FORM" | "APPROVAL";
|
|
14
|
-
/** The token an activity points at (resolved to an id at deploy). */
|
|
15
|
-
export type FlowActivityReferenceV2 = AgentRef | AutomationRef | ApprovalChainRef;
|
|
16
|
-
/**
|
|
17
|
-
* The phantom output shape an activity exposes to downstream activities via
|
|
18
|
-
* `ctx.activities.<key>`. Loose today (`outputs.<name>` accepts any name);
|
|
19
|
-
* per-kind typed outputs land with the form render-catalog port.
|
|
20
|
-
*/
|
|
21
|
-
export type FlowActivityOutputsV2 = unknown;
|
|
22
|
-
export interface FlowActivityDefV2<TOutputs = FlowActivityOutputsV2> {
|
|
23
|
-
readonly activityType: FlowActivityType;
|
|
24
|
-
/** Only set for HUMAN activities — omitted for AGENT / AUTOMATION. */
|
|
25
|
-
readonly activitySubType?: FlowActivitySubType;
|
|
26
|
-
readonly name: string;
|
|
27
|
-
/** Outbound reference token. Optional — HUMAN/FORM activities are self-contained. */
|
|
28
|
-
readonly reference?: FlowActivityReferenceV2;
|
|
29
|
-
/** Opaque per-activity config (e.g. `{ inputs }`, `{ prompt }`, form render tree). */
|
|
30
|
-
readonly configuration?: Record<string, unknown>;
|
|
31
|
-
/** Phantom — carries the typed output shape for `ctx.activities.<key>`. */
|
|
32
|
-
readonly __outputs?: TOutputs;
|
|
33
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { FlowRef } from "../../catalog/index.js";
|
|
2
|
-
import type { Simplify } from "../shared/ref.js";
|
|
3
|
-
import type { DeployableEntity, EntityDeployOptions } from "../../engine/entity.js";
|
|
4
|
-
import { type FlowActivityOutputProxy, type FlowCtxV2 } from "./activities/ctx.js";
|
|
5
|
-
import type { FlowActivityDefV2 } from "./activities/types.js";
|
|
6
|
-
import { type FlowStartType, type FlowStatus } from "./serialize.js";
|
|
7
|
-
/** A v2 wire filter (may embed FieldRef tokens) — the `startWhen` shape. */
|
|
8
|
-
export type FlowFilter = Record<string, unknown>;
|
|
9
|
-
/** An activity slot: a built def or a lazy `(ctx) => def` for typed prior-output refs. */
|
|
10
|
-
export type FlowActivityFactory<TActivities extends Record<string, unknown>> = FlowActivityDefV2 | ((ctx: FlowCtxV2<TActivities>) => FlowActivityDefV2);
|
|
11
|
-
/** Branch condition — a label string, or a `(ctx) => string` for typed authoring. */
|
|
12
|
-
export type BranchConditionFactory<TActivities extends Record<string, unknown>> = string | ((ctx: FlowCtxV2<TActivities>) => string);
|
|
13
|
-
type AddActivity<TActivities, K extends string> = Simplify<TActivities & Record<K, FlowActivityOutputProxy>>;
|
|
14
|
-
export interface DefineFlowV2Options extends EntityDeployOptions {
|
|
15
|
-
readonly handle?: string;
|
|
16
|
-
readonly name: string;
|
|
17
|
-
readonly parent?: string;
|
|
18
|
-
readonly description?: string;
|
|
19
|
-
readonly starts?: readonly FlowStartType[];
|
|
20
|
-
readonly status?: FlowStatus;
|
|
21
|
-
/** Record-creation filter over the owner app's fields (build with the v2 filter DSL). */
|
|
22
|
-
readonly startWhen?: FlowFilter;
|
|
23
|
-
}
|
|
24
|
-
export interface FlowConfigured<TActivities extends Record<string, unknown> = Record<string, FlowActivityOutputProxy>> {
|
|
25
|
-
readonly ref: FlowRef;
|
|
26
|
-
activity(factoryOrDef: FlowActivityFactory<TActivities>): FlowWithActivity<TActivities>;
|
|
27
|
-
activity<K extends string>(key: K, factoryOrDef: FlowActivityFactory<TActivities>): FlowWithActivity<AddActivity<TActivities, K>>;
|
|
28
|
-
build(): DeployableEntity;
|
|
29
|
-
}
|
|
30
|
-
export interface FlowWithActivity<TActivities extends Record<string, unknown> = Record<string, FlowActivityOutputProxy>> {
|
|
31
|
-
/** A conditional branch off the previous activity. */
|
|
32
|
-
branch(condition: BranchConditionFactory<TActivities>, ...activities: Array<FlowActivityFactory<TActivities>>): FlowWithActivity<TActivities>;
|
|
33
|
-
activity(factoryOrDef: FlowActivityFactory<TActivities>): FlowWithActivity<TActivities>;
|
|
34
|
-
activity<K extends string>(key: K, factoryOrDef: FlowActivityFactory<TActivities>): FlowWithActivity<AddActivity<TActivities, K>>;
|
|
35
|
-
build(): DeployableEntity;
|
|
36
|
-
}
|
|
37
|
-
export declare function defineFlow(opts: DefineFlowV2Options): FlowConfigured;
|
|
38
|
-
export {};
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v2 flow authoring — `defineFlow`. Parallel to v1 `src/flows/builder.ts`,
|
|
3
|
-
* but standalone: it produces a `DeployableEntity { kind:"flow", parent, handle, payload }`
|
|
4
|
-
* whose activity references are CatalogRef tokens (resolved at deploy), not live
|
|
5
|
-
* `.id`s.
|
|
6
|
-
*
|
|
7
|
-
* defineFlow({ name:"Triage", parent:"incidents" })
|
|
8
|
-
* .activity("intake", agentActivity({ agent: app.agents.intake, name: "Intake" }))
|
|
9
|
-
* .activity((ctx) => automationActivity({
|
|
10
|
-
* automation: app.automations.escalate,
|
|
11
|
-
* name: "Escalate",
|
|
12
|
-
* inputs: { summary: ctx.activities.intake.outputs.summary },
|
|
13
|
-
* }))
|
|
14
|
-
* .build()
|
|
15
|
-
*
|
|
16
|
-
* Flows are CREATE-ONLY on the platform — a changed, already-deployed flow is
|
|
17
|
-
* surfaced by the deploy as unsupported-update (delete + re-create), not a PUT.
|
|
18
|
-
*
|
|
19
|
-
* Slice scope: agent / automation / approval activities, branches, starts,
|
|
20
|
-
* status, and `startWhen` (a v2 filter over the owner app's fields). Form
|
|
21
|
-
* activities (the render-catalog DSL) follow.
|
|
22
|
-
*/
|
|
23
|
-
import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
|
|
24
|
-
import { slugifyActivityName } from "./util.js";
|
|
25
|
-
import { buildFlowCtxV2 } from "./activities/ctx.js";
|
|
26
|
-
import { serializeFlowV2, } from "./serialize.js";
|
|
27
|
-
export function defineFlow(opts) {
|
|
28
|
-
const name = opts.name;
|
|
29
|
-
if (!name || name.trim() === "") {
|
|
30
|
-
throw new EdkValidationError("defineFlow requires a non-empty name.");
|
|
31
|
-
}
|
|
32
|
-
const nodes = [];
|
|
33
|
-
// Registered activity keys (in order) — drive the ctx `activities` proxy.
|
|
34
|
-
const keys = [];
|
|
35
|
-
function resolveFactory(factory) {
|
|
36
|
-
return typeof factory === "function" ? factory(buildFlowCtxV2(keys)) : factory;
|
|
37
|
-
}
|
|
38
|
-
function registerActivity(factory, explicitKey) {
|
|
39
|
-
const def = resolveFactory(factory);
|
|
40
|
-
if (!def.name || def.name.trim() === "") {
|
|
41
|
-
throw new EdkValidationError("Flow activity requires a non-empty name.");
|
|
42
|
-
}
|
|
43
|
-
// The key drives both `ctx.activities.<key>` and the wire `key` (so refs
|
|
44
|
-
// line up): explicit key when given, else the activity-name slug.
|
|
45
|
-
const key = explicitKey ?? slugifyActivityName(def.name);
|
|
46
|
-
keys.push(key);
|
|
47
|
-
const node = { def, key, branches: [] };
|
|
48
|
-
nodes.push(node);
|
|
49
|
-
return node;
|
|
50
|
-
}
|
|
51
|
-
function resolveCondition(condition) {
|
|
52
|
-
const out = typeof condition === "function" ? condition(buildFlowCtxV2(keys)) : condition;
|
|
53
|
-
if (!out || out.trim() === "") {
|
|
54
|
-
throw new EdkValidationError("branch(condition, ...) requires a non-empty condition string.");
|
|
55
|
-
}
|
|
56
|
-
return out;
|
|
57
|
-
}
|
|
58
|
-
function build() {
|
|
59
|
-
return {
|
|
60
|
-
kind: "flow",
|
|
61
|
-
parent: opts.parent ?? "",
|
|
62
|
-
refName: opts.handle ?? "",
|
|
63
|
-
payload: serializeFlowV2({
|
|
64
|
-
name,
|
|
65
|
-
...(opts.description !== undefined ? { description: opts.description } : {}),
|
|
66
|
-
...(opts.starts !== undefined ? { starts: opts.starts } : {}),
|
|
67
|
-
...(opts.status !== undefined ? { status: opts.status } : {}),
|
|
68
|
-
...(opts.startWhen !== undefined ? { startWhen: opts.startWhen } : {}),
|
|
69
|
-
nodes,
|
|
70
|
-
}),
|
|
71
|
-
...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}),
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function withActivity(node) {
|
|
75
|
-
const api = {
|
|
76
|
-
branch(condition, ...activities) {
|
|
77
|
-
const conditionString = resolveCondition(condition);
|
|
78
|
-
if (activities.length === 0) {
|
|
79
|
-
throw new EdkValidationError(`branch "${conditionString}" requires at least one activity.`);
|
|
80
|
-
}
|
|
81
|
-
// Branch activities are mutated onto the parent node's branch list.
|
|
82
|
-
const resolved = activities.map((a) => resolveFactory(a));
|
|
83
|
-
node.branches.push({ condition: conditionString, activities: resolved });
|
|
84
|
-
return api;
|
|
85
|
-
},
|
|
86
|
-
activity(...args) {
|
|
87
|
-
const { factory, key } = parseActivityArgs(args);
|
|
88
|
-
return withActivity(registerActivity(factory, key));
|
|
89
|
-
},
|
|
90
|
-
build,
|
|
91
|
-
};
|
|
92
|
-
return api;
|
|
93
|
-
}
|
|
94
|
-
const ref = { __kind: "flow", refName: opts.handle ?? "", name: opts.name, parent: opts.parent ?? "" };
|
|
95
|
-
return {
|
|
96
|
-
ref,
|
|
97
|
-
activity(...args) {
|
|
98
|
-
const { factory, key } = parseActivityArgs(args);
|
|
99
|
-
return withActivity(registerActivity(factory, key));
|
|
100
|
-
},
|
|
101
|
-
build,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
/** Disambiguate `activity(def)` from `activity(key, def)`. */
|
|
105
|
-
function parseActivityArgs(args) {
|
|
106
|
-
if (args.length === 0)
|
|
107
|
-
throw new EdkValidationError("activity(...) requires at least one argument.");
|
|
108
|
-
if (typeof args[0] === "string") {
|
|
109
|
-
if (args.length < 2) {
|
|
110
|
-
throw new EdkValidationError(`activity("${args[0]}", factoryOrDef) requires the second argument.`);
|
|
111
|
-
}
|
|
112
|
-
return { factory: args[1], key: args[0] };
|
|
113
|
-
}
|
|
114
|
-
return { factory: args[0] };
|
|
115
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v2 flow authoring — `defineFlow`. App-owned; create-only on the platform.
|
|
3
|
-
* Standalone from v1's `src/flows`. Activity factories + the input-ref / prompt
|
|
4
|
-
* vocabulary live under `./activities`.
|
|
5
|
-
*/
|
|
6
|
-
export { defineFlow, type BranchConditionFactory, type DefineFlowV2Options, type FlowActivityFactory, type FlowConfigured, type FlowFilter, type FlowWithActivity, } from "./build.js";
|
|
7
|
-
export { type FlowStartType, type FlowStatus, type SerializedFlowActivity, type SerializedFlow, } from "./serialize.js";
|
|
8
|
-
export * from "./activities/index.js";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v2 flow authoring — `defineFlow`. App-owned; create-only on the platform.
|
|
3
|
-
* Standalone from v1's `src/flows`. Activity factories + the input-ref / prompt
|
|
4
|
-
* vocabulary live under `./activities`.
|
|
5
|
-
*/
|
|
6
|
-
export { defineFlow, } from "./build.js";
|
|
7
|
-
export * from "./activities/index.js";
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { FlowActivityDefV2 } from "./activities/types.js";
|
|
2
|
-
export type FlowStartType = "WEB" | "PHONE" | "EMAIL" | "AUTOMATION" | "SERVICE_REQUEST" | "SLACK" | "GOOGLE_CHAT" | "MS_TEAMS";
|
|
3
|
-
export type FlowStatus = "DRAFT" | "ACTIVE";
|
|
4
|
-
/** One activity node in the builder tree (a main-path activity + its branches). */
|
|
5
|
-
export interface FlowActivityNodeV2 {
|
|
6
|
-
readonly def: FlowActivityDefV2;
|
|
7
|
-
/** The activity's key — explicit `.activity(key, …)` or the name slug. Drives the wire key + ctx refs. */
|
|
8
|
-
readonly key: string;
|
|
9
|
-
readonly branches: readonly FlowBranchV2[];
|
|
10
|
-
}
|
|
11
|
-
export interface FlowBranchV2 {
|
|
12
|
-
readonly condition: string;
|
|
13
|
-
readonly activities: readonly FlowActivityDefV2[];
|
|
14
|
-
}
|
|
15
|
-
export interface SerializedFlowActivity {
|
|
16
|
-
readonly key: string;
|
|
17
|
-
readonly type: string;
|
|
18
|
-
readonly subType?: "FORM" | "APPROVAL";
|
|
19
|
-
readonly name: string;
|
|
20
|
-
/** CatalogRef token pre-resolution; the field id after deploy. */
|
|
21
|
-
readonly referenceId?: unknown;
|
|
22
|
-
readonly configuration?: Record<string, unknown>;
|
|
23
|
-
readonly branchParentKey?: string;
|
|
24
|
-
readonly branchCondition?: string;
|
|
25
|
-
}
|
|
26
|
-
/** The flow payload minus `appId` (injected at the wire boundary). */
|
|
27
|
-
export interface SerializedFlow {
|
|
28
|
-
readonly name: string;
|
|
29
|
-
readonly description?: string;
|
|
30
|
-
readonly starts?: readonly FlowStartType[];
|
|
31
|
-
readonly startWhen?: Record<string, unknown>;
|
|
32
|
-
readonly status?: FlowStatus;
|
|
33
|
-
readonly activities: readonly SerializedFlowActivity[];
|
|
34
|
-
}
|
|
35
|
-
export interface SerializeFlowV2Input {
|
|
36
|
-
readonly name: string;
|
|
37
|
-
readonly description?: string;
|
|
38
|
-
readonly starts?: readonly FlowStartType[];
|
|
39
|
-
readonly startWhen?: Record<string, unknown>;
|
|
40
|
-
readonly status?: FlowStatus;
|
|
41
|
-
readonly nodes: readonly FlowActivityNodeV2[];
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Deep-walk a config node: internal `Ref`s → wire ref JSON; `CatalogRef` tokens
|
|
45
|
-
* slimmed + left in place (resolved at deploy); arrays/objects recursed.
|
|
46
|
-
* (Same body as automations-v2's `serializeNode`; consolidates to `core` at the
|
|
47
|
-
* cutover.)
|
|
48
|
-
*/
|
|
49
|
-
export declare function serializeNode(node: unknown): unknown;
|
|
50
|
-
/** Serialize the flow to its handle-form payload (tokens intact, no `appId`). */
|
|
51
|
-
export declare function serializeFlowV2(input: SerializeFlowV2Input): SerializedFlow;
|