@elementumai/edk 0.13.4 → 0.14.0
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/dist-sdk/src/catalog/factories.d.ts +4 -2
- package/dist-sdk/src/catalog/factories.js +3 -1
- package/dist-sdk/src/catalog/from-authoring.d.ts +8 -3
- package/dist-sdk/src/catalog/from-authoring.js +21 -8
- package/dist-sdk/src/engine/build/context.d.ts +17 -0
- package/dist-sdk/src/engine/coverage-gaps.d.ts +10 -0
- package/dist-sdk/src/engine/coverage-gaps.js +16 -0
- package/dist-sdk/src/engine/pull/context.d.ts +56 -0
- package/dist-sdk/src/engine/pull/context.js +8 -0
- package/dist-sdk/src/engine/pull/pulled-roots.d.ts +14 -1
- package/dist-sdk/src/engine/pull/pulled-roots.js +23 -3
- package/dist-sdk/src/engine/pull/ref-only.d.ts +6 -1
- package/dist-sdk/src/engine/pull/ref-only.js +4 -1
- package/dist-sdk/src/engine/pull/stream-root.d.ts +13 -1
- package/dist-sdk/src/engine/pull/stream-root.js +54 -4
- package/dist-sdk/src/engine/validation.d.ts +36 -1
- package/dist-sdk/src/engine/validation.js +56 -2
- package/dist-sdk/src/engine/workspace/loader.d.ts +6 -0
- package/dist-sdk/src/engine/workspace/loader.js +87 -2
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +7 -0
- package/dist-sdk/src/entities/access-policy/from-tf.js +58 -17
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +3 -1
- package/dist-sdk/src/entities/access-policy/to-tf.js +1 -1
- package/dist-sdk/src/entities/agent/build.d.ts +15 -0
- package/dist-sdk/src/entities/agent/build.js +139 -16
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +3 -3
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +39 -25
- package/dist-sdk/src/entities/agent/module.js +95 -3
- package/dist-sdk/src/entities/agent/to-tf.js +6 -4
- package/dist-sdk/src/entities/agent-evaluation/from-tf.d.ts +7 -0
- package/dist-sdk/src/entities/agent-evaluation/from-tf.js +14 -5
- package/dist-sdk/src/entities/agent-evaluation/module.js +4 -2
- package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +11 -2
- package/dist-sdk/src/entities/agent-tool/from-tf.js +38 -40
- package/dist-sdk/src/entities/agent-tool/to-tf.js +12 -5
- package/dist-sdk/src/entities/app/build.d.ts +1 -1
- package/dist-sdk/src/entities/automation/build.d.ts +75 -42
- package/dist-sdk/src/entities/automation/build.js +17 -7
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +14 -2
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +9 -0
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +57 -12
- package/dist-sdk/src/entities/automation/from-tf.d.ts +51 -0
- package/dist-sdk/src/entities/automation/from-tf.js +476 -93
- package/dist-sdk/src/entities/automation/index.d.ts +1 -1
- package/dist-sdk/src/entities/automation/index.js +1 -1
- package/dist-sdk/src/entities/automation/module.js +90 -9
- package/dist-sdk/src/entities/automation/operators.d.ts +6 -2
- package/dist-sdk/src/entities/automation/operators.js +0 -2
- package/dist-sdk/src/entities/automation/task-output-labels.d.ts +8 -0
- package/dist-sdk/src/entities/automation/task-output-labels.js +11 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +37 -2
- package/dist-sdk/src/entities/automation/tasks.js +38 -1
- package/dist-sdk/src/entities/automation/to-tf.d.ts +8 -0
- package/dist-sdk/src/entities/automation/to-tf.js +413 -47
- package/dist-sdk/src/entities/chart/to-tf.js +18 -5
- package/dist-sdk/src/entities/dashboard/from-tf.js +45 -11
- package/dist-sdk/src/entities/dashboard-widget-order/order.d.ts +5 -3
- package/dist-sdk/src/entities/dashboard-widget-order/order.js +6 -4
- package/dist-sdk/src/entities/datamine/from-tf.js +10 -3
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +9 -2
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +35 -7
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +63 -7
- package/dist-sdk/src/entities/element/build.d.ts +4 -1
- package/dist-sdk/src/entities/element/build.js +3 -4
- package/dist-sdk/src/entities/field/from-tf.js +8 -1
- package/dist-sdk/src/entities/field/to-tf.d.ts +29 -2
- package/dist-sdk/src/entities/field/to-tf.js +106 -7
- package/dist-sdk/src/entities/phone-service/from-tf.d.ts +7 -0
- package/dist-sdk/src/entities/phone-service/from-tf.js +15 -7
- package/dist-sdk/src/entities/phone-service/module.js +4 -2
- package/dist-sdk/src/entities/portal/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/portal/to-tf.js +61 -2
- package/dist-sdk/src/entities/record-create-form/from-tf.js +3 -1
- package/dist-sdk/src/entities/relationship/from-tf.js +34 -4
- package/dist-sdk/src/entities/relationship/to-tf.js +24 -6
- package/dist-sdk/src/entities/role/from-tf.js +3 -1
- package/dist-sdk/src/entities/search-table/from-tf.d.ts +3 -1
- package/dist-sdk/src/entities/search-table/from-tf.js +6 -3
- package/dist-sdk/src/entities/search-table/module.js +18 -2
- package/dist-sdk/src/entities/search-table/to-tf.js +10 -16
- package/dist-sdk/src/entities/shared/aspect-target-from-tf.js +6 -1
- package/dist-sdk/src/entities/shared/filters/index.d.ts +6 -1
- package/dist-sdk/src/entities/shared/filters/index.js +8 -2
- package/dist-sdk/src/entities/shared/filters/print.js +18 -7
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +11 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +24 -2
- package/dist-sdk/src/entities/shared/run-automation-requirement.d.ts +15 -0
- package/dist-sdk/src/entities/shared/run-automation-requirement.js +28 -0
- package/dist-sdk/src/entities/shared/search-table-address.d.ts +17 -0
- package/dist-sdk/src/entities/shared/search-table-address.js +24 -0
- package/dist-sdk/src/entities/shared/skip-release.d.ts +49 -0
- package/dist-sdk/src/entities/shared/skip-release.js +74 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +3 -3
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +11 -5
- package/dist-sdk/src/entities/skill/module.js +3 -25
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +4 -2
- package/dist-sdk/src/entities/skill-tool/from-tf.js +28 -27
- package/dist-sdk/src/entities/skill-tool/to-tf.js +12 -5
- package/dist-sdk/src/entities/skill-tool/types.d.ts +1 -0
- package/dist-sdk/src/entities/skill-tool/types.js +2 -1
- package/dist-sdk/src/entities/table/catalog.d.ts +16 -0
- package/dist-sdk/src/entities/table/catalog.js +44 -2
- package/dist-sdk/src/entities/table/from-tf.js +30 -4
- package/dist-sdk/src/entities/table/keys.d.ts +27 -0
- package/dist-sdk/src/entities/table/keys.js +46 -0
- package/dist-sdk/src/entities/table/to-tf.js +2 -2
- package/dist-sdk/src/entities/view/agent-view-layout-from-tf.d.ts +12 -1
- package/dist-sdk/src/entities/view/agent-view-layout-from-tf.js +9 -4
- package/dist-sdk/src/entities/view/agent-view-layout-to-tf.js +215 -10
- package/dist-sdk/src/entities/view/agent-view-layout.d.ts +10 -4
- package/dist-sdk/src/entities/view/custom-view-runtime-rules.d.ts +43 -0
- package/dist-sdk/src/entities/view/custom-view-runtime-rules.js +285 -0
- package/dist-sdk/src/entities/view/custom-view-validate.d.ts +3 -1
- package/dist-sdk/src/entities/view/custom-view-validate.js +24 -5
- package/dist-sdk/src/entities/view/from-tf.js +14 -1
- package/dist-sdk/src/entities/widget/from-tf.js +14 -7
- package/dist-sdk/src/entities/widget/to-tf.js +7 -5
- package/dist-sdk/src/graph/index.d.ts +14 -1
- package/dist-sdk/src/graph/index.js +2 -0
- package/dist-sdk/src/graph/resource-types.d.ts +2 -0
- package/dist-sdk/src/graph/resource-types.js +3 -0
- package/dist-sdk/src/graph/types.d.ts +82 -0
- package/package.json +1 -1
|
@@ -117,6 +117,13 @@ export interface NormalizedAgentTool {
|
|
|
117
117
|
readonly handleDescription?: string;
|
|
118
118
|
/** executeWorkflow: the target automation's bag key (bijective image of its tf label). */
|
|
119
119
|
readonly automationKey?: string;
|
|
120
|
+
/**
|
|
121
|
+
* executeWorkflow: how the live tool is out of step with its automation in
|
|
122
|
+
* the export (a required parameter it doesn't map, an output the
|
|
123
|
+
* automation doesn't declare; edk#3230, #3231). The printer widens the
|
|
124
|
+
* automation ref for such a tool so the pulled file typechecks.
|
|
125
|
+
*/
|
|
126
|
+
readonly staleMappings?: readonly string[];
|
|
120
127
|
readonly inputs?: readonly NormalizedExecuteWorkflowInput[];
|
|
121
128
|
readonly outputs?: readonly NormalizedExecuteWorkflowOutput[];
|
|
122
129
|
/** Search-table bag key when the table is a pulled resource. */
|
|
@@ -156,7 +163,9 @@ export interface ToolOwner {
|
|
|
156
163
|
readonly agentLabel: string;
|
|
157
164
|
}
|
|
158
165
|
/**
|
|
159
|
-
* One tool block → its normalized shape; undefined = skipped
|
|
160
|
-
*
|
|
166
|
+
* One tool block → its normalized shape; undefined = skipped (unimplemented
|
|
167
|
+
* sub-type, wrong owner, unresolvable target). A tool written to no source
|
|
168
|
+
* is also left out of adoption, or released if state has it, so the next
|
|
169
|
+
* plan doesn't destroy it (edk#3172); skipAndRelease does both.
|
|
161
170
|
*/
|
|
162
171
|
export declare function toolFromTf(block: TfBlock, owner: ToolOwner, ctx: FromTfContext): NormalizedAgentTool | undefined;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { EntityTfError } from "../../engine/entity.js";
|
|
8
8
|
import { dataRefLabel, optionalString, resourceRefLabel } from "../../engine/pull/context.js";
|
|
9
9
|
import { isTfExpr, sanitizeName, scopedLabelToBagKey, scopedResourceLabel, tfLabelToTsLabel, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
10
|
+
import { skipAndRelease, unresolvedReferenceName } from "../shared/skip-release.js";
|
|
10
11
|
import { droppedToolFieldDiagnostic, resolveToolFieldKey } from "../shared/tool-field-ref.js";
|
|
11
12
|
import { dataAspectDisplayName } from "../shared/aspect-target-from-tf.js";
|
|
12
13
|
import { KNOWN_TOOL_ATTRS, TOOL_SUB_TYPE_BY_RESOURCE } from "./types.js";
|
|
@@ -50,13 +51,16 @@ function runAsFromTf(attrs, owner, where, ctx) {
|
|
|
50
51
|
return undefined;
|
|
51
52
|
}
|
|
52
53
|
/**
|
|
53
|
-
* One tool block → its normalized shape; undefined = skipped
|
|
54
|
-
*
|
|
54
|
+
* One tool block → its normalized shape; undefined = skipped (unimplemented
|
|
55
|
+
* sub-type, wrong owner, unresolvable target). A tool written to no source
|
|
56
|
+
* is also left out of adoption, or released if state has it, so the next
|
|
57
|
+
* plan doesn't destroy it (edk#3172); skipAndRelease does both.
|
|
55
58
|
*/
|
|
56
59
|
export function toolFromTf(block, owner, ctx) {
|
|
57
60
|
const subType = TOOL_SUB_TYPE_BY_RESOURCE.get(block.type ?? "");
|
|
58
61
|
if (subType === undefined) {
|
|
59
|
-
|
|
62
|
+
const fallback = `resource "${block.type}" is not a known agent tool resource; skipped`;
|
|
63
|
+
skipAndRelease(ctx, `${block.type}.${block.label ?? ""}`, { problem: "its resource type is not an agent tool pull knows" }, fallback);
|
|
60
64
|
return undefined;
|
|
61
65
|
}
|
|
62
66
|
const label = block.label;
|
|
@@ -66,11 +70,19 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
66
70
|
const attrs = block.attrs;
|
|
67
71
|
const name = optionalString(attrs, "name", `tool "${label}"`, ctx) ?? "";
|
|
68
72
|
const where = `agent tool "${name}" (${block.type}.${label})`;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
const address = `${block.type}.${label}`;
|
|
74
|
+
const skipReference = (attribute, value, fallback) => {
|
|
75
|
+
skipAndRelease(ctx, address, { reference: unresolvedReferenceName(value, attribute) }, fallback);
|
|
76
|
+
return undefined;
|
|
77
|
+
};
|
|
78
|
+
const skipProblem = (problem, fallback) => {
|
|
79
|
+
skipAndRelease(ctx, address, { problem }, fallback);
|
|
73
80
|
return undefined;
|
|
81
|
+
};
|
|
82
|
+
if (subType.implemented !== true) {
|
|
83
|
+
return subType.typeKey === "selectBotRoute"
|
|
84
|
+
? skipProblem("select-bot-route is a platform-internal Nexus routing tool and is not part of the public EDK", `${where}: select-bot-route is a platform-internal Nexus routing tool and is not part of the public EDK; skipped`)
|
|
85
|
+
: skipProblem("its tool kind is not supported yet", `${where}: tool kind is not supported on the terraform path yet; skipped`);
|
|
74
86
|
}
|
|
75
87
|
const known = KNOWN_TOOL_ATTRS[subType.typeKey];
|
|
76
88
|
for (const key of Object.keys(attrs)) {
|
|
@@ -83,7 +95,7 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
83
95
|
return undefined;
|
|
84
96
|
}
|
|
85
97
|
if (subType.typeKey === "executeWorkflow") {
|
|
86
|
-
return executeWorkflowFromTf(block, name, where, owner, ctx);
|
|
98
|
+
return executeWorkflowFromTf(block, name, where, owner, ctx, skipReference);
|
|
87
99
|
}
|
|
88
100
|
const startMessage = optionalString(attrs, "start_message", where, ctx);
|
|
89
101
|
const runAs = runAsFromTf(attrs, owner, where, ctx);
|
|
@@ -96,13 +108,11 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
96
108
|
if (subType.typeKey === "runAgent") {
|
|
97
109
|
const targetLabel = resourceRefLabel(attrs["target_agent_id"], "elementum_agent");
|
|
98
110
|
if (targetLabel === undefined) {
|
|
99
|
-
|
|
100
|
-
return undefined;
|
|
111
|
+
return skipReference("target_agent_id", attrs["target_agent_id"], `${where}: target_agent_id is not an elementum_agent resource reference; skipped`);
|
|
101
112
|
}
|
|
102
113
|
const targetAgentKey = scopedLabelToBagKey(owner.ownerTfLabel, targetLabel);
|
|
103
114
|
if (scopedResourceLabel(owner.ownerTfLabel, tsLabelToTfLabel(targetAgentKey), "app") !== targetLabel) {
|
|
104
|
-
|
|
105
|
-
return undefined;
|
|
115
|
+
return skipProblem(`its target agent elementum_agent.${targetLabel} is in another app, which a run-agent tool can't target`, `${where}: cross-app run-agent targets are not supported; skipped`);
|
|
106
116
|
}
|
|
107
117
|
return {
|
|
108
118
|
typeKey: "runAgent",
|
|
@@ -115,8 +125,7 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
115
125
|
const serverUrl = optionalString(attrs, "server_url", where, ctx);
|
|
116
126
|
const mcpToolName = optionalString(attrs, "mcp_tool_name", where, ctx);
|
|
117
127
|
if (serverUrl === undefined || serverUrl === "" || mcpToolName === undefined || mcpToolName === "") {
|
|
118
|
-
|
|
119
|
-
return undefined;
|
|
128
|
+
return skipProblem("the export gives it no server_url or mcp_tool_name", `${where}: server_url or mcp_tool_name is missing; skipped`);
|
|
120
129
|
}
|
|
121
130
|
const headers = [];
|
|
122
131
|
const rawHeaders = attrs["headers"];
|
|
@@ -155,12 +164,11 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
155
164
|
let fieldScope = "app";
|
|
156
165
|
if (targetAttr === undefined) {
|
|
157
166
|
if (subType.typeKey !== "searchTable") {
|
|
158
|
-
|
|
159
|
-
return undefined;
|
|
167
|
+
return skipProblem("the export gives it no target_id", `${where}: target_id is missing; skipped`);
|
|
160
168
|
}
|
|
161
169
|
}
|
|
162
170
|
else {
|
|
163
|
-
const resolved = aspectTargetFromTf(targetAttr, "target_id", owner, ctx, where);
|
|
171
|
+
const resolved = aspectTargetFromTf(targetAttr, "target_id", owner, ctx, where, skipReference);
|
|
164
172
|
if (resolved === undefined)
|
|
165
173
|
return undefined;
|
|
166
174
|
target = resolved.target;
|
|
@@ -333,8 +341,7 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
333
341
|
}
|
|
334
342
|
}
|
|
335
343
|
if (searchTableName === undefined) {
|
|
336
|
-
|
|
337
|
-
return undefined;
|
|
344
|
+
return skipReference("search_table_id", value, `${where}: search_table_id references data.${value.type}.${value.label} without a matching name lookup; skipped`);
|
|
338
345
|
}
|
|
339
346
|
}
|
|
340
347
|
else if (typeof value === "string" && value !== "") {
|
|
@@ -352,14 +359,13 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
352
359
|
searchTableRawId = value;
|
|
353
360
|
}
|
|
354
361
|
else {
|
|
355
|
-
|
|
356
|
-
return undefined;
|
|
362
|
+
return skipReference("search_table_id", value, `${where}: search_table_id is not a supported search-table reference; skipped`);
|
|
357
363
|
}
|
|
358
364
|
}
|
|
359
365
|
let relatedTarget;
|
|
360
366
|
if (subType.typeKey === "relateRecord") {
|
|
361
367
|
const relatedAttr = attrs["related_target_id"];
|
|
362
|
-
const resolved = aspectTargetFromTf(relatedAttr, "related_target_id", owner, ctx, where);
|
|
368
|
+
const resolved = aspectTargetFromTf(relatedAttr, "related_target_id", owner, ctx, where, skipReference);
|
|
363
369
|
if (resolved === undefined)
|
|
364
370
|
return undefined;
|
|
365
371
|
relatedTarget = resolved.target;
|
|
@@ -393,11 +399,9 @@ export function toolFromTf(block, owner, ctx) {
|
|
|
393
399
|
...(searchTableRawId !== undefined && { searchTableRawId }),
|
|
394
400
|
};
|
|
395
401
|
}
|
|
396
|
-
function aspectTargetFromTf(value, attrName, owner, ctx, where) {
|
|
397
|
-
if (value === undefined)
|
|
398
|
-
|
|
399
|
-
return undefined;
|
|
400
|
-
}
|
|
402
|
+
function aspectTargetFromTf(value, attrName, owner, ctx, where, skip) {
|
|
403
|
+
if (value === undefined)
|
|
404
|
+
return skip(attrName, value, `${where}: ${attrName} is missing; skipped`);
|
|
401
405
|
if (owner.appLabel !== undefined && resourceRefLabel(value, owner.appType) === owner.appLabel) {
|
|
402
406
|
return { target: { kind: "self" }, fieldScopeLabel: owner.ownerTfLabel, fieldScope: "app" };
|
|
403
407
|
}
|
|
@@ -410,8 +414,7 @@ function aspectTargetFromTf(value, attrName, owner, ctx, where) {
|
|
|
410
414
|
continue;
|
|
411
415
|
const name = dataAspectDisplayName(ctx, scope, value.label);
|
|
412
416
|
if (name === undefined) {
|
|
413
|
-
|
|
414
|
-
return undefined;
|
|
417
|
+
return skip(attrName, value, `${where}: ${attrName} references data.${type}.${value.label} but the stream has no such data block; skipped`);
|
|
415
418
|
}
|
|
416
419
|
return { target: { kind, name }, fieldScopeLabel: value.label, fieldScope: scope };
|
|
417
420
|
}
|
|
@@ -422,8 +425,7 @@ function aspectTargetFromTf(value, attrName, owner, ctx, where) {
|
|
|
422
425
|
ctx.diagnostics.push(`${where}: ${attrName} could not be resolved to a portable reference ("${value}"); kept as unresolved`);
|
|
423
426
|
return { target: { kind: "unresolved", uuid: value }, fieldScopeLabel: owner.ownerTfLabel, fieldScope: "app" };
|
|
424
427
|
}
|
|
425
|
-
|
|
426
|
-
return undefined;
|
|
428
|
+
return skip(attrName, value, `${where}: ${attrName} has an unrecognized shape (${JSON.stringify(value)}); skipped`);
|
|
427
429
|
}
|
|
428
430
|
/**
|
|
429
431
|
* Run-automation (executeWorkflow) tool extraction. `automation_id` may
|
|
@@ -431,7 +433,7 @@ function aspectTargetFromTf(value, attrName, owner, ctx, where) {
|
|
|
431
433
|
* generated after the automation's, and both carry the same platform id) or
|
|
432
434
|
* the automation resource itself; both labels are the automation's.
|
|
433
435
|
*/
|
|
434
|
-
function executeWorkflowFromTf(block, name, where, owner, ctx) {
|
|
436
|
+
function executeWorkflowFromTf(block, name, where, owner, ctx, skip) {
|
|
435
437
|
const attrs = block.attrs;
|
|
436
438
|
const autoRef = attrs["automation_id"];
|
|
437
439
|
const autoLabel = isTfExpr(autoRef) &&
|
|
@@ -440,14 +442,10 @@ function executeWorkflowFromTf(block, name, where, owner, ctx) {
|
|
|
440
442
|
? autoRef.label
|
|
441
443
|
: undefined;
|
|
442
444
|
if (autoLabel === undefined) {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
ctx.skipped.push(`${block.type}.${block.label}`);
|
|
448
|
-
ctx.releaseIfManaged?.push(`${block.type}.${block.label}`);
|
|
449
|
-
}
|
|
450
|
-
return undefined;
|
|
445
|
+
// A raw id (the export left the automation out, #2525) or another app's
|
|
446
|
+
// automation (data.elementum_automation): no source can manage the tool,
|
|
447
|
+
// so it is left out of adoption, or released, rather than destroyed.
|
|
448
|
+
return skip("automation_id", autoRef, `${where}: automation_id is not an automation/workflow_publish resource reference (${JSON.stringify(autoRef)}); skipped`);
|
|
451
449
|
}
|
|
452
450
|
const inputs = [];
|
|
453
451
|
for (const item of Array.isArray(attrs["inputs"]) ? attrs["inputs"] : []) {
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
import { workspaceAspectKey } from "../../engine/build/context.js";
|
|
16
16
|
import { EntityTfError } from "../../engine/entity.js";
|
|
17
17
|
import { automationRunTargetResourceAttr } from "../automation/run-target.js";
|
|
18
|
-
import { appScopedResourceLabel, collisionLabelSuffixes, expr, sanitizeName,
|
|
19
|
-
import {
|
|
18
|
+
import { appScopedResourceLabel, collisionLabelSuffixes, expr, sanitizeName, stableIdSuffix, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
19
|
+
import { fieldRefToTfValue, siblingFieldOwnership, } from "../field/to-tf.js";
|
|
20
20
|
import { foreignFieldDataLabel } from "../shared/foreign-ref.js";
|
|
21
|
+
import { localSearchTableLabel } from "../shared/search-table-address.js";
|
|
21
22
|
import { encodeOptionalHandleDescription } from "../shared/handle-description.js";
|
|
22
23
|
import { TOOL_SUB_TYPE_BY_TYPE_KEY } from "./types.js";
|
|
23
24
|
function serviceAccountIdValue(token, where, ctx) {
|
|
@@ -70,7 +71,9 @@ function resolveTarget(token, ctx) {
|
|
|
70
71
|
refName,
|
|
71
72
|
kind,
|
|
72
73
|
localTfLabel: sibling.tfLabel,
|
|
73
|
-
|
|
74
|
+
// Each field resolves to the address the sibling's own build gives it,
|
|
75
|
+
// whatever type the reference carries (#3088).
|
|
76
|
+
fieldOwnership: siblingFieldOwnership(sibling.streamRootEntity?.payload, sibling.tfLabel, kind),
|
|
74
77
|
};
|
|
75
78
|
}
|
|
76
79
|
// ei derives foreign-app/foreign-element data labels from the display NAME.
|
|
@@ -159,7 +162,7 @@ function fieldRefValue(token, where, ctx, target) {
|
|
|
159
162
|
// vs. real field resource, by authoring type) rather than reimplementing
|
|
160
163
|
// it here — see fieldRefToTfValue's doc comment for the system-field
|
|
161
164
|
// ordering rationale.
|
|
162
|
-
const value = fieldRefToTfValue(token.fieldType ?? "", refName, target?.localTfLabel ?? ctx.appTfLabel, target?.kind === "element" ? "element" : "app", target?.fieldOwnership);
|
|
165
|
+
const value = fieldRefToTfValue(token.fieldType ?? "", refName, target?.localTfLabel ?? ctx.appTfLabel, target?.kind === "element" ? "element" : "app", target?.fieldOwnership, undefined, token.name);
|
|
163
166
|
if (value === undefined) {
|
|
164
167
|
ctx.diagnostics.push(`${where}: field token "${refName}" has no terraform field resource mapping (fieldType ${JSON.stringify(token.fieldType ?? "")}); dropped`);
|
|
165
168
|
}
|
|
@@ -497,7 +500,11 @@ export function toolToTf(entry, ctx) {
|
|
|
497
500
|
: table.__variant === "table"
|
|
498
501
|
? "elementum_table_search_table"
|
|
499
502
|
: "elementum_ai_search_table";
|
|
500
|
-
attrs["search_table_id"] = expr.resourceAttr(resourceType,
|
|
503
|
+
attrs["search_table_id"] = expr.resourceAttr(resourceType, localSearchTableLabel(where, { refName: table.refName ?? "", ...(table.name !== undefined && { name: table.name }) }, {
|
|
504
|
+
refName: target.refName,
|
|
505
|
+
tfLabel: target.localTfLabel,
|
|
506
|
+
scope: target.kind === "element" ? "element" : "app",
|
|
507
|
+
}), ["id"]);
|
|
501
508
|
}
|
|
502
509
|
else {
|
|
503
510
|
const lookupLabel = sanitizeName(`${target.foreignTfLabel}_${table.name ?? table.refName}`);
|
|
@@ -516,7 +516,7 @@ interface AppV2OptionsBase<F extends Record<string, AppField> = Record<string, A
|
|
|
516
516
|
readonly lockStages?: boolean;
|
|
517
517
|
/** Automatic record sharing toggles. Omit to leave the platform setting untouched. */
|
|
518
518
|
readonly autoShare?: AutoShareOptions;
|
|
519
|
-
/** Fields keyed by ref name.
|
|
519
|
+
/** Fields keyed by ref name. `app()` needs at least one entry here or a `systemFields` override. */
|
|
520
520
|
readonly fields: F;
|
|
521
521
|
/**
|
|
522
522
|
* Overrides for the platform's auto-provisioned system fields (ID, Title,
|
|
@@ -36,7 +36,7 @@ export interface NestedActionEntry {
|
|
|
36
36
|
readonly name: string;
|
|
37
37
|
readonly def: ActionDef<unknown>;
|
|
38
38
|
/** Display name distinct from `refKey` (`name`), when adopting a platform-authored task. */
|
|
39
|
-
readonly displayName?: string;
|
|
39
|
+
readonly displayName?: string | null;
|
|
40
40
|
readonly hclParent?: string;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
@@ -191,10 +191,43 @@ export type NestedActionContext<TTrigger, TActions extends Record<string, unknow
|
|
|
191
191
|
type BuilderActionOptions<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem, TOptions> = TOptions | ((ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => TOptions);
|
|
192
192
|
type BuilderMode = "root" | "nested";
|
|
193
193
|
type WithAction<TMode extends BuilderMode, TItem, TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TName extends string, TOutput> = FluentActionBuilder<TMode, TItem, TTrigger, Simplify<TActions & Record<TName, TOutput>>, TVars>;
|
|
194
|
+
/**
|
|
195
|
+
* The optional third argument of every step method: the step's name as the
|
|
196
|
+
* platform shows it, when it differs from the step's key (the first argument).
|
|
197
|
+
* Omit it and the step is named after its key.
|
|
198
|
+
*
|
|
199
|
+
* `null` is for steps pulled without a name: the platform holds a step with no
|
|
200
|
+
* name, and pull prints `null` so build leaves the name out and the plan after
|
|
201
|
+
* the pull stays clean (edk#3191). Don't use it for a new step. The platform
|
|
202
|
+
* names a new step itself (an If step "Conditional", a variable step
|
|
203
|
+
* "Variable Management"); every later plan then proposes clearing that name,
|
|
204
|
+
* which the platform ignores, and a new calculation step fails to apply
|
|
205
|
+
* (its create reads the step back and gets the platform's name). Pull the app
|
|
206
|
+
* again to take the platform's name.
|
|
207
|
+
*
|
|
208
|
+
* A step pulled with `null` is also a new step whenever the source creates it:
|
|
209
|
+
* when it is applied where the step doesn't exist yet (another org or
|
|
210
|
+
* environment, a copy of the app), or when the plan replaces it (a step is
|
|
211
|
+
* replaced when the step before it is created or replaced). Give it a name
|
|
212
|
+
* before applying it anywhere it doesn't exist yet.
|
|
213
|
+
*
|
|
214
|
+
* The platform can also name an If step that has none when one of its cases is
|
|
215
|
+
* added or changed (it took the case's label on a local stack); pull again to
|
|
216
|
+
* take that name.
|
|
217
|
+
*
|
|
218
|
+
* On `unimplementedTask`, `null` looks the unsupported step up by its key, not
|
|
219
|
+
* as a step without a name (pull never prints `null` for one).
|
|
220
|
+
*/
|
|
221
|
+
type StepDisplayName = string | null;
|
|
194
222
|
/**
|
|
195
223
|
* An automation body with a trigger set. Every implemented platform action is
|
|
196
224
|
* exposed as a direct method; there is intentionally no generic escape hatch.
|
|
197
225
|
* Options may be passed directly or returned from a typed context callback.
|
|
226
|
+
*
|
|
227
|
+
* Every step method takes `(key, options, displayName?, hclParent?)`. The key
|
|
228
|
+
* names the step in `ctx.actions` and is its name on the platform unless
|
|
229
|
+
* `displayName` says otherwise; see {@link StepDisplayName} for `null`, which
|
|
230
|
+
* marks a step pulled without a name.
|
|
198
231
|
*/
|
|
199
232
|
interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown> = EmptyObject, TMode extends BuilderMode = "root", TItem = never> {
|
|
200
233
|
/**
|
|
@@ -223,7 +256,7 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
|
|
|
223
256
|
readonly inputs?: (ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => I;
|
|
224
257
|
readonly code: ScriptFile;
|
|
225
258
|
readonly outputs: O;
|
|
226
|
-
}, displayName?:
|
|
259
|
+
}, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
227
260
|
result: ExecuteScriptOutput<O>["result"];
|
|
228
261
|
textResult: string;
|
|
229
262
|
stringArrayResult: readonly string[];
|
|
@@ -239,7 +272,7 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
|
|
|
239
272
|
readonly inputs?: (ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => I;
|
|
240
273
|
readonly code: ScriptFile;
|
|
241
274
|
readonly outputs?: ScriptOutputs | null;
|
|
242
|
-
}, displayName?:
|
|
275
|
+
}, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
243
276
|
result: Record<string, unknown>;
|
|
244
277
|
textResult: string;
|
|
245
278
|
stringArrayResult: readonly string[];
|
|
@@ -257,7 +290,7 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
|
|
|
257
290
|
* the option infers from the code body.
|
|
258
291
|
*/
|
|
259
292
|
readonly outputs?: ScriptOutputs | null;
|
|
260
|
-
}, displayName?:
|
|
293
|
+
}, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
261
294
|
result: R;
|
|
262
295
|
textResult: string;
|
|
263
296
|
stringArrayResult: readonly string[];
|
|
@@ -278,52 +311,52 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
|
|
|
278
311
|
readonly value: (ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => ValueOrRef<unknown>;
|
|
279
312
|
/** Platform variable type (default "TEXT"). */
|
|
280
313
|
readonly type?: TType;
|
|
281
|
-
}, displayName?:
|
|
282
|
-
setVariable<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SetVariableOptions>, displayName?:
|
|
283
|
-
recordSearch<TName extends string, A extends AppOrElementOrTaskRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RecordSearchOptions<A>>, displayName?:
|
|
284
|
-
tableRecordsSearch<TName extends string, A extends AppOrElementRef = AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").TableRecordsSearchOptions<A>>, displayName?:
|
|
285
|
-
createRecord<TName extends string, A extends AppOrElementOrTaskRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").CreateRecordOptions<A>>, displayName?:
|
|
286
|
-
updateField<TName extends string, A extends AppOrElementOrTaskRef, const Fields extends readonly import("./tasks.js").FieldAssignment[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UpdateFieldOptions<A, Fields>>, displayName?:
|
|
314
|
+
}, displayName?: StepDisplayName, hclParent?: "trigger" | string): FluentActionBuilder<TMode, TItem, TTrigger, Simplify<TActions & Record<TName, Record<string, never>>>, Simplify<TVars & Record<TName, VariableValueOf<TType>>>>;
|
|
315
|
+
setVariable<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SetVariableOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
316
|
+
recordSearch<TName extends string, A extends AppOrElementOrTaskRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RecordSearchOptions<A>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").RecordSearchOutput<A>>;
|
|
317
|
+
tableRecordsSearch<TName extends string, A extends AppOrElementRef = AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").TableRecordsSearchOptions<A>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").TableRecordsSearchOutput<A>>;
|
|
318
|
+
createRecord<TName extends string, A extends AppOrElementOrTaskRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").CreateRecordOptions<A>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CreateRecordOutput<A>>;
|
|
319
|
+
updateField<TName extends string, A extends AppOrElementOrTaskRef, const Fields extends readonly import("./tasks.js").FieldAssignment[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UpdateFieldOptions<A, Fields>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
287
320
|
record: RecordShape<A>;
|
|
288
321
|
}>;
|
|
289
|
-
bulkUpdateFields<TName extends string, A extends AppOrElementOrTaskRef, const Fields extends readonly import("./tasks.js").FieldAssignment[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").BulkUpdateFieldsOptions<A, Fields>>, displayName?:
|
|
290
|
-
findRelatedRecords<TName extends string, A extends AppOrElementOrTaskRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").FindRelatedRecordsOptions<A>>, displayName?:
|
|
291
|
-
relateRecords<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RelateRecordsOptions>, displayName?:
|
|
292
|
-
sendEmail<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SendEmailOptions>, displayName?:
|
|
293
|
-
postComment<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").PostCommentOptions>, displayName?:
|
|
294
|
-
notification<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").NotificationOptions>, displayName?:
|
|
295
|
-
aiAgent<TName extends string, const S extends Record<string, import("./tasks.js").AiAgentOutputField> | undefined = undefined>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiAgentOptions<S>>, displayName?:
|
|
296
|
-
aiClassify<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiClassifyOptions>, displayName?:
|
|
322
|
+
bulkUpdateFields<TName extends string, A extends AppOrElementOrTaskRef, const Fields extends readonly import("./tasks.js").FieldAssignment[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").BulkUpdateFieldsOptions<A, Fields>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").BulkUpdateFieldsOutput>;
|
|
323
|
+
findRelatedRecords<TName extends string, A extends AppOrElementOrTaskRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").FindRelatedRecordsOptions<A>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").FindRelatedRecordsOutput<A>>;
|
|
324
|
+
relateRecords<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RelateRecordsOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
325
|
+
sendEmail<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SendEmailOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
326
|
+
postComment<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").PostCommentOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
327
|
+
notification<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").NotificationOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
328
|
+
aiAgent<TName extends string, const S extends Record<string, import("./tasks.js").AiAgentOutputField> | undefined = undefined>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiAgentOptions<S>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").AiAgentOutput<S>>;
|
|
329
|
+
aiClassify<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiClassifyOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
297
330
|
output: unknown;
|
|
298
331
|
}>;
|
|
299
|
-
aiSummarize<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiSummarizeOptions>, displayName?:
|
|
332
|
+
aiSummarize<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiSummarizeOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
300
333
|
output: unknown;
|
|
301
334
|
}>;
|
|
302
|
-
aiTransform<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiTransformOptions>, displayName?:
|
|
303
|
-
aiSearchTable<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiSearchTableOptions>, displayName?:
|
|
304
|
-
aiFileAnalysis<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiFileAnalysisOptions>, displayName?:
|
|
335
|
+
aiTransform<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiTransformOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, Record<string, unknown>>;
|
|
336
|
+
aiSearchTable<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiSearchTableOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").AiSearchTableOutput>;
|
|
337
|
+
aiFileAnalysis<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiFileAnalysisOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
305
338
|
output: unknown;
|
|
306
339
|
}>;
|
|
307
|
-
apiRequest<TName extends string, R extends import("./tasks.js").ApiResponseType = "JSON">(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApiRequestOptions<R>>, displayName?:
|
|
308
|
-
calculation<TName extends string, const Values extends import("./tasks.js").CalculationValues>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").CalculationOptions<Values>>, displayName?:
|
|
309
|
-
calculation<TName extends string, const Entries extends readonly import("./tasks.js").CalculationEntry[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").LegacyCalculationOptions<Entries>>, displayName?:
|
|
310
|
-
procedure<TName extends string, const Parameters extends readonly import("../../catalog/types.js").ProcedureParameterType[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").TypedProcedureOptions<Parameters>>, displayName?:
|
|
311
|
-
procedure<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").LegacyProcedureOptions>, displayName?:
|
|
312
|
-
runAutomation<TName extends string, const O extends import("./tasks.js").RunAutomationStaticOptions<AutomationCatalogRef> | import("./tasks.js").RunAutomationDynamicReferenceOptions<readonly string[] | undefined>>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, O>, displayName?:
|
|
313
|
-
readFile<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ReadFileOptions>, displayName?:
|
|
314
|
-
approvalChain<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApprovalChainOptions>, displayName?:
|
|
315
|
-
approvalStatusUpdate<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApprovalStatusUpdateOptions>, displayName?:
|
|
316
|
-
addWatcher<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AddWatcherOptions>, displayName?:
|
|
317
|
-
saveAttachment<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SaveAttachmentOptions>, displayName?:
|
|
318
|
-
unzip<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UnzipOptions>, displayName?:
|
|
319
|
-
userSearch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UserSearchOptions>, displayName?:
|
|
320
|
-
userGroupSearch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UserGroupSearchOptions>, displayName?:
|
|
321
|
-
initiateCall<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").InitiateCallOptions>, displayName?:
|
|
322
|
-
recordFieldLocking<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RecordFieldLockingOptions>, displayName?:
|
|
323
|
-
unimplementedTask<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UnimplementedTaskOptions>, displayName?:
|
|
324
|
-
forEach<TName extends string, TForEachItem>(name: TName, opts: ForEachConfig<TTrigger, TActions, TVars, TItem, TForEachItem, TName>, displayName?:
|
|
325
|
-
switch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, SwitchConfig<TTrigger, TActions, TVars, TItem>>, displayName?:
|
|
326
|
-
forkJoin<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, ForkJoinConfig<TTrigger, TActions, TVars, TItem>>, displayName?:
|
|
340
|
+
apiRequest<TName extends string, R extends import("./tasks.js").ApiResponseType = "JSON">(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApiRequestOptions<R>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").ApiRequestOutputs<R>>;
|
|
341
|
+
calculation<TName extends string, const Values extends import("./tasks.js").CalculationValues>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").CalculationOptions<Values>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CalculationValueOutputs<Values>>;
|
|
342
|
+
calculation<TName extends string, const Entries extends readonly import("./tasks.js").CalculationEntry[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").LegacyCalculationOptions<Entries>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CalculationOutputs<Entries>>;
|
|
343
|
+
procedure<TName extends string, const Parameters extends readonly import("../../catalog/types.js").ProcedureParameterType[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").TypedProcedureOptions<Parameters>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, Record<string, unknown>>;
|
|
344
|
+
procedure<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").LegacyProcedureOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, Record<string, unknown>>;
|
|
345
|
+
runAutomation<TName extends string, const O extends import("./tasks.js").RunAutomationStaticOptions<AutomationCatalogRef> | import("./tasks.js").RunAutomationDynamicReferenceOptions<readonly string[] | undefined>>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, O>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").RunAutomationStepResult<O>>;
|
|
346
|
+
readFile<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ReadFileOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, Record<string, unknown>>;
|
|
347
|
+
approvalChain<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApprovalChainOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
348
|
+
approvalStatusUpdate<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApprovalStatusUpdateOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
349
|
+
addWatcher<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AddWatcherOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
350
|
+
saveAttachment<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SaveAttachmentOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
351
|
+
unzip<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UnzipOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
352
|
+
userSearch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UserSearchOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").UserSearchOutput>;
|
|
353
|
+
userGroupSearch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UserGroupSearchOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").UserGroupSearchOutput>;
|
|
354
|
+
initiateCall<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").InitiateCallOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
355
|
+
recordFieldLocking<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RecordFieldLockingOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
356
|
+
unimplementedTask<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UnimplementedTaskOptions>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
357
|
+
forEach<TName extends string, TForEachItem>(name: TName, opts: ForEachConfig<TTrigger, TActions, TVars, TItem, TForEachItem, TName>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, ForEachOutput>;
|
|
358
|
+
switch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, SwitchConfig<TTrigger, TActions, TVars, TItem>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
359
|
+
forkJoin<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, ForkJoinConfig<TTrigger, TActions, TVars, TItem>>, displayName?: StepDisplayName, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
327
360
|
}
|
|
328
361
|
/** Internal finalizer returned by every operator-body builder. */
|
|
329
362
|
export interface NestedActionChain {
|
|
@@ -40,7 +40,7 @@ import { serializeNode } from "./serialize.js";
|
|
|
40
40
|
// automations call the direct fluent methods declared on ActionBuilder.
|
|
41
41
|
import * as operatorFactories from "./operators.js";
|
|
42
42
|
import * as actionFactories from "./tasks.js";
|
|
43
|
-
import { AI_SEARCH_TABLE_OUTPUT_NAMES, TRIGGER_WHOLE_RECORD_MARKER, TRIGGER_WHOLE_RECORD_REF_NAME, USER_SEARCH_REF_WIRE_NAMES, WHOLE_RECORD_REF_WIRE_NAMES, } from "./task-output-labels.js";
|
|
43
|
+
import { AI_SEARCH_TABLE_OUTPUT_NAMES, TRIGGER_WHOLE_RECORD_MARKER, TRIGGER_WHOLE_RECORD_REF_NAME, USER_SEARCH_REF_WIRE_NAMES, WHOLE_RECORD_REF_WIRE_NAMES, ATTACHMENT_WHOLE_RECORD_REF_WIRE_NAMES, } from "./task-output-labels.js";
|
|
44
44
|
import { isWorkflowOutputDeclaration, workflowOutputFieldType, } from "./workflow-output.js";
|
|
45
45
|
/** Placeholder `forEachTaskRefKey` the forEach item proxy emits; replaced with the real refKey. */
|
|
46
46
|
export const FOR_EACH_PLACEHOLDER = "__forEach__";
|
|
@@ -49,14 +49,15 @@ export const FOR_EACH_PLACEHOLDER = "__forEach__";
|
|
|
49
49
|
* `{ refKey, task, children? }` shape. The task's human display name is
|
|
50
50
|
* injected into the body — `displayName` when given (an adopted task whose
|
|
51
51
|
* platform-side name differs from its `refKey`, e.g. "For Each" vs.
|
|
52
|
-
* "For_Each"), else `refKey` itself, matching prior behavior
|
|
53
|
-
*
|
|
54
|
-
*
|
|
52
|
+
* "For_Each"), else `refKey` itself, matching prior behavior. `null` (a step
|
|
53
|
+
* pulled with no name on the platform, edk#3191) leaves `name` out, which the
|
|
54
|
+
* provider reads as "no name". Operator children become `children`; a forEach
|
|
55
|
+
* task's `__forEach__` placeholder is swapped for its real refKey.
|
|
55
56
|
*/
|
|
56
57
|
function serializeTaskEntry(name, def, displayName, hclParent) {
|
|
57
58
|
const result = {
|
|
58
59
|
refKey: name,
|
|
59
|
-
task: serializeNode({ [def.key]: { name: displayName ?? name, ...def.config } }),
|
|
60
|
+
task: serializeNode({ [def.key]: { ...(displayName === null ? {} : { name: displayName ?? name }), ...def.config } }),
|
|
60
61
|
...(hclParent !== undefined ? { hclParent } : {}),
|
|
61
62
|
};
|
|
62
63
|
if (def.operatorChildren && def.operatorChildren.length > 0) {
|
|
@@ -518,11 +519,11 @@ export function rewriteCanonicalOutputRefName(taskKey, name, taskRefKey, schema,
|
|
|
518
519
|
return name;
|
|
519
520
|
}
|
|
520
521
|
/** Rename a task's `.record` reference to its whole-record output, in place. */
|
|
521
|
-
function useWholeTaskRecord(value, taskKindByRefKey) {
|
|
522
|
+
function useWholeTaskRecord(value, taskKindByRefKey, wholeRecordNames = WHOLE_RECORD_REF_WIRE_NAMES) {
|
|
522
523
|
const mapped = value?.taskReference;
|
|
523
524
|
if (typeof mapped?.taskRefKey !== "string" || mapped.name !== "record")
|
|
524
525
|
return;
|
|
525
|
-
const wholeRecord =
|
|
526
|
+
const wholeRecord = wholeRecordNames[taskKindByRefKey.get(mapped.taskRefKey) ?? ""];
|
|
526
527
|
if (wholeRecord !== undefined)
|
|
527
528
|
mapped.name = wholeRecord;
|
|
528
529
|
}
|
|
@@ -560,6 +561,15 @@ filterLeft = false) {
|
|
|
560
561
|
for (const input of scriptInputs)
|
|
561
562
|
useWholeTaskRecord(input?.value, taskKindByRefKey);
|
|
562
563
|
}
|
|
564
|
+
// A `record` attachment hands over every file on a record, which the platform
|
|
565
|
+
// reads from the whole record (its Attachments field); the record ID gives the
|
|
566
|
+
// AI agent no files and fails the email.
|
|
567
|
+
for (const attachments of [rec.aiAgent?.attachments, rec.sendEmail?.emailAttachments]) {
|
|
568
|
+
if (!Array.isArray(attachments))
|
|
569
|
+
continue;
|
|
570
|
+
for (const attachment of attachments)
|
|
571
|
+
useWholeTaskRecord(attachment?.record, taskKindByRefKey, ATTACHMENT_WHOLE_RECORD_REF_WIRE_NAMES);
|
|
572
|
+
}
|
|
563
573
|
if (Array.isArray(rec.field_mappings)) {
|
|
564
574
|
useWholeTaskRecord(rec.value, taskKindByRefKey);
|
|
565
575
|
// Field mappings read a trigger's whole record too, which shares its
|
|
@@ -29,8 +29,13 @@ export interface TaskCall {
|
|
|
29
29
|
readonly refKey: string;
|
|
30
30
|
readonly args: Record<string, unknown>;
|
|
31
31
|
readonly children?: readonly OperatorChildAst[];
|
|
32
|
-
/**
|
|
33
|
-
|
|
32
|
+
/**
|
|
33
|
+
* The task's real wire display name, when it differs from `refKey` (e.g. a
|
|
34
|
+
* platform-authored "For Each" vs. the slugged `refKey` "For_Each"). `null`
|
|
35
|
+
* when the platform step has no name: the printer passes `null` so build
|
|
36
|
+
* leaves `name` out (edk#3191).
|
|
37
|
+
*/
|
|
38
|
+
readonly displayName?: string | null;
|
|
34
39
|
/** Explicit provider graph parent (`trigger` or another task refKey). */
|
|
35
40
|
readonly hclParent?: string;
|
|
36
41
|
}
|
|
@@ -40,6 +45,13 @@ export interface PulledRawCalculationAst {
|
|
|
40
45
|
readonly text: string;
|
|
41
46
|
readonly resultType: "attachment" | "bool" | "date" | "datetime" | "decimal" | "group" | "handle" | "html" | "json" | "multiPicklist" | "number" | "picklist" | "text" | "user";
|
|
42
47
|
}
|
|
48
|
+
/** A group in an approvalChain dynamic approver slot: `groupApprover(group, { approvalsRequired, denialsRequired })` (edk#3163). */
|
|
49
|
+
export interface PulledGroupApproverAst {
|
|
50
|
+
readonly kind: "groupApprover";
|
|
51
|
+
readonly group: RefExpr | unknown;
|
|
52
|
+
readonly approvalsRequired: number;
|
|
53
|
+
readonly denialsRequired: number;
|
|
54
|
+
}
|
|
43
55
|
export interface OperatorChildAst {
|
|
44
56
|
readonly label?: string | null;
|
|
45
57
|
/** True only for a switch default branch; label absence is not a default discriminator. */
|
|
@@ -115,6 +115,15 @@ export interface PrintAutomationV2Options {
|
|
|
115
115
|
readonly foreignAppRefNamespaces?: ReadonlyMap<string, string>;
|
|
116
116
|
readonly foreignElementRefNamespaces?: ReadonlyMap<string, string>;
|
|
117
117
|
readonly foreignTaskRefNames?: ReadonlyMap<string, string>;
|
|
118
|
+
/**
|
|
119
|
+
* `JSON.stringify([element name, search-table lookup name])` → the catalog
|
|
120
|
+
* key the element's catalog gives that table, as the agent and skill tool
|
|
121
|
+
* printers read it (edk#3228).
|
|
122
|
+
*/
|
|
123
|
+
readonly foreignSearchTableRefsByName?: ReadonlyMap<string, {
|
|
124
|
+
readonly ownerRefName: string;
|
|
125
|
+
readonly tableKey: string;
|
|
126
|
+
}>;
|
|
118
127
|
/** Diagnostics emitted by the bridge for raw UUIDs retained in this pull. */
|
|
119
128
|
readonly unresolvedReferences?: readonly UnresolvedReferenceDiagnostic[];
|
|
120
129
|
}
|