@elementumai/edk 0.0.0-oidc-bootstrap → 0.8.0-preview.11
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 +408 -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/factories.d.ts +189 -0
- package/dist-sdk/src/catalog/factories.js +202 -0
- package/dist-sdk/src/catalog/from-authoring.d.ts +103 -0
- package/dist-sdk/src/catalog/from-authoring.js +462 -0
- package/dist-sdk/src/catalog/index.d.ts +11 -0
- package/dist-sdk/src/catalog/index.js +11 -0
- package/dist-sdk/src/catalog/org.d.ts +11 -0
- package/dist-sdk/src/catalog/org.js +211 -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 +36 -0
- package/dist-sdk/src/catalog/render.js +176 -0
- package/dist-sdk/src/catalog/token.d.ts +10 -0
- package/dist-sdk/src/catalog/token.js +62 -0
- package/dist-sdk/src/catalog/types.d.ts +158 -0
- package/dist-sdk/src/catalog/types.js +83 -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 +93 -0
- package/dist-sdk/src/core/system-fields.js +151 -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 +36 -0
- package/dist-sdk/src/core/types/ai-provider.js +32 -0
- package/dist-sdk/src/core/types/app.d.ts +838 -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 +49 -0
- package/dist-sdk/src/engine/build/context.js +6 -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 +23 -0
- package/dist-sdk/src/engine/pull/context.js +44 -0
- package/dist-sdk/src/engine/pull/org.d.ts +44 -0
- package/dist-sdk/src/engine/pull/org.js +104 -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 +31 -0
- package/dist-sdk/src/engine/tf/labels.js +125 -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/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 +18 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +177 -0
- package/dist-sdk/src/entities/agent/from-tf.d.ts +50 -0
- package/dist-sdk/src/entities/agent/from-tf.js +169 -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 +116 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/agent/to-tf.js +136 -0
- package/dist-sdk/src/entities/agent/tools.d.ts +205 -0
- package/dist-sdk/src/entities/agent/tools.js +199 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +63 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.js +169 -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 +38 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.js +164 -0
- package/dist-sdk/src/entities/agent-tool/types.d.ts +42 -0
- package/dist-sdk/src/entities/agent-tool/types.js +70 -0
- package/dist-sdk/src/entities/app/build.d.ts +318 -0
- package/dist-sdk/src/entities/app/build.js +325 -0
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +165 -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 +180 -0
- package/dist-sdk/src/entities/app/index.d.ts +11 -0
- package/dist-sdk/src/entities/app/index.js +10 -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 +59 -0
- package/dist-sdk/src/entities/app/to-tf.d.ts +28 -0
- package/dist-sdk/src/entities/app/to-tf.js +183 -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 +215 -0
- package/dist-sdk/src/entities/automation/build.js +424 -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 +135 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.js +13 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +40 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +1040 -0
- package/dist-sdk/src/entities/automation/filter.d.ts +81 -0
- package/dist-sdk/src/entities/automation/filter.js +146 -0
- package/dist-sdk/src/entities/automation/from-tf.d.ts +36 -0
- package/dist-sdk/src/entities/automation/from-tf.js +252 -0
- package/dist-sdk/src/entities/automation/index.d.ts +18 -0
- package/dist-sdk/src/entities/automation/index.js +21 -0
- package/dist-sdk/src/entities/automation/module.d.ts +3 -0
- package/dist-sdk/src/entities/automation/module.js +153 -0
- package/dist-sdk/src/entities/automation/operators.d.ts +66 -0
- package/dist-sdk/src/entities/automation/operators.js +43 -0
- package/dist-sdk/src/entities/automation/script-code.d.ts +62 -0
- package/dist-sdk/src/entities/automation/script-code.js +366 -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 +535 -0
- package/dist-sdk/src/entities/automation/tasks.js +697 -0
- package/dist-sdk/src/entities/automation/to-tf.d.ts +38 -0
- package/dist-sdk/src/entities/automation/to-tf.js +266 -0
- package/dist-sdk/src/entities/automation/triggers.d.ts +197 -0
- package/dist-sdk/src/entities/automation/triggers.js +202 -0
- package/dist-sdk/src/entities/automation/types.d.ts +53 -0
- package/dist-sdk/src/entities/automation/types.js +101 -0
- package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +76 -0
- package/dist-sdk/src/entities/automation/value-ref-tf.js +190 -0
- package/dist-sdk/src/entities/element/build.d.ts +108 -0
- package/dist-sdk/src/entities/element/build.js +109 -0
- package/dist-sdk/src/entities/element/from-tf.d.ts +19 -0
- package/dist-sdk/src/entities/element/from-tf.js +155 -0
- package/dist-sdk/src/entities/element/index.d.ts +9 -0
- package/dist-sdk/src/entities/element/index.js +9 -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 +63 -0
- package/dist-sdk/src/entities/element/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/element/to-tf.js +151 -0
- package/dist-sdk/src/entities/field/build.d.ts +69 -0
- package/dist-sdk/src/entities/field/build.js +74 -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 +170 -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 +29 -0
- package/dist-sdk/src/entities/field/from-tf.js +73 -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 +49 -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 +55 -0
- package/dist-sdk/src/entities/field/to-tf.js +97 -0
- package/dist-sdk/src/entities/field/types.d.ts +27 -0
- package/dist-sdk/src/entities/field/types.js +46 -0
- package/dist-sdk/src/entities/file-reader/build.d.ts +124 -0
- package/dist-sdk/src/entities/file-reader/build.js +105 -0
- package/dist-sdk/src/entities/file-reader/index.d.ts +5 -0
- package/dist-sdk/src/entities/file-reader/index.js +5 -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/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 +5 -0
- package/dist-sdk/src/entities/org/connector.js +37 -0
- package/dist-sdk/src/entities/org/group.d.ts +5 -0
- package/dist-sdk/src/entities/org/group.js +31 -0
- package/dist-sdk/src/entities/org/index.d.ts +10 -0
- package/dist-sdk/src/entities/org/index.js +10 -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 +21 -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 +242 -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/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 +49 -0
- package/dist-sdk/src/entities/shared/types/field-types.js +48 -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 +20 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +96 -0
- package/dist-sdk/src/entities/skill/from-tf.d.ts +33 -0
- package/dist-sdk/src/entities/skill/from-tf.js +95 -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 +106 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +33 -0
- package/dist-sdk/src/entities/skill/to-tf.js +58 -0
- package/dist-sdk/src/entities/skill/tools.d.ts +71 -0
- package/dist-sdk/src/entities/skill/tools.js +88 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +47 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +121 -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 +32 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.js +107 -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 +25 -0
- package/dist-sdk/src/entities/view/from-tf.js +233 -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 +63 -0
- package/dist-sdk/src/entities/view/to-tf.js +156 -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 +14 -0
- package/dist-sdk/src/graph/deferred-catalog-render.js +37 -0
- package/dist-sdk/src/graph/index.d.ts +83 -0
- package/dist-sdk/src/graph/index.js +207 -0
- package/dist-sdk/src/graph/modules.d.ts +7 -0
- package/dist-sdk/src/graph/modules.js +37 -0
- package/dist-sdk/src/graph/types.d.ts +301 -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 +173 -8
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 search-table authoring — `defineSearchTable`. Parallel to v1
|
|
3
|
+
* `src/searchTables`, but standalone: produces a `DeployableEntity` of kind
|
|
4
|
+
* `searchTable` (app-owned) whose field / connector / cloud-link references are
|
|
5
|
+
* catalog tokens resolved at deploy. Two variants — `snowflake` (Elementum
|
|
6
|
+
* manages the table) and `linked` (points at an existing Cortex service) — pick
|
|
7
|
+
* the create endpoint via a `__variant` discriminator on the payload.
|
|
8
|
+
*
|
|
9
|
+
* Mostly create-only in v2: the platform's thin PUT only honors
|
|
10
|
+
* duration/targetLag on a snowflake table (see `planV2`'s
|
|
11
|
+
* `isSearchTableUpdateSupported`, `src/deploy/plan/plan.ts`). A diff limited
|
|
12
|
+
* to those fields routes to update; anything else (attributeFields,
|
|
13
|
+
* vectorIndexes, kind, warehouse, a linked table at all) surfaces as
|
|
14
|
+
* `update-unsupported` (delete + re-create).
|
|
15
|
+
*/
|
|
16
|
+
import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
|
|
17
|
+
import { slimTokens, } from "../../catalog/index.js";
|
|
18
|
+
function snowflakeBody(opts) {
|
|
19
|
+
if (opts.targetLag <= 0) {
|
|
20
|
+
throw new EdkValidationError(`defineSearchTable: targetLag must be > 0 (got ${opts.targetLag}).`);
|
|
21
|
+
}
|
|
22
|
+
if (opts.attributeFields.length === 0) {
|
|
23
|
+
throw new EdkValidationError("defineSearchTable: at least one attributeField is required.");
|
|
24
|
+
}
|
|
25
|
+
const hasVectors = (opts.vectorIndexes?.length ?? 0) > 0;
|
|
26
|
+
const hasLegacy = opts.keyField != null || opts.embeddingConnector != null;
|
|
27
|
+
if (hasLegacy && (opts.keyField == null || opts.embeddingConnector == null)) {
|
|
28
|
+
throw new EdkValidationError("defineSearchTable: `keyField` and `embeddingConnector` must be provided together.");
|
|
29
|
+
}
|
|
30
|
+
if (!hasVectors && !hasLegacy) {
|
|
31
|
+
throw new EdkValidationError("defineSearchTable: provide either `vectorIndexes` or the legacy `keyField`+`embeddingConnector`.");
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
attributeFieldIds: opts.attributeFields, // FieldRef tokens → ids at deploy
|
|
35
|
+
duration: opts.duration,
|
|
36
|
+
targetLag: opts.targetLag,
|
|
37
|
+
...(opts.textIndexFields != null && opts.textIndexFields.length > 0
|
|
38
|
+
? { textIndexFieldIds: opts.textIndexFields }
|
|
39
|
+
: {}),
|
|
40
|
+
...(opts.warehouse != null ? { warehouse: opts.warehouse } : {}),
|
|
41
|
+
...(hasVectors
|
|
42
|
+
? { vectorIndexes: opts.vectorIndexes.map((v) => ({ fieldId: v.field, aiProviderConnectorId: v.connector })) }
|
|
43
|
+
: {}),
|
|
44
|
+
...(opts.keyField != null ? { fieldId: opts.keyField } : {}),
|
|
45
|
+
...(opts.embeddingConnector != null ? { aiProviderConnectorId: opts.embeddingConnector } : {}),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function linkedBody(opts) {
|
|
49
|
+
if (!opts.serviceName) {
|
|
50
|
+
throw new EdkValidationError("defineSearchTable: linked tables require a non-empty `serviceName`.");
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
cloudLinkId: opts.cloudLink, // CloudLinkRef token → id at deploy
|
|
54
|
+
database: opts.database,
|
|
55
|
+
schema: opts.schema,
|
|
56
|
+
serviceName: opts.serviceName,
|
|
57
|
+
...(opts.warehouse != null ? { warehouse: opts.warehouse } : {}),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** Build a v2 search-table entity (app-owned; create-only), returning DeployableEntity with `.ref`. */
|
|
61
|
+
export function defineSearchTable(opts) {
|
|
62
|
+
const handle = opts.handle ?? "";
|
|
63
|
+
const parent = opts.parent ?? "";
|
|
64
|
+
const ref = { __kind: "searchTable", refName: handle, name: opts.name, parent };
|
|
65
|
+
// `__variant` tells the wire client which create endpoint to POST to; it's
|
|
66
|
+
// stripped from the body before the request.
|
|
67
|
+
const payload = {
|
|
68
|
+
__variant: opts.kind,
|
|
69
|
+
...(opts.kind === "snowflake" ? snowflakeBody(opts) : linkedBody(opts)),
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
ref,
|
|
73
|
+
kind: "searchTable",
|
|
74
|
+
parent,
|
|
75
|
+
refName: handle,
|
|
76
|
+
payload: slimTokens(payload),
|
|
77
|
+
...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 search-table authoring — `defineSearchTable`. App-owned; create-only.
|
|
3
|
+
* Standalone from v1's `src/searchTables`.
|
|
4
|
+
*/
|
|
5
|
+
export { defineSearchTable, type DefineSearchTableV2Options, type SearchTableLinkedV2Options, type SearchTableSnowflakeV2Options, type SearchTableTimeUnit, type VectorIndex, } from "./build.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search-table kind graph stub — own-file under app/element for layout +
|
|
3
|
+
* catalog discovery; TF bridge not on the graph lifecycle yet.
|
|
4
|
+
*/
|
|
5
|
+
import { type EntityKindModule } from "../../graph/types.js";
|
|
6
|
+
export declare const searchTableModule: EntityKindModule;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search-table kind graph stub — own-file under app/element for layout +
|
|
3
|
+
* catalog discovery; TF bridge not on the graph lifecycle yet.
|
|
4
|
+
*/
|
|
5
|
+
import { rootParentFactoryEntry } from "../../catalog/render-helpers.js";
|
|
6
|
+
import { NO_DATA, NO_LIFECYCLE, } from "../../graph/types.js";
|
|
7
|
+
function isConfigured(value) {
|
|
8
|
+
return (typeof value === "object" &&
|
|
9
|
+
value !== null &&
|
|
10
|
+
typeof value.ref === "function" &&
|
|
11
|
+
typeof value.def === "function");
|
|
12
|
+
}
|
|
13
|
+
function searchTableStubRef(refName, parent) {
|
|
14
|
+
return { __kind: "searchTable", refName, name: refName, parent };
|
|
15
|
+
}
|
|
16
|
+
function searchTableRefFromAuthoring(args) {
|
|
17
|
+
const { refName, parent, defaultExport } = args;
|
|
18
|
+
if (isConfigured(defaultExport)) {
|
|
19
|
+
const catalogRef = defaultExport.ref(refName);
|
|
20
|
+
if (catalogRef.__kind !== "searchTable")
|
|
21
|
+
return undefined;
|
|
22
|
+
return catalogRef;
|
|
23
|
+
}
|
|
24
|
+
// DeployableEntity.kind uses the catalog refKind ("searchTable"), not KindId.
|
|
25
|
+
if (typeof defaultExport !== "object" ||
|
|
26
|
+
defaultExport === null ||
|
|
27
|
+
defaultExport.kind !== "searchTable") {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
const entity = defaultExport;
|
|
31
|
+
const entityRefName = entity.refName === "" ? refName : entity.refName;
|
|
32
|
+
const entityParent = entity.parent === "" ? parent : entity.parent;
|
|
33
|
+
const maybeRefName = entity.ref?.name;
|
|
34
|
+
const payloadName = entity.payload?.name;
|
|
35
|
+
const name = typeof maybeRefName === "string"
|
|
36
|
+
? maybeRefName
|
|
37
|
+
: typeof payloadName === "string"
|
|
38
|
+
? payloadName
|
|
39
|
+
: entityRefName;
|
|
40
|
+
return { __kind: "searchTable", refName: entityRefName, name, parent: entityParent };
|
|
41
|
+
}
|
|
42
|
+
export const searchTableModule = {
|
|
43
|
+
kind: "search-table",
|
|
44
|
+
stream: { role: "streamReported" },
|
|
45
|
+
authoring: { unit: "ownFile", bag: "search-tables" },
|
|
46
|
+
parents: [
|
|
47
|
+
{ parent: "app", child: "search-table" },
|
|
48
|
+
{ parent: "element", child: "search-table" },
|
|
49
|
+
],
|
|
50
|
+
resource: { shape: "none" },
|
|
51
|
+
data: NO_DATA,
|
|
52
|
+
lifecycle: NO_LIFECYCLE,
|
|
53
|
+
canvas: { participates: true, label: "Search tables", glyph: "⌕", component: "generic" },
|
|
54
|
+
catalog: {
|
|
55
|
+
participates: true,
|
|
56
|
+
refKind: "searchTable",
|
|
57
|
+
catalogBag: "searchTables",
|
|
58
|
+
renderOrder: 60,
|
|
59
|
+
catalogRoot: "app",
|
|
60
|
+
renderEntry: rootParentFactoryEntry("searchTableRef"),
|
|
61
|
+
stubRef: searchTableStubRef,
|
|
62
|
+
refFromAuthoring: searchTableRefFromAuthoring,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context & Proxy factory — builds the typed `ctx` object passed to each
|
|
3
|
+
* .task() callback.
|
|
4
|
+
*
|
|
5
|
+
* At the TypeScript level, ctx.trigger.vendorName is Ref<string>.
|
|
6
|
+
* At runtime, a Proxy intercepts the property access and returns a Ref
|
|
7
|
+
* with the correct RefData ({ kind: "trigger", name: "vendorName" }).
|
|
8
|
+
*
|
|
9
|
+
* This bridges compile-time type safety with runtime reference building.
|
|
10
|
+
*/
|
|
11
|
+
import type { Ref, ToRefs, Simplify } from "./ref.js";
|
|
12
|
+
/**
|
|
13
|
+
* Deep ref — a `Ref<T>` that also exposes `T`'s string-keyed properties as
|
|
14
|
+
* nested deep refs. This is what makes `ctx.tasks.x.record.id` and
|
|
15
|
+
* `ctx.trigger.record.summary` type-check: each property access yields
|
|
16
|
+
* another `Ref` whose runtime proxy extends the dotted path in `RefData.name`.
|
|
17
|
+
*
|
|
18
|
+
* Arrays stop the recursion — you can't drill into an array element by type.
|
|
19
|
+
*/
|
|
20
|
+
export type DeepRef<T> = Ref<T> & (T extends ReadonlyArray<unknown> ? unknown : T extends object ? {
|
|
21
|
+
[K in keyof T & string]: DeepRef<T[K]>;
|
|
22
|
+
} : unknown);
|
|
23
|
+
/**
|
|
24
|
+
* Maps each key of `T` to a `DeepRef` — used for both trigger outputs and
|
|
25
|
+
* task outputs so that property drilling (`ctx.trigger.record.summary`,
|
|
26
|
+
* `ctx.tasks.x.record.id`) type-checks uniformly.
|
|
27
|
+
*/
|
|
28
|
+
export type DeepRefs<T> = {
|
|
29
|
+
[K in keyof T]: DeepRef<T[K]>;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Default open-ended shape for variables when the builder hasn't tracked
|
|
33
|
+
* any typed `setVariable` calls yet — the generic-path form, where a variable
|
|
34
|
+
* task may create several variables: `ctx.variables.<varTask>.<varName>` is
|
|
35
|
+
* `Ref<unknown>`.
|
|
36
|
+
*/
|
|
37
|
+
export type VariableRefs = {
|
|
38
|
+
[taskName: string]: {
|
|
39
|
+
[varName: string]: Ref<unknown>;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Narrow variable refs from the fluent `setVariable` tracking (task name →
|
|
44
|
+
* the variable's TS value type). A fluent variable task holds exactly ONE
|
|
45
|
+
* variable named after the task, so the task-name access IS the ref:
|
|
46
|
+
* `ctx.variables.<name>` is `Ref<T>` — no second hop.
|
|
47
|
+
*/
|
|
48
|
+
type TypedVariableRefs<TVariables extends Record<string, unknown>> = {
|
|
49
|
+
[TaskName in keyof TVariables]: Ref<TVariables[TaskName]>;
|
|
50
|
+
};
|
|
51
|
+
export type Context<TTrigger, TTasks extends Record<string, unknown>, TVariables extends Record<string, unknown> = Record<string, never>> = {
|
|
52
|
+
readonly trigger: DeepRefs<TTrigger>;
|
|
53
|
+
readonly tasks: Simplify<{
|
|
54
|
+
[K in keyof TTasks]: DeepRefs<TTasks[K]>;
|
|
55
|
+
}>;
|
|
56
|
+
readonly variables: keyof TVariables extends never ? VariableRefs : TypedVariableRefs<TVariables> & VariableRefs;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Creates a proxy that intercepts property access and returns trigger Refs.
|
|
60
|
+
* Top-level access returns a deep ref so nested field drilling works:
|
|
61
|
+
* ctx.trigger.vendorName → Ref { kind: "trigger", name: "vendorName" }
|
|
62
|
+
* ctx.trigger.record.id → Ref { kind: "trigger", name: "record.id" }
|
|
63
|
+
*/
|
|
64
|
+
export declare function createTriggerProxy<T>(): DeepRefs<T>;
|
|
65
|
+
/**
|
|
66
|
+
* Creates a proxy for a single task's outputs.
|
|
67
|
+
* ctx.tasks.findVendor.records → Ref with { kind: "task", taskRefKey: "findVendor", name: "records" }
|
|
68
|
+
*/
|
|
69
|
+
export declare function createTaskOutputProxy<T>(taskRefKey: string): DeepRefs<T>;
|
|
70
|
+
/**
|
|
71
|
+
* Creates a proxy for the tasks namespace.
|
|
72
|
+
* ctx.tasks → Proxy where each property access returns a task output proxy.
|
|
73
|
+
*/
|
|
74
|
+
export declare function createTasksProxy<TTasks extends Record<string, unknown>>(taskNames: string[]): Context<never, TTasks>["tasks"];
|
|
75
|
+
/**
|
|
76
|
+
* A forEach item that is both a Ref to the whole item and a proxy
|
|
77
|
+
* with typed field access: item.fieldName → Ref<T[fieldName]>.
|
|
78
|
+
*/
|
|
79
|
+
export type ForEachItem<T> = Ref<T> & ToRefs<T>;
|
|
80
|
+
/**
|
|
81
|
+
* Creates a forEach item proxy.
|
|
82
|
+
* item.fieldName → Ref with { kind: "forEach", forEachTaskName, name: "fieldName" }
|
|
83
|
+
* Accessing the item directly (without a property) returns a Ref to the whole item.
|
|
84
|
+
*/
|
|
85
|
+
export declare function createForEachItemProxy<T>(forEachTaskName: string): ForEachItem<T>;
|
|
86
|
+
/**
|
|
87
|
+
* Build a complete Context object for a given point in the chain.
|
|
88
|
+
*
|
|
89
|
+
* `TVariables` is a phantom — it only affects the compile-time shape of
|
|
90
|
+
* `ctx.variables`. The runtime proxy is still an open-ended lookup.
|
|
91
|
+
*/
|
|
92
|
+
export declare function buildContext<TTrigger, TTasks extends Record<string, unknown>, TVariables extends Record<string, unknown> = Record<string, never>>(taskNames: string[]): Context<TTrigger, TTasks, TVariables>;
|
|
93
|
+
export {};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context & Proxy factory — builds the typed `ctx` object passed to each
|
|
3
|
+
* .task() callback.
|
|
4
|
+
*
|
|
5
|
+
* At the TypeScript level, ctx.trigger.vendorName is Ref<string>.
|
|
6
|
+
* At runtime, a Proxy intercepts the property access and returns a Ref
|
|
7
|
+
* with the correct RefData ({ kind: "trigger", name: "vendorName" }).
|
|
8
|
+
*
|
|
9
|
+
* This bridges compile-time type safety with runtime reference building.
|
|
10
|
+
*/
|
|
11
|
+
import { createRef } from "./ref.js";
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// Proxy factories
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
/**
|
|
16
|
+
* Ref to a trigger output path; further property access extends `name`
|
|
17
|
+
* with dot segments, mirroring `createTaskOutputFieldRef` for task refs.
|
|
18
|
+
* ctx.trigger.record.summary → { kind: "trigger", name: "record.summary" }
|
|
19
|
+
*/
|
|
20
|
+
function createTriggerFieldRef(path) {
|
|
21
|
+
const base = createRef({ kind: "trigger", name: path });
|
|
22
|
+
return new Proxy(base, {
|
|
23
|
+
get(target, prop, receiver) {
|
|
24
|
+
if (typeof prop === "symbol" || prop === "__data" || prop === "__type") {
|
|
25
|
+
return Reflect.get(target, prop, receiver);
|
|
26
|
+
}
|
|
27
|
+
return createTriggerFieldRef(`${path}.${String(prop)}`);
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Creates a proxy that intercepts property access and returns trigger Refs.
|
|
33
|
+
* Top-level access returns a deep ref so nested field drilling works:
|
|
34
|
+
* ctx.trigger.vendorName → Ref { kind: "trigger", name: "vendorName" }
|
|
35
|
+
* ctx.trigger.record.id → Ref { kind: "trigger", name: "record.id" }
|
|
36
|
+
*/
|
|
37
|
+
export function createTriggerProxy() {
|
|
38
|
+
return new Proxy({}, {
|
|
39
|
+
get(_target, prop) {
|
|
40
|
+
if (typeof prop === "symbol")
|
|
41
|
+
return undefined;
|
|
42
|
+
return createTriggerFieldRef(prop);
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Ref to a task output path; further property access extends `name` with dot segments
|
|
48
|
+
* (`record.id` → `{ kind: "task", taskRefKey, name: "record.id" }`).
|
|
49
|
+
*/
|
|
50
|
+
function createTaskOutputFieldRef(taskRefKey, outputPath) {
|
|
51
|
+
const base = createRef({ kind: "task", taskRefKey, name: outputPath });
|
|
52
|
+
return new Proxy(base, {
|
|
53
|
+
get(target, prop, receiver) {
|
|
54
|
+
if (typeof prop === "symbol" || prop === "__data" || prop === "__type") {
|
|
55
|
+
return Reflect.get(target, prop, receiver);
|
|
56
|
+
}
|
|
57
|
+
return createTaskOutputFieldRef(taskRefKey, `${outputPath}.${String(prop)}`);
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Creates a proxy for a single task's outputs.
|
|
63
|
+
* ctx.tasks.findVendor.records → Ref with { kind: "task", taskRefKey: "findVendor", name: "records" }
|
|
64
|
+
*/
|
|
65
|
+
export function createTaskOutputProxy(taskRefKey) {
|
|
66
|
+
return new Proxy({}, {
|
|
67
|
+
get(_target, prop) {
|
|
68
|
+
if (typeof prop === "symbol")
|
|
69
|
+
return undefined;
|
|
70
|
+
return createTaskOutputFieldRef(taskRefKey, String(prop));
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Creates a proxy for the tasks namespace.
|
|
76
|
+
* ctx.tasks → Proxy where each property access returns a task output proxy.
|
|
77
|
+
*/
|
|
78
|
+
export function createTasksProxy(taskNames) {
|
|
79
|
+
const cache = new Map();
|
|
80
|
+
return new Proxy({}, {
|
|
81
|
+
get(_target, prop) {
|
|
82
|
+
if (typeof prop === "symbol")
|
|
83
|
+
return undefined;
|
|
84
|
+
if (!cache.has(prop)) {
|
|
85
|
+
cache.set(prop, createTaskOutputProxy(prop));
|
|
86
|
+
}
|
|
87
|
+
return cache.get(prop);
|
|
88
|
+
},
|
|
89
|
+
ownKeys() {
|
|
90
|
+
return taskNames;
|
|
91
|
+
},
|
|
92
|
+
getOwnPropertyDescriptor(_target, prop) {
|
|
93
|
+
if (typeof prop === "symbol")
|
|
94
|
+
return undefined;
|
|
95
|
+
if (taskNames.includes(prop)) {
|
|
96
|
+
return { configurable: true, enumerable: true, writable: false };
|
|
97
|
+
}
|
|
98
|
+
return undefined;
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Creates a forEach item proxy.
|
|
104
|
+
* item.fieldName → Ref with { kind: "forEach", forEachTaskName, name: "fieldName" }
|
|
105
|
+
* Accessing the item directly (without a property) returns a Ref to the whole item.
|
|
106
|
+
*/
|
|
107
|
+
export function createForEachItemProxy(forEachTaskName) {
|
|
108
|
+
const baseRef = createRef({ kind: "forEach", forEachTaskName, name: "item" });
|
|
109
|
+
return new Proxy(baseRef, {
|
|
110
|
+
get(target, prop) {
|
|
111
|
+
if (typeof prop === "symbol" || prop === "__data" || prop === "__type") {
|
|
112
|
+
return target[prop];
|
|
113
|
+
}
|
|
114
|
+
return createRef({ kind: "forEach", forEachTaskName, name: prop });
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Variables proxy. The first-level access is a HYBRID (same pattern as
|
|
120
|
+
* {@link createForEachItemProxy}): it is itself a Ref to the variable named
|
|
121
|
+
* after the task — the fluent form, `ctx.variables.greeting` — AND a proxy
|
|
122
|
+
* whose further property access yields per-variable refs — the generic form,
|
|
123
|
+
* `ctx.variables.taskName.varName`, for variable tasks creating several
|
|
124
|
+
* variables. Both produce { kind: "variableParam", variableTaskRefKey, name }.
|
|
125
|
+
*/
|
|
126
|
+
function createVariablesProxy() {
|
|
127
|
+
return new Proxy({}, {
|
|
128
|
+
get(_target, taskName) {
|
|
129
|
+
if (typeof taskName === "symbol")
|
|
130
|
+
return undefined;
|
|
131
|
+
const task = String(taskName);
|
|
132
|
+
const base = createRef({ kind: "variableParam", variableTaskRefKey: task, name: task });
|
|
133
|
+
return new Proxy(base, {
|
|
134
|
+
get(target, varName, receiver) {
|
|
135
|
+
if (typeof varName === "symbol" || varName === "__data" || varName === "__type") {
|
|
136
|
+
return Reflect.get(target, varName, receiver);
|
|
137
|
+
}
|
|
138
|
+
return createRef({ kind: "variableParam", variableTaskRefKey: task, name: String(varName) });
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Build a complete Context object for a given point in the chain.
|
|
146
|
+
*
|
|
147
|
+
* `TVariables` is a phantom — it only affects the compile-time shape of
|
|
148
|
+
* `ctx.variables`. The runtime proxy is still an open-ended lookup.
|
|
149
|
+
*/
|
|
150
|
+
export function buildContext(taskNames) {
|
|
151
|
+
return {
|
|
152
|
+
trigger: createTriggerProxy(),
|
|
153
|
+
tasks: createTasksProxy(taskNames),
|
|
154
|
+
variables: createVariablesProxy(),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared deserializer AST for filters, sorts, and the catalog references
|
|
3
|
+
* they carry. Lifted out of `src/automations/deserializer/ast.ts` so other
|
|
4
|
+
* tool surfaces (agent search tools, future skill/flow tools) can use
|
|
5
|
+
* the same printer infrastructure without forking the type definitions.
|
|
6
|
+
*
|
|
7
|
+
* ## One catalog-ref vocabulary, two containers
|
|
8
|
+
*
|
|
9
|
+
* The standalone catalog-ref nodes below (`AppRefAst`, `FieldRefAst`,
|
|
10
|
+
* `AgentRefAst`, `AutomationRefAst`, `SearchTableRefAst`,
|
|
11
|
+
* `ApprovalChainRefAst`) are the single definition of "a reference into
|
|
12
|
+
* the catalog." They show up in two positions:
|
|
13
|
+
*
|
|
14
|
+
* - **bare**, in a fixed builder slot that can only hold one kind of
|
|
15
|
+
* ref — a tool's `aspect:`, an approval chain's `lockedFields:`, a
|
|
16
|
+
* search table's `attributeFields:`. Every entity deserializer's
|
|
17
|
+
* `ast.ts` imports these directly.
|
|
18
|
+
* - **as members of `RefExpr`**, the union for a *polymorphic* slot — a
|
|
19
|
+
* filter / sort / task argument, where the value could equally be a
|
|
20
|
+
* literal, a template, or a task/trigger reference.
|
|
21
|
+
*
|
|
22
|
+
* `RefExpr` therefore *composes* these nodes rather than redefining them:
|
|
23
|
+
* a field ref is `{ kind: "field", ... }` whether it stands alone or sits
|
|
24
|
+
* inside a filter. The value/flow kinds (`literal`, `template`, `taskRef`,
|
|
25
|
+
* …) only exist inside `RefExpr` because they only ever appear in a
|
|
26
|
+
* polymorphic slot. Each node's `kind` names the catalog bag it points at
|
|
27
|
+
* (`"field"`, `"app"`, …) — distinct from the `MissingDataCollector`
|
|
28
|
+
* category strings (`"fieldRef"`, `"valueRef"`, …), which are an unrelated
|
|
29
|
+
* enum despite the similar spelling.
|
|
30
|
+
*
|
|
31
|
+
* The shared printer handles every kind; per-consumer normalize stages
|
|
32
|
+
* only emit the kinds their wire shape actually carries (agent search
|
|
33
|
+
* filters, for instance, only produce `literal`, `field`, `app`, and
|
|
34
|
+
* `unresolved`).
|
|
35
|
+
*/
|
|
36
|
+
/** Reference to an app: `<appHandle>`. */
|
|
37
|
+
export interface AppRefAst {
|
|
38
|
+
readonly kind: "app";
|
|
39
|
+
readonly appHandle: string;
|
|
40
|
+
}
|
|
41
|
+
/** Reference to an app field: `<appHandle>.fields.<fieldKey>`. */
|
|
42
|
+
export interface FieldRefAst {
|
|
43
|
+
readonly kind: "field";
|
|
44
|
+
readonly appHandle: string;
|
|
45
|
+
readonly fieldKey: string;
|
|
46
|
+
}
|
|
47
|
+
/** Reference to an app's search table: `<appHandle>.searchTables.<tableKey>`. */
|
|
48
|
+
export interface SearchTableRefAst {
|
|
49
|
+
readonly kind: "searchTable";
|
|
50
|
+
readonly appHandle: string;
|
|
51
|
+
readonly tableKey: string;
|
|
52
|
+
}
|
|
53
|
+
/** Reference to a sub-automation via the app's `automations` bag. */
|
|
54
|
+
export interface AutomationRefAst {
|
|
55
|
+
readonly kind: "automation";
|
|
56
|
+
readonly appHandle: string;
|
|
57
|
+
readonly automationKey: string;
|
|
58
|
+
}
|
|
59
|
+
/** Reference to an app's document model via the app's `documentModels` bag. */
|
|
60
|
+
export interface DocumentModelRefAst {
|
|
61
|
+
readonly kind: "documentModel";
|
|
62
|
+
readonly appHandle: string;
|
|
63
|
+
readonly documentModelKey: string;
|
|
64
|
+
}
|
|
65
|
+
/** Reference to a document model's field: `<appHandle>.documentModels.<documentModelKey>.fields.<fieldKey>`. */
|
|
66
|
+
export interface DocumentModelFieldRefAst {
|
|
67
|
+
readonly kind: "documentModelField";
|
|
68
|
+
readonly appHandle: string;
|
|
69
|
+
readonly documentModelKey: string;
|
|
70
|
+
readonly fieldKey: string;
|
|
71
|
+
}
|
|
72
|
+
/** Reference to an agent via direct module import of the agent's `self` export. */
|
|
73
|
+
export interface AgentRefAst {
|
|
74
|
+
readonly kind: "agent";
|
|
75
|
+
readonly appHandle: string;
|
|
76
|
+
readonly agentKey: string;
|
|
77
|
+
/** Display name of the agent — used to derive the import filename via slugify. */
|
|
78
|
+
readonly name: string;
|
|
79
|
+
}
|
|
80
|
+
/** Reference to an approval chain via the app's `approvalChains` bag. */
|
|
81
|
+
export interface ApprovalChainRefAst {
|
|
82
|
+
readonly kind: "approvalChain";
|
|
83
|
+
readonly appHandle: string;
|
|
84
|
+
readonly approvalChainKey: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Reference to an org-level AI provider connector via the flat `catalog.connectors`
|
|
88
|
+
* bag (connectors aren't app-owned, so there's no `appHandle`). `id` is the wire
|
|
89
|
+
* connector id, carried even when resolved so the printer can fall back to an
|
|
90
|
+
* id-only TODO literal on a catalog miss; `name` is set only when the connector
|
|
91
|
+
* catalog resolved a display name. `handle` is the minted, disambiguated catalog
|
|
92
|
+
* key (e.g. `bedrockSonnet`) resolved via the connector catalog — when present,
|
|
93
|
+
* the printer emits it directly rather than re-deriving a handle from `name`.
|
|
94
|
+
*/
|
|
95
|
+
export interface ConnectorRefAst {
|
|
96
|
+
readonly kind: "connector";
|
|
97
|
+
readonly id: string;
|
|
98
|
+
readonly name?: string;
|
|
99
|
+
readonly handle?: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Placeholder for an identifier (uuid or clientHandle) the catalog couldn't
|
|
103
|
+
* resolve — printer emits it as a quoted literal with a `/* TODO *\/` comment.
|
|
104
|
+
* Named (not just inline in `RefExpr`) so consumers outside a polymorphic
|
|
105
|
+
* `RefExpr` slot — e.g. a trigger's `app:` / `changedFields:` — can carry the
|
|
106
|
+
* same unresolved marker without fabricating a fake catalog handle.
|
|
107
|
+
*/
|
|
108
|
+
export interface UnresolvedRefAst {
|
|
109
|
+
readonly kind: "unresolved";
|
|
110
|
+
readonly uuid: string;
|
|
111
|
+
readonly hint: string;
|
|
112
|
+
}
|
|
113
|
+
export type RefExpr =
|
|
114
|
+
/** Literal value (string, number, boolean, array, object, null). */
|
|
115
|
+
{
|
|
116
|
+
kind: "literal";
|
|
117
|
+
value: unknown;
|
|
118
|
+
}
|
|
119
|
+
/** Reference to a task's output: `ctx.tasks.<task>.<path...>`. */
|
|
120
|
+
| {
|
|
121
|
+
kind: "taskRef";
|
|
122
|
+
task: string;
|
|
123
|
+
path: readonly string[];
|
|
124
|
+
}
|
|
125
|
+
/** Reference to a trigger input: `ctx.trigger.<path...>`. */
|
|
126
|
+
| {
|
|
127
|
+
kind: "triggerRef";
|
|
128
|
+
path: readonly string[];
|
|
129
|
+
}
|
|
130
|
+
/** Reference to a forEach loop variable: `ctx.tasks.<forEachTask>.<path...>`. */
|
|
131
|
+
| {
|
|
132
|
+
kind: "forEachRef";
|
|
133
|
+
forEachTask: string;
|
|
134
|
+
path: readonly string[];
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Reference to the *current iteration value* of an enclosing forEach
|
|
138
|
+
* body — i.e. the `item` parameter passed to the `tasks` callback.
|
|
139
|
+
* Emitted when the wire payload uses the sentinel UUID
|
|
140
|
+
* `10000001-2000-4000-a000-800000000000` as the forEach ref `name`.
|
|
141
|
+
* Printer renders as `item` (plus any remaining path).
|
|
142
|
+
*/
|
|
143
|
+
| {
|
|
144
|
+
kind: "forEachItemRef";
|
|
145
|
+
forEachTask: string;
|
|
146
|
+
path: readonly string[];
|
|
147
|
+
}
|
|
148
|
+
/** Reference to a variable created by a setVariable task: `ctx.variables.<varTask>.<name>`. */
|
|
149
|
+
| {
|
|
150
|
+
kind: "variableParamRef";
|
|
151
|
+
varTask: string;
|
|
152
|
+
name: string;
|
|
153
|
+
}
|
|
154
|
+
/** Template string: `template(...parts)` where parts alternate strings and RefExpr. */
|
|
155
|
+
| {
|
|
156
|
+
kind: "template";
|
|
157
|
+
parts: readonly (string | RefExpr)[];
|
|
158
|
+
} | FieldRefAst | AppRefAst | AgentRefAst | AutomationRefAst | DocumentModelRefAst | DocumentModelFieldRefAst | ApprovalChainRefAst | ConnectorRefAst | UnresolvedRefAst;
|
|
159
|
+
export type FilterValueAst = {
|
|
160
|
+
kind: "text";
|
|
161
|
+
value: string;
|
|
162
|
+
} | {
|
|
163
|
+
kind: "number";
|
|
164
|
+
value: number;
|
|
165
|
+
} | {
|
|
166
|
+
kind: "boolean";
|
|
167
|
+
value: boolean;
|
|
168
|
+
} | {
|
|
169
|
+
kind: "uuid";
|
|
170
|
+
value: string;
|
|
171
|
+
} | {
|
|
172
|
+
kind: "date";
|
|
173
|
+
value: string;
|
|
174
|
+
} | {
|
|
175
|
+
kind: "datetime";
|
|
176
|
+
value: string;
|
|
177
|
+
} | {
|
|
178
|
+
kind: "null";
|
|
179
|
+
} | {
|
|
180
|
+
kind: "currentUser";
|
|
181
|
+
}
|
|
182
|
+
/** A reference value — wraps a RefExpr for the printer to render. */
|
|
183
|
+
| {
|
|
184
|
+
kind: "reference";
|
|
185
|
+
ref: RefExpr;
|
|
186
|
+
};
|
|
187
|
+
export type FilterAst = {
|
|
188
|
+
kind: "eq" | "gt" | "gte" | "lt" | "lte";
|
|
189
|
+
/** Either a field descriptor (`app.fields.X`) or a RefExpr (for ref* operators). */
|
|
190
|
+
left: RefExpr;
|
|
191
|
+
right: FilterValueAst | RefExpr;
|
|
192
|
+
not?: boolean;
|
|
193
|
+
} | {
|
|
194
|
+
kind: "like";
|
|
195
|
+
left: RefExpr;
|
|
196
|
+
right: FilterValueAst | RefExpr;
|
|
197
|
+
not?: boolean;
|
|
198
|
+
caseInsensitive?: boolean;
|
|
199
|
+
mode?: "STARTS_WITH" | "ENDS_WITH" | "CONTAINS" | "LEGACY";
|
|
200
|
+
} | {
|
|
201
|
+
kind: "in";
|
|
202
|
+
left: RefExpr;
|
|
203
|
+
values: readonly (FilterValueAst | RefExpr)[];
|
|
204
|
+
not?: boolean;
|
|
205
|
+
} | {
|
|
206
|
+
kind: "between";
|
|
207
|
+
left: RefExpr;
|
|
208
|
+
values: readonly [FilterValueAst | RefExpr, FilterValueAst | RefExpr];
|
|
209
|
+
not?: boolean;
|
|
210
|
+
} | {
|
|
211
|
+
/** Field falls within a relative calendar range — see `ConsecutiveRangeFilter`. */
|
|
212
|
+
kind: "consecutiveRange";
|
|
213
|
+
left: RefExpr;
|
|
214
|
+
unit: string;
|
|
215
|
+
count: number;
|
|
216
|
+
offset: number;
|
|
217
|
+
semantic: boolean;
|
|
218
|
+
} | {
|
|
219
|
+
kind: "contains" | "overlaps";
|
|
220
|
+
left: RefExpr;
|
|
221
|
+
values: readonly (FilterValueAst | RefExpr)[];
|
|
222
|
+
} | {
|
|
223
|
+
kind: "isNull";
|
|
224
|
+
left: RefExpr;
|
|
225
|
+
not?: boolean;
|
|
226
|
+
} | {
|
|
227
|
+
kind: "and" | "or";
|
|
228
|
+
children: readonly FilterAst[];
|
|
229
|
+
} | {
|
|
230
|
+
kind: "true" | "false";
|
|
231
|
+
};
|
|
232
|
+
export interface SortAst {
|
|
233
|
+
readonly field: RefExpr;
|
|
234
|
+
readonly direction: "ASC" | "DESC";
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Runtime predicate matching the closed `RefExpr` discriminant set.
|
|
238
|
+
* Used by the shared filter printer to disambiguate `FilterValueAst |
|
|
239
|
+
* RefExpr` (both shapes carry a `kind` field) and by per-consumer
|
|
240
|
+
* printers when dispatching generic task-arg values.
|
|
241
|
+
*/
|
|
242
|
+
export declare function isRefExpr(value: unknown): value is RefExpr;
|