@stndrds/schema 1.0.0-alpha.265 → 1.0.0-alpha.267

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 (47) hide show
  1. package/dist/all--B2_3ksI.d.ts +465 -0
  2. package/dist/all-D5zeUllO.d.mts +465 -0
  3. package/dist/chunk-63WWFZFY.js +1262 -0
  4. package/dist/{chunk-ZBQEMIAV.js → chunk-FDIAOFHS.js} +11 -8
  5. package/dist/chunk-ITGE3PBX.mjs +1215 -0
  6. package/dist/{chunk-UXCJ3NI4.mjs → chunk-KDHDC7E6.mjs} +150 -9
  7. package/dist/{chunk-U36ZIBEM.mjs → chunk-O73ROMWQ.mjs} +15 -6
  8. package/dist/{chunk-QIWADKYA.mjs → chunk-POULKEJM.mjs} +11 -9
  9. package/dist/{chunk-EBGRZUIH.js → chunk-Q4SZAMJT.js} +5 -0
  10. package/dist/{chunk-NGGU6BSN.mjs → chunk-QMLO7V5E.mjs} +6 -6
  11. package/dist/{chunk-L4U5QEQL.js → chunk-QN2N3IJZ.js} +158 -8
  12. package/dist/{chunk-JUKLL5RJ.mjs → chunk-R5LAJCBU.mjs} +5 -2
  13. package/dist/{chunk-NI3HCSYH.js → chunk-V6Q7HCA7.js} +11 -11
  14. package/dist/{chunk-QAF3HNKQ.js → chunk-ZPFOKBIN.js} +16 -5
  15. package/dist/exceptions.d.mts +21 -8
  16. package/dist/exceptions.d.ts +21 -8
  17. package/dist/exceptions.js +42 -38
  18. package/dist/exceptions.mjs +1 -1
  19. package/dist/helpers-C1VVEAOO.d.mts +76 -0
  20. package/dist/helpers-vQ6kp8ET.d.ts +76 -0
  21. package/dist/index-Bq1KrQkR.d.ts +2413 -0
  22. package/dist/index-DtxtOBYT.d.mts +2413 -0
  23. package/dist/index.d.mts +1516 -2212
  24. package/dist/index.d.ts +1516 -2212
  25. package/dist/index.js +1294 -1038
  26. package/dist/index.mjs +911 -905
  27. package/dist/{helpers-eyrnPJEF.d.ts → objects-A1ED9af-.d.ts} +32 -77
  28. package/dist/{helpers-uKLet0kF.d.mts → objects-BCaBw2ef.d.mts} +32 -77
  29. package/dist/validation/all.d.mts +4 -2
  30. package/dist/validation/all.d.ts +4 -2
  31. package/dist/validation/all.js +88 -16
  32. package/dist/validation/all.mjs +9 -9
  33. package/dist/validation/complex/phone.js +2 -2
  34. package/dist/validation/complex/phone.mjs +1 -1
  35. package/dist/validation/config/index.d.mts +5 -18
  36. package/dist/validation/config/index.d.ts +5 -18
  37. package/dist/validation/config/index.js +34 -4
  38. package/dist/validation/config/index.mjs +7 -1
  39. package/dist/validation/object/index.d.mts +2 -2
  40. package/dist/validation/object/index.d.ts +2 -2
  41. package/dist/validation/object/index.js +19 -19
  42. package/dist/validation/object/index.mjs +7 -7
  43. package/dist/validation/primitives/text.js +2 -2
  44. package/dist/validation/primitives/text.mjs +1 -1
  45. package/package.json +2 -2
  46. package/dist/chunk-PGERPYDR.js +0 -2
  47. package/dist/chunk-SP3PNHYF.mjs +0 -1
package/dist/index.js CHANGED
@@ -1,30 +1,30 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkFRCDMQER_js = require('./chunk-FRCDMQER.js');
4
- require('./chunk-PGERPYDR.js');
5
- var chunkL4U5QEQL_js = require('./chunk-L4U5QEQL.js');
6
- var chunkNI3HCSYH_js = require('./chunk-NI3HCSYH.js');
7
- require('./chunk-5WATIVCA.js');
8
- require('./chunk-SI34M4IC.js');
9
- require('./chunk-YIP5FJ5H.js');
10
- require('./chunk-QAF3HNKQ.js');
4
+ var chunk63WWFZFY_js = require('./chunk-63WWFZFY.js');
5
+ var chunkQN2N3IJZ_js = require('./chunk-QN2N3IJZ.js');
6
+ var chunkV6Q7HCA7_js = require('./chunk-V6Q7HCA7.js');
11
7
  require('./chunk-EW5XR2X3.js');
12
8
  require('./chunk-QWKLQRBX.js');
13
9
  require('./chunk-KNGWHQLR.js');
14
10
  require('./chunk-HTSTPTNZ.js');
15
11
  require('./chunk-V2UA2D4E.js');
16
- var chunkZBQEMIAV_js = require('./chunk-ZBQEMIAV.js');
12
+ var chunk5WATIVCA_js = require('./chunk-5WATIVCA.js');
13
+ var chunkSI34M4IC_js = require('./chunk-SI34M4IC.js');
14
+ var chunkYIP5FJ5H_js = require('./chunk-YIP5FJ5H.js');
15
+ var chunkZPFOKBIN_js = require('./chunk-ZPFOKBIN.js');
16
+ var chunkFDIAOFHS_js = require('./chunk-FDIAOFHS.js');
17
17
  require('./chunk-ACKMC6FL.js');
18
18
  require('./chunk-E6JUYGJX.js');
19
- var chunkEBGRZUIH_js = require('./chunk-EBGRZUIH.js');
19
+ var chunkQ4SZAMJT_js = require('./chunk-Q4SZAMJT.js');
20
20
  require('./chunk-EEH4XQ7W.js');
21
21
  var chunkYKWSHBT5_js = require('./chunk-YKWSHBT5.js');
22
22
  var constants = require('@stndrds/constants');
23
- var z3 = require('zod');
23
+ var z2 = require('zod');
24
24
 
25
25
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
26
26
 
27
- var z3__default = /*#__PURE__*/_interopDefault(z3);
27
+ var z2__default = /*#__PURE__*/_interopDefault(z2);
28
28
 
29
29
  // src/types/notifications.ts
30
30
  var NOTIFICATION_KINDS = ["fyi", "task", "question", "handoff", "system"];
@@ -69,408 +69,6 @@ var BEHAVIOR_PROPERTIES = [
69
69
  ];
70
70
  var PRESENTATION_PROPERTIES = ["label", "description", "placeholder", "icon"];
71
71
 
72
- // src/types/system-attributes.ts
73
- var SYSTEM_ATTRIBUTE_I18N_KEYS = {
74
- createdAt: "createdAt",
75
- updatedAt: "updatedAt",
76
- createdBy: "createdBy",
77
- lastUpdatedBy: "lastUpdatedBy",
78
- attachments: "attachments"
79
- };
80
- function getSystemAttributeI18nKey(name) {
81
- return SYSTEM_ATTRIBUTE_I18N_KEYS[name];
82
- }
83
- var SYSTEM_ATTRIBUTES = {
84
- createdAt: {
85
- id: "system:createdAt",
86
- name: "createdAt",
87
- label: "Created time",
88
- type: "date",
89
- required: false,
90
- system: true,
91
- icon: "clock-circle",
92
- description: "When this record was created"
93
- },
94
- updatedAt: {
95
- id: "system:updatedAt",
96
- name: "updatedAt",
97
- label: "Last edited time",
98
- type: "date",
99
- required: false,
100
- system: true,
101
- icon: "clock-circle",
102
- description: "When this record was last modified"
103
- },
104
- createdBy: {
105
- id: "system:createdBy",
106
- name: "createdBy",
107
- label: "Created by",
108
- type: "user",
109
- required: false,
110
- system: true,
111
- multiple: false,
112
- icon: "user",
113
- description: "Actor who created this record"
114
- },
115
- lastUpdatedBy: {
116
- id: "system:lastUpdatedBy",
117
- name: "lastUpdatedBy",
118
- label: "Last edited by",
119
- type: "user",
120
- required: false,
121
- system: true,
122
- multiple: false,
123
- icon: "user",
124
- description: "Actor who last modified this record"
125
- },
126
- /**
127
- * System attribute for free-form document attachments.
128
- * Hidden from forms, visible in Documents tab.
129
- * Users can attach any document without template constraints.
130
- */
131
- attachments: {
132
- id: "system:attachments",
133
- name: "attachments",
134
- label: "Attachments",
135
- type: "document",
136
- required: false,
137
- system: true,
138
- hidden: true,
139
- // Hidden from regular form views
140
- icon: "paperclip",
141
- description: "Free-form document attachments"
142
- }
143
- };
144
- function getSystemAttributeList() {
145
- return Object.values(SYSTEM_ATTRIBUTES);
146
- }
147
- function isManagedSystemAttribute(attribute) {
148
- return attribute.id?.startsWith("system:") ?? false;
149
- }
150
-
151
- // src/types/attribute-capabilities.ts
152
- var TEXT_OPERATORS = [
153
- "is",
154
- "is_not",
155
- "contains",
156
- "not_contains",
157
- "starts_with",
158
- "ends_with",
159
- "is_empty",
160
- "is_not_empty"
161
- ];
162
- var NUMBER_OPERATORS = [
163
- "eq",
164
- "neq",
165
- "lt",
166
- "gt",
167
- "lte",
168
- "gte",
169
- "is_empty",
170
- "is_not_empty"
171
- ];
172
- var CHECKBOX_OPERATORS = [
173
- "is_checked",
174
- "is_not_checked"
175
- ];
176
- var DATE_OPERATORS = [
177
- "is",
178
- "is_not",
179
- "before",
180
- "after",
181
- "on_or_before",
182
- "on_or_after",
183
- "is_within",
184
- "day_month_eq",
185
- "is_empty",
186
- "is_not_empty"
187
- ];
188
- var SELECT_OPERATORS = [
189
- "is",
190
- "is_not",
191
- "any_of",
192
- "none_of",
193
- "is_empty",
194
- "is_not_empty"
195
- ];
196
- var MULTISELECT_OPERATORS = [
197
- "contains",
198
- "not_contains",
199
- "is_empty",
200
- "is_not_empty"
201
- ];
202
- var REFERENCE_OPERATORS = [
203
- "is",
204
- "is_not",
205
- "any_of",
206
- "none_of",
207
- "contains",
208
- "not_contains",
209
- "is_empty",
210
- "is_not_empty"
211
- ];
212
- var PRESENCE_OPERATORS = [
213
- "is_empty",
214
- "is_not_empty"
215
- ];
216
- var FORMULA_OPERATORS = [
217
- "is",
218
- "is_not",
219
- "eq",
220
- "neq",
221
- "lt",
222
- "gt",
223
- "lte",
224
- "gte",
225
- "contains",
226
- "not_contains",
227
- "is_empty",
228
- "is_not_empty"
229
- ];
230
- var ATTRIBUTE_FILTER_OPERATORS = {
231
- text: TEXT_OPERATORS,
232
- richtext: [],
233
- number: NUMBER_OPERATORS,
234
- checkbox: CHECKBOX_OPERATORS,
235
- date: DATE_OPERATORS,
236
- phone: ["is", "is_not", "contains", "not_contains", "is_empty", "is_not_empty"],
237
- currency: NUMBER_OPERATORS,
238
- status: SELECT_OPERATORS,
239
- select: SELECT_OPERATORS,
240
- multiselect: MULTISELECT_OPERATORS,
241
- location: [],
242
- user: REFERENCE_OPERATORS,
243
- relation: REFERENCE_OPERATORS,
244
- formula: FORMULA_OPERATORS,
245
- document: PRESENCE_OPERATORS
246
- };
247
- var COMPUTED_TYPES = /* @__PURE__ */ new Set(["formula", "rollup"]);
248
- var EDGE_BACKED_TYPES = /* @__PURE__ */ new Set(["user", "relation", "document"]);
249
- var STATIC_DEFAULT_TYPES = /* @__PURE__ */ new Set([
250
- "text",
251
- "richtext",
252
- "number",
253
- "select",
254
- "multiselect",
255
- "status",
256
- "date",
257
- "phone",
258
- "currency",
259
- "location",
260
- "user",
261
- "relation",
262
- "document"
263
- ]);
264
- var PLACEHOLDER_TYPES = /* @__PURE__ */ new Set([
265
- "text",
266
- "number",
267
- "date",
268
- "phone",
269
- "currency",
270
- "select",
271
- "multiselect"
272
- ]);
273
- var SEARCHABLE_TYPES = /* @__PURE__ */ new Set([
274
- "text",
275
- "phone",
276
- "status",
277
- "select",
278
- "multiselect"
279
- ]);
280
- var SORTABLE_TYPES = /* @__PURE__ */ new Set([
281
- "text",
282
- "number",
283
- "checkbox",
284
- "date",
285
- "phone",
286
- "currency",
287
- "status",
288
- "select"
289
- ]);
290
- function getAttributeCapabilities(attribute) {
291
- const suppressed = Boolean(attribute.hidden || attribute.archived);
292
- const active = !attribute.archived;
293
- const computed = COMPUTED_TYPES.has(attribute.type);
294
- const document2 = attribute.type === "document";
295
- const edgeBacked = EDGE_BACKED_TYPES.has(attribute.type);
296
- const cardinality = getAttributeCardinality(attribute);
297
- const operators = suppressed ? [] : getRawFilterOperators(attribute);
298
- const filterable = operators.length > 0 && !suppressed;
299
- const searchable = !suppressed && SEARCHABLE_TYPES.has(attribute.type);
300
- const sortable = !suppressed && SORTABLE_TYPES.has(attribute.type);
301
- const groupable = !suppressed && isGroupableType(attribute.type);
302
- const kanbanGroupable = !suppressed && attribute.type === "status";
303
- const managed = isManagedSystemAttribute(attribute);
304
- const readOnly = computed || document2 || managed;
305
- const editable = !(suppressed || readOnly);
306
- const required = isRequiredForbidden(attribute.type) ? "forbidden" : "allowed";
307
- const defaultValue = getDefaultValueCapability(attribute.type);
308
- const maxItems = supportsMaxItems(attribute);
309
- const placeholder = PLACEHOLDER_TYPES.has(attribute.type);
310
- const warningWhenDeprecated = Boolean(attribute.deprecated && !suppressed);
311
- const editMode = resolveEditMode(attribute);
312
- return {
313
- lifecycle: {
314
- active,
315
- deprecated: Boolean(attribute.deprecated),
316
- visibleInArchitect: true,
317
- visibleInRuntime: !suppressed,
318
- warningWhenDeprecated
319
- },
320
- storage: {
321
- mode: computed ? "computed" : edgeBacked ? "edge" : "value",
322
- cardinality,
323
- edgeBacked,
324
- preservesExistingValues: Boolean(attribute.archived),
325
- qualifiedProperties: supportsQualifiedProperties(attribute.type),
326
- polymorphic: getPolymorphicCapability(attribute),
327
- maxItems
328
- },
329
- authoring: {
330
- editable,
331
- readOnly,
332
- directEdit: editable && editMode === "inline",
333
- required,
334
- defaultValue,
335
- placeholder,
336
- maxItems
337
- },
338
- presentation: {
339
- formField: !suppressed && isFormFieldType(attribute.type),
340
- tableCell: !suppressed && isTableCellType(attribute.type),
341
- defaultColumn: !suppressed && isDefaultColumnType(attribute.type),
342
- compactDisplay: !suppressed,
343
- popoverEditor: !suppressed && editMode === "popover",
344
- placeholder,
345
- warningWhenDeprecated
346
- },
347
- query: {
348
- filterable,
349
- searchable,
350
- sortable,
351
- groupable,
352
- kanbanGroupable,
353
- operators
354
- },
355
- agent: {
356
- readable: !suppressed,
357
- writable: editable && !document2,
358
- compactReadable: !suppressed,
359
- contentReadable: !suppressed && isContentReadableType(attribute.type),
360
- requiresDedicatedTool: document2
361
- },
362
- exchange: {
363
- importable: !suppressed,
364
- exportable: !suppressed,
365
- schemaExportable: true,
366
- metadataExportable: false
367
- }
368
- };
369
- }
370
- function getAttributeFilterOperators(attribute) {
371
- return getAttributeCapabilities(attribute).query.operators;
372
- }
373
- function isAttributeFilterable(attribute) {
374
- return getAttributeCapabilities(attribute).query.filterable;
375
- }
376
- function isAttributeSearchable(attribute) {
377
- return getAttributeCapabilities(attribute).query.searchable;
378
- }
379
- function isAttributeSortable(attribute) {
380
- return getAttributeCapabilities(attribute).query.sortable;
381
- }
382
- function isAttributeGroupable(attribute) {
383
- return getAttributeCapabilities(attribute).query.groupable;
384
- }
385
- function isAttributeKanbanGroupable(attribute) {
386
- return getAttributeCapabilities(attribute).query.kanbanGroupable;
387
- }
388
- function getRollupFilterOperators(attr) {
389
- const fn = attr.function;
390
- if (fn === "earliest" || fn === "latest") {
391
- return ATTRIBUTE_FILTER_OPERATORS.date;
392
- }
393
- if (fn === "original") {
394
- const targetType = attr.targetAttributeType;
395
- if (targetType && hasFilterOperatorEntry(targetType)) {
396
- return ATTRIBUTE_FILTER_OPERATORS[targetType];
397
- }
398
- return ATTRIBUTE_FILTER_OPERATORS.number;
399
- }
400
- return ATTRIBUTE_FILTER_OPERATORS.number;
401
- }
402
- function getRawFilterOperators(attribute) {
403
- if (attribute.type === "rollup") {
404
- return getRollupFilterOperators(attribute);
405
- }
406
- return ATTRIBUTE_FILTER_OPERATORS[attribute.type] ?? [];
407
- }
408
- function getAttributeCardinality(attribute) {
409
- if (attribute.type === "multiselect" || attribute.type === "document") return "many";
410
- if (attribute.type === "user" && attribute.multiple === true) return "many";
411
- if (attribute.type === "relation") return attribute.cardinality === "many" ? "many" : "one";
412
- return "one";
413
- }
414
- function getPolymorphicCapability(attribute) {
415
- if (attribute.type !== "relation") return "none";
416
- const relation2 = attribute;
417
- const targets = relation2.targets ?? [];
418
- if (targets.length === 1 && targets[0]?.object === "*") return "internal";
419
- return targets.length > 1 ? "code-only" : "none";
420
- }
421
- function supportsMaxItems(attribute) {
422
- if (attribute.type === "multiselect") return true;
423
- if (attribute.type === "relation") return attribute.cardinality === "many";
424
- return false;
425
- }
426
- function supportsQualifiedProperties(type) {
427
- return type === "relation" || type === "document";
428
- }
429
- function isRequiredForbidden(type) {
430
- return type === "checkbox" || type === "formula" || type === "rollup";
431
- }
432
- function getDefaultValueCapability(type) {
433
- if (type === "checkbox") return "automatic";
434
- if (type === "formula" || type === "rollup") return "forbidden";
435
- if (STATIC_DEFAULT_TYPES.has(type)) return "static";
436
- return "forbidden";
437
- }
438
- function isDefaultColumnType(type) {
439
- return isTableCellType(type);
440
- }
441
- function isTableCellType(type) {
442
- return type !== "richtext" && type !== "document";
443
- }
444
- function isFormFieldType(type) {
445
- return type !== "richtext";
446
- }
447
- function resolveEditMode(attribute) {
448
- switch (attribute.type) {
449
- case "checkbox":
450
- return "inline";
451
- case "number":
452
- return attribute.renderAs === "rating" ? "inline" : "default";
453
- case "select":
454
- case "multiselect":
455
- return attribute.renderAs === "badges" ? "inline" : "popover";
456
- case "status":
457
- case "relation":
458
- case "user":
459
- return "popover";
460
- default:
461
- return "default";
462
- }
463
- }
464
- function isGroupableType(type) {
465
- return type === "status" || type === "currency";
466
- }
467
- function isContentReadableType(type) {
468
- return type === "richtext" || type === "document";
469
- }
470
- function hasFilterOperatorEntry(type) {
471
- return Object.prototype.hasOwnProperty.call(ATTRIBUTE_FILTER_OPERATORS, type);
472
- }
473
-
474
72
  // src/types/attributes.ts
475
73
  var RELATION_TARGET_ANY = "*";
476
74
  function isUniversalRelation(attr) {
@@ -483,7 +81,7 @@ function inferInverseCardinality(cardinality) {
483
81
  return cardinality === "one" ? "many" : "many";
484
82
  }
485
83
  function isAttributeSortable2(attr) {
486
- return isAttributeSortable(attr);
84
+ return chunk63WWFZFY_js.isAttributeSortable(attr);
487
85
  }
488
86
 
489
87
  // src/types/audit.ts
@@ -491,10 +89,12 @@ var AUDIT_RESOURCE_TYPES = [
491
89
  "record",
492
90
  "object",
493
91
  "attribute",
92
+ "view",
494
93
  "user",
495
94
  "role",
496
95
  "settings",
497
- "file"
96
+ "file",
97
+ "agent"
498
98
  ];
499
99
  var AUDIT_ACTIONS = [
500
100
  // Records
@@ -511,6 +111,10 @@ var AUDIT_ACTIONS = [
511
111
  "attribute.created",
512
112
  "attribute.updated",
513
113
  "attribute.deleted",
114
+ // Schema - Views
115
+ "view.created",
116
+ "view.updated",
117
+ "view.deleted",
514
118
  // Users
515
119
  "user.created",
516
120
  "user.invited",
@@ -532,6 +136,32 @@ var AUDIT_ACTIONS = [
532
136
  "file.deleted"
533
137
  ];
534
138
 
139
+ // src/types/agent.ts
140
+ var SESSION_TERMINAL_STATUSES = [
141
+ "completed",
142
+ "failed",
143
+ "cancelled",
144
+ "timeout",
145
+ "expired"
146
+ ];
147
+ function isTerminalSessionStatus(status2) {
148
+ return SESSION_TERMINAL_STATUSES.includes(status2);
149
+ }
150
+ var DEFAULT_APPROVAL_POLICY = Object.freeze({
151
+ mutation: "ask",
152
+ destructive: "ask",
153
+ outward: "ask"
154
+ });
155
+ var TODO_PLAN_STATUSES = ["active", "completed", "promoted", "abandoned"];
156
+ function agentDisplayName(agent2) {
157
+ return agent2.label?.trim() || agent2.name;
158
+ }
159
+ var TODO_STATUSES = ["pending", "in_progress", "completed", "blocked"];
160
+ var MAX_TODOS = 50;
161
+ var MAX_TODO_ID_CHARS = 80;
162
+ var MAX_TODO_DESCRIPTION_CHARS = 500;
163
+ var MAX_TODO_RESULT_CHARS = 2e3;
164
+
535
165
  // src/types/document-layout.ts
536
166
  var MAX_PRESET_DEPTH = 5;
537
167
 
@@ -547,21 +177,6 @@ function getErrorMessage(error) {
547
177
  return String(error);
548
178
  }
549
179
 
550
- // src/types/filters.ts
551
- var OPERATORS_BY_TYPE = ATTRIBUTE_FILTER_OPERATORS;
552
- var NO_VALUE_OPERATORS = [
553
- "is_empty",
554
- "is_not_empty",
555
- "is_checked",
556
- "is_not_checked"
557
- ];
558
- function isNoValueOperator(operator) {
559
- return NO_VALUE_OPERATORS.includes(operator);
560
- }
561
- function getRollupFilterOperators2(attr) {
562
- return getRollupFilterOperators(attr);
563
- }
564
-
565
180
  // src/types/forms/definition.ts
566
181
  function isFormDefinition(obj) {
567
182
  return typeof obj === "object" && obj !== null && "slots" in obj && "steps" in obj && "name" in obj && typeof obj.name === "string" && Array.isArray(obj.slots) && Array.isArray(obj.steps);
@@ -614,29 +229,6 @@ var NoopGeocodingAdapter = class {
614
229
  }
615
230
  };
616
231
 
617
- // src/types/objects.ts
618
- var SYSTEM_FIELD_NAMES = [
619
- "id",
620
- "createdAt",
621
- "updatedAt",
622
- "createdBy",
623
- "lastUpdatedBy"
624
- ];
625
- var RESERVED_ATTRIBUTE_NAMES = [
626
- // System fields (auto-managed)
627
- ...SYSTEM_FIELD_NAMES,
628
- // Other ObjectRecord properties
629
- "objectId",
630
- "label",
631
- "embeddingText",
632
- "values",
633
- "metadata",
634
- "deletedAt",
635
- "deletedBy",
636
- "schemaVersion"
637
- ];
638
- var RESERVED_OBJECT_NAMES = ["skill"];
639
-
640
232
  // src/types/permissions.ts
641
233
  var ALL_ACTIONS = ["read", "create", "update", "delete", "manage"];
642
234
  function actionsToAccessLevel(actions) {
@@ -672,6 +264,11 @@ function hasOptions(attr) {
672
264
  // src/types/user-profiles.ts
673
265
  var USER_STATUSES = ["active", "suspended"];
674
266
 
267
+ // src/types/schema-state.ts
268
+ function viewStateKey(view) {
269
+ return `${view.object}:${view.name}:${view.type}`;
270
+ }
271
+
675
272
  // src/types/views.ts
676
273
  function isDetailView(view) {
677
274
  return view.type === "detail";
@@ -680,12 +277,15 @@ function isListView(view) {
680
277
  return view.type === "list";
681
278
  }
682
279
  function isFieldGroup(group2) {
683
- return !group2.type || group2.type === "fields";
280
+ return group2.type === "fields";
684
281
  }
685
282
  function isRelationGroup(group2) {
686
283
  return group2.type === "relation";
687
284
  }
688
285
 
286
+ // src/types/pagination.ts
287
+ var ESTIMATED_COUNT_CAP = 1e4;
288
+
689
289
  // src/lib/object-helpers.ts
690
290
  function isEmptyObject(obj) {
691
291
  if (obj === null || obj === void 0) {
@@ -703,6 +303,21 @@ function toUndefinedIfEmpty(obj) {
703
303
  return isNotEmpty(obj) ? obj : void 0;
704
304
  }
705
305
 
306
+ // src/lib/byte-size.ts
307
+ var MAX_UNIT_INDEX = 4;
308
+ function computeByteMagnitude(bytes) {
309
+ if (bytes <= 0) return { value: 0, unitIndex: 0 };
310
+ const k = 1e3;
311
+ const unitIndex = Math.min(MAX_UNIT_INDEX, Math.floor(Math.log(bytes) / Math.log(k)));
312
+ const value = Number.parseFloat((bytes / k ** unitIndex).toFixed(1));
313
+ return { value, unitIndex };
314
+ }
315
+ var BYTE_UNIT_LABELS = ["B", "KB", "MB", "GB", "TB"];
316
+ function formatByteSize(bytes) {
317
+ const { value, unitIndex } = computeByteMagnitude(bytes);
318
+ return `${value} ${BYTE_UNIT_LABELS[unitIndex]}`;
319
+ }
320
+
706
321
  // src/lib/document-attribute.ts
707
322
  var DOCUMENT_SYSTEM_ATTRIBUTES = {
708
323
  ATTACHMENTS: "attachments"
@@ -710,13 +325,13 @@ var DOCUMENT_SYSTEM_ATTRIBUTES = {
710
325
  function isDocumentAttribute(attr) {
711
326
  return attr.type === "document";
712
327
  }
713
- function matchesMime(mime, accepted) {
714
- if (!accepted || accepted.length === 0) return true;
715
- return accepted.some((pattern) => {
716
- if (pattern.endsWith("/*")) {
717
- return mime.startsWith(pattern.slice(0, -1));
718
- }
719
- return mime === pattern;
328
+ function matchesAccepts(file, accepts) {
329
+ if (!accepts || accepts.length === 0) return true;
330
+ const name = file.name.toLowerCase();
331
+ return accepts.some((pattern) => {
332
+ if (pattern.endsWith("/*")) return file.mimeType.startsWith(pattern.slice(0, -1));
333
+ if (pattern.startsWith(".")) return name.endsWith(pattern.toLowerCase());
334
+ return file.mimeType === pattern;
720
335
  });
721
336
  }
722
337
 
@@ -846,7 +461,7 @@ function formatPhone(value) {
846
461
  if (!("phoneNumber" in phone2)) return String(value);
847
462
  if (!phone2.phoneNumber) return "";
848
463
  if (!phone2.countryCode) return phone2.phoneNumber;
849
- return chunkEBGRZUIH_js.formatPhoneForDisplay(phone2);
464
+ return chunkQ4SZAMJT_js.formatPhoneForDisplay(phone2);
850
465
  }
851
466
  function formatLocationValue(location2, granularity = "full") {
852
467
  if (typeof location2 !== "object" || location2 === null) return "";
@@ -946,7 +561,7 @@ function formatAttributeValue(value, attribute) {
946
561
  var SIMPLE_PIPES = ["UPPER", "LOWER", "capitalize", "trim"];
947
562
  var PIPES_WITH_ARGS = ["prefix", "suffix", "wrap", "default"];
948
563
  var ALL_PIPES = [...SIMPLE_PIPES, ...PIPES_WITH_ARGS];
949
- var labelExpressionSchema = z3.z.string().min(1, "labelExpression cannot be empty").refine((val) => isLabelExpression(val), {
564
+ var labelExpressionSchema = z2.z.string().min(1, "labelExpression cannot be empty").refine((val) => isLabelExpression(val), {
950
565
  message: "labelExpression must contain at least one {{ attribute }} interpolation"
951
566
  }).refine(
952
567
  (val) => {
@@ -970,6 +585,19 @@ var labelExpressionSchema = z3.z.string().min(1, "labelExpression cannot be empt
970
585
  message: `Invalid pipe name. Valid pipes: ${ALL_PIPES.join(", ")}`
971
586
  }
972
587
  );
588
+ function validateLabelExpression(expression) {
589
+ const result = labelExpressionSchema.safeParse(expression);
590
+ if (!result.success) {
591
+ return {
592
+ success: false,
593
+ error: result.error.issues[0]?.message ?? "Invalid labelExpression"
594
+ };
595
+ }
596
+ return {
597
+ success: true,
598
+ attributes: extractAttributeNames(expression)
599
+ };
600
+ }
973
601
  var simplePipes = {
974
602
  /** Convert to uppercase */
975
603
  UPPER: (v) => String(v).toUpperCase(),
@@ -1128,6 +756,13 @@ function getUserDisplayName(user2) {
1128
756
  return user2.email?.split("@")[0] ?? "";
1129
757
  }
1130
758
 
759
+ // src/lib/record-creator.ts
760
+ var RECORD_CREATOR_ROOT_ACTOR_METADATA_KEY = "__creatorRootActorId";
761
+ function getRecordCreatorPrincipalId(record) {
762
+ const creatorRootActorId = record.metadata?.[RECORD_CREATOR_ROOT_ACTOR_METADATA_KEY];
763
+ return typeof creatorRootActorId === "string" && creatorRootActorId.length > 0 ? creatorRootActorId : record.createdBy;
764
+ }
765
+
1131
766
  // src/constants/attribute-columns.ts
1132
767
  var DB_COLUMN_FIELDS = /* @__PURE__ */ new Set([
1133
768
  "id",
@@ -1269,6 +904,19 @@ var VALID_ICONS = new Set(constants.ICONS);
1269
904
  var ATTRIBUTE_NAME_REGEX = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
1270
905
  var MAX_NAME_LENGTH = 63;
1271
906
  var MAX_LABEL_LENGTH = 128;
907
+ var OBJECT_NAME_SCHEMA = z2__default.default.string().min(1, "Object name cannot be empty").max(63, "Object name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/, {
908
+ message: "Invalid object name format.\nName must be in kebab-case (slug format):\n \u2705 Valid: 'products', 'user-profiles', 'order-items'\n \u274C Invalid: 'Products', 'userProfiles', 'user_profiles'"
909
+ });
910
+ function validateObjectName(name) {
911
+ try {
912
+ OBJECT_NAME_SCHEMA.parse(name);
913
+ } catch (error) {
914
+ if (error instanceof z2__default.default.ZodError) {
915
+ throw new chunkFDIAOFHS_js.SchemaError(error.issues[0].message, chunkFDIAOFHS_js.SchemaErrorCode.INVALID_OBJECT_NAME);
916
+ }
917
+ throw error;
918
+ }
919
+ }
1272
920
  function assertUniqueBy(items, getKey, buildError) {
1273
921
  const seen = /* @__PURE__ */ new Set();
1274
922
  for (const item of items) {
@@ -1293,10 +941,10 @@ function validateAttributeName(name) {
1293
941
  "[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'"
1294
942
  );
1295
943
  }
1296
- if (RESERVED_ATTRIBUTE_NAMES.includes(name)) {
944
+ if (chunk63WWFZFY_js.RESERVED_ATTRIBUTE_NAMES.includes(name)) {
1297
945
  throw new Error(
1298
946
  `[AttributeBuilder] "${name}" is a reserved name and cannot be used as an attribute name.
1299
- Reserved names: ${RESERVED_ATTRIBUTE_NAMES.join(", ")}`
947
+ Reserved names: ${chunk63WWFZFY_js.RESERVED_ATTRIBUTE_NAMES.join(", ")}`
1300
948
  );
1301
949
  }
1302
950
  }
@@ -1363,14 +1011,30 @@ var DEFAULT_AGENT_EXECUTION_CONFIG = {
1363
1011
  var AgentBuilder = class {
1364
1012
  constructor(config) {
1365
1013
  if (!config.name || config.name.trim().length === 0) {
1366
- throw new chunkZBQEMIAV_js.ValidationError("Agent name is required", []);
1014
+ throw new chunkFDIAOFHS_js.ValidationError("Agent name is required", []);
1367
1015
  }
1368
- this.bp = { name: config.name, system: true, triggers: [] };
1016
+ this.bp = { name: config.name, system: true, visibility: "workspace", triggers: [] };
1369
1017
  }
1370
1018
  description(value) {
1371
1019
  this.bp.description = value;
1372
1020
  return this;
1373
1021
  }
1022
+ /**
1023
+ * Display text shown wherever this agent's identity is rendered in the
1024
+ * UI — a separate concern from `name` (the stable identity the boot sync
1025
+ * matches rows on). Falls back to `name` when never called.
1026
+ *
1027
+ * @example
1028
+ * ```typescript
1029
+ * agent({ name: "architecte" })
1030
+ * .label("Architecte")
1031
+ * // ...
1032
+ * ```
1033
+ */
1034
+ label(value) {
1035
+ this.bp.label = value;
1036
+ return this;
1037
+ }
1374
1038
  icon(value) {
1375
1039
  this.bp.icon = value;
1376
1040
  return this;
@@ -1409,6 +1073,32 @@ var AgentBuilder = class {
1409
1073
  Object.assign(this.bp, value);
1410
1074
  return this;
1411
1075
  }
1076
+ approval(value) {
1077
+ this.bp.approval = { ...DEFAULT_APPROVAL_POLICY, ...this.bp.approval, ...value };
1078
+ return this;
1079
+ }
1080
+ /** Runtime-agent visibility. Code-declared system agents must stay workspace-visible. */
1081
+ visibility(value) {
1082
+ this.bp.visibility = value;
1083
+ return this;
1084
+ }
1085
+ /**
1086
+ * Gate this agent behind a system permission: an actor lacking `action` on
1087
+ * `resource` never sees it in the agent list and cannot open a session
1088
+ * against it. Reuses the same permission vocabulary that guards the
1089
+ * matching HTTP surface — do not invent a new resource/action pair.
1090
+ *
1091
+ * @example
1092
+ * ```typescript
1093
+ * agent({ name: "architecte" })
1094
+ * .requiresPermission("architect", "update")
1095
+ * // ...
1096
+ * ```
1097
+ */
1098
+ requiresPermission(resource, action) {
1099
+ this.bp.requiredPermission = { resource, action };
1100
+ return this;
1101
+ }
1412
1102
  /**
1413
1103
  * Declare a trigger. `name` is the stable identity the boot sync uses to
1414
1104
  * reconcile trigger rows; `enabled` defaults to true.
@@ -1436,18 +1126,25 @@ var AgentBuilder = class {
1436
1126
  }
1437
1127
  build() {
1438
1128
  if (!this.bp.systemPrompt) {
1439
- throw new chunkZBQEMIAV_js.ValidationError(`Agent "${this.bp.name}": systemPrompt is required`, []);
1129
+ throw new chunkFDIAOFHS_js.ValidationError(`Agent "${this.bp.name}": systemPrompt is required`, []);
1440
1130
  }
1441
1131
  if (!this.bp.model) {
1442
- throw new chunkZBQEMIAV_js.ValidationError(`Agent "${this.bp.name}": model is required`, []);
1132
+ throw new chunkFDIAOFHS_js.ValidationError(`Agent "${this.bp.name}": model is required`, []);
1133
+ }
1134
+ if (this.bp.system && this.bp.visibility === "private") {
1135
+ throw new chunkFDIAOFHS_js.ValidationError(
1136
+ `Agent "${this.bp.name}": system agents must use workspace visibility`,
1137
+ []
1138
+ );
1443
1139
  }
1444
1140
  assertUniqueBy(
1445
1141
  this.bp.triggers,
1446
1142
  (t) => t.name,
1447
- (name) => new chunkZBQEMIAV_js.ValidationError(`Agent "${this.bp.name}": duplicate trigger name "${name}"`, [])
1143
+ (name) => new chunkFDIAOFHS_js.ValidationError(`Agent "${this.bp.name}": duplicate trigger name "${name}"`, [])
1448
1144
  );
1449
1145
  return {
1450
1146
  ...this.bp,
1147
+ visibility: this.bp.visibility ?? "workspace",
1451
1148
  config: this.bp.config ?? DEFAULT_AGENT_EXECUTION_CONFIG,
1452
1149
  systemPrompt: this.bp.systemPrompt,
1453
1150
  model: this.bp.model
@@ -1498,7 +1195,7 @@ var BaseAttributeBuilder = class {
1498
1195
  * @see https://standardschema.dev/
1499
1196
  */
1500
1197
  get "~standard"() {
1501
- const zodSchema = chunkNI3HCSYH_js.createAttributeValidator(this.build());
1198
+ const zodSchema = chunkV6Q7HCA7_js.createAttributeValidator(this.build());
1502
1199
  return createStandardSchemaProps(zodSchema);
1503
1200
  }
1504
1201
  constructor(type, name, label) {
@@ -1619,6 +1316,7 @@ var TextAttributeBuilder = class extends BaseAttributeBuilder {
1619
1316
  }
1620
1317
  pattern(value) {
1621
1318
  this.attr.pattern = value;
1319
+ this.attr.format = void 0;
1622
1320
  return this;
1623
1321
  }
1624
1322
  multiline(value = true) {
@@ -1637,21 +1335,24 @@ var TextAttributeBuilder = class extends BaseAttributeBuilder {
1637
1335
  * Set email validation pattern
1638
1336
  */
1639
1337
  email() {
1640
- this.attr.pattern = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$";
1338
+ this.attr.format = "email";
1339
+ this.attr.pattern = void 0;
1641
1340
  return this;
1642
1341
  }
1643
1342
  /**
1644
1343
  * Set URL validation pattern
1645
1344
  */
1646
1345
  url() {
1647
- this.attr.pattern = "^https?:\\/\\/[\\w\\-]+(\\.[\\w\\-]+)+[/#?]?.*$";
1346
+ this.attr.format = "url";
1347
+ this.attr.pattern = void 0;
1648
1348
  return this;
1649
1349
  }
1650
1350
  /**
1651
1351
  * Set slug validation pattern
1652
1352
  */
1653
1353
  slug() {
1654
- this.attr.pattern = "^[a-z0-9]+(?:-[a-z0-9]+)*$";
1354
+ this.attr.format = "slug";
1355
+ this.attr.pattern = void 0;
1655
1356
  return this;
1656
1357
  }
1657
1358
  };
@@ -2241,9 +1942,9 @@ var RollupAttributeBuilder = class extends BaseAttributeBuilder {
2241
1942
  if (fn === "original" && targetType !== void 0 && targetType !== "select" && targetType !== "status" && targetType !== "multiselect") {
2242
1943
  const relation2 = this.attr.relationAttribute ?? "relation";
2243
1944
  const target = this.attr.targetAttribute ?? "field";
2244
- throw new chunkZBQEMIAV_js.SchemaError(
1945
+ throw new chunkFDIAOFHS_js.SchemaError(
2245
1946
  `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}").`,
2246
- chunkZBQEMIAV_js.SchemaErrorCode.VALIDATION_FAILED
1947
+ chunkFDIAOFHS_js.SchemaErrorCode.VALIDATION_FAILED
2247
1948
  );
2248
1949
  }
2249
1950
  return super.build();
@@ -2521,13 +2222,13 @@ var FormBuilder = class {
2521
2222
  return this;
2522
2223
  }
2523
2224
  validateName(name) {
2524
- const schema = z3.z.string().min(1, "Form name cannot be empty").max(63, "Form name is too long (max 63 characters)").regex(/^[a-z0-9]+(-[a-z0-9]+)*$/, {
2225
+ const schema = z2.z.string().min(1, "Form name cannot be empty").max(63, "Form name is too long (max 63 characters)").regex(/^[a-z0-9]+(-[a-z0-9]+)*$/, {
2525
2226
  message: "Invalid form name format. Name must be in kebab-case: 'client-onboarding', 'contact-creation'"
2526
2227
  });
2527
2228
  try {
2528
2229
  schema.parse(name);
2529
2230
  } catch (error) {
2530
- if (error instanceof z3.z.ZodError) {
2231
+ if (error instanceof z2.z.ZodError) {
2531
2232
  throw new Error(`[FormBuilder] ${error.issues[0].message}`);
2532
2233
  }
2533
2234
  throw error;
@@ -2753,7 +2454,7 @@ var ObjectBuilder = class {
2753
2454
  * @see https://standardschema.dev/
2754
2455
  */
2755
2456
  get "~standard"() {
2756
- const zodSchema = chunkNI3HCSYH_js.createObjectValidator(this.build());
2457
+ const zodSchema = chunkV6Q7HCA7_js.createObjectValidator(this.build());
2757
2458
  return createStandardSchemaProps(zodSchema);
2758
2459
  }
2759
2460
  /**
@@ -2967,26 +2668,26 @@ var ObjectBuilder = class {
2967
2668
  throw new Error("[ObjectBuilder] Missing required field: label");
2968
2669
  }
2969
2670
  if (!this._labelExpression) {
2970
- throw new chunkZBQEMIAV_js.SchemaError(
2671
+ throw new chunkFDIAOFHS_js.SchemaError(
2971
2672
  `Object "${this.obj.name}" must have a labelExpression. The labelExpression defines how records are displayed in lists and relations (e.g. "{{ name }}").`,
2972
- chunkZBQEMIAV_js.SchemaErrorCode.VALIDATION_FAILED
2673
+ chunkFDIAOFHS_js.SchemaErrorCode.VALIDATION_FAILED
2973
2674
  );
2974
2675
  }
2975
2676
  const labelResult = labelExpressionSchema.safeParse(this._labelExpression);
2976
2677
  if (!labelResult.success) {
2977
2678
  const errorMsg = labelResult.error.issues[0]?.message ?? "Invalid labelExpression";
2978
- throw new chunkZBQEMIAV_js.SchemaError(
2679
+ throw new chunkFDIAOFHS_js.SchemaError(
2979
2680
  `Invalid labelExpression for "${this.obj.name}": ${errorMsg}`,
2980
- chunkZBQEMIAV_js.SchemaErrorCode.VALIDATION_FAILED
2681
+ chunkFDIAOFHS_js.SchemaErrorCode.VALIDATION_FAILED
2981
2682
  );
2982
2683
  }
2983
2684
  if (this._embeddingExpression !== void 0) {
2984
2685
  const embeddingResult = labelExpressionSchema.safeParse(this._embeddingExpression);
2985
2686
  if (!embeddingResult.success) {
2986
2687
  const errorMsg = embeddingResult.error.issues[0]?.message ?? "Invalid embeddingExpression";
2987
- throw new chunkZBQEMIAV_js.SchemaError(
2688
+ throw new chunkFDIAOFHS_js.SchemaError(
2988
2689
  `Invalid embeddingExpression for "${this.obj.name}": ${errorMsg}`,
2989
- chunkZBQEMIAV_js.SchemaErrorCode.VALIDATION_FAILED
2690
+ chunkFDIAOFHS_js.SchemaErrorCode.VALIDATION_FAILED
2990
2691
  );
2991
2692
  }
2992
2693
  }
@@ -3020,17 +2721,7 @@ var ObjectBuilder = class {
3020
2721
  if (name === void 0) {
3021
2722
  return;
3022
2723
  }
3023
- const objectNameSchema = z3__default.default.string().min(1, "Object name cannot be empty").max(63, "Object name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/, {
3024
- message: "Invalid object name format.\nName must be in kebab-case (slug format):\n \u2705 Valid: 'products', 'user-profiles', 'order-items'\n \u274C Invalid: 'Products', 'userProfiles', 'user_profiles'"
3025
- });
3026
- try {
3027
- objectNameSchema.parse(name);
3028
- } catch (error) {
3029
- if (error instanceof z3__default.default.ZodError) {
3030
- throw new chunkZBQEMIAV_js.SchemaError(error.issues[0].message, chunkZBQEMIAV_js.SchemaErrorCode.INVALID_OBJECT_NAME);
3031
- }
3032
- throw error;
3033
- }
2724
+ validateObjectName(name);
3034
2725
  }
3035
2726
  };
3036
2727
  function object(config) {
@@ -3038,7 +2729,7 @@ function object(config) {
3038
2729
  }
3039
2730
  function validatePresetStructure(presetId, nodes, depth) {
3040
2731
  const fail = (message, detail) => {
3041
- throw new chunkZBQEMIAV_js.ValidationError(message, [
2732
+ throw new chunkFDIAOFHS_js.ValidationError(message, [
3042
2733
  { path: ["documentLayout", "presets", presetId], message: detail }
3043
2734
  ]);
3044
2735
  };
@@ -3065,7 +2756,7 @@ function validatePresetStructure(presetId, nodes, depth) {
3065
2756
  }
3066
2757
  var GroupBuilder = class {
3067
2758
  constructor(id, label) {
3068
- this.data = { fields: [] };
2759
+ this.data = { type: "fields", fields: [] };
3069
2760
  this.data.id = id;
3070
2761
  this.data.label = label;
3071
2762
  }
@@ -3187,17 +2878,6 @@ var RelationGroupBuilder = class {
3187
2878
  this.data.allowCreate = value;
3188
2879
  return this;
3189
2880
  }
3190
- /**
3191
- * Enable two-level traversal (through mode).
3192
- * Parent rows become grouping headers; sub-rows from `attribute` are the primary display.
3193
- *
3194
- * @param attribute - Relation attribute on the first-level target object
3195
- * @example .through("companies") — display companies linked via each member
3196
- */
3197
- through(attribute) {
3198
- this.data.through = { attribute };
3199
- return this;
3200
- }
3201
2881
  /**
3202
2882
  * Build the relation group definition
3203
2883
  */
@@ -3215,7 +2895,7 @@ var RelationGroupBuilder = class {
3215
2895
  }
3216
2896
  };
3217
2897
  function validateViewName(name, builderName, examples) {
3218
- const viewNameSchema = z3.z.string().min(1, "View name cannot be empty").max(63, "View name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/, {
2898
+ const viewNameSchema = z2.z.string().min(1, "View name cannot be empty").max(63, "View name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/, {
3219
2899
  message: `Invalid view name format.
3220
2900
  Name must be in kebab-case:
3221
2901
  \u2705 Valid: ${examples.valid}
@@ -3224,7 +2904,7 @@ Name must be in kebab-case:
3224
2904
  try {
3225
2905
  viewNameSchema.parse(name);
3226
2906
  } catch (error) {
3227
- if (error instanceof z3.z.ZodError) {
2907
+ if (error instanceof z2.z.ZodError) {
3228
2908
  throw new Error(`[${builderName}] ${error.issues[0].message}`);
3229
2909
  }
3230
2910
  throw error;
@@ -3318,29 +2998,6 @@ var TableTabConfig = class {
3318
2998
  this.tabData.sorts.push({ attribute, direction });
3319
2999
  return this;
3320
3000
  }
3321
- /**
3322
- * Traverse a 2nd-level relation to display nested data.
3323
- * When active, `tab.columns` stores the 2nd-level object's attribute names.
3324
- *
3325
- * @param attribute - Relation attribute on the first-level target object
3326
- * @example .table("members").through("companies").columns(["name", "sector"])
3327
- */
3328
- through(attribute) {
3329
- this.tabData.through = { attribute };
3330
- return this;
3331
- }
3332
- /**
3333
- * Show _source and _target columns in flattened (through) view
3334
- */
3335
- showSourceTarget(value = true) {
3336
- if (!this.tabData.through) {
3337
- throw new Error(
3338
- `[TableTabConfig] showSourceTarget() requires through() to be called first for tab "${this.tabData.name}"`
3339
- );
3340
- }
3341
- this.tabData.through.showSourceTarget = value;
3342
- return this;
3343
- }
3344
3001
  /**
3345
3002
  * Continue building with a new tab
3346
3003
  */
@@ -3798,6 +3455,17 @@ var DetailViewBuilder = class {
3798
3455
  function detailView(name, label) {
3799
3456
  return new DetailViewBuilder(name, label);
3800
3457
  }
3458
+ function findProtectedTabFilterAttribute(node) {
3459
+ if (Array.isArray(node)) {
3460
+ return node.map(findProtectedTabFilterAttribute).find((attribute) => attribute !== void 0);
3461
+ }
3462
+ if (node === null || typeof node !== "object") return void 0;
3463
+ const candidate = node;
3464
+ if (candidate.attribute === "visibility" || candidate.attribute === "ownedBy") {
3465
+ return candidate.attribute;
3466
+ }
3467
+ return findProtectedTabFilterAttribute(candidate.rules) ?? findProtectedTabFilterAttribute(candidate.groups);
3468
+ }
3801
3469
  var ListViewBuilder = class {
3802
3470
  constructor(name, label) {
3803
3471
  validateViewName(name, "ListViewBuilder", {
@@ -3907,28 +3575,39 @@ var ListViewBuilder = class {
3907
3575
  combinator: this.data.defaultFilters.combinator,
3908
3576
  rules: this.data.defaultFilters.rules
3909
3577
  } : void 0,
3910
- tabs: this.data.tabs.map((tab) => ({
3911
- id: tab.id,
3912
- label: tab.label,
3913
- icon: tab.icon,
3914
- default: tab.default,
3915
- layout: tab.layout,
3916
- columns: tab.columns,
3917
- columnSizing: tab.columnSizing,
3918
- filters: tab.filters ? {
3919
- id: chunkFRCDMQER_js.generateId(),
3920
- combinator: tab.filters.combinator,
3921
- rules: tab.filters.rules
3922
- } : void 0,
3923
- sorts: tab.sorts,
3924
- groupByAttribute: tab.groupByAttribute,
3925
- cardUserAttribute: tab.cardUserAttribute,
3926
- cardDateAttribute: tab.cardDateAttribute,
3927
- createMode: tab.createMode,
3928
- kanbanColumnOrder: tab.kanbanColumnOrder,
3929
- kanbanColumnVisibility: tab.kanbanColumnVisibility,
3930
- kanbanPinnedColumns: tab.kanbanPinnedColumns
3931
- }))
3578
+ tabs: this.data.tabs.map((tab) => {
3579
+ const common = {
3580
+ id: tab.id,
3581
+ label: tab.label,
3582
+ icon: tab.icon,
3583
+ default: tab.default,
3584
+ // Which records the tab scopes to — a tab-level scope, never a
3585
+ // record's own column (see the visibility notes in CLAUDE.md).
3586
+ visibility: tab.visibility,
3587
+ columns: tab.columns,
3588
+ filters: tab.filters ? {
3589
+ id: chunkFRCDMQER_js.generateId(),
3590
+ combinator: tab.filters.combinator,
3591
+ rules: tab.filters.rules
3592
+ } : void 0,
3593
+ sorts: tab.sorts,
3594
+ createMode: tab.createMode
3595
+ };
3596
+ return tab.layout === "kanban" ? {
3597
+ ...common,
3598
+ layout: "kanban",
3599
+ groupByAttribute: tab.groupByAttribute,
3600
+ cardUserAttribute: tab.cardUserAttribute,
3601
+ cardDateAttribute: tab.cardDateAttribute,
3602
+ kanbanColumnOrder: tab.kanbanColumnOrder,
3603
+ kanbanColumnVisibility: tab.kanbanColumnVisibility,
3604
+ kanbanPinnedColumns: tab.kanbanPinnedColumns
3605
+ } : {
3606
+ ...common,
3607
+ layout: "table",
3608
+ columnSizing: tab.columnSizing
3609
+ };
3610
+ })
3932
3611
  };
3933
3612
  return {
3934
3613
  name: this.data.name,
@@ -3950,6 +3629,7 @@ var ListViewTabConfigBuilder = class _ListViewTabConfigBuilder {
3950
3629
  this.tabData = {
3951
3630
  id,
3952
3631
  label,
3632
+ visibility: "all",
3953
3633
  layout: "table",
3954
3634
  columns: []
3955
3635
  };
@@ -3968,6 +3648,14 @@ var ListViewTabConfigBuilder = class _ListViewTabConfigBuilder {
3968
3648
  this.tabData.default = true;
3969
3649
  return this;
3970
3650
  }
3651
+ /**
3652
+ * Set the record scope this tab reads. Defaults to `"all"` (no scope: every
3653
+ * workspace record plus the viewer's own private ones).
3654
+ */
3655
+ visibility(value) {
3656
+ this.tabData.visibility = value;
3657
+ return this;
3658
+ }
3971
3659
  /**
3972
3660
  * Set the layout to table (default)
3973
3661
  */
@@ -4061,6 +3749,11 @@ var ListViewTabConfigBuilder = class _ListViewTabConfigBuilder {
4061
3749
  * @example .filter({ combinator: "and", rules: [{ attribute: "status", operator: "is", value: "active" }] })
4062
3750
  */
4063
3751
  filter(filters) {
3752
+ const protectedAttribute = findProtectedTabFilterAttribute(filters);
3753
+ if (protectedAttribute) {
3754
+ const message = `Tab filters cannot target "${protectedAttribute}". Use .visibility("private")`;
3755
+ throw new chunkFDIAOFHS_js.ValidationError(message, [{ path: ["filters"], message }]);
3756
+ }
4064
3757
  this.tabData.filters = filters;
4065
3758
  return this;
4066
3759
  }
@@ -4273,7 +3966,7 @@ function jsonFlag(name, defaultValue) {
4273
3966
 
4274
3967
  // src/feature-flags/flag-registry.ts
4275
3968
  function duplicateFlagError(name) {
4276
- return new chunkZBQEMIAV_js.DuplicateError(
3969
+ return new chunkFDIAOFHS_js.DuplicateError(
4277
3970
  "feature flag",
4278
3971
  name,
4279
3972
  `Flag "${name}" is already registered. Each flag name must be unique.`
@@ -4351,7 +4044,7 @@ var FlagRegistry = class {
4351
4044
  getOrThrow(name) {
4352
4045
  const flag = this.get(name);
4353
4046
  if (!flag) {
4354
- throw new chunkZBQEMIAV_js.NotFoundError(
4047
+ throw new chunkFDIAOFHS_js.NotFoundError(
4355
4048
  "Feature flag",
4356
4049
  name,
4357
4050
  void 0,
@@ -4508,19 +4201,19 @@ var FlagService = class {
4508
4201
  */
4509
4202
  async setOverride(flagName, level, value, options = {}) {
4510
4203
  if (!this.repository) {
4511
- throw new chunkZBQEMIAV_js.SchemaError(
4204
+ throw new chunkFDIAOFHS_js.SchemaError(
4512
4205
  "Cannot set override: no FeatureFlagsRepository configured. Add featureFlags to your DatabaseAdapter to enable runtime overrides.",
4513
- chunkZBQEMIAV_js.SchemaErrorCode.CONFIGURATION_REQUIRED
4206
+ chunkFDIAOFHS_js.SchemaErrorCode.CONFIGURATION_REQUIRED
4514
4207
  );
4515
4208
  }
4516
4209
  const flag = this.registry.get(flagName);
4517
4210
  if (flag && !flag.allowedLevels.includes(level)) {
4518
4211
  const message = `Flag "${flagName}" does not allow ${level}-level overrides. Allowed levels: ${flag.allowedLevels.join(", ")}`;
4519
- throw new chunkZBQEMIAV_js.ValidationError(message, [{ path: ["level"], message }]);
4212
+ throw new chunkFDIAOFHS_js.ValidationError(message, [{ path: ["level"], message }]);
4520
4213
  }
4521
4214
  if (flag?.system) {
4522
4215
  const message = `Flag "${flagName}" is a system flag and cannot be overridden via API.`;
4523
- throw new chunkZBQEMIAV_js.ValidationError(message, [{ path: ["flagName"], message }]);
4216
+ throw new chunkFDIAOFHS_js.ValidationError(message, [{ path: ["flagName"], message }]);
4524
4217
  }
4525
4218
  await this.repository.setOverride({
4526
4219
  flagName,
@@ -4540,9 +4233,9 @@ var FlagService = class {
4540
4233
  */
4541
4234
  async deleteOverride(flagName, level, targetId) {
4542
4235
  if (!this.repository) {
4543
- throw new chunkZBQEMIAV_js.SchemaError(
4236
+ throw new chunkFDIAOFHS_js.SchemaError(
4544
4237
  "Cannot delete override: no FeatureFlagsRepository configured.",
4545
- chunkZBQEMIAV_js.SchemaErrorCode.CONFIGURATION_REQUIRED
4238
+ chunkFDIAOFHS_js.SchemaErrorCode.CONFIGURATION_REQUIRED
4546
4239
  );
4547
4240
  }
4548
4241
  await this.repository.deleteOverride(flagName, level, targetId);
@@ -4679,7 +4372,7 @@ var NativeObjectRegistryClass = class {
4679
4372
  if (!object2.system) {
4680
4373
  const message = `[NativeObjectRegistry] Cannot register object "${object2.name}" (id: ${object2.id}): missing system flag.
4681
4374
  Native objects must have system=true. Did you call .runtime() on the builder? Remove that call \u2014 objects are system:true by default.`;
4682
- throw new chunkZBQEMIAV_js.ValidationError(message, []);
4375
+ throw new chunkFDIAOFHS_js.ValidationError(message, []);
4683
4376
  }
4684
4377
  if (this.objects.has(object2.name)) {
4685
4378
  const existing = this.objects.get(object2.name);
@@ -4687,7 +4380,7 @@ Native objects must have system=true. Did you call .runtime() on the builder? Re
4687
4380
  - Existing: "${existing?.label}" (id: ${existing?.id})
4688
4381
  - New: "${object2.label}" (id: ${object2.id})
4689
4382
  Please use unique names for each native object.`;
4690
- throw new chunkZBQEMIAV_js.DuplicateError("object", object2.name, message);
4383
+ throw new chunkFDIAOFHS_js.DuplicateError("object", object2.name, message);
4691
4384
  }
4692
4385
  this.objects.set(object2.name, cloneObjectDefinition(object2));
4693
4386
  }
@@ -4719,7 +4412,7 @@ Please use unique names for each native object.`;
4719
4412
  if (!object2) {
4720
4413
  const message = `[NativeObjectRegistry] Native object "${name}" not found.
4721
4414
  Available objects: ${this.listNames().join(", ")}`;
4722
- throw new chunkZBQEMIAV_js.NotFoundError("Native object", name, chunkZBQEMIAV_js.SchemaErrorCode.OBJECT_NOT_FOUND, message);
4415
+ throw new chunkFDIAOFHS_js.NotFoundError("Native object", name, chunkFDIAOFHS_js.SchemaErrorCode.OBJECT_NOT_FOUND, message);
4723
4416
  }
4724
4417
  return object2;
4725
4418
  }
@@ -4818,7 +4511,7 @@ var SKILL_OBJECT = object({ name: "skill", label: "Skill" }).sealed().icon("spar
4818
4511
  )
4819
4512
  ).attribute(richtext({ name: "content", label: "Content" }).defaultValue(SKILL_CONTENT_TEMPLATE)).build();
4820
4513
  var SKILL_VIEW = detailView("skill-detail", "Skill").for("skill").default().sidePanel({ attributes: ["name", "description"] }).tab("content", "Content").richtext("content").titleAttribute("name").done().tab("files", "Files").documents().done().build();
4821
- var SKILL_LIST_VIEW = listView("skill-list", "Skills").for("skill").default().tab("all", "All").table().columns("name", "description").sort("name", "asc").build();
4514
+ var SKILL_LIST_VIEW = listView("skill-list", "Skills").for("skill").default().tab("workspace", "Skills").default().icon("table").visibility("workspace").table().columns("name", "description").sort("name", "asc").tab("mine", "Mes skills").icon("lock").visibility("private").table().columns("name", "description").sort("name", "asc").build();
4822
4515
  var MEMORY_OBJECT = object({ name: "memory", label: "Memory" }).sealed().icon("database").order(Number.MAX_SAFE_INTEGER).pluralLabel("Memories").labelExpression("{{ name }}").embeddingExpression("{{ name }}\n{{ description }}\n{{ content }}").attribute(text({ name: "name", label: "Name" }).maxLength(constants.MEMORY_NAME_MAX_LENGTH).required()).attribute(
4823
4516
  text({ name: "description", label: "Description" }).multiline().maxLength(constants.MEMORY_DESCRIPTION_MAX_LENGTH).required()
4824
4517
  ).attribute(text({ name: "content", label: "Content" }).multiline()).attribute(
@@ -4828,9 +4521,9 @@ var MEMORY_OBJECT = object({ name: "memory", label: "Memory" }).sealed().icon("d
4828
4521
  { value: "feedback", label: "Feedback" },
4829
4522
  { value: "reference", label: "Reference" }
4830
4523
  ])
4831
- ).attribute(user({ name: "owner", label: "Owner" })).attribute(relation({ name: "subjects", label: "Subjects" }).toAny().many()).attribute(relation({ name: "links", label: "Links" }).to("memory").many()).build();
4832
- var MEMORY_VIEW = detailView("memory-detail", "Memory").for("memory").default().sidePanel({ attributes: ["name", "description", "kind", "owner", "subjects", "links"] }).tab("content", "Content").form(group("content", "Content").field("content", { span: 12 })).build();
4833
- var MEMORY_LIST_VIEW = listView("memory-list", "Memories").for("memory").default().tab("all", "All").table().columns("name", "description", "kind", "owner").sort("name", "asc").build();
4524
+ ).attribute(relation({ name: "subjects", label: "Subjects" }).toAny().many()).attribute(relation({ name: "links", label: "Links" }).to("memory").many()).build();
4525
+ var MEMORY_VIEW = detailView("memory-detail", "Memory").for("memory").default().sidePanel({ attributes: ["name", "description", "kind", "subjects", "links"] }).tab("content", "Content").form(group("content", "Content").field("content", { span: 12 })).build();
4526
+ var MEMORY_LIST_VIEW = listView("memory-list", "Memories").for("memory").default().tab("workspace", "Memories").default().icon("table").visibility("workspace").table().columns("name", "kind", "description", "createdAt").sort("name", "asc").tab("mine", "Mes m\xE9moires").icon("lock").visibility("private").table().columns("name", "kind", "description", "createdAt").sort("name", "asc").build();
4834
4527
 
4835
4528
  // src/views/registry.ts
4836
4529
  function cloneViewDefinition(view) {
@@ -4858,7 +4551,7 @@ var ViewRegistry = class {
4858
4551
  const key = this.makeKey(view.object, view.name, view.type);
4859
4552
  if (this.views.has(key)) {
4860
4553
  const message = `[ViewRegistry] Duplicate view: "${view.name}" (${view.type}) for object "${view.object}"`;
4861
- throw new chunkZBQEMIAV_js.DuplicateError("view", key, message);
4554
+ throw new chunkFDIAOFHS_js.DuplicateError("view", key, message);
4862
4555
  }
4863
4556
  const storedView = cloneViewDefinition(view);
4864
4557
  this.views.set(key, storedView);
@@ -4903,7 +4596,7 @@ var ViewRegistry = class {
4903
4596
  const availableNames = available.map((v) => `${v.name} (${v.type})`).join(", ") || "(none)";
4904
4597
  const message = `[ViewRegistry] View "${viewName}" not found for object "${objectName}".
4905
4598
  Available views: ${availableNames}`;
4906
- throw new chunkZBQEMIAV_js.NotFoundError("View", `${objectName}:${viewName}`, void 0, message);
4599
+ throw new chunkFDIAOFHS_js.NotFoundError("View", `${objectName}:${viewName}`, void 0, message);
4907
4600
  }
4908
4601
  return view;
4909
4602
  }
@@ -4991,7 +4684,7 @@ var viewRegistry = new ViewRegistry();
4991
4684
  // src/views/auto-generator.ts
4992
4685
  function getRuntimeAttributes(attributes, excludeNames = []) {
4993
4686
  return attributes.filter(
4994
- (attr) => !(!getAttributeCapabilities(attr).lifecycle.visibleInRuntime || attr.system || excludeNames.includes(attr.name))
4687
+ (attr) => !(!chunk63WWFZFY_js.getAttributeCapabilities(attr).lifecycle.visibleInRuntime || attr.system || excludeNames.includes(attr.name))
4995
4688
  );
4996
4689
  }
4997
4690
  function sortAttributes(attributes) {
@@ -5024,7 +4717,7 @@ function generateDefaultDetailView(object2, options = {}) {
5024
4717
  const { includeActivityTab = true, includeDocumentsTab = true, excludeAttributes = [] } = options;
5025
4718
  const runtimeAttrs = getRuntimeAttributes(object2.attributes, excludeAttributes);
5026
4719
  const sortedAttrs = sortAttributes(
5027
- runtimeAttrs.filter((attr) => getAttributeCapabilities(attr).presentation.formField)
4720
+ runtimeAttrs.filter((attr) => chunk63WWFZFY_js.getAttributeCapabilities(attr).presentation.formField)
5028
4721
  );
5029
4722
  const formTab = {
5030
4723
  id: "form",
@@ -5035,6 +4728,7 @@ function generateDefaultDetailView(object2, options = {}) {
5035
4728
  {
5036
4729
  id: "general",
5037
4730
  label: "General",
4731
+ type: "fields",
5038
4732
  fields: sortedAttrs.map(attributeToField),
5039
4733
  order: 0
5040
4734
  }
@@ -5080,7 +4774,7 @@ function generateDefaultListView(object2, options = {}) {
5080
4774
  const { excludeAttributes = [], maxListColumns = 5 } = options;
5081
4775
  const runtimeAttrs = getRuntimeAttributes(object2.attributes, excludeAttributes);
5082
4776
  const sortedAttrs = sortAttributes(
5083
- runtimeAttrs.filter((attr) => getAttributeCapabilities(attr).presentation.defaultColumn)
4777
+ runtimeAttrs.filter((attr) => chunk63WWFZFY_js.getAttributeCapabilities(attr).presentation.defaultColumn)
5084
4778
  );
5085
4779
  const columns = sortedAttrs.slice(0, maxListColumns).map((attr) => attr.name);
5086
4780
  const config = {
@@ -5089,6 +4783,7 @@ function generateDefaultListView(object2, options = {}) {
5089
4783
  id: "all",
5090
4784
  label: "All",
5091
4785
  default: true,
4786
+ visibility: "workspace",
5092
4787
  layout: "table",
5093
4788
  columns
5094
4789
  }
@@ -5209,7 +4904,7 @@ var FormRegistry = class {
5209
4904
  const forms = Array.isArray(formOrForms) ? formOrForms : [formOrForms];
5210
4905
  for (const f of forms) {
5211
4906
  if (this.forms.has(f.name)) {
5212
- throw new chunkZBQEMIAV_js.DuplicateError("form", f.name, `[FormRegistry] Duplicate form: "${f.name}"`);
4907
+ throw new chunkFDIAOFHS_js.DuplicateError("form", f.name, `[FormRegistry] Duplicate form: "${f.name}"`);
5213
4908
  }
5214
4909
  this.forms.set(f.name, cloneFormDefinition(f));
5215
4910
  }
@@ -5348,6 +5043,8 @@ var BROWSER_PREVIEW_STATUSES = ["live", "paused", "ended", "disconnected"];
5348
5043
  var LIVE_EVENT_TYPE_REGISTRY = {
5349
5044
  "record.patch": true,
5350
5045
  "record.deleted": true,
5046
+ "record.removed": true,
5047
+ "record.created": true,
5351
5048
  "view.projection.stale": true,
5352
5049
  "agent.session.patch": true,
5353
5050
  "agent.unread.patch": true,
@@ -5394,6 +5091,33 @@ var BROWSER_PREVIEW_DESCRIPTOR_KEYS = [
5394
5091
  "sequence",
5395
5092
  "updatedAt"
5396
5093
  ];
5094
+ var RECORD_REMOVED_PAYLOAD_KEYS = [
5095
+ "type",
5096
+ "objectId",
5097
+ "recordId",
5098
+ "recordVersion"
5099
+ ];
5100
+ var RECORD_CREATED_PAYLOAD_KEYS = [
5101
+ "type",
5102
+ "objectId",
5103
+ "recordId",
5104
+ "recordVersion",
5105
+ "record"
5106
+ ];
5107
+ var RECORD_LIVE_SNAPSHOT_KEYS = [
5108
+ "id",
5109
+ "objectId",
5110
+ "visibility",
5111
+ "ownedBy",
5112
+ "label",
5113
+ "values",
5114
+ "metadata",
5115
+ "createdAt",
5116
+ "updatedAt",
5117
+ "createdBy",
5118
+ "lastUpdatedBy",
5119
+ "schemaVersion"
5120
+ ];
5397
5121
  function isLiveEventType(value) {
5398
5122
  return typeof value === "string" && LIVE_EVENT_TYPES.includes(value);
5399
5123
  }
@@ -5412,6 +5136,10 @@ function isLiveEventPayloadForType(type, payload) {
5412
5136
  return isRecordPatchPayload(payload);
5413
5137
  case "record.deleted":
5414
5138
  return isRecordDeletedPayload(payload);
5139
+ case "record.removed":
5140
+ return isRecordRemovedPayload(payload);
5141
+ case "record.created":
5142
+ return isRecordCreatedPayload(payload);
5415
5143
  case "view.projection.stale":
5416
5144
  return isViewProjectionStalePayload(payload);
5417
5145
  case "agent.session.patch":
@@ -5507,6 +5235,15 @@ function isRecordPatchPayload(payload) {
5507
5235
  function isRecordDeletedPayload(payload) {
5508
5236
  return payload.type === "record.deleted" && hasString(payload, "objectId") && hasString(payload, "recordId") && hasVersion(payload, "recordVersion") && hasString(payload, "deletedAt");
5509
5237
  }
5238
+ function isRecordRemovedPayload(payload) {
5239
+ return payload.type === "record.removed" && hasOnlyKeys(payload, RECORD_REMOVED_PAYLOAD_KEYS) && hasString(payload, "objectId") && hasString(payload, "recordId") && hasVersion(payload, "recordVersion");
5240
+ }
5241
+ function isRecordLiveSnapshot(value) {
5242
+ return isRecord(value) && hasOnlyKeys(value, RECORD_LIVE_SNAPSHOT_KEYS) && hasString(value, "id") && hasString(value, "objectId") && isOneOf(value.visibility, ["workspace", "private"]) && isNullableString(value.ownedBy) && (value.visibility === "workspace" && value.ownedBy === null || value.visibility === "private" && isNonEmptyString(value.ownedBy)) && hasString(value, "label") && isRecord(value.values) && hasOptional(value, "metadata", isRecord) && hasIsoDateString(value, "createdAt") && hasIsoDateString(value, "updatedAt") && hasOptional(value, "createdBy", isString) && hasOptional(value, "lastUpdatedBy", isString) && hasVersion(value, "schemaVersion");
5243
+ }
5244
+ function isRecordCreatedPayload(payload) {
5245
+ return payload.type === "record.created" && hasOnlyKeys(payload, RECORD_CREATED_PAYLOAD_KEYS) && hasString(payload, "objectId") && hasString(payload, "recordId") && hasVersion(payload, "recordVersion") && isRecordLiveSnapshot(payload.record) && payload.record.id === payload.recordId && payload.record.objectId === payload.objectId;
5246
+ }
5510
5247
  function isViewProjectionStalePayload(payload) {
5511
5248
  return payload.type === "view.projection.stale" && hasString(payload, "viewId") && isOneOf(payload.reason, VIEW_PROJECTION_STALE_REASONS);
5512
5249
  }
@@ -5745,7 +5482,7 @@ function assertAcyclicComputedDependencies(nodes) {
5745
5482
  }
5746
5483
  function parseCompileFormula(expression) {
5747
5484
  try {
5748
- return chunkL4U5QEQL_js.parseComputedFormula(expression);
5485
+ return chunkQN2N3IJZ_js.parseComputedFormula(expression);
5749
5486
  } catch (error) {
5750
5487
  if (error instanceof Error) {
5751
5488
  throw new ComputedFormulaCompileError(error.message);
@@ -6656,11 +6393,11 @@ function evaluateComputedAst(node, input) {
6656
6393
  return evaluateAst(node, input);
6657
6394
  }
6658
6395
  function evaluateComputedFormula(expression, input) {
6659
- return evaluateAst(chunkL4U5QEQL_js.parseComputedFormula(expression), input);
6396
+ return evaluateAst(chunkQN2N3IJZ_js.parseComputedFormula(expression), input);
6660
6397
  }
6661
6398
  function evaluateComputedFormulaWithResult(expression, input, returnType, decimals) {
6662
6399
  try {
6663
- const raw = evaluateAst(chunkL4U5QEQL_js.parseComputedFormula(expression), input);
6400
+ const raw = evaluateAst(chunkQN2N3IJZ_js.parseComputedFormula(expression), input);
6664
6401
  const value = returnType ? formatComputedResult(raw, returnType, decimals) : raw;
6665
6402
  return { value };
6666
6403
  } catch (error) {
@@ -6798,53 +6535,86 @@ var toDate2 = (v) => {
6798
6535
  return Number.isNaN(d.getTime()) ? null : d;
6799
6536
  };
6800
6537
  var toArr = (v) => Array.isArray(v) ? v : v == null ? [] : [v];
6801
- function relativeDateBoundary(rel) {
6802
- const ms = {
6803
- days: 864e5,
6804
- weeks: 6048e5,
6805
- months: 2592e6,
6806
- years: 31536e6
6807
- };
6808
- const offset = rel.amount * ms[rel.unit] * (rel.direction === "future" ? 1 : -1);
6809
- return new Date(Date.now() + offset);
6538
+ var compareNumbers = (v, rv, cmp) => {
6539
+ const a = toNum(v);
6540
+ const b = toNum(rv);
6541
+ return a !== null && b !== null && cmp(a, b);
6542
+ };
6543
+ var compareDates = (v, rv, cmp) => {
6544
+ const a = toDate2(v);
6545
+ const b = toDate2(rv);
6546
+ return a !== null && b !== null && cmp(a.getTime(), b.getTime());
6547
+ };
6548
+ var equalsForAttr = (v, rv, attr) => {
6549
+ if (attr.type === "number" || attr.type === "currency") {
6550
+ const a = toNum(v);
6551
+ const b = toNum(rv);
6552
+ if (a !== null && b !== null) return a === b;
6553
+ }
6554
+ return toStr(v) === toStr(rv);
6555
+ };
6556
+ function isCheckboxEquality(attributeType, value) {
6557
+ return attributeType ? attributeType === "checkbox" : typeof value === "boolean";
6810
6558
  }
6559
+ var orderingSpec = (cmp) => ({
6560
+ appliesTo: ["number", "currency", "date", "formula"],
6561
+ evaluateInMemory: (v, rv, attr) => attr.type === "date" ? compareDates(v, rv, cmp) : compareNumbers(v, rv, cmp)
6562
+ });
6811
6563
  var OPERATOR_SPECS = {
6812
- // ---- text-style ----
6564
+ // ---- equality ----
6813
6565
  is: {
6814
- appliesTo: ["text", "phone", "status", "select", "date", "formula"],
6815
- evaluateInMemory: (v, rv) => toStr(v) === toStr(rv)
6816
- },
6817
- is_not: {
6818
- appliesTo: ["text", "phone", "status", "select", "date", "formula"],
6819
- evaluateInMemory: (v, rv) => toStr(v) !== toStr(rv)
6820
- },
6821
- contains: {
6822
- appliesTo: ["text", "phone", "location", "user", "multiselect", "relation", "formula"],
6823
- evaluateInMemory: (v, rv) => {
6824
- if (Array.isArray(v)) return v.map(toStr).includes(toStr(rv));
6825
- return toStr(v).toLowerCase().includes(toStr(rv).toLowerCase());
6826
- }
6827
- },
6828
- not_contains: {
6829
- appliesTo: ["text", "phone", "user", "multiselect", "relation", "formula"],
6830
- evaluateInMemory: (v, rv) => {
6831
- if (Array.isArray(v)) return !v.map(toStr).includes(toStr(rv));
6832
- return !toStr(v).toLowerCase().includes(toStr(rv).toLowerCase());
6833
- }
6834
- },
6835
- starts_with: {
6836
- appliesTo: ["text", "formula"],
6837
- evaluateInMemory: (v, rv) => toStr(v).toLowerCase().startsWith(toStr(rv).toLowerCase())
6838
- },
6839
- ends_with: {
6840
- appliesTo: ["text", "formula"],
6841
- evaluateInMemory: (v, rv) => toStr(v).toLowerCase().endsWith(toStr(rv).toLowerCase())
6842
- },
6843
- is_empty: {
6844
6566
  appliesTo: [
6845
6567
  "text",
6846
- "richtext",
6847
- "number",
6568
+ "phone",
6569
+ "number",
6570
+ "currency",
6571
+ "checkbox",
6572
+ "status",
6573
+ "select",
6574
+ "date",
6575
+ "user",
6576
+ "relation",
6577
+ "formula"
6578
+ ],
6579
+ evaluateInMemory: (v, rv, attr) => attr.type === "checkbox" ? v === true === (rv === true) : equalsForAttr(v, rv, attr)
6580
+ },
6581
+ is_not: {
6582
+ appliesTo: [
6583
+ "text",
6584
+ "phone",
6585
+ "number",
6586
+ "currency",
6587
+ "status",
6588
+ "select",
6589
+ "date",
6590
+ "user",
6591
+ "relation",
6592
+ "formula"
6593
+ ],
6594
+ evaluateInMemory: (v, rv, attr) => !equalsForAttr(v, rv, attr)
6595
+ },
6596
+ // ---- text substring ----
6597
+ contains: {
6598
+ appliesTo: ["text", "phone", "formula"],
6599
+ evaluateInMemory: (v, rv) => toStr(v).toLowerCase().includes(toStr(rv).toLowerCase())
6600
+ },
6601
+ not_contains: {
6602
+ appliesTo: ["text", "phone", "formula"],
6603
+ evaluateInMemory: (v, rv) => !toStr(v).toLowerCase().includes(toStr(rv).toLowerCase())
6604
+ },
6605
+ starts_with: {
6606
+ appliesTo: ["text", "phone"],
6607
+ evaluateInMemory: (v, rv) => toStr(v).toLowerCase().startsWith(toStr(rv).toLowerCase())
6608
+ },
6609
+ ends_with: {
6610
+ appliesTo: ["text"],
6611
+ evaluateInMemory: (v, rv) => toStr(v).toLowerCase().endsWith(toStr(rv).toLowerCase())
6612
+ },
6613
+ is_empty: {
6614
+ appliesTo: [
6615
+ "text",
6616
+ "richtext",
6617
+ "number",
6848
6618
  "phone",
6849
6619
  "currency",
6850
6620
  "status",
@@ -6878,100 +6648,22 @@ var OPERATOR_SPECS = {
6878
6648
  ],
6879
6649
  evaluateInMemory: (v) => !isEmpty(v)
6880
6650
  },
6881
- // ---- numeric ----
6882
- eq: {
6883
- appliesTo: ["number", "currency", "formula"],
6884
- evaluateInMemory: (v, rv) => toNum(v) === toNum(rv)
6885
- },
6886
- neq: {
6887
- appliesTo: ["number", "currency", "formula"],
6888
- evaluateInMemory: (v, rv) => toNum(v) !== toNum(rv)
6889
- },
6890
- lt: {
6891
- appliesTo: ["number", "currency", "formula"],
6892
- evaluateInMemory: (v, rv) => {
6893
- const a = toNum(v);
6894
- const b = toNum(rv);
6895
- return a !== null && b !== null && a < b;
6896
- }
6897
- },
6898
- gt: {
6899
- appliesTo: ["number", "currency", "formula"],
6900
- evaluateInMemory: (v, rv) => {
6901
- const a = toNum(v);
6902
- const b = toNum(rv);
6903
- return a !== null && b !== null && a > b;
6904
- }
6905
- },
6906
- lte: {
6907
- appliesTo: ["number", "currency", "formula"],
6908
- evaluateInMemory: (v, rv) => {
6909
- const a = toNum(v);
6910
- const b = toNum(rv);
6911
- return a !== null && b !== null && a <= b;
6912
- }
6913
- },
6914
- gte: {
6915
- appliesTo: ["number", "currency", "formula"],
6916
- evaluateInMemory: (v, rv) => {
6917
- const a = toNum(v);
6918
- const b = toNum(rv);
6919
- return a !== null && b !== null && a >= b;
6920
- }
6921
- },
6922
- // ---- checkbox ----
6923
- is_checked: {
6924
- appliesTo: ["checkbox"],
6925
- evaluateInMemory: (v) => v === true
6926
- },
6927
- is_not_checked: {
6928
- appliesTo: ["checkbox"],
6929
- evaluateInMemory: (v) => v !== true
6930
- },
6931
- // ---- date ----
6932
- before: {
6933
- appliesTo: ["date"],
6934
- evaluateInMemory: (v, rv) => {
6935
- const a = toDate2(v);
6936
- const b = toDate2(rv);
6937
- return a !== null && b !== null && a < b;
6938
- }
6939
- },
6940
- after: {
6941
- appliesTo: ["date"],
6942
- evaluateInMemory: (v, rv) => {
6943
- const a = toDate2(v);
6944
- const b = toDate2(rv);
6945
- return a !== null && b !== null && a > b;
6946
- }
6947
- },
6948
- on_or_before: {
6949
- appliesTo: ["date"],
6950
- evaluateInMemory: (v, rv) => {
6951
- const a = toDate2(v);
6952
- const b = toDate2(rv);
6953
- return a !== null && b !== null && a <= b;
6954
- }
6955
- },
6956
- on_or_after: {
6957
- appliesTo: ["date"],
6958
- evaluateInMemory: (v, rv) => {
6959
- const a = toDate2(v);
6960
- const b = toDate2(rv);
6961
- return a !== null && b !== null && a >= b;
6962
- }
6963
- },
6651
+ // ---- ordering (numeric on number/currency/formula, chronological on date) ----
6652
+ less_than: orderingSpec((a, b) => a < b),
6653
+ greater_than: orderingSpec((a, b) => a > b),
6654
+ less_or_equal: orderingSpec((a, b) => a <= b),
6655
+ greater_or_equal: orderingSpec((a, b) => a >= b),
6656
+ // ---- date-only ----
6964
6657
  is_within: {
6965
6658
  appliesTo: ["date"],
6966
6659
  evaluateInMemory: (v, rv) => {
6967
6660
  const d = toDate2(v);
6968
- if (!d) return false;
6969
- const rel = rv;
6970
- const boundary = relativeDateBoundary(rel);
6971
- return rel.direction === "future" ? d >= /* @__PURE__ */ new Date() && d <= boundary : d >= boundary && d <= /* @__PURE__ */ new Date();
6661
+ const bounds = chunk63WWFZFY_js.resolveIsWithinBounds(rv);
6662
+ if (!(d && bounds)) return false;
6663
+ return d.getTime() >= bounds.startMs && d.getTime() < bounds.endMs;
6972
6664
  }
6973
6665
  },
6974
- day_month_eq: {
6666
+ on_day_month: {
6975
6667
  appliesTo: ["date"],
6976
6668
  evaluateInMemory: (v, rv) => {
6977
6669
  const d = toDate2(v);
@@ -6980,9 +6672,9 @@ var OPERATOR_SPECS = {
6980
6672
  return d.getMonth() + 1 === rule.month && d.getDate() === rule.day;
6981
6673
  }
6982
6674
  },
6983
- // ---- select multi-value ----
6675
+ // ---- set membership ----
6984
6676
  any_of: {
6985
- appliesTo: ["status", "select", "relation"],
6677
+ appliesTo: ["status", "select", "multiselect", "user", "relation"],
6986
6678
  evaluateInMemory: (v, rv) => {
6987
6679
  const ruleArr = toArr(rv).map(toStr);
6988
6680
  const valArr = toArr(v).map(toStr);
@@ -6990,7 +6682,7 @@ var OPERATOR_SPECS = {
6990
6682
  }
6991
6683
  },
6992
6684
  none_of: {
6993
- appliesTo: ["status", "select", "relation"],
6685
+ appliesTo: ["status", "select", "multiselect", "user", "relation"],
6994
6686
  evaluateInMemory: (v, rv) => {
6995
6687
  const ruleArr = toArr(rv).map(toStr);
6996
6688
  const valArr = toArr(v).map(toStr);
@@ -6999,37 +6691,34 @@ var OPERATOR_SPECS = {
6999
6691
  }
7000
6692
  };
7001
6693
 
7002
- // src/filters/evaluate.ts
7003
- function evaluateFilterState(state, values, attributes) {
7004
- if (state.rules.length === 0) return true;
7005
- const attrByName = new Map(attributes.map((a) => [a.name, a]));
7006
- const reducer = state.combinator === "or" ? "some" : "every";
7007
- return state.rules[reducer]((rule) => evaluateRule(rule, values, attrByName));
6694
+ // src/filters/extract-filter-value.ts
6695
+ function extractCurrencyFilterValue(value) {
6696
+ if (typeof value === "number") return value;
6697
+ if (value !== null && typeof value === "object" && "value" in value) {
6698
+ const inner = value.value;
6699
+ return typeof inner === "number" ? inner : null;
6700
+ }
6701
+ return null;
7008
6702
  }
7009
- function evaluateRule(rule, values, attrByName) {
7010
- const attr = attrByName.get(rule.attribute);
7011
- if (!attr) return false;
7012
- const spec = OPERATOR_SPECS[rule.operator];
7013
- if (!spec) return false;
7014
- if (!spec.appliesTo.includes(attr.type)) return false;
7015
- return spec.evaluateInMemory(values[rule.attribute], rule.value, attr);
6703
+ function extractFilterValue(value) {
6704
+ if (value === null || value === void 0) return null;
6705
+ if (typeof value === "object" && "value" in value) {
6706
+ return value.value ?? null;
6707
+ }
6708
+ return value;
7016
6709
  }
7017
6710
 
7018
6711
  // src/filters/polarity.ts
7019
6712
  var NEGATIVE_OPERATORS = /* @__PURE__ */ new Set([
7020
6713
  "is_not",
7021
6714
  "not_contains",
7022
- "neq",
7023
6715
  "none_of",
7024
- "is_not_checked",
7025
6716
  "is_empty"
7026
6717
  ]);
7027
6718
  var NEGATIVE_TO_POSITIVE = {
7028
6719
  is_not: "is",
7029
6720
  not_contains: "contains",
7030
- neq: "eq",
7031
6721
  none_of: "any_of",
7032
- is_not_checked: "is_checked",
7033
6722
  is_empty: "is_not_empty"
7034
6723
  };
7035
6724
  function getOperatorPolarity(op) {
@@ -7040,251 +6729,136 @@ function normalizeForEdgeRpc(op) {
7040
6729
  }
7041
6730
  var SINGLE_TO_MULTI = {
7042
6731
  is: "any_of",
7043
- eq: "any_of",
7044
- contains: "any_of",
7045
- is_not: "none_of",
7046
- neq: "none_of",
7047
- not_contains: "none_of"
6732
+ is_not: "none_of"
7048
6733
  };
7049
6734
  function toMultiValueOperator(op) {
7050
6735
  return SINGLE_TO_MULTI[op] ?? op;
7051
6736
  }
7052
6737
 
7053
- // src/filters/dynamic-value.ts
7054
- function isDynamicValue(value) {
7055
- return typeof value === "object" && value !== null && !Array.isArray(value) && "dynamic" in value;
7056
- }
7057
- function currentActor() {
7058
- return { dynamic: "actor", ref: "current" };
7059
- }
7060
- function today() {
7061
- return { dynamic: "date", anchor: "today" };
7062
- }
7063
- function now() {
7064
- return { dynamic: "date", anchor: "now" };
6738
+ // src/filters/evaluate.ts
6739
+ var systemAttribute = (name, type) => ({ id: `system:${name}`, name, label: name, type, system: true });
6740
+ var RECORD_SYSTEM_ATTRIBUTES = [
6741
+ ...Object.entries(chunk63WWFZFY_js.SYSTEM_FILTER_ATTRIBUTE_TYPES).map(
6742
+ ([name, type]) => systemAttribute(name, type)
6743
+ )
6744
+ ];
6745
+ function evaluateRecordFilterState(state, record, attributes) {
6746
+ const physical = record;
6747
+ return evaluateFilterState(
6748
+ state,
6749
+ {
6750
+ ...record.values,
6751
+ id: record.id,
6752
+ objectId: record.objectId,
6753
+ objectName: physical.objectName,
6754
+ tenantId: physical.tenantId,
6755
+ label: record.label,
6756
+ createdAt: record.createdAt,
6757
+ updatedAt: record.updatedAt,
6758
+ createdBy: record.createdBy,
6759
+ lastUpdatedBy: record.lastUpdatedBy,
6760
+ deletedAt: record.deletedAt,
6761
+ deletedBy: record.deletedBy,
6762
+ visibility: record.visibility,
6763
+ ownedBy: record.ownedBy
6764
+ },
6765
+ [...attributes, ...RECORD_SYSTEM_ATTRIBUTES]
6766
+ );
7065
6767
  }
7066
-
7067
- // src/filters/normalize-operator.ts
7068
- var SYNONYM_ALIASES = {
7069
- // equality
7070
- equals: "is",
7071
- equal: "is",
7072
- "==": "is",
7073
- "=": "is",
7074
- notEqual: "is_not",
7075
- isNot: "is_not",
7076
- "!=": "is_not",
7077
- "<>": "is_not",
7078
- // set
7079
- in: "any_of",
7080
- isAnyOf: "any_of",
7081
- oneOf: "any_of",
7082
- notIn: "none_of",
7083
- not_in: "none_of",
7084
- isNoneOf: "none_of",
7085
- notOneOf: "none_of",
7086
- // text
7087
- startsWith: "starts_with",
7088
- beginsWith: "starts_with",
7089
- endsWith: "ends_with",
7090
- doesNotContain: "not_contains",
7091
- notContain: "not_contains",
7092
- // nullity
7093
- isEmpty: "is_empty",
7094
- isNotEmpty: "is_not_empty",
7095
- // checkbox
7096
- isChecked: "is_checked",
7097
- isUnchecked: "is_not_checked"
7098
- };
7099
- var CROSS_TYPE_CONVERSIONS = {
7100
- date: {
7101
- gte: "on_or_after",
7102
- lte: "on_or_before",
7103
- gt: "after",
7104
- lt: "before",
7105
- eq: "is",
7106
- neq: "is_not"
7107
- },
7108
- number: { is: "eq", is_not: "neq" },
7109
- currency: { is: "eq", is_not: "neq" },
7110
- text: { eq: "is", neq: "is_not" },
7111
- phone: { eq: "is", neq: "is_not" },
7112
- select: { eq: "is", neq: "is_not" },
7113
- status: { eq: "is", neq: "is_not" },
7114
- multiselect: { eq: "contains", neq: "not_contains" },
7115
- relation: { eq: "is", neq: "is_not" },
7116
- user: { eq: "is", neq: "is_not" },
7117
- document: { eq: "is", neq: "is_not" },
7118
- file: { eq: "is", neq: "is_not" },
7119
- checkbox: { eq: "is_checked", neq: "is_not_checked", is: "is_checked", is_not: "is_not_checked" }
7120
- };
7121
- function normalizeOperator(rawOp, effectiveType) {
7122
- const synonymed = SYNONYM_ALIASES[rawOp] ?? rawOp;
7123
- const typeMap = CROSS_TYPE_CONVERSIONS[effectiveType];
7124
- return typeMap?.[synonymed] ?? synonymed;
6768
+ function evaluateFilterState(state, values, attributes) {
6769
+ if (state.rules.length === 0) return true;
6770
+ const attrByName = new Map(attributes.map((a) => [a.name, a]));
6771
+ const reducer = state.combinator === "or" ? "some" : "every";
6772
+ return state.rules[reducer]((rule) => evaluateRule(rule, values, attrByName));
7125
6773
  }
7126
-
7127
- // src/filters/validation.ts
7128
- var REFERENCE_TYPES = /* @__PURE__ */ new Set(["relation", "document", "user"]);
7129
- var ID_LIKE_OPERATORS = [
7130
- "eq",
7131
- "neq",
7132
- "is",
7133
- "is_not",
7134
- "any_of",
7135
- "none_of",
7136
- "is_empty",
7137
- "is_not_empty"
7138
- ];
7139
- var SYSTEM_FILTER_OPERATORS = {
7140
- // Identifier columns (uuid)
7141
- id: ID_LIKE_OPERATORS,
7142
- objectId: ID_LIKE_OPERATORS,
7143
- tenantId: ID_LIKE_OPERATORS,
7144
- // Free-form text columns share their counterpart's operator set
7145
- label: OPERATORS_BY_TYPE.text,
7146
- // Date columns
7147
- createdAt: OPERATORS_BY_TYPE.date,
7148
- updatedAt: OPERATORS_BY_TYPE.date,
7149
- deletedAt: OPERATORS_BY_TYPE.date,
7150
- // User columns (uuid → actor identity)
7151
- createdBy: OPERATORS_BY_TYPE.user,
7152
- lastUpdatedBy: OPERATORS_BY_TYPE.user
7153
- };
7154
- var SYSTEM_ATTRIBUTE_TYPES = {
7155
- id: "id",
7156
- objectId: "id",
7157
- tenantId: "id",
7158
- label: "text",
7159
- createdAt: "date",
7160
- updatedAt: "date",
7161
- deletedAt: "date",
7162
- createdBy: "user",
7163
- lastUpdatedBy: "user"
7164
- };
7165
- function assertOperatorForType(operator, type, context) {
7166
- const normalized = normalizeOperator(operator, type);
7167
- const ops = OPERATORS_BY_TYPE[type];
7168
- if (!ops?.includes(normalized)) {
7169
- const validList = ops?.length ? ops.join(", ") : "(no operators registered for this type)";
7170
- const summary = `Operator "${operator}" is not valid for ${context} type "${type}". Valid operators: ${validList}.`;
7171
- throw new chunkZBQEMIAV_js.ValidationError(summary, [
7172
- {
7173
- path: ["operator"],
7174
- message: summary
7175
- }
7176
- ]);
7177
- }
7178
- return normalized;
7179
- }
7180
- var RELATIVE_DATE_UNITS = /* @__PURE__ */ new Set(["days", "weeks", "months", "years"]);
7181
- var RELATIVE_DATE_DIRECTIONS = /* @__PURE__ */ new Set(["past", "future"]);
7182
- function assertRelativeDateValue(rule) {
7183
- if (rule.operator !== "is_within") return;
7184
- const v = rule.value;
7185
- const valid = typeof v === "object" && v !== null && typeof v.amount === "number" && Number.isFinite(v.amount) && v.amount > 0 && typeof v.unit === "string" && RELATIVE_DATE_UNITS.has(v.unit) && typeof v.direction === "string" && RELATIVE_DATE_DIRECTIONS.has(v.direction);
7186
- if (!valid) {
7187
- const m = `Operator "is_within" requires a relative-date value { amount: positive number, unit: days|weeks|months|years, direction: past|future }`;
7188
- throw new chunkZBQEMIAV_js.ValidationError(m, [{ path: ["value"], message: m }]);
7189
- }
7190
- }
7191
- function assertDynamicValueForAttribute(rule, attrType) {
7192
- if (!isDynamicValue(rule.value)) return;
7193
- const v = rule.value;
7194
- if (v.dynamic === "actor" && attrType !== "user") {
7195
- const m = `actor token (@me) is only valid on user attributes, not "${attrType}"`;
7196
- throw new chunkZBQEMIAV_js.ValidationError(m, [{ path: ["value"], message: m }]);
7197
- }
7198
- if (v.dynamic === "date" && attrType !== "date") {
7199
- const m = `date token (@today/@now) is only valid on date attributes, not "${attrType}"`;
7200
- throw new chunkZBQEMIAV_js.ValidationError(m, [{ path: ["value"], message: m }]);
7201
- }
7202
- }
7203
- function validateQualifiedRule(rule, context) {
7204
- const rootAttr = context.attributes.find((a) => a.name === rule.attribute);
7205
- const systemOps = SYSTEM_FILTER_OPERATORS[rule.attribute];
7206
- if (!(rootAttr || systemOps)) {
7207
- throw new chunkZBQEMIAV_js.ValidationError(`Unknown attribute: ${rule.attribute}`, [
7208
- { path: ["attribute"], message: `Unknown attribute: ${rule.attribute}` }
7209
- ]);
7210
- }
7211
- if (rule.quantifier !== void 0 && !rule.property) {
7212
- const m = `quantifier is only valid on qualified edge rules (set "property")`;
7213
- throw new chunkZBQEMIAV_js.ValidationError(m, [{ path: ["quantifier"], message: m }]);
7214
- }
7215
- if (!rootAttr) {
7216
- if (rule.property) {
7217
- throw new chunkZBQEMIAV_js.ValidationError(`Cannot qualify system attribute "${rule.attribute}"`, [
7218
- { path: ["property"], message: `"${rule.attribute}" is a system column, not a reference` }
7219
- ]);
7220
- }
7221
- const effectiveType = SYSTEM_ATTRIBUTE_TYPES[rule.attribute] ?? "id";
7222
- const normalizedOperator = normalizeOperator(
7223
- rule.operator,
7224
- effectiveType
7225
- );
7226
- if (!systemOps.includes(normalizedOperator)) {
7227
- const summary = `Operator "${rule.operator}" is not valid for system attribute "${rule.attribute}". Valid operators: ${systemOps.join(", ")}.`;
7228
- throw new chunkZBQEMIAV_js.ValidationError(summary, [{ path: ["operator"], message: summary }]);
7229
- }
7230
- rule.operator = normalizedOperator;
7231
- assertRelativeDateValue(rule);
7232
- return;
7233
- }
7234
- if (!rule.property) {
7235
- assertDynamicValueForAttribute(rule, rootAttr.type);
7236
- const ops = getAttributeFilterOperators(rootAttr);
7237
- const normalizedOperator = normalizeOperator(
7238
- rule.operator,
7239
- rootAttr.type
7240
- );
7241
- if (!ops.includes(normalizedOperator)) {
7242
- const validList = ops.length ? ops.join(", ") : "(not filterable)";
7243
- const summary = `Operator "${rule.operator}" is not valid for attribute "${rootAttr.name}". Valid operators: ${validList}.`;
7244
- throw new chunkZBQEMIAV_js.ValidationError(summary, [{ path: ["operator"], message: summary }]);
7245
- }
7246
- rule.operator = normalizedOperator;
7247
- assertRelativeDateValue(rule);
7248
- return;
7249
- }
7250
- if (!REFERENCE_TYPES.has(rootAttr.type)) {
7251
- throw new chunkZBQEMIAV_js.ValidationError(`Cannot qualify ${rootAttr.type} attribute "${rule.attribute}"`, [
7252
- { path: ["property"], message: `Attribute "${rule.attribute}" is not a reference type` }
7253
- ]);
7254
- }
7255
- const propSchema = rootAttr.properties;
7256
- if (!propSchema) {
7257
- throw new chunkZBQEMIAV_js.ValidationError(`Attribute "${rule.attribute}" has no qualifyWith schema`, [
7258
- { path: ["property"], message: `"${rule.attribute}" has no qualifyWith` }
7259
- ]);
7260
- }
7261
- const propDef = propSchema.definitions.find((p) => p.name === rule.property);
7262
- if (!propDef) {
7263
- throw new chunkZBQEMIAV_js.ValidationError(
7264
- `Property "${rule.property}" not defined on "${rule.attribute}".qualifyWith()`,
7265
- [{ path: ["property"], message: `Unknown property: ${rule.property}` }]
6774
+ function evaluateRule(rule, values, attrByName) {
6775
+ const attr = attrByName.get(rule.attribute);
6776
+ if (!attr) return false;
6777
+ if (rule.property) {
6778
+ const property = resolvePropertyDefinitions(attr).find(
6779
+ (definition) => definition.name === rule.property
7266
6780
  );
6781
+ if (!property) return false;
6782
+ const positiveOperator = normalizeForEdgeRpc(rule.operator);
6783
+ const propertySpec = OPERATOR_SPECS[positiveOperator];
6784
+ if (!propertySpec?.appliesTo.includes(property.type)) return false;
6785
+ const rootValue = values[rule.attribute];
6786
+ const references = Array.isArray(rootValue) ? rootValue : rootValue == null ? [] : [rootValue];
6787
+ const matches = references.some((reference) => {
6788
+ if (typeof reference !== "object" || reference === null) return false;
6789
+ const props = reference.props;
6790
+ if (typeof props !== "object" || props === null) return false;
6791
+ return evaluateNormalizedComparands(
6792
+ propertySpec,
6793
+ property.type,
6794
+ positiveOperator,
6795
+ props[rule.property],
6796
+ rule.value,
6797
+ property
6798
+ );
6799
+ });
6800
+ return (rule.quantifier ?? getOperatorPolarity(rule.operator)) === "none" ? !matches : matches;
7267
6801
  }
7268
- rule.operator = assertOperatorForType(rule.operator, propDef.type, "property");
7269
- assertRelativeDateValue(rule);
7270
- }
7271
-
7272
- // src/filters/extract-filter-value.ts
7273
- function extractCurrencyFilterValue(value) {
7274
- if (typeof value === "number") return value;
7275
- if (value !== null && typeof value === "object" && "value" in value) {
7276
- const inner = value.value;
7277
- return typeof inner === "number" ? inner : null;
7278
- }
7279
- return null;
6802
+ const spec = OPERATOR_SPECS[rule.operator];
6803
+ if (!spec) return false;
6804
+ if (!spec.appliesTo.includes(attr.type)) return false;
6805
+ const rawValue = values[rule.attribute];
6806
+ const value = attr.type === "relation" || attr.type === "document" || attr.type === "user" ? normalizeReferenceIds(rawValue) : rawValue;
6807
+ return evaluateNormalizedComparands(spec, attr.type, rule.operator, value, rule.value, attr);
6808
+ }
6809
+ function evaluateNormalizedComparands(spec, type, operator, storedValue, ruleValue, attribute) {
6810
+ const [normalizedStored, normalizedRule] = normalizeOperatorComparands(
6811
+ type,
6812
+ operator,
6813
+ storedValue,
6814
+ ruleValue
6815
+ );
6816
+ if (type === "phone" && normalizedRule === "" && operator === "contains") return false;
6817
+ if (type === "phone" && normalizedRule === "" && operator === "not_contains") return true;
6818
+ return spec.evaluateInMemory(normalizedStored, normalizedRule, attribute);
6819
+ }
6820
+ function normalizeOperatorComparands(type, operator, storedValue, ruleValue) {
6821
+ if (type === "date" && (operator === "is" || operator === "is_not")) {
6822
+ return [normalizeUtcCalendarDay(storedValue), normalizeUtcCalendarDay(ruleValue)];
6823
+ }
6824
+ if (type === "phone") return normalizePhoneComparands(storedValue, ruleValue);
6825
+ return [normalizeComparableValue(type, storedValue), normalizeComparableValue(type, ruleValue)];
6826
+ }
6827
+ function normalizeUtcCalendarDay(value) {
6828
+ if (value instanceof Date)
6829
+ return Number.isNaN(value.getTime()) ? null : value.toISOString().slice(0, 10);
6830
+ if (typeof value !== "string" || value === "") return null;
6831
+ if (/^\d{4}-\d{2}-\d{2}$/.test(value)) return value;
6832
+ const date2 = new Date(value);
6833
+ return Number.isNaN(date2.getTime()) ? null : date2.toISOString().slice(0, 10);
6834
+ }
6835
+ function normalizePhoneComparands(stored, rule) {
6836
+ const rulePhone = typeof rule === "object" && rule !== null ? rule : { };
6837
+ const ruleCountry = typeof rulePhone.countryCode === "string" ? rulePhone.countryCode : void 0;
6838
+ const normalizeOne = (value) => {
6839
+ const phone2 = typeof value === "object" && value !== null ? value : { phoneNumber: value };
6840
+ if (typeof phone2.phoneNumber !== "string") return null;
6841
+ if (!ruleCountry) return chunkQ4SZAMJT_js.normalizeCountrylessPhoneNumber(phone2.phoneNumber);
6842
+ const country = typeof phone2.countryCode === "string" ? phone2.countryCode : ruleCountry;
6843
+ return `${country}:${chunkQ4SZAMJT_js.normalizePhoneNumber(phone2.phoneNumber, country)}`;
6844
+ };
6845
+ return [normalizeOne(stored), normalizeOne(rule)];
7280
6846
  }
7281
- function extractFilterValue(value) {
7282
- if (value === null || value === void 0) return null;
7283
- if (typeof value === "object" && "value" in value) {
7284
- return value.value ?? null;
6847
+ function normalizeComparableValue(type, value) {
6848
+ if (type === "currency") return extractCurrencyFilterValue(value);
6849
+ if (type === "date") {
6850
+ if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value.toISOString();
6851
+ return value;
7285
6852
  }
7286
6853
  return value;
7287
6854
  }
6855
+ function normalizeReferenceIds(value) {
6856
+ const normalizeOne = (candidate) => {
6857
+ if (typeof candidate !== "object" || candidate === null) return candidate;
6858
+ return candidate.id;
6859
+ };
6860
+ return Array.isArray(value) ? value.map(normalizeOne) : normalizeOne(value);
6861
+ }
7288
6862
 
7289
6863
  // src/connectors/types.ts
7290
6864
  var CONNECTOR_CALLBACK_PARAM = {
@@ -7308,10 +6882,10 @@ function canonicalStringify(value) {
7308
6882
  case "object":
7309
6883
  break;
7310
6884
  default:
7311
- throw new chunkZBQEMIAV_js.ValidationError(`Cannot canonicalize value of type ${typeof v}`, []);
6885
+ throw new chunkFDIAOFHS_js.ValidationError(`Cannot canonicalize value of type ${typeof v}`, []);
7312
6886
  }
7313
6887
  const obj = v;
7314
- if (seen.has(obj)) throw new chunkZBQEMIAV_js.ValidationError("Cannot canonicalize circular structure", []);
6888
+ if (seen.has(obj)) throw new chunkFDIAOFHS_js.ValidationError("Cannot canonicalize circular structure", []);
7315
6889
  seen.add(obj);
7316
6890
  try {
7317
6891
  if (Array.isArray(obj)) return `[${obj.map((e) => encode(e) ?? "null").join(",")}]`;
@@ -7324,6 +6898,23 @@ function canonicalStringify(value) {
7324
6898
  return encode(value) ?? "null";
7325
6899
  }
7326
6900
 
6901
+ // src/utils/attribute-defaults.ts
6902
+ var TODAY_DEFAULT = "today";
6903
+ function dateInTimezone(date2, timezone) {
6904
+ return new Intl.DateTimeFormat("en-CA", {
6905
+ timeZone: timezone,
6906
+ year: "numeric",
6907
+ month: "2-digit",
6908
+ day: "2-digit"
6909
+ }).format(date2);
6910
+ }
6911
+ function resolveAttributeDefaultValue(attribute, ctx) {
6912
+ if (!("defaultValue" in attribute)) return void 0;
6913
+ const { defaultValue } = attribute;
6914
+ if (attribute.type !== "date" || defaultValue !== TODAY_DEFAULT) return defaultValue;
6915
+ return attribute.includeTime ? ctx.now.toISOString() : dateInTimezone(ctx.now, ctx.timezone);
6916
+ }
6917
+
7327
6918
  // src/utils/view-sync-payload.ts
7328
6919
  function viewSyncPayload(view) {
7329
6920
  return {
@@ -7336,6 +6927,420 @@ function viewSyncPayload(view) {
7336
6927
  };
7337
6928
  }
7338
6929
 
6930
+ // src/types/schema-plan.ts
6931
+ function hasDestructiveEntries(plan) {
6932
+ const { attributeRemovals, objectRemovals, renames } = plan.destructive;
6933
+ return attributeRemovals.length > 0 || objectRemovals.length > 0 || renames.length > 0;
6934
+ }
6935
+ var SCHEMA_PLAN_LIMITS = {
6936
+ objectAdditions: 20,
6937
+ totalMutations: 500,
6938
+ serializedBytes: 512 * 1024
6939
+ };
6940
+ function errorMessage(error) {
6941
+ return error instanceof Error ? error.message : String(error);
6942
+ }
6943
+ var attributeTypeSchema = z2.z.enum([
6944
+ "text",
6945
+ "richtext",
6946
+ "number",
6947
+ "checkbox",
6948
+ "date",
6949
+ "phone",
6950
+ "currency",
6951
+ "status",
6952
+ "location",
6953
+ "select",
6954
+ "multiselect",
6955
+ "user",
6956
+ "relation",
6957
+ "formula",
6958
+ "rollup",
6959
+ "document"
6960
+ ]).describe(
6961
+ 'The attribute\'s data type. Determines which keys `config` accepts and requires: `status`/`select`/`multiselect` need a non-empty `options` array (each `status` option carrying its own `group`); `relation` needs `targets` (non-empty) and `cardinality` ("one" or "many"); `formula` needs `expression` and `returnType`; `rollup` needs `targetAttribute` and `function`. Every other type accepts only the shared presentation keys (`placeholder`, `defaultValue`, `icon`, ...) plus a few type-specific optionals (e.g. `number.decimals`, `date.dateFormat`). An attribute\'s type can never be changed later through this tool \u2014 only through a code migration \u2014 so pick it correctly now.'
6962
+ );
6963
+ var attributeNameSchema = z2.z.string().min(1).superRefine((name, ctx) => {
6964
+ try {
6965
+ validateAttributeName(name);
6966
+ } catch (error) {
6967
+ ctx.addIssue({ code: z2.z.ZodIssueCode.custom, message: errorMessage(error) });
6968
+ }
6969
+ }).describe(
6970
+ '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).'
6971
+ );
6972
+ var objectNameSchema = z2.z.string().min(1).superRefine((name, ctx) => {
6973
+ if (chunk63WWFZFY_js.RESERVED_OBJECT_NAMES.includes(name)) {
6974
+ ctx.addIssue({
6975
+ code: z2.z.ZodIssueCode.custom,
6976
+ message: `"${name}" is a reserved object name (${chunk63WWFZFY_js.RESERVED_OBJECT_NAMES.join(", ")}) and cannot be used for a new object.`
6977
+ });
6978
+ }
6979
+ try {
6980
+ validateObjectName(name);
6981
+ } catch (error) {
6982
+ ctx.addIssue({ code: z2.z.ZodIssueCode.custom, message: errorMessage(error) });
6983
+ }
6984
+ }).describe(
6985
+ `The new object's machine name: kebab-case slug, lowercase letters/digits/hyphens only, starting with a letter ("products", "user-profiles", "order-items" are valid; "Products", "userProfiles", "user_profiles" are not). Max 63 characters. Cannot be a name the platform reserves for its own system objects, and cannot already exist.`
6986
+ );
6987
+ function withConfigCheck(schema) {
6988
+ return schema.superRefine((attribute, ctx) => {
6989
+ try {
6990
+ const parsedConfig = chunkQN2N3IJZ_js.parseAttributeConfigForCreate(attribute.type, {
6991
+ ...attribute.config ?? {},
6992
+ description: attribute.description
6993
+ });
6994
+ const unknownKeys = Object.keys(attribute.config ?? {}).filter(
6995
+ (key) => !Object.hasOwn(parsedConfig, key)
6996
+ );
6997
+ if (unknownKeys.length > 0) {
6998
+ ctx.addIssue({
6999
+ code: "unrecognized_keys",
7000
+ keys: unknownKeys,
7001
+ path: ["config"],
7002
+ message: `Unrecognized attribute config key${unknownKeys.length === 1 ? "" : "s"}: ${unknownKeys.join(", ")}`
7003
+ });
7004
+ }
7005
+ } catch (error) {
7006
+ if (error instanceof chunkFDIAOFHS_js.ValidationError) {
7007
+ for (const issue of error.errors) {
7008
+ ctx.addIssue({
7009
+ code: z2.z.ZodIssueCode.custom,
7010
+ path: [
7011
+ "config",
7012
+ ...issue.path.map((segment) => /^\d+$/.test(segment) ? Number(segment) : segment)
7013
+ ],
7014
+ message: `Config for type "${attribute.type}" is invalid or incomplete: ${issue.message}`
7015
+ });
7016
+ }
7017
+ return;
7018
+ }
7019
+ ctx.addIssue({
7020
+ code: z2.z.ZodIssueCode.custom,
7021
+ path: ["config"],
7022
+ message: `Config for type "${attribute.type}" is invalid or incomplete: ${errorMessage(error)}`
7023
+ });
7024
+ }
7025
+ });
7026
+ }
7027
+ var plannedAttributeBaseSchema = z2.z.object({
7028
+ objectName: z2.z.string().min(1).describe(
7029
+ "Name of the existing (or, elsewhere in the same plan, newly created) object this attribute is added to. Ignored for an attribute declared inline in `additive.objects[].attributes` \u2014 there the parent object's own `name` is used instead."
7030
+ ),
7031
+ name: attributeNameSchema,
7032
+ label: z2.z.string().min(1).max(128).describe("Human-readable display label shown in the UI. 1-128 characters, cannot be empty."),
7033
+ type: attributeTypeSchema,
7034
+ config: z2.z.record(z2.z.string(), z2.z.unknown()).optional().describe(
7035
+ 'Type-specific configuration; required keys depend on `type` (see `type`\'s description). Shared optional keys on every type: `placeholder`, `defaultValue`, `icon`, `order`, `hidden`, `archived`, `deprecated`, `metadata`. Per-type keys: `text` \u2014 `multiline`, `minLength`, `maxLength`, `pattern`, `format` ("email"|"url"|"slug"); `number` \u2014 `renderAs` ("number"|"rating"), `min`, `max`, `unit`, `decimals`; `date` \u2014 `dateFormat`, `minDate`, `maxDate`, `includeTime`, `endDate`, `timeFormat` ("12h"|"24h"); `phone` \u2014 `defaultCountryCode` (3-letter); `currency` \u2014 `defaultCurrency`, `allowedCurrencies`, `allowNegative`; `status`/`select`/`multiselect` \u2014 `options` (REQUIRED, non-empty array of `{ value, label, color }`, unique `value`s; for `status` every OPTION also carries `group` as idle|in_progress|finished \u2014 `group` belongs on each option, never on `config` itself; select/multiselect accept `renderAs: "badges"`); `location` \u2014 `granularity`, `defaultCountry`, `allowedCountries`; `user` \u2014 `types` ("user"|"agent"), `multiple`; `relation` \u2014 `targets` (REQUIRED, non-empty array of `{ object }`) and `cardinality` (REQUIRED, "one"|"many"); `formula` \u2014 `expression` (REQUIRED formula string) and `returnType` (REQUIRED); `rollup` \u2014 `targetAttribute` (REQUIRED) and `function` (REQUIRED, e.g. "sum"|"avg"|"count"); `document` \u2014 `properties`, `accepts`, `maxFileSize`. Omit entirely for `richtext`/`checkbox`, which take no type-specific keys.'
7036
+ ),
7037
+ required: z2.z.boolean().optional().describe(
7038
+ "Whether the attribute must have a value on every record. Defaults to false (optional)."
7039
+ ),
7040
+ description: z2.z.string().optional().describe("Help text shown under the field in the UI. Not the same as the plan's `summary`.")
7041
+ }).strict();
7042
+ var plannedAttributeSchema = withConfigCheck(plannedAttributeBaseSchema);
7043
+ var plannedInlineAttributeSchema = withConfigCheck(
7044
+ plannedAttributeBaseSchema.omit({ objectName: true })
7045
+ );
7046
+ var plannedObjectSchema = z2.z.object({
7047
+ name: objectNameSchema,
7048
+ label: z2.z.string().min(1).describe('Human-readable singular display label (e.g. "Devis").'),
7049
+ pluralLabel: z2.z.string().optional().describe(
7050
+ 'Human-readable plural display label (e.g. "Devis"/"Invoices"). Defaults from `label` if omitted.'
7051
+ ),
7052
+ description: z2.z.string().optional().describe("Help text describing what this object represents."),
7053
+ icon: chunkQN2N3IJZ_js.iconNameSchema.describe(
7054
+ "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."
7055
+ ),
7056
+ labelExpression: labelExpressionSchema.describe(
7057
+ 'Template used to render a human-readable label for every record of this object \u2014 e.g. shown in relations, search results, and breadcrumbs. MUST contain at least one `{{ attributeName }}` interpolation referencing an attribute this object will actually have (either declared in this same `attributes` array, or an existing attribute if this is an update) \u2014 a plain string with no `{{ }}` at all (e.g. "Devis") is rejected. Interpolations cannot be empty (`{{ }}` is rejected) and only these pipes are allowed: UPPER, LOWER, capitalize, trim, prefix:"...", suffix:"...", wrap:"..." "...", default:"...". `{{ a || b }}` falls back to `b` when `a` is empty. Examples: "{{ firstName }} {{ lastName }}", "{{ numero | UPPER }}", "{{ name || reference }}".'
7058
+ ),
7059
+ // Inline attributes get the SAME validation as attributes added to an
7060
+ // existing object, minus `objectName` which the parent supplies. Anything
7061
+ // weaker would let an agent slip a typeless attribute into a new object
7062
+ // while the strict path above rejects the identical mistake.
7063
+ attributes: z2.z.array(plannedInlineAttributeSchema).default([]).describe(
7064
+ "Attributes to create on this new object, inline. Same rules as a standalone entry in `additive.attributes`, minus `objectName` (implied by this object). At least one attribute referenced by `labelExpression` should be included here."
7065
+ )
7066
+ }).strict();
7067
+ var destructiveSchema = z2.z.object({
7068
+ attributeRemovals: z2.z.array(
7069
+ z2.z.object({
7070
+ objectName: z2.z.string().min(1).describe("Object the attribute is removed from."),
7071
+ attributeName: z2.z.string().min(1).describe(
7072
+ "Attribute to delete, together with every record's stored value for it. Must not be a system (code-declared) attribute, and must not be referenced by the object's own `labelExpression` or `embeddingExpression` \u2014 update those first."
7073
+ )
7074
+ }).strict()
7075
+ ).default([]).describe(
7076
+ "Attributes to permanently delete. Irreversible: record values for the attribute are purged."
7077
+ ),
7078
+ objectRemovals: z2.z.array(
7079
+ z2.z.object({
7080
+ objectName: z2.z.string().min(1).describe(
7081
+ "Object to delete entirely, together with all its records. Must not be a system (code-declared) object, and must not still be targeted by a `relation` attribute on another object \u2014 retarget or remove that relation first."
7082
+ )
7083
+ }).strict()
7084
+ ).default([]).describe("Objects to permanently delete, records included. Irreversible."),
7085
+ renames: z2.z.array(
7086
+ z2.z.object({
7087
+ objectName: z2.z.string().min(1).describe("Object the renamed attribute belongs to."),
7088
+ from: z2.z.string().min(1).describe(
7089
+ "Current attribute name. Must already exist and not be a system attribute."
7090
+ ),
7091
+ to: attributeNameSchema.describe(
7092
+ "New attribute name \u2014 same identifier rules as any attribute `name` (see `name` on a planned attribute), and must not collide with another name already on the object, including one added elsewhere in this same plan."
7093
+ )
7094
+ }).strict()
7095
+ ).default([]).describe(
7096
+ "Attribute renames. Every reference to the old name (labelExpression, views, formulas) must be updated separately \u2014 a rename does not follow references automatically."
7097
+ )
7098
+ }).strict().default({ attributeRemovals: [], objectRemovals: [], renames: [] });
7099
+ var planSummarySchema = z2.z.string().min(1).describe(
7100
+ "One or two plain-language sentences describing the change and why, shown to the human who approves or rejects the plan \u2014 this is the only free-text context they see before deciding. If `destructive` is non-empty, say plainly what will be lost (e.g. 'deletes the \"ancienMontant\" column and its data on every devis'). Do not restate the raw plan \u2014 explain intent."
7101
+ );
7102
+ var CANONICAL_CONFIG_DESCRIPTION = "The COMPLETE config this view should end up with \u2014 not a patch. Copy the baseline returned by get_default_view and edit it, preserving every tab and setting you are not changing: anything you omit is dropped. To change the columns shown, set `tabs[].columns` (an array of attribute names) \u2014 there is no top-level `columns` on either view type. For a detail view's side panel, set `sidePanel.attributes`. Every attribute name listed must already exist on the object, or be created earlier in this same plan. ONE EXCEPTION to omit-is-dropped: a tab with `type: \"custom\"` renders a component belonging to the application, which you cannot describe or recreate. Copy every such tab through from the baseline exactly as it came, `name`, `component` and `props` untouched \u2014 dropping one, inventing one, or altering any of those three is rejected rather than applied (`name` is the tab's address in links, not its wording). Its `label` and `icon` you may change.";
7103
+ var BASELINE_TOKEN_DESCRIPTION = "Opaque token returned by get_default_view alongside the baseline you edited. REQUIRED when the object already exists \u2014 it proves you authored against the baseline that is still current. Must be OMITTED when this plan creates the object, which has no baseline yet.";
7104
+ var viewTargetObjectNameSchema = z2.z.string().min(1).describe(
7105
+ "Name of the object whose default view of this type is replaced. Not a view name \u2014 a plan can only replace an object's deterministic default view, never create a view or target a non-default one."
7106
+ );
7107
+ var proposedDefaultViewTargetSchema = z2.z.discriminatedUnion("viewType", [
7108
+ z2.z.object({
7109
+ objectName: viewTargetObjectNameSchema,
7110
+ viewType: z2.z.literal("list").describe("Targets the object's default list view (the grid)."),
7111
+ canonicalConfig: chunk63WWFZFY_js.listViewConfigSchema.describe(CANONICAL_CONFIG_DESCRIPTION),
7112
+ baselineToken: z2.z.string().min(1).optional().describe(BASELINE_TOKEN_DESCRIPTION)
7113
+ }).strict(),
7114
+ z2.z.object({
7115
+ objectName: viewTargetObjectNameSchema,
7116
+ viewType: z2.z.literal("detail").describe("Targets the object's default detail view (the single-record view)."),
7117
+ canonicalConfig: chunk63WWFZFY_js.detailViewConfigSchema.describe(CANONICAL_CONFIG_DESCRIPTION),
7118
+ baselineToken: z2.z.string().min(1).optional().describe(BASELINE_TOKEN_DESCRIPTION)
7119
+ }).strict()
7120
+ ]);
7121
+ var canonicalHashSchema = z2.z.string().regex(/^[0-9a-f]{64}$/, "Expected a lowercase SHA-256 hash");
7122
+ var persistedBaselineFields = {
7123
+ baseConfigHash: canonicalHashSchema.nullable(),
7124
+ targetConfigHash: canonicalHashSchema,
7125
+ baselineOrigin: z2.z.enum(["persisted", "generated", "absent"])
7126
+ };
7127
+ var persistedDefaultViewTargetSchema = z2.z.discriminatedUnion("viewType", [
7128
+ z2.z.object({
7129
+ objectName: z2.z.string().min(1),
7130
+ viewType: z2.z.literal("list"),
7131
+ canonicalConfig: chunk63WWFZFY_js.listViewConfigSchema,
7132
+ ...persistedBaselineFields
7133
+ }).strict(),
7134
+ z2.z.object({
7135
+ objectName: z2.z.string().min(1),
7136
+ viewType: z2.z.literal("detail"),
7137
+ canonicalConfig: chunk63WWFZFY_js.detailViewConfigSchema,
7138
+ ...persistedBaselineFields
7139
+ }).strict()
7140
+ ]).superRefine((target, ctx) => {
7141
+ const requiresHash = target.baselineOrigin !== "absent";
7142
+ if (requiresHash === (target.baseConfigHash !== null)) return;
7143
+ ctx.addIssue({
7144
+ code: "custom",
7145
+ path: ["baseConfigHash"],
7146
+ message: requiresHash ? `A ${target.baselineOrigin} baseline requires baseConfigHash` : "An absent baseline requires baseConfigHash to be null"
7147
+ });
7148
+ });
7149
+ function buildAdditiveSchema(viewTargetSchema) {
7150
+ return z2.z.object({
7151
+ objects: z2.z.array(plannedObjectSchema).default([]).describe("New objects to create, with their attributes inline."),
7152
+ attributes: z2.z.array(plannedAttributeSchema).default([]).describe("Attributes to add to existing or same-plan objects."),
7153
+ viewUpdates: z2.z.array(viewTargetSchema).default([]).describe("Complete target configs for deterministic default views; never view names.")
7154
+ }).strict().default({ objects: [], attributes: [], viewUpdates: [] });
7155
+ }
7156
+ function findJsonSafetyIssue(value, path = [], activeObjects = /* @__PURE__ */ new WeakSet()) {
7157
+ if (value === null || typeof value === "string" || typeof value === "boolean") return null;
7158
+ if (typeof value === "number") {
7159
+ if (!Number.isFinite(value)) {
7160
+ return { path, message: "Plan input contains a non-finite number" };
7161
+ }
7162
+ return null;
7163
+ }
7164
+ if (typeof value !== "object") {
7165
+ return { path, message: "Plan input must contain only JSON-safe values" };
7166
+ }
7167
+ if (activeObjects.has(value)) {
7168
+ return { path, message: "Plan input cannot contain circular references" };
7169
+ }
7170
+ if (Array.isArray(value)) {
7171
+ activeObjects.add(value);
7172
+ for (const key of Reflect.ownKeys(value)) {
7173
+ if (key === "length") continue;
7174
+ if (typeof key === "symbol" || !/^(0|[1-9]\d*)$/.test(key)) {
7175
+ activeObjects.delete(value);
7176
+ return {
7177
+ path: [...path, key],
7178
+ message: "Plan input arrays cannot contain non-index JSON properties"
7179
+ };
7180
+ }
7181
+ }
7182
+ for (let index = 0; index < value.length; index++) {
7183
+ if (!Object.hasOwn(value, index)) {
7184
+ activeObjects.delete(value);
7185
+ return {
7186
+ path: [...path, index],
7187
+ message: "Plan input cannot contain sparse arrays"
7188
+ };
7189
+ }
7190
+ const issue = findJsonSafetyIssue(value[index], [...path, index], activeObjects);
7191
+ if (issue) {
7192
+ activeObjects.delete(value);
7193
+ return issue;
7194
+ }
7195
+ }
7196
+ activeObjects.delete(value);
7197
+ return null;
7198
+ }
7199
+ const prototype = Object.getPrototypeOf(value);
7200
+ if (prototype !== Object.prototype && prototype !== null) {
7201
+ return { path, message: "Plan input must contain only plain JSON objects" };
7202
+ }
7203
+ activeObjects.add(value);
7204
+ const record = value;
7205
+ const keys = Reflect.ownKeys(record);
7206
+ for (const key of keys) {
7207
+ const descriptor = Object.getOwnPropertyDescriptor(record, key);
7208
+ if (typeof key === "symbol" || !(descriptor?.enumerable && "value" in descriptor)) {
7209
+ activeObjects.delete(value);
7210
+ return {
7211
+ path: [...path, key],
7212
+ message: "Plan input objects must contain enumerable JSON data properties only"
7213
+ };
7214
+ }
7215
+ }
7216
+ for (const key of keys.sort()) {
7217
+ const issue = findJsonSafetyIssue(record[key], [...path, key], activeObjects);
7218
+ if (issue) {
7219
+ activeObjects.delete(value);
7220
+ return issue;
7221
+ }
7222
+ }
7223
+ activeObjects.delete(value);
7224
+ return null;
7225
+ }
7226
+ function mutationPaths(plan) {
7227
+ const paths = [];
7228
+ plan.additive.objects.forEach((object2, objectIndex) => {
7229
+ paths.push(["additive", "objects", objectIndex]);
7230
+ object2.attributes.forEach((_attribute, attributeIndex) => {
7231
+ paths.push(["additive", "objects", objectIndex, "attributes", attributeIndex]);
7232
+ });
7233
+ });
7234
+ plan.additive.attributes.forEach((_attribute, index) => {
7235
+ paths.push(["additive", "attributes", index]);
7236
+ });
7237
+ plan.additive.viewUpdates.forEach((_target, index) => {
7238
+ paths.push(["additive", "viewUpdates", index]);
7239
+ });
7240
+ plan.destructive.attributeRemovals.forEach((_removal, index) => {
7241
+ paths.push(["destructive", "attributeRemovals", index]);
7242
+ });
7243
+ plan.destructive.objectRemovals.forEach((_removal, index) => {
7244
+ paths.push(["destructive", "objectRemovals", index]);
7245
+ });
7246
+ plan.destructive.renames.forEach((_rename, index) => {
7247
+ paths.push(["destructive", "renames", index]);
7248
+ });
7249
+ return paths;
7250
+ }
7251
+ function addPlanLimitIssues(plan, ctx) {
7252
+ if (plan.additive.objects.length > SCHEMA_PLAN_LIMITS.objectAdditions) {
7253
+ ctx.addIssue({
7254
+ code: "too_big",
7255
+ origin: "array",
7256
+ maximum: SCHEMA_PLAN_LIMITS.objectAdditions,
7257
+ inclusive: true,
7258
+ path: ["additive", "objects", SCHEMA_PLAN_LIMITS.objectAdditions],
7259
+ message: `A schema plan can add at most ${SCHEMA_PLAN_LIMITS.objectAdditions} objects`
7260
+ });
7261
+ }
7262
+ const paths = mutationPaths(plan);
7263
+ if (paths.length > SCHEMA_PLAN_LIMITS.totalMutations) {
7264
+ ctx.addIssue({
7265
+ code: "too_big",
7266
+ origin: "array",
7267
+ maximum: SCHEMA_PLAN_LIMITS.totalMutations,
7268
+ inclusive: true,
7269
+ path: paths[SCHEMA_PLAN_LIMITS.totalMutations],
7270
+ message: `A schema plan can contain at most ${SCHEMA_PLAN_LIMITS.totalMutations} mutations; received ${paths.length}`
7271
+ });
7272
+ }
7273
+ }
7274
+ function boundSerializedPlanInput(input, ctx) {
7275
+ const jsonSafetyIssue = findJsonSafetyIssue(input);
7276
+ if (jsonSafetyIssue) {
7277
+ ctx.addIssue({
7278
+ code: "custom",
7279
+ path: jsonSafetyIssue.path,
7280
+ message: jsonSafetyIssue.message
7281
+ });
7282
+ return z2.z.NEVER;
7283
+ }
7284
+ const serializedBytes = new TextEncoder().encode(canonicalStringify(input)).byteLength;
7285
+ if (serializedBytes > SCHEMA_PLAN_LIMITS.serializedBytes) {
7286
+ ctx.addIssue({
7287
+ code: "too_big",
7288
+ origin: "string",
7289
+ maximum: SCHEMA_PLAN_LIMITS.serializedBytes,
7290
+ inclusive: true,
7291
+ path: [],
7292
+ message: `A schema plan can serialize to at most ${SCHEMA_PLAN_LIMITS.serializedBytes} UTF-8 bytes; received ${serializedBytes}`
7293
+ });
7294
+ return z2.z.NEVER;
7295
+ }
7296
+ return input;
7297
+ }
7298
+ var proposedAdditiveSchema = buildAdditiveSchema(proposedDefaultViewTargetSchema);
7299
+ var persistedAdditiveSchema = buildAdditiveSchema(persistedDefaultViewTargetSchema);
7300
+ var structuralSchemaPlanSchema = z2.z.object({
7301
+ schemaPlanVersion: z2.z.literal(2).describe("Required proposal contract version."),
7302
+ summary: planSummarySchema,
7303
+ additive: proposedAdditiveSchema,
7304
+ destructive: destructiveSchema
7305
+ }).strict().superRefine((plan, ctx) => {
7306
+ const newObjectNames = new Set(plan.additive.objects.map((object2) => object2.name));
7307
+ plan.additive.viewUpdates.forEach((target, index) => {
7308
+ const path = ["additive", "viewUpdates", index, "baselineToken"];
7309
+ if (newObjectNames.has(target.objectName)) {
7310
+ if (target.baselineToken !== void 0) {
7311
+ ctx.addIssue({
7312
+ code: "custom",
7313
+ path,
7314
+ message: "A view target for an object added by this plan must not include baselineToken"
7315
+ });
7316
+ }
7317
+ return;
7318
+ }
7319
+ if (target.baselineToken === void 0) {
7320
+ ctx.addIssue({
7321
+ code: "custom",
7322
+ path,
7323
+ message: "A view target for an existing object requires baselineToken"
7324
+ });
7325
+ }
7326
+ });
7327
+ addPlanLimitIssues(plan, ctx);
7328
+ });
7329
+ var schemaPlanSchema = Object.assign(
7330
+ z2.z.preprocess(boundSerializedPlanInput, structuralSchemaPlanSchema),
7331
+ { shape: structuralSchemaPlanSchema.shape }
7332
+ );
7333
+ var structuralPersistedSchemaPlanSchema = z2.z.object({
7334
+ schemaPlanVersion: z2.z.literal(2),
7335
+ summary: planSummarySchema,
7336
+ additive: persistedAdditiveSchema,
7337
+ destructive: destructiveSchema
7338
+ }).strict().superRefine(addPlanLimitIssues);
7339
+ var persistedSchemaPlanSchema = z2.z.preprocess(
7340
+ boundSerializedPlanInput,
7341
+ structuralPersistedSchemaPlanSchema
7342
+ );
7343
+
7339
7344
  Object.defineProperty(exports, "asTenantId", {
7340
7345
  enumerable: true,
7341
7346
  get: function () { return chunkFRCDMQER_js.asTenantId; }
@@ -7356,189 +7361,433 @@ Object.defineProperty(exports, "indexBy", {
7356
7361
  enumerable: true,
7357
7362
  get: function () { return chunkFRCDMQER_js.indexBy; }
7358
7363
  });
7364
+ Object.defineProperty(exports, "ATTRIBUTE_FILTER_OPERATORS", {
7365
+ enumerable: true,
7366
+ get: function () { return chunk63WWFZFY_js.ATTRIBUTE_FILTER_OPERATORS; }
7367
+ });
7368
+ Object.defineProperty(exports, "LIST_VIEW_TAB_VISIBILITIES", {
7369
+ enumerable: true,
7370
+ get: function () { return chunk63WWFZFY_js.LIST_VIEW_TAB_VISIBILITIES; }
7371
+ });
7372
+ Object.defineProperty(exports, "NO_VALUE_OPERATORS", {
7373
+ enumerable: true,
7374
+ get: function () { return chunk63WWFZFY_js.NO_VALUE_OPERATORS; }
7375
+ });
7376
+ Object.defineProperty(exports, "OPERATORS_BY_TYPE", {
7377
+ enumerable: true,
7378
+ get: function () { return chunk63WWFZFY_js.OPERATORS_BY_TYPE; }
7379
+ });
7380
+ Object.defineProperty(exports, "REMOVED_OPERATOR_REPLACEMENTS", {
7381
+ enumerable: true,
7382
+ get: function () { return chunk63WWFZFY_js.REMOVED_OPERATOR_REPLACEMENTS; }
7383
+ });
7384
+ Object.defineProperty(exports, "RESERVED_ATTRIBUTE_NAMES", {
7385
+ enumerable: true,
7386
+ get: function () { return chunk63WWFZFY_js.RESERVED_ATTRIBUTE_NAMES; }
7387
+ });
7388
+ Object.defineProperty(exports, "RESERVED_OBJECT_NAMES", {
7389
+ enumerable: true,
7390
+ get: function () { return chunk63WWFZFY_js.RESERVED_OBJECT_NAMES; }
7391
+ });
7392
+ Object.defineProperty(exports, "RESOURCE_VISIBILITIES", {
7393
+ enumerable: true,
7394
+ get: function () { return chunk63WWFZFY_js.RESOURCE_VISIBILITIES; }
7395
+ });
7396
+ Object.defineProperty(exports, "SYNONYM_ALIASES", {
7397
+ enumerable: true,
7398
+ get: function () { return chunk63WWFZFY_js.SYNONYM_ALIASES; }
7399
+ });
7400
+ Object.defineProperty(exports, "SYSTEM_ATTRIBUTES", {
7401
+ enumerable: true,
7402
+ get: function () { return chunk63WWFZFY_js.SYSTEM_ATTRIBUTES; }
7403
+ });
7404
+ Object.defineProperty(exports, "SYSTEM_ATTRIBUTE_I18N_KEYS", {
7405
+ enumerable: true,
7406
+ get: function () { return chunk63WWFZFY_js.SYSTEM_ATTRIBUTE_I18N_KEYS; }
7407
+ });
7408
+ Object.defineProperty(exports, "SYSTEM_FIELD_NAMES", {
7409
+ enumerable: true,
7410
+ get: function () { return chunk63WWFZFY_js.SYSTEM_FIELD_NAMES; }
7411
+ });
7412
+ Object.defineProperty(exports, "SYSTEM_FILTER_ATTRIBUTE_TYPES", {
7413
+ enumerable: true,
7414
+ get: function () { return chunk63WWFZFY_js.SYSTEM_FILTER_ATTRIBUTE_TYPES; }
7415
+ });
7416
+ Object.defineProperty(exports, "collectQualifiedRuleIssues", {
7417
+ enumerable: true,
7418
+ get: function () { return chunk63WWFZFY_js.collectQualifiedRuleIssues; }
7419
+ });
7420
+ Object.defineProperty(exports, "currentActor", {
7421
+ enumerable: true,
7422
+ get: function () { return chunk63WWFZFY_js.currentActor; }
7423
+ });
7424
+ Object.defineProperty(exports, "detailTabSchema", {
7425
+ enumerable: true,
7426
+ get: function () { return chunk63WWFZFY_js.detailTabSchema; }
7427
+ });
7428
+ Object.defineProperty(exports, "detailViewConfigSchema", {
7429
+ enumerable: true,
7430
+ get: function () { return chunk63WWFZFY_js.detailViewConfigSchema; }
7431
+ });
7432
+ Object.defineProperty(exports, "getAttributeCapabilities", {
7433
+ enumerable: true,
7434
+ get: function () { return chunk63WWFZFY_js.getAttributeCapabilities; }
7435
+ });
7436
+ Object.defineProperty(exports, "getAttributeFilterOperators", {
7437
+ enumerable: true,
7438
+ get: function () { return chunk63WWFZFY_js.getAttributeFilterOperators; }
7439
+ });
7440
+ Object.defineProperty(exports, "getRollupFilterOperators", {
7441
+ enumerable: true,
7442
+ get: function () { return chunk63WWFZFY_js.getRollupFilterOperators; }
7443
+ });
7444
+ Object.defineProperty(exports, "getSystemAttributeI18nKey", {
7445
+ enumerable: true,
7446
+ get: function () { return chunk63WWFZFY_js.getSystemAttributeI18nKey; }
7447
+ });
7448
+ Object.defineProperty(exports, "getSystemAttributeList", {
7449
+ enumerable: true,
7450
+ get: function () { return chunk63WWFZFY_js.getSystemAttributeList; }
7451
+ });
7452
+ Object.defineProperty(exports, "inverseSourceSchema", {
7453
+ enumerable: true,
7454
+ get: function () { return chunk63WWFZFY_js.inverseSourceSchema; }
7455
+ });
7456
+ Object.defineProperty(exports, "isAttributeFilterable", {
7457
+ enumerable: true,
7458
+ get: function () { return chunk63WWFZFY_js.isAttributeFilterable; }
7459
+ });
7460
+ Object.defineProperty(exports, "isAttributeGroupable", {
7461
+ enumerable: true,
7462
+ get: function () { return chunk63WWFZFY_js.isAttributeGroupable; }
7463
+ });
7464
+ Object.defineProperty(exports, "isAttributeKanbanGroupable", {
7465
+ enumerable: true,
7466
+ get: function () { return chunk63WWFZFY_js.isAttributeKanbanGroupable; }
7467
+ });
7468
+ Object.defineProperty(exports, "isAttributeSearchable", {
7469
+ enumerable: true,
7470
+ get: function () { return chunk63WWFZFY_js.isAttributeSearchable; }
7471
+ });
7472
+ Object.defineProperty(exports, "isDynamicValue", {
7473
+ enumerable: true,
7474
+ get: function () { return chunk63WWFZFY_js.isDynamicValue; }
7475
+ });
7476
+ Object.defineProperty(exports, "isManagedSystemAttribute", {
7477
+ enumerable: true,
7478
+ get: function () { return chunk63WWFZFY_js.isManagedSystemAttribute; }
7479
+ });
7480
+ Object.defineProperty(exports, "isNoValueOperator", {
7481
+ enumerable: true,
7482
+ get: function () { return chunk63WWFZFY_js.isNoValueOperator; }
7483
+ });
7484
+ Object.defineProperty(exports, "isRelativeDateValue", {
7485
+ enumerable: true,
7486
+ get: function () { return chunk63WWFZFY_js.isRelativeDateValue; }
7487
+ });
7488
+ Object.defineProperty(exports, "listViewConfigSchema", {
7489
+ enumerable: true,
7490
+ get: function () { return chunk63WWFZFY_js.listViewConfigSchema; }
7491
+ });
7492
+ Object.defineProperty(exports, "listViewTabSchema", {
7493
+ enumerable: true,
7494
+ get: function () { return chunk63WWFZFY_js.listViewTabSchema; }
7495
+ });
7496
+ Object.defineProperty(exports, "normalizeFilterRule", {
7497
+ enumerable: true,
7498
+ get: function () { return chunk63WWFZFY_js.normalizeFilterRule; }
7499
+ });
7500
+ Object.defineProperty(exports, "normalizeOperator", {
7501
+ enumerable: true,
7502
+ get: function () { return chunk63WWFZFY_js.normalizeOperator; }
7503
+ });
7504
+ Object.defineProperty(exports, "now", {
7505
+ enumerable: true,
7506
+ get: function () { return chunk63WWFZFY_js.now; }
7507
+ });
7508
+ Object.defineProperty(exports, "parseViewConfig", {
7509
+ enumerable: true,
7510
+ get: function () { return chunk63WWFZFY_js.parseViewConfig; }
7511
+ });
7512
+ Object.defineProperty(exports, "relationSourceSchema", {
7513
+ enumerable: true,
7514
+ get: function () { return chunk63WWFZFY_js.relationSourceSchema; }
7515
+ });
7516
+ Object.defineProperty(exports, "resolveIsWithinBounds", {
7517
+ enumerable: true,
7518
+ get: function () { return chunk63WWFZFY_js.resolveIsWithinBounds; }
7519
+ });
7520
+ Object.defineProperty(exports, "tableSourceSchema", {
7521
+ enumerable: true,
7522
+ get: function () { return chunk63WWFZFY_js.tableSourceSchema; }
7523
+ });
7524
+ Object.defineProperty(exports, "toUtcDayString", {
7525
+ enumerable: true,
7526
+ get: function () { return chunk63WWFZFY_js.toUtcDayString; }
7527
+ });
7528
+ Object.defineProperty(exports, "today", {
7529
+ enumerable: true,
7530
+ get: function () { return chunk63WWFZFY_js.today; }
7531
+ });
7532
+ Object.defineProperty(exports, "validateQualifiedRule", {
7533
+ enumerable: true,
7534
+ get: function () { return chunk63WWFZFY_js.validateQualifiedRule; }
7535
+ });
7536
+ Object.defineProperty(exports, "viewConfigByTypeSchema", {
7537
+ enumerable: true,
7538
+ get: function () { return chunk63WWFZFY_js.viewConfigByTypeSchema; }
7539
+ });
7540
+ Object.defineProperty(exports, "viewTypeSchema", {
7541
+ enumerable: true,
7542
+ get: function () { return chunk63WWFZFY_js.viewTypeSchema; }
7543
+ });
7359
7544
  Object.defineProperty(exports, "ComputedFormulaParseError", {
7360
7545
  enumerable: true,
7361
- get: function () { return chunkL4U5QEQL_js.ComputedFormulaParseError; }
7546
+ get: function () { return chunkQN2N3IJZ_js.ComputedFormulaParseError; }
7547
+ });
7548
+ Object.defineProperty(exports, "SCHEMA_LIMITS", {
7549
+ enumerable: true,
7550
+ get: function () { return chunkQN2N3IJZ_js.SCHEMA_LIMITS; }
7551
+ });
7552
+ Object.defineProperty(exports, "colorIdSchema", {
7553
+ enumerable: true,
7554
+ get: function () { return chunkQN2N3IJZ_js.colorIdSchema; }
7555
+ });
7556
+ Object.defineProperty(exports, "iconNameSchema", {
7557
+ enumerable: true,
7558
+ get: function () { return chunkQN2N3IJZ_js.iconNameSchema; }
7559
+ });
7560
+ Object.defineProperty(exports, "multiselectOptionWriteSchema", {
7561
+ enumerable: true,
7562
+ get: function () { return chunkQN2N3IJZ_js.multiselectOptionWriteSchema; }
7362
7563
  });
7363
7564
  Object.defineProperty(exports, "parseAttributeConfig", {
7364
7565
  enumerable: true,
7365
- get: function () { return chunkL4U5QEQL_js.parseAttributeConfig; }
7566
+ get: function () { return chunkQN2N3IJZ_js.parseAttributeConfig; }
7567
+ });
7568
+ Object.defineProperty(exports, "parseAttributeConfigForCreate", {
7569
+ enumerable: true,
7570
+ get: function () { return chunkQN2N3IJZ_js.parseAttributeConfigForCreate; }
7571
+ });
7572
+ Object.defineProperty(exports, "parseAttributeConfigForUpdate", {
7573
+ enumerable: true,
7574
+ get: function () { return chunkQN2N3IJZ_js.parseAttributeConfigForUpdate; }
7366
7575
  });
7367
7576
  Object.defineProperty(exports, "parseComputedFormula", {
7368
7577
  enumerable: true,
7369
- get: function () { return chunkL4U5QEQL_js.parseComputedFormula; }
7578
+ get: function () { return chunkQN2N3IJZ_js.parseComputedFormula; }
7579
+ });
7580
+ Object.defineProperty(exports, "selectOptionWriteSchema", {
7581
+ enumerable: true,
7582
+ get: function () { return chunkQN2N3IJZ_js.selectOptionWriteSchema; }
7583
+ });
7584
+ Object.defineProperty(exports, "statusGroupSchema", {
7585
+ enumerable: true,
7586
+ get: function () { return chunkQN2N3IJZ_js.statusGroupSchema; }
7587
+ });
7588
+ Object.defineProperty(exports, "statusOptionWriteSchema", {
7589
+ enumerable: true,
7590
+ get: function () { return chunkQN2N3IJZ_js.statusOptionWriteSchema; }
7370
7591
  });
7371
7592
  Object.defineProperty(exports, "createFormAttributeValidator", {
7372
7593
  enumerable: true,
7373
- get: function () { return chunkNI3HCSYH_js.createFormAttributeValidator; }
7594
+ get: function () { return chunkV6Q7HCA7_js.createFormAttributeValidator; }
7374
7595
  });
7375
7596
  Object.defineProperty(exports, "rejectUnknownAttributesOrThrow", {
7376
7597
  enumerable: true,
7377
- get: function () { return chunkNI3HCSYH_js.rejectUnknownAttributesOrThrow; }
7598
+ get: function () { return chunkV6Q7HCA7_js.rejectUnknownAttributesOrThrow; }
7378
7599
  });
7379
7600
  Object.defineProperty(exports, "validateDraft", {
7380
7601
  enumerable: true,
7381
- get: function () { return chunkNI3HCSYH_js.validateDraft; }
7602
+ get: function () { return chunkV6Q7HCA7_js.validateDraft; }
7382
7603
  });
7383
7604
  Object.defineProperty(exports, "validateDraftOrThrow", {
7384
7605
  enumerable: true,
7385
- get: function () { return chunkNI3HCSYH_js.validateDraftOrThrow; }
7606
+ get: function () { return chunkV6Q7HCA7_js.validateDraftOrThrow; }
7386
7607
  });
7387
7608
  Object.defineProperty(exports, "validateObject", {
7388
7609
  enumerable: true,
7389
- get: function () { return chunkNI3HCSYH_js.validateObject; }
7610
+ get: function () { return chunkV6Q7HCA7_js.validateObject; }
7390
7611
  });
7391
7612
  Object.defineProperty(exports, "validateObjectOrThrow", {
7392
7613
  enumerable: true,
7393
- get: function () { return chunkNI3HCSYH_js.validateObjectOrThrow; }
7614
+ get: function () { return chunkV6Q7HCA7_js.validateObjectOrThrow; }
7615
+ });
7616
+ Object.defineProperty(exports, "createCheckboxValidator", {
7617
+ enumerable: true,
7618
+ get: function () { return chunk5WATIVCA_js.createCheckboxValidator; }
7619
+ });
7620
+ Object.defineProperty(exports, "createDateValidator", {
7621
+ enumerable: true,
7622
+ get: function () { return chunkSI34M4IC_js.createDateValidator; }
7623
+ });
7624
+ Object.defineProperty(exports, "createNumberValidator", {
7625
+ enumerable: true,
7626
+ get: function () { return chunkYIP5FJ5H_js.createNumberValidator; }
7627
+ });
7628
+ Object.defineProperty(exports, "TEXT_FORMAT_PATTERNS", {
7629
+ enumerable: true,
7630
+ get: function () { return chunkZPFOKBIN_js.TEXT_FORMAT_PATTERNS; }
7631
+ });
7632
+ Object.defineProperty(exports, "createTextValidator", {
7633
+ enumerable: true,
7634
+ get: function () { return chunkZPFOKBIN_js.createTextValidator; }
7635
+ });
7636
+ Object.defineProperty(exports, "resolveTextPattern", {
7637
+ enumerable: true,
7638
+ get: function () { return chunkZPFOKBIN_js.resolveTextPattern; }
7394
7639
  });
7395
7640
  Object.defineProperty(exports, "AccessDeniedError", {
7396
7641
  enumerable: true,
7397
- get: function () { return chunkZBQEMIAV_js.AccessDeniedError; }
7642
+ get: function () { return chunkFDIAOFHS_js.AccessDeniedError; }
7398
7643
  });
7399
7644
  Object.defineProperty(exports, "AttributeInUseError", {
7400
7645
  enumerable: true,
7401
- get: function () { return chunkZBQEMIAV_js.AttributeInUseError; }
7646
+ get: function () { return chunkFDIAOFHS_js.AttributeInUseError; }
7402
7647
  });
7403
7648
  Object.defineProperty(exports, "AttributeNotFoundError", {
7404
7649
  enumerable: true,
7405
- get: function () { return chunkZBQEMIAV_js.AttributeNotFoundError; }
7650
+ get: function () { return chunkFDIAOFHS_js.AttributeNotFoundError; }
7406
7651
  });
7407
7652
  Object.defineProperty(exports, "ChangeTypeNotSupportedError", {
7408
7653
  enumerable: true,
7409
- get: function () { return chunkZBQEMIAV_js.ChangeTypeNotSupportedError; }
7654
+ get: function () { return chunkFDIAOFHS_js.ChangeTypeNotSupportedError; }
7410
7655
  });
7411
7656
  Object.defineProperty(exports, "ConcurrentModificationError", {
7412
7657
  enumerable: true,
7413
- get: function () { return chunkZBQEMIAV_js.ConcurrentModificationError; }
7658
+ get: function () { return chunkFDIAOFHS_js.ConcurrentModificationError; }
7414
7659
  });
7415
7660
  Object.defineProperty(exports, "DestructiveSyncNotAllowedError", {
7416
7661
  enumerable: true,
7417
- get: function () { return chunkZBQEMIAV_js.DestructiveSyncNotAllowedError; }
7662
+ get: function () { return chunkFDIAOFHS_js.DestructiveSyncNotAllowedError; }
7418
7663
  });
7419
7664
  Object.defineProperty(exports, "DuplicateError", {
7420
7665
  enumerable: true,
7421
- get: function () { return chunkZBQEMIAV_js.DuplicateError; }
7666
+ get: function () { return chunkFDIAOFHS_js.DuplicateError; }
7422
7667
  });
7423
7668
  Object.defineProperty(exports, "ForbiddenError", {
7424
7669
  enumerable: true,
7425
- get: function () { return chunkZBQEMIAV_js.ForbiddenError; }
7670
+ get: function () { return chunkFDIAOFHS_js.ForbiddenError; }
7426
7671
  });
7427
7672
  Object.defineProperty(exports, "MemoryNotFoundError", {
7428
7673
  enumerable: true,
7429
- get: function () { return chunkZBQEMIAV_js.MemoryNotFoundError; }
7674
+ get: function () { return chunkFDIAOFHS_js.MemoryNotFoundError; }
7430
7675
  });
7431
7676
  Object.defineProperty(exports, "MigrationTimeoutError", {
7432
7677
  enumerable: true,
7433
- get: function () { return chunkZBQEMIAV_js.MigrationTimeoutError; }
7678
+ get: function () { return chunkFDIAOFHS_js.MigrationTimeoutError; }
7434
7679
  });
7435
7680
  Object.defineProperty(exports, "NotFoundError", {
7436
7681
  enumerable: true,
7437
- get: function () { return chunkZBQEMIAV_js.NotFoundError; }
7682
+ get: function () { return chunkFDIAOFHS_js.NotFoundError; }
7438
7683
  });
7439
7684
  Object.defineProperty(exports, "NotImplementedError", {
7440
7685
  enumerable: true,
7441
- get: function () { return chunkZBQEMIAV_js.NotImplementedError; }
7686
+ get: function () { return chunkFDIAOFHS_js.NotImplementedError; }
7442
7687
  });
7443
7688
  Object.defineProperty(exports, "ObjectNotFoundError", {
7444
7689
  enumerable: true,
7445
- get: function () { return chunkZBQEMIAV_js.ObjectNotFoundError; }
7690
+ get: function () { return chunkFDIAOFHS_js.ObjectNotFoundError; }
7446
7691
  });
7447
7692
  Object.defineProperty(exports, "ObjectReferencedError", {
7448
7693
  enumerable: true,
7449
- get: function () { return chunkZBQEMIAV_js.ObjectReferencedError; }
7694
+ get: function () { return chunkFDIAOFHS_js.ObjectReferencedError; }
7450
7695
  });
7451
7696
  Object.defineProperty(exports, "OrphanSystemAttributeError", {
7452
7697
  enumerable: true,
7453
- get: function () { return chunkZBQEMIAV_js.OrphanSystemAttributeError; }
7698
+ get: function () { return chunkFDIAOFHS_js.OrphanSystemAttributeError; }
7454
7699
  });
7455
7700
  Object.defineProperty(exports, "ProtectedResourceError", {
7456
7701
  enumerable: true,
7457
- get: function () { return chunkZBQEMIAV_js.ProtectedResourceError; }
7702
+ get: function () { return chunkFDIAOFHS_js.ProtectedResourceError; }
7458
7703
  });
7459
7704
  Object.defineProperty(exports, "ProtectedRoleError", {
7460
7705
  enumerable: true,
7461
- get: function () { return chunkZBQEMIAV_js.ProtectedRoleError; }
7706
+ get: function () { return chunkFDIAOFHS_js.ProtectedRoleError; }
7462
7707
  });
7463
7708
  Object.defineProperty(exports, "RecordNotFoundError", {
7464
7709
  enumerable: true,
7465
- get: function () { return chunkZBQEMIAV_js.RecordNotFoundError; }
7710
+ get: function () { return chunkFDIAOFHS_js.RecordNotFoundError; }
7466
7711
  });
7467
7712
  Object.defineProperty(exports, "RecordReferencedError", {
7468
7713
  enumerable: true,
7469
- get: function () { return chunkZBQEMIAV_js.RecordReferencedError; }
7714
+ get: function () { return chunkFDIAOFHS_js.RecordReferencedError; }
7470
7715
  });
7471
7716
  Object.defineProperty(exports, "RepositoryError", {
7472
7717
  enumerable: true,
7473
- get: function () { return chunkZBQEMIAV_js.RepositoryError; }
7718
+ get: function () { return chunkFDIAOFHS_js.RepositoryError; }
7474
7719
  });
7475
7720
  Object.defineProperty(exports, "RoleNotFoundError", {
7476
7721
  enumerable: true,
7477
- get: function () { return chunkZBQEMIAV_js.RoleNotFoundError; }
7722
+ get: function () { return chunkFDIAOFHS_js.RoleNotFoundError; }
7478
7723
  });
7479
7724
  Object.defineProperty(exports, "SchemaError", {
7480
7725
  enumerable: true,
7481
- get: function () { return chunkZBQEMIAV_js.SchemaError; }
7726
+ get: function () { return chunkFDIAOFHS_js.SchemaError; }
7482
7727
  });
7483
7728
  Object.defineProperty(exports, "SchemaErrorCode", {
7484
7729
  enumerable: true,
7485
- get: function () { return chunkZBQEMIAV_js.SchemaErrorCode; }
7730
+ get: function () { return chunkFDIAOFHS_js.SchemaErrorCode; }
7731
+ });
7732
+ Object.defineProperty(exports, "SchemaPlanNotFoundError", {
7733
+ enumerable: true,
7734
+ get: function () { return chunkFDIAOFHS_js.SchemaPlanNotFoundError; }
7486
7735
  });
7487
7736
  Object.defineProperty(exports, "SearchBackendError", {
7488
7737
  enumerable: true,
7489
- get: function () { return chunkZBQEMIAV_js.SearchBackendError; }
7738
+ get: function () { return chunkFDIAOFHS_js.SearchBackendError; }
7490
7739
  });
7491
7740
  Object.defineProperty(exports, "StorageError", {
7492
7741
  enumerable: true,
7493
- get: function () { return chunkZBQEMIAV_js.StorageError; }
7742
+ get: function () { return chunkFDIAOFHS_js.StorageError; }
7494
7743
  });
7495
7744
  Object.defineProperty(exports, "SyncCascadeError", {
7496
7745
  enumerable: true,
7497
- get: function () { return chunkZBQEMIAV_js.SyncCascadeError; }
7746
+ get: function () { return chunkFDIAOFHS_js.SyncCascadeError; }
7498
7747
  });
7499
7748
  Object.defineProperty(exports, "SyncConflictError", {
7500
7749
  enumerable: true,
7501
- get: function () { return chunkZBQEMIAV_js.SyncConflictError; }
7750
+ get: function () { return chunkFDIAOFHS_js.SyncConflictError; }
7502
7751
  });
7503
7752
  Object.defineProperty(exports, "SyncError", {
7504
7753
  enumerable: true,
7505
- get: function () { return chunkZBQEMIAV_js.SyncError; }
7754
+ get: function () { return chunkFDIAOFHS_js.SyncError; }
7506
7755
  });
7507
7756
  Object.defineProperty(exports, "SystemEntityImmutableError", {
7508
7757
  enumerable: true,
7509
- get: function () { return chunkZBQEMIAV_js.SystemEntityImmutableError; }
7758
+ get: function () { return chunkFDIAOFHS_js.SystemEntityImmutableError; }
7510
7759
  });
7511
7760
  Object.defineProperty(exports, "ValidationError", {
7512
7761
  enumerable: true,
7513
- get: function () { return chunkZBQEMIAV_js.ValidationError; }
7762
+ get: function () { return chunkFDIAOFHS_js.ValidationError; }
7514
7763
  });
7515
7764
  Object.defineProperty(exports, "isAttributeInUseError", {
7516
7765
  enumerable: true,
7517
- get: function () { return chunkZBQEMIAV_js.isAttributeInUseError; }
7766
+ get: function () { return chunkFDIAOFHS_js.isAttributeInUseError; }
7518
7767
  });
7519
7768
  Object.defineProperty(exports, "isNotFoundError", {
7520
7769
  enumerable: true,
7521
- get: function () { return chunkZBQEMIAV_js.isNotFoundError; }
7770
+ get: function () { return chunkFDIAOFHS_js.isNotFoundError; }
7522
7771
  });
7523
7772
  Object.defineProperty(exports, "isObjectReferencedError", {
7524
7773
  enumerable: true,
7525
- get: function () { return chunkZBQEMIAV_js.isObjectReferencedError; }
7774
+ get: function () { return chunkFDIAOFHS_js.isObjectReferencedError; }
7526
7775
  });
7527
7776
  Object.defineProperty(exports, "isProtectedResourceError", {
7528
7777
  enumerable: true,
7529
- get: function () { return chunkZBQEMIAV_js.isProtectedResourceError; }
7778
+ get: function () { return chunkFDIAOFHS_js.isProtectedResourceError; }
7530
7779
  });
7531
7780
  Object.defineProperty(exports, "isRecordReferencedError", {
7532
7781
  enumerable: true,
7533
- get: function () { return chunkZBQEMIAV_js.isRecordReferencedError; }
7782
+ get: function () { return chunkFDIAOFHS_js.isRecordReferencedError; }
7534
7783
  });
7535
7784
  Object.defineProperty(exports, "isSchemaError", {
7536
7785
  enumerable: true,
7537
- get: function () { return chunkZBQEMIAV_js.isSchemaError; }
7786
+ get: function () { return chunkFDIAOFHS_js.isSchemaError; }
7538
7787
  });
7539
7788
  Object.defineProperty(exports, "isValidationError", {
7540
7789
  enumerable: true,
7541
- get: function () { return chunkZBQEMIAV_js.isValidationError; }
7790
+ get: function () { return chunkFDIAOFHS_js.isValidationError; }
7542
7791
  });
7543
7792
  Object.defineProperty(exports, "DEFAULT_VALIDATION_MESSAGES", {
7544
7793
  enumerable: true,
@@ -7551,22 +7800,22 @@ Object.defineProperty(exports, "formatZodErrors", {
7551
7800
  exports.ALLOWED_PROPERTY_TYPES = ALLOWED_PROPERTY_TYPES;
7552
7801
  exports.ALL_ACTIONS = ALL_ACTIONS;
7553
7802
  exports.ALL_SYSTEM_RESOURCES = ALL_SYSTEM_RESOURCES;
7554
- exports.ATTRIBUTE_FILTER_OPERATORS = ATTRIBUTE_FILTER_OPERATORS;
7555
7803
  exports.AUDIT_ACTIONS = AUDIT_ACTIONS;
7556
7804
  exports.AUDIT_RESOURCE_TYPES = AUDIT_RESOURCE_TYPES;
7557
7805
  exports.ActivityTabConfig = ActivityTabConfig;
7558
7806
  exports.AgentBuilder = AgentBuilder;
7559
7807
  exports.BEHAVIOR_PROPERTIES = BEHAVIOR_PROPERTIES;
7560
7808
  exports.BROWSER_PREVIEW_STATUSES = BROWSER_PREVIEW_STATUSES;
7809
+ exports.BYTE_UNIT_LABELS = BYTE_UNIT_LABELS;
7561
7810
  exports.COMPUTED_FUNCTIONS = COMPUTED_FUNCTIONS;
7562
7811
  exports.COMPUTED_FUNCTION_METADATA = COMPUTED_FUNCTION_METADATA;
7563
7812
  exports.COMPUTED_FUNCTION_NAMES = COMPUTED_FUNCTION_NAMES;
7564
7813
  exports.CONNECTOR_CALLBACK_PARAM = CONNECTOR_CALLBACK_PARAM;
7565
- exports.CROSS_TYPE_CONVERSIONS = CROSS_TYPE_CONVERSIONS;
7566
7814
  exports.ComputedFormulaCompileError = ComputedFormulaCompileError;
7567
7815
  exports.CustomTabConfig = CustomTabConfig;
7568
7816
  exports.DB_COLUMN_FIELDS = DB_COLUMN_FIELDS;
7569
7817
  exports.DEFAULT_AGENT_EXECUTION_CONFIG = DEFAULT_AGENT_EXECUTION_CONFIG;
7818
+ exports.DEFAULT_APPROVAL_POLICY = DEFAULT_APPROVAL_POLICY;
7570
7819
  exports.DEFAULT_ROLES = DEFAULT_ROLES;
7571
7820
  exports.DEFAULT_ROLE_DESCRIPTIONS = DEFAULT_ROLE_DESCRIPTIONS;
7572
7821
  exports.DEFAULT_ROLE_LABELS = DEFAULT_ROLE_LABELS;
@@ -7575,6 +7824,7 @@ exports.DOCUMENT_SYSTEM_ATTRIBUTES = DOCUMENT_SYSTEM_ATTRIBUTES;
7575
7824
  exports.DetailViewBuilder = DetailViewBuilder;
7576
7825
  exports.DocumentsTabConfig = DocumentsTabConfig;
7577
7826
  exports.EMPTY_VALUE_PLACEHOLDER = EMPTY_VALUE_PLACEHOLDER;
7827
+ exports.ESTIMATED_COUNT_CAP = ESTIMATED_COUNT_CAP;
7578
7828
  exports.EmailsTabConfig = EmailsTabConfig;
7579
7829
  exports.FORM_FORBIDDEN_ATTRIBUTE_TYPES = FORM_FORBIDDEN_ATTRIBUTE_TYPES;
7580
7830
  exports.FlagRegistry = FlagRegistry;
@@ -7590,6 +7840,10 @@ exports.LIVE_STREAM_START_CURSOR = LIVE_STREAM_START_CURSOR;
7590
7840
  exports.ListViewBuilder = ListViewBuilder;
7591
7841
  exports.ListViewTabConfigBuilder = ListViewTabConfigBuilder;
7592
7842
  exports.MAX_PRESET_DEPTH = MAX_PRESET_DEPTH;
7843
+ exports.MAX_TODOS = MAX_TODOS;
7844
+ exports.MAX_TODO_DESCRIPTION_CHARS = MAX_TODO_DESCRIPTION_CHARS;
7845
+ exports.MAX_TODO_ID_CHARS = MAX_TODO_ID_CHARS;
7846
+ exports.MAX_TODO_RESULT_CHARS = MAX_TODO_RESULT_CHARS;
7593
7847
  exports.MEMORY_LIST_VIEW = MEMORY_LIST_VIEW;
7594
7848
  exports.MEMORY_OBJECT = MEMORY_OBJECT;
7595
7849
  exports.MEMORY_VIEW = MEMORY_VIEW;
@@ -7605,34 +7859,33 @@ exports.NOTIFICATION_TYPE_AGENT_SESSION_TIMEOUT = NOTIFICATION_TYPE_AGENT_SESSIO
7605
7859
  exports.NOTIFICATION_TYPE_AGENT_SESSION_WAITING_HUMAN = NOTIFICATION_TYPE_AGENT_SESSION_WAITING_HUMAN;
7606
7860
  exports.NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED = NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED;
7607
7861
  exports.NOTIFICATION_WORK_STATES = NOTIFICATION_WORK_STATES;
7608
- exports.NO_VALUE_OPERATORS = NO_VALUE_OPERATORS;
7609
7862
  exports.NoopGeocodingAdapter = NoopGeocodingAdapter;
7610
- exports.OPERATORS_BY_TYPE = OPERATORS_BY_TYPE;
7611
7863
  exports.OPERATOR_SPECS = OPERATOR_SPECS;
7612
7864
  exports.ObjectBuilder = ObjectBuilder;
7613
7865
  exports.PRESENTATION_PROPERTIES = PRESENTATION_PROPERTIES;
7614
7866
  exports.QUALIFIED_SEPARATOR = QUALIFIED_SEPARATOR;
7867
+ exports.RECORD_CREATOR_ROOT_ACTOR_METADATA_KEY = RECORD_CREATOR_ROOT_ACTOR_METADATA_KEY;
7615
7868
  exports.RELATION_TARGET_ANY = RELATION_TARGET_ANY;
7616
- exports.RESERVED_ATTRIBUTE_NAMES = RESERVED_ATTRIBUTE_NAMES;
7617
- exports.RESERVED_OBJECT_NAMES = RESERVED_OBJECT_NAMES;
7618
7869
  exports.RelationGroupBuilder = RelationGroupBuilder;
7619
7870
  exports.RichtextTabConfig = RichtextTabConfig;
7871
+ exports.SCHEMA_PLAN_LIMITS = SCHEMA_PLAN_LIMITS;
7872
+ exports.SESSION_TERMINAL_STATUSES = SESSION_TERMINAL_STATUSES;
7620
7873
  exports.SKILL_LIST_VIEW = SKILL_LIST_VIEW;
7621
7874
  exports.SKILL_OBJECT = SKILL_OBJECT;
7622
7875
  exports.SKILL_VIEW = SKILL_VIEW;
7623
7876
  exports.STANDARD_SCHEMA_VENDOR = STANDARD_SCHEMA_VENDOR;
7624
- exports.SYNONYM_ALIASES = SYNONYM_ALIASES;
7625
- exports.SYSTEM_ATTRIBUTES = SYSTEM_ATTRIBUTES;
7626
- exports.SYSTEM_ATTRIBUTE_I18N_KEYS = SYSTEM_ATTRIBUTE_I18N_KEYS;
7627
- exports.SYSTEM_FIELD_NAMES = SYSTEM_FIELD_NAMES;
7628
7877
  exports.SYSTEM_RESOURCES = SYSTEM_RESOURCES;
7629
7878
  exports.SYSTEM_RESOURCE_LABELS = SYSTEM_RESOURCE_LABELS;
7879
+ exports.TODAY_DEFAULT = TODAY_DEFAULT;
7880
+ exports.TODO_PLAN_STATUSES = TODO_PLAN_STATUSES;
7881
+ exports.TODO_STATUSES = TODO_STATUSES;
7630
7882
  exports.TabBuilder = TabBuilder;
7631
7883
  exports.TableTabConfig = TableTabConfig;
7632
7884
  exports.USER_STATUSES = USER_STATUSES;
7633
7885
  exports.accessLevelToActions = accessLevelToActions;
7634
7886
  exports.actionsToAccessLevel = actionsToAccessLevel;
7635
7887
  exports.agent = agent;
7888
+ exports.agentDisplayName = agentDisplayName;
7636
7889
  exports.applyPipes = applyPipes;
7637
7890
  exports.applyRelationProps = applyRelationProps;
7638
7891
  exports.assertAcyclicComputedDependencies = assertAcyclicComputedDependencies;
@@ -7645,19 +7898,22 @@ exports.checkbox = checkbox;
7645
7898
  exports.compareLiveStreamCursors = compareLiveStreamCursors;
7646
7899
  exports.compileComputedFormula = compileComputedFormula;
7647
7900
  exports.compileRollupAttribute = compileRollupAttribute;
7901
+ exports.computeByteMagnitude = computeByteMagnitude;
7648
7902
  exports.createFlagRegistry = createFlagRegistry;
7649
7903
  exports.createFlagService = createFlagService;
7650
7904
  exports.createStandardSchemaProps = createStandardSchemaProps;
7651
7905
  exports.currency = currency;
7652
- exports.currentActor = currentActor;
7653
7906
  exports.date = date;
7907
+ exports.dateInTimezone = dateInTimezone;
7654
7908
  exports.dateValueStart = dateValueStart;
7909
+ exports.destructiveSchema = destructiveSchema;
7655
7910
  exports.detailView = detailView;
7656
7911
  exports.document = document;
7657
7912
  exports.evaluateComputedAst = evaluateComputedAst;
7658
7913
  exports.evaluateComputedFormula = evaluateComputedFormula;
7659
7914
  exports.evaluateComputedFormulaWithResult = evaluateComputedFormulaWithResult;
7660
7915
  exports.evaluateFilterState = evaluateFilterState;
7916
+ exports.evaluateRecordFilterState = evaluateRecordFilterState;
7661
7917
  exports.extractAttributeNames = extractAttributeNames;
7662
7918
  exports.extractCurrencyFilterValue = extractCurrencyFilterValue;
7663
7919
  exports.extractFilterValue = extractFilterValue;
@@ -7666,38 +7922,32 @@ exports.flagRegistry = flagRegistry;
7666
7922
  exports.form = form;
7667
7923
  exports.formRegistry = formRegistry;
7668
7924
  exports.formatAttributeValue = formatAttributeValue;
7925
+ exports.formatByteSize = formatByteSize;
7669
7926
  exports.formatComputedResult = formatComputedResult;
7670
7927
  exports.formatLocationValue = formatLocationValue;
7671
7928
  exports.formula = formula;
7672
7929
  exports.generateDefaultDetailView = generateDefaultDetailView;
7673
7930
  exports.generateDefaultListView = generateDefaultListView;
7674
7931
  exports.getActiveTab = getActiveTab;
7675
- exports.getAttributeCapabilities = getAttributeCapabilities;
7676
- exports.getAttributeFilterOperators = getAttributeFilterOperators;
7677
7932
  exports.getErrorMessage = getErrorMessage;
7678
7933
  exports.getLiveProtocolPayloadChannel = getLiveProtocolPayloadChannel;
7679
7934
  exports.getOperatorPolarity = getOperatorPolarity;
7680
- exports.getRollupFilterOperators = getRollupFilterOperators2;
7935
+ exports.getRecordCreatorPrincipalId = getRecordCreatorPrincipalId;
7681
7936
  exports.getSlotFieldTargets = getSlotFieldTargets;
7682
- exports.getSystemAttributeI18nKey = getSystemAttributeI18nKey;
7683
- exports.getSystemAttributeList = getSystemAttributeList;
7684
7937
  exports.getUserDisplayName = getUserDisplayName;
7685
7938
  exports.group = group;
7939
+ exports.hasDestructiveEntries = hasDestructiveEntries;
7686
7940
  exports.hasOptions = hasOptions;
7687
7941
  exports.inferInverseCardinality = inferInverseCardinality;
7688
7942
  exports.inferRollupReturnType = inferRollupReturnType;
7689
- exports.isAttributeFilterable = isAttributeFilterable;
7690
- exports.isAttributeGroupable = isAttributeGroupable;
7691
- exports.isAttributeKanbanGroupable = isAttributeKanbanGroupable;
7692
- exports.isAttributeSearchable = isAttributeSearchable;
7693
7943
  exports.isAttributeSortable = isAttributeSortable2;
7694
7944
  exports.isBilateralRelation = isBilateralRelation;
7945
+ exports.isCheckboxEquality = isCheckboxEquality;
7695
7946
  exports.isComputedFunctionName = isComputedFunctionName;
7696
7947
  exports.isDateRangeValue = isDateRangeValue;
7697
7948
  exports.isDefaultRole = isDefaultRole;
7698
7949
  exports.isDetailView = isDetailView;
7699
7950
  exports.isDocumentAttribute = isDocumentAttribute;
7700
- exports.isDynamicValue = isDynamicValue;
7701
7951
  exports.isEmptyObject = isEmptyObject;
7702
7952
  exports.isFieldGroup = isFieldGroup;
7703
7953
  exports.isFormDefinition = isFormDefinition;
@@ -7717,23 +7967,20 @@ exports.isLiveEventType = isLiveEventType;
7717
7967
  exports.isLiveGapPayload = isLiveGapPayload;
7718
7968
  exports.isLiveReplayCompletePayload = isLiveReplayCompletePayload;
7719
7969
  exports.isLiveStreamCursor = isLiveStreamCursor;
7720
- exports.isManagedSystemAttribute = isManagedSystemAttribute;
7721
- exports.isNoValueOperator = isNoValueOperator;
7722
7970
  exports.isNotEmpty = isNotEmpty;
7723
7971
  exports.isPlainRecord = isPlainRecord;
7724
7972
  exports.isRelationGroup = isRelationGroup;
7725
7973
  exports.isStandardSchema = isStandardSchema;
7974
+ exports.isTerminalSessionStatus = isTerminalSessionStatus;
7726
7975
  exports.isUniversalRelation = isUniversalRelation;
7727
7976
  exports.jsonFlag = jsonFlag;
7728
7977
  exports.listView = listView;
7729
7978
  exports.liveChannelKey = liveChannelKey;
7730
7979
  exports.location = location;
7731
- exports.matchesMime = matchesMime;
7980
+ exports.matchesAccepts = matchesAccepts;
7732
7981
  exports.multiselect = multiselect;
7733
7982
  exports.normalizeDateValue = normalizeDateValue;
7734
7983
  exports.normalizeForEdgeRpc = normalizeForEdgeRpc;
7735
- exports.normalizeOperator = normalizeOperator;
7736
- exports.now = now;
7737
7984
  exports.number = number;
7738
7985
  exports.numberFlag = numberFlag;
7739
7986
  exports.object = object;
@@ -7741,25 +7988,34 @@ exports.parseLiveChannelKey = parseLiveChannelKey;
7741
7988
  exports.parseLiveSubscribePayload = parseLiveSubscribePayload;
7742
7989
  exports.parseLiveUnsubscribePayload = parseLiveUnsubscribePayload;
7743
7990
  exports.parseQualifiedAttribute = parseQualifiedAttribute;
7991
+ exports.persistedDefaultViewTargetSchema = persistedDefaultViewTargetSchema;
7992
+ exports.persistedSchemaPlanSchema = persistedSchemaPlanSchema;
7744
7993
  exports.phone = phone;
7994
+ exports.plannedAttributeSchema = plannedAttributeSchema;
7995
+ exports.plannedInlineAttributeSchema = plannedInlineAttributeSchema;
7996
+ exports.plannedObjectSchema = plannedObjectSchema;
7997
+ exports.proposedDefaultViewTargetSchema = proposedDefaultViewTargetSchema;
7745
7998
  exports.registry = registry;
7746
7999
  exports.relation = relation;
7747
8000
  exports.relationGroup = relationGroup;
7748
8001
  exports.renderLabelExpression = renderLabelExpression;
7749
8002
  exports.resetViewToDefault = resetViewToDefault;
8003
+ exports.resolveAttributeDefaultValue = resolveAttributeDefaultValue;
7750
8004
  exports.resolvePropertyDefinitions = resolvePropertyDefinitions;
7751
8005
  exports.richtext = richtext;
7752
8006
  exports.rollup = rollup;
7753
8007
  exports.rollupToFormulaExpression = rollupToFormulaExpression;
8008
+ exports.schemaPlanSchema = schemaPlanSchema;
7754
8009
  exports.select = select;
7755
8010
  exports.status = status;
7756
8011
  exports.stringFlag = stringFlag;
7757
8012
  exports.text = text;
7758
8013
  exports.toMultiValueOperator = toMultiValueOperator;
7759
8014
  exports.toUndefinedIfEmpty = toUndefinedIfEmpty;
7760
- exports.today = today;
7761
8015
  exports.user = user;
7762
8016
  exports.validateAttributeName = validateAttributeName;
7763
- exports.validateQualifiedRule = validateQualifiedRule;
8017
+ exports.validateLabelExpression = validateLabelExpression;
8018
+ exports.validateObjectName = validateObjectName;
7764
8019
  exports.viewRegistry = viewRegistry;
8020
+ exports.viewStateKey = viewStateKey;
7765
8021
  exports.viewSyncPayload = viewSyncPayload;