@elementumai/edk 0.0.0-oidc-bootstrap → 0.8.1
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 +462 -3
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +188 -0
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.js +20 -0
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent.d.ts +245 -0
- package/dist-sdk/elementum-entity-client/clients/agents/models/agent.js +30 -0
- package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.d.ts +18 -0
- package/dist-sdk/elementum-entity-client/clients/ai-provider-connectors/models/ai-provider-connector.js +8 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.d.ts +718 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/aspect.js +52 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.d.ts +23 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-base.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.d.ts +148 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/field-types.js +12 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/format.d.ts +63 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/format.js +17 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +39 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/index.js +35 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +116 -0
- package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.js +11 -0
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +178 -0
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.js +18 -0
- package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.d.ts +200 -0
- package/dist-sdk/elementum-entity-client/clients/document-models/models/document-model.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.d.ts +1 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/index.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.d.ts +141 -0
- package/dist-sdk/elementum-entity-client/clients/search-tables/models/search-table-wire.js +22 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +123 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.js +14 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +78 -0
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +23 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/index.d.ts +1 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/index.js +1 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.d.ts +265 -0
- package/dist-sdk/elementum-entity-client/clients/tables/models/table-wire.js +15 -0
- package/dist-sdk/elementum-entity-client/errors.d.ts +90 -0
- package/dist-sdk/elementum-entity-client/errors.js +111 -0
- package/dist-sdk/elementum-entity-client/models/connection.d.ts +30 -0
- package/dist-sdk/elementum-entity-client/models/connection.js +16 -0
- package/dist-sdk/elementum-entity-client/types.d.ts +71 -0
- package/dist-sdk/elementum-entity-client/types.js +1 -0
- package/dist-sdk/fs/entity.d.ts +104 -0
- package/dist-sdk/fs/entity.js +52 -0
- package/dist-sdk/pull/util.d.ts +130 -0
- package/dist-sdk/pull/util.js +204 -0
- package/dist-sdk/src/catalog/ai-provider-models.d.ts +30 -0
- package/dist-sdk/src/catalog/ai-provider-models.js +63 -0
- package/dist-sdk/src/catalog/factories.d.ts +242 -0
- package/dist-sdk/src/catalog/factories.js +265 -0
- package/dist-sdk/src/catalog/from-authoring.d.ts +103 -0
- package/dist-sdk/src/catalog/from-authoring.js +467 -0
- package/dist-sdk/src/catalog/index.d.ts +12 -0
- package/dist-sdk/src/catalog/index.js +12 -0
- package/dist-sdk/src/catalog/org.d.ts +11 -0
- package/dist-sdk/src/catalog/org.js +288 -0
- package/dist-sdk/src/catalog/render-helpers.d.ts +35 -0
- package/dist-sdk/src/catalog/render-helpers.js +82 -0
- package/dist-sdk/src/catalog/render.d.ts +48 -0
- package/dist-sdk/src/catalog/render.js +193 -0
- package/dist-sdk/src/catalog/token.d.ts +10 -0
- package/dist-sdk/src/catalog/token.js +76 -0
- package/dist-sdk/src/catalog/types.d.ts +215 -0
- package/dist-sdk/src/catalog/types.js +86 -0
- package/dist-sdk/src/catalog/write.d.ts +43 -0
- package/dist-sdk/src/catalog/write.js +109 -0
- package/dist-sdk/src/core/app-to-ui.d.ts +22 -0
- package/dist-sdk/src/core/app-to-ui.js +75 -0
- package/dist-sdk/src/core/index.d.ts +10 -0
- package/dist-sdk/src/core/index.js +9 -0
- package/dist-sdk/src/core/system-fields.d.ts +95 -0
- package/dist-sdk/src/core/system-fields.js +153 -0
- package/dist-sdk/src/core/triggers/on-demand.d.ts +144 -0
- package/dist-sdk/src/core/triggers/on-demand.js +112 -0
- package/dist-sdk/src/core/types/ai-provider.d.ts +23 -0
- package/dist-sdk/src/core/types/ai-provider.js +8 -0
- package/dist-sdk/src/core/types/app.d.ts +857 -0
- package/dist-sdk/src/core/types/app.js +210 -0
- package/dist-sdk/src/core/types/aspect-category.d.ts +35 -0
- package/dist-sdk/src/core/types/aspect-category.js +33 -0
- package/dist-sdk/src/core/types/cloud-link.d.ts +34 -0
- package/dist-sdk/src/core/types/cloud-link.js +32 -0
- package/dist-sdk/src/core/types/display-block.d.ts +149 -0
- package/dist-sdk/src/core/types/display-block.js +61 -0
- package/dist-sdk/src/core/types/group.d.ts +13 -0
- package/dist-sdk/src/core/types/group.js +6 -0
- package/dist-sdk/src/core/types/platform.d.ts +2 -0
- package/dist-sdk/src/core/types/platform.js +1 -0
- package/dist-sdk/src/core/types/user.d.ts +20 -0
- package/dist-sdk/src/core/types/user.js +8 -0
- package/dist-sdk/src/core/wire/ref-serializer.d.ts +45 -0
- package/dist-sdk/src/core/wire/ref-serializer.js +89 -0
- package/dist-sdk/src/engine/build/context.d.ts +67 -0
- package/dist-sdk/src/engine/build/context.js +6 -0
- package/dist-sdk/src/engine/build/source-context.d.ts +45 -0
- package/dist-sdk/src/engine/build/source-context.js +23 -0
- package/dist-sdk/src/engine/entity.d.ts +44 -0
- package/dist-sdk/src/engine/entity.js +15 -0
- package/dist-sdk/src/engine/pull/context.d.ts +38 -0
- package/dist-sdk/src/engine/pull/context.js +44 -0
- package/dist-sdk/src/engine/pull/org.d.ts +54 -0
- package/dist-sdk/src/engine/pull/org.js +134 -0
- package/dist-sdk/src/engine/tf/escape.d.ts +22 -0
- package/dist-sdk/src/engine/tf/escape.js +28 -0
- package/dist-sdk/src/engine/tf/expr.d.ts +25 -0
- package/dist-sdk/src/engine/tf/expr.js +405 -0
- package/dist-sdk/src/engine/tf/index.d.ts +12 -0
- package/dist-sdk/src/engine/tf/index.js +11 -0
- package/dist-sdk/src/engine/tf/labels.d.ts +76 -0
- package/dist-sdk/src/engine/tf/labels.js +196 -0
- package/dist-sdk/src/engine/tf/model.d.ts +84 -0
- package/dist-sdk/src/engine/tf/model.js +49 -0
- package/dist-sdk/src/engine/tf/parse.d.ts +41 -0
- package/dist-sdk/src/engine/tf/parse.js +189 -0
- package/dist-sdk/src/engine/tf/render.d.ts +13 -0
- package/dist-sdk/src/engine/tf/render.js +102 -0
- package/dist-sdk/src/engine/workspace/authoring-layout.d.ts +43 -0
- package/dist-sdk/src/engine/workspace/authoring-layout.js +201 -0
- package/dist-sdk/src/entities/access-policy/build.d.ts +26 -0
- package/dist-sdk/src/entities/access-policy/build.js +7 -0
- package/dist-sdk/src/entities/access-policy/filter.d.ts +61 -0
- package/dist-sdk/src/entities/access-policy/filter.js +83 -0
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +48 -0
- package/dist-sdk/src/entities/access-policy/from-tf.js +189 -0
- package/dist-sdk/src/entities/access-policy/module.d.ts +3 -0
- package/dist-sdk/src/entities/access-policy/module.js +17 -0
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +36 -0
- package/dist-sdk/src/entities/access-policy/to-tf.js +149 -0
- package/dist-sdk/src/entities/access-policy/types.d.ts +4 -0
- package/dist-sdk/src/entities/access-policy/types.js +10 -0
- package/dist-sdk/src/entities/agent/build.d.ts +108 -0
- package/dist-sdk/src/entities/agent/build.js +148 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +53 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +344 -0
- package/dist-sdk/src/entities/agent/from-tf.d.ts +65 -0
- package/dist-sdk/src/entities/agent/from-tf.js +289 -0
- package/dist-sdk/src/entities/agent/index.d.ts +7 -0
- package/dist-sdk/src/entities/agent/index.js +7 -0
- package/dist-sdk/src/entities/agent/module.d.ts +4 -0
- package/dist-sdk/src/entities/agent/module.js +122 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/agent/to-tf.js +188 -0
- package/dist-sdk/src/entities/agent/tools.d.ts +284 -0
- package/dist-sdk/src/entities/agent/tools.js +238 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +110 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.js +265 -0
- package/dist-sdk/src/entities/agent-tool/module.d.ts +3 -0
- package/dist-sdk/src/entities/agent-tool/module.js +32 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +40 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.js +250 -0
- package/dist-sdk/src/entities/agent-tool/types.d.ts +43 -0
- package/dist-sdk/src/entities/agent-tool/types.js +102 -0
- package/dist-sdk/src/entities/app/build.d.ts +368 -0
- package/dist-sdk/src/entities/app/build.js +372 -0
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +168 -0
- package/dist-sdk/src/entities/app/deserializer/normalize.js +12 -0
- package/dist-sdk/src/entities/app/display-blocks.d.ts +26 -0
- package/dist-sdk/src/entities/app/display-blocks.js +34 -0
- package/dist-sdk/src/entities/app/from-tf.d.ts +23 -0
- package/dist-sdk/src/entities/app/from-tf.js +197 -0
- package/dist-sdk/src/entities/app/index.d.ts +14 -0
- package/dist-sdk/src/entities/app/index.js +11 -0
- package/dist-sdk/src/entities/app/locals.d.ts +11 -0
- package/dist-sdk/src/entities/app/locals.js +31 -0
- package/dist-sdk/src/entities/app/module.d.ts +4 -0
- package/dist-sdk/src/entities/app/module.js +66 -0
- package/dist-sdk/src/entities/app/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/app/to-tf.js +212 -0
- package/dist-sdk/src/entities/approval-chain/build.d.ts +24 -0
- package/dist-sdk/src/entities/approval-chain/build.js +56 -0
- package/dist-sdk/src/entities/approval-chain/index.d.ts +6 -0
- package/dist-sdk/src/entities/approval-chain/index.js +6 -0
- package/dist-sdk/src/entities/approval-chain/steps.d.ts +24 -0
- package/dist-sdk/src/entities/approval-chain/steps.js +20 -0
- package/dist-sdk/src/entities/automation/build.d.ts +259 -0
- package/dist-sdk/src/entities/automation/build.js +436 -0
- package/dist-sdk/src/entities/automation/catalog-render.d.ts +5 -0
- package/dist-sdk/src/entities/automation/catalog-render.js +35 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +152 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.js +13 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +55 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +1176 -0
- package/dist-sdk/src/entities/automation/filter.d.ts +93 -0
- package/dist-sdk/src/entities/automation/filter.js +156 -0
- package/dist-sdk/src/entities/automation/from-tf.d.ts +35 -0
- package/dist-sdk/src/entities/automation/from-tf.js +1258 -0
- package/dist-sdk/src/entities/automation/index.d.ts +22 -0
- package/dist-sdk/src/entities/automation/index.js +25 -0
- package/dist-sdk/src/entities/automation/module.d.ts +3 -0
- package/dist-sdk/src/entities/automation/module.js +150 -0
- package/dist-sdk/src/entities/automation/operators.d.ts +93 -0
- package/dist-sdk/src/entities/automation/operators.js +69 -0
- package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +19 -0
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +24 -0
- package/dist-sdk/src/entities/automation/script-code.d.ts +51 -0
- package/dist-sdk/src/entities/automation/script-code.js +633 -0
- package/dist-sdk/src/entities/automation/serialize.d.ts +6 -0
- package/dist-sdk/src/entities/automation/serialize.js +41 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +641 -0
- package/dist-sdk/src/entities/automation/tasks.js +765 -0
- package/dist-sdk/src/entities/automation/to-tf.d.ts +19 -0
- package/dist-sdk/src/entities/automation/to-tf.js +1169 -0
- package/dist-sdk/src/entities/automation/triggers.d.ts +205 -0
- package/dist-sdk/src/entities/automation/triggers.js +202 -0
- package/dist-sdk/src/entities/automation/types.d.ts +78 -0
- package/dist-sdk/src/entities/automation/types.js +131 -0
- package/dist-sdk/src/entities/element/build.d.ts +121 -0
- package/dist-sdk/src/entities/element/build.js +110 -0
- package/dist-sdk/src/entities/element/from-tf.d.ts +19 -0
- package/dist-sdk/src/entities/element/from-tf.js +170 -0
- package/dist-sdk/src/entities/element/index.d.ts +12 -0
- package/dist-sdk/src/entities/element/index.js +10 -0
- package/dist-sdk/src/entities/element/locals.d.ts +7 -0
- package/dist-sdk/src/entities/element/locals.js +12 -0
- package/dist-sdk/src/entities/element/module.d.ts +8 -0
- package/dist-sdk/src/entities/element/module.js +65 -0
- package/dist-sdk/src/entities/element/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/element/to-tf.js +169 -0
- package/dist-sdk/src/entities/field/build.d.ts +112 -0
- package/dist-sdk/src/entities/field/build.js +84 -0
- package/dist-sdk/src/entities/field/calc/aggregate.d.ts +60 -0
- package/dist-sdk/src/entities/field/calc/aggregate.js +71 -0
- package/dist-sdk/src/entities/field/calc/date.d.ts +73 -0
- package/dist-sdk/src/entities/field/calc/date.js +109 -0
- package/dist-sdk/src/entities/field/calc/index.d.ts +229 -0
- package/dist-sdk/src/entities/field/calc/index.js +433 -0
- package/dist-sdk/src/entities/field/calc/numeric.d.ts +22 -0
- package/dist-sdk/src/entities/field/calc/numeric.js +67 -0
- package/dist-sdk/src/entities/field/calc/runtime.d.ts +61 -0
- package/dist-sdk/src/entities/field/calc/runtime.js +174 -0
- package/dist-sdk/src/entities/field/calc/text.d.ts +100 -0
- package/dist-sdk/src/entities/field/calc/text.js +208 -0
- package/dist-sdk/src/entities/field/calc/types.d.ts +86 -0
- package/dist-sdk/src/entities/field/calc/types.js +23 -0
- package/dist-sdk/src/entities/field/calc.d.ts +108 -0
- package/dist-sdk/src/entities/field/calc.js +54 -0
- package/dist-sdk/src/entities/field/from-tf.d.ts +31 -0
- package/dist-sdk/src/entities/field/from-tf.js +184 -0
- package/dist-sdk/src/entities/field/locals.d.ts +8 -0
- package/dist-sdk/src/entities/field/locals.js +24 -0
- package/dist-sdk/src/entities/field/module.d.ts +3 -0
- package/dist-sdk/src/entities/field/module.js +50 -0
- package/dist-sdk/src/entities/field/options.d.ts +27 -0
- package/dist-sdk/src/entities/field/options.js +76 -0
- package/dist-sdk/src/entities/field/record-shape.d.ts +57 -0
- package/dist-sdk/src/entities/field/record-shape.js +1 -0
- package/dist-sdk/src/entities/field/to-tf.d.ts +73 -0
- package/dist-sdk/src/entities/field/to-tf.js +142 -0
- package/dist-sdk/src/entities/field/types.d.ts +53 -0
- package/dist-sdk/src/entities/field/types.js +68 -0
- package/dist-sdk/src/entities/file-reader/build.d.ts +182 -0
- package/dist-sdk/src/entities/file-reader/build.js +105 -0
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +6 -0
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +109 -0
- package/dist-sdk/src/entities/file-reader/from-tf.d.ts +13 -0
- package/dist-sdk/src/entities/file-reader/from-tf.js +172 -0
- package/dist-sdk/src/entities/file-reader/index.d.ts +10 -0
- package/dist-sdk/src/entities/file-reader/index.js +10 -0
- package/dist-sdk/src/entities/file-reader/module.d.ts +3 -0
- package/dist-sdk/src/entities/file-reader/module.js +115 -0
- package/dist-sdk/src/entities/file-reader/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/file-reader/to-tf.js +84 -0
- package/dist-sdk/src/entities/file-reader/types.d.ts +32 -0
- package/dist-sdk/src/entities/file-reader/types.js +30 -0
- package/dist-sdk/src/entities/flow/activities/agent.d.ts +15 -0
- package/dist-sdk/src/entities/flow/activities/agent.js +29 -0
- package/dist-sdk/src/entities/flow/activities/approval.d.ts +9 -0
- package/dist-sdk/src/entities/flow/activities/approval.js +18 -0
- package/dist-sdk/src/entities/flow/activities/automation.d.ts +12 -0
- package/dist-sdk/src/entities/flow/activities/automation.js +22 -0
- package/dist-sdk/src/entities/flow/activities/ctx.d.ts +34 -0
- package/dist-sdk/src/entities/flow/activities/ctx.js +38 -0
- package/dist-sdk/src/entities/flow/activities/form.d.ts +22 -0
- package/dist-sdk/src/entities/flow/activities/form.js +36 -0
- package/dist-sdk/src/entities/flow/activities/index.d.ts +14 -0
- package/dist-sdk/src/entities/flow/activities/index.js +13 -0
- package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +39 -0
- package/dist-sdk/src/entities/flow/activities/input-refs.js +19 -0
- package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +13 -0
- package/dist-sdk/src/entities/flow/activities/prompt-template.js +34 -0
- package/dist-sdk/src/entities/flow/activities/render-catalog.d.ts +140 -0
- package/dist-sdk/src/entities/flow/activities/render-catalog.js +174 -0
- package/dist-sdk/src/entities/flow/activities/types.d.ts +33 -0
- package/dist-sdk/src/entities/flow/activities/types.js +1 -0
- package/dist-sdk/src/entities/flow/build.d.ts +38 -0
- package/dist-sdk/src/entities/flow/build.js +115 -0
- package/dist-sdk/src/entities/flow/index.d.ts +8 -0
- package/dist-sdk/src/entities/flow/index.js +7 -0
- package/dist-sdk/src/entities/flow/serialize.d.ts +51 -0
- package/dist-sdk/src/entities/flow/serialize.js +94 -0
- package/dist-sdk/src/entities/flow/util.d.ts +27 -0
- package/dist-sdk/src/entities/flow/util.js +38 -0
- package/dist-sdk/src/entities/org/ai-provider.d.ts +13 -0
- package/dist-sdk/src/entities/org/ai-provider.js +46 -0
- package/dist-sdk/src/entities/org/category.d.ts +5 -0
- package/dist-sdk/src/entities/org/category.js +33 -0
- package/dist-sdk/src/entities/org/cloud-link.d.ts +5 -0
- package/dist-sdk/src/entities/org/cloud-link.js +33 -0
- package/dist-sdk/src/entities/org/connector.d.ts +12 -0
- package/dist-sdk/src/entities/org/connector.js +35 -0
- package/dist-sdk/src/entities/org/group.d.ts +5 -0
- package/dist-sdk/src/entities/org/group.js +40 -0
- package/dist-sdk/src/entities/org/index.d.ts +11 -0
- package/dist-sdk/src/entities/org/index.js +11 -0
- package/dist-sdk/src/entities/org/role.d.ts +7 -0
- package/dist-sdk/src/entities/org/role.js +21 -0
- package/dist-sdk/src/entities/org/user.d.ts +7 -0
- package/dist-sdk/src/entities/org/user.js +30 -0
- package/dist-sdk/src/entities/search-table/build.d.ts +41 -0
- package/dist-sdk/src/entities/search-table/build.js +79 -0
- package/dist-sdk/src/entities/search-table/index.d.ts +5 -0
- package/dist-sdk/src/entities/search-table/index.js +5 -0
- package/dist-sdk/src/entities/search-table/module.d.ts +6 -0
- package/dist-sdk/src/entities/search-table/module.js +64 -0
- package/dist-sdk/src/entities/shared/context.d.ts +93 -0
- package/dist-sdk/src/entities/shared/context.js +156 -0
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +277 -0
- package/dist-sdk/src/entities/shared/filters/ast.js +65 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +211 -0
- package/dist-sdk/src/entities/shared/filters/index.js +372 -0
- package/dist-sdk/src/entities/shared/filters/types.d.ts +170 -0
- package/dist-sdk/src/entities/shared/filters/types.js +7 -0
- package/dist-sdk/src/entities/shared/ref.d.ts +160 -0
- package/dist-sdk/src/entities/shared/ref.js +119 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +17 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.js +31 -0
- package/dist-sdk/src/entities/shared/types/common.d.ts +106 -0
- package/dist-sdk/src/entities/shared/types/common.js +64 -0
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +58 -0
- package/dist-sdk/src/entities/shared/types/field-types.js +57 -0
- package/dist-sdk/src/entities/shared/types/platform.d.ts +46 -0
- package/dist-sdk/src/entities/shared/types/platform.js +10 -0
- package/dist-sdk/src/entities/skill/build.d.ts +25 -0
- package/dist-sdk/src/entities/skill/build.js +50 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +39 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +124 -0
- package/dist-sdk/src/entities/skill/from-tf.d.ts +33 -0
- package/dist-sdk/src/entities/skill/from-tf.js +96 -0
- package/dist-sdk/src/entities/skill/index.d.ts +7 -0
- package/dist-sdk/src/entities/skill/index.js +7 -0
- package/dist-sdk/src/entities/skill/module.d.ts +4 -0
- package/dist-sdk/src/entities/skill/module.js +111 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/skill/to-tf.js +59 -0
- package/dist-sdk/src/entities/skill/tools.d.ts +93 -0
- package/dist-sdk/src/entities/skill/tools.js +105 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +60 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +142 -0
- package/dist-sdk/src/entities/skill-tool/module.d.ts +3 -0
- package/dist-sdk/src/entities/skill-tool/module.js +21 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +34 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.js +130 -0
- package/dist-sdk/src/entities/skill-tool/types.d.ts +40 -0
- package/dist-sdk/src/entities/skill-tool/types.js +67 -0
- package/dist-sdk/src/entities/table/build.d.ts +74 -0
- package/dist-sdk/src/entities/table/build.js +339 -0
- package/dist-sdk/src/entities/table/catalog-render.d.ts +5 -0
- package/dist-sdk/src/entities/table/catalog-render.js +39 -0
- package/dist-sdk/src/entities/table/fields.d.ts +81 -0
- package/dist-sdk/src/entities/table/fields.js +70 -0
- package/dist-sdk/src/entities/table/filter.d.ts +41 -0
- package/dist-sdk/src/entities/table/filter.js +89 -0
- package/dist-sdk/src/entities/table/index.d.ts +8 -0
- package/dist-sdk/src/entities/table/index.js +12 -0
- package/dist-sdk/src/entities/table/joins.d.ts +26 -0
- package/dist-sdk/src/entities/table/joins.js +31 -0
- package/dist-sdk/src/entities/table/keys.d.ts +11 -0
- package/dist-sdk/src/entities/table/keys.js +25 -0
- package/dist-sdk/src/entities/table/module.d.ts +5 -0
- package/dist-sdk/src/entities/table/module.js +25 -0
- package/dist-sdk/src/entities/table/state.d.ts +39 -0
- package/dist-sdk/src/entities/table/state.js +43 -0
- package/dist-sdk/src/entities/view/from-tf.d.ts +29 -0
- package/dist-sdk/src/entities/view/from-tf.js +235 -0
- package/dist-sdk/src/entities/view/module.d.ts +24 -0
- package/dist-sdk/src/entities/view/module.js +61 -0
- package/dist-sdk/src/entities/view/to-tf.d.ts +65 -0
- package/dist-sdk/src/entities/view/to-tf.js +171 -0
- package/dist-sdk/src/entities/view/types.d.ts +58 -0
- package/dist-sdk/src/entities/view/types.js +89 -0
- package/dist-sdk/src/graph/deferred-catalog-render.d.ts +9 -0
- package/dist-sdk/src/graph/deferred-catalog-render.js +18 -0
- package/dist-sdk/src/graph/index.d.ts +91 -0
- package/dist-sdk/src/graph/index.js +211 -0
- package/dist-sdk/src/graph/modules.d.ts +7 -0
- package/dist-sdk/src/graph/modules.js +42 -0
- package/dist-sdk/src/graph/types.d.ts +375 -0
- package/dist-sdk/src/graph/types.js +102 -0
- package/dist-sdk/src/internal/sdk-package.d.ts +7 -0
- package/dist-sdk/src/internal/sdk-package.js +23 -0
- package/package.json +201 -8
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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;
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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;
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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;
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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";
|
|
@@ -0,0 +1,13 @@
|
|
|
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";
|
|
@@ -0,0 +1,39 @@
|
|
|
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;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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;
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { FieldRef } from "../../../catalog/index.js";
|
|
2
|
+
/** Marker key the wire boundary flattens to a `record/<id>` statePath string. */
|
|
3
|
+
export declare const RECORD_PATH_MARKER = "__recordPath";
|
|
4
|
+
/** A node in the v2 render-tree AST. `aspectFieldId`/statePath hold tokens/markers. */
|
|
5
|
+
export interface RenderNode<T extends string = string> {
|
|
6
|
+
readonly __nodeKind: "render-node";
|
|
7
|
+
readonly type: T;
|
|
8
|
+
readonly props: Record<string, unknown>;
|
|
9
|
+
readonly children?: readonly RenderNode[];
|
|
10
|
+
readonly __binding?: {
|
|
11
|
+
readonly aspectFieldId: FieldRef;
|
|
12
|
+
readonly statePath: unknown;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface StackProps {
|
|
16
|
+
readonly direction?: "horizontal" | "vertical";
|
|
17
|
+
readonly gap?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
18
|
+
readonly align?: "start" | "center" | "end" | "stretch";
|
|
19
|
+
readonly justify?: "start" | "center" | "end" | "between" | "around";
|
|
20
|
+
}
|
|
21
|
+
export interface CardProps {
|
|
22
|
+
readonly title?: string;
|
|
23
|
+
readonly description?: string;
|
|
24
|
+
readonly maxWidth?: "sm" | "md" | "lg" | "xl" | "full";
|
|
25
|
+
readonly centered?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface GridProps {
|
|
28
|
+
readonly columns?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
29
|
+
readonly gap?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
30
|
+
}
|
|
31
|
+
export interface HeadingProps {
|
|
32
|
+
readonly level?: 1 | 2 | 3 | 4;
|
|
33
|
+
}
|
|
34
|
+
export interface TextProps {
|
|
35
|
+
readonly variant?: "default" | "muted" | "small";
|
|
36
|
+
}
|
|
37
|
+
export interface SeparatorProps {
|
|
38
|
+
readonly orientation?: "horizontal" | "vertical";
|
|
39
|
+
}
|
|
40
|
+
export declare function stack(children: readonly RenderNode[], props?: StackProps): RenderNode<"Stack">;
|
|
41
|
+
export declare function card(props: CardProps, children: readonly RenderNode[]): RenderNode<"Card">;
|
|
42
|
+
export declare function grid(props: GridProps, children: readonly RenderNode[]): RenderNode<"Grid">;
|
|
43
|
+
export declare function heading(text: string, props?: HeadingProps): RenderNode<"Heading">;
|
|
44
|
+
export declare function text(value: string, props?: TextProps): RenderNode<"Text">;
|
|
45
|
+
export declare function separator(props?: SeparatorProps): RenderNode<"Separator">;
|
|
46
|
+
/** A single entity-reference leaf, used by `App.toUI()` to render bag entries. */
|
|
47
|
+
export interface ActivityNodeSpec {
|
|
48
|
+
readonly kind: "AGENT" | "AUTOMATION" | "DEFAULT";
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly referenceName?: string;
|
|
51
|
+
readonly subType?: string;
|
|
52
|
+
readonly typeLabel?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Build a single-node `ActivityNode` element — a colored leaf rendering an
|
|
56
|
+
* entity reference. Useful for the agent / automation grids in `App.toUI()`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function activityNode(spec: ActivityNodeSpec): RenderNode<"ActivityNode">;
|
|
59
|
+
export type Check = {
|
|
60
|
+
readonly type: "required";
|
|
61
|
+
readonly message?: string;
|
|
62
|
+
} | {
|
|
63
|
+
readonly type: "email";
|
|
64
|
+
readonly message?: string;
|
|
65
|
+
} | {
|
|
66
|
+
readonly type: "url";
|
|
67
|
+
readonly message?: string;
|
|
68
|
+
} | {
|
|
69
|
+
readonly type: "minLength";
|
|
70
|
+
readonly value: number;
|
|
71
|
+
readonly message?: string;
|
|
72
|
+
} | {
|
|
73
|
+
readonly type: "maxLength";
|
|
74
|
+
readonly value: number;
|
|
75
|
+
readonly message?: string;
|
|
76
|
+
} | {
|
|
77
|
+
readonly type: "min";
|
|
78
|
+
readonly value: number;
|
|
79
|
+
readonly message?: string;
|
|
80
|
+
} | {
|
|
81
|
+
readonly type: "max";
|
|
82
|
+
readonly value: number;
|
|
83
|
+
readonly message?: string;
|
|
84
|
+
} | {
|
|
85
|
+
readonly type: "pattern";
|
|
86
|
+
readonly value: string;
|
|
87
|
+
readonly message?: string;
|
|
88
|
+
};
|
|
89
|
+
export declare const required: (message?: string) => Check;
|
|
90
|
+
export declare const email: (message?: string) => Check;
|
|
91
|
+
export declare const minLength: (value: number, message?: string) => Check;
|
|
92
|
+
export declare const maxLength: (value: number, message?: string) => Check;
|
|
93
|
+
export interface FieldBindingOptions {
|
|
94
|
+
readonly label?: string;
|
|
95
|
+
readonly helpText?: string;
|
|
96
|
+
readonly checks?: readonly Check[];
|
|
97
|
+
}
|
|
98
|
+
export interface InputFieldOptions extends FieldBindingOptions {
|
|
99
|
+
readonly placeholder?: string;
|
|
100
|
+
readonly type?: "text" | "email" | "password" | "tel" | "url" | "number" | "date" | "datetime-local";
|
|
101
|
+
}
|
|
102
|
+
export interface TextareaFieldOptions extends FieldBindingOptions {
|
|
103
|
+
readonly placeholder?: string;
|
|
104
|
+
readonly rows?: number;
|
|
105
|
+
}
|
|
106
|
+
export interface SelectFieldOptions extends FieldBindingOptions {
|
|
107
|
+
readonly placeholder?: string;
|
|
108
|
+
readonly options?: readonly {
|
|
109
|
+
value: string;
|
|
110
|
+
label: string;
|
|
111
|
+
}[];
|
|
112
|
+
}
|
|
113
|
+
/** Bind a scalar field (TEXT/NUMBER/DECIMAL/DATE/DATETIME/USER_ID/GROUP_ID) to an `Input`. */
|
|
114
|
+
export declare function inputFor(field: FieldRef, opts?: InputFieldOptions): RenderNode<"Input">;
|
|
115
|
+
/** Bind a TEXT/HTML/RICH_TEXT field to a `Textarea`. */
|
|
116
|
+
export declare function textareaFor(field: FieldRef, opts?: TextareaFieldOptions): RenderNode<"Textarea">;
|
|
117
|
+
/** Bind a PICKLIST/MULTI_PICKLIST field to a `Select` (options fetched at render time unless given). */
|
|
118
|
+
export declare function selectFor(field: FieldRef, opts?: SelectFieldOptions): RenderNode<"Select">;
|
|
119
|
+
/** Bind a BOOLEAN field to a `Switch`. */
|
|
120
|
+
export declare function switchFor(field: FieldRef, opts?: FieldBindingOptions): RenderNode<"Switch">;
|
|
121
|
+
/** Bind a BOOLEAN field to a `Checkbox`. */
|
|
122
|
+
export declare function checkboxFor(field: FieldRef, opts?: FieldBindingOptions): RenderNode<"Checkbox">;
|
|
123
|
+
/** Bind any binding-eligible field to the component best fitting its declared type. */
|
|
124
|
+
export declare function fieldFor(field: FieldRef, opts?: FieldBindingOptions & {
|
|
125
|
+
placeholder?: string;
|
|
126
|
+
rows?: number;
|
|
127
|
+
}): RenderNode;
|
|
128
|
+
export interface SerializedRenderElement {
|
|
129
|
+
readonly type: string;
|
|
130
|
+
readonly props: Record<string, unknown>;
|
|
131
|
+
readonly children?: readonly string[];
|
|
132
|
+
}
|
|
133
|
+
export interface SerializedRenderTree {
|
|
134
|
+
readonly root: string;
|
|
135
|
+
readonly elements: Record<string, SerializedRenderElement>;
|
|
136
|
+
}
|
|
137
|
+
export type RenderTreeVisitor = (node: RenderNode, elementId: string) => void;
|
|
138
|
+
export declare function isRenderNode(value: unknown): value is RenderNode;
|
|
139
|
+
/** Walk the AST depth-first → flat `{ root, elements }`; `visit` collects bindings. */
|
|
140
|
+
export declare function serializeRenderTree(layout: RenderNode, visit?: RenderTreeVisitor): SerializedRenderTree;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 form render-catalog — typed json-render AST helpers for `formActivity`.
|
|
3
|
+
* Parallel to v1 `src/flows/activities/render-catalog.ts`; the layout helpers
|
|
4
|
+
* are identical, but the **field-binding leaves take a `FieldRef` token** (not a
|
|
5
|
+
* live `AppField`) and emit the field id position as a token resolved at deploy.
|
|
6
|
+
*
|
|
7
|
+
* A binding leaf needs the field id in two places — `__binding.aspectFieldId`
|
|
8
|
+
* (resolved straight to the id) and the `record/<id>` **statePath string**. v2
|
|
9
|
+
* has no id at author time, so the statePath is emitted as a structured marker
|
|
10
|
+
* `{ __recordPath: <FieldRef token> }`; after `resolvePayload` swaps the token
|
|
11
|
+
* for the id, the wire boundary flattens the marker to `"record/<id>"` (see
|
|
12
|
+
* `flattenRecordPaths` in the apply wire client).
|
|
13
|
+
*/
|
|
14
|
+
import { EdkValidationError } from "../../../../elementum-entity-client/errors.js";
|
|
15
|
+
/** Marker key the wire boundary flattens to a `record/<id>` statePath string. */
|
|
16
|
+
export const RECORD_PATH_MARKER = "__recordPath";
|
|
17
|
+
const NODE_KIND = "render-node";
|
|
18
|
+
/** Build the structured statePath marker for a field (flattened to a string at deploy). */
|
|
19
|
+
function recordPath(field) {
|
|
20
|
+
return { [RECORD_PATH_MARKER]: field };
|
|
21
|
+
}
|
|
22
|
+
export function stack(children, props) {
|
|
23
|
+
return { __nodeKind: NODE_KIND, type: "Stack", props: { ...(props ?? {}) }, children };
|
|
24
|
+
}
|
|
25
|
+
export function card(props, children) {
|
|
26
|
+
return { __nodeKind: NODE_KIND, type: "Card", props: { ...props }, children };
|
|
27
|
+
}
|
|
28
|
+
export function grid(props, children) {
|
|
29
|
+
return { __nodeKind: NODE_KIND, type: "Grid", props: { ...props }, children };
|
|
30
|
+
}
|
|
31
|
+
export function heading(text, props) {
|
|
32
|
+
return { __nodeKind: NODE_KIND, type: "Heading", props: { text, ...(props ?? {}) } };
|
|
33
|
+
}
|
|
34
|
+
export function text(value, props) {
|
|
35
|
+
return { __nodeKind: NODE_KIND, type: "Text", props: { text: value, ...(props ?? {}) } };
|
|
36
|
+
}
|
|
37
|
+
export function separator(props) {
|
|
38
|
+
return { __nodeKind: NODE_KIND, type: "Separator", props: { ...(props ?? {}) } };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Build a single-node `ActivityNode` element — a colored leaf rendering an
|
|
42
|
+
* entity reference. Useful for the agent / automation grids in `App.toUI()`.
|
|
43
|
+
*/
|
|
44
|
+
export function activityNode(spec) {
|
|
45
|
+
const props = { kind: spec.kind, name: spec.name };
|
|
46
|
+
if (spec.subType != null)
|
|
47
|
+
props.subType = spec.subType;
|
|
48
|
+
if (spec.referenceName != null)
|
|
49
|
+
props.referenceName = spec.referenceName;
|
|
50
|
+
if (spec.typeLabel != null)
|
|
51
|
+
props.typeLabel = spec.typeLabel;
|
|
52
|
+
return { __nodeKind: NODE_KIND, type: "ActivityNode", props };
|
|
53
|
+
}
|
|
54
|
+
export const required = (message) => message ? { type: "required", message } : { type: "required" };
|
|
55
|
+
export const email = (message) => message ? { type: "email", message } : { type: "email" };
|
|
56
|
+
export const minLength = (value, message) => message ? { type: "minLength", value, message } : { type: "minLength", value };
|
|
57
|
+
export const maxLength = (value, message) => message ? { type: "maxLength", value, message } : { type: "maxLength", value };
|
|
58
|
+
/** Attach the binding marker + state path. `aspectFieldId` resolves to the id at deploy. */
|
|
59
|
+
function buildBindingNode(type, field, props) {
|
|
60
|
+
const statePath = recordPath(field);
|
|
61
|
+
return {
|
|
62
|
+
__nodeKind: NODE_KIND,
|
|
63
|
+
type,
|
|
64
|
+
props: { ...props, name: statePath, statePath },
|
|
65
|
+
__binding: { aspectFieldId: field, statePath },
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function commonProps(field, opts) {
|
|
69
|
+
const props = { label: opts.label ?? field.name };
|
|
70
|
+
if (opts.helpText != null)
|
|
71
|
+
props.helpText = opts.helpText;
|
|
72
|
+
if (opts.checks != null && opts.checks.length > 0)
|
|
73
|
+
props.checks = opts.checks;
|
|
74
|
+
return props;
|
|
75
|
+
}
|
|
76
|
+
/** Bind a scalar field (TEXT/NUMBER/DECIMAL/DATE/DATETIME/USER_ID/GROUP_ID) to an `Input`. */
|
|
77
|
+
export function inputFor(field, opts = {}) {
|
|
78
|
+
const inferred = field.fieldType === "NUMBER" || field.fieldType === "DECIMAL"
|
|
79
|
+
? "number"
|
|
80
|
+
: field.fieldType === "DATE"
|
|
81
|
+
? "date"
|
|
82
|
+
: field.fieldType === "DATETIME"
|
|
83
|
+
? "datetime-local"
|
|
84
|
+
: "text";
|
|
85
|
+
const props = commonProps(field, opts);
|
|
86
|
+
props.type = opts.type ?? inferred;
|
|
87
|
+
if (opts.placeholder != null)
|
|
88
|
+
props.placeholder = opts.placeholder;
|
|
89
|
+
return buildBindingNode("Input", field, props);
|
|
90
|
+
}
|
|
91
|
+
/** Bind a TEXT/HTML/RICH_TEXT field to a `Textarea`. */
|
|
92
|
+
export function textareaFor(field, opts = {}) {
|
|
93
|
+
const props = commonProps(field, opts);
|
|
94
|
+
if (opts.placeholder != null)
|
|
95
|
+
props.placeholder = opts.placeholder;
|
|
96
|
+
if (opts.rows != null)
|
|
97
|
+
props.rows = opts.rows;
|
|
98
|
+
return buildBindingNode("Textarea", field, props);
|
|
99
|
+
}
|
|
100
|
+
/** Bind a PICKLIST/MULTI_PICKLIST field to a `Select` (options fetched at render time unless given). */
|
|
101
|
+
export function selectFor(field, opts = {}) {
|
|
102
|
+
const props = commonProps(field, opts);
|
|
103
|
+
if (opts.placeholder != null)
|
|
104
|
+
props.placeholder = opts.placeholder;
|
|
105
|
+
if (opts.options != null)
|
|
106
|
+
props.options = opts.options;
|
|
107
|
+
return buildBindingNode("Select", field, props);
|
|
108
|
+
}
|
|
109
|
+
/** Bind a BOOLEAN field to a `Switch`. */
|
|
110
|
+
export function switchFor(field, opts = {}) {
|
|
111
|
+
return buildBindingNode("Switch", field, commonProps(field, opts));
|
|
112
|
+
}
|
|
113
|
+
/** Bind a BOOLEAN field to a `Checkbox`. */
|
|
114
|
+
export function checkboxFor(field, opts = {}) {
|
|
115
|
+
return buildBindingNode("Checkbox", field, commonProps(field, opts));
|
|
116
|
+
}
|
|
117
|
+
/** Bind any binding-eligible field to the component best fitting its declared type. */
|
|
118
|
+
export function fieldFor(field, opts = {}) {
|
|
119
|
+
switch (field.fieldType) {
|
|
120
|
+
case "PICKLIST":
|
|
121
|
+
case "MULTI_PICKLIST":
|
|
122
|
+
return selectFor(field, opts);
|
|
123
|
+
case "HTML":
|
|
124
|
+
case "RICH_TEXT":
|
|
125
|
+
return textareaFor(field, opts);
|
|
126
|
+
case "BOOLEAN":
|
|
127
|
+
return switchFor(field, opts);
|
|
128
|
+
case "TEXT":
|
|
129
|
+
case "NUMBER":
|
|
130
|
+
case "DECIMAL":
|
|
131
|
+
case "DATE":
|
|
132
|
+
case "DATETIME":
|
|
133
|
+
case "USER_ID":
|
|
134
|
+
case "GROUP_ID":
|
|
135
|
+
return inputFor(field, opts);
|
|
136
|
+
default:
|
|
137
|
+
throw new EdkValidationError(`fieldFor: field "${field.name}" has type "${field.fieldType}" which no binding helper supports. ` +
|
|
138
|
+
`Use a layout helper (heading / text / separator) or a specific binding helper.`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
export function isRenderNode(value) {
|
|
142
|
+
return (typeof value === "object" &&
|
|
143
|
+
value !== null &&
|
|
144
|
+
value.__nodeKind === NODE_KIND);
|
|
145
|
+
}
|
|
146
|
+
function uniqueElementId(candidate, used) {
|
|
147
|
+
if (!used.has(candidate))
|
|
148
|
+
return candidate;
|
|
149
|
+
let suffix = 2;
|
|
150
|
+
while (used.has(`${candidate}_${suffix}`))
|
|
151
|
+
suffix++;
|
|
152
|
+
return `${candidate}_${suffix}`;
|
|
153
|
+
}
|
|
154
|
+
/** Walk the AST depth-first → flat `{ root, elements }`; `visit` collects bindings. */
|
|
155
|
+
export function serializeRenderTree(layout, visit) {
|
|
156
|
+
if (!isRenderNode(layout)) {
|
|
157
|
+
throw new EdkValidationError(`serializeRenderTree: \`layout\` must be a RenderNode from the catalog helpers (card, stack, inputFor, ...).`);
|
|
158
|
+
}
|
|
159
|
+
const elements = {};
|
|
160
|
+
const usedIds = new Set();
|
|
161
|
+
const walk = (node, path) => {
|
|
162
|
+
const id = uniqueElementId(path, usedIds);
|
|
163
|
+
usedIds.add(id);
|
|
164
|
+
let childIds;
|
|
165
|
+
if (node.children && node.children.length > 0) {
|
|
166
|
+
childIds = node.children.map((child, index) => walk(child, `${path}.${index}`));
|
|
167
|
+
}
|
|
168
|
+
elements[id] = { type: node.type, props: node.props, ...(childIds ? { children: childIds } : {}) };
|
|
169
|
+
visit?.(node, id);
|
|
170
|
+
return id;
|
|
171
|
+
};
|
|
172
|
+
const root = walk(layout, "root");
|
|
173
|
+
return { root, elements };
|
|
174
|
+
}
|