@elementumai/edk 0.9.19 → 0.9.20

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 (176) hide show
  1. package/README.md +146 -6
  2. package/dist-sdk/src/catalog/factories.d.ts +24 -1
  3. package/dist-sdk/src/catalog/factories.js +30 -0
  4. package/dist-sdk/src/catalog/from-authoring.d.ts +13 -8
  5. package/dist-sdk/src/catalog/from-authoring.js +34 -9
  6. package/dist-sdk/src/catalog/index.d.ts +2 -2
  7. package/dist-sdk/src/catalog/index.js +2 -2
  8. package/dist-sdk/src/catalog/render.js +6 -6
  9. package/dist-sdk/src/catalog/token.js +7 -0
  10. package/dist-sdk/src/catalog/types.d.ts +34 -1
  11. package/dist-sdk/src/catalog/types.js +11 -0
  12. package/dist-sdk/src/core/triggers/on-demand.d.ts +39 -3
  13. package/dist-sdk/src/core/triggers/on-demand.js +10 -2
  14. package/dist-sdk/src/engine/build/context.d.ts +1 -1
  15. package/dist-sdk/src/engine/ei/run.d.ts +149 -0
  16. package/dist-sdk/src/engine/ei/run.js +1132 -0
  17. package/dist-sdk/src/engine/logging.d.ts +17 -0
  18. package/dist-sdk/src/engine/logging.js +18 -0
  19. package/dist-sdk/src/engine/pull/ref-only.d.ts +5 -0
  20. package/dist-sdk/src/engine/pull/ref-only.js +10 -7
  21. package/dist-sdk/src/engine/pull/result-output.d.ts +6 -0
  22. package/dist-sdk/src/engine/pull/result-output.js +87 -3
  23. package/dist-sdk/src/engine/tf/expr.js +1 -1
  24. package/dist-sdk/src/engine/tf/index.d.ts +2 -2
  25. package/dist-sdk/src/engine/tf/index.js +1 -1
  26. package/dist-sdk/src/engine/tf/labels.d.ts +6 -0
  27. package/dist-sdk/src/engine/tf/labels.js +9 -0
  28. package/dist-sdk/src/engine/tf/model.d.ts +22 -1
  29. package/dist-sdk/src/engine/tf/parse.js +92 -4
  30. package/dist-sdk/src/engine/tf/render.d.ts +4 -2
  31. package/dist-sdk/src/engine/tf/render.js +41 -7
  32. package/dist-sdk/src/engine/validation.d.ts +39 -0
  33. package/dist-sdk/src/engine/validation.js +85 -0
  34. package/dist-sdk/src/entities/access-policy/to-tf.js +5 -2
  35. package/dist-sdk/src/entities/agent/build.d.ts +4 -16
  36. package/dist-sdk/src/entities/agent/build.js +40 -5
  37. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +4 -2
  38. package/dist-sdk/src/entities/agent/to-tf.js +6 -3
  39. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +2 -0
  40. package/dist-sdk/src/entities/agent-tool/from-tf.js +7 -1
  41. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +2 -2
  42. package/dist-sdk/src/entities/agent-tool/to-tf.js +27 -5
  43. package/dist-sdk/src/entities/app/build.d.ts +89 -20
  44. package/dist-sdk/src/entities/app/build.js +51 -6
  45. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +16 -0
  46. package/dist-sdk/src/entities/app/from-tf.d.ts +1 -0
  47. package/dist-sdk/src/entities/app/from-tf.js +7 -2
  48. package/dist-sdk/src/entities/app/index.d.ts +6 -6
  49. package/dist-sdk/src/entities/app/index.js +1 -0
  50. package/dist-sdk/src/entities/app/module.js +5 -2
  51. package/dist-sdk/src/entities/app/to-tf.js +19 -11
  52. package/dist-sdk/src/entities/automation/build.d.ts +47 -5
  53. package/dist-sdk/src/entities/automation/build.js +137 -20
  54. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +24 -1
  55. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +314 -39
  56. package/dist-sdk/src/entities/automation/from-tf.d.ts +28 -6
  57. package/dist-sdk/src/entities/automation/from-tf.js +428 -48
  58. package/dist-sdk/src/entities/automation/generated/task-output-contracts.d.ts +33 -0
  59. package/dist-sdk/src/entities/automation/generated/task-output-contracts.js +183 -0
  60. package/dist-sdk/src/entities/automation/index.d.ts +2 -2
  61. package/dist-sdk/src/entities/automation/index.js +1 -1
  62. package/dist-sdk/src/entities/automation/module.js +37 -8
  63. package/dist-sdk/src/entities/automation/output-field-types.d.ts +7 -0
  64. package/dist-sdk/src/entities/automation/output-field-types.js +36 -0
  65. package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +9 -0
  66. package/dist-sdk/src/entities/automation/output-key-wire-name.js +13 -0
  67. package/dist-sdk/src/entities/automation/script-code.d.ts +17 -0
  68. package/dist-sdk/src/entities/automation/script-code.js +91 -5
  69. package/dist-sdk/src/entities/automation/system-ref-name.js +4 -0
  70. package/dist-sdk/src/entities/automation/task-output-labels.d.ts +2 -0
  71. package/dist-sdk/src/entities/automation/task-output-labels.js +9 -0
  72. package/dist-sdk/src/entities/automation/tasks.d.ts +24 -2
  73. package/dist-sdk/src/entities/automation/tasks.js +38 -9
  74. package/dist-sdk/src/entities/automation/to-tf.d.ts +4 -0
  75. package/dist-sdk/src/entities/automation/to-tf.js +489 -83
  76. package/dist-sdk/src/entities/automation/triggers.d.ts +4 -2
  77. package/dist-sdk/src/entities/automation/triggers.js +4 -0
  78. package/dist-sdk/src/entities/chart/to-tf.js +10 -3
  79. package/dist-sdk/src/entities/dynamic-layout/build.d.ts +24 -31
  80. package/dist-sdk/src/entities/element/build.d.ts +25 -13
  81. package/dist-sdk/src/entities/element/build.js +4 -1
  82. package/dist-sdk/src/entities/element/from-tf.d.ts +11 -0
  83. package/dist-sdk/src/entities/element/from-tf.js +58 -1
  84. package/dist-sdk/src/entities/element/index.d.ts +5 -3
  85. package/dist-sdk/src/entities/element/index.js +1 -0
  86. package/dist-sdk/src/entities/element/module.js +9 -3
  87. package/dist-sdk/src/entities/element/to-tf.js +8 -2
  88. package/dist-sdk/src/entities/field/build.d.ts +14 -1
  89. package/dist-sdk/src/entities/field/build.js +3 -0
  90. package/dist-sdk/src/entities/field/from-tf.d.ts +1 -0
  91. package/dist-sdk/src/entities/field/from-tf.js +39 -1
  92. package/dist-sdk/src/entities/field/media-types.d.ts +6 -0
  93. package/dist-sdk/src/entities/field/media-types.js +30 -0
  94. package/dist-sdk/src/entities/field/module.js +1 -0
  95. package/dist-sdk/src/entities/field/to-tf.d.ts +23 -2
  96. package/dist-sdk/src/entities/field/to-tf.js +130 -14
  97. package/dist-sdk/src/entities/file-reader/from-tf.js +14 -5
  98. package/dist-sdk/src/entities/file-reader/module.js +1 -0
  99. package/dist-sdk/src/entities/file-reader/types.d.ts +2 -0
  100. package/dist-sdk/src/entities/file-reader/types.js +1 -1
  101. package/dist-sdk/src/entities/portal/build.d.ts +26 -0
  102. package/dist-sdk/src/entities/portal/build.js +37 -0
  103. package/dist-sdk/src/entities/portal/from-tf.d.ts +27 -0
  104. package/dist-sdk/src/entities/portal/from-tf.js +75 -0
  105. package/dist-sdk/src/entities/portal/index.d.ts +1 -0
  106. package/dist-sdk/src/entities/portal/index.js +1 -0
  107. package/dist-sdk/src/entities/portal/module.d.ts +3 -0
  108. package/dist-sdk/src/entities/portal/module.js +28 -0
  109. package/dist-sdk/src/entities/portal/to-tf.d.ts +12 -0
  110. package/dist-sdk/src/entities/portal/to-tf.js +73 -0
  111. package/dist-sdk/src/entities/portal/types.d.ts +1 -0
  112. package/dist-sdk/src/entities/portal/types.js +1 -0
  113. package/dist-sdk/src/entities/relationship/module.js +2 -0
  114. package/dist-sdk/src/entities/relationship/pair-check.d.ts +7 -0
  115. package/dist-sdk/src/entities/relationship/pair-check.js +68 -0
  116. package/dist-sdk/src/entities/relationship/to-tf.d.ts +2 -0
  117. package/dist-sdk/src/entities/relationship/to-tf.js +12 -3
  118. package/dist-sdk/src/entities/search-table/module.js +1 -0
  119. package/dist-sdk/src/entities/search-table/to-tf.d.ts +1 -0
  120. package/dist-sdk/src/entities/search-table/to-tf.js +1 -1
  121. package/dist-sdk/src/entities/service-account/build.d.ts +15 -2
  122. package/dist-sdk/src/entities/service-account/from-tf.d.ts +2 -4
  123. package/dist-sdk/src/entities/service-account/from-tf.js +17 -5
  124. package/dist-sdk/src/entities/service-account/role-fidelity.d.ts +56 -0
  125. package/dist-sdk/src/entities/service-account/role-fidelity.js +243 -0
  126. package/dist-sdk/src/entities/service-account/to-tf.d.ts +14 -0
  127. package/dist-sdk/src/entities/service-account/to-tf.js +17 -0
  128. package/dist-sdk/src/entities/shared/aspect-target-from-tf.d.ts +1 -1
  129. package/dist-sdk/src/entities/shared/aspect-target-from-tf.js +5 -2
  130. package/dist-sdk/src/entities/shared/filters/ast.d.ts +8 -0
  131. package/dist-sdk/src/entities/shared/filters/index.d.ts +2 -0
  132. package/dist-sdk/src/entities/shared/filters/index.js +14 -4
  133. package/dist-sdk/src/entities/shared/filters/print.js +17 -1
  134. package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +2 -0
  135. package/dist-sdk/src/entities/shared/filters/tf-codec.js +5 -1
  136. package/dist-sdk/src/entities/shared/filters/types.d.ts +9 -1
  137. package/dist-sdk/src/entities/shared/types/field-types.d.ts +10 -5
  138. package/dist-sdk/src/entities/shared/types/field-types.js +4 -0
  139. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +2 -1
  140. package/dist-sdk/src/entities/skill/from-tf.js +66 -13
  141. package/dist-sdk/src/entities/skill/input-coverage.d.ts +7 -0
  142. package/dist-sdk/src/entities/skill/input-coverage.js +11 -0
  143. package/dist-sdk/src/entities/skill/to-tf.js +14 -4
  144. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +2 -0
  145. package/dist-sdk/src/entities/skill-tool/from-tf.js +8 -2
  146. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +2 -2
  147. package/dist-sdk/src/entities/skill-tool/to-tf.js +27 -5
  148. package/dist-sdk/src/entities/table/catalog.d.ts +14 -0
  149. package/dist-sdk/src/entities/table/catalog.js +66 -0
  150. package/dist-sdk/src/entities/table/module.js +2 -1
  151. package/dist-sdk/src/entities/table/to-tf.js +2 -2
  152. package/dist-sdk/src/entities/view/agent-view-layout-from-tf.d.ts +49 -9
  153. package/dist-sdk/src/entities/view/agent-view-layout-from-tf.js +71 -18
  154. package/dist-sdk/src/entities/view/agent-view-layout-to-tf.d.ts +19 -4
  155. package/dist-sdk/src/entities/view/agent-view-layout-to-tf.js +82 -10
  156. package/dist-sdk/src/entities/view/agent-view-layout.d.ts +53 -23
  157. package/dist-sdk/src/entities/view/agent-view-layout.js +1 -1
  158. package/dist-sdk/src/entities/view/from-tf.d.ts +3 -2
  159. package/dist-sdk/src/entities/view/from-tf.js +124 -12
  160. package/dist-sdk/src/entities/view/module.js +30 -3
  161. package/dist-sdk/src/entities/view/to-tf.d.ts +14 -1
  162. package/dist-sdk/src/entities/view/to-tf.js +67 -10
  163. package/dist-sdk/src/entities/view/types.d.ts +4 -15
  164. package/dist-sdk/src/entities/view/types.js +15 -15
  165. package/dist-sdk/src/entities/widget/build.d.ts +16 -1
  166. package/dist-sdk/src/entities/widget/build.js +11 -1
  167. package/dist-sdk/src/entities/widget/to-tf.js +34 -8
  168. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +16 -5
  169. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
  170. package/dist-sdk/src/graph/index.d.ts +11 -0
  171. package/dist-sdk/src/graph/index.js +21 -0
  172. package/dist-sdk/src/graph/modules.js +2 -0
  173. package/dist-sdk/src/graph/types.d.ts +55 -2
  174. package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
  175. package/dist-sdk/src/internal/sdk-package.js +1 -0
  176. package/package.json +10 -1
@@ -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 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.
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 either an exact YYYY-MM-DD/YYYY-MM-DD range or relativeRange) for a bar or line trend. Exact range is a BETWEEN on that date field. relativeRange is { count, unit, optional offset } with unit day, week, month, quarter, or year. The runtime resolves it to an inclusive local-calendar BETWEEN that moves with today. Omit offset to include the current unfinished unit; offset 1 is the previous complete unit or units. Quarter and year have no series granularity, so set bucket to month unless a day or week bucket is intended. Set only one window. Write the window in the Spec. The builder has no range control. Plot the returned points in order, including zeros the API already filled. A blank window 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";
@@ -561,12 +561,18 @@ export type ChartBlockDateSeriesProps = {
561
561
  readonly dateFieldId: (string) | (PropExpression);
562
562
  readonly bucket?: ("day" | "week" | "month") | (PropExpression);
563
563
  readonly range?: (string) | (PropExpression);
564
+ readonly relativeRange?: (ChartBlockRelativeRange) | (PropExpression);
564
565
  readonly filterJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
565
566
  readonly [key: string]: OpaqueJson;
566
567
  }))) | (PropExpression)) | (null);
567
568
  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
569
  readonly quickFilterValue?: ((string) | (PropExpression)) | (null);
569
570
  };
571
+ export type ChartBlockRelativeRange = {
572
+ readonly count: (number) | (PropExpression);
573
+ readonly unit: ("day" | "week" | "month" | "quarter" | "year") | (PropExpression);
574
+ readonly offset?: (number) | (PropExpression);
575
+ };
570
576
  /**
571
577
  * Customer-facing name: Metrics
572
578
  * Customer-facing description: A single KPI tile with a caption and prominent value.
@@ -663,7 +669,7 @@ export type PageHeaderAction = {
663
669
  /**
664
670
  * Customer-facing name: Buttons
665
671
  * Customer-facing description: A row of buttons that link to pages or run actions.
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.
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.
667
673
  */
668
674
  export type ButtonBlockElement = {
669
675
  readonly type: "ButtonBlock";
@@ -725,11 +731,18 @@ export type ButtonBlockActionItem = {
725
731
  readonly icon?: string;
726
732
  readonly disabled?: boolean;
727
733
  /**
728
- * Non-navigation action, such as createRecord with an aspectId parameter or triggerAutomation with an automationId. Do not set href on the same item.
734
+ * 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 item.
729
735
  */
730
736
  readonly onPress: {
731
737
  readonly action: string;
732
738
  readonly params?: {
739
+ readonly copy?: {
740
+ readonly confirm?: string;
741
+ readonly pending?: string;
742
+ readonly success?: string;
743
+ readonly failure?: string;
744
+ };
745
+ } & {
733
746
  readonly [key: string]: (string) | (number) | (boolean) | (null) | ({
734
747
  readonly $state: string;
735
748
  } & {
@@ -786,8 +799,6 @@ export type ButtonBlockActionItem = {
786
799
  readonly [key: string]: unknown;
787
800
  });
788
801
  readonly preventDefault?: boolean;
789
- } & {
790
- readonly [key: string]: unknown;
791
802
  };
792
803
  };
793
804
  export type ButtonBlockStaticItem = {
@@ -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.32.0
3
- // Schema sha256: e7aaa8b67a6efb61e10fd927c08be354c14ec1bb09cb740df41100abb56059bc
2
+ // Source: urn:elementum:elementum-blocks:spec:v1 version 1.34.0
3
+ // Schema sha256: b03a0f70e1dab852a792f92f5d684997f290cc364d5f1049d12bd9eb78647f57
4
4
  // Generator revision: 2
5
5
  export {};
@@ -123,6 +123,16 @@ export declare const STREAM_ROOT_RESOURCE_TYPES: ReadonlySet<string>;
123
123
  * entities/ directly.
124
124
  */
125
125
  export declare const AUTHORING_TYPE_BY_RESOURCE_TYPE: ReadonlyMap<string, string>;
126
+ /**
127
+ * Resource type → attributes the platform never returns on read, as each kind
128
+ * declares them on its resource facet. A re-pull fills these from state.
129
+ */
130
+ export declare const UNREADABLE_ATTRIBUTES_BY_RESOURCE_TYPE: ReadonlyMap<string, readonly string[]>;
131
+ /**
132
+ * Resource type → map attributes the provider manages per key, as each
133
+ * single-resource kind declares them. A re-pull keeps only the keys in state.
134
+ */
135
+ export declare const STATE_SCOPED_MAP_ATTRIBUTES_BY_RESOURCE_TYPE: ReadonlyMap<string, readonly string[]>;
126
136
  /** Entity-declared value equivalences used to compare builder and exporter HCL. */
127
137
  export declare const BUILD_VS_EXPORT_NORMALIZATIONS: {
128
138
  readonly omittedAttributeDefaults: {
@@ -168,6 +178,7 @@ export interface CatalogKindMeta {
168
178
  readonly renderOrder: number;
169
179
  readonly catalogRoot: import("./types.js").CatalogRoot;
170
180
  readonly factoryName: string;
181
+ readonly fromOwnRef?: true;
171
182
  readonly renderEntry: (args: CatalogRenderArgs) => CatalogRenderResult;
172
183
  }
173
184
  /** refKind → catalog bag / order / root / factory — graph facets win over deferred. */
@@ -107,6 +107,26 @@ export const STREAM_ROOT_RESOURCE_TYPES = new Set(STREAM_ROOT_MODULES.flatMap((m
107
107
  export const AUTHORING_TYPE_BY_RESOURCE_TYPE = new Map(KIND_MODULES.flatMap((m) => m.resource.shape === "subTypes"
108
108
  ? m.resource.rows.flatMap((row) => (row.authoringType === undefined ? [] : [[row.resourceType, row.authoringType]]))
109
109
  : []));
110
+ /**
111
+ * Resource type → attributes the platform never returns on read, as each kind
112
+ * declares them on its resource facet. A re-pull fills these from state.
113
+ */
114
+ export const UNREADABLE_ATTRIBUTES_BY_RESOURCE_TYPE = new Map(KIND_MODULES.flatMap((m) => {
115
+ if (m.resource.shape === "single") {
116
+ return m.resource.unreadableAttributes === undefined ? [] : [[m.resource.resourceType, m.resource.unreadableAttributes]];
117
+ }
118
+ if (m.resource.shape === "subTypes") {
119
+ return m.resource.rows.flatMap((row) => (row.unreadableAttributes === undefined ? [] : [[row.resourceType, row.unreadableAttributes]]));
120
+ }
121
+ return [];
122
+ }));
123
+ /**
124
+ * Resource type → map attributes the provider manages per key, as each
125
+ * single-resource kind declares them. A re-pull keeps only the keys in state.
126
+ */
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
+ ? [[m.resource.resourceType, m.resource.stateScopedMapAttributes]]
129
+ : []));
110
130
  /** Entity-declared value equivalences used to compare builder and exporter HCL. */
111
131
  export const BUILD_VS_EXPORT_NORMALIZATIONS = {
112
132
  omittedAttributeDefaults: KIND_MODULES.flatMap((module) => (module.roundtrip?.omittedAttributeDefaults ?? []).flatMap((equivalence) => implementedResourceTypes(module.resource).map((blockType) => ({ blockType, ...equivalence })))),
@@ -181,6 +201,7 @@ function catalogMetaOf(facet) {
181
201
  renderOrder: facet.renderOrder,
182
202
  catalogRoot: facet.catalogRoot,
183
203
  factoryName: facet.factoryName ?? `${facet.refKind}Ref`,
204
+ ...(facet.fromOwnRef === true ? { fromOwnRef: true } : {}),
184
205
  renderEntry: facet.renderEntry,
185
206
  };
186
207
  }
@@ -29,6 +29,7 @@ import { skillToolModule } from "../entities/skill-tool/module.js";
29
29
  import { serviceAccountModule } from "../entities/service-account/module.js";
30
30
  import { tableModule } from "../entities/table/module.js";
31
31
  import { taskModule } from "../entities/task/module.js";
32
+ import { portalModule } from "../entities/portal/module.js";
32
33
  import { managedViewOrderModule, viewModule } from "../entities/view/module.js";
33
34
  import { phoneServiceModule } from "../entities/phone-service/module.js";
34
35
  import { organizationModule } from "../entities/organization/module.js";
@@ -65,6 +66,7 @@ export const KIND_MODULES = [
65
66
  searchTableModule,
66
67
  tableModule,
67
68
  taskModule,
69
+ portalModule,
68
70
  cloudLinkModule,
69
71
  categoryModule,
70
72
  connectorModule,
@@ -9,12 +9,13 @@
9
9
  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
- 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" | "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";
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
14
  /** @deprecated Use {@link KindId}. */
14
15
  export type EntityKindId = KindId;
15
16
  export type StreamFacet = {
16
17
  readonly role: "streamRoot";
17
- readonly exportVerb: "apps" | "org" | "elements" | "tasks" | "tables";
18
+ readonly exportVerb: "apps" | "org" | "elements" | "tasks" | "tables" | "portals";
18
19
  } | {
19
20
  readonly role: "streamMember";
20
21
  } | {
@@ -59,6 +60,12 @@ export interface SubTypeRow {
59
60
  * `bootstrapFromState`).
60
61
  */
61
62
  readonly authoringType?: string;
63
+ /**
64
+ * Attributes the platform accepts but never returns on read, so an export
65
+ * can't carry them. A re-pull fills them from the workspace's state (see
66
+ * `alignExportWithState`); a first pull has nothing to fill.
67
+ */
68
+ readonly unreadableAttributes?: readonly string[];
62
69
  }
63
70
  export interface CompositeMember {
64
71
  readonly role: string;
@@ -69,6 +76,18 @@ export type ResourceFacet = {
69
76
  readonly shape: "single";
70
77
  readonly resourceType: string;
71
78
  readonly adoptable: boolean;
79
+ /**
80
+ * Attributes the platform accepts but never returns on read, so an export
81
+ * can't carry them. A re-pull fills them from the workspace's state (see
82
+ * `alignExportWithState`); a first pull has nothing to fill.
83
+ */
84
+ readonly unreadableAttributes?: readonly string[];
85
+ /**
86
+ * Map attributes the provider manages per key, keeping only the keys a
87
+ * workspace sets. The export prints every key; a re-pull keeps only the
88
+ * keys state holds (see `alignExportWithState`).
89
+ */
90
+ readonly stateScopedMapAttributes?: readonly string[];
72
91
  } | {
73
92
  readonly shape: "subTypes";
74
93
  readonly rows: readonly SubTypeRow[];
@@ -219,6 +238,12 @@ export type CatalogFacet = {
219
238
  * `catalog/render.ts`.
220
239
  */
221
240
  readonly renderEntry: (args: CatalogRenderArgs) => CatalogRenderResult;
241
+ /**
242
+ * The bag is read live from the owner's own `.ref()` (it is authored
243
+ * inline in the owner's file), so generated catalogs emit
244
+ * `<bag>: __own.<bag>` instead of baked entries.
245
+ */
246
+ readonly fromOwnRef?: true;
222
247
  /** Placeholder ref before the authoring file is imported (cross-ref stubs). */
223
248
  readonly stubRef: (refName: string, parent: string) => unknown;
224
249
  /**
@@ -251,7 +276,20 @@ export interface StreamExtractContext extends FromTfContext {
251
276
  export interface OwnFileExtractResult {
252
277
  readonly items: readonly unknown[];
253
278
  readonly skipped: readonly string[];
279
+ /**
280
+ * The subset of `skipped` that no authored source can ever manage. If an
281
+ * earlier pull already adopted them, adoption releases them from state so
282
+ * the next apply doesn't destroy the live resources.
283
+ */
284
+ readonly releaseIfManaged?: readonly string[];
254
285
  readonly diagnostics: readonly string[];
286
+ /**
287
+ * Fatal or warning findings that must not be folded into `diagnostics`.
288
+ * Soft extract gaps stay in `diagnostics` + `skipped`. A fatal validation
289
+ * still lists its addresses in `skipped` so adoption does not import a
290
+ * graph that was not written.
291
+ */
292
+ readonly validations?: readonly ValidationFailure[];
255
293
  /** Export address → canonical address rebuilt by the printed current API. */
256
294
  readonly adoptionAddressAliases?: readonly AdoptionAddressAlias[];
257
295
  }
@@ -383,6 +421,8 @@ export interface BuildChildContext {
383
421
  * catalog (#490).
384
422
  */
385
423
  readonly fieldNamesByAppRefName?: ReadonlyMap<string, ReadonlyMap<string, string>>;
424
+ /** RefNames of this build's elements without `systemFields.audit`. */
425
+ readonly elementsWithoutAuditFields?: ReadonlySet<string>;
386
426
  /**
387
427
  * Field resource addresses for every app/element in this build, keyed the
388
428
  * same way as {@link fieldNamesByAppRefName}. A calculation addresses a
@@ -494,6 +534,15 @@ export type LifecycleFacet = {
494
534
  readonly printOwnFile?: (item: unknown, opts: PrintOwnFileOptions) => PrintedOwnFile;
495
535
  /** Re-pull: preserve author-owned values that the live export cannot represent. */
496
536
  readonly mergePulledSource?: (freshSource: string, existingSource: string) => string;
537
+ /**
538
+ * Re-pull: true when an existing source file is earlier printer output
539
+ * that can never build (it carries a placeholder the printer emits for a
540
+ * value with no authored form). When this kind's export is incomplete
541
+ * because a child was skipped, such leftovers are archived to
542
+ * `.edk-state/pull-backups` instead of preserved, so the skipped child's
543
+ * stale source doesn't fail the post-pull build.
544
+ */
545
+ readonly isUnbuildablePulledSource?: (source: string) => boolean;
497
546
  /** Build: emit HCL for one discovered DeployableEntity. */
498
547
  readonly toTf?: (entity: DeployableEntity, ctx: BuildChildContext) => ToTfResult;
499
548
  /** Optional locals contribution after a root/own-file emit. */
@@ -532,6 +581,10 @@ export interface EntityKindModule {
532
581
  readonly canvas: CanvasFacet;
533
582
  /** Generated catalog participation — or {@link NO_CATALOG}. */
534
583
  readonly catalog: CatalogFacet;
584
+ /** Build: checks across every built root block; each returned string fails the build. */
585
+ readonly buildChecks?: {
586
+ readonly validateBuiltBlocks: (blocks: readonly TfBlock[]) => readonly string[];
587
+ };
535
588
  /** Entity-specific equivalences used only by live build-vs-export comparison. */
536
589
  readonly roundtrip?: {
537
590
  readonly referenceAliases: readonly {
@@ -2,6 +2,6 @@ export declare const SDK_PACKAGE_NAME: "@elementumai/edk";
2
2
  export declare const TRANSITIONAL_SDK_PACKAGE_NAME: "@elementum/edk";
3
3
  export declare const LEGACY_SDK_PACKAGE_NAME: "@elementumltd/edk";
4
4
  export declare const LEGACY_SDK_REGISTRY_SCOPE: "@elementumltd:registry";
5
- export declare const SDK_PUBLIC_SUBPATHS: readonly ["app", "elements", "core", "core/filters", "automations", "agents", "agents/skills", "charts", "visualFlows", "searchTables", "fileReaders", "approvalChains", "approvalProcesses", "tables", "tasks", "organization", "catalog"];
5
+ export declare const SDK_PUBLIC_SUBPATHS: readonly ["app", "elements", "core", "core/filters", "automations", "agents", "agents/skills", "charts", "visualFlows", "searchTables", "fileReaders", "approvalChains", "approvalProcesses", "tables", "tasks", "portals", "organization", "catalog"];
6
6
  export type SdkPackageSubpath = (typeof SDK_PUBLIC_SUBPATHS)[number];
7
7
  export declare function sdkPackageSpecifier<T extends SdkPackageSubpath>(subpath: T): `${typeof SDK_PACKAGE_NAME}/${T}`;
@@ -18,6 +18,7 @@ export const SDK_PUBLIC_SUBPATHS = [
18
18
  "approvalProcesses",
19
19
  "tables",
20
20
  "tasks",
21
+ "portals",
21
22
  "organization",
22
23
  "catalog",
23
24
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementumai/edk",
3
- "version": "0.9.19",
3
+ "version": "0.9.20",
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",
@@ -77,6 +77,10 @@
77
77
  "types": "./dist-sdk/src/entities/task/index.d.ts",
78
78
  "import": "./dist-sdk/src/entities/task/index.js"
79
79
  },
80
+ "./portals": {
81
+ "types": "./dist-sdk/src/entities/portal/index.d.ts",
82
+ "import": "./dist-sdk/src/entities/portal/index.js"
83
+ },
80
84
  "./organization": {
81
85
  "types": "./dist-sdk/src/entities/organization/index.d.ts",
82
86
  "import": "./dist-sdk/src/entities/organization/index.js"
@@ -133,6 +137,9 @@
133
137
  "tasks": [
134
138
  "dist-sdk/src/entities/task/index.d.ts"
135
139
  ],
140
+ "portals": [
141
+ "dist-sdk/src/entities/portal/index.d.ts"
142
+ ],
136
143
  "organization": [
137
144
  "dist-sdk/src/entities/organization/index.d.ts"
138
145
  ],
@@ -183,6 +190,7 @@
183
190
  "pack:dry-run": "npm pack --dry-run",
184
191
  "pack:consumer": "npm run build:sdk && tsx src/scripts/test-package-consumer.ts",
185
192
  "release:local-sdk": "bash release/verify-local-sdk-prepare.sh",
193
+ "release:notes": "tsx src/scripts/release-notes.ts",
186
194
  "test": "tsx src/scripts/test.ts",
187
195
  "test:unit": "npm run typecheck:ci && vitest run",
188
196
  "test:runtime": "vitest run",
@@ -221,6 +229,7 @@
221
229
  "edk:canvas": "tsx --tsconfig tsconfig.examples-check.json src/scripts/edk-canvas.ts"
222
230
  },
223
231
  "dependencies": {
232
+ "acorn": "^8.16.0",
224
233
  "jiti": "^2.7.0",
225
234
  "semver": "^7.8.5"
226
235
  },