@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,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkflowFieldType — mirrors the Java enum in
|
|
3
|
+
* jarvis/util/.../WorkflowFieldType.java
|
|
4
|
+
*
|
|
5
|
+
* Only the subset relevant to on-demand trigger inputs and task
|
|
6
|
+
* configurations is surfaced here. The full enum is listed for
|
|
7
|
+
* forward-compatibility; uncommon types are commented.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Map from user-friendly type names (used in the SDK's onDemand input
|
|
11
|
+
* schema) to the platform's WorkflowFieldType value.
|
|
12
|
+
*/
|
|
13
|
+
export const FIELD_TYPE_MAP = {
|
|
14
|
+
text: "TEXT",
|
|
15
|
+
number: "NUMBER",
|
|
16
|
+
decimal: "DECIMAL",
|
|
17
|
+
boolean: "BOOLEAN",
|
|
18
|
+
date: "DATE",
|
|
19
|
+
datetime: "DATETIME",
|
|
20
|
+
user: "USER",
|
|
21
|
+
json: "JSON",
|
|
22
|
+
object: "OBJECT",
|
|
23
|
+
attachmentId: "ATTACHMENT_ID",
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Maps a user-friendly FieldTypeAlias to the TypeScript type it represents.
|
|
27
|
+
* Used to derive the phantom T in Ref<T> for trigger inputs.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Maps GraphQL __typename values for aspect fields to WorkflowFieldType.
|
|
31
|
+
* Used when generating app definitions from Hydra's field metadata.
|
|
32
|
+
*/
|
|
33
|
+
export const ASPECT_FIELD_TYPE_NAME_TO_WORKFLOW_FIELD_TYPE = {
|
|
34
|
+
AspectTextField: "TEXT",
|
|
35
|
+
AspectHandleField: "HANDLE",
|
|
36
|
+
AspectHtmlField: "HTML",
|
|
37
|
+
AspectNumberField: "NUMBER",
|
|
38
|
+
AspectDecimalField: "DECIMAL",
|
|
39
|
+
AspectBooleanField: "BOOLEAN",
|
|
40
|
+
AspectDateField: "DATE",
|
|
41
|
+
AspectDateTimeField: "DATETIME",
|
|
42
|
+
AspectUserField: "USER_ID",
|
|
43
|
+
AspectGroupField: "GROUP_ID",
|
|
44
|
+
AspectAttachmentField: "ATTACHMENT_ID",
|
|
45
|
+
AspectJsonField: "TEXT",
|
|
46
|
+
AspectPicklistField: "PICKLIST",
|
|
47
|
+
AspectMultiPicklistField: "MULTI_PICKLIST",
|
|
48
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform field-value shapes — used as record / task-output types so
|
|
3
|
+
* `DeepRef` exposes the sub-properties the Elementum platform resolves at
|
|
4
|
+
* runtime (e.g. `ctx.trigger.record.owner.email` → ref name `user.email`).
|
|
5
|
+
*
|
|
6
|
+
* These are value types, not deployable entity kinds. Org `user`/`group`
|
|
7
|
+
* modules are data lookups for org.ts; these interfaces describe USER/GROUP
|
|
8
|
+
* (etc.) *field values* on records.
|
|
9
|
+
*/
|
|
10
|
+
export interface Manager {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly email: string;
|
|
13
|
+
}
|
|
14
|
+
export interface Employee {
|
|
15
|
+
readonly manager: Manager;
|
|
16
|
+
}
|
|
17
|
+
export interface User {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly email: string;
|
|
21
|
+
readonly employee: Employee;
|
|
22
|
+
}
|
|
23
|
+
export interface Group {
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly name: string;
|
|
26
|
+
}
|
|
27
|
+
export interface Attachment {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly description: string;
|
|
31
|
+
readonly mediaType: string;
|
|
32
|
+
readonly url: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A rich-text value. The platform exposes both `plainText` (stripped) and
|
|
36
|
+
* `html` (the rendered HTML) sub-properties on rich-text references.
|
|
37
|
+
*/
|
|
38
|
+
export interface RichText {
|
|
39
|
+
readonly plainText: string;
|
|
40
|
+
readonly html: string;
|
|
41
|
+
}
|
|
42
|
+
/** A selected picklist option. `MULTI_PICKLIST` fields expose an array of these. */
|
|
43
|
+
export interface PicklistValue {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly label: string;
|
|
46
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform field-value shapes — used as record / task-output types so
|
|
3
|
+
* `DeepRef` exposes the sub-properties the Elementum platform resolves at
|
|
4
|
+
* runtime (e.g. `ctx.trigger.record.owner.email` → ref name `user.email`).
|
|
5
|
+
*
|
|
6
|
+
* These are value types, not deployable entity kinds. Org `user`/`group`
|
|
7
|
+
* modules are data lookups for org.ts; these interfaces describe USER/GROUP
|
|
8
|
+
* (etc.) *field values* on records.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SkillRef } from "../../catalog/index.js";
|
|
2
|
+
import type { DeployableEntity, EntityDeployOptions } from "../../engine/entity.js";
|
|
3
|
+
import type { SkillTool } from "./tools.js";
|
|
4
|
+
export interface SkillV2Options extends EntityDeployOptions {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly parent: string;
|
|
7
|
+
readonly description: string;
|
|
8
|
+
readonly instructions: string;
|
|
9
|
+
/** Skill status. Defaults to `DRAFT`. */
|
|
10
|
+
readonly status?: "DRAFT" | "ACTIVE" | "INACTIVE";
|
|
11
|
+
/** Opaque passthrough for the skill's `properties` JSON field. */
|
|
12
|
+
readonly properties?: Record<string, unknown>;
|
|
13
|
+
readonly tools?: readonly SkillTool[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The configured result of `defineSkill` — its catalog reference (`ref()`) and
|
|
17
|
+
* deployable entity (`def()`). Both take the file refName as a call-time
|
|
18
|
+
* argument, matching agents and automations.
|
|
19
|
+
*/
|
|
20
|
+
export interface SkillConfigured {
|
|
21
|
+
ref(refName: string): SkillRef;
|
|
22
|
+
def(refName: string): DeployableEntity;
|
|
23
|
+
}
|
|
24
|
+
/** Build a v2 skill entity config, exposing `.ref(refName)` and `.def(refName)`. */
|
|
25
|
+
export declare function defineSkill(opts: SkillV2Options): SkillConfigured;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 skill authoring (parallel to v1 `src/agents/skills`, fully standalone so v1
|
|
3
|
+
* can be deleted wholesale once v2 is validated).
|
|
4
|
+
*
|
|
5
|
+
* `defineSkill` emits the platform's skill create envelope **minus the owner**
|
|
6
|
+
* (`ownerId`/`ownerType` injected by the wire client at deploy; the update DTO
|
|
7
|
+
* omits them) with `CatalogRef` tokens at each tool's reference positions.
|
|
8
|
+
*
|
|
9
|
+
* Identity comes from the authoring file's `refName`, exactly like
|
|
10
|
+
* `defineAutomation` / `defineAgent`; the owning app still comes from `parent`.
|
|
11
|
+
*/
|
|
12
|
+
import { slimTokens } from "../../catalog/index.js";
|
|
13
|
+
/**
|
|
14
|
+
* The provider validates `name` client-side against this pattern (confirmed
|
|
15
|
+
* live) — it is NOT a free-text display name like an agent's; the platform
|
|
16
|
+
* uses it as the skill's identifier.
|
|
17
|
+
*/
|
|
18
|
+
const SKILL_NAME_PATTERN = /^[a-z0-9-]{1,64}$/;
|
|
19
|
+
/** Build a v2 skill entity config, exposing `.ref(refName)` and `.def(refName)`. */
|
|
20
|
+
export function defineSkill(opts) {
|
|
21
|
+
if (!SKILL_NAME_PATTERN.test(opts.name)) {
|
|
22
|
+
throw new Error(`skill name "${opts.name}" must be 1-64 characters of lowercase letters, digits, and hyphens ` +
|
|
23
|
+
`(a-z, 0-9, -) — the platform uses it as the skill's identifier, not a free-text label.`);
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
ref(refName) {
|
|
27
|
+
return { __kind: "skill", refName, name: opts.name, parent: opts.parent };
|
|
28
|
+
},
|
|
29
|
+
def(refName) {
|
|
30
|
+
return {
|
|
31
|
+
kind: "skill",
|
|
32
|
+
parent: opts.parent,
|
|
33
|
+
refName,
|
|
34
|
+
// Slim every embedded catalog token to its canonical form (drop barrel bags).
|
|
35
|
+
payload: slimTokens({
|
|
36
|
+
skill: {
|
|
37
|
+
name: opts.name,
|
|
38
|
+
description: opts.description,
|
|
39
|
+
instructions: opts.instructions,
|
|
40
|
+
status: opts.status ?? "DRAFT",
|
|
41
|
+
type: "CUSTOM",
|
|
42
|
+
...(opts.properties !== undefined ? { properties: opts.properties } : {}),
|
|
43
|
+
},
|
|
44
|
+
tools: opts.tools ?? [],
|
|
45
|
+
}),
|
|
46
|
+
...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}),
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* printSkillV2 — pulled skill rendering for the terraform path. Consumes
|
|
3
|
+
* the `NormalizedSkill` that `skillFromTf` produces and emits an
|
|
4
|
+
* `apps/<app>/skills/<refName>.ts` authoring file: `defineSkill` with tools
|
|
5
|
+
* as `catalog` tokens (self-app) or a TODO literal (foreign apps — their
|
|
6
|
+
* catalog may not exist in this workspace) and tool fields as
|
|
7
|
+
* `catalog.<app>.fields.<key>`.
|
|
8
|
+
*
|
|
9
|
+
* Named identically to (but distinct from, different file/path) the legacy
|
|
10
|
+
* AST-based `printSkillV2` in `print-skill.ts` — same precedent as
|
|
11
|
+
* `entities/agent/deserializer/print-agent.ts` vs. `print-agent-v2.ts`.
|
|
12
|
+
*
|
|
13
|
+
* Platform ids never reach printed source.
|
|
14
|
+
*/
|
|
15
|
+
import type { NormalizedSkill } from "../from-tf.js";
|
|
16
|
+
export interface PrintSkillV2Options {
|
|
17
|
+
/** The owning app's refName — `parent:` and the catalog token root. */
|
|
18
|
+
readonly appRefName: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function printSkillV2(skill: NormalizedSkill, opts: PrintSkillV2Options): string;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* printSkillV2 — pulled skill rendering for the terraform path. Consumes
|
|
3
|
+
* the `NormalizedSkill` that `skillFromTf` produces and emits an
|
|
4
|
+
* `apps/<app>/skills/<refName>.ts` authoring file: `defineSkill` with tools
|
|
5
|
+
* as `catalog` tokens (self-app) or a TODO literal (foreign apps — their
|
|
6
|
+
* catalog may not exist in this workspace) and tool fields as
|
|
7
|
+
* `catalog.<app>.fields.<key>`.
|
|
8
|
+
*
|
|
9
|
+
* Named identically to (but distinct from, different file/path) the legacy
|
|
10
|
+
* AST-based `printSkillV2` in `print-skill.ts` — same precedent as
|
|
11
|
+
* `entities/agent/deserializer/print-agent.ts` vs. `print-agent-v2.ts`.
|
|
12
|
+
*
|
|
13
|
+
* Platform ids never reach printed source.
|
|
14
|
+
*/
|
|
15
|
+
import { quote } from "../../../../pull/util.js";
|
|
16
|
+
import { sdkPackageSpecifier } from "../../../internal/sdk-package.js";
|
|
17
|
+
const TOOL_FACTORY_BY_TYPE_KEY = {
|
|
18
|
+
createRecord: "skillCreateRecord",
|
|
19
|
+
searchAspect: "skillSearchAspect",
|
|
20
|
+
};
|
|
21
|
+
export function printSkillV2(skill, opts) {
|
|
22
|
+
const { appRefName } = opts;
|
|
23
|
+
const factories = [...new Set(skill.tools.map((t) => TOOL_FACTORY_BY_TYPE_KEY[t.typeKey]).filter(Boolean))].sort();
|
|
24
|
+
const usesCatalog = skill.tools.some((t) => t.target.kind === "self" || (t.fields !== undefined && t.fields.length > 0));
|
|
25
|
+
const lines = [];
|
|
26
|
+
lines.push("/**");
|
|
27
|
+
lines.push(` * ${skill.name}`);
|
|
28
|
+
lines.push(" *");
|
|
29
|
+
lines.push(" * Auto-generated by EDK (v2 pull). Hand-edit freely; the generator is a");
|
|
30
|
+
lines.push(" * one-shot starting point, not a live-binding view.");
|
|
31
|
+
lines.push(" */");
|
|
32
|
+
lines.push("");
|
|
33
|
+
lines.push(`import { ${[...factories, "defineSkill"].sort().join(", ")} } from ${JSON.stringify(sdkPackageSpecifier("agents/skills"))};`);
|
|
34
|
+
if (usesCatalog)
|
|
35
|
+
lines.push(`import catalog from "@catalog";`);
|
|
36
|
+
lines.push("");
|
|
37
|
+
lines.push(`const ${skill.refName} = defineSkill({`);
|
|
38
|
+
lines.push(` name: ${quote(skill.name)},`);
|
|
39
|
+
lines.push(` parent: ${quote(appRefName)},`);
|
|
40
|
+
lines.push(` description: ${quote(skill.description)},`);
|
|
41
|
+
lines.push(` instructions: ${quote(skill.instructions)},`);
|
|
42
|
+
if (skill.status !== undefined)
|
|
43
|
+
lines.push(` status: ${quote(skill.status)},`);
|
|
44
|
+
if (skill.properties !== undefined) {
|
|
45
|
+
lines.push(` properties: ${JSON.stringify(skill.properties)},`);
|
|
46
|
+
}
|
|
47
|
+
if (skill.tools.length > 0) {
|
|
48
|
+
lines.push(" tools: [");
|
|
49
|
+
for (const tool of skill.tools) {
|
|
50
|
+
lines.push(...printTool(tool, appRefName).map((l) => ` ${l}`));
|
|
51
|
+
}
|
|
52
|
+
lines.push(" ],");
|
|
53
|
+
}
|
|
54
|
+
lines.push("});");
|
|
55
|
+
lines.push("");
|
|
56
|
+
lines.push(`export default ${skill.refName};`);
|
|
57
|
+
lines.push("");
|
|
58
|
+
return lines.join("\n");
|
|
59
|
+
}
|
|
60
|
+
function printTool(tool, appRefName) {
|
|
61
|
+
const factory = TOOL_FACTORY_BY_TYPE_KEY[tool.typeKey] ?? "skillSearchAspect";
|
|
62
|
+
const lines = [`${factory}({`];
|
|
63
|
+
lines.push(` name: ${quote(tool.name)},`);
|
|
64
|
+
lines.push(` description: ${quote(tool.description)},`);
|
|
65
|
+
if (tool.status !== undefined)
|
|
66
|
+
lines.push(` status: ${quote(tool.status)},`);
|
|
67
|
+
if (tool.startMessage !== undefined)
|
|
68
|
+
lines.push(` startMessage: ${quote(tool.startMessage)},`);
|
|
69
|
+
if (tool.target.kind === "self") {
|
|
70
|
+
lines.push(` aspect: catalog.${appRefName},`);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
// The foreign app's catalog may not exist in this workspace — a literal
|
|
74
|
+
// token compiles and deploys; swap for a catalog token when available.
|
|
75
|
+
lines.push(` aspect: { __kind: "app", refName: ${quote(tool.target.name)}, name: ${quote(tool.target.name)} },`);
|
|
76
|
+
}
|
|
77
|
+
if (tool.typeKey === "searchAspect") {
|
|
78
|
+
lines.push(` queryDescription: ${quote(tool.queryDescription ?? "")},`);
|
|
79
|
+
if (tool.limit !== undefined)
|
|
80
|
+
lines.push(` limit: ${tool.limit},`);
|
|
81
|
+
}
|
|
82
|
+
if (tool.fields !== undefined && tool.fields.length > 0) {
|
|
83
|
+
lines.push(" fields: [");
|
|
84
|
+
for (const f of tool.fields) {
|
|
85
|
+
const parts = [`field: catalog.${appRefName}.fields.${f.key}`];
|
|
86
|
+
parts.push(`name: ${quote(f.name ?? "")}`);
|
|
87
|
+
parts.push(`description: ${quote(f.description ?? "")}`);
|
|
88
|
+
if (tool.typeKey === "createRecord" && f.required !== undefined)
|
|
89
|
+
parts.push(`required: ${f.required}`);
|
|
90
|
+
lines.push(` { ${parts.join(", ")} },`);
|
|
91
|
+
}
|
|
92
|
+
lines.push(" ],");
|
|
93
|
+
}
|
|
94
|
+
lines.push("}),");
|
|
95
|
+
return lines;
|
|
96
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill extraction: `skillFromTf` turns an `elementum_agentic_skill` block +
|
|
3
|
+
* its tool blocks (delegated to `entities/skill-tool/from-tf.ts`) into the
|
|
4
|
+
* normalized shape `printSkillV2` consumes. Platform ids come only from the
|
|
5
|
+
* stream's import blocks and stay data-side — they never reach printed
|
|
6
|
+
* source. Mirrors `entities/agent/from-tf.ts`.
|
|
7
|
+
*/
|
|
8
|
+
import { type FromTfContext } from "../../engine/pull/context.js";
|
|
9
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
10
|
+
import { type NormalizedSkillTool } from "../skill-tool/from-tf.js";
|
|
11
|
+
export interface NormalizedSkill {
|
|
12
|
+
/** Authoring key = the bijective image of the exported label. */
|
|
13
|
+
readonly refName: string;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly description: string;
|
|
16
|
+
readonly instructions: string;
|
|
17
|
+
/** Present only when it differs from the default ("DRAFT"). */
|
|
18
|
+
readonly status?: "ACTIVE" | "INACTIVE";
|
|
19
|
+
readonly properties?: Record<string, unknown>;
|
|
20
|
+
readonly tools: readonly NormalizedSkillTool[];
|
|
21
|
+
}
|
|
22
|
+
export interface SkillFromTfResult {
|
|
23
|
+
readonly skill?: NormalizedSkill;
|
|
24
|
+
/** Set when the skill can't be authored on the terraform path — reported, not fatal. */
|
|
25
|
+
readonly skippedReason?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The `elementum_agentic_skill` block + its tool blocks → the normalized
|
|
29
|
+
* skill. Tool blocks belonging to OTHER skills are skipped with a
|
|
30
|
+
* diagnostic (the caller partitions per-skill by skill_id, but stays
|
|
31
|
+
* defensive).
|
|
32
|
+
*/
|
|
33
|
+
export declare function skillFromTf(skillBlock: TfBlock, toolBlocks: readonly TfBlock[], appLabel: string, ctx: FromTfContext): SkillFromTfResult;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill extraction: `skillFromTf` turns an `elementum_agentic_skill` block +
|
|
3
|
+
* its tool blocks (delegated to `entities/skill-tool/from-tf.ts`) into the
|
|
4
|
+
* normalized shape `printSkillV2` consumes. Platform ids come only from the
|
|
5
|
+
* stream's import blocks and stay data-side — they never reach printed
|
|
6
|
+
* source. Mirrors `entities/agent/from-tf.ts`.
|
|
7
|
+
*/
|
|
8
|
+
import { EntityTfError } from "../../engine/entity.js";
|
|
9
|
+
import { optionalString, resourceRefLabel } from "../../engine/pull/context.js";
|
|
10
|
+
import { tfLabelToTsLabel } from "../../engine/tf/index.js";
|
|
11
|
+
import { skillToolFromTf } from "../skill-tool/from-tf.js";
|
|
12
|
+
import { APP_RESOURCE_TYPE } from "../app/module.js";
|
|
13
|
+
import { SKILL_RESOURCE_TYPE } from "./module.js";
|
|
14
|
+
/** Attributes `skillFromTf` understands — anything else is dialect growth, reported loudly. */
|
|
15
|
+
const KNOWN_SKILL_ATTRS = new Set([
|
|
16
|
+
"owner_id",
|
|
17
|
+
"owner_type",
|
|
18
|
+
"name",
|
|
19
|
+
"description",
|
|
20
|
+
"instructions",
|
|
21
|
+
"status",
|
|
22
|
+
"type",
|
|
23
|
+
"properties",
|
|
24
|
+
]);
|
|
25
|
+
/** Dialect attrs with no authoring slot yet — reported by name, skill still pulled. */
|
|
26
|
+
const UNAUTHORABLE_SKILL_ATTRS = new Set([
|
|
27
|
+
"routing_priority",
|
|
28
|
+
"aliases",
|
|
29
|
+
"example_utterances",
|
|
30
|
+
"positive_keywords",
|
|
31
|
+
"negative_keywords",
|
|
32
|
+
"user_ids",
|
|
33
|
+
"group_ids",
|
|
34
|
+
]);
|
|
35
|
+
/**
|
|
36
|
+
* The `elementum_agentic_skill` block + its tool blocks → the normalized
|
|
37
|
+
* skill. Tool blocks belonging to OTHER skills are skipped with a
|
|
38
|
+
* diagnostic (the caller partitions per-skill by skill_id, but stays
|
|
39
|
+
* defensive).
|
|
40
|
+
*/
|
|
41
|
+
export function skillFromTf(skillBlock, toolBlocks, appLabel, ctx) {
|
|
42
|
+
const label = skillBlock.label;
|
|
43
|
+
if (label === undefined || label === "") {
|
|
44
|
+
throw new EntityTfError(`${SKILL_RESOURCE_TYPE} block is missing its label`);
|
|
45
|
+
}
|
|
46
|
+
const attrs = skillBlock.attrs;
|
|
47
|
+
const name = optionalString(attrs, "name", `skill "${label}"`, ctx) ?? "";
|
|
48
|
+
const where = `skill "${name}" (${SKILL_RESOURCE_TYPE}.${label})`;
|
|
49
|
+
for (const key of Object.keys(attrs)) {
|
|
50
|
+
if (KNOWN_SKILL_ATTRS.has(key))
|
|
51
|
+
continue;
|
|
52
|
+
if (UNAUTHORABLE_SKILL_ATTRS.has(key)) {
|
|
53
|
+
ctx.diagnostics.push(`${where}: ${key} has no authoring slot on the terraform path yet; a rebuilt stream will omit it`);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
ctx.diagnostics.push(`${where}: unhandled attribute "${key}" — the export dialect grew; extend skillFromTf deliberately`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const ownerType = attrs["owner_type"];
|
|
60
|
+
if (ownerType !== "APP_ASPECT") {
|
|
61
|
+
return { skippedReason: `${where}: owner_type ${JSON.stringify(ownerType)} has no terraform-path authoring yet; skipped` };
|
|
62
|
+
}
|
|
63
|
+
if (resourceRefLabel(attrs["owner_id"], APP_RESOURCE_TYPE) !== appLabel) {
|
|
64
|
+
return { skippedReason: `${where}: owner_id does not reference ${APP_RESOURCE_TYPE}.${appLabel}; skipped` };
|
|
65
|
+
}
|
|
66
|
+
let properties;
|
|
67
|
+
const rawProperties = attrs["properties"];
|
|
68
|
+
if (typeof rawProperties === "string" && rawProperties !== "") {
|
|
69
|
+
try {
|
|
70
|
+
properties = JSON.parse(rawProperties);
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
ctx.diagnostics.push(`${where}: properties is not valid JSON; dropped`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const status = optionalString(attrs, "status", where, ctx);
|
|
77
|
+
const owner = { appType: APP_RESOURCE_TYPE, appLabel, skillType: SKILL_RESOURCE_TYPE, skillLabel: label };
|
|
78
|
+
const tools = [];
|
|
79
|
+
for (const block of toolBlocks) {
|
|
80
|
+
const tool = skillToolFromTf(block, owner, ctx);
|
|
81
|
+
if (tool !== undefined)
|
|
82
|
+
tools.push(tool);
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
skill: {
|
|
86
|
+
refName: tfLabelToTsLabel(label),
|
|
87
|
+
name,
|
|
88
|
+
description: optionalString(attrs, "description", where, ctx) ?? "",
|
|
89
|
+
instructions: optionalString(attrs, "instructions", where, ctx) ?? "",
|
|
90
|
+
...((status === "ACTIVE" || status === "INACTIVE") && { status }),
|
|
91
|
+
...(properties !== undefined && { properties }),
|
|
92
|
+
tools,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 skill authoring — emits the platform's skill wire shape (minus the owner,
|
|
3
|
+
* which the deploy wire client injects) with `CatalogRef` tokens at every
|
|
4
|
+
* reference position. Standalone from v1.
|
|
5
|
+
*/
|
|
6
|
+
export { defineSkill, type SkillConfigured, type SkillV2Options } from "./build.js";
|
|
7
|
+
export { skillAutomation, skillCreateRecord, skillRunAgent, skillSearchAspect, skillSearchTable, skillUpdateRecord, type SkillRecordField, type SkillSearchField, type SkillToolStatus, type SkillTool, } from "./tools.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2 skill authoring — emits the platform's skill wire shape (minus the owner,
|
|
3
|
+
* which the deploy wire client injects) with `CatalogRef` tokens at every
|
|
4
|
+
* reference position. Standalone from v1.
|
|
5
|
+
*/
|
|
6
|
+
export { defineSkill } from "./build.js";
|
|
7
|
+
export { skillAutomation, skillCreateRecord, skillRunAgent, skillSearchAspect, skillSearchTable, skillUpdateRecord, } from "./tools.js";
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** The skill entity's registry entry + resource-type constant (see src/graph/). */
|
|
2
|
+
import { bareFactoryEntry } from "../../catalog/render-helpers.js";
|
|
3
|
+
import { isTfExpr } from "../../engine/tf/index.js";
|
|
4
|
+
import { printSkillV2 } from "./deserializer/print-skill-v2.js";
|
|
5
|
+
import { skillFromTf } from "./from-tf.js";
|
|
6
|
+
import { skillToTf } from "./to-tf.js";
|
|
7
|
+
export const SKILL_RESOURCE_TYPE = "elementum_agentic_skill";
|
|
8
|
+
function isConfigured(value) {
|
|
9
|
+
return (typeof value === "object" &&
|
|
10
|
+
value !== null &&
|
|
11
|
+
typeof value.ref === "function" &&
|
|
12
|
+
typeof value.def === "function");
|
|
13
|
+
}
|
|
14
|
+
function skillStubRef(refName, parent) {
|
|
15
|
+
return { __kind: "skill", refName, name: refName, parent };
|
|
16
|
+
}
|
|
17
|
+
function skillRefFromAuthoring(args) {
|
|
18
|
+
const { refName, parent, defaultExport } = args;
|
|
19
|
+
if (isConfigured(defaultExport)) {
|
|
20
|
+
const catalogRef = defaultExport.ref(refName);
|
|
21
|
+
if (catalogRef.__kind !== "skill")
|
|
22
|
+
return undefined;
|
|
23
|
+
return catalogRef;
|
|
24
|
+
}
|
|
25
|
+
if (typeof defaultExport !== "object" ||
|
|
26
|
+
defaultExport === null ||
|
|
27
|
+
defaultExport.kind !== "skill") {
|
|
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 payload = entity.payload;
|
|
35
|
+
const name = typeof maybeRefName === "string"
|
|
36
|
+
? maybeRefName
|
|
37
|
+
: typeof payload.name === "string"
|
|
38
|
+
? payload.name
|
|
39
|
+
: typeof payload.skill?.name === "string"
|
|
40
|
+
? payload.skill.name
|
|
41
|
+
: entityRefName;
|
|
42
|
+
return { __kind: "skill", refName: entityRefName, name, parent: entityParent };
|
|
43
|
+
}
|
|
44
|
+
function extractSkills(ownBlocks, stream, ctx) {
|
|
45
|
+
const toolBlocks = stream.byKind.get("skill-tool") ?? [];
|
|
46
|
+
const items = [];
|
|
47
|
+
const skipped = [];
|
|
48
|
+
const diagnostics = [];
|
|
49
|
+
for (const skillBlock of ownBlocks) {
|
|
50
|
+
const skillLabel = skillBlock.label ?? "";
|
|
51
|
+
const ownTools = toolBlocks.filter((b) => {
|
|
52
|
+
const ref = b.attrs["skill_id"];
|
|
53
|
+
return isTfExpr(ref) && ref.$expr === "resource-attr" && ref.type === SKILL_RESOURCE_TYPE && ref.label === skillLabel;
|
|
54
|
+
});
|
|
55
|
+
const { skill, skippedReason } = skillFromTf(skillBlock, ownTools, ctx.appTfLabel, ctx);
|
|
56
|
+
if (skill !== undefined)
|
|
57
|
+
items.push(skill);
|
|
58
|
+
else if (skippedReason !== undefined) {
|
|
59
|
+
skipped.push(`${SKILL_RESOURCE_TYPE}.${skillLabel}`);
|
|
60
|
+
diagnostics.push(skippedReason);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return { items, skipped, diagnostics };
|
|
64
|
+
}
|
|
65
|
+
export const skillModule = {
|
|
66
|
+
kind: "skill",
|
|
67
|
+
stream: { role: "streamMember" },
|
|
68
|
+
authoring: { unit: "ownFile", bag: "skills" },
|
|
69
|
+
parents: [
|
|
70
|
+
{ parent: "org", child: "skill" },
|
|
71
|
+
{ parent: "app", child: "skill" },
|
|
72
|
+
{ parent: "agent", child: "skill" },
|
|
73
|
+
],
|
|
74
|
+
resource: { shape: "single", resourceType: SKILL_RESOURCE_TYPE, adoptable: true },
|
|
75
|
+
// Foreign skills (an agent's skillAccess pointing at a skill owned by a
|
|
76
|
+
// different app) emit `data.elementum_agentic_skill` — mirrors appModule.
|
|
77
|
+
data: { participates: true, lookupAttr: "name", referencedByBuild: true },
|
|
78
|
+
canvas: { participates: true, label: "Skills", glyph: "◇", component: "skillCard" },
|
|
79
|
+
lifecycle: {
|
|
80
|
+
participates: true,
|
|
81
|
+
extractOwnFile: extractSkills,
|
|
82
|
+
printOwnFile: (item, opts) => {
|
|
83
|
+
const skill = item;
|
|
84
|
+
return {
|
|
85
|
+
refName: skill.refName,
|
|
86
|
+
source: printSkillV2(skill, { appRefName: opts.appRefName }),
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
toTf: (entity, ctx) => skillToTf(entity, {
|
|
90
|
+
appRefName: ctx.appRefName,
|
|
91
|
+
appTfLabel: ctx.appTfLabel,
|
|
92
|
+
orgRefs: ctx.orgRefs,
|
|
93
|
+
diagnostics: ctx.diagnostics,
|
|
94
|
+
}),
|
|
95
|
+
},
|
|
96
|
+
catalog: {
|
|
97
|
+
participates: true,
|
|
98
|
+
refKind: "skill",
|
|
99
|
+
catalogBag: "skills",
|
|
100
|
+
renderOrder: 30,
|
|
101
|
+
catalogRoot: "app",
|
|
102
|
+
renderEntry: ({ keyName, baseIndent }) => bareFactoryEntry("skillRef", keyName, baseIndent),
|
|
103
|
+
stubRef: skillStubRef,
|
|
104
|
+
refFromAuthoring: skillRefFromAuthoring,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill emission: `skillToTf` consumes the discovered `DeployableEntity`
|
|
3
|
+
* (the `defineSkill` def() payload) and emits `elementum_agentic_skill` +
|
|
4
|
+
* one tool resource per implemented tool (the tool pass delegates to
|
|
5
|
+
* `entities/skill-tool/to-tf.ts`). Mirrors `entities/agent/to-tf.ts`.
|
|
6
|
+
*
|
|
7
|
+
* The dialect is the live provider's ACTUAL schema (confirmed against the
|
|
8
|
+
* deployed `elementum` provider, `main` branch of the ei terraform provider
|
|
9
|
+
* repo — not `pristine-refactor`'s older, generic single-tool-resource
|
|
10
|
+
* shape): `owner_id`/`owner_type` as the owning app's resource ref +
|
|
11
|
+
* `"APP_ASPECT"`, `name`/`description`/`instructions`/`status`/`type`/
|
|
12
|
+
* `properties`. Discovery/routing fields (aliases, example_utterances,
|
|
13
|
+
* *_keywords, routing_priority) and access policy (user_ids/group_ids)
|
|
14
|
+
* aren't authored yet, so there's nothing to emit for them.
|
|
15
|
+
*/
|
|
16
|
+
import type { OrgRefLookup } from "../../engine/build/context.js";
|
|
17
|
+
import { type DeployableEntity } from "../../engine/entity.js";
|
|
18
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
19
|
+
export interface SkillToTfContext {
|
|
20
|
+
/** The owning app's refName (self-target detection) and tfLabel (namespace). */
|
|
21
|
+
readonly appRefName: string;
|
|
22
|
+
readonly appTfLabel: string;
|
|
23
|
+
readonly orgRefs: OrgRefLookup;
|
|
24
|
+
/** Degradations land here — reported by the caller, never silent. */
|
|
25
|
+
readonly diagnostics: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface SkillToTfResult {
|
|
28
|
+
readonly blocks: readonly TfBlock[];
|
|
29
|
+
/** The skill's terraform address. */
|
|
30
|
+
readonly address: string;
|
|
31
|
+
}
|
|
32
|
+
/** `elementum_agentic_skill` + one tool resource per implemented tool, in the platform's dialect. */
|
|
33
|
+
export declare function skillToTf(entity: DeployableEntity, ctx: SkillToTfContext): SkillToTfResult;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill emission: `skillToTf` consumes the discovered `DeployableEntity`
|
|
3
|
+
* (the `defineSkill` def() payload) and emits `elementum_agentic_skill` +
|
|
4
|
+
* one tool resource per implemented tool (the tool pass delegates to
|
|
5
|
+
* `entities/skill-tool/to-tf.ts`). Mirrors `entities/agent/to-tf.ts`.
|
|
6
|
+
*
|
|
7
|
+
* The dialect is the live provider's ACTUAL schema (confirmed against the
|
|
8
|
+
* deployed `elementum` provider, `main` branch of the ei terraform provider
|
|
9
|
+
* repo — not `pristine-refactor`'s older, generic single-tool-resource
|
|
10
|
+
* shape): `owner_id`/`owner_type` as the owning app's resource ref +
|
|
11
|
+
* `"APP_ASPECT"`, `name`/`description`/`instructions`/`status`/`type`/
|
|
12
|
+
* `properties`. Discovery/routing fields (aliases, example_utterances,
|
|
13
|
+
* *_keywords, routing_priority) and access policy (user_ids/group_ids)
|
|
14
|
+
* aren't authored yet, so there's nothing to emit for them.
|
|
15
|
+
*/
|
|
16
|
+
import { EntityTfError } from "../../engine/entity.js";
|
|
17
|
+
import { expr, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
18
|
+
import { skillToolToTf } from "../skill-tool/to-tf.js";
|
|
19
|
+
import { APP_RESOURCE_TYPE } from "../app/module.js";
|
|
20
|
+
import { SKILL_RESOURCE_TYPE } from "./module.js";
|
|
21
|
+
/** `elementum_agentic_skill` + one tool resource per implemented tool, in the platform's dialect. */
|
|
22
|
+
export function skillToTf(entity, ctx) {
|
|
23
|
+
if (entity.kind !== "skill") {
|
|
24
|
+
throw new EntityTfError(`skillToTf expects kind "skill"; got "${entity.kind}" (refName "${entity.refName}")`);
|
|
25
|
+
}
|
|
26
|
+
const payload = entity.payload;
|
|
27
|
+
const elementum = payload?.skill;
|
|
28
|
+
if (payload === null || typeof payload !== "object" || elementum === undefined) {
|
|
29
|
+
throw new EntityTfError(`skill "${entity.refName}" has no skill payload — was it built with defineSkill?`);
|
|
30
|
+
}
|
|
31
|
+
const tfLabel = tsLabelToTfLabel(entity.refName);
|
|
32
|
+
const name = elementum.name ?? "";
|
|
33
|
+
const attrs = {
|
|
34
|
+
owner_id: expr.resourceAttr(APP_RESOURCE_TYPE, ctx.appTfLabel, ["id"]),
|
|
35
|
+
owner_type: "APP_ASPECT",
|
|
36
|
+
name,
|
|
37
|
+
description: elementum.description ?? "",
|
|
38
|
+
instructions: elementum.instructions ?? "",
|
|
39
|
+
status: elementum.status ?? "DRAFT",
|
|
40
|
+
type: elementum.type ?? "CUSTOM",
|
|
41
|
+
};
|
|
42
|
+
if (elementum.properties !== undefined) {
|
|
43
|
+
attrs["properties"] = JSON.stringify(elementum.properties);
|
|
44
|
+
}
|
|
45
|
+
const blocks = [{ kind: "resource", type: SKILL_RESOURCE_TYPE, label: tfLabel, attrs }];
|
|
46
|
+
for (const entry of payload.tools ?? []) {
|
|
47
|
+
const tool = skillToolToTf(entry, {
|
|
48
|
+
appRefName: ctx.appRefName,
|
|
49
|
+
appTfLabel: ctx.appTfLabel,
|
|
50
|
+
skillTfLabel: tfLabel,
|
|
51
|
+
foreignAppRef: (l, n) => ctx.orgRefs.foreignApp(l, n),
|
|
52
|
+
diagnostics: ctx.diagnostics,
|
|
53
|
+
});
|
|
54
|
+
if (tool !== undefined)
|
|
55
|
+
blocks.push(tool.block);
|
|
56
|
+
}
|
|
57
|
+
return { blocks, address: `${SKILL_RESOURCE_TYPE}.${tfLabel}` };
|
|
58
|
+
}
|