@elementumai/edk 0.12.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/README.md +8 -2
  2. package/dist-sdk/src/catalog/factories.d.ts +7 -1
  3. package/dist-sdk/src/catalog/factories.js +10 -2
  4. package/dist-sdk/src/catalog/index.d.ts +2 -2
  5. package/dist-sdk/src/catalog/index.js +1 -1
  6. package/dist-sdk/src/catalog/org.js +79 -34
  7. package/dist-sdk/src/catalog/token.js +5 -0
  8. package/dist-sdk/src/catalog/types.d.ts +12 -1
  9. package/dist-sdk/src/catalog/types.js +3 -0
  10. package/dist-sdk/src/core/system-fields.d.ts +1 -1
  11. package/dist-sdk/src/core/system-fields.js +1 -1
  12. package/dist-sdk/src/core/types/app.d.ts +6 -0
  13. package/dist-sdk/src/engine/build/context.d.ts +3 -0
  14. package/dist-sdk/src/engine/coverage-gaps.d.ts +2 -0
  15. package/dist-sdk/src/engine/coverage-gaps.js +4 -0
  16. package/dist-sdk/src/engine/ei/run.d.ts +8 -0
  17. package/dist-sdk/src/engine/ei/run.js +46 -7
  18. package/dist-sdk/src/engine/pull/authored-address.js +42 -6
  19. package/dist-sdk/src/engine/pull/authored-root.d.ts +88 -0
  20. package/dist-sdk/src/engine/pull/authored-root.js +306 -0
  21. package/dist-sdk/src/engine/pull/context.d.ts +34 -0
  22. package/dist-sdk/src/engine/pull/field-refs-registry.d.ts +114 -0
  23. package/dist-sdk/src/engine/pull/field-refs-registry.js +501 -0
  24. package/dist-sdk/src/engine/pull/org.d.ts +1 -0
  25. package/dist-sdk/src/engine/pull/org.js +2 -0
  26. package/dist-sdk/src/engine/pull/partition.d.ts +8 -0
  27. package/dist-sdk/src/engine/pull/partition.js +43 -0
  28. package/dist-sdk/src/engine/pull/pulled-roots.d.ts +89 -0
  29. package/dist-sdk/src/engine/pull/pulled-roots.js +203 -0
  30. package/dist-sdk/src/engine/pull/ref-only.d.ts +4 -0
  31. package/dist-sdk/src/engine/pull/ref-only.js +7 -1
  32. package/dist-sdk/src/engine/pull/source-resources.d.ts +39 -0
  33. package/dist-sdk/src/engine/pull/source-resources.js +110 -0
  34. package/dist-sdk/src/engine/pull/stream-root.d.ts +159 -0
  35. package/dist-sdk/src/engine/pull/stream-root.js +579 -0
  36. package/dist-sdk/src/engine/workspace/authoring-layout.js +16 -2
  37. package/dist-sdk/src/engine/workspace/reserved-catalog-keys.d.ts +47 -0
  38. package/dist-sdk/src/engine/workspace/reserved-catalog-keys.js +115 -0
  39. package/dist-sdk/src/entities/access-policy/build.d.ts +2 -1
  40. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +7 -0
  41. package/dist-sdk/src/entities/access-policy/from-tf.js +17 -5
  42. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +19 -0
  43. package/dist-sdk/src/entities/access-policy/to-tf.js +65 -8
  44. package/dist-sdk/src/entities/agent/build.d.ts +52 -1
  45. package/dist-sdk/src/entities/agent/build.js +34 -0
  46. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +70 -1
  47. package/dist-sdk/src/entities/agent/from-tf.d.ts +36 -1
  48. package/dist-sdk/src/entities/agent/from-tf.js +289 -2
  49. package/dist-sdk/src/entities/agent/index.d.ts +1 -1
  50. package/dist-sdk/src/entities/agent/module.js +1 -0
  51. package/dist-sdk/src/entities/agent/to-tf.d.ts +11 -11
  52. package/dist-sdk/src/entities/agent/to-tf.js +179 -17
  53. package/dist-sdk/src/entities/agent-tool/from-tf.js +6 -0
  54. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +2 -2
  55. package/dist-sdk/src/entities/agent-tool/to-tf.js +2 -2
  56. package/dist-sdk/src/entities/app/build.d.ts +33 -13
  57. package/dist-sdk/src/entities/app/build.js +14 -12
  58. package/dist-sdk/src/entities/app/from-tf.d.ts +1 -0
  59. package/dist-sdk/src/entities/app/from-tf.js +7 -9
  60. package/dist-sdk/src/entities/app/index.d.ts +1 -0
  61. package/dist-sdk/src/entities/app/index.js +1 -0
  62. package/dist-sdk/src/entities/app/module.js +3 -0
  63. package/dist-sdk/src/entities/app/stage-keys.d.ts +2 -2
  64. package/dist-sdk/src/entities/app/stage-keys.js +3 -3
  65. package/dist-sdk/src/entities/app/to-tf.js +1 -0
  66. package/dist-sdk/src/entities/approval-chain/build.d.ts +46 -11
  67. package/dist-sdk/src/entities/approval-chain/build.js +120 -8
  68. package/dist-sdk/src/entities/approval-chain/from-tf.d.ts +24 -2
  69. package/dist-sdk/src/entities/approval-chain/from-tf.js +148 -6
  70. package/dist-sdk/src/entities/approval-chain/index.d.ts +4 -1
  71. package/dist-sdk/src/entities/approval-chain/index.js +4 -1
  72. package/dist-sdk/src/entities/approval-chain/module.js +23 -5
  73. package/dist-sdk/src/entities/approval-chain/printer.d.ts +1 -1
  74. package/dist-sdk/src/entities/approval-chain/printer.js +91 -5
  75. package/dist-sdk/src/entities/approval-chain/steps-tf.d.ts +77 -0
  76. package/dist-sdk/src/entities/approval-chain/steps-tf.js +255 -0
  77. package/dist-sdk/src/entities/approval-chain/steps.d.ts +71 -0
  78. package/dist-sdk/src/entities/approval-chain/steps.js +83 -0
  79. package/dist-sdk/src/entities/approval-chain/to-tf.d.ts +16 -6
  80. package/dist-sdk/src/entities/approval-chain/to-tf.js +37 -4
  81. package/dist-sdk/src/entities/automation/build.d.ts +10 -1
  82. package/dist-sdk/src/entities/automation/build.js +70 -27
  83. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +21 -5
  84. package/dist-sdk/src/entities/automation/from-tf.d.ts +26 -5
  85. package/dist-sdk/src/entities/automation/from-tf.js +665 -112
  86. package/dist-sdk/src/entities/automation/index.d.ts +2 -1
  87. package/dist-sdk/src/entities/automation/index.js +1 -0
  88. package/dist-sdk/src/entities/automation/module.d.ts +4 -3
  89. package/dist-sdk/src/entities/automation/module.js +45 -12
  90. package/dist-sdk/src/entities/automation/refs-read.d.ts +19 -0
  91. package/dist-sdk/src/entities/automation/refs-read.js +48 -0
  92. package/dist-sdk/src/entities/automation/slack-message-refs.d.ts +9 -0
  93. package/dist-sdk/src/entities/automation/slack-message-refs.js +75 -0
  94. package/dist-sdk/src/entities/automation/system-ref-name.d.ts +23 -3
  95. package/dist-sdk/src/entities/automation/system-ref-name.js +86 -4
  96. package/dist-sdk/src/entities/automation/task-output-labels.d.ts +11 -0
  97. package/dist-sdk/src/entities/automation/task-output-labels.js +23 -0
  98. package/dist-sdk/src/entities/automation/tasks.d.ts +29 -4
  99. package/dist-sdk/src/entities/automation/tasks.js +34 -11
  100. package/dist-sdk/src/entities/automation/to-tf.d.ts +8 -1
  101. package/dist-sdk/src/entities/automation/to-tf.js +563 -103
  102. package/dist-sdk/src/entities/automation/triggers.d.ts +0 -8
  103. package/dist-sdk/src/entities/automation/triggers.js +26 -11
  104. package/dist-sdk/src/entities/automation/unsafe-script-output.d.ts +50 -0
  105. package/dist-sdk/src/entities/automation/unsafe-script-output.js +92 -0
  106. package/dist-sdk/src/entities/chart/build.d.ts +9 -1
  107. package/dist-sdk/src/entities/chart/from-tf.js +3 -0
  108. package/dist-sdk/src/entities/chart/to-tf.js +19 -2
  109. package/dist-sdk/src/entities/dashboard/from-tf.d.ts +3 -1
  110. package/dist-sdk/src/entities/dashboard/from-tf.js +42 -2
  111. package/dist-sdk/src/entities/dashboard/to-tf.js +9 -1
  112. package/dist-sdk/src/entities/dashboard-widget-order/module.d.ts +10 -0
  113. package/dist-sdk/src/entities/dashboard-widget-order/module.js +25 -0
  114. package/dist-sdk/src/entities/dashboard-widget-order/order.d.ts +31 -0
  115. package/dist-sdk/src/entities/dashboard-widget-order/order.js +102 -0
  116. package/dist-sdk/src/entities/dynamic-layout/build.d.ts +2 -0
  117. package/dist-sdk/src/entities/dynamic-layout/from-tf.js +44 -5
  118. package/dist-sdk/src/entities/dynamic-layout/to-tf.js +46 -12
  119. package/dist-sdk/src/entities/element/audit-field-guard.d.ts +9 -0
  120. package/dist-sdk/src/entities/element/audit-field-guard.js +88 -0
  121. package/dist-sdk/src/entities/element/build.js +2 -1
  122. package/dist-sdk/src/entities/element/from-tf.d.ts +1 -0
  123. package/dist-sdk/src/entities/element/from-tf.js +4 -7
  124. package/dist-sdk/src/entities/element/module.js +5 -0
  125. package/dist-sdk/src/entities/element/system-fields.d.ts +13 -0
  126. package/dist-sdk/src/entities/element/system-fields.js +23 -0
  127. package/dist-sdk/src/entities/element/to-tf.js +1 -0
  128. package/dist-sdk/src/entities/field/build.d.ts +9 -0
  129. package/dist-sdk/src/entities/field/from-tf.d.ts +52 -1
  130. package/dist-sdk/src/entities/field/from-tf.js +212 -14
  131. package/dist-sdk/src/entities/field/module.js +4 -0
  132. package/dist-sdk/src/entities/field/to-tf.d.ts +5 -1
  133. package/dist-sdk/src/entities/field/to-tf.js +33 -12
  134. package/dist-sdk/src/entities/org/category.js +1 -0
  135. package/dist-sdk/src/entities/org/index.d.ts +1 -0
  136. package/dist-sdk/src/entities/org/index.js +1 -0
  137. package/dist-sdk/src/entities/org/voice-auth.d.ts +5 -0
  138. package/dist-sdk/src/entities/org/voice-auth.js +33 -0
  139. package/dist-sdk/src/entities/organization/build.d.ts +3 -0
  140. package/dist-sdk/src/entities/organization/build.js +2 -0
  141. package/dist-sdk/src/entities/organization/index.d.ts +1 -0
  142. package/dist-sdk/src/entities/organization/index.js +1 -0
  143. package/dist-sdk/src/entities/organization/to-tf.d.ts +2 -0
  144. package/dist-sdk/src/entities/organization/to-tf.js +59 -1
  145. package/dist-sdk/src/entities/organization/voice-auth.d.ts +60 -0
  146. package/dist-sdk/src/entities/organization/voice-auth.js +60 -0
  147. package/dist-sdk/src/entities/phone-service/build.d.ts +9 -1
  148. package/dist-sdk/src/entities/phone-service/build.js +1 -0
  149. package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +3 -0
  150. package/dist-sdk/src/entities/phone-service/from-tf.d.ts +1 -0
  151. package/dist-sdk/src/entities/phone-service/from-tf.js +8 -1
  152. package/dist-sdk/src/entities/phone-service/to-tf.js +16 -0
  153. package/dist-sdk/src/entities/record-create-form/from-tf.js +2 -2
  154. package/dist-sdk/src/entities/relationship/from-tf.js +9 -4
  155. package/dist-sdk/src/entities/relationship/module.js +2 -2
  156. package/dist-sdk/src/entities/relationship/pair-check.d.ts +6 -2
  157. package/dist-sdk/src/entities/relationship/pair-check.js +105 -18
  158. package/dist-sdk/src/entities/relationship/to-tf.js +5 -2
  159. package/dist-sdk/src/entities/role/build.d.ts +3 -4
  160. package/dist-sdk/src/entities/role/permission-levels.d.ts +7 -0
  161. package/dist-sdk/src/entities/role/permission-levels.js +78 -0
  162. package/dist-sdk/src/entities/role/to-tf.js +32 -2
  163. package/dist-sdk/src/entities/search-table/build.d.ts +9 -3
  164. package/dist-sdk/src/entities/search-table/build.js +4 -4
  165. package/dist-sdk/src/entities/search-table/printer.js +3 -1
  166. package/dist-sdk/src/entities/search-table/to-tf.js +20 -2
  167. package/dist-sdk/src/entities/service-account/module.d.ts +2 -1
  168. package/dist-sdk/src/entities/service-account/module.js +4 -1
  169. package/dist-sdk/src/entities/service-account/resource-type.d.ts +2 -0
  170. package/dist-sdk/src/entities/service-account/resource-type.js +2 -0
  171. package/dist-sdk/src/entities/service-account/role-membership-check.d.ts +20 -0
  172. package/dist-sdk/src/entities/service-account/role-membership-check.js +80 -0
  173. package/dist-sdk/src/entities/shared/aspect-target-from-tf.d.ts +15 -0
  174. package/dist-sdk/src/entities/shared/aspect-target-from-tf.js +36 -0
  175. package/dist-sdk/src/entities/shared/context.d.ts +14 -1
  176. package/dist-sdk/src/entities/shared/filters/ast.d.ts +2 -0
  177. package/dist-sdk/src/entities/shared/filters/index.d.ts +97 -15
  178. package/dist-sdk/src/entities/shared/filters/index.js +30 -7
  179. package/dist-sdk/src/entities/shared/filters/option-lookups.d.ts +57 -0
  180. package/dist-sdk/src/entities/shared/filters/option-lookups.js +108 -0
  181. package/dist-sdk/src/entities/shared/filters/print.d.ts +2 -0
  182. package/dist-sdk/src/entities/shared/filters/print.js +19 -6
  183. package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +16 -7
  184. package/dist-sdk/src/entities/shared/filters/tf-codec.js +25 -5
  185. package/dist-sdk/src/entities/shared/filters/types.d.ts +4 -0
  186. package/dist-sdk/src/entities/shared/raw-option-id.d.ts +30 -0
  187. package/dist-sdk/src/entities/shared/raw-option-id.js +41 -0
  188. package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +1 -1
  189. package/dist-sdk/src/entities/shared/tool-field-ref.js +3 -2
  190. package/dist-sdk/src/entities/skill/input-coverage.js +5 -2
  191. package/dist-sdk/src/entities/sla/build.d.ts +96 -0
  192. package/dist-sdk/src/entities/sla/build.js +124 -0
  193. package/dist-sdk/src/entities/sla/from-tf.d.ts +40 -0
  194. package/dist-sdk/src/entities/sla/from-tf.js +164 -0
  195. package/dist-sdk/src/entities/sla/index.d.ts +1 -0
  196. package/dist-sdk/src/entities/sla/index.js +1 -0
  197. package/dist-sdk/src/entities/sla/module.d.ts +4 -0
  198. package/dist-sdk/src/entities/sla/module.js +73 -0
  199. package/dist-sdk/src/entities/sla/printer.d.ts +2 -0
  200. package/dist-sdk/src/entities/sla/printer.js +84 -0
  201. package/dist-sdk/src/entities/sla/to-tf.d.ts +12 -0
  202. package/dist-sdk/src/entities/sla/to-tf.js +81 -0
  203. package/dist-sdk/src/entities/table/build.d.ts +7 -2
  204. package/dist-sdk/src/entities/table/build.js +22 -1
  205. package/dist-sdk/src/entities/table/deserializer/normalize.d.ts +4 -1
  206. package/dist-sdk/src/entities/table/from-tf.js +89 -14
  207. package/dist-sdk/src/entities/table/index.d.ts +1 -1
  208. package/dist-sdk/src/entities/table/to-tf.js +41 -2
  209. package/dist-sdk/src/entities/task/from-tf.js +3 -2
  210. package/dist-sdk/src/entities/view/custom-view-validate.d.ts +6 -4
  211. package/dist-sdk/src/entities/view/custom-view-validate.js +36 -18
  212. package/dist-sdk/src/entities/view/from-tf.js +16 -4
  213. package/dist-sdk/src/entities/view/to-tf.js +66 -47
  214. package/dist-sdk/src/entities/visual-flow/module.js +52 -1
  215. package/dist-sdk/src/entities/widget/from-tf.js +19 -8
  216. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +49 -4
  217. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
  218. package/dist-sdk/src/graph/index.d.ts +9 -0
  219. package/dist-sdk/src/graph/index.js +8 -0
  220. package/dist-sdk/src/graph/modules.js +13 -1
  221. package/dist-sdk/src/graph/resource-types.d.ts +47 -0
  222. package/dist-sdk/src/graph/resource-types.js +62 -0
  223. package/dist-sdk/src/graph/types.d.ts +113 -6
  224. package/package.json +7 -4
@@ -3,13 +3,28 @@ import { isExpr } from "../field/calc/runtime.js";
3
3
  import { isRef } from "../shared/ref.js";
4
4
  import { renderCalculationExpression, } from "./calculation-expression.js";
5
5
  import { extractScriptBody, isScriptFile, readScriptFile, toPlatformScriptBody } from "./script-code.js";
6
- function workflowFields(fields) {
6
+ /**
7
+ * Where an undefined `fields[i].field` most likely came from, for the error.
8
+ * `catalog.<owner>.fields.someKey` evaluates to undefined when the key is not
9
+ * in the owner's fields bag: renamed or removed in source (#1579), or added
10
+ * in Elementum after the owner's source was last pulled, while the pulled
11
+ * automation already uses it (#2629). Build names the exact keys it can find
12
+ * in the file; this names the owner and the pull that refreshes it.
13
+ */
14
+ function missingFieldHint(target) {
15
+ const owner = target;
16
+ if (owner?.refName === undefined)
17
+ return "Check the key against its app/element's fields bag.";
18
+ const kind = owner.__kind === "element" || owner.__kind === "task" ? owner.__kind : "app";
19
+ const label = `${kind} ${JSON.stringify(owner.name ?? owner.refName)}`;
20
+ return (`The key is not in the fields bag of ${label} (catalog.${owner.refName}.fields). ` +
21
+ `If the field was added or renamed in Elementum after that ${kind} was last pulled, run ` +
22
+ `\`elementum pull ${kind} ${owner.namespace ?? owner.refName}\`; if it was renamed or removed in source, use its current key.`);
23
+ }
24
+ function workflowFields(action, target, fields) {
7
25
  return fields.map((f, index) => {
8
26
  if (typeof f.field !== "object" || f.field === null) {
9
- // `app.fields.someKey` evaluates to undefined when the key is not in the
10
- // bag (renamed or removed, e.g. by a re-pull, #1579).
11
- throw new Error(`updateField: fields[${index}].field is ${String(f.field)}; the field key it reads does not exist on its app/element ` +
12
- "(renamed or removed?). Check the app's fields bag for the current key.");
27
+ throw new Error(`${action}: fields[${index}].field is ${String(f.field)}: the field key it reads does not exist. ${missingFieldHint(target)}`);
13
28
  }
14
29
  const updateMode = "updateMode" in f ? f.updateMode : undefined;
15
30
  const fieldType = "fieldType" in f.field ? f.field.fieldType : undefined;
@@ -60,7 +75,7 @@ export function createRecord(opts) {
60
75
  key: "createRecord",
61
76
  config: {
62
77
  aspectId: opts.app,
63
- workflowFields: workflowFields(opts.fields),
78
+ workflowFields: workflowFields("createRecord", opts.app, opts.fields),
64
79
  relateToRecord: opts.relateToRecord ?? false,
65
80
  ...(opts.record !== undefined ? { recordReference: serializeValueOrRef(opts.record) } : {}),
66
81
  },
@@ -77,7 +92,7 @@ export function updateField(opts) {
77
92
  config: {
78
93
  aspectId: opts.app,
79
94
  recordReference: serializeValueOrRef(opts.record),
80
- workflowFields: workflowFields(opts.fields),
95
+ workflowFields: workflowFields("updateField", opts.app, opts.fields),
81
96
  },
82
97
  __recordApp: opts.app.refName,
83
98
  ...recordKindOf(opts.app),
@@ -95,7 +110,7 @@ export function bulkUpdateFields(opts) {
95
110
  config: {
96
111
  aspectId: opts.app,
97
112
  filter: opts.filter,
98
- workflowFields: workflowFields(opts.fields),
113
+ workflowFields: workflowFields("bulkUpdateFields", opts.app, opts.fields),
99
114
  },
100
115
  __recordApp: opts.app.refName,
101
116
  ...recordKindOf(opts.app),
@@ -491,12 +506,16 @@ export function aiSummarize(opts) {
491
506
  };
492
507
  }
493
508
  export function aiTransform(opts) {
509
+ if (opts.dimensions !== undefined && (!Number.isInteger(opts.dimensions) || opts.dimensions < 1)) {
510
+ throw new Error(`aiTransform dimensions must be a whole number ≥ 1 (got ${String(opts.dimensions)}).`);
511
+ }
494
512
  return {
495
513
  key: "aiTransform",
496
514
  config: {
497
515
  prompt: serializeValueOrRef(opts.prompt),
498
516
  fieldType: opts.fieldType,
499
517
  ...connectorSlot(opts.connector),
518
+ ...(opts.dimensions !== undefined ? { dimensions: opts.dimensions } : {}),
500
519
  },
501
520
  };
502
521
  }
@@ -592,14 +611,16 @@ export function assignGroup(opts) {
592
611
  return { key: "assignGroup", config: { fieldId: opts.field, groupId: opts.groupId } };
593
612
  }
594
613
  export function addWatcher(opts) {
595
- if (!opts.userIds?.length && !opts.groupIds?.length) {
596
- throw new Error("addWatcher requires at least one of: userIds or groupIds.");
614
+ if (!opts.userIds?.length && !opts.groupIds?.length && !opts.userRefs?.length && !opts.groupRefs?.length) {
615
+ throw new Error("addWatcher requires at least one of: userIds, groupIds, userRefs, or groupRefs.");
597
616
  }
598
617
  return {
599
618
  key: "addWatcher",
600
619
  config: {
601
620
  ...(opts.userIds?.length ? { userIds: opts.userIds } : {}),
602
621
  ...(opts.groupIds?.length ? { groupIds: opts.groupIds } : {}),
622
+ ...(opts.userRefs?.length ? { users: refList(opts.userRefs) } : {}),
623
+ ...(opts.groupRefs?.length ? { groups: refList(opts.groupRefs) } : {}),
603
624
  ...(opts.record !== undefined ? { recordReference: serializeValueOrRef(opts.record) } : {}),
604
625
  },
605
626
  };
@@ -846,7 +867,8 @@ export function approvalStatusUpdate(opts) {
846
867
  return {
847
868
  key: "approvalStatusUpdate",
848
869
  config: {
849
- approvalReference: serializeValueOrRef(opts.approvalReference),
870
+ approvalReference: opts.approvalReference,
871
+ recordReference: serializeValueOrRef(opts.record),
850
872
  status: opts.status,
851
873
  ...(opts.reason !== undefined ? { reason: serializeValueOrRef(opts.reason) } : {}),
852
874
  },
@@ -915,6 +937,7 @@ export function approvalChain(opts) {
915
937
  ...(opts.approvers !== undefined ? { approverReferences: opts.approvers.map((a) => serializeValueOrRef(a)) } : {}),
916
938
  ...(opts.reason !== undefined ? { reason: serializeValueOrRef(opts.reason) } : {}),
917
939
  ...(opts.summary !== undefined ? { summary: serializeValueOrRef(opts.summary) } : {}),
940
+ ...(opts.tag !== undefined ? { tags: serializeValueOrRef(opts.tag) } : {}),
918
941
  },
919
942
  };
920
943
  }
@@ -2,8 +2,9 @@ import type { DeployableEntity } from "../../engine/entity.js";
2
2
  import { type ValidationFailure } from "../../engine/validation.js";
3
3
  import { type TfBlock, type TfValue } from "../../engine/tf/index.js";
4
4
  import { type ForeignRootIdentity, type OrgRefLookup, type WorkspaceAspect } from "../../engine/build/context.js";
5
- import type { BuildFieldMetadata } from "../../graph/types.js";
5
+ import type { AdvisoryWhileRecorded, BuildFieldMetadata } from "../../graph/types.js";
6
6
  import type { AppServiceAccount } from "../service-account/build.js";
7
+ import type { OptionIdIndex } from "../../engine/pull/field-refs-registry.js";
7
8
  export interface AutomationToTfContext {
8
9
  /** The owning app or element's refName. */
9
10
  readonly appRefName?: string;
@@ -33,6 +34,10 @@ export interface AutomationToTfContext {
33
34
  * searched aspect's own `<resource>.<label>.id` to interpolate.
34
35
  */
35
36
  readonly fieldAddressesByAppRefName?: ReadonlyMap<string, ReadonlyMap<string, string>>;
37
+ /** Org catalog field types for every app/element it lists, keyed by refName and then field key. */
38
+ readonly catalogFieldTypesByAppRefName?: ReadonlyMap<string, ReadonlyMap<string, string>>;
39
+ /** Whole-object findings, advisories only while the revision record lists them (#2283). */
40
+ readonly advisoriesWhileRecorded?: AdvisoryWhileRecorded[];
36
41
  /**
37
42
  * Every app/element authored in the workspace, keyed by
38
43
  * `workspaceAspectKey`, including those this build leaves out (pull builds
@@ -42,6 +47,8 @@ export interface AutomationToTfContext {
42
47
  readonly authoredAspectKeys?: ReadonlySet<string>;
43
48
  /** Build-time tolerance for stale labels retained by pulled automations. */
44
49
  readonly allowUnknownPicklistOptions?: boolean;
50
+ /** Option ids known offline, so a raw id's warning can name its label (#1733). */
51
+ readonly optionIds?: OptionIdIndex;
45
52
  readonly orgRefs?: OrgRefLookup;
46
53
  readonly diagnostics?: string[];
47
54
  readonly serviceAccounts?: Readonly<Record<string, AppServiceAccount>>;