@elementumai/edk 0.9.6 → 0.9.7

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.
Files changed (97) hide show
  1. package/README.md +31 -1
  2. package/dist-sdk/src/catalog/factories.d.ts +12 -3
  3. package/dist-sdk/src/catalog/factories.js +9 -6
  4. package/dist-sdk/src/catalog/org.js +26 -13
  5. package/dist-sdk/src/catalog/types.d.ts +22 -1
  6. package/dist-sdk/src/core/index.d.ts +1 -1
  7. package/dist-sdk/src/core/system-fields.d.ts +4 -0
  8. package/dist-sdk/src/core/system-fields.js +15 -0
  9. package/dist-sdk/src/core/types/app.d.ts +14 -9
  10. package/dist-sdk/src/core/types/platform.d.ts +1 -1
  11. package/dist-sdk/src/engine/build/context.d.ts +4 -0
  12. package/dist-sdk/src/engine/pull/context.d.ts +9 -0
  13. package/dist-sdk/src/engine/pull/ref-only.d.ts +14 -0
  14. package/dist-sdk/src/engine/pull/ref-only.js +35 -2
  15. package/dist-sdk/src/entities/access-policy/from-tf.js +14 -2
  16. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +6 -0
  17. package/dist-sdk/src/entities/access-policy/to-tf.js +4 -1
  18. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +18 -1
  19. package/dist-sdk/src/entities/agent/module.js +1 -0
  20. package/dist-sdk/src/entities/agent/to-tf.d.ts +1 -0
  21. package/dist-sdk/src/entities/agent/to-tf.js +1 -0
  22. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +9 -0
  23. package/dist-sdk/src/entities/agent-tool/from-tf.js +10 -2
  24. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +2 -0
  25. package/dist-sdk/src/entities/agent-tool/to-tf.js +2 -3
  26. package/dist-sdk/src/entities/app/build.d.ts +42 -22
  27. package/dist-sdk/src/entities/app/build.js +12 -5
  28. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +10 -0
  29. package/dist-sdk/src/entities/app/from-tf.js +71 -8
  30. package/dist-sdk/src/entities/app/index.d.ts +3 -2
  31. package/dist-sdk/src/entities/app/index.js +2 -1
  32. package/dist-sdk/src/entities/app/to-tf.js +16 -0
  33. package/dist-sdk/src/entities/automation/build.d.ts +31 -19
  34. package/dist-sdk/src/entities/automation/build.js +85 -7
  35. package/dist-sdk/src/entities/automation/catalog-render.js +5 -2
  36. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +5 -3
  37. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +26 -12
  38. package/dist-sdk/src/entities/automation/from-tf.js +364 -31
  39. package/dist-sdk/src/entities/automation/index.d.ts +1 -1
  40. package/dist-sdk/src/entities/automation/module.js +2 -2
  41. package/dist-sdk/src/entities/automation/operators.d.ts +2 -2
  42. package/dist-sdk/src/entities/automation/operators.js +1 -0
  43. package/dist-sdk/src/entities/automation/output-field-types.d.ts +17 -0
  44. package/dist-sdk/src/entities/automation/output-field-types.js +45 -0
  45. package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +8 -0
  46. package/dist-sdk/src/entities/automation/output-key-wire-name.js +16 -0
  47. package/dist-sdk/src/entities/automation/script-code.js +153 -25
  48. package/dist-sdk/src/entities/automation/tasks.d.ts +100 -37
  49. package/dist-sdk/src/entities/automation/tasks.js +44 -43
  50. package/dist-sdk/src/entities/automation/to-tf.d.ts +3 -1
  51. package/dist-sdk/src/entities/automation/to-tf.js +454 -58
  52. package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +78 -0
  53. package/dist-sdk/src/entities/automation/value-ref-tf.js +193 -0
  54. package/dist-sdk/src/entities/element/build.js +1 -0
  55. package/dist-sdk/src/entities/element/index.d.ts +2 -1
  56. package/dist-sdk/src/entities/element/index.js +2 -1
  57. package/dist-sdk/src/entities/field/build.d.ts +94 -3
  58. package/dist-sdk/src/entities/field/build.js +82 -3
  59. package/dist-sdk/src/entities/field/from-tf.js +92 -1
  60. package/dist-sdk/src/entities/field/locals.js +6 -7
  61. package/dist-sdk/src/entities/field/options.d.ts +2 -0
  62. package/dist-sdk/src/entities/field/options.js +12 -2
  63. package/dist-sdk/src/entities/field/record-shape.d.ts +12 -15
  64. package/dist-sdk/src/entities/field/to-tf.d.ts +12 -2
  65. package/dist-sdk/src/entities/field/to-tf.js +172 -51
  66. package/dist-sdk/src/entities/field/types.js +2 -0
  67. package/dist-sdk/src/entities/record-create-form/to-tf.js +5 -8
  68. package/dist-sdk/src/entities/relationship/from-tf.js +91 -9
  69. package/dist-sdk/src/entities/shared/aspect-target-from-tf.d.ts +9 -0
  70. package/dist-sdk/src/entities/shared/aspect-target-from-tf.js +39 -0
  71. package/dist-sdk/src/entities/shared/filters/ast.d.ts +18 -1
  72. package/dist-sdk/src/entities/shared/filters/ast.js +1 -0
  73. package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +6 -1
  74. package/dist-sdk/src/entities/shared/filters/tf-codec.js +6 -4
  75. package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +5 -3
  76. package/dist-sdk/src/entities/shared/tool-field-ref.js +11 -16
  77. package/dist-sdk/src/entities/shared/types/common.d.ts +7 -5
  78. package/dist-sdk/src/entities/shared/types/platform.d.ts +15 -2
  79. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +1 -1
  80. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +44 -15
  81. package/dist-sdk/src/entities/skill/from-tf.js +11 -1
  82. package/dist-sdk/src/entities/skill/input-coverage.d.ts +68 -0
  83. package/dist-sdk/src/entities/skill/input-coverage.js +184 -0
  84. package/dist-sdk/src/entities/skill/module.js +2 -0
  85. package/dist-sdk/src/entities/skill/to-tf.d.ts +3 -0
  86. package/dist-sdk/src/entities/skill/to-tf.js +7 -2
  87. package/dist-sdk/src/entities/skill/tools.d.ts +10 -1
  88. package/dist-sdk/src/entities/skill/tools.js +0 -5
  89. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +19 -0
  90. package/dist-sdk/src/entities/skill-tool/from-tf.js +40 -11
  91. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +4 -2
  92. package/dist-sdk/src/entities/skill-tool/to-tf.js +24 -16
  93. package/dist-sdk/src/entities/table/to-tf.js +18 -1
  94. package/dist-sdk/src/entities/view/to-tf.js +8 -3
  95. package/dist-sdk/src/entities/visual-flow/from-tf.js +6 -2
  96. package/dist-sdk/src/graph/types.d.ts +3 -0
  97. package/package.json +2 -1
@@ -8,6 +8,7 @@ import { EntityTfError } from "../../engine/entity.js";
8
8
  import { dataRefLabel, optionalString, resourceRefLabel } from "../../engine/pull/context.js";
9
9
  import { isTfExpr, scopedLabelToBagKey, scopedResourceLabel, tsLabelToTfLabel } from "../../engine/tf/index.js";
10
10
  import { resolveToolFieldKey } from "../shared/tool-field-ref.js";
11
+ import { dataAspectDisplayName } from "../shared/aspect-target-from-tf.js";
11
12
  import { KNOWN_TOOL_ATTRS, TOOL_SUB_TYPE_BY_RESOURCE } from "./types.js";
12
13
  function runAsFromTf(attrs, owner, where, ctx) {
13
14
  const value = optionalString(attrs, "run_as", where, ctx);
@@ -199,7 +200,7 @@ export function toolFromTf(block, owner, ctx) {
199
200
  continue;
200
201
  }
201
202
  const rec = item;
202
- const fieldKey = resolveToolFieldKey(rec["field_id"], fieldScopeLabel, fieldScope);
203
+ const fieldKey = resolveToolFieldKey(rec["field_id"], fieldScopeLabel, fieldScope, ctx);
203
204
  // A field on a foreign/out-of-scope aspect has no field resource ei
204
205
  // can reference — it falls back to a bare platform id, confirmed
205
206
  // live (board issue #169). Preserve it (raw-id TODO placeholder)
@@ -327,13 +328,20 @@ function aspectTargetFromTf(value, attrName, owner, ctx, where) {
327
328
  ]) {
328
329
  if (!isTfExpr(value) || value.$expr !== "data-attr" || value.type !== type)
329
330
  continue;
330
- const name = ctx.dataName(type, value.label);
331
+ const name = dataAspectDisplayName(ctx, scope, value.label);
331
332
  if (name === undefined) {
332
333
  ctx.diagnostics.push(`${where}: ${attrName} references data.${type}.${value.label} but the stream has no such data block; skipped`);
333
334
  return undefined;
334
335
  }
335
336
  return { target: { kind, name }, fieldScopeLabel: value.label, fieldScope: scope };
336
337
  }
338
+ if (typeof value === "string") {
339
+ // No portable reference was available at export time (ei fell back to
340
+ // the raw platform UUID) — keep the tool with an unresolved target
341
+ // instead of dropping it entirely (board issue #648).
342
+ ctx.diagnostics.push(`${where}: ${attrName} could not be resolved to a portable reference ("${value}"); kept as unresolved`);
343
+ return { target: { kind: "unresolved", uuid: value }, fieldScopeLabel: owner.ownerTfLabel, fieldScope: "app" };
344
+ }
337
345
  ctx.diagnostics.push(`${where}: ${attrName} has an unrecognized shape (${JSON.stringify(value)}); skipped`);
338
346
  return undefined;
339
347
  }
@@ -36,6 +36,8 @@ export interface ToolToTfContext {
36
36
  readonly workspaceAspects?: ReadonlyMap<string, WorkspaceAspect>;
37
37
  /** Records an app-scoped service-account lookup by name. */
38
38
  serviceAccountRef?(tfLabel: string, name: string): TfValue | void;
39
+ /** App-local automations whose publish resource will be emitted in this build. */
40
+ readonly activeAutomationRefNames?: ReadonlySet<string>;
39
41
  /** Degradations land here — reported by the caller, never silent. */
40
42
  readonly diagnostics: string[];
41
43
  }
@@ -13,6 +13,7 @@
13
13
  * `data.elementum_field` lookup when the typed target is foreign.
14
14
  */
15
15
  import { workspaceAspectKey } from "../../engine/build/context.js";
16
+ import { automationRunTargetResourceAttr } from "../automation/to-tf.js";
16
17
  import { appScopedResourceLabel, expr, sanitizeName, scopedResourceLabel, tsLabelToTfLabel } from "../../engine/tf/index.js";
17
18
  import { EntityTfError } from "../../engine/entity.js";
18
19
  import { fieldRefToTfValue } from "../field/to-tf.js";
@@ -229,9 +230,7 @@ export function toolToTf(entry, ctx) {
229
230
  attrs["automation_id"] = expr.dataAttr("elementum_automation", dataLabel, ["id"]);
230
231
  }
231
232
  else {
232
- // The automation and workflow-publish resources carry the same platform
233
- // id. Reference the publish block so Terraform sequences publication.
234
- attrs["automation_id"] = expr.resourceAttr("elementum_workflow_publish", appScopedResourceLabel(ctx.appTfLabel, autoTfLabel), ["id"]);
233
+ attrs["automation_id"] = automationRunTargetResourceAttr(ctx.appTfLabel, typeof auto?.refName === "string" && auto.refName !== "" ? auto.refName : autoTfLabel, ctx.activeAutomationRefNames);
235
234
  }
236
235
  if (inner.inputs !== undefined && inner.inputs.length > 0) {
237
236
  attrs["inputs"] = inner.inputs.map((i) => ({
@@ -8,9 +8,8 @@
8
8
  * inline (a new app's fields get server-assigned ids on compose). Deployed via
9
9
  * the wire client's compose path (`composeAspect`).
10
10
  *
11
- * Slice scope: identity + the common scalar/picklist field types. Calc fields,
12
- * dependent picklists, display blocks, and field-id reconciliation for updates
13
- * follow the same pattern and land as expansion.
11
+ * Includes typed scalar, Dropdown/Multi-Select, relation, calculation, and
12
+ * record-experience configuration with build/pull round-trip support.
14
13
  */
15
14
  import { type AgentRef, type AppOrElementRef, type AutomationCatalogRef, type CatalogRef, type ChartRef, type CloudLinkRef, type DashboardRef, type FieldRef } from "../../catalog/index.js";
16
15
  import type { WorkflowFieldType } from "../shared/types/field-types.js";
@@ -43,7 +42,10 @@ export interface AppPicklistDynamicSortOrder {
43
42
  readonly aggregation?: unknown;
44
43
  }
45
44
  /**
46
- * Authoring-time picklist config. Wire `PicklistConfigInput` uses bare id
45
+ * @deprecated Internal compatibility shape. Author Dropdowns through
46
+ * `DropdownConfig` on `dropdownField` or `multiSelectField`.
47
+ *
48
+ * Wire `PicklistConfigInput` uses bare id
47
49
  * strings; here `relatedAspectId` / `relatedLabelFieldId` / `parentFieldId`
48
50
  * may be catalog tokens that `resolvePayload` swaps for ids at plan/apply.
49
51
  *
@@ -62,6 +64,10 @@ export interface AppPicklistDynamicConfig {
62
64
  readonly relatedAspectId: AppOrElementRef | UnsafePlatformId;
63
65
  readonly relatedLabelFieldId: FieldRef | UnsafePlatformId;
64
66
  readonly parentFieldId?: FieldRef | UnsafePlatformId;
67
+ readonly parentMappings?: readonly {
68
+ readonly parentAspectFieldId: FieldRef | UnsafePlatformId;
69
+ readonly relatedAspectFieldId: FieldRef | UnsafePlatformId;
70
+ }[];
65
71
  readonly autoRelate?: boolean;
66
72
  readonly valuesRenderType?: string;
67
73
  readonly filter?: Filter;
@@ -71,14 +77,18 @@ export interface AppPicklistDynamicConfig {
71
77
  readonly orders?: never;
72
78
  });
73
79
  }
74
- export interface AppPicklistConfig {
75
- readonly static?: {
80
+ /** @deprecated Use `DropdownConfig` through the selection-field factories. */
81
+ export type AppPicklistConfig = {
82
+ readonly static: {
76
83
  readonly parentFieldId?: FieldRef | UnsafePlatformId;
77
84
  readonly filter?: Filter;
78
85
  readonly sort?: Readonly<Record<string, unknown>>;
79
86
  };
80
- readonly dynamic?: AppPicklistDynamicConfig;
81
- }
87
+ readonly dynamic?: never;
88
+ } | {
89
+ readonly static?: never;
90
+ readonly dynamic: AppPicklistDynamicConfig;
91
+ };
82
92
  /**
83
93
  * A field authored on a v2 app or element — shared with `element`
84
94
  * (`src/elements/build.ts`), which imports this type and {@link serializeField}
@@ -104,10 +114,9 @@ export interface AppField {
104
114
  */
105
115
  readonly tags?: readonly string[];
106
116
  /**
107
- * Picklist options (`PICKLIST` / `MULTI_PICKLIST`). A bare string is the
108
- * label; the object form adds `parentValues` (parent-picklist **option ids**)
109
- * for a dependent dropdown. (Option ids aren't catalog-modeled yet — raw ids
110
- * for now.) Omit for dynamic picklists (`config.dynamic`).
117
+ * Legacy selection values (`PICKLIST` / `MULTI_PICKLIST`). New authoring
118
+ * should use `config.static.values` on `dropdownField`/`multiSelectField`;
119
+ * typed `dropdownValue(...)` references avoid parent-option UUIDs.
111
120
  */
112
121
  readonly options?: readonly (string | PicklistOption)[];
113
122
  /** Parent picklist for a dependent dropdown (token → `config.static.parentFieldId`). */
@@ -147,11 +156,17 @@ export interface AppField {
147
156
  /** `RELATION` only. Defaults to `true` on the platform. */
148
157
  readonly autoRelate?: boolean;
149
158
  }
150
- /** A picklist option with optional dependent-dropdown parent links. */
159
+ /** @deprecated Use `DropdownOption` and `dropdownOption(...)`. */
151
160
  export interface PicklistOption {
152
161
  readonly label: string;
153
- /** Parent-picklist option ids that activate this option (dependent picklists). */
154
- readonly parentValues?: readonly string[];
162
+ /** Parent values that activate this option. Prefer typed `dropdownValue(...)` refs. */
163
+ readonly parentValues?: readonly (string | {
164
+ readonly __kind: "dropdownValue";
165
+ readonly field: FieldRef<string, string, "PICKLIST" | "MULTI_PICKLIST">;
166
+ readonly label: string;
167
+ })[];
168
+ readonly active?: boolean;
169
+ readonly icon?: string;
155
170
  /** Option tags (e.g. "CLOSED" marks the closing status option). */
156
171
  readonly tags?: readonly PicklistOptionTag[];
157
172
  /** Display color (hex, e.g. "#3B82F6") — surfaced on status options; cosmetic only. */
@@ -181,18 +196,19 @@ export interface AppCloudOptions {
181
196
  * genuinely allows overriding is authorable: the display name, an optional
182
197
  * description (title/id/status only — the app resource has no
183
198
  * `*_field_description` attribute for the others), and, for the status/stage
184
- * picklists, the option set. `type` and the required/showOnCreate booleans
185
- * are fixed by the platform's per-tag config and deliberately have no
186
- * authoring slot.
199
+ * picklists, the option set. `type` stays platform-owned; the three validation
200
+ * flags are first-class because they affect record creation/closure and phone
201
+ * agent behavior.
187
202
  */
188
203
  export interface AppSystemFieldOverride {
189
204
  readonly name: string;
190
205
  readonly description?: string;
206
+ readonly required?: boolean;
207
+ readonly requiredOnClose?: boolean;
208
+ readonly showOnCreate?: boolean;
191
209
  }
192
210
  /** A system-picklist override (status/stage): display name + option set. */
193
- export interface AppSystemPicklistOverride {
194
- readonly name: string;
195
- readonly description?: string;
211
+ export interface AppSystemPicklistOverride extends AppSystemFieldOverride {
196
212
  readonly options: readonly (string | PicklistOption)[];
197
213
  }
198
214
  /**
@@ -456,7 +472,11 @@ export declare function serializeSystemFields(overrides: AppSystemFields | undef
456
472
  * (`entities/field/record-shape.ts`) needs to discriminate value types.
457
473
  */
458
474
  export type AppFieldRefs<F extends Record<string, AppField>, Parent extends string = string> = {
459
- readonly [K in keyof F]: FieldRef<Parent, Extract<K, string>, F[K]["type"]>;
475
+ readonly [K in keyof F]: FieldRef<Parent, Extract<K, string>, F[K]["type"]> & (F[K] extends {
476
+ readonly dynamicSource: true;
477
+ } ? {
478
+ readonly dynamicSource: true;
479
+ } : {});
460
480
  };
461
481
  /**
462
482
  * The platform field type each auto-provisioned system field carries —
@@ -8,9 +8,8 @@
8
8
  * inline (a new app's fields get server-assigned ids on compose). Deployed via
9
9
  * the wire client's compose path (`composeAspect`).
10
10
  *
11
- * Slice scope: identity + the common scalar/picklist field types. Calc fields,
12
- * dependent picklists, display blocks, and field-id reconciliation for updates
13
- * follow the same pattern and land as expansion.
11
+ * Includes typed scalar, Dropdown/Multi-Select, relation, calculation, and
12
+ * record-experience configuration with build/pull round-trip support.
14
13
  */
15
14
  import { slimTokens } from "../../catalog/index.js";
16
15
  import { DEPLOY_DEFAULT_SYSTEM_FIELD_NAMES, SYSTEM_FIELD_KEYS, SYSTEM_FIELD_REQUIRED, SYSTEM_FIELD_TAG_BY_KEY, WRITABLE_SYSTEM_TAG_NAMES, } from "../../core/system-fields.js";
@@ -104,6 +103,8 @@ function picklistValue(opt) {
104
103
  value: opt.label,
105
104
  label: opt.label,
106
105
  ...(opt.parentValues !== undefined ? { relatedParentValues: opt.parentValues } : {}),
106
+ ...(opt.active !== undefined ? { active: opt.active } : {}),
107
+ ...(opt.icon !== undefined ? { icon: opt.icon } : {}),
107
108
  ...(opt.tags !== undefined ? { tags: opt.tags } : {}),
108
109
  ...(opt.color !== undefined ? { color: opt.color } : {}),
109
110
  };
@@ -224,6 +225,11 @@ export function serializeSystemFields(overrides) {
224
225
  const tag = SYSTEM_FIELD_TAG_BY_KEY[key];
225
226
  const override = overrides[key];
226
227
  const name = override.name ?? DEPLOY_DEFAULT_SYSTEM_FIELD_NAMES[key];
228
+ const flags = {
229
+ required: override.required ?? SYSTEM_FIELD_REQUIRED[key],
230
+ requiredOnClose: override.requiredOnClose ?? false,
231
+ showOnCreate: override.showOnCreate ?? false,
232
+ };
227
233
  if (key === "stage") {
228
234
  // Constructed directly, not via serializeField: the REST compose API
229
235
  // rejects stage picklistValues (stage mutations have dedicated
@@ -233,7 +239,7 @@ export function serializeSystemFields(overrides) {
233
239
  return {
234
240
  picklist: {
235
241
  name,
236
- required: SYSTEM_FIELD_REQUIRED[key],
242
+ ...flags,
237
243
  tags: [tag],
238
244
  __refName: key,
239
245
  picklistValues: override.options.map(picklistValue),
@@ -243,7 +249,7 @@ export function serializeSystemFields(overrides) {
243
249
  const field = {
244
250
  name,
245
251
  type: SYSTEM_FIELD_TAG_TO_TYPE[tag],
246
- required: SYSTEM_FIELD_REQUIRED[key],
252
+ ...flags,
247
253
  tags: [tag],
248
254
  ...(override.description !== undefined ? { description: override.description } : {}),
249
255
  ...(key === "status" ? { options: override.options } : {}),
@@ -310,6 +316,7 @@ export function app(opts) {
310
316
  parentKind: kind,
311
317
  parentName: opts.name,
312
318
  fieldType: field.type,
319
+ ...("dynamicSource" in field && field.dynamicSource === true ? { dynamicSource: true } : {}),
313
320
  ...(field.options !== undefined ? { options: picklistOptionLabels(field.options) } : {}),
314
321
  ...(field.tags !== undefined ? { tags: field.tags } : {}),
315
322
  };
@@ -53,6 +53,10 @@ export interface NormalizedField {
53
53
  readonly parentFieldId?: string;
54
54
  /** Map of this field's option id → parent option ids. */
55
55
  readonly optionParents?: ReadonlyMap<string, readonly string[]>;
56
+ /** Same information reconstructed from Terraform's name-based locals. */
57
+ readonly parentFieldKey?: string;
58
+ /** Child option label -> parent option labels. */
59
+ readonly optionParentLabels?: ReadonlyMap<string, readonly string[]>;
56
60
  };
57
61
  }
58
62
  /**
@@ -275,6 +279,12 @@ export interface PulledRelationshipRef {
275
279
  readonly fieldType?: string;
276
280
  readonly tfLabel?: string;
277
281
  readonly managed?: boolean;
282
+ /** The recursive pull resolved this reference to an on-disk generated catalog token. */
283
+ readonly catalogRef?: boolean;
284
+ readonly namespace?: string;
285
+ readonly parentKind?: "app" | "element";
286
+ readonly parentName?: string;
287
+ readonly parentNamespace?: string;
278
288
  }
279
289
  export interface NormalizedRelationship {
280
290
  readonly key: string;
@@ -7,6 +7,7 @@
7
7
  * identically for both pull paths. Platform ids come only from the stream's
8
8
  * import blocks and stay data-side — they never reach printed source.
9
9
  */
10
+ import { DEPLOY_DEFAULT_SYSTEM_FIELD_NAMES, SYSTEM_FIELD_KEYS, SYSTEM_FIELD_KEY_BY_HCL_KEY, SYSTEM_FIELD_TAG_BY_KEY, } from "../../core/system-fields.js";
10
11
  import { EntityTfError } from "../../engine/entity.js";
11
12
  import { dataRefLabel, optionalString, plainObject } from "../../engine/pull/context.js";
12
13
  import { snakeSlug, tfLabelToTsLabel } from "../../engine/tf/index.js";
@@ -41,7 +42,47 @@ const KNOWN_APP_ATTRS = new Set([
41
42
  "id_field_description",
42
43
  "status_field_description",
43
44
  "comments_enabled",
45
+ "system_field_config",
44
46
  ]);
47
+ const SYSTEM_FIELD_TYPE_BY_KEY = {
48
+ id: "HANDLE",
49
+ title: "TEXT",
50
+ status: "PICKLIST",
51
+ stage: "PICKLIST",
52
+ createdAt: "DATETIME",
53
+ createdBy: "USER",
54
+ updatedAt: "DATETIME",
55
+ updatedBy: "USER",
56
+ closedAt: "DATETIME",
57
+ closedBy: "USER",
58
+ };
59
+ function systemFieldConfigFromTf(value, owner, ctx) {
60
+ const result = new Map();
61
+ if (value === undefined)
62
+ return result;
63
+ const config = plainObject(value);
64
+ if (config === undefined) {
65
+ ctx.diagnostics.push(`${owner}: system_field_config is not a map; dropped`);
66
+ return result;
67
+ }
68
+ for (const [rawKey, rawValue] of Object.entries(config)) {
69
+ const publicKey = SYSTEM_FIELD_KEY_BY_HCL_KEY[rawKey];
70
+ if (publicKey === undefined) {
71
+ ctx.diagnostics.push(`${owner}: system_field_config has unknown key "${rawKey}"; dropped`);
72
+ continue;
73
+ }
74
+ const entry = plainObject(rawValue);
75
+ const required = entry?.["required"];
76
+ const requiredOnClose = entry?.["required_on_close"];
77
+ const showOnCreate = entry?.["show_on_create"];
78
+ if (typeof required !== "boolean" || typeof requiredOnClose !== "boolean" || typeof showOnCreate !== "boolean") {
79
+ ctx.diagnostics.push(`${owner}: system_field_config.${rawKey} must contain boolean required, required_on_close, and show_on_create; dropped`);
80
+ continue;
81
+ }
82
+ result.set(publicKey, { required, requiredOnClose, showOnCreate });
83
+ }
84
+ return result;
85
+ }
45
86
  export function appFromTf(appBlock, fieldBlocks, ctx, viewBlocks = { layoutBlocks: [], listViewBlocks: [], calendarViewBlocks: [], kanbanViewBlocks: [], dashboardViewBlocks: [], agentViewBlocks: [], managedViewOrderBlocks: [], recordCreateFormBlocks: [], dynamicLayoutBlocks: [], relationshipBlocks: [], dashboardBlocks: [], dashboardWidgetBlocks: [], widgetBlocks: [] }, accessPolicyBlocks = [], roleBlocks = [], serviceAccountBlocks = []) {
46
87
  const label = appBlock.label;
47
88
  if (label === undefined || label === "") {
@@ -95,19 +136,21 @@ export function appFromTf(appBlock, fieldBlocks, ctx, viewBlocks = { layoutBlock
95
136
  cloudLinkId = `data.elementum_cloudlink.${dataLabel}`;
96
137
  }
97
138
  }
98
- // --- System-field attributes → tagged NormalizedField entries.
139
+ // --- System-field attributes/config → tagged NormalizedField entries.
99
140
  const fields = [];
141
+ const systemConfig = systemFieldConfigFromTf(attrs["system_field_config"], `app "${label}"`, ctx);
100
142
  const titleName = optionalString(attrs, "title_field_name", `app "${label}"`, ctx);
101
- if (titleName !== undefined || titleFieldDescription !== undefined) {
102
- fields.push(systemEntry("title", titleName ?? "Title", "TEXT", "TITLE", titleFieldDescription));
143
+ if (titleName !== undefined || titleFieldDescription !== undefined || systemConfig.has("title")) {
144
+ fields.push(systemEntry("title", titleName ?? "Title", "TEXT", "TITLE", titleFieldDescription, systemConfig.get("title")));
103
145
  }
104
146
  const idName = optionalString(attrs, "id_field_name", `app "${label}"`, ctx);
105
- if (idName !== undefined || idFieldDescription !== undefined) {
106
- fields.push(systemEntry("id", idName ?? "ID", "TEXT", "HANDLE", idFieldDescription));
147
+ if (idName !== undefined || idFieldDescription !== undefined || systemConfig.has("id")) {
148
+ fields.push(systemEntry("id", idName ?? "ID", "TEXT", "HANDLE", idFieldDescription, systemConfig.get("id")));
107
149
  }
108
150
  const statusName = optionalString(attrs, "status_field_name", `app "${label}"`, ctx) ?? "Status";
109
151
  const statusOptions = optionsFromTf(attrs["status_options"], `app "${label}" status_options`, ctx);
110
- if (statusName !== "Status" || statusOptions !== undefined || statusFieldDescription !== undefined) {
152
+ if (statusName !== "Status" || statusOptions !== undefined || statusFieldDescription !== undefined || systemConfig.has("status")) {
153
+ const flags = systemConfig.get("status");
111
154
  fields.push({
112
155
  key: "status",
113
156
  field: {
@@ -117,9 +160,19 @@ export function appFromTf(appBlock, fieldBlocks, ctx, viewBlocks = { layoutBlock
117
160
  tags: ["STATUS"],
118
161
  ...(statusFieldDescription !== undefined && { description: statusFieldDescription }),
119
162
  ...(statusOptions !== undefined && { options: statusOptions }),
163
+ ...(flags !== undefined && flags),
120
164
  },
121
165
  });
122
166
  }
167
+ for (const key of SYSTEM_FIELD_KEYS) {
168
+ if (key === "id" || key === "title" || key === "status")
169
+ continue;
170
+ const flags = systemConfig.get(key);
171
+ if (flags === undefined)
172
+ continue;
173
+ const tag = SYSTEM_FIELD_TAG_BY_KEY[key];
174
+ fields.push(systemEntry(key, DEPLOY_DEFAULT_SYSTEM_FIELD_NAMES[key], SYSTEM_FIELD_TYPE_BY_KEY[key], tag, undefined, flags));
175
+ }
123
176
  const stages = [];
124
177
  const stagesAttr = attrs["stages"];
125
178
  if (Array.isArray(stagesAttr)) {
@@ -213,6 +266,16 @@ export function appFromTf(appBlock, fieldBlocks, ctx, viewBlocks = { layoutBlock
213
266
  };
214
267
  return { app, ...(cloudLinkHandle !== undefined && { cloudLinkHandle }) };
215
268
  }
216
- function systemEntry(key, name, type, tag, description) {
217
- return { key, field: { id: "", name, type, tags: [tag], ...(description !== undefined && { description }) } };
269
+ function systemEntry(key, name, type, tag, description, flags) {
270
+ return {
271
+ key,
272
+ field: {
273
+ id: "",
274
+ name,
275
+ type,
276
+ tags: [tag],
277
+ ...(description !== undefined && { description }),
278
+ ...(flags !== undefined && flags),
279
+ },
280
+ };
218
281
  }
@@ -5,14 +5,15 @@
5
5
  * `src/elements/build.ts`'s header for why apps and elements split into
6
6
  * dedicated builders despite sharing this module's field/print internals.
7
7
  */
8
- export { app, type AppAgentView, type AppCalendarView, type AppDashboardView, type AppKanbanView, type AppListView, type AppCategory, type AppCloudOptions, type AppField, type AppPicklistConfig, type AppPicklistDynamicConfig, type AppPicklistDynamicSortOrder, type AppRecordCreateForm, type AppRecordCreateFormSection, type AppConfigured, type AppFieldRefs, type AppRef, type AppSelfRef, type AppReferenceConfiguration, type AppV2Options, type PicklistOption, } from "./build.js";
8
+ export { app, type AppAgentView, type AppCalendarView, type AppDashboardView, type AppKanbanView, type AppListView, type AppCategory, type AppCloudOptions, type AppField, type AppPicklistConfig, type AppPicklistDynamicConfig, type AppPicklistDynamicSortOrder, type AppRecordCreateForm, type AppRecordCreateFormSection, type AppConfigured, type AppFieldRefs, type AppRef, type AppSelfRef, type AppReferenceConfiguration, type AppV2Options, } from "./build.js";
9
9
  export { listViewDensity, managedViewSortAggregation, managedViewSortDirection, type ListViewDensity, type ManagedViewSort, type ManagedViewSortAggregation, type ManagedViewSortDirection, type ManagedViewSortField, type ManagedViewSortOrder, } from "../view/build.js";
10
10
  export { type AppWidget, type CreateRecordWidget, type LinkRecordsWidget, type RelatedRecordsWidget, type RunAutomationWidget, type RunAutomationWidgetParameter, type WidgetButtonStyle, type WidgetButtonType, } from "../widget/build.js";
11
11
  export { type DisplayBlock } from "./display-blocks.js";
12
12
  export { type AppRelationship, type AppRelationshipColumn } from "../relationship/build.js";
13
13
  export { dashboardChartWidget, dashboardRecordsWidget, dashboardWidgetSize, type DashboardChartWidget, type DashboardRecordsWidget, type DashboardWidget, type DashboardWidgetSize, } from "../dashboard/build.js";
14
14
  export { type AppDynamicLayout, type DynamicLayoutComponent, type DynamicLayoutCondition, type DynamicLayoutCssLength, type DynamicLayoutDependency, type DynamicLayoutFieldComponent, type DynamicLayoutFieldValidation, type DynamicLayoutSaveGroup, type DynamicLayoutStyle, type DynamicLayoutTypedValue, type DynamicLayoutValidationRule, dynamicLayout, } from "../dynamic-layout/build.js";
15
- export { attachmentField, booleanField, calculatedField, dateField, dateTimeField, decimalField, groupField, jsonField, multiPicklistField, numberField, picklistField, relationField, richTextField, textField, userField, type BaseFieldOptions, type CalculatedFieldOptions, type InferredCalculatedField, type NumericFieldOptions, type NumericFieldFormat, type PicklistFieldOptions, type RelationFieldOptions, type TextFieldOptions, type QrFieldFormat, } from "../field/build.js";
15
+ export { attachmentField, booleanField, calculatedField, dateField, dateTimeField, decimalField, dropdownDisplay, dropdownField, dropdownOption, dropdownValue, groupField, jsonField, multiSelectField, numberField, relationField, richTextField, textField, userField, type BaseFieldOptions, type CalculatedFieldOptions, type InferredCalculatedField, type DropdownConfig, type DropdownDisplay, type DropdownFieldOptions, type DropdownOption, type DropdownParentValueRef, type DynamicDropdownConfig, type DynamicDropdownParent, type DynamicDropdownParentMapping, type MultiSelectFieldOptions, type NumericFieldOptions, type NumericFieldFormat, type PicklistFieldOptions, type RelationFieldOptions, type TextFieldOptions, type QrFieldFormat, } from "../field/build.js";
16
+ export { asc, desc, sortBy, type SortDirection, type SortOrder } from "../shared/types/common.js";
16
17
  export { calc, dateDifUnit, dateTimeTruncPrecision, field, orderByDirection, predicateOp, weekdayMode, type ConcatExprType, type DateDifUnit, type DateTimeTruncPrecision, type Expr, type ExprType, type FieldRefExprType, type OrderByDirection, type Predicate, type PredicateOp, type StringAggOptions, type StringAggOrderBy, type WeekdayMode, } from "../field/calc.js";
17
18
  export { agentEvaluation, type AgentEvaluationConfigured, type AgentEvaluationOptions, } from "../agent-evaluation/index.js";
18
19
  export { phoneService, callerAccessMode, type CallerAccessMode, type E164PhoneNumber, type PhoneServiceConfigured, type PhoneServiceNumber, type PhoneServiceOptions, type PhoneServiceRegistration, } from "../phone-service/index.js";
@@ -9,7 +9,8 @@ export { app, } from "./build.js";
9
9
  export { listViewDensity, managedViewSortAggregation, managedViewSortDirection, } from "../view/build.js";
10
10
  export { dashboardChartWidget, dashboardRecordsWidget, dashboardWidgetSize, } from "../dashboard/build.js";
11
11
  export { dynamicLayout, } from "../dynamic-layout/build.js";
12
- export { attachmentField, booleanField, calculatedField, dateField, dateTimeField, decimalField, groupField, jsonField, multiPicklistField, numberField, picklistField, relationField, richTextField, textField, userField, } from "../field/build.js";
12
+ export { attachmentField, booleanField, calculatedField, dateField, dateTimeField, decimalField, dropdownDisplay, dropdownField, dropdownOption, dropdownValue, groupField, jsonField, multiSelectField, numberField, relationField, richTextField, textField, userField, } from "../field/build.js";
13
+ export { asc, desc, sortBy } from "../shared/types/common.js";
13
14
  export { calc, dateDifUnit, dateTimeTruncPrecision, field, orderByDirection, predicateOp, weekdayMode, } from "../field/calc.js";
14
15
  export { agentEvaluation, } from "../agent-evaluation/index.js";
15
16
  export { phoneService, callerAccessMode, } from "../phone-service/index.js";
@@ -14,6 +14,7 @@
14
14
  * Unsupported authoring shapes degrade through `diagnostics` — reported,
15
15
  * never silent, never thrown (plan §4.3).
16
16
  */
17
+ import { SYSTEM_FIELD_HCL_KEY_BY_KEY, SYSTEM_FIELD_KEY_BY_TAG } from "../../core/system-fields.js";
17
18
  import { EntityTfError } from "../../engine/entity.js";
18
19
  import { expr, snakeSlug } from "../../engine/tf/index.js";
19
20
  import { accessPolicyToTf } from "../access-policy/to-tf.js";
@@ -113,6 +114,7 @@ export function appToTf(entity, ctx) {
113
114
  const fieldNames = new Map();
114
115
  let statusOptions;
115
116
  let stages;
117
+ const systemFieldConfig = {};
116
118
  const stageTfLabels = new Set();
117
119
  const objectId = expr.resourceAttr(APP_RESOURCE_TYPE, ctx.appTfLabel, ["id"]);
118
120
  for (const fieldEntry of payload.fields ?? []) {
@@ -137,6 +139,17 @@ export function appToTf(entity, ctx) {
137
139
  fieldNames.set(fieldKey, name);
138
140
  const systemTag = inner.tags?.find((tag) => SYSTEM_FIELD_TAGS.has(tag));
139
141
  if (systemTag !== undefined) {
142
+ const systemKey = SYSTEM_FIELD_KEY_BY_TAG[systemTag];
143
+ if (systemKey === undefined) {
144
+ ctx.diagnostics.push(`systemFields: unsupported semantic tag ${systemTag}; validation flags dropped`);
145
+ }
146
+ else {
147
+ systemFieldConfig[SYSTEM_FIELD_HCL_KEY_BY_KEY[systemKey]] = {
148
+ required: inner.required ?? false,
149
+ required_on_close: inner.requiredOnClose ?? false,
150
+ show_on_create: inner.showOnCreate ?? false,
151
+ };
152
+ }
140
153
  switch (systemTag) {
141
154
  case "TITLE":
142
155
  if (name !== "Title")
@@ -202,6 +215,9 @@ export function appToTf(entity, ctx) {
202
215
  blocks.push(field.block);
203
216
  fieldAddresses.set(field.bagKey, field.address);
204
217
  }
218
+ if (Object.keys(systemFieldConfig).length > 0) {
219
+ appAttrs["system_field_config"] = systemFieldConfig;
220
+ }
205
221
  // For an empty authored create, render the two platform-required defaults
206
222
  // directly into HCL. plan/apply rejects the same empty authoring when the
207
223
  // app is already present in state; after create, apply regenerates source.
@@ -6,6 +6,7 @@ import { type Context, type ForEachItem } from "../shared/context.js";
6
6
  import { type Ref, type Simplify, type ValueOrRef } from "../shared/ref.js";
7
7
  import type { Filter } from "./filter.js";
8
8
  import { type ScriptInput } from "./script-code.js";
9
+ import type { ScriptOutputs } from "./tasks.js";
9
10
  /** Structural empty object — neutral element for the accumulated action map. */
10
11
  type EmptyObject = {
11
12
  [K in never]: never;
@@ -37,27 +38,27 @@ export interface NestedActionEntry {
37
38
  readonly hclParent?: string;
38
39
  }
39
40
  /**
40
- * One branch of an operator: a label (case name, or `null` for forEach body /
41
- * switch default), an optional filter (switch case condition), and its tasks.
41
+ * One branch of an operator: an optional label, an optional filter (switch
42
+ * case condition), and its tasks. Switch defaults are marked independently so
43
+ * a platform-authored conditional branch with no label remains a case.
42
44
  * Maps to the wire `children` entry `{ label, filter?, tasks }`.
43
45
  */
44
46
  export interface OperatorChild {
45
- readonly label: string | null;
47
+ readonly label?: string | null;
48
+ readonly isDefault?: boolean;
46
49
  readonly filter?: Filter;
47
50
  readonly tasks: readonly NestedActionEntry[];
48
51
  /**
49
52
  * The switch default branch's actual display label, when it deviates from
50
53
  * the platform's usual "Default" (e.g. a manually renamed "Default Path").
51
- * Only meaningful when `label` is `null`; `label` itself stays `null` so
52
- * `to-tf.ts`/the printer can keep using it as the case-vs-default
53
- * discriminator.
54
+ * Only meaningful when `isDefault` is true.
54
55
  */
55
56
  readonly defaultLabel?: string;
56
57
  /**
57
58
  * Which wire shape to-tf.ts should emit for this switch default branch —
58
59
  * `"explicitTrueFilter"` for the older `filter = {type:"true"}` form,
59
60
  * unset/`"isDefault"` for the newer `is_default = true` form. Only
60
- * meaningful when `label` is `null`. Round-trip metadata: `edk pull`
61
+ * meaningful when `isDefault` is true. Round-trip metadata: `edk pull`
61
62
  * records whichever shape a case's export actually has (see #157); a
62
63
  * hand-authored default branch should leave this unset.
63
64
  */
@@ -81,6 +82,11 @@ export interface ActionDef<TOutput> {
81
82
  }
82
83
  /** Placeholder `forEachTaskRefKey` the forEach item proxy emits; replaced with the real refKey. */
83
84
  export declare const FOR_EACH_PLACEHOLDER = "__forEach__";
85
+ /** One finalized automation-level output property (already serialized to wire). */
86
+ export interface OutputEntry {
87
+ readonly name: string;
88
+ readonly value: unknown;
89
+ }
84
90
  /**
85
91
  * The finalized automation body `automation` embeds — the wire trigger,
86
92
  * serialized platform task list, and optional output properties. Produced by
@@ -110,8 +116,15 @@ export interface ActionChain {
110
116
  __finalize(): ActionSequenceDef;
111
117
  /** @internal — onDemand parameter metadata; empty for non-onDemand triggers. */
112
118
  __triggerParams(): readonly TriggerParamMeta[];
113
- /** @internal — output property names declared via `.outputs()`; empty if none. */
114
- __outputNames(): readonly string[];
119
+ /** @internal — output properties declared via `.outputs()`; empty if none. */
120
+ __outputEntries(): readonly OutputEntry[];
121
+ /**
122
+ * @internal — declared (wire-shaped) `output_schema` for every executeScript
123
+ * task in this chain, by refKey. Used to resolve `OutputPropertyRef.valueType`
124
+ * for an automation-level output whose value is a plain ref to one of these
125
+ * tasks' `result.<prop>`.
126
+ */
127
+ __executeScriptOutputSchemas(): ReadonlyMap<string, unknown>;
115
128
  }
116
129
  /** A value an output property can carry: a typed ctx ref, or a literal. */
117
130
  type OutputValue = Ref<unknown> | string | number | boolean | null;
@@ -161,11 +174,12 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
161
174
  readonly code: (input: ScriptInput<ResolvedRefs<NoInfer<I>>>) => R;
162
175
  /**
163
176
  * Override the inferred output schema: property name → `"text" |
164
- * "integer" | "number" | "decimal" | "boolean"`. `null` explicitly
165
- * means "no schema" and suppresses inference; omitting the option
166
- * infers from the code body.
177
+ * "integer" | "number" | "decimal" | "boolean"`, or `{ name,
178
+ * properties }` to also carry the root object's name. `null`
179
+ * explicitly means "no schema" and suppresses inference; omitting the
180
+ * option infers from the code body.
167
181
  */
168
- readonly outputs?: Record<string, string> | null;
182
+ readonly outputs?: ScriptOutputs | null;
169
183
  }, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
170
184
  result: R;
171
185
  textResult: string;
@@ -190,7 +204,7 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
190
204
  recordSearch<TName extends string, A extends AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RecordSearchOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").RecordSearchOutput<A>>;
191
205
  tableRecordsSearch<TName extends string, A extends AppOrElementRef = AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").TableRecordsSearchOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").TableRecordsSearchOutput<A>>;
192
206
  createRecord<TName extends string, A extends AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").CreateRecordOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CreateRecordOutput<A>>;
193
- updateField<TName extends string, A extends AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UpdateFieldOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
207
+ updateField<TName extends string, A extends AppOrElementRef, const Fields extends readonly import("./tasks.js").FieldAssignment[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UpdateFieldOptions<A, Fields>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
194
208
  record: RecordShape<A>;
195
209
  }>;
196
210
  findRelatedRecords<TName extends string, A extends AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").FindRelatedRecordsOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").RecordSearchOutput<A>>;
@@ -220,9 +234,7 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
220
234
  procedure<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ProcedureOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
221
235
  output: unknown;
222
236
  }>;
223
- runAutomation<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RunAutomationOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
224
- output: unknown;
225
- }>;
237
+ runAutomation<TName extends string, const A extends AutomationCatalogRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RunAutomationOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").RunAutomationOutput<A>>;
226
238
  readFile<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ReadFileOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
227
239
  output: unknown;
228
240
  }>;
@@ -260,7 +272,7 @@ export interface ForEachConfig<TTrigger, TActions extends Record<string, unknown
260
272
  readonly actions: (actions: ForEachBuilder<TTrigger, TActions, TVars, NoInfer<TItem>>) => NestedActionChain;
261
273
  }
262
274
  export interface SwitchCase<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> {
263
- readonly label: string;
275
+ readonly label?: string;
264
276
  readonly condition?: Filter;
265
277
  readonly actions: (actions: SwitchCaseBuilder<TTrigger, TActions, TVars, TItem>) => NestedActionChain;
266
278
  }
@@ -273,7 +285,7 @@ export interface SwitchConfig<TTrigger, TActions extends Record<string, unknown>
273
285
  };
274
286
  }
275
287
  export interface ForkJoinBranch<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> {
276
- readonly label: string;
288
+ readonly label?: string;
277
289
  readonly actions: (actions: ForkJoinBranchBuilder<TTrigger, TActions, TVars, TItem>) => NestedActionChain;
278
290
  }
279
291
  export interface ForkJoinConfig<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> {