@stndrds/schema 1.0.0-alpha.281 → 1.0.0-alpha.284

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 (81) hide show
  1. package/dist/all-DanoPxKr.d.ts +879 -0
  2. package/dist/all-bG_ha0VV.d.mts +879 -0
  3. package/dist/{attributes-D8eHv5Kf.d.ts → attributes-CNYwg_Nr.d.ts} +14 -13
  4. package/dist/{attributes--M1ifW8_.d.mts → attributes-CWPLbp7c.d.mts} +14 -13
  5. package/dist/capabilities.d.mts +146 -0
  6. package/dist/capabilities.d.ts +146 -0
  7. package/dist/capabilities.js +77 -0
  8. package/dist/capabilities.mjs +70 -0
  9. package/dist/{chunk-A5PPZ2FM.mjs → chunk-5OBQRDRM.mjs} +7 -3
  10. package/dist/{chunk-ORPCS24B.mjs → chunk-AGRAFDGU.mjs} +72 -16
  11. package/dist/{chunk-LRFLSFIA.js → chunk-BOICAZHR.js} +9 -4
  12. package/dist/{chunk-E47WAI5K.js → chunk-I3EYILYO.js} +5 -5
  13. package/dist/{chunk-OYHBQMC7.js → chunk-K6ET4CXP.js} +3 -3
  14. package/dist/{chunk-MLTXSBOB.mjs → chunk-PNOWKRH2.mjs} +2 -2
  15. package/dist/{chunk-XCLVXM7F.mjs → chunk-R57T4UDX.mjs} +1 -1
  16. package/dist/{chunk-SYQDFZ74.mjs → chunk-RUO25ERR.mjs} +36 -0
  17. package/dist/{chunk-HWZRSXFB.js → chunk-V26R64A4.js} +36 -0
  18. package/dist/{chunk-TU6ECJFZ.js → chunk-YZ5RCMIQ.js} +112 -45
  19. package/dist/exceptions.d.mts +24 -3
  20. package/dist/exceptions.d.ts +24 -3
  21. package/dist/exceptions.js +39 -39
  22. package/dist/exceptions.mjs +1 -1
  23. package/dist/{helpers-DyoPqiSz.d.ts → helpers-CXkVwpsl.d.ts} +3 -3
  24. package/dist/{helpers-BiABdSxK.d.mts → helpers-Dul_r9rJ.d.mts} +3 -3
  25. package/dist/{index-DWoqObyG.d.mts → index-Ca-MzQuU.d.mts} +46 -6
  26. package/dist/{index-TMlrIKAY.d.ts → index-Ns6KGfrZ.d.ts} +46 -6
  27. package/dist/index.d.mts +1508 -357
  28. package/dist/index.d.ts +1508 -357
  29. package/dist/index.js +1396 -363
  30. package/dist/index.mjs +1072 -124
  31. package/dist/{migrations-B1kkIhIX.d.ts → migrations-DaFneOfx.d.ts} +1 -1
  32. package/dist/{migrations-BNlQVzDC.d.mts → migrations-fRvadl6i.d.mts} +1 -1
  33. package/dist/{objects-DmMqHn3L.d.mts → objects-CDwMSnqv.d.mts} +2 -4
  34. package/dist/{objects-DgFojgwH.d.ts → objects-DJv6WrDE.d.ts} +2 -4
  35. package/dist/{types-DHqXzkgW.d.mts → types-CVYiFc69.d.mts} +1 -1
  36. package/dist/{types-DYYFto8d.d.ts → types-NGEww_ln.d.ts} +1 -1
  37. package/dist/utils.js +8 -8
  38. package/dist/utils.mjs +2 -2
  39. package/dist/validation/all.d.mts +7 -7
  40. package/dist/validation/all.d.ts +7 -7
  41. package/dist/validation/all.js +46 -46
  42. package/dist/validation/all.mjs +5 -5
  43. package/dist/validation/complex/currency.d.mts +2 -2
  44. package/dist/validation/complex/currency.d.ts +2 -2
  45. package/dist/validation/complex/location.d.mts +2 -2
  46. package/dist/validation/complex/location.d.ts +2 -2
  47. package/dist/validation/complex/phone.d.mts +2 -2
  48. package/dist/validation/complex/phone.d.ts +2 -2
  49. package/dist/validation/complex/relation.d.mts +2 -2
  50. package/dist/validation/complex/relation.d.ts +2 -2
  51. package/dist/validation/complex/richtext.d.mts +2 -2
  52. package/dist/validation/complex/richtext.d.ts +2 -2
  53. package/dist/validation/complex/select.d.mts +2 -2
  54. package/dist/validation/complex/select.d.ts +2 -2
  55. package/dist/validation/complex/user.d.mts +2 -2
  56. package/dist/validation/complex/user.d.ts +2 -2
  57. package/dist/validation/computed/formula.d.mts +2 -2
  58. package/dist/validation/computed/formula.d.ts +2 -2
  59. package/dist/validation/computed/rollup.d.mts +2 -2
  60. package/dist/validation/computed/rollup.d.ts +2 -2
  61. package/dist/validation/config/index.d.mts +4 -4
  62. package/dist/validation/config/index.d.ts +4 -4
  63. package/dist/validation/config/index.js +15 -11
  64. package/dist/validation/config/index.mjs +2 -2
  65. package/dist/validation/core/index.d.mts +3 -3
  66. package/dist/validation/core/index.d.ts +3 -3
  67. package/dist/validation/object/index.d.mts +5 -5
  68. package/dist/validation/object/index.d.ts +5 -5
  69. package/dist/validation/object/index.js +15 -15
  70. package/dist/validation/object/index.mjs +3 -3
  71. package/dist/validation/primitives/checkbox.d.mts +2 -2
  72. package/dist/validation/primitives/checkbox.d.ts +2 -2
  73. package/dist/validation/primitives/date.d.mts +2 -2
  74. package/dist/validation/primitives/date.d.ts +2 -2
  75. package/dist/validation/primitives/number.d.mts +2 -2
  76. package/dist/validation/primitives/number.d.ts +2 -2
  77. package/dist/validation/primitives/text.d.mts +2 -2
  78. package/dist/validation/primitives/text.d.ts +2 -2
  79. package/package.json +10 -5
  80. package/dist/all-BVp3k9Hi.d.ts +0 -471
  81. package/dist/all-CnIU2anT.d.mts +0 -471
package/dist/index.js CHANGED
@@ -1,23 +1,23 @@
1
1
  'use strict';
2
2
 
3
- var chunkOYHBQMC7_js = require('./chunk-OYHBQMC7.js');
4
- var chunkTU6ECJFZ_js = require('./chunk-TU6ECJFZ.js');
5
- var chunkLRFLSFIA_js = require('./chunk-LRFLSFIA.js');
6
- var chunkE47WAI5K_js = require('./chunk-E47WAI5K.js');
3
+ var chunkK6ET4CXP_js = require('./chunk-K6ET4CXP.js');
4
+ var chunkYZ5RCMIQ_js = require('./chunk-YZ5RCMIQ.js');
5
+ var chunkI3EYILYO_js = require('./chunk-I3EYILYO.js');
6
+ require('./chunk-EEH4XQ7W.js');
7
7
  require('./chunk-EW5XR2X3.js');
8
8
  require('./chunk-QWKLQRBX.js');
9
9
  require('./chunk-KNGWHQLR.js');
10
10
  require('./chunk-HTSTPTNZ.js');
11
11
  require('./chunk-V2UA2D4E.js');
12
+ var chunkBOICAZHR_js = require('./chunk-BOICAZHR.js');
12
13
  var chunk5WATIVCA_js = require('./chunk-5WATIVCA.js');
13
14
  var chunkSI34M4IC_js = require('./chunk-SI34M4IC.js');
14
15
  var chunkYIP5FJ5H_js = require('./chunk-YIP5FJ5H.js');
15
16
  var chunkZPFOKBIN_js = require('./chunk-ZPFOKBIN.js');
16
- var chunkHWZRSXFB_js = require('./chunk-HWZRSXFB.js');
17
+ var chunkV26R64A4_js = require('./chunk-V26R64A4.js');
17
18
  require('./chunk-ACKMC6FL.js');
18
19
  require('./chunk-E6JUYGJX.js');
19
20
  var chunkQ4SZAMJT_js = require('./chunk-Q4SZAMJT.js');
20
- require('./chunk-EEH4XQ7W.js');
21
21
  var chunkYKWSHBT5_js = require('./chunk-YKWSHBT5.js');
22
22
  var constants = require('@stndrds/constants');
23
23
  var z2 = require('zod');
@@ -70,6 +70,24 @@ var BEHAVIOR_PROPERTIES = [
70
70
  var PRESENTATION_PROPERTIES = ["label", "description", "placeholder", "icon"];
71
71
 
72
72
  // src/types/attributes.ts
73
+ var ATTRIBUTE_TYPES = [
74
+ "text",
75
+ "richtext",
76
+ "number",
77
+ "checkbox",
78
+ "date",
79
+ "phone",
80
+ "currency",
81
+ "status",
82
+ "location",
83
+ "select",
84
+ "multiselect",
85
+ "user",
86
+ "relation",
87
+ "formula",
88
+ "rollup",
89
+ "document"
90
+ ];
73
91
  var RELATION_TARGET_ANY = "*";
74
92
  function isUniversalRelation(attr) {
75
93
  return attr.targets.length === 1 && attr.targets[0].object === RELATION_TARGET_ANY;
@@ -81,7 +99,7 @@ function inferInverseCardinality(cardinality) {
81
99
  return cardinality === "one" ? "many" : "many";
82
100
  }
83
101
  function isAttributeSortable2(attr) {
84
- return chunkTU6ECJFZ_js.isAttributeSortable(attr);
102
+ return chunkYZ5RCMIQ_js.isAttributeSortable(attr);
85
103
  }
86
104
 
87
105
  // src/types/audit.ts
@@ -148,14 +166,14 @@ function sessionStateToLegacyStatus(state) {
148
166
  return "idle";
149
167
  case "parked":
150
168
  if (state.parkedOn === void 0) {
151
- throw new chunkHWZRSXFB_js.SchemaError("parked state without parkedOn", chunkHWZRSXFB_js.SchemaErrorCode.INVARIANT_VIOLATION);
169
+ throw new chunkV26R64A4_js.SchemaError("parked state without parkedOn", chunkV26R64A4_js.SchemaErrorCode.INVARIANT_VIOLATION);
152
170
  }
153
171
  return state.parkedOn === "agents" ? "waiting_agents" : "waiting_human";
154
172
  case "terminal":
155
173
  if (state.outcome === void 0) {
156
- throw new chunkHWZRSXFB_js.SchemaError(
174
+ throw new chunkV26R64A4_js.SchemaError(
157
175
  "terminal state without outcome",
158
- chunkHWZRSXFB_js.SchemaErrorCode.INVARIANT_VIOLATION
176
+ chunkV26R64A4_js.SchemaErrorCode.INVARIANT_VIOLATION
159
177
  );
160
178
  }
161
179
  return state.outcome;
@@ -206,6 +224,25 @@ var TODO_PLAN_STATUSES = ["active", "completed", "abandoned"];
206
224
  function agentDisplayName(agent2) {
207
225
  return agent2.label?.trim() || agent2.name;
208
226
  }
227
+ var TOOL_APPROVAL_STATES = [
228
+ "approval-requested",
229
+ "approval-responded",
230
+ "approval-dispatched"
231
+ ];
232
+ var OPEN_TOOL_PART_STATES = ["streaming", "running", ...TOOL_APPROVAL_STATES];
233
+ function isOpenToolPartState(state) {
234
+ return OPEN_TOOL_PART_STATES.includes(state);
235
+ }
236
+ function isToolApprovalState(state) {
237
+ return TOOL_APPROVAL_STATES.includes(state);
238
+ }
239
+ function compareAgentSessionMessages(left, right) {
240
+ const createdAtOrder = left.createdAt.getTime() - right.createdAt.getTime();
241
+ return createdAtOrder === 0 ? left.id.localeCompare(right.id) : createdAtOrder;
242
+ }
243
+ function orderAgentSessionMessages(messages) {
244
+ return [...messages].sort(compareAgentSessionMessages);
245
+ }
209
246
  var TODO_STATUSES = ["pending", "in_progress", "completed", "blocked"];
210
247
  var MAX_TODOS = 50;
211
248
  var MAX_TODO_ID_CHARS = 80;
@@ -217,7 +254,7 @@ var NATIVE_AGENT_UI_PART_IDS_METADATA_KEY = "__stndrdsNativeUiPartIds";
217
254
  var NATIVE_AGENT_UI_PART_IDS_METADATA_SCHEMA_VERSION = 1;
218
255
  var INVALID_NATIVE_PART_IDS = "Native agent UI part IDs metadata is invalid";
219
256
  function invalidNativePartIds() {
220
- throw new chunkHWZRSXFB_js.ValidationError(INVALID_NATIVE_PART_IDS, []);
257
+ throw new chunkV26R64A4_js.ValidationError(INVALID_NATIVE_PART_IDS, []);
221
258
  }
222
259
  function isPlainRecord(value) {
223
260
  if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
@@ -309,6 +346,15 @@ function resolveFieldRequired(input) {
309
346
  function getSlotFieldTargets(field) {
310
347
  return field.additionalSlotIds?.length ? [field.slotId, ...field.additionalSlotIds] : [field.slotId];
311
348
  }
349
+ function formFieldKey(field) {
350
+ return isFormSlotFieldRef(field) ? `${field.slotId}.${field.attribute}` : `free.${field.attribute.name}`;
351
+ }
352
+ function formFieldFlatKey(field) {
353
+ return isFormSlotFieldRef(field) ? field.attribute : field.attribute.name;
354
+ }
355
+ function readFormFieldValue(values, field) {
356
+ return values[formFieldKey(field)] ?? values[formFieldFlatKey(field)];
357
+ }
312
358
 
313
359
  // src/types/forms/rows.ts
314
360
  function isFormFieldsRow(row) {
@@ -395,9 +441,8 @@ function parseCountMode(value) {
395
441
  if (typeof value === "string" && COUNT_MODES.includes(value)) {
396
442
  return value;
397
443
  }
398
- throw new chunkHWZRSXFB_js.ValidationError(
399
- // biome-ignore lint/style/useTemplate: see the comment above.
400
- "countMode must be one of: " + COUNT_MODES.join(", ") + " (received: " + String(value) + ")",
444
+ throw new chunkV26R64A4_js.ValidationError(
445
+ `countMode must be one of: ${COUNT_MODES.join(", ")} (received: ${String(value)})`,
401
446
  []
402
447
  );
403
448
  }
@@ -502,7 +547,7 @@ function isDateRangeValue(value) {
502
547
  return typeof value === "object" && value !== null && typeof value.start === "string";
503
548
  }
504
549
  function normalizeDateValue(value, attr) {
505
- if (chunkE47WAI5K_js.isNullishOrEmptyString(value)) return null;
550
+ if (chunkI3EYILYO_js.isNullishOrEmptyString(value)) return null;
506
551
  if (isDateRangeValue(value)) {
507
552
  return attr.endDate ? { start: value.start, end: value.end ?? null } : value.start;
508
553
  }
@@ -640,7 +685,7 @@ function formatMultiselect(value, attribute) {
640
685
  return value.join(", ");
641
686
  }
642
687
  function formatAttributeValue(value, attribute) {
643
- if (chunkE47WAI5K_js.isNullishOrEmptyString(value)) {
688
+ if (chunkI3EYILYO_js.isNullishOrEmptyString(value)) {
644
689
  return EMPTY_VALUE_PLACEHOLDER;
645
690
  }
646
691
  switch (attribute.type) {
@@ -793,7 +838,7 @@ function renderLabelExpression(template, values, fallback = DEFAULT_LABEL_FALLBA
793
838
  break;
794
839
  }
795
840
  }
796
- const isEmpty2 = chunkE47WAI5K_js.isNullishOrEmptyString(value);
841
+ const isEmpty2 = chunkI3EYILYO_js.isNullishOrEmptyString(value);
797
842
  if (isEmpty2 && pipes.length === 0) return "";
798
843
  for (const pipeExpr of pipes) {
799
844
  const { name: pipeName, args } = parsePipeExpression(pipeExpr);
@@ -869,8 +914,14 @@ function relationPropertyDefs(attribute) {
869
914
  if (attribute?.type !== "relation") return void 0;
870
915
  return attribute.properties?.definitions;
871
916
  }
917
+ function qualifiedPropertyDefs(attribute) {
918
+ if (attribute?.type === "relation" || attribute?.type === "document") {
919
+ return attribute.properties?.definitions;
920
+ }
921
+ return void 0;
922
+ }
872
923
  function extractValueRefs(value) {
873
- if (chunkE47WAI5K_js.isNullishOrEmptyString(value)) return [];
924
+ if (chunkI3EYILYO_js.isNullishOrEmptyString(value)) return [];
874
925
  if (typeof value === "string") return [{ id: value }];
875
926
  if (Array.isArray(value)) return value.flatMap((item) => extractValueRefs(item));
876
927
  if (typeof value === "object" && "id" in value) {
@@ -1074,24 +1125,24 @@ function validateObjectName(name) {
1074
1125
  OBJECT_NAME_SCHEMA.parse(name);
1075
1126
  } catch (error) {
1076
1127
  if (error instanceof z2__default.default.ZodError) {
1077
- throw new chunkHWZRSXFB_js.SchemaError(error.issues[0].message, chunkHWZRSXFB_js.SchemaErrorCode.INVALID_OBJECT_NAME);
1128
+ throw new chunkV26R64A4_js.SchemaError(error.issues[0].message, chunkV26R64A4_js.SchemaErrorCode.INVALID_OBJECT_NAME);
1078
1129
  }
1079
1130
  throw error;
1080
1131
  }
1081
1132
  }
1082
1133
  function validateViewName(name) {
1083
1134
  if (!name || name.length === 0) {
1084
- throw new chunkHWZRSXFB_js.ValidationError("View name cannot be empty", [
1135
+ throw new chunkV26R64A4_js.ValidationError("View name cannot be empty", [
1085
1136
  { path: ["name"], message: "View name cannot be empty" }
1086
1137
  ]);
1087
1138
  }
1088
1139
  if (name.length > MAX_NAME_LENGTH) {
1089
- throw new chunkHWZRSXFB_js.ValidationError("View name is too long", [
1140
+ throw new chunkV26R64A4_js.ValidationError("View name is too long", [
1090
1141
  { path: ["name"], message: `View name is too long (max ${MAX_NAME_LENGTH} characters)` }
1091
1142
  ]);
1092
1143
  }
1093
1144
  if (!VIEW_NAME_REGEX.test(name)) {
1094
- throw new chunkHWZRSXFB_js.ValidationError("Invalid view name format", [
1145
+ throw new chunkV26R64A4_js.ValidationError("Invalid view name format", [
1095
1146
  {
1096
1147
  path: ["name"],
1097
1148
  message: "View name must be in kebab-case (e.g., 'detail', 'list-view')"
@@ -1109,6 +1160,12 @@ function assertUniqueBy(items, getKey, buildError) {
1109
1160
  seen.add(key);
1110
1161
  }
1111
1162
  }
1163
+ var ATTRIBUTE_NAME_SCHEMA = z2__default.default.string().min(1, "Attribute name cannot be empty").max(MAX_NAME_LENGTH, `Attribute name is too long (max ${MAX_NAME_LENGTH} characters)`).regex(ATTRIBUTE_NAME_REGEX, {
1164
+ message: "Invalid attribute name format.\nName must be a valid variable identifier:\n \u2705 Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'\n \u274C Invalid: 'first-name', 'first name', '123name', 'first.name'"
1165
+ }).refine(
1166
+ (name) => !chunkYZ5RCMIQ_js.RESERVED_ATTRIBUTE_NAMES.includes(name),
1167
+ { message: "This is a reserved attribute name" }
1168
+ );
1112
1169
  function validateAttributeName(name) {
1113
1170
  if (!name || name.length === 0) {
1114
1171
  throw new Error("[AttributeBuilder] Attribute name cannot be empty");
@@ -1123,10 +1180,10 @@ function validateAttributeName(name) {
1123
1180
  "[AttributeBuilder] Invalid attribute name format.\nName must be a valid variable identifier:\n \u2705 Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'\n \u274C Invalid: 'first-name', 'first name', '123name', 'first.name'"
1124
1181
  );
1125
1182
  }
1126
- if (chunkTU6ECJFZ_js.RESERVED_ATTRIBUTE_NAMES.includes(name)) {
1183
+ if (chunkYZ5RCMIQ_js.RESERVED_ATTRIBUTE_NAMES.includes(name)) {
1127
1184
  throw new Error(
1128
1185
  `[AttributeBuilder] "${name}" is a reserved name and cannot be used as an attribute name.
1129
- Reserved names: ${chunkTU6ECJFZ_js.RESERVED_ATTRIBUTE_NAMES.join(", ")}`
1186
+ Reserved names: ${chunkYZ5RCMIQ_js.RESERVED_ATTRIBUTE_NAMES.join(", ")}`
1130
1187
  );
1131
1188
  }
1132
1189
  }
@@ -1193,7 +1250,7 @@ var DEFAULT_AGENT_EXECUTION_CONFIG = {
1193
1250
  var AgentBuilder = class {
1194
1251
  constructor(config) {
1195
1252
  if (!config.name || config.name.trim().length === 0) {
1196
- throw new chunkHWZRSXFB_js.ValidationError("Agent name is required", []);
1253
+ throw new chunkV26R64A4_js.ValidationError("Agent name is required", []);
1197
1254
  }
1198
1255
  this.bp = { name: config.name, system: true, visibility: "workspace", triggers: [] };
1199
1256
  }
@@ -1327,13 +1384,13 @@ var AgentBuilder = class {
1327
1384
  }
1328
1385
  build() {
1329
1386
  if (!this.bp.systemPrompt) {
1330
- throw new chunkHWZRSXFB_js.ValidationError(`Agent "${this.bp.name}": systemPrompt is required`, []);
1387
+ throw new chunkV26R64A4_js.ValidationError(`Agent "${this.bp.name}": systemPrompt is required`, []);
1331
1388
  }
1332
1389
  if (!this.bp.model) {
1333
- throw new chunkHWZRSXFB_js.ValidationError(`Agent "${this.bp.name}": model is required`, []);
1390
+ throw new chunkV26R64A4_js.ValidationError(`Agent "${this.bp.name}": model is required`, []);
1334
1391
  }
1335
1392
  if (this.bp.system && this.bp.visibility === "private") {
1336
- throw new chunkHWZRSXFB_js.ValidationError(
1393
+ throw new chunkV26R64A4_js.ValidationError(
1337
1394
  `Agent "${this.bp.name}": system agents must use workspace visibility`,
1338
1395
  []
1339
1396
  );
@@ -1341,7 +1398,7 @@ var AgentBuilder = class {
1341
1398
  assertUniqueBy(
1342
1399
  this.bp.triggers,
1343
1400
  (t) => t.name,
1344
- (name) => new chunkHWZRSXFB_js.ValidationError(`Agent "${this.bp.name}": duplicate trigger name "${name}"`, [])
1401
+ (name) => new chunkV26R64A4_js.ValidationError(`Agent "${this.bp.name}": duplicate trigger name "${name}"`, [])
1345
1402
  );
1346
1403
  return {
1347
1404
  ...this.bp,
@@ -1396,7 +1453,7 @@ var BaseAttributeBuilder = class {
1396
1453
  * @see https://standardschema.dev/
1397
1454
  */
1398
1455
  get "~standard"() {
1399
- const zodSchema = chunkE47WAI5K_js.createAttributeValidator(this.build());
1456
+ const zodSchema = chunkI3EYILYO_js.createAttributeValidator(this.build());
1400
1457
  return createStandardSchemaProps(zodSchema);
1401
1458
  }
1402
1459
  constructor(type, name, label) {
@@ -2132,6 +2189,16 @@ var RollupAttributeBuilder = class extends BaseAttributeBuilder {
2132
2189
  this.attr.targetAttributeOptions = options;
2133
2190
  return this;
2134
2191
  }
2192
+ /**
2193
+ * Set the currency code a sum/avg over a currency target renders with
2194
+ * (#2644). Mirror of the target attribute's `defaultCurrency` — the stored
2195
+ * value stays a bare number; this only carries the symbol to the screen.
2196
+ * @param code - ISO 4217 code (e.g. "EUR")
2197
+ */
2198
+ targetCurrency(code) {
2199
+ this.attr.targetCurrencyCode = code;
2200
+ return this;
2201
+ }
2135
2202
  /**
2136
2203
  * Build the attribute, validating computed-field configuration eagerly so a
2137
2204
  * misconfiguration surfaces at schema-definition time (with a fix-it hint)
@@ -2143,9 +2210,9 @@ var RollupAttributeBuilder = class extends BaseAttributeBuilder {
2143
2210
  if (fn === "original" && targetType !== void 0 && targetType !== "select" && targetType !== "status" && targetType !== "multiselect") {
2144
2211
  const relation2 = this.attr.relationAttribute ?? "relation";
2145
2212
  const target = this.attr.targetAttribute ?? "field";
2146
- throw new chunkHWZRSXFB_js.SchemaError(
2213
+ throw new chunkV26R64A4_js.SchemaError(
2147
2214
  `Rollup "${this.attr.name}": .using("original") only supports a "select", "status", or "multiselect" target, but .targetType("${targetType}") was given. To surface a plain ${targetType} value from a related record, use a formula instead \u2014 e.g. formula({ name: "${this.attr.name}", label: "\u2026" }).expression("${relation2}.${target}").`,
2148
- chunkHWZRSXFB_js.SchemaErrorCode.VALIDATION_FAILED
2215
+ chunkV26R64A4_js.SchemaErrorCode.VALIDATION_FAILED
2149
2216
  );
2150
2217
  }
2151
2218
  return super.build();
@@ -2655,7 +2722,7 @@ var ObjectBuilder = class {
2655
2722
  * @see https://standardschema.dev/
2656
2723
  */
2657
2724
  get "~standard"() {
2658
- const zodSchema = chunkE47WAI5K_js.createObjectValidator(this.build());
2725
+ const zodSchema = chunkI3EYILYO_js.createObjectValidator(this.build());
2659
2726
  return createStandardSchemaProps(zodSchema);
2660
2727
  }
2661
2728
  /**
@@ -2783,7 +2850,7 @@ var ObjectBuilder = class {
2783
2850
  assertUniqueBy(
2784
2851
  [...this.obj.attributes, ...finalAttrs],
2785
2852
  (attribute) => attribute.name,
2786
- (name) => new chunkHWZRSXFB_js.DuplicateError(
2853
+ (name) => new chunkV26R64A4_js.DuplicateError(
2787
2854
  "attribute",
2788
2855
  name,
2789
2856
  `Object "${this.obj.name}": duplicate attribute name "${name}"`
@@ -2912,26 +2979,26 @@ var ObjectBuilder = class {
2912
2979
  throw new Error("[ObjectBuilder] Missing required field: label");
2913
2980
  }
2914
2981
  if (!this._labelExpression) {
2915
- throw new chunkHWZRSXFB_js.SchemaError(
2982
+ throw new chunkV26R64A4_js.SchemaError(
2916
2983
  `Object "${this.obj.name}" must have a labelExpression. The labelExpression defines how records are displayed in lists and relations (e.g. "{{ name }}").`,
2917
- chunkHWZRSXFB_js.SchemaErrorCode.VALIDATION_FAILED
2984
+ chunkV26R64A4_js.SchemaErrorCode.VALIDATION_FAILED
2918
2985
  );
2919
2986
  }
2920
2987
  const labelResult = labelExpressionSchema.safeParse(this._labelExpression);
2921
2988
  if (!labelResult.success) {
2922
2989
  const errorMsg = labelResult.error.issues[0]?.message ?? "Invalid labelExpression";
2923
- throw new chunkHWZRSXFB_js.SchemaError(
2990
+ throw new chunkV26R64A4_js.SchemaError(
2924
2991
  `Invalid labelExpression for "${this.obj.name}": ${errorMsg}`,
2925
- chunkHWZRSXFB_js.SchemaErrorCode.VALIDATION_FAILED
2992
+ chunkV26R64A4_js.SchemaErrorCode.VALIDATION_FAILED
2926
2993
  );
2927
2994
  }
2928
2995
  if (this._embeddingExpression !== void 0) {
2929
2996
  const embeddingResult = labelExpressionSchema.safeParse(this._embeddingExpression);
2930
2997
  if (!embeddingResult.success) {
2931
2998
  const errorMsg = embeddingResult.error.issues[0]?.message ?? "Invalid embeddingExpression";
2932
- throw new chunkHWZRSXFB_js.SchemaError(
2999
+ throw new chunkV26R64A4_js.SchemaError(
2933
3000
  `Invalid embeddingExpression for "${this.obj.name}": ${errorMsg}`,
2934
- chunkHWZRSXFB_js.SchemaErrorCode.VALIDATION_FAILED
3001
+ chunkV26R64A4_js.SchemaErrorCode.VALIDATION_FAILED
2935
3002
  );
2936
3003
  }
2937
3004
  }
@@ -2973,7 +3040,7 @@ function object(config) {
2973
3040
  }
2974
3041
  function validatePresetStructure(presetId, nodes, depth) {
2975
3042
  const fail = (message, detail) => {
2976
- throw new chunkHWZRSXFB_js.ValidationError(message, [
3043
+ throw new chunkV26R64A4_js.ValidationError(message, [
2977
3044
  { path: ["documentLayout", "presets", presetId], message: detail }
2978
3045
  ]);
2979
3046
  };
@@ -3744,7 +3811,7 @@ var ListViewBuilder = class {
3744
3811
  }
3745
3812
  const config = {
3746
3813
  defaultFilters: this.data.defaultFilters ? {
3747
- id: chunkOYHBQMC7_js.generateId(),
3814
+ id: chunkK6ET4CXP_js.generateId(),
3748
3815
  combinator: this.data.defaultFilters.combinator,
3749
3816
  rules: this.data.defaultFilters.rules
3750
3817
  } : void 0,
@@ -3759,7 +3826,7 @@ var ListViewBuilder = class {
3759
3826
  visibility: tab.visibility,
3760
3827
  columns: tab.columns,
3761
3828
  filters: tab.filters ? {
3762
- id: chunkOYHBQMC7_js.generateId(),
3829
+ id: chunkK6ET4CXP_js.generateId(),
3763
3830
  combinator: tab.filters.combinator,
3764
3831
  rules: tab.filters.rules
3765
3832
  } : void 0,
@@ -3925,7 +3992,7 @@ var ListViewTabConfigBuilder = class _ListViewTabConfigBuilder {
3925
3992
  const protectedAttribute = findProtectedTabFilterAttribute(filters);
3926
3993
  if (protectedAttribute) {
3927
3994
  const message = `Tab filters cannot target "${protectedAttribute}". Use .visibility("private")`;
3928
- throw new chunkHWZRSXFB_js.ValidationError(message, [{ path: ["filters"], message }]);
3995
+ throw new chunkV26R64A4_js.ValidationError(message, [{ path: ["filters"], message }]);
3929
3996
  }
3930
3997
  this.tabData.filters = filters;
3931
3998
  return this;
@@ -4136,7 +4203,7 @@ function jsonFlag(name, defaultValue) {
4136
4203
 
4137
4204
  // src/feature-flags/flag-registry.ts
4138
4205
  function duplicateFlagError(name) {
4139
- return new chunkHWZRSXFB_js.DuplicateError(
4206
+ return new chunkV26R64A4_js.DuplicateError(
4140
4207
  "feature flag",
4141
4208
  name,
4142
4209
  `Flag "${name}" is already registered. Each flag name must be unique.`
@@ -4214,7 +4281,7 @@ var FlagRegistry = class {
4214
4281
  getOrThrow(name) {
4215
4282
  const flag = this.get(name);
4216
4283
  if (!flag) {
4217
- throw new chunkHWZRSXFB_js.NotFoundError(
4284
+ throw new chunkV26R64A4_js.NotFoundError(
4218
4285
  "Feature flag",
4219
4286
  name,
4220
4287
  void 0,
@@ -4391,19 +4458,19 @@ var FlagService = class {
4391
4458
  */
4392
4459
  async setOverride(flagName, level, value, options = {}) {
4393
4460
  if (!this.repository) {
4394
- throw new chunkHWZRSXFB_js.SchemaError(
4461
+ throw new chunkV26R64A4_js.SchemaError(
4395
4462
  "Cannot set override: no FeatureFlagsRepository configured. Add featureFlags to your DatabaseAdapter to enable runtime overrides.",
4396
- chunkHWZRSXFB_js.SchemaErrorCode.CONFIGURATION_REQUIRED
4463
+ chunkV26R64A4_js.SchemaErrorCode.CONFIGURATION_REQUIRED
4397
4464
  );
4398
4465
  }
4399
4466
  const flag = this.registry.get(flagName);
4400
4467
  if (flag && !flag.allowedLevels.includes(level)) {
4401
4468
  const message = `Flag "${flagName}" does not allow ${level}-level overrides. Allowed levels: ${flag.allowedLevels.join(", ")}`;
4402
- throw new chunkHWZRSXFB_js.ValidationError(message, [{ path: ["level"], message }]);
4469
+ throw new chunkV26R64A4_js.ValidationError(message, [{ path: ["level"], message }]);
4403
4470
  }
4404
4471
  if (flag?.system) {
4405
4472
  const message = `Flag "${flagName}" is a system flag and cannot be overridden via API.`;
4406
- throw new chunkHWZRSXFB_js.ValidationError(message, [{ path: ["flagName"], message }]);
4473
+ throw new chunkV26R64A4_js.ValidationError(message, [{ path: ["flagName"], message }]);
4407
4474
  }
4408
4475
  await this.repository.setOverride({
4409
4476
  flagName,
@@ -4423,9 +4490,9 @@ var FlagService = class {
4423
4490
  */
4424
4491
  async deleteOverride(flagName, level, targetId) {
4425
4492
  if (!this.repository) {
4426
- throw new chunkHWZRSXFB_js.SchemaError(
4493
+ throw new chunkV26R64A4_js.SchemaError(
4427
4494
  "Cannot delete override: no FeatureFlagsRepository configured.",
4428
- chunkHWZRSXFB_js.SchemaErrorCode.CONFIGURATION_REQUIRED
4495
+ chunkV26R64A4_js.SchemaErrorCode.CONFIGURATION_REQUIRED
4429
4496
  );
4430
4497
  }
4431
4498
  await this.repository.deleteOverride(flagName, level, targetId);
@@ -4562,7 +4629,7 @@ var NativeObjectRegistryClass = class {
4562
4629
  if (!object2.system) {
4563
4630
  const message = `[NativeObjectRegistry] Cannot register object "${object2.name}" (id: ${object2.id}): missing system flag.
4564
4631
  Native objects must have system=true. Did you call .runtime() on the builder? Remove that call \u2014 objects are system:true by default.`;
4565
- throw new chunkHWZRSXFB_js.ValidationError(message, []);
4632
+ throw new chunkV26R64A4_js.ValidationError(message, []);
4566
4633
  }
4567
4634
  if (this.objects.has(object2.name)) {
4568
4635
  const existing = this.objects.get(object2.name);
@@ -4570,7 +4637,7 @@ Native objects must have system=true. Did you call .runtime() on the builder? Re
4570
4637
  - Existing: "${existing?.label}" (id: ${existing?.id})
4571
4638
  - New: "${object2.label}" (id: ${object2.id})
4572
4639
  Please use unique names for each native object.`;
4573
- throw new chunkHWZRSXFB_js.DuplicateError("object", object2.name, message);
4640
+ throw new chunkV26R64A4_js.DuplicateError("object", object2.name, message);
4574
4641
  }
4575
4642
  this.objects.set(object2.name, cloneObjectDefinition(object2));
4576
4643
  }
@@ -4602,7 +4669,7 @@ Please use unique names for each native object.`;
4602
4669
  if (!object2) {
4603
4670
  const message = `[NativeObjectRegistry] Native object "${name}" not found.
4604
4671
  Available objects: ${this.listNames().join(", ")}`;
4605
- throw new chunkHWZRSXFB_js.NotFoundError("Native object", name, chunkHWZRSXFB_js.SchemaErrorCode.OBJECT_NOT_FOUND, message);
4672
+ throw new chunkV26R64A4_js.NotFoundError("Native object", name, chunkV26R64A4_js.SchemaErrorCode.OBJECT_NOT_FOUND, message);
4606
4673
  }
4607
4674
  return object2;
4608
4675
  }
@@ -4764,7 +4831,7 @@ var ViewRegistry = class {
4764
4831
  const key = this.makeKey(view.object, view.name, view.type);
4765
4832
  if (this.views.has(key)) {
4766
4833
  const message = `[ViewRegistry] Duplicate view: "${view.name}" (${view.type}) for object "${view.object}"`;
4767
- throw new chunkHWZRSXFB_js.DuplicateError("view", key, message);
4834
+ throw new chunkV26R64A4_js.DuplicateError("view", key, message);
4768
4835
  }
4769
4836
  const storedView = cloneViewDefinition(view);
4770
4837
  this.views.set(key, storedView);
@@ -4809,7 +4876,7 @@ var ViewRegistry = class {
4809
4876
  const availableNames = available.map((v) => `${v.name} (${v.type})`).join(", ") || "(none)";
4810
4877
  const message = `[ViewRegistry] View "${viewName}" not found for object "${objectName}".
4811
4878
  Available views: ${availableNames}`;
4812
- throw new chunkHWZRSXFB_js.NotFoundError("View", `${objectName}:${viewName}`, void 0, message);
4879
+ throw new chunkV26R64A4_js.NotFoundError("View", `${objectName}:${viewName}`, void 0, message);
4813
4880
  }
4814
4881
  return view;
4815
4882
  }
@@ -4897,7 +4964,7 @@ var viewRegistry = new ViewRegistry();
4897
4964
  // src/views/auto-generator.ts
4898
4965
  function getRuntimeAttributes(attributes, excludeNames = []) {
4899
4966
  return attributes.filter(
4900
- (attr) => !(!chunkTU6ECJFZ_js.getAttributeCapabilities(attr).lifecycle.visibleInRuntime || attr.system || excludeNames.includes(attr.name))
4967
+ (attr) => !(!chunkYZ5RCMIQ_js.getAttributeCapabilities(attr).lifecycle.visibleInRuntime || attr.system || excludeNames.includes(attr.name))
4901
4968
  );
4902
4969
  }
4903
4970
  function sortAttributes(attributes) {
@@ -4930,7 +4997,7 @@ function generateDefaultDetailView(object2, options = {}) {
4930
4997
  const { includeActivityTab = true, includeDocumentsTab = true, excludeAttributes = [] } = options;
4931
4998
  const runtimeAttrs = getRuntimeAttributes(object2.attributes, excludeAttributes);
4932
4999
  const sortedAttrs = sortAttributes(
4933
- runtimeAttrs.filter((attr) => chunkTU6ECJFZ_js.getAttributeCapabilities(attr).presentation.formField)
5000
+ runtimeAttrs.filter((attr) => chunkYZ5RCMIQ_js.getAttributeCapabilities(attr).presentation.formField)
4934
5001
  );
4935
5002
  const formTab = {
4936
5003
  id: "form",
@@ -4987,7 +5054,7 @@ function generateDefaultListView(object2, options = {}) {
4987
5054
  const { excludeAttributes = [], maxListColumns = 5 } = options;
4988
5055
  const runtimeAttrs = getRuntimeAttributes(object2.attributes, excludeAttributes);
4989
5056
  const sortedAttrs = sortAttributes(
4990
- runtimeAttrs.filter((attr) => chunkTU6ECJFZ_js.getAttributeCapabilities(attr).presentation.defaultColumn)
5057
+ runtimeAttrs.filter((attr) => chunkYZ5RCMIQ_js.getAttributeCapabilities(attr).presentation.defaultColumn)
4991
5058
  );
4992
5059
  const columns = sortedAttrs.slice(0, maxListColumns).map((attr) => attr.name);
4993
5060
  const config = {
@@ -5117,7 +5184,7 @@ var FormRegistry = class {
5117
5184
  const forms = Array.isArray(formOrForms) ? formOrForms : [formOrForms];
5118
5185
  for (const f of forms) {
5119
5186
  if (this.forms.has(f.name)) {
5120
- throw new chunkHWZRSXFB_js.DuplicateError("form", f.name, `[FormRegistry] Duplicate form: "${f.name}"`);
5187
+ throw new chunkV26R64A4_js.DuplicateError("form", f.name, `[FormRegistry] Duplicate form: "${f.name}"`);
5121
5188
  }
5122
5189
  this.forms.set(f.name, cloneFormDefinition(f));
5123
5190
  }
@@ -5221,6 +5288,8 @@ function liveChannelKey(channel) {
5221
5288
  return `user:${encodeURIComponent(channel.actorId)}`;
5222
5289
  case "conversation":
5223
5290
  return `conversation:${encodeURIComponent(channel.sessionId)}`;
5291
+ case "architect-draft":
5292
+ return `architect-draft:${encodeURIComponent(channel.actorId)}`;
5224
5293
  }
5225
5294
  }
5226
5295
  function decodeLiveChannelPart(part) {
@@ -5262,6 +5331,10 @@ function parseLiveChannelKey(key) {
5262
5331
  const actorId = decodeLiveChannelPart(parts[1]);
5263
5332
  return actorId ? { kind: "user", actorId } : null;
5264
5333
  }
5334
+ if (parts[0] === "architect-draft" && parts.length === 2 && parts[1]) {
5335
+ const actorId = decodeLiveChannelPart(parts[1]);
5336
+ return actorId ? { kind: "architect-draft", actorId } : null;
5337
+ }
5265
5338
  if (parts[0] === "conversation" && parts.length === 2 && parts[1]) {
5266
5339
  const sessionId = decodeLiveChannelPart(parts[1]);
5267
5340
  return sessionId ? { kind: "conversation", sessionId } : null;
@@ -5282,8 +5355,13 @@ var LIVE_EVENT_TYPE_REGISTRY = {
5282
5355
  "notification.created": true,
5283
5356
  "notification.recipient.patch": true,
5284
5357
  "notification.count.patch": true,
5358
+ "notification.inbox.archived": true,
5285
5359
  "conversation.renamed": true,
5286
5360
  "browser.preview.updated": true,
5361
+ "reflex.state.changed": true,
5362
+ "reflex.run.completed": true,
5363
+ "reflex.authoring.progress": true,
5364
+ "architect.draft.updated": true,
5287
5365
  "channel.revoked": true
5288
5366
  };
5289
5367
  var LIVE_EVENT_TYPES = Object.keys(LIVE_EVENT_TYPE_REGISTRY);
@@ -5349,6 +5427,13 @@ var RECORD_LIVE_SNAPSHOT_KEYS = [
5349
5427
  "lastUpdatedBy",
5350
5428
  "schemaVersion"
5351
5429
  ];
5430
+ var NOTIFICATION_INBOX_ARCHIVED_PAYLOAD_KEYS = [
5431
+ "type",
5432
+ "targetActorId",
5433
+ "archivedCount",
5434
+ "version",
5435
+ "updatedAt"
5436
+ ];
5352
5437
  function isLiveEventType(value) {
5353
5438
  return typeof value === "string" && LIVE_EVENT_TYPES.includes(value);
5354
5439
  }
@@ -5383,10 +5468,20 @@ function isLiveEventPayloadForType(type, payload) {
5383
5468
  return isNotificationRecipientPatchPayload(payload);
5384
5469
  case "notification.count.patch":
5385
5470
  return isNotificationCountPatchPayload(payload);
5471
+ case "notification.inbox.archived":
5472
+ return isNotificationInboxArchivedPayload(payload);
5386
5473
  case "conversation.renamed":
5387
5474
  return isConversationRenamedPayload(payload);
5388
5475
  case "browser.preview.updated":
5389
5476
  return isBrowserPreviewUpdatedPayload(payload);
5477
+ case "reflex.state.changed":
5478
+ return isReflexStateChangedPayload(payload);
5479
+ case "reflex.run.completed":
5480
+ return isReflexRunCompletedPayload(payload);
5481
+ case "reflex.authoring.progress":
5482
+ return isReflexAuthoringProgressPayload(payload);
5483
+ case "architect.draft.updated":
5484
+ return isArchitectDraftUpdatedPayload(payload);
5390
5485
  case "channel.revoked":
5391
5486
  return isChannelRevokedPayload(payload);
5392
5487
  default:
@@ -5461,7 +5556,9 @@ function isRecordFieldPatch(value) {
5461
5556
  return isRecord2(value) && hasString(value, "fieldKey") && Object.hasOwn(value, "value") && hasVersion(value, "version");
5462
5557
  }
5463
5558
  function isRecordPatchPayload(payload) {
5464
- return payload.type === "record.patch" && hasString(payload, "objectId") && hasString(payload, "recordId") && hasVersion(payload, "recordVersion") && hasOptional(payload, "label", isString) && hasOptional(payload, "metadata", isRecord2) && Array.isArray(payload.fieldPatches) && payload.fieldPatches.every(isRecordFieldPatch) && hasString(payload, "updatedAt");
5559
+ return payload.type === "record.patch" && hasString(payload, "objectId") && hasString(payload, "recordId") && hasVersion(payload, "recordVersion") && hasOptional(payload, "label", isString) && hasOptional(payload, "metadata", isRecord2) && // Strictly `true`: the applier evicts an entity on this bit, so truthy
5560
+ // junk on the wire must not pass as the presence flag (#2637).
5561
+ hasOptional(payload, "fieldsWithheld", (value) => value === true) && Array.isArray(payload.fieldPatches) && payload.fieldPatches.every(isRecordFieldPatch) && hasString(payload, "updatedAt");
5465
5562
  }
5466
5563
  function isRecordDeletedPayload(payload) {
5467
5564
  return payload.type === "record.deleted" && hasString(payload, "objectId") && hasString(payload, "recordId") && hasVersion(payload, "recordVersion") && hasString(payload, "deletedAt");
@@ -5510,6 +5607,9 @@ function isNotificationRecipientPatchPayload(payload) {
5510
5607
  function isNotificationCountPatchPayload(payload) {
5511
5608
  return payload.type === "notification.count.patch" && hasString(payload, "targetActorId") && hasVersion(payload, "unread") && hasVersion(payload, "pendingWork") && hasVersion(payload, "version") && hasIsoDateString(payload, "updatedAt");
5512
5609
  }
5610
+ function isNotificationInboxArchivedPayload(payload) {
5611
+ return payload.type === "notification.inbox.archived" && hasOnlyKeys(payload, NOTIFICATION_INBOX_ARCHIVED_PAYLOAD_KEYS) && hasNonEmptyString(payload, "targetActorId") && hasVersion(payload, "archivedCount") && hasVersion(payload, "version") && hasIsoDateString(payload, "updatedAt");
5612
+ }
5513
5613
  function isConversationRenamedPayload(payload) {
5514
5614
  return payload.type === "conversation.renamed" && hasString(payload, "sessionId") && hasString(payload, "title") && hasVersion(payload, "version") && hasString(payload, "updatedAt");
5515
5615
  }
@@ -5517,6 +5617,41 @@ function isBrowserPreviewUpdatedPayload(payload) {
5517
5617
  const preview = payload.preview;
5518
5618
  return payload.type === "browser.preview.updated" && hasOnlyKeys(payload, BROWSER_PREVIEW_UPDATED_PAYLOAD_KEYS) && isRecord2(preview) && hasOnlyKeys(preview, BROWSER_PREVIEW_DESCRIPTOR_KEYS) && hasNonEmptyString(preview, "previewId") && hasNonEmptyString(preview, "rootSessionId") && hasNonEmptyString(preview, "agentSessionId") && hasNonEmptyString(preview, "browserSession") && isOneOf(preview.status, BROWSER_PREVIEW_STATUSES) && hasVersion(preview, "sequence") && hasIsoDateString(preview, "updatedAt") && preview.previewId === `browser:${preview.agentSessionId}:${preview.browserSession}`;
5519
5619
  }
5620
+ var REFLEX_STATES = ["armed", "disarmed"];
5621
+ var REFLEX_AUTHORING_STATUSES = [
5622
+ "authoring",
5623
+ "compiling",
5624
+ "replaying",
5625
+ "promoted",
5626
+ "failed"
5627
+ ];
5628
+ var REFLEX_SERVED_MODES = [
5629
+ "promoted",
5630
+ "lkg"
5631
+ ];
5632
+ var ARCHITECT_DRAFT_STATUSES = [
5633
+ "composing",
5634
+ "published",
5635
+ "discarded"
5636
+ ];
5637
+ function isArchitectDraftUpdatedPayload(payload) {
5638
+ if (payload.type !== "architect.draft.updated" || !isRecord2(payload.draft)) {
5639
+ return false;
5640
+ }
5641
+ const draft = payload.draft;
5642
+ return hasNonEmptyString(draft, "id") && hasNonEmptyString(draft, "actorId") && isNullableString(draft.agentSessionId) && // Each operation was parsed by the registry before it was persisted; the
5643
+ // wire check stops at the shape realtime itself is responsible for.
5644
+ Array.isArray(draft.operations) && draft.operations.every(isRecord2) && isRecord2(draft.baselines) && isOneOf(draft.status, ARCHITECT_DRAFT_STATUSES);
5645
+ }
5646
+ function isReflexStateChangedPayload(payload) {
5647
+ return payload.type === "reflex.state.changed" && hasNonEmptyString(payload, "reflexId") && isOneOf(payload.state, REFLEX_STATES) && hasIsoDateString(payload, "updatedAt");
5648
+ }
5649
+ function isReflexRunCompletedPayload(payload) {
5650
+ return payload.type === "reflex.run.completed" && hasNonEmptyString(payload, "reflexId") && hasNonEmptyString(payload, "runId") && isOneOf(payload.served, REFLEX_SERVED_MODES) && hasVersion(payload, "version") && hasVersion(payload, "wallMs") && hasIsoDateString(payload, "completedAt");
5651
+ }
5652
+ function isReflexAuthoringProgressPayload(payload) {
5653
+ return payload.type === "reflex.authoring.progress" && hasNonEmptyString(payload, "reflexId") && isOneOf(payload.status, REFLEX_AUTHORING_STATUSES) && hasIsoDateString(payload, "updatedAt");
5654
+ }
5520
5655
  function isChannelRevokedPayload(payload) {
5521
5656
  return payload.type === "channel.revoked" && hasString(payload, "channel") && isOneOf(payload.reason, CHANNEL_REVOKED_REASONS);
5522
5657
  }
@@ -5678,7 +5813,7 @@ function assertAcyclicComputedDependencies(nodes) {
5678
5813
  }
5679
5814
  function parseCompileFormula(expression) {
5680
5815
  try {
5681
- return chunkLRFLSFIA_js.parseComputedFormula(expression);
5816
+ return chunkBOICAZHR_js.parseComputedFormula(expression);
5682
5817
  } catch (error) {
5683
5818
  if (error instanceof Error) {
5684
5819
  throw new ComputedFormulaCompileError(error.message);
@@ -6306,7 +6441,11 @@ function evaluateCallNode(functionName, args, input) {
6306
6441
  assertComputedFunctionName(functionName);
6307
6442
  validateArity(functionName, args.length);
6308
6443
  if (functionName === "if") {
6309
- return evaluateAst(args[0], input) ? evaluateAst(args[1], input) : evaluateAst(args[2], input);
6444
+ const condition = evaluateAst(args[0], input);
6445
+ if (condition === null) {
6446
+ return null;
6447
+ }
6448
+ return condition ? evaluateAst(args[1], input) : evaluateAst(args[2], input);
6310
6449
  }
6311
6450
  return evaluateCall(
6312
6451
  functionName,
@@ -6352,8 +6491,10 @@ function evaluateBinary(operator, left, right) {
6352
6491
  return compareWith(left, right, (result) => result <= 0);
6353
6492
  case "==":
6354
6493
  return equalScalar(left, right);
6355
- case "!=":
6356
- return !equalScalar(left, right);
6494
+ case "!=": {
6495
+ const equal = equalScalar(left, right);
6496
+ return equal === null ? null : !equal;
6497
+ }
6357
6498
  default:
6358
6499
  return unreachable(operator);
6359
6500
  }
@@ -6369,6 +6510,9 @@ function compareWith(left, right, predicate) {
6369
6510
  return result === null ? null : predicate(result);
6370
6511
  }
6371
6512
  function compare(left, right) {
6513
+ if (!areCommensurable([left, right])) {
6514
+ return null;
6515
+ }
6372
6516
  const leftNumber = toFiniteNumber(left);
6373
6517
  const rightNumber = toFiniteNumber(right);
6374
6518
  if (leftNumber !== null && rightNumber !== null) {
@@ -6385,6 +6529,9 @@ function equalScalar(left, right) {
6385
6529
  if (left === null || left === void 0 || right === null || right === void 0) {
6386
6530
  return false;
6387
6531
  }
6532
+ if (!areCommensurable([left, right])) {
6533
+ return null;
6534
+ }
6388
6535
  return compare(left, right) === 0;
6389
6536
  }
6390
6537
  function assertComputedFunctionName(name) {
@@ -6405,8 +6552,14 @@ function evaluateCall(functionName, args) {
6405
6552
  case "concat":
6406
6553
  return args.filter((arg) => arg !== null && arg !== void 0).map(String).join("");
6407
6554
  case "sum":
6555
+ if (!areCommensurable(args)) {
6556
+ return null;
6557
+ }
6408
6558
  return numericValues(args).reduce((total, value) => total + value, 0);
6409
6559
  case "avg": {
6560
+ if (!areCommensurable(args)) {
6561
+ return null;
6562
+ }
6410
6563
  const values = numericValues(args);
6411
6564
  return values.length > 0 ? values.reduce((total, value) => total + value, 0) / values.length : null;
6412
6565
  }
@@ -6429,9 +6582,9 @@ function evaluateCall(functionName, args) {
6429
6582
  case "percent_not_empty":
6430
6583
  return percentByEmptyState(args[0], false);
6431
6584
  case "count_empty":
6432
- return collectionItems(args[0]).filter(chunkE47WAI5K_js.isNullishOrEmptyString).length;
6585
+ return collectionItems(args[0]).filter(chunkI3EYILYO_js.isNullishOrEmptyString).length;
6433
6586
  case "count_not_empty":
6434
- return collectionItems(args[0]).filter((item) => !chunkE47WAI5K_js.isNullishOrEmptyString(item)).length;
6587
+ return collectionItems(args[0]).filter((item) => !chunkI3EYILYO_js.isNullishOrEmptyString(item)).length;
6435
6588
  case "count_unique":
6436
6589
  return uniqueNonEmpty(collectionItems(args[0])).length;
6437
6590
  default:
@@ -6444,7 +6597,22 @@ function unreachable(value) {
6444
6597
  function numericValues(values) {
6445
6598
  return flatten(values).map(toFiniteNumber).filter((value) => value !== null);
6446
6599
  }
6600
+ function areCommensurable(values) {
6601
+ const codes = /* @__PURE__ */ new Set();
6602
+ for (const value of flatten(values)) {
6603
+ if (isCurrencyValue(value)) {
6604
+ codes.add(currencyCode(value));
6605
+ }
6606
+ }
6607
+ return codes.size <= 1;
6608
+ }
6609
+ function currencyCode(value) {
6610
+ return value.code.toUpperCase();
6611
+ }
6447
6612
  function numericBinary(left, right, operation) {
6613
+ if (!areCommensurable([left, right])) {
6614
+ return null;
6615
+ }
6448
6616
  const leftNumber = toFiniteNumber(left);
6449
6617
  const rightNumber = toFiniteNumber(right);
6450
6618
  if (leftNumber === null || rightNumber === null) {
@@ -6454,6 +6622,9 @@ function numericBinary(left, right, operation) {
6454
6622
  return Number.isFinite(result) ? result : null;
6455
6623
  }
6456
6624
  function minMax(values, mode) {
6625
+ if (!areCommensurable(values)) {
6626
+ return null;
6627
+ }
6457
6628
  const numbers = numericValues(values);
6458
6629
  if (numbers.length > 0) {
6459
6630
  return mode === "min" ? Math.min(...numbers) : Math.max(...numbers);
@@ -6474,14 +6645,14 @@ function percentByEmptyState(value, countEmpty) {
6474
6645
  if (items.length === 0) {
6475
6646
  return 0;
6476
6647
  }
6477
- const count = items.filter((item) => chunkE47WAI5K_js.isNullishOrEmptyString(item) === countEmpty).length;
6648
+ const count = items.filter((item) => chunkI3EYILYO_js.isNullishOrEmptyString(item) === countEmpty).length;
6478
6649
  return count / items.length;
6479
6650
  }
6480
6651
  function uniqueNonEmpty(values) {
6481
6652
  const seen = /* @__PURE__ */ new Set();
6482
6653
  const result = [];
6483
6654
  for (const value of values) {
6484
- if (chunkE47WAI5K_js.isNullishOrEmptyString(value)) {
6655
+ if (chunkI3EYILYO_js.isNullishOrEmptyString(value)) {
6485
6656
  continue;
6486
6657
  }
6487
6658
  const key = uniqueKey(value);
@@ -6532,6 +6703,9 @@ function toDate(value) {
6532
6703
  return Number.isNaN(date2.getTime()) ? null : date2;
6533
6704
  }
6534
6705
  function uniqueKey(value) {
6706
+ if (isCurrencyValue(value)) {
6707
+ return `currency:${currencyCode(value)}:${value.value}`;
6708
+ }
6535
6709
  const numberValue = toFiniteNumber(value);
6536
6710
  if (numberValue !== null) {
6537
6711
  return `number:${numberValue}`;
@@ -6595,11 +6769,11 @@ function evaluateComputedAst(node, input) {
6595
6769
  return evaluateAst(node, input);
6596
6770
  }
6597
6771
  function evaluateComputedFormula(expression, input) {
6598
- return evaluateAst(chunkLRFLSFIA_js.parseComputedFormula(expression), input);
6772
+ return evaluateAst(chunkBOICAZHR_js.parseComputedFormula(expression), input);
6599
6773
  }
6600
6774
  function evaluateComputedFormulaWithResult(expression, input, returnType, decimals) {
6601
6775
  try {
6602
- const raw = evaluateAst(chunkLRFLSFIA_js.parseComputedFormula(expression), input);
6776
+ const raw = evaluateAst(chunkBOICAZHR_js.parseComputedFormula(expression), input);
6603
6777
  const value = returnType ? formatComputedResult(raw, returnType, decimals) : raw;
6604
6778
  return { value };
6605
6779
  } catch (error) {
@@ -6724,10 +6898,10 @@ var COMPUTED_FUNCTION_METADATA = [
6724
6898
  ];
6725
6899
 
6726
6900
  // src/filters/operators.ts
6727
- var isEmpty = (v) => chunkE47WAI5K_js.isNullishOrEmptyString(v) || Array.isArray(v) && v.length === 0;
6901
+ var isEmpty = (v) => chunkI3EYILYO_js.isNullishOrEmptyString(v) || Array.isArray(v) && v.length === 0;
6728
6902
  var toStr = (v) => v == null ? "" : String(v);
6729
6903
  var toNum = (v) => {
6730
- if (chunkE47WAI5K_js.isNullishOrEmptyString(v)) return null;
6904
+ if (chunkI3EYILYO_js.isNullishOrEmptyString(v)) return null;
6731
6905
  const n = typeof v === "number" ? v : Number(v);
6732
6906
  return Number.isFinite(n) ? n : null;
6733
6907
  };
@@ -6860,7 +7034,7 @@ var OPERATOR_SPECS = {
6860
7034
  appliesTo: ["date"],
6861
7035
  evaluateInMemory: (v, rv) => {
6862
7036
  const d = toDate2(v);
6863
- const bounds = chunkTU6ECJFZ_js.resolveIsWithinBounds(rv);
7037
+ const bounds = chunkYZ5RCMIQ_js.resolveIsWithinBounds(rv);
6864
7038
  if (!(d && bounds)) return false;
6865
7039
  return d.getTime() >= bounds.startMs && d.getTime() < bounds.endMs;
6866
7040
  }
@@ -6896,7 +7070,7 @@ var OPERATOR_SPECS = {
6896
7070
  // src/filters/evaluate.ts
6897
7071
  var systemAttribute = (name, type) => ({ id: `system:${name}`, name, label: name, type, system: true });
6898
7072
  var RECORD_SYSTEM_ATTRIBUTES = [
6899
- ...Object.entries(chunkTU6ECJFZ_js.SYSTEM_FILTER_ATTRIBUTE_TYPES).map(
7073
+ ...Object.entries(chunkYZ5RCMIQ_js.SYSTEM_FILTER_ATTRIBUTE_TYPES).map(
6900
7074
  ([name, type]) => systemAttribute(name, type)
6901
7075
  )
6902
7076
  ];
@@ -6937,7 +7111,7 @@ function evaluateRule(rule, values, attrByName) {
6937
7111
  (definition) => definition.name === rule.property
6938
7112
  );
6939
7113
  if (!property) return false;
6940
- const positiveOperator = chunkTU6ECJFZ_js.normalizeForEdgeRpc(rule.operator);
7114
+ const positiveOperator = chunkYZ5RCMIQ_js.normalizeForEdgeRpc(rule.operator);
6941
7115
  const propertySpec = OPERATOR_SPECS[positiveOperator];
6942
7116
  if (!propertySpec?.appliesTo.includes(property.type)) return false;
6943
7117
  const rootValue = values[rule.attribute];
@@ -6955,7 +7129,7 @@ function evaluateRule(rule, values, attrByName) {
6955
7129
  property
6956
7130
  );
6957
7131
  });
6958
- return (rule.quantifier ?? chunkTU6ECJFZ_js.getOperatorPolarity(rule.operator)) === "none" ? !matches : matches;
7132
+ return (rule.quantifier ?? chunkYZ5RCMIQ_js.getOperatorPolarity(rule.operator)) === "none" ? !matches : matches;
6959
7133
  }
6960
7134
  const spec = OPERATOR_SPECS[rule.operator];
6961
7135
  if (!spec) return false;
@@ -7004,7 +7178,7 @@ function normalizePhoneComparands(stored, rule) {
7004
7178
  return [normalizeOne(stored), normalizeOne(rule)];
7005
7179
  }
7006
7180
  function normalizeComparableValue(type, value) {
7007
- if (type === "currency") return chunkTU6ECJFZ_js.extractCurrencyFilterValue(value);
7181
+ if (type === "currency") return chunkYZ5RCMIQ_js.extractCurrencyFilterValue(value);
7008
7182
  if (type === "date") {
7009
7183
  if (isDateRangeValue(value)) return dateValueStart(value);
7010
7184
  if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value.toISOString();
@@ -7113,10 +7287,10 @@ var attributeNameSchema = z2.z.string().min(1).superRefine((name, ctx) => {
7113
7287
  'The attribute\'s machine name \u2014 the record\'s field key, and what `{{ name }}` refers to in a labelExpression. Must be a valid identifier: starts with a letter or underscore, then only letters/digits/underscores ("montantHt", "first_name", "FIRST_NAME" are valid; "first-name", "first name", "123name" are not). Max 63 characters. Cannot be a name reserved by the record shape itself (id, createdAt, updatedAt, createdBy, lastUpdatedBy, objectId, label, embeddingText, values, metadata, deletedAt, deletedBy, schemaVersion).'
7114
7288
  );
7115
7289
  var objectNameSchema = z2.z.string().min(1).superRefine((name, ctx) => {
7116
- if (chunkTU6ECJFZ_js.RESERVED_OBJECT_NAMES.includes(name)) {
7290
+ if (chunkYZ5RCMIQ_js.RESERVED_OBJECT_NAMES.includes(name)) {
7117
7291
  ctx.addIssue({
7118
7292
  code: z2.z.ZodIssueCode.custom,
7119
- message: `"${name}" is a reserved object name (${chunkTU6ECJFZ_js.RESERVED_OBJECT_NAMES.join(", ")}) and cannot be used for a new object.`
7293
+ message: `"${name}" is a reserved object name (${chunkYZ5RCMIQ_js.RESERVED_OBJECT_NAMES.join(", ")}) and cannot be used for a new object.`
7120
7294
  });
7121
7295
  }
7122
7296
  try {
@@ -7130,7 +7304,7 @@ var objectNameSchema = z2.z.string().min(1).superRefine((name, ctx) => {
7130
7304
  function withConfigCheck(schema) {
7131
7305
  return schema.superRefine((attribute, ctx) => {
7132
7306
  try {
7133
- const parsedConfig = chunkLRFLSFIA_js.parseAttributeConfigForCreate(attribute.type, {
7307
+ const parsedConfig = chunkBOICAZHR_js.parseAttributeConfigForCreate(attribute.type, {
7134
7308
  ...attribute.config ?? {},
7135
7309
  description: attribute.description
7136
7310
  });
@@ -7146,7 +7320,7 @@ function withConfigCheck(schema) {
7146
7320
  });
7147
7321
  }
7148
7322
  } catch (error) {
7149
- if (error instanceof chunkHWZRSXFB_js.ValidationError) {
7323
+ if (error instanceof chunkV26R64A4_js.ValidationError) {
7150
7324
  for (const issue of error.errors) {
7151
7325
  ctx.addIssue({
7152
7326
  code: z2.z.ZodIssueCode.custom,
@@ -7193,7 +7367,7 @@ var plannedObjectSchema = z2.z.object({
7193
7367
  'Human-readable plural display label (e.g. "Devis"/"Invoices"). Defaults from `label` if omitted.'
7194
7368
  ),
7195
7369
  description: z2.z.string().optional().describe("Help text describing what this object represents."),
7196
- icon: chunkLRFLSFIA_js.iconNameSchema.describe(
7370
+ icon: chunkBOICAZHR_js.iconNameSchema.describe(
7197
7371
  "Required icon name for the object. Must be a catalogue value \u2014 call `search_icons` and use a name it returns verbatim. A name that is not in the catalogue is rejected without any hint as to what would have worked, so never guess one."
7198
7372
  ),
7199
7373
  labelExpression: labelExpressionSchema.describe(
@@ -7251,13 +7425,13 @@ var proposedDefaultViewTargetSchema = z2.z.discriminatedUnion("viewType", [
7251
7425
  z2.z.object({
7252
7426
  objectName: viewTargetObjectNameSchema,
7253
7427
  viewType: z2.z.literal("list").describe("Targets the object's default list view (the grid)."),
7254
- canonicalConfig: chunkTU6ECJFZ_js.listViewConfigSchema.describe(CANONICAL_CONFIG_DESCRIPTION),
7428
+ canonicalConfig: chunkYZ5RCMIQ_js.listViewConfigSchema.describe(CANONICAL_CONFIG_DESCRIPTION),
7255
7429
  baselineToken: z2.z.string().min(1).optional().describe(BASELINE_TOKEN_DESCRIPTION)
7256
7430
  }).strict(),
7257
7431
  z2.z.object({
7258
7432
  objectName: viewTargetObjectNameSchema,
7259
7433
  viewType: z2.z.literal("detail").describe("Targets the object's default detail view (the single-record view)."),
7260
- canonicalConfig: chunkTU6ECJFZ_js.detailViewConfigSchema.describe(CANONICAL_CONFIG_DESCRIPTION),
7434
+ canonicalConfig: chunkYZ5RCMIQ_js.detailViewConfigSchema.describe(CANONICAL_CONFIG_DESCRIPTION),
7261
7435
  baselineToken: z2.z.string().min(1).optional().describe(BASELINE_TOKEN_DESCRIPTION)
7262
7436
  }).strict()
7263
7437
  ]);
@@ -7271,13 +7445,13 @@ var persistedDefaultViewTargetSchema = z2.z.discriminatedUnion("viewType", [
7271
7445
  z2.z.object({
7272
7446
  objectName: z2.z.string().min(1),
7273
7447
  viewType: z2.z.literal("list"),
7274
- canonicalConfig: chunkTU6ECJFZ_js.listViewConfigSchema,
7448
+ canonicalConfig: chunkYZ5RCMIQ_js.listViewConfigSchema,
7275
7449
  ...persistedBaselineFields
7276
7450
  }).strict(),
7277
7451
  z2.z.object({
7278
7452
  objectName: z2.z.string().min(1),
7279
7453
  viewType: z2.z.literal("detail"),
7280
- canonicalConfig: chunkTU6ECJFZ_js.detailViewConfigSchema,
7454
+ canonicalConfig: chunkYZ5RCMIQ_js.detailViewConfigSchema,
7281
7455
  ...persistedBaselineFields
7282
7456
  }).strict()
7283
7457
  ]).superRefine((target, ctx) => {
@@ -7424,7 +7598,7 @@ function boundSerializedPlanInput(input, ctx) {
7424
7598
  });
7425
7599
  return z2.z.NEVER;
7426
7600
  }
7427
- const serializedBytes = new TextEncoder().encode(chunkOYHBQMC7_js.canonicalStringify(input)).byteLength;
7601
+ const serializedBytes = new TextEncoder().encode(chunkK6ET4CXP_js.canonicalStringify(input)).byteLength;
7428
7602
  if (serializedBytes > SCHEMA_PLAN_LIMITS.serializedBytes) {
7429
7603
  ctx.addIssue({
7430
7604
  code: "too_big",
@@ -7483,16 +7657,248 @@ var persistedSchemaPlanSchema = z2.z.preprocess(
7483
7657
  boundSerializedPlanInput,
7484
7658
  structuralPersistedSchemaPlanSchema
7485
7659
  );
7660
+ var nonNegativeNumberSchema = z2.z.number().finite().nonnegative();
7661
+ var toolImpactSchema = z2.z.object({
7662
+ label: z2.z.string(),
7663
+ denied: z2.z.boolean().optional(),
7664
+ deletion: z2.z.object({
7665
+ target: z2.z.string().optional(),
7666
+ count: nonNegativeNumberSchema.optional(),
7667
+ restorableDays: nonNegativeNumberSchema.optional()
7668
+ }).strict().optional(),
7669
+ counts: z2.z.record(z2.z.string(), nonNegativeNumberSchema).optional(),
7670
+ warnings: z2.z.array(z2.z.string()).optional()
7671
+ }).strict();
7672
+ var agentMessagePartSchema = z2.z.union([
7673
+ z2.z.object({ type: z2.z.literal("text"), text: z2.z.string() }).strict(),
7674
+ z2.z.object({ type: z2.z.literal("reasoning"), text: z2.z.string() }).strict(),
7675
+ z2.z.object({ type: z2.z.literal("error"), error: z2.z.string(), errorClass: z2.z.string().optional() }).strict(),
7676
+ z2.z.object({
7677
+ type: z2.z.literal("tool"),
7678
+ toolCallId: z2.z.string(),
7679
+ name: z2.z.string(),
7680
+ args: z2.z.record(z2.z.string(), z2.z.unknown()),
7681
+ result: z2.z.unknown().optional(),
7682
+ error: z2.z.string().optional(),
7683
+ errorCode: z2.z.enum(["output_limit_reached", "interrupted"]).optional(),
7684
+ state: z2.z.enum([
7685
+ "streaming",
7686
+ "running",
7687
+ "completed",
7688
+ "error",
7689
+ "approval-requested",
7690
+ "approval-responded",
7691
+ "approval-dispatched"
7692
+ ]),
7693
+ durationMs: nonNegativeNumberSchema.optional(),
7694
+ approvalId: z2.z.string().optional(),
7695
+ approvalImpact: toolImpactSchema.optional(),
7696
+ approved: z2.z.boolean().optional(),
7697
+ approvalReason: z2.z.string().optional(),
7698
+ approvalRelaxableByAuto: z2.z.boolean().optional()
7699
+ }).strict(),
7700
+ z2.z.object({
7701
+ type: z2.z.literal("file"),
7702
+ fileId: z2.z.string(),
7703
+ name: z2.z.string(),
7704
+ mimeType: z2.z.string()
7705
+ }).strict(),
7706
+ z2.z.object({
7707
+ type: z2.z.literal("compaction"),
7708
+ state: z2.z.literal("in-progress"),
7709
+ reason: z2.z.enum(["preflight_threshold", "overflow_recovery"]),
7710
+ estimatedTokens: nonNegativeNumberSchema.optional(),
7711
+ reportedTokens: nonNegativeNumberSchema.optional()
7712
+ }).strict(),
7713
+ z2.z.object({
7714
+ type: z2.z.literal("compaction"),
7715
+ state: z2.z.literal("completed"),
7716
+ tokensBefore: nonNegativeNumberSchema,
7717
+ tokensAfter: nonNegativeNumberSchema,
7718
+ tokensSaved: nonNegativeNumberSchema,
7719
+ strategy: z2.z.enum(["no-op", "summary", "truncation"]),
7720
+ durationMs: nonNegativeNumberSchema,
7721
+ summary: z2.z.string().optional()
7722
+ }).strict(),
7723
+ z2.z.object({
7724
+ type: z2.z.literal("compaction"),
7725
+ state: z2.z.literal("failed"),
7726
+ reason: z2.z.string(),
7727
+ durationMs: nonNegativeNumberSchema.optional()
7728
+ }).strict()
7729
+ ]);
7730
+ var agentMessageAttachmentSchema = z2.z.object({
7731
+ id: z2.z.string(),
7732
+ name: z2.z.string(),
7733
+ mimeType: z2.z.string(),
7734
+ size: nonNegativeNumberSchema
7735
+ }).strict();
7736
+ var mentionReferenceSchema = z2.z.object({
7737
+ id: z2.z.string(),
7738
+ // `MentionEntityType` is `"user" | "record" | (string & {})`, which accepts
7739
+ // exactly what `string` accepts but is not `Equal` to it, so a bare
7740
+ // `z.string()` fails this file's drift guard. The identity transform types
7741
+ // the output without touching validation: `z.string()` still runs first, so
7742
+ // a non-string is still rejected as `invalid_type` with the same message and
7743
+ // path — which matters, because `agentUIValidationError` copies the issue
7744
+ // code into the ValidationError it throws.
7745
+ type: z2.z.string().transform((value) => value),
7746
+ entityId: z2.z.string(),
7747
+ label: z2.z.string(),
7748
+ objectName: z2.z.string().optional(),
7749
+ startIndex: nonNegativeNumberSchema,
7750
+ endIndex: nonNegativeNumberSchema
7751
+ }).strict();
7752
+ var modelDefinitionSchema = z2.z.object({
7753
+ provider: z2.z.enum(["anthropic", "openai", "google", "mistral"]),
7754
+ model: z2.z.string(),
7755
+ maxTokens: nonNegativeNumberSchema.optional(),
7756
+ contextWindow: nonNegativeNumberSchema.optional()
7757
+ }).strict();
7758
+ var durableDateSchema = z2.z.union([
7759
+ z2.z.date(),
7760
+ z2.z.string().datetime({ offset: true }).transform((value) => new Date(value))
7761
+ ]);
7762
+ var agentSessionMessageSchema = z2.z.object({
7763
+ id: z2.z.string(),
7764
+ sessionId: z2.z.string(),
7765
+ tenantId: z2.z.string().optional(),
7766
+ runId: z2.z.string().optional(),
7767
+ role: z2.z.enum(["user", "assistant", "system", "tool"]),
7768
+ parts: z2.z.array(agentMessagePartSchema),
7769
+ attachments: z2.z.array(agentMessageAttachmentSchema).optional(),
7770
+ mentions: z2.z.array(mentionReferenceSchema).optional(),
7771
+ model: modelDefinitionSchema.optional(),
7772
+ tokenUsage: z2.z.object({ input: nonNegativeNumberSchema, output: nonNegativeNumberSchema }).strict().optional(),
7773
+ metadata: z2.z.record(z2.z.string(), z2.z.unknown()).optional(),
7774
+ createdAt: durableDateSchema
7775
+ }).strict();
7776
+ var todoItemSchema = z2.z.object({
7777
+ id: z2.z.string(),
7778
+ description: z2.z.string(),
7779
+ status: z2.z.enum(["pending", "in_progress", "completed", "blocked"]),
7780
+ result: z2.z.string().optional(),
7781
+ updatedAt: nonNegativeNumberSchema.optional()
7782
+ }).strict();
7783
+ var todoPlanSchema = z2.z.object({
7784
+ id: z2.z.string(),
7785
+ sessionId: z2.z.string(),
7786
+ status: z2.z.enum(["active", "completed", "abandoned"]),
7787
+ todos: z2.z.array(todoItemSchema),
7788
+ version: nonNegativeNumberSchema,
7789
+ createdAt: z2.z.string(),
7790
+ updatedAt: z2.z.string(),
7791
+ completedAt: z2.z.string().optional()
7792
+ }).strict();
7793
+ var customDataChunkSchemas = {
7794
+ "session-named": z2.z.object({ name: z2.z.string() }).strict(),
7795
+ "compaction-start": z2.z.object({
7796
+ reason: z2.z.enum(["preflight_threshold", "overflow_recovery"]),
7797
+ estimatedTokens: nonNegativeNumberSchema.optional(),
7798
+ reportedTokens: nonNegativeNumberSchema.optional()
7799
+ }).strict(),
7800
+ "compaction-end": z2.z.object({
7801
+ tokensBefore: nonNegativeNumberSchema,
7802
+ tokensAfter: nonNegativeNumberSchema,
7803
+ tokensSaved: nonNegativeNumberSchema,
7804
+ strategy: z2.z.enum(["no-op", "summary", "truncation"]),
7805
+ durationMs: nonNegativeNumberSchema,
7806
+ summary: z2.z.string().optional()
7807
+ }).strict(),
7808
+ "compaction-failed": z2.z.object({ reason: z2.z.string() }).strict(),
7809
+ usage: z2.z.object({
7810
+ inputTokens: nonNegativeNumberSchema,
7811
+ outputTokens: nonNegativeNumberSchema,
7812
+ totalTokens: nonNegativeNumberSchema,
7813
+ cacheReadTokens: nonNegativeNumberSchema.optional(),
7814
+ cacheCreationTokens: nonNegativeNumberSchema.optional(),
7815
+ contextWindow: nonNegativeNumberSchema,
7816
+ residentTokens: nonNegativeNumberSchema,
7817
+ utilization: z2.z.number().finite().min(0).max(1),
7818
+ costUsd: nonNegativeNumberSchema.optional()
7819
+ }).strict(),
7820
+ "message-persisted": z2.z.object({ message: agentSessionMessageSchema }).strict(),
7821
+ "message-updated": z2.z.object({ message: agentSessionMessageSchema }).strict(),
7822
+ "todo-plan-update": z2.z.object({ plan: todoPlanSchema }).strict(),
7823
+ "approval-context": z2.z.object({
7824
+ approvalId: z2.z.string(),
7825
+ toolCallId: z2.z.string(),
7826
+ impact: toolImpactSchema.optional(),
7827
+ relaxableByAuto: z2.z.boolean().optional()
7828
+ }).strict()
7829
+ };
7830
+ function isAgentUIDataName(value) {
7831
+ return value in customDataChunkSchemas;
7832
+ }
7833
+ function agentUIValidationError(issues) {
7834
+ return new chunkV26R64A4_js.ValidationError(
7835
+ "Invalid agent UI message chunk",
7836
+ issues.map((issue) => ({
7837
+ path: issue.path.map(String),
7838
+ message: issue.message,
7839
+ code: issue.code
7840
+ }))
7841
+ );
7842
+ }
7843
+ function assertCustomAgentUIMessageChunk(value) {
7844
+ if (typeof value !== "object" || value === null || typeof value.type !== "string") {
7845
+ throw new chunkV26R64A4_js.ValidationError("Invalid agent UI message chunk", [
7846
+ { path: ["type"], message: "Expected UI message chunk type", code: "invalid_type" }
7847
+ ]);
7848
+ }
7849
+ const type = value.type;
7850
+ if (!type.startsWith("data-")) {
7851
+ throw new chunkV26R64A4_js.ValidationError("Invalid agent UI message chunk", [
7852
+ { path: ["type"], message: "Expected agent data chunk type", code: "invalid_value" }
7853
+ ]);
7854
+ }
7855
+ const name = type.slice("data-".length);
7856
+ if (!isAgentUIDataName(name)) {
7857
+ throw new chunkV26R64A4_js.ValidationError("Invalid agent UI message chunk", [
7858
+ { path: ["type"], message: `Unknown agent UI data type: ${name}`, code: "invalid_value" }
7859
+ ]);
7860
+ }
7861
+ const chunkResult = z2.z.object({
7862
+ type: z2.z.literal(`data-${name}`),
7863
+ id: z2.z.string().optional(),
7864
+ data: customDataChunkSchemas[name],
7865
+ transient: z2.z.boolean().optional()
7866
+ }).strict().safeParse(value);
7867
+ if (!chunkResult.success) throw agentUIValidationError(chunkResult.error.issues);
7868
+ return chunkResult.data;
7869
+ }
7870
+ function agentDataChunk(name, data, options) {
7871
+ return assertCustomAgentUIMessageChunk({
7872
+ type: `data-${name}`,
7873
+ ...options?.id !== void 0 ? { id: options.id } : {},
7874
+ data,
7875
+ ...options?.transient !== void 0 ? { transient: options.transient } : {}
7876
+ });
7877
+ }
7486
7878
 
7487
7879
  // src/architect/define-operation.ts
7488
7880
  function defineOperation(def) {
7489
7881
  return def;
7490
7882
  }
7883
+ function definePresentation(focus, impact, propertyPath) {
7884
+ const navigation = impact === "atomic" ? "none" : impact === "local" ? "if-not-visible" : "follow";
7885
+ return (op) => {
7886
+ const path = propertyPath?.(op);
7887
+ return {
7888
+ impact,
7889
+ navigation,
7890
+ focus: {
7891
+ ...focus(op),
7892
+ ...path === void 0 ? {} : { propertyPath: path }
7893
+ }
7894
+ };
7895
+ };
7896
+ }
7491
7897
  var operationBase = { id: z2.z.string().min(1) };
7492
7898
  var viewOperationBase = { ...operationBase, viewId: z2.z.string().min(1) };
7493
7899
  function mapView(state, viewId, fn) {
7494
7900
  if (!state.views.some((v) => v.id === viewId)) {
7495
- throw new chunkHWZRSXFB_js.ValidationError(`View "${viewId}" is not in the draftable state`, []);
7901
+ throw new chunkV26R64A4_js.ValidationError(`View "${viewId}" is not in the draftable state`, []);
7496
7902
  }
7497
7903
  return { ...state, views: state.views.map((v) => v.id === viewId ? fn(v) : v) };
7498
7904
  }
@@ -7504,14 +7910,14 @@ function moveWithin(items, from, toIndex) {
7504
7910
  }
7505
7911
  function reorderById(items, order, what) {
7506
7912
  if (order.length !== items.length) {
7507
- throw new chunkHWZRSXFB_js.ValidationError(
7913
+ throw new chunkV26R64A4_js.ValidationError(
7508
7914
  `${what} order lists ${order.length} ids for ${items.length} items`,
7509
7915
  []
7510
7916
  );
7511
7917
  }
7512
7918
  return order.map((id) => {
7513
7919
  const found = items.find((item) => item.id === id);
7514
- if (!found) throw new chunkHWZRSXFB_js.ValidationError(`${what} "${id}" is not in this collection`, []);
7920
+ if (!found) throw new chunkV26R64A4_js.ValidationError(`${what} "${id}" is not in this collection`, []);
7515
7921
  return found;
7516
7922
  });
7517
7923
  }
@@ -7519,15 +7925,15 @@ function reorderById(items, order, what) {
7519
7925
  // src/architect/operations/detail-view.ts
7520
7926
  function mapFormTab(view, tabId, fn) {
7521
7927
  const found = view.tabs.find((t) => t.id === tabId);
7522
- if (!found) throw new chunkHWZRSXFB_js.ValidationError(`Tab "${tabId}" is not in view "${view.id}"`, []);
7928
+ if (!found) throw new chunkV26R64A4_js.ValidationError(`Tab "${tabId}" is not in view "${view.id}"`, []);
7523
7929
  if (found.type !== "form") {
7524
- throw new chunkHWZRSXFB_js.ValidationError(`Tab "${tabId}" is not a form tab`, []);
7930
+ throw new chunkV26R64A4_js.ValidationError(`Tab "${tabId}" is not a form tab`, []);
7525
7931
  }
7526
7932
  return { ...view, tabs: view.tabs.map((t) => t.id === tabId ? fn(found) : t) };
7527
7933
  }
7528
7934
  function requireGroup(tab, groupId) {
7529
7935
  const found = tab.groups.find((g) => g.id === groupId);
7530
- if (!found) throw new chunkHWZRSXFB_js.ValidationError(`Group "${groupId}" is not in tab "${tab.id}"`, []);
7936
+ if (!found) throw new chunkV26R64A4_js.ValidationError(`Group "${groupId}" is not in tab "${tab.id}"`, []);
7531
7937
  return found;
7532
7938
  }
7533
7939
  function locateField(tab, fieldId) {
@@ -7535,20 +7941,49 @@ function locateField(tab, fieldId) {
7535
7941
  const field = group2.fields.find((f) => f.id === fieldId);
7536
7942
  if (field) return { group: group2, field };
7537
7943
  }
7538
- throw new chunkHWZRSXFB_js.ValidationError(`Field slot "${fieldId}" is not in tab "${tab.id}"`, []);
7944
+ throw new chunkV26R64A4_js.ValidationError(`Field slot "${fieldId}" is not in tab "${tab.id}"`, []);
7539
7945
  }
7540
- var tabPayload = z2.z.custom(
7541
- (value) => typeof value === "object" && value !== null && "id" in value && "type" in value,
7542
- { message: "A tab must be an object carrying id and type" }
7543
- );
7544
- var groupPayload = z2.z.custom(
7545
- (value) => typeof value === "object" && value !== null && "id" in value && "fields" in value,
7546
- { message: "A group must be an object carrying id and fields" }
7547
- );
7548
- var fieldPayload = z2.z.custom(
7549
- (value) => typeof value === "object" && value !== null && "id" in value,
7550
- { message: "A field slot must be an object carrying an id" }
7551
- );
7946
+ function viewFocus(op) {
7947
+ return { viewId: op.viewId };
7948
+ }
7949
+ function tabFocus(op) {
7950
+ return { viewId: op.viewId, tabId: op.tabId };
7951
+ }
7952
+ function groupFocus(op) {
7953
+ return { viewId: op.viewId, tabId: op.tabId, groupId: op.groupId };
7954
+ }
7955
+ function fieldFocus(op) {
7956
+ return { viewId: op.viewId, tabId: op.tabId, fieldId: op.fieldId };
7957
+ }
7958
+ function addTabFocus(op) {
7959
+ return { viewId: op.viewId, tabId: op.tab.id };
7960
+ }
7961
+ function addGroupFocus(op) {
7962
+ return { viewId: op.viewId, tabId: op.tabId, groupId: op.group.id };
7963
+ }
7964
+ function addFieldFocus(op) {
7965
+ return {
7966
+ viewId: op.viewId,
7967
+ tabId: op.tabId,
7968
+ groupId: op.groupId,
7969
+ fieldId: op.field.id
7970
+ };
7971
+ }
7972
+ function moveFieldFocus(op) {
7973
+ return {
7974
+ viewId: op.viewId,
7975
+ tabId: op.tabId,
7976
+ groupId: op.toGroupId,
7977
+ fieldId: op.fieldId
7978
+ };
7979
+ }
7980
+ function firstChangedProperty(op) {
7981
+ const keys = Object.keys(op.changes).sort();
7982
+ return keys.length === 1 ? [keys[0]] : void 0;
7983
+ }
7984
+ var tabPayload = chunkYZ5RCMIQ_js.detailTabDraftSchema;
7985
+ var groupPayload = chunkYZ5RCMIQ_js.groupWriteSchema;
7986
+ var fieldPayload = chunkYZ5RCMIQ_js.fieldSlotSchema;
7552
7987
  var addTabSchema = z2.z.object({
7553
7988
  ...viewOperationBase,
7554
7989
  type: z2.z.literal("add_tab"),
@@ -7559,11 +7994,12 @@ var addTab = defineOperation({
7559
7994
  schema: addTabSchema,
7560
7995
  apply: (state, op) => mapView(state, op.viewId, (view) => {
7561
7996
  if (view.tabs.some((t) => t.id === op.tab.id)) {
7562
- throw new chunkHWZRSXFB_js.ValidationError(`Tab "${op.tab.id}" already exists in view "${op.viewId}"`, []);
7997
+ throw new chunkV26R64A4_js.ValidationError(`Tab "${op.tab.id}" already exists in view "${op.viewId}"`, []);
7563
7998
  }
7564
7999
  return { ...view, tabs: [...view.tabs, op.tab] };
7565
8000
  }),
7566
- focus: (op) => ({ viewId: op.viewId, tabId: op.tab.id }),
8001
+ focus: addTabFocus,
8002
+ presentation: definePresentation(addTabFocus, "local"),
7567
8003
  describe: (op) => `Ajoute l'onglet \xAB ${op.tab.label} \xBB`
7568
8004
  });
7569
8005
  var removeTabSchema = z2.z.object({
@@ -7576,36 +8012,49 @@ var removeTab = defineOperation({
7576
8012
  schema: removeTabSchema,
7577
8013
  apply: (state, op) => mapView(state, op.viewId, (view) => {
7578
8014
  if (!view.tabs.some((t) => t.id === op.tabId)) {
7579
- throw new chunkHWZRSXFB_js.ValidationError(`Tab "${op.tabId}" is not in view "${op.viewId}"`, []);
8015
+ throw new chunkV26R64A4_js.ValidationError(`Tab "${op.tabId}" is not in view "${op.viewId}"`, []);
7580
8016
  }
7581
8017
  return { ...view, tabs: view.tabs.filter((t) => t.id !== op.tabId) };
7582
8018
  }),
7583
- focus: (op) => ({ viewId: op.viewId }),
8019
+ focus: tabFocus,
8020
+ presentation: definePresentation(tabFocus, "local"),
7584
8021
  describe: (op) => `Supprime l'onglet ${op.tabId}`
7585
8022
  });
8023
+ var updateTabChanges = z2.z.object({
8024
+ label: z2.z.string().min(1).optional(),
8025
+ icon: chunkBOICAZHR_js.iconNameSchema.optional(),
8026
+ order: z2.z.number().int().optional()
8027
+ });
8028
+ var UPDATE_TAB_CHANGE_KEYS = Object.keys(
8029
+ updateTabChanges.shape
8030
+ );
7586
8031
  var updateTabSchema = z2.z.object({
7587
8032
  ...viewOperationBase,
7588
8033
  type: z2.z.literal("update_tab"),
7589
8034
  tabId: z2.z.string().min(1),
7590
- changes: z2.z.object({
7591
- label: z2.z.string().min(1).optional(),
7592
- icon: z2.z.custom((v) => typeof v === "string" && v.length > 0).optional(),
7593
- order: z2.z.number().int().optional()
7594
- }).refine((c) => Object.keys(c).length > 0, "update_tab needs at least one change")
8035
+ changes: updateTabChanges.refine(
8036
+ (c) => Object.keys(c).length > 0,
8037
+ "update_tab needs at least one change"
8038
+ )
8039
+ });
8040
+ var updateTabFocus = (op) => ({
8041
+ viewId: op.viewId,
8042
+ tabId: op.tabId
7595
8043
  });
7596
8044
  var updateTab = defineOperation({
7597
8045
  type: "update_tab",
7598
8046
  schema: updateTabSchema,
7599
8047
  apply: (state, op) => mapView(state, op.viewId, (view) => {
7600
8048
  if (!view.tabs.some((t) => t.id === op.tabId)) {
7601
- throw new chunkHWZRSXFB_js.ValidationError(`Tab "${op.tabId}" is not in view "${op.viewId}"`, []);
8049
+ throw new chunkV26R64A4_js.ValidationError(`Tab "${op.tabId}" is not in view "${op.viewId}"`, []);
7602
8050
  }
7603
8051
  return {
7604
8052
  ...view,
7605
8053
  tabs: view.tabs.map((t) => t.id === op.tabId ? { ...t, ...op.changes } : t)
7606
8054
  };
7607
8055
  }),
7608
- focus: (op) => ({ viewId: op.viewId, tabId: op.tabId }),
8056
+ focus: updateTabFocus,
8057
+ presentation: definePresentation(updateTabFocus, "atomic", firstChangedProperty),
7609
8058
  describe: (op) => op.changes.label ? `Renomme l'onglet en \xAB ${op.changes.label} \xBB` : `Modifie l'onglet ${op.tabId}`
7610
8059
  });
7611
8060
  var reorderTabsSchema = z2.z.object({
@@ -7620,7 +8069,8 @@ var reorderTabs = defineOperation({
7620
8069
  ...view,
7621
8070
  tabs: reorderById(view.tabs, op.tabOrder, "Tab")
7622
8071
  })),
7623
- focus: (op) => ({ viewId: op.viewId }),
8072
+ focus: viewFocus,
8073
+ presentation: definePresentation(viewFocus, "local"),
7624
8074
  describe: () => "R\xE9ordonne les onglets"
7625
8075
  });
7626
8076
  var addGroupSchema = z2.z.object({
@@ -7637,7 +8087,7 @@ var addGroup = defineOperation({
7637
8087
  op.viewId,
7638
8088
  (view) => mapFormTab(view, op.tabId, (tab) => {
7639
8089
  if (tab.groups.some((g) => g.id === op.group.id)) {
7640
- throw new chunkHWZRSXFB_js.ValidationError(
8090
+ throw new chunkV26R64A4_js.ValidationError(
7641
8091
  `Group "${op.group.id}" already exists in tab "${op.tabId}"`,
7642
8092
  []
7643
8093
  );
@@ -7645,7 +8095,8 @@ var addGroup = defineOperation({
7645
8095
  return { ...tab, groups: [...tab.groups, op.group] };
7646
8096
  })
7647
8097
  ),
7648
- focus: (op) => ({ viewId: op.viewId, tabId: op.tabId, groupId: op.group.id }),
8098
+ focus: addGroupFocus,
8099
+ presentation: definePresentation(addGroupFocus, "local"),
7649
8100
  describe: (op) => `Ajoute le groupe \xAB ${op.group.label} \xBB`
7650
8101
  });
7651
8102
  var removeGroupSchema = z2.z.object({
@@ -7665,19 +8116,31 @@ var removeGroup = defineOperation({
7665
8116
  return { ...tab, groups: tab.groups.filter((g) => g.id !== op.groupId) };
7666
8117
  })
7667
8118
  ),
7668
- focus: (op) => ({ viewId: op.viewId, tabId: op.tabId }),
8119
+ focus: groupFocus,
8120
+ presentation: definePresentation(groupFocus, "local"),
7669
8121
  describe: (op) => `Supprime le groupe ${op.groupId}`
7670
8122
  });
7671
- var setGroupLabelSchema = z2.z.object({
8123
+ var updateGroupSchema = z2.z.object({
7672
8124
  ...viewOperationBase,
7673
- type: z2.z.literal("set_group_label"),
8125
+ type: z2.z.literal("update_group"),
7674
8126
  tabId: z2.z.string().min(1),
7675
8127
  groupId: z2.z.string().min(1),
7676
- label: z2.z.string().min(1)
8128
+ changes: z2.z.object({
8129
+ label: z2.z.string().min(1).optional(),
8130
+ description: z2.z.string().optional(),
8131
+ collapsible: z2.z.boolean().optional(),
8132
+ collapsed: z2.z.boolean().optional(),
8133
+ order: z2.z.number().int().optional()
8134
+ }).refine((c) => Object.keys(c).length > 0, "update_group needs at least one change")
8135
+ });
8136
+ var updateGroupFocus = (op) => ({
8137
+ viewId: op.viewId,
8138
+ tabId: op.tabId,
8139
+ groupId: op.groupId
7677
8140
  });
7678
- var setGroupLabel = defineOperation({
7679
- type: "set_group_label",
7680
- schema: setGroupLabelSchema,
8141
+ var updateGroup = defineOperation({
8142
+ type: "update_group",
8143
+ schema: updateGroupSchema,
7681
8144
  apply: (state, op) => mapView(
7682
8145
  state,
7683
8146
  op.viewId,
@@ -7685,12 +8148,13 @@ var setGroupLabel = defineOperation({
7685
8148
  requireGroup(tab, op.groupId);
7686
8149
  return {
7687
8150
  ...tab,
7688
- groups: tab.groups.map((g) => g.id === op.groupId ? { ...g, label: op.label } : g)
8151
+ groups: tab.groups.map((g) => g.id === op.groupId ? { ...g, ...op.changes } : g)
7689
8152
  };
7690
8153
  })
7691
8154
  ),
7692
- focus: (op) => ({ viewId: op.viewId, tabId: op.tabId, groupId: op.groupId }),
7693
- describe: (op) => `Renomme le groupe en \xAB ${op.label} \xBB`
8155
+ focus: updateGroupFocus,
8156
+ presentation: definePresentation(updateGroupFocus, "atomic", firstChangedProperty),
8157
+ describe: (op) => op.changes.label ? `Renomme le groupe en \xAB ${op.changes.label} \xBB` : "Modifie le groupe"
7694
8158
  });
7695
8159
  var reorderGroupsSchema = z2.z.object({
7696
8160
  ...viewOperationBase,
@@ -7709,7 +8173,8 @@ var reorderGroups = defineOperation({
7709
8173
  groups: reorderById(tab.groups, op.groupOrder, "Group")
7710
8174
  }))
7711
8175
  ),
7712
- focus: (op) => ({ viewId: op.viewId, tabId: op.tabId }),
8176
+ focus: tabFocus,
8177
+ presentation: definePresentation(tabFocus, "local"),
7713
8178
  describe: () => "R\xE9ordonne les groupes"
7714
8179
  });
7715
8180
  var addFieldSchema = z2.z.object({
@@ -7729,7 +8194,7 @@ var addField = defineOperation({
7729
8194
  (view) => mapFormTab(view, op.tabId, (tab) => {
7730
8195
  requireGroup(tab, op.groupId);
7731
8196
  if (tab.groups.some((g) => g.fields.some((f) => f.id === op.field.id))) {
7732
- throw new chunkHWZRSXFB_js.ValidationError(
8197
+ throw new chunkV26R64A4_js.ValidationError(
7733
8198
  `Field slot "${op.field.id}" already exists in tab "${op.tabId}"`,
7734
8199
  []
7735
8200
  );
@@ -7747,12 +8212,8 @@ var addField = defineOperation({
7747
8212
  };
7748
8213
  })
7749
8214
  ),
7750
- focus: (op) => ({
7751
- viewId: op.viewId,
7752
- tabId: op.tabId,
7753
- groupId: op.groupId,
7754
- fieldId: op.field.id
7755
- }),
8215
+ focus: addFieldFocus,
8216
+ presentation: definePresentation(addFieldFocus, "local"),
7756
8217
  describe: (op) => `Ajoute le champ ${op.field.attribute ?? op.field.id}`
7757
8218
  });
7758
8219
  var removeFieldSchema = z2.z.object({
@@ -7777,7 +8238,8 @@ var removeField = defineOperation({
7777
8238
  };
7778
8239
  })
7779
8240
  ),
7780
- focus: (op) => ({ viewId: op.viewId, tabId: op.tabId }),
8241
+ focus: fieldFocus,
8242
+ presentation: definePresentation(fieldFocus, "local"),
7781
8243
  describe: (op) => `Retire le champ ${op.fieldId}`
7782
8244
  });
7783
8245
  var moveFieldSchema = z2.z.object({
@@ -7827,12 +8289,8 @@ var moveField = defineOperation({
7827
8289
  };
7828
8290
  })
7829
8291
  ),
7830
- focus: (op) => ({
7831
- viewId: op.viewId,
7832
- tabId: op.tabId,
7833
- groupId: op.toGroupId,
7834
- fieldId: op.fieldId
7835
- }),
8292
+ focus: moveFieldFocus,
8293
+ presentation: definePresentation(moveFieldFocus, "local"),
7836
8294
  describe: (op) => `D\xE9place le champ ${op.fieldId} vers le groupe ${op.toGroupId}`
7837
8295
  });
7838
8296
  var updateFieldSchema = z2.z.object({
@@ -7846,6 +8304,11 @@ var updateFieldSchema = z2.z.object({
7846
8304
  span: z2.z.number().int().min(1).max(12).optional()
7847
8305
  }).refine((c) => Object.keys(c).length > 0, "update_field needs at least one change")
7848
8306
  });
8307
+ var updateFieldFocus = (op) => ({
8308
+ viewId: op.viewId,
8309
+ tabId: op.tabId,
8310
+ fieldId: op.fieldId
8311
+ });
7849
8312
  var updateField = defineOperation({
7850
8313
  type: "update_field",
7851
8314
  schema: updateFieldSchema,
@@ -7865,9 +8328,137 @@ var updateField = defineOperation({
7865
8328
  };
7866
8329
  })
7867
8330
  ),
7868
- focus: (op) => ({ viewId: op.viewId, tabId: op.tabId, fieldId: op.fieldId }),
8331
+ focus: updateFieldFocus,
8332
+ presentation: definePresentation(updateFieldFocus, "atomic", firstChangedProperty),
7869
8333
  describe: (op) => `Modifie le champ ${op.fieldId}`
7870
8334
  });
8335
+ var updateTableTabChanges = z2.z.object({
8336
+ /**
8337
+ * Where the table reads its rows from — a `TableSource`, not a name: a
8338
+ * direct relation, or the inverse of one. Kept with `columns` on purpose:
8339
+ * the source picker posts `{ source, columns: [] }` as one gesture, and
8340
+ * splitting the pair across two operations would wipe the column list while
8341
+ * the source change vanished (#2763, #2787).
8342
+ */
8343
+ source: chunkYZ5RCMIQ_js.tableSourceSchema.optional(),
8344
+ columns: chunkYZ5RCMIQ_js.columnsSchema.optional(),
8345
+ // Nullable, not merely optional: the panels clear a filter list or a sort
8346
+ // list by sending `null`, because `undefined` does not survive
8347
+ // `JSON.stringify` and the operation would arrive with no changes at all
8348
+ // (#2787). `apply` drops the key rather than storing the null.
8349
+ filters: chunkYZ5RCMIQ_js.filterStateSchema.nullable().optional(),
8350
+ sorts: chunkYZ5RCMIQ_js.sortsSchema.nullable().optional(),
8351
+ allowCreate: z2.z.boolean().optional(),
8352
+ allowEdit: z2.z.boolean().optional(),
8353
+ allowDelete: z2.z.boolean().optional(),
8354
+ createMode: z2.z.enum(["redirect", "inline", "peek"]).optional()
8355
+ });
8356
+ var UPDATE_TABLE_TAB_CHANGE_KEYS = Object.keys(
8357
+ updateTableTabChanges.shape
8358
+ );
8359
+ var updateTabConfigChanges = z2.z.object({
8360
+ /** Address attributes an emails/meetings tab reads. */
8361
+ emailAttributeIds: z2.z.array(z2.z.string().min(1)).optional(),
8362
+ /**
8363
+ * The attribute a richtext tab edits, and the one it titles itself with.
8364
+ * `titleAttribute` is nullable because "None" is a real choice — and null,
8365
+ * not undefined, because `JSON.stringify` drops undefined-valued keys and
8366
+ * the operation would arrive with no changes at all.
8367
+ */
8368
+ attribute: z2.z.string().min(1).optional(),
8369
+ titleAttribute: z2.z.string().min(1).nullable().optional(),
8370
+ /**
8371
+ * The component a custom tab renders, and the props handed to it. Both are
8372
+ * clearable for the same reason: the name is emptied on blur and the props
8373
+ * textarea is emptied to mean "none".
8374
+ */
8375
+ component: z2.z.string().nullable().optional(),
8376
+ props: z2.z.record(z2.z.string(), z2.z.unknown()).nullable().optional()
8377
+ });
8378
+ var UPDATE_TAB_CONFIG_CHANGE_KEYS = Object.keys(
8379
+ updateTabConfigChanges.shape
8380
+ );
8381
+ var TAB_CONFIG_FIELD_OWNERS = {
8382
+ emailAttributeIds: ["emails", "meetings"],
8383
+ attribute: ["richtext"],
8384
+ titleAttribute: ["richtext"],
8385
+ component: ["custom"],
8386
+ props: ["custom"]
8387
+ };
8388
+ var updateTabConfigSchema = z2.z.object({
8389
+ ...viewOperationBase,
8390
+ type: z2.z.literal("update_tab_config"),
8391
+ tabId: z2.z.string().min(1),
8392
+ changes: updateTabConfigChanges.refine(
8393
+ (c) => Object.keys(c).length > 0,
8394
+ "update_tab_config needs at least one change"
8395
+ )
8396
+ });
8397
+ var updateTabConfigFocus = (op) => ({
8398
+ viewId: op.viewId,
8399
+ tabId: op.tabId
8400
+ });
8401
+ var updateTabConfig = defineOperation({
8402
+ type: "update_tab_config",
8403
+ schema: updateTabConfigSchema,
8404
+ apply: (state, op) => mapView(state, op.viewId, (view) => {
8405
+ const found = view.tabs.find((t) => t.id === op.tabId);
8406
+ if (!found) {
8407
+ throw new chunkV26R64A4_js.ValidationError(`Tab "${op.tabId}" is not in view "${view.id}"`, []);
8408
+ }
8409
+ for (const key of Object.keys(op.changes)) {
8410
+ const allowed = TAB_CONFIG_FIELD_OWNERS[key];
8411
+ if (allowed && !allowed.includes(found.type)) {
8412
+ throw new chunkV26R64A4_js.ValidationError(`"${key}" is not a setting of a "${found.type}" tab`, []);
8413
+ }
8414
+ }
8415
+ return {
8416
+ ...view,
8417
+ tabs: view.tabs.map((t) => t.id === op.tabId ? { ...t, ...op.changes } : t)
8418
+ };
8419
+ }),
8420
+ focus: updateTabConfigFocus,
8421
+ presentation: definePresentation(updateTabConfigFocus, "atomic", firstChangedProperty),
8422
+ describe: (op) => `Configure ${Object.keys(op.changes).join(", ")} sur l'onglet ${op.tabId}`
8423
+ });
8424
+ var updateTableTabSchema = z2.z.object({
8425
+ ...viewOperationBase,
8426
+ type: z2.z.literal("update_table_tab"),
8427
+ tabId: z2.z.string().min(1),
8428
+ changes: updateTableTabChanges.refine(
8429
+ (c) => Object.keys(c).length > 0,
8430
+ "update_table_tab needs at least one change"
8431
+ )
8432
+ });
8433
+ var updateTableTabFocus = (op) => ({
8434
+ viewId: op.viewId,
8435
+ tabId: op.tabId
8436
+ });
8437
+ var updateTableTab = defineOperation({
8438
+ type: "update_table_tab",
8439
+ schema: updateTableTabSchema,
8440
+ apply: (state, op) => mapView(state, op.viewId, (view) => {
8441
+ const found = view.tabs.find((t) => t.id === op.tabId);
8442
+ if (!found) throw new chunkV26R64A4_js.ValidationError(`Tab "${op.tabId}" is not in view "${view.id}"`, []);
8443
+ if (found.type !== "table") {
8444
+ throw new chunkV26R64A4_js.ValidationError(`Tab "${op.tabId}" is not a table tab`, []);
8445
+ }
8446
+ const entries = Object.entries(op.changes);
8447
+ const applied = Object.fromEntries(entries.filter(([, value]) => value !== null));
8448
+ const cleared = new Set(entries.filter(([, value]) => value === null).map(([key]) => key));
8449
+ return {
8450
+ ...view,
8451
+ tabs: view.tabs.map(
8452
+ (t) => t.id === op.tabId ? Object.fromEntries(
8453
+ Object.entries({ ...t, ...applied }).filter(([key]) => !cleared.has(key))
8454
+ ) : t
8455
+ )
8456
+ };
8457
+ }),
8458
+ focus: updateTableTabFocus,
8459
+ presentation: definePresentation(updateTableTabFocus, "atomic", firstChangedProperty),
8460
+ describe: (op) => op.changes.columns ? `Affiche ${op.changes.columns.length} colonne(s) dans l'onglet ${op.tabId}` : `Modifie l'onglet ${op.tabId}`
8461
+ });
7871
8462
  var setSidePanelSchema = z2.z.object({
7872
8463
  ...viewOperationBase,
7873
8464
  type: z2.z.literal("set_side_panel"),
@@ -7883,7 +8474,8 @@ var setSidePanel = defineOperation({
7883
8474
  sidePanel: op.sidePanel ?? void 0
7884
8475
  }
7885
8476
  })),
7886
- focus: (op) => ({ viewId: op.viewId }),
8477
+ focus: viewFocus,
8478
+ presentation: definePresentation(viewFocus, "atomic", () => ["config", "sidePanel"]),
7887
8479
  describe: (op) => op.sidePanel ? "Active le panneau lat\xE9ral" : "Retire le panneau lat\xE9ral"
7888
8480
  });
7889
8481
  var DETAIL_VIEW_OPERATIONS = [
@@ -7893,35 +8485,74 @@ var DETAIL_VIEW_OPERATIONS = [
7893
8485
  reorderTabs,
7894
8486
  addGroup,
7895
8487
  removeGroup,
7896
- setGroupLabel,
8488
+ updateGroup,
7897
8489
  reorderGroups,
7898
8490
  addField,
7899
8491
  removeField,
7900
8492
  moveField,
7901
8493
  updateField,
8494
+ updateTableTab,
8495
+ updateTabConfig,
7902
8496
  setSidePanel
7903
8497
  ];
7904
8498
  var listTabBase = { ...viewOperationBase, tabId: z2.z.string().min(1) };
8499
+ function viewFocus2(op) {
8500
+ return { viewId: op.viewId };
8501
+ }
8502
+ function tabFocus2(op) {
8503
+ return { viewId: op.viewId, tabId: op.tabId };
8504
+ }
8505
+ function addTabFocus2(op) {
8506
+ return { viewId: op.viewId, tabId: op.tab.id };
8507
+ }
8508
+ function firstChangedProperty2(op) {
8509
+ const keys = Object.keys(op.changes).sort();
8510
+ return keys.length === 1 ? [keys[0]] : void 0;
8511
+ }
8512
+ function withoutKanbanKeys(tab) {
8513
+ const rest = { ...tab };
8514
+ for (const key of chunkYZ5RCMIQ_js.LIST_TAB_KANBAN_KEYS) delete rest[key];
8515
+ return rest;
8516
+ }
8517
+ function withoutTableKeys(tab) {
8518
+ const rest = { ...tab };
8519
+ for (const key of chunkYZ5RCMIQ_js.LIST_TAB_TABLE_KEYS) delete rest[key];
8520
+ return rest;
8521
+ }
8522
+ function assertStillPublishableTab(before, after, viewId, tabId) {
8523
+ const parsed = chunkYZ5RCMIQ_js.listViewTabSchema.safeParse(after);
8524
+ if (!parsed.success) {
8525
+ if (!chunkYZ5RCMIQ_js.listViewTabSchema.safeParse(before).success) return after;
8526
+ const detail = parsed.error.issues.map(
8527
+ (issue) => issue.path.length ? `${issue.path.join(".")}: ${issue.message}` : issue.message
8528
+ ).join(", ");
8529
+ throw new chunkV26R64A4_js.ValidationError(
8530
+ `List tab "${tabId}" in view "${viewId}" would no longer be publishable: ${detail}`,
8531
+ []
8532
+ );
8533
+ }
8534
+ return after;
8535
+ }
7905
8536
  function mapListTab(state, viewId, tabId, fn) {
7906
8537
  return mapView(state, viewId, (view) => {
7907
8538
  const tabs = view.config.tabs ?? [];
7908
8539
  if (!tabs.some((t) => t.id === tabId)) {
7909
- throw new chunkHWZRSXFB_js.ValidationError(`List tab "${tabId}" is not in view "${viewId}"`, []);
8540
+ throw new chunkV26R64A4_js.ValidationError(`List tab "${tabId}" is not in view "${viewId}"`, []);
7910
8541
  }
7911
8542
  return {
7912
8543
  ...view,
7913
- config: { ...view.config, tabs: tabs.map((t) => t.id === tabId ? fn(t) : t) }
8544
+ config: {
8545
+ ...view.config,
8546
+ tabs: tabs.map(
8547
+ (t) => t.id === tabId ? assertStillPublishableTab(t, fn(t), viewId, tabId) : t
8548
+ )
8549
+ }
7914
8550
  };
7915
8551
  });
7916
8552
  }
7917
- var listTabPayload = z2.z.custom(
7918
- (value) => typeof value === "object" && value !== null && "id" in value,
7919
- { message: "A list tab must be an object carrying an id" }
7920
- );
7921
- var filterGroupPayload = z2.z.custom(
7922
- (value) => value === null || typeof value === "object"
7923
- );
7924
- var sortRulesPayload = z2.z.custom((value) => Array.isArray(value));
8553
+ var listTabPayload = chunkYZ5RCMIQ_js.listViewTabSchema;
8554
+ var filterGroupPayload = chunkYZ5RCMIQ_js.filterGroupSchema;
8555
+ var sortRulesPayload = chunkYZ5RCMIQ_js.sortsSchema;
7925
8556
  function setOnTab(type, key, valueSchema, describe) {
7926
8557
  const schema = z2.z.object({ ...listTabBase, type: z2.z.literal(type), value: valueSchema });
7927
8558
  return defineOperation({
@@ -7934,7 +8565,8 @@ function setOnTab(type, key, valueSchema, describe) {
7934
8565
  }
7935
8566
  return { ...tab, [key]: op.value };
7936
8567
  }),
7937
- focus: (op) => ({ viewId: op.viewId, tabId: op.tabId }),
8568
+ focus: tabFocus2,
8569
+ presentation: definePresentation(tabFocus2, "atomic", () => [String(key)]),
7938
8570
  describe: (op) => describe(op.value)
7939
8571
  });
7940
8572
  }
@@ -7949,14 +8581,15 @@ var addListTab = defineOperation({
7949
8581
  apply: (state, op) => mapView(state, op.viewId, (view) => {
7950
8582
  const tabs = view.config.tabs ?? [];
7951
8583
  if (tabs.some((t) => t.id === op.tab.id)) {
7952
- throw new chunkHWZRSXFB_js.ValidationError(
8584
+ throw new chunkV26R64A4_js.ValidationError(
7953
8585
  `List tab "${op.tab.id}" already exists in view "${op.viewId}"`,
7954
8586
  []
7955
8587
  );
7956
8588
  }
7957
8589
  return { ...view, config: { ...view.config, tabs: [...tabs, op.tab] } };
7958
8590
  }),
7959
- focus: (op) => ({ viewId: op.viewId, tabId: op.tab.id }),
8591
+ focus: addTabFocus2,
8592
+ presentation: definePresentation(addTabFocus2, "local"),
7960
8593
  describe: (op) => `Ajoute l'onglet \xAB ${op.tab.label} \xBB`
7961
8594
  });
7962
8595
  var removeListTabSchema = z2.z.object({
@@ -7969,14 +8602,15 @@ var removeListTab = defineOperation({
7969
8602
  apply: (state, op) => mapView(state, op.viewId, (view) => {
7970
8603
  const tabs = view.config.tabs ?? [];
7971
8604
  if (!tabs.some((t) => t.id === op.tabId)) {
7972
- throw new chunkHWZRSXFB_js.ValidationError(`List tab "${op.tabId}" is not in view "${op.viewId}"`, []);
8605
+ throw new chunkV26R64A4_js.ValidationError(`List tab "${op.tabId}" is not in view "${op.viewId}"`, []);
7973
8606
  }
7974
8607
  return {
7975
8608
  ...view,
7976
8609
  config: { ...view.config, tabs: tabs.filter((t) => t.id !== op.tabId) }
7977
8610
  };
7978
8611
  }),
7979
- focus: (op) => ({ viewId: op.viewId }),
8612
+ focus: tabFocus2,
8613
+ presentation: definePresentation(tabFocus2, "local"),
7980
8614
  describe: (op) => `Supprime l'onglet ${op.tabId}`
7981
8615
  });
7982
8616
  var updateListTabSchema = z2.z.object({
@@ -7984,16 +8618,21 @@ var updateListTabSchema = z2.z.object({
7984
8618
  type: z2.z.literal("update_list_tab"),
7985
8619
  changes: z2.z.object({
7986
8620
  label: z2.z.string().min(1).optional(),
7987
- icon: z2.z.custom((v) => typeof v === "string" && v.length > 0).optional(),
8621
+ icon: chunkBOICAZHR_js.iconNameSchema.optional(),
7988
8622
  default: z2.z.boolean().optional(),
7989
- visibility: z2.z.enum(chunkTU6ECJFZ_js.LIST_VIEW_TAB_VISIBILITIES).optional()
8623
+ visibility: z2.z.enum(chunkYZ5RCMIQ_js.LIST_VIEW_TAB_VISIBILITIES).optional()
7990
8624
  }).refine((c) => Object.keys(c).length > 0, "update_list_tab needs at least one change")
7991
8625
  });
8626
+ var updateListTabFocus = (op) => ({
8627
+ viewId: op.viewId,
8628
+ tabId: op.tabId
8629
+ });
7992
8630
  var updateListTab = defineOperation({
7993
8631
  type: "update_list_tab",
7994
8632
  schema: updateListTabSchema,
7995
8633
  apply: (state, op) => mapListTab(state, op.viewId, op.tabId, (tab) => ({ ...tab, ...op.changes })),
7996
- focus: (op) => ({ viewId: op.viewId, tabId: op.tabId }),
8634
+ focus: updateListTabFocus,
8635
+ presentation: definePresentation(updateListTabFocus, "atomic", firstChangedProperty2),
7997
8636
  describe: (op) => op.changes.label ? `Renomme l'onglet en \xAB ${op.changes.label} \xBB` : `Modifie l'onglet ${op.tabId}`
7998
8637
  });
7999
8638
  var reorderListTabsSchema = z2.z.object({
@@ -8011,7 +8650,8 @@ var reorderListTabs = defineOperation({
8011
8650
  tabs: reorderById(view.config.tabs ?? [], op.tabOrder, "List tab")
8012
8651
  }
8013
8652
  })),
8014
- focus: (op) => ({ viewId: op.viewId }),
8653
+ focus: viewFocus2,
8654
+ presentation: definePresentation(viewFocus2, "local"),
8015
8655
  describe: () => "R\xE9ordonne les onglets"
8016
8656
  });
8017
8657
  var setColumns = setOnTab(
@@ -8028,18 +8668,47 @@ var setColumnSizing = setOnTab(
8028
8668
  z2.z.record(z2.z.string(), z2.z.number().int().positive()),
8029
8669
  () => "Ajuste la largeur des colonnes"
8030
8670
  );
8031
- var setLayout = setOnTab(
8032
- "set_layout",
8033
- "layout",
8034
- z2.z.enum(["table", "kanban"]),
8035
- (value) => `Passe en affichage ${value}`
8036
- );
8037
- var setGroupBy = setOnTab(
8038
- "set_group_by",
8039
- "groupByAttribute",
8040
- z2.z.string().min(1).nullable(),
8041
- (value) => value ? `Regroupe par ${value}` : "Retire le regroupement"
8042
- );
8671
+ var setLayoutSchema = z2.z.object({
8672
+ ...listTabBase,
8673
+ type: z2.z.literal("set_layout"),
8674
+ value: z2.z.enum(["table", "kanban"])
8675
+ });
8676
+ var setLayout = defineOperation({
8677
+ type: "set_layout",
8678
+ schema: setLayoutSchema,
8679
+ apply: (state, op) => mapListTab(state, op.viewId, op.tabId, (tab) => {
8680
+ if (op.value === "table") return { ...withoutKanbanKeys(tab), layout: "table" };
8681
+ if (tab.groupByAttribute === void 0) {
8682
+ throw new chunkV26R64A4_js.ValidationError(
8683
+ `List tab "${op.tabId}" cannot switch to kanban without a group attribute \u2014 use set_group_by, which switches the layout itself`,
8684
+ []
8685
+ );
8686
+ }
8687
+ return { ...withoutTableKeys(tab), layout: "kanban" };
8688
+ }),
8689
+ focus: tabFocus2,
8690
+ presentation: definePresentation(tabFocus2, "atomic", () => ["layout"]),
8691
+ describe: (op) => `Passe en affichage ${op.value}`
8692
+ });
8693
+ var setGroupBySchema = z2.z.object({
8694
+ ...listTabBase,
8695
+ type: z2.z.literal("set_group_by"),
8696
+ value: z2.z.string().min(1).nullable()
8697
+ });
8698
+ var setGroupBy = defineOperation({
8699
+ type: "set_group_by",
8700
+ schema: setGroupBySchema,
8701
+ apply: (state, op) => mapListTab(
8702
+ state,
8703
+ op.viewId,
8704
+ op.tabId,
8705
+ (tab) => op.value === null ? { ...withoutKanbanKeys(tab), layout: "table" } : { ...withoutTableKeys(tab), layout: "kanban", groupByAttribute: op.value }
8706
+ ),
8707
+ focus: tabFocus2,
8708
+ // The layout flip is a side effect; the addressable property stays the group.
8709
+ presentation: definePresentation(tabFocus2, "atomic", () => ["groupByAttribute"]),
8710
+ describe: (op) => op.value ? `Regroupe par ${op.value} en kanban` : "Retire le regroupement, retour en table"
8711
+ });
8043
8712
  var setFilters = setOnTab(
8044
8713
  "set_filters",
8045
8714
  "filters",
@@ -8076,7 +8745,27 @@ var setCardDateAttribute = setOnTab(
8076
8745
  z2.z.string().min(1).nullable(),
8077
8746
  (value) => value ? `Affiche ${value} sur les cartes` : "Retire la date des cartes"
8078
8747
  );
8748
+ var setDefaultFiltersSchema = z2.z.object({
8749
+ ...viewOperationBase,
8750
+ type: z2.z.literal("set_default_filters"),
8751
+ filters: filterGroupPayload.nullable()
8752
+ });
8753
+ var setDefaultFilters = defineOperation({
8754
+ type: "set_default_filters",
8755
+ schema: setDefaultFiltersSchema,
8756
+ apply: (state, op) => mapView(state, op.viewId, (view) => {
8757
+ if (op.filters === null) {
8758
+ const { defaultFilters: _dropped, ...rest } = view.config;
8759
+ return { ...view, config: rest };
8760
+ }
8761
+ return { ...view, config: { ...view.config, defaultFilters: op.filters } };
8762
+ }),
8763
+ focus: viewFocus2,
8764
+ presentation: definePresentation(viewFocus2, "atomic", () => ["config", "defaultFilters"]),
8765
+ describe: (op) => op.filters ? "Modifie les filtres de la vue" : "Retire les filtres de la vue"
8766
+ });
8079
8767
  var LIST_VIEW_OPERATIONS = [
8768
+ setDefaultFilters,
8080
8769
  addListTab,
8081
8770
  removeListTab,
8082
8771
  updateListTab,
@@ -8094,14 +8783,30 @@ var LIST_VIEW_OPERATIONS = [
8094
8783
  ];
8095
8784
  function requireObject(state, objectId) {
8096
8785
  if (!state.objects.some((o) => o.id === objectId)) {
8097
- throw new chunkHWZRSXFB_js.ValidationError(`Object "${objectId}" is not in the draftable state`, []);
8786
+ throw new chunkV26R64A4_js.ValidationError(`Object "${objectId}" is not in the draftable state`, []);
8098
8787
  }
8099
8788
  }
8100
- var objectOperationBase = { ...operationBase, objectId: z2.z.string().min(1) };
8789
+ function objectFocus(op) {
8790
+ return { objectId: op.objectId };
8791
+ }
8792
+ function recordFocus(op) {
8793
+ return { objectId: op.objectId, recordId: op.recordId };
8794
+ }
8795
+ function attributeFocus(op) {
8796
+ return { objectId: op.objectId, attributeId: op.attributeId };
8797
+ }
8798
+ function firstChangedProperty3(op) {
8799
+ const keys = Object.keys(op.changes).sort();
8800
+ return keys.length === 1 ? [keys[0]] : void 0;
8801
+ }
8802
+ var objectOperationBase = { ...operationBase, objectId: z2.z.string().uuid() };
8101
8803
  var addObjectSchema = z2.z.object({
8102
8804
  ...objectOperationBase,
8103
8805
  type: z2.z.literal("add_object"),
8104
- name: z2.z.string().min(1),
8806
+ // The service's own kebab-case rule, enforced at APPEND: an agent that
8807
+ // names an object "Facture" is refused here with the format spelled out,
8808
+ // not at publish (live QA, 2026-08-17).
8809
+ name: OBJECT_NAME_SCHEMA,
8105
8810
  label: z2.z.string().min(1),
8106
8811
  icon: z2.z.string().min(1).optional()
8107
8812
  });
@@ -8110,10 +8815,10 @@ var addObject = defineOperation({
8110
8815
  schema: addObjectSchema,
8111
8816
  apply: (state, op) => {
8112
8817
  if (state.objects.some((o) => o.name === op.name)) {
8113
- throw new chunkHWZRSXFB_js.ValidationError(`Object "${op.name}" already exists`, []);
8818
+ throw new chunkV26R64A4_js.ValidationError(`Object "${op.name}" already exists`, []);
8114
8819
  }
8115
8820
  if (state.objects.some((o) => o.id === op.objectId)) {
8116
- throw new chunkHWZRSXFB_js.ValidationError(`Object id "${op.objectId}" is already taken`, []);
8821
+ throw new chunkV26R64A4_js.ValidationError(`Object id "${op.objectId}" is already taken`, []);
8117
8822
  }
8118
8823
  const created = {
8119
8824
  id: op.objectId,
@@ -8125,7 +8830,8 @@ var addObject = defineOperation({
8125
8830
  },
8126
8831
  // The caller generates objectId, so a draft object is addressable by route
8127
8832
  // before it exists — that is what lets the app navigate to it live.
8128
- focus: (op) => ({ objectId: op.objectId }),
8833
+ focus: objectFocus,
8834
+ presentation: definePresentation(objectFocus, "structural"),
8129
8835
  describe: (op) => `Cr\xE9e l'objet \xAB ${op.label} \xBB`
8130
8836
  });
8131
8837
  var updateObjectSchema = z2.z.object({
@@ -8133,6 +8839,9 @@ var updateObjectSchema = z2.z.object({
8133
8839
  type: z2.z.literal("update_object"),
8134
8840
  changes: z2.z.object({ label: z2.z.string().min(1).optional(), icon: z2.z.string().min(1).optional() }).refine((c) => Object.keys(c).length > 0, "update_object needs at least one change")
8135
8841
  });
8842
+ var updateObjectFocus = (op) => ({
8843
+ objectId: op.objectId
8844
+ });
8136
8845
  var updateObject = defineOperation({
8137
8846
  type: "update_object",
8138
8847
  schema: updateObjectSchema,
@@ -8143,7 +8852,8 @@ var updateObject = defineOperation({
8143
8852
  objects: state.objects.map((o) => o.id === op.objectId ? { ...o, ...op.changes } : o)
8144
8853
  };
8145
8854
  },
8146
- focus: (op) => ({ objectId: op.objectId }),
8855
+ focus: updateObjectFocus,
8856
+ presentation: definePresentation(updateObjectFocus, "atomic", firstChangedProperty3),
8147
8857
  describe: (op) => op.changes.label ? `Renomme l'objet en \xAB ${op.changes.label} \xBB` : "Modifie l'objet"
8148
8858
  });
8149
8859
  var removeObjectSchema = z2.z.object({ ...objectOperationBase, type: z2.z.literal("remove_object") });
@@ -8152,24 +8862,51 @@ var removeObject = defineOperation({
8152
8862
  schema: removeObjectSchema,
8153
8863
  apply: (state, op) => {
8154
8864
  requireObject(state, op.objectId);
8865
+ const objectName = state.objects.find((o) => o.id === op.objectId)?.name;
8155
8866
  return {
8156
8867
  ...state,
8157
8868
  objects: state.objects.filter((o) => o.id !== op.objectId),
8158
8869
  attributes: state.attributes.filter((a) => a.objectId !== op.objectId),
8159
8870
  sampleRecords: state.sampleRecords.filter((r) => r.objectId !== op.objectId),
8160
- views: state.views.filter((v) => v.objectId !== op.objectId)
8871
+ views: state.views.filter((v) => v.objectName !== objectName)
8161
8872
  };
8162
8873
  },
8163
- focus: () => ({}),
8874
+ focus: objectFocus,
8875
+ presentation: definePresentation(objectFocus, "structural"),
8164
8876
  describe: (op) => `Supprime l'objet ${op.objectId}`
8165
8877
  });
8878
+ var DRAFTABLE_ATTRIBUTE_TYPES = ATTRIBUTE_TYPES.filter(
8879
+ (type) => type !== "formula" && type !== "rollup"
8880
+ );
8166
8881
  var addAttributeSchema = z2.z.object({
8167
8882
  ...objectOperationBase,
8168
8883
  type: z2.z.literal("add_attribute"),
8169
8884
  attributeId: z2.z.string().min(1),
8170
- name: z2.z.string().min(1),
8885
+ // The same identifier rule the attribute builder enforces.
8886
+ name: ATTRIBUTE_NAME_SCHEMA,
8171
8887
  label: z2.z.string().min(1),
8172
- attributeType: z2.z.string().min(1)
8888
+ // The canonical union, not a bare string: an agent that invents "num" gets
8889
+ // refused at APPEND, where the error names the valid types and the one
8890
+ // operation to fix — instead of a whole draft failing at publish.
8891
+ attributeType: z2.z.enum(DRAFTABLE_ATTRIBUTE_TYPES),
8892
+ /** Type-specific configuration, published as-is onto the attribute. */
8893
+ config: z2.z.record(z2.z.string(), z2.z.unknown()).optional()
8894
+ }).superRefine((op, ctx) => {
8895
+ try {
8896
+ chunkBOICAZHR_js.parseAttributeConfigForCreate(op.attributeType, op.config ?? {});
8897
+ } catch (error) {
8898
+ if (error instanceof chunkV26R64A4_js.ValidationError) {
8899
+ for (const detail of error.errors) {
8900
+ ctx.addIssue({
8901
+ code: "custom",
8902
+ message: detail.message,
8903
+ path: ["config", ...detail.path ?? []]
8904
+ });
8905
+ }
8906
+ return;
8907
+ }
8908
+ throw error;
8909
+ }
8173
8910
  });
8174
8911
  var addAttribute = defineOperation({
8175
8912
  type: "add_attribute",
@@ -8177,30 +8914,33 @@ var addAttribute = defineOperation({
8177
8914
  apply: (state, op) => {
8178
8915
  requireObject(state, op.objectId);
8179
8916
  if (state.attributes.some((a) => a.objectId === op.objectId && a.name === op.name)) {
8180
- throw new chunkHWZRSXFB_js.ValidationError(
8917
+ throw new chunkV26R64A4_js.ValidationError(
8181
8918
  `Attribute "${op.name}" already exists on object "${op.objectId}"`,
8182
8919
  []
8183
8920
  );
8184
8921
  }
8922
+ const added = {
8923
+ id: op.attributeId,
8924
+ objectId: op.objectId,
8925
+ name: op.name,
8926
+ label: op.label,
8927
+ attributeType: op.attributeType,
8928
+ ...op.config === void 0 ? {} : { config: op.config }
8929
+ };
8930
+ for (const sample of state.sampleRecords) {
8931
+ if (sample.objectId === op.objectId) assertRequiredCovered(sample.id, added, sample.values);
8932
+ }
8185
8933
  return {
8186
8934
  ...state,
8187
- attributes: [
8188
- ...state.attributes,
8189
- {
8190
- id: op.attributeId,
8191
- objectId: op.objectId,
8192
- name: op.name,
8193
- label: op.label,
8194
- attributeType: op.attributeType
8195
- }
8196
- ]
8935
+ attributes: [...state.attributes, added]
8197
8936
  };
8198
8937
  },
8199
- focus: (op) => ({ objectId: op.objectId }),
8938
+ focus: attributeFocus,
8939
+ presentation: definePresentation(attributeFocus, "local"),
8200
8940
  describe: (op) => `Ajoute l'attribut \xAB ${op.label} \xBB`
8201
8941
  });
8202
8942
  var updateAttributeSchema = z2.z.object({
8203
- ...operationBase,
8943
+ ...objectOperationBase,
8204
8944
  type: z2.z.literal("update_attribute"),
8205
8945
  attributeId: z2.z.string().min(1),
8206
8946
  changes: z2.z.object({ label: z2.z.string().min(1).optional() }).refine((c) => Object.keys(c).length > 0, "update_attribute needs at least one change")
@@ -8210,7 +8950,7 @@ var updateAttribute = defineOperation({
8210
8950
  schema: updateAttributeSchema,
8211
8951
  apply: (state, op) => {
8212
8952
  if (!state.attributes.some((a) => a.id === op.attributeId)) {
8213
- throw new chunkHWZRSXFB_js.ValidationError(`Attribute "${op.attributeId}" is not in the draftable state`, []);
8953
+ throw new chunkV26R64A4_js.ValidationError(`Attribute "${op.attributeId}" is not in the draftable state`, []);
8214
8954
  }
8215
8955
  return {
8216
8956
  ...state,
@@ -8219,11 +8959,15 @@ var updateAttribute = defineOperation({
8219
8959
  )
8220
8960
  };
8221
8961
  },
8222
- focus: () => ({}),
8962
+ // Carries objectId so the scope can load the attribute's parent. Without it
8963
+ // the reader returns an empty state and the fold rejects the operation before
8964
+ // the draft is ever persisted — renaming an existing field was impossible.
8965
+ focus: attributeFocus,
8966
+ presentation: definePresentation(attributeFocus, "atomic"),
8223
8967
  describe: (op) => op.changes.label ? `Renomme l'attribut en \xAB ${op.changes.label} \xBB` : "Modifie l'attribut"
8224
8968
  });
8225
8969
  var removeAttributeSchema = z2.z.object({
8226
- ...operationBase,
8970
+ ...objectOperationBase,
8227
8971
  type: z2.z.literal("remove_attribute"),
8228
8972
  attributeId: z2.z.string().min(1)
8229
8973
  });
@@ -8231,18 +8975,62 @@ var removeAttribute = defineOperation({
8231
8975
  type: "remove_attribute",
8232
8976
  schema: removeAttributeSchema,
8233
8977
  apply: (state, op) => {
8234
- if (!state.attributes.some((a) => a.id === op.attributeId)) {
8235
- throw new chunkHWZRSXFB_js.ValidationError(`Attribute "${op.attributeId}" is not in the draftable state`, []);
8978
+ const removed = state.attributes.find((a) => a.id === op.attributeId);
8979
+ if (!removed) {
8980
+ throw new chunkV26R64A4_js.ValidationError(`Attribute "${op.attributeId}" is not in the draftable state`, []);
8981
+ }
8982
+ const user2 = state.sampleRecords.find(
8983
+ (r) => r.objectId === removed.objectId && removed.name in r.values
8984
+ );
8985
+ if (user2) {
8986
+ throw new chunkV26R64A4_js.ValidationError(
8987
+ `Attribute "${removed.name}" is still used by sample record "${user2.id}"`,
8988
+ []
8989
+ );
8236
8990
  }
8237
8991
  return { ...state, attributes: state.attributes.filter((a) => a.id !== op.attributeId) };
8238
8992
  },
8239
- focus: () => ({}),
8993
+ // Same reason as update_attribute: the parent object must be in scope.
8994
+ focus: attributeFocus,
8995
+ presentation: definePresentation(attributeFocus, "local"),
8240
8996
  describe: (op) => `Supprime l'attribut ${op.attributeId}`
8241
8997
  });
8998
+ function assertSampleValue(recordId, key, attribute, value) {
8999
+ const reconstructed = {
9000
+ id: attribute.id,
9001
+ name: attribute.name,
9002
+ label: attribute.label,
9003
+ type: attribute.attributeType,
9004
+ ...attribute.config
9005
+ };
9006
+ try {
9007
+ chunkI3EYILYO_js.createAttributeValidator(reconstructed);
9008
+ } catch {
9009
+ return;
9010
+ }
9011
+ const result = chunkI3EYILYO_js.validateAttribute(reconstructed, value);
9012
+ if (result.success) return;
9013
+ const errors = result.errors ?? [];
9014
+ const detail = errors.map((error) => error.message).join(", ");
9015
+ throw new chunkV26R64A4_js.ValidationError(
9016
+ `Sample record "${recordId}" has an invalid value for "${key}": ${detail}`,
9017
+ errors.map((error) => ({ path: error.path, message: error.message }))
9018
+ );
9019
+ }
9020
+ function assertRequiredCovered(recordId, attribute, values) {
9021
+ if (attribute.config?.required !== true) return;
9022
+ if (attribute.config?.defaultValue !== void 0) return;
9023
+ if (attribute.name in values && values[attribute.name] !== void 0) return;
9024
+ throw new chunkV26R64A4_js.ValidationError(
9025
+ `Sample record "${recordId}" is missing a value for required attribute "${attribute.name}"`,
9026
+ []
9027
+ );
9028
+ }
8242
9029
  var addSampleRecordSchema = z2.z.object({
8243
9030
  ...objectOperationBase,
8244
9031
  type: z2.z.literal("add_sample_record"),
8245
- recordId: z2.z.string().min(1),
9032
+ // Same rule as objectId: publish inserts it, so it must be a UUID.
9033
+ recordId: z2.z.string().uuid(),
8246
9034
  values: z2.z.record(z2.z.string(), z2.z.unknown())
8247
9035
  });
8248
9036
  var addSampleRecord = defineOperation({
@@ -8251,7 +9039,23 @@ var addSampleRecord = defineOperation({
8251
9039
  apply: (state, op) => {
8252
9040
  requireObject(state, op.objectId);
8253
9041
  if (state.sampleRecords.some((r) => r.id === op.recordId)) {
8254
- throw new chunkHWZRSXFB_js.ValidationError(`Sample record "${op.recordId}" already exists`, []);
9042
+ throw new chunkV26R64A4_js.ValidationError(`Sample record "${op.recordId}" already exists`, []);
9043
+ }
9044
+ const known = new Map(
9045
+ state.attributes.filter((a) => a.objectId === op.objectId).map((a) => [a.name, a])
9046
+ );
9047
+ for (const [key, value] of Object.entries(op.values)) {
9048
+ const attribute = known.get(key);
9049
+ if (!attribute) {
9050
+ throw new chunkV26R64A4_js.ValidationError(
9051
+ `Sample record "${op.recordId}" uses unknown attribute "${key}"`,
9052
+ []
9053
+ );
9054
+ }
9055
+ assertSampleValue(op.recordId, key, attribute, value);
9056
+ }
9057
+ for (const attribute of known.values()) {
9058
+ assertRequiredCovered(op.recordId, attribute, op.values);
8255
9059
  }
8256
9060
  return {
8257
9061
  ...state,
@@ -8263,11 +9067,12 @@ var addSampleRecord = defineOperation({
8263
9067
  },
8264
9068
  // A sample is a draft record, not a render-time fiction: publishing
8265
9069
  // materialises it, discarding the draft discards it.
8266
- focus: (op) => ({ objectId: op.objectId, recordId: op.recordId }),
9070
+ focus: recordFocus,
9071
+ presentation: definePresentation(recordFocus, "local"),
8267
9072
  describe: () => "Ajoute un exemple"
8268
9073
  });
8269
9074
  var removeSampleRecordSchema = z2.z.object({
8270
- ...operationBase,
9075
+ ...objectOperationBase,
8271
9076
  type: z2.z.literal("remove_sample_record"),
8272
9077
  recordId: z2.z.string().min(1)
8273
9078
  });
@@ -8275,12 +9080,16 @@ var removeSampleRecord = defineOperation({
8275
9080
  type: "remove_sample_record",
8276
9081
  schema: removeSampleRecordSchema,
8277
9082
  apply: (state, op) => {
8278
- if (!state.sampleRecords.some((r) => r.id === op.recordId)) {
8279
- throw new chunkHWZRSXFB_js.ValidationError(`Sample record "${op.recordId}" is not in the draft`, []);
9083
+ if (!state.sampleRecords.some((r) => r.id === op.recordId && r.objectId === op.objectId)) {
9084
+ throw new chunkV26R64A4_js.ValidationError(
9085
+ `Sample record "${op.recordId}" is not in object "${op.objectId}"`,
9086
+ []
9087
+ );
8280
9088
  }
8281
9089
  return { ...state, sampleRecords: state.sampleRecords.filter((r) => r.id !== op.recordId) };
8282
9090
  },
8283
- focus: () => ({}),
9091
+ focus: recordFocus,
9092
+ presentation: definePresentation(recordFocus, "local"),
8284
9093
  describe: () => "Retire un exemple"
8285
9094
  });
8286
9095
  var SCHEMA_OPERATIONS = [
@@ -8303,7 +9112,7 @@ function build() {
8303
9112
  ...LIST_VIEW_OPERATIONS
8304
9113
  ]) {
8305
9114
  if (map.has(definition.type)) {
8306
- throw new chunkHWZRSXFB_js.DuplicateError("architect operation", definition.type);
9115
+ throw new chunkV26R64A4_js.DuplicateError("architect operation", definition.type);
8307
9116
  }
8308
9117
  map.set(definition.type, definition);
8309
9118
  }
@@ -8316,7 +9125,7 @@ var ALL_OPERATION_TYPES = [...OPERATION_REGISTRY.keys()];
8316
9125
  function defOf(operation) {
8317
9126
  const definition = OPERATION_REGISTRY.get(operation.type);
8318
9127
  if (!definition) {
8319
- throw new chunkHWZRSXFB_js.ValidationError(
9128
+ throw new chunkV26R64A4_js.ValidationError(
8320
9129
  `Operation "${operation.id}" has unknown type "${operation.type}"`,
8321
9130
  []
8322
9131
  );
@@ -8337,25 +9146,45 @@ function describeOperations(operations, ctx) {
8337
9146
  }
8338
9147
  function parseOperation(candidate) {
8339
9148
  if (typeof candidate !== "object" || candidate === null || !("type" in candidate)) {
8340
- throw new chunkHWZRSXFB_js.ValidationError("An operation must be an object carrying a type", []);
9149
+ throw new chunkV26R64A4_js.ValidationError("An operation must be an object carrying a type", []);
8341
9150
  }
8342
9151
  const type = candidate.type;
8343
9152
  if (typeof type !== "string") {
8344
- throw new chunkHWZRSXFB_js.ValidationError("An operation's type must be a string", []);
9153
+ throw new chunkV26R64A4_js.ValidationError("An operation's type must be a string", []);
8345
9154
  }
8346
9155
  const definition = OPERATION_REGISTRY.get(type);
8347
9156
  if (!definition) {
8348
- throw new chunkHWZRSXFB_js.ValidationError(`Unknown operation type "${type}"`, []);
9157
+ throw new chunkV26R64A4_js.ValidationError(`Unknown operation type "${type}"`, []);
8349
9158
  }
8350
9159
  const parsed = definition.schema.safeParse(candidate);
8351
9160
  if (!parsed.success) {
8352
- throw new chunkHWZRSXFB_js.ValidationError(
9161
+ throw new chunkV26R64A4_js.ValidationError(
8353
9162
  `Operation "${type}" is invalid: ${parsed.error.issues.map((i) => `${i.path.join(".")} ${i.message}`).join("; ")}`,
8354
9163
  []
8355
9164
  );
8356
9165
  }
8357
9166
  return parsed.data;
8358
9167
  }
9168
+ function toJsonSchema(schema) {
9169
+ return z2.z.toJSONSchema(schema, { io: "input" });
9170
+ }
9171
+ function describeOperationInput(type) {
9172
+ const definition = OPERATION_REGISTRY.get(type);
9173
+ if (!definition) {
9174
+ throw new chunkV26R64A4_js.ValidationError(`Unknown operation type "${type}"`, []);
9175
+ }
9176
+ return toJsonSchema(definition.schema);
9177
+ }
9178
+ function describeAttributeConfig(type) {
9179
+ const draftable = DRAFTABLE_ATTRIBUTE_TYPES.find((candidate) => candidate === type);
9180
+ if (!draftable) {
9181
+ throw new chunkV26R64A4_js.ValidationError(`Unknown attribute type "${type}"`, []);
9182
+ }
9183
+ return toJsonSchema(chunkBOICAZHR_js.getAttributeConfigWriteSchema(draftable));
9184
+ }
9185
+ function listDescribableNames() {
9186
+ return { operations: [...ALL_OPERATION_TYPES], attributeTypes: [...DRAFTABLE_ATTRIBUTE_TYPES] };
9187
+ }
8359
9188
 
8360
9189
  // src/architect/field-ids.ts
8361
9190
  function makeFieldId(groupId, seed, collisionIndex) {
@@ -8384,329 +9213,492 @@ function ensureFieldIds(tabs) {
8384
9213
  );
8385
9214
  }
8386
9215
 
9216
+ // src/architect/presentation.ts
9217
+ function presentationOf(operation) {
9218
+ return defOf(operation).presentation(operation);
9219
+ }
9220
+ function episodeImpactOf(operations) {
9221
+ const presentations = operations.map(presentationOf);
9222
+ const roots = new Set(
9223
+ presentations.map(({ focus }) => focus.viewId ?? focus.objectId).filter((root) => root !== void 0)
9224
+ );
9225
+ if (roots.size > 1) return "structural";
9226
+ if (presentations.some(({ impact }) => impact === "structural")) return "structural";
9227
+ if (presentations.some(({ impact }) => impact === "local")) return "local";
9228
+ return "atomic";
9229
+ }
9230
+ function listTabOf(view, tabId) {
9231
+ return view.config.tabs?.find((tab) => tab.id === tabId);
9232
+ }
9233
+ function snapshotArchitectTarget(state, focus) {
9234
+ const view = focus.viewId ? state.views.find((candidate) => candidate.id === focus.viewId) : void 0;
9235
+ const detailTab = focus.tabId ? view?.tabs.find((candidate) => candidate.id === focus.tabId) : void 0;
9236
+ if (focus.attributeId) {
9237
+ return state.attributes.find((attribute) => attribute.id === focus.attributeId);
9238
+ }
9239
+ if (focus.fieldId) {
9240
+ if (detailTab?.type !== "form") return void 0;
9241
+ for (const group2 of detailTab.groups) {
9242
+ const field = group2.fields.find((candidate) => candidate.id === focus.fieldId);
9243
+ if (field) return field;
9244
+ }
9245
+ return void 0;
9246
+ }
9247
+ if (focus.groupId) {
9248
+ if (detailTab?.type !== "form") return void 0;
9249
+ return detailTab.groups.find((candidate) => candidate.id === focus.groupId);
9250
+ }
9251
+ if (focus.tabId) {
9252
+ if (!view) return void 0;
9253
+ return detailTab ?? listTabOf(view, focus.tabId);
9254
+ }
9255
+ if (focus.recordId) {
9256
+ return state.sampleRecords.find((record) => record.id === focus.recordId);
9257
+ }
9258
+ if (view) return view;
9259
+ if (focus.objectId) {
9260
+ return state.objects.find((object2) => object2.id === focus.objectId);
9261
+ }
9262
+ return void 0;
9263
+ }
9264
+ function deriveArchitectChanges(initial, operations) {
9265
+ let state = initial;
9266
+ return operations.map((operation) => {
9267
+ const presentation = presentationOf(operation);
9268
+ const before = snapshotArchitectTarget(state, presentation.focus);
9269
+ state = applyOperations(state, [operation]);
9270
+ const after = snapshotArchitectTarget(state, presentation.focus);
9271
+ return {
9272
+ operationId: operation.id,
9273
+ operationType: operation.type,
9274
+ presentation,
9275
+ before,
9276
+ after
9277
+ };
9278
+ });
9279
+ }
9280
+
9281
+ // src/architect/object-projection.ts
9282
+ function toDraftableObject(object2) {
9283
+ return {
9284
+ id: object2.id ?? object2.name,
9285
+ name: object2.name,
9286
+ label: object2.label,
9287
+ ...object2.icon === void 0 ? {} : { icon: object2.icon }
9288
+ };
9289
+ }
9290
+ function toDraftableAttributes(object2) {
9291
+ const objectId = object2.id ?? object2.name;
9292
+ return (object2.attributes ?? []).map((attribute) => toDraftableAttribute(attribute, objectId));
9293
+ }
9294
+ function toDraftableAttribute(attribute, objectId) {
9295
+ const { id: _id, name: _name, label: _label, type: _type, ...config } = attribute;
9296
+ return {
9297
+ id: attribute.id ?? attribute.name,
9298
+ objectId,
9299
+ name: attribute.name,
9300
+ label: attribute.label ?? attribute.name,
9301
+ attributeType: attribute.type,
9302
+ config
9303
+ };
9304
+ }
9305
+
9306
+ // src/architect/view-projection.ts
9307
+ function toDraftableView(view) {
9308
+ return {
9309
+ id: view.id ?? "",
9310
+ objectName: view.object,
9311
+ type: view.type,
9312
+ label: view.label,
9313
+ tabs: isDetailView(view) ? view.config.tabs ?? [] : [],
9314
+ config: view.config
9315
+ };
9316
+ }
9317
+ function fromDraftableView(original, drafted) {
9318
+ if (original.type === "detail") {
9319
+ return {
9320
+ ...original,
9321
+ label: drafted.label,
9322
+ config: {
9323
+ ...drafted.config,
9324
+ tabs: drafted.tabs
9325
+ }
9326
+ };
9327
+ }
9328
+ return {
9329
+ ...original,
9330
+ label: drafted.label,
9331
+ config: drafted.config
9332
+ };
9333
+ }
9334
+
8387
9335
  Object.defineProperty(exports, "asTenantId", {
8388
9336
  enumerable: true,
8389
- get: function () { return chunkOYHBQMC7_js.asTenantId; }
9337
+ get: function () { return chunkK6ET4CXP_js.asTenantId; }
8390
9338
  });
8391
9339
  Object.defineProperty(exports, "asUserId", {
8392
9340
  enumerable: true,
8393
- get: function () { return chunkOYHBQMC7_js.asUserId; }
9341
+ get: function () { return chunkK6ET4CXP_js.asUserId; }
8394
9342
  });
8395
9343
  Object.defineProperty(exports, "canonicalStringify", {
8396
9344
  enumerable: true,
8397
- get: function () { return chunkOYHBQMC7_js.canonicalStringify; }
9345
+ get: function () { return chunkK6ET4CXP_js.canonicalStringify; }
8398
9346
  });
8399
9347
  Object.defineProperty(exports, "deepEqual", {
8400
9348
  enumerable: true,
8401
- get: function () { return chunkOYHBQMC7_js.deepEqual; }
9349
+ get: function () { return chunkK6ET4CXP_js.deepEqual; }
8402
9350
  });
8403
9351
  Object.defineProperty(exports, "generateId", {
8404
9352
  enumerable: true,
8405
- get: function () { return chunkOYHBQMC7_js.generateId; }
9353
+ get: function () { return chunkK6ET4CXP_js.generateId; }
8406
9354
  });
8407
9355
  Object.defineProperty(exports, "indexBy", {
8408
9356
  enumerable: true,
8409
- get: function () { return chunkOYHBQMC7_js.indexBy; }
9357
+ get: function () { return chunkK6ET4CXP_js.indexBy; }
8410
9358
  });
8411
9359
  Object.defineProperty(exports, "ATTRIBUTE_FILTER_OPERATORS", {
8412
9360
  enumerable: true,
8413
- get: function () { return chunkTU6ECJFZ_js.ATTRIBUTE_FILTER_OPERATORS; }
9361
+ get: function () { return chunkYZ5RCMIQ_js.ATTRIBUTE_FILTER_OPERATORS; }
9362
+ });
9363
+ Object.defineProperty(exports, "LIST_TAB_KANBAN_KEYS", {
9364
+ enumerable: true,
9365
+ get: function () { return chunkYZ5RCMIQ_js.LIST_TAB_KANBAN_KEYS; }
9366
+ });
9367
+ Object.defineProperty(exports, "LIST_TAB_TABLE_KEYS", {
9368
+ enumerable: true,
9369
+ get: function () { return chunkYZ5RCMIQ_js.LIST_TAB_TABLE_KEYS; }
8414
9370
  });
8415
9371
  Object.defineProperty(exports, "LIST_VIEW_TAB_VISIBILITIES", {
8416
9372
  enumerable: true,
8417
- get: function () { return chunkTU6ECJFZ_js.LIST_VIEW_TAB_VISIBILITIES; }
9373
+ get: function () { return chunkYZ5RCMIQ_js.LIST_VIEW_TAB_VISIBILITIES; }
8418
9374
  });
8419
9375
  Object.defineProperty(exports, "NO_VALUE_OPERATORS", {
8420
9376
  enumerable: true,
8421
- get: function () { return chunkTU6ECJFZ_js.NO_VALUE_OPERATORS; }
9377
+ get: function () { return chunkYZ5RCMIQ_js.NO_VALUE_OPERATORS; }
8422
9378
  });
8423
9379
  Object.defineProperty(exports, "OPERATORS_BY_TYPE", {
8424
9380
  enumerable: true,
8425
- get: function () { return chunkTU6ECJFZ_js.OPERATORS_BY_TYPE; }
9381
+ get: function () { return chunkYZ5RCMIQ_js.OPERATORS_BY_TYPE; }
8426
9382
  });
8427
9383
  Object.defineProperty(exports, "REMOVED_OPERATOR_REPLACEMENTS", {
8428
9384
  enumerable: true,
8429
- get: function () { return chunkTU6ECJFZ_js.REMOVED_OPERATOR_REPLACEMENTS; }
9385
+ get: function () { return chunkYZ5RCMIQ_js.REMOVED_OPERATOR_REPLACEMENTS; }
8430
9386
  });
8431
9387
  Object.defineProperty(exports, "RESERVED_ATTRIBUTE_NAMES", {
8432
9388
  enumerable: true,
8433
- get: function () { return chunkTU6ECJFZ_js.RESERVED_ATTRIBUTE_NAMES; }
9389
+ get: function () { return chunkYZ5RCMIQ_js.RESERVED_ATTRIBUTE_NAMES; }
8434
9390
  });
8435
9391
  Object.defineProperty(exports, "RESERVED_OBJECT_NAMES", {
8436
9392
  enumerable: true,
8437
- get: function () { return chunkTU6ECJFZ_js.RESERVED_OBJECT_NAMES; }
9393
+ get: function () { return chunkYZ5RCMIQ_js.RESERVED_OBJECT_NAMES; }
8438
9394
  });
8439
9395
  Object.defineProperty(exports, "RESOURCE_VISIBILITIES", {
8440
9396
  enumerable: true,
8441
- get: function () { return chunkTU6ECJFZ_js.RESOURCE_VISIBILITIES; }
9397
+ get: function () { return chunkYZ5RCMIQ_js.RESOURCE_VISIBILITIES; }
8442
9398
  });
8443
9399
  Object.defineProperty(exports, "SYNONYM_ALIASES", {
8444
9400
  enumerable: true,
8445
- get: function () { return chunkTU6ECJFZ_js.SYNONYM_ALIASES; }
9401
+ get: function () { return chunkYZ5RCMIQ_js.SYNONYM_ALIASES; }
8446
9402
  });
8447
9403
  Object.defineProperty(exports, "SYSTEM_ATTRIBUTES", {
8448
9404
  enumerable: true,
8449
- get: function () { return chunkTU6ECJFZ_js.SYSTEM_ATTRIBUTES; }
9405
+ get: function () { return chunkYZ5RCMIQ_js.SYSTEM_ATTRIBUTES; }
8450
9406
  });
8451
9407
  Object.defineProperty(exports, "SYSTEM_ATTRIBUTE_I18N_KEYS", {
8452
9408
  enumerable: true,
8453
- get: function () { return chunkTU6ECJFZ_js.SYSTEM_ATTRIBUTE_I18N_KEYS; }
9409
+ get: function () { return chunkYZ5RCMIQ_js.SYSTEM_ATTRIBUTE_I18N_KEYS; }
8454
9410
  });
8455
9411
  Object.defineProperty(exports, "SYSTEM_FIELD_NAMES", {
8456
9412
  enumerable: true,
8457
- get: function () { return chunkTU6ECJFZ_js.SYSTEM_FIELD_NAMES; }
9413
+ get: function () { return chunkYZ5RCMIQ_js.SYSTEM_FIELD_NAMES; }
8458
9414
  });
8459
9415
  Object.defineProperty(exports, "SYSTEM_FILTER_ATTRIBUTE_TYPES", {
8460
9416
  enumerable: true,
8461
- get: function () { return chunkTU6ECJFZ_js.SYSTEM_FILTER_ATTRIBUTE_TYPES; }
9417
+ get: function () { return chunkYZ5RCMIQ_js.SYSTEM_FILTER_ATTRIBUTE_TYPES; }
8462
9418
  });
8463
9419
  Object.defineProperty(exports, "canonicalizeFilterValue", {
8464
9420
  enumerable: true,
8465
- get: function () { return chunkTU6ECJFZ_js.canonicalizeFilterValue; }
9421
+ get: function () { return chunkYZ5RCMIQ_js.canonicalizeFilterValue; }
8466
9422
  });
8467
9423
  Object.defineProperty(exports, "collectQualifiedRuleIssues", {
8468
9424
  enumerable: true,
8469
- get: function () { return chunkTU6ECJFZ_js.collectQualifiedRuleIssues; }
9425
+ get: function () { return chunkYZ5RCMIQ_js.collectQualifiedRuleIssues; }
9426
+ });
9427
+ Object.defineProperty(exports, "columnsSchema", {
9428
+ enumerable: true,
9429
+ get: function () { return chunkYZ5RCMIQ_js.columnsSchema; }
8470
9430
  });
8471
9431
  Object.defineProperty(exports, "currentActor", {
8472
9432
  enumerable: true,
8473
- get: function () { return chunkTU6ECJFZ_js.currentActor; }
9433
+ get: function () { return chunkYZ5RCMIQ_js.currentActor; }
9434
+ });
9435
+ Object.defineProperty(exports, "detailTabDraftSchema", {
9436
+ enumerable: true,
9437
+ get: function () { return chunkYZ5RCMIQ_js.detailTabDraftSchema; }
8474
9438
  });
8475
9439
  Object.defineProperty(exports, "detailTabSchema", {
8476
9440
  enumerable: true,
8477
- get: function () { return chunkTU6ECJFZ_js.detailTabSchema; }
9441
+ get: function () { return chunkYZ5RCMIQ_js.detailTabSchema; }
8478
9442
  });
8479
9443
  Object.defineProperty(exports, "detailViewConfigSchema", {
8480
9444
  enumerable: true,
8481
- get: function () { return chunkTU6ECJFZ_js.detailViewConfigSchema; }
9445
+ get: function () { return chunkYZ5RCMIQ_js.detailViewConfigSchema; }
8482
9446
  });
8483
9447
  Object.defineProperty(exports, "extractCurrencyFilterValue", {
8484
9448
  enumerable: true,
8485
- get: function () { return chunkTU6ECJFZ_js.extractCurrencyFilterValue; }
9449
+ get: function () { return chunkYZ5RCMIQ_js.extractCurrencyFilterValue; }
8486
9450
  });
8487
9451
  Object.defineProperty(exports, "extractFilterValue", {
8488
9452
  enumerable: true,
8489
- get: function () { return chunkTU6ECJFZ_js.extractFilterValue; }
9453
+ get: function () { return chunkYZ5RCMIQ_js.extractFilterValue; }
9454
+ });
9455
+ Object.defineProperty(exports, "fieldSchema", {
9456
+ enumerable: true,
9457
+ get: function () { return chunkYZ5RCMIQ_js.fieldSchema; }
9458
+ });
9459
+ Object.defineProperty(exports, "fieldShape", {
9460
+ enumerable: true,
9461
+ get: function () { return chunkYZ5RCMIQ_js.fieldShape; }
9462
+ });
9463
+ Object.defineProperty(exports, "fieldSlotSchema", {
9464
+ enumerable: true,
9465
+ get: function () { return chunkYZ5RCMIQ_js.fieldSlotSchema; }
9466
+ });
9467
+ Object.defineProperty(exports, "filterGroupSchema", {
9468
+ enumerable: true,
9469
+ get: function () { return chunkYZ5RCMIQ_js.filterGroupSchema; }
9470
+ });
9471
+ Object.defineProperty(exports, "filterStateSchema", {
9472
+ enumerable: true,
9473
+ get: function () { return chunkYZ5RCMIQ_js.filterStateSchema; }
8490
9474
  });
8491
9475
  Object.defineProperty(exports, "getAttributeCapabilities", {
8492
9476
  enumerable: true,
8493
- get: function () { return chunkTU6ECJFZ_js.getAttributeCapabilities; }
9477
+ get: function () { return chunkYZ5RCMIQ_js.getAttributeCapabilities; }
8494
9478
  });
8495
9479
  Object.defineProperty(exports, "getAttributeFilterOperators", {
8496
9480
  enumerable: true,
8497
- get: function () { return chunkTU6ECJFZ_js.getAttributeFilterOperators; }
9481
+ get: function () { return chunkYZ5RCMIQ_js.getAttributeFilterOperators; }
8498
9482
  });
8499
9483
  Object.defineProperty(exports, "getOperatorPolarity", {
8500
9484
  enumerable: true,
8501
- get: function () { return chunkTU6ECJFZ_js.getOperatorPolarity; }
9485
+ get: function () { return chunkYZ5RCMIQ_js.getOperatorPolarity; }
8502
9486
  });
8503
9487
  Object.defineProperty(exports, "getRollupFilterOperators", {
8504
9488
  enumerable: true,
8505
- get: function () { return chunkTU6ECJFZ_js.getRollupFilterOperators; }
9489
+ get: function () { return chunkYZ5RCMIQ_js.getRollupFilterOperators; }
8506
9490
  });
8507
9491
  Object.defineProperty(exports, "getSystemAttributeI18nKey", {
8508
9492
  enumerable: true,
8509
- get: function () { return chunkTU6ECJFZ_js.getSystemAttributeI18nKey; }
9493
+ get: function () { return chunkYZ5RCMIQ_js.getSystemAttributeI18nKey; }
8510
9494
  });
8511
9495
  Object.defineProperty(exports, "getSystemAttributeList", {
8512
9496
  enumerable: true,
8513
- get: function () { return chunkTU6ECJFZ_js.getSystemAttributeList; }
9497
+ get: function () { return chunkYZ5RCMIQ_js.getSystemAttributeList; }
9498
+ });
9499
+ Object.defineProperty(exports, "groupWriteSchema", {
9500
+ enumerable: true,
9501
+ get: function () { return chunkYZ5RCMIQ_js.groupWriteSchema; }
8514
9502
  });
8515
9503
  Object.defineProperty(exports, "inverseSourceSchema", {
8516
9504
  enumerable: true,
8517
- get: function () { return chunkTU6ECJFZ_js.inverseSourceSchema; }
9505
+ get: function () { return chunkYZ5RCMIQ_js.inverseSourceSchema; }
8518
9506
  });
8519
9507
  Object.defineProperty(exports, "isAttributeFilterable", {
8520
9508
  enumerable: true,
8521
- get: function () { return chunkTU6ECJFZ_js.isAttributeFilterable; }
9509
+ get: function () { return chunkYZ5RCMIQ_js.isAttributeFilterable; }
8522
9510
  });
8523
9511
  Object.defineProperty(exports, "isAttributeGroupable", {
8524
9512
  enumerable: true,
8525
- get: function () { return chunkTU6ECJFZ_js.isAttributeGroupable; }
9513
+ get: function () { return chunkYZ5RCMIQ_js.isAttributeGroupable; }
8526
9514
  });
8527
9515
  Object.defineProperty(exports, "isAttributeKanbanGroupable", {
8528
9516
  enumerable: true,
8529
- get: function () { return chunkTU6ECJFZ_js.isAttributeKanbanGroupable; }
9517
+ get: function () { return chunkYZ5RCMIQ_js.isAttributeKanbanGroupable; }
8530
9518
  });
8531
9519
  Object.defineProperty(exports, "isAttributeSearchable", {
8532
9520
  enumerable: true,
8533
- get: function () { return chunkTU6ECJFZ_js.isAttributeSearchable; }
9521
+ get: function () { return chunkYZ5RCMIQ_js.isAttributeSearchable; }
8534
9522
  });
8535
9523
  Object.defineProperty(exports, "isDynamicValue", {
8536
9524
  enumerable: true,
8537
- get: function () { return chunkTU6ECJFZ_js.isDynamicValue; }
9525
+ get: function () { return chunkYZ5RCMIQ_js.isDynamicValue; }
8538
9526
  });
8539
9527
  Object.defineProperty(exports, "isManagedSystemAttribute", {
8540
9528
  enumerable: true,
8541
- get: function () { return chunkTU6ECJFZ_js.isManagedSystemAttribute; }
9529
+ get: function () { return chunkYZ5RCMIQ_js.isManagedSystemAttribute; }
8542
9530
  });
8543
9531
  Object.defineProperty(exports, "isNoValueOperator", {
8544
9532
  enumerable: true,
8545
- get: function () { return chunkTU6ECJFZ_js.isNoValueOperator; }
9533
+ get: function () { return chunkYZ5RCMIQ_js.isNoValueOperator; }
8546
9534
  });
8547
9535
  Object.defineProperty(exports, "isRelativeDateValue", {
8548
9536
  enumerable: true,
8549
- get: function () { return chunkTU6ECJFZ_js.isRelativeDateValue; }
9537
+ get: function () { return chunkYZ5RCMIQ_js.isRelativeDateValue; }
8550
9538
  });
8551
9539
  Object.defineProperty(exports, "isSetMembershipOperator", {
8552
9540
  enumerable: true,
8553
- get: function () { return chunkTU6ECJFZ_js.isSetMembershipOperator; }
9541
+ get: function () { return chunkYZ5RCMIQ_js.isSetMembershipOperator; }
8554
9542
  });
8555
9543
  Object.defineProperty(exports, "listViewConfigSchema", {
8556
9544
  enumerable: true,
8557
- get: function () { return chunkTU6ECJFZ_js.listViewConfigSchema; }
9545
+ get: function () { return chunkYZ5RCMIQ_js.listViewConfigSchema; }
8558
9546
  });
8559
9547
  Object.defineProperty(exports, "listViewTabSchema", {
8560
9548
  enumerable: true,
8561
- get: function () { return chunkTU6ECJFZ_js.listViewTabSchema; }
9549
+ get: function () { return chunkYZ5RCMIQ_js.listViewTabSchema; }
8562
9550
  });
8563
9551
  Object.defineProperty(exports, "normalizeFilterRule", {
8564
9552
  enumerable: true,
8565
- get: function () { return chunkTU6ECJFZ_js.normalizeFilterRule; }
9553
+ get: function () { return chunkYZ5RCMIQ_js.normalizeFilterRule; }
8566
9554
  });
8567
9555
  Object.defineProperty(exports, "normalizeForEdgeRpc", {
8568
9556
  enumerable: true,
8569
- get: function () { return chunkTU6ECJFZ_js.normalizeForEdgeRpc; }
9557
+ get: function () { return chunkYZ5RCMIQ_js.normalizeForEdgeRpc; }
8570
9558
  });
8571
9559
  Object.defineProperty(exports, "normalizeOperator", {
8572
9560
  enumerable: true,
8573
- get: function () { return chunkTU6ECJFZ_js.normalizeOperator; }
9561
+ get: function () { return chunkYZ5RCMIQ_js.normalizeOperator; }
8574
9562
  });
8575
9563
  Object.defineProperty(exports, "now", {
8576
9564
  enumerable: true,
8577
- get: function () { return chunkTU6ECJFZ_js.now; }
9565
+ get: function () { return chunkYZ5RCMIQ_js.now; }
8578
9566
  });
8579
9567
  Object.defineProperty(exports, "parseResourceVisibility", {
8580
9568
  enumerable: true,
8581
- get: function () { return chunkTU6ECJFZ_js.parseResourceVisibility; }
9569
+ get: function () { return chunkYZ5RCMIQ_js.parseResourceVisibility; }
8582
9570
  });
8583
9571
  Object.defineProperty(exports, "parseViewConfig", {
8584
9572
  enumerable: true,
8585
- get: function () { return chunkTU6ECJFZ_js.parseViewConfig; }
9573
+ get: function () { return chunkYZ5RCMIQ_js.parseViewConfig; }
8586
9574
  });
8587
9575
  Object.defineProperty(exports, "relationSourceSchema", {
8588
9576
  enumerable: true,
8589
- get: function () { return chunkTU6ECJFZ_js.relationSourceSchema; }
9577
+ get: function () { return chunkYZ5RCMIQ_js.relationSourceSchema; }
8590
9578
  });
8591
9579
  Object.defineProperty(exports, "resolveEffectiveFilterType", {
8592
9580
  enumerable: true,
8593
- get: function () { return chunkTU6ECJFZ_js.resolveEffectiveFilterType; }
9581
+ get: function () { return chunkYZ5RCMIQ_js.resolveEffectiveFilterType; }
8594
9582
  });
8595
9583
  Object.defineProperty(exports, "resolveIsWithinBounds", {
8596
9584
  enumerable: true,
8597
- get: function () { return chunkTU6ECJFZ_js.resolveIsWithinBounds; }
9585
+ get: function () { return chunkYZ5RCMIQ_js.resolveIsWithinBounds; }
8598
9586
  });
8599
9587
  Object.defineProperty(exports, "resolveUtcDayBounds", {
8600
9588
  enumerable: true,
8601
- get: function () { return chunkTU6ECJFZ_js.resolveUtcDayBounds; }
9589
+ get: function () { return chunkYZ5RCMIQ_js.resolveUtcDayBounds; }
9590
+ });
9591
+ Object.defineProperty(exports, "sortsSchema", {
9592
+ enumerable: true,
9593
+ get: function () { return chunkYZ5RCMIQ_js.sortsSchema; }
8602
9594
  });
8603
9595
  Object.defineProperty(exports, "tableSourceSchema", {
8604
9596
  enumerable: true,
8605
- get: function () { return chunkTU6ECJFZ_js.tableSourceSchema; }
9597
+ get: function () { return chunkYZ5RCMIQ_js.tableSourceSchema; }
8606
9598
  });
8607
9599
  Object.defineProperty(exports, "toMultiValueOperator", {
8608
9600
  enumerable: true,
8609
- get: function () { return chunkTU6ECJFZ_js.toMultiValueOperator; }
9601
+ get: function () { return chunkYZ5RCMIQ_js.toMultiValueOperator; }
8610
9602
  });
8611
9603
  Object.defineProperty(exports, "toUtcDayString", {
8612
9604
  enumerable: true,
8613
- get: function () { return chunkTU6ECJFZ_js.toUtcDayString; }
9605
+ get: function () { return chunkYZ5RCMIQ_js.toUtcDayString; }
8614
9606
  });
8615
9607
  Object.defineProperty(exports, "today", {
8616
9608
  enumerable: true,
8617
- get: function () { return chunkTU6ECJFZ_js.today; }
9609
+ get: function () { return chunkYZ5RCMIQ_js.today; }
8618
9610
  });
8619
9611
  Object.defineProperty(exports, "validateQualifiedRule", {
8620
9612
  enumerable: true,
8621
- get: function () { return chunkTU6ECJFZ_js.validateQualifiedRule; }
9613
+ get: function () { return chunkYZ5RCMIQ_js.validateQualifiedRule; }
8622
9614
  });
8623
9615
  Object.defineProperty(exports, "viewConfigByTypeSchema", {
8624
9616
  enumerable: true,
8625
- get: function () { return chunkTU6ECJFZ_js.viewConfigByTypeSchema; }
9617
+ get: function () { return chunkYZ5RCMIQ_js.viewConfigByTypeSchema; }
8626
9618
  });
8627
9619
  Object.defineProperty(exports, "viewTypeSchema", {
8628
9620
  enumerable: true,
8629
- get: function () { return chunkTU6ECJFZ_js.viewTypeSchema; }
9621
+ get: function () { return chunkYZ5RCMIQ_js.viewTypeSchema; }
8630
9622
  });
8631
- Object.defineProperty(exports, "ComputedFormulaParseError", {
9623
+ Object.defineProperty(exports, "createFormAttributeValidator", {
8632
9624
  enumerable: true,
8633
- get: function () { return chunkLRFLSFIA_js.ComputedFormulaParseError; }
9625
+ get: function () { return chunkI3EYILYO_js.createFormAttributeValidator; }
8634
9626
  });
8635
- Object.defineProperty(exports, "SCHEMA_LIMITS", {
9627
+ Object.defineProperty(exports, "isNullishOrEmptyString", {
8636
9628
  enumerable: true,
8637
- get: function () { return chunkLRFLSFIA_js.SCHEMA_LIMITS; }
9629
+ get: function () { return chunkI3EYILYO_js.isNullishOrEmptyString; }
8638
9630
  });
8639
- Object.defineProperty(exports, "colorIdSchema", {
9631
+ Object.defineProperty(exports, "isValuePresent", {
8640
9632
  enumerable: true,
8641
- get: function () { return chunkLRFLSFIA_js.colorIdSchema; }
9633
+ get: function () { return chunkI3EYILYO_js.isValuePresent; }
8642
9634
  });
8643
- Object.defineProperty(exports, "iconNameSchema", {
9635
+ Object.defineProperty(exports, "rejectUnknownAttributesOrThrow", {
8644
9636
  enumerable: true,
8645
- get: function () { return chunkLRFLSFIA_js.iconNameSchema; }
9637
+ get: function () { return chunkI3EYILYO_js.rejectUnknownAttributesOrThrow; }
8646
9638
  });
8647
- Object.defineProperty(exports, "multiselectOptionWriteSchema", {
9639
+ Object.defineProperty(exports, "validateDraft", {
8648
9640
  enumerable: true,
8649
- get: function () { return chunkLRFLSFIA_js.multiselectOptionWriteSchema; }
9641
+ get: function () { return chunkI3EYILYO_js.validateDraft; }
8650
9642
  });
8651
- Object.defineProperty(exports, "parseAttributeConfig", {
9643
+ Object.defineProperty(exports, "validateDraftOrThrow", {
8652
9644
  enumerable: true,
8653
- get: function () { return chunkLRFLSFIA_js.parseAttributeConfig; }
9645
+ get: function () { return chunkI3EYILYO_js.validateDraftOrThrow; }
8654
9646
  });
8655
- Object.defineProperty(exports, "parseAttributeConfigForCreate", {
9647
+ Object.defineProperty(exports, "validateObject", {
8656
9648
  enumerable: true,
8657
- get: function () { return chunkLRFLSFIA_js.parseAttributeConfigForCreate; }
9649
+ get: function () { return chunkI3EYILYO_js.validateObject; }
8658
9650
  });
8659
- Object.defineProperty(exports, "parseAttributeConfigForUpdate", {
9651
+ Object.defineProperty(exports, "validateObjectOrThrow", {
8660
9652
  enumerable: true,
8661
- get: function () { return chunkLRFLSFIA_js.parseAttributeConfigForUpdate; }
9653
+ get: function () { return chunkI3EYILYO_js.validateObjectOrThrow; }
8662
9654
  });
8663
- Object.defineProperty(exports, "parseComputedFormula", {
9655
+ Object.defineProperty(exports, "ComputedFormulaParseError", {
8664
9656
  enumerable: true,
8665
- get: function () { return chunkLRFLSFIA_js.parseComputedFormula; }
9657
+ get: function () { return chunkBOICAZHR_js.ComputedFormulaParseError; }
8666
9658
  });
8667
- Object.defineProperty(exports, "selectOptionWriteSchema", {
9659
+ Object.defineProperty(exports, "SCHEMA_LIMITS", {
8668
9660
  enumerable: true,
8669
- get: function () { return chunkLRFLSFIA_js.selectOptionWriteSchema; }
9661
+ get: function () { return chunkBOICAZHR_js.SCHEMA_LIMITS; }
8670
9662
  });
8671
- Object.defineProperty(exports, "statusGroupSchema", {
9663
+ Object.defineProperty(exports, "colorIdSchema", {
8672
9664
  enumerable: true,
8673
- get: function () { return chunkLRFLSFIA_js.statusGroupSchema; }
9665
+ get: function () { return chunkBOICAZHR_js.colorIdSchema; }
8674
9666
  });
8675
- Object.defineProperty(exports, "statusOptionWriteSchema", {
9667
+ Object.defineProperty(exports, "iconNameSchema", {
8676
9668
  enumerable: true,
8677
- get: function () { return chunkLRFLSFIA_js.statusOptionWriteSchema; }
9669
+ get: function () { return chunkBOICAZHR_js.iconNameSchema; }
8678
9670
  });
8679
- Object.defineProperty(exports, "createFormAttributeValidator", {
9671
+ Object.defineProperty(exports, "multiselectOptionWriteSchema", {
8680
9672
  enumerable: true,
8681
- get: function () { return chunkE47WAI5K_js.createFormAttributeValidator; }
9673
+ get: function () { return chunkBOICAZHR_js.multiselectOptionWriteSchema; }
8682
9674
  });
8683
- Object.defineProperty(exports, "isNullishOrEmptyString", {
9675
+ Object.defineProperty(exports, "parseAttributeConfig", {
8684
9676
  enumerable: true,
8685
- get: function () { return chunkE47WAI5K_js.isNullishOrEmptyString; }
9677
+ get: function () { return chunkBOICAZHR_js.parseAttributeConfig; }
8686
9678
  });
8687
- Object.defineProperty(exports, "isValuePresent", {
9679
+ Object.defineProperty(exports, "parseAttributeConfigForCreate", {
8688
9680
  enumerable: true,
8689
- get: function () { return chunkE47WAI5K_js.isValuePresent; }
9681
+ get: function () { return chunkBOICAZHR_js.parseAttributeConfigForCreate; }
8690
9682
  });
8691
- Object.defineProperty(exports, "rejectUnknownAttributesOrThrow", {
9683
+ Object.defineProperty(exports, "parseAttributeConfigForUpdate", {
8692
9684
  enumerable: true,
8693
- get: function () { return chunkE47WAI5K_js.rejectUnknownAttributesOrThrow; }
9685
+ get: function () { return chunkBOICAZHR_js.parseAttributeConfigForUpdate; }
8694
9686
  });
8695
- Object.defineProperty(exports, "validateDraft", {
9687
+ Object.defineProperty(exports, "parseComputedFormula", {
8696
9688
  enumerable: true,
8697
- get: function () { return chunkE47WAI5K_js.validateDraft; }
9689
+ get: function () { return chunkBOICAZHR_js.parseComputedFormula; }
8698
9690
  });
8699
- Object.defineProperty(exports, "validateDraftOrThrow", {
9691
+ Object.defineProperty(exports, "selectOptionWriteSchema", {
8700
9692
  enumerable: true,
8701
- get: function () { return chunkE47WAI5K_js.validateDraftOrThrow; }
9693
+ get: function () { return chunkBOICAZHR_js.selectOptionWriteSchema; }
8702
9694
  });
8703
- Object.defineProperty(exports, "validateObject", {
9695
+ Object.defineProperty(exports, "statusGroupSchema", {
8704
9696
  enumerable: true,
8705
- get: function () { return chunkE47WAI5K_js.validateObject; }
9697
+ get: function () { return chunkBOICAZHR_js.statusGroupSchema; }
8706
9698
  });
8707
- Object.defineProperty(exports, "validateObjectOrThrow", {
9699
+ Object.defineProperty(exports, "statusOptionWriteSchema", {
8708
9700
  enumerable: true,
8709
- get: function () { return chunkE47WAI5K_js.validateObjectOrThrow; }
9701
+ get: function () { return chunkBOICAZHR_js.statusOptionWriteSchema; }
8710
9702
  });
8711
9703
  Object.defineProperty(exports, "createCheckboxValidator", {
8712
9704
  enumerable: true,
@@ -8734,155 +9726,155 @@ Object.defineProperty(exports, "resolveTextPattern", {
8734
9726
  });
8735
9727
  Object.defineProperty(exports, "AccessDeniedError", {
8736
9728
  enumerable: true,
8737
- get: function () { return chunkHWZRSXFB_js.AccessDeniedError; }
9729
+ get: function () { return chunkV26R64A4_js.AccessDeniedError; }
8738
9730
  });
8739
9731
  Object.defineProperty(exports, "AttributeInUseError", {
8740
9732
  enumerable: true,
8741
- get: function () { return chunkHWZRSXFB_js.AttributeInUseError; }
9733
+ get: function () { return chunkV26R64A4_js.AttributeInUseError; }
8742
9734
  });
8743
9735
  Object.defineProperty(exports, "AttributeNotFoundError", {
8744
9736
  enumerable: true,
8745
- get: function () { return chunkHWZRSXFB_js.AttributeNotFoundError; }
9737
+ get: function () { return chunkV26R64A4_js.AttributeNotFoundError; }
8746
9738
  });
8747
9739
  Object.defineProperty(exports, "ChangeTypeNotSupportedError", {
8748
9740
  enumerable: true,
8749
- get: function () { return chunkHWZRSXFB_js.ChangeTypeNotSupportedError; }
9741
+ get: function () { return chunkV26R64A4_js.ChangeTypeNotSupportedError; }
8750
9742
  });
8751
9743
  Object.defineProperty(exports, "ConcurrentModificationError", {
8752
9744
  enumerable: true,
8753
- get: function () { return chunkHWZRSXFB_js.ConcurrentModificationError; }
9745
+ get: function () { return chunkV26R64A4_js.ConcurrentModificationError; }
8754
9746
  });
8755
9747
  Object.defineProperty(exports, "DestructiveSyncNotAllowedError", {
8756
9748
  enumerable: true,
8757
- get: function () { return chunkHWZRSXFB_js.DestructiveSyncNotAllowedError; }
9749
+ get: function () { return chunkV26R64A4_js.DestructiveSyncNotAllowedError; }
8758
9750
  });
8759
9751
  Object.defineProperty(exports, "DuplicateError", {
8760
9752
  enumerable: true,
8761
- get: function () { return chunkHWZRSXFB_js.DuplicateError; }
9753
+ get: function () { return chunkV26R64A4_js.DuplicateError; }
8762
9754
  });
8763
9755
  Object.defineProperty(exports, "ForbiddenError", {
8764
9756
  enumerable: true,
8765
- get: function () { return chunkHWZRSXFB_js.ForbiddenError; }
9757
+ get: function () { return chunkV26R64A4_js.ForbiddenError; }
8766
9758
  });
8767
9759
  Object.defineProperty(exports, "MemoryNotFoundError", {
8768
9760
  enumerable: true,
8769
- get: function () { return chunkHWZRSXFB_js.MemoryNotFoundError; }
9761
+ get: function () { return chunkV26R64A4_js.MemoryNotFoundError; }
8770
9762
  });
8771
9763
  Object.defineProperty(exports, "MigrationTimeoutError", {
8772
9764
  enumerable: true,
8773
- get: function () { return chunkHWZRSXFB_js.MigrationTimeoutError; }
9765
+ get: function () { return chunkV26R64A4_js.MigrationTimeoutError; }
8774
9766
  });
8775
9767
  Object.defineProperty(exports, "NotFoundError", {
8776
9768
  enumerable: true,
8777
- get: function () { return chunkHWZRSXFB_js.NotFoundError; }
9769
+ get: function () { return chunkV26R64A4_js.NotFoundError; }
8778
9770
  });
8779
9771
  Object.defineProperty(exports, "NotImplementedError", {
8780
9772
  enumerable: true,
8781
- get: function () { return chunkHWZRSXFB_js.NotImplementedError; }
9773
+ get: function () { return chunkV26R64A4_js.NotImplementedError; }
8782
9774
  });
8783
9775
  Object.defineProperty(exports, "ObjectNotFoundError", {
8784
9776
  enumerable: true,
8785
- get: function () { return chunkHWZRSXFB_js.ObjectNotFoundError; }
9777
+ get: function () { return chunkV26R64A4_js.ObjectNotFoundError; }
8786
9778
  });
8787
9779
  Object.defineProperty(exports, "ObjectReferencedError", {
8788
9780
  enumerable: true,
8789
- get: function () { return chunkHWZRSXFB_js.ObjectReferencedError; }
9781
+ get: function () { return chunkV26R64A4_js.ObjectReferencedError; }
8790
9782
  });
8791
9783
  Object.defineProperty(exports, "OrphanSystemAttributeError", {
8792
9784
  enumerable: true,
8793
- get: function () { return chunkHWZRSXFB_js.OrphanSystemAttributeError; }
9785
+ get: function () { return chunkV26R64A4_js.OrphanSystemAttributeError; }
8794
9786
  });
8795
9787
  Object.defineProperty(exports, "ProtectedResourceError", {
8796
9788
  enumerable: true,
8797
- get: function () { return chunkHWZRSXFB_js.ProtectedResourceError; }
9789
+ get: function () { return chunkV26R64A4_js.ProtectedResourceError; }
8798
9790
  });
8799
9791
  Object.defineProperty(exports, "ProtectedRoleError", {
8800
9792
  enumerable: true,
8801
- get: function () { return chunkHWZRSXFB_js.ProtectedRoleError; }
9793
+ get: function () { return chunkV26R64A4_js.ProtectedRoleError; }
8802
9794
  });
8803
9795
  Object.defineProperty(exports, "RecordNotFoundError", {
8804
9796
  enumerable: true,
8805
- get: function () { return chunkHWZRSXFB_js.RecordNotFoundError; }
9797
+ get: function () { return chunkV26R64A4_js.RecordNotFoundError; }
8806
9798
  });
8807
9799
  Object.defineProperty(exports, "RecordReferencedError", {
8808
9800
  enumerable: true,
8809
- get: function () { return chunkHWZRSXFB_js.RecordReferencedError; }
9801
+ get: function () { return chunkV26R64A4_js.RecordReferencedError; }
8810
9802
  });
8811
9803
  Object.defineProperty(exports, "RepositoryError", {
8812
9804
  enumerable: true,
8813
- get: function () { return chunkHWZRSXFB_js.RepositoryError; }
9805
+ get: function () { return chunkV26R64A4_js.RepositoryError; }
8814
9806
  });
8815
9807
  Object.defineProperty(exports, "RoleNotFoundError", {
8816
9808
  enumerable: true,
8817
- get: function () { return chunkHWZRSXFB_js.RoleNotFoundError; }
9809
+ get: function () { return chunkV26R64A4_js.RoleNotFoundError; }
8818
9810
  });
8819
9811
  Object.defineProperty(exports, "SchemaError", {
8820
9812
  enumerable: true,
8821
- get: function () { return chunkHWZRSXFB_js.SchemaError; }
9813
+ get: function () { return chunkV26R64A4_js.SchemaError; }
8822
9814
  });
8823
9815
  Object.defineProperty(exports, "SchemaErrorCode", {
8824
9816
  enumerable: true,
8825
- get: function () { return chunkHWZRSXFB_js.SchemaErrorCode; }
9817
+ get: function () { return chunkV26R64A4_js.SchemaErrorCode; }
8826
9818
  });
8827
9819
  Object.defineProperty(exports, "SchemaPlanNotFoundError", {
8828
9820
  enumerable: true,
8829
- get: function () { return chunkHWZRSXFB_js.SchemaPlanNotFoundError; }
9821
+ get: function () { return chunkV26R64A4_js.SchemaPlanNotFoundError; }
8830
9822
  });
8831
9823
  Object.defineProperty(exports, "SearchBackendError", {
8832
9824
  enumerable: true,
8833
- get: function () { return chunkHWZRSXFB_js.SearchBackendError; }
9825
+ get: function () { return chunkV26R64A4_js.SearchBackendError; }
8834
9826
  });
8835
9827
  Object.defineProperty(exports, "StorageError", {
8836
9828
  enumerable: true,
8837
- get: function () { return chunkHWZRSXFB_js.StorageError; }
9829
+ get: function () { return chunkV26R64A4_js.StorageError; }
8838
9830
  });
8839
9831
  Object.defineProperty(exports, "SyncCascadeError", {
8840
9832
  enumerable: true,
8841
- get: function () { return chunkHWZRSXFB_js.SyncCascadeError; }
9833
+ get: function () { return chunkV26R64A4_js.SyncCascadeError; }
8842
9834
  });
8843
9835
  Object.defineProperty(exports, "SyncConflictError", {
8844
9836
  enumerable: true,
8845
- get: function () { return chunkHWZRSXFB_js.SyncConflictError; }
9837
+ get: function () { return chunkV26R64A4_js.SyncConflictError; }
8846
9838
  });
8847
9839
  Object.defineProperty(exports, "SyncError", {
8848
9840
  enumerable: true,
8849
- get: function () { return chunkHWZRSXFB_js.SyncError; }
9841
+ get: function () { return chunkV26R64A4_js.SyncError; }
8850
9842
  });
8851
9843
  Object.defineProperty(exports, "SystemEntityImmutableError", {
8852
9844
  enumerable: true,
8853
- get: function () { return chunkHWZRSXFB_js.SystemEntityImmutableError; }
9845
+ get: function () { return chunkV26R64A4_js.SystemEntityImmutableError; }
8854
9846
  });
8855
9847
  Object.defineProperty(exports, "ValidationError", {
8856
9848
  enumerable: true,
8857
- get: function () { return chunkHWZRSXFB_js.ValidationError; }
9849
+ get: function () { return chunkV26R64A4_js.ValidationError; }
8858
9850
  });
8859
9851
  Object.defineProperty(exports, "isAttributeInUseError", {
8860
9852
  enumerable: true,
8861
- get: function () { return chunkHWZRSXFB_js.isAttributeInUseError; }
9853
+ get: function () { return chunkV26R64A4_js.isAttributeInUseError; }
8862
9854
  });
8863
9855
  Object.defineProperty(exports, "isNotFoundError", {
8864
9856
  enumerable: true,
8865
- get: function () { return chunkHWZRSXFB_js.isNotFoundError; }
9857
+ get: function () { return chunkV26R64A4_js.isNotFoundError; }
8866
9858
  });
8867
9859
  Object.defineProperty(exports, "isObjectReferencedError", {
8868
9860
  enumerable: true,
8869
- get: function () { return chunkHWZRSXFB_js.isObjectReferencedError; }
9861
+ get: function () { return chunkV26R64A4_js.isObjectReferencedError; }
8870
9862
  });
8871
9863
  Object.defineProperty(exports, "isProtectedResourceError", {
8872
9864
  enumerable: true,
8873
- get: function () { return chunkHWZRSXFB_js.isProtectedResourceError; }
9865
+ get: function () { return chunkV26R64A4_js.isProtectedResourceError; }
8874
9866
  });
8875
9867
  Object.defineProperty(exports, "isRecordReferencedError", {
8876
9868
  enumerable: true,
8877
- get: function () { return chunkHWZRSXFB_js.isRecordReferencedError; }
9869
+ get: function () { return chunkV26R64A4_js.isRecordReferencedError; }
8878
9870
  });
8879
9871
  Object.defineProperty(exports, "isSchemaError", {
8880
9872
  enumerable: true,
8881
- get: function () { return chunkHWZRSXFB_js.isSchemaError; }
9873
+ get: function () { return chunkV26R64A4_js.isSchemaError; }
8882
9874
  });
8883
9875
  Object.defineProperty(exports, "isValidationError", {
8884
9876
  enumerable: true,
8885
- get: function () { return chunkHWZRSXFB_js.isValidationError; }
9877
+ get: function () { return chunkV26R64A4_js.isValidationError; }
8886
9878
  });
8887
9879
  Object.defineProperty(exports, "DEFAULT_VALIDATION_MESSAGES", {
8888
9880
  enumerable: true,
@@ -8898,6 +9890,7 @@ exports.ALLOWED_PROPERTY_TYPES = ALLOWED_PROPERTY_TYPES;
8898
9890
  exports.ALL_ACTIONS = ALL_ACTIONS;
8899
9891
  exports.ALL_OPERATION_TYPES = ALL_OPERATION_TYPES;
8900
9892
  exports.ALL_SYSTEM_RESOURCES = ALL_SYSTEM_RESOURCES;
9893
+ exports.ATTRIBUTE_TYPES = ATTRIBUTE_TYPES;
8901
9894
  exports.AUDIT_ACTIONS = AUDIT_ACTIONS;
8902
9895
  exports.AUDIT_RESOURCE_TYPES = AUDIT_RESOURCE_TYPES;
8903
9896
  exports.ActivityTabConfig = ActivityTabConfig;
@@ -8922,6 +9915,7 @@ exports.DEFAULT_ROLE_DESCRIPTIONS = DEFAULT_ROLE_DESCRIPTIONS;
8922
9915
  exports.DEFAULT_ROLE_LABELS = DEFAULT_ROLE_LABELS;
8923
9916
  exports.DEFAULT_ROLE_PERMISSIONS = DEFAULT_ROLE_PERMISSIONS;
8924
9917
  exports.DOCUMENT_SYSTEM_ATTRIBUTES = DOCUMENT_SYSTEM_ATTRIBUTES;
9918
+ exports.DRAFTABLE_ATTRIBUTE_TYPES = DRAFTABLE_ATTRIBUTE_TYPES;
8925
9919
  exports.DRIVE_LIST_VIEW = DRIVE_LIST_VIEW;
8926
9920
  exports.DRIVE_OBJECT = DRIVE_OBJECT;
8927
9921
  exports.DRIVE_OBJECT_NAME = DRIVE_OBJECT_NAME;
@@ -8967,6 +9961,8 @@ exports.NOTIFICATION_TYPE_AGENT_SESSION_WAITING_HUMAN = NOTIFICATION_TYPE_AGENT_
8967
9961
  exports.NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED = NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED;
8968
9962
  exports.NOTIFICATION_WORK_STATES = NOTIFICATION_WORK_STATES;
8969
9963
  exports.NoopGeocodingAdapter = NoopGeocodingAdapter;
9964
+ exports.OBJECT_NAME_SCHEMA = OBJECT_NAME_SCHEMA;
9965
+ exports.OPEN_TOOL_PART_STATES = OPEN_TOOL_PART_STATES;
8970
9966
  exports.OPERATION_REGISTRY = OPERATION_REGISTRY;
8971
9967
  exports.OPERATOR_SPECS = OPERATOR_SPECS;
8972
9968
  exports.ObjectBuilder = ObjectBuilder;
@@ -8986,24 +9982,35 @@ exports.SYSTEM_RESOURCE_LABELS = SYSTEM_RESOURCE_LABELS;
8986
9982
  exports.TODAY_DEFAULT = TODAY_DEFAULT;
8987
9983
  exports.TODO_PLAN_STATUSES = TODO_PLAN_STATUSES;
8988
9984
  exports.TODO_STATUSES = TODO_STATUSES;
9985
+ exports.TOOL_APPROVAL_STATES = TOOL_APPROVAL_STATES;
8989
9986
  exports.TabBuilder = TabBuilder;
8990
9987
  exports.TableTabConfig = TableTabConfig;
9988
+ exports.UPDATE_TABLE_TAB_CHANGE_KEYS = UPDATE_TABLE_TAB_CHANGE_KEYS;
9989
+ exports.UPDATE_TAB_CHANGE_KEYS = UPDATE_TAB_CHANGE_KEYS;
9990
+ exports.UPDATE_TAB_CONFIG_CHANGE_KEYS = UPDATE_TAB_CONFIG_CHANGE_KEYS;
8991
9991
  exports.USER_STATUSES = USER_STATUSES;
8992
9992
  exports.USER_WORK_POSTURES = USER_WORK_POSTURES;
8993
9993
  exports.accessLevelToActions = accessLevelToActions;
8994
9994
  exports.actionsToAccessLevel = actionsToAccessLevel;
8995
9995
  exports.agent = agent;
9996
+ exports.agentDataChunk = agentDataChunk;
8996
9997
  exports.agentDisplayName = agentDisplayName;
9998
+ exports.agentMessageAttachmentSchema = agentMessageAttachmentSchema;
9999
+ exports.agentMessagePartSchema = agentMessagePartSchema;
10000
+ exports.agentSessionMessageSchema = agentSessionMessageSchema;
10001
+ exports.agentUIValidationError = agentUIValidationError;
8997
10002
  exports.applyOperations = applyOperations;
8998
10003
  exports.applyPipes = applyPipes;
8999
10004
  exports.applyRelationProps = applyRelationProps;
9000
10005
  exports.assertAcyclicComputedDependencies = assertAcyclicComputedDependencies;
10006
+ exports.assertCustomAgentUIMessageChunk = assertCustomAgentUIMessageChunk;
9001
10007
  exports.booleanFlag = booleanFlag;
9002
10008
  exports.buildAgentFallbackTitle = buildAgentFallbackTitle;
9003
10009
  exports.buildPermissionFlags = buildPermissionFlags;
9004
10010
  exports.buildPropertySchema = buildPropertySchema;
9005
10011
  exports.buildQualifiedAttribute = buildQualifiedAttribute;
9006
10012
  exports.checkbox = checkbox;
10013
+ exports.compareAgentSessionMessages = compareAgentSessionMessages;
9007
10014
  exports.compileComputedFormula = compileComputedFormula;
9008
10015
  exports.compileRollupAttribute = compileRollupAttribute;
9009
10016
  exports.computeByteMagnitude = computeByteMagnitude;
@@ -9012,16 +10019,23 @@ exports.createFlagRegistry = createFlagRegistry;
9012
10019
  exports.createFlagService = createFlagService;
9013
10020
  exports.createStandardSchemaProps = createStandardSchemaProps;
9014
10021
  exports.currency = currency;
10022
+ exports.customDataChunkSchemas = customDataChunkSchemas;
9015
10023
  exports.date = date;
9016
10024
  exports.dateInTimezone = dateInTimezone;
9017
10025
  exports.dateValueStart = dateValueStart;
9018
10026
  exports.defineOperation = defineOperation;
10027
+ exports.definePresentation = definePresentation;
10028
+ exports.deriveArchitectChanges = deriveArchitectChanges;
9019
10029
  exports.deriveInitials = deriveInitials;
10030
+ exports.describeAttributeConfig = describeAttributeConfig;
10031
+ exports.describeOperationInput = describeOperationInput;
9020
10032
  exports.describeOperations = describeOperations;
9021
10033
  exports.destructiveSchema = destructiveSchema;
9022
10034
  exports.detailView = detailView;
9023
10035
  exports.document = document;
10036
+ exports.durableDateSchema = durableDateSchema;
9024
10037
  exports.ensureFieldIds = ensureFieldIds;
10038
+ exports.episodeImpactOf = episodeImpactOf;
9025
10039
  exports.evaluateComputedAst = evaluateComputedAst;
9026
10040
  exports.evaluateComputedFormula = evaluateComputedFormula;
9027
10041
  exports.evaluateComputedFormulaWithResult = evaluateComputedFormulaWithResult;
@@ -9032,12 +10046,15 @@ exports.extractValueRefs = extractValueRefs;
9032
10046
  exports.flagRegistry = flagRegistry;
9033
10047
  exports.focusOf = focusOf;
9034
10048
  exports.form = form;
10049
+ exports.formFieldFlatKey = formFieldFlatKey;
10050
+ exports.formFieldKey = formFieldKey;
9035
10051
  exports.formRegistry = formRegistry;
9036
10052
  exports.formatAttributeValue = formatAttributeValue;
9037
10053
  exports.formatByteSize = formatByteSize;
9038
10054
  exports.formatComputedResult = formatComputedResult;
9039
10055
  exports.formatLocationValue = formatLocationValue;
9040
10056
  exports.formula = formula;
10057
+ exports.fromDraftableView = fromDraftableView;
9041
10058
  exports.generateDefaultDetailView = generateDefaultDetailView;
9042
10059
  exports.generateDefaultListView = generateDefaultListView;
9043
10060
  exports.getActiveTab = getActiveTab;
@@ -9052,6 +10069,7 @@ exports.hasOptions = hasOptions;
9052
10069
  exports.includesAction = includesAction;
9053
10070
  exports.inferInverseCardinality = inferInverseCardinality;
9054
10071
  exports.inferRollupReturnType = inferRollupReturnType;
10072
+ exports.isAgentUIDataName = isAgentUIDataName;
9055
10073
  exports.isAgentUIMessageBatch = isAgentUIMessageBatch;
9056
10074
  exports.isAttributeSortable = isAttributeSortable2;
9057
10075
  exports.isBilateralRelation = isBilateralRelation;
@@ -9078,24 +10096,30 @@ exports.isLiveEventPayload = isLiveEventPayload;
9078
10096
  exports.isLiveEventPayloadForType = isLiveEventPayloadForType;
9079
10097
  exports.isLiveEventType = isLiveEventType;
9080
10098
  exports.isNotEmpty = isNotEmpty;
10099
+ exports.isOpenToolPartState = isOpenToolPartState;
9081
10100
  exports.isPlainRecord = isPlainRecord2;
9082
10101
  exports.isStandardSchema = isStandardSchema;
9083
10102
  exports.isTerminalSessionStatus = isTerminalSessionStatus;
9084
10103
  exports.isTerminalState = isTerminalState;
10104
+ exports.isToolApprovalState = isToolApprovalState;
9085
10105
  exports.isUniversalRelation = isUniversalRelation;
9086
10106
  exports.jsonFlag = jsonFlag;
9087
10107
  exports.legacyStatusToSessionState = legacyStatusToSessionState;
10108
+ exports.listDescribableNames = listDescribableNames;
9088
10109
  exports.listView = listView;
9089
10110
  exports.liveChannelKey = liveChannelKey;
9090
10111
  exports.location = location;
9091
10112
  exports.makeFieldId = makeFieldId;
9092
10113
  exports.matchesAccepts = matchesAccepts;
10114
+ exports.mentionReferenceSchema = mentionReferenceSchema;
10115
+ exports.modelDefinitionSchema = modelDefinitionSchema;
9093
10116
  exports.multiselect = multiselect;
9094
10117
  exports.nativeAgentUIPartIdMetadataKey = nativeAgentUIPartIdMetadataKey;
9095
10118
  exports.normalizeDateValue = normalizeDateValue;
9096
10119
  exports.number = number;
9097
10120
  exports.numberFlag = numberFlag;
9098
10121
  exports.object = object;
10122
+ exports.orderAgentSessionMessages = orderAgentSessionMessages;
9099
10123
  exports.parseCountMode = parseCountMode;
9100
10124
  exports.parseLiveChannelKey = parseLiveChannelKey;
9101
10125
  exports.parseNativeAgentUIPartIdsMetadata = parseNativeAgentUIPartIdsMetadata;
@@ -9108,7 +10132,10 @@ exports.phone = phone;
9108
10132
  exports.plannedAttributeSchema = plannedAttributeSchema;
9109
10133
  exports.plannedInlineAttributeSchema = plannedInlineAttributeSchema;
9110
10134
  exports.plannedObjectSchema = plannedObjectSchema;
10135
+ exports.presentationOf = presentationOf;
9111
10136
  exports.proposedDefaultViewTargetSchema = proposedDefaultViewTargetSchema;
10137
+ exports.qualifiedPropertyDefs = qualifiedPropertyDefs;
10138
+ exports.readFormFieldValue = readFormFieldValue;
9112
10139
  exports.registry = registry;
9113
10140
  exports.relation = relation;
9114
10141
  exports.relationPropertyDefs = relationPropertyDefs;
@@ -9126,7 +10153,13 @@ exports.sessionStateToLegacyStatus = sessionStateToLegacyStatus;
9126
10153
  exports.status = status;
9127
10154
  exports.stringFlag = stringFlag;
9128
10155
  exports.text = text;
10156
+ exports.toDraftableAttributes = toDraftableAttributes;
10157
+ exports.toDraftableObject = toDraftableObject;
10158
+ exports.toDraftableView = toDraftableView;
9129
10159
  exports.toUndefinedIfEmpty = toUndefinedIfEmpty;
10160
+ exports.todoItemSchema = todoItemSchema;
10161
+ exports.todoPlanSchema = todoPlanSchema;
10162
+ exports.toolImpactSchema = toolImpactSchema;
9130
10163
  exports.user = user;
9131
10164
  exports.validateAttributeName = validateAttributeName;
9132
10165
  exports.validateLabelExpression = validateLabelExpression;