@stndrds/schema 1.0.0-alpha.293 → 1.0.0-alpha.68
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.
- package/dist/chunk-36UBIXJN.js +82 -0
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/chunk-IXHWBBIY.mjs +721 -0
- package/dist/chunk-KG75T7MA.mjs +18664 -0
- package/dist/chunk-NEVERCM3.js +41 -0
- package/dist/chunk-V2RPPE2Y.mjs +41 -0
- package/dist/chunk-V32FQLWX.js +721 -0
- package/dist/chunk-V5QXU2OK.mjs +82 -0
- package/dist/chunk-XGFBT4K2.js +18664 -0
- package/dist/chunk-Y6FXYEAI.mjs +10 -0
- package/dist/default-roles-42X3TJI5.mjs +21 -0
- package/dist/default-roles-C3FYDYMN.js +21 -0
- package/dist/index.d.mts +3392 -10860
- package/dist/index.d.ts +3392 -10860
- package/dist/index.js +1705 -10255
- package/dist/index.mjs +1735 -9398
- package/dist/runtime-B0G6eBXO.d.ts +12810 -0
- package/dist/runtime-fj4EKCWH.d.mts +12810 -0
- package/dist/runtime.d.mts +6 -0
- package/dist/runtime.d.ts +6 -0
- package/dist/runtime.js +323 -0
- package/dist/runtime.mjs +323 -0
- package/dist/utils.d.mts +55 -35
- package/dist/utils.d.ts +55 -35
- package/dist/utils.js +19 -31
- package/dist/utils.mjs +19 -2
- package/dist/validation/validators.d.mts +4 -0
- package/dist/validation/validators.d.ts +4 -0
- package/dist/validation/validators.js +121 -0
- package/dist/validation/validators.mjs +121 -0
- package/dist/validators-B6L_hVBw.d.ts +1564 -0
- package/dist/validators-CgiGGhyH.d.mts +1564 -0
- package/package.json +16 -106
- package/dist/all-CDJSpI46.d.ts +0 -978
- package/dist/all-Cru_CaSY.d.mts +0 -978
- package/dist/attributes-CNYwg_Nr.d.ts +0 -584
- package/dist/attributes-CWPLbp7c.d.mts +0 -584
- package/dist/capabilities.d.mts +0 -146
- package/dist/capabilities.d.ts +0 -146
- package/dist/capabilities.js +0 -77
- package/dist/capabilities.mjs +0 -70
- package/dist/chunk-5N7OSHVX.js +0 -657
- package/dist/chunk-5WATIVCA.js +0 -10
- package/dist/chunk-ACKMC6FL.js +0 -17
- package/dist/chunk-APRL56F4.mjs +0 -226
- package/dist/chunk-AYVHMVKQ.mjs +0 -15
- package/dist/chunk-C32UUQ6D.js +0 -241
- package/dist/chunk-E6JUYGJX.js +0 -22
- package/dist/chunk-EEH4XQ7W.js +0 -61
- package/dist/chunk-EW5XR2X3.js +0 -12
- package/dist/chunk-GO6LQADH.mjs +0 -57
- package/dist/chunk-GRUSTQK3.mjs +0 -641
- package/dist/chunk-HRQEZUAA.mjs +0 -29
- package/dist/chunk-HTSTPTNZ.js +0 -10
- package/dist/chunk-KNGWHQLR.js +0 -16
- package/dist/chunk-LV3FEUKU.mjs +0 -14
- package/dist/chunk-NS63SPNN.mjs +0 -8
- package/dist/chunk-O73ROMWQ.mjs +0 -85
- package/dist/chunk-OASIPLEB.js +0 -1504
- package/dist/chunk-OSSGN43B.mjs +0 -8
- package/dist/chunk-P4VCAPJT.js +0 -81
- package/dist/chunk-Q44QKLN4.mjs +0 -43
- package/dist/chunk-Q4SZAMJT.js +0 -72
- package/dist/chunk-QVLQPW3O.mjs +0 -10
- package/dist/chunk-QWKLQRBX.js +0 -35
- package/dist/chunk-R5LAJCBU.mjs +0 -67
- package/dist/chunk-SI34M4IC.js +0 -45
- package/dist/chunk-UANQJ2GH.mjs +0 -25
- package/dist/chunk-ULM2BA5A.mjs +0 -1432
- package/dist/chunk-UXAHLSWC.mjs +0 -8
- package/dist/chunk-V2UA2D4E.js +0 -10
- package/dist/chunk-VGGGLTYJ.mjs +0 -74
- package/dist/chunk-Y3UPKP2B.js +0 -605
- package/dist/chunk-YIP5FJ5H.js +0 -27
- package/dist/chunk-YKWSHBT5.js +0 -32
- package/dist/chunk-YUFTHPOE.mjs +0 -20
- package/dist/chunk-Z5OPSBMQ.mjs +0 -566
- package/dist/chunk-ZDQ5AP26.mjs +0 -31
- package/dist/chunk-ZPFOKBIN.js +0 -89
- package/dist/exceptions.d.mts +0 -507
- package/dist/exceptions.d.ts +0 -507
- package/dist/exceptions.js +0 -158
- package/dist/exceptions.mjs +0 -1
- package/dist/helpers-CXkVwpsl.d.ts +0 -76
- package/dist/helpers-Dul_r9rJ.d.mts +0 -76
- package/dist/index-BdVnHL3F.d.mts +0 -853
- package/dist/index-CFhPHQaI.d.ts +0 -853
- package/dist/migrations-DaFneOfx.d.ts +0 -39
- package/dist/migrations-fRvadl6i.d.mts +0 -39
- package/dist/objects-CDwMSnqv.d.mts +0 -250
- package/dist/objects-DJv6WrDE.d.ts +0 -250
- package/dist/types-CVYiFc69.d.mts +0 -38
- package/dist/types-NGEww_ln.d.ts +0 -38
- package/dist/validation/all.d.mts +0 -11
- package/dist/validation/all.d.ts +0 -11
- package/dist/validation/all.js +0 -131
- package/dist/validation/all.mjs +0 -18
- package/dist/validation/complex/currency.d.mts +0 -15
- package/dist/validation/complex/currency.d.ts +0 -15
- package/dist/validation/complex/currency.js +0 -11
- package/dist/validation/complex/currency.mjs +0 -2
- package/dist/validation/complex/location.d.mts +0 -22
- package/dist/validation/complex/location.d.ts +0 -22
- package/dist/validation/complex/location.js +0 -11
- package/dist/validation/complex/location.mjs +0 -2
- package/dist/validation/complex/phone.d.mts +0 -22
- package/dist/validation/complex/phone.d.ts +0 -22
- package/dist/validation/complex/phone.js +0 -11
- package/dist/validation/complex/phone.mjs +0 -2
- package/dist/validation/complex/relation.d.mts +0 -25
- package/dist/validation/complex/relation.d.ts +0 -25
- package/dist/validation/complex/relation.js +0 -19
- package/dist/validation/complex/relation.mjs +0 -2
- package/dist/validation/complex/richtext.d.mts +0 -13
- package/dist/validation/complex/richtext.d.ts +0 -13
- package/dist/validation/complex/richtext.js +0 -11
- package/dist/validation/complex/richtext.mjs +0 -2
- package/dist/validation/complex/select.d.mts +0 -20
- package/dist/validation/complex/select.d.ts +0 -20
- package/dist/validation/complex/select.js +0 -19
- package/dist/validation/complex/select.mjs +0 -2
- package/dist/validation/complex/user.d.mts +0 -13
- package/dist/validation/complex/user.d.ts +0 -13
- package/dist/validation/complex/user.js +0 -11
- package/dist/validation/complex/user.mjs +0 -2
- package/dist/validation/computed/formula.d.mts +0 -14
- package/dist/validation/computed/formula.d.ts +0 -14
- package/dist/validation/computed/formula.js +0 -11
- package/dist/validation/computed/formula.mjs +0 -2
- package/dist/validation/computed/rollup.d.mts +0 -14
- package/dist/validation/computed/rollup.d.ts +0 -14
- package/dist/validation/computed/rollup.js +0 -11
- package/dist/validation/computed/rollup.mjs +0 -2
- package/dist/validation/config/index.d.mts +0 -7
- package/dist/validation/config/index.d.ts +0 -7
- package/dist/validation/config/index.js +0 -52
- package/dist/validation/config/index.mjs +0 -7
- package/dist/validation/core/index.d.mts +0 -19
- package/dist/validation/core/index.d.ts +0 -19
- package/dist/validation/core/index.js +0 -14
- package/dist/validation/core/index.mjs +0 -1
- package/dist/validation/object/index.d.mts +0 -32
- package/dist/validation/object/index.d.ts +0 -32
- package/dist/validation/object/index.js +0 -69
- package/dist/validation/object/index.mjs +0 -16
- package/dist/validation/primitives/checkbox.d.mts +0 -12
- package/dist/validation/primitives/checkbox.d.ts +0 -12
- package/dist/validation/primitives/checkbox.js +0 -11
- package/dist/validation/primitives/checkbox.mjs +0 -2
- package/dist/validation/primitives/date.d.mts +0 -25
- package/dist/validation/primitives/date.d.ts +0 -25
- package/dist/validation/primitives/date.js +0 -11
- package/dist/validation/primitives/date.mjs +0 -2
- package/dist/validation/primitives/number.d.mts +0 -12
- package/dist/validation/primitives/number.d.ts +0 -12
- package/dist/validation/primitives/number.js +0 -11
- package/dist/validation/primitives/number.mjs +0 -2
- package/dist/validation/primitives/text.d.mts +0 -12
- package/dist/validation/primitives/text.d.ts +0 -12
- package/dist/validation/primitives/text.js +0 -11
- package/dist/validation/primitives/text.mjs +0 -2
package/dist/capabilities.d.mts
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
/** Accepted forms of the object identifier every object-scoped capability takes. */
|
|
4
|
-
declare const OBJECT_ID_DESCRIPTION = "Object UUID, kebab-case name (e.g., 'contacts'), or display label (e.g., 'Personne physique'). All three are accepted; UUID is most precise.";
|
|
5
|
-
/** Shared suffix for record `data` inputs that accept `$fromSandboxFile` references for large content. */
|
|
6
|
-
declare const SANDBOX_FILE_DATA_HINT = " For large text content (> a few KB), write it to a sandbox file first and pass {\"$fromSandboxFile\": \"/workspace/<file>\"} as the attribute value \u2014 the server substitutes the file content.";
|
|
7
|
-
/**
|
|
8
|
-
* The LLM-facing filter shape, deliberately looser than its two siblings:
|
|
9
|
-
* `types/filters.ts` (`FilterState`, the canonical TS model — its `quantifier`
|
|
10
|
-
* is omitted here on purpose, agents don't set edge quantifiers) and
|
|
11
|
-
* `validators/view-config.schema.ts` (`filterStateSchema`, the strict capped
|
|
12
|
-
* variant for stored view config). The operator list in the describe text
|
|
13
|
-
* restates `filters/operators.ts` (`OPERATOR_SPECS`) and
|
|
14
|
-
* `filters/normalize-operator.ts` (`SYNONYM_ALIASES`) — those are the source
|
|
15
|
-
* of truth; keep the prose in sync when adding an operator.
|
|
16
|
-
*/
|
|
17
|
-
declare const filtersSchema: z.ZodObject<{
|
|
18
|
-
combinator: z.ZodDefault<z.ZodEnum<{
|
|
19
|
-
and: "and";
|
|
20
|
-
or: "or";
|
|
21
|
-
}>>;
|
|
22
|
-
rules: z.ZodArray<z.ZodObject<{
|
|
23
|
-
attribute: z.ZodString;
|
|
24
|
-
property: z.ZodOptional<z.ZodString>;
|
|
25
|
-
operator: z.ZodString;
|
|
26
|
-
value: z.ZodNullable<z.ZodUnknown>;
|
|
27
|
-
}, z.core.$strip>>;
|
|
28
|
-
}, z.core.$strip>;
|
|
29
|
-
declare const sortsSchema: z.ZodArray<z.ZodObject<{
|
|
30
|
-
attribute: z.ZodString;
|
|
31
|
-
direction: z.ZodEnum<{
|
|
32
|
-
asc: "asc";
|
|
33
|
-
desc: "desc";
|
|
34
|
-
}>;
|
|
35
|
-
}, z.core.$strip>>;
|
|
36
|
-
/**
|
|
37
|
-
* Filter shapes derived from {@link filtersSchema} so the capability schema stays
|
|
38
|
-
* the single source of truth.
|
|
39
|
-
*
|
|
40
|
-
* The *parsed* shape (`z.infer`), deliberately: the runtime holds these after
|
|
41
|
-
* validation, when `combinator` has already been defaulted. What a caller may
|
|
42
|
-
* omit is `z.input`, and that is what {@link CapabilityInput} exposes.
|
|
43
|
-
*/
|
|
44
|
-
type FilterStateInput = z.infer<typeof filtersSchema>;
|
|
45
|
-
type FilterRuleInput = FilterStateInput["rules"][number];
|
|
46
|
-
/** How a capability mutates data, which decides whether a rehearsal captures it. */
|
|
47
|
-
type CapabilityKind = "read" | "create" | "update" | "delete";
|
|
48
|
-
/**
|
|
49
|
-
* Every capability a Reflex may call, defined once.
|
|
50
|
-
*
|
|
51
|
-
* Deliberately five entries — the single-record tools whose input the gateway can
|
|
52
|
-
* turn into a faithful `RunEffect`. Excluded on purpose: `get_schema`,
|
|
53
|
-
* `global_search` and `bulk_search`, which are not scoped to one object and so
|
|
54
|
-
* yield no object to grant a permission on; and the `bulk_*` record tools, where
|
|
55
|
-
* one call mutates many records and would be recorded as a single effect, making
|
|
56
|
-
* an effects report understate what happened.
|
|
57
|
-
*
|
|
58
|
-
* `description` is NOT here: the tools compute it per call from their config
|
|
59
|
-
* (`schemaInContext` changes the wording), and `schema-tools-descriptions.test.ts`
|
|
60
|
-
* pins both variants. The name, the kind and the input schema are what must exist
|
|
61
|
-
* exactly once, and they do.
|
|
62
|
-
*/
|
|
63
|
-
declare const RECORD_CAPABILITIES: {
|
|
64
|
-
readonly get_record: {
|
|
65
|
-
readonly name: "get_record";
|
|
66
|
-
readonly kind: "read";
|
|
67
|
-
readonly input: z.ZodObject<{
|
|
68
|
-
recordId: z.ZodString;
|
|
69
|
-
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
-
}, z.core.$strip>;
|
|
71
|
-
};
|
|
72
|
-
readonly search_records: {
|
|
73
|
-
readonly name: "search_records";
|
|
74
|
-
readonly kind: "read";
|
|
75
|
-
readonly input: z.ZodObject<{
|
|
76
|
-
objectId: z.ZodString;
|
|
77
|
-
_displayLabel: z.ZodOptional<z.ZodString>;
|
|
78
|
-
query: z.ZodOptional<z.ZodString>;
|
|
79
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
80
|
-
offset: z.ZodOptional<z.ZodNumber>;
|
|
81
|
-
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
82
|
-
filters: z.ZodOptional<z.ZodObject<{
|
|
83
|
-
combinator: z.ZodDefault<z.ZodEnum<{
|
|
84
|
-
and: "and";
|
|
85
|
-
or: "or";
|
|
86
|
-
}>>;
|
|
87
|
-
rules: z.ZodArray<z.ZodObject<{
|
|
88
|
-
attribute: z.ZodString;
|
|
89
|
-
property: z.ZodOptional<z.ZodString>;
|
|
90
|
-
operator: z.ZodString;
|
|
91
|
-
value: z.ZodNullable<z.ZodUnknown>;
|
|
92
|
-
}, z.core.$strip>>;
|
|
93
|
-
}, z.core.$strip>>;
|
|
94
|
-
sorts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
95
|
-
attribute: z.ZodString;
|
|
96
|
-
direction: z.ZodEnum<{
|
|
97
|
-
asc: "asc";
|
|
98
|
-
desc: "desc";
|
|
99
|
-
}>;
|
|
100
|
-
}, z.core.$strip>>>;
|
|
101
|
-
}, z.core.$strip>;
|
|
102
|
-
};
|
|
103
|
-
readonly create_record: {
|
|
104
|
-
readonly name: "create_record";
|
|
105
|
-
readonly kind: "create";
|
|
106
|
-
readonly input: z.ZodObject<{
|
|
107
|
-
objectId: z.ZodString;
|
|
108
|
-
_displayLabel: z.ZodOptional<z.ZodString>;
|
|
109
|
-
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
110
|
-
}, z.core.$strip>;
|
|
111
|
-
};
|
|
112
|
-
readonly update_record: {
|
|
113
|
-
readonly name: "update_record";
|
|
114
|
-
readonly kind: "update";
|
|
115
|
-
readonly input: z.ZodObject<{
|
|
116
|
-
recordId: z.ZodString;
|
|
117
|
-
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
118
|
-
}, z.core.$strip>;
|
|
119
|
-
};
|
|
120
|
-
readonly delete_record: {
|
|
121
|
-
readonly name: "delete_record";
|
|
122
|
-
readonly kind: "delete";
|
|
123
|
-
readonly input: z.ZodObject<{
|
|
124
|
-
recordId: z.ZodString;
|
|
125
|
-
}, z.core.$strip>;
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
type RecordCapabilityName = keyof typeof RECORD_CAPABILITIES;
|
|
129
|
-
/**
|
|
130
|
-
* A capability's argument type, inferred from the very schema the runtime
|
|
131
|
-
* validates against.
|
|
132
|
-
*
|
|
133
|
-
* `z.input`, not `z.infer`: these are the arguments a caller supplies, and the
|
|
134
|
-
* two sides differ wherever a field has a `.default()` — `filtersSchema`'s
|
|
135
|
-
* `combinator` is required on the output and optional on the input. Typing
|
|
136
|
-
* arguments with the output side made the SDK demand a `combinator` the runtime
|
|
137
|
-
* would have filled in anyway.
|
|
138
|
-
*/
|
|
139
|
-
type CapabilityInput<N extends RecordCapabilityName> = z.input<(typeof RECORD_CAPABILITIES)[N]["input"]>;
|
|
140
|
-
/**
|
|
141
|
-
* The capability → kind projection, derived rather than restated. The reflexes
|
|
142
|
-
* module reads this instead of maintaining its own table (D26/D28).
|
|
143
|
-
*/
|
|
144
|
-
declare const RECORD_CAPABILITY_KINDS: Readonly<Record<RecordCapabilityName, CapabilityKind>>;
|
|
145
|
-
|
|
146
|
-
export { type CapabilityInput, type CapabilityKind, type FilterRuleInput, type FilterStateInput, OBJECT_ID_DESCRIPTION, RECORD_CAPABILITIES, RECORD_CAPABILITY_KINDS, type RecordCapabilityName, SANDBOX_FILE_DATA_HINT, filtersSchema, sortsSchema };
|
package/dist/capabilities.d.ts
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
/** Accepted forms of the object identifier every object-scoped capability takes. */
|
|
4
|
-
declare const OBJECT_ID_DESCRIPTION = "Object UUID, kebab-case name (e.g., 'contacts'), or display label (e.g., 'Personne physique'). All three are accepted; UUID is most precise.";
|
|
5
|
-
/** Shared suffix for record `data` inputs that accept `$fromSandboxFile` references for large content. */
|
|
6
|
-
declare const SANDBOX_FILE_DATA_HINT = " For large text content (> a few KB), write it to a sandbox file first and pass {\"$fromSandboxFile\": \"/workspace/<file>\"} as the attribute value \u2014 the server substitutes the file content.";
|
|
7
|
-
/**
|
|
8
|
-
* The LLM-facing filter shape, deliberately looser than its two siblings:
|
|
9
|
-
* `types/filters.ts` (`FilterState`, the canonical TS model — its `quantifier`
|
|
10
|
-
* is omitted here on purpose, agents don't set edge quantifiers) and
|
|
11
|
-
* `validators/view-config.schema.ts` (`filterStateSchema`, the strict capped
|
|
12
|
-
* variant for stored view config). The operator list in the describe text
|
|
13
|
-
* restates `filters/operators.ts` (`OPERATOR_SPECS`) and
|
|
14
|
-
* `filters/normalize-operator.ts` (`SYNONYM_ALIASES`) — those are the source
|
|
15
|
-
* of truth; keep the prose in sync when adding an operator.
|
|
16
|
-
*/
|
|
17
|
-
declare const filtersSchema: z.ZodObject<{
|
|
18
|
-
combinator: z.ZodDefault<z.ZodEnum<{
|
|
19
|
-
and: "and";
|
|
20
|
-
or: "or";
|
|
21
|
-
}>>;
|
|
22
|
-
rules: z.ZodArray<z.ZodObject<{
|
|
23
|
-
attribute: z.ZodString;
|
|
24
|
-
property: z.ZodOptional<z.ZodString>;
|
|
25
|
-
operator: z.ZodString;
|
|
26
|
-
value: z.ZodNullable<z.ZodUnknown>;
|
|
27
|
-
}, z.core.$strip>>;
|
|
28
|
-
}, z.core.$strip>;
|
|
29
|
-
declare const sortsSchema: z.ZodArray<z.ZodObject<{
|
|
30
|
-
attribute: z.ZodString;
|
|
31
|
-
direction: z.ZodEnum<{
|
|
32
|
-
asc: "asc";
|
|
33
|
-
desc: "desc";
|
|
34
|
-
}>;
|
|
35
|
-
}, z.core.$strip>>;
|
|
36
|
-
/**
|
|
37
|
-
* Filter shapes derived from {@link filtersSchema} so the capability schema stays
|
|
38
|
-
* the single source of truth.
|
|
39
|
-
*
|
|
40
|
-
* The *parsed* shape (`z.infer`), deliberately: the runtime holds these after
|
|
41
|
-
* validation, when `combinator` has already been defaulted. What a caller may
|
|
42
|
-
* omit is `z.input`, and that is what {@link CapabilityInput} exposes.
|
|
43
|
-
*/
|
|
44
|
-
type FilterStateInput = z.infer<typeof filtersSchema>;
|
|
45
|
-
type FilterRuleInput = FilterStateInput["rules"][number];
|
|
46
|
-
/** How a capability mutates data, which decides whether a rehearsal captures it. */
|
|
47
|
-
type CapabilityKind = "read" | "create" | "update" | "delete";
|
|
48
|
-
/**
|
|
49
|
-
* Every capability a Reflex may call, defined once.
|
|
50
|
-
*
|
|
51
|
-
* Deliberately five entries — the single-record tools whose input the gateway can
|
|
52
|
-
* turn into a faithful `RunEffect`. Excluded on purpose: `get_schema`,
|
|
53
|
-
* `global_search` and `bulk_search`, which are not scoped to one object and so
|
|
54
|
-
* yield no object to grant a permission on; and the `bulk_*` record tools, where
|
|
55
|
-
* one call mutates many records and would be recorded as a single effect, making
|
|
56
|
-
* an effects report understate what happened.
|
|
57
|
-
*
|
|
58
|
-
* `description` is NOT here: the tools compute it per call from their config
|
|
59
|
-
* (`schemaInContext` changes the wording), and `schema-tools-descriptions.test.ts`
|
|
60
|
-
* pins both variants. The name, the kind and the input schema are what must exist
|
|
61
|
-
* exactly once, and they do.
|
|
62
|
-
*/
|
|
63
|
-
declare const RECORD_CAPABILITIES: {
|
|
64
|
-
readonly get_record: {
|
|
65
|
-
readonly name: "get_record";
|
|
66
|
-
readonly kind: "read";
|
|
67
|
-
readonly input: z.ZodObject<{
|
|
68
|
-
recordId: z.ZodString;
|
|
69
|
-
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
-
}, z.core.$strip>;
|
|
71
|
-
};
|
|
72
|
-
readonly search_records: {
|
|
73
|
-
readonly name: "search_records";
|
|
74
|
-
readonly kind: "read";
|
|
75
|
-
readonly input: z.ZodObject<{
|
|
76
|
-
objectId: z.ZodString;
|
|
77
|
-
_displayLabel: z.ZodOptional<z.ZodString>;
|
|
78
|
-
query: z.ZodOptional<z.ZodString>;
|
|
79
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
80
|
-
offset: z.ZodOptional<z.ZodNumber>;
|
|
81
|
-
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
82
|
-
filters: z.ZodOptional<z.ZodObject<{
|
|
83
|
-
combinator: z.ZodDefault<z.ZodEnum<{
|
|
84
|
-
and: "and";
|
|
85
|
-
or: "or";
|
|
86
|
-
}>>;
|
|
87
|
-
rules: z.ZodArray<z.ZodObject<{
|
|
88
|
-
attribute: z.ZodString;
|
|
89
|
-
property: z.ZodOptional<z.ZodString>;
|
|
90
|
-
operator: z.ZodString;
|
|
91
|
-
value: z.ZodNullable<z.ZodUnknown>;
|
|
92
|
-
}, z.core.$strip>>;
|
|
93
|
-
}, z.core.$strip>>;
|
|
94
|
-
sorts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
95
|
-
attribute: z.ZodString;
|
|
96
|
-
direction: z.ZodEnum<{
|
|
97
|
-
asc: "asc";
|
|
98
|
-
desc: "desc";
|
|
99
|
-
}>;
|
|
100
|
-
}, z.core.$strip>>>;
|
|
101
|
-
}, z.core.$strip>;
|
|
102
|
-
};
|
|
103
|
-
readonly create_record: {
|
|
104
|
-
readonly name: "create_record";
|
|
105
|
-
readonly kind: "create";
|
|
106
|
-
readonly input: z.ZodObject<{
|
|
107
|
-
objectId: z.ZodString;
|
|
108
|
-
_displayLabel: z.ZodOptional<z.ZodString>;
|
|
109
|
-
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
110
|
-
}, z.core.$strip>;
|
|
111
|
-
};
|
|
112
|
-
readonly update_record: {
|
|
113
|
-
readonly name: "update_record";
|
|
114
|
-
readonly kind: "update";
|
|
115
|
-
readonly input: z.ZodObject<{
|
|
116
|
-
recordId: z.ZodString;
|
|
117
|
-
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
118
|
-
}, z.core.$strip>;
|
|
119
|
-
};
|
|
120
|
-
readonly delete_record: {
|
|
121
|
-
readonly name: "delete_record";
|
|
122
|
-
readonly kind: "delete";
|
|
123
|
-
readonly input: z.ZodObject<{
|
|
124
|
-
recordId: z.ZodString;
|
|
125
|
-
}, z.core.$strip>;
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
type RecordCapabilityName = keyof typeof RECORD_CAPABILITIES;
|
|
129
|
-
/**
|
|
130
|
-
* A capability's argument type, inferred from the very schema the runtime
|
|
131
|
-
* validates against.
|
|
132
|
-
*
|
|
133
|
-
* `z.input`, not `z.infer`: these are the arguments a caller supplies, and the
|
|
134
|
-
* two sides differ wherever a field has a `.default()` — `filtersSchema`'s
|
|
135
|
-
* `combinator` is required on the output and optional on the input. Typing
|
|
136
|
-
* arguments with the output side made the SDK demand a `combinator` the runtime
|
|
137
|
-
* would have filled in anyway.
|
|
138
|
-
*/
|
|
139
|
-
type CapabilityInput<N extends RecordCapabilityName> = z.input<(typeof RECORD_CAPABILITIES)[N]["input"]>;
|
|
140
|
-
/**
|
|
141
|
-
* The capability → kind projection, derived rather than restated. The reflexes
|
|
142
|
-
* module reads this instead of maintaining its own table (D26/D28).
|
|
143
|
-
*/
|
|
144
|
-
declare const RECORD_CAPABILITY_KINDS: Readonly<Record<RecordCapabilityName, CapabilityKind>>;
|
|
145
|
-
|
|
146
|
-
export { type CapabilityInput, type CapabilityKind, type FilterRuleInput, type FilterStateInput, OBJECT_ID_DESCRIPTION, RECORD_CAPABILITIES, RECORD_CAPABILITY_KINDS, type RecordCapabilityName, SANDBOX_FILE_DATA_HINT, filtersSchema, sortsSchema };
|
package/dist/capabilities.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var zod = require('zod');
|
|
4
|
-
|
|
5
|
-
// src/capabilities.ts
|
|
6
|
-
var OBJECT_ID_DESCRIPTION = "Object UUID, kebab-case name (e.g., 'contacts'), or display label (e.g., 'Personne physique'). All three are accepted; UUID is most precise.";
|
|
7
|
-
var SANDBOX_FILE_DATA_HINT = ' For large text content (> a few KB), write it to a sandbox file first and pass {"$fromSandboxFile": "/workspace/<file>"} as the attribute value \u2014 the server substitutes the file content.';
|
|
8
|
-
var filtersSchema = zod.z.object({
|
|
9
|
-
combinator: zod.z.enum(["and", "or"]).default("and"),
|
|
10
|
-
rules: zod.z.array(
|
|
11
|
-
zod.z.object({
|
|
12
|
-
attribute: zod.z.string().describe("Attribute name on the object being searched"),
|
|
13
|
-
property: zod.z.string().optional().describe(
|
|
14
|
-
"Optional. Only valid when 'attribute' is a relation / document / user attribute declared with .qualifyWith({...}). When set, the rule filters on the named EDGE property (not the linked record) and the operator must be valid for that property's type. See <filter_operators>."
|
|
15
|
-
),
|
|
16
|
-
operator: zod.z.string().describe(
|
|
17
|
-
"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) \u2014 see <filter_operators>."
|
|
18
|
-
),
|
|
19
|
-
value: zod.z.unknown().nullable().describe(
|
|
20
|
-
"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."
|
|
21
|
-
)
|
|
22
|
-
})
|
|
23
|
-
)
|
|
24
|
-
});
|
|
25
|
-
var sortsSchema = zod.z.array(
|
|
26
|
-
zod.z.object({
|
|
27
|
-
attribute: zod.z.string().describe("Attribute name"),
|
|
28
|
-
direction: zod.z.enum(["asc", "desc"])
|
|
29
|
-
})
|
|
30
|
-
);
|
|
31
|
-
var getRecordInput = zod.z.object({
|
|
32
|
-
recordId: zod.z.string().describe("Record UUID"),
|
|
33
|
-
fields: zod.z.array(zod.z.string()).optional().describe("Attribute names to return")
|
|
34
|
-
});
|
|
35
|
-
var searchRecordsInput = zod.z.object({
|
|
36
|
-
objectId: zod.z.string().describe(OBJECT_ID_DESCRIPTION),
|
|
37
|
-
_displayLabel: zod.z.string().optional().describe("Display label"),
|
|
38
|
-
query: zod.z.string().optional().describe("Full-text search query (omit to browse/list)"),
|
|
39
|
-
limit: zod.z.number().optional().describe("Max results per call: 1-1000 (default 20). Paginate via offset for more."),
|
|
40
|
-
offset: zod.z.number().optional().describe("Skip N records (default 0)"),
|
|
41
|
-
fields: zod.z.array(zod.z.string()).optional().describe("Attribute names to include in values"),
|
|
42
|
-
filters: filtersSchema.optional().describe(
|
|
43
|
-
"Structured filter: { combinator: 'and'|'or', rules: [{attribute, operator, value, property?}] }. Operators are constrained per attribute type \u2014 see <filter_operators>. Use 'property' on a rule to filter on a qualified edge property."
|
|
44
|
-
),
|
|
45
|
-
sorts: sortsSchema.optional().describe("Sorts: [{ attribute, direction: 'asc'|'desc' }]")
|
|
46
|
-
});
|
|
47
|
-
var createRecordInput = zod.z.object({
|
|
48
|
-
objectId: zod.z.string().describe(OBJECT_ID_DESCRIPTION),
|
|
49
|
-
_displayLabel: zod.z.string().optional().describe("Display label"),
|
|
50
|
-
data: zod.z.record(zod.z.string(), zod.z.unknown()).describe(`Record data.${SANDBOX_FILE_DATA_HINT}`)
|
|
51
|
-
});
|
|
52
|
-
var updateRecordInput = zod.z.object({
|
|
53
|
-
recordId: zod.z.string().describe("Record UUID"),
|
|
54
|
-
data: zod.z.record(zod.z.string(), zod.z.unknown()).describe(`Fields to update.${SANDBOX_FILE_DATA_HINT}`)
|
|
55
|
-
});
|
|
56
|
-
var deleteRecordInput = zod.z.object({
|
|
57
|
-
recordId: zod.z.string().describe("Record UUID")
|
|
58
|
-
});
|
|
59
|
-
var RECORD_CAPABILITIES = {
|
|
60
|
-
get_record: { name: "get_record", kind: "read", input: getRecordInput },
|
|
61
|
-
search_records: { name: "search_records", kind: "read", input: searchRecordsInput },
|
|
62
|
-
create_record: { name: "create_record", kind: "create", input: createRecordInput },
|
|
63
|
-
update_record: { name: "update_record", kind: "update", input: updateRecordInput },
|
|
64
|
-
delete_record: { name: "delete_record", kind: "delete", input: deleteRecordInput }
|
|
65
|
-
};
|
|
66
|
-
var RECORD_CAPABILITY_KINDS = Object.freeze(
|
|
67
|
-
Object.fromEntries(
|
|
68
|
-
Object.values(RECORD_CAPABILITIES).map((capability) => [capability.name, capability.kind])
|
|
69
|
-
)
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
exports.OBJECT_ID_DESCRIPTION = OBJECT_ID_DESCRIPTION;
|
|
73
|
-
exports.RECORD_CAPABILITIES = RECORD_CAPABILITIES;
|
|
74
|
-
exports.RECORD_CAPABILITY_KINDS = RECORD_CAPABILITY_KINDS;
|
|
75
|
-
exports.SANDBOX_FILE_DATA_HINT = SANDBOX_FILE_DATA_HINT;
|
|
76
|
-
exports.filtersSchema = filtersSchema;
|
|
77
|
-
exports.sortsSchema = sortsSchema;
|
package/dist/capabilities.mjs
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
// src/capabilities.ts
|
|
4
|
-
var OBJECT_ID_DESCRIPTION = "Object UUID, kebab-case name (e.g., 'contacts'), or display label (e.g., 'Personne physique'). All three are accepted; UUID is most precise.";
|
|
5
|
-
var SANDBOX_FILE_DATA_HINT = ' For large text content (> a few KB), write it to a sandbox file first and pass {"$fromSandboxFile": "/workspace/<file>"} as the attribute value \u2014 the server substitutes the file content.';
|
|
6
|
-
var filtersSchema = z.object({
|
|
7
|
-
combinator: z.enum(["and", "or"]).default("and"),
|
|
8
|
-
rules: z.array(
|
|
9
|
-
z.object({
|
|
10
|
-
attribute: z.string().describe("Attribute name on the object being searched"),
|
|
11
|
-
property: z.string().optional().describe(
|
|
12
|
-
"Optional. Only valid when 'attribute' is a relation / document / user attribute declared with .qualifyWith({...}). When set, the rule filters on the named EDGE property (not the linked record) and the operator must be valid for that property's type. See <filter_operators>."
|
|
13
|
-
),
|
|
14
|
-
operator: z.string().describe(
|
|
15
|
-
"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) \u2014 see <filter_operators>."
|
|
16
|
-
),
|
|
17
|
-
value: z.unknown().nullable().describe(
|
|
18
|
-
"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."
|
|
19
|
-
)
|
|
20
|
-
})
|
|
21
|
-
)
|
|
22
|
-
});
|
|
23
|
-
var sortsSchema = z.array(
|
|
24
|
-
z.object({
|
|
25
|
-
attribute: z.string().describe("Attribute name"),
|
|
26
|
-
direction: z.enum(["asc", "desc"])
|
|
27
|
-
})
|
|
28
|
-
);
|
|
29
|
-
var getRecordInput = z.object({
|
|
30
|
-
recordId: z.string().describe("Record UUID"),
|
|
31
|
-
fields: z.array(z.string()).optional().describe("Attribute names to return")
|
|
32
|
-
});
|
|
33
|
-
var searchRecordsInput = z.object({
|
|
34
|
-
objectId: z.string().describe(OBJECT_ID_DESCRIPTION),
|
|
35
|
-
_displayLabel: z.string().optional().describe("Display label"),
|
|
36
|
-
query: z.string().optional().describe("Full-text search query (omit to browse/list)"),
|
|
37
|
-
limit: z.number().optional().describe("Max results per call: 1-1000 (default 20). Paginate via offset for more."),
|
|
38
|
-
offset: z.number().optional().describe("Skip N records (default 0)"),
|
|
39
|
-
fields: z.array(z.string()).optional().describe("Attribute names to include in values"),
|
|
40
|
-
filters: filtersSchema.optional().describe(
|
|
41
|
-
"Structured filter: { combinator: 'and'|'or', rules: [{attribute, operator, value, property?}] }. Operators are constrained per attribute type \u2014 see <filter_operators>. Use 'property' on a rule to filter on a qualified edge property."
|
|
42
|
-
),
|
|
43
|
-
sorts: sortsSchema.optional().describe("Sorts: [{ attribute, direction: 'asc'|'desc' }]")
|
|
44
|
-
});
|
|
45
|
-
var createRecordInput = z.object({
|
|
46
|
-
objectId: z.string().describe(OBJECT_ID_DESCRIPTION),
|
|
47
|
-
_displayLabel: z.string().optional().describe("Display label"),
|
|
48
|
-
data: z.record(z.string(), z.unknown()).describe(`Record data.${SANDBOX_FILE_DATA_HINT}`)
|
|
49
|
-
});
|
|
50
|
-
var updateRecordInput = z.object({
|
|
51
|
-
recordId: z.string().describe("Record UUID"),
|
|
52
|
-
data: z.record(z.string(), z.unknown()).describe(`Fields to update.${SANDBOX_FILE_DATA_HINT}`)
|
|
53
|
-
});
|
|
54
|
-
var deleteRecordInput = z.object({
|
|
55
|
-
recordId: z.string().describe("Record UUID")
|
|
56
|
-
});
|
|
57
|
-
var RECORD_CAPABILITIES = {
|
|
58
|
-
get_record: { name: "get_record", kind: "read", input: getRecordInput },
|
|
59
|
-
search_records: { name: "search_records", kind: "read", input: searchRecordsInput },
|
|
60
|
-
create_record: { name: "create_record", kind: "create", input: createRecordInput },
|
|
61
|
-
update_record: { name: "update_record", kind: "update", input: updateRecordInput },
|
|
62
|
-
delete_record: { name: "delete_record", kind: "delete", input: deleteRecordInput }
|
|
63
|
-
};
|
|
64
|
-
var RECORD_CAPABILITY_KINDS = Object.freeze(
|
|
65
|
-
Object.fromEntries(
|
|
66
|
-
Object.values(RECORD_CAPABILITIES).map((capability) => [capability.name, capability.kind])
|
|
67
|
-
)
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
export { OBJECT_ID_DESCRIPTION, RECORD_CAPABILITIES, RECORD_CAPABILITY_KINDS, SANDBOX_FILE_DATA_HINT, filtersSchema, sortsSchema };
|