@elementumai/edk 0.10.4 → 0.12.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.
Files changed (171) hide show
  1. package/README.md +49 -13
  2. package/dist-sdk/src/catalog/token.js +2 -1
  3. package/dist-sdk/src/core/triggers/on-demand.d.ts +2 -0
  4. package/dist-sdk/src/core/triggers/on-demand.js +3 -0
  5. package/dist-sdk/src/core/wire/ref-serializer.js +26 -1
  6. package/dist-sdk/src/engine/build/context.d.ts +4 -0
  7. package/dist-sdk/src/engine/coverage-gaps.d.ts +7 -0
  8. package/dist-sdk/src/engine/coverage-gaps.js +12 -0
  9. package/dist-sdk/src/engine/ei/json-stream-reader.d.ts +43 -0
  10. package/dist-sdk/src/engine/ei/json-stream-reader.js +234 -0
  11. package/dist-sdk/src/engine/ei/run.d.ts +42 -1
  12. package/dist-sdk/src/engine/ei/run.js +201 -32
  13. package/dist-sdk/src/engine/ei/saved-plan.d.ts +16 -0
  14. package/dist-sdk/src/engine/ei/saved-plan.js +19 -0
  15. package/dist-sdk/src/engine/ei/state.d.ts +1 -1
  16. package/dist-sdk/src/engine/ei/state.js +17 -4
  17. package/dist-sdk/src/engine/progress.d.ts +3 -1
  18. package/dist-sdk/src/engine/progress.js +7 -3
  19. package/dist-sdk/src/engine/pull/authored-address.d.ts +15 -1
  20. package/dist-sdk/src/engine/pull/authored-address.js +180 -29
  21. package/dist-sdk/src/engine/pull/context.d.ts +37 -2
  22. package/dist-sdk/src/engine/pull/context.js +7 -4
  23. package/dist-sdk/src/engine/pull/ref-only.d.ts +18 -0
  24. package/dist-sdk/src/engine/pull/ref-only.js +52 -0
  25. package/dist-sdk/src/engine/tf/index.d.ts +2 -2
  26. package/dist-sdk/src/engine/tf/index.js +2 -2
  27. package/dist-sdk/src/engine/tf/labels.d.ts +22 -0
  28. package/dist-sdk/src/engine/tf/labels.js +50 -0
  29. package/dist-sdk/src/engine/tf/model.d.ts +2 -0
  30. package/dist-sdk/src/engine/tf/model.js +26 -0
  31. package/dist-sdk/src/engine/validation.d.ts +2 -0
  32. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +18 -0
  33. package/dist-sdk/src/entities/access-policy/from-tf.js +58 -24
  34. package/dist-sdk/src/entities/access-policy/member-list.d.ts +32 -0
  35. package/dist-sdk/src/entities/access-policy/member-list.js +57 -0
  36. package/dist-sdk/src/entities/access-policy/module.js +10 -0
  37. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +4 -3
  38. package/dist-sdk/src/entities/access-policy/to-tf.js +21 -12
  39. package/dist-sdk/src/entities/agent/build.js +7 -5
  40. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +2 -0
  41. package/dist-sdk/src/entities/agent/from-tf.js +13 -3
  42. package/dist-sdk/src/entities/agent/to-tf.js +11 -5
  43. package/dist-sdk/src/entities/agent/tools.d.ts +8 -0
  44. package/dist-sdk/src/entities/agent/tools.js +6 -2
  45. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +2 -0
  46. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +29 -0
  47. package/dist-sdk/src/entities/agent-tool/to-tf.js +56 -3
  48. package/dist-sdk/src/entities/agent-tool/types.d.ts +12 -8
  49. package/dist-sdk/src/entities/agent-tool/types.js +13 -9
  50. package/dist-sdk/src/entities/app/build.d.ts +12 -1
  51. package/dist-sdk/src/entities/app/build.js +80 -4
  52. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +5 -7
  53. package/dist-sdk/src/entities/app/from-tf.js +17 -12
  54. package/dist-sdk/src/entities/app/stage-keys.d.ts +18 -3
  55. package/dist-sdk/src/entities/app/stage-keys.js +40 -6
  56. package/dist-sdk/src/entities/app/to-tf.js +7 -4
  57. package/dist-sdk/src/entities/automation/build.d.ts +52 -31
  58. package/dist-sdk/src/entities/automation/build.js +59 -20
  59. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +7 -4
  60. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +39 -14
  61. package/dist-sdk/src/entities/automation/from-tf.d.ts +35 -2
  62. package/dist-sdk/src/entities/automation/from-tf.js +721 -93
  63. package/dist-sdk/src/entities/automation/index.d.ts +1 -1
  64. package/dist-sdk/src/entities/automation/module.d.ts +22 -2
  65. package/dist-sdk/src/entities/automation/module.js +244 -57
  66. package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +22 -2
  67. package/dist-sdk/src/entities/automation/output-key-wire-name.js +54 -3
  68. package/dist-sdk/src/entities/automation/run-target.d.ts +61 -0
  69. package/dist-sdk/src/entities/automation/run-target.js +104 -0
  70. package/dist-sdk/src/entities/automation/script-code.d.ts +11 -1
  71. package/dist-sdk/src/entities/automation/script-code.js +106 -4
  72. package/dist-sdk/src/entities/automation/script-lint.d.ts +13 -0
  73. package/dist-sdk/src/entities/automation/script-lint.js +418 -0
  74. package/dist-sdk/src/entities/automation/task-output-labels.d.ts +17 -1
  75. package/dist-sdk/src/entities/automation/task-output-labels.js +58 -1
  76. package/dist-sdk/src/entities/automation/tasks.d.ts +67 -22
  77. package/dist-sdk/src/entities/automation/tasks.js +18 -4
  78. package/dist-sdk/src/entities/automation/to-tf.d.ts +1 -3
  79. package/dist-sdk/src/entities/automation/to-tf.js +354 -64
  80. package/dist-sdk/src/entities/automation/triggers.d.ts +63 -11
  81. package/dist-sdk/src/entities/automation/triggers.js +45 -5
  82. package/dist-sdk/src/entities/automation/types.d.ts +21 -0
  83. package/dist-sdk/src/entities/automation/types.js +26 -0
  84. package/dist-sdk/src/entities/chart/build.d.ts +9 -1
  85. package/dist-sdk/src/entities/chart/from-tf.d.ts +2 -2
  86. package/dist-sdk/src/entities/chart/from-tf.js +25 -1
  87. package/dist-sdk/src/entities/chart/index.d.ts +1 -1
  88. package/dist-sdk/src/entities/chart/printer.js +5 -2
  89. package/dist-sdk/src/entities/chart/to-tf.js +19 -1
  90. package/dist-sdk/src/entities/dashboard/from-tf.d.ts +11 -1
  91. package/dist-sdk/src/entities/dashboard/from-tf.js +57 -7
  92. package/dist-sdk/src/entities/dashboard/to-tf.js +13 -0
  93. package/dist-sdk/src/entities/dynamic-layout/build.d.ts +8 -2
  94. package/dist-sdk/src/entities/dynamic-layout/condition-keys.d.ts +48 -0
  95. package/dist-sdk/src/entities/dynamic-layout/condition-keys.js +261 -0
  96. package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +3 -0
  97. package/dist-sdk/src/entities/dynamic-layout/from-tf.js +66 -20
  98. package/dist-sdk/src/entities/dynamic-layout/module.js +2 -1
  99. package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +4 -2
  100. package/dist-sdk/src/entities/dynamic-layout/to-tf.js +341 -32
  101. package/dist-sdk/src/entities/element/build.d.ts +10 -0
  102. package/dist-sdk/src/entities/element/build.js +1 -0
  103. package/dist-sdk/src/entities/element/from-tf.js +14 -9
  104. package/dist-sdk/src/entities/element/to-tf.js +7 -4
  105. package/dist-sdk/src/entities/field/from-tf.d.ts +24 -0
  106. package/dist-sdk/src/entities/field/from-tf.js +79 -1
  107. package/dist-sdk/src/entities/field/module.js +14 -1
  108. package/dist-sdk/src/entities/field/to-tf.d.ts +38 -3
  109. package/dist-sdk/src/entities/field/to-tf.js +108 -34
  110. package/dist-sdk/src/entities/file-reader/module.js +3 -3
  111. package/dist-sdk/src/entities/file-reader/to-tf.js +3 -3
  112. package/dist-sdk/src/entities/file-reader/types.d.ts +4 -16
  113. package/dist-sdk/src/entities/file-reader/types.js +7 -0
  114. package/dist-sdk/src/entities/org/group.d.ts +1 -0
  115. package/dist-sdk/src/entities/org/group.js +2 -1
  116. package/dist-sdk/src/entities/org/role.js +5 -0
  117. package/dist-sdk/src/entities/record-create-form/from-tf.d.ts +8 -0
  118. package/dist-sdk/src/entities/record-create-form/from-tf.js +10 -2
  119. package/dist-sdk/src/entities/record-create-form/to-tf.d.ts +2 -1
  120. package/dist-sdk/src/entities/record-create-form/to-tf.js +14 -2
  121. package/dist-sdk/src/entities/relationship/from-tf.d.ts +8 -0
  122. package/dist-sdk/src/entities/relationship/from-tf.js +88 -10
  123. package/dist-sdk/src/entities/relationship/to-tf.d.ts +3 -2
  124. package/dist-sdk/src/entities/relationship/to-tf.js +79 -8
  125. package/dist-sdk/src/entities/role/from-tf.js +24 -7
  126. package/dist-sdk/src/entities/role/to-tf.js +25 -7
  127. package/dist-sdk/src/entities/service-account/from-tf.js +2 -1
  128. package/dist-sdk/src/entities/service-account/module.js +20 -0
  129. package/dist-sdk/src/entities/service-account/role-fidelity.d.ts +5 -5
  130. package/dist-sdk/src/entities/service-account/role-fidelity.js +21 -13
  131. package/dist-sdk/src/entities/service-account/to-tf.js +12 -4
  132. package/dist-sdk/src/entities/shared/filters/ast.d.ts +2 -0
  133. package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +1 -1
  134. package/dist-sdk/src/entities/shared/filters/tf-codec.js +12 -7
  135. package/dist-sdk/src/entities/shared/types/field-types.d.ts +6 -3
  136. package/dist-sdk/src/entities/shared/types/field-types.js +3 -1
  137. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +5 -2
  138. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +8 -1
  139. package/dist-sdk/src/entities/skill/from-tf.js +10 -3
  140. package/dist-sdk/src/entities/skill/module.js +18 -0
  141. package/dist-sdk/src/entities/skill/to-tf.d.ts +8 -1
  142. package/dist-sdk/src/entities/skill/to-tf.js +23 -14
  143. package/dist-sdk/src/entities/skill/tools.d.ts +8 -0
  144. package/dist-sdk/src/entities/skill/tools.js +6 -2
  145. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +2 -0
  146. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +8 -0
  147. package/dist-sdk/src/entities/skill-tool/to-tf.js +6 -2
  148. package/dist-sdk/src/entities/task/to-tf.js +1 -0
  149. package/dist-sdk/src/entities/view/agent-view-layout-from-tf.d.ts +8 -2
  150. package/dist-sdk/src/entities/view/agent-view-layout-from-tf.js +20 -10
  151. package/dist-sdk/src/entities/view/from-tf.d.ts +68 -4
  152. package/dist-sdk/src/entities/view/from-tf.js +394 -22
  153. package/dist-sdk/src/entities/view/module.js +20 -0
  154. package/dist-sdk/src/entities/view/portable.d.ts +11 -0
  155. package/dist-sdk/src/entities/view/portable.js +47 -0
  156. package/dist-sdk/src/entities/view/to-tf.d.ts +4 -1
  157. package/dist-sdk/src/entities/view/to-tf.js +25 -7
  158. package/dist-sdk/src/entities/view/types.js +1 -1
  159. package/dist-sdk/src/entities/widget/build.d.ts +4 -3
  160. package/dist-sdk/src/entities/widget/from-tf.d.ts +3 -0
  161. package/dist-sdk/src/entities/widget/from-tf.js +100 -3
  162. package/dist-sdk/src/entities/widget/to-tf.d.ts +16 -1
  163. package/dist-sdk/src/entities/widget/to-tf.js +77 -14
  164. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +30 -9
  165. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
  166. package/dist-sdk/src/graph/field-resource-types.d.ts +2 -0
  167. package/dist-sdk/src/graph/field-resource-types.js +11 -0
  168. package/dist-sdk/src/graph/index.d.ts +41 -3
  169. package/dist-sdk/src/graph/index.js +24 -2
  170. package/dist-sdk/src/graph/types.d.ts +195 -5
  171. package/package.json +1 -1
@@ -116,8 +116,11 @@ type ValidatedUpdateFieldAssignments<Fields extends readonly FieldAssignment[]>
116
116
  };
117
117
  export interface UpdateFieldOptions<A extends AppOrElementOrTaskRef = AppOrElementOrTaskRef, Fields extends readonly FieldAssignment[] = readonly FieldAssignment[]> {
118
118
  readonly app: A;
119
- /** The record to update (e.g. `ctx.trigger.record` or `.record.recordId`). */
120
- readonly record: RecordReference<A>;
119
+ /**
120
+ * The record to update (e.g. `ctx.trigger.record` or `.record.recordId`),
121
+ * or every record a search found (`ctx.actions.<search>.records`).
122
+ */
123
+ readonly record: RecordReference<A> | Ref<readonly RecordShape<A>[]>;
121
124
  readonly fields: Fields & ValidatedUpdateFieldAssignments<NoInfer<Fields>>;
122
125
  }
123
126
  /** Update fields on an existing record. `value: ""` or `value: null` clears a nullable field (including Dropdown). */
@@ -168,11 +171,23 @@ export interface RelateRecordsOptions {
168
171
  readonly target: ValueOrRef<unknown>;
169
172
  }
170
173
  export declare function relateRecords(opts: RelateRecordsOptions): ActionDef<Record<string, never>>;
171
- /** An email attachment: a literal/ref file value, or an existing record's attachment field to reuse. */
174
+ /**
175
+ * A file to attach to the email. Set exactly one key: `attachment` is an
176
+ * attachment field, `file` is a file from the trigger or an earlier task, and
177
+ * `record` attaches every file on a record.
178
+ */
172
179
  export type EmailAttachment = {
180
+ readonly attachment: ValueOrRef<unknown>;
181
+ readonly file?: never;
182
+ readonly record?: never;
183
+ } | {
173
184
  readonly file: ValueOrRef<unknown>;
185
+ readonly attachment?: never;
186
+ readonly record?: never;
174
187
  } | {
175
- readonly fromRecord: ValueOrRef<unknown>;
188
+ readonly record: ValueOrRef<unknown>;
189
+ readonly attachment?: never;
190
+ readonly file?: never;
176
191
  };
177
192
  export interface SendEmailOptions {
178
193
  readonly subject: ValueOrRef<unknown>;
@@ -185,12 +200,19 @@ export interface SendEmailOptions {
185
200
  readonly toGroups?: readonly ValueOrRef<unknown>[];
186
201
  /** Literal email addresses. */
187
202
  readonly toAddresses?: readonly ValueOrRef<unknown>[];
203
+ /** Files to attach. Omit to leave the live attachments as they are; `[]` removes them. */
188
204
  readonly attachments?: readonly EmailAttachment[];
205
+ /**
206
+ * The platform id of a DNS-verified sending domain. Omit to keep the live
207
+ * task's domain, including one chosen in the web app; omitting it does not
208
+ * reset the task to the default domain.
209
+ */
210
+ readonly emailSendDomainId?: string;
189
211
  }
190
212
  export declare function sendEmail(opts: SendEmailOptions): ActionDef<Record<string, never>>;
191
213
  export interface PostCommentOptions {
192
214
  readonly contents: ValueOrRef<unknown>;
193
- /** Conversation tags. Omit for an untagged comment — the provider's message task has no tags of its own. */
215
+ /** Channel (Select Channel): omit or `["public"]` for the Public Channel; `["consumer"]` for the Customer Channel (needs customer chat on the app's record comments). */
194
216
  readonly tags?: readonly string[];
195
217
  /** The record to comment on (required). */
196
218
  readonly record: ValueOrRef<unknown>;
@@ -316,12 +338,13 @@ type ExecuteScriptFieldValue<T extends ScriptOutputType> = T extends {
316
338
  readonly [K in keyof P]: ExecuteScriptFieldValue<P[K]>;
317
339
  } : T extends {
318
340
  readonly type: "object";
319
- } ? Record<string, unknown> : T extends "integer" | "number" | "decimal" ? number : T extends "boolean" ? boolean : string;
341
+ } | "object" ? Record<string, unknown> : T extends "integer" | "number" | "decimal" ? number : T extends "boolean" ? boolean : string;
320
342
  /** The properties of an authored `outputs` option, in either accepted form. */
321
343
  type ScriptOutputPropertiesOf<O> = O extends {
322
344
  readonly properties: ScriptOutputProperties;
323
345
  } ? O["properties"] : O extends ScriptOutputProperties ? O : undefined;
324
- type ExecuteScriptOutput<O extends ScriptOutputs | undefined> = {
346
+ /** Result shape for an executeScript whose `outputs` option is `O`. */
347
+ export type ExecuteScriptOutput<O extends ScriptOutputs | undefined> = {
325
348
  readonly result: ScriptOutputPropertiesOf<O> extends ScriptOutputProperties ? {
326
349
  readonly [K in keyof ScriptOutputPropertiesOf<O>]: ExecuteScriptFieldValue<Extract<ScriptOutputPropertiesOf<O>[K], ScriptOutputType>>;
327
350
  } : Record<string, unknown>;
@@ -354,9 +377,12 @@ export interface ExecuteScriptListInputToken {
354
377
  * can read - which fields, and under what alias. The value is a whole record
355
378
  * or a list of records (a prior task's `.records`, read per item).
356
379
  *
357
- * Inside this wrapper these deploy the whole record: a record trigger's
358
- * `ctx.trigger.record`, and the `.record` of `recordSearch`, `createRecord`
359
- * and `updateField`. Elsewhere they are the record ID a `record:` slot takes.
380
+ * Inside this wrapper a record trigger's `ctx.trigger.record` deploys the
381
+ * whole record. The `.record` of `recordSearch`, `createRecord` and
382
+ * `updateField` is the whole record in any script input, wrapped or not.
383
+ * `.record.recordId` is the ID for `recordSearch` and `createRecord`. An
384
+ * Update Field `.record.recordId` does not build. Elsewhere they are the
385
+ * record ID a `record:` slot takes.
360
386
  * An on-demand record parameter and `findRelatedRecords`' `.record` expose
361
387
  * only the record ID, so they stay the ID here too.
362
388
  */
@@ -495,7 +521,24 @@ export interface ApiRequestMultipartPart {
495
521
  export interface ApiRequestMultipartBody {
496
522
  readonly parts: readonly ApiRequestMultipartPart[];
497
523
  }
498
- export interface ApiRequestOptions {
524
+ /** elementum_api_task's `response_type` values; the provider default is JSON. */
525
+ export type ApiResponseType = "JSON" | "FILE" | "CUSTOM";
526
+ /**
527
+ * apiRequest outputs for a `responseType`. JSON (also when omitted) has no
528
+ * `.file`, since build rejects it (edk#2058); FILE, CUSTOM or a non-literal
529
+ * type keep every accessor.
530
+ */
531
+ export type ApiRequestOutputs<R extends ApiResponseType = ApiResponseType> = [R] extends ["JSON"] ? {
532
+ response: unknown;
533
+ statusCode?: unknown;
534
+ textResponse?: unknown;
535
+ } : {
536
+ response: unknown;
537
+ file?: unknown;
538
+ statusCode?: unknown;
539
+ textResponse?: unknown;
540
+ };
541
+ export interface ApiRequestOptions<R extends ApiResponseType = ApiResponseType> {
499
542
  readonly url: ValueOrRef<unknown>;
500
543
  readonly method: string;
501
544
  readonly headers?: readonly ApiRequestHeader[];
@@ -513,15 +556,10 @@ export interface ApiRequestOptions {
513
556
  readonly customBody?: ApiRequestCustomBody;
514
557
  /** elementum_api_task's `multipart_body` block (file uploads). Mutually exclusive with `jsonBody`/`formBody`/`customBody`. */
515
558
  readonly multipartBody?: ApiRequestMultipartBody;
516
- readonly responseType?: string;
559
+ readonly responseType?: R;
517
560
  readonly continueOnError?: boolean;
518
561
  }
519
- export declare function apiRequest(opts: ApiRequestOptions): ActionDef<{
520
- response: unknown;
521
- file?: unknown;
522
- statusCode?: unknown;
523
- textResponse?: unknown;
524
- }>;
562
+ export declare function apiRequest<R extends ApiResponseType = "JSON">(opts: ApiRequestOptions<R>): ActionDef<ApiRequestOutputs<R>>;
525
563
  export interface AiSearchTableOptions {
526
564
  readonly table: SearchTableRef | UnsafePlatformId;
527
565
  readonly query: ValueOrRef<unknown>;
@@ -902,7 +940,8 @@ export interface RunAutomationStaticOptions<A extends AutomationCatalogRef = Aut
902
940
  * The UI's "Dynamic Reference" mode: the automation to run is a value
903
941
  * resolved at runtime, such as a trigger parameter or an earlier step's
904
942
  * output holding an automation ID. The platform always waits for a dynamic
905
- * target, so `synchronous` must be `true`.
943
+ * target, so `synchronous` must be `true`. Its outputs don't come back today
944
+ * (see `outputs`).
906
945
  */
907
946
  export interface RunAutomationDynamicReferenceOptions<Outputs extends readonly string[] | undefined = undefined> {
908
947
  readonly automation: Ref<string>;
@@ -910,9 +949,15 @@ export interface RunAutomationDynamicReferenceOptions<Outputs extends readonly s
910
949
  /** Input mappings by the target's on-demand trigger parameter **name**. */
911
950
  readonly inputs?: readonly RunAutomationInput[];
912
951
  /**
913
- * Output names to capture from whichever automation runs. The target is
914
- * unknown at build time, so each captured name is `unknown`. Omitting
915
- * `outputs` exposes nothing on the step result.
952
+ * Output names to expose on the step result. The target is unknown at build
953
+ * time, so each name is `unknown`. Omitting `outputs` exposes nothing.
954
+ *
955
+ * The platform doesn't return a Dynamic Reference target's outputs today:
956
+ * every name listed here reads as null at run time, though the same target
957
+ * called with Select Automation returns them (edk#1869). To get a result
958
+ * back, have the target report it instead: give a separate on-demand
959
+ * automation trigger inputs for the result, and end the target with a
960
+ * Select Automation `runAutomation` to it that maps them.
916
961
  */
917
962
  readonly outputs?: Outputs;
918
963
  }
@@ -131,8 +131,18 @@ export function relateRecords(opts) {
131
131
  function refList(values) {
132
132
  return values === undefined ? undefined : values.map((v) => typeof v === "object" && v !== null && "__kind" in v && v.__kind === "user" ? v : serializeValueOrRef(v));
133
133
  }
134
+ const EMAIL_ATTACHMENT_KEYS = ["attachment", "file", "record"];
134
135
  function serializeEmailAttachment(a) {
135
- return "file" in a ? { file: serializeValueOrRef(a.file) } : { record: serializeValueOrRef(a.fromRecord) };
136
+ const unknownKeys = Object.keys(a).filter((key) => !EMAIL_ATTACHMENT_KEYS.includes(key));
137
+ if (unknownKeys.length > 0) {
138
+ throw new Error(`sendEmail attachment has unsupported key ${unknownKeys.map((k) => `"${k}"`).join(", ")}; set exactly one of attachment, file, or record.`);
139
+ }
140
+ const present = EMAIL_ATTACHMENT_KEYS.filter((key) => a[key] !== undefined);
141
+ if (present.length !== 1) {
142
+ throw new Error("sendEmail attachment must set exactly one of attachment, file, or record.");
143
+ }
144
+ const key = present[0];
145
+ return { [key]: serializeValueOrRef(a[key]) };
136
146
  }
137
147
  export function sendEmail(opts) {
138
148
  if (!opts.toUsers?.length && !opts.toGroups?.length && !opts.toAddresses?.length) {
@@ -151,6 +161,7 @@ export function sendEmail(opts) {
151
161
  ...(opts.attachments !== undefined
152
162
  ? { emailAttachments: opts.attachments.map(serializeEmailAttachment) }
153
163
  : {}),
164
+ ...(opts.emailSendDomainId !== undefined ? { emailSendDomainId: opts.emailSendDomainId } : {}),
154
165
  },
155
166
  };
156
167
  }
@@ -310,9 +321,12 @@ const EXECUTE_SCRIPT_LIST_INPUT_MARKER = "__edkExecuteScriptListInput";
310
321
  * can read - which fields, and under what alias. The value is a whole record
311
322
  * or a list of records (a prior task's `.records`, read per item).
312
323
  *
313
- * Inside this wrapper these deploy the whole record: a record trigger's
314
- * `ctx.trigger.record`, and the `.record` of `recordSearch`, `createRecord`
315
- * and `updateField`. Elsewhere they are the record ID a `record:` slot takes.
324
+ * Inside this wrapper a record trigger's `ctx.trigger.record` deploys the
325
+ * whole record. The `.record` of `recordSearch`, `createRecord` and
326
+ * `updateField` is the whole record in any script input, wrapped or not.
327
+ * `.record.recordId` is the ID for `recordSearch` and `createRecord`. An
328
+ * Update Field `.record.recordId` does not build. Elsewhere they are the
329
+ * record ID a `record:` slot takes.
316
330
  * An on-demand record parameter and `findRelatedRecords`' `.record` expose
317
331
  * only the record ID, so they stay the ID here too.
318
332
  */
@@ -1,6 +1,6 @@
1
1
  import type { DeployableEntity } from "../../engine/entity.js";
2
2
  import { type ValidationFailure } from "../../engine/validation.js";
3
- import { type ChildResourceScope, type TfBlock, type TfExpr, type TfValue } from "../../engine/tf/index.js";
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
5
  import type { BuildFieldMetadata } from "../../graph/types.js";
6
6
  import type { AppServiceAccount } from "../service-account/build.js";
@@ -88,8 +88,6 @@ export interface AutomationToTfResult {
88
88
  readonly blocks: readonly TfBlock[];
89
89
  readonly address: string;
90
90
  }
91
- /** Run-automation targets reference publish for ACTIVE automations, automation for draft/inactive. */
92
- export declare function automationRunTargetResourceAttr(appTfLabel: string, automationRefName: string, activeAutomationRefNames: ReadonlySet<string> | undefined, scope?: ChildResourceScope, handle?: string): TfExpr;
93
91
  /**
94
92
  * edk#1499: script-input field mappings read fields off a whole record. A
95
93
  * value that exposes only a record ID (an onDemand record parameter, or