@elementumai/edk 0.9.2 → 0.9.6
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 +34 -26
- package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +1 -1
- package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +1 -1
- package/dist-sdk/pull/util.d.ts +1 -1
- package/dist-sdk/pull/util.js +3 -3
- package/dist-sdk/src/catalog/factories.d.ts +49 -10
- package/dist-sdk/src/catalog/factories.js +94 -13
- package/dist-sdk/src/catalog/from-authoring.d.ts +5 -5
- package/dist-sdk/src/catalog/from-authoring.js +7 -7
- package/dist-sdk/src/catalog/index.d.ts +2 -2
- package/dist-sdk/src/catalog/index.js +1 -1
- package/dist-sdk/src/catalog/org.js +62 -4
- package/dist-sdk/src/catalog/render-helpers.d.ts +1 -1
- package/dist-sdk/src/catalog/render-helpers.js +1 -1
- package/dist-sdk/src/catalog/render.d.ts +1 -0
- package/dist-sdk/src/catalog/render.js +2 -2
- package/dist-sdk/src/catalog/token.js +11 -4
- package/dist-sdk/src/catalog/types.d.ts +33 -4
- package/dist-sdk/src/catalog/types.js +5 -0
- package/dist-sdk/src/core/index.d.ts +10 -10
- package/dist-sdk/src/core/index.js +9 -9
- package/dist-sdk/src/core/render-tree.d.ts +1 -1
- package/dist-sdk/src/core/render-tree.js +1 -2
- package/dist-sdk/src/core/types/ai-provider.d.ts +1 -1
- package/dist-sdk/src/core/types/ai-provider.js +1 -1
- package/dist-sdk/src/core/types/app.d.ts +66 -30
- package/dist-sdk/src/core/types/app.js +2 -2
- package/dist-sdk/src/core/types/aspect-category.d.ts +4 -4
- package/dist-sdk/src/core/types/aspect-category.js +4 -4
- package/dist-sdk/src/core/types/cloud-link.d.ts +3 -3
- package/dist-sdk/src/core/types/cloud-link.js +3 -3
- package/dist-sdk/src/core/types/display-block.d.ts +2 -2
- package/dist-sdk/src/core/types/display-block.js +2 -2
- package/dist-sdk/src/core/types/group.d.ts +1 -1
- package/dist-sdk/src/core/types/group.js +1 -1
- package/dist-sdk/src/core/types/user.d.ts +1 -1
- package/dist-sdk/src/core/types/user.js +1 -1
- package/dist-sdk/src/core/wire/ref-serializer.js +3 -3
- package/dist-sdk/src/engine/build/context.d.ts +20 -13
- package/dist-sdk/src/engine/entity.d.ts +1 -1
- package/dist-sdk/src/engine/pull/context.d.ts +34 -0
- package/dist-sdk/src/engine/pull/context.js +14 -0
- package/dist-sdk/src/engine/pull/org.d.ts +9 -0
- package/dist-sdk/src/engine/pull/org.js +33 -0
- package/dist-sdk/src/engine/pull/ref-only.d.ts +37 -0
- package/dist-sdk/src/engine/pull/ref-only.js +204 -0
- package/dist-sdk/src/engine/tf/expr.d.ts +6 -2
- package/dist-sdk/src/engine/tf/expr.js +18 -13
- package/dist-sdk/src/engine/tf/index.d.ts +1 -1
- package/dist-sdk/src/engine/tf/index.js +1 -1
- package/dist-sdk/src/engine/tf/model.d.ts +8 -1
- package/dist-sdk/src/engine/tf/model.js +4 -0
- package/dist-sdk/src/engine/tf/parse.js +13 -2
- package/dist-sdk/src/engine/tf/render.js +4 -0
- package/dist-sdk/src/entities/access-policy/build.d.ts +4 -5
- package/dist-sdk/src/entities/access-policy/build.js +1 -1
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +4 -4
- package/dist-sdk/src/entities/access-policy/from-tf.js +12 -13
- package/dist-sdk/src/entities/access-policy/principal.d.ts +14 -4
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +14 -2
- package/dist-sdk/src/entities/access-policy/to-tf.js +36 -6
- package/dist-sdk/src/entities/agent/build.d.ts +3 -3
- package/dist-sdk/src/entities/agent/build.js +5 -5
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +6 -1
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +68 -18
- package/dist-sdk/src/entities/agent/from-tf.d.ts +3 -1
- package/dist-sdk/src/entities/agent/from-tf.js +12 -4
- package/dist-sdk/src/entities/agent/index.d.ts +2 -2
- package/dist-sdk/src/entities/agent/index.js +1 -1
- package/dist-sdk/src/entities/agent/module.js +2 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +5 -2
- package/dist-sdk/src/entities/agent/to-tf.js +56 -8
- package/dist-sdk/src/entities/agent/tools.d.ts +38 -23
- package/dist-sdk/src/entities/agent/tools.js +21 -7
- package/dist-sdk/src/entities/agent-evaluation/build.d.ts +19 -0
- package/dist-sdk/src/entities/agent-evaluation/build.js +41 -0
- package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.d.ts +4 -0
- package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.js +30 -0
- package/dist-sdk/src/entities/agent-evaluation/from-tf.d.ts +12 -0
- package/dist-sdk/src/entities/agent-evaluation/from-tf.js +46 -0
- package/dist-sdk/src/entities/agent-evaluation/index.d.ts +1 -0
- package/dist-sdk/src/entities/agent-evaluation/index.js +1 -0
- package/dist-sdk/src/entities/agent-evaluation/module.d.ts +3 -0
- package/dist-sdk/src/entities/agent-evaluation/module.js +58 -0
- package/dist-sdk/src/entities/agent-evaluation/to-tf.d.ts +12 -0
- package/dist-sdk/src/entities/agent-evaluation/to-tf.js +35 -0
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +8 -7
- package/dist-sdk/src/entities/agent-tool/from-tf.js +48 -6
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +10 -2
- package/dist-sdk/src/entities/agent-tool/to-tf.js +76 -28
- package/dist-sdk/src/entities/agent-tool/types.d.ts +0 -1
- package/dist-sdk/src/entities/agent-tool/types.js +10 -37
- package/dist-sdk/src/entities/app/build.d.ts +97 -42
- package/dist-sdk/src/entities/app/build.js +25 -14
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +32 -24
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.d.ts +1 -1
- package/dist-sdk/src/entities/app/deserializer/pulled-expression.js +2 -0
- package/dist-sdk/src/entities/app/index.d.ts +11 -8
- package/dist-sdk/src/entities/app/index.js +10 -7
- package/dist-sdk/src/entities/app/module.js +2 -2
- package/dist-sdk/src/entities/app/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/app/to-tf.js +22 -6
- package/dist-sdk/src/entities/approval-chain/build.d.ts +1 -1
- package/dist-sdk/src/entities/approval-chain/build.js +5 -5
- package/dist-sdk/src/entities/approval-chain/index.d.ts +1 -1
- package/dist-sdk/src/entities/approval-chain/index.js +1 -1
- package/dist-sdk/src/entities/approval-chain/printer.js +2 -2
- package/dist-sdk/src/entities/automation/build.d.ts +172 -94
- package/dist-sdk/src/entities/automation/build.js +159 -68
- package/dist-sdk/src/entities/automation/calculation-expression.d.ts +191 -0
- package/dist-sdk/src/entities/automation/calculation-expression.js +57 -0
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +11 -4
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +18 -14
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +164 -198
- package/dist-sdk/src/entities/automation/from-tf.d.ts +26 -2
- package/dist-sdk/src/entities/automation/from-tf.js +510 -80
- package/dist-sdk/src/entities/automation/index.d.ts +9 -12
- package/dist-sdk/src/entities/automation/index.js +11 -13
- package/dist-sdk/src/entities/automation/module.js +74 -6
- package/dist-sdk/src/entities/automation/operators.d.ts +32 -48
- package/dist-sdk/src/entities/automation/operators.js +10 -37
- package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +1 -1
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +1 -1
- package/dist-sdk/src/entities/automation/script-code.js +13 -22
- package/dist-sdk/src/entities/automation/serialize.js +1 -1
- package/dist-sdk/src/entities/automation/tasks.d.ts +153 -89
- package/dist-sdk/src/entities/automation/tasks.js +64 -11
- package/dist-sdk/src/entities/automation/to-tf.d.ts +10 -1
- package/dist-sdk/src/entities/automation/to-tf.js +342 -71
- package/dist-sdk/src/entities/automation/triggers.d.ts +17 -10
- package/dist-sdk/src/entities/automation/triggers.js +7 -1
- package/dist-sdk/src/entities/automation/types.d.ts +3 -2
- package/dist-sdk/src/entities/automation/types.js +3 -2
- package/dist-sdk/src/entities/chart/build.d.ts +95 -0
- package/dist-sdk/src/entities/chart/build.js +42 -0
- package/dist-sdk/src/entities/chart/from-tf.d.ts +55 -0
- package/dist-sdk/src/entities/chart/from-tf.js +269 -0
- package/dist-sdk/src/entities/chart/index.d.ts +4 -0
- package/dist-sdk/src/entities/chart/index.js +3 -0
- package/dist-sdk/src/entities/chart/module.d.ts +3 -0
- package/dist-sdk/src/entities/chart/module.js +61 -0
- package/dist-sdk/src/entities/chart/printer.d.ts +5 -0
- package/dist-sdk/src/entities/chart/printer.js +104 -0
- package/dist-sdk/src/entities/chart/to-tf.d.ts +15 -0
- package/dist-sdk/src/entities/chart/to-tf.js +150 -0
- package/dist-sdk/src/entities/chart/types.d.ts +53 -0
- package/dist-sdk/src/entities/chart/types.js +22 -0
- package/dist-sdk/src/entities/dashboard/build.d.ts +34 -7
- package/dist-sdk/src/entities/dashboard/build.js +16 -1
- package/dist-sdk/src/entities/dashboard/from-tf.js +22 -4
- package/dist-sdk/src/entities/dashboard/to-tf.d.ts +16 -3
- package/dist-sdk/src/entities/dashboard/to-tf.js +37 -10
- package/dist-sdk/src/entities/datamine/module.js +1 -1
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +4 -3
- package/dist-sdk/src/entities/dynamic-layout/build.js +1 -1
- package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +2 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.js +43 -5
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +12 -6
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +10 -10
- package/dist-sdk/src/entities/element/build.d.ts +25 -32
- package/dist-sdk/src/entities/element/build.js +15 -32
- package/dist-sdk/src/entities/element/index.d.ts +7 -5
- package/dist-sdk/src/entities/element/index.js +7 -4
- package/dist-sdk/src/entities/element/module.js +7 -3
- package/dist-sdk/src/entities/element/to-tf.d.ts +2 -1
- package/dist-sdk/src/entities/element/to-tf.js +7 -3
- package/dist-sdk/src/entities/field/build.d.ts +51 -24
- package/dist-sdk/src/entities/field/build.js +31 -6
- package/dist-sdk/src/entities/field/calc/aggregate.d.ts +52 -21
- package/dist-sdk/src/entities/field/calc/aggregate.js +59 -29
- package/dist-sdk/src/entities/field/calc/date.d.ts +78 -29
- package/dist-sdk/src/entities/field/calc/date.js +120 -29
- package/dist-sdk/src/entities/field/calc/index.d.ts +80 -85
- package/dist-sdk/src/entities/field/calc/index.js +82 -139
- package/dist-sdk/src/entities/field/calc/numeric.d.ts +8 -12
- package/dist-sdk/src/entities/field/calc/numeric.js +10 -27
- package/dist-sdk/src/entities/field/calc/runtime.d.ts +19 -2
- package/dist-sdk/src/entities/field/calc/runtime.js +79 -8
- package/dist-sdk/src/entities/field/calc/text.d.ts +32 -23
- package/dist-sdk/src/entities/field/calc/text.js +43 -31
- package/dist-sdk/src/entities/field/calc/types.d.ts +36 -81
- package/dist-sdk/src/entities/field/calc/types.js +1 -22
- package/dist-sdk/src/entities/field/calc.d.ts +71 -48
- package/dist-sdk/src/entities/field/calc.js +5 -15
- package/dist-sdk/src/entities/field/calculation-types.js +10 -3
- package/dist-sdk/src/entities/field/from-tf.js +156 -10
- package/dist-sdk/src/entities/field/locals.d.ts +11 -3
- package/dist-sdk/src/entities/field/locals.js +15 -2
- package/dist-sdk/src/entities/field/module.js +23 -6
- package/dist-sdk/src/entities/field/record-shape.d.ts +24 -10
- package/dist-sdk/src/entities/field/to-tf.d.ts +40 -1
- package/dist-sdk/src/entities/field/to-tf.js +293 -35
- package/dist-sdk/src/entities/field/types.d.ts +1 -1
- package/dist-sdk/src/entities/field/types.js +7 -1
- package/dist-sdk/src/entities/file-reader/build.d.ts +5 -0
- package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +1 -1
- package/dist-sdk/src/entities/org/cloud-link.js +4 -5
- package/dist-sdk/src/entities/org/email-alias.d.ts +2 -0
- package/dist-sdk/src/entities/org/email-alias.js +12 -0
- package/dist-sdk/src/entities/org/index.d.ts +1 -0
- package/dist-sdk/src/entities/org/index.js +1 -0
- package/dist-sdk/src/entities/org/phone-provider.js +4 -7
- package/dist-sdk/src/entities/organization/build.d.ts +214 -2
- package/dist-sdk/src/entities/organization/build.js +145 -4
- package/dist-sdk/src/entities/organization/index.d.ts +1 -1
- package/dist-sdk/src/entities/organization/index.js +1 -1
- package/dist-sdk/src/entities/organization/module.js +4 -1
- package/dist-sdk/src/entities/organization/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/organization/to-tf.js +118 -1
- package/dist-sdk/src/entities/phone-service/build.d.ts +1 -1
- package/dist-sdk/src/entities/phone-service/build.js +2 -2
- package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +5 -3
- package/dist-sdk/src/entities/phone-service/index.d.ts +1 -1
- package/dist-sdk/src/entities/phone-service/index.js +1 -1
- package/dist-sdk/src/entities/phone-service/types.js +1 -1
- package/dist-sdk/src/entities/record-create-form/to-tf.js +9 -1
- package/dist-sdk/src/entities/relationship/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/relationship/to-tf.js +5 -13
- package/dist-sdk/src/entities/search-table/build.d.ts +4 -4
- package/dist-sdk/src/entities/search-table/build.js +13 -13
- package/dist-sdk/src/entities/search-table/index.d.ts +2 -2
- package/dist-sdk/src/entities/search-table/index.js +2 -2
- package/dist-sdk/src/entities/search-table/printer.js +5 -5
- package/dist-sdk/src/entities/service-account/to-tf.d.ts +21 -0
- package/dist-sdk/src/entities/service-account/to-tf.js +32 -1
- package/dist-sdk/src/entities/shared/context.d.ts +25 -24
- package/dist-sdk/src/entities/shared/context.js +36 -35
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +10 -3
- package/dist-sdk/src/entities/shared/filters/ast.js +1 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +2 -1
- package/dist-sdk/src/entities/shared/filters/index.js +11 -4
- package/dist-sdk/src/entities/shared/foreign-ref.d.ts +14 -0
- package/dist-sdk/src/entities/shared/foreign-ref.js +12 -0
- package/dist-sdk/src/entities/shared/ref.d.ts +26 -11
- package/dist-sdk/src/entities/shared/ref.js +8 -3
- package/dist-sdk/src/entities/shared/types/common.d.ts +2 -2
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +1 -1
- package/dist-sdk/src/entities/shared/types/field-types.js +1 -1
- package/dist-sdk/src/entities/skill/build.d.ts +2 -2
- package/dist-sdk/src/entities/skill/build.js +3 -3
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +1 -1
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +26 -7
- package/dist-sdk/src/entities/skill/index.d.ts +1 -1
- package/dist-sdk/src/entities/skill/index.js +1 -1
- package/dist-sdk/src/entities/skill/module.js +2 -2
- package/dist-sdk/src/entities/skill/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/skill/to-tf.js +2 -2
- package/dist-sdk/src/entities/skill/tools.d.ts +4 -3
- package/dist-sdk/src/entities/skill/tools.js +4 -3
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +13 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +42 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.js +6 -6
- package/dist-sdk/src/entities/table/build.d.ts +1 -1
- package/dist-sdk/src/entities/table/build.js +9 -9
- package/dist-sdk/src/entities/table/catalog-render.js +9 -1
- package/dist-sdk/src/entities/table/deserializer/normalize.js +4 -4
- package/dist-sdk/src/entities/table/fields/types.d.ts +1 -1
- package/dist-sdk/src/entities/table/fields/types.js +1 -1
- package/dist-sdk/src/entities/table/index.d.ts +2 -2
- package/dist-sdk/src/entities/table/index.js +3 -3
- package/dist-sdk/src/entities/table/module.js +1 -1
- package/dist-sdk/src/entities/table/to-tf.js +22 -30
- package/dist-sdk/src/entities/task/build.d.ts +1 -1
- package/dist-sdk/src/entities/task/build.js +5 -5
- package/dist-sdk/src/entities/task/index.d.ts +1 -1
- package/dist-sdk/src/entities/task/index.js +1 -1
- package/dist-sdk/src/entities/view/build.d.ts +46 -0
- package/dist-sdk/src/entities/view/build.js +19 -0
- package/dist-sdk/src/entities/view/from-tf.js +68 -18
- package/dist-sdk/src/entities/view/module.d.ts +6 -13
- package/dist-sdk/src/entities/view/module.js +7 -14
- package/dist-sdk/src/entities/view/sharing.d.ts +10 -0
- package/dist-sdk/src/entities/view/sharing.js +6 -0
- package/dist-sdk/src/entities/view/to-tf.d.ts +21 -19
- package/dist-sdk/src/entities/view/to-tf.js +61 -26
- package/dist-sdk/src/entities/view/types.js +3 -0
- package/dist-sdk/src/entities/visual-flow/build.d.ts +1 -1
- package/dist-sdk/src/entities/visual-flow/build.js +8 -8
- package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -1
- package/dist-sdk/src/entities/visual-flow/index.js +1 -1
- package/dist-sdk/src/entities/visual-flow/module.js +1 -1
- package/dist-sdk/src/entities/visual-flow/printer.js +3 -3
- package/dist-sdk/src/entities/visual-flow/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.js +3 -7
- package/dist-sdk/src/entities/widget/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/widget/to-tf.js +9 -7
- package/dist-sdk/src/graph/index.d.ts +5 -1
- package/dist-sdk/src/graph/index.js +4 -1
- package/dist-sdk/src/graph/modules.js +6 -1
- package/dist-sdk/src/graph/types.d.ts +52 -1
- package/dist-sdk/src/internal/safe-identifier.d.ts +4 -0
- package/dist-sdk/src/internal/safe-identifier.js +13 -0
- package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
- package/dist-sdk/src/internal/sdk-package.js +1 -0
- package/package.json +12 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Context & Proxy factory — builds the typed `ctx` object passed to each
|
|
3
|
-
*
|
|
3
|
+
* fluent action method.
|
|
4
4
|
*
|
|
5
5
|
* At the TypeScript level, ctx.trigger.vendorName is Ref<string>.
|
|
6
6
|
* At runtime, a Proxy intercepts the property access and returns a Ref
|
|
@@ -14,14 +14,14 @@ import { createRef } from "./ref.js";
|
|
|
14
14
|
// ---------------------------------------------------------------------------
|
|
15
15
|
/**
|
|
16
16
|
* Ref to a trigger output path; further property access extends `name`
|
|
17
|
-
* with dot segments, mirroring
|
|
17
|
+
* with dot segments, mirroring action output refs.
|
|
18
18
|
* ctx.trigger.record.summary → { kind: "trigger", name: "record.summary" }
|
|
19
19
|
*/
|
|
20
20
|
function createTriggerFieldRef(path) {
|
|
21
21
|
const base = createRef({ kind: "trigger", name: path });
|
|
22
22
|
return new Proxy(base, {
|
|
23
23
|
get(target, prop, receiver) {
|
|
24
|
-
if (typeof prop === "symbol" || prop === "__data" || prop === "__type") {
|
|
24
|
+
if (typeof prop === "symbol" || prop === "__data" || prop === "__type" || prop === "__calculationType") {
|
|
25
25
|
return Reflect.get(target, prop, receiver);
|
|
26
26
|
}
|
|
27
27
|
return createTriggerFieldRef(`${path}.${String(prop)}`);
|
|
@@ -44,55 +44,56 @@ export function createTriggerProxy() {
|
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* Ref to
|
|
48
|
-
* (`record.id` → `{ kind: "task",
|
|
47
|
+
* Ref to an action output path; further property access extends `name` with dot
|
|
48
|
+
* segments (`record.id` → `{ kind: "task", actionRefKey, name: "record.id" }`).
|
|
49
49
|
*/
|
|
50
|
-
function
|
|
51
|
-
const base = createRef({ kind: "task",
|
|
50
|
+
function createActionOutputFieldRef(actionRefKey, outputPath) {
|
|
51
|
+
const base = createRef({ kind: "task", actionRefKey, name: outputPath });
|
|
52
52
|
return new Proxy(base, {
|
|
53
53
|
get(target, prop, receiver) {
|
|
54
|
-
if (typeof prop === "symbol" || prop === "__data" || prop === "__type") {
|
|
54
|
+
if (typeof prop === "symbol" || prop === "__data" || prop === "__type" || prop === "__calculationType") {
|
|
55
55
|
return Reflect.get(target, prop, receiver);
|
|
56
56
|
}
|
|
57
|
-
return
|
|
57
|
+
return createActionOutputFieldRef(actionRefKey, `${outputPath}.${String(prop)}`);
|
|
58
58
|
},
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
|
-
* Creates a proxy for a single
|
|
63
|
-
* ctx.
|
|
62
|
+
* Creates a proxy for a single action's outputs.
|
|
63
|
+
* ctx.actions.findVendor.records → Ref with
|
|
64
|
+
* { kind: "task", actionRefKey: "findVendor", name: "records" }
|
|
64
65
|
*/
|
|
65
|
-
export function
|
|
66
|
+
export function createActionOutputProxy(actionRefKey) {
|
|
66
67
|
return new Proxy({}, {
|
|
67
68
|
get(_target, prop) {
|
|
68
69
|
if (typeof prop === "symbol")
|
|
69
70
|
return undefined;
|
|
70
|
-
return
|
|
71
|
+
return createActionOutputFieldRef(actionRefKey, String(prop));
|
|
71
72
|
},
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
75
|
/**
|
|
75
|
-
* Creates a proxy for the
|
|
76
|
-
* ctx.
|
|
76
|
+
* Creates a proxy for the actions namespace.
|
|
77
|
+
* ctx.actions → Proxy where each property access returns an action output proxy.
|
|
77
78
|
*/
|
|
78
|
-
export function
|
|
79
|
+
export function createActionsProxy(actionNames) {
|
|
79
80
|
const cache = new Map();
|
|
80
81
|
return new Proxy({}, {
|
|
81
82
|
get(_target, prop) {
|
|
82
83
|
if (typeof prop === "symbol")
|
|
83
84
|
return undefined;
|
|
84
85
|
if (!cache.has(prop)) {
|
|
85
|
-
cache.set(prop,
|
|
86
|
+
cache.set(prop, createActionOutputProxy(prop));
|
|
86
87
|
}
|
|
87
88
|
return cache.get(prop);
|
|
88
89
|
},
|
|
89
90
|
ownKeys() {
|
|
90
|
-
return
|
|
91
|
+
return actionNames;
|
|
91
92
|
},
|
|
92
93
|
getOwnPropertyDescriptor(_target, prop) {
|
|
93
94
|
if (typeof prop === "symbol")
|
|
94
95
|
return undefined;
|
|
95
|
-
if (
|
|
96
|
+
if (actionNames.includes(prop)) {
|
|
96
97
|
return { configurable: true, enumerable: true, writable: false };
|
|
97
98
|
}
|
|
98
99
|
return undefined;
|
|
@@ -101,41 +102,41 @@ export function createTasksProxy(taskNames) {
|
|
|
101
102
|
}
|
|
102
103
|
/**
|
|
103
104
|
* Creates a forEach item proxy.
|
|
104
|
-
* item.fieldName → Ref with { kind: "forEach",
|
|
105
|
+
* item.fieldName → Ref with { kind: "forEach", forEachActionName, name: "fieldName" }
|
|
105
106
|
* Accessing the item directly (without a property) returns a Ref to the whole item.
|
|
106
107
|
*/
|
|
107
|
-
export function createForEachItemProxy(
|
|
108
|
-
const baseRef = createRef({ kind: "forEach",
|
|
108
|
+
export function createForEachItemProxy(forEachActionName) {
|
|
109
|
+
const baseRef = createRef({ kind: "forEach", forEachActionName, name: "item" });
|
|
109
110
|
return new Proxy(baseRef, {
|
|
110
111
|
get(target, prop) {
|
|
111
|
-
if (typeof prop === "symbol" || prop === "__data" || prop === "__type") {
|
|
112
|
+
if (typeof prop === "symbol" || prop === "__data" || prop === "__type" || prop === "__calculationType") {
|
|
112
113
|
return target[prop];
|
|
113
114
|
}
|
|
114
|
-
return createRef({ kind: "forEach",
|
|
115
|
+
return createRef({ kind: "forEach", forEachActionName, name: prop });
|
|
115
116
|
},
|
|
116
117
|
});
|
|
117
118
|
}
|
|
118
119
|
/**
|
|
119
120
|
* Variables proxy. The first-level access is a HYBRID (same pattern as
|
|
120
121
|
* {@link createForEachItemProxy}): it is itself a Ref to the variable named
|
|
121
|
-
* after the
|
|
122
|
+
* after the action — the fluent form, `ctx.variables.greeting` — AND a proxy
|
|
122
123
|
* whose further property access yields per-variable refs — the generic form,
|
|
123
|
-
* `ctx.variables.
|
|
124
|
-
* variables. Both produce { kind: "variableParam",
|
|
124
|
+
* `ctx.variables.actionName.varName`, for variable actions creating several
|
|
125
|
+
* variables. Both produce { kind: "variableParam", variableActionRefKey, name }.
|
|
125
126
|
*/
|
|
126
127
|
function createVariablesProxy() {
|
|
127
128
|
return new Proxy({}, {
|
|
128
|
-
get(_target,
|
|
129
|
-
if (typeof
|
|
129
|
+
get(_target, actionName) {
|
|
130
|
+
if (typeof actionName === "symbol")
|
|
130
131
|
return undefined;
|
|
131
|
-
const
|
|
132
|
-
const base = createRef({ kind: "variableParam",
|
|
132
|
+
const action = String(actionName);
|
|
133
|
+
const base = createRef({ kind: "variableParam", variableActionRefKey: action, name: action });
|
|
133
134
|
return new Proxy(base, {
|
|
134
135
|
get(target, varName, receiver) {
|
|
135
|
-
if (typeof varName === "symbol" || varName === "__data" || varName === "__type") {
|
|
136
|
+
if (typeof varName === "symbol" || varName === "__data" || varName === "__type" || varName === "__calculationType") {
|
|
136
137
|
return Reflect.get(target, varName, receiver);
|
|
137
138
|
}
|
|
138
|
-
return createRef({ kind: "variableParam",
|
|
139
|
+
return createRef({ kind: "variableParam", variableActionRefKey: action, name: String(varName) });
|
|
139
140
|
},
|
|
140
141
|
});
|
|
141
142
|
},
|
|
@@ -147,10 +148,10 @@ function createVariablesProxy() {
|
|
|
147
148
|
* `TVariables` is a phantom — it only affects the compile-time shape of
|
|
148
149
|
* `ctx.variables`. The runtime proxy is still an open-ended lookup.
|
|
149
150
|
*/
|
|
150
|
-
export function buildContext(
|
|
151
|
+
export function buildContext(actionNames) {
|
|
151
152
|
return {
|
|
152
153
|
trigger: createTriggerProxy(),
|
|
153
|
-
|
|
154
|
+
actions: createActionsProxy(actionNames),
|
|
154
155
|
variables: createVariablesProxy(),
|
|
155
156
|
};
|
|
156
157
|
}
|
|
@@ -127,6 +127,13 @@ export interface DatamineRefAst {
|
|
|
127
127
|
readonly tableHandle: string;
|
|
128
128
|
readonly datamineKey: string;
|
|
129
129
|
}
|
|
130
|
+
/** Reference to an org-owned table: `catalog.tables.<tableHandle>`. */
|
|
131
|
+
export interface TableRefAst {
|
|
132
|
+
readonly kind: "table";
|
|
133
|
+
readonly tableHandle: string;
|
|
134
|
+
/** Display name from a `data.elementum_table` lookup, when the export carried it. */
|
|
135
|
+
readonly name?: string;
|
|
136
|
+
}
|
|
130
137
|
/**
|
|
131
138
|
* Reference to an org-level AI provider connector, nested under its owning
|
|
132
139
|
* provider (`catalog.aiProviders.<provider>.models.<model>`) — connectors
|
|
@@ -175,7 +182,7 @@ export type RefExpr =
|
|
|
175
182
|
kind: "literal";
|
|
176
183
|
value: unknown;
|
|
177
184
|
}
|
|
178
|
-
/** Reference to a task's output: `ctx.
|
|
185
|
+
/** Reference to a task's output: `ctx.actions.<task>.<path...>`. */
|
|
179
186
|
| {
|
|
180
187
|
kind: "taskRef";
|
|
181
188
|
task: string;
|
|
@@ -186,7 +193,7 @@ export type RefExpr =
|
|
|
186
193
|
kind: "triggerRef";
|
|
187
194
|
path: readonly string[];
|
|
188
195
|
}
|
|
189
|
-
/** Reference to a forEach loop variable: `ctx.
|
|
196
|
+
/** Reference to a forEach loop variable: `ctx.actions.<forEachTask>.<path...>`. */
|
|
190
197
|
| {
|
|
191
198
|
kind: "forEachRef";
|
|
192
199
|
forEachTask: string;
|
|
@@ -214,7 +221,7 @@ export type RefExpr =
|
|
|
214
221
|
| {
|
|
215
222
|
kind: "template";
|
|
216
223
|
parts: readonly (string | RefExpr)[];
|
|
217
|
-
} | FieldRefAst | UserFieldRefAst | AppRefAst | AgentRefAst | AutomationRefAst | DocumentModelRefAst | DocumentModelFieldRefAst | ApprovalChainRefAst | DatamineRefAst | ConnectorRefAst | CloudLinkRefAst | PhoneServiceRefAst | UserRefAst | UnresolvedRefAst
|
|
224
|
+
} | FieldRefAst | UserFieldRefAst | AppRefAst | AgentRefAst | AutomationRefAst | DocumentModelRefAst | DocumentModelFieldRefAst | ApprovalChainRefAst | DatamineRefAst | TableRefAst | ConnectorRefAst | CloudLinkRefAst | PhoneServiceRefAst | UserRefAst | UnresolvedRefAst
|
|
218
225
|
/** Preserved terraform local expression for round-trip (e.g. status option ids by label). */
|
|
219
226
|
| {
|
|
220
227
|
kind: "localRef";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/** Canonical Elementum filter model and authoring helpers. */
|
|
2
2
|
import type { AppOrElementRef, FieldRef, TableColumnRef, TableRef, UserFieldRef } from "../../../catalog/index.js";
|
|
3
|
+
import type { UnsafePlatformId } from "../../../core/platform-id.js";
|
|
3
4
|
import { type AppField, type FieldScope } from "../../../core/types/app.js";
|
|
4
5
|
import { type Ref } from "../ref.js";
|
|
5
6
|
import type { WorkflowFieldType } from "../types/field-types.js";
|
|
6
7
|
import type { AndFilter, BetweenFilter, ConsecutiveRangeFilter, ContainsFilter, CurrentRangeFilter, DateTimeUnit, EqualsFilter, FalseFilter, Filter, FilterReference, FilterValue, GreaterThanEqualsFilter, GreaterThanFilter, InFilter, IsNullFilter, LessThanEqualsFilter, LessThanFilter, LikeFilter, LikeMode, OrFilter, OverlapsFilter, TrueFilter, ValueType } from "./types.js";
|
|
7
8
|
export type { AndFilter, BetweenFilter, ConsecutiveRangeFilter, ContainsFilter, CurrentRangeFilter, DateTimeUnit, EqualsFilter, FalseFilter, FieldFilterOptions, Filter, FilterReference, FilterValue, GreaterThanEqualsFilter, GreaterThanFilter, InFilter, IsNullFilter, LessThanEqualsFilter, LessThanFilter, LikeFilter, LikeMode, OrFilter, OverlapsFilter, TrueFilter, ValueType, } from "./types.js";
|
|
8
|
-
export type FilterField = AppOrElementRef | FieldRef | UserFieldRef | TableColumnRef | TableRef | AppField<FieldScope> | string;
|
|
9
|
+
export type FilterField = AppOrElementRef | FieldRef | UserFieldRef | TableColumnRef | TableRef | AppField<FieldScope> | UnsafePlatformId | string;
|
|
9
10
|
export type FilterReferenceValue = FilterReference | {
|
|
10
11
|
readonly __rawFilterReference: string;
|
|
11
12
|
};
|
|
@@ -62,8 +62,8 @@ export const UNRESOLVED_REFERENCE_MARKER = "__edkUnresolvedReference::";
|
|
|
62
62
|
export function refDataToFilterReference(data) {
|
|
63
63
|
switch (data.kind) {
|
|
64
64
|
case "trigger": return { type: "TRIGGER", name: data.name };
|
|
65
|
-
case "task": return { type: "TASK", taskRefKey: data.
|
|
66
|
-
case "forEach": return { type: "FOR_EACH", forEachTaskRefKey: data.
|
|
65
|
+
case "task": return { type: "TASK", taskRefKey: data.actionRefKey, name: data.name };
|
|
66
|
+
case "forEach": return { type: "FOR_EACH", forEachTaskRefKey: data.forEachActionName, name: data.name };
|
|
67
67
|
case "static": return { type: "VALUE", value: data.value };
|
|
68
68
|
case "template": return { type: "VALUE", value: serializeRefData(data) };
|
|
69
69
|
case "variableParam": throw new EdkValidationError("Variable param refs cannot be used directly in filter values");
|
|
@@ -87,13 +87,20 @@ function isCatalogField(value) {
|
|
|
87
87
|
function isAppField(value) {
|
|
88
88
|
return typeof value === "object" && value !== null && "id" in value && "type" in value && !isCatalogField(value);
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function isUnsafePlatformId(value) {
|
|
91
|
+
return typeof value === "object" && value !== null && value.__unsafe === "platformId";
|
|
92
|
+
}
|
|
93
|
+
function fieldWireValue(field) {
|
|
94
|
+
if (isUnsafePlatformId(field))
|
|
95
|
+
return field.value;
|
|
96
|
+
return isAppField(field) ? field.id : field;
|
|
97
|
+
}
|
|
91
98
|
function leftType(left, fallback, explicit) {
|
|
92
99
|
if (explicit !== undefined)
|
|
93
100
|
return explicit;
|
|
94
101
|
if (isFilterReferenceInput(left))
|
|
95
102
|
return left.valueType;
|
|
96
|
-
if (isRef(left) || typeof left === "string")
|
|
103
|
+
if (isRef(left) || typeof left === "string" || isUnsafePlatformId(left))
|
|
97
104
|
return fallback;
|
|
98
105
|
return fieldTypeToValueType(isAppField(left) ? left.type : "fieldType" in left ? left.fieldType : undefined);
|
|
99
106
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OrgRefLookup } from "../../engine/build/context.js";
|
|
2
|
+
import { type TfValue } from "../../engine/tf/index.js";
|
|
3
|
+
import type { KindId } from "../../graph/types.js";
|
|
4
|
+
export interface ForeignRootToken {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly namespace?: string;
|
|
7
|
+
readonly tfLabel?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ForeignRootDataRef {
|
|
10
|
+
readonly value: TfValue;
|
|
11
|
+
readonly tfLabel: string;
|
|
12
|
+
}
|
|
13
|
+
/** Resolve a foreign root through its graph-declared reference lookup facet. */
|
|
14
|
+
export declare function resolveForeignRef(kind: KindId, token: ForeignRootToken, orgRefs: OrgRefLookup, diagnostics?: string[], where?: string): ForeignRootDataRef;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { expr } from "../../engine/tf/index.js";
|
|
2
|
+
/** Resolve a foreign root through its graph-declared reference lookup facet. */
|
|
3
|
+
export function resolveForeignRef(kind, token, orgRefs, diagnostics, where = "foreign reference") {
|
|
4
|
+
const resolved = orgRefs.resolveForeignRoot(kind, token);
|
|
5
|
+
if (resolved.usedCompatibilityFallback) {
|
|
6
|
+
diagnostics?.push(`${where}: ${kind} "${token.name}" has no namespace; using the graph-declared name compatibility lookup`);
|
|
7
|
+
}
|
|
8
|
+
return {
|
|
9
|
+
value: expr.dataAttr(resolved.resourceType, resolved.tfLabel, ["id"]),
|
|
10
|
+
tfLabel: resolved.tfLabel,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -3,25 +3,26 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A Ref<T> is a *description* of a runtime value, not the value itself.
|
|
5
5
|
* It carries enough metadata to serialize into the Elementum API's
|
|
6
|
-
* ValueReferenceInput format (trigger refs,
|
|
6
|
+
* ValueReferenceInput format (trigger refs, action refs, forEach refs,
|
|
7
7
|
* static values, and template strings).
|
|
8
8
|
*
|
|
9
9
|
* TypeScript sees the phantom T so autocomplete and type checking work;
|
|
10
10
|
* the runtime Proxy layer (see context.ts) constructs these automatically
|
|
11
|
-
* when agent code accesses ctx.trigger.* or ctx.
|
|
11
|
+
* when agent code accesses ctx.trigger.* or ctx.actions.*.
|
|
12
12
|
*/
|
|
13
13
|
export interface TriggerRefData {
|
|
14
14
|
kind: "trigger";
|
|
15
15
|
name: string;
|
|
16
16
|
}
|
|
17
|
-
export interface
|
|
17
|
+
export interface ActionRefData {
|
|
18
|
+
/** Platform wire discriminator; kept as `task` at the serialization boundary. */
|
|
18
19
|
kind: "task";
|
|
19
|
-
|
|
20
|
+
actionRefKey: string;
|
|
20
21
|
name: string;
|
|
21
22
|
}
|
|
22
23
|
export interface ForEachRefData {
|
|
23
24
|
kind: "forEach";
|
|
24
|
-
|
|
25
|
+
forEachActionName: string;
|
|
25
26
|
name: string;
|
|
26
27
|
}
|
|
27
28
|
export interface StaticRefData {
|
|
@@ -34,7 +35,7 @@ export interface TemplateRefData {
|
|
|
34
35
|
}
|
|
35
36
|
export interface VariableParamRefData {
|
|
36
37
|
kind: "variableParam";
|
|
37
|
-
|
|
38
|
+
variableActionRefKey: string;
|
|
38
39
|
name: string;
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
@@ -45,19 +46,33 @@ export interface SecretRefData {
|
|
|
45
46
|
kind: "secret";
|
|
46
47
|
secretId: string;
|
|
47
48
|
}
|
|
48
|
-
export type RefData = TriggerRefData |
|
|
49
|
+
export type RefData = TriggerRefData | ActionRefData | ForEachRefData | StaticRefData | TemplateRefData | VariableParamRefData | SecretRefData;
|
|
49
50
|
declare const REF_BRAND: unique symbol;
|
|
50
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Phantom marker carried by values whose JavaScript representation is not
|
|
53
|
+
* enough to identify their calculation type (for example DATE vs TEXT, or
|
|
54
|
+
* NUMBER vs DECIMAL). It is optional and has no runtime representation.
|
|
55
|
+
*/
|
|
56
|
+
export declare const CALCULATION_VALUE_TYPE: unique symbol;
|
|
57
|
+
export type CalculationTypedValue<T, CalculationType extends string> = T & {
|
|
58
|
+
readonly [CALCULATION_VALUE_TYPE]?: CalculationType;
|
|
59
|
+
};
|
|
60
|
+
export type CalculationTypeOfValue<T> = NonNullable<T> extends {
|
|
61
|
+
readonly [CALCULATION_VALUE_TYPE]?: infer CalculationType extends string;
|
|
62
|
+
} ? CalculationType : NonNullable<T> extends number ? "number" : NonNullable<T> extends boolean ? "bool" : NonNullable<T> extends string ? "text" : "unknown";
|
|
63
|
+
export interface Ref<T, CalculationType extends string = CalculationTypeOfValue<T>> {
|
|
51
64
|
readonly [REF_BRAND]: true;
|
|
52
65
|
/** Phantom type — never read at runtime, only used by TypeScript. */
|
|
53
66
|
readonly __type: T;
|
|
67
|
+
/** Phantom calculation type retained through automation data flow. */
|
|
68
|
+
readonly __calculationType: CalculationType;
|
|
54
69
|
/** The serializable descriptor for this reference. */
|
|
55
70
|
readonly __data: RefData;
|
|
56
71
|
}
|
|
57
|
-
export declare function createRef<T
|
|
58
|
-
export declare function isRef(value: unknown): value is Ref<unknown>;
|
|
72
|
+
export declare function createRef<T, CalculationType extends string = CalculationTypeOfValue<T>>(data: RefData): Ref<T, CalculationType>;
|
|
73
|
+
export declare function isRef(value: unknown): value is Ref<unknown, string>;
|
|
59
74
|
export type ToRefs<T> = {
|
|
60
|
-
[K in keyof T]: Ref<T[K]
|
|
75
|
+
[K in keyof T]: Ref<T[K], CalculationTypeOfValue<T[K]>>;
|
|
61
76
|
};
|
|
62
77
|
/**
|
|
63
78
|
* Simplify<T> flattens intersection types into a single object for clean
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A Ref<T> is a *description* of a runtime value, not the value itself.
|
|
5
5
|
* It carries enough metadata to serialize into the Elementum API's
|
|
6
|
-
* ValueReferenceInput format (trigger refs,
|
|
6
|
+
* ValueReferenceInput format (trigger refs, action refs, forEach refs,
|
|
7
7
|
* static values, and template strings).
|
|
8
8
|
*
|
|
9
9
|
* TypeScript sees the phantom T so autocomplete and type checking work;
|
|
10
10
|
* the runtime Proxy layer (see context.ts) constructs these automatically
|
|
11
|
-
* when agent code accesses ctx.trigger.* or ctx.
|
|
11
|
+
* when agent code accesses ctx.trigger.* or ctx.actions.*.
|
|
12
12
|
*/
|
|
13
13
|
import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
|
|
14
14
|
// ---------------------------------------------------------------------------
|
|
@@ -16,7 +16,12 @@ import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
|
|
|
16
16
|
// ---------------------------------------------------------------------------
|
|
17
17
|
const REF_BRAND = Symbol("Ref");
|
|
18
18
|
export function createRef(data) {
|
|
19
|
-
return {
|
|
19
|
+
return {
|
|
20
|
+
[REF_BRAND]: true,
|
|
21
|
+
__type: undefined,
|
|
22
|
+
__calculationType: undefined,
|
|
23
|
+
__data: data,
|
|
24
|
+
};
|
|
20
25
|
}
|
|
21
26
|
export function isRef(value) {
|
|
22
27
|
return (typeof value === "object" &&
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared types used across automations, agents, and other EDK domains.
|
|
3
3
|
*/
|
|
4
|
+
import type { AppField } from "../../../core/types/app.js";
|
|
4
5
|
import type { Ref, ValueOrRef } from "../ref.js";
|
|
5
6
|
import type { Attachment } from "./platform.js";
|
|
6
|
-
import type { AppField } from "../../../core/types/app.js";
|
|
7
7
|
export type HttpMethod = "GET" | "POST" | "PUT" | "DELETE";
|
|
8
8
|
export interface BasicAuth {
|
|
9
9
|
type: "basic";
|
|
@@ -14,7 +14,7 @@ export interface BearerAuth {
|
|
|
14
14
|
type: "bearer";
|
|
15
15
|
/**
|
|
16
16
|
* Bearer token. Accepts a raw string (literal or environment-rewritten
|
|
17
|
-
* placeholder), a task/trigger ref (e.g. `ctx.
|
|
17
|
+
* placeholder), a task/trigger ref (e.g. `ctx.actions.login.token`), or
|
|
18
18
|
* a `secret(...)` ref that serializes to Mobius's secret-reference
|
|
19
19
|
* shape. Every real integration uses a secret; the raw-string form
|
|
20
20
|
* exists only for the literal / placeholder case.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* configurations is surfaced here. The full enum is listed for
|
|
7
7
|
* forward-compatibility; uncommon types are commented.
|
|
8
8
|
*/
|
|
9
|
-
export type WorkflowFieldType = "TEXT" | "HANDLE" | "NUMBER" | "DECIMAL" | "BOOLEAN" | "DATE" | "DATETIME" | "
|
|
9
|
+
export type WorkflowFieldType = "TEXT" | "HANDLE" | "NUMBER" | "DECIMAL" | "BOOLEAN" | "DATE" | "DATETIME" | "USER" | "USER_ID" | "GROUP" | "GROUP_ID" | "FILE" | "ATTACHMENT" | "ATTACHMENT_ID" | "ASPECT_ID" | "ASPECT_RECORD" | "ASPECT_RECORD_ID" | "ASPECT_FIELD_ID" | "FILTER" | "OBJECT" | "JSON" | "PICKLIST" | "PICKLIST_ID" | "MULTI_PICKLIST" | "MULTI_PICKLIST_ID" | "RELATION" | "SEARCH_TABLE_ID" | "TABLE_ID" | "TABLE_RECORD" | "VARIABLE" | "RICH_TEXT" | "AI_SEARCH_TABLE_RECORD";
|
|
10
10
|
/**
|
|
11
11
|
* Map from user-friendly type names (used in the SDK's onDemand input
|
|
12
12
|
* schema) to the platform's WorkflowFieldType value.
|
|
@@ -42,7 +42,7 @@ export const FIELD_TYPE_MAP = {
|
|
|
42
42
|
export const ASPECT_FIELD_TYPE_NAME_TO_WORKFLOW_FIELD_TYPE = {
|
|
43
43
|
AspectTextField: "TEXT",
|
|
44
44
|
AspectHandleField: "HANDLE",
|
|
45
|
-
AspectHtmlField: "
|
|
45
|
+
AspectHtmlField: "RICH_TEXT",
|
|
46
46
|
AspectNumberField: "NUMBER",
|
|
47
47
|
AspectDecimalField: "DECIMAL",
|
|
48
48
|
AspectBooleanField: "BOOLEAN",
|
|
@@ -13,7 +13,7 @@ export interface SkillV2Options extends EntityDeployOptions {
|
|
|
13
13
|
readonly tools?: readonly SkillTool[];
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* The configured result of `
|
|
16
|
+
* The configured result of `skill` — its catalog reference (`ref()`) and
|
|
17
17
|
* deployable entity (`def()`). Both take the file refName as a call-time
|
|
18
18
|
* argument, matching agents and automations.
|
|
19
19
|
*/
|
|
@@ -22,4 +22,4 @@ export interface SkillConfigured {
|
|
|
22
22
|
def(refName: string): DeployableEntity;
|
|
23
23
|
}
|
|
24
24
|
/** Build a v2 skill entity config, exposing `.ref(refName)` and `.def(refName)`. */
|
|
25
|
-
export declare function
|
|
25
|
+
export declare function skill(opts: SkillV2Options): SkillConfigured;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* v2 skill authoring (parallel to v1 `src/agents/skills`, fully standalone so v1
|
|
3
3
|
* can be deleted wholesale once v2 is validated).
|
|
4
4
|
*
|
|
5
|
-
* `
|
|
5
|
+
* `skill` emits the platform's skill create envelope **minus the owner**
|
|
6
6
|
* (`ownerId`/`ownerType` injected by the wire client at deploy; the update DTO
|
|
7
7
|
* omits them) with `CatalogRef` tokens at each tool's reference positions.
|
|
8
8
|
*
|
|
9
9
|
* Identity comes from the authoring file's `refName`, exactly like
|
|
10
|
-
* `
|
|
10
|
+
* `automation` / `agent`; the owning app comes from the typed
|
|
11
11
|
* `app` reference.
|
|
12
12
|
*/
|
|
13
13
|
import { slimTokens } from "../../catalog/index.js";
|
|
@@ -18,7 +18,7 @@ import { slimTokens } from "../../catalog/index.js";
|
|
|
18
18
|
*/
|
|
19
19
|
const SKILL_NAME_PATTERN = /^[a-z0-9-]{1,64}$/;
|
|
20
20
|
/** Build a v2 skill entity config, exposing `.ref(refName)` and `.def(refName)`. */
|
|
21
|
-
export function
|
|
21
|
+
export function skill(opts) {
|
|
22
22
|
if (!SKILL_NAME_PATTERN.test(opts.name)) {
|
|
23
23
|
throw new Error(`skill name "${opts.name}" must be 1-64 characters of lowercase letters, digits, and hyphens ` +
|
|
24
24
|
`(a-z, 0-9, -) — the platform uses it as the skill's identifier, not a free-text label.`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* printSkillV2 — pulled skill rendering for the terraform path. Consumes
|
|
3
3
|
* the `NormalizedSkill` that `skillFromTf` produces and emits an
|
|
4
|
-
* `apps/<app>/skills/<refName>.ts` authoring file: `
|
|
4
|
+
* `apps/<app>/skills/<refName>.ts` authoring file: `skill` with tools
|
|
5
5
|
* as `catalog` tokens (self-app) or a TODO literal (foreign apps — their
|
|
6
6
|
* catalog may not exist in this workspace) and tool fields as
|
|
7
7
|
* `catalog.<app>.fields.<key>`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* printSkillV2 — pulled skill rendering for the terraform path. Consumes
|
|
3
3
|
* the `NormalizedSkill` that `skillFromTf` produces and emits an
|
|
4
|
-
* `apps/<app>/skills/<refName>.ts` authoring file: `
|
|
4
|
+
* `apps/<app>/skills/<refName>.ts` authoring file: `skill` with tools
|
|
5
5
|
* as `catalog` tokens (self-app) or a TODO literal (foreign apps — their
|
|
6
6
|
* catalog may not exist in this workspace) and tool fields as
|
|
7
7
|
* `catalog.<app>.fields.<key>`.
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { quote } from "../../../../pull/util.js";
|
|
16
16
|
import { sdkPackageSpecifier } from "../../../internal/sdk-package.js";
|
|
17
|
+
import { safeIdentifier } from "../../../internal/safe-identifier.js";
|
|
17
18
|
const TOOL_FACTORY_BY_TYPE_KEY = {
|
|
18
19
|
createRecord: "skillCreateRecord",
|
|
19
20
|
searchAspect: "skillSearchRecords",
|
|
@@ -58,12 +59,13 @@ export function printSkillV2(skill, opts) {
|
|
|
58
59
|
lines.push(" * one-shot starting point, not a live-binding view.");
|
|
59
60
|
lines.push(" */");
|
|
60
61
|
lines.push("");
|
|
61
|
-
lines.push(`import { ${[...factories, "
|
|
62
|
+
lines.push(`import { ${[...factories, "skill"].sort().join(", ")} } from ${JSON.stringify(sdkPackageSpecifier("agents/skills"))};`);
|
|
62
63
|
if (usesUnsafePlatformId)
|
|
63
64
|
lines.push(`import { unsafePlatformId } from ${JSON.stringify(sdkPackageSpecifier("core"))};`);
|
|
64
65
|
lines.push(`import catalog from "@catalog";`);
|
|
65
66
|
lines.push("");
|
|
66
|
-
|
|
67
|
+
const identifier = safeIdentifier(skill.refName, "skill");
|
|
68
|
+
lines.push(`const ${identifier} = skill({`);
|
|
67
69
|
lines.push(` name: ${quote(skill.name)},`);
|
|
68
70
|
lines.push(` app: catalog.${appRefName},`);
|
|
69
71
|
lines.push(` description: ${quote(skill.description)},`);
|
|
@@ -82,7 +84,7 @@ export function printSkillV2(skill, opts) {
|
|
|
82
84
|
}
|
|
83
85
|
lines.push("});");
|
|
84
86
|
lines.push("");
|
|
85
|
-
lines.push(`export default ${
|
|
87
|
+
lines.push(`export default ${identifier};`);
|
|
86
88
|
lines.push("");
|
|
87
89
|
return lines.join("\n");
|
|
88
90
|
}
|
|
@@ -126,9 +128,21 @@ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElemen
|
|
|
126
128
|
}
|
|
127
129
|
if (tool.typeKey === "automation") {
|
|
128
130
|
lines.push(` automation: catalog.${appRefName}.automations${safeMember(tool.automationKey ?? "")},`);
|
|
129
|
-
|
|
131
|
+
const inputs = tool.inputs ?? [];
|
|
132
|
+
const missingRequired = tool.missingRequiredInputs ?? [];
|
|
133
|
+
if (inputs.length > 0 || missingRequired.length > 0) {
|
|
134
|
+
// `missingRequiredInputs` names REQUIRED trigger parameters this tool
|
|
135
|
+
// has no real mapping for on the platform — `AutomationToolV2` demands
|
|
136
|
+
// every one be present, but there is no real data to print for them
|
|
137
|
+
// (see skill-tool/from-tf.ts's doc comment: inventing an entry here
|
|
138
|
+
// would get faithfully re-serialized to HCL by `elementum build` and
|
|
139
|
+
// propose writing fake data onto a live tool). Print only the REAL
|
|
140
|
+
// captured entries, verbatim, and — only when a required one is still
|
|
141
|
+
// missing — cast the whole (possibly empty) object so the file still
|
|
142
|
+
// compiles; the cast changes nothing about what gets built, since an
|
|
143
|
+
// empty/absent `inputs` already round-trips to the same wire shape.
|
|
130
144
|
lines.push(" inputs: {");
|
|
131
|
-
for (const input of
|
|
145
|
+
for (const input of inputs) {
|
|
132
146
|
const parts = [];
|
|
133
147
|
if (input.displayName !== undefined && input.displayName !== input.parameterName) {
|
|
134
148
|
parts.push(`name: ${quote(input.displayName)}`);
|
|
@@ -138,7 +152,10 @@ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElemen
|
|
|
138
152
|
parts.push(`required: ${input.required}`);
|
|
139
153
|
lines.push(` ${safeKey(input.parameterName)}: { ${parts.join(", ")} },`);
|
|
140
154
|
}
|
|
141
|
-
|
|
155
|
+
const cast = missingRequired.length > 0
|
|
156
|
+
? ` as any /* TODO: automation requires input(s) for ${missingRequired.map((n) => quote(n)).join(", ")} — this tool has no mapping configured on the platform; add real inputs and remove this cast before deploying */`
|
|
157
|
+
: "";
|
|
158
|
+
lines.push(` }${cast},`);
|
|
142
159
|
}
|
|
143
160
|
if (tool.outputs !== undefined && tool.outputs.length > 0) {
|
|
144
161
|
lines.push(" outputs: {");
|
|
@@ -241,6 +258,8 @@ function printTool(tool, appRefName, crossOrg, foreignAppRefNames, foreignElemen
|
|
|
241
258
|
if ((tool.typeKey === "createRecord" || tool.typeKey === "updateRecord") && f.required !== undefined) {
|
|
242
259
|
parts.push(`required: ${f.required}`);
|
|
243
260
|
}
|
|
261
|
+
if (f.defaultValue !== undefined)
|
|
262
|
+
parts.push(`defaultValue: ${quote(f.defaultValue)}`);
|
|
244
263
|
const todo = isRaw
|
|
245
264
|
? " // TODO: raw platform field id - the field belongs to a foreign/out-of-scope aspect ei can't resolve to a reference"
|
|
246
265
|
: owner.kind === "raw" && resolvedRaw === undefined
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* which the deploy wire client injects) with `CatalogRef` tokens at every
|
|
4
4
|
* reference position. Standalone from v1.
|
|
5
5
|
*/
|
|
6
|
-
export {
|
|
6
|
+
export { skill, type SkillConfigured, type SkillV2Options } from "./build.js";
|
|
7
7
|
export { serviceAccountRef, type AgentToolRunAs, type ServiceAccountRef, } from "../agent/run-as.js";
|
|
8
8
|
export { skillAutomation, skillCreateRecord, skillRunAgent, skillSearchRecords, skillSearchTable, skillUpdateRecord, type SkillRecordField, type SkillRecordFieldInput, type SkillRecordRawIdField, type SkillSearchField, type SkillSearchFieldInput, type SkillSearchRawIdField, type SkillToolStatus, type SkillTool, } from "./tools.js";
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* which the deploy wire client injects) with `CatalogRef` tokens at every
|
|
4
4
|
* reference position. Standalone from v1.
|
|
5
5
|
*/
|
|
6
|
-
export {
|
|
6
|
+
export { skill } from "./build.js";
|
|
7
7
|
export { serviceAccountRef, } from "../agent/run-as.js";
|
|
8
8
|
export { skillAutomation, skillCreateRecord, skillRunAgent, skillSearchRecords, skillSearchTable, skillUpdateRecord, } from "./tools.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The skill entity's registry entry + resource-type constant (see src/graph/). */
|
|
2
|
-
import {
|
|
2
|
+
import { rootParentFactoryEntry } from "../../catalog/render-helpers.js";
|
|
3
3
|
import { isTfExpr } from "../../engine/tf/index.js";
|
|
4
4
|
import { printSkillV2 } from "./deserializer/print-skill-v2.js";
|
|
5
5
|
import { skillFromTf } from "./from-tf.js";
|
|
@@ -111,7 +111,7 @@ export const skillModule = {
|
|
|
111
111
|
catalogBag: "skills",
|
|
112
112
|
renderOrder: 30,
|
|
113
113
|
catalogRoot: "app",
|
|
114
|
-
renderEntry: (
|
|
114
|
+
renderEntry: rootParentFactoryEntry("skillRef"),
|
|
115
115
|
stubRef: skillStubRef,
|
|
116
116
|
refFromAuthoring: skillRefFromAuthoring,
|
|
117
117
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Skill emission: `skillToTf` consumes the discovered `DeployableEntity`
|
|
3
|
-
* (the `
|
|
3
|
+
* (the `skill` def() payload) and emits `elementum_agentic_skill` +
|
|
4
4
|
* one tool resource per implemented tool (the tool pass delegates to
|
|
5
5
|
* `entities/skill-tool/to-tf.ts`). Mirrors `entities/agent/to-tf.ts`.
|
|
6
6
|
*
|