@standards/schema 1.0.0-alpha.412 → 1.0.0-alpha.415

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 (140) hide show
  1. package/dist/all-Bldqj4jl.d.ts +4360 -0
  2. package/dist/all-BxsoHW0V.js +4 -0
  3. package/dist/all-C27HT84u.mjs +4 -0
  4. package/dist/all-CmG4j3B_.d.mts +4360 -0
  5. package/dist/api/index.d.mts +386 -764
  6. package/dist/api/index.d.ts +386 -764
  7. package/dist/api/index.js +1 -1
  8. package/dist/api/index.mjs +1 -1
  9. package/dist/{exceptions-C420ndUi.d.ts → exceptions-BIqEbF4H.d.mts} +0 -2
  10. package/dist/{exceptions-C420ndUi.d.mts → exceptions-BIqEbF4H.d.ts} +0 -2
  11. package/dist/exceptions.d.mts +1 -1
  12. package/dist/exceptions.d.ts +1 -1
  13. package/dist/exceptions.js +1 -1
  14. package/dist/exceptions.mjs +1 -1
  15. package/dist/{index-BcSCcPYP.d.mts → index-BGdQIO0V.d.mts} +5902 -5866
  16. package/dist/{index-DML62rLJ.d.ts → index-DIo9VcVh.d.ts} +5902 -5866
  17. package/dist/index.d.mts +5 -10
  18. package/dist/index.d.ts +5 -10
  19. package/dist/index.js +1653 -1
  20. package/dist/index.mjs +1653 -1
  21. package/dist/local-path-CDRPquGU.js +2 -0
  22. package/dist/local-path-PA4ZoNKq.mjs +2 -0
  23. package/dist/primitives-DpBFjzxV.mjs +11 -0
  24. package/dist/primitives-s7GS1T3w.js +11 -0
  25. package/dist/record-operation-C-qr4zs3.js +2 -0
  26. package/dist/record-operation-DM8ZJvmH.mjs +2 -0
  27. package/dist/{utils-Damrow3z.d.ts → utils-CIVBFpC3.d.mts} +11 -1
  28. package/dist/{utils-BwO5qkWb.d.mts → utils-iNW5feob.d.ts} +11 -1
  29. package/dist/utils.d.mts +2 -2
  30. package/dist/utils.d.ts +2 -2
  31. package/dist/utils.js +1 -1
  32. package/dist/utils.mjs +1 -1
  33. package/dist/validation/all.d.mts +1 -4
  34. package/dist/validation/all.d.ts +1 -4
  35. package/dist/validation/all.js +1 -1
  36. package/dist/validation/all.mjs +1 -1
  37. package/package.json +2 -172
  38. package/dist/all-B1wPXYWF.d.mts +0 -2967
  39. package/dist/all-BPIA8DP2.mjs +0 -2
  40. package/dist/all-C46IPclG.js +0 -2
  41. package/dist/all-LNCDQFk5.d.ts +0 -2967
  42. package/dist/attributes-HkhFubZE.d.ts +0 -561
  43. package/dist/attributes-oDsTQ689.d.mts +0 -561
  44. package/dist/checkbox-BN3EcJMd.d.ts +0 -10
  45. package/dist/checkbox-Dd8-zfTD.d.mts +0 -10
  46. package/dist/config-YSw2jzWj.js +0 -2
  47. package/dist/config-iUwnquKr.mjs +0 -2
  48. package/dist/core-DAxRlJ5i.js +0 -2
  49. package/dist/core-rKI7Q9_U.mjs +0 -2
  50. package/dist/date-CEi4zU-G.d.ts +0 -23
  51. package/dist/date-CTR5SI6F.d.mts +0 -23
  52. package/dist/index-BEKmQS4Q.d.mts +0 -269
  53. package/dist/index-BW5-F7CG.d.mts +0 -52
  54. package/dist/index-CtcIhiFv.d.ts +0 -269
  55. package/dist/index-Cxr1ytkx.d.ts +0 -52
  56. package/dist/index-Dl5E_5ex.d.mts +0 -100
  57. package/dist/index-DungcUbX.d.ts +0 -100
  58. package/dist/number-BeaqB8WD.d.ts +0 -10
  59. package/dist/number-CwD0yOIv.d.mts +0 -10
  60. package/dist/object-5-wnsH0o.js +0 -4
  61. package/dist/object-BF5y6bgs.mjs +0 -4
  62. package/dist/objects-CkhVZFNC.d.mts +0 -478
  63. package/dist/objects-DDtMv0oN.d.ts +0 -478
  64. package/dist/phone-BGJea5sr.mjs +0 -2
  65. package/dist/phone-DHXyNkVY.js +0 -2
  66. package/dist/primitives-BCJLtpaI.mjs +0 -11
  67. package/dist/primitives-CVbrjJ24.js +0 -11
  68. package/dist/record-aggregates-BrLE4IsX.mjs +0 -2
  69. package/dist/record-aggregates-BuOfVWPJ.js +0 -2
  70. package/dist/record-operation-B1J86dGW.js +0 -2
  71. package/dist/record-operation-BTmK3mBi.mjs +0 -2
  72. package/dist/rolldown-runtime-DETHMehu.js +0 -2
  73. package/dist/text-BaxaZ5Vv.mjs +0 -2
  74. package/dist/text-Bf12HDTw.d.mts +0 -10
  75. package/dist/text-DVrTGjjX.js +0 -2
  76. package/dist/text-Dim46h6u.d.ts +0 -10
  77. package/dist/validation/complex/currency.d.mts +0 -13
  78. package/dist/validation/complex/currency.d.ts +0 -13
  79. package/dist/validation/complex/currency.js +0 -2
  80. package/dist/validation/complex/currency.mjs +0 -2
  81. package/dist/validation/complex/location.d.mts +0 -20
  82. package/dist/validation/complex/location.d.ts +0 -20
  83. package/dist/validation/complex/location.js +0 -2
  84. package/dist/validation/complex/location.mjs +0 -2
  85. package/dist/validation/complex/phone.d.mts +0 -20
  86. package/dist/validation/complex/phone.d.ts +0 -20
  87. package/dist/validation/complex/phone.js +0 -2
  88. package/dist/validation/complex/phone.mjs +0 -2
  89. package/dist/validation/complex/relation.d.mts +0 -23
  90. package/dist/validation/complex/relation.d.ts +0 -23
  91. package/dist/validation/complex/relation.js +0 -2
  92. package/dist/validation/complex/relation.mjs +0 -2
  93. package/dist/validation/complex/richtext.d.mts +0 -11
  94. package/dist/validation/complex/richtext.d.ts +0 -11
  95. package/dist/validation/complex/richtext.js +0 -2
  96. package/dist/validation/complex/richtext.mjs +0 -2
  97. package/dist/validation/complex/select.d.mts +0 -18
  98. package/dist/validation/complex/select.d.ts +0 -18
  99. package/dist/validation/complex/select.js +0 -2
  100. package/dist/validation/complex/select.mjs +0 -2
  101. package/dist/validation/complex/user.d.mts +0 -11
  102. package/dist/validation/complex/user.d.ts +0 -11
  103. package/dist/validation/complex/user.js +0 -2
  104. package/dist/validation/complex/user.mjs +0 -2
  105. package/dist/validation/computed/formula.d.mts +0 -12
  106. package/dist/validation/computed/formula.d.ts +0 -12
  107. package/dist/validation/computed/formula.js +0 -2
  108. package/dist/validation/computed/formula.mjs +0 -2
  109. package/dist/validation/computed/rollup.d.mts +0 -12
  110. package/dist/validation/computed/rollup.d.ts +0 -12
  111. package/dist/validation/computed/rollup.js +0 -2
  112. package/dist/validation/computed/rollup.mjs +0 -2
  113. package/dist/validation/config/index.d.mts +0 -3
  114. package/dist/validation/config/index.d.ts +0 -3
  115. package/dist/validation/config/index.js +0 -2
  116. package/dist/validation/config/index.mjs +0 -2
  117. package/dist/validation/core/index.d.mts +0 -3
  118. package/dist/validation/core/index.d.ts +0 -3
  119. package/dist/validation/core/index.js +0 -2
  120. package/dist/validation/core/index.mjs +0 -2
  121. package/dist/validation/object/index.d.mts +0 -3
  122. package/dist/validation/object/index.d.ts +0 -3
  123. package/dist/validation/object/index.js +0 -2
  124. package/dist/validation/object/index.mjs +0 -2
  125. package/dist/validation/primitives/checkbox.d.mts +0 -3
  126. package/dist/validation/primitives/checkbox.d.ts +0 -3
  127. package/dist/validation/primitives/checkbox.js +0 -2
  128. package/dist/validation/primitives/checkbox.mjs +0 -2
  129. package/dist/validation/primitives/date.d.mts +0 -3
  130. package/dist/validation/primitives/date.d.ts +0 -3
  131. package/dist/validation/primitives/date.js +0 -2
  132. package/dist/validation/primitives/date.mjs +0 -2
  133. package/dist/validation/primitives/number.d.mts +0 -3
  134. package/dist/validation/primitives/number.d.ts +0 -3
  135. package/dist/validation/primitives/number.js +0 -2
  136. package/dist/validation/primitives/number.mjs +0 -2
  137. package/dist/validation/primitives/text.d.mts +0 -3
  138. package/dist/validation/primitives/text.d.ts +0 -3
  139. package/dist/validation/primitives/text.js +0 -2
  140. package/dist/validation/primitives/text.mjs +0 -2
@@ -1,478 +0,0 @@
1
-
2
- import { Uuid } from "./utils-Damrow3z.js";
3
- import { Attribute } from "./attributes-HkhFubZE.js";
4
- import { ColorId, IconName } from "@standards/constants";
5
- //#region src/types/appearance.d.ts
6
- /** Icon used when neither the entity nor its parent has one. */
7
- export declare const DEFAULT_APPEARANCE_ICON: IconName;
8
- export declare const IMAGE_SHAPES: readonly ["circle", "square"];
9
- export type ImageShape = (typeof IMAGE_SHAPES)[number];
10
- /**
11
- * How an object's records wear an image (#5785 §2): the crop, and where the
12
- * image may be found — an ordered fallback list of the object's `text`
13
- * attributes, whose lookup kind is inferred (`text().url()` a website,
14
- * `text().email()` an email, any other `text()` a name).
15
- */
16
- export interface ObjectImage {
17
- shape: ImageShape;
18
- from?: readonly string[];
19
- }
20
- /**
21
- * Where a record's image came from (#5785 § 4): a person's `upload` (a file,
22
- * or a logo they picked), or found from the record's website, name or email.
23
- * A person's choice is never replaced; a found image follows its data.
24
- */
25
- export declare const IMAGE_SOURCES: readonly ["upload", "website", "name", "email"];
26
- export type ImageSource = (typeof IMAGE_SOURCES)[number];
27
- export declare function isImageSource(value: unknown): value is ImageSource;
28
- /** A record's image: a public file, and where it came from. */
29
- export interface RecordImage {
30
- fileId: Uuid;
31
- source: ImageSource;
32
- }
33
- /** The one appearance shape: every entity stores the facets it accepts. */
34
- export interface Appearance {
35
- icon?: IconName;
36
- color?: ColorId;
37
- imageFileId?: Uuid;
38
- }
39
- export type AppearanceFacet = "icon" | "color" | "image";
40
- export type AppearanceEntity = "object" | "record" | "emailCategory" | "option" | "view" | "agent" | "user";
41
- export declare const APPEARANCE_FACETS: Record<AppearanceEntity, readonly AppearanceFacet[]>;
42
- export type ResolvedAppearance = {
43
- kind: "image";
44
- imageFileId: Uuid;
45
- shape: ImageShape;
46
- } | {
47
- kind: "tile";
48
- icon: IconName;
49
- color: ColorId;
50
- } | {
51
- kind: "glyph";
52
- icon: IconName;
53
- };
54
- type Named = Appearance & {
55
- name?: string;
56
- };
57
- /** A record's own appearance: its image is a {@link RecordImage}, not a bare file id. */
58
- type NamedRecord = Pick<Appearance, "icon" | "color"> & {
59
- name?: string;
60
- image?: RecordImage;
61
- };
62
- /** Image wins; else an icon in a colour (own, parent's or derived from the name) is a tile, without colour a glyph. */
63
- export declare function resolveAppearance(entity: Named | NamedRecord, parent?: Named & {
64
- image?: Pick<ObjectImage, "shape">;
65
- }): ResolvedAppearance;
66
- //#endregion
67
- //#region src/types/document-layout.d.ts
68
- export interface DocumentLayout {
69
- /** Dev-declared folder structures the user can instantiate via the UI inside a record's drive. */
70
- presets?: FolderPreset[];
71
- }
72
- export interface FolderPreset {
73
- id: string;
74
- label: string;
75
- icon?: IconName;
76
- description?: string;
77
- structure: PresetNode[];
78
- /** When true, this preset is auto-instantiated on every new record's drive for the owning object. */
79
- autoInstantiate?: boolean;
80
- }
81
- export interface PresetNode {
82
- title: string;
83
- description?: string;
84
- children?: PresetNode[];
85
- }
86
- /** Max depth allowed for preset.structure to keep instantiation predictable. */
87
- export declare const MAX_PRESET_DEPTH = 5;
88
- //#endregion
89
- //#region src/types/record-access.d.ts
90
- /**
91
- * Every role a resource access grant can carry, weakest first (spec
92
- * 2026-10-08 §3.2): `reader` sees, `runner` also uses (agents only),
93
- * `editor` also modifies and manages the grants.
94
- */
95
- export declare const ACCESS_ROLES: readonly ["reader", "runner", "editor"];
96
- export type AccessRole = (typeof ACCESS_ROLES)[number];
97
- /** Roles a record access grant can carry (spec 2026-09-25 §5.1): a record is never "used". */
98
- export declare const RECORD_ACCESS_ROLES: readonly ["reader", "editor"];
99
- export type RecordAccessRole = (typeof RECORD_ACCESS_ROLES)[number];
100
- /**
101
- * Why a grant exists — the equivalent of Salesforce's `RowCause` (spec §3):
102
- * automatic grants are recomputed without ever touching manual shares.
103
- */
104
- export declare const RECORD_ACCESS_SOURCES: readonly ["manual", "meeting_attendee"];
105
- export type RecordAccessSource = (typeof RECORD_ACCESS_SOURCES)[number];
106
- /**
107
- * Agent-internal objects whose records are never shared (spec 2026-09-25
108
- * §5.3.4): the memory resolver reads "private and visible" as "mine", and an
109
- * extraction could rewrite another member's memory through an `editor` grant.
110
- * A constant in v1 — a definition flag would mean editing native objects. The
111
- * server refuses them; the UI hides the share control for them.
112
- */
113
- export declare const UNSHAREABLE_OBJECT_NAMES: ReadonlySet<string>;
114
- /** What the reading actor may do with a resource (spec §6.6); records never produce `runner`. */
115
- export type ViewerAccess = "owner" | "editor" | "runner" | "reader" | "workspace";
116
- /** One beneficiary of a private resource: its effective role and every source that grants it. */
117
- export interface ResourceAccessGrant<TRole extends AccessRole = AccessRole, TSource extends string = RecordAccessSource> {
118
- actorId: Uuid;
119
- role: TRole;
120
- sources: TSource[];
121
- }
122
- /** One beneficiary of a private record (shape unchanged since 2026-09-25, D11). */
123
- export type RecordAudienceGrant = ResourceAccessGrant<RecordAccessRole, RecordAccessSource>;
124
- /** Who can reach a record beyond its owner (`GET /records/:object/:id/access`). */
125
- export interface RecordAudience {
126
- recordId: Uuid;
127
- visibility: ResourceVisibility;
128
- ownedBy: Uuid | null;
129
- /** The caller's own level; additive (D11), always sent by the server. */
130
- viewerAccess?: ViewerAccess;
131
- grants: RecordAudienceGrant[];
132
- }
133
- /** Who can reach an agent definition beyond its owner (`GET /agents/definitions/:id/access`). */
134
- export interface AgentDefinitionAudience {
135
- definitionId: string;
136
- visibility: ResourceVisibility;
137
- ownedBy: Uuid | null;
138
- viewerAccess: ViewerAccess;
139
- /** Agents only carry manual grants (spec §3.1). */
140
- grants: ResourceAccessGrant<AccessRole, "manual">[];
141
- }
142
- /** A device is lent to a conversation's principal: only `runner`. */
143
- export declare const DEVICE_ACCESS_ROLES: readonly ["runner"];
144
- export type DeviceAccessRole = (typeof DEVICE_ACCESS_ROLES)[number];
145
- /** Who may run commands on a device beyond its owner (`GET /devices/:id/access`). */
146
- export interface DeviceAudience {
147
- deviceId: string;
148
- visibility: ResourceVisibility;
149
- ownedBy: Uuid | null;
150
- viewerAccess: ViewerAccess;
151
- /** Devices only carry manual `runner` grants. */
152
- grants: ResourceAccessGrant<DeviceAccessRole, "manual">[];
153
- }
154
- /** Who can reach a private page beyond its owner (`GET /pages/:id/access`). */
155
- export interface PageAudience {
156
- pageId: Uuid;
157
- visibility: ResourceVisibility;
158
- ownedBy: Uuid | null;
159
- viewerAccess: ViewerAccess;
160
- /** Pages only carry manual grants (screens spec § 8). */
161
- grants: ResourceAccessGrant<RecordAccessRole, "manual">[];
162
- }
163
- /** Roles a conversation share carries (spec 2026-10-27 §4.5): it is read, never written. */
164
- export declare const AGENT_SESSION_ACCESS_ROLES: readonly ["reader"];
165
- export type AgentSessionAccessRole = (typeof AGENT_SESSION_ACCESS_ROLES)[number];
166
- /** Who reads a root conversation beyond its creator (`GET /agents/sessions/:id/access`). */
167
- export interface AgentSessionAudience {
168
- sessionId: string;
169
- /** Always `private`: a conversation is its creator's. */
170
- visibility: ResourceVisibility;
171
- /** The conversation's creator, the only one who shares it. */
172
- ownedBy: Uuid | null;
173
- viewerAccess: ViewerAccess;
174
- /** Conversations only carry manual `reader` grants. */
175
- grants: ResourceAccessGrant<AgentSessionAccessRole, "manual">[];
176
- }
177
- /** The resource an access operation addresses. */
178
- export type ResourceAccessTarget = {
179
- kind: "record";
180
- object: string;
181
- id: string;
182
- } | {
183
- kind: "agent_definition";
184
- id: string;
185
- } | {
186
- kind: "page";
187
- id: string;
188
- } | {
189
- kind: "agent_session";
190
- id: string;
191
- } | {
192
- kind: "device";
193
- id: string;
194
- };
195
- /** Narrow an untrusted value (HTTP body, CLI flag) to a record grant role. */
196
- export declare function parseRecordAccessRole(value: unknown): RecordAccessRole;
197
- /** Narrow an untrusted value to an agent definition grant role. */
198
- export declare function parseAgentDefinitionAccessRole(value: unknown): AccessRole;
199
- /** Narrow an untrusted value to a page grant role: a page is read or edited, never "used". */
200
- export declare function parsePageAccessRole(value: unknown): RecordAccessRole;
201
- /** Narrow an untrusted value to a device grant role: only `runner`. */
202
- export declare function parseDeviceAccessRole(value: unknown): DeviceAccessRole;
203
- /** Narrow an untrusted value to a conversation grant role: only `reader`. */
204
- export declare function parseAgentSessionAccessRole(value: unknown): AgentSessionAccessRole;
205
- /**
206
- * The single derivation of `viewerAccess`, from the row's owner and the
207
- * `viewer_grant` storage computed FOR this viewer. A private resource that is
208
- * neither owned nor granted can only have been read by the system reader,
209
- * which reads and never writes: `reader`.
210
- */
211
- export declare function deriveViewerAccess(resource: {
212
- visibility: ResourceVisibility;
213
- ownedBy: string | null;
214
- viewerGrant?: AccessRole | null;
215
- }, actorIds: readonly string[]): ViewerAccess;
216
- //#endregion
217
- //#region src/types/objects.d.ts
218
- /** Visibility scopes shared by resources that can be workspace-wide or actor-private. */
219
- export declare const RESOURCE_VISIBILITIES: readonly ["workspace", "private"];
220
- export type ResourceVisibility = (typeof RESOURCE_VISIBILITIES)[number];
221
- /**
222
- * Scope a list-view tab reads. Deliberately a SEPARATE union from
223
- * {@link ResourceVisibility}: a stored resource is always exactly one of
224
- * `workspace` or `private`, while a tab may also read across both.
225
- *
226
- * `all` is not a third resource state — it means "impose no scope", so the tab
227
- * returns whatever the mandatory viewer predicate already allows. `shared` is
228
- * not one either: it reads the private resources other members shared with
229
- * the viewer (spec 2026-10-08 §5). Never assign a tab scope to a record's
230
- * `visibility` column.
231
- */
232
- export declare const LIST_VIEW_TAB_VISIBILITIES: readonly ["all", "workspace", "private", "shared"];
233
- export type ListViewTabVisibility = (typeof LIST_VIEW_TAB_VISIBILITIES)[number];
234
- /** The exact scope a record list query may impose: a visibility, or `shared` (owned by someone else, granted to me). */
235
- export declare const RECORD_LIST_SCOPES: readonly ["workspace", "private", "shared"];
236
- export type RecordListScope = (typeof RECORD_LIST_SCOPES)[number];
237
- /** Narrow an untrusted list scope (HTTP body) or reject it — `all` is a tab value, never a query scope. */
238
- export declare function parseRecordListScope(value: unknown): RecordListScope;
239
- /**
240
- * Narrow an untrusted value from an edge (HTTP body, CLI flag) to a
241
- * {@link ResourceVisibility}, or reject it.
242
- *
243
- * It lives beside the union so that whoever changes the union sees the one
244
- * gate that admits values into it. Every edge had grown its own copy, and the
245
- * one edge that instead trusted a `@IsIn` decorator had no gate at all: the
246
- * API host installs a zod-only global pipe, so class-validator DTOs never ran
247
- * and `"all"` — a real member of the sibling {@link ListViewTabVisibility}
248
- * union, so the first thing a confused client sends — reached the visibility
249
- * state machine as a 404, and Postgres as a SQLSTATE 22023 (#1715).
250
- *
251
- * Throws {@link ValidationError} rather than a transport exception so it can
252
- * be used below the controller layer; the HTTP filter maps its code to 400.
253
- */
254
- export declare function parseResourceVisibility(value: unknown): ResourceVisibility;
255
- /**
256
- * Timestamps for tracking creation and updates
257
- */
258
- export interface Timestamps {
259
- createdAt: Date;
260
- updatedAt: Date;
261
- }
262
- /**
263
- * Object definition - Represents a database table/entity
264
- */
265
- export interface ObjectDefinition {
266
- id?: Uuid;
267
- name: string;
268
- label: string;
269
- pluralLabel?: string;
270
- description?: string;
271
- icon?: IconName;
272
- color?: ColorId;
273
- /** How this object's records wear an image: its crop, and where it may be found. */
274
- image?: ObjectImage;
275
- /**
276
- * Template expression used to compute the object's display label.
277
- * Supports variable interpolation and pipes for formatting.
278
- *
279
- * @example
280
- * ```typescript
281
- * // Simple attribute reference
282
- * labelExpression: "{{ name }}"
283
- *
284
- * // Multiple attributes
285
- * labelExpression: "{{ firstName }} {{ lastName }}"
286
- *
287
- * // With pipes for formatting
288
- * labelExpression: "{{ code | UPPER }} - {{ name | capitalize }}"
289
- * ```
290
- *
291
- * Available pipes: UPPER, LOWER, capitalize, trim
292
- */
293
- labelExpression: string;
294
- /**
295
- * Optional template expression used to compute the semantic text sent to
296
- * Meilisearch for vector generation. When absent, records opt out of semantic
297
- * embedding generation.
298
- */
299
- embeddingExpression?: string;
300
- attributes: Attribute[];
301
- system?: boolean;
302
- /**
303
- * If true, no custom (user-created) attributes are allowed on this object.
304
- * `standards diff` will report an error if any custom attribute is found.
305
- * Use .sealed() on the ObjectBuilder to set this.
306
- */
307
- sealed?: boolean;
308
- /**
309
- * List of custom attribute names explicitly acknowledged by the developer.
310
- * On a sealed object, these names will NOT trigger a CI failure.
311
- * On an extensible object, this is purely documentary.
312
- * Use .tolerate(["name"]) on the ObjectBuilder to set this.
313
- */
314
- toleratedAttributes?: string[];
315
- metadata?: Record<string, unknown>;
316
- /** Smart-folder layout convention for documents attached to records of this object. */
317
- documentLayout?: DocumentLayout;
318
- /** Records of this object may have a parent record of the same object (a tree). */
319
- hierarchical?: boolean;
320
- }
321
- /**
322
- * Links an attribute to an object
323
- */
324
- export interface ObjectAttribute {
325
- objectId: Uuid;
326
- attributeId: Uuid;
327
- order?: number;
328
- required?: boolean;
329
- }
330
- /** A record's own icon and image file (`APPEARANCE_FACETS.record`); each key is absent when unset. */
331
- /** A record's own appearance: an icon or an image, never both (#5785 § 4). */
332
- export type RecordAppearance = Pick<Appearance, "icon"> & {
333
- image?: RecordImage;
334
- };
335
- /**
336
- * Record - Instance of an Object (a row in the database)
337
- */
338
- export interface ObjectRecord<TValues extends Record<string, unknown> = Record<string, unknown>> extends Timestamps {
339
- id: Uuid;
340
- objectId: Uuid;
341
- /**
342
- * Name of the owning object. Present on every row read through the repository
343
- * (`object_records.object_name` is denormalized and always selected), absent
344
- * on records built in memory before a write.
345
- */
346
- objectName?: string;
347
- /** Workspace-wide or owner-private visibility enforced by repository queries. */
348
- visibility: ResourceVisibility;
349
- /** Owning actor for private records; always null for workspace records. */
350
- ownedBy: Uuid | null;
351
- /**
352
- * What the reading actor may do with this record (spec §6.6): its owner,
353
- * an editor or reader by grant, or any member of a workspace record.
354
- * Computed for the viewer that read the row; absent on records built in
355
- * memory and on rows read without a viewer. Never broadcast nor indexed.
356
- */
357
- viewerAccess?: ViewerAccess;
358
- /**
359
- * Display label computed from the object's labelExpression.
360
- * Computed dynamically based on record values.
361
- *
362
- * @example "John Doe" (from "{{ firstName }} {{ lastName }}")
363
- */
364
- label: string;
365
- /**
366
- * Semantic text computed from the object's embeddingExpression and persisted
367
- * for Meilisearch documentTemplate-based vector generation.
368
- */
369
- embeddingText?: string;
370
- /**
371
- * The record's own icon or image (`image.fileId` is a `files` row id;
372
- * clients compose `{publicFilesUrl}/{fileId}`), and where the image came
373
- * from. Absent when it has neither: the record then shows its object's
374
- * appearance.
375
- */
376
- appearance?: RecordAppearance;
377
- /** The record this one sits under, in its own object; null for a root. */
378
- parentId: Uuid | null;
379
- /** The path from the root to the parent, root first; empty for a root. */
380
- ancestorIds: readonly Uuid[];
381
- /** The ancestor whose trashing took this record along; null when it was trashed alone or is live. */
382
- trashedWithRecordId: Uuid | null;
383
- /**
384
- * The ids of the first live children (at most `HIERARCHY_CHILD_IDS_LIMIT`).
385
- * Set by the reads of a hierarchical object; absent elsewhere.
386
- */
387
- childIds?: readonly Uuid[];
388
- values: TValues;
389
- /**
390
- * Custom metadata for the record.
391
- * Use this for UI/UX state, feature flags, or any application-specific data.
392
- * Unlike system fields (id, createdAt, updatedAt), metadata can be updated.
393
- */
394
- metadata?: Record<string, unknown>;
395
- /**
396
- * Soft delete timestamp.
397
- * If set, the record is considered deleted but can be restored.
398
- * Queries exclude soft-deleted records by default.
399
- */
400
- deletedAt?: Date | null;
401
- /**
402
- * Actor ID who soft-deleted this record.
403
- * Set alongside deletedAt when a record is soft-deleted.
404
- */
405
- deletedBy?: string | null;
406
- /**
407
- * Actor ID who created this record.
408
- * Automatically set by RecordService when actorId is configured.
409
- * Optional for backward compatibility with existing records.
410
- */
411
- createdBy?: string;
412
- /**
413
- * Actor ID who last updated this record.
414
- * Automatically set by RecordService when actorId is configured.
415
- * Optional for backward compatibility with existing records.
416
- */
417
- lastUpdatedBy?: string;
418
- /** Monotonic record version: moves on every stored change, computed recalculations included. */
419
- version?: number;
420
- /**
421
- * Storage-managed compare-and-set token the engine's own writers retry on.
422
- * Not part of the API contract: no route accepts it as a precondition (a
423
- * write's precondition is an operation step's `base`); read `version`.
424
- * @internal
425
- */
426
- writeVersion?: number;
427
- /** Schema version at the time this record was last migrated */
428
- schemaVersion: number;
429
- }
430
- /**
431
- * System-managed field names on ObjectRecord.
432
- * These are stored as SQL columns (not in JSONB `values`).
433
- *
434
- * Use this in adapters to determine if a filter/sort attribute is a table column
435
- * vs. a JSONB value field.
436
- *
437
- * @example
438
- * ```typescript
439
- * if (SYSTEM_FIELD_NAMES.includes(filter.attribute)) {
440
- * // Filter on SQL column (e.g., WHERE created_at > ...)
441
- * } else {
442
- * // Filter on JSONB field (e.g., WHERE values->>'name' = ...)
443
- * }
444
- * ```
445
- */
446
- export declare const SYSTEM_FIELD_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "visibility", "ownedBy"];
447
- /**
448
- * Type for system field names
449
- */
450
- export type SystemFieldName = (typeof SYSTEM_FIELD_NAMES)[number];
451
- /**
452
- * Reserved attribute names that cannot be used for custom attributes.
453
- * These names conflict with ObjectRecord properties.
454
- *
455
- * Includes:
456
- * - System fields (id, timestamps, actor audit fields, visibility, ownership)
457
- * - Other ObjectRecord properties (objectId, label, values, metadata, deletedAt)
458
- *
459
- * @example
460
- * ```typescript
461
- * if (RESERVED_ATTRIBUTE_NAMES.includes(attributeName)) {
462
- * throw new Error(`"${attributeName}" is a reserved name`);
463
- * }
464
- * ```
465
- */
466
- export declare const RESERVED_ATTRIBUTE_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "visibility", "ownedBy", "objectId", "label", "embeddingText", "values", "metadata", "deletedAt", "deletedBy", "schemaVersion", "appearance", "owned_by", "parentId", "childIds"];
467
- /**
468
- * Type for reserved attribute names
469
- */
470
- export type ReservedAttributeName = (typeof RESERVED_ATTRIBUTE_NAMES)[number];
471
- /**
472
- * Reserved object names: every framework-native object. They cannot be used
473
- * for user-created (runtime) objects, nor declared by a consumer's builder,
474
- * registry entry, bundle or schema source — see `native/names.ts`.
475
- */
476
- export declare const RESERVED_OBJECT_NAMES: readonly ["skill", "memory", "drives", "artifact", "meeting"];
477
- export type ReservedObjectName = (typeof RESERVED_OBJECT_NAMES)[number];
478
- //#endregion
@@ -1,2 +0,0 @@
1
- /*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
- import"./zod-locale.mjs";import{DEFAULT_VALIDATION_MESSAGES as e}from"./core-rKI7Q9_U.mjs";import*as t from"zod";import{getCountryByIso3 as n,isValidIso3 as r,stripTrunkPrefix as i}from"@standards/constants";import{parsePhoneNumberFromString as a}from"libphonenumber-js";function digitsOnly(e){return e.replace(/\D/g,``)}function normalizeCountrylessPhoneNumber(e){return digitsOnly(e)}function getIso2(e){return n(e)?.iso2}function normalizePhoneNumber(e,t){if(!e)return``;let r=getIso2(t);if(!r)return digitsOnly(e);let o=a(e,r);if(o)return absorbDoubledCallingCode(o.nationalNumber,o.isValid(),t,r);let s=n(t),c=digitsOnly(e);if(s){let e=s.phoneCode.replace(`+`,``),t=c.startsWith(e)?c.slice(e.length):c;return i(t,s.phoneTrunkPrefix??``)}return c}function absorbDoubledCallingCode(e,t,r,i){if(t)return e;let o=n(r)?.phoneCode.replace(`+`,``);if(o===void 0||!e.startsWith(o))return e;let s=e.slice(o.length),c=a(`+${o}${s}`,i);return c?.isValid()?c.nationalNumber:e}function formatPhoneForDisplay(e){if(!e.phoneNumber)return``;let t=getIso2(e.countryCode),r=n(e.countryCode)?.phoneCode??``;if(!t)return`${r} ${e.phoneNumber}`.trim();let i=`${r}${digitsOnly(e.phoneNumber)}`,o=a(i);return o?o.formatInternational():`${r} ${e.phoneNumber}`.trim()}function createPhoneValidator(n,i=e){return t.object({countryCode:t.string().length(3),phoneNumber:t.string().min(1,{message:i.required(n)})},{message:i.invalidPhone(n)}).refine(e=>r(e.countryCode),{message:`Invalid country code`}).transform(e=>({countryCode:e.countryCode,phoneNumber:normalizePhoneNumber(e.phoneNumber,e.countryCode)}))}export{createPhoneValidator,formatPhoneForDisplay,getIso2,normalizeCountrylessPhoneNumber,normalizePhoneNumber};
@@ -1,2 +0,0 @@
1
- /*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
- const e=require("./rolldown-runtime-DETHMehu.js");require("./zod-locale.js");const t=require("./core-DAxRlJ5i.js");let n=require("zod");n=e.__toESM(n);let r=require("@standards/constants"),i=require("libphonenumber-js");function digitsOnly(e){return e.replace(/\D/g,``)}function normalizeCountrylessPhoneNumber(e){return digitsOnly(e)}function getIso2(e){return(0,r.getCountryByIso3)(e)?.iso2}function normalizePhoneNumber(e,t){if(!e)return``;let n=getIso2(t);if(!n)return digitsOnly(e);let a=(0,i.parsePhoneNumberFromString)(e,n);if(a)return absorbDoubledCallingCode(a.nationalNumber,a.isValid(),t,n);let o=(0,r.getCountryByIso3)(t),s=digitsOnly(e);if(o){let e=o.phoneCode.replace(`+`,``),t=s.startsWith(e)?s.slice(e.length):s;return(0,r.stripTrunkPrefix)(t,o.phoneTrunkPrefix??``)}return s}function absorbDoubledCallingCode(e,t,n,a){if(t)return e;let o=(0,r.getCountryByIso3)(n)?.phoneCode.replace(`+`,``);if(o===void 0||!e.startsWith(o))return e;let s=e.slice(o.length),c=(0,i.parsePhoneNumberFromString)(`+${o}${s}`,a);return c?.isValid()?c.nationalNumber:e}function formatPhoneForDisplay(e){if(!e.phoneNumber)return``;let t=getIso2(e.countryCode),n=(0,r.getCountryByIso3)(e.countryCode)?.phoneCode??``;if(!t)return`${n} ${e.phoneNumber}`.trim();let a=`${n}${digitsOnly(e.phoneNumber)}`,o=(0,i.parsePhoneNumberFromString)(a);return o?o.formatInternational():`${n} ${e.phoneNumber}`.trim()}function createPhoneValidator(e,i=t.DEFAULT_VALIDATION_MESSAGES){return n.object({countryCode:n.string().length(3),phoneNumber:n.string().min(1,{message:i.required(e)})},{message:i.invalidPhone(e)}).refine(e=>(0,r.isValidIso3)(e.countryCode),{message:`Invalid country code`}).transform(e=>({countryCode:e.countryCode,phoneNumber:normalizePhoneNumber(e.phoneNumber,e.countryCode)}))}Object.defineProperty(exports,"createPhoneValidator",{enumerable:!0,get:function(){return createPhoneValidator}}),Object.defineProperty(exports,"formatPhoneForDisplay",{enumerable:!0,get:function(){return formatPhoneForDisplay}}),Object.defineProperty(exports,"getIso2",{enumerable:!0,get:function(){return getIso2}}),Object.defineProperty(exports,"normalizeCountrylessPhoneNumber",{enumerable:!0,get:function(){return normalizeCountrylessPhoneNumber}}),Object.defineProperty(exports,"normalizePhoneNumber",{enumerable:!0,get:function(){return normalizePhoneNumber}});
@@ -1,11 +0,0 @@
1
- /*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
- import{SchemaError as e,SchemaErrorCode as t,ValidationError as n}from"./exceptions.mjs";import"./zod-locale.mjs";import*as r from"zod";import{COLORS as i,ICONS as a}from"@standards/constants";const o=[`skill`,`memory`,`drives`,`artifact`,`meeting`];function isNativeObjectName(e){return o.includes(e)}const s=[`workspace`,`private`],c=[`all`,...s,`shared`],l=[...s,`shared`];function parseRecordListScope(e){if(typeof e==`string`&&l.includes(e))return e;throw new n(`visibility must be one of: ${l.join(`, `)} (received: ${String(e)})`,[])}function parseResourceVisibility(e){if(typeof e==`string`&&s.includes(e))return e;throw new n(`visibility must be one of: ${s.join(`, `)} (received: ${String(e)})`,[])}const u=[`id`,`createdAt`,`updatedAt`,`createdBy`,`lastUpdatedBy`,`visibility`,`ownedBy`],d=[...u,`objectId`,`label`,`embeddingText`,`values`,`metadata`,`deletedAt`,`deletedBy`,`schemaVersion`,`appearance`,`owned_by`,`parentId`,`childIds`],f=o,p={attributesPerObject:300,tabsPerView:24,membersPerGroup:4,pageRows:1e3,groupsPerFormTab:12,fieldsPerGroup:60,fieldsPerFormTab:150,columnsPerTab:50,optionsPerAttribute:200,sidePanelAttributes:100,sidePanelPanes:20,filterRulesPerTab:50,sortsPerTab:20,emailAttributesPerTab:30,objectsPerPlan:20,mutationsPerPlan:500,planBytes:524288,historyDefault:20,historyMax:50,iconQueries:5,iconResults:20,labelLength:128};function isPlainRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const m=new Set(a),h=/^[a-zA-Z_][a-zA-Z0-9_]*$/,g=/^[a-z][a-z0-9-]*$/,_=p.labelLength,v=r.string().min(1,`Object name cannot be empty`).max(63,`Object name is too long (max 63 characters)`).regex(/^[a-z][a-z0-9-]*$/,{message:`Invalid object name format.
3
- Name must be in kebab-case (slug format):
4
- ✅ Valid: 'products', 'user-profiles', 'order-items'
5
- ❌ Invalid: 'Products', 'userProfiles', 'user_profiles'`});function validateObjectName(n){try{v.parse(n)}catch(n){throw n instanceof r.ZodError?new e(n.issues[0].message,t.INVALID_OBJECT_NAME):n}}function validateViewName(e){if(!e||e.length===0)throw new n(`View name cannot be empty`,[{path:[`name`],message:`View name cannot be empty`}]);if(e.length>63)throw new n(`View name is too long`,[{path:[`name`],message:`View name is too long (max 63 characters)`}]);if(!g.test(e))throw new n(`Invalid view name format`,[{path:[`name`],message:`View name must be in kebab-case (e.g., 'detail', 'list-view')`}])}function assertUniqueBy(e,t,n){let r=new Set;for(let i of e){let e=t(i);if(r.has(e))throw n(e);r.add(e)}}const y=r.string().min(1,`Attribute name cannot be empty`).max(63,`Attribute name is too long (max 63 characters)`).regex(h,{message:`Invalid attribute name format.
6
- Name must be a valid variable identifier:
7
- ✅ Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
8
- ❌ Invalid: 'first-name', 'first name', '123name', 'first.name'`}).refine(e=>!d.includes(e),{message:`This is a reserved attribute name. Reserved names: ${d.join(`, `)}`});function validateAttributeName(e){if(!e||e.length===0)throw Error(`[AttributeBuilder] Attribute name cannot be empty`);if(e.length>63)throw Error(`[AttributeBuilder] Attribute name is too long (max 63 characters)`);if(!h.test(e))throw Error(`[AttributeBuilder] Invalid attribute name format.
9
- Name must be a valid variable identifier:
10
- ✅ Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
11
- ❌ Invalid: 'first-name', 'first name', '123name', 'first.name'`);if(d.includes(e))throw Error(`[AttributeBuilder] "${e}" is a reserved name and cannot be used as an attribute name.\nReserved names: ${d.join(`, `)}`)}function validateLabel(e){if(!e||e.length===0)throw Error(`[AttributeBuilder] Attribute label cannot be empty`);if(e.length>_)throw Error(`[AttributeBuilder] Attribute label is too long (max ${_} characters)`)}function validateIconName(e,t){if(!m.has(e))throw Error(`[AttributeBuilder] Invalid icon "${e}" in ${t}.\nIcon must be one of the predefined icons from @standards/constants.`)}function validateOptions(e,t){let n=new Set;for(let r of t){if(!r.value?.trim())throw Error(`[AttributeBuilder] Option in "${e}" has an empty or missing value.`);if(!r.label?.trim())throw Error(`[AttributeBuilder] Option "${r.value}" in "${e}" has an empty or missing label.`);if(n.has(r.value))throw Error(`[AttributeBuilder] Duplicate option value "${r.value}" in "${e}".`);n.add(r.value)}for(let n of t){if(n.inverse===void 0)continue;let r=t.find(e=>e.value===n.inverse);if(!r)throw Error(`[AttributeBuilder] Option "${n.value}" in "${e}" has inverse "${n.inverse}" which does not match any option value.`);if(r.inverse!==n.value)throw Error(`[AttributeBuilder] Inverse mismatch in "${e}": "${n.value}" points to "${n.inverse}", but "${n.inverse}" points to "${r.inverse??`(none)`}". Inverse pairs must be symmetric.`)}}const b=Object.keys(i),x=new Set(a),S=r.enum(b).describe(`A color id from the palette`),C=r.string().superRefine((e,t)=>{x.has(e)||t.addIssue({code:`custom`,message:`Invalid icon name`})}).transform(e=>e);export{y as ATTRIBUTE_NAME_SCHEMA,c as LIST_VIEW_TAB_VISIBILITIES,o as NATIVE_OBJECT_NAMES,v as OBJECT_NAME_SCHEMA,l as RECORD_LIST_SCOPES,d as RESERVED_ATTRIBUTE_NAMES,f as RESERVED_OBJECT_NAMES,s as RESOURCE_VISIBILITIES,p as SCHEMA_LIMITS,u as SYSTEM_FIELD_NAMES,assertUniqueBy,S as colorIdSchema,C as iconNameSchema,isNativeObjectName,isPlainRecord,parseRecordListScope,parseResourceVisibility,validateAttributeName,validateIconName,validateLabel,validateObjectName,validateOptions,validateViewName};
@@ -1,11 +0,0 @@
1
- /*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
- const e=require("./rolldown-runtime-DETHMehu.js"),t=require("./exceptions.js");require("./zod-locale.js");let n=require("zod");n=e.__toESM(n);let r=require("@standards/constants");const i=[`skill`,`memory`,`drives`,`artifact`,`meeting`];function isNativeObjectName(e){return i.includes(e)}const a=[`workspace`,`private`],o=[`all`,...a,`shared`],s=[...a,`shared`];function parseRecordListScope(e){if(typeof e==`string`&&s.includes(e))return e;throw new t.ValidationError(`visibility must be one of: ${s.join(`, `)} (received: ${String(e)})`,[])}function parseResourceVisibility(e){if(typeof e==`string`&&a.includes(e))return e;throw new t.ValidationError(`visibility must be one of: ${a.join(`, `)} (received: ${String(e)})`,[])}const c=[`id`,`createdAt`,`updatedAt`,`createdBy`,`lastUpdatedBy`,`visibility`,`ownedBy`],l=[...c,`objectId`,`label`,`embeddingText`,`values`,`metadata`,`deletedAt`,`deletedBy`,`schemaVersion`,`appearance`,`owned_by`,`parentId`,`childIds`],u=i,d={attributesPerObject:300,tabsPerView:24,membersPerGroup:4,pageRows:1e3,groupsPerFormTab:12,fieldsPerGroup:60,fieldsPerFormTab:150,columnsPerTab:50,optionsPerAttribute:200,sidePanelAttributes:100,sidePanelPanes:20,filterRulesPerTab:50,sortsPerTab:20,emailAttributesPerTab:30,objectsPerPlan:20,mutationsPerPlan:500,planBytes:524288,historyDefault:20,historyMax:50,iconQueries:5,iconResults:20,labelLength:128};function isPlainRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const f=new Set(r.ICONS),p=/^[a-zA-Z_][a-zA-Z0-9_]*$/,m=/^[a-z][a-z0-9-]*$/,h=d.labelLength,g=n.string().min(1,`Object name cannot be empty`).max(63,`Object name is too long (max 63 characters)`).regex(/^[a-z][a-z0-9-]*$/,{message:`Invalid object name format.
3
- Name must be in kebab-case (slug format):
4
- ✅ Valid: 'products', 'user-profiles', 'order-items'
5
- ❌ Invalid: 'Products', 'userProfiles', 'user_profiles'`});function validateObjectName(e){try{g.parse(e)}catch(e){throw e instanceof n.ZodError?new t.SchemaError(e.issues[0].message,t.SchemaErrorCode.INVALID_OBJECT_NAME):e}}function validateViewName(e){if(!e||e.length===0)throw new t.ValidationError(`View name cannot be empty`,[{path:[`name`],message:`View name cannot be empty`}]);if(e.length>63)throw new t.ValidationError(`View name is too long`,[{path:[`name`],message:`View name is too long (max 63 characters)`}]);if(!m.test(e))throw new t.ValidationError(`Invalid view name format`,[{path:[`name`],message:`View name must be in kebab-case (e.g., 'detail', 'list-view')`}])}function assertUniqueBy(e,t,n){let r=new Set;for(let i of e){let e=t(i);if(r.has(e))throw n(e);r.add(e)}}const _=n.string().min(1,`Attribute name cannot be empty`).max(63,`Attribute name is too long (max 63 characters)`).regex(p,{message:`Invalid attribute name format.
6
- Name must be a valid variable identifier:
7
- ✅ Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
8
- ❌ Invalid: 'first-name', 'first name', '123name', 'first.name'`}).refine(e=>!l.includes(e),{message:`This is a reserved attribute name. Reserved names: ${l.join(`, `)}`});function validateAttributeName(e){if(!e||e.length===0)throw Error(`[AttributeBuilder] Attribute name cannot be empty`);if(e.length>63)throw Error(`[AttributeBuilder] Attribute name is too long (max 63 characters)`);if(!p.test(e))throw Error(`[AttributeBuilder] Invalid attribute name format.
9
- Name must be a valid variable identifier:
10
- ✅ Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
11
- ❌ Invalid: 'first-name', 'first name', '123name', 'first.name'`);if(l.includes(e))throw Error(`[AttributeBuilder] "${e}" is a reserved name and cannot be used as an attribute name.\nReserved names: ${l.join(`, `)}`)}function validateLabel(e){if(!e||e.length===0)throw Error(`[AttributeBuilder] Attribute label cannot be empty`);if(e.length>h)throw Error(`[AttributeBuilder] Attribute label is too long (max ${h} characters)`)}function validateIconName(e,t){if(!f.has(e))throw Error(`[AttributeBuilder] Invalid icon "${e}" in ${t}.\nIcon must be one of the predefined icons from @standards/constants.`)}function validateOptions(e,t){let n=new Set;for(let r of t){if(!r.value?.trim())throw Error(`[AttributeBuilder] Option in "${e}" has an empty or missing value.`);if(!r.label?.trim())throw Error(`[AttributeBuilder] Option "${r.value}" in "${e}" has an empty or missing label.`);if(n.has(r.value))throw Error(`[AttributeBuilder] Duplicate option value "${r.value}" in "${e}".`);n.add(r.value)}for(let n of t){if(n.inverse===void 0)continue;let r=t.find(e=>e.value===n.inverse);if(!r)throw Error(`[AttributeBuilder] Option "${n.value}" in "${e}" has inverse "${n.inverse}" which does not match any option value.`);if(r.inverse!==n.value)throw Error(`[AttributeBuilder] Inverse mismatch in "${e}": "${n.value}" points to "${n.inverse}", but "${n.inverse}" points to "${r.inverse??`(none)`}". Inverse pairs must be symmetric.`)}}const v=Object.keys(r.COLORS),y=new Set(r.ICONS),b=n.enum(v).describe(`A color id from the palette`),x=n.string().superRefine((e,t)=>{y.has(e)||t.addIssue({code:`custom`,message:`Invalid icon name`})}).transform(e=>e);Object.defineProperty(exports,"ATTRIBUTE_NAME_SCHEMA",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"LIST_VIEW_TAB_VISIBILITIES",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"NATIVE_OBJECT_NAMES",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"OBJECT_NAME_SCHEMA",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"RECORD_LIST_SCOPES",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"RESERVED_ATTRIBUTE_NAMES",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"RESERVED_OBJECT_NAMES",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"RESOURCE_VISIBILITIES",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"SCHEMA_LIMITS",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"SYSTEM_FIELD_NAMES",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"assertUniqueBy",{enumerable:!0,get:function(){return assertUniqueBy}}),Object.defineProperty(exports,"colorIdSchema",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"iconNameSchema",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"isNativeObjectName",{enumerable:!0,get:function(){return isNativeObjectName}}),Object.defineProperty(exports,"isPlainRecord",{enumerable:!0,get:function(){return isPlainRecord}}),Object.defineProperty(exports,"parseRecordListScope",{enumerable:!0,get:function(){return parseRecordListScope}}),Object.defineProperty(exports,"parseResourceVisibility",{enumerable:!0,get:function(){return parseResourceVisibility}}),Object.defineProperty(exports,"validateAttributeName",{enumerable:!0,get:function(){return validateAttributeName}}),Object.defineProperty(exports,"validateIconName",{enumerable:!0,get:function(){return validateIconName}}),Object.defineProperty(exports,"validateLabel",{enumerable:!0,get:function(){return validateLabel}}),Object.defineProperty(exports,"validateObjectName",{enumerable:!0,get:function(){return validateObjectName}}),Object.defineProperty(exports,"validateOptions",{enumerable:!0,get:function(){return validateOptions}}),Object.defineProperty(exports,"validateViewName",{enumerable:!0,get:function(){return validateViewName}});
@@ -1,2 +0,0 @@
1
- /*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
- const e=[`question`,`approval`,`review`,`handoff`,`report`,`fyi`],t=[`unread`,`read`,`archived`],n=[`none`,`pending`,`completed`,`dismissed`,`expired`],r=[`open`,`snoozed`,`closed`,`answered`,`withdrawn`,`expired`,`unread`,`read`,`archived`],i=[`record`,`session`,`document`,`agent`,`routine`,`page`,`email_thread`];function formatDecisionLink(e){return e.targetType===`record`?`record:${e.objectName??``}:${e.targetId}`:`${e.targetType}:${e.targetId}`}function parseDecisionLink(e){let[t,...n]=e.split(`:`);if(!i.includes(t??``))return null;let r=t;if(r===`record`){let[e,t]=n;return n.length===2&&e&&t?{targetType:r,targetId:t,objectName:e}:null}let a=n.join(`:`);return a?{targetType:r,targetId:a}:null}function decisionThreadKey(e){return`decision:${e}`}const a=120,o=200,s=`agent.question`,c=`agent.approval`,l=`agent.review`,u=`agent.setup`,d=`agent.routine_run.failed`,f=`agent.message`,p=`connector.connection.reauth_required`,m=`connector.connection.error`,h=`record.assigned`,g=`record.mentioned`,_=`access.granted`,v=`environment.build.failed`,y=`person.decision`,b=`bundle.setup`,x=[s,c,l,u,d,f,p,m,h,g,_,v,y,b],S=[`question`,`approval`,`review`,`handoff`];function isActionableDecisionKind(e){return S.includes(e)}const C=[`agents`,`connectors`,`assignment`,`mentions`,`sharing`],w={[s]:{kind:`question`,area:null},[c]:{kind:`approval`,area:null},[l]:{kind:`review`,area:null},[u]:{kind:`handoff`,area:null},[d]:{kind:`question`,area:`agents`},[f]:{kind:`report`,area:`agents`},[p]:{kind:`handoff`,area:`connectors`},[m]:{kind:`handoff`,area:`connectors`},[h]:{kind:`fyi`,area:`assignment`},[g]:{kind:`fyi`,area:`mentions`},[_]:{kind:`fyi`,area:`sharing`},[v]:{kind:`fyi`,area:`agents`},[y]:{kind:`question`,area:null},[b]:{kind:`handoff`,area:null}},T=`transfers`;function isDecisionTransfer(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.fromActorId==`string`&&typeof t.toActorId==`string`&&typeof t.toLabel==`string`&&typeof t.at==`string`}function decisionTransfersOf(e){let t=e.payload[T];return Array.isArray(t)?t.filter(isDecisionTransfer):[]}function decisionTransferBy(e,t){return decisionTransfersOf(e).filter(e=>e.fromActorId===t).at(-1)}const E=[`open`,`answered`,`withdrawn`,`expired`,`info`],D={createdAt:`createdAt`,updatedAt:`updatedAt`,createdBy:`createdBy`,lastUpdatedBy:`lastUpdatedBy`,attachments:`attachments`,parentId:`parentId`,childIds:`childIds`};function getSystemAttributeI18nKey(e){return D[e]}const O={createdAt:{id:`system:createdAt`,name:`createdAt`,label:`Created time`,type:`date`,required:!1,system:!0,icon:`clock-circle`,description:`When this record was created`},updatedAt:{id:`system:updatedAt`,name:`updatedAt`,label:`Last edited time`,type:`date`,required:!1,system:!0,icon:`clock-circle`,description:`When this record was last modified`},createdBy:{id:`system:createdBy`,name:`createdBy`,label:`Created by`,type:`user`,required:!1,system:!0,multiple:!1,actors:!0,icon:`user`,description:`Actor who created this record`},lastUpdatedBy:{id:`system:lastUpdatedBy`,name:`lastUpdatedBy`,label:`Last edited by`,type:`user`,required:!1,system:!0,multiple:!1,actors:!0,icon:`user`,description:`Actor who last modified this record`},attachments:{id:`system:attachments`,name:`attachments`,label:`Attachments`,type:`document`,required:!1,system:!0,hidden:!0,icon:`paperclip`,description:`Free-form document attachments`}};function getSystemAttributeList(){return Object.values(O)}function isManagedSystemAttribute(e){return e.id?.startsWith(`system:`)??!1}const k=[`hierarchy:parentId`,`hierarchy:childIds`],A=new Set([`parentId`,`childIds`]),j=6;function getHierarchyAttributes(e){if(!e.hierarchical)return[];let t=[{object:e.name}];return[{id:k[0],name:`parentId`,label:`Parent`,type:`relation`,cardinality:`one`,targets:t,required:!1,system:!0,icon:`corner-left-up`,description:`The record this one sits under`},{id:k[1],name:`childIds`,label:`Sub-items`,type:`relation`,cardinality:`many`,targets:t,required:!1,system:!0,icon:`corner-down-right`,description:`The records that sit under this one`}]}function isHierarchyAttribute(e){return e.id?.startsWith(`hierarchy:`)??!1}function getObjectSystemAttributes(e){return[...getSystemAttributeList(),...getHierarchyAttributes(e)]}const M=100,N=[`count`,`sum`,`avg`,`min`,`max`],P=[`day`,`week`,`month`,`quarter`,`year`];export{S as ACTIONABLE_DECISION_KINDS,P as AGGREGATE_BUCKETS,N as AGGREGATE_MEASURES,t as DECISION_INBOX_STATES,e as DECISION_KINDS,o as DECISION_LINE_MAX_LENGTH,i as DECISION_LINK_TARGET_TYPES,r as DECISION_LIST_STATES,E as DECISION_READ_STATES,C as DECISION_SETTINGS_AREAS,a as DECISION_TITLE_MAX_LENGTH,T as DECISION_TRANSFERS_KEY,x as DECISION_TYPES_V1,_ as DECISION_TYPE_ACCESS_GRANTED,c as DECISION_TYPE_AGENT_APPROVAL,f as DECISION_TYPE_AGENT_MESSAGE,s as DECISION_TYPE_AGENT_QUESTION,l as DECISION_TYPE_AGENT_REVIEW,d as DECISION_TYPE_AGENT_ROUTINE_RUN_FAILED,u as DECISION_TYPE_AGENT_SETUP,b as DECISION_TYPE_BUNDLE_SETUP,m as DECISION_TYPE_CONNECTOR_CONNECTION_ERROR,p as DECISION_TYPE_CONNECTOR_CONNECTION_REAUTH_REQUIRED,v as DECISION_TYPE_ENVIRONMENT_BUILD_FAILED,w as DECISION_TYPE_KINDS,y as DECISION_TYPE_PERSON,h as DECISION_TYPE_RECORD_ASSIGNED,g as DECISION_TYPE_RECORD_MENTIONED,n as DECISION_WORK_STATES,k as HIERARCHY_ATTRIBUTE_IDS,A as HIERARCHY_ATTRIBUTE_NAMES,j as HIERARCHY_CHILD_IDS_LIMIT,M as MAX_AGGREGATE_GROUPS,O as SYSTEM_ATTRIBUTES,D as SYSTEM_ATTRIBUTE_I18N_KEYS,decisionThreadKey,decisionTransferBy,decisionTransfersOf,formatDecisionLink,getHierarchyAttributes,getObjectSystemAttributes,getSystemAttributeI18nKey,getSystemAttributeList,isActionableDecisionKind,isHierarchyAttribute,isManagedSystemAttribute,parseDecisionLink};
@@ -1,2 +0,0 @@
1
- /*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
- const e=[`question`,`approval`,`review`,`handoff`,`report`,`fyi`],t=[`unread`,`read`,`archived`],n=[`none`,`pending`,`completed`,`dismissed`,`expired`],r=[`open`,`snoozed`,`closed`,`answered`,`withdrawn`,`expired`,`unread`,`read`,`archived`],i=[`record`,`session`,`document`,`agent`,`routine`,`page`,`email_thread`];function formatDecisionLink(e){return e.targetType===`record`?`record:${e.objectName??``}:${e.targetId}`:`${e.targetType}:${e.targetId}`}function parseDecisionLink(e){let[t,...n]=e.split(`:`);if(!i.includes(t??``))return null;let r=t;if(r===`record`){let[e,t]=n;return n.length===2&&e&&t?{targetType:r,targetId:t,objectName:e}:null}let a=n.join(`:`);return a?{targetType:r,targetId:a}:null}function decisionThreadKey(e){return`decision:${e}`}const a=`agent.question`,o=`agent.approval`,s=`agent.review`,c=`agent.setup`,l=`agent.routine_run.failed`,u=`agent.message`,d=`connector.connection.reauth_required`,f=`connector.connection.error`,p=`record.assigned`,m=`record.mentioned`,h=`access.granted`,g=`environment.build.failed`,_=`person.decision`,v=`bundle.setup`,y=[a,o,s,c,l,u,d,f,p,m,h,g,_,v],b=[`question`,`approval`,`review`,`handoff`];function isActionableDecisionKind(e){return b.includes(e)}const x=[`agents`,`connectors`,`assignment`,`mentions`,`sharing`],S={[a]:{kind:`question`,area:null},[o]:{kind:`approval`,area:null},[s]:{kind:`review`,area:null},[c]:{kind:`handoff`,area:null},[l]:{kind:`question`,area:`agents`},[u]:{kind:`report`,area:`agents`},[d]:{kind:`handoff`,area:`connectors`},[f]:{kind:`handoff`,area:`connectors`},[p]:{kind:`fyi`,area:`assignment`},[m]:{kind:`fyi`,area:`mentions`},[h]:{kind:`fyi`,area:`sharing`},[g]:{kind:`fyi`,area:`agents`},[_]:{kind:`question`,area:null},[v]:{kind:`handoff`,area:null}},C=`transfers`;function isDecisionTransfer(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.fromActorId==`string`&&typeof t.toActorId==`string`&&typeof t.toLabel==`string`&&typeof t.at==`string`}function decisionTransfersOf(e){let t=e.payload[C];return Array.isArray(t)?t.filter(isDecisionTransfer):[]}function decisionTransferBy(e,t){return decisionTransfersOf(e).filter(e=>e.fromActorId===t).at(-1)}const w=[`open`,`answered`,`withdrawn`,`expired`,`info`],T={createdAt:`createdAt`,updatedAt:`updatedAt`,createdBy:`createdBy`,lastUpdatedBy:`lastUpdatedBy`,attachments:`attachments`,parentId:`parentId`,childIds:`childIds`};function getSystemAttributeI18nKey(e){return T[e]}const E={createdAt:{id:`system:createdAt`,name:`createdAt`,label:`Created time`,type:`date`,required:!1,system:!0,icon:`clock-circle`,description:`When this record was created`},updatedAt:{id:`system:updatedAt`,name:`updatedAt`,label:`Last edited time`,type:`date`,required:!1,system:!0,icon:`clock-circle`,description:`When this record was last modified`},createdBy:{id:`system:createdBy`,name:`createdBy`,label:`Created by`,type:`user`,required:!1,system:!0,multiple:!1,actors:!0,icon:`user`,description:`Actor who created this record`},lastUpdatedBy:{id:`system:lastUpdatedBy`,name:`lastUpdatedBy`,label:`Last edited by`,type:`user`,required:!1,system:!0,multiple:!1,actors:!0,icon:`user`,description:`Actor who last modified this record`},attachments:{id:`system:attachments`,name:`attachments`,label:`Attachments`,type:`document`,required:!1,system:!0,hidden:!0,icon:`paperclip`,description:`Free-form document attachments`}};function getSystemAttributeList(){return Object.values(E)}function isManagedSystemAttribute(e){return e.id?.startsWith(`system:`)??!1}const D=[`hierarchy:parentId`,`hierarchy:childIds`],O=new Set([`parentId`,`childIds`]);function getHierarchyAttributes(e){if(!e.hierarchical)return[];let t=[{object:e.name}];return[{id:D[0],name:`parentId`,label:`Parent`,type:`relation`,cardinality:`one`,targets:t,required:!1,system:!0,icon:`corner-left-up`,description:`The record this one sits under`},{id:D[1],name:`childIds`,label:`Sub-items`,type:`relation`,cardinality:`many`,targets:t,required:!1,system:!0,icon:`corner-down-right`,description:`The records that sit under this one`}]}function isHierarchyAttribute(e){return e.id?.startsWith(`hierarchy:`)??!1}function getObjectSystemAttributes(e){return[...getSystemAttributeList(),...getHierarchyAttributes(e)]}const k=[`count`,`sum`,`avg`,`min`,`max`],A=[`day`,`week`,`month`,`quarter`,`year`];Object.defineProperty(exports,"ACTIONABLE_DECISION_KINDS",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"AGGREGATE_BUCKETS",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"AGGREGATE_MEASURES",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"DECISION_INBOX_STATES",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"DECISION_KINDS",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"DECISION_LINE_MAX_LENGTH",{enumerable:!0,get:function(){return 200}}),Object.defineProperty(exports,"DECISION_LINK_TARGET_TYPES",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"DECISION_LIST_STATES",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"DECISION_READ_STATES",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"DECISION_SETTINGS_AREAS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"DECISION_TITLE_MAX_LENGTH",{enumerable:!0,get:function(){return 120}}),Object.defineProperty(exports,"DECISION_TRANSFERS_KEY",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"DECISION_TYPES_V1",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"DECISION_TYPE_ACCESS_GRANTED",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"DECISION_TYPE_AGENT_APPROVAL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"DECISION_TYPE_AGENT_MESSAGE",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"DECISION_TYPE_AGENT_QUESTION",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"DECISION_TYPE_AGENT_REVIEW",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"DECISION_TYPE_AGENT_ROUTINE_RUN_FAILED",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"DECISION_TYPE_AGENT_SETUP",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"DECISION_TYPE_BUNDLE_SETUP",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"DECISION_TYPE_CONNECTOR_CONNECTION_ERROR",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"DECISION_TYPE_CONNECTOR_CONNECTION_REAUTH_REQUIRED",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"DECISION_TYPE_ENVIRONMENT_BUILD_FAILED",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"DECISION_TYPE_KINDS",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"DECISION_TYPE_PERSON",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"DECISION_TYPE_RECORD_ASSIGNED",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"DECISION_TYPE_RECORD_MENTIONED",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"DECISION_WORK_STATES",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"HIERARCHY_ATTRIBUTE_IDS",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"HIERARCHY_ATTRIBUTE_NAMES",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"HIERARCHY_CHILD_IDS_LIMIT",{enumerable:!0,get:function(){return 6}}),Object.defineProperty(exports,"MAX_AGGREGATE_GROUPS",{enumerable:!0,get:function(){return 100}}),Object.defineProperty(exports,"SYSTEM_ATTRIBUTES",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"SYSTEM_ATTRIBUTE_I18N_KEYS",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"decisionThreadKey",{enumerable:!0,get:function(){return decisionThreadKey}}),Object.defineProperty(exports,"decisionTransferBy",{enumerable:!0,get:function(){return decisionTransferBy}}),Object.defineProperty(exports,"decisionTransfersOf",{enumerable:!0,get:function(){return decisionTransfersOf}}),Object.defineProperty(exports,"formatDecisionLink",{enumerable:!0,get:function(){return formatDecisionLink}}),Object.defineProperty(exports,"getHierarchyAttributes",{enumerable:!0,get:function(){return getHierarchyAttributes}}),Object.defineProperty(exports,"getObjectSystemAttributes",{enumerable:!0,get:function(){return getObjectSystemAttributes}}),Object.defineProperty(exports,"getSystemAttributeI18nKey",{enumerable:!0,get:function(){return getSystemAttributeI18nKey}}),Object.defineProperty(exports,"getSystemAttributeList",{enumerable:!0,get:function(){return getSystemAttributeList}}),Object.defineProperty(exports,"isActionableDecisionKind",{enumerable:!0,get:function(){return isActionableDecisionKind}}),Object.defineProperty(exports,"isHierarchyAttribute",{enumerable:!0,get:function(){return isHierarchyAttribute}}),Object.defineProperty(exports,"isManagedSystemAttribute",{enumerable:!0,get:function(){return isManagedSystemAttribute}}),Object.defineProperty(exports,"parseDecisionLink",{enumerable:!0,get:function(){return parseDecisionLink}});