@elementumai/edk 0.9.18 → 0.9.19

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 (125) hide show
  1. package/README.md +8 -3
  2. package/dist-sdk/src/catalog/factories.d.ts +11 -0
  3. package/dist-sdk/src/catalog/factories.js +6 -0
  4. package/dist-sdk/src/catalog/index.d.ts +2 -2
  5. package/dist-sdk/src/catalog/index.js +2 -2
  6. package/dist-sdk/src/catalog/org.d.ts +39 -1
  7. package/dist-sdk/src/catalog/org.js +460 -50
  8. package/dist-sdk/src/catalog/types.d.ts +10 -0
  9. package/dist-sdk/src/catalog/types.js +2 -0
  10. package/dist-sdk/src/engine/pull/ref-only.js +54 -20
  11. package/dist-sdk/src/engine/pull/result-output.d.ts +2 -0
  12. package/dist-sdk/src/engine/pull/result-output.js +1 -1
  13. package/dist-sdk/src/engine/tf/expr.js +38 -13
  14. package/dist-sdk/src/engine/tf/index.d.ts +2 -2
  15. package/dist-sdk/src/engine/tf/index.js +2 -2
  16. package/dist-sdk/src/engine/tf/labels.d.ts +2 -0
  17. package/dist-sdk/src/engine/tf/labels.js +4 -0
  18. package/dist-sdk/src/engine/tf/parse.d.ts +19 -0
  19. package/dist-sdk/src/engine/tf/parse.js +105 -6
  20. package/dist-sdk/src/engine/workspace/loader.js +49 -12
  21. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +11 -1
  22. package/dist-sdk/src/entities/access-policy/from-tf.js +6 -1
  23. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +11 -0
  24. package/dist-sdk/src/entities/access-policy/to-tf.js +11 -4
  25. package/dist-sdk/src/entities/agent-tool/to-tf.js +2 -1
  26. package/dist-sdk/src/entities/app/build.d.ts +10 -0
  27. package/dist-sdk/src/entities/app/build.js +0 -13
  28. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +6 -1
  29. package/dist-sdk/src/entities/app/from-tf.js +4 -3
  30. package/dist-sdk/src/entities/app/index.d.ts +1 -0
  31. package/dist-sdk/src/entities/app/index.js +1 -0
  32. package/dist-sdk/src/entities/app/module.js +13 -0
  33. package/dist-sdk/src/entities/app/to-tf.js +2 -0
  34. package/dist-sdk/src/entities/automation/build.d.ts +2 -1
  35. package/dist-sdk/src/entities/automation/build.js +27 -0
  36. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +6 -0
  37. package/dist-sdk/src/entities/automation/from-tf.js +135 -26
  38. package/dist-sdk/src/entities/automation/index.d.ts +1 -1
  39. package/dist-sdk/src/entities/automation/module.d.ts +2 -0
  40. package/dist-sdk/src/entities/automation/module.js +56 -0
  41. package/dist-sdk/src/entities/automation/system-ref-name.d.ts +16 -0
  42. package/dist-sdk/src/entities/automation/system-ref-name.js +44 -0
  43. package/dist-sdk/src/entities/automation/task-output-labels.d.ts +15 -0
  44. package/dist-sdk/src/entities/automation/task-output-labels.js +38 -0
  45. package/dist-sdk/src/entities/automation/tasks.d.ts +29 -2
  46. package/dist-sdk/src/entities/automation/to-tf.js +158 -84
  47. package/dist-sdk/src/entities/automation/types.js +1 -0
  48. package/dist-sdk/src/entities/chart/from-tf.js +33 -17
  49. package/dist-sdk/src/entities/chart/module.js +3 -1
  50. package/dist-sdk/src/entities/chart/printer.d.ts +1 -0
  51. package/dist-sdk/src/entities/chart/printer.js +26 -16
  52. package/dist-sdk/src/entities/chart/rebind-owner.d.ts +3 -0
  53. package/dist-sdk/src/entities/chart/rebind-owner.js +42 -0
  54. package/dist-sdk/src/entities/chart/to-tf.js +12 -10
  55. package/dist-sdk/src/entities/dashboard/build.d.ts +4 -0
  56. package/dist-sdk/src/entities/dashboard/from-tf.js +15 -4
  57. package/dist-sdk/src/entities/dashboard/to-tf.d.ts +2 -0
  58. package/dist-sdk/src/entities/dashboard/to-tf.js +13 -0
  59. package/dist-sdk/src/entities/dashboard-widget/module.js +4 -0
  60. package/dist-sdk/src/entities/dynamic-layout/build.d.ts +51 -2
  61. package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +3 -0
  62. package/dist-sdk/src/entities/dynamic-layout/dialect.js +5 -0
  63. package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +9 -6
  64. package/dist-sdk/src/entities/dynamic-layout/from-tf.js +188 -26
  65. package/dist-sdk/src/entities/dynamic-layout/module.js +4 -1
  66. package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +5 -1
  67. package/dist-sdk/src/entities/dynamic-layout/to-tf.js +254 -23
  68. package/dist-sdk/src/entities/element/build.d.ts +8 -0
  69. package/dist-sdk/src/entities/element/build.js +1 -0
  70. package/dist-sdk/src/entities/element/from-tf.d.ts +1 -0
  71. package/dist-sdk/src/entities/element/from-tf.js +6 -2
  72. package/dist-sdk/src/entities/element/index.d.ts +1 -0
  73. package/dist-sdk/src/entities/element/index.js +1 -0
  74. package/dist-sdk/src/entities/element/module.js +2 -0
  75. package/dist-sdk/src/entities/element/to-tf.js +12 -0
  76. package/dist-sdk/src/entities/field/from-tf.d.ts +2 -0
  77. package/dist-sdk/src/entities/field/from-tf.js +11 -0
  78. package/dist-sdk/src/entities/field/to-tf.js +13 -9
  79. package/dist-sdk/src/entities/relationship/from-tf.d.ts +8 -1
  80. package/dist-sdk/src/entities/relationship/from-tf.js +53 -10
  81. package/dist-sdk/src/entities/relationship/to-tf.d.ts +8 -0
  82. package/dist-sdk/src/entities/relationship/to-tf.js +19 -10
  83. package/dist-sdk/src/entities/shared/filters/ast.d.ts +7 -2
  84. package/dist-sdk/src/entities/shared/filters/index.d.ts +23 -2
  85. package/dist-sdk/src/entities/shared/filters/index.js +24 -1
  86. package/dist-sdk/src/entities/shared/filters/print.js +14 -2
  87. package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +23 -3
  88. package/dist-sdk/src/entities/shared/filters/tf-codec.js +46 -14
  89. package/dist-sdk/src/entities/shared/filters/types.d.ts +13 -4
  90. package/dist-sdk/src/entities/shared/foreign-ref.d.ts +16 -0
  91. package/dist-sdk/src/entities/shared/foreign-ref.js +17 -1
  92. package/dist-sdk/src/entities/shared/tool-field-ref.js +6 -9
  93. package/dist-sdk/src/entities/skill/access-policy.d.ts +17 -0
  94. package/dist-sdk/src/entities/skill/access-policy.js +101 -0
  95. package/dist-sdk/src/entities/skill/build.d.ts +3 -0
  96. package/dist-sdk/src/entities/skill/build.js +3 -0
  97. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +4 -1
  98. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +21 -0
  99. package/dist-sdk/src/entities/skill/from-tf.d.ts +2 -0
  100. package/dist-sdk/src/entities/skill/from-tf.js +4 -9
  101. package/dist-sdk/src/entities/skill/index.d.ts +2 -0
  102. package/dist-sdk/src/entities/skill/index.js +1 -0
  103. package/dist-sdk/src/entities/skill/module.js +1 -0
  104. package/dist-sdk/src/entities/skill/to-tf.d.ts +2 -2
  105. package/dist-sdk/src/entities/skill/to-tf.js +5 -2
  106. package/dist-sdk/src/entities/skill-tool/to-tf.js +2 -1
  107. package/dist-sdk/src/entities/table/to-tf.js +3 -3
  108. package/dist-sdk/src/entities/view/agent-view-layout-from-tf.d.ts +49 -0
  109. package/dist-sdk/src/entities/view/agent-view-layout-from-tf.js +224 -0
  110. package/dist-sdk/src/entities/view/agent-view-layout-to-tf.d.ts +36 -0
  111. package/dist-sdk/src/entities/view/agent-view-layout-to-tf.js +288 -0
  112. package/dist-sdk/src/entities/view/agent-view-layout.d.ts +121 -0
  113. package/dist-sdk/src/entities/view/agent-view-layout.js +21 -0
  114. package/dist-sdk/src/entities/view/from-tf.d.ts +3 -1
  115. package/dist-sdk/src/entities/view/from-tf.js +42 -7
  116. package/dist-sdk/src/entities/view/to-tf.d.ts +10 -1
  117. package/dist-sdk/src/entities/view/to-tf.js +30 -1
  118. package/dist-sdk/src/entities/view/types.js +2 -0
  119. package/dist-sdk/src/entities/widget/to-tf.js +2 -2
  120. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +25 -8
  121. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
  122. package/dist-sdk/src/graph/index.d.ts +43 -0
  123. package/dist-sdk/src/graph/index.js +9 -0
  124. package/dist-sdk/src/graph/types.d.ts +78 -0
  125. package/package.json +2 -1
@@ -9,6 +9,7 @@
9
9
  * reported, never silent. Invalid authored filter trees fail at build time
10
10
  * with the same `EntityTfError` path used by access-policy row filters.
11
11
  */
12
+ import { agentViewLayoutToTf } from "./agent-view-layout-to-tf.js";
12
13
  import { expr, isCanonicalTsLabel, sanitizeName, scopedResourceLabel, tsLabelToTfLabel, } from "../../engine/tf/index.js";
13
14
  import { fieldRefToTfValue as customFieldRefToTfValue } from "../field/to-tf.js";
14
15
  import { ELEMENT_SYSTEM_FIELD_KEYS } from "../element/system-fields.js";
@@ -208,6 +209,19 @@ export function viewToTf(layouts, listViews, calendarViews, kanbanViews, dashboa
208
209
  appendViewSharingAttrs(attrs, view, `agentViews.${viewKey}`, principalCtx);
209
210
  if (view.displayOrder !== undefined)
210
211
  attrs["display_order"] = view.displayOrder;
212
+ if (view.layout !== undefined) {
213
+ attrs["layout"] = agentViewLayoutToTf(view.layout, `agentViews.${viewKey}.layout`, {
214
+ ownerRefName,
215
+ ownerTfLabel,
216
+ scope,
217
+ objectId,
218
+ diagnostics,
219
+ fieldAddresses,
220
+ orgRefs: opts.orgRefs,
221
+ workspaceAspects: opts.workspaceAspects,
222
+ resolveField: (ref, where) => fieldRefToTfValue(ref, ownerTfLabel, scope, where, diagnostics, fieldAddresses),
223
+ });
224
+ }
211
225
  blocks.push({ kind: "resource", type: AGENT_VIEW_RESOURCE_TYPE, label: tfLabel, attrs });
212
226
  viewAddressByKey.set(viewKey, { type: AGENT_VIEW_RESOURCE_TYPE, label: tfLabel });
213
227
  }
@@ -250,7 +264,7 @@ export function viewToTf(layouts, listViews, calendarViews, kanbanViews, dashboa
250
264
  }
251
265
  return { blocks };
252
266
  }
253
- function managedViewSortToTf(sort, ownerTfLabel, scope, where, diagnostics, fieldAddresses) {
267
+ export function managedViewSortToTf(sort, ownerTfLabel, scope, where, diagnostics, fieldAddresses) {
254
268
  const orders = [];
255
269
  for (const [index, order] of sort.orders.entries()) {
256
270
  const field = fieldRefToTfValue(order.field, ownerTfLabel, scope, `${where}.orders[${index}].field`, diagnostics, fieldAddresses);
@@ -292,6 +306,21 @@ function layoutToTf(stageKey, layout, ownerRefName, ownerTfLabel, scope, objectI
292
306
  if (section.maxColumns !== undefined)
293
307
  sec.max_columns = section.maxColumns;
294
308
  const where = `layouts.${stageKey} section "${section.name ?? ""}"`;
309
+ if (section.agent !== undefined) {
310
+ const agentRefName = section.agent.refName ?? "";
311
+ if (scope !== "app") {
312
+ diagnostics.push(`${where}: agent-assisted sections are only resolvable for app-owned agents; agent dropped`);
313
+ }
314
+ else if (section.agent.parent !== ownerRefName) {
315
+ diagnostics.push(`${where}: agent belongs to ${JSON.stringify(section.agent.parent)}, not ${JSON.stringify(ownerRefName)}; agent dropped`);
316
+ }
317
+ else if (!isCanonicalTsLabel(agentRefName)) {
318
+ diagnostics.push(`${where}: agent key "${agentRefName}" is not a canonical tsLabel; agent dropped`);
319
+ }
320
+ else {
321
+ sec.agent_id = expr.resourceAttr("elementum_agent", scopedResourceLabel(ownerTfLabel, tsLabelToTfLabel(agentRefName), "app"), ["id"]);
322
+ }
323
+ }
295
324
  const fields = (section.fields ?? []).filter((f) => {
296
325
  if (typeof f === "string" && LAYOUT_RESTRICTED_SYSTEM_FIELD_KEYS.has(f)) {
297
326
  diagnostics.push(`${where}: system field "${f}" is platform-managed and cannot be placed in a layout section; dropped`);
@@ -78,6 +78,7 @@ export const KNOWN_LAYOUT_SECTION_ATTRS = new Set([
78
78
  "max_columns",
79
79
  "field_ids",
80
80
  "modules",
81
+ "agent_id",
81
82
  ]);
82
83
  /** Attributes `listViewFromTf` understands. */
83
84
  export const KNOWN_LIST_VIEW_ATTRS = new Set([
@@ -102,6 +103,7 @@ export const KNOWN_AGENT_VIEW_ATTRS = new Set([
102
103
  "user_ids",
103
104
  "group_ids",
104
105
  "display_order",
106
+ "layout",
105
107
  ]);
106
108
  const COMMON_TYPED_VIEW_ATTRS = [
107
109
  "aspect_id",
@@ -1,5 +1,5 @@
1
1
  import { workspaceAspectKey } from "../../engine/build/context.js";
2
- import { resolveForeignRef } from "../shared/foreign-ref.js";
2
+ import { foreignFieldDataLabel, resolveForeignRef } from "../shared/foreign-ref.js";
3
3
  import { appScopedResourceLabel, expr, isCanonicalTsLabel, sanitizeName, scopedResourceLabel, tfLabelToTsLabel, tsLabelToTfLabel, } from "../../engine/tf/index.js";
4
4
  import { AUTOMATION_RESOURCE_TYPE } from "../automation/types.js";
5
5
  import { fieldMetadataFromEntries } from "../field/metadata.js";
@@ -224,7 +224,7 @@ function resolveColumns(columns, target, where, opts) {
224
224
  }
225
225
  }
226
226
  if (target.kind !== undefined) {
227
- const label = sanitizeName(`${target.kind}_${target.tfLabel ?? target.refName ?? "target"}_${value.name ?? refName}`);
227
+ const label = foreignFieldDataLabel(target.kind, target.tfLabel ?? target.refName ?? "target", value.name ?? refName);
228
228
  opts.orgRefs.foreignField("elementum_field", label, target.value, value.name ?? refName);
229
229
  out.push(expr.dataAttr("elementum_field", label, ["id"]));
230
230
  continue;
@@ -492,7 +492,7 @@ export type ActionCardItem = {
492
492
  /**
493
493
  * Customer-facing name: Chart
494
494
  * Customer-facing description: A bar, line, or donut chart in a card. Use it to compare values or show a trend.
495
- * Internal authoring guidance: Plot-only report chart in a card with optional title, metric, and caption, branded primary default palette, and no download. Use live grouped count fetch (aspectId + stable groupByFieldId) for useful bar, line, or donut category charts; bar and line share the same grouped dataset. Grouped count supports uncalculated single-value picklist/text fields plus filterJson/filterPreset and named quickFilterValue, ANDed with the block filter. Bind filterJson and use the same filterPreset as ListControls when the chart shares the view filter; omit that binding and give the chart its own filterPreset/filterJson when it should measure a different slice. Use scalar fetch (aggregation + aspectId, optional fieldId/filterJson/filterPreset/quickFilterValue) only for one observation; prefer MetricsRowBlock for a single KPI and never present one scalar line point as a trend. Nonempty filterJson wins; a preset is only a seed. Never mix fetch and embedded data. Use embedded data for preview or when the agent already owns the complete dataset. Grouped numeric sum/avg/min/max is not supported by this count-shaped API. Pair charts with DataTableBlock/ListCollectionBlock and MetricsRowBlock to build dashboards.
495
+ * Internal authoring guidance: Plot-only report chart in a card with optional title, metric, and caption, branded primary default palette, and no download. Use live grouped count fetch (aspectId + stable groupByFieldId) for useful bar, line, or donut category charts; bar and line share the same grouped dataset. Grouped count supports uncalculated single-value picklist/text fields plus filterJson/filterPreset and named quickFilterValue, ANDed with the block filter. Bind filterJson and use the same filterPreset as ListControls when the chart shares the view filter; omit that binding and give the chart its own filterPreset/filterJson when it should measure a different slice. Use date series (aspectId + stable dateFieldId, saved bucket day/week/month, and YYYY-MM-DD/YYYY-MM-DD range) for a bar or line trend. The range is sent as a BETWEEN on that date field; plot the returned points in order, including zeros the API already filled. A blank range draws the empty plot. There is no runtime bucket switch. Use scalar fetch (aggregation + aspectId, optional fieldId/filterJson/filterPreset/quickFilterValue) only for one observation; prefer MetricsRowBlock for a single KPI and never present one scalar line point as a trend. Nonempty filterJson wins; a preset is only a seed. Never mix fetch and embedded data. Use embedded data for preview or when the agent already owns the complete dataset. Grouped numeric sum/avg/min/max is not supported by this count-shaped API. Pair charts with DataTableBlock/ListCollectionBlock and MetricsRowBlock to build dashboards.
496
496
  */
497
497
  export type ChartBlockElement = {
498
498
  readonly type: "ChartBlock";
@@ -504,7 +504,7 @@ export type ChartBlockElement = {
504
504
  readonly watch?: ElementWatch;
505
505
  readonly validation?: ElementValidation;
506
506
  };
507
- export type ChartBlockProps = (ChartBlockPresentationalProps) | (ChartBlockFetchProps) | (ChartBlockGroupedFetchProps);
507
+ export type ChartBlockProps = (ChartBlockPresentationalProps) | (ChartBlockFetchProps) | (ChartBlockGroupedFetchProps) | (ChartBlockDateSeriesProps);
508
508
  export type ChartBlockPresentationalProps = {
509
509
  readonly variant: ("bar" | "line" | "donut") | (PropExpression);
510
510
  readonly height?: ("sm" | "md" | "lg") | (PropExpression);
@@ -550,6 +550,23 @@ export type ChartBlockGroupedFetchProps = {
550
550
  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);
551
551
  readonly quickFilterValue?: ((string) | (PropExpression)) | (null);
552
552
  };
553
+ export type ChartBlockDateSeriesProps = {
554
+ readonly variant: ("bar" | "line") | (PropExpression);
555
+ readonly height?: ("sm" | "md" | "lg") | (PropExpression);
556
+ readonly colorStyle?: ("gradient" | "flat") | (PropExpression);
557
+ readonly title?: (string) | (PropExpression);
558
+ readonly metric?: (string) | (PropExpression);
559
+ readonly caption?: (string) | (PropExpression);
560
+ readonly aspectId: (string) | (PropExpression);
561
+ readonly dateFieldId: (string) | (PropExpression);
562
+ readonly bucket?: ("day" | "week" | "month") | (PropExpression);
563
+ readonly range?: (string) | (PropExpression);
564
+ readonly filterJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
565
+ readonly [key: string]: OpaqueJson;
566
+ }))) | (PropExpression)) | (null);
567
+ 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);
568
+ readonly quickFilterValue?: ((string) | (PropExpression)) | (null);
569
+ };
553
570
  /**
554
571
  * Customer-facing name: Metrics
555
572
  * Customer-facing description: A single KPI tile with a caption and prominent value.
@@ -614,7 +631,7 @@ export type MetricsRowSelfFetchProps = {
614
631
  /**
615
632
  * Customer-facing name: Page header
616
633
  * Customer-facing description: A compact heading with a short description and actions at the top of a page.
617
- * 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. Use DataTableBlock or ListCollectionBlock for collection content and HeaderBlock or BodyBlock for headings inside a detail section.
634
+ * 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.
618
635
  */
619
636
  export type PageHeaderBlockElement = {
620
637
  readonly type: "PageHeaderBlock";
@@ -646,7 +663,7 @@ export type PageHeaderAction = {
646
663
  /**
647
664
  * Customer-facing name: Buttons
648
665
  * Customer-facing description: A row of buttons that link to pages or run actions.
649
- * 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; no other element or state is needed. The row stacks in narrow panes. Use PageHeaderBlock actions for page-level heading buttons.
666
+ * 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. 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.
650
667
  */
651
668
  export type ButtonBlockElement = {
652
669
  readonly type: "ButtonBlock";
@@ -681,11 +698,11 @@ export type ButtonBlockLinkItem = {
681
698
  readonly icon?: string;
682
699
  readonly disabled?: boolean;
683
700
  /**
684
- * Navigation target. Absolute http(s) URL or root-relative /path.
701
+ * Navigation target. Absolute http(s) URL or root-relative /path. For managed views and portal pages, use the href a tool returned verbatim; never build route segments.
685
702
  */
686
703
  readonly href: string;
687
704
  /**
688
- * Managed view id this href targets; saved as an AspectView dependency.
705
+ * Managed view id this href targets (from the same tool result as href); saved as an AspectView dependency.
689
706
  */
690
707
  readonly viewId?: string;
691
708
  };
@@ -708,7 +725,7 @@ export type ButtonBlockActionItem = {
708
725
  readonly icon?: string;
709
726
  readonly disabled?: boolean;
710
727
  /**
711
- * Non-navigation action, such as createRecord with an aspectId parameter.
728
+ * Non-navigation action, such as createRecord with an aspectId parameter or triggerAutomation with an automationId. Do not set href on the same item.
712
729
  */
713
730
  readonly onPress: {
714
731
  readonly action: string;
@@ -792,7 +809,7 @@ export type ButtonBlockStaticItem = {
792
809
  readonly icon?: string;
793
810
  readonly disabled?: boolean;
794
811
  /**
795
- * Managed view id this href targets; saved as an AspectView dependency.
812
+ * Managed view id this href targets (from the same tool result as href); saved as an AspectView dependency.
796
813
  */
797
814
  readonly viewId?: string;
798
815
  };
@@ -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.31.0
3
- // Schema sha256: b20dcc28894662a36323d036f9701d47c0e06fd0a913429c3cd82e610d3c5a1a
2
+ // Source: urn:elementum:elementum-blocks:spec:v1 version 1.32.0
3
+ // Schema sha256: e7aaa8b67a6efb61e10fd927c08be354c14ec1bb09cb740df41100abb56059bc
4
4
  // Generator revision: 2
5
5
  export {};
@@ -51,6 +51,49 @@ export declare const BUILD_VS_EXPORT_RESOLVED_DATA_REFERENCE_EQUIVALENCES: {
51
51
  dataType: string;
52
52
  blockType: string;
53
53
  }[];
54
+ export declare const BUILD_VS_EXPORT_KEYED_LOCAL_ALIASES: {
55
+ listAttribute: string;
56
+ keyAttribute: string;
57
+ nameAttribute: string;
58
+ byNameSuffix: string;
59
+ byKeySuffix: string;
60
+ blockType: string;
61
+ }[];
62
+ export declare const BUILD_VS_EXPORT_MANAGED_LOOKUP_ATTRIBUTES: {
63
+ readonly lookupType: string;
64
+ readonly attribute: string;
65
+ readonly ownerType: string;
66
+ readonly ownerReference: string;
67
+ }[];
68
+ export declare const BUILD_VS_EXPORT_COMPUTED_MAP_ATTRIBUTES: {
69
+ attribute: string;
70
+ listAttribute: string;
71
+ keyAttribute: string;
72
+ valueAttribute: string;
73
+ blockType: string;
74
+ }[];
75
+ export declare const BUILD_VS_EXPORT_NESTED_OMITTED_DEFAULTS: {
76
+ attribute: string;
77
+ defaults: Readonly<Record<string, import("../engine/tf/model.js").TfValue>>;
78
+ blockType: string;
79
+ }[];
80
+ export declare const BUILD_VS_EXPORT_COMPUTED_REFERENCE_MAPS: {
81
+ readonly resourceType: string;
82
+ readonly attribute: string;
83
+ readonly listAttribute: string;
84
+ readonly nameAttribute: string;
85
+ readonly value: (name: string) => string;
86
+ }[];
87
+ export declare const BUILD_VS_EXPORT_RECORD_FIELD_OUTPUT_KEYS: {
88
+ readonly nameAttribute: string;
89
+ readonly ownerAttribute: string;
90
+ }[];
91
+ export declare const BUILD_VS_EXPORT_ATTRIBUTE_LOCALS: {
92
+ readonly resourceType: string;
93
+ readonly attribute: string;
94
+ readonly localPrefix: string;
95
+ }[];
96
+ export declare const BUILD_VS_EXPORT_TASK_OUTPUT_REFERENCE_NAMES: ReadonlyMap<string, ReadonlyMap<string, string>>;
54
97
  /** Kind id → module. */
55
98
  export declare const KIND_BY_ID: ReadonlyMap<KindId, EntityKindModule>;
56
99
  /** @deprecated Use {@link KIND_BY_ID}. */
@@ -57,6 +57,15 @@ export const BUILD_VS_EXPORT_SCOPE_TYPES = new Set([
57
57
  export const BUILD_VS_EXPORT_REFERENCE_ALIASES = KIND_MODULES.flatMap((module) => module.roundtrip?.referenceAliases ?? []);
58
58
  /** Entity-declared typed-data-vs-resolved-literal equivalences for export comparison. */
59
59
  export const BUILD_VS_EXPORT_RESOLVED_DATA_REFERENCE_EQUIVALENCES = KIND_MODULES.flatMap((module) => (module.roundtrip?.resolvedDataReferences ?? []).flatMap((equivalence) => implementedResourceTypes(module.resource).map((blockType) => ({ blockType, ...equivalence }))));
60
+ export const BUILD_VS_EXPORT_KEYED_LOCAL_ALIASES = KIND_MODULES.flatMap((module) => (module.roundtrip?.keyedLocalAliases ?? []).flatMap((alias) => implementedResourceTypes(module.resource).map((blockType) => ({ blockType, ...alias }))));
61
+ export const BUILD_VS_EXPORT_MANAGED_LOOKUP_ATTRIBUTES = KIND_MODULES.flatMap((module) => module.roundtrip?.managedLookupAttributes ?? []);
62
+ export const BUILD_VS_EXPORT_COMPUTED_MAP_ATTRIBUTES = KIND_MODULES.flatMap((module) => (module.roundtrip?.computedMapAttributes ?? []).flatMap((declared) => implementedResourceTypes(module.resource).map((blockType) => ({ blockType, ...declared }))));
63
+ export const BUILD_VS_EXPORT_NESTED_OMITTED_DEFAULTS = KIND_MODULES.flatMap((module) => (module.roundtrip?.nestedOmittedDefaults ?? []).flatMap((declared) => implementedResourceTypes(module.resource).map((blockType) => ({ blockType, ...declared }))));
64
+ export const BUILD_VS_EXPORT_COMPUTED_REFERENCE_MAPS = KIND_MODULES.flatMap((module) => module.roundtrip?.computedReferenceMaps ?? []);
65
+ export const BUILD_VS_EXPORT_RECORD_FIELD_OUTPUT_KEYS = KIND_MODULES.flatMap((module) => module.roundtrip?.recordFieldOutputKeys ?? []);
66
+ export const BUILD_VS_EXPORT_ATTRIBUTE_LOCALS = KIND_MODULES.flatMap((module) => module.roundtrip?.exportedAttributeLocals ?? []);
67
+ export const BUILD_VS_EXPORT_TASK_OUTPUT_REFERENCE_NAMES = new Map(KIND_MODULES.flatMap((module) => Object.entries(module.roundtrip?.taskOutputReferenceNames ?? {}))
68
+ .map(([taskType, names]) => [taskType, new Map(Object.entries(names))]));
60
69
  /** Kind id → module. */
61
70
  export const KIND_BY_ID = new Map(KIND_MODULES.map((m) => [m.kind, m]));
62
71
  /** @deprecated Use {@link KIND_BY_ID}. */
@@ -280,6 +280,8 @@ export interface UnresolvedReferenceDiagnostic {
280
280
  readonly portability: "source-org-only";
281
281
  }
282
282
  export interface PrintOwnFileOptions {
283
+ /** Directory refName → actual flat barrel key, including app/element collisions. */
284
+ readonly elementCatalogKeys?: ReadonlyMap<string, string>;
283
285
  readonly appRefName: string;
284
286
  /** The owning stream root; required for typed app/element authoring output. */
285
287
  readonly parentScope: ChildResourceScope | "table";
@@ -483,6 +485,11 @@ export type LifecycleFacet = {
483
485
  * the source (relative to its folder). Required for the pruning above.
484
486
  */
485
487
  readonly companionRefs?: (source: string) => readonly string[];
488
+ /**
489
+ * Rebind an extracted child's self references to an existing authored owner.
490
+ * Kinds with typed foreign identities can override the generic deep rebind.
491
+ */
492
+ readonly rebindOwnFileOwner?: (item: unknown, extractedOwnerRefName: string, authoredOwnerRefName: string) => unknown;
486
493
  /** Print one extracted own-file instance to TypeScript source. */
487
494
  readonly printOwnFile?: (item: unknown, opts: PrintOwnFileOptions) => PrintedOwnFile;
488
495
  /** Re-pull: preserve author-owned values that the live export cannot represent. */
@@ -548,6 +555,77 @@ export interface EntityKindModule {
548
555
  readonly attribute: string;
549
556
  readonly suffix: string;
550
557
  }[];
558
+ /**
559
+ * Two `<label><suffix>` locals that read the same list on this kind's
560
+ * resource, one indexed by each entry's name and one by its key.
561
+ */
562
+ readonly keyedLocalAliases?: readonly {
563
+ readonly listAttribute: string;
564
+ readonly keyAttribute: string;
565
+ readonly nameAttribute: string;
566
+ readonly byNameSuffix: string;
567
+ readonly byKeySuffix: string;
568
+ }[];
569
+ /**
570
+ * Attributes a data lookup of one of this kind's managed resources (by
571
+ * that resource's own id) reads from the sibling resource referencing it,
572
+ * e.g. a published automation's `parameter_ids` from its trigger.
573
+ */
574
+ readonly managedLookupAttributes?: readonly {
575
+ readonly lookupType: string;
576
+ readonly attribute: string;
577
+ readonly ownerType: string;
578
+ readonly ownerReference: string;
579
+ }[];
580
+ /**
581
+ * Per task resource type, refs-map keys whose task reference name (what
582
+ * an exported value envelope carries) differs from the key. Every other
583
+ * task output's reference name is its refs-map key.
584
+ */
585
+ readonly taskOutputReferenceNames?: Readonly<Record<string, Readonly<Record<string, string>>>>;
586
+ /**
587
+ * A found record's `record.<field id>` output is listed in the task's
588
+ * refs under the field's `<nameAttribute>`, unique per `<ownerAttribute>`.
589
+ */
590
+ readonly recordFieldOutputKeys?: readonly {
591
+ readonly nameAttribute: string;
592
+ readonly ownerAttribute: string;
593
+ }[];
594
+ /**
595
+ * Map attributes the provider computes at plan time from the resource's
596
+ * own list: `<attribute>[entry.<nameAttribute>]` is `value(name)`.
597
+ */
598
+ readonly computedReferenceMaps?: readonly {
599
+ readonly resourceType: string;
600
+ readonly attribute: string;
601
+ readonly listAttribute: string;
602
+ readonly nameAttribute: string;
603
+ readonly value: (name: string) => string;
604
+ }[];
605
+ /**
606
+ * Map attributes the provider computes on this kind's resource as
607
+ * `{ for e in <listAttribute> : e.<keyAttribute> => e.<valueAttribute> }`.
608
+ */
609
+ readonly computedMapAttributes?: readonly {
610
+ readonly attribute: string;
611
+ readonly listAttribute: string;
612
+ readonly keyAttribute: string;
613
+ readonly valueAttribute: string;
614
+ }[];
615
+ /**
616
+ * Keys the export writes at their default on every object nested in
617
+ * `<attribute>` (including jsonencoded payloads) and the build omits.
618
+ */
619
+ readonly nestedOmittedDefaults?: readonly {
620
+ readonly attribute: string;
621
+ readonly defaults: Readonly<Record<string, TfValue>>;
622
+ }[];
623
+ /** Server-assigned attributes the export records as a `<localPrefix><label>` local. */
624
+ readonly exportedAttributeLocals?: readonly {
625
+ readonly resourceType: string;
626
+ readonly attribute: string;
627
+ readonly localPrefix: string;
628
+ }[];
551
629
  };
552
630
  }
553
631
  export declare function implementedResourceTypes(resource: ResourceFacet): readonly string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementumai/edk",
3
- "version": "0.9.18",
3
+ "version": "0.9.19",
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",
@@ -161,6 +161,7 @@
161
161
  "build": "npm run build:sdk",
162
162
  "prebuild:sdk": "npm run generate:ragnarok",
163
163
  "build:sdk": "rm -rf dist-sdk && tsc -p tsconfig.sdk.json",
164
+ "prebuild:cli": "npm run generate:ragnarok",
164
165
  "build:cli": "npm run sync:version && npm run sync:skills && npm run sync:compatibility && rm -rf dist-cli && tsc -p tsconfig.cli.json",
165
166
  "prebuild:provider": "npm run generate:graphql",
166
167
  "build:provider": "go -C provider build .",