@elementumai/edk 0.9.20 → 0.10.2

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 (159) hide show
  1. package/README.md +19 -7
  2. package/dist-sdk/src/catalog/factories.d.ts +10 -2
  3. package/dist-sdk/src/catalog/factories.js +10 -1
  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/token.js +4 -0
  7. package/dist-sdk/src/catalog/types.d.ts +7 -1
  8. package/dist-sdk/src/catalog/types.js +1 -0
  9. package/dist-sdk/src/core/triggers/on-demand.d.ts +2 -2
  10. package/dist-sdk/src/core/triggers/on-demand.js +7 -0
  11. package/dist-sdk/src/core/types/app.d.ts +2 -2
  12. package/dist-sdk/src/engine/coverage-gaps.d.ts +86 -0
  13. package/dist-sdk/src/engine/coverage-gaps.js +156 -0
  14. package/dist-sdk/src/engine/ei/run.d.ts +21 -1
  15. package/dist-sdk/src/engine/ei/run.js +89 -2
  16. package/dist-sdk/src/engine/pull/catalog-ref.d.ts +16 -0
  17. package/dist-sdk/src/engine/pull/catalog-ref.js +24 -0
  18. package/dist-sdk/src/engine/pull/context.d.ts +68 -6
  19. package/dist-sdk/src/engine/pull/context.js +40 -1
  20. package/dist-sdk/src/engine/pull/procedure-refs.d.ts +8 -0
  21. package/dist-sdk/src/engine/pull/procedure-refs.js +28 -0
  22. package/dist-sdk/src/engine/pull/result-output.js +27 -1
  23. package/dist-sdk/src/engine/tf/index.d.ts +1 -1
  24. package/dist-sdk/src/engine/tf/index.js +1 -1
  25. package/dist-sdk/src/engine/tf/labels.d.ts +22 -5
  26. package/dist-sdk/src/engine/tf/labels.js +45 -3
  27. package/dist-sdk/src/engine/tf/parse.js +3 -2
  28. package/dist-sdk/src/engine/validation.d.ts +5 -0
  29. package/dist-sdk/src/engine/validation.js +12 -2
  30. package/dist-sdk/src/entities/access-policy/from-tf.js +38 -1
  31. package/dist-sdk/src/entities/access-policy/principal.d.ts +2 -0
  32. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +3 -0
  33. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +42 -19
  34. package/dist-sdk/src/entities/agent/from-tf.js +11 -3
  35. package/dist-sdk/src/entities/agent/module.js +2 -0
  36. package/dist-sdk/src/entities/agent/to-tf.js +14 -3
  37. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +8 -1
  38. package/dist-sdk/src/entities/agent-tool/from-tf.js +11 -5
  39. package/dist-sdk/src/entities/agent-tool/module.js +3 -0
  40. package/dist-sdk/src/entities/app/auto-share.d.ts +38 -0
  41. package/dist-sdk/src/entities/app/auto-share.js +49 -0
  42. package/dist-sdk/src/entities/app/build.d.ts +17 -3
  43. package/dist-sdk/src/entities/app/build.js +56 -4
  44. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +6 -1
  45. package/dist-sdk/src/entities/app/from-tf.js +4 -0
  46. package/dist-sdk/src/entities/app/index.d.ts +2 -1
  47. package/dist-sdk/src/entities/app/index.js +1 -8
  48. package/dist-sdk/src/entities/app/module.js +2 -1
  49. package/dist-sdk/src/entities/app/to-tf.d.ts +6 -0
  50. package/dist-sdk/src/entities/app/to-tf.js +25 -2
  51. package/dist-sdk/src/entities/automation/build.d.ts +12 -2
  52. package/dist-sdk/src/entities/automation/build.js +105 -17
  53. package/dist-sdk/src/entities/automation/calculation-expression.d.ts +7 -7
  54. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +17 -4
  55. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +187 -27
  56. package/dist-sdk/src/entities/automation/from-tf.d.ts +9 -2
  57. package/dist-sdk/src/entities/automation/from-tf.js +397 -89
  58. package/dist-sdk/src/entities/automation/index.d.ts +1 -1
  59. package/dist-sdk/src/entities/automation/index.js +1 -1
  60. package/dist-sdk/src/entities/automation/module.d.ts +3 -0
  61. package/dist-sdk/src/entities/automation/module.js +70 -7
  62. package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +21 -0
  63. package/dist-sdk/src/entities/automation/output-key-wire-name.js +38 -0
  64. package/dist-sdk/src/entities/automation/script-code.d.ts +5 -2
  65. package/dist-sdk/src/entities/automation/script-code.js +23 -5
  66. package/dist-sdk/src/entities/automation/task-output-labels.d.ts +37 -0
  67. package/dist-sdk/src/entities/automation/task-output-labels.js +76 -0
  68. package/dist-sdk/src/entities/automation/tasks.d.ts +92 -20
  69. package/dist-sdk/src/entities/automation/tasks.js +48 -15
  70. package/dist-sdk/src/entities/automation/to-tf.d.ts +20 -3
  71. package/dist-sdk/src/entities/automation/to-tf.js +656 -65
  72. package/dist-sdk/src/entities/automation/triggers.d.ts +8 -4
  73. package/dist-sdk/src/entities/automation/types.d.ts +9 -0
  74. package/dist-sdk/src/entities/automation/types.js +19 -0
  75. package/dist-sdk/src/entities/automation/value-ref-tf.d.ts +1 -1
  76. package/dist-sdk/src/entities/automation/value-ref-tf.js +1 -1
  77. package/dist-sdk/src/entities/chart/from-tf.js +9 -1
  78. package/dist-sdk/src/entities/data-lookup/module.js +2 -0
  79. package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +1 -0
  80. package/dist-sdk/src/entities/dynamic-layout/to-tf.js +7 -5
  81. package/dist-sdk/src/entities/element/build.d.ts +3 -0
  82. package/dist-sdk/src/entities/element/build.js +1 -0
  83. package/dist-sdk/src/entities/element/from-tf.js +4 -0
  84. package/dist-sdk/src/entities/element/module.js +2 -1
  85. package/dist-sdk/src/entities/element/to-tf.d.ts +1 -1
  86. package/dist-sdk/src/entities/element/to-tf.js +12 -14
  87. package/dist-sdk/src/entities/field/build.d.ts +3 -2
  88. package/dist-sdk/src/entities/field/calc.d.ts +7 -7
  89. package/dist-sdk/src/entities/field/from-tf.d.ts +4 -4
  90. package/dist-sdk/src/entities/field/from-tf.js +255 -80
  91. package/dist-sdk/src/entities/field/module.d.ts +6 -0
  92. package/dist-sdk/src/entities/field/module.js +23 -2
  93. package/dist-sdk/src/entities/field/options.js +6 -1
  94. package/dist-sdk/src/entities/field/order.d.ts +16 -0
  95. package/dist-sdk/src/entities/field/order.js +41 -0
  96. package/dist-sdk/src/entities/field/to-tf.d.ts +4 -4
  97. package/dist-sdk/src/entities/field/to-tf.js +7 -1
  98. package/dist-sdk/src/entities/field/types.d.ts +7 -0
  99. package/dist-sdk/src/entities/field/types.js +32 -0
  100. package/dist-sdk/src/entities/role/from-tf.js +3 -3
  101. package/dist-sdk/src/entities/role/to-tf.d.ts +2 -0
  102. package/dist-sdk/src/entities/role/to-tf.js +12 -4
  103. package/dist-sdk/src/entities/service-account/from-tf.js +3 -3
  104. package/dist-sdk/src/entities/service-account/workspace-owner.d.ts +16 -0
  105. package/dist-sdk/src/entities/service-account/workspace-owner.js +22 -0
  106. package/dist-sdk/src/entities/shared/filters/ast.d.ts +15 -1
  107. package/dist-sdk/src/entities/shared/filters/ast.js +2 -0
  108. package/dist-sdk/src/entities/shared/filters/index.d.ts +5 -0
  109. package/dist-sdk/src/entities/shared/filters/index.js +5 -0
  110. package/dist-sdk/src/entities/shared/filters/print.js +7 -2
  111. package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +5 -0
  112. package/dist-sdk/src/entities/shared/filters/tf-codec.js +42 -7
  113. package/dist-sdk/src/entities/shared/filters/types.d.ts +8 -3
  114. package/dist-sdk/src/entities/shared/ref.d.ts +5 -7
  115. package/dist-sdk/src/entities/shared/ref.js +5 -7
  116. package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +9 -0
  117. package/dist-sdk/src/entities/shared/tool-field-ref.js +35 -2
  118. package/dist-sdk/src/entities/shared/types/field-types.d.ts +10 -0
  119. package/dist-sdk/src/entities/shared/types/field-types.js +4 -0
  120. package/dist-sdk/src/entities/skill/access-policy.js +3 -3
  121. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +3 -0
  122. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +12 -5
  123. package/dist-sdk/src/entities/skill/from-tf.js +4 -2
  124. package/dist-sdk/src/entities/skill/module.js +2 -0
  125. package/dist-sdk/src/entities/skill-tool/from-tf.js +41 -8
  126. package/dist-sdk/src/entities/skill-tool/module.js +3 -0
  127. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +0 -6
  128. package/dist-sdk/src/entities/skill-tool/to-tf.js +22 -9
  129. package/dist-sdk/src/entities/task/build.d.ts +8 -0
  130. package/dist-sdk/src/entities/task/build.js +10 -1
  131. package/dist-sdk/src/entities/task/from-tf.d.ts +4 -2
  132. package/dist-sdk/src/entities/task/from-tf.js +7 -2
  133. package/dist-sdk/src/entities/task/module.js +3 -2
  134. package/dist-sdk/src/entities/task/to-tf.d.ts +8 -4
  135. package/dist-sdk/src/entities/task/to-tf.js +32 -1
  136. package/dist-sdk/src/entities/view/from-tf.js +9 -1
  137. package/dist-sdk/src/entities/view/module.js +4 -1
  138. package/dist-sdk/src/entities/view/to-tf.d.ts +6 -7
  139. package/dist-sdk/src/entities/view/to-tf.js +30 -11
  140. package/dist-sdk/src/entities/view/types.d.ts +6 -0
  141. package/dist-sdk/src/entities/view/types.js +6 -0
  142. package/dist-sdk/src/entities/visual-flow/build.d.ts +16 -1
  143. package/dist-sdk/src/entities/visual-flow/build.js +9 -0
  144. package/dist-sdk/src/entities/visual-flow/from-tf.d.ts +14 -0
  145. package/dist-sdk/src/entities/visual-flow/from-tf.js +51 -3
  146. package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -1
  147. package/dist-sdk/src/entities/visual-flow/index.js +1 -1
  148. package/dist-sdk/src/entities/visual-flow/printer.js +19 -0
  149. package/dist-sdk/src/entities/visual-flow/to-tf.js +87 -3
  150. package/dist-sdk/src/entities/widget/from-tf.js +3 -3
  151. package/dist-sdk/src/entities/widget/to-tf.d.ts +2 -0
  152. package/dist-sdk/src/entities/widget/to-tf.js +7 -6
  153. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +133 -9
  154. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
  155. package/dist-sdk/src/graph/index.d.ts +4 -2
  156. package/dist-sdk/src/graph/index.js +3 -0
  157. package/dist-sdk/src/graph/modules.js +2 -1
  158. package/dist-sdk/src/graph/types.d.ts +41 -3
  159. package/package.json +7 -3
@@ -102,7 +102,7 @@ export type PanesBlockProps = {
102
102
  /**
103
103
  * Customer-facing name: List controls
104
104
  * Customer-facing description: Search, filters, grouping, and sort controls that sit above a list.
105
- * Internal authoring guidance: Toolbar of search, Open/Closed quick filters, filter popover, group-by, and sort. For a shared view filter, put filterPreset here as the optional seed and bind filterJson to $bindState: "/query/filter"; this block owns FormFilters, writes the composed/applied JSON back to that path, and self-fetching siblings bound to it refetch automatically. Keep quickFilterValue separate as the Open/Closed status control. Looks like list chrome above a collection, not the results themselves.
105
+ * Internal authoring guidance: Toolbar of search, quick filters, filter popover, group-by, and sort. Prefer a `kind: "filters"` list. `kind: "statusGroups"` is legacyStatusGroups: Open/Closed only, with no All chip. If a spec already has legacyStatusGroups or filterPreset and the user is changing filters, rewrite them into one `kind: "filters"` list. Put a preset filter on the chips that should include it. Do not leave filterPreset beside that list. Bind quickFilterValue to $bindState: "/query/statusGroup". Bind filterJson to $bindState: "/query/filter". When a view has more than one App, bind every App to /query/filter/<aspectId> and /query/statusGroup/<aspectId>. A view with one App keeps the shared paths. filterJson is the menu filter the list uses, besides the managed filter. A kind: "filters" chip writes its filter there. legacyStatusGroups writes the preset and Open/Closed there together. A preset alone fills the menu when there is no chip list. The All chip and a cleared filter menu do not return to this preset. The block applies the managed filter at query time and does not store it in filterJson. This block writes that JSON; self-fetching siblings on the same App bound to the same path refetch from it. Looks like list chrome above a collection, not the results themselves. `field` is the aspect field id, not the display name. A picklist value is { "type": "TEXT", "value": "<id>" }. Do not use `UUID` for that id. A dynamic id is the related record id `aspectId:handle`, still `TEXT`. `AspectPicklistField` uses `EQUALS`. `AspectMultiPicklistField` uses `CONTAINS` with one `TEXT` value. Open/Closed chips are statusGroup with filter omitted: { id, label, statusGroup: "open" | "closed" }. The toolbar builds that clause from the STATUS field and every CLOSED picklist tag and writes it into filterJson. Open is status not in those values. Closed is status in those values. Do not author that tree, do not use the STAGE field, and do not use the words "open" or "closed" as values. A specific status such as Pending is a normal chip filter: STATUS field id, value id from findPicklistValue, EQUALS, TEXT value. All is filter null and no statusGroup, only when the admin asks. Mix All, statusGroup chips, and named chips in one `kind: "filters"` list. A chip that already has `filter` uses that tree. Put the admin default on sortPreset as a Sort document with aspect field ids in orders[].field. Bind sortJson to $bindState: "/query/sort". ListControls writes the live sort and /query/sortAspectId from filterAspectId. Keep sort out of filterJson. The menu offers system fields by semantic tag. Restore copies sortPreset back into sortJson during the visit.
106
106
  */
107
107
  export type ListControlsBlockElement = {
108
108
  readonly type: "ListControlsBlock";
@@ -129,13 +129,36 @@ export type ListControlsBlockProps = {
129
129
  readonly sortByValue?: ((string) | (PropExpression)) | (null);
130
130
  readonly sortByDirection?: ("ASC" | "DESC") | (PropExpression);
131
131
  readonly sortByOptions?: (ReadonlyArray<ListControlsOption>) | (PropExpression);
132
+ readonly sortJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
133
+ readonly [key: string]: OpaqueJson;
134
+ }))) | (PropExpression)) | (null);
135
+ readonly sortPreset?: ({
136
+ readonly orders: (ReadonlyArray<{
137
+ readonly field: string;
138
+ readonly direction: "ASC" | "DESC";
139
+ }>) | (PropExpression);
140
+ }) | (PropExpression);
132
141
  };
133
142
  export type JsonSafeState = OpaqueJson;
134
- export type ListControlsQuickFilters = {
143
+ export type ListControlsQuickFilters = ({
144
+ readonly kind: ("filters") | (PropExpression);
145
+ readonly chips: (ReadonlyArray<{
146
+ readonly id: string;
147
+ readonly label: string;
148
+ readonly filter?: ((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
149
+ readonly [key: string]: OpaqueJson;
150
+ }))) | (null);
151
+ /**
152
+ * Set "open" or "closed" and omit filter. Runtime uses the STATUS field and every CLOSED picklist tag. Open is status not in those values. Closed is status in those values. Ignored when filter is set.
153
+ */
154
+ readonly statusGroup?: "open" | "closed";
155
+ }>) | (PropExpression);
156
+ readonly defaultValue?: (string) | (PropExpression);
157
+ }) | ({
135
158
  readonly kind?: ("statusGroups") | (PropExpression);
136
159
  readonly groups?: (ReadonlyArray<"open" | "closed">) | (PropExpression);
137
160
  readonly defaultValue?: ("open" | "closed") | (PropExpression);
138
- };
161
+ });
139
162
  export type ListControlsOption = {
140
163
  readonly value: string;
141
164
  readonly label: string;
@@ -144,7 +167,7 @@ export type ListControlsOption = {
144
167
  /**
145
168
  * Customer-facing name: Record list
146
169
  * Customer-facing description: A compact stacked list of records with titles and status pills. Use it for queues and pickers.
147
- * Internal authoring guidance: Dual presentational/self-fetching selectable stacked list with title, identifier, pills, and optional collapsible groups. Place every ListCollectionBlock under a root PanesBlock so clicks can support secondary/detail panes. Use items for authored content, or aspectId/search/filter props for live records; self-fetching falls back to the runtime default aspect. To share a ListControls filter, bind filterJson and use the same filterPreset on this list; state changes refetch it. Use filterPreset without that binding only for an independent list seed. Looks like a ticket queue, not a spreadsheet. Prefer DataTableBlock for dense columns.
170
+ * Internal authoring guidance: Dual presentational/self-fetching selectable stacked list with title, identifier, pills, and optional collapsible groups. Place every ListCollectionBlock under a root PanesBlock so clicks can support secondary/detail panes. Use items for authored content, or aspectId/search/filter props for live records; self-fetching falls back to the runtime default aspect. To share a ListControls filter, bind filterJson and use the same filterPreset on this list; state changes refetch it. When a view has more than one App, bind every App to /query/filter/<aspectId> and /query/statusGroup/<aspectId>. A view with one App keeps the shared paths. Use filterPreset without that binding only for an independent list seed. Looks like a ticket queue, not a spreadsheet. Prefer DataTableBlock for dense columns.
148
171
  */
149
172
  export type ListCollectionBlockElement = {
150
173
  readonly type: "ListCollectionBlock";
@@ -207,6 +230,15 @@ export type ListCollectionBlockSelfFetchingProps = {
207
230
  readonly [key: string]: OpaqueJson;
208
231
  }))) | (PropExpression)) | (null);
209
232
  readonly filterPreset?: ((("createdByCurrentUser" | "createdInLast24Hours" | "createdInLast7Days" | "createdInLast30Days" | "createdInLast90Days" | "createdInLastYear" | "closedInLast24Hours" | "closedInLast7Days" | "closedInLast30Days" | "closedInLast90Days" | "closedInLastYear" | "assignedToCurrentUser" | "unassigned") | (PropExpression)) | ((ReadonlyArray<"createdByCurrentUser" | "createdInLast24Hours" | "createdInLast7Days" | "createdInLast30Days" | "createdInLast90Days" | "createdInLastYear" | "closedInLast24Hours" | "closedInLast7Days" | "closedInLast30Days" | "closedInLast90Days" | "closedInLastYear" | "assignedToCurrentUser" | "unassigned">) | (PropExpression))) | (PropExpression);
233
+ readonly sortJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
234
+ readonly [key: string]: OpaqueJson;
235
+ }))) | (PropExpression)) | (null);
236
+ readonly sortPreset?: ({
237
+ readonly orders: (ReadonlyArray<{
238
+ readonly field: string;
239
+ readonly direction: "ASC" | "DESC";
240
+ }>) | (PropExpression);
241
+ }) | (PropExpression);
210
242
  readonly quickFilterValue?: ((string) | (PropExpression)) | (null);
211
243
  };
212
244
  /**
@@ -383,7 +415,7 @@ export type CardBlockProps = {
383
415
  /**
384
416
  * Customer-facing name: Data table
385
417
  * Customer-facing description: A spreadsheet-style table with typed columns for structured rows.
386
- * Internal authoring guidance: Dual presentational/self-fetching data table with typed columns, row selection, optional nested children, and loading/empty/error states. Use rows or object columns for authored data, or aspectId/record columns for live records; self-fetching falls back to the runtime default aspect. Presentational rows may set href (absolute https:// opens a new tab, "/path" navigates inside Elementum) so the primary title cell renders as a link; same rules as ActionCardBlock. Per-cell links use a cell-hint object with href. To share a ListControls filter, bind filterJson and use the same filterPreset on this table; state changes refetch it. Use filterPreset without that binding only for an independent table seed. Looks like a spreadsheet-style grid; wrap in CardBlock with padding "none". Prefer ListCollectionBlock for compact record queues.
418
+ * Internal authoring guidance: Dual presentational/self-fetching data table with typed columns, row selection, optional nested children, and loading/empty/error states. Use rows or object columns for authored data, or aspectId/record columns for live records; self-fetching falls back to the runtime default aspect. Presentational rows may set href (absolute https:// opens a new tab, "/path" navigates inside Elementum) so the primary title cell renders as a link; same rules as ActionCardBlock. Per-cell links use a cell-hint object with href. To share a ListControls filter, bind filterJson and use the same filterPreset on this table; state changes refetch it. When a view has more than one App, bind every App to /query/filter/<aspectId> and /query/statusGroup/<aspectId>. A view with one App keeps the shared paths. Use filterPreset without that binding only for an independent table seed. Looks like a spreadsheet-style grid; wrap in CardBlock with padding "none". Prefer ListCollectionBlock for compact record queues.
387
419
  */
388
420
  export type DataTableBlockElement = {
389
421
  readonly type: "DataTableBlock";
@@ -452,6 +484,15 @@ export type DataTableBlockSelfFetchingProps = {
452
484
  readonly [key: string]: OpaqueJson;
453
485
  }))) | (PropExpression)) | (null);
454
486
  readonly filterPreset?: ((("createdByCurrentUser" | "createdInLast24Hours" | "createdInLast7Days" | "createdInLast30Days" | "createdInLast90Days" | "createdInLastYear" | "closedInLast24Hours" | "closedInLast7Days" | "closedInLast30Days" | "closedInLast90Days" | "closedInLastYear" | "assignedToCurrentUser" | "unassigned") | (PropExpression)) | ((ReadonlyArray<"createdByCurrentUser" | "createdInLast24Hours" | "createdInLast7Days" | "createdInLast30Days" | "createdInLast90Days" | "createdInLastYear" | "closedInLast24Hours" | "closedInLast7Days" | "closedInLast30Days" | "closedInLast90Days" | "closedInLastYear" | "assignedToCurrentUser" | "unassigned">) | (PropExpression))) | (PropExpression);
487
+ readonly sortJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
488
+ readonly [key: string]: OpaqueJson;
489
+ }))) | (PropExpression)) | (null);
490
+ readonly sortPreset?: ({
491
+ readonly orders: (ReadonlyArray<{
492
+ readonly field: string;
493
+ readonly direction: "ASC" | "DESC";
494
+ }>) | (PropExpression);
495
+ }) | (PropExpression);
455
496
  readonly quickFilterValue?: ((string) | (PropExpression)) | (null);
456
497
  readonly selectedAspectId?: ((string) | (PropExpression)) | (null);
457
498
  readonly selectedHandle?: ((string) | (PropExpression)) | (null);
@@ -637,7 +678,7 @@ export type MetricsRowSelfFetchProps = {
637
678
  /**
638
679
  * Customer-facing name: Page header
639
680
  * Customer-facing description: A compact heading with a short description and actions at the top of a page.
640
- * Internal authoring guidance: Compact page-level heading with supporting description, icon badge, and primary or outline actions. Best used once at the top of a page or managed view as a child of a StackBlock. Give an action an href to navigate (absolute https:// opens a new tab, "/path" navigates inside Elementum); omit href to make it a press action that writes selectedActionId and emits actionPress. Handle actionPress with any host action the view supports, such as createRecord or triggerAutomation. Use DataTableBlock or ListCollectionBlock for collection content and HeaderBlock or BodyBlock for headings inside a detail section.
681
+ * Internal authoring guidance: Compact page-level heading with supporting description, icon badge, and primary or outline actions. Best used once at the top of a page or managed view as a child of a StackBlock. Each action is a link (href) or an action (onPress); never set both. Give an action an href to navigate (absolute https:// opens a new tab, "/path" navigates inside Elementum). A createRecord onPress opens the host create-record dialog for that App. A triggerAutomation onPress runs one on-demand automation from a literal automationId. Prefer recordId { "$state": "/selection/recordId" } for the selected row; a literal recordId must be {aspectUuid}:{handle}, never a handle alone or a fake prefix. Omit recordId to let the user pick. copy goes inside params, never beside action. Shape: params: { automationId, recordId?, copy?: { confirm?, pending?, success?, failure? } }. Omit copy to use the defaults Save / Saving… / Saved / Save failed. Do not invent these strings. Use DataTableBlock or ListCollectionBlock for collection content and HeaderBlock or BodyBlock for headings inside a detail section.
641
682
  */
642
683
  export type PageHeaderBlockElement = {
643
684
  readonly type: "PageHeaderBlock";
@@ -656,7 +697,8 @@ export type PageHeaderBlockProps = {
656
697
  readonly actions?: ((ReadonlyArray<PageHeaderAction>) | (PropExpression)) | (null);
657
698
  readonly selectedActionId?: ((string) | (PropExpression)) | (null);
658
699
  };
659
- export type PageHeaderAction = {
700
+ export type PageHeaderAction = (PageHeaderLinkAction) | (PageHeaderPressAction) | (PageHeaderLegacyAction);
701
+ export type PageHeaderLinkAction = {
660
702
  readonly id: string;
661
703
  readonly label: string;
662
704
  readonly variant?: "primary" | "outline";
@@ -664,12 +706,94 @@ export type PageHeaderAction = {
664
706
  /**
665
707
  * Navigation target. Use an absolute http(s) URL or a root-relative /path. Same rules as ActionCardBlock card href.
666
708
  */
667
- readonly href?: string;
709
+ readonly href: string;
710
+ };
711
+ export type PageHeaderPressAction = {
712
+ readonly id: string;
713
+ readonly label: string;
714
+ readonly variant?: "primary" | "outline";
715
+ readonly disabled?: boolean;
716
+ /**
717
+ * Non-navigation action, such as createRecord with an aspectId parameter or triggerAutomation with an automationId, optional recordId ({aspectUuid}:{handle}, or omit to pick), and optional copy inside params (never beside action): copy?: { confirm?, pending?, success?, failure? }. Omit copy for Save / Saving… / Saved / Save failed. Do not set href on the same action.
718
+ */
719
+ readonly onPress: {
720
+ readonly action: string;
721
+ readonly params?: {
722
+ readonly copy?: {
723
+ readonly confirm?: string;
724
+ readonly pending?: string;
725
+ readonly success?: string;
726
+ readonly failure?: string;
727
+ };
728
+ } & {
729
+ readonly [key: string]: (string) | (number) | (boolean) | (null) | ({
730
+ readonly $state: string;
731
+ } & {
732
+ readonly [key: string]: unknown;
733
+ });
734
+ };
735
+ readonly confirm?: {
736
+ readonly title: string;
737
+ readonly message: string;
738
+ readonly confirmLabel?: string;
739
+ readonly cancelLabel?: string;
740
+ readonly variant?: "default" | "danger";
741
+ } & {
742
+ readonly [key: string]: unknown;
743
+ };
744
+ readonly onSuccess?: ({
745
+ readonly navigate: string;
746
+ } & {
747
+ readonly [key: string]: unknown;
748
+ }) | ({
749
+ readonly set: {
750
+ readonly [key: string]: unknown;
751
+ };
752
+ } & {
753
+ readonly [key: string]: unknown;
754
+ }) | ({
755
+ readonly action: string;
756
+ readonly params?: {
757
+ readonly [key: string]: (string) | (number) | (boolean) | (null) | ({
758
+ readonly $state: string;
759
+ } & {
760
+ readonly [key: string]: unknown;
761
+ });
762
+ };
763
+ } & {
764
+ readonly [key: string]: unknown;
765
+ });
766
+ readonly onError?: ({
767
+ readonly set: {
768
+ readonly [key: string]: unknown;
769
+ };
770
+ } & {
771
+ readonly [key: string]: unknown;
772
+ }) | ({
773
+ readonly action: string;
774
+ readonly params?: {
775
+ readonly [key: string]: (string) | (number) | (boolean) | (null) | ({
776
+ readonly $state: string;
777
+ } & {
778
+ readonly [key: string]: unknown;
779
+ });
780
+ };
781
+ } & {
782
+ readonly [key: string]: unknown;
783
+ });
784
+ readonly preventDefault?: boolean;
785
+ };
786
+ };
787
+ export type PageHeaderLegacyAction = {
788
+ readonly id: string;
789
+ readonly label: string;
790
+ readonly variant?: "primary" | "outline";
791
+ readonly disabled?: boolean;
668
792
  };
669
793
  /**
670
794
  * Customer-facing name: Buttons
671
795
  * Customer-facing description: A row of buttons that link to pages or run actions.
672
- * Internal authoring guidance: A responsive row of buttons. Each item is a link (href, optional viewId), an action (onPress), or a static button (neither); never set both href and onPress. Omitted emphasis defaults to primary for onPress buttons and secondary for links. Set it explicitly for tertiary alternates or destructive actions. A createRecord onPress opens the host create-record dialog for that App. A triggerAutomation onPress runs one on-demand automation from a literal automationId. Prefer recordId { "$state": "/selection/recordId" } for the selected row; a literal recordId must be {aspectUuid}:{handle}, never a handle alone or a fake prefix. Omit recordId to let the user pick. copy goes inside params, never beside action. Shape: params: { automationId, recordId?, copy?: { confirm?, pending?, success?, failure? } }. Omit copy to use the defaults Save / Saving… / Saved / Save failed. Do not invent these strings. Host actions such as createRecord and triggerAutomation also work on PageHeaderBlock via actionPress. The row stacks in narrow panes. Use PageHeaderBlock actions for page-level heading buttons.
796
+ * Internal authoring guidance: A responsive row of buttons. Each item is a link (href, optional viewId), an action (onPress), or a static button (neither); never set both href and onPress. Omitted emphasis defaults to primary for onPress buttons and secondary for links. Set it explicitly for tertiary alternates or destructive actions. A createRecord onPress opens the host create-record dialog for that App. A triggerAutomation onPress runs one on-demand automation from a literal automationId. Prefer recordId { "$state": "/selection/recordId" } for the selected row; a literal recordId must be {aspectUuid}:{handle}, never a handle alone or a fake prefix. Omit recordId to let the user pick. copy goes inside params, never beside action. Shape: params: { automationId, recordId?, copy?: { confirm?, pending?, success?, failure? } }. Omit copy to use the defaults Save / Saving… / Saved / Save failed. Do not invent these strings. Host actions such as createRecord and triggerAutomation also work on PageHeaderBlock via onPress. The row stacks in narrow panes. Use PageHeaderBlock actions for page-level heading buttons.
673
797
  */
674
798
  export type ButtonBlockElement = {
675
799
  readonly type: "ButtonBlock";
@@ -1,5 +1,5 @@
1
1
  // Generated by `npm run generate:ragnarok` — do not edit. Refresh with `npm run refresh:ragnarok`.
2
- // Source: urn:elementum:elementum-blocks:spec:v1 version 1.34.0
3
- // Schema sha256: b03a0f70e1dab852a792f92f5d684997f290cc364d5f1049d12bd9eb78647f57
2
+ // Source: urn:elementum:elementum-blocks:spec:v1 version 1.38.0
3
+ // Schema sha256: 6d96d9f9edee222052989a1c5eecf75d0da751ed102c8c3fb1a5e5229502990b
4
4
  // Generator revision: 2
5
5
  export {};
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Public graph barrel: KIND_MODULES + derived views for pull/build/canvas.
3
3
  */
4
- import { type CatalogRenderArgs, type CatalogRenderResult, type EntityKindModule, type KindId, type ParentEdge, matchType } from "./types.js";
5
- export type { AdoptionAddressAlias, AuthoringFacet, CanvasComponentId, CanvasFacet, CanvasView, CatalogAuthoringArgs, CatalogFacet, CatalogRenderArgs, CatalogRenderResult, CatalogRoot, DataFacet, DataFacetCatalogKind, EntityKindId, EntityKindModule, KindId, LifecycleFacet, OrgIdentityBag, ParentEdge, ParentageFacet, ResourceFacet, StreamFacet, StreamMatch, StreamPartition, StreamRootExtractResult, ToTfResult, } from "./types.js";
4
+ import { type CatalogRenderArgs, type CatalogRenderResult, type EntityKindModule, type KindId, type ParentEdge, type StateScopedPlatformEntry, matchType } from "./types.js";
5
+ export type { AdoptionAddressAlias, AuthoringFacet, CanvasComponentId, CanvasFacet, CanvasView, CatalogAuthoringArgs, CatalogFacet, CatalogRenderArgs, CatalogRenderResult, CatalogRoot, DataFacet, DataFacetCatalogKind, EntityKindId, EntityKindModule, KindId, LifecycleFacet, OrgIdentityBag, ParentEdge, ParentageFacet, ResourceFacet, StateScopedPlatformEntry, StreamFacet, StreamMatch, StreamPartition, StreamRootExtractResult, ToTfResult, } from "./types.js";
6
6
  export type { ReferenceLookupStrategy } from "./types.js";
7
7
  export { NO_CANVAS, NO_CATALOG, NO_DATA, NO_LIFECYCLE, defaultMatchResourceType, implementedResourceTypes, isResourceAdoptable, isTfLive, knownResourceTypes, matchType, singleResourceType, } from "./types.js";
8
8
  export { KIND_MODULES } from "./modules.js";
@@ -92,6 +92,7 @@ export declare const BUILD_VS_EXPORT_ATTRIBUTE_LOCALS: {
92
92
  readonly resourceType: string;
93
93
  readonly attribute: string;
94
94
  readonly localPrefix: string;
95
+ readonly listField?: string;
95
96
  }[];
96
97
  export declare const BUILD_VS_EXPORT_TASK_OUTPUT_REFERENCE_NAMES: ReadonlyMap<string, ReadonlyMap<string, string>>;
97
98
  /** Kind id → module. */
@@ -133,6 +134,7 @@ export declare const UNREADABLE_ATTRIBUTES_BY_RESOURCE_TYPE: ReadonlyMap<string,
133
134
  * single-resource kind declares them. A re-pull keeps only the keys in state.
134
135
  */
135
136
  export declare const STATE_SCOPED_MAP_ATTRIBUTES_BY_RESOURCE_TYPE: ReadonlyMap<string, readonly string[]>;
137
+ export declare const STATE_SCOPED_PLATFORM_ENTRIES_BY_RESOURCE_TYPE: ReadonlyMap<string, readonly StateScopedPlatformEntry[]>;
136
138
  /** Entity-declared value equivalences used to compare builder and exporter HCL. */
137
139
  export declare const BUILD_VS_EXPORT_NORMALIZATIONS: {
138
140
  readonly omittedAttributeDefaults: {
@@ -127,6 +127,9 @@ export const UNREADABLE_ATTRIBUTES_BY_RESOURCE_TYPE = new Map(KIND_MODULES.flatM
127
127
  export const STATE_SCOPED_MAP_ATTRIBUTES_BY_RESOURCE_TYPE = new Map(KIND_MODULES.flatMap((m) => m.resource.shape === "single" && m.resource.stateScopedMapAttributes !== undefined
128
128
  ? [[m.resource.resourceType, m.resource.stateScopedMapAttributes]]
129
129
  : []));
130
+ export const STATE_SCOPED_PLATFORM_ENTRIES_BY_RESOURCE_TYPE = new Map(KIND_MODULES.flatMap((m) => m.resource.shape === "single" && m.resource.stateScopedPlatformEntries !== undefined
131
+ ? [[m.resource.resourceType, m.resource.stateScopedPlatformEntries]]
132
+ : []));
130
133
  /** Entity-declared value equivalences used to compare builder and exporter HCL. */
131
134
  export const BUILD_VS_EXPORT_NORMALIZATIONS = {
132
135
  omittedAttributeDefaults: KIND_MODULES.flatMap((module) => (module.roundtrip?.omittedAttributeDefaults ?? []).flatMap((equivalence) => implementedResourceTypes(module.resource).map((blockType) => ({ blockType, ...equivalence })))),
@@ -17,7 +17,7 @@ import { dashboardModule } from "../entities/dashboard/module.js";
17
17
  import { dashboardWidgetModule } from "../entities/dashboard-widget/module.js";
18
18
  import { datamineModule } from "../entities/datamine/module.js";
19
19
  import { dataLookupModules } from "../entities/data-lookup/module.js";
20
- import { fieldModule } from "../entities/field/module.js";
20
+ import { fieldModule, managedFieldOrderModule } from "../entities/field/module.js";
21
21
  import { fileReaderModule } from "../entities/file-reader/module.js";
22
22
  import { visualFlowModule } from "../entities/visual-flow/module.js";
23
23
  import { aiProviderModules, categoryModule, cloudLinkModule, connectorModule, emailAliasModule, groupModule, phoneProviderModule, roleModule, userModule, } from "../entities/org/index.js";
@@ -52,6 +52,7 @@ export const KIND_MODULES = [
52
52
  visualFlowModule,
53
53
  viewModule,
54
54
  managedViewOrderModule,
55
+ managedFieldOrderModule,
55
56
  recordCreateFormModule,
56
57
  dynamicLayoutModule,
57
58
  dashboardModule,
@@ -10,7 +10,7 @@ import type { DeployableEntity } from "../engine/entity.js";
10
10
  import type { FromTfContext } from "../engine/pull/context.js";
11
11
  import type { ChildResourceScope, TfBlock, TfValue } from "../engine/tf/index.js";
12
12
  import type { ValidationFailure } from "../engine/validation.js";
13
- export type KindId = "org" | "app" | "element" | "field" | "access-policy" | "agent" | "agent-evaluation" | "chart" | "agent-tool" | "agent-a2a-skill" | "automation" | "approval-chain" | "file-reader" | "visual-flow" | "skill" | "skill-tool" | "view" | "managed-view-order" | "record-create-form" | "dynamic-layout" | "dashboard" | "dashboard-widget" | "datamine" | "automation-value-references" | "organization" | "permission-template" | "service-account" | "stored-function" | "task" | "portal" | "widget" | "relationship" | "search-table" | "table" | "cloud-link" | "email-alias" | "category" | "connector" | "ai-provider-anthropic" | "ai-provider-bedrock" | "ai-provider-custom" | "ai-provider-deepgram" | "ai-provider-elevenlab" | "ai-provider-gemini" | "ai-provider-openai" | "ai-provider-snowflake" | "ai-provider-xai" | "ai-provider-managed" | "group" | "phone-provider" | "phone-service" | "role" | "user";
13
+ export type KindId = "org" | "app" | "element" | "field" | "access-policy" | "agent" | "agent-evaluation" | "chart" | "agent-tool" | "agent-a2a-skill" | "automation" | "approval-chain" | "file-reader" | "visual-flow" | "skill" | "skill-tool" | "view" | "managed-view-order" | "managed-field-order" | "record-create-form" | "dynamic-layout" | "dashboard" | "dashboard-widget" | "datamine" | "automation-value-references" | "organization" | "permission-template" | "service-account" | "stored-function" | "vault-entry" | "task" | "portal" | "widget" | "relationship" | "search-table" | "table" | "cloud-link" | "email-alias" | "category" | "connector" | "ai-provider-anthropic" | "ai-provider-bedrock" | "ai-provider-custom" | "ai-provider-deepgram" | "ai-provider-elevenlab" | "ai-provider-gemini" | "ai-provider-openai" | "ai-provider-snowflake" | "ai-provider-xai" | "ai-provider-managed" | "group" | "phone-provider" | "phone-service" | "role" | "user";
14
14
  /** @deprecated Use {@link KindId}. */
15
15
  export type EntityKindId = KindId;
16
16
  export type StreamFacet = {
@@ -43,6 +43,11 @@ export interface ParentEdge {
43
43
  }
44
44
  /** Parentage facet: who may own whom (multi-parent OK). */
45
45
  export type ParentageFacet = readonly ParentEdge[];
46
+ /** A reference list attribute and the name of the platform-created resource state decides on. */
47
+ export interface StateScopedPlatformEntry {
48
+ readonly attribute: string;
49
+ readonly name: string;
50
+ }
46
51
  export interface SubTypeRow {
47
52
  readonly key: string;
48
53
  readonly resourceType: string;
@@ -88,6 +93,13 @@ export type ResourceFacet = {
88
93
  * keys state holds (see `alignExportWithState`).
89
94
  */
90
95
  readonly stateScopedMapAttributes?: readonly string[];
96
+ /**
97
+ * Reference lists where the provider keeps an entry pointing at a
98
+ * platform-created resource (recognised by its `name`) only when state
99
+ * already holds that entry. The export always lists it; a re-pull drops
100
+ * it unless state holds its id (see `alignExportWithState`).
101
+ */
102
+ readonly stateScopedPlatformEntries?: readonly StateScopedPlatformEntry[];
91
103
  } | {
92
104
  readonly shape: "subTypes";
93
105
  readonly rows: readonly SubTypeRow[];
@@ -97,6 +109,12 @@ export type ResourceFacet = {
97
109
  readonly shape: "composite";
98
110
  readonly members: readonly CompositeMember[];
99
111
  readonly adoptable: boolean;
112
+ /**
113
+ * Skeleton label for a child of this kind, when it differs from
114
+ * `scopedResourceLabel`. `childTfLabel` is the child's ref name in
115
+ * terraform form.
116
+ */
117
+ readonly childLabel?: (ownerTfLabel: string, childTfLabel: string, scope: ChildResourceScope) => string;
100
118
  } | {
101
119
  /** Authoring/parentage graph node with no distinct terraform resource types yet. */
102
120
  readonly shape: "none";
@@ -317,6 +335,18 @@ export interface UnresolvedReferenceDiagnostic {
317
335
  readonly reason: string;
318
336
  readonly portability: "source-org-only";
319
337
  }
338
+ /** Workspace facts a re-pull merge may consult (#1590). */
339
+ export interface MergePulledSourceContext {
340
+ /** Platform id of the pulled child. */
341
+ readonly platformId?: string;
342
+ /** Workspace state read at write time; undefined when it could not be read. */
343
+ readonly stateResources?: readonly {
344
+ readonly type?: string;
345
+ readonly instances?: readonly {
346
+ readonly attributes?: Record<string, unknown>;
347
+ }[];
348
+ }[];
349
+ }
320
350
  export interface PrintOwnFileOptions {
321
351
  /** Directory refName → actual flat barrel key, including app/element collisions. */
322
352
  readonly elementCatalogKeys?: ReadonlyMap<string, string>;
@@ -368,6 +398,9 @@ export interface PrintOwnFileOptions {
368
398
  * prints `catalog.<refName>` instead of the literal stub.
369
399
  */
370
400
  readonly foreignElementRefNames?: ReadonlyMap<string, string>;
401
+ /** Namespace → refName for apps/elements on disk, for owners ei exports with only a `namespace`. */
402
+ readonly foreignAppRefNamespaces?: ReadonlyMap<string, string>;
403
+ readonly foreignElementRefNamespaces?: ReadonlyMap<string, string>;
371
404
  /**
372
405
  * Same as {@link foreignAppRefNames}, keyed for tasks (#1011) — a
373
406
  * task target whose name is a key here prints `catalog.<refName>` instead
@@ -533,7 +566,7 @@ export type LifecycleFacet = {
533
566
  /** Print one extracted own-file instance to TypeScript source. */
534
567
  readonly printOwnFile?: (item: unknown, opts: PrintOwnFileOptions) => PrintedOwnFile;
535
568
  /** Re-pull: preserve author-owned values that the live export cannot represent. */
536
- readonly mergePulledSource?: (freshSource: string, existingSource: string) => string;
569
+ readonly mergePulledSource?: (freshSource: string, existingSource: string, context?: MergePulledSourceContext) => string;
537
570
  /**
538
571
  * Re-pull: true when an existing source file is earlier printer output
539
572
  * that can never build (it carries a placeholder the printer emits for a
@@ -673,11 +706,16 @@ export interface EntityKindModule {
673
706
  readonly attribute: string;
674
707
  readonly defaults: Readonly<Record<string, TfValue>>;
675
708
  }[];
676
- /** Server-assigned attributes the export records as a `<localPrefix><label>` local. */
709
+ /**
710
+ * Server-assigned attributes the export records as a `<localPrefix><label>` local.
711
+ * With `listField`, the attribute is a list and the local lists each entry's
712
+ * `listField` in order (`<attribute>[i].<listField>` = local[i]).
713
+ */
677
714
  readonly exportedAttributeLocals?: readonly {
678
715
  readonly resourceType: string;
679
716
  readonly attribute: string;
680
717
  readonly localPrefix: string;
718
+ readonly listField?: string;
681
719
  }[];
682
720
  };
683
721
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementumai/edk",
3
- "version": "0.9.20",
3
+ "version": "0.10.2",
4
4
  "description": "Elementum Development Kit — statically typed SDK for building Elementum apps, automations, and agents",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -192,7 +192,7 @@
192
192
  "release:local-sdk": "bash release/verify-local-sdk-prepare.sh",
193
193
  "release:notes": "tsx src/scripts/release-notes.ts",
194
194
  "test": "tsx src/scripts/test.ts",
195
- "test:unit": "npm run typecheck:ci && vitest run",
195
+ "test:unit": "vitest run",
196
196
  "test:runtime": "vitest run",
197
197
  "check:parity": "tsx src/scripts/check-provider-parity.ts",
198
198
  "pretest:provider": "npm run generate:graphql",
@@ -211,7 +211,11 @@
211
211
  "reap:orphans": "node integration/tools/reap-orphaned-test-entities.mjs",
212
212
  "typecheck": "npm run typecheck:ci",
213
213
  "pretypecheck:ci": "npm run generate:ragnarok",
214
- "typecheck:ci": "tsc --noEmit -p tsconfig.ci.json && tsc --noEmit -p tsconfig.examples-check.json",
214
+ "typecheck:ci": "npm run typecheck:ci:project --ignore-scripts && npm run typecheck:ci:examples --ignore-scripts",
215
+ "pretypecheck:ci:project": "npm run generate:ragnarok",
216
+ "typecheck:ci:project": "tsc --noEmit -p tsconfig.ci.json --incremental --tsBuildInfoFile node_modules/.cache/edk-tsc/ci.tsbuildinfo",
217
+ "pretypecheck:ci:examples": "npm run generate:ragnarok",
218
+ "typecheck:ci:examples": "tsc --noEmit -p tsconfig.examples-check.json --incremental --tsBuildInfoFile node_modules/.cache/edk-tsc/examples.tsbuildinfo",
215
219
  "pretypecheck:src": "npm run generate:ragnarok",
216
220
  "typecheck:src": "tsc --noEmit",
217
221
  "pretypecheck:examples": "npm run generate:ragnarok",