@elementumai/edk 0.9.19 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +159 -7
- package/dist-sdk/src/catalog/factories.d.ts +33 -2
- package/dist-sdk/src/catalog/factories.js +40 -1
- package/dist-sdk/src/catalog/from-authoring.d.ts +13 -8
- package/dist-sdk/src/catalog/from-authoring.js +34 -9
- package/dist-sdk/src/catalog/index.d.ts +2 -2
- package/dist-sdk/src/catalog/index.js +2 -2
- package/dist-sdk/src/catalog/render.js +6 -6
- package/dist-sdk/src/catalog/token.js +11 -0
- package/dist-sdk/src/catalog/types.d.ts +40 -1
- package/dist-sdk/src/catalog/types.js +12 -0
- package/dist-sdk/src/core/triggers/on-demand.d.ts +40 -4
- package/dist-sdk/src/core/triggers/on-demand.js +17 -2
- package/dist-sdk/src/core/types/app.d.ts +2 -2
- package/dist-sdk/src/engine/build/context.d.ts +1 -1
- package/dist-sdk/src/engine/coverage-gaps.d.ts +86 -0
- package/dist-sdk/src/engine/coverage-gaps.js +156 -0
- package/dist-sdk/src/engine/ei/run.d.ts +169 -0
- package/dist-sdk/src/engine/ei/run.js +1219 -0
- package/dist-sdk/src/engine/logging.d.ts +17 -0
- package/dist-sdk/src/engine/logging.js +18 -0
- package/dist-sdk/src/engine/pull/catalog-ref.d.ts +16 -0
- package/dist-sdk/src/engine/pull/catalog-ref.js +24 -0
- package/dist-sdk/src/engine/pull/context.d.ts +68 -6
- package/dist-sdk/src/engine/pull/context.js +40 -1
- package/dist-sdk/src/engine/pull/procedure-refs.d.ts +8 -0
- package/dist-sdk/src/engine/pull/procedure-refs.js +28 -0
- package/dist-sdk/src/engine/pull/ref-only.d.ts +5 -0
- package/dist-sdk/src/engine/pull/ref-only.js +10 -7
- package/dist-sdk/src/engine/pull/result-output.d.ts +6 -0
- package/dist-sdk/src/engine/pull/result-output.js +113 -3
- package/dist-sdk/src/engine/tf/expr.js +1 -1
- package/dist-sdk/src/engine/tf/index.d.ts +2 -2
- package/dist-sdk/src/engine/tf/index.js +1 -1
- package/dist-sdk/src/engine/tf/labels.d.ts +28 -5
- package/dist-sdk/src/engine/tf/labels.js +54 -3
- package/dist-sdk/src/engine/tf/model.d.ts +22 -1
- package/dist-sdk/src/engine/tf/parse.js +93 -4
- package/dist-sdk/src/engine/tf/render.d.ts +4 -2
- package/dist-sdk/src/engine/tf/render.js +41 -7
- package/dist-sdk/src/engine/validation.d.ts +44 -0
- package/dist-sdk/src/engine/validation.js +95 -0
- package/dist-sdk/src/entities/access-policy/from-tf.js +38 -1
- package/dist-sdk/src/entities/access-policy/principal.d.ts +2 -0
- package/dist-sdk/src/entities/access-policy/to-tf.js +5 -2
- package/dist-sdk/src/entities/agent/build.d.ts +4 -16
- package/dist-sdk/src/entities/agent/build.js +40 -5
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +3 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +46 -21
- package/dist-sdk/src/entities/agent/from-tf.js +11 -3
- package/dist-sdk/src/entities/agent/module.js +2 -0
- package/dist-sdk/src/entities/agent/to-tf.js +20 -6
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +10 -1
- package/dist-sdk/src/entities/agent-tool/from-tf.js +18 -6
- package/dist-sdk/src/entities/agent-tool/module.js +3 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +2 -2
- package/dist-sdk/src/entities/agent-tool/to-tf.js +27 -5
- package/dist-sdk/src/entities/app/auto-share.d.ts +38 -0
- package/dist-sdk/src/entities/app/auto-share.js +49 -0
- package/dist-sdk/src/entities/app/build.d.ts +105 -22
- package/dist-sdk/src/entities/app/build.js +107 -10
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +22 -1
- package/dist-sdk/src/entities/app/from-tf.d.ts +1 -0
- package/dist-sdk/src/entities/app/from-tf.js +11 -2
- package/dist-sdk/src/entities/app/index.d.ts +7 -6
- package/dist-sdk/src/entities/app/index.js +2 -8
- package/dist-sdk/src/entities/app/module.js +5 -2
- package/dist-sdk/src/entities/app/to-tf.d.ts +6 -0
- package/dist-sdk/src/entities/app/to-tf.js +40 -13
- package/dist-sdk/src/entities/automation/build.d.ts +56 -6
- package/dist-sdk/src/entities/automation/build.js +230 -26
- package/dist-sdk/src/entities/automation/calculation-expression.d.ts +7 -7
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +41 -5
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +470 -58
- package/dist-sdk/src/entities/automation/from-tf.d.ts +37 -8
- package/dist-sdk/src/entities/automation/from-tf.js +791 -131
- package/dist-sdk/src/entities/automation/generated/task-output-contracts.d.ts +33 -0
- package/dist-sdk/src/entities/automation/generated/task-output-contracts.js +183 -0
- package/dist-sdk/src/entities/automation/index.d.ts +2 -2
- package/dist-sdk/src/entities/automation/index.js +1 -1
- package/dist-sdk/src/entities/automation/module.d.ts +3 -0
- package/dist-sdk/src/entities/automation/module.js +107 -15
- package/dist-sdk/src/entities/automation/output-field-types.d.ts +7 -0
- package/dist-sdk/src/entities/automation/output-field-types.js +36 -0
- package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +9 -0
- package/dist-sdk/src/entities/automation/output-key-wire-name.js +13 -0
- package/dist-sdk/src/entities/automation/script-code.d.ts +20 -0
- package/dist-sdk/src/entities/automation/script-code.js +109 -5
- package/dist-sdk/src/entities/automation/system-ref-name.js +4 -0
- package/dist-sdk/src/entities/automation/task-output-labels.d.ts +39 -0
- package/dist-sdk/src/entities/automation/task-output-labels.js +85 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +116 -22
- package/dist-sdk/src/entities/automation/tasks.js +86 -24
- package/dist-sdk/src/entities/automation/to-tf.d.ts +24 -3
- package/dist-sdk/src/entities/automation/to-tf.js +1082 -132
- package/dist-sdk/src/entities/automation/triggers.d.ts +12 -6
- package/dist-sdk/src/entities/automation/triggers.js +4 -0
- package/dist-sdk/src/entities/automation/types.d.ts +9 -0
- package/dist-sdk/src/entities/automation/types.js +19 -0
- package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +1 -1
- package/dist-sdk/src/entities/automation/value-ref-tf.js +1 -1
- package/dist-sdk/src/entities/chart/from-tf.js +9 -1
- package/dist-sdk/src/entities/chart/to-tf.js +10 -3
- package/dist-sdk/src/entities/data-lookup/module.js +2 -0
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +24 -31
- package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +7 -5
- package/dist-sdk/src/entities/element/build.d.ts +28 -13
- package/dist-sdk/src/entities/element/build.js +5 -1
- package/dist-sdk/src/entities/element/from-tf.d.ts +11 -0
- package/dist-sdk/src/entities/element/from-tf.js +62 -1
- package/dist-sdk/src/entities/element/index.d.ts +5 -3
- package/dist-sdk/src/entities/element/index.js +1 -0
- package/dist-sdk/src/entities/element/module.js +9 -3
- package/dist-sdk/src/entities/element/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/element/to-tf.js +16 -16
- package/dist-sdk/src/entities/field/build.d.ts +17 -3
- package/dist-sdk/src/entities/field/build.js +3 -0
- package/dist-sdk/src/entities/field/calc.d.ts +7 -7
- package/dist-sdk/src/entities/field/from-tf.d.ts +5 -4
- package/dist-sdk/src/entities/field/from-tf.js +244 -49
- package/dist-sdk/src/entities/field/media-types.d.ts +6 -0
- package/dist-sdk/src/entities/field/media-types.js +30 -0
- package/dist-sdk/src/entities/field/module.js +2 -0
- package/dist-sdk/src/entities/field/options.js +6 -1
- package/dist-sdk/src/entities/field/to-tf.d.ts +26 -5
- package/dist-sdk/src/entities/field/to-tf.js +137 -15
- package/dist-sdk/src/entities/field/types.d.ts +2 -0
- package/dist-sdk/src/entities/field/types.js +27 -0
- package/dist-sdk/src/entities/file-reader/from-tf.js +14 -5
- package/dist-sdk/src/entities/file-reader/module.js +1 -0
- package/dist-sdk/src/entities/file-reader/types.d.ts +2 -0
- package/dist-sdk/src/entities/file-reader/types.js +1 -1
- package/dist-sdk/src/entities/portal/build.d.ts +26 -0
- package/dist-sdk/src/entities/portal/build.js +37 -0
- package/dist-sdk/src/entities/portal/from-tf.d.ts +27 -0
- package/dist-sdk/src/entities/portal/from-tf.js +75 -0
- package/dist-sdk/src/entities/portal/index.d.ts +1 -0
- package/dist-sdk/src/entities/portal/index.js +1 -0
- package/dist-sdk/src/entities/portal/module.d.ts +3 -0
- package/dist-sdk/src/entities/portal/module.js +28 -0
- package/dist-sdk/src/entities/portal/to-tf.d.ts +12 -0
- package/dist-sdk/src/entities/portal/to-tf.js +73 -0
- package/dist-sdk/src/entities/portal/types.d.ts +1 -0
- package/dist-sdk/src/entities/portal/types.js +1 -0
- package/dist-sdk/src/entities/relationship/module.js +2 -0
- package/dist-sdk/src/entities/relationship/pair-check.d.ts +7 -0
- package/dist-sdk/src/entities/relationship/pair-check.js +68 -0
- package/dist-sdk/src/entities/relationship/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/relationship/to-tf.js +12 -3
- package/dist-sdk/src/entities/role/from-tf.js +3 -3
- package/dist-sdk/src/entities/role/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/role/to-tf.js +12 -4
- package/dist-sdk/src/entities/search-table/module.js +1 -0
- package/dist-sdk/src/entities/search-table/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/search-table/to-tf.js +1 -1
- package/dist-sdk/src/entities/service-account/build.d.ts +15 -2
- package/dist-sdk/src/entities/service-account/from-tf.d.ts +2 -4
- package/dist-sdk/src/entities/service-account/from-tf.js +20 -8
- package/dist-sdk/src/entities/service-account/role-fidelity.d.ts +56 -0
- package/dist-sdk/src/entities/service-account/role-fidelity.js +243 -0
- package/dist-sdk/src/entities/service-account/to-tf.d.ts +14 -0
- package/dist-sdk/src/entities/service-account/to-tf.js +17 -0
- package/dist-sdk/src/entities/service-account/workspace-owner.d.ts +16 -0
- package/dist-sdk/src/entities/service-account/workspace-owner.js +22 -0
- package/dist-sdk/src/entities/shared/aspect-target-from-tf.d.ts +1 -1
- package/dist-sdk/src/entities/shared/aspect-target-from-tf.js +5 -2
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +23 -1
- package/dist-sdk/src/entities/shared/filters/ast.js +2 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +7 -0
- package/dist-sdk/src/entities/shared/filters/index.js +19 -4
- package/dist-sdk/src/entities/shared/filters/print.js +24 -3
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +7 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +46 -7
- package/dist-sdk/src/entities/shared/filters/types.d.ts +15 -2
- package/dist-sdk/src/entities/shared/ref.d.ts +5 -7
- package/dist-sdk/src/entities/shared/ref.js +5 -7
- package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +9 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.js +35 -2
- package/dist-sdk/src/entities/shared/types/field-types.d.ts +20 -5
- package/dist-sdk/src/entities/shared/types/field-types.js +8 -0
- package/dist-sdk/src/entities/skill/access-policy.js +3 -3
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +3 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +14 -6
- package/dist-sdk/src/entities/skill/from-tf.js +70 -15
- package/dist-sdk/src/entities/skill/input-coverage.d.ts +7 -0
- package/dist-sdk/src/entities/skill/input-coverage.js +11 -0
- package/dist-sdk/src/entities/skill/module.js +2 -0
- package/dist-sdk/src/entities/skill/to-tf.js +14 -4
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +2 -0
- package/dist-sdk/src/entities/skill-tool/from-tf.js +49 -10
- package/dist-sdk/src/entities/skill-tool/module.js +3 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +2 -8
- package/dist-sdk/src/entities/skill-tool/to-tf.js +49 -14
- package/dist-sdk/src/entities/table/catalog.d.ts +14 -0
- package/dist-sdk/src/entities/table/catalog.js +66 -0
- package/dist-sdk/src/entities/table/module.js +2 -1
- package/dist-sdk/src/entities/table/to-tf.js +2 -2
- package/dist-sdk/src/entities/task/build.d.ts +8 -0
- package/dist-sdk/src/entities/task/build.js +10 -1
- package/dist-sdk/src/entities/task/from-tf.d.ts +4 -2
- package/dist-sdk/src/entities/task/from-tf.js +7 -2
- package/dist-sdk/src/entities/task/module.js +2 -2
- package/dist-sdk/src/entities/task/to-tf.d.ts +8 -4
- package/dist-sdk/src/entities/task/to-tf.js +28 -1
- package/dist-sdk/src/entities/view/agent-view-layout-from-tf.d.ts +49 -9
- package/dist-sdk/src/entities/view/agent-view-layout-from-tf.js +71 -18
- package/dist-sdk/src/entities/view/agent-view-layout-to-tf.d.ts +19 -4
- package/dist-sdk/src/entities/view/agent-view-layout-to-tf.js +82 -10
- package/dist-sdk/src/entities/view/agent-view-layout.d.ts +53 -23
- package/dist-sdk/src/entities/view/agent-view-layout.js +1 -1
- package/dist-sdk/src/entities/view/from-tf.d.ts +3 -2
- package/dist-sdk/src/entities/view/from-tf.js +133 -13
- package/dist-sdk/src/entities/view/module.js +30 -3
- package/dist-sdk/src/entities/view/to-tf.d.ts +20 -8
- package/dist-sdk/src/entities/view/to-tf.js +86 -18
- package/dist-sdk/src/entities/view/types.d.ts +4 -15
- package/dist-sdk/src/entities/view/types.js +15 -15
- package/dist-sdk/src/entities/visual-flow/build.d.ts +16 -1
- package/dist-sdk/src/entities/visual-flow/build.js +9 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.d.ts +14 -0
- package/dist-sdk/src/entities/visual-flow/from-tf.js +51 -3
- 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/printer.js +19 -0
- package/dist-sdk/src/entities/visual-flow/to-tf.js +87 -3
- package/dist-sdk/src/entities/widget/build.d.ts +16 -1
- package/dist-sdk/src/entities/widget/build.js +11 -1
- package/dist-sdk/src/entities/widget/from-tf.js +3 -3
- package/dist-sdk/src/entities/widget/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/widget/to-tf.js +41 -14
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +148 -13
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
- package/dist-sdk/src/graph/index.d.ts +12 -0
- package/dist-sdk/src/graph/index.js +21 -0
- package/dist-sdk/src/graph/modules.js +2 -0
- package/dist-sdk/src/graph/types.d.ts +83 -4
- package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
- package/dist-sdk/src/internal/sdk-package.js +1 -0
- package/package.json +16 -3
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Captured from mobius `service_tasks` (2026-10-02), validated byte-for-byte
|
|
3
|
+
* against the live registry, and proven end-to-end on local (publish + 0-diff
|
|
4
|
+
* round-trip) for every affected task type. Hand-maintained: update it
|
|
5
|
+
* deliberately when the platform's task output contracts change.
|
|
6
|
+
* `canonical-reference-model.test.ts` locks the canonical output names +
|
|
7
|
+
* fieldTypes this fix emits against the forward/inverse rewrite maps, so a
|
|
8
|
+
* change here that breaks the mapping fails CI.
|
|
9
|
+
*
|
|
10
|
+
* Each entry is an executor's **referenceable** output contract — the canonical
|
|
11
|
+
* reference name → { fieldType, multiple } the platform validates against. This
|
|
12
|
+
* is the source of truth for a workflow output/task-input `taskReference.name`
|
|
13
|
+
* and its fieldType; EDK emits `{taskReference:{taskId,name:<canonical>},fieldType}`
|
|
14
|
+
* directly (no display labels). See DESIGN-canonical-reference-model.md.
|
|
15
|
+
*
|
|
16
|
+
* `executeScript` (script-runner-javascript) outputs beyond the base ones are
|
|
17
|
+
* author-declared via the task's `output_schema` (fieldType comes from there,
|
|
18
|
+
* canonical name is `result.<field>`); only the base outputs are listed here.
|
|
19
|
+
* createRecord/updateField also expose a `<relation-field-id>` ASPECT_REFERENCES
|
|
20
|
+
* output keyed by the field UUID — handled per-instance, not in this table.
|
|
21
|
+
*/
|
|
22
|
+
export interface OutputContract {
|
|
23
|
+
readonly fieldType: string;
|
|
24
|
+
readonly multiple: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** executor name (service_tasks.name) → canonical referenceable output → contract. */
|
|
27
|
+
export declare const TASK_OUTPUT_CONTRACTS: Readonly<Record<string, Readonly<Record<string, OutputContract>>>>;
|
|
28
|
+
/**
|
|
29
|
+
* EDK terraform resource type → service_tasks executor name, so to-tf/from-tf
|
|
30
|
+
* can look up a task's contract from its resource type. aiAgent has two
|
|
31
|
+
* executors (completion/run) with an identical contract.
|
|
32
|
+
*/
|
|
33
|
+
export declare const RESOURCE_TYPE_TO_EXECUTOR: Readonly<Record<string, string>>;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Captured from mobius `service_tasks` (2026-10-02), validated byte-for-byte
|
|
3
|
+
* against the live registry, and proven end-to-end on local (publish + 0-diff
|
|
4
|
+
* round-trip) for every affected task type. Hand-maintained: update it
|
|
5
|
+
* deliberately when the platform's task output contracts change.
|
|
6
|
+
* `canonical-reference-model.test.ts` locks the canonical output names +
|
|
7
|
+
* fieldTypes this fix emits against the forward/inverse rewrite maps, so a
|
|
8
|
+
* change here that breaks the mapping fails CI.
|
|
9
|
+
*
|
|
10
|
+
* Each entry is an executor's **referenceable** output contract — the canonical
|
|
11
|
+
* reference name → { fieldType, multiple } the platform validates against. This
|
|
12
|
+
* is the source of truth for a workflow output/task-input `taskReference.name`
|
|
13
|
+
* and its fieldType; EDK emits `{taskReference:{taskId,name:<canonical>},fieldType}`
|
|
14
|
+
* directly (no display labels). See DESIGN-canonical-reference-model.md.
|
|
15
|
+
*
|
|
16
|
+
* `executeScript` (script-runner-javascript) outputs beyond the base ones are
|
|
17
|
+
* author-declared via the task's `output_schema` (fieldType comes from there,
|
|
18
|
+
* canonical name is `result.<field>`); only the base outputs are listed here.
|
|
19
|
+
* createRecord/updateField also expose a `<relation-field-id>` ASPECT_REFERENCES
|
|
20
|
+
* output keyed by the field UUID — handled per-instance, not in this table.
|
|
21
|
+
*/
|
|
22
|
+
/** executor name (service_tasks.name) → canonical referenceable output → contract. */
|
|
23
|
+
export const TASK_OUTPUT_CONTRACTS = {
|
|
24
|
+
ai_classify_completion: {
|
|
25
|
+
response: { fieldType: "TEXT", multiple: false },
|
|
26
|
+
reason: { fieldType: "TEXT", multiple: false },
|
|
27
|
+
success: { fieldType: "BOOLEAN", multiple: false },
|
|
28
|
+
},
|
|
29
|
+
ai_summarize_completion: {
|
|
30
|
+
response: { fieldType: "TEXT", multiple: false },
|
|
31
|
+
success: { fieldType: "BOOLEAN", multiple: false },
|
|
32
|
+
},
|
|
33
|
+
ai_transform_completion: {
|
|
34
|
+
response: { fieldType: "TEXT", multiple: false },
|
|
35
|
+
success: { fieldType: "BOOLEAN", multiple: false },
|
|
36
|
+
},
|
|
37
|
+
ai_search_table: {
|
|
38
|
+
firstFoundRecord: { fieldType: "AI_SEARCH_TABLE_RECORD", multiple: false },
|
|
39
|
+
firstFoundRecordJson: { fieldType: "JSON", multiple: false },
|
|
40
|
+
firstFoundRecordText: { fieldType: "TEXT", multiple: false },
|
|
41
|
+
searchTableRecords: { fieldType: "AI_SEARCH_TABLE_RECORD", multiple: true },
|
|
42
|
+
searchTableRecordsJson: { fieldType: "JSON", multiple: false },
|
|
43
|
+
searchTableRecordsText: { fieldType: "TEXT", multiple: false },
|
|
44
|
+
},
|
|
45
|
+
ai_file_analysis_completion: {
|
|
46
|
+
documentModel: { fieldType: "DOCUMENT_MODEL_RECORD", multiple: false },
|
|
47
|
+
success: { fieldType: "BOOLEAN", multiple: false },
|
|
48
|
+
},
|
|
49
|
+
ai_agent_completion: {
|
|
50
|
+
ai_agent_task_response: { fieldType: "TEXT", multiple: false },
|
|
51
|
+
ai_agent_task_status: { fieldType: "BOOLEAN", multiple: false },
|
|
52
|
+
ai_agent_task_error: { fieldType: "TEXT", multiple: false },
|
|
53
|
+
ai_agent_task_output_files: { fieldType: "ATTACHMENT", multiple: true },
|
|
54
|
+
ai_agent_task_structured_output: { fieldType: "OBJECT", multiple: false },
|
|
55
|
+
},
|
|
56
|
+
ai_agent_run: {
|
|
57
|
+
ai_agent_task_response: { fieldType: "TEXT", multiple: false },
|
|
58
|
+
ai_agent_task_status: { fieldType: "BOOLEAN", multiple: false },
|
|
59
|
+
ai_agent_task_error: { fieldType: "TEXT", multiple: false },
|
|
60
|
+
ai_agent_task_output_files: { fieldType: "ATTACHMENT", multiple: true },
|
|
61
|
+
ai_agent_task_structured_output: { fieldType: "OBJECT", multiple: false },
|
|
62
|
+
},
|
|
63
|
+
send_api_request: {
|
|
64
|
+
success: { fieldType: "BOOLEAN", multiple: false },
|
|
65
|
+
response: { fieldType: "OBJECT", multiple: false },
|
|
66
|
+
textResponse: { fieldType: "TEXT", multiple: false },
|
|
67
|
+
statusCode: { fieldType: "NUMBER", multiple: false },
|
|
68
|
+
file: { fieldType: "FILE", multiple: false },
|
|
69
|
+
contentType: { fieldType: "TEXT", multiple: false },
|
|
70
|
+
},
|
|
71
|
+
"script-runner-javascript": {
|
|
72
|
+
result: { fieldType: "JSON", multiple: false },
|
|
73
|
+
textResult: { fieldType: "TEXT", multiple: false },
|
|
74
|
+
stringArrayResult: { fieldType: "TEXT", multiple: true },
|
|
75
|
+
numberArrayResult: { fieldType: "NUMBER", multiple: true },
|
|
76
|
+
},
|
|
77
|
+
aspect_records_search: {
|
|
78
|
+
count: { fieldType: "NUMBER", multiple: false },
|
|
79
|
+
record: { fieldType: "ASPECT_RECORD", multiple: false },
|
|
80
|
+
recordId: { fieldType: "ASPECT_RECORD_ID", multiple: false },
|
|
81
|
+
recordIds: { fieldType: "ASPECT_RECORD_ID", multiple: true },
|
|
82
|
+
records: { fieldType: "ASPECT_RECORD", multiple: true },
|
|
83
|
+
resultTruncatedByLimit: { fieldType: "BOOLEAN", multiple: false },
|
|
84
|
+
},
|
|
85
|
+
table_records_search: {
|
|
86
|
+
count: { fieldType: "NUMBER", multiple: false },
|
|
87
|
+
metaData: { fieldType: "JSON", multiple: false },
|
|
88
|
+
record: { fieldType: "TABLE_RECORD", multiple: false },
|
|
89
|
+
records: { fieldType: "TABLE_RECORD", multiple: true },
|
|
90
|
+
tableId: { fieldType: "TABLE_ID", multiple: false },
|
|
91
|
+
},
|
|
92
|
+
find_related_records: {
|
|
93
|
+
record: { fieldType: "ASPECT_RECORD", multiple: false },
|
|
94
|
+
records: { fieldType: "ASPECT_RECORD", multiple: true },
|
|
95
|
+
// `fields` (ASPECT_FIELD_PROPERTY) is NOT referenceable — intentionally omitted.
|
|
96
|
+
},
|
|
97
|
+
create_aspect_record_and_relate: {
|
|
98
|
+
record: { fieldType: "ASPECT_RECORD", multiple: false },
|
|
99
|
+
recordId: { fieldType: "ASPECT_RECORD_ID", multiple: false },
|
|
100
|
+
},
|
|
101
|
+
update_aspect_field: {
|
|
102
|
+
record: { fieldType: "ASPECT_RECORD", multiple: false },
|
|
103
|
+
recordId: { fieldType: "ASPECT_RECORD_ID", multiple: false },
|
|
104
|
+
},
|
|
105
|
+
relate_aspect_records: {
|
|
106
|
+
SUCCESS: { fieldType: "BOOLEAN", multiple: false },
|
|
107
|
+
},
|
|
108
|
+
calculation: {
|
|
109
|
+
calculationOutputMap: { fieldType: "OBJECT", multiple: false },
|
|
110
|
+
},
|
|
111
|
+
execution_procedure: {
|
|
112
|
+
result: { fieldType: "OBJECT", multiple: false },
|
|
113
|
+
},
|
|
114
|
+
bulk_update_fields: {
|
|
115
|
+
recordsUpdated: { fieldType: "NUMBER", multiple: false },
|
|
116
|
+
allMatchingRecordsUpdated: { fieldType: "BOOLEAN", multiple: false },
|
|
117
|
+
},
|
|
118
|
+
document_model: {
|
|
119
|
+
documentModels: { fieldType: "DOCUMENT_MODEL_RECORD", multiple: true },
|
|
120
|
+
},
|
|
121
|
+
save_attachment: {
|
|
122
|
+
attachments: { fieldType: "ATTACHMENT", multiple: true },
|
|
123
|
+
},
|
|
124
|
+
unzip_file: {
|
|
125
|
+
files: { fieldType: "FILE", multiple: true },
|
|
126
|
+
firstFile: { fieldType: "FILE", multiple: false },
|
|
127
|
+
},
|
|
128
|
+
user_search: {
|
|
129
|
+
count: { fieldType: "NUMBER", multiple: false },
|
|
130
|
+
user: { fieldType: "USER", multiple: false },
|
|
131
|
+
// user.id / user.name / user.email are referenceable sub-field outputs
|
|
132
|
+
// (fieldTypes confirmed live 0-diff: user.id is USER_ID, the rest TEXT).
|
|
133
|
+
// user.managerName / user.managerEmail are NOT referenceable at publish —
|
|
134
|
+
// their canonical name was never captured live; omitted deliberately.
|
|
135
|
+
"user.id": { fieldType: "USER_ID", multiple: false },
|
|
136
|
+
"user.name": { fieldType: "TEXT", multiple: false },
|
|
137
|
+
"user.email": { fieldType: "TEXT", multiple: false },
|
|
138
|
+
users: { fieldType: "USER", multiple: true },
|
|
139
|
+
},
|
|
140
|
+
user_group_search: {
|
|
141
|
+
count: { fieldType: "NUMBER", multiple: false },
|
|
142
|
+
group: { fieldType: "GROUP", multiple: false },
|
|
143
|
+
// group.id / group.name are referenceable sub-field outputs (#1271's
|
|
144
|
+
// TASK_OUTPUT_REFERENCE_NAMES ID→group.id, Name→group.name). fieldTypes
|
|
145
|
+
// confirmed live 0-diff: group.id is GROUP_ID, group.name is TEXT.
|
|
146
|
+
"group.id": { fieldType: "GROUP_ID", multiple: false },
|
|
147
|
+
"group.name": { fieldType: "TEXT", multiple: false },
|
|
148
|
+
groups: { fieldType: "GROUP", multiple: true },
|
|
149
|
+
},
|
|
150
|
+
// Executors with NO referenceable outputs (no reference table needed):
|
|
151
|
+
// send_email, send_tagged_message, generate_notification_simple,
|
|
152
|
+
// add_watcher_to_record, lock_aspect_fields, create_approval_chain,
|
|
153
|
+
// run_automation (childExecutionId is not referenceable).
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* EDK terraform resource type → service_tasks executor name, so to-tf/from-tf
|
|
157
|
+
* can look up a task's contract from its resource type. aiAgent has two
|
|
158
|
+
* executors (completion/run) with an identical contract.
|
|
159
|
+
*/
|
|
160
|
+
export const RESOURCE_TYPE_TO_EXECUTOR = {
|
|
161
|
+
elementum_ai_classify_task: "ai_classify_completion",
|
|
162
|
+
elementum_ai_summarize_task: "ai_summarize_completion",
|
|
163
|
+
elementum_ai_transform_task: "ai_transform_completion",
|
|
164
|
+
elementum_ai_search_table_task: "ai_search_table",
|
|
165
|
+
elementum_ai_file_read_task: "ai_file_analysis_completion",
|
|
166
|
+
elementum_ai_agent_task: "ai_agent_completion",
|
|
167
|
+
elementum_api_task: "send_api_request",
|
|
168
|
+
elementum_execute_script_task: "script-runner-javascript",
|
|
169
|
+
elementum_record_search_task: "aspect_records_search",
|
|
170
|
+
elementum_table_records_search_task: "table_records_search",
|
|
171
|
+
elementum_find_related_records_task: "find_related_records",
|
|
172
|
+
elementum_create_record_task: "create_aspect_record_and_relate",
|
|
173
|
+
elementum_update_field_task: "update_aspect_field",
|
|
174
|
+
elementum_relate_records_task: "relate_aspect_records",
|
|
175
|
+
elementum_calculation_task: "calculation",
|
|
176
|
+
elementum_procedure_task: "execution_procedure",
|
|
177
|
+
elementum_bulk_update_fields_task: "bulk_update_fields",
|
|
178
|
+
elementum_file_reader_task: "document_model",
|
|
179
|
+
elementum_save_attachment_task: "save_attachment",
|
|
180
|
+
elementum_unzip_file_task: "unzip_file",
|
|
181
|
+
elementum_user_search_task: "user_search",
|
|
182
|
+
elementum_user_group_search_task: "user_group_search",
|
|
183
|
+
};
|
|
@@ -15,8 +15,8 @@ export { AUTOMATION_RESOURCE_TYPES, AUTOMATION_TASK_TYPES, AUTOMATION_TRIGGER_TY
|
|
|
15
15
|
* from v1's deploy-wired builder.
|
|
16
16
|
*/
|
|
17
17
|
export * as filter from "../shared/filters/index.js";
|
|
18
|
-
export { automationStatus, chainableTrigger, actions, automation, type ActionBuilder, type ActionChain, type ActionDef, type ActionOptions, type ActionSequenceDef, type ActionsStarted, type AutomationConfigured, type AutomationOptions, type AutomationStatus, type ForkJoinBranch, type ForkJoinBranchBuilder, type ForkJoinConfig, type ForEachBuilder, type ForEachConfig, type NestedActionBuilder, type NestedActionChain, type NestedActionContext, type OperatorChild, type SwitchCase, type SwitchCaseBuilder, type SwitchConfig, type TriggerChain, type TriggerDef, type TriggerParamMeta } from "./build.js";
|
|
18
|
+
export { automationStatus, chainableTrigger, actions, automation, type ActionBuilder, type ActionChain, type ActionDef, type ActionOptions, type ActionSequenceDef, type ActionsStarted, type AutomationConfigured, type AutomationOptions, type AutomationStatus, type ForkJoinBranch, type ForkJoinBranchBuilder, type ForkJoinConfig, type ForEachBuilder, type ForEachConfig, type ForEachScope, type LoopScope, type NestedActionBuilder, type NestedActionChain, type NestedActionContext, type OperatorChild, type SwitchCase, type SwitchCaseBuilder, type SwitchConfig, type TriggerChain, type TriggerDef, type TriggerParamMeta } from "./build.js";
|
|
19
19
|
export { ScriptCodeError, scriptFile, type ScriptCodeFn, type ScriptFile, type ScriptInput } from "./script-code.js";
|
|
20
20
|
export { workflowOutput, workflowOutputType, type WorkflowOutputDeclaration, type WorkflowOutputType, } from "./workflow-output.js";
|
|
21
|
-
export { addWatcher, aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, approvalChain, approvalChainTemplate, approvalStatusUpdate, assignGroup, assignUser, assignmentEngine, bulkExcel, calculation, createRecord, executeScript, findRelatedRecords, generateReport, initiateCall, initiateEmailConversation, notification, postComment, postTeamsMessage, procedure, readFile, recordFieldLocking, recordSearch, relateRecords, runAutomation, saveAttachment, sendEmail, sendSurvey, setVariable, tableRecordsSearch, unzip, updateField, userGroupSearch, userSearch, withFieldMappings, type AddWatcherOptions, type AiAgentAttachment, type AiAgentOptions, type AiAgentOutput, type AiAgentOutputField, type AiAgentOutputFieldType, type AiClassifyCategorySource, type AiClassifyOptions, type AiClassifyStaticCategory, type AiEmailAnalysisOptions, type AiFileAnalysisOptions, type AiSearchTableOptions, type AiSearchTableOutput, type AiSummarizeOptions, type AiTransformOptions, type ApiRequestHeader, type ApiRequestOptions, type ApprovalChainOptions, type ApprovalChainTemplateOptions, type ApprovalStatusUpdateOptions, type ApprovalStatusUpdateStatus, type AssignGroupOptions, type AssignUserOptions, type AssignmentEngineOptions, type BulkExcelFieldMapping, type BulkExcelFieldSource, type BulkExcelOptions, type CalculationEntry, type CalculationExpression, type CalculationInclude, type CalculationOptions, type CalculationOutputs, type CalculationValueInput, type CalculationValueOptions, type CalculationValueOutputs, type CalculationValues, type CreateRecordOptions, type CreateRecordOutput, type EmailAttachment, type ExecuteScriptFieldMapping, type ExecuteScriptOptions, type FieldAssignment, type FindRelatedRecordsOptions, type FindRelatedRecordsOutput, type GenerateReportOptions, type InitiateCallOptions, type InitiateEmailConversationOptions, type InitiateEmailFirstEmail, type LegacyCalculationOptions, type MultiSelectUpdateMode, type NotificationOptions, type PostCommentOptions, type PostTeamsMessageOptions, type LegacyProcedureOptions, type ProcedureOptions, type TypedProcedureOptions, type ReadFileDataSource, type ReadFileOptions, type RecordFieldLockingOptions, type RecordId, type RecordReference, type RecordSearchOptions, type RecordSearchOutput, type RelateRecordsOptions, type RunAutomationInput, type RunAutomationOptions, type SaveAttachmentOptions, type ScriptOutputProperties, type ScriptOutputScalarType, type ScriptOutputType, type ScriptOutputs, type SendEmailOptions, type SendSurveyOptions, type SetVariableOptions, type TableRecordsSearchOptions, type TableRecordsSearchOutput, type UnzipOptions, type UpdateFieldAssignment, type UpdateFieldOptions, type UserGroupSearchOptions, type UserGroupSearchOutput, type UserGroupShape, type UserSearchOptions, type VariableAssign, type VariableDecl } from "./tasks.js";
|
|
21
|
+
export { addWatcher, aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, approvalChain, approvalChainTemplate, approvalStatusUpdate, requiredSecret, assignGroup, assignUser, assignmentEngine, bulkExcel, bulkUpdateFields, calculation, createRecord, executeScript, findRelatedRecords, generateReport, initiateCall, initiateEmailConversation, notification, postComment, postTeamsMessage, procedure, readFile, recordFieldLocking, recordSearch, relateRecords, runAutomation, saveAttachment, sendEmail, sendSurvey, setVariable, tableRecordsSearch, unzip, updateField, userGroupSearch, userSearch, withFieldMappings, type AddWatcherOptions, type AiAgentAttachment, type AiAgentOptions, type AiAgentOutput, type AiAgentOutputField, type AiAgentOutputFieldType, type AiClassifyCategorySource, type AiClassifyOptions, type AiClassifyStaticCategory, type AiEmailAnalysisOptions, type AiFileAnalysisOptions, type AiSearchTableOptions, type AiSearchTableOutput, type AiSummarizeOptions, type AiTransformOptions, type ApiRequestHeader, type ApiRequestOptions, type ApprovalChainOptions, type RequiredSecret, type ApprovalChainTemplateOptions, type ApprovalStatusUpdateOptions, type ApprovalStatusUpdateStatus, type AssignGroupOptions, type AssignUserOptions, type AssignmentEngineOptions, type BulkExcelFieldMapping, type BulkExcelFieldSource, type BulkExcelOptions, type BulkUpdateFieldsOptions, type BulkUpdateFieldsOutput, type CalculationEntry, type CalculationExpression, type CalculationInclude, type CalculationOptions, type CalculationOutputs, type CalculationValueInput, type CalculationValueOptions, type CalculationValueOutputs, type CalculationValues, type CreateRecordOptions, type CreateRecordOutput, type EmailAttachment, type ExecuteScriptFieldMapping, type ExecuteScriptOptions, type FieldAssignment, type FindRelatedRecordsOptions, type FindRelatedRecordsOutput, type GenerateReportOptions, type InitiateCallOptions, type InitiateEmailConversationOptions, type InitiateEmailFirstEmail, type LegacyCalculationOptions, type MultiSelectUpdateMode, type NotificationOptions, type StaticGroupRecipient, type StaticUserRecipient, type PostCommentOptions, type PostTeamsMessageOptions, type LegacyProcedureOptions, type ProcedureOptions, type TypedProcedureOptions, type ReadFileDataSource, type ReadFileOptions, type RecordFieldLockingOptions, type RecordId, type RecordReference, type RecordSearchOptions, type RecordSearchOutput, type RelateRecordsOptions, type RunAutomationInput, type RunAutomationDynamicReferenceOptions, type RunAutomationOptions, type RunAutomationStaticOptions, type SaveAttachmentOptions, type ScriptOutputProperties, type ScriptOutputScalarType, type ScriptOutputType, type ScriptOutputs, type SendEmailOptions, type SendSurveyOptions, type SetVariableOptions, type TableRecordsSearchOptions, type TableRecordsSearchOutput, type UnzipOptions, type UpdateFieldAssignment, type UpdateFieldOptions, type UserGroupSearchOptions, type UserGroupSearchOutput, type UserGroupShape, type UserSearchOptions, type VariableAssign, type VariableDecl } from "./tasks.js";
|
|
22
22
|
export { approvalProcessStatusUpdated, attachment, commentAdded, conversationEnd, dataMine, emailReceived, onDemand, recordCreated, recordUpdated, schedule, slackMessage, surveyResponseCreate, temporal, webHook, webhook, type AttachmentTriggerOptions, type AttachmentTriggerOutput, type CommentAddedTriggerOptions, type CommentAddedTriggerOutput, type ConversationEndConversationType, type ConversationEndTriggerOptions, type ConversationEndTriggerOutput, type DataMineTriggerOptions, type DataMineTriggerOutput, type EmailReceivedTriggerOptions, type EmailReceivedTriggerOutput, type RecordTriggerOptions, type RecordTriggerOutput, type ScheduleFrequency, type ScheduleTriggerOptions, type ScheduleTriggerOutput, type SlackMessageTriggerOutput, type SurveyResponseCreateTriggerOptions, type SurveyResponseCreateTriggerOutput, type TemporalTriggerOptions, type TemporalUnit, type WebhookTriggerOptions, type WebhookTriggerOutput, type Weekday, type approvalProcessStatusUpdatedStatus, type approvalProcessStatusUpdatedTriggerOptions } from "./triggers.js";
|
|
@@ -18,7 +18,7 @@ export * as filter from "../shared/filters/index.js";
|
|
|
18
18
|
export { automationStatus, chainableTrigger, actions, automation } from "./build.js";
|
|
19
19
|
export { ScriptCodeError, scriptFile } from "./script-code.js";
|
|
20
20
|
export { workflowOutput, workflowOutputType, } from "./workflow-output.js";
|
|
21
|
-
export { addWatcher, aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, approvalChain, approvalChainTemplate, approvalStatusUpdate, assignGroup, assignUser, assignmentEngine, bulkExcel, calculation, createRecord, executeScript, findRelatedRecords, generateReport, initiateCall, initiateEmailConversation, notification, postComment, postTeamsMessage, procedure, readFile, recordFieldLocking, recordSearch, relateRecords, runAutomation, saveAttachment, sendEmail, sendSurvey, setVariable, tableRecordsSearch, unzip, updateField, userGroupSearch, userSearch, withFieldMappings } from "./tasks.js";
|
|
21
|
+
export { addWatcher, aiAgent, aiClassify, aiEmailAnalysis, aiFileAnalysis, aiSearchTable, aiSummarize, aiTransform, apiRequest, approvalChain, approvalChainTemplate, approvalStatusUpdate, requiredSecret, assignGroup, assignUser, assignmentEngine, bulkExcel, bulkUpdateFields, calculation, createRecord, executeScript, findRelatedRecords, generateReport, initiateCall, initiateEmailConversation, notification, postComment, postTeamsMessage, procedure, readFile, recordFieldLocking, recordSearch, relateRecords, runAutomation, saveAttachment, sendEmail, sendSurvey, setVariable, tableRecordsSearch, unzip, updateField, userGroupSearch, userSearch, withFieldMappings } from "./tasks.js";
|
|
22
22
|
export { approvalProcessStatusUpdated, attachment, commentAdded, conversationEnd, dataMine, emailReceived, onDemand, recordCreated, recordUpdated, schedule, slackMessage, surveyResponseCreate, temporal, webHook, webhook } from "./triggers.js";
|
|
23
23
|
// Pull a deployed automation back as editable v2 source. `automation`
|
|
24
24
|
// is a plain factory returning a builder-chain object (not an Object.assign-able
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/** The automation entity's registry entry (see src/graph/). */
|
|
2
|
+
import { type TfBlock } from "../../engine/tf/index.js";
|
|
2
3
|
import { type EntityKindModule } from "../../graph/types.js";
|
|
4
|
+
/** The named WARN for an automation pull could not extract (edk#1054, edk#1480). */
|
|
5
|
+
export declare function droppedAutomationGap(autoBlock: TfBlock, autoLabel: string, reason: string): string;
|
|
3
6
|
export declare const automationModule: EntityKindModule;
|
|
4
7
|
/** The provider's `normalizeOnDemandFilterRefName`, which computes `filter_refs` at plan time. */
|
|
5
8
|
export declare function onDemandFilterRefName(name: string): string;
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
/** The automation entity's registry entry (see src/graph/). */
|
|
2
|
-
import { sanitizeName, tfLabelToTsLabel, isTfExpr } from "../../engine/tf/index.js";
|
|
2
|
+
import { appScopedResourceLabel, sanitizeName, tfLabelToTsLabel, isTfExpr } from "../../engine/tf/index.js";
|
|
3
|
+
function elementOwnerHandle(payload) {
|
|
4
|
+
if (payload === null || typeof payload !== "object" || !("handle" in payload))
|
|
5
|
+
return undefined;
|
|
6
|
+
const handle = payload.handle;
|
|
7
|
+
return typeof handle === "string" && handle !== "" ? handle : undefined;
|
|
8
|
+
}
|
|
3
9
|
import { renderAutomationCatalogEntry } from "./catalog-render.js";
|
|
4
|
-
import { preserveAuthoredAutomationPullMeta, printAutomationV2WithScriptFiles, SCRIPT_FILES_DIR } from "./deserializer/print-automation.js";
|
|
5
|
-
import {
|
|
10
|
+
import { hasUnresolvedForEachItem, preserveAuthoredAutomationPullMeta, printAutomationV2WithScriptFiles, SCRIPT_FILES_DIR } from "./deserializer/print-automation.js";
|
|
11
|
+
import { reportAuthoringBlocker } from "../../engine/pull/context.js";
|
|
12
|
+
import { recordValidations } from "../../engine/validation.js";
|
|
13
|
+
import { automationFromTf, automationOwnedAddresses, ForEachItemOutsideLoopError, UnsupportedMultiTriggerError } from "./from-tf.js";
|
|
6
14
|
import { scriptFileRefs } from "./script-code.js";
|
|
15
|
+
import { typedCoverageGap } from "../../engine/coverage-gaps.js";
|
|
7
16
|
import { TASK_OUTPUT_REFERENCE_NAMES } from "./task-output-labels.js";
|
|
8
17
|
import { automationToTf } from "./to-tf.js";
|
|
9
18
|
import { ALL_AUTOMATION_SUB_TYPES, AUTOMATION_RESOURCE_TYPE, WORKFLOW_PUBLISH_RESOURCE_TYPE, } from "./types.js";
|
|
19
|
+
const AUTOMATION_MEMBER_TYPES = new Set([
|
|
20
|
+
WORKFLOW_PUBLISH_RESOURCE_TYPE,
|
|
21
|
+
...ALL_AUTOMATION_SUB_TYPES.map((subType) => subType.resourceType),
|
|
22
|
+
]);
|
|
10
23
|
function isConfigured(value) {
|
|
11
24
|
return (typeof value === "object" &&
|
|
12
25
|
value !== null &&
|
|
@@ -88,23 +101,42 @@ function registerForeignObjectIdDeps(doc, automationLabel, ctx) {
|
|
|
88
101
|
if (!isTfExpr(objectId) || objectId.$expr !== "data-attr")
|
|
89
102
|
continue;
|
|
90
103
|
if (objectId.type === "elementum_app") {
|
|
91
|
-
|
|
104
|
+
// Namespace-only data blocks (ei's common foreign-app shape) leave
|
|
105
|
+
// dataName undefined; fall back to the namespace attribute (#1647).
|
|
106
|
+
const attrs = ctx.dataAttrs?.("elementum_app", objectId.label);
|
|
107
|
+
const name = ctx.dataName("elementum_app", objectId.label)
|
|
108
|
+
?? (typeof attrs?.["namespace"] === "string" ? attrs["namespace"] : undefined);
|
|
92
109
|
if (name === undefined || ctx.foreignAppRefNames?.has(name))
|
|
93
110
|
continue;
|
|
94
111
|
unresolved.apps.add(name);
|
|
95
112
|
}
|
|
96
113
|
else if (objectId.type === "elementum_element") {
|
|
97
|
-
const
|
|
114
|
+
const attrs = ctx.dataAttrs?.("elementum_element", objectId.label);
|
|
115
|
+
const name = ctx.dataName("elementum_element", objectId.label)
|
|
116
|
+
?? (typeof attrs?.["namespace"] === "string" ? attrs["namespace"] : undefined);
|
|
98
117
|
if (name === undefined || ctx.foreignElementRefNames?.has(name))
|
|
99
118
|
continue;
|
|
100
119
|
unresolved.elements.add(name);
|
|
101
120
|
}
|
|
102
121
|
}
|
|
103
122
|
}
|
|
123
|
+
/** The named WARN for an automation pull could not extract (edk#1054, edk#1480). */
|
|
124
|
+
export function droppedAutomationGap(autoBlock, autoLabel, reason) {
|
|
125
|
+
const name = autoBlock.attrs["name"];
|
|
126
|
+
const display = typeof name === "string" && name !== "" ? name : autoLabel;
|
|
127
|
+
return typedCoverageGap({
|
|
128
|
+
kind: "skipped",
|
|
129
|
+
entity: `automation ${JSON.stringify(display)} (${autoLabel})`,
|
|
130
|
+
detail: `not pulled, skipped: ${reason}`,
|
|
131
|
+
consequence: "it is not written to source or adopted; it keeps running on the platform unmanaged",
|
|
132
|
+
});
|
|
133
|
+
}
|
|
104
134
|
function extractAutomations(ownBlocks, stream, ctx) {
|
|
105
135
|
const items = [];
|
|
106
136
|
const skipped = [];
|
|
137
|
+
const releaseIfManaged = [];
|
|
107
138
|
const diagnostics = [];
|
|
139
|
+
const validations = [];
|
|
108
140
|
const adoptionAddressAliases = [];
|
|
109
141
|
for (const autoBlock of ownBlocks) {
|
|
110
142
|
const autoLabel = autoBlock.label ?? "";
|
|
@@ -114,7 +146,7 @@ function extractAutomations(ownBlocks, stream, ctx) {
|
|
|
114
146
|
// (one owned-address walk) relative to from-tf.
|
|
115
147
|
registerForeignObjectIdDeps(doc, autoLabel, ctx);
|
|
116
148
|
try {
|
|
117
|
-
const extracted = automationFromTf(doc, autoLabel, ctx.appRefName, ctx.foreignFieldRefsById, ctx.foreignFieldRefsByDataAddress, ctx.foreignTableRefsById, ctx.picklistOptionLabelById, ctx.fieldNamesByOwnerRefName, ctx.foreignAppRefNames, ctx.foreignElementRefNames, ctx.procedureKeysByDiscriminator, ctx.foreignTaskRefNames);
|
|
149
|
+
const extracted = automationFromTf(doc, autoLabel, ctx.appRefName, ctx.foreignFieldRefsById, ctx.foreignFieldRefsByDataAddress, ctx.foreignTableRefsById, ctx.picklistOptionLabelById, ctx.fieldNamesByOwnerRefName, ctx.foreignAppRefNames, ctx.foreignElementRefNames, ctx.procedureKeysByDiscriminator, ctx.foreignTaskRefNames, ctx.groupKeysByName);
|
|
118
150
|
// Keep automationFromTf's label-derived refName — agent/skill tools store
|
|
119
151
|
// the same scopedLabelToBagKey as automationKey. Pushing bare AST (name
|
|
120
152
|
// only) made missing-automation diagnostics false-positive on every real
|
|
@@ -124,20 +156,68 @@ function extractAutomations(ownBlocks, stream, ctx) {
|
|
|
124
156
|
diagnostics.push(...(extracted.diagnostics ?? []).map((diagnostic) => `${autoLabel}: ${diagnostic}`));
|
|
125
157
|
}
|
|
126
158
|
catch (err) {
|
|
127
|
-
// Multi-trigger is unsupported, not an extract gap.
|
|
128
|
-
//
|
|
129
|
-
|
|
130
|
-
|
|
159
|
+
// Multi-trigger is unsupported, not an extract gap. Collect every
|
|
160
|
+
// offender and keep going. The addresses still go through `skipped` so
|
|
161
|
+
// adoption will not import a graph that was not written, and the
|
|
162
|
+
// message stays out of `diagnostics` (those are warnings).
|
|
163
|
+
if (err instanceof UnsupportedMultiTriggerError) {
|
|
164
|
+
const failure = {
|
|
165
|
+
severity: "fatal",
|
|
166
|
+
address: `${AUTOMATION_RESOURCE_TYPE}.${autoLabel}`,
|
|
167
|
+
name: err.automationName,
|
|
168
|
+
ownerKind: "automation",
|
|
169
|
+
message: err.message,
|
|
170
|
+
};
|
|
171
|
+
validations.push(failure);
|
|
172
|
+
recordValidations([failure]);
|
|
173
|
+
skipped.push(...automationOwnedAddresses(doc, autoLabel));
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
131
176
|
// Report the automation's FULL graph (trigger/tasks/branches/publish),
|
|
132
177
|
// not just its root - otherwise those children's otherwise-adoptable
|
|
133
178
|
// resource TYPES get imported into state anyway, and build (which
|
|
134
179
|
// never wrote this automation to source) can't reproduce them, so
|
|
135
180
|
// `plan` shows them as destroy-on-apply. See automationOwnedAddresses.
|
|
136
|
-
|
|
137
|
-
|
|
181
|
+
const owned = automationOwnedAddresses(doc, autoLabel);
|
|
182
|
+
skipped.push(...owned);
|
|
183
|
+
// A sibling-loop item reference has no authored form at all, so an
|
|
184
|
+
// earlier pull's state binding can never be reproduced either: release
|
|
185
|
+
// it rather than let the next apply destroy the live automation (#1320).
|
|
186
|
+
// That skip is a diagnostic, not a validation fatal: the automation is
|
|
187
|
+
// not printed, so the build must not also report the placeholder.
|
|
188
|
+
if (err instanceof ForEachItemOutsideLoopError)
|
|
189
|
+
releaseIfManaged.push(...owned);
|
|
190
|
+
// edk#1480: name the dropped automation and say what that means, as a
|
|
191
|
+
// typed gap so it counts (and fails --strict-coverage) by itself.
|
|
192
|
+
diagnostics.push(droppedAutomationGap(autoBlock, autoLabel, err instanceof Error ? err.message : String(err)));
|
|
138
193
|
}
|
|
139
194
|
}
|
|
140
|
-
|
|
195
|
+
// A trigger, task, or publish with no automation resource is not in any
|
|
196
|
+
// skeleton's graph. extractAutomations never sees it, and its resource type
|
|
197
|
+
// is still adoptable, so the next plan can destroy it (#1484).
|
|
198
|
+
const doc = { blocks: [...stream.allBlocks] };
|
|
199
|
+
const owned = new Set();
|
|
200
|
+
for (const autoBlock of ownBlocks) {
|
|
201
|
+
if (autoBlock.label === undefined || autoBlock.label === "")
|
|
202
|
+
continue;
|
|
203
|
+
for (const address of automationOwnedAddresses(doc, autoBlock.label))
|
|
204
|
+
owned.add(address);
|
|
205
|
+
}
|
|
206
|
+
for (const block of stream.familyByKind.get("automation") ?? []) {
|
|
207
|
+
if (block.type === undefined || block.label === undefined || !AUTOMATION_MEMBER_TYPES.has(block.type))
|
|
208
|
+
continue;
|
|
209
|
+
const address = `${block.type}.${block.label}`;
|
|
210
|
+
if (owned.has(address))
|
|
211
|
+
continue;
|
|
212
|
+
skipped.push(address);
|
|
213
|
+
reportAuthoringBlocker(ctx, {
|
|
214
|
+
address,
|
|
215
|
+
ownFileKind: "automation",
|
|
216
|
+
description: `${address} is not owned by an ${AUTOMATION_RESOURCE_TYPE} resource, so it cannot be pulled`,
|
|
217
|
+
remedy: "The export is missing the automation these resources belong to. Re-export the app, or remove the orphaned automation resources, then pull again.",
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
return { items, skipped, releaseIfManaged, diagnostics, validations, adoptionAddressAliases };
|
|
141
221
|
}
|
|
142
222
|
export const automationModule = {
|
|
143
223
|
kind: "automation",
|
|
@@ -150,6 +230,9 @@ export const automationModule = {
|
|
|
150
230
|
resource: {
|
|
151
231
|
shape: "composite",
|
|
152
232
|
adoptable: true,
|
|
233
|
+
// An element-owned automation's ref name already carries the handle prefix
|
|
234
|
+
// ei exports and build keeps (`<handle>_<automation>`).
|
|
235
|
+
childLabel: (ownerTfLabel, childTfLabel, scope) => scope === "element" ? childTfLabel : appScopedResourceLabel(ownerTfLabel, childTfLabel),
|
|
153
236
|
members: [
|
|
154
237
|
{ role: "skeleton", resourceType: AUTOMATION_RESOURCE_TYPE, implemented: true },
|
|
155
238
|
{ role: "publish", resourceType: WORKFLOW_PUBLISH_RESOURCE_TYPE, implemented: true },
|
|
@@ -197,6 +280,8 @@ export const automationModule = {
|
|
|
197
280
|
appRefName: opts.appRefName,
|
|
198
281
|
...(opts.foreignAppRefNames !== undefined && { foreignAppRefNames: opts.foreignAppRefNames }),
|
|
199
282
|
...(opts.foreignElementRefNames !== undefined && { foreignElementRefNames: opts.foreignElementRefNames }),
|
|
283
|
+
...(opts.foreignAppRefNamespaces !== undefined && { foreignAppRefNamespaces: opts.foreignAppRefNamespaces }),
|
|
284
|
+
...(opts.foreignElementRefNamespaces !== undefined && { foreignElementRefNamespaces: opts.foreignElementRefNamespaces }),
|
|
200
285
|
...(opts.foreignTaskRefNames !== undefined && { foreignTaskRefNames: opts.foreignTaskRefNames }),
|
|
201
286
|
...(opts.unresolvedReferences !== undefined && { unresolvedReferences: opts.unresolvedReferences }),
|
|
202
287
|
});
|
|
@@ -207,10 +292,16 @@ export const automationModule = {
|
|
|
207
292
|
};
|
|
208
293
|
},
|
|
209
294
|
mergePulledSource: preserveAuthoredAutomationPullMeta,
|
|
295
|
+
isUnbuildablePulledSource: hasUnresolvedForEachItem,
|
|
210
296
|
toTf: (entity, ctx) => automationToTf(entity, {
|
|
211
297
|
appRefName: ctx.appRefName,
|
|
212
298
|
appTfLabel: ctx.appTfLabel,
|
|
213
299
|
parentScope: ctx.parentScope === "element" ? "element" : "app",
|
|
300
|
+
...(ctx.parentScope === "element" ? { ownerHandle: elementOwnerHandle(ctx.streamRootEntity?.payload) } : {}),
|
|
301
|
+
...(ctx.streamRootEntity?.payload?.auditFields === true
|
|
302
|
+
? { ownerAuditFields: true }
|
|
303
|
+
: {}),
|
|
304
|
+
...(ctx.elementsWithoutAuditFields !== undefined ? { elementsWithoutAuditFields: ctx.elementsWithoutAuditFields } : {}),
|
|
214
305
|
diagnostics: ctx.diagnostics,
|
|
215
306
|
fieldAddresses: ctx.fieldAddresses ?? new Map(),
|
|
216
307
|
fieldNames: ctx.fieldNames ?? new Map(),
|
|
@@ -257,8 +348,9 @@ export const automationModule = {
|
|
|
257
348
|
}],
|
|
258
349
|
exportedAttributeLocals: [{
|
|
259
350
|
resourceType: "elementum_variable_task",
|
|
260
|
-
attribute: "
|
|
261
|
-
localPrefix: "
|
|
351
|
+
attribute: "variables",
|
|
352
|
+
localPrefix: "edk_variable_ids_",
|
|
353
|
+
listField: "id",
|
|
262
354
|
}],
|
|
263
355
|
},
|
|
264
356
|
};
|
|
@@ -16,6 +16,13 @@ export declare function outputFieldTypesFromScriptSchema(schema: unknown): Map<s
|
|
|
16
16
|
multiple: boolean;
|
|
17
17
|
kind: string;
|
|
18
18
|
}> | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Top-level output names the schema lists more than once, at both
|
|
21
|
+
* `result.<name>` and `<name>`. Such a name resolves to its first entry
|
|
22
|
+
* everywhere (see outputFieldTypesFromScriptSchema), so an exported
|
|
23
|
+
* envelope type taken from a later entry is not authored intent.
|
|
24
|
+
*/
|
|
25
|
+
export declare function repeatedScriptOutputNames(schema: unknown): ReadonlySet<string>;
|
|
19
26
|
/**
|
|
20
27
|
* A nested result path belongs to its declared top-level object even when the
|
|
21
28
|
* current schema projection does not yet model that object's item properties.
|
|
@@ -58,12 +58,19 @@ export function outputFieldTypesFromScriptSchema(schema) {
|
|
|
58
58
|
: undefined;
|
|
59
59
|
return fieldType === undefined ? undefined : { fieldType, multiple: false, kind };
|
|
60
60
|
};
|
|
61
|
+
// A name the platform stores twice resolves to its FIRST entry, the same
|
|
62
|
+
// one from-tf's decoded `outputs` keeps, so pulled source, ref typing, and
|
|
63
|
+
// workflow-output inference never disagree about a repeated name.
|
|
64
|
+
const seen = new Set();
|
|
61
65
|
for (const property of properties) {
|
|
62
66
|
if (!isObject(property))
|
|
63
67
|
continue;
|
|
64
68
|
for (const body of Object.values(property)) {
|
|
65
69
|
if (!isObject(body) || typeof body.name !== "string")
|
|
66
70
|
continue;
|
|
71
|
+
if (seen.has(body.name))
|
|
72
|
+
continue;
|
|
73
|
+
seen.add(body.name);
|
|
67
74
|
const resolved = nodeType(property);
|
|
68
75
|
if (resolved === undefined)
|
|
69
76
|
continue;
|
|
@@ -73,6 +80,35 @@ export function outputFieldTypesFromScriptSchema(schema) {
|
|
|
73
80
|
}
|
|
74
81
|
return out.size > 0 ? out : undefined;
|
|
75
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Top-level output names the schema lists more than once, at both
|
|
85
|
+
* `result.<name>` and `<name>`. Such a name resolves to its first entry
|
|
86
|
+
* everywhere (see outputFieldTypesFromScriptSchema), so an exported
|
|
87
|
+
* envelope type taken from a later entry is not authored intent.
|
|
88
|
+
*/
|
|
89
|
+
export function repeatedScriptOutputNames(schema) {
|
|
90
|
+
const repeated = new Set();
|
|
91
|
+
if (!isObject(schema))
|
|
92
|
+
return repeated;
|
|
93
|
+
const objectNode = isObject(schema.object) ? schema.object : schema;
|
|
94
|
+
const properties = objectNode.properties;
|
|
95
|
+
if (!Array.isArray(properties))
|
|
96
|
+
return repeated;
|
|
97
|
+
const seen = new Set();
|
|
98
|
+
for (const property of properties) {
|
|
99
|
+
if (!isObject(property))
|
|
100
|
+
continue;
|
|
101
|
+
const body = Object.values(property)[0];
|
|
102
|
+
if (!isObject(body) || typeof body.name !== "string")
|
|
103
|
+
continue;
|
|
104
|
+
if (seen.has(body.name)) {
|
|
105
|
+
repeated.add(body.name);
|
|
106
|
+
repeated.add(`result.${body.name}`);
|
|
107
|
+
}
|
|
108
|
+
seen.add(body.name);
|
|
109
|
+
}
|
|
110
|
+
return repeated;
|
|
111
|
+
}
|
|
76
112
|
/**
|
|
77
113
|
* A nested result path belongs to its declared top-level object even when the
|
|
78
114
|
* current schema projection does not yet model that object's item properties.
|
|
@@ -16,6 +16,15 @@
|
|
|
16
16
|
* either side can never introduce a cycle.
|
|
17
17
|
*/
|
|
18
18
|
export declare const OUTPUT_KEY_WIRE_NAME: Readonly<Record<string, string>>;
|
|
19
|
+
/**
|
|
20
|
+
* CANONICAL reference model: EDK's single-scalar `.output` accessor → the
|
|
21
|
+
* platform's CANONICAL output name (service_tasks), used for a workflow
|
|
22
|
+
* OUTPUT's `taskReference.name` (NOT the refs-map display label in
|
|
23
|
+
* {@link OUTPUT_KEY_WIRE_NAME}). The aiClassify/aiSummarize/aiTransform family's
|
|
24
|
+
* canonical output is `response`. See DESIGN-canonical-reference-model.md;
|
|
25
|
+
* validated against TASK_OUTPUT_CONTRACTS by canonical-reference-model.test.ts.
|
|
26
|
+
*/
|
|
27
|
+
export declare const OUTPUT_KEY_CANONICAL: Readonly<Record<string, string>>;
|
|
19
28
|
/**
|
|
20
29
|
* Compares a raw wire segment against an {@link OUTPUT_KEY_WIRE_NAME} value.
|
|
21
30
|
* The Title-Case wire name above is confirmed against each task's own
|
|
@@ -21,6 +21,19 @@ export const OUTPUT_KEY_WIRE_NAME = {
|
|
|
21
21
|
aiClassify: "Response",
|
|
22
22
|
documentModel: "text",
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* CANONICAL reference model: EDK's single-scalar `.output` accessor → the
|
|
26
|
+
* platform's CANONICAL output name (service_tasks), used for a workflow
|
|
27
|
+
* OUTPUT's `taskReference.name` (NOT the refs-map display label in
|
|
28
|
+
* {@link OUTPUT_KEY_WIRE_NAME}). The aiClassify/aiSummarize/aiTransform family's
|
|
29
|
+
* canonical output is `response`. See DESIGN-canonical-reference-model.md;
|
|
30
|
+
* validated against TASK_OUTPUT_CONTRACTS by canonical-reference-model.test.ts.
|
|
31
|
+
*/
|
|
32
|
+
export const OUTPUT_KEY_CANONICAL = {
|
|
33
|
+
aiSummarize: "response",
|
|
34
|
+
aiTransform: "response",
|
|
35
|
+
aiClassify: "response",
|
|
36
|
+
};
|
|
24
37
|
/**
|
|
25
38
|
* Compares a raw wire segment against an {@link OUTPUT_KEY_WIRE_NAME} value.
|
|
26
39
|
* The Title-Case wire name above is confirmed against each task's own
|
|
@@ -39,6 +39,26 @@ export declare function readScriptFile(ref: ScriptFile): string;
|
|
|
39
39
|
export declare class ScriptCodeError extends Error {
|
|
40
40
|
constructor(message: string);
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* The platform runs a script body as plain JavaScript, so TypeScript-only
|
|
44
|
+
* syntax (`const out: Record<string, string> = {}`, `x as T`, `value!`,
|
|
45
|
+
* `implements`) fails there at runtime. A body that parses as JavaScript,
|
|
46
|
+
* which includes every pulled script, is returned unchanged so it round-trips
|
|
47
|
+
* byte for byte (`f(a < b, c > (d))` stays two comparisons). One that parses
|
|
48
|
+
* only as TypeScript has its types erased by the TypeScript transpiler with an
|
|
49
|
+
* ESNext target, so no syntax is downleveled into helpers; one that parses as
|
|
50
|
+
* neither is refused. `label` names the script in errors. With
|
|
51
|
+
* `stripTypes: false` (script files) a TypeScript body is kept byte for byte
|
|
52
|
+
* so a pulled workflow round-trips. When TypeScript is available, a body that
|
|
53
|
+
* parses as neither JavaScript nor TypeScript is refused. When the TypeScript
|
|
54
|
+
* package cannot be loaded, the stored body is kept so pull can finish,
|
|
55
|
+
* including a body that cannot be classified.
|
|
56
|
+
*/
|
|
57
|
+
export declare function toPlatformScriptBody(body: string, label: string, options?: {
|
|
58
|
+
readonly stripTypes?: boolean;
|
|
59
|
+
/** @internal Test seam for the optional runtime dependency. */
|
|
60
|
+
readonly loadTypeScript?: () => object | undefined;
|
|
61
|
+
}): string;
|
|
42
62
|
/**
|
|
43
63
|
* Extract the platform script body from an authored code function. Accepts the
|
|
44
64
|
* shapes a transpiler emits for `(input) => …`: arrow with block body, arrow
|