@elementumai/edk 0.9.17 → 0.9.18

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.
@@ -270,8 +270,8 @@ export interface TriggerParameterRef extends CatalogRef<"triggerParameter"> {
270
270
  /**
271
271
  * An automation output property reference. `valueType` (when known) is the
272
272
  * platform's workflow field-type tag for this output — `"TEXT"`,
273
- * `"BOOLEAN"`, `"NUMBER"`, `"DECIMAL"` — the same domain
274
- * `entities/automation`'s `outputFieldTypesFromScriptSchema` already
273
+ * `"BOOLEAN"`, `"NUMBER"`, `"DECIMAL"`, `"DATE"`, `"DATETIME"` — the same
274
+ * domain `entities/automation`'s `outputFieldTypesFromScriptSchema` already
275
275
  * computes for the wire; not populated when the output's source can't be
276
276
  * resolved to a typed schema (a literal, a trigger ref, a variable ref, or
277
277
  * a non-executeScript task). Kept a bare generic `string` here (no import
@@ -20,6 +20,7 @@ export { phoneService, callerAccessMode, type CallerAccessMode, type E164PhoneNu
20
20
  export { preservePulledCalculation } from "./deserializer/pulled-expression.js";
21
21
  export { groupId, userId, type AccessPolicyGroupRef, type AccessPolicyOptions, type AccessPolicyPrincipalRef, type AccessPolicyUserRef, type GroupId, type UserId } from "../access-policy/build.js";
22
22
  export { type ManagedViewSharing } from "../view/sharing.js";
23
+ export { type ElementumBlocksElement, type ElementumBlocksSpec } from "../view/ragnarok.js";
23
24
  export { roleAutoShare, rolePermissionGroup, rolePermissionLevel, userRef, type AppRole, type RoleAutoShare, type RoleGroupRef, type RolePermission, type RolePermissionGroup, type RolePermissionLevel, type RoleUserRef } from "../role/build.js";
24
25
  export { serviceAccountRoleRef, serviceAccountStatus, type AppServiceAccount, type ServiceAccountAccessPolicy, type ServiceAccountRoleRef, type ServiceAccountStatus } from "../service-account/build.js";
25
26
  export { serviceAccountRef, type ServiceAccountRef } from "../service-account/ref.js";
@@ -121,6 +121,25 @@ const ATTR_TO_ARG = {
121
121
  function isObject(value) {
122
122
  return value !== null && typeof value === "object" && !Array.isArray(value) && !("$expr" in value);
123
123
  }
124
+ /**
125
+ * Map a string output-schema node back to a product scalar.
126
+ * DATE/DATETIME/EMAIL/UUID4 become date/datetime/email/uuid4. A missing
127
+ * format stays the unformatted `string` scalar. Any other format is
128
+ * reported rather than stripped, because dropping it plans a schema update.
129
+ */
130
+ function scriptOutputScalarFromStringNode(definition) {
131
+ const format = definition.format;
132
+ if (format === undefined || format === "")
133
+ return "string";
134
+ switch (format) {
135
+ case "DATE": return "date";
136
+ case "DATETIME": return "datetime";
137
+ case "EMAIL": return "email";
138
+ case "UUID4": return "uuid4";
139
+ default:
140
+ throw new EntityTfError(`unsupported execute-script output string format ${JSON.stringify(format)}; expected DATE, DATETIME, EMAIL, or UUID4`);
141
+ }
142
+ }
124
143
  /**
125
144
  * Detects a switch task's default/catch-all branch and which of the two
126
145
  * mutually-exclusive wire shapes the platform is currently using to mark it.
@@ -2496,6 +2515,8 @@ function taskArgs(block, factory, ctx, fieldMappingDiagnostics) {
2496
2515
  }));
2497
2516
  return { type: "object", properties };
2498
2517
  }
2518
+ if (type === "string")
2519
+ return scriptOutputScalarFromStringNode(definition);
2499
2520
  return type === "bool" ? "boolean" : type;
2500
2521
  };
2501
2522
  const properties = Object.fromEntries(props.map((property) => {
@@ -4,10 +4,11 @@
4
4
  * workflow field type each declared property resolves to.
5
5
  *
6
6
  * Used by `to-tf.ts` (forward: building the `elementum_workflow_publish`
7
- * outputs' `fieldType` envelope) and `build.ts` (authoring-time: stamping
8
- * `OutputPropertyRef.valueType` on the catalog ref) — kept dependency-free
9
- * like `output-key-wire-name.ts` so importing it from either side can never
10
- * introduce a cycle.
7
+ * outputs' `fieldType` envelope), `build.ts` (authoring-time: stamping
8
+ * `OutputPropertyRef.valueType` on the catalog ref), and `from-tf.ts`
9
+ * (a filter reference whose export omitted `real_type`) — kept
10
+ * dependency-free like `output-key-wire-name.ts` so importing it from
11
+ * either side can never introduce a cycle.
11
12
  */
12
13
  /** Map executeScript output_schema properties to refs keys (`result.<name>`). */
13
14
  export declare function outputFieldTypesFromScriptSchema(schema: unknown): Map<string, {
@@ -4,14 +4,29 @@
4
4
  * workflow field type each declared property resolves to.
5
5
  *
6
6
  * Used by `to-tf.ts` (forward: building the `elementum_workflow_publish`
7
- * outputs' `fieldType` envelope) and `build.ts` (authoring-time: stamping
8
- * `OutputPropertyRef.valueType` on the catalog ref) — kept dependency-free
9
- * like `output-key-wire-name.ts` so importing it from either side can never
10
- * introduce a cycle.
7
+ * outputs' `fieldType` envelope), `build.ts` (authoring-time: stamping
8
+ * `OutputPropertyRef.valueType` on the catalog ref), and `from-tf.ts`
9
+ * (a filter reference whose export omitted `real_type`) — kept
10
+ * dependency-free like `output-key-wire-name.ts` so importing it from
11
+ * either side can never introduce a cycle.
11
12
  */
12
13
  function isObject(value) {
13
14
  return value !== null && typeof value === "object" && !Array.isArray(value);
14
15
  }
16
+ /**
17
+ * DATE and DATETIME string formats project to those workflow field types.
18
+ * EMAIL, UUID4, and a missing or other format stay TEXT.
19
+ *
20
+ * Publish envelopes use this projection for `fieldType`. A filter uses it
21
+ * only when the export omitted `real_type`. A stored `real_type`, including
22
+ * `text` on a DATETIME output, is kept so a text comparison is not rewritten
23
+ * as a datetime literal.
24
+ */
25
+ function stringFormatFieldType(format) {
26
+ if (format === "DATE" || format === "DATETIME")
27
+ return format;
28
+ return "TEXT";
29
+ }
15
30
  /** Map executeScript output_schema properties to refs keys (`result.<name>`). */
16
31
  export function outputFieldTypesFromScriptSchema(schema) {
17
32
  if (!isObject(schema))
@@ -33,10 +48,13 @@ export function outputFieldTypesFromScriptSchema(schema) {
33
48
  }
34
49
  if (kind === "object")
35
50
  return { fieldType: "TEXT", multiple: false, kind };
51
+ // Live EDK/dev capture (edkdatetimecap, 2026-09-30): DATE and DATETIME
52
+ // string formats publish as those field types. EMAIL, UUID4, and an
53
+ // unformatted string stay TEXT.
36
54
  const fieldType = kind === "bool" ? "BOOLEAN"
37
55
  : kind === "integer" ? "NUMBER"
38
56
  : kind === "number" ? "DECIMAL"
39
- : kind === "string" ? "TEXT"
57
+ : kind === "string" ? stringFormatFieldType(body.format)
40
58
  : undefined;
41
59
  return fieldType === undefined ? undefined : { fieldType, multiple: false, kind };
42
60
  };
@@ -250,8 +250,13 @@ export interface SetVariableOptions {
250
250
  readonly update?: readonly VariableAssign[];
251
251
  }
252
252
  export declare function setVariable(opts: SetVariableOptions): ActionDef<Record<string, never>>;
253
- /** Scalar types supported by an executeScript output schema. */
254
- export type ScriptOutputScalarType = "text" | "string" | "integer" | "number" | "decimal" | "boolean" | "object";
253
+ /**
254
+ * Scalar types supported by an executeScript output schema.
255
+ *
256
+ * `date`, `datetime`, `email`, and `uuid4` are string outputs the platform
257
+ * stores with a format. Plain `text` and `string` stay format-less.
258
+ */
259
+ export type ScriptOutputScalarType = "text" | "string" | "integer" | "number" | "decimal" | "boolean" | "object" | "date" | "datetime" | "email" | "uuid4";
255
260
  /** A recursively typed executeScript output schema node. */
256
261
  export type ScriptOutputType = ScriptOutputScalarType | {
257
262
  readonly type: "array";
@@ -779,7 +784,7 @@ export interface RunAutomationInput {
779
784
  * output's source wasn't a typed executeScript result) stays `unknown` —
780
785
  * an honest "we don't know", never a wrong guess.
781
786
  */
782
- type WorkflowOutputScalar<T extends string | undefined> = T extends "BOOLEAN" ? boolean : T extends "NUMBER" | "DECIMAL" ? number : T extends "TEXT" ? string : unknown;
787
+ type WorkflowOutputScalar<T extends string | undefined> = T extends "BOOLEAN" ? boolean : T extends "NUMBER" | "DECIMAL" ? number : T extends "TEXT" | "DATE" | "DATETIME" ? string : unknown;
783
788
  type WorkflowOutputValue<T extends string | undefined, Multiple extends boolean | undefined> = Multiple extends true ? readonly WorkflowOutputScalar<T>[] : WorkflowOutputScalar<T>;
784
789
  /**
785
790
  * A `runAutomation` step's result: flat, one property per key the target
@@ -192,6 +192,13 @@ export function setVariable(opts) {
192
192
  },
193
193
  };
194
194
  }
195
+ /** Platform string formats for the product scalar outputs that carry one. */
196
+ const SCRIPT_OUTPUT_STRING_FORMAT = {
197
+ date: "DATE",
198
+ datetime: "DATETIME",
199
+ email: "EMAIL",
200
+ uuid4: "UUID4",
201
+ };
195
202
  /** Split the authored `outputs` option into the root name and the properties. */
196
203
  function normalizeScriptOutputs(outputs) {
197
204
  const properties = outputs.properties;
@@ -214,9 +221,24 @@ function outputSchemaNode(name, type) {
214
221
  case "decimal": return { number: named };
215
222
  case "boolean": return { bool: named };
216
223
  case "object": return { object: named };
224
+ case "date":
225
+ case "datetime":
226
+ case "email":
227
+ case "uuid4":
228
+ // Live export lists format before name. Terraform jsonencode and
229
+ // encoding/json sort object keys, so this order does not change the
230
+ // plan; it keeps the parsed shape aligned with the capture.
231
+ return { string: { format: SCRIPT_OUTPUT_STRING_FORMAT[type], ...named } };
217
232
  case "text":
218
233
  case "string":
219
- default: return { string: named };
234
+ return { string: named };
235
+ default: {
236
+ // A runtime string outside this union (authored JavaScript) stays a
237
+ // format-less string. Falling through would emit an object node.
238
+ const unexpected = type;
239
+ void unexpected;
240
+ return { string: named };
241
+ }
220
242
  }
221
243
  }
222
244
  if (type.type === "array") {
@@ -107,8 +107,12 @@ function printFilterValue(value, codec, call, quote) {
107
107
  case "CURRENT_USER": return call("currentUser", quote(value.valueType ?? "ID"));
108
108
  case "REFERENCE": {
109
109
  const options = value.multiple === true ? ", { multiple: true }" : "";
110
+ // Stored HCL real_type is uppercased as-is. DECIMAL and INTEGER are
111
+ // numeric scalars outside the public ValueType union; they print with
112
+ // the same number helper as NUMBER.
113
+ const realType = value.realType;
110
114
  let helper;
111
- switch (value.realType) {
115
+ switch (realType) {
112
116
  case "BOOLEAN":
113
117
  helper = "boolean";
114
118
  break;
@@ -119,6 +123,8 @@ function printFilterValue(value, codec, call, quote) {
119
123
  helper = "dateTime";
120
124
  break;
121
125
  case "NUMBER":
126
+ case "DECIMAL":
127
+ case "INTEGER":
122
128
  helper = "number";
123
129
  break;
124
130
  case "TEXT":
@@ -129,7 +135,7 @@ function printFilterValue(value, codec, call, quote) {
129
135
  break;
130
136
  case undefined:
131
137
  return `${codec.reference(value.value)}${options}`;
132
- default: throw new Error(`unsupported filter reference type "${value.realType}"`);
138
+ default: throw new Error(`unsupported filter reference type "${realType}"`);
133
139
  }
134
140
  return call(helper, `${codec.reference(value.value)}${options}`);
135
141
  }
@@ -437,6 +437,18 @@ export function filterTfToWire(value) {
437
437
  ...(single.not === true && { not: true }),
438
438
  };
439
439
  }
440
+ /**
441
+ * A stored `real_type` is the comparison the export recorded. Keep it.
442
+ * Schema projection (`referenceType`) fills the type only when `real_type`
443
+ * was omitted, the same way a publish envelope keeps a stored field type.
444
+ */
445
+ function decodedReferenceRealType(codec, reference, stored) {
446
+ const present = typeof stored === "string" && stored !== "";
447
+ const fallback = (present ? stored.toUpperCase() : "TEXT");
448
+ if (present)
449
+ return fallback;
450
+ return codec.referenceType?.(reference, fallback) ?? fallback;
451
+ }
440
452
  /** The only Terraform-HCL filter -> strongly typed deserializer AST. */
441
453
  export function filterFromTf(value, codec, fieldScope = "app") {
442
454
  const filter = tfFilter(value);
@@ -459,11 +471,10 @@ export function filterFromTf(value, codec, fieldScope = "app") {
459
471
  if (filter.left_value.field_id !== undefined)
460
472
  return { leftValue: { type: "FIELD", value: codec.field(filter.left_value.field_id, fieldScope) } };
461
473
  if (filter.left_value.value_reference !== undefined) {
462
- const fallback = (filter.left_value.real_type?.toUpperCase() ?? "TEXT");
463
474
  return {
464
475
  leftValue: {
465
476
  type: "REFERENCE",
466
- realType: codec.referenceType?.(filter.left_value.value_reference, fallback) ?? fallback,
477
+ realType: decodedReferenceRealType(codec, filter.left_value.value_reference, filter.left_value.real_type),
467
478
  value: codec.reference(filter.left_value.value_reference, "left"),
468
479
  },
469
480
  };
@@ -528,10 +539,9 @@ function filterValueFromTf(value, codec, fieldScope) {
528
539
  case "reference": {
529
540
  if (value.value_reference === undefined)
530
541
  throw new EntityTfError("reference filter value requires value_reference");
531
- const fallback = (value.real_type?.toUpperCase() ?? "TEXT");
532
542
  return {
533
543
  type: "REFERENCE",
534
- realType: codec.referenceType?.(value.value_reference, fallback) ?? fallback,
544
+ realType: decodedReferenceRealType(codec, value.value_reference, value.real_type),
535
545
  value: codec.reference(value.value_reference, "value"),
536
546
  ...(value.multiple === true && { multiple: true }),
537
547
  };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Elementum Blocks Spec — the document behind a managed view's custom JSON
3
+ * view. Generated from asgard's public schema into the ignored
4
+ * `src/generated/ragnarok/` by `npm run generate:ragnarok`; refresh with
5
+ * `npm run refresh:ragnarok` when asgard ships a new schema version.
6
+ */
7
+ export type { ElementumBlocksElement, ElementumBlocksSpec, } from "../../generated/ragnarok/ragnarok-spec.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,798 @@
1
+ export type ElementumBlocksSpec = {
2
+ readonly root: string;
3
+ readonly elements: ElementumBlocks;
4
+ readonly state?: JsonSafeState;
5
+ };
6
+ export type ElementumBlocks = {
7
+ readonly [key: string]: ElementumBlocksElement;
8
+ };
9
+ export type ElementumBlocksElement = (StackBlockElement) | (RowBlockElement) | (PanesBlockElement) | (ListControlsBlockElement) | (ListCollectionBlockElement) | (HeaderBlockElement) | (BodyBlockElement) | (BulletsBlockElement) | (DetailsListBlockElement) | (DetailsFieldsBlockElement) | (DividerBlockElement) | (SpacerBlockElement) | (CardBlockElement) | (DataTableBlockElement) | (ActionCardBlockElement) | (ChartBlockElement) | (MetricsRowBlockElement) | (PageHeaderBlockElement) | (ButtonBlockElement);
10
+ /**
11
+ * Customer-facing name: Stack
12
+ * Customer-facing description: Stacks blocks from top to bottom with even spacing. Valid as the page root for simple portal or report layouts, and as a vertical section under Panes for process and list-to-record views.
13
+ * Internal authoring guidance: Nested vertical column that stacks child blocks top-to-bottom with a consistent gap and a 16px default inset. Set padding "none" for a flush stack. Looks like an unstyled layout container (no card chrome or borders). Valid as the Spec root for simple portal or report single-column layouts. For process or list-to-record views, nest it under PanesBlock. Not for side-by-side layout; use RowBlock for KPI tiles or other equal-width columns.
14
+ */
15
+ export type StackBlockElement = {
16
+ readonly type: "StackBlock";
17
+ readonly props: StackBlockProps;
18
+ readonly children?: ReadonlyArray<string>;
19
+ readonly visible?: VisibilityCondition;
20
+ readonly repeat?: RepeatConfig;
21
+ readonly on?: ElementOn;
22
+ readonly watch?: ElementWatch;
23
+ readonly validation?: ElementValidation;
24
+ };
25
+ export type StackBlockProps = {
26
+ readonly gap?: ("none" | "sm" | "md" | "lg") | (PropExpression);
27
+ readonly padding?: ("none" | "sm" | "md" | "lg") | (PropExpression);
28
+ };
29
+ export type PropExpression = ({
30
+ readonly $state: string;
31
+ }) | ({
32
+ readonly $item: string;
33
+ }) | ({
34
+ readonly $index: true;
35
+ }) | ({
36
+ readonly $bindState: string;
37
+ }) | ({
38
+ readonly $bindItem: string;
39
+ }) | ({
40
+ readonly $cond: VisibilityCondition;
41
+ readonly $then: PropExpressionValue;
42
+ readonly $else: PropExpressionValue;
43
+ }) | ({
44
+ readonly $computed: string;
45
+ readonly args?: {
46
+ readonly [key: string]: PropExpressionValue;
47
+ };
48
+ }) | ({
49
+ readonly $template: string;
50
+ });
51
+ export type VisibilityCondition = OpaqueJson;
52
+ export type OpaqueJson = (string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
53
+ readonly [key: string]: OpaqueJson;
54
+ });
55
+ export type PropExpressionValue = (string) | (number) | (boolean) | (null) | (ReadonlyArray<PropExpressionValue>) | (PropExpression) | ({
56
+ readonly [key: string]: PropExpressionValue;
57
+ });
58
+ export type RepeatConfig = {
59
+ readonly statePath: string;
60
+ readonly key?: string;
61
+ };
62
+ export type ElementOn = OpaqueJson;
63
+ export type ElementWatch = OpaqueJson;
64
+ export type ElementValidation = OpaqueJson;
65
+ /**
66
+ * Customer-facing name: Row
67
+ * Customer-facing description: Places blocks side by side at equal width. Use inside a stack for tiles or columns.
68
+ * Internal authoring guidance: Responsive row that stretches child blocks equally across four desktop, two tablet, or one mobile column with a 12px default gap. Looks like an unstyled layout container (no card chrome or borders). Best used inside a StackBlock for KPI tiles or other side-by-side sections. Prefer StackBlock for top-to-bottom page layout. Do not use ActionCardBlock to fake a KPI row.
69
+ */
70
+ export type RowBlockElement = {
71
+ readonly type: "RowBlock";
72
+ readonly props: RowBlockProps;
73
+ readonly children?: ReadonlyArray<string>;
74
+ readonly visible?: VisibilityCondition;
75
+ readonly repeat?: RepeatConfig;
76
+ readonly on?: ElementOn;
77
+ readonly watch?: ElementWatch;
78
+ readonly validation?: ElementValidation;
79
+ };
80
+ export type RowBlockProps = {
81
+ readonly gap?: ("none" | "sm" | "md" | "lg") | (PropExpression);
82
+ };
83
+ /**
84
+ * Customer-facing name: Panes
85
+ * Customer-facing description: A full-height main column with up to three extra side panes. Use this when a record details pane should sit beside the main view.
86
+ * Internal authoring guidance: Preferred root for managed-view Specs, including single-pane layouts. Provide at least one default-slot child; children map in order to panes (max 4), typically one nested StackBlock for the main pane. Any clickable or selectable list, including ListCollectionBlock, must be under a root PanesBlock so secondary/detail panes can be supported. Additional panes are optional. The host may append record details after authored children; do not author that pane or nest PanesBlock.
87
+ */
88
+ export type PanesBlockElement = {
89
+ readonly type: "PanesBlock";
90
+ readonly props: PanesBlockProps;
91
+ readonly children?: ReadonlyArray<string>;
92
+ readonly visible?: VisibilityCondition;
93
+ readonly repeat?: RepeatConfig;
94
+ readonly on?: ElementOn;
95
+ readonly watch?: ElementWatch;
96
+ readonly validation?: ElementValidation;
97
+ };
98
+ export type PanesBlockProps = {
99
+ readonly panelState?: ("open" | "closed" | "full") | (PropExpression);
100
+ readonly contentWidth?: ("full" | "reader") | (PropExpression);
101
+ };
102
+ /**
103
+ * Customer-facing name: List controls
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.
106
+ */
107
+ export type ListControlsBlockElement = {
108
+ readonly type: "ListControlsBlock";
109
+ readonly props: ListControlsBlockProps;
110
+ readonly children?: ReadonlyArray<string>;
111
+ readonly visible?: VisibilityCondition;
112
+ readonly repeat?: RepeatConfig;
113
+ readonly on?: ElementOn;
114
+ readonly watch?: ElementWatch;
115
+ readonly validation?: ElementValidation;
116
+ };
117
+ export type ListControlsBlockProps = {
118
+ readonly searchValue?: (string) | (PropExpression);
119
+ readonly filterJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
120
+ readonly [key: string]: OpaqueJson;
121
+ }))) | (PropExpression)) | (null);
122
+ 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);
123
+ readonly filterFields?: (ReadonlyArray<JsonSafeState>) | (PropExpression);
124
+ readonly filterAspectId?: (string) | (PropExpression);
125
+ readonly quickFilters?: (ListControlsQuickFilters) | (PropExpression);
126
+ readonly quickFilterValue?: ((string) | (PropExpression)) | (null);
127
+ readonly groupByValue?: ((string) | (PropExpression)) | (null);
128
+ readonly groupByOptions?: (ReadonlyArray<ListControlsOption>) | (PropExpression);
129
+ readonly sortByValue?: ((string) | (PropExpression)) | (null);
130
+ readonly sortByDirection?: ("ASC" | "DESC") | (PropExpression);
131
+ readonly sortByOptions?: (ReadonlyArray<ListControlsOption>) | (PropExpression);
132
+ };
133
+ export type JsonSafeState = OpaqueJson;
134
+ export type ListControlsQuickFilters = {
135
+ readonly kind?: ("statusGroups") | (PropExpression);
136
+ readonly groups?: (ReadonlyArray<"open" | "closed">) | (PropExpression);
137
+ readonly defaultValue?: ("open" | "closed") | (PropExpression);
138
+ };
139
+ export type ListControlsOption = {
140
+ readonly value: string;
141
+ readonly label: string;
142
+ readonly disabled?: boolean;
143
+ };
144
+ /**
145
+ * Customer-facing name: Record list
146
+ * 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.
148
+ */
149
+ export type ListCollectionBlockElement = {
150
+ readonly type: "ListCollectionBlock";
151
+ readonly props: ListCollectionBlockProps;
152
+ readonly children?: ReadonlyArray<string>;
153
+ readonly visible?: VisibilityCondition;
154
+ readonly repeat?: RepeatConfig;
155
+ readonly on?: ElementOn;
156
+ readonly watch?: ElementWatch;
157
+ readonly validation?: ElementValidation;
158
+ };
159
+ export type ListCollectionBlockProps = (ListCollectionBlockPresentationalProps) | (ListCollectionBlockSelfFetchingProps);
160
+ export type ListCollectionBlockPresentationalProps = {
161
+ readonly selectedId?: ((string) | (PropExpression)) | (null);
162
+ readonly selectedAspectId?: ((string) | (PropExpression)) | (null);
163
+ readonly selectedHandle?: ((string) | (PropExpression)) | (null);
164
+ readonly groupBy?: ((string) | (PropExpression)) | (null);
165
+ readonly sortBy?: ((string) | (PropExpression)) | (null);
166
+ readonly sortDirection?: ("ASC" | "DESC") | (PropExpression);
167
+ readonly status?: ("idle" | "loading" | "error") | (PropExpression);
168
+ readonly loadingMessage?: (string) | (PropExpression);
169
+ readonly errorMessage?: (string) | (PropExpression);
170
+ readonly emptyMessage?: (string) | (PropExpression);
171
+ readonly items?: (ReadonlyArray<ListCollectionItem>) | (PropExpression);
172
+ };
173
+ export type ListCollectionItem = {
174
+ readonly id: string;
175
+ readonly title: string;
176
+ readonly identifier?: (string) | (null);
177
+ readonly group?: (string) | (null);
178
+ readonly pills?: ReadonlyArray<ListCollectionPill>;
179
+ };
180
+ export type ListCollectionPill = {
181
+ readonly id: string;
182
+ readonly label: string;
183
+ readonly tone?: "neutral" | "info" | "warning" | "danger";
184
+ readonly visual?: ({
185
+ readonly type: "icon";
186
+ readonly semantic: "priority" | "sla" | "updated";
187
+ }) | ({
188
+ readonly type: "avatar";
189
+ readonly name: string;
190
+ readonly imageUrl?: string;
191
+ });
192
+ };
193
+ export type ListCollectionBlockSelfFetchingProps = {
194
+ readonly selectedId?: ((string) | (PropExpression)) | (null);
195
+ readonly selectedAspectId?: ((string) | (PropExpression)) | (null);
196
+ readonly selectedHandle?: ((string) | (PropExpression)) | (null);
197
+ readonly groupBy?: ((string) | (PropExpression)) | (null);
198
+ readonly sortBy?: ((string) | (PropExpression)) | (null);
199
+ readonly sortDirection?: ("ASC" | "DESC") | (PropExpression);
200
+ readonly status?: ("idle" | "loading" | "error") | (PropExpression);
201
+ readonly loadingMessage?: (string) | (PropExpression);
202
+ readonly errorMessage?: (string) | (PropExpression);
203
+ readonly emptyMessage?: (string) | (PropExpression);
204
+ readonly aspectId?: (string) | (PropExpression);
205
+ readonly searchValue?: (string) | (PropExpression);
206
+ readonly filterJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
207
+ readonly [key: string]: OpaqueJson;
208
+ }))) | (PropExpression)) | (null);
209
+ 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);
210
+ readonly quickFilterValue?: ((string) | (PropExpression)) | (null);
211
+ };
212
+ /**
213
+ * Customer-facing name: Header
214
+ * Customer-facing description: A section title with a heading level and color.
215
+ * Internal authoring guidance: A semantic heading with a fixed typography treatment for each numeric level 1–6 and a constrained semantic tone: primary organization branding, default foreground, or muted foreground. Best used for section titles and headings. Set level to choose both the semantic h1–h6 element and its closed design-system typography. Prefer BodyBlock for paragraph copy.
216
+ */
217
+ export type HeaderBlockElement = {
218
+ readonly type: "HeaderBlock";
219
+ readonly props: HeaderBlockProps;
220
+ readonly children?: ReadonlyArray<string>;
221
+ readonly visible?: VisibilityCondition;
222
+ readonly repeat?: RepeatConfig;
223
+ readonly on?: ElementOn;
224
+ readonly watch?: ElementWatch;
225
+ readonly validation?: ElementValidation;
226
+ };
227
+ export type HeaderBlockProps = {
228
+ readonly text?: (string) | (PropExpression);
229
+ readonly level?: (1 | 2 | 3 | 4 | 5 | 6) | (PropExpression);
230
+ readonly tone?: ("primary" | "default" | "muted") | (PropExpression);
231
+ };
232
+ /**
233
+ * Customer-facing name: Body
234
+ * Customer-facing description: A paragraph for body copy, helper text, and short descriptions.
235
+ * Internal authoring guidance: A fixed-width semantic paragraph with prototype-aligned 14px typography and 1.6 line height. Best used for body, helper, description, and subtitle copy. Use tone muted for secondary paragraph copy; typography and measure remain fixed. Prefer HeaderBlock for titles and BulletsBlock for lists.
236
+ */
237
+ export type BodyBlockElement = {
238
+ readonly type: "BodyBlock";
239
+ readonly props: BodyBlockProps;
240
+ readonly children?: ReadonlyArray<string>;
241
+ readonly visible?: VisibilityCondition;
242
+ readonly repeat?: RepeatConfig;
243
+ readonly on?: ElementOn;
244
+ readonly watch?: ElementWatch;
245
+ readonly validation?: ElementValidation;
246
+ };
247
+ export type BodyBlockProps = {
248
+ readonly text?: (string) | (PropExpression);
249
+ readonly tone?: ("default" | "muted") | (PropExpression);
250
+ };
251
+ /**
252
+ * Customer-facing name: Bullets
253
+ * Customer-facing description: A list of short facts, checks, or next steps.
254
+ * Internal authoring guidance: A branded semantic unordered list with prototype-aligned 14px typography, 48rem measure, and 8px row spacing. Best used for concise facts, checks, or next steps. Provide item text only; the browser supplies the standard bullet marker. Prefer BodyBlock for prose.
255
+ */
256
+ export type BulletsBlockElement = {
257
+ readonly type: "BulletsBlock";
258
+ readonly props: BulletsBlockProps;
259
+ readonly children?: ReadonlyArray<string>;
260
+ readonly visible?: VisibilityCondition;
261
+ readonly repeat?: RepeatConfig;
262
+ readonly on?: ElementOn;
263
+ readonly watch?: ElementWatch;
264
+ readonly validation?: ElementValidation;
265
+ };
266
+ export type BulletsBlockProps = {
267
+ readonly items?: (ReadonlyArray<string>) | (PropExpression);
268
+ };
269
+ /**
270
+ * Customer-facing name: Details list
271
+ * Customer-facing description: A list of authored label and value rows.
272
+ * Internal authoring guidance: Bordered stack of ordered 14px label/value rows with a one-third/two-thirds split. Best for custom explanatory details authored as complete display-ready strings. Use DetailsFieldsBlock instead when the host is projecting already-resolved record fields. This block never accepts record identity or fetch props.
273
+ */
274
+ export type DetailsListBlockElement = {
275
+ readonly type: "DetailsListBlock";
276
+ readonly props: DetailsListBlockProps;
277
+ readonly children?: ReadonlyArray<string>;
278
+ readonly visible?: VisibilityCondition;
279
+ readonly repeat?: RepeatConfig;
280
+ readonly on?: ElementOn;
281
+ readonly watch?: ElementWatch;
282
+ readonly validation?: ElementValidation;
283
+ };
284
+ export type DetailsListBlockProps = {
285
+ readonly items: (ReadonlyArray<DetailsListItem>) | (PropExpression);
286
+ };
287
+ export type DetailsListItem = {
288
+ /**
289
+ * Required nonblank label for this authored detail.
290
+ */
291
+ readonly label: string;
292
+ /**
293
+ * Required nonblank display-ready string value.
294
+ */
295
+ readonly value: string;
296
+ };
297
+ /**
298
+ * Customer-facing name: Record fields
299
+ * Customer-facing description: A grid of field labels and values for the selected record.
300
+ * Internal authoring guidance: Responsive one-to-four-column field grid with 12px muted labels and 14px values. Best for selected record-field metadata whose field IDs, labels, and display-ready string values were already resolved by the host. fieldId is stable render identity only; never use this block to fetch or look up a record. Use DetailsListBlock for generic authored explanatory details.
301
+ */
302
+ export type DetailsFieldsBlockElement = {
303
+ readonly type: "DetailsFieldsBlock";
304
+ readonly props: DetailsFieldsBlockProps;
305
+ readonly children?: ReadonlyArray<string>;
306
+ readonly visible?: VisibilityCondition;
307
+ readonly repeat?: RepeatConfig;
308
+ readonly on?: ElementOn;
309
+ readonly watch?: ElementWatch;
310
+ readonly validation?: ElementValidation;
311
+ };
312
+ export type DetailsFieldsBlockProps = {
313
+ readonly fields: (ReadonlyArray<DetailsField>) | (PropExpression);
314
+ };
315
+ export type DetailsField = {
316
+ /**
317
+ * Required stable field identity supplied by the host. Used only as render identity; it never triggers a lookup or fetch.
318
+ */
319
+ readonly fieldId: string;
320
+ /**
321
+ * Required nonblank display label already resolved by the host.
322
+ */
323
+ readonly label: string;
324
+ /**
325
+ * Required nonblank display-ready string value already resolved by the host.
326
+ */
327
+ readonly value: string;
328
+ };
329
+ /**
330
+ * Customer-facing name: Divider
331
+ * Customer-facing description: A horizontal line that separates related sections.
332
+ * Internal authoring guidance: Decorative horizontal separator with fixed semantic theme styling and internal spacing. Best used as a quiet boundary between related content regions; use SpacerBlock when an invisible gap is intended.
333
+ */
334
+ export type DividerBlockElement = {
335
+ readonly type: "DividerBlock";
336
+ readonly props: DividerBlockProps;
337
+ readonly children?: ReadonlyArray<string>;
338
+ readonly visible?: VisibilityCondition;
339
+ readonly repeat?: RepeatConfig;
340
+ readonly on?: ElementOn;
341
+ readonly watch?: ElementWatch;
342
+ readonly validation?: ElementValidation;
343
+ };
344
+ export type DividerBlockProps = {
345
+ readonly [key: string]: never;
346
+ };
347
+ /**
348
+ * Customer-facing name: Spacing
349
+ * Customer-facing description: Adds empty vertical space between sections. It is not a visible divider.
350
+ * Internal authoring guidance: Invisible vertical empty space between blocks (aria-hidden; not a visible divider). Best used between major page sections. Prefer StackBlock gap for tight spacing inside a section.
351
+ */
352
+ export type SpacerBlockElement = {
353
+ readonly type: "SpacerBlock";
354
+ readonly props: SpacerBlockProps;
355
+ readonly children?: ReadonlyArray<string>;
356
+ readonly visible?: VisibilityCondition;
357
+ readonly repeat?: RepeatConfig;
358
+ readonly on?: ElementOn;
359
+ readonly watch?: ElementWatch;
360
+ readonly validation?: ElementValidation;
361
+ };
362
+ export type SpacerBlockProps = {
363
+ readonly size?: ("sm" | "md" | "lg") | (PropExpression);
364
+ };
365
+ /**
366
+ * Customer-facing name: Card
367
+ * Customer-facing description: A bordered panel that groups related content. Use it to frame a section.
368
+ * Internal authoring guidance: Bordered, rounded card surface that wraps child blocks. Looks like a panel with default inner padding; padding "none" makes a flush list/table shell. Best used to group a section. Not a clickable service tile. Use ActionCardBlock for that.
369
+ */
370
+ export type CardBlockElement = {
371
+ readonly type: "CardBlock";
372
+ readonly props: CardBlockProps;
373
+ readonly children?: ReadonlyArray<string>;
374
+ readonly visible?: VisibilityCondition;
375
+ readonly repeat?: RepeatConfig;
376
+ readonly on?: ElementOn;
377
+ readonly watch?: ElementWatch;
378
+ readonly validation?: ElementValidation;
379
+ };
380
+ export type CardBlockProps = {
381
+ readonly padding?: ("none") | (PropExpression);
382
+ };
383
+ /**
384
+ * Customer-facing name: Data table
385
+ * 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.
387
+ */
388
+ export type DataTableBlockElement = {
389
+ readonly type: "DataTableBlock";
390
+ readonly props: DataTableBlockProps;
391
+ readonly children?: ReadonlyArray<string>;
392
+ readonly visible?: VisibilityCondition;
393
+ readonly repeat?: RepeatConfig;
394
+ readonly on?: ElementOn;
395
+ readonly watch?: ElementWatch;
396
+ readonly validation?: ElementValidation;
397
+ };
398
+ export type DataTableBlockProps = (DataTableBlockPresentationalProps) | (DataTableBlockSelfFetchingProps);
399
+ export type DataTableBlockPresentationalProps = {
400
+ readonly selectedId?: ((string) | (PropExpression)) | (null);
401
+ readonly showHeader?: (boolean) | (PropExpression);
402
+ readonly loadingMessage?: (string) | (PropExpression);
403
+ readonly errorMessage?: (string) | (PropExpression);
404
+ readonly emptyMessage?: (string) | (PropExpression);
405
+ readonly rows?: (ReadonlyArray<DataTableRow>) | (PropExpression);
406
+ readonly columns?: (ReadonlyArray<DataTableColumn>) | (PropExpression);
407
+ readonly presentation?: ("popularArticles" | "announcements") | (PropExpression);
408
+ readonly bordered?: (boolean) | (PropExpression);
409
+ readonly defaultExpanded?: (boolean) | (PropExpression);
410
+ readonly childrenPageSize?: (number) | (PropExpression);
411
+ readonly messages?: (DataTableMessages) | (PropExpression);
412
+ readonly status?: ("idle" | "loading" | "error") | (PropExpression);
413
+ };
414
+ export type DataTableRow = {
415
+ readonly id: string;
416
+ /**
417
+ * Navigation target for the row primary cell. Use an absolute http(s) URL or a root-relative /path. Same rules as ActionCardBlock card href.
418
+ */
419
+ readonly href?: string;
420
+ readonly children?: ReadonlyArray<DataTableRow>;
421
+ } & {
422
+ readonly [key: string]: unknown;
423
+ };
424
+ export type DataTableColumn = {
425
+ readonly key: string;
426
+ readonly header?: string;
427
+ readonly type?: "text" | "number" | "currency" | "badge" | "variance" | "progress" | "tags";
428
+ readonly align?: "start" | "center" | "end";
429
+ readonly bold?: boolean;
430
+ readonly width?: (string) | (number);
431
+ readonly minWidth?: (string) | (number);
432
+ readonly maxWidth?: (string) | (number);
433
+ };
434
+ export type DataTableMessages = {
435
+ readonly expandRow?: (string) | (PropExpression);
436
+ readonly collapseRow?: (string) | (PropExpression);
437
+ readonly loading?: (string) | (PropExpression);
438
+ readonly retry?: (string) | (PropExpression);
439
+ readonly empty?: (string) | (PropExpression);
440
+ readonly loadMore?: (string) | (PropExpression);
441
+ };
442
+ export type DataTableBlockSelfFetchingProps = {
443
+ readonly selectedId?: ((string) | (PropExpression)) | (null);
444
+ readonly showHeader?: (boolean) | (PropExpression);
445
+ readonly loadingMessage?: (string) | (PropExpression);
446
+ readonly errorMessage?: (string) | (PropExpression);
447
+ readonly emptyMessage?: (string) | (PropExpression);
448
+ readonly aspectId?: (string) | (PropExpression);
449
+ readonly columns?: (ReadonlyArray<"handle" | "title" | "status" | "priority" | "assignee" | "assignmentGroup" | "createdBy" | "createdTime" | "updatedAt" | "stage">) | (PropExpression);
450
+ readonly searchValue?: (string) | (PropExpression);
451
+ readonly filterJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
452
+ readonly [key: string]: OpaqueJson;
453
+ }))) | (PropExpression)) | (null);
454
+ 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);
455
+ readonly quickFilterValue?: ((string) | (PropExpression)) | (null);
456
+ readonly selectedAspectId?: ((string) | (PropExpression)) | (null);
457
+ readonly selectedHandle?: ((string) | (PropExpression)) | (null);
458
+ };
459
+ /**
460
+ * Customer-facing name: Action cards
461
+ * Customer-facing description: Clickable tiles with an icon, title, and short description. Use them to choose a topic or action.
462
+ * Internal authoring guidance: Responsive grid of clickable tiles with a tinted icon well, title, short description, and hover arrow. Looks like a service/topic picker (typically 1–3 columns). Best used for choosing a category or action. Give a card an href to navigate (absolute https:// opens a new tab, "/path" navigates inside Elementum); omit href to make it a selection tile that writes selectedId. Do not simulate with CardBlock plus generic text or emoji icons. Empty props render one default card.
463
+ */
464
+ export type ActionCardBlockElement = {
465
+ readonly type: "ActionCardBlock";
466
+ readonly props: ActionCardBlockProps;
467
+ readonly children?: ReadonlyArray<string>;
468
+ readonly visible?: VisibilityCondition;
469
+ readonly repeat?: RepeatConfig;
470
+ readonly on?: ElementOn;
471
+ readonly watch?: ElementWatch;
472
+ readonly validation?: ElementValidation;
473
+ };
474
+ export type ActionCardBlockProps = {
475
+ readonly cards?: (ReadonlyArray<ActionCardItem>) | (PropExpression);
476
+ readonly selectedId?: ((string) | (PropExpression)) | (null);
477
+ };
478
+ export type ActionCardItem = {
479
+ readonly id: string;
480
+ readonly title?: string;
481
+ readonly description?: string;
482
+ /**
483
+ * Lucide icon name for the tinted icon well. Omit for no icon.
484
+ */
485
+ readonly icon?: string;
486
+ readonly disabled?: boolean;
487
+ /**
488
+ * Navigation target. Use an absolute http(s) URL or a root-relative /path.
489
+ */
490
+ readonly href?: string;
491
+ };
492
+ /**
493
+ * Customer-facing name: Chart
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.
496
+ */
497
+ export type ChartBlockElement = {
498
+ readonly type: "ChartBlock";
499
+ readonly props: ChartBlockProps;
500
+ readonly children?: ReadonlyArray<string>;
501
+ readonly visible?: VisibilityCondition;
502
+ readonly repeat?: RepeatConfig;
503
+ readonly on?: ElementOn;
504
+ readonly watch?: ElementWatch;
505
+ readonly validation?: ElementValidation;
506
+ };
507
+ export type ChartBlockProps = (ChartBlockPresentationalProps) | (ChartBlockFetchProps) | (ChartBlockGroupedFetchProps);
508
+ export type ChartBlockPresentationalProps = {
509
+ readonly variant: ("bar" | "line" | "donut") | (PropExpression);
510
+ readonly height?: ("sm" | "md" | "lg") | (PropExpression);
511
+ readonly colorStyle?: ("gradient" | "flat") | (PropExpression);
512
+ readonly title?: (string) | (PropExpression);
513
+ readonly metric?: (string) | (PropExpression);
514
+ readonly caption?: (string) | (PropExpression);
515
+ readonly data?: (ReadonlyArray<ChartBlockPoint>) | (PropExpression);
516
+ };
517
+ export type ChartBlockPoint = {
518
+ readonly label: string;
519
+ readonly value: number;
520
+ readonly series?: string;
521
+ };
522
+ export type ChartBlockFetchProps = {
523
+ readonly variant: ("bar" | "line" | "donut") | (PropExpression);
524
+ readonly height?: ("sm" | "md" | "lg") | (PropExpression);
525
+ readonly colorStyle?: ("gradient" | "flat") | (PropExpression);
526
+ readonly title?: (string) | (PropExpression);
527
+ readonly metric?: (string) | (PropExpression);
528
+ readonly caption?: (string) | (PropExpression);
529
+ readonly aggregation: ("count" | "sum" | "avg" | "min" | "max") | (PropExpression);
530
+ readonly aspectId: (string) | (PropExpression);
531
+ readonly fieldId?: (string) | (PropExpression);
532
+ readonly filterJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
533
+ readonly [key: string]: OpaqueJson;
534
+ }))) | (PropExpression)) | (null);
535
+ 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);
536
+ readonly quickFilterValue?: ((string) | (PropExpression)) | (null);
537
+ };
538
+ export type ChartBlockGroupedFetchProps = {
539
+ readonly variant: ("bar" | "line" | "donut") | (PropExpression);
540
+ readonly height?: ("sm" | "md" | "lg") | (PropExpression);
541
+ readonly colorStyle?: ("gradient" | "flat") | (PropExpression);
542
+ readonly title?: (string) | (PropExpression);
543
+ readonly metric?: (string) | (PropExpression);
544
+ readonly caption?: (string) | (PropExpression);
545
+ readonly aspectId: (string) | (PropExpression);
546
+ readonly groupByFieldId: (string) | (PropExpression);
547
+ readonly filterJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
548
+ readonly [key: string]: OpaqueJson;
549
+ }))) | (PropExpression)) | (null);
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
+ readonly quickFilterValue?: ((string) | (PropExpression)) | (null);
552
+ };
553
+ /**
554
+ * Customer-facing name: Metrics
555
+ * Customer-facing description: A single KPI tile with a caption and prominent value.
556
+ * Internal authoring guidance: Single read-only KPI tile with a caption, prominent value, and optional static subtext below successful results. Use formattedValue for a complete display-ready metric, or calc for live Aspect.calculation data with optional explicit aspectId (otherwise the managed-view default), filterJson/filterPreset, quickFilterValue, number format, empty copy, and color/colorRules limited to default, primary organization theme, muted, error, success, or warning. Bind filterJson and use the same filterPreset as ListControls when the KPI should share its view filter; give the metric its own filterPreset/filterJson without that binding when it should measure a different slice. Each MetricsRowBlock renders exactly one KPI; compose several independent tiles in RowBlock. Prefer ChartBlock when the result needs a bar, line, donut, category comparison, or trend.
557
+ */
558
+ export type MetricsRowBlockElement = {
559
+ readonly type: "MetricsRowBlock";
560
+ readonly props: MetricsRowBlockProps;
561
+ readonly children?: ReadonlyArray<string>;
562
+ readonly visible?: VisibilityCondition;
563
+ readonly repeat?: RepeatConfig;
564
+ readonly on?: ElementOn;
565
+ readonly watch?: ElementWatch;
566
+ readonly validation?: ElementValidation;
567
+ };
568
+ export type MetricsRowBlockProps = (MetricsRowPresentationalProps) | (MetricsRowSelfFetchProps);
569
+ export type MetricsRowPresentationalProps = {
570
+ readonly title?: (string) | (PropExpression);
571
+ readonly subtext?: (string) | (PropExpression);
572
+ readonly color?: ("default" | "primary" | "muted" | "error" | "success" | "warning") | (PropExpression);
573
+ readonly colorRules?: (ReadonlyArray<{
574
+ readonly when: ("negative" | "positive" | "zero") | ({
575
+ readonly op: "lt" | "lte" | "gt" | "gte" | "eq";
576
+ readonly value: number;
577
+ });
578
+ readonly color: "default" | "primary" | "muted" | "error" | "success" | "warning";
579
+ }>) | (PropExpression);
580
+ readonly format?: ({
581
+ readonly style?: ("decimal" | "currency" | "percent") | (PropExpression);
582
+ readonly minimumFractionDigits?: (number) | (PropExpression);
583
+ readonly maximumFractionDigits?: (number) | (PropExpression);
584
+ readonly currency?: (string) | (PropExpression);
585
+ }) | (PropExpression);
586
+ readonly formattedValue: (string) | (PropExpression);
587
+ };
588
+ export type MetricsRowSelfFetchProps = {
589
+ readonly title?: (string) | (PropExpression);
590
+ readonly subtext?: (string) | (PropExpression);
591
+ readonly color?: ("default" | "primary" | "muted" | "error" | "success" | "warning") | (PropExpression);
592
+ readonly colorRules?: (ReadonlyArray<{
593
+ readonly when: ("negative" | "positive" | "zero") | ({
594
+ readonly op: "lt" | "lte" | "gt" | "gte" | "eq";
595
+ readonly value: number;
596
+ });
597
+ readonly color: "default" | "primary" | "muted" | "error" | "success" | "warning";
598
+ }>) | (PropExpression);
599
+ readonly format?: ({
600
+ readonly style?: ("decimal" | "currency" | "percent") | (PropExpression);
601
+ readonly minimumFractionDigits?: (number) | (PropExpression);
602
+ readonly maximumFractionDigits?: (number) | (PropExpression);
603
+ readonly currency?: (string) | (PropExpression);
604
+ }) | (PropExpression);
605
+ readonly calc: (string) | (PropExpression);
606
+ readonly aspectId?: (string) | (PropExpression);
607
+ readonly filterJson?: (((JsonSafeState) & ((string) | (number) | (boolean) | (null) | (ReadonlyArray<OpaqueJson>) | ({
608
+ readonly [key: string]: OpaqueJson;
609
+ }))) | (PropExpression)) | (null);
610
+ 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);
611
+ readonly quickFilterValue?: ((string) | (PropExpression)) | (null);
612
+ readonly emptyMessage?: (string) | (PropExpression);
613
+ };
614
+ /**
615
+ * Customer-facing name: Page header
616
+ * 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.
618
+ */
619
+ export type PageHeaderBlockElement = {
620
+ readonly type: "PageHeaderBlock";
621
+ readonly props: PageHeaderBlockProps;
622
+ readonly children?: ReadonlyArray<string>;
623
+ readonly visible?: VisibilityCondition;
624
+ readonly repeat?: RepeatConfig;
625
+ readonly on?: ElementOn;
626
+ readonly watch?: ElementWatch;
627
+ readonly validation?: ElementValidation;
628
+ };
629
+ export type PageHeaderBlockProps = {
630
+ readonly title?: ((string) | (PropExpression)) | (null);
631
+ readonly description?: ((string) | (PropExpression)) | (null);
632
+ readonly icon?: ((string) | (PropExpression)) | (null);
633
+ readonly actions?: ((ReadonlyArray<PageHeaderAction>) | (PropExpression)) | (null);
634
+ readonly selectedActionId?: ((string) | (PropExpression)) | (null);
635
+ };
636
+ export type PageHeaderAction = {
637
+ readonly id: string;
638
+ readonly label: string;
639
+ readonly variant?: "primary" | "outline";
640
+ readonly disabled?: boolean;
641
+ /**
642
+ * Navigation target. Use an absolute http(s) URL or a root-relative /path. Same rules as ActionCardBlock card href.
643
+ */
644
+ readonly href?: string;
645
+ };
646
+ /**
647
+ * Customer-facing name: Buttons
648
+ * 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.
650
+ */
651
+ export type ButtonBlockElement = {
652
+ readonly type: "ButtonBlock";
653
+ readonly props: ButtonBlockProps;
654
+ readonly children?: ReadonlyArray<string>;
655
+ readonly visible?: VisibilityCondition;
656
+ readonly repeat?: RepeatConfig;
657
+ readonly on?: ElementOn;
658
+ readonly watch?: ElementWatch;
659
+ readonly validation?: ElementValidation;
660
+ };
661
+ export type ButtonBlockProps = {
662
+ readonly buttons: (ReadonlyArray<ButtonBlockItem>) | (PropExpression);
663
+ };
664
+ export type ButtonBlockItem = (ButtonBlockLinkItem) | (ButtonBlockActionItem) | (ButtonBlockStaticItem);
665
+ export type ButtonBlockLinkItem = {
666
+ /**
667
+ * Visible text. Icon-only buttons use it as the accessible name.
668
+ */
669
+ readonly label: string;
670
+ /**
671
+ * Visual weight and row order. Defaults to primary for an onPress item, otherwise secondary.
672
+ */
673
+ readonly emphasis?: "primary" | "secondary" | "tertiary" | "destructive";
674
+ /**
675
+ * icon renders only the icon; label becomes aria-label.
676
+ */
677
+ readonly size?: "default" | "icon";
678
+ /**
679
+ * Lucide icon name, e.g. trash-2.
680
+ */
681
+ readonly icon?: string;
682
+ readonly disabled?: boolean;
683
+ /**
684
+ * Navigation target. Absolute http(s) URL or root-relative /path.
685
+ */
686
+ readonly href: string;
687
+ /**
688
+ * Managed view id this href targets; saved as an AspectView dependency.
689
+ */
690
+ readonly viewId?: string;
691
+ };
692
+ export type ButtonBlockActionItem = {
693
+ /**
694
+ * Visible text. Icon-only buttons use it as the accessible name.
695
+ */
696
+ readonly label: string;
697
+ /**
698
+ * Visual weight and row order. Defaults to primary for an onPress item, otherwise secondary.
699
+ */
700
+ readonly emphasis?: "primary" | "secondary" | "tertiary" | "destructive";
701
+ /**
702
+ * icon renders only the icon; label becomes aria-label.
703
+ */
704
+ readonly size?: "default" | "icon";
705
+ /**
706
+ * Lucide icon name, e.g. trash-2.
707
+ */
708
+ readonly icon?: string;
709
+ readonly disabled?: boolean;
710
+ /**
711
+ * Non-navigation action, such as createRecord with an aspectId parameter.
712
+ */
713
+ readonly onPress: {
714
+ readonly action: string;
715
+ readonly params?: {
716
+ readonly [key: string]: (string) | (number) | (boolean) | (null) | ({
717
+ readonly $state: string;
718
+ } & {
719
+ readonly [key: string]: unknown;
720
+ });
721
+ };
722
+ readonly confirm?: {
723
+ readonly title: string;
724
+ readonly message: string;
725
+ readonly confirmLabel?: string;
726
+ readonly cancelLabel?: string;
727
+ readonly variant?: "default" | "danger";
728
+ } & {
729
+ readonly [key: string]: unknown;
730
+ };
731
+ readonly onSuccess?: ({
732
+ readonly navigate: string;
733
+ } & {
734
+ readonly [key: string]: unknown;
735
+ }) | ({
736
+ readonly set: {
737
+ readonly [key: string]: unknown;
738
+ };
739
+ } & {
740
+ readonly [key: string]: unknown;
741
+ }) | ({
742
+ readonly action: string;
743
+ readonly params?: {
744
+ readonly [key: string]: (string) | (number) | (boolean) | (null) | ({
745
+ readonly $state: string;
746
+ } & {
747
+ readonly [key: string]: unknown;
748
+ });
749
+ };
750
+ } & {
751
+ readonly [key: string]: unknown;
752
+ });
753
+ readonly onError?: ({
754
+ readonly set: {
755
+ readonly [key: string]: unknown;
756
+ };
757
+ } & {
758
+ readonly [key: string]: unknown;
759
+ }) | ({
760
+ readonly action: string;
761
+ readonly params?: {
762
+ readonly [key: string]: (string) | (number) | (boolean) | (null) | ({
763
+ readonly $state: string;
764
+ } & {
765
+ readonly [key: string]: unknown;
766
+ });
767
+ };
768
+ } & {
769
+ readonly [key: string]: unknown;
770
+ });
771
+ readonly preventDefault?: boolean;
772
+ } & {
773
+ readonly [key: string]: unknown;
774
+ };
775
+ };
776
+ export type ButtonBlockStaticItem = {
777
+ /**
778
+ * Visible text. Icon-only buttons use it as the accessible name.
779
+ */
780
+ readonly label: string;
781
+ /**
782
+ * Visual weight and row order. Defaults to primary for an onPress item, otherwise secondary.
783
+ */
784
+ readonly emphasis?: "primary" | "secondary" | "tertiary" | "destructive";
785
+ /**
786
+ * icon renders only the icon; label becomes aria-label.
787
+ */
788
+ readonly size?: "default" | "icon";
789
+ /**
790
+ * Lucide icon name, e.g. trash-2.
791
+ */
792
+ readonly icon?: string;
793
+ readonly disabled?: boolean;
794
+ /**
795
+ * Managed view id this href targets; saved as an AspectView dependency.
796
+ */
797
+ readonly viewId?: string;
798
+ };
@@ -0,0 +1,5 @@
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
4
+ // Generator revision: 2
5
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementumai/edk",
3
- "version": "0.9.17",
3
+ "version": "0.9.18",
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",
@@ -155,7 +155,11 @@
155
155
  "fetch:schema": "make -C provider fetch-schema",
156
156
  "generate:schema": "make -C provider generate-schema",
157
157
  "generate:graphql": "make -C provider generate-graphql",
158
+ "fetch:ragnarok": "tsx src/scripts/ragnarok-schema.ts fetch",
159
+ "generate:ragnarok": "tsx src/scripts/ragnarok-schema.ts generate",
160
+ "refresh:ragnarok": "npm run fetch:ragnarok && npm run generate:ragnarok",
158
161
  "build": "npm run build:sdk",
162
+ "prebuild:sdk": "npm run generate:ragnarok",
159
163
  "build:sdk": "rm -rf dist-sdk && tsc -p tsconfig.sdk.json",
160
164
  "build:cli": "npm run sync:version && npm run sync:skills && npm run sync:compatibility && rm -rf dist-cli && tsc -p tsconfig.cli.json",
161
165
  "prebuild:provider": "npm run generate:graphql",
@@ -197,10 +201,15 @@
197
201
  "test:integration": "node integration/run.mjs",
198
202
  "reap:orphans": "node integration/tools/reap-orphaned-test-entities.mjs",
199
203
  "typecheck": "npm run typecheck:ci",
204
+ "pretypecheck:ci": "npm run generate:ragnarok",
200
205
  "typecheck:ci": "tsc --noEmit -p tsconfig.ci.json && tsc --noEmit -p tsconfig.examples-check.json",
206
+ "pretypecheck:src": "npm run generate:ragnarok",
201
207
  "typecheck:src": "tsc --noEmit",
208
+ "pretypecheck:examples": "npm run generate:ragnarok",
202
209
  "typecheck:examples": "tsc --noEmit -p tsconfig.examples-check.json",
210
+ "pretypecheck:consumer": "npm run generate:ragnarok",
203
211
  "typecheck:consumer": "tsc --noEmit -p tsconfig.package-consumer-check.json",
212
+ "pretypecheck:tests": "npm run generate:ragnarok",
204
213
  "typecheck:tests": "tsc --noEmit -p tsconfig.typecheck-tests.json",
205
214
  "lint": "eslint src/cli src/internal/sdk-package.ts src/scripts/prepare-release-promotion.ts src/scripts/test-package-consumer.ts examples/package-consumer",
206
215
  "lint:all": "eslint .",