@stndrds/schema 1.0.0-alpha.351 → 1.0.0-alpha.352

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/{all-CxrR3FfQ.d.mts → all-BmVuO_vv.d.mts} +38 -38
  2. package/dist/{all-DgCMEIjc.d.ts → all-Bv-5hu8j.d.ts} +38 -38
  3. package/dist/{attributes-BrWmES5w.d.mts → attributes-Cft68n4u.d.mts} +1 -1
  4. package/dist/{attributes-DF899HOt.d.ts → attributes-gEcJp-WP.d.ts} +1 -1
  5. package/dist/capabilities.d.mts +5 -13
  6. package/dist/capabilities.d.ts +5 -13
  7. package/dist/capabilities.js +1 -1
  8. package/dist/capabilities.mjs +1 -1
  9. package/dist/{checkbox-Clb_FZ4C.d.mts → checkbox-C-kdNm3A.d.mts} +2 -2
  10. package/dist/{checkbox-DdyYfy8E.d.ts → checkbox-C7ctkYoQ.d.ts} +2 -2
  11. package/dist/{date-DhwNqFU4.d.ts → date-CY4L11B_.d.ts} +2 -2
  12. package/dist/{date-CXp1zJM4.d.mts → date-mQ8gxU85.d.mts} +2 -2
  13. package/dist/{exceptions-DrrzAhuA.d.mts → exceptions-704MxF-j.d.mts} +53 -25
  14. package/dist/{exceptions-DrrzAhuA.d.ts → exceptions-704MxF-j.d.ts} +53 -25
  15. package/dist/exceptions.d.mts +2 -2
  16. package/dist/exceptions.d.ts +2 -2
  17. package/dist/exceptions.js +1 -1
  18. package/dist/exceptions.mjs +1 -1
  19. package/dist/{index-Bfvc4AZB.d.mts → index-BV_w2VTh.d.mts} +1 -1
  20. package/dist/{index-OvRk1isl.d.ts → index-Bbc3qfJ3.d.ts} +1 -1
  21. package/dist/{index-DggAjGTr.d.mts → index-Cga9i2js.d.mts} +1 -1
  22. package/dist/{index-Lp5dhlhc.d.mts → index-DQ4cGca2.d.mts} +50 -11
  23. package/dist/{index-DCw-X_sc.d.ts → index-DmS-DtU4.d.ts} +50 -11
  24. package/dist/{index-BOibflWy.d.ts → index-UYQmTrEG.d.ts} +1 -1
  25. package/dist/index.d.mts +1143 -1228
  26. package/dist/index.d.ts +1143 -1228
  27. package/dist/index.js +9 -9
  28. package/dist/index.mjs +9 -9
  29. package/dist/{number-CoTBX03I.d.ts → number-CAAAb8Wz.d.ts} +2 -2
  30. package/dist/{number-C_ZN3qJO.d.mts → number-eNEdOtC3.d.mts} +2 -2
  31. package/dist/{object-AqI3n2CP.mjs → object-sbH7KtsH.mjs} +1 -1
  32. package/dist/{object-BEwZx-Fu.js → object-xwmmQZ8z.js} +1 -1
  33. package/dist/{phone-MN6Li5Wx.js → phone-BXTenBvF.js} +1 -1
  34. package/dist/{phone-CsV9QNwF.mjs → phone-CRbCvH20.mjs} +1 -1
  35. package/dist/{text-D_rs4VYZ.d.mts → text-BKyAPMGX.d.mts} +2 -2
  36. package/dist/{text-Z8QjbxUx.d.ts → text-CP1eHBEv.d.ts} +2 -2
  37. package/dist/{utils-Cuz_wSKI.d.ts → utils-C6VEXia7.d.ts} +3 -3
  38. package/dist/{utils-Cl3b_6d8.d.mts → utils-CnhbUWev.d.mts} +3 -3
  39. package/dist/utils.d.mts +1 -1
  40. package/dist/utils.d.ts +1 -1
  41. package/dist/validation/all.d.mts +4 -4
  42. package/dist/validation/all.d.ts +4 -4
  43. package/dist/validation/all.js +1 -1
  44. package/dist/validation/all.mjs +1 -1
  45. package/dist/validation/complex/currency.d.mts +2 -2
  46. package/dist/validation/complex/currency.d.ts +2 -2
  47. package/dist/validation/complex/location.d.mts +2 -2
  48. package/dist/validation/complex/location.d.ts +2 -2
  49. package/dist/validation/complex/phone.d.mts +2 -2
  50. package/dist/validation/complex/phone.d.ts +2 -2
  51. package/dist/validation/complex/phone.js +1 -1
  52. package/dist/validation/complex/phone.mjs +1 -1
  53. package/dist/validation/complex/relation.d.mts +2 -2
  54. package/dist/validation/complex/relation.d.ts +2 -2
  55. package/dist/validation/complex/richtext.d.mts +2 -2
  56. package/dist/validation/complex/richtext.d.ts +2 -2
  57. package/dist/validation/complex/select.d.mts +2 -2
  58. package/dist/validation/complex/select.d.ts +2 -2
  59. package/dist/validation/complex/user.d.mts +2 -2
  60. package/dist/validation/complex/user.d.ts +2 -2
  61. package/dist/validation/computed/formula.d.mts +2 -2
  62. package/dist/validation/computed/formula.d.ts +2 -2
  63. package/dist/validation/computed/rollup.d.mts +2 -2
  64. package/dist/validation/computed/rollup.d.ts +2 -2
  65. package/dist/validation/config/index.d.mts +1 -1
  66. package/dist/validation/config/index.d.ts +1 -1
  67. package/dist/validation/core/index.d.mts +1 -1
  68. package/dist/validation/core/index.d.ts +1 -1
  69. package/dist/validation/object/index.d.mts +1 -1
  70. package/dist/validation/object/index.d.ts +1 -1
  71. package/dist/validation/object/index.js +1 -1
  72. package/dist/validation/object/index.mjs +1 -1
  73. package/dist/validation/primitives/checkbox.d.mts +1 -1
  74. package/dist/validation/primitives/checkbox.d.ts +1 -1
  75. package/dist/validation/primitives/date.d.mts +1 -1
  76. package/dist/validation/primitives/date.d.ts +1 -1
  77. package/dist/validation/primitives/number.d.mts +1 -1
  78. package/dist/validation/primitives/number.d.ts +1 -1
  79. package/dist/validation/primitives/text.d.mts +1 -1
  80. package/dist/validation/primitives/text.d.ts +1 -1
  81. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
 
2
- import { r as Uuid } from "./utils-Cl3b_6d8.mjs";
2
+ import { r as Uuid } from "./utils-CnhbUWev.mjs";
3
3
  import { ColorId, CountryIso3, CurrencyCode, IconName } from "@stndrds/constants";
4
4
  //#region src/computed/parser.d.ts
5
5
  type ComputedFormulaAstNode = ComputedFormulaLiteralNode | ComputedFormulaPathNode | ComputedFormulaCallNode | ComputedFormulaBinaryNode;
@@ -1,5 +1,5 @@
1
1
 
2
- import { r as Uuid } from "./utils-Cuz_wSKI.js";
2
+ import { r as Uuid } from "./utils-C6VEXia7.js";
3
3
  import { ColorId, CountryIso3, CurrencyCode, IconName } from "@stndrds/constants";
4
4
  //#region src/computed/parser.d.ts
5
5
  type ComputedFormulaAstNode = ComputedFormulaLiteralNode | ComputedFormulaPathNode | ComputedFormulaCallNode | ComputedFormulaBinaryNode;
@@ -51,17 +51,14 @@ export declare const sortsSchema: z$1.ZodArray<z$1.ZodObject<{
51
51
  */
52
52
  export type FilterStateInput = z$1.infer<typeof filtersSchema>;
53
53
  export type FilterRuleInput = FilterStateInput["rules"][number];
54
- /** How a capability mutates data, which decides whether a rehearsal captures it. */
54
+ /** How a capability mutates data, which decides its tool risk. */
55
55
  export type CapabilityKind = "read" | "create" | "update" | "delete";
56
56
  /**
57
- * Every capability a Reflex may call, defined once.
57
+ * The single-record capabilities, defined once.
58
58
  *
59
- * Deliberately five entries — the single-record tools whose input the gateway can
60
- * turn into a faithful `RunEffect`. Excluded on purpose: `get_schema`,
61
- * `global_search` and `bulk_search`, which are not scoped to one object and so
62
- * yield no object to grant a permission on; and the `bulk_*` record tools, where
63
- * one call mutates many records and would be recorded as a single effect, making
64
- * an effects report understate what happened.
59
+ * Deliberately five entries: each is scoped to one object, so its kind maps to
60
+ * one permission. `get_schema`, `global_search` and the `bulk_*`
61
+ * record tools are not single-record operations and live elsewhere.
65
62
  *
66
63
  * `description` is NOT here: the tools compute it per call from their config
67
64
  * (`schemaInContext` changes the wording), and `schema-tools-descriptions.test.ts`
@@ -145,9 +142,4 @@ export type RecordCapabilityName = keyof typeof RECORD_CAPABILITIES;
145
142
  * would have filled in anyway.
146
143
  */
147
144
  export type CapabilityInput<N extends RecordCapabilityName> = z$1.input<(typeof RECORD_CAPABILITIES)[N]["input"]>;
148
- /**
149
- * The capability → kind projection, derived rather than restated. The reflexes
150
- * module reads this instead of maintaining its own table (D26/D28).
151
- */
152
- export declare const RECORD_CAPABILITY_KINDS: Readonly<Record<RecordCapabilityName, CapabilityKind>>;
153
145
  //#endregion
@@ -51,17 +51,14 @@ export declare const sortsSchema: z$1.ZodArray<z$1.ZodObject<{
51
51
  */
52
52
  export type FilterStateInput = z$1.infer<typeof filtersSchema>;
53
53
  export type FilterRuleInput = FilterStateInput["rules"][number];
54
- /** How a capability mutates data, which decides whether a rehearsal captures it. */
54
+ /** How a capability mutates data, which decides its tool risk. */
55
55
  export type CapabilityKind = "read" | "create" | "update" | "delete";
56
56
  /**
57
- * Every capability a Reflex may call, defined once.
57
+ * The single-record capabilities, defined once.
58
58
  *
59
- * Deliberately five entries — the single-record tools whose input the gateway can
60
- * turn into a faithful `RunEffect`. Excluded on purpose: `get_schema`,
61
- * `global_search` and `bulk_search`, which are not scoped to one object and so
62
- * yield no object to grant a permission on; and the `bulk_*` record tools, where
63
- * one call mutates many records and would be recorded as a single effect, making
64
- * an effects report understate what happened.
59
+ * Deliberately five entries: each is scoped to one object, so its kind maps to
60
+ * one permission. `get_schema`, `global_search` and the `bulk_*`
61
+ * record tools are not single-record operations and live elsewhere.
65
62
  *
66
63
  * `description` is NOT here: the tools compute it per call from their config
67
64
  * (`schemaInContext` changes the wording), and `schema-tools-descriptions.test.ts`
@@ -145,9 +142,4 @@ export type RecordCapabilityName = keyof typeof RECORD_CAPABILITIES;
145
142
  * would have filled in anyway.
146
143
  */
147
144
  export type CapabilityInput<N extends RecordCapabilityName> = z$1.input<(typeof RECORD_CAPABILITIES)[N]["input"]>;
148
- /**
149
- * The capability → kind projection, derived rather than restated. The reflexes
150
- * module reads this instead of maintaining its own table (D26/D28).
151
- */
152
- export declare const RECORD_CAPABILITY_KINDS: Readonly<Record<RecordCapabilityName, CapabilityKind>>;
153
145
  //#endregion
@@ -1,2 +1,2 @@
1
1
  /*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("zod");const t=`Object UUID, kebab-case name (e.g., 'contacts'), or display label (e.g., 'Personne physique'). All three are accepted; UUID is most precise.`,n=`Relevance ranking for a name or a phrase — matches tokens, not values. Exact criteria go in filters with NO query.`,r=` For large text content (> a few KB), write it to a sandbox file first and pass {"$fromSandboxFile": "/workspace/<file>"} as the attribute value — the server substitutes the file content.`,i=e.z.object({combinator:e.z.enum([`and`,`or`]).default(`and`),rules:e.z.array(e.z.object({attribute:e.z.string().describe(`Attribute name on the object being searched`),property:e.z.string().optional().describe(`Optional, and the only way to read one part of a compound value. On a relation / document / user attribute declared with .qualifyWith({...}) it names an EDGE property (not the linked record); on a location attribute it is one of city | postalCode | country, which is how a postal code or a city is filtered exactly. The operator must be valid for that property's type. See <filter_operators>.`),operator:e.z.string().describe(`Filter operator (canonical: is, is_not, contains, not_contains, starts_with, ends_with, less_than, greater_than, less_or_equal, greater_or_equal, is_within, on_day_month, any_of, none_of, is_empty, is_not_empty). Short codes (lt, gt, lte, gte, eq, neq, in) are accepted as input and auto-normalized to the canonical names. The valid set depends on the attribute type (or property type when 'property' is set) — see <filter_operators>.`),value:e.z.unknown().nullable().describe(`Value matching the attribute (or property) type: scalar for is/contains/less_than/etc (checkbox is: true|false); array (string[]) for any_of/none_of; null for is_empty/is_not_empty; { amount, unit, direction } for is_within; { day, month } for on_day_month.`)}))}),a=e.z.array(e.z.object({attribute:e.z.string().describe(`Attribute name`),direction:e.z.enum([`asc`,`desc`])})),o=e.z.object({recordId:e.z.string().describe(`Record UUID`),fields:e.z.array(e.z.string()).optional().describe(`Attribute names to return`)}),s=e.z.object({objectId:e.z.string().describe(t),_displayLabel:e.z.string().optional().describe(`Display label`),query:e.z.string().optional().describe(n),limit:e.z.number().optional().describe(`Max results per call: 1-1000 (default 20). Paginate via offset for more.`),offset:e.z.number().optional().describe(`Skip N records (default 0)`),fields:e.z.array(e.z.string()).optional().describe(`Attribute names to include in values`),filters:i.optional().describe(`Structured filter: { combinator: 'and'|'or', rules: [{attribute, operator, value, property?}] }. Operators are constrained per attribute type — see <filter_operators>. Use 'property' on a rule to filter on a qualified edge property.`),sorts:a.optional().describe(`Sorts: [{ attribute, direction: 'asc'|'desc' }]`)}),c=e.z.object({objectId:e.z.string().describe(t),_displayLabel:e.z.string().optional().describe(`Display label`),data:e.z.record(e.z.string(),e.z.unknown()).describe(`Record data.${r}`)}),l=e.z.object({recordId:e.z.string().describe(`Record UUID`),data:e.z.record(e.z.string(),e.z.unknown()).describe(`Fields to update.${r}`)}),u=e.z.object({recordId:e.z.string().describe(`Record UUID`)}),d={get_record:{name:`get_record`,kind:`read`,input:o},search_records:{name:`search_records`,kind:`read`,input:s},create_record:{name:`create_record`,kind:`create`,input:c},update_record:{name:`update_record`,kind:`update`,input:l},delete_record:{name:`delete_record`,kind:`delete`,input:u}},f=Object.freeze(Object.fromEntries(Object.values(d).map(e=>[e.name,e.kind])));exports.OBJECT_ID_DESCRIPTION=t,exports.QUERY_DESCRIPTION=n,exports.RECORD_CAPABILITIES=d,exports.RECORD_CAPABILITY_KINDS=f,exports.SANDBOX_FILE_DATA_HINT=r,exports.filtersSchema=i,exports.sortsSchema=a;
2
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("zod");const t=`Object UUID, kebab-case name (e.g., 'contacts'), or display label (e.g., 'Personne physique'). All three are accepted; UUID is most precise.`,n=`Relevance ranking for a name or a phrase — matches tokens, not values. Exact criteria go in filters with NO query.`,r=` For large text content (> a few KB), write it to a sandbox file first and pass {"$fromSandboxFile": "/workspace/<file>"} as the attribute value — the server substitutes the file content.`,i=e.z.object({combinator:e.z.enum([`and`,`or`]).default(`and`),rules:e.z.array(e.z.object({attribute:e.z.string().describe(`Attribute name on the object being searched`),property:e.z.string().optional().describe(`Optional, and the only way to read one part of a compound value. On a relation / document / user attribute declared with .qualifyWith({...}) it names an EDGE property (not the linked record); on a location attribute it is one of city | postalCode | country, which is how a postal code or a city is filtered exactly. The operator must be valid for that property's type. See <filter_operators>.`),operator:e.z.string().describe(`Filter operator (canonical: is, is_not, contains, not_contains, starts_with, ends_with, less_than, greater_than, less_or_equal, greater_or_equal, is_within, on_day_month, any_of, none_of, is_empty, is_not_empty). Short codes (lt, gt, lte, gte, eq, neq, in) are accepted as input and auto-normalized to the canonical names. The valid set depends on the attribute type (or property type when 'property' is set) — see <filter_operators>.`),value:e.z.unknown().nullable().describe(`Value matching the attribute (or property) type: scalar for is/contains/less_than/etc (checkbox is: true|false); array (string[]) for any_of/none_of; null for is_empty/is_not_empty; { amount, unit, direction } for is_within; { day, month } for on_day_month.`)}))}),a=e.z.array(e.z.object({attribute:e.z.string().describe(`Attribute name`),direction:e.z.enum([`asc`,`desc`])})),o=e.z.object({recordId:e.z.string().describe(`Record UUID`),fields:e.z.array(e.z.string()).optional().describe(`Attribute names to return`)}),s=e.z.object({objectId:e.z.string().describe(t),_displayLabel:e.z.string().optional().describe(`Display label`),query:e.z.string().optional().describe(n),limit:e.z.number().optional().describe(`Max results per call: 1-1000 (default 20). Paginate via offset for more.`),offset:e.z.number().optional().describe(`Skip N records (default 0)`),fields:e.z.array(e.z.string()).optional().describe(`Attribute names to include in values`),filters:i.optional().describe(`Structured filter: { combinator: 'and'|'or', rules: [{attribute, operator, value, property?}] }. Operators are constrained per attribute type — see <filter_operators>. Use 'property' on a rule to filter on a qualified edge property.`),sorts:a.optional().describe(`Sorts: [{ attribute, direction: 'asc'|'desc' }]`)}),c=e.z.object({objectId:e.z.string().describe(t),_displayLabel:e.z.string().optional().describe(`Display label`),data:e.z.record(e.z.string(),e.z.unknown()).describe(`Record data.${r}`)}),l=e.z.object({recordId:e.z.string().describe(`Record UUID`),data:e.z.record(e.z.string(),e.z.unknown()).describe(`Fields to update.${r}`)}),u=e.z.object({recordId:e.z.string().describe(`Record UUID`)}),d={get_record:{name:`get_record`,kind:`read`,input:o},search_records:{name:`search_records`,kind:`read`,input:s},create_record:{name:`create_record`,kind:`create`,input:c},update_record:{name:`update_record`,kind:`update`,input:l},delete_record:{name:`delete_record`,kind:`delete`,input:u}};exports.OBJECT_ID_DESCRIPTION=t,exports.QUERY_DESCRIPTION=n,exports.RECORD_CAPABILITIES=d,exports.SANDBOX_FILE_DATA_HINT=r,exports.filtersSchema=i,exports.sortsSchema=a;
@@ -1,2 +1,2 @@
1
1
  /*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
- import{z as e}from"zod";const t=`Object UUID, kebab-case name (e.g., 'contacts'), or display label (e.g., 'Personne physique'). All three are accepted; UUID is most precise.`,n=`Relevance ranking for a name or a phrase — matches tokens, not values. Exact criteria go in filters with NO query.`,r=` For large text content (> a few KB), write it to a sandbox file first and pass {"$fromSandboxFile": "/workspace/<file>"} as the attribute value — the server substitutes the file content.`,i=e.object({combinator:e.enum([`and`,`or`]).default(`and`),rules:e.array(e.object({attribute:e.string().describe(`Attribute name on the object being searched`),property:e.string().optional().describe(`Optional, and the only way to read one part of a compound value. On a relation / document / user attribute declared with .qualifyWith({...}) it names an EDGE property (not the linked record); on a location attribute it is one of city | postalCode | country, which is how a postal code or a city is filtered exactly. The operator must be valid for that property's type. See <filter_operators>.`),operator:e.string().describe(`Filter operator (canonical: is, is_not, contains, not_contains, starts_with, ends_with, less_than, greater_than, less_or_equal, greater_or_equal, is_within, on_day_month, any_of, none_of, is_empty, is_not_empty). Short codes (lt, gt, lte, gte, eq, neq, in) are accepted as input and auto-normalized to the canonical names. The valid set depends on the attribute type (or property type when 'property' is set) — see <filter_operators>.`),value:e.unknown().nullable().describe(`Value matching the attribute (or property) type: scalar for is/contains/less_than/etc (checkbox is: true|false); array (string[]) for any_of/none_of; null for is_empty/is_not_empty; { amount, unit, direction } for is_within; { day, month } for on_day_month.`)}))}),a=e.array(e.object({attribute:e.string().describe(`Attribute name`),direction:e.enum([`asc`,`desc`])})),o=e.object({recordId:e.string().describe(`Record UUID`),fields:e.array(e.string()).optional().describe(`Attribute names to return`)}),s=e.object({objectId:e.string().describe(t),_displayLabel:e.string().optional().describe(`Display label`),query:e.string().optional().describe(n),limit:e.number().optional().describe(`Max results per call: 1-1000 (default 20). Paginate via offset for more.`),offset:e.number().optional().describe(`Skip N records (default 0)`),fields:e.array(e.string()).optional().describe(`Attribute names to include in values`),filters:i.optional().describe(`Structured filter: { combinator: 'and'|'or', rules: [{attribute, operator, value, property?}] }. Operators are constrained per attribute type — see <filter_operators>. Use 'property' on a rule to filter on a qualified edge property.`),sorts:a.optional().describe(`Sorts: [{ attribute, direction: 'asc'|'desc' }]`)}),c=e.object({objectId:e.string().describe(t),_displayLabel:e.string().optional().describe(`Display label`),data:e.record(e.string(),e.unknown()).describe(`Record data.${r}`)}),l=e.object({recordId:e.string().describe(`Record UUID`),data:e.record(e.string(),e.unknown()).describe(`Fields to update.${r}`)}),u=e.object({recordId:e.string().describe(`Record UUID`)}),d={get_record:{name:`get_record`,kind:`read`,input:o},search_records:{name:`search_records`,kind:`read`,input:s},create_record:{name:`create_record`,kind:`create`,input:c},update_record:{name:`update_record`,kind:`update`,input:l},delete_record:{name:`delete_record`,kind:`delete`,input:u}},f=Object.freeze(Object.fromEntries(Object.values(d).map(e=>[e.name,e.kind])));export{t as OBJECT_ID_DESCRIPTION,n as QUERY_DESCRIPTION,d as RECORD_CAPABILITIES,f as RECORD_CAPABILITY_KINDS,r as SANDBOX_FILE_DATA_HINT,i as filtersSchema,a as sortsSchema};
2
+ import{z as e}from"zod";const t=`Object UUID, kebab-case name (e.g., 'contacts'), or display label (e.g., 'Personne physique'). All three are accepted; UUID is most precise.`,n=`Relevance ranking for a name or a phrase — matches tokens, not values. Exact criteria go in filters with NO query.`,r=` For large text content (> a few KB), write it to a sandbox file first and pass {"$fromSandboxFile": "/workspace/<file>"} as the attribute value — the server substitutes the file content.`,i=e.object({combinator:e.enum([`and`,`or`]).default(`and`),rules:e.array(e.object({attribute:e.string().describe(`Attribute name on the object being searched`),property:e.string().optional().describe(`Optional, and the only way to read one part of a compound value. On a relation / document / user attribute declared with .qualifyWith({...}) it names an EDGE property (not the linked record); on a location attribute it is one of city | postalCode | country, which is how a postal code or a city is filtered exactly. The operator must be valid for that property's type. See <filter_operators>.`),operator:e.string().describe(`Filter operator (canonical: is, is_not, contains, not_contains, starts_with, ends_with, less_than, greater_than, less_or_equal, greater_or_equal, is_within, on_day_month, any_of, none_of, is_empty, is_not_empty). Short codes (lt, gt, lte, gte, eq, neq, in) are accepted as input and auto-normalized to the canonical names. The valid set depends on the attribute type (or property type when 'property' is set) — see <filter_operators>.`),value:e.unknown().nullable().describe(`Value matching the attribute (or property) type: scalar for is/contains/less_than/etc (checkbox is: true|false); array (string[]) for any_of/none_of; null for is_empty/is_not_empty; { amount, unit, direction } for is_within; { day, month } for on_day_month.`)}))}),a=e.array(e.object({attribute:e.string().describe(`Attribute name`),direction:e.enum([`asc`,`desc`])})),o=e.object({recordId:e.string().describe(`Record UUID`),fields:e.array(e.string()).optional().describe(`Attribute names to return`)}),s=e.object({objectId:e.string().describe(t),_displayLabel:e.string().optional().describe(`Display label`),query:e.string().optional().describe(n),limit:e.number().optional().describe(`Max results per call: 1-1000 (default 20). Paginate via offset for more.`),offset:e.number().optional().describe(`Skip N records (default 0)`),fields:e.array(e.string()).optional().describe(`Attribute names to include in values`),filters:i.optional().describe(`Structured filter: { combinator: 'and'|'or', rules: [{attribute, operator, value, property?}] }. Operators are constrained per attribute type — see <filter_operators>. Use 'property' on a rule to filter on a qualified edge property.`),sorts:a.optional().describe(`Sorts: [{ attribute, direction: 'asc'|'desc' }]`)}),c=e.object({objectId:e.string().describe(t),_displayLabel:e.string().optional().describe(`Display label`),data:e.record(e.string(),e.unknown()).describe(`Record data.${r}`)}),l=e.object({recordId:e.string().describe(`Record UUID`),data:e.record(e.string(),e.unknown()).describe(`Fields to update.${r}`)}),u=e.object({recordId:e.string().describe(`Record UUID`)}),d={get_record:{name:`get_record`,kind:`read`,input:o},search_records:{name:`search_records`,kind:`read`,input:s},create_record:{name:`create_record`,kind:`create`,input:c},update_record:{name:`update_record`,kind:`update`,input:l},delete_record:{name:`delete_record`,kind:`delete`,input:u}};export{t as OBJECT_ID_DESCRIPTION,n as QUERY_DESCRIPTION,d as RECORD_CAPABILITIES,r as SANDBOX_FILE_DATA_HINT,i as filtersSchema,a as sortsSchema};
@@ -1,6 +1,6 @@
1
1
 
2
- import { s as CheckboxAttribute } from "./attributes-BrWmES5w.mjs";
3
- import { r as ValidationMessages } from "./index-DggAjGTr.mjs";
2
+ import { s as CheckboxAttribute } from "./attributes-Cft68n4u.mjs";
3
+ import { r as ValidationMessages } from "./index-Cga9i2js.mjs";
4
4
  import { z as z$1 } from "zod";
5
5
  //#region src/validation/primitives/checkbox.d.ts
6
6
  /**
@@ -1,6 +1,6 @@
1
1
 
2
- import { s as CheckboxAttribute } from "./attributes-DF899HOt.js";
3
- import { r as ValidationMessages } from "./index-OvRk1isl.js";
2
+ import { s as CheckboxAttribute } from "./attributes-gEcJp-WP.js";
3
+ import { r as ValidationMessages } from "./index-Bbc3qfJ3.js";
4
4
  import { z as z$1 } from "zod";
5
5
  //#region src/validation/primitives/checkbox.d.ts
6
6
  /**
@@ -1,6 +1,6 @@
1
1
 
2
- import { u as DateAttribute } from "./attributes-DF899HOt.js";
3
- import { r as ValidationMessages } from "./index-OvRk1isl.js";
2
+ import { u as DateAttribute } from "./attributes-gEcJp-WP.js";
3
+ import { r as ValidationMessages } from "./index-Bbc3qfJ3.js";
4
4
  import { z as z$1 } from "zod";
5
5
  //#region src/validation/primitives/date.d.ts
6
6
  /**
@@ -1,6 +1,6 @@
1
1
 
2
- import { u as DateAttribute } from "./attributes-BrWmES5w.mjs";
3
- import { r as ValidationMessages } from "./index-DggAjGTr.mjs";
2
+ import { u as DateAttribute } from "./attributes-Cft68n4u.mjs";
3
+ import { r as ValidationMessages } from "./index-Cga9i2js.mjs";
4
4
  import { z as z$1 } from "zod";
5
5
  //#region src/validation/primitives/date.d.ts
6
6
  /**
@@ -1,4 +1,31 @@
1
1
 
2
+ import { z as z$1 } from "zod";
3
+ //#region src/lib/permission-grants.d.ts
4
+ declare const PERMISSION_ACTIONS: readonly ["read", "create", "update", "delete", "manage"];
5
+ /** The only definition of a valid grant (spec B1). */
6
+ declare const permissionGrantSchema: z$1.ZodObject<{
7
+ scope: z$1.ZodEnum<{
8
+ object: "object";
9
+ system: "system";
10
+ }>;
11
+ target: z$1.ZodString;
12
+ actions: z$1.ZodArray<z$1.ZodEnum<{
13
+ read: "read";
14
+ create: "create";
15
+ update: "update";
16
+ delete: "delete";
17
+ manage: "manage";
18
+ }>>;
19
+ }, z$1.core.$strict>;
20
+ type PermissionGrant = z$1.infer<typeof permissionGrantSchema>;
21
+ interface GrantIssue {
22
+ target: string;
23
+ reason: "shape" | "unknown-resource" | "off-level" | "split-capability" | "unknown-object" | "object-action";
24
+ }
25
+ declare function findGrantIssues(grants: readonly unknown[], context: {
26
+ objectNames: ReadonlySet<string>;
27
+ }): GrantIssue[];
28
+ //#endregion
2
29
  //#region src/exceptions.d.ts
3
30
  /**
4
31
  * Error codes for schema exceptions
@@ -12,7 +39,6 @@ declare const SchemaErrorCode: {
12
39
  readonly SOURCE_NOT_FOUND: "SCHEMA_SOURCE_NOT_FOUND";
13
40
  readonly ROLE_NOT_FOUND: "SCHEMA_ROLE_NOT_FOUND";
14
41
  readonly MEMORY_NOT_FOUND: "SCHEMA_MEMORY_NOT_FOUND";
15
- readonly SCHEMA_PLAN_NOT_FOUND: "SCHEMA_PLAN_NOT_FOUND";
16
42
  readonly VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED";
17
43
  readonly INVALID_ATTRIBUTE_NAME: "SCHEMA_INVALID_ATTRIBUTE_NAME";
18
44
  readonly INVALID_OBJECT_NAME: "SCHEMA_INVALID_OBJECT_NAME";
@@ -22,6 +48,8 @@ declare const SchemaErrorCode: {
22
48
  readonly PROTECTED_ATTRIBUTE: "SCHEMA_PROTECTED_ATTRIBUTE";
23
49
  readonly PROTECTED_VIEW: "SCHEMA_PROTECTED_VIEW";
24
50
  readonly PROTECTED_ROLE: "SCHEMA_PROTECTED_ROLE";
51
+ /** A saved permission grant is outside the permission catalog (spec B1). */
52
+ readonly PERMISSION_INVALID_GRANT: "SCHEMA_PERMISSION_INVALID_GRANT";
25
53
  readonly FORBIDDEN: "SCHEMA_FORBIDDEN";
26
54
  readonly ACCESS_DENIED: "SCHEMA_ACCESS_DENIED";
27
55
  /**
@@ -33,7 +61,7 @@ declare const SchemaErrorCode: {
33
61
  * by a request that was entirely well-formed, whose message tells them how.
34
62
  */
35
63
  readonly WORKSPACE_INVARIANT: "SCHEMA_WORKSPACE_INVARIANT";
36
- /** The resource's own state refuses the operation — a disarmed reflex run. */
64
+ /** The resource's own state refuses the operation — e.g. a draft already being sent. */
37
65
  readonly STATE_GATE: "SCHEMA_STATE_GATE";
38
66
  /** The operation needs an actor and the request carried none. */
39
67
  readonly ACTOR_CONTEXT_REQUIRED: "SCHEMA_ACTOR_CONTEXT_REQUIRED";
@@ -52,6 +80,9 @@ declare const SchemaErrorCode: {
52
80
  readonly ORPHAN_SYSTEM_ATTRIBUTE: "SCHEMA_ORPHAN_SYSTEM_ATTRIBUTE";
53
81
  readonly SYSTEM_ENTITY_IMMUTABLE: "SCHEMA_SYSTEM_ENTITY_IMMUTABLE";
54
82
  readonly AMBIGUOUS_CHANGE: "SCHEMA_AMBIGUOUS_CHANGE";
83
+ readonly RECORD_GRANT_ON_WORKSPACE: "RECORD_GRANT_ON_WORKSPACE";
84
+ readonly RECORD_GRANT_INVALID_ACTOR: "RECORD_GRANT_INVALID_ACTOR";
85
+ readonly RECORD_GRANT_UNSHAREABLE_OBJECT: "RECORD_GRANT_UNSHAREABLE_OBJECT";
55
86
  readonly DUPLICATE: "SCHEMA_DUPLICATE";
56
87
  readonly DUPLICATE_OBJECT: "SCHEMA_DUPLICATE_OBJECT";
57
88
  readonly DUPLICATE_ATTRIBUTE: "SCHEMA_DUPLICATE_ATTRIBUTE";
@@ -99,7 +130,6 @@ declare const SchemaErrorCode: {
99
130
  readonly AGENT_COMPACTION_TIMEOUT: "AGENT_COMPACTION_TIMEOUT";
100
131
  readonly AGENT_LEASE_HELD: "AGENT_LEASE_HELD";
101
132
  readonly AGENT_LEASE_UNAVAILABLE: "AGENT_LEASE_UNAVAILABLE";
102
- readonly AGENT_WORK_MODE_REQUIRED: "AGENT_WORK_MODE_REQUIRED";
103
133
  readonly AGENT_MESSAGE_NOT_FOUND: "AGENT_MESSAGE_NOT_FOUND";
104
134
  readonly AGENT_MESSAGE_NOT_EDITABLE: "AGENT_MESSAGE_NOT_EDITABLE";
105
135
  readonly INVALID_TOOL_INPUT: "INVALID_TOOL_INPUT";
@@ -115,6 +145,11 @@ declare const SchemaErrorCode: {
115
145
  readonly AGENT_CANCELLATION_WATCH_CAPACITY: "AGENT_CANCELLATION_WATCH_CAPACITY";
116
146
  readonly AGENT_CANCELLATION_CLEANUP: "AGENT_CANCELLATION_CLEANUP";
117
147
  readonly AGENT_TURN_FINALIZER_STALLED: "AGENT_TURN_FINALIZER_STALLED";
148
+ readonly WORKSTATION_NOT_READY: "WORKSTATION_NOT_READY";
149
+ readonly WORKSTATION_IN_USE: "WORKSTATION_IN_USE";
150
+ readonly WORKSTATION_NOT_CONNECTED: "WORKSTATION_NOT_CONNECTED";
151
+ readonly WORKSTATION_AUTH_FAILED: "WORKSTATION_AUTH_FAILED";
152
+ readonly WORKSTATION_RUN_FAILED: "WORKSTATION_RUN_FAILED";
118
153
  readonly DEVICE_NOT_FOUND: "DEVICE_NOT_FOUND";
119
154
  readonly DEVICE_OFFLINE: "DEVICE_OFFLINE";
120
155
  readonly DEVICE_CAPABILITY_MISMATCH: "DEVICE_CAPABILITY_MISMATCH";
@@ -131,6 +166,7 @@ declare const SchemaErrorCode: {
131
166
  readonly AI_IMAGE_GENERATION_INDETERMINATE: "AI_IMAGE_GENERATION_INDETERMINATE";
132
167
  readonly AI_IMAGE_RESERVATION_CLEANUP_INDETERMINATE: "AI_IMAGE_RESERVATION_CLEANUP_INDETERMINATE";
133
168
  readonly AI_IMAGE_PUBLICATION_FAILED: "AI_IMAGE_PUBLICATION_FAILED";
169
+ readonly FILE_PUBLIC_NOT_ATTACHABLE: "FILE_PUBLIC_NOT_ATTACHABLE";
134
170
  readonly DOCUMENT_MIME_NOT_ACCEPTED: "DOCUMENT_MIME_NOT_ACCEPTED";
135
171
  readonly DOCUMENT_MULTIPLE_NOT_ALLOWED: "DOCUMENT_MULTIPLE_NOT_ALLOWED";
136
172
  readonly DOCUMENT_NOT_FOUND_FOR_OPERATION: "DOCUMENT_NOT_FOUND_FOR_OPERATION";
@@ -150,18 +186,6 @@ declare const SchemaErrorCode: {
150
186
  readonly EMAIL_SENT_NOT_STORED: "EMAIL_SENT_NOT_STORED";
151
187
  readonly EMAIL_BATCH_ITEM_FAILED: "EMAIL_BATCH_ITEM_FAILED";
152
188
  readonly CALENDAR_PROVIDER_API_FAILED: "CALENDAR_PROVIDER_API_FAILED";
153
- readonly REFLEX_INVALID_TRANSITION: "REFLEX_INVALID_TRANSITION";
154
- readonly REFLEX_INVALID_TOKEN: "REFLEX_INVALID_TOKEN";
155
- readonly REFLEX_CAPABILITY_DENIED: "REFLEX_CAPABILITY_DENIED";
156
- readonly REFLEX_GATEWAY_UNAVAILABLE: "REFLEX_GATEWAY_UNAVAILABLE";
157
- readonly REFLEX_BUNDLE_FAILED: "REFLEX_BUNDLE_FAILED";
158
- readonly REFLEX_EGRESS_DENIED: "REFLEX_EGRESS_DENIED";
159
- readonly REFLEX_PROTOCOL_VIOLATION: "REFLEX_PROTOCOL_VIOLATION";
160
- readonly REFLEX_RUN_FAILED: "REFLEX_RUN_FAILED";
161
- readonly REFLEX_RUN_TIMEOUT: "REFLEX_RUN_TIMEOUT";
162
- readonly REFLEX_DEPENDENCY_DRIFT: "REFLEX_DEPENDENCY_DRIFT";
163
- readonly REFLEX_NOT_READY: "REFLEX_NOT_READY";
164
- readonly REFLEX_INVARIANT_VIOLATION: "REFLEX_INVARIANT_VIOLATION";
165
189
  /** The embeddings feature is enabled but no Gateway credential is configured. */
166
190
  readonly EMBEDDING_MODEL_UNAVAILABLE: "EMBEDDING_MODEL_UNAVAILABLE";
167
191
  /** The provider returned vectors whose length differs from the configured dimensions. */
@@ -210,14 +234,6 @@ declare class AttributeNotFoundError extends NotFoundError {
210
234
  declare class RecordNotFoundError extends NotFoundError {
211
235
  constructor(recordId: string);
212
236
  }
213
- /**
214
- * Schema plan not found error — raised when a `planId` sent by an approver
215
- * (who never receives the plan payload itself, only its id) does not match
216
- * any stored plan.
217
- */
218
- declare class SchemaPlanNotFoundError extends NotFoundError {
219
- constructor(planId: string);
220
- }
221
237
  /**
222
238
  * Validation error with field-level details
223
239
  */
@@ -247,7 +263,9 @@ declare class ValidationError extends SchemaError {
247
263
  * system attribute that disappeared alongside a new one of the same type
248
264
  * (rename or drop + add?), or a retype whose stored values the new type cannot
249
265
  * read. Refused at boot and at source push; resolved by a hand-written SQL
250
- * migration, or by shipping a real removal and addition in separate deploys.
266
+ * migration, by shipping a real removal and addition in separate deploys, or —
267
+ * on a source push, for a rename or a `text → phone` / `number → currency`
268
+ * retype — by the resolution the refusal names (#4362).
251
269
  * HTTP status: 400 Bad Request.
252
270
  *
253
271
  * The first detail's `path[0]` is the declared attribute name, so the boot
@@ -393,6 +411,16 @@ declare class ProtectedRoleError extends SchemaError {
393
411
  readonly operation: "delete" | "modify";
394
412
  constructor(roleName: string, operation: "delete" | "modify");
395
413
  }
414
+ /**
415
+ * Error thrown when a saved permission grant falls outside the permission
416
+ * catalog (spec B1): an unknown resource, a level the catalog never declared,
417
+ * a split capability, an unknown object, or a shape the schema rejects.
418
+ */
419
+ declare class InvalidPermissionGrantError extends SchemaError {
420
+ readonly issues: GrantIssue[];
421
+ readonly _tag = "InvalidPermissionGrantError";
422
+ constructor(issues: GrantIssue[]);
423
+ }
396
424
  /**
397
425
  * Role not found error
398
426
  */
@@ -587,4 +615,4 @@ declare function isAttributeInUseError(error: unknown): error is AttributeInUseE
587
615
  */
588
616
  declare function isObjectReferencedError(error: unknown): error is ObjectReferencedError;
589
617
  //#endregion
590
- export { SearchBackendError as A, ValidationErrorDetail as B, RepositoryError as C, SchemaError as D, RoleNotFoundError as E, SyncCascadeError as F, isRecordReferencedError as G, isNotFoundError as H, SyncConflictError as I, isSchemaError as K, SyncError as L, SearchBackendFailureKind as M, StorageError as N, SchemaErrorCode as O, StorageOperation as P, SystemEntityImmutableError as R, RecordReferencedError as S, ReservedObjectNameError as T, isObjectReferencedError as U, isAttributeInUseError as V, isProtectedResourceError as W, RealtimeDeliveryError as _, AttributeUsage as a, RecordNotFoundError as b, ForbiddenError as c, NotImplementedError as d, ObjectNotFoundError as f, ProtectedRoleError as g, ProtectedResourceError as h, AttributeNotFoundError as i, SearchBackendErrorOptions as j, SchemaPlanNotFoundError as k, MemoryNotFoundError as l, OrphanSystemAttributeError as m, AmbiguousSchemaChangeError as n, ConcurrentModificationError as o, ObjectReferencedError as p, isValidationError as q, AttributeInUseError as r, DuplicateError as s, AccessDeniedError as t, NotFoundError as u, RealtimeRateLimitedError as v, RepositoryOperation as w, RecordReference as x, RealtimeSubscriptionError as y, ValidationError as z };
618
+ export { SearchBackendError as A, ValidationErrorDetail as B, RecordReferencedError as C, RoleNotFoundError as D, ReservedObjectNameError as E, SyncCascadeError as F, isRecordReferencedError as G, isNotFoundError as H, SyncConflictError as I, GrantIssue as J, isSchemaError as K, SyncError as L, SearchBackendFailureKind as M, StorageError as N, SchemaError as O, StorageOperation as P, permissionGrantSchema as Q, SystemEntityImmutableError as R, RecordReference as S, RepositoryOperation as T, isObjectReferencedError as U, isAttributeInUseError as V, isProtectedResourceError as W, PermissionGrant as X, PERMISSION_ACTIONS as Y, findGrantIssues as Z, ProtectedRoleError as _, AttributeUsage as a, RealtimeSubscriptionError as b, ForbiddenError as c, NotFoundError as d, NotImplementedError as f, ProtectedResourceError as g, OrphanSystemAttributeError as h, AttributeNotFoundError as i, SearchBackendErrorOptions as j, SchemaErrorCode as k, InvalidPermissionGrantError as l, ObjectReferencedError as m, AmbiguousSchemaChangeError as n, ConcurrentModificationError as o, ObjectNotFoundError as p, isValidationError as q, AttributeInUseError as r, DuplicateError as s, AccessDeniedError as t, MemoryNotFoundError as u, RealtimeDeliveryError as v, RepositoryError as w, RecordNotFoundError as x, RealtimeRateLimitedError as y, ValidationError as z };
@@ -1,4 +1,31 @@
1
1
 
2
+ import { z as z$1 } from "zod";
3
+ //#region src/lib/permission-grants.d.ts
4
+ declare const PERMISSION_ACTIONS: readonly ["read", "create", "update", "delete", "manage"];
5
+ /** The only definition of a valid grant (spec B1). */
6
+ declare const permissionGrantSchema: z$1.ZodObject<{
7
+ scope: z$1.ZodEnum<{
8
+ object: "object";
9
+ system: "system";
10
+ }>;
11
+ target: z$1.ZodString;
12
+ actions: z$1.ZodArray<z$1.ZodEnum<{
13
+ read: "read";
14
+ create: "create";
15
+ update: "update";
16
+ delete: "delete";
17
+ manage: "manage";
18
+ }>>;
19
+ }, z$1.core.$strict>;
20
+ type PermissionGrant = z$1.infer<typeof permissionGrantSchema>;
21
+ interface GrantIssue {
22
+ target: string;
23
+ reason: "shape" | "unknown-resource" | "off-level" | "split-capability" | "unknown-object" | "object-action";
24
+ }
25
+ declare function findGrantIssues(grants: readonly unknown[], context: {
26
+ objectNames: ReadonlySet<string>;
27
+ }): GrantIssue[];
28
+ //#endregion
2
29
  //#region src/exceptions.d.ts
3
30
  /**
4
31
  * Error codes for schema exceptions
@@ -12,7 +39,6 @@ declare const SchemaErrorCode: {
12
39
  readonly SOURCE_NOT_FOUND: "SCHEMA_SOURCE_NOT_FOUND";
13
40
  readonly ROLE_NOT_FOUND: "SCHEMA_ROLE_NOT_FOUND";
14
41
  readonly MEMORY_NOT_FOUND: "SCHEMA_MEMORY_NOT_FOUND";
15
- readonly SCHEMA_PLAN_NOT_FOUND: "SCHEMA_PLAN_NOT_FOUND";
16
42
  readonly VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED";
17
43
  readonly INVALID_ATTRIBUTE_NAME: "SCHEMA_INVALID_ATTRIBUTE_NAME";
18
44
  readonly INVALID_OBJECT_NAME: "SCHEMA_INVALID_OBJECT_NAME";
@@ -22,6 +48,8 @@ declare const SchemaErrorCode: {
22
48
  readonly PROTECTED_ATTRIBUTE: "SCHEMA_PROTECTED_ATTRIBUTE";
23
49
  readonly PROTECTED_VIEW: "SCHEMA_PROTECTED_VIEW";
24
50
  readonly PROTECTED_ROLE: "SCHEMA_PROTECTED_ROLE";
51
+ /** A saved permission grant is outside the permission catalog (spec B1). */
52
+ readonly PERMISSION_INVALID_GRANT: "SCHEMA_PERMISSION_INVALID_GRANT";
25
53
  readonly FORBIDDEN: "SCHEMA_FORBIDDEN";
26
54
  readonly ACCESS_DENIED: "SCHEMA_ACCESS_DENIED";
27
55
  /**
@@ -33,7 +61,7 @@ declare const SchemaErrorCode: {
33
61
  * by a request that was entirely well-formed, whose message tells them how.
34
62
  */
35
63
  readonly WORKSPACE_INVARIANT: "SCHEMA_WORKSPACE_INVARIANT";
36
- /** The resource's own state refuses the operation — a disarmed reflex run. */
64
+ /** The resource's own state refuses the operation — e.g. a draft already being sent. */
37
65
  readonly STATE_GATE: "SCHEMA_STATE_GATE";
38
66
  /** The operation needs an actor and the request carried none. */
39
67
  readonly ACTOR_CONTEXT_REQUIRED: "SCHEMA_ACTOR_CONTEXT_REQUIRED";
@@ -52,6 +80,9 @@ declare const SchemaErrorCode: {
52
80
  readonly ORPHAN_SYSTEM_ATTRIBUTE: "SCHEMA_ORPHAN_SYSTEM_ATTRIBUTE";
53
81
  readonly SYSTEM_ENTITY_IMMUTABLE: "SCHEMA_SYSTEM_ENTITY_IMMUTABLE";
54
82
  readonly AMBIGUOUS_CHANGE: "SCHEMA_AMBIGUOUS_CHANGE";
83
+ readonly RECORD_GRANT_ON_WORKSPACE: "RECORD_GRANT_ON_WORKSPACE";
84
+ readonly RECORD_GRANT_INVALID_ACTOR: "RECORD_GRANT_INVALID_ACTOR";
85
+ readonly RECORD_GRANT_UNSHAREABLE_OBJECT: "RECORD_GRANT_UNSHAREABLE_OBJECT";
55
86
  readonly DUPLICATE: "SCHEMA_DUPLICATE";
56
87
  readonly DUPLICATE_OBJECT: "SCHEMA_DUPLICATE_OBJECT";
57
88
  readonly DUPLICATE_ATTRIBUTE: "SCHEMA_DUPLICATE_ATTRIBUTE";
@@ -99,7 +130,6 @@ declare const SchemaErrorCode: {
99
130
  readonly AGENT_COMPACTION_TIMEOUT: "AGENT_COMPACTION_TIMEOUT";
100
131
  readonly AGENT_LEASE_HELD: "AGENT_LEASE_HELD";
101
132
  readonly AGENT_LEASE_UNAVAILABLE: "AGENT_LEASE_UNAVAILABLE";
102
- readonly AGENT_WORK_MODE_REQUIRED: "AGENT_WORK_MODE_REQUIRED";
103
133
  readonly AGENT_MESSAGE_NOT_FOUND: "AGENT_MESSAGE_NOT_FOUND";
104
134
  readonly AGENT_MESSAGE_NOT_EDITABLE: "AGENT_MESSAGE_NOT_EDITABLE";
105
135
  readonly INVALID_TOOL_INPUT: "INVALID_TOOL_INPUT";
@@ -115,6 +145,11 @@ declare const SchemaErrorCode: {
115
145
  readonly AGENT_CANCELLATION_WATCH_CAPACITY: "AGENT_CANCELLATION_WATCH_CAPACITY";
116
146
  readonly AGENT_CANCELLATION_CLEANUP: "AGENT_CANCELLATION_CLEANUP";
117
147
  readonly AGENT_TURN_FINALIZER_STALLED: "AGENT_TURN_FINALIZER_STALLED";
148
+ readonly WORKSTATION_NOT_READY: "WORKSTATION_NOT_READY";
149
+ readonly WORKSTATION_IN_USE: "WORKSTATION_IN_USE";
150
+ readonly WORKSTATION_NOT_CONNECTED: "WORKSTATION_NOT_CONNECTED";
151
+ readonly WORKSTATION_AUTH_FAILED: "WORKSTATION_AUTH_FAILED";
152
+ readonly WORKSTATION_RUN_FAILED: "WORKSTATION_RUN_FAILED";
118
153
  readonly DEVICE_NOT_FOUND: "DEVICE_NOT_FOUND";
119
154
  readonly DEVICE_OFFLINE: "DEVICE_OFFLINE";
120
155
  readonly DEVICE_CAPABILITY_MISMATCH: "DEVICE_CAPABILITY_MISMATCH";
@@ -131,6 +166,7 @@ declare const SchemaErrorCode: {
131
166
  readonly AI_IMAGE_GENERATION_INDETERMINATE: "AI_IMAGE_GENERATION_INDETERMINATE";
132
167
  readonly AI_IMAGE_RESERVATION_CLEANUP_INDETERMINATE: "AI_IMAGE_RESERVATION_CLEANUP_INDETERMINATE";
133
168
  readonly AI_IMAGE_PUBLICATION_FAILED: "AI_IMAGE_PUBLICATION_FAILED";
169
+ readonly FILE_PUBLIC_NOT_ATTACHABLE: "FILE_PUBLIC_NOT_ATTACHABLE";
134
170
  readonly DOCUMENT_MIME_NOT_ACCEPTED: "DOCUMENT_MIME_NOT_ACCEPTED";
135
171
  readonly DOCUMENT_MULTIPLE_NOT_ALLOWED: "DOCUMENT_MULTIPLE_NOT_ALLOWED";
136
172
  readonly DOCUMENT_NOT_FOUND_FOR_OPERATION: "DOCUMENT_NOT_FOUND_FOR_OPERATION";
@@ -150,18 +186,6 @@ declare const SchemaErrorCode: {
150
186
  readonly EMAIL_SENT_NOT_STORED: "EMAIL_SENT_NOT_STORED";
151
187
  readonly EMAIL_BATCH_ITEM_FAILED: "EMAIL_BATCH_ITEM_FAILED";
152
188
  readonly CALENDAR_PROVIDER_API_FAILED: "CALENDAR_PROVIDER_API_FAILED";
153
- readonly REFLEX_INVALID_TRANSITION: "REFLEX_INVALID_TRANSITION";
154
- readonly REFLEX_INVALID_TOKEN: "REFLEX_INVALID_TOKEN";
155
- readonly REFLEX_CAPABILITY_DENIED: "REFLEX_CAPABILITY_DENIED";
156
- readonly REFLEX_GATEWAY_UNAVAILABLE: "REFLEX_GATEWAY_UNAVAILABLE";
157
- readonly REFLEX_BUNDLE_FAILED: "REFLEX_BUNDLE_FAILED";
158
- readonly REFLEX_EGRESS_DENIED: "REFLEX_EGRESS_DENIED";
159
- readonly REFLEX_PROTOCOL_VIOLATION: "REFLEX_PROTOCOL_VIOLATION";
160
- readonly REFLEX_RUN_FAILED: "REFLEX_RUN_FAILED";
161
- readonly REFLEX_RUN_TIMEOUT: "REFLEX_RUN_TIMEOUT";
162
- readonly REFLEX_DEPENDENCY_DRIFT: "REFLEX_DEPENDENCY_DRIFT";
163
- readonly REFLEX_NOT_READY: "REFLEX_NOT_READY";
164
- readonly REFLEX_INVARIANT_VIOLATION: "REFLEX_INVARIANT_VIOLATION";
165
189
  /** The embeddings feature is enabled but no Gateway credential is configured. */
166
190
  readonly EMBEDDING_MODEL_UNAVAILABLE: "EMBEDDING_MODEL_UNAVAILABLE";
167
191
  /** The provider returned vectors whose length differs from the configured dimensions. */
@@ -210,14 +234,6 @@ declare class AttributeNotFoundError extends NotFoundError {
210
234
  declare class RecordNotFoundError extends NotFoundError {
211
235
  constructor(recordId: string);
212
236
  }
213
- /**
214
- * Schema plan not found error — raised when a `planId` sent by an approver
215
- * (who never receives the plan payload itself, only its id) does not match
216
- * any stored plan.
217
- */
218
- declare class SchemaPlanNotFoundError extends NotFoundError {
219
- constructor(planId: string);
220
- }
221
237
  /**
222
238
  * Validation error with field-level details
223
239
  */
@@ -247,7 +263,9 @@ declare class ValidationError extends SchemaError {
247
263
  * system attribute that disappeared alongside a new one of the same type
248
264
  * (rename or drop + add?), or a retype whose stored values the new type cannot
249
265
  * read. Refused at boot and at source push; resolved by a hand-written SQL
250
- * migration, or by shipping a real removal and addition in separate deploys.
266
+ * migration, by shipping a real removal and addition in separate deploys, or —
267
+ * on a source push, for a rename or a `text → phone` / `number → currency`
268
+ * retype — by the resolution the refusal names (#4362).
251
269
  * HTTP status: 400 Bad Request.
252
270
  *
253
271
  * The first detail's `path[0]` is the declared attribute name, so the boot
@@ -393,6 +411,16 @@ declare class ProtectedRoleError extends SchemaError {
393
411
  readonly operation: "delete" | "modify";
394
412
  constructor(roleName: string, operation: "delete" | "modify");
395
413
  }
414
+ /**
415
+ * Error thrown when a saved permission grant falls outside the permission
416
+ * catalog (spec B1): an unknown resource, a level the catalog never declared,
417
+ * a split capability, an unknown object, or a shape the schema rejects.
418
+ */
419
+ declare class InvalidPermissionGrantError extends SchemaError {
420
+ readonly issues: GrantIssue[];
421
+ readonly _tag = "InvalidPermissionGrantError";
422
+ constructor(issues: GrantIssue[]);
423
+ }
396
424
  /**
397
425
  * Role not found error
398
426
  */
@@ -587,4 +615,4 @@ declare function isAttributeInUseError(error: unknown): error is AttributeInUseE
587
615
  */
588
616
  declare function isObjectReferencedError(error: unknown): error is ObjectReferencedError;
589
617
  //#endregion
590
- export { SearchBackendError as A, ValidationErrorDetail as B, RepositoryError as C, SchemaError as D, RoleNotFoundError as E, SyncCascadeError as F, isRecordReferencedError as G, isNotFoundError as H, SyncConflictError as I, isSchemaError as K, SyncError as L, SearchBackendFailureKind as M, StorageError as N, SchemaErrorCode as O, StorageOperation as P, SystemEntityImmutableError as R, RecordReferencedError as S, ReservedObjectNameError as T, isObjectReferencedError as U, isAttributeInUseError as V, isProtectedResourceError as W, RealtimeDeliveryError as _, AttributeUsage as a, RecordNotFoundError as b, ForbiddenError as c, NotImplementedError as d, ObjectNotFoundError as f, ProtectedRoleError as g, ProtectedResourceError as h, AttributeNotFoundError as i, SearchBackendErrorOptions as j, SchemaPlanNotFoundError as k, MemoryNotFoundError as l, OrphanSystemAttributeError as m, AmbiguousSchemaChangeError as n, ConcurrentModificationError as o, ObjectReferencedError as p, isValidationError as q, AttributeInUseError as r, DuplicateError as s, AccessDeniedError as t, NotFoundError as u, RealtimeRateLimitedError as v, RepositoryOperation as w, RecordReference as x, RealtimeSubscriptionError as y, ValidationError as z };
618
+ export { SearchBackendError as A, ValidationErrorDetail as B, RecordReferencedError as C, RoleNotFoundError as D, ReservedObjectNameError as E, SyncCascadeError as F, isRecordReferencedError as G, isNotFoundError as H, SyncConflictError as I, GrantIssue as J, isSchemaError as K, SyncError as L, SearchBackendFailureKind as M, StorageError as N, SchemaError as O, StorageOperation as P, permissionGrantSchema as Q, SystemEntityImmutableError as R, RecordReference as S, RepositoryOperation as T, isObjectReferencedError as U, isAttributeInUseError as V, isProtectedResourceError as W, PermissionGrant as X, PERMISSION_ACTIONS as Y, findGrantIssues as Z, ProtectedRoleError as _, AttributeUsage as a, RealtimeSubscriptionError as b, ForbiddenError as c, NotFoundError as d, NotImplementedError as f, ProtectedResourceError as g, OrphanSystemAttributeError as h, AttributeNotFoundError as i, SearchBackendErrorOptions as j, SchemaErrorCode as k, InvalidPermissionGrantError as l, ObjectReferencedError as m, AmbiguousSchemaChangeError as n, ConcurrentModificationError as o, ObjectNotFoundError as p, isValidationError as q, AttributeInUseError as r, DuplicateError as s, AccessDeniedError as t, MemoryNotFoundError as u, RealtimeDeliveryError as v, RepositoryError as w, RecordNotFoundError as x, RealtimeRateLimitedError as y, ValidationError as z };
@@ -1,3 +1,3 @@
1
1
 
2
- import { A as SearchBackendError, B as ValidationErrorDetail, C as RepositoryError, D as SchemaError, E as RoleNotFoundError, F as SyncCascadeError, G as isRecordReferencedError, H as isNotFoundError, I as SyncConflictError, K as isSchemaError, L as SyncError, M as SearchBackendFailureKind, N as StorageError, O as SchemaErrorCode, P as StorageOperation, R as SystemEntityImmutableError, S as RecordReferencedError, T as ReservedObjectNameError, U as isObjectReferencedError, V as isAttributeInUseError, W as isProtectedResourceError, _ as RealtimeDeliveryError, a as AttributeUsage, b as RecordNotFoundError, c as ForbiddenError, d as NotImplementedError, f as ObjectNotFoundError, g as ProtectedRoleError, h as ProtectedResourceError, i as AttributeNotFoundError, j as SearchBackendErrorOptions, k as SchemaPlanNotFoundError, l as MemoryNotFoundError, m as OrphanSystemAttributeError, n as AmbiguousSchemaChangeError, o as ConcurrentModificationError, p as ObjectReferencedError, q as isValidationError, r as AttributeInUseError, s as DuplicateError, t as AccessDeniedError, u as NotFoundError, v as RealtimeRateLimitedError, w as RepositoryOperation, x as RecordReference, y as RealtimeSubscriptionError, z as ValidationError } from "./exceptions-DrrzAhuA.mjs";
3
- export { AccessDeniedError, AmbiguousSchemaChangeError, AttributeInUseError, AttributeNotFoundError, AttributeUsage, ConcurrentModificationError, DuplicateError, ForbiddenError, MemoryNotFoundError, NotFoundError, NotImplementedError, ObjectNotFoundError, ObjectReferencedError, OrphanSystemAttributeError, ProtectedResourceError, ProtectedRoleError, RealtimeDeliveryError, RealtimeRateLimitedError, RealtimeSubscriptionError, RecordNotFoundError, RecordReference, RecordReferencedError, RepositoryError, RepositoryOperation, ReservedObjectNameError, RoleNotFoundError, SchemaError, SchemaErrorCode, SchemaPlanNotFoundError, SearchBackendError, SearchBackendErrorOptions, SearchBackendFailureKind, StorageError, StorageOperation, SyncCascadeError, SyncConflictError, SyncError, SystemEntityImmutableError, ValidationError, ValidationErrorDetail, isAttributeInUseError, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isSchemaError, isValidationError };
2
+ import { A as SearchBackendError, B as ValidationErrorDetail, C as RecordReferencedError, D as RoleNotFoundError, E as ReservedObjectNameError, F as SyncCascadeError, G as isRecordReferencedError, H as isNotFoundError, I as SyncConflictError, K as isSchemaError, L as SyncError, M as SearchBackendFailureKind, N as StorageError, O as SchemaError, P as StorageOperation, R as SystemEntityImmutableError, S as RecordReference, T as RepositoryOperation, U as isObjectReferencedError, V as isAttributeInUseError, W as isProtectedResourceError, _ as ProtectedRoleError, a as AttributeUsage, b as RealtimeSubscriptionError, c as ForbiddenError, d as NotFoundError, f as NotImplementedError, g as ProtectedResourceError, h as OrphanSystemAttributeError, i as AttributeNotFoundError, j as SearchBackendErrorOptions, k as SchemaErrorCode, l as InvalidPermissionGrantError, m as ObjectReferencedError, n as AmbiguousSchemaChangeError, o as ConcurrentModificationError, p as ObjectNotFoundError, q as isValidationError, r as AttributeInUseError, s as DuplicateError, t as AccessDeniedError, u as MemoryNotFoundError, v as RealtimeDeliveryError, w as RepositoryError, x as RecordNotFoundError, y as RealtimeRateLimitedError, z as ValidationError } from "./exceptions-704MxF-j.mjs";
3
+ export { AccessDeniedError, AmbiguousSchemaChangeError, AttributeInUseError, AttributeNotFoundError, AttributeUsage, ConcurrentModificationError, DuplicateError, ForbiddenError, InvalidPermissionGrantError, MemoryNotFoundError, NotFoundError, NotImplementedError, ObjectNotFoundError, ObjectReferencedError, OrphanSystemAttributeError, ProtectedResourceError, ProtectedRoleError, RealtimeDeliveryError, RealtimeRateLimitedError, RealtimeSubscriptionError, RecordNotFoundError, RecordReference, RecordReferencedError, RepositoryError, RepositoryOperation, ReservedObjectNameError, RoleNotFoundError, SchemaError, SchemaErrorCode, SearchBackendError, SearchBackendErrorOptions, SearchBackendFailureKind, StorageError, StorageOperation, SyncCascadeError, SyncConflictError, SyncError, SystemEntityImmutableError, ValidationError, ValidationErrorDetail, isAttributeInUseError, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isSchemaError, isValidationError };
@@ -1,3 +1,3 @@
1
1
 
2
- import { A as SearchBackendError, B as ValidationErrorDetail, C as RepositoryError, D as SchemaError, E as RoleNotFoundError, F as SyncCascadeError, G as isRecordReferencedError, H as isNotFoundError, I as SyncConflictError, K as isSchemaError, L as SyncError, M as SearchBackendFailureKind, N as StorageError, O as SchemaErrorCode, P as StorageOperation, R as SystemEntityImmutableError, S as RecordReferencedError, T as ReservedObjectNameError, U as isObjectReferencedError, V as isAttributeInUseError, W as isProtectedResourceError, _ as RealtimeDeliveryError, a as AttributeUsage, b as RecordNotFoundError, c as ForbiddenError, d as NotImplementedError, f as ObjectNotFoundError, g as ProtectedRoleError, h as ProtectedResourceError, i as AttributeNotFoundError, j as SearchBackendErrorOptions, k as SchemaPlanNotFoundError, l as MemoryNotFoundError, m as OrphanSystemAttributeError, n as AmbiguousSchemaChangeError, o as ConcurrentModificationError, p as ObjectReferencedError, q as isValidationError, r as AttributeInUseError, s as DuplicateError, t as AccessDeniedError, u as NotFoundError, v as RealtimeRateLimitedError, w as RepositoryOperation, x as RecordReference, y as RealtimeSubscriptionError, z as ValidationError } from "./exceptions-DrrzAhuA.js";
3
- export { AccessDeniedError, AmbiguousSchemaChangeError, AttributeInUseError, AttributeNotFoundError, AttributeUsage, ConcurrentModificationError, DuplicateError, ForbiddenError, MemoryNotFoundError, NotFoundError, NotImplementedError, ObjectNotFoundError, ObjectReferencedError, OrphanSystemAttributeError, ProtectedResourceError, ProtectedRoleError, RealtimeDeliveryError, RealtimeRateLimitedError, RealtimeSubscriptionError, RecordNotFoundError, RecordReference, RecordReferencedError, RepositoryError, RepositoryOperation, ReservedObjectNameError, RoleNotFoundError, SchemaError, SchemaErrorCode, SchemaPlanNotFoundError, SearchBackendError, SearchBackendErrorOptions, SearchBackendFailureKind, StorageError, StorageOperation, SyncCascadeError, SyncConflictError, SyncError, SystemEntityImmutableError, ValidationError, ValidationErrorDetail, isAttributeInUseError, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isSchemaError, isValidationError };
2
+ import { A as SearchBackendError, B as ValidationErrorDetail, C as RecordReferencedError, D as RoleNotFoundError, E as ReservedObjectNameError, F as SyncCascadeError, G as isRecordReferencedError, H as isNotFoundError, I as SyncConflictError, K as isSchemaError, L as SyncError, M as SearchBackendFailureKind, N as StorageError, O as SchemaError, P as StorageOperation, R as SystemEntityImmutableError, S as RecordReference, T as RepositoryOperation, U as isObjectReferencedError, V as isAttributeInUseError, W as isProtectedResourceError, _ as ProtectedRoleError, a as AttributeUsage, b as RealtimeSubscriptionError, c as ForbiddenError, d as NotFoundError, f as NotImplementedError, g as ProtectedResourceError, h as OrphanSystemAttributeError, i as AttributeNotFoundError, j as SearchBackendErrorOptions, k as SchemaErrorCode, l as InvalidPermissionGrantError, m as ObjectReferencedError, n as AmbiguousSchemaChangeError, o as ConcurrentModificationError, p as ObjectNotFoundError, q as isValidationError, r as AttributeInUseError, s as DuplicateError, t as AccessDeniedError, u as MemoryNotFoundError, v as RealtimeDeliveryError, w as RepositoryError, x as RecordNotFoundError, y as RealtimeRateLimitedError, z as ValidationError } from "./exceptions-704MxF-j.js";
3
+ export { AccessDeniedError, AmbiguousSchemaChangeError, AttributeInUseError, AttributeNotFoundError, AttributeUsage, ConcurrentModificationError, DuplicateError, ForbiddenError, InvalidPermissionGrantError, MemoryNotFoundError, NotFoundError, NotImplementedError, ObjectNotFoundError, ObjectReferencedError, OrphanSystemAttributeError, ProtectedResourceError, ProtectedRoleError, RealtimeDeliveryError, RealtimeRateLimitedError, RealtimeSubscriptionError, RecordNotFoundError, RecordReference, RecordReferencedError, RepositoryError, RepositoryOperation, ReservedObjectNameError, RoleNotFoundError, SchemaError, SchemaErrorCode, SearchBackendError, SearchBackendErrorOptions, SearchBackendFailureKind, StorageError, StorageOperation, SyncCascadeError, SyncConflictError, SyncError, SystemEntityImmutableError, ValidationError, ValidationErrorDetail, isAttributeInUseError, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isSchemaError, isValidationError };
@@ -1,2 +1,2 @@
1
1
  /*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e={DRAFT_REVISION_CONFLICT:`DRAFT_REVISION_CONFLICT`,UNKNOWN:`SCHEMA_UNKNOWN_ERROR`,OBJECT_NOT_FOUND:`SCHEMA_OBJECT_NOT_FOUND`,ATTRIBUTE_NOT_FOUND:`SCHEMA_ATTRIBUTE_NOT_FOUND`,RECORD_NOT_FOUND:`SCHEMA_RECORD_NOT_FOUND`,SOURCE_NOT_FOUND:`SCHEMA_SOURCE_NOT_FOUND`,ROLE_NOT_FOUND:`SCHEMA_ROLE_NOT_FOUND`,MEMORY_NOT_FOUND:`SCHEMA_MEMORY_NOT_FOUND`,SCHEMA_PLAN_NOT_FOUND:`SCHEMA_PLAN_NOT_FOUND`,VALIDATION_FAILED:`SCHEMA_VALIDATION_FAILED`,INVALID_ATTRIBUTE_NAME:`SCHEMA_INVALID_ATTRIBUTE_NAME`,INVALID_OBJECT_NAME:`SCHEMA_INVALID_OBJECT_NAME`,RESERVED_OBJECT_NAME:`SCHEMA_RESERVED_OBJECT_NAME`,PROTECTED_OBJECT:`SCHEMA_PROTECTED_OBJECT`,PROTECTED_ATTRIBUTE:`SCHEMA_PROTECTED_ATTRIBUTE`,PROTECTED_VIEW:`SCHEMA_PROTECTED_VIEW`,PROTECTED_ROLE:`SCHEMA_PROTECTED_ROLE`,FORBIDDEN:`SCHEMA_FORBIDDEN`,ACCESS_DENIED:`SCHEMA_ACCESS_DENIED`,WORKSPACE_INVARIANT:`SCHEMA_WORKSPACE_INVARIANT`,STATE_GATE:`SCHEMA_STATE_GATE`,ACTOR_CONTEXT_REQUIRED:`SCHEMA_ACTOR_CONTEXT_REQUIRED`,CONNECTOR_AUTH_FAILED:`SCHEMA_CONNECTOR_AUTH_FAILED`,CONNECTOR_INVALID_STATE:`SCHEMA_CONNECTOR_INVALID_STATE`,CONNECTOR_GRANT_ORPHANED:`SCHEMA_CONNECTOR_GRANT_ORPHANED`,SYNC_FAILED:`SCHEMA_SYNC_FAILED`,SYNC_CONFLICT:`SCHEMA_SYNC_CONFLICT`,SYNC_CASCADE:`SCHEMA_SYNC_CASCADE`,ORPHAN_SYSTEM_ATTRIBUTE:`SCHEMA_ORPHAN_SYSTEM_ATTRIBUTE`,SYSTEM_ENTITY_IMMUTABLE:`SCHEMA_SYSTEM_ENTITY_IMMUTABLE`,AMBIGUOUS_CHANGE:`SCHEMA_AMBIGUOUS_CHANGE`,DUPLICATE:`SCHEMA_DUPLICATE`,DUPLICATE_OBJECT:`SCHEMA_DUPLICATE_OBJECT`,DUPLICATE_ATTRIBUTE:`SCHEMA_DUPLICATE_ATTRIBUTE`,CONFLICT:`SCHEMA_CONFLICT`,STORAGE_UPLOAD_FAILED:`SCHEMA_STORAGE_UPLOAD_FAILED`,STORAGE_DOWNLOAD_FAILED:`SCHEMA_STORAGE_DOWNLOAD_FAILED`,STORAGE_DELETE_FAILED:`SCHEMA_STORAGE_DELETE_FAILED`,STORAGE_URL_FAILED:`SCHEMA_STORAGE_URL_FAILED`,REPOSITORY_CREATE_FAILED:`SCHEMA_REPOSITORY_CREATE_FAILED`,REPOSITORY_UPDATE_FAILED:`SCHEMA_REPOSITORY_UPDATE_FAILED`,REPOSITORY_DELETE_FAILED:`SCHEMA_REPOSITORY_DELETE_FAILED`,REPOSITORY_QUERY_FAILED:`SCHEMA_REPOSITORY_QUERY_FAILED`,NOT_IMPLEMENTED:`SCHEMA_NOT_IMPLEMENTED`,TIMEOUT:`SCHEMA_TIMEOUT`,RECORD_REFERENCED:`SCHEMA_RECORD_REFERENCED`,ATTRIBUTE_IN_USE:`SCHEMA_ATTRIBUTE_IN_USE`,OBJECT_REFERENCED:`SCHEMA_OBJECT_REFERENCED`,CONFIGURATION_REQUIRED:`CONFIGURATION_REQUIRED`,SEARCH_ADAPTER_REQUIRED:`SEARCH_ADAPTER_REQUIRED`,SEARCH_BACKEND_FAILED:`SEARCH_BACKEND_FAILED`,SEARCH_BACKEND_REJECTED:`SEARCH_BACKEND_REJECTED`,INVARIANT_VIOLATION:`INVARIANT_VIOLATION`,TENANT_CONTEXT_MISSING:`TENANT_CONTEXT_MISSING`,JOB_RUN_METADATA_MISMATCH:`JOB_RUN_METADATA_MISMATCH`,JOB_COALESCED_FAILURE_HANDLED:`JOB_COALESCED_FAILURE_HANDLED`,FEATURE_FLAGS_CONTEXT:`FEATURE_FLAGS_CONTEXT`,REALTIME_RATE_LIMITED:`REALTIME_RATE_LIMITED`,REALTIME_DELIVERY_FAILED:`REALTIME_DELIVERY_FAILED`,REALTIME_SUBSCRIPTION_FAILED:`REALTIME_SUBSCRIPTION_FAILED`,AGENT_UNKNOWN:`AGENT_UNKNOWN`,AGENT_DEPTH_EXCEEDED:`AGENT_DEPTH_EXCEEDED`,AGENT_COST_LIMIT_EXCEEDED:`AGENT_COST_LIMIT_EXCEEDED`,AGENT_TREE_COST_LIMIT_EXCEEDED:`AGENT_TREE_COST_LIMIT_EXCEEDED`,CREDITS_EXHAUSTED:`CREDITS_EXHAUSTED`,QUOTA_EXCEEDED:`QUOTA_EXCEEDED`,AGENT_SESSION_NOT_FOUND:`AGENT_SESSION_NOT_FOUND`,AGENT_DEFINITION_NOT_FOUND:`AGENT_DEFINITION_NOT_FOUND`,AGENT_RUN_CONFIG:`AGENT_RUN_CONFIG`,AGENT_STREAMING:`AGENT_STREAMING`,AGENT_MISSING_ACTOR:`AGENT_MISSING_ACTOR`,AGENT_INVALID_STATE:`AGENT_INVALID_STATE`,AGENT_COMPACTION_IMPOSSIBLE:`AGENT_COMPACTION_IMPOSSIBLE`,AGENT_COMPACTION_TIMEOUT:`AGENT_COMPACTION_TIMEOUT`,AGENT_LEASE_HELD:`AGENT_LEASE_HELD`,AGENT_LEASE_UNAVAILABLE:`AGENT_LEASE_UNAVAILABLE`,AGENT_WORK_MODE_REQUIRED:`AGENT_WORK_MODE_REQUIRED`,AGENT_MESSAGE_NOT_FOUND:`AGENT_MESSAGE_NOT_FOUND`,AGENT_MESSAGE_NOT_EDITABLE:`AGENT_MESSAGE_NOT_EDITABLE`,INVALID_TOOL_INPUT:`INVALID_TOOL_INPUT`,EDIT_MATCH_NOT_FOUND:`EDIT_MATCH_NOT_FOUND`,EDIT_MATCH_AMBIGUOUS:`EDIT_MATCH_AMBIGUOUS`,EDIT_NO_CHANGE:`EDIT_NO_CHANGE`,EDIT_TARGET_UNAVAILABLE:`EDIT_TARGET_UNAVAILABLE`,EDIT_TARGET_UNSUPPORTED:`EDIT_TARGET_UNSUPPORTED`,AGENT_EXECUTION_CANCELLED:`AGENT_EXECUTION_CANCELLED`,AGENT_EXECUTION_TIMEOUT:`AGENT_EXECUTION_TIMEOUT`,AGENT_EXTERNAL_OUTCOME_UNKNOWN:`AGENT_EXTERNAL_OUTCOME_UNKNOWN`,AGENT_TOOL_CANCELLATION_POLICY:`AGENT_TOOL_CANCELLATION_POLICY`,AGENT_CANCELLATION_WATCH_CAPACITY:`AGENT_CANCELLATION_WATCH_CAPACITY`,AGENT_CANCELLATION_CLEANUP:`AGENT_CANCELLATION_CLEANUP`,AGENT_TURN_FINALIZER_STALLED:`AGENT_TURN_FINALIZER_STALLED`,DEVICE_NOT_FOUND:`DEVICE_NOT_FOUND`,DEVICE_OFFLINE:`DEVICE_OFFLINE`,DEVICE_CAPABILITY_MISMATCH:`DEVICE_CAPABILITY_MISMATCH`,DEVICE_CHANNEL_PROTOCOL:`DEVICE_CHANNEL_PROTOCOL`,AI_UNKNOWN:`AI_UNKNOWN`,AI_USAGE_LIMIT_EXCEEDED:`AI_USAGE_LIMIT_EXCEEDED`,AI_INVALID_USAGE:`AI_INVALID_USAGE`,AI_INVALID_MODEL:`AI_INVALID_MODEL`,AI_INVALID_MODEL_INPUT:`AI_INVALID_MODEL_INPUT`,AI_REPOSITORY_ERROR:`AI_REPOSITORY_ERROR`,AI_GENERATION_FAILED:`AI_GENERATION_FAILED`,AI_DECISION_FAILED:`AI_DECISION_FAILED`,AI_IMAGE_USAGE_PENDING:`AI_IMAGE_USAGE_PENDING`,AI_IMAGE_GENERATION_INDETERMINATE:`AI_IMAGE_GENERATION_INDETERMINATE`,AI_IMAGE_RESERVATION_CLEANUP_INDETERMINATE:`AI_IMAGE_RESERVATION_CLEANUP_INDETERMINATE`,AI_IMAGE_PUBLICATION_FAILED:`AI_IMAGE_PUBLICATION_FAILED`,DOCUMENT_MIME_NOT_ACCEPTED:`DOCUMENT_MIME_NOT_ACCEPTED`,DOCUMENT_MULTIPLE_NOT_ALLOWED:`DOCUMENT_MULTIPLE_NOT_ALLOWED`,DOCUMENT_NOT_FOUND_FOR_OPERATION:`DOCUMENT_NOT_FOUND_FOR_OPERATION`,DOCUMENT_STORAGE_FAILED:`DOCUMENT_STORAGE_FAILED`,DOCUMENT_SIZE_EXCEEDED:`DOCUMENT_SIZE_EXCEEDED`,DOCUMENT_OCR_FAILED:`DOCUMENT_OCR_FAILED`,DOCUMENT_BLOB_EMPTY:`DOCUMENT_BLOB_EMPTY`,DOCUMENT_FILE_TOO_LARGE:`DOCUMENT_FILE_TOO_LARGE`,DOCUMENT_FILE_NOT_FOUND:`DOCUMENT_FILE_NOT_FOUND`,DOCUMENT_FILE_ALREADY_PACKED:`DOCUMENT_FILE_ALREADY_PACKED`,DOCUMENT_RECORD_NOT_FOUND:`DOCUMENT_RECORD_NOT_FOUND`,DOCUMENT_RECORD_OBJECT_MISMATCH:`DOCUMENT_RECORD_OBJECT_MISMATCH`,DOCUMENT_FOLDER_SERVICE_UNAVAILABLE:`DOCUMENT_FOLDER_SERVICE_UNAVAILABLE`,DOCUMENT_FOLDER_PATH_NOT_FOUND:`DOCUMENT_FOLDER_PATH_NOT_FOUND`,EMAIL_PROVIDER_API_FAILED:`EMAIL_PROVIDER_API_FAILED`,EMAIL_SEND_FAILED:`EMAIL_SEND_FAILED`,EMAIL_SENT_NOT_STORED:`EMAIL_SENT_NOT_STORED`,EMAIL_BATCH_ITEM_FAILED:`EMAIL_BATCH_ITEM_FAILED`,CALENDAR_PROVIDER_API_FAILED:`CALENDAR_PROVIDER_API_FAILED`,REFLEX_INVALID_TRANSITION:`REFLEX_INVALID_TRANSITION`,REFLEX_INVALID_TOKEN:`REFLEX_INVALID_TOKEN`,REFLEX_CAPABILITY_DENIED:`REFLEX_CAPABILITY_DENIED`,REFLEX_GATEWAY_UNAVAILABLE:`REFLEX_GATEWAY_UNAVAILABLE`,REFLEX_BUNDLE_FAILED:`REFLEX_BUNDLE_FAILED`,REFLEX_EGRESS_DENIED:`REFLEX_EGRESS_DENIED`,REFLEX_PROTOCOL_VIOLATION:`REFLEX_PROTOCOL_VIOLATION`,REFLEX_RUN_FAILED:`REFLEX_RUN_FAILED`,REFLEX_RUN_TIMEOUT:`REFLEX_RUN_TIMEOUT`,REFLEX_DEPENDENCY_DRIFT:`REFLEX_DEPENDENCY_DRIFT`,REFLEX_NOT_READY:`REFLEX_NOT_READY`,REFLEX_INVARIANT_VIOLATION:`REFLEX_INVARIANT_VIOLATION`,EMBEDDING_MODEL_UNAVAILABLE:`EMBEDDING_MODEL_UNAVAILABLE`,EMBEDDING_DIMENSION_MISMATCH:`EMBEDDING_DIMENSION_MISMATCH`};var SchemaError=class extends Error{constructor(t,n=e.UNKNOWN,r){super(t),this.name=`SchemaError`,this.code=n,this.details=r,Object.setPrototypeOf(this,new.target.prototype)}toJSON(){return{name:this.name,code:this.code,message:this.message,details:this.details}}},NotFoundError=class extends SchemaError{constructor(t,n,r=e.RECORD_NOT_FOUND,i=`${t} with id "${n}" not found`){super(i,r,{resourceType:t,resourceId:n}),this._tag=`NotFoundError`,this.name=`NotFoundError`,this.resourceType=t,this.resourceId=n}},ObjectNotFoundError=class extends NotFoundError{constructor(t){super(`Object`,t,e.OBJECT_NOT_FOUND),this.name=`ObjectNotFoundError`}},AttributeNotFoundError=class extends NotFoundError{constructor(t){super(`Attribute`,t,e.ATTRIBUTE_NOT_FOUND),this.name=`AttributeNotFoundError`}},RecordNotFoundError=class extends NotFoundError{constructor(t){super(`Record`,t,e.RECORD_NOT_FOUND),this.name=`RecordNotFoundError`}},SchemaPlanNotFoundError=class extends NotFoundError{constructor(t){super(`Schema plan`,t,e.SCHEMA_PLAN_NOT_FOUND),this.name=`SchemaPlanNotFoundError`}},t=class ValidationError extends SchemaError{constructor(t,n){super(t,e.VALIDATION_FAILED,{errors:n}),this._tag=`ValidationError`,this.name=`ValidationError`,this.errors=n}static fromZodErrors(e){let t=e.map(e=>({path:e.path.map(String),message:e.message})),n=`Validation failed: ${t.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `)}`;return new ValidationError(n,t)}},AmbiguousSchemaChangeError=class extends t{constructor(t,n){super(t,n),this.code=e.AMBIGUOUS_CHANGE,this.name=`AmbiguousSchemaChangeError`}},ProtectedResourceError=class extends SchemaError{constructor(t,n,r){let i=t===`object`?e.PROTECTED_OBJECT:t===`view`?e.PROTECTED_VIEW:e.PROTECTED_ATTRIBUTE;super(`Cannot ${r} system ${t} "${n}"`,i,{resourceType:t,resourceName:n,operation:r}),this.name=`ProtectedResourceError`,this.resourceType=t,this.resourceName=n,this.operation=r}},SyncError=class extends SchemaError{constructor(t,n,r){super(`Failed to sync object "${t}": ${n}`,e.SYNC_FAILED,{objectName:t,cause:r?.message}),this.name=`SyncError`,this.objectName=t,this.cause=r}},SystemEntityImmutableError=class extends SchemaError{constructor(t,n){super(`Cannot mutate system ${t} "${n}". System entities are declared in code and immutable at runtime.`,e.SYSTEM_ENTITY_IMMUTABLE,{entityType:t,entityName:n}),this.name=`SystemEntityImmutableError`,this.entityType=t,this.entityName=n}},SyncConflictError=class extends SchemaError{constructor(t){let n=t.attributeName?`"${t.objectName}.${t.attributeName}"`:`"${t.objectName}"`;super(`Cannot promote runtime entity ${n}: ${t.reason}. Resolve via: (1) relax the code constraint, (2) migrate runtime values manually, or (3) rename the code declaration.`,e.SYNC_CONFLICT,{objectName:t.objectName,attributeName:t.attributeName,reason:t.reason}),this.name=`SyncConflictError`,this.objectName=t.objectName,this.attributeName=t.attributeName,this.reason=t.reason}},SyncCascadeError=class extends SchemaError{constructor(t,n){super(`Cannot demote object "${t}": attributes ${n.join(`, `)} are still declared in code. Remove them from code first, or restore the object.`,e.SYNC_CASCADE,{objectName:t,conflictingAttributes:n}),this.name=`SyncCascadeError`,this.objectName=t,this.conflictingAttributes=n}},OrphanSystemAttributeError=class extends SchemaError{constructor(t,n){super(`Attribute "${t}.${n}" is system:true but its object parent is system:false. This is an invariant violation.`,e.ORPHAN_SYSTEM_ATTRIBUTE,{objectName:t,attributeName:n}),this.name=`OrphanSystemAttributeError`,this.objectName=t,this.attributeName=n}},DuplicateError=class extends SchemaError{constructor(t,n,r){let i=t===`object`?e.DUPLICATE_OBJECT:t===`attribute`?e.DUPLICATE_ATTRIBUTE:e.DUPLICATE,a=`${t.charAt(0).toUpperCase()}${t.slice(1)} "${n}" already exists`;super(r??a,i,{resourceType:t,resourceName:n}),this.name=`DuplicateError`,this.resourceType=t,this.resourceName=n}};const n={builder:`cannot be built by a consumer`,registry:`cannot be registered by a consumer`,bundle:`cannot be claimed by a bundle`,source:`cannot be declared by a schema source`};var ReservedObjectNameError=class extends SchemaError{constructor(t,r){super(`"${t}" is a framework-native object name and ${n[r]}: the framework ships it, pick another name.`,e.RESERVED_OBJECT_NAME,{objectName:t,context:r}),this.name=`ReservedObjectNameError`,this.objectName=t}};function isSchemaError(e){return e instanceof SchemaError}function isNotFoundError(e){return e instanceof NotFoundError}function isValidationError(e){return e instanceof t}function isProtectedResourceError(e){return e instanceof ProtectedResourceError}var ForbiddenError=class extends SchemaError{constructor(t,n,r){super(`No ${n} permission on object "${t}"`,e.FORBIDDEN,{objectName:t,action:n,userId:r}),this._tag=`ForbiddenError`,this.name=`ForbiddenError`,this.objectName=t,this.action=n,this.userId=r}},ProtectedRoleError=class extends SchemaError{constructor(t,n){super(`Cannot ${n} system role "${t}"`,e.PROTECTED_ROLE,{roleName:t,operation:n}),this.name=`ProtectedRoleError`,this.roleName=t,this.operation=n}},RoleNotFoundError=class extends NotFoundError{constructor(t){super(`Role`,t,e.ROLE_NOT_FOUND),this.name=`RoleNotFoundError`}},ConcurrentModificationError=class extends SchemaError{constructor(t){super(`Record ${t} was modified by another request. Please refresh and try again.`,e.CONFLICT,{recordId:t})}},StorageError=class extends SchemaError{constructor(t,n,r,i){let a=t===`upload`?e.STORAGE_UPLOAD_FAILED:t===`download`?e.STORAGE_DOWNLOAD_FAILED:t===`delete`?e.STORAGE_DELETE_FAILED:e.STORAGE_URL_FAILED;super(`Storage ${t} failed: ${n}`,a,{operation:t,path:r,cause:i}),this.name=`StorageError`,this.operation=t,this.path=r,this.cause=i}},AccessDeniedError=class extends SchemaError{constructor(t,n){super(n??`Access denied to resource: ${t}`,e.ACCESS_DENIED,{resource:t,reason:n}),this.name=`AccessDeniedError`,this.resource=t,this.reason=n}},RepositoryError=class extends SchemaError{constructor(t,n,r,i){let a=t===`create`?e.REPOSITORY_CREATE_FAILED:t===`update`?e.REPOSITORY_UPDATE_FAILED:t===`delete`?e.REPOSITORY_DELETE_FAILED:e.REPOSITORY_QUERY_FAILED;super(`Failed to ${t} ${n}: ${r}${i?` (${i})`:``}`,a,{operation:t,entity:n,cause:i}),this.name=`RepositoryError`,this.operation=t,this.entity=n,this.cause=i}};function searchBackendMessage(e,t,n,r){return t===`unavailable`?`Search backend unavailable for ${e}`:`${t===`capacity`?`Search backend out of capacity for ${e}`:`Search backend rejected ${e}`}${n?`: ${n}`:``}${r?` — ${r}`:``}`}var SearchBackendError=class extends SchemaError{constructor(t,n,r={}){let i=r.kind??`unavailable`;super(searchBackendMessage(t,i,r.backendCode,r.detail),i===`unavailable`?e.SEARCH_BACKEND_FAILED:e.SEARCH_BACKEND_REJECTED,{scope:t,cause:n,kind:i,...r.backendCode?{backendCode:r.backendCode}:{}}),this.name=`SearchBackendError`,this.scope=t,this.cause=n,this.kind=i,this.backendCode=r.backendCode}},NotImplementedError=class extends SchemaError{constructor(t,n){let r=n?`${t}: not implemented (${n})`:`${t}: not implemented`;super(r,e.NOT_IMPLEMENTED,{feature:t,milestone:n}),this.name=`NotImplementedError`,this.feature=t,this.milestone=n}},MemoryNotFoundError=class extends NotFoundError{constructor(t){super(`Memory`,t,e.MEMORY_NOT_FOUND),this.name=`MemoryNotFoundError`}},RecordReferencedError=class extends SchemaError{constructor(t,n){let r=n.reduce((e,t)=>e+t.count,0);super(`Cannot delete record: referenced by ${r} record${r>1?`s`:``}`,e.RECORD_REFERENCED,{recordId:t,references:n}),this.name=`RecordReferencedError`,this.recordId=t,this.references=n}},AttributeInUseError=class extends SchemaError{constructor(t,n,r){super(`Cannot delete attribute "${t}": used in ${n}${r===void 0?``:` ${r}`}`,e.ATTRIBUTE_IN_USE,{attributeName:t,usage:n,...r===void 0?{}:{location:r}}),this.name=`AttributeInUseError`,this.attributeName=t,this.usage=n,this.location=r}},ObjectReferencedError=class extends SchemaError{constructor(t,n){super(`Cannot delete object "${t}": target of relations in ${n.join(`, `)}`,e.OBJECT_REFERENCED,{objectName:t,referencingObjects:n}),this.name=`ObjectReferencedError`,this.objectName=t,this.referencingObjects=n}},RealtimeRateLimitedError=class extends SchemaError{constructor(){super(`Supabase Realtime delivery was rate limited`,e.REALTIME_RATE_LIMITED),this.name=`RealtimeRateLimitedError`}},RealtimeDeliveryError=class extends SchemaError{constructor(){super(`Supabase Realtime delivery failed`,e.REALTIME_DELIVERY_FAILED),this.name=`RealtimeDeliveryError`}},RealtimeSubscriptionError=class extends SchemaError{constructor(){super(`Supabase Realtime subscription failed`,e.REALTIME_SUBSCRIPTION_FAILED),this.name=`RealtimeSubscriptionError`}};function isRecordReferencedError(e){return e instanceof RecordReferencedError}function isAttributeInUseError(e){return e instanceof AttributeInUseError}function isObjectReferencedError(e){return e instanceof ObjectReferencedError}exports.AccessDeniedError=AccessDeniedError,exports.AmbiguousSchemaChangeError=AmbiguousSchemaChangeError,exports.AttributeInUseError=AttributeInUseError,exports.AttributeNotFoundError=AttributeNotFoundError,exports.ConcurrentModificationError=ConcurrentModificationError,exports.DuplicateError=DuplicateError,exports.ForbiddenError=ForbiddenError,exports.MemoryNotFoundError=MemoryNotFoundError,exports.NotFoundError=NotFoundError,exports.NotImplementedError=NotImplementedError,exports.ObjectNotFoundError=ObjectNotFoundError,exports.ObjectReferencedError=ObjectReferencedError,exports.OrphanSystemAttributeError=OrphanSystemAttributeError,exports.ProtectedResourceError=ProtectedResourceError,exports.ProtectedRoleError=ProtectedRoleError,exports.RealtimeDeliveryError=RealtimeDeliveryError,exports.RealtimeRateLimitedError=RealtimeRateLimitedError,exports.RealtimeSubscriptionError=RealtimeSubscriptionError,exports.RecordNotFoundError=RecordNotFoundError,exports.RecordReferencedError=RecordReferencedError,exports.RepositoryError=RepositoryError,exports.ReservedObjectNameError=ReservedObjectNameError,exports.RoleNotFoundError=RoleNotFoundError,exports.SchemaError=SchemaError,exports.SchemaErrorCode=e,exports.SchemaPlanNotFoundError=SchemaPlanNotFoundError,exports.SearchBackendError=SearchBackendError,exports.StorageError=StorageError,exports.SyncCascadeError=SyncCascadeError,exports.SyncConflictError=SyncConflictError,exports.SyncError=SyncError,exports.SystemEntityImmutableError=SystemEntityImmutableError,exports.ValidationError=t,exports.isAttributeInUseError=isAttributeInUseError,exports.isNotFoundError=isNotFoundError,exports.isObjectReferencedError=isObjectReferencedError,exports.isProtectedResourceError=isProtectedResourceError,exports.isRecordReferencedError=isRecordReferencedError,exports.isSchemaError=isSchemaError,exports.isValidationError=isValidationError;
2
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e={DRAFT_REVISION_CONFLICT:`DRAFT_REVISION_CONFLICT`,UNKNOWN:`SCHEMA_UNKNOWN_ERROR`,OBJECT_NOT_FOUND:`SCHEMA_OBJECT_NOT_FOUND`,ATTRIBUTE_NOT_FOUND:`SCHEMA_ATTRIBUTE_NOT_FOUND`,RECORD_NOT_FOUND:`SCHEMA_RECORD_NOT_FOUND`,SOURCE_NOT_FOUND:`SCHEMA_SOURCE_NOT_FOUND`,ROLE_NOT_FOUND:`SCHEMA_ROLE_NOT_FOUND`,MEMORY_NOT_FOUND:`SCHEMA_MEMORY_NOT_FOUND`,VALIDATION_FAILED:`SCHEMA_VALIDATION_FAILED`,INVALID_ATTRIBUTE_NAME:`SCHEMA_INVALID_ATTRIBUTE_NAME`,INVALID_OBJECT_NAME:`SCHEMA_INVALID_OBJECT_NAME`,RESERVED_OBJECT_NAME:`SCHEMA_RESERVED_OBJECT_NAME`,PROTECTED_OBJECT:`SCHEMA_PROTECTED_OBJECT`,PROTECTED_ATTRIBUTE:`SCHEMA_PROTECTED_ATTRIBUTE`,PROTECTED_VIEW:`SCHEMA_PROTECTED_VIEW`,PROTECTED_ROLE:`SCHEMA_PROTECTED_ROLE`,PERMISSION_INVALID_GRANT:`SCHEMA_PERMISSION_INVALID_GRANT`,FORBIDDEN:`SCHEMA_FORBIDDEN`,ACCESS_DENIED:`SCHEMA_ACCESS_DENIED`,WORKSPACE_INVARIANT:`SCHEMA_WORKSPACE_INVARIANT`,STATE_GATE:`SCHEMA_STATE_GATE`,ACTOR_CONTEXT_REQUIRED:`SCHEMA_ACTOR_CONTEXT_REQUIRED`,CONNECTOR_AUTH_FAILED:`SCHEMA_CONNECTOR_AUTH_FAILED`,CONNECTOR_INVALID_STATE:`SCHEMA_CONNECTOR_INVALID_STATE`,CONNECTOR_GRANT_ORPHANED:`SCHEMA_CONNECTOR_GRANT_ORPHANED`,SYNC_FAILED:`SCHEMA_SYNC_FAILED`,SYNC_CONFLICT:`SCHEMA_SYNC_CONFLICT`,SYNC_CASCADE:`SCHEMA_SYNC_CASCADE`,ORPHAN_SYSTEM_ATTRIBUTE:`SCHEMA_ORPHAN_SYSTEM_ATTRIBUTE`,SYSTEM_ENTITY_IMMUTABLE:`SCHEMA_SYSTEM_ENTITY_IMMUTABLE`,AMBIGUOUS_CHANGE:`SCHEMA_AMBIGUOUS_CHANGE`,RECORD_GRANT_ON_WORKSPACE:`RECORD_GRANT_ON_WORKSPACE`,RECORD_GRANT_INVALID_ACTOR:`RECORD_GRANT_INVALID_ACTOR`,RECORD_GRANT_UNSHAREABLE_OBJECT:`RECORD_GRANT_UNSHAREABLE_OBJECT`,DUPLICATE:`SCHEMA_DUPLICATE`,DUPLICATE_OBJECT:`SCHEMA_DUPLICATE_OBJECT`,DUPLICATE_ATTRIBUTE:`SCHEMA_DUPLICATE_ATTRIBUTE`,CONFLICT:`SCHEMA_CONFLICT`,STORAGE_UPLOAD_FAILED:`SCHEMA_STORAGE_UPLOAD_FAILED`,STORAGE_DOWNLOAD_FAILED:`SCHEMA_STORAGE_DOWNLOAD_FAILED`,STORAGE_DELETE_FAILED:`SCHEMA_STORAGE_DELETE_FAILED`,STORAGE_URL_FAILED:`SCHEMA_STORAGE_URL_FAILED`,REPOSITORY_CREATE_FAILED:`SCHEMA_REPOSITORY_CREATE_FAILED`,REPOSITORY_UPDATE_FAILED:`SCHEMA_REPOSITORY_UPDATE_FAILED`,REPOSITORY_DELETE_FAILED:`SCHEMA_REPOSITORY_DELETE_FAILED`,REPOSITORY_QUERY_FAILED:`SCHEMA_REPOSITORY_QUERY_FAILED`,NOT_IMPLEMENTED:`SCHEMA_NOT_IMPLEMENTED`,TIMEOUT:`SCHEMA_TIMEOUT`,RECORD_REFERENCED:`SCHEMA_RECORD_REFERENCED`,ATTRIBUTE_IN_USE:`SCHEMA_ATTRIBUTE_IN_USE`,OBJECT_REFERENCED:`SCHEMA_OBJECT_REFERENCED`,CONFIGURATION_REQUIRED:`CONFIGURATION_REQUIRED`,SEARCH_ADAPTER_REQUIRED:`SEARCH_ADAPTER_REQUIRED`,SEARCH_BACKEND_FAILED:`SEARCH_BACKEND_FAILED`,SEARCH_BACKEND_REJECTED:`SEARCH_BACKEND_REJECTED`,INVARIANT_VIOLATION:`INVARIANT_VIOLATION`,TENANT_CONTEXT_MISSING:`TENANT_CONTEXT_MISSING`,JOB_RUN_METADATA_MISMATCH:`JOB_RUN_METADATA_MISMATCH`,JOB_COALESCED_FAILURE_HANDLED:`JOB_COALESCED_FAILURE_HANDLED`,FEATURE_FLAGS_CONTEXT:`FEATURE_FLAGS_CONTEXT`,REALTIME_RATE_LIMITED:`REALTIME_RATE_LIMITED`,REALTIME_DELIVERY_FAILED:`REALTIME_DELIVERY_FAILED`,REALTIME_SUBSCRIPTION_FAILED:`REALTIME_SUBSCRIPTION_FAILED`,AGENT_UNKNOWN:`AGENT_UNKNOWN`,AGENT_DEPTH_EXCEEDED:`AGENT_DEPTH_EXCEEDED`,AGENT_COST_LIMIT_EXCEEDED:`AGENT_COST_LIMIT_EXCEEDED`,AGENT_TREE_COST_LIMIT_EXCEEDED:`AGENT_TREE_COST_LIMIT_EXCEEDED`,CREDITS_EXHAUSTED:`CREDITS_EXHAUSTED`,QUOTA_EXCEEDED:`QUOTA_EXCEEDED`,AGENT_SESSION_NOT_FOUND:`AGENT_SESSION_NOT_FOUND`,AGENT_DEFINITION_NOT_FOUND:`AGENT_DEFINITION_NOT_FOUND`,AGENT_RUN_CONFIG:`AGENT_RUN_CONFIG`,AGENT_STREAMING:`AGENT_STREAMING`,AGENT_MISSING_ACTOR:`AGENT_MISSING_ACTOR`,AGENT_INVALID_STATE:`AGENT_INVALID_STATE`,AGENT_COMPACTION_IMPOSSIBLE:`AGENT_COMPACTION_IMPOSSIBLE`,AGENT_COMPACTION_TIMEOUT:`AGENT_COMPACTION_TIMEOUT`,AGENT_LEASE_HELD:`AGENT_LEASE_HELD`,AGENT_LEASE_UNAVAILABLE:`AGENT_LEASE_UNAVAILABLE`,AGENT_MESSAGE_NOT_FOUND:`AGENT_MESSAGE_NOT_FOUND`,AGENT_MESSAGE_NOT_EDITABLE:`AGENT_MESSAGE_NOT_EDITABLE`,INVALID_TOOL_INPUT:`INVALID_TOOL_INPUT`,EDIT_MATCH_NOT_FOUND:`EDIT_MATCH_NOT_FOUND`,EDIT_MATCH_AMBIGUOUS:`EDIT_MATCH_AMBIGUOUS`,EDIT_NO_CHANGE:`EDIT_NO_CHANGE`,EDIT_TARGET_UNAVAILABLE:`EDIT_TARGET_UNAVAILABLE`,EDIT_TARGET_UNSUPPORTED:`EDIT_TARGET_UNSUPPORTED`,AGENT_EXECUTION_CANCELLED:`AGENT_EXECUTION_CANCELLED`,AGENT_EXECUTION_TIMEOUT:`AGENT_EXECUTION_TIMEOUT`,AGENT_EXTERNAL_OUTCOME_UNKNOWN:`AGENT_EXTERNAL_OUTCOME_UNKNOWN`,AGENT_TOOL_CANCELLATION_POLICY:`AGENT_TOOL_CANCELLATION_POLICY`,AGENT_CANCELLATION_WATCH_CAPACITY:`AGENT_CANCELLATION_WATCH_CAPACITY`,AGENT_CANCELLATION_CLEANUP:`AGENT_CANCELLATION_CLEANUP`,AGENT_TURN_FINALIZER_STALLED:`AGENT_TURN_FINALIZER_STALLED`,WORKSTATION_NOT_READY:`WORKSTATION_NOT_READY`,WORKSTATION_IN_USE:`WORKSTATION_IN_USE`,WORKSTATION_NOT_CONNECTED:`WORKSTATION_NOT_CONNECTED`,WORKSTATION_AUTH_FAILED:`WORKSTATION_AUTH_FAILED`,WORKSTATION_RUN_FAILED:`WORKSTATION_RUN_FAILED`,DEVICE_NOT_FOUND:`DEVICE_NOT_FOUND`,DEVICE_OFFLINE:`DEVICE_OFFLINE`,DEVICE_CAPABILITY_MISMATCH:`DEVICE_CAPABILITY_MISMATCH`,DEVICE_CHANNEL_PROTOCOL:`DEVICE_CHANNEL_PROTOCOL`,AI_UNKNOWN:`AI_UNKNOWN`,AI_USAGE_LIMIT_EXCEEDED:`AI_USAGE_LIMIT_EXCEEDED`,AI_INVALID_USAGE:`AI_INVALID_USAGE`,AI_INVALID_MODEL:`AI_INVALID_MODEL`,AI_INVALID_MODEL_INPUT:`AI_INVALID_MODEL_INPUT`,AI_REPOSITORY_ERROR:`AI_REPOSITORY_ERROR`,AI_GENERATION_FAILED:`AI_GENERATION_FAILED`,AI_DECISION_FAILED:`AI_DECISION_FAILED`,AI_IMAGE_USAGE_PENDING:`AI_IMAGE_USAGE_PENDING`,AI_IMAGE_GENERATION_INDETERMINATE:`AI_IMAGE_GENERATION_INDETERMINATE`,AI_IMAGE_RESERVATION_CLEANUP_INDETERMINATE:`AI_IMAGE_RESERVATION_CLEANUP_INDETERMINATE`,AI_IMAGE_PUBLICATION_FAILED:`AI_IMAGE_PUBLICATION_FAILED`,FILE_PUBLIC_NOT_ATTACHABLE:`FILE_PUBLIC_NOT_ATTACHABLE`,DOCUMENT_MIME_NOT_ACCEPTED:`DOCUMENT_MIME_NOT_ACCEPTED`,DOCUMENT_MULTIPLE_NOT_ALLOWED:`DOCUMENT_MULTIPLE_NOT_ALLOWED`,DOCUMENT_NOT_FOUND_FOR_OPERATION:`DOCUMENT_NOT_FOUND_FOR_OPERATION`,DOCUMENT_STORAGE_FAILED:`DOCUMENT_STORAGE_FAILED`,DOCUMENT_SIZE_EXCEEDED:`DOCUMENT_SIZE_EXCEEDED`,DOCUMENT_OCR_FAILED:`DOCUMENT_OCR_FAILED`,DOCUMENT_BLOB_EMPTY:`DOCUMENT_BLOB_EMPTY`,DOCUMENT_FILE_TOO_LARGE:`DOCUMENT_FILE_TOO_LARGE`,DOCUMENT_FILE_NOT_FOUND:`DOCUMENT_FILE_NOT_FOUND`,DOCUMENT_FILE_ALREADY_PACKED:`DOCUMENT_FILE_ALREADY_PACKED`,DOCUMENT_RECORD_NOT_FOUND:`DOCUMENT_RECORD_NOT_FOUND`,DOCUMENT_RECORD_OBJECT_MISMATCH:`DOCUMENT_RECORD_OBJECT_MISMATCH`,DOCUMENT_FOLDER_SERVICE_UNAVAILABLE:`DOCUMENT_FOLDER_SERVICE_UNAVAILABLE`,DOCUMENT_FOLDER_PATH_NOT_FOUND:`DOCUMENT_FOLDER_PATH_NOT_FOUND`,EMAIL_PROVIDER_API_FAILED:`EMAIL_PROVIDER_API_FAILED`,EMAIL_SEND_FAILED:`EMAIL_SEND_FAILED`,EMAIL_SENT_NOT_STORED:`EMAIL_SENT_NOT_STORED`,EMAIL_BATCH_ITEM_FAILED:`EMAIL_BATCH_ITEM_FAILED`,CALENDAR_PROVIDER_API_FAILED:`CALENDAR_PROVIDER_API_FAILED`,EMBEDDING_MODEL_UNAVAILABLE:`EMBEDDING_MODEL_UNAVAILABLE`,EMBEDDING_DIMENSION_MISMATCH:`EMBEDDING_DIMENSION_MISMATCH`};var SchemaError=class extends Error{constructor(t,n=e.UNKNOWN,r){super(t),this.name=`SchemaError`,this.code=n,this.details=r,Object.setPrototypeOf(this,new.target.prototype)}toJSON(){return{name:this.name,code:this.code,message:this.message,details:this.details}}},NotFoundError=class extends SchemaError{constructor(t,n,r=e.RECORD_NOT_FOUND,i=`${t} with id "${n}" not found`){super(i,r,{resourceType:t,resourceId:n}),this._tag=`NotFoundError`,this.name=`NotFoundError`,this.resourceType=t,this.resourceId=n}},ObjectNotFoundError=class extends NotFoundError{constructor(t){super(`Object`,t,e.OBJECT_NOT_FOUND),this.name=`ObjectNotFoundError`}},AttributeNotFoundError=class extends NotFoundError{constructor(t){super(`Attribute`,t,e.ATTRIBUTE_NOT_FOUND),this.name=`AttributeNotFoundError`}},RecordNotFoundError=class extends NotFoundError{constructor(t){super(`Record`,t,e.RECORD_NOT_FOUND),this.name=`RecordNotFoundError`}},t=class ValidationError extends SchemaError{constructor(t,n){super(t,e.VALIDATION_FAILED,{errors:n}),this._tag=`ValidationError`,this.name=`ValidationError`,this.errors=n}static fromZodErrors(e){let t=e.map(e=>({path:e.path.map(String),message:e.message})),n=`Validation failed: ${t.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `)}`;return new ValidationError(n,t)}},AmbiguousSchemaChangeError=class extends t{constructor(t,n){super(t,n),this.code=e.AMBIGUOUS_CHANGE,this.name=`AmbiguousSchemaChangeError`}},ProtectedResourceError=class extends SchemaError{constructor(t,n,r){let i=t===`object`?e.PROTECTED_OBJECT:t===`view`?e.PROTECTED_VIEW:e.PROTECTED_ATTRIBUTE;super(`Cannot ${r} system ${t} "${n}"`,i,{resourceType:t,resourceName:n,operation:r}),this.name=`ProtectedResourceError`,this.resourceType=t,this.resourceName=n,this.operation=r}},SyncError=class extends SchemaError{constructor(t,n,r){super(`Failed to sync object "${t}": ${n}`,e.SYNC_FAILED,{objectName:t,cause:r?.message}),this.name=`SyncError`,this.objectName=t,this.cause=r}},SystemEntityImmutableError=class extends SchemaError{constructor(t,n){super(`Cannot mutate system ${t} "${n}". System entities are declared in code and immutable at runtime.`,e.SYSTEM_ENTITY_IMMUTABLE,{entityType:t,entityName:n}),this.name=`SystemEntityImmutableError`,this.entityType=t,this.entityName=n}},SyncConflictError=class extends SchemaError{constructor(t){let n=t.attributeName?`"${t.objectName}.${t.attributeName}"`:`"${t.objectName}"`;super(`Cannot promote runtime entity ${n}: ${t.reason}. Resolve via: (1) relax the code constraint, (2) migrate runtime values manually, or (3) rename the code declaration.`,e.SYNC_CONFLICT,{objectName:t.objectName,attributeName:t.attributeName,reason:t.reason}),this.name=`SyncConflictError`,this.objectName=t.objectName,this.attributeName=t.attributeName,this.reason=t.reason}},SyncCascadeError=class extends SchemaError{constructor(t,n){super(`Cannot demote object "${t}": attributes ${n.join(`, `)} are still declared in code. Remove them from code first, or restore the object.`,e.SYNC_CASCADE,{objectName:t,conflictingAttributes:n}),this.name=`SyncCascadeError`,this.objectName=t,this.conflictingAttributes=n}},OrphanSystemAttributeError=class extends SchemaError{constructor(t,n){super(`Attribute "${t}.${n}" is system:true but its object parent is system:false. This is an invariant violation.`,e.ORPHAN_SYSTEM_ATTRIBUTE,{objectName:t,attributeName:n}),this.name=`OrphanSystemAttributeError`,this.objectName=t,this.attributeName=n}},DuplicateError=class extends SchemaError{constructor(t,n,r){let i=t===`object`?e.DUPLICATE_OBJECT:t===`attribute`?e.DUPLICATE_ATTRIBUTE:e.DUPLICATE,a=`${t.charAt(0).toUpperCase()}${t.slice(1)} "${n}" already exists`;super(r??a,i,{resourceType:t,resourceName:n}),this.name=`DuplicateError`,this.resourceType=t,this.resourceName=n}};const n={builder:`cannot be built by a consumer`,registry:`cannot be registered by a consumer`,bundle:`cannot be claimed by a bundle`,source:`cannot be declared by a schema source`};var ReservedObjectNameError=class extends SchemaError{constructor(t,r){super(`"${t}" is a framework-native object name and ${n[r]}: the framework ships it, pick another name.`,e.RESERVED_OBJECT_NAME,{objectName:t,context:r}),this.name=`ReservedObjectNameError`,this.objectName=t}};function isSchemaError(e){return e instanceof SchemaError}function isNotFoundError(e){return e instanceof NotFoundError}function isValidationError(e){return e instanceof t}function isProtectedResourceError(e){return e instanceof ProtectedResourceError}var ForbiddenError=class extends SchemaError{constructor(t,n,r){super(`No ${n} permission on object "${t}"`,e.FORBIDDEN,{objectName:t,action:n,userId:r}),this._tag=`ForbiddenError`,this.name=`ForbiddenError`,this.objectName=t,this.action=n,this.userId=r}},ProtectedRoleError=class extends SchemaError{constructor(t,n){super(`Cannot ${n} system role "${t}"`,e.PROTECTED_ROLE,{roleName:t,operation:n}),this.name=`ProtectedRoleError`,this.roleName=t,this.operation=n}},InvalidPermissionGrantError=class extends SchemaError{constructor(t){super(`Invalid permission grants: ${t.map(e=>`${e.target} (${e.reason})`).join(`, `)}`,e.PERMISSION_INVALID_GRANT,{issues:t}),this.issues=t,this._tag=`InvalidPermissionGrantError`,this.name=`InvalidPermissionGrantError`}},RoleNotFoundError=class extends NotFoundError{constructor(t){super(`Role`,t,e.ROLE_NOT_FOUND),this.name=`RoleNotFoundError`}},ConcurrentModificationError=class extends SchemaError{constructor(t){super(`Record ${t} was modified by another request. Please refresh and try again.`,e.CONFLICT,{recordId:t})}},StorageError=class extends SchemaError{constructor(t,n,r,i){let a=t===`upload`?e.STORAGE_UPLOAD_FAILED:t===`download`?e.STORAGE_DOWNLOAD_FAILED:t===`delete`?e.STORAGE_DELETE_FAILED:e.STORAGE_URL_FAILED;super(`Storage ${t} failed: ${n}`,a,{operation:t,path:r,cause:i}),this.name=`StorageError`,this.operation=t,this.path=r,this.cause=i}},AccessDeniedError=class extends SchemaError{constructor(t,n){super(n??`Access denied to resource: ${t}`,e.ACCESS_DENIED,{resource:t,reason:n}),this.name=`AccessDeniedError`,this.resource=t,this.reason=n}},RepositoryError=class extends SchemaError{constructor(t,n,r,i){let a=t===`create`?e.REPOSITORY_CREATE_FAILED:t===`update`?e.REPOSITORY_UPDATE_FAILED:t===`delete`?e.REPOSITORY_DELETE_FAILED:e.REPOSITORY_QUERY_FAILED;super(`Failed to ${t} ${n}: ${r}${i?` (${i})`:``}`,a,{operation:t,entity:n,cause:i}),this.name=`RepositoryError`,this.operation=t,this.entity=n,this.cause=i}};function searchBackendMessage(e,t,n,r){return t===`unavailable`?`Search backend unavailable for ${e}`:`${t===`capacity`?`Search backend out of capacity for ${e}`:`Search backend rejected ${e}`}${n?`: ${n}`:``}${r?` — ${r}`:``}`}var SearchBackendError=class extends SchemaError{constructor(t,n,r={}){let i=r.kind??`unavailable`;super(searchBackendMessage(t,i,r.backendCode,r.detail),i===`unavailable`?e.SEARCH_BACKEND_FAILED:e.SEARCH_BACKEND_REJECTED,{scope:t,cause:n,kind:i,...r.backendCode?{backendCode:r.backendCode}:{}}),this.name=`SearchBackendError`,this.scope=t,this.cause=n,this.kind=i,this.backendCode=r.backendCode}},NotImplementedError=class extends SchemaError{constructor(t,n){let r=n?`${t}: not implemented (${n})`:`${t}: not implemented`;super(r,e.NOT_IMPLEMENTED,{feature:t,milestone:n}),this.name=`NotImplementedError`,this.feature=t,this.milestone=n}},MemoryNotFoundError=class extends NotFoundError{constructor(t){super(`Memory`,t,e.MEMORY_NOT_FOUND),this.name=`MemoryNotFoundError`}},RecordReferencedError=class extends SchemaError{constructor(t,n){let r=n.reduce((e,t)=>e+t.count,0);super(`Cannot delete record: referenced by ${r} record${r>1?`s`:``}`,e.RECORD_REFERENCED,{recordId:t,references:n}),this.name=`RecordReferencedError`,this.recordId=t,this.references=n}},AttributeInUseError=class extends SchemaError{constructor(t,n,r){super(`Cannot delete attribute "${t}": used in ${n}${r===void 0?``:` ${r}`}`,e.ATTRIBUTE_IN_USE,{attributeName:t,usage:n,...r===void 0?{}:{location:r}}),this.name=`AttributeInUseError`,this.attributeName=t,this.usage=n,this.location=r}},ObjectReferencedError=class extends SchemaError{constructor(t,n){super(`Cannot delete object "${t}": target of relations in ${n.join(`, `)}`,e.OBJECT_REFERENCED,{objectName:t,referencingObjects:n}),this.name=`ObjectReferencedError`,this.objectName=t,this.referencingObjects=n}},RealtimeRateLimitedError=class extends SchemaError{constructor(){super(`Supabase Realtime delivery was rate limited`,e.REALTIME_RATE_LIMITED),this.name=`RealtimeRateLimitedError`}},RealtimeDeliveryError=class extends SchemaError{constructor(){super(`Supabase Realtime delivery failed`,e.REALTIME_DELIVERY_FAILED),this.name=`RealtimeDeliveryError`}},RealtimeSubscriptionError=class extends SchemaError{constructor(){super(`Supabase Realtime subscription failed`,e.REALTIME_SUBSCRIPTION_FAILED),this.name=`RealtimeSubscriptionError`}};function isRecordReferencedError(e){return e instanceof RecordReferencedError}function isAttributeInUseError(e){return e instanceof AttributeInUseError}function isObjectReferencedError(e){return e instanceof ObjectReferencedError}exports.AccessDeniedError=AccessDeniedError,exports.AmbiguousSchemaChangeError=AmbiguousSchemaChangeError,exports.AttributeInUseError=AttributeInUseError,exports.AttributeNotFoundError=AttributeNotFoundError,exports.ConcurrentModificationError=ConcurrentModificationError,exports.DuplicateError=DuplicateError,exports.ForbiddenError=ForbiddenError,exports.InvalidPermissionGrantError=InvalidPermissionGrantError,exports.MemoryNotFoundError=MemoryNotFoundError,exports.NotFoundError=NotFoundError,exports.NotImplementedError=NotImplementedError,exports.ObjectNotFoundError=ObjectNotFoundError,exports.ObjectReferencedError=ObjectReferencedError,exports.OrphanSystemAttributeError=OrphanSystemAttributeError,exports.ProtectedResourceError=ProtectedResourceError,exports.ProtectedRoleError=ProtectedRoleError,exports.RealtimeDeliveryError=RealtimeDeliveryError,exports.RealtimeRateLimitedError=RealtimeRateLimitedError,exports.RealtimeSubscriptionError=RealtimeSubscriptionError,exports.RecordNotFoundError=RecordNotFoundError,exports.RecordReferencedError=RecordReferencedError,exports.RepositoryError=RepositoryError,exports.ReservedObjectNameError=ReservedObjectNameError,exports.RoleNotFoundError=RoleNotFoundError,exports.SchemaError=SchemaError,exports.SchemaErrorCode=e,exports.SearchBackendError=SearchBackendError,exports.StorageError=StorageError,exports.SyncCascadeError=SyncCascadeError,exports.SyncConflictError=SyncConflictError,exports.SyncError=SyncError,exports.SystemEntityImmutableError=SystemEntityImmutableError,exports.ValidationError=t,exports.isAttributeInUseError=isAttributeInUseError,exports.isNotFoundError=isNotFoundError,exports.isObjectReferencedError=isObjectReferencedError,exports.isProtectedResourceError=isProtectedResourceError,exports.isRecordReferencedError=isRecordReferencedError,exports.isSchemaError=isSchemaError,exports.isValidationError=isValidationError;