@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,467 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build an app's catalog by scanning its **authoring files** rather than
|
|
3
|
+
* round-tripping the server. Stream-root builders (`defineApp`, …) and
|
|
4
|
+
* own-file children default-export either a `{ ref(refName), def(refName) }`
|
|
5
|
+
* configured entity or a plain `DeployableEntity`. Per-kind catalog shape
|
|
6
|
+
* (stub refs, trigger/outputs bags, `searchTable` vs bag dir) lives on each
|
|
7
|
+
* module's `catalog` facet — this file only walks
|
|
8
|
+
* `ownFileCatalogChildrenOf(parent)`.
|
|
9
|
+
*
|
|
10
|
+
* Assembles two parallel objects:
|
|
11
|
+
*
|
|
12
|
+
* - `refs` — identity + the app's `fields` bag + one bag per catalog child
|
|
13
|
+
* (`catalog.catalogBag`), each entry from `catalog.refFromAuthoring`.
|
|
14
|
+
* - `defs` — configured children's `.def(refName)` plus the app's own
|
|
15
|
+
* `def()` under `app`.
|
|
16
|
+
*
|
|
17
|
+
* `refName` is always the file's own name (`refNameOf`).
|
|
18
|
+
*
|
|
19
|
+
* `writeAppCatalogFromAuthoring` persists `refs` as a static catalog file
|
|
20
|
+
* at `<appDir>/generated/catalog.ts`.
|
|
21
|
+
*/
|
|
22
|
+
import { mkdir, readdir, stat, writeFile } from "node:fs/promises";
|
|
23
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
24
|
+
import { createJiti } from "jiti/static";
|
|
25
|
+
import { KIND_BY_ID, ownFileCatalogChildrenOf, } from "../graph/index.js";
|
|
26
|
+
import { writeCatalogBarrel } from "./org.js";
|
|
27
|
+
import { renderCatalog } from "./render.js";
|
|
28
|
+
import { assertAuthoringPathForTenant, assertValidAuthoringLayout, } from "../engine/workspace/authoring-layout.js";
|
|
29
|
+
function isConfiguredEntity(value) {
|
|
30
|
+
return (typeof value === "object" &&
|
|
31
|
+
value !== null &&
|
|
32
|
+
typeof value.ref === "function" &&
|
|
33
|
+
typeof value.def === "function");
|
|
34
|
+
}
|
|
35
|
+
// `moduleCache: false` — every function in this module exists to reflect
|
|
36
|
+
// whatever's *currently* on disk. Within a single `edk pull` an app's own
|
|
37
|
+
// file gets imported here once while it's still the import-time
|
|
38
|
+
// reference-only stub (no default export), then overwritten with the real
|
|
39
|
+
// `defineApp(...)` call via plain `writeFile` (not through jiti), then
|
|
40
|
+
// imported here again. A cached jiti would return the stale pre-overwrite
|
|
41
|
+
// result for that second import — exactly the "does not default-export a
|
|
42
|
+
// configured app" failure this avoids. Re-transpiling on every call is the
|
|
43
|
+
// deliberate tradeoff; this isn't a hot path.
|
|
44
|
+
//
|
|
45
|
+
// Keyed by the resolved `@catalog` path so multiple consumers (different
|
|
46
|
+
// workspace roots) each get the right alias, and so the singleton is reused
|
|
47
|
+
// within a single import/pull run.
|
|
48
|
+
const jitiByAlias = new Map();
|
|
49
|
+
function authoringJiti(catalogPath) {
|
|
50
|
+
const key = catalogPath ?? "";
|
|
51
|
+
let jiti = jitiByAlias.get(key);
|
|
52
|
+
if (jiti === undefined) {
|
|
53
|
+
const alias = catalogPath !== undefined ? { "@catalog": catalogPath } : {};
|
|
54
|
+
jiti = createJiti(import.meta.url, { moduleCache: false, alias });
|
|
55
|
+
jitiByAlias.set(key, jiti);
|
|
56
|
+
}
|
|
57
|
+
return jiti;
|
|
58
|
+
}
|
|
59
|
+
/** The generated catalog's own filename — never treated as an authoring file. */
|
|
60
|
+
const CATALOG_FILENAME = "catalog.ts";
|
|
61
|
+
function isEntityFile(name) {
|
|
62
|
+
if (name === CATALOG_FILENAME)
|
|
63
|
+
return false;
|
|
64
|
+
if (name.endsWith(".d.ts") || name.endsWith(".test.ts"))
|
|
65
|
+
return false;
|
|
66
|
+
if (name.startsWith("_"))
|
|
67
|
+
return false; // driver/helper convention, matches src/deploy/directory.ts
|
|
68
|
+
return name.endsWith(".ts") || name.endsWith(".js") || name.endsWith(".mjs");
|
|
69
|
+
}
|
|
70
|
+
async function listEntityFiles(dir) {
|
|
71
|
+
let entries;
|
|
72
|
+
try {
|
|
73
|
+
entries = await readdir(dir, { withFileTypes: true });
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
if (err.code === "ENOENT")
|
|
77
|
+
return [];
|
|
78
|
+
throw err;
|
|
79
|
+
}
|
|
80
|
+
return entries.filter((e) => e.isFile() && isEntityFile(e.name)).map((e) => join(dir, e.name));
|
|
81
|
+
}
|
|
82
|
+
// Mirrors `src/deploy/directory.ts`'s `SKIP_DIR_NAMES` — `regenerateAppCatalogsUnder`
|
|
83
|
+
// runs over the same caller-supplied directory just before discovery, so it
|
|
84
|
+
// needs the identical guard against walking into `node_modules`/`.git`/`dist`
|
|
85
|
+
// when that directory turns out to be the repo root (e.g. a caller that
|
|
86
|
+
// defaulted to `cwd`).
|
|
87
|
+
const SKIP_DIR_NAMES = new Set(["node_modules", ".git", "dist", ".edk-state", "generated"]);
|
|
88
|
+
/** Same as {@link listEntityFiles}, but walks every subdirectory too. */
|
|
89
|
+
async function listEntityFilesRecursive(dir) {
|
|
90
|
+
let entries;
|
|
91
|
+
try {
|
|
92
|
+
entries = await readdir(dir, { withFileTypes: true });
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
if (err.code === "ENOENT")
|
|
96
|
+
return [];
|
|
97
|
+
throw err;
|
|
98
|
+
}
|
|
99
|
+
const out = [];
|
|
100
|
+
for (const entry of entries) {
|
|
101
|
+
if (entry.isDirectory() && SKIP_DIR_NAMES.has(entry.name))
|
|
102
|
+
continue;
|
|
103
|
+
const full = join(dir, entry.name);
|
|
104
|
+
if (entry.isDirectory())
|
|
105
|
+
out.push(...(await listEntityFilesRecursive(full)));
|
|
106
|
+
else if (entry.isFile() && isEntityFile(entry.name))
|
|
107
|
+
out.push(full);
|
|
108
|
+
}
|
|
109
|
+
return out;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Expand caller paths into concrete entity source files.
|
|
113
|
+
*
|
|
114
|
+
* Each path may be a single `.ts`/`.js`/`.mjs` authoring file or a directory
|
|
115
|
+
* to walk (same skip rules as {@link listEntityFilesRecursive}). Used by
|
|
116
|
+
* plan/apply so `edk plan path/to/foo.ts bar.ts some/dir` works without
|
|
117
|
+
* moving files into a staging folder.
|
|
118
|
+
*
|
|
119
|
+
* When `tenant` is set (plan/apply), every file must also sit under the
|
|
120
|
+
* authenticated org/instance workspace — see {@link assertAuthoringPathForTenant}.
|
|
121
|
+
*/
|
|
122
|
+
export async function listEntityFilesFromPaths(paths, tenant) {
|
|
123
|
+
if (paths.length === 0) {
|
|
124
|
+
return listEntityFilesRecursive(process.cwd());
|
|
125
|
+
}
|
|
126
|
+
const out = [];
|
|
127
|
+
for (const raw of paths) {
|
|
128
|
+
const abs = resolve(raw);
|
|
129
|
+
let st;
|
|
130
|
+
try {
|
|
131
|
+
st = await stat(abs);
|
|
132
|
+
}
|
|
133
|
+
catch (err) {
|
|
134
|
+
if (err.code === "ENOENT") {
|
|
135
|
+
throw new Error(`Path does not exist: ${abs}`);
|
|
136
|
+
}
|
|
137
|
+
throw err;
|
|
138
|
+
}
|
|
139
|
+
if (st.isFile()) {
|
|
140
|
+
if (!isEntityFile(basename(abs))) {
|
|
141
|
+
throw new Error(`Not an entity source file: ${abs}`);
|
|
142
|
+
}
|
|
143
|
+
if (tenant)
|
|
144
|
+
assertAuthoringPathForTenant(abs, tenant);
|
|
145
|
+
else
|
|
146
|
+
assertValidAuthoringLayout(abs);
|
|
147
|
+
out.push(abs);
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (st.isDirectory()) {
|
|
151
|
+
for (const file of await listEntityFilesRecursive(abs)) {
|
|
152
|
+
if (tenant)
|
|
153
|
+
assertAuthoringPathForTenant(file, tenant);
|
|
154
|
+
else
|
|
155
|
+
assertValidAuthoringLayout(file);
|
|
156
|
+
out.push(file);
|
|
157
|
+
}
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
throw new Error(`Not a file or directory: ${abs}`);
|
|
161
|
+
}
|
|
162
|
+
return [...new Set(out)].sort();
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* The ref name a file's authoring convention implies — its name minus
|
|
166
|
+
* extension. Exported so other discovery code (`src/deploy/directory.ts`)
|
|
167
|
+
* derives the same value from the same rule, rather than each maintaining its
|
|
168
|
+
* own copy of "strip the extension."
|
|
169
|
+
*/
|
|
170
|
+
export function refNameOf(file) {
|
|
171
|
+
return basename(file).replace(/\.(ts|js|mjs)$/, "");
|
|
172
|
+
}
|
|
173
|
+
/** Own-file bag directory for a catalog child under `appDir`. */
|
|
174
|
+
function catalogChildDir(appDir, child) {
|
|
175
|
+
if (child.authoring.unit !== "ownFile") {
|
|
176
|
+
throw new Error(`entity kind "${child.kind}" has no ownFile authoring bag`);
|
|
177
|
+
}
|
|
178
|
+
return join(appDir, child.authoring.bag);
|
|
179
|
+
}
|
|
180
|
+
/** Catalog-facet children of a stream-root kind (app / element). */
|
|
181
|
+
function catalogChildrenOf(parentKind) {
|
|
182
|
+
return ownFileCatalogChildrenOf(parentKind);
|
|
183
|
+
}
|
|
184
|
+
/** Stub refs for every file in a child's bag — no import, just a directory listing. */
|
|
185
|
+
async function stubRefsForChild(appDir, child, parent) {
|
|
186
|
+
const facet = child.catalog;
|
|
187
|
+
if (!facet.participates)
|
|
188
|
+
return {};
|
|
189
|
+
const out = {};
|
|
190
|
+
for (const file of await listEntityFiles(catalogChildDir(appDir, child))) {
|
|
191
|
+
const refName = refNameOf(file);
|
|
192
|
+
out[refName] = facet.stubRef(refName, parent);
|
|
193
|
+
}
|
|
194
|
+
return out;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Import every authoring file in a catalog child's bag; build refs via the
|
|
198
|
+
* module's `catalog.refFromAuthoring`. Configured entities also contribute
|
|
199
|
+
* `.def(refName)` into `defsOut[catalogBag]`.
|
|
200
|
+
*/
|
|
201
|
+
async function loadCatalogChildBag(appDir, child, parent, catalogPath, defsOut) {
|
|
202
|
+
const facet = child.catalog;
|
|
203
|
+
if (!facet.participates)
|
|
204
|
+
return {};
|
|
205
|
+
const jiti = authoringJiti(catalogPath);
|
|
206
|
+
const refs = {};
|
|
207
|
+
const defs = {};
|
|
208
|
+
for (const file of await listEntityFiles(catalogChildDir(appDir, child))) {
|
|
209
|
+
let mod;
|
|
210
|
+
try {
|
|
211
|
+
mod = (await jiti.import(file));
|
|
212
|
+
}
|
|
213
|
+
catch (err) {
|
|
214
|
+
if (process.env.EDK_DEBUG) {
|
|
215
|
+
console.error(`[EDK_DEBUG] Failed to import ${file}:`, err);
|
|
216
|
+
}
|
|
217
|
+
// Skip files that fail to load — e.g. an automation that references a
|
|
218
|
+
// catalog token not yet imported. Same policy as `regenerateAppCatalogsUnder`.
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
const refName = refNameOf(file);
|
|
222
|
+
const defaultExport = mod.default;
|
|
223
|
+
const namedExports = { ...mod };
|
|
224
|
+
delete namedExports.default;
|
|
225
|
+
const catalogRef = facet.refFromAuthoring({
|
|
226
|
+
refName,
|
|
227
|
+
parent,
|
|
228
|
+
defaultExport,
|
|
229
|
+
namedExports,
|
|
230
|
+
});
|
|
231
|
+
if (catalogRef === undefined)
|
|
232
|
+
continue;
|
|
233
|
+
refs[refName] = catalogRef;
|
|
234
|
+
if (isConfiguredEntity(defaultExport)) {
|
|
235
|
+
defs[refName] = defaultExport.def(refName);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
if (Object.keys(defs).length > 0) {
|
|
239
|
+
defsOut[facet.catalogBag] = defs;
|
|
240
|
+
}
|
|
241
|
+
return refs;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Dedupe by `(kind, handle)`, keeping the *last* occurrence. Matches the
|
|
245
|
+
* pre-dedup behavior of rendering duplicates as duplicate object-literal
|
|
246
|
+
* keys, where normal JS semantics make the last-listed entry win — callers
|
|
247
|
+
* rely on this ordering (e.g. `writeAppCatalogFromAuthoring` lists authored
|
|
248
|
+
* `extraRefs` last so they win; `writeAppCatalog`'s fallback lists `importRefs`
|
|
249
|
+
* first so a freshly authored/pulled file wins over a stale import stub).
|
|
250
|
+
*/
|
|
251
|
+
function dedupeCatalogRefs(refs) {
|
|
252
|
+
const out = new Map();
|
|
253
|
+
for (const ref of refs) {
|
|
254
|
+
out.set(`${ref.__kind}::${ref.refName}`, ref);
|
|
255
|
+
}
|
|
256
|
+
return [...out.values()];
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Write a throwaway version of `<appDir>/generated/catalog.ts` containing
|
|
260
|
+
* only stub refs — a named export matching the app's own barrel shape, so
|
|
261
|
+
* the org catalog's `import { <appRefName> } from "../../apps/<appRefName>/
|
|
262
|
+
* generated/catalog.js"` picks it up. Immediately overwritten by
|
|
263
|
+
* `writeAppCatalogFromAuthoring`'s real write once child bags resolve.
|
|
264
|
+
*/
|
|
265
|
+
async function writeStubCatalog(appDir, appRefName, appName, kind, fields, childBags) {
|
|
266
|
+
const generatedDir = join(appDir, "generated");
|
|
267
|
+
await mkdir(generatedDir, { recursive: true });
|
|
268
|
+
const body = { __kind: kind, refName: appRefName, name: appName, fields, ...childBags };
|
|
269
|
+
await writeFile(join(generatedDir, CATALOG_FILENAME), `export const ${appRefName} = ${JSON.stringify(body)};\n`, "utf8");
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Assemble an app's catalog from authoring files on disk — no server
|
|
273
|
+
* round-trip. `appFile` is the app's own authoring file (a `defineApp(...)`
|
|
274
|
+
* result); `appDir` is its containing folder.
|
|
275
|
+
*
|
|
276
|
+
* Writes a throwaway stub version of `<appDir>/generated/catalog.ts` before
|
|
277
|
+
* importing any child authoring file (see `writeStubCatalog`) — a sibling
|
|
278
|
+
* may reference another sibling's catalog entry that doesn't exist on disk
|
|
279
|
+
* yet. The stub is overwritten with the real catalog by this function's
|
|
280
|
+
* caller.
|
|
281
|
+
*/
|
|
282
|
+
export async function buildAppCatalogFromAuthoring(appDir, appFile, orgCatalogPath) {
|
|
283
|
+
// `appDir` is `<wsRoot>/apps/<handle>` or `<wsRoot>/elements/<handle>`.
|
|
284
|
+
const resolvedOrgCatalogPath = orgCatalogPath ?? join(dirname(dirname(appDir)), "generated", "catalog.ts");
|
|
285
|
+
const jiti = authoringJiti(resolvedOrgCatalogPath);
|
|
286
|
+
const appMod = (await jiti.import(appFile));
|
|
287
|
+
if (!isConfiguredEntity(appMod.default)) {
|
|
288
|
+
throw new Error(`${appFile} does not default-export a configured app (a defineApp(...) result)`);
|
|
289
|
+
}
|
|
290
|
+
const app = appMod.default;
|
|
291
|
+
const appRefName = refNameOf(appFile);
|
|
292
|
+
const appRef = app.ref(appRefName);
|
|
293
|
+
const fields = appRef.fields ?? {};
|
|
294
|
+
const parentKind = (appRef.__kind === "element" ? "element" : "app");
|
|
295
|
+
const children = catalogChildrenOf(parentKind);
|
|
296
|
+
const stubBags = {};
|
|
297
|
+
for (const child of children) {
|
|
298
|
+
if (!child.catalog.participates)
|
|
299
|
+
continue;
|
|
300
|
+
stubBags[child.catalog.catalogBag] = await stubRefsForChild(appDir, child, appRefName);
|
|
301
|
+
}
|
|
302
|
+
await writeStubCatalog(appDir, appRefName, appRef.name, appRef.__kind, fields, stubBags);
|
|
303
|
+
// The stub above makes THIS app's own generated/catalog.ts self-consistent
|
|
304
|
+
// for intra-app sibling references (e.g. one agent referencing another's
|
|
305
|
+
// catalog entry) — but a sibling file resolves `@catalog` through the ORG
|
|
306
|
+
// ROOT's barrel, which re-exports this app from that same file. On a
|
|
307
|
+
// brand-new app's very first regen, the org barrel doesn't reference this
|
|
308
|
+
// app yet, so `catalog.<thisApp>...` inside a sibling agent/skill file
|
|
309
|
+
// (e.g. an agent's own `skillAccess` pointing at a sibling skill) resolves
|
|
310
|
+
// to `undefined` and throws — silently dropping that file from its bag
|
|
311
|
+
// (loadBag/loadV2Bag treat a load failure as "skip", by design, for other
|
|
312
|
+
// legitimate not-yet-resolvable cases). Refresh the org barrel now so the
|
|
313
|
+
// stub is at least visible before loading any sibling file below.
|
|
314
|
+
await writeCatalogBarrel(dirname(dirname(appDir)));
|
|
315
|
+
const childRefBags = {};
|
|
316
|
+
const childDefBags = {};
|
|
317
|
+
for (const child of children) {
|
|
318
|
+
if (!child.catalog.participates)
|
|
319
|
+
continue;
|
|
320
|
+
childRefBags[child.catalog.catalogBag] = await loadCatalogChildBag(appDir, child, appRefName, resolvedOrgCatalogPath, childDefBags);
|
|
321
|
+
}
|
|
322
|
+
const refs = {
|
|
323
|
+
__kind: appRef.__kind,
|
|
324
|
+
refName: appRefName,
|
|
325
|
+
name: appRef.name,
|
|
326
|
+
fields,
|
|
327
|
+
...childRefBags,
|
|
328
|
+
};
|
|
329
|
+
const defs = {
|
|
330
|
+
refName: appRefName,
|
|
331
|
+
name: appRef.name,
|
|
332
|
+
app: app.def(appRefName),
|
|
333
|
+
...childDefBags,
|
|
334
|
+
};
|
|
335
|
+
return { refs, defs };
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Build the app's catalog from authoring files and persist `refs` as a static
|
|
339
|
+
* catalog file at `<appDir>/generated/catalog.ts` — distinct from the app's own
|
|
340
|
+
* authoring files, so this never clobbers hand-authored source. Returns `defs`
|
|
341
|
+
* too (not yet written to disk) for callers that need the whole app's deployable
|
|
342
|
+
* entities in one pass.
|
|
343
|
+
*
|
|
344
|
+
* `extraRefs` merges in refs that don't (yet) have authoring files of their
|
|
345
|
+
* own — e.g. search tables, sourced from state by the app-pull orchestrator —
|
|
346
|
+
* so they keep showing up in the catalog instead of being dropped now that the
|
|
347
|
+
* old embedded-in-the-app-file catalog section is gone.
|
|
348
|
+
*/
|
|
349
|
+
export async function writeAppCatalogFromAuthoring(appDir, appRefName, appName, appFile, extraRefs = []) {
|
|
350
|
+
// Derive org catalog path once — passed to buildAppCatalogFromAuthoring and reused
|
|
351
|
+
// for the trigger-kind scan so both use the identical `@catalog` alias.
|
|
352
|
+
const orgCatalogPath = join(dirname(dirname(appDir)), "generated", "catalog.ts");
|
|
353
|
+
const { refs, defs } = await buildAppCatalogFromAuthoring(appDir, appFile, orgCatalogPath);
|
|
354
|
+
const fields = refs.fields ?? {};
|
|
355
|
+
const parentKind = (refs.__kind === "element" ? "element" : "app");
|
|
356
|
+
const fromBags = [];
|
|
357
|
+
for (const child of catalogChildrenOf(parentKind)) {
|
|
358
|
+
if (!child.catalog.participates)
|
|
359
|
+
continue;
|
|
360
|
+
const bag = refs[child.catalog.catalogBag];
|
|
361
|
+
if (bag === undefined)
|
|
362
|
+
continue;
|
|
363
|
+
fromBags.push(...Object.values(bag));
|
|
364
|
+
}
|
|
365
|
+
const flatRefs = dedupeCatalogRefs([...Object.values(fields), ...fromBags, ...extraRefs]);
|
|
366
|
+
// Fields resolve live off the app's own file (see `renderCatalog`'s `ownFile`
|
|
367
|
+
// param) — never baked, so adding/editing/removing a field never requires
|
|
368
|
+
// re-running this writer. `flatRefs`' field entries still flow through
|
|
369
|
+
// (extraRefs/dedupe), but rendering ignores them when `ownFile` is set.
|
|
370
|
+
const ownFile = { importPath: `../${basename(appFile).replace(/\.ts$/, ".js")}`, identifier: `${appRefName}Own` };
|
|
371
|
+
const source = renderCatalog({ kind: refs.__kind, refName: appRefName, name: appName }, flatRefs, undefined, ownFile);
|
|
372
|
+
const generatedDir = join(appDir, "generated");
|
|
373
|
+
const catalogPath = join(generatedDir, CATALOG_FILENAME);
|
|
374
|
+
await mkdir(generatedDir, { recursive: true });
|
|
375
|
+
await writeFile(catalogPath, source, "utf8");
|
|
376
|
+
return { catalogPath, defs };
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Write/refresh `<appDir>/generated/catalog.ts` regardless of whether the app has been
|
|
380
|
+
* fully pulled yet. If `appFile` already default-exports a configured app (a
|
|
381
|
+
* `defineApp(...)` pull), this is exactly {@link writeAppCatalogFromAuthoring}.
|
|
382
|
+
* Otherwise — `edk import app` ran but `edk pull app` hasn't, so `appFile` is
|
|
383
|
+
* just the old reference-only stub with no default export — falls back to
|
|
384
|
+
* `importRefs` (the import-time fields/searchTables) merged with whatever
|
|
385
|
+
* own-file children already have authoring files in this folder.
|
|
386
|
+
*/
|
|
387
|
+
export async function writeAppCatalog(appDir, appRefName, appName, appFile, importRefs = [], kind = "app") {
|
|
388
|
+
// Derive the workspace catalog path for the `@catalog` alias so entity files
|
|
389
|
+
// that `import catalog from "@catalog"` can be loaded. `appDir` is
|
|
390
|
+
// `<wsRoot>/apps/<handle>`; the org catalog lives at `<wsRoot>/generated/catalog.ts`.
|
|
391
|
+
const wsRoot = dirname(dirname(appDir));
|
|
392
|
+
const orgCatalogPath = join(wsRoot, "generated", "catalog.ts");
|
|
393
|
+
const jiti = authoringJiti(orgCatalogPath);
|
|
394
|
+
let appMod;
|
|
395
|
+
try {
|
|
396
|
+
appMod = (await jiti.import(appFile));
|
|
397
|
+
}
|
|
398
|
+
catch {
|
|
399
|
+
appMod = undefined;
|
|
400
|
+
}
|
|
401
|
+
if (appMod !== undefined && isConfiguredEntity(appMod.default)) {
|
|
402
|
+
const { catalogPath } = await writeAppCatalogFromAuthoring(appDir, appRefName, appName, appFile, importRefs);
|
|
403
|
+
return { catalogPath };
|
|
404
|
+
}
|
|
405
|
+
const parentKind = kind;
|
|
406
|
+
// Ensure parent kind is registered (loud if graph drifts).
|
|
407
|
+
if (KIND_BY_ID.get(parentKind) === undefined) {
|
|
408
|
+
throw new Error(`unknown catalog parent kind "${kind}"`);
|
|
409
|
+
}
|
|
410
|
+
const fromBags = [];
|
|
411
|
+
const unusedDefs = {};
|
|
412
|
+
for (const child of catalogChildrenOf(parentKind)) {
|
|
413
|
+
const bag = await loadCatalogChildBag(appDir, child, appRefName, orgCatalogPath, unusedDefs);
|
|
414
|
+
fromBags.push(...Object.values(bag));
|
|
415
|
+
}
|
|
416
|
+
const flatRefs = dedupeCatalogRefs([...importRefs, ...fromBags]);
|
|
417
|
+
const source = renderCatalog({ kind, refName: appRefName, name: appName }, flatRefs);
|
|
418
|
+
const generatedDir = join(appDir, "generated");
|
|
419
|
+
const catalogPath = join(generatedDir, CATALOG_FILENAME);
|
|
420
|
+
await mkdir(generatedDir, { recursive: true });
|
|
421
|
+
await writeFile(catalogPath, source, "utf8");
|
|
422
|
+
return { catalogPath };
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Regenerate the per-entity catalog for every app/element authoring file
|
|
426
|
+
* found anywhere under `dir` — the same kind of file `edk plan`/`edk apply`
|
|
427
|
+
* discover as deployable entities. Run this **before** plan/apply discovery:
|
|
428
|
+
* an automation file that imports its owning app's/element's `catalog.ts`
|
|
429
|
+
* needs that file to reflect whatever own-file children exist on disk right
|
|
430
|
+
* now, not a stale snapshot from the last time the catalog was written.
|
|
431
|
+
*
|
|
432
|
+
* A file that fails to load is silently skipped here — `discoverV2Entities`
|
|
433
|
+
* (run right after this, by the caller) is what surfaces load errors to the
|
|
434
|
+
* user; duplicating that reporting here would just be noise.
|
|
435
|
+
*
|
|
436
|
+
* `pathOrPaths` may be one directory (historical), one authoring file, or a
|
|
437
|
+
* mix of files and directories — same expansion rules as plan/apply discovery.
|
|
438
|
+
*
|
|
439
|
+
* Pass `tenant` from plan/apply so paths are gated to the authenticated
|
|
440
|
+
* org/instance workspace.
|
|
441
|
+
*/
|
|
442
|
+
export async function regenerateAppCatalogsUnder(pathOrPaths, tenant) {
|
|
443
|
+
const paths = typeof pathOrPaths === "string" ? [pathOrPaths] : pathOrPaths;
|
|
444
|
+
const jiti = authoringJiti();
|
|
445
|
+
const out = [];
|
|
446
|
+
for (const file of await listEntityFilesFromPaths(paths, tenant)) {
|
|
447
|
+
let mod;
|
|
448
|
+
try {
|
|
449
|
+
mod = (await jiti.import(file));
|
|
450
|
+
}
|
|
451
|
+
catch (err) {
|
|
452
|
+
if (process.env.EDK_DEBUG) {
|
|
453
|
+
console.error(`[EDK_DEBUG] Failed to import ${file}:`, err);
|
|
454
|
+
}
|
|
455
|
+
continue;
|
|
456
|
+
}
|
|
457
|
+
if (!isConfiguredEntity(mod.default))
|
|
458
|
+
continue;
|
|
459
|
+
const appRefName = refNameOf(file);
|
|
460
|
+
const ref = mod.default.ref(appRefName);
|
|
461
|
+
if (ref.__kind !== "app" && ref.__kind !== "element")
|
|
462
|
+
continue;
|
|
463
|
+
const { catalogPath } = await writeAppCatalogFromAuthoring(dirname(file), appRefName, ref.name, file, []);
|
|
464
|
+
out.push({ appRefName, appName: ref.name, kind: ref.__kind, catalogPath });
|
|
465
|
+
}
|
|
466
|
+
return out;
|
|
467
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 catalog: per-entity fragment files + a generated barrel that assembles
|
|
3
|
+
* the typed app catalog. Handles (from `src/handles`) key the fragments; no
|
|
4
|
+
* ids appear here (identity lives in `src/deploy/state`).
|
|
5
|
+
*/
|
|
6
|
+
export { AI_PROVIDER_LLM_MODELS, type AiProviderLlmModel, type AiProviderType } from "./ai-provider-models.js";
|
|
7
|
+
export { REF_SCOPE, REF_UPDATABLE, type AgentRef, type AiProviderRef, type ApprovalChainRef, type AspectRef, type AutomationCatalogRef, type AutomationRef, type CatalogRef, type CatalogRefKind, type CategoryRef, type CloudLinkRef, type ConnectorRef, type GroupRef, type FileReaderCatalogRef, type DocumentModelFieldRef, type FieldRef, type FlowRef, type OutputPropertyRef, type SearchTableRef, type SkillRef, type TableColumnRef, type TableRef, type TriggerParameterRef, USER_FIELD_KEYS, type UserFieldKey, type UserFieldRef, } from "./types.js";
|
|
8
|
+
export { renderBarrel, renderCatalog, renderFragment, type BarrelEntry, type BarrelRoot, } from "./render.js";
|
|
9
|
+
export { appCatalogTarget, barrelPathFor, orgCatalogTarget, regenerateBarrel, writeCatalog, writeFlatCatalog, writeFragment, type CatalogTarget, } from "./write.js";
|
|
10
|
+
export { isCatalogToken, slimToken, slimTokens } from "./token.js";
|
|
11
|
+
export { buildAppCatalogFromAuthoring, listEntityFilesFromPaths, refNameOf, regenerateAppCatalogsUnder, writeAppCatalog, writeAppCatalogFromAuthoring, type AppAuthoringCatalog, type AppCatalogRegenResult, type ConfiguredEntity, } from "./from-authoring.js";
|
|
12
|
+
export { agentRef, appCatalog, approvalChainRef, automationRef, categoryRef, cloudLinkRef, connectorRef, defineAiProvider, groupRef, documentModelFieldRef, documentModelRef, elementCatalog, fieldRef, flowRef, orgCatalog, outputPropertyRef, searchTableRef, skillRef, tableColumnRef, tableRef, triggerParameterRef, usersCatalog, } from "./factories.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 catalog: per-entity fragment files + a generated barrel that assembles
|
|
3
|
+
* the typed app catalog. Handles (from `src/handles`) key the fragments; no
|
|
4
|
+
* ids appear here (identity lives in `src/deploy/state`).
|
|
5
|
+
*/
|
|
6
|
+
export { AI_PROVIDER_LLM_MODELS } from "./ai-provider-models.js";
|
|
7
|
+
export { REF_SCOPE, REF_UPDATABLE, USER_FIELD_KEYS, } from "./types.js";
|
|
8
|
+
export { renderBarrel, renderCatalog, renderFragment, } from "./render.js";
|
|
9
|
+
export { appCatalogTarget, barrelPathFor, orgCatalogTarget, regenerateBarrel, writeCatalog, writeFlatCatalog, writeFragment, } from "./write.js";
|
|
10
|
+
export { isCatalogToken, slimToken, slimTokens } from "./token.js";
|
|
11
|
+
export { buildAppCatalogFromAuthoring, listEntityFilesFromPaths, refNameOf, regenerateAppCatalogsUnder, writeAppCatalog, writeAppCatalogFromAuthoring, } from "./from-authoring.js";
|
|
12
|
+
export { agentRef, appCatalog, approvalChainRef, automationRef, categoryRef, cloudLinkRef, connectorRef, defineAiProvider, groupRef, documentModelFieldRef, documentModelRef, elementCatalog, fieldRef, flowRef, orgCatalog, outputPropertyRef, searchTableRef, skillRef, tableColumnRef, tableRef, triggerParameterRef, usersCatalog, } from "./factories.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type OrgExtract } from "../engine/pull/org.js";
|
|
2
|
+
export declare function writeOrgCatalogFromExtract(root: string, extract: OrgExtract): Promise<{
|
|
3
|
+
catalogPath: string;
|
|
4
|
+
orgPath: string;
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* Rewrite generated/catalog.ts ALONE from the current file tree — org.ts is
|
|
8
|
+
* untouched (it belongs to `pull org`). Called after a pull writes new
|
|
9
|
+
* authoring (apps/agents) so `@catalog` resolves the fresh entries.
|
|
10
|
+
*/
|
|
11
|
+
export declare function writeCatalogBarrel(root: string): Promise<string>;
|