@schift-io/knowledge-scope 0.1.0

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 (62) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +387 -0
  3. package/dist/context-pack.js +4771 -0
  4. package/dist/index.js +8044 -0
  5. package/dist/main.js +7550 -0
  6. package/dist/types/adapters/evidence-policy.d.ts +3 -0
  7. package/dist/types/adapters/gates.d.ts +13 -0
  8. package/dist/types/adapters/http-policy.d.ts +10 -0
  9. package/dist/types/adapters/open-connector.d.ts +20 -0
  10. package/dist/types/adapters/provider-port.d.ts +27 -0
  11. package/dist/types/adapters/response.d.ts +12 -0
  12. package/dist/types/adapters/schift-search-headers.d.ts +2 -0
  13. package/dist/types/adapters/schift-search-identity.d.ts +14 -0
  14. package/dist/types/adapters/schift-search.d.ts +17 -0
  15. package/dist/types/adapters/types.d.ts +136 -0
  16. package/dist/types/api-contract.d.ts +164 -0
  17. package/dist/types/api.d.ts +30 -0
  18. package/dist/types/application-batch.d.ts +4 -0
  19. package/dist/types/application-execution.d.ts +30 -0
  20. package/dist/types/application.d.ts +47 -0
  21. package/dist/types/authorization.d.ts +228 -0
  22. package/dist/types/cli-options.d.ts +6 -0
  23. package/dist/types/cli.d.ts +24 -0
  24. package/dist/types/client-error.d.ts +5 -0
  25. package/dist/types/client-validation.d.ts +8 -0
  26. package/dist/types/client.d.ts +18 -0
  27. package/dist/types/context-pack/bounded-json.d.ts +3 -0
  28. package/dist/types/context-pack/canonical.d.ts +12 -0
  29. package/dist/types/context-pack/index.d.ts +73 -0
  30. package/dist/types/context-pack/knowledge-scope-admission.d.ts +23 -0
  31. package/dist/types/context-pack/knowledge-scope-batch.d.ts +85 -0
  32. package/dist/types/context-pack/knowledge-scope-execution.d.ts +297 -0
  33. package/dist/types/context-pack/knowledge-scope-lock.d.ts +71 -0
  34. package/dist/types/context-pack/knowledge-scope-mount.d.ts +1094 -0
  35. package/dist/types/context-pack/knowledge-scope.d.ts +1843 -0
  36. package/dist/types/context-pack/scalars.d.ts +13 -0
  37. package/dist/types/doctor-config.d.ts +6 -0
  38. package/dist/types/doctor.d.ts +7 -0
  39. package/dist/types/errors.d.ts +8 -0
  40. package/dist/types/evaluation/contracts.d.ts +718 -0
  41. package/dist/types/evaluation.d.ts +20 -0
  42. package/dist/types/index.d.ts +26 -0
  43. package/dist/types/json.d.ts +17 -0
  44. package/dist/types/limits.d.ts +10 -0
  45. package/dist/types/main.d.ts +10 -0
  46. package/dist/types/onboarding-config.d.ts +9 -0
  47. package/dist/types/portable.d.ts +14 -0
  48. package/dist/types/quickstart.d.ts +10 -0
  49. package/dist/types/schema-subset.d.ts +9 -0
  50. package/dist/types/state-contract.d.ts +2867 -0
  51. package/dist/types/state-store.d.ts +29 -0
  52. package/docs/PILOT.md +184 -0
  53. package/examples/batch-consumer.mjs +19 -0
  54. package/examples/consumer.mjs +17 -0
  55. package/examples/evaluation/README.md +34 -0
  56. package/examples/evaluation/run.mjs +21 -0
  57. package/examples/evaluation/synthetic.json +59 -0
  58. package/examples/mount-bindings.json +31 -0
  59. package/examples/support-scope/schemas/query-input.json +6 -0
  60. package/examples/support-scope/schemas/result-row.json +6 -0
  61. package/examples/support-scope/scope.json +48 -0
  62. package/package.json +58 -0
@@ -0,0 +1,1094 @@
1
+ import { z } from "zod";
2
+ import type { KnowledgeScopeDefinition } from "./knowledge-scope.js";
3
+ export declare const KnowledgeScopeMountSchema: z.ZodReadonly<z.ZodEffects<z.ZodObject<{
4
+ installationId: z.ZodBranded<z.ZodString, "InstallationId">;
5
+ definitionDigest: z.ZodBranded<z.ZodString, "Sha256Digest">;
6
+ scopeAuthority: z.ZodReadonly<z.ZodObject<{
7
+ organizationId: z.ZodString;
8
+ tenant: z.ZodString;
9
+ }, "strict", z.ZodTypeAny, {
10
+ tenant: string;
11
+ organizationId: string;
12
+ }, {
13
+ tenant: string;
14
+ organizationId: string;
15
+ }>>;
16
+ sourceBindings: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
17
+ sourceId: z.ZodBranded<z.ZodString, "SourceId">;
18
+ sourceClass: z.ZodEnum<["document", "records", "activity_stream"]>;
19
+ providerRef: z.ZodString;
20
+ connectorRef: z.ZodOptional<z.ZodString>;
21
+ authority: z.ZodEnum<["primary", "operational", "approved", "observed", "derived"]>;
22
+ origin: z.ZodOptional<z.ZodEnum<["observed", "derived"]>>;
23
+ permissionMode: z.ZodEnum<["live", "mirrored", "static", "unsupported"]>;
24
+ operationIds: z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
25
+ }, "strict", z.ZodTypeAny, {
26
+ authority: "primary" | "operational" | "approved" | "observed" | "derived";
27
+ sourceId: string & z.BRAND<"SourceId">;
28
+ sourceClass: "document" | "records" | "activity_stream";
29
+ providerRef: string;
30
+ permissionMode: "live" | "mirrored" | "static" | "unsupported";
31
+ operationIds: readonly string[];
32
+ connectorRef?: string | undefined;
33
+ origin?: "observed" | "derived" | undefined;
34
+ }, {
35
+ authority: "primary" | "operational" | "approved" | "observed" | "derived";
36
+ sourceId: string;
37
+ sourceClass: "document" | "records" | "activity_stream";
38
+ providerRef: string;
39
+ permissionMode: "live" | "mirrored" | "static" | "unsupported";
40
+ operationIds: readonly string[];
41
+ connectorRef?: string | undefined;
42
+ origin?: "observed" | "derived" | undefined;
43
+ }>>, "many">>;
44
+ state: z.ZodEnum<["mounted", "unmounted"]>;
45
+ revision: z.ZodNumber;
46
+ }, "strict", z.ZodTypeAny, {
47
+ installationId: string & z.BRAND<"InstallationId">;
48
+ definitionDigest: string & z.BRAND<"Sha256Digest">;
49
+ scopeAuthority: Readonly<{
50
+ tenant: string;
51
+ organizationId: string;
52
+ }>;
53
+ revision: number;
54
+ sourceBindings: readonly Readonly<{
55
+ authority: "primary" | "operational" | "approved" | "observed" | "derived";
56
+ sourceId: string & z.BRAND<"SourceId">;
57
+ sourceClass: "document" | "records" | "activity_stream";
58
+ providerRef: string;
59
+ permissionMode: "live" | "mirrored" | "static" | "unsupported";
60
+ operationIds: readonly string[];
61
+ connectorRef?: string | undefined;
62
+ origin?: "observed" | "derived" | undefined;
63
+ }>[];
64
+ state: "mounted" | "unmounted";
65
+ }, {
66
+ installationId: string;
67
+ definitionDigest: string;
68
+ scopeAuthority: Readonly<{
69
+ tenant: string;
70
+ organizationId: string;
71
+ }>;
72
+ revision: number;
73
+ sourceBindings: readonly Readonly<{
74
+ authority: "primary" | "operational" | "approved" | "observed" | "derived";
75
+ sourceId: string;
76
+ sourceClass: "document" | "records" | "activity_stream";
77
+ providerRef: string;
78
+ permissionMode: "live" | "mirrored" | "static" | "unsupported";
79
+ operationIds: readonly string[];
80
+ connectorRef?: string | undefined;
81
+ origin?: "observed" | "derived" | undefined;
82
+ }>[];
83
+ state: "mounted" | "unmounted";
84
+ }>, {
85
+ installationId: string & z.BRAND<"InstallationId">;
86
+ definitionDigest: string & z.BRAND<"Sha256Digest">;
87
+ scopeAuthority: Readonly<{
88
+ tenant: string;
89
+ organizationId: string;
90
+ }>;
91
+ revision: number;
92
+ sourceBindings: readonly Readonly<{
93
+ authority: "primary" | "operational" | "approved" | "observed" | "derived";
94
+ sourceId: string & z.BRAND<"SourceId">;
95
+ sourceClass: "document" | "records" | "activity_stream";
96
+ providerRef: string;
97
+ permissionMode: "live" | "mirrored" | "static" | "unsupported";
98
+ operationIds: readonly string[];
99
+ connectorRef?: string | undefined;
100
+ origin?: "observed" | "derived" | undefined;
101
+ }>[];
102
+ state: "mounted" | "unmounted";
103
+ }, {
104
+ installationId: string;
105
+ definitionDigest: string;
106
+ scopeAuthority: Readonly<{
107
+ tenant: string;
108
+ organizationId: string;
109
+ }>;
110
+ revision: number;
111
+ sourceBindings: readonly Readonly<{
112
+ authority: "primary" | "operational" | "approved" | "observed" | "derived";
113
+ sourceId: string;
114
+ sourceClass: "document" | "records" | "activity_stream";
115
+ providerRef: string;
116
+ permissionMode: "live" | "mirrored" | "static" | "unsupported";
117
+ operationIds: readonly string[];
118
+ connectorRef?: string | undefined;
119
+ origin?: "observed" | "derived" | undefined;
120
+ }>[];
121
+ state: "mounted" | "unmounted";
122
+ }>>;
123
+ /** @deprecated Use KnowledgeScopeDefinitionSchema and KnowledgeScopeMountSchema. */
124
+ export declare const KnowledgeScopePackSchema: z.ZodReadonly<z.ZodEffects<z.ZodObject<Omit<{
125
+ packId: z.ZodBranded<z.ZodString, "PackId">;
126
+ version: z.ZodBranded<z.ZodString, "SemanticVersion">;
127
+ responsibility: z.ZodString;
128
+ scope: z.ZodReadonly<z.ZodObject<{
129
+ root: z.ZodLiteral<"tenant">;
130
+ descendants: z.ZodReadonly<z.ZodTuple<[z.ZodLiteral<"namespace">, z.ZodLiteral<"subject">, z.ZodLiteral<"session">], null>>;
131
+ }, "strict", z.ZodTypeAny, {
132
+ root: "tenant";
133
+ descendants: readonly ["namespace", "subject", "session"];
134
+ }, {
135
+ root: "tenant";
136
+ descendants: readonly ["namespace", "subject", "session"];
137
+ }>>;
138
+ capabilities: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
139
+ operationId: z.ZodString;
140
+ provider: z.ZodReadonly<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
141
+ kind: z.ZodLiteral<"records_operation">;
142
+ operationId: z.ZodString;
143
+ }, "strict", z.ZodTypeAny, {
144
+ kind: "records_operation";
145
+ operationId: string;
146
+ }, {
147
+ kind: "records_operation";
148
+ operationId: string;
149
+ }>, z.ZodObject<{
150
+ kind: z.ZodLiteral<"open_connector_action">;
151
+ actionId: z.ZodString;
152
+ connectorRef: z.ZodString;
153
+ }, "strict", z.ZodTypeAny, {
154
+ kind: "open_connector_action";
155
+ actionId: string;
156
+ connectorRef: string;
157
+ }, {
158
+ kind: "open_connector_action";
159
+ actionId: string;
160
+ connectorRef: string;
161
+ }>, z.ZodObject<{
162
+ kind: z.ZodLiteral<"schift_search">;
163
+ indexRef: z.ZodString;
164
+ }, "strict", z.ZodTypeAny, {
165
+ kind: "schift_search";
166
+ indexRef: string;
167
+ }, {
168
+ kind: "schift_search";
169
+ indexRef: string;
170
+ }>, z.ZodObject<{
171
+ kind: z.ZodLiteral<"web_search">;
172
+ provider: z.ZodEnum<["customer", "schift"]>;
173
+ }, "strict", z.ZodTypeAny, {
174
+ kind: "web_search";
175
+ provider: "customer" | "schift";
176
+ }, {
177
+ kind: "web_search";
178
+ provider: "customer" | "schift";
179
+ }>]>>;
180
+ inputSchemaRef: z.ZodEffects<z.ZodString, string, string>;
181
+ resultSchemaRef: z.ZodEffects<z.ZodString, string, string>;
182
+ allowedFilters: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>>;
183
+ limits: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodObject<{
184
+ maxRows: z.ZodOptional<z.ZodNumber>;
185
+ maxResultBytes: z.ZodOptional<z.ZodNumber>;
186
+ }, "strict", z.ZodTypeAny, {
187
+ maxRows?: number | undefined;
188
+ maxResultBytes?: number | undefined;
189
+ }, {
190
+ maxRows?: number | undefined;
191
+ maxResultBytes?: number | undefined;
192
+ }>, {
193
+ maxRows?: number | undefined;
194
+ maxResultBytes?: number | undefined;
195
+ }, {
196
+ maxRows?: number | undefined;
197
+ maxResultBytes?: number | undefined;
198
+ }>>>;
199
+ freshness: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
200
+ maxAgeSeconds: z.ZodNumber;
201
+ }, "strict", z.ZodTypeAny, {
202
+ maxAgeSeconds: number;
203
+ }, {
204
+ maxAgeSeconds: number;
205
+ }>>>;
206
+ requiredProviderScopes: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>>;
207
+ }, "strict", z.ZodTypeAny, {
208
+ operationId: string;
209
+ provider: Readonly<{
210
+ kind: "records_operation";
211
+ operationId: string;
212
+ }> | Readonly<{
213
+ kind: "open_connector_action";
214
+ actionId: string;
215
+ connectorRef: string;
216
+ }> | Readonly<{
217
+ kind: "schift_search";
218
+ indexRef: string;
219
+ }> | Readonly<{
220
+ kind: "web_search";
221
+ provider: "customer" | "schift";
222
+ }>;
223
+ inputSchemaRef: string;
224
+ resultSchemaRef: string;
225
+ allowedFilters?: readonly string[] | undefined;
226
+ limits?: Readonly<{
227
+ maxRows?: number | undefined;
228
+ maxResultBytes?: number | undefined;
229
+ }> | undefined;
230
+ freshness?: Readonly<{
231
+ maxAgeSeconds: number;
232
+ }> | undefined;
233
+ requiredProviderScopes?: readonly string[] | undefined;
234
+ }, {
235
+ operationId: string;
236
+ provider: Readonly<{
237
+ kind: "records_operation";
238
+ operationId: string;
239
+ }> | Readonly<{
240
+ kind: "open_connector_action";
241
+ actionId: string;
242
+ connectorRef: string;
243
+ }> | Readonly<{
244
+ kind: "schift_search";
245
+ indexRef: string;
246
+ }> | Readonly<{
247
+ kind: "web_search";
248
+ provider: "customer" | "schift";
249
+ }>;
250
+ inputSchemaRef: string;
251
+ resultSchemaRef: string;
252
+ allowedFilters?: readonly string[] | undefined;
253
+ limits?: Readonly<{
254
+ maxRows?: number | undefined;
255
+ maxResultBytes?: number | undefined;
256
+ }> | undefined;
257
+ freshness?: Readonly<{
258
+ maxAgeSeconds: number;
259
+ }> | undefined;
260
+ requiredProviderScopes?: readonly string[] | undefined;
261
+ }>>, "many">>;
262
+ contextPolicy: z.ZodReadonly<z.ZodEffects<z.ZodObject<{
263
+ mustConsider: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
264
+ id: z.ZodString;
265
+ selector: z.ZodReadonly<z.ZodEffects<z.ZodObject<{
266
+ sourceIds: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>>;
267
+ sourceClasses: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodEnum<["document", "records", "activity_stream"]>, "many">, ("document" | "records" | "activity_stream")[], ("document" | "records" | "activity_stream")[]>>>;
268
+ authorities: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodEnum<["primary", "operational", "approved", "observed", "derived"]>, "many">, ("primary" | "operational" | "approved" | "observed" | "derived")[], ("primary" | "operational" | "approved" | "observed" | "derived")[]>>>;
269
+ origins: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodEnum<["observed", "derived"]>, "many">, ("observed" | "derived")[], ("observed" | "derived")[]>>>;
270
+ }, "strict", z.ZodTypeAny, {
271
+ sourceIds?: readonly string[] | undefined;
272
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
273
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
274
+ origins?: readonly ("observed" | "derived")[] | undefined;
275
+ }, {
276
+ sourceIds?: readonly string[] | undefined;
277
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
278
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
279
+ origins?: readonly ("observed" | "derived")[] | undefined;
280
+ }>, {
281
+ sourceIds?: readonly string[] | undefined;
282
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
283
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
284
+ origins?: readonly ("observed" | "derived")[] | undefined;
285
+ }, {
286
+ sourceIds?: readonly string[] | undefined;
287
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
288
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
289
+ origins?: readonly ("observed" | "derived")[] | undefined;
290
+ }>>;
291
+ minEvidence: z.ZodNumber;
292
+ maxAgeSeconds: z.ZodOptional<z.ZodNumber>;
293
+ }, "strict", z.ZodTypeAny, {
294
+ id: string;
295
+ selector: Readonly<{
296
+ sourceIds?: readonly string[] | undefined;
297
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
298
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
299
+ origins?: readonly ("observed" | "derived")[] | undefined;
300
+ }>;
301
+ minEvidence: number;
302
+ maxAgeSeconds?: number | undefined;
303
+ }, {
304
+ id: string;
305
+ selector: Readonly<{
306
+ sourceIds?: readonly string[] | undefined;
307
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
308
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
309
+ origins?: readonly ("observed" | "derived")[] | undefined;
310
+ }>;
311
+ minEvidence: number;
312
+ maxAgeSeconds?: number | undefined;
313
+ }>>, "many">>;
314
+ mayConsider: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
315
+ id: z.ZodString;
316
+ selector: z.ZodReadonly<z.ZodEffects<z.ZodObject<{
317
+ sourceIds: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>>;
318
+ sourceClasses: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodEnum<["document", "records", "activity_stream"]>, "many">, ("document" | "records" | "activity_stream")[], ("document" | "records" | "activity_stream")[]>>>;
319
+ authorities: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodEnum<["primary", "operational", "approved", "observed", "derived"]>, "many">, ("primary" | "operational" | "approved" | "observed" | "derived")[], ("primary" | "operational" | "approved" | "observed" | "derived")[]>>>;
320
+ origins: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodEnum<["observed", "derived"]>, "many">, ("observed" | "derived")[], ("observed" | "derived")[]>>>;
321
+ }, "strict", z.ZodTypeAny, {
322
+ sourceIds?: readonly string[] | undefined;
323
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
324
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
325
+ origins?: readonly ("observed" | "derived")[] | undefined;
326
+ }, {
327
+ sourceIds?: readonly string[] | undefined;
328
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
329
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
330
+ origins?: readonly ("observed" | "derived")[] | undefined;
331
+ }>, {
332
+ sourceIds?: readonly string[] | undefined;
333
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
334
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
335
+ origins?: readonly ("observed" | "derived")[] | undefined;
336
+ }, {
337
+ sourceIds?: readonly string[] | undefined;
338
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
339
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
340
+ origins?: readonly ("observed" | "derived")[] | undefined;
341
+ }>>;
342
+ minEvidence: z.ZodNumber;
343
+ maxAgeSeconds: z.ZodOptional<z.ZodNumber>;
344
+ }, "strict", z.ZodTypeAny, {
345
+ id: string;
346
+ selector: Readonly<{
347
+ sourceIds?: readonly string[] | undefined;
348
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
349
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
350
+ origins?: readonly ("observed" | "derived")[] | undefined;
351
+ }>;
352
+ minEvidence: number;
353
+ maxAgeSeconds?: number | undefined;
354
+ }, {
355
+ id: string;
356
+ selector: Readonly<{
357
+ sourceIds?: readonly string[] | undefined;
358
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
359
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
360
+ origins?: readonly ("observed" | "derived")[] | undefined;
361
+ }>;
362
+ minEvidence: number;
363
+ maxAgeSeconds?: number | undefined;
364
+ }>>, "many">>>;
365
+ mustNotUse: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
366
+ id: z.ZodString;
367
+ selector: z.ZodReadonly<z.ZodEffects<z.ZodObject<{
368
+ sourceIds: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>>;
369
+ sourceClasses: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodEnum<["document", "records", "activity_stream"]>, "many">, ("document" | "records" | "activity_stream")[], ("document" | "records" | "activity_stream")[]>>>;
370
+ authorities: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodEnum<["primary", "operational", "approved", "observed", "derived"]>, "many">, ("primary" | "operational" | "approved" | "observed" | "derived")[], ("primary" | "operational" | "approved" | "observed" | "derived")[]>>>;
371
+ origins: z.ZodOptional<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodEnum<["observed", "derived"]>, "many">, ("observed" | "derived")[], ("observed" | "derived")[]>>>;
372
+ }, "strict", z.ZodTypeAny, {
373
+ sourceIds?: readonly string[] | undefined;
374
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
375
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
376
+ origins?: readonly ("observed" | "derived")[] | undefined;
377
+ }, {
378
+ sourceIds?: readonly string[] | undefined;
379
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
380
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
381
+ origins?: readonly ("observed" | "derived")[] | undefined;
382
+ }>, {
383
+ sourceIds?: readonly string[] | undefined;
384
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
385
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
386
+ origins?: readonly ("observed" | "derived")[] | undefined;
387
+ }, {
388
+ sourceIds?: readonly string[] | undefined;
389
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
390
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
391
+ origins?: readonly ("observed" | "derived")[] | undefined;
392
+ }>>;
393
+ }, "strict", z.ZodTypeAny, {
394
+ id: string;
395
+ selector: Readonly<{
396
+ sourceIds?: readonly string[] | undefined;
397
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
398
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
399
+ origins?: readonly ("observed" | "derived")[] | undefined;
400
+ }>;
401
+ }, {
402
+ id: string;
403
+ selector: Readonly<{
404
+ sourceIds?: readonly string[] | undefined;
405
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
406
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
407
+ origins?: readonly ("observed" | "derived")[] | undefined;
408
+ }>;
409
+ }>>, "many">>;
410
+ }, "strict", z.ZodTypeAny, {
411
+ mustConsider: readonly Readonly<{
412
+ id: string;
413
+ selector: Readonly<{
414
+ sourceIds?: readonly string[] | undefined;
415
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
416
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
417
+ origins?: readonly ("observed" | "derived")[] | undefined;
418
+ }>;
419
+ minEvidence: number;
420
+ maxAgeSeconds?: number | undefined;
421
+ }>[];
422
+ mustNotUse: readonly Readonly<{
423
+ id: string;
424
+ selector: Readonly<{
425
+ sourceIds?: readonly string[] | undefined;
426
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
427
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
428
+ origins?: readonly ("observed" | "derived")[] | undefined;
429
+ }>;
430
+ }>[];
431
+ mayConsider?: readonly Readonly<{
432
+ id: string;
433
+ selector: Readonly<{
434
+ sourceIds?: readonly string[] | undefined;
435
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
436
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
437
+ origins?: readonly ("observed" | "derived")[] | undefined;
438
+ }>;
439
+ minEvidence: number;
440
+ maxAgeSeconds?: number | undefined;
441
+ }>[] | undefined;
442
+ }, {
443
+ mustConsider: readonly Readonly<{
444
+ id: string;
445
+ selector: Readonly<{
446
+ sourceIds?: readonly string[] | undefined;
447
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
448
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
449
+ origins?: readonly ("observed" | "derived")[] | undefined;
450
+ }>;
451
+ minEvidence: number;
452
+ maxAgeSeconds?: number | undefined;
453
+ }>[];
454
+ mustNotUse: readonly Readonly<{
455
+ id: string;
456
+ selector: Readonly<{
457
+ sourceIds?: readonly string[] | undefined;
458
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
459
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
460
+ origins?: readonly ("observed" | "derived")[] | undefined;
461
+ }>;
462
+ }>[];
463
+ mayConsider?: readonly Readonly<{
464
+ id: string;
465
+ selector: Readonly<{
466
+ sourceIds?: readonly string[] | undefined;
467
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
468
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
469
+ origins?: readonly ("observed" | "derived")[] | undefined;
470
+ }>;
471
+ minEvidence: number;
472
+ maxAgeSeconds?: number | undefined;
473
+ }>[] | undefined;
474
+ }>, {
475
+ mustConsider: readonly Readonly<{
476
+ id: string;
477
+ selector: Readonly<{
478
+ sourceIds?: readonly string[] | undefined;
479
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
480
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
481
+ origins?: readonly ("observed" | "derived")[] | undefined;
482
+ }>;
483
+ minEvidence: number;
484
+ maxAgeSeconds?: number | undefined;
485
+ }>[];
486
+ mustNotUse: readonly Readonly<{
487
+ id: string;
488
+ selector: Readonly<{
489
+ sourceIds?: readonly string[] | undefined;
490
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
491
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
492
+ origins?: readonly ("observed" | "derived")[] | undefined;
493
+ }>;
494
+ }>[];
495
+ mayConsider?: readonly Readonly<{
496
+ id: string;
497
+ selector: Readonly<{
498
+ sourceIds?: readonly string[] | undefined;
499
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
500
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
501
+ origins?: readonly ("observed" | "derived")[] | undefined;
502
+ }>;
503
+ minEvidence: number;
504
+ maxAgeSeconds?: number | undefined;
505
+ }>[] | undefined;
506
+ }, {
507
+ mustConsider: readonly Readonly<{
508
+ id: string;
509
+ selector: Readonly<{
510
+ sourceIds?: readonly string[] | undefined;
511
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
512
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
513
+ origins?: readonly ("observed" | "derived")[] | undefined;
514
+ }>;
515
+ minEvidence: number;
516
+ maxAgeSeconds?: number | undefined;
517
+ }>[];
518
+ mustNotUse: readonly Readonly<{
519
+ id: string;
520
+ selector: Readonly<{
521
+ sourceIds?: readonly string[] | undefined;
522
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
523
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
524
+ origins?: readonly ("observed" | "derived")[] | undefined;
525
+ }>;
526
+ }>[];
527
+ mayConsider?: readonly Readonly<{
528
+ id: string;
529
+ selector: Readonly<{
530
+ sourceIds?: readonly string[] | undefined;
531
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
532
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
533
+ origins?: readonly ("observed" | "derived")[] | undefined;
534
+ }>;
535
+ minEvidence: number;
536
+ maxAgeSeconds?: number | undefined;
537
+ }>[] | undefined;
538
+ }>>;
539
+ authority: z.ZodReadonly<z.ZodEffects<z.ZodObject<{
540
+ precedence: z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodEnum<["primary", "operational", "approved", "observed", "derived"]>, "many">, ("primary" | "operational" | "approved" | "observed" | "derived")[], ("primary" | "operational" | "approved" | "observed" | "derived")[]>>;
541
+ allowed: z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodEnum<["read", "draft"]>, "many">, ("read" | "draft")[], ("read" | "draft")[]>>;
542
+ forbidden: z.ZodReadonly<z.ZodTuple<[z.ZodLiteral<"send">, z.ZodLiteral<"approve">, z.ZodLiteral<"mutate_source">, z.ZodLiteral<"workflow">], null>>;
543
+ }, "strict", z.ZodTypeAny, {
544
+ precedence: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[];
545
+ allowed: readonly ("read" | "draft")[];
546
+ forbidden: readonly ["send", "approve", "mutate_source", "workflow"];
547
+ }, {
548
+ precedence: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[];
549
+ allowed: readonly ("read" | "draft")[];
550
+ forbidden: readonly ["send", "approve", "mutate_source", "workflow"];
551
+ }>, {
552
+ precedence: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[];
553
+ allowed: readonly ("read" | "draft")[];
554
+ forbidden: readonly ["send", "approve", "mutate_source", "workflow"];
555
+ }, {
556
+ precedence: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[];
557
+ allowed: readonly ("read" | "draft")[];
558
+ forbidden: readonly ["send", "approve", "mutate_source", "workflow"];
559
+ }>>;
560
+ evidence: z.ZodReadonly<z.ZodObject<{
561
+ requireCitation: z.ZodBoolean;
562
+ freshness: z.ZodReadonly<z.ZodObject<{
563
+ defaultMaxAgeSeconds: z.ZodNumber;
564
+ }, "strict", z.ZodTypeAny, {
565
+ defaultMaxAgeSeconds: number;
566
+ }, {
567
+ defaultMaxAgeSeconds: number;
568
+ }>>;
569
+ coverageAssertions: z.ZodEffects<z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>, readonly string[], readonly string[]>;
570
+ }, "strict", z.ZodTypeAny, {
571
+ freshness: Readonly<{
572
+ defaultMaxAgeSeconds: number;
573
+ }>;
574
+ requireCitation: boolean;
575
+ coverageAssertions: readonly string[];
576
+ }, {
577
+ freshness: Readonly<{
578
+ defaultMaxAgeSeconds: number;
579
+ }>;
580
+ requireCitation: boolean;
581
+ coverageAssertions: readonly string[];
582
+ }>>;
583
+ }, "scope"> & {
584
+ scope: z.ZodReadonly<z.ZodObject<{
585
+ installation: z.ZodLiteral<"required">;
586
+ root: z.ZodLiteral<"tenant">;
587
+ descendants: z.ZodReadonly<z.ZodTuple<[z.ZodLiteral<"namespace">, z.ZodLiteral<"subject">, z.ZodLiteral<"session">], null>>;
588
+ }, "strict", z.ZodTypeAny, {
589
+ root: "tenant";
590
+ descendants: readonly ["namespace", "subject", "session"];
591
+ installation: "required";
592
+ }, {
593
+ root: "tenant";
594
+ descendants: readonly ["namespace", "subject", "session"];
595
+ installation: "required";
596
+ }>>;
597
+ installation: z.ZodReadonly<z.ZodObject<{
598
+ mode: z.ZodLiteral<"server_enforced">;
599
+ state: z.ZodEnum<["mounted", "unmounted"]>;
600
+ installationId: z.ZodBranded<z.ZodString, "InstallationId">;
601
+ packDigest: z.ZodBranded<z.ZodString, "Sha256Digest">;
602
+ scopeAuthority: z.ZodReadonly<z.ZodObject<{
603
+ organizationId: z.ZodString;
604
+ tenant: z.ZodString;
605
+ }, "strict", z.ZodTypeAny, {
606
+ tenant: string;
607
+ organizationId: string;
608
+ }, {
609
+ tenant: string;
610
+ organizationId: string;
611
+ }>>;
612
+ sourceBindings: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
613
+ sourceId: z.ZodBranded<z.ZodString, "SourceId">;
614
+ sourceClass: z.ZodEnum<["document", "records", "activity_stream"]>;
615
+ providerRef: z.ZodString;
616
+ connectorRef: z.ZodOptional<z.ZodString>;
617
+ authority: z.ZodEnum<["primary", "operational", "approved", "observed", "derived"]>;
618
+ origin: z.ZodOptional<z.ZodEnum<["observed", "derived"]>>;
619
+ permissionMode: z.ZodEnum<["live", "mirrored", "static", "unsupported"]>;
620
+ operationIds: z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
621
+ }, "strict", z.ZodTypeAny, {
622
+ authority: "primary" | "operational" | "approved" | "observed" | "derived";
623
+ sourceId: string & z.BRAND<"SourceId">;
624
+ sourceClass: "document" | "records" | "activity_stream";
625
+ providerRef: string;
626
+ permissionMode: "live" | "mirrored" | "static" | "unsupported";
627
+ operationIds: readonly string[];
628
+ connectorRef?: string | undefined;
629
+ origin?: "observed" | "derived" | undefined;
630
+ }, {
631
+ authority: "primary" | "operational" | "approved" | "observed" | "derived";
632
+ sourceId: string;
633
+ sourceClass: "document" | "records" | "activity_stream";
634
+ providerRef: string;
635
+ permissionMode: "live" | "mirrored" | "static" | "unsupported";
636
+ operationIds: readonly string[];
637
+ connectorRef?: string | undefined;
638
+ origin?: "observed" | "derived" | undefined;
639
+ }>>, "many">>;
640
+ }, "strict", z.ZodTypeAny, {
641
+ installationId: string & z.BRAND<"InstallationId">;
642
+ scopeAuthority: Readonly<{
643
+ tenant: string;
644
+ organizationId: string;
645
+ }>;
646
+ sourceBindings: readonly Readonly<{
647
+ authority: "primary" | "operational" | "approved" | "observed" | "derived";
648
+ sourceId: string & z.BRAND<"SourceId">;
649
+ sourceClass: "document" | "records" | "activity_stream";
650
+ providerRef: string;
651
+ permissionMode: "live" | "mirrored" | "static" | "unsupported";
652
+ operationIds: readonly string[];
653
+ connectorRef?: string | undefined;
654
+ origin?: "observed" | "derived" | undefined;
655
+ }>[];
656
+ state: "mounted" | "unmounted";
657
+ mode: "server_enforced";
658
+ packDigest: string & z.BRAND<"Sha256Digest">;
659
+ }, {
660
+ installationId: string;
661
+ scopeAuthority: Readonly<{
662
+ tenant: string;
663
+ organizationId: string;
664
+ }>;
665
+ sourceBindings: readonly Readonly<{
666
+ authority: "primary" | "operational" | "approved" | "observed" | "derived";
667
+ sourceId: string;
668
+ sourceClass: "document" | "records" | "activity_stream";
669
+ providerRef: string;
670
+ permissionMode: "live" | "mirrored" | "static" | "unsupported";
671
+ operationIds: readonly string[];
672
+ connectorRef?: string | undefined;
673
+ origin?: "observed" | "derived" | undefined;
674
+ }>[];
675
+ state: "mounted" | "unmounted";
676
+ mode: "server_enforced";
677
+ packDigest: string;
678
+ }>>;
679
+ }, "strict", z.ZodTypeAny, {
680
+ packId: string & z.BRAND<"PackId">;
681
+ version: string & z.BRAND<"SemanticVersion">;
682
+ responsibility: string;
683
+ scope: Readonly<{
684
+ root: "tenant";
685
+ descendants: readonly ["namespace", "subject", "session"];
686
+ installation: "required";
687
+ }>;
688
+ capabilities: readonly Readonly<{
689
+ operationId: string;
690
+ provider: Readonly<{
691
+ kind: "records_operation";
692
+ operationId: string;
693
+ }> | Readonly<{
694
+ kind: "open_connector_action";
695
+ actionId: string;
696
+ connectorRef: string;
697
+ }> | Readonly<{
698
+ kind: "schift_search";
699
+ indexRef: string;
700
+ }> | Readonly<{
701
+ kind: "web_search";
702
+ provider: "customer" | "schift";
703
+ }>;
704
+ inputSchemaRef: string;
705
+ resultSchemaRef: string;
706
+ allowedFilters?: readonly string[] | undefined;
707
+ limits?: Readonly<{
708
+ maxRows?: number | undefined;
709
+ maxResultBytes?: number | undefined;
710
+ }> | undefined;
711
+ freshness?: Readonly<{
712
+ maxAgeSeconds: number;
713
+ }> | undefined;
714
+ requiredProviderScopes?: readonly string[] | undefined;
715
+ }>[];
716
+ contextPolicy: Readonly<{
717
+ mustConsider: readonly Readonly<{
718
+ id: string;
719
+ selector: Readonly<{
720
+ sourceIds?: readonly string[] | undefined;
721
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
722
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
723
+ origins?: readonly ("observed" | "derived")[] | undefined;
724
+ }>;
725
+ minEvidence: number;
726
+ maxAgeSeconds?: number | undefined;
727
+ }>[];
728
+ mustNotUse: readonly Readonly<{
729
+ id: string;
730
+ selector: Readonly<{
731
+ sourceIds?: readonly string[] | undefined;
732
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
733
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
734
+ origins?: readonly ("observed" | "derived")[] | undefined;
735
+ }>;
736
+ }>[];
737
+ mayConsider?: readonly Readonly<{
738
+ id: string;
739
+ selector: Readonly<{
740
+ sourceIds?: readonly string[] | undefined;
741
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
742
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
743
+ origins?: readonly ("observed" | "derived")[] | undefined;
744
+ }>;
745
+ minEvidence: number;
746
+ maxAgeSeconds?: number | undefined;
747
+ }>[] | undefined;
748
+ }>;
749
+ authority: Readonly<{
750
+ precedence: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[];
751
+ allowed: readonly ("read" | "draft")[];
752
+ forbidden: readonly ["send", "approve", "mutate_source", "workflow"];
753
+ }>;
754
+ evidence: Readonly<{
755
+ freshness: Readonly<{
756
+ defaultMaxAgeSeconds: number;
757
+ }>;
758
+ requireCitation: boolean;
759
+ coverageAssertions: readonly string[];
760
+ }>;
761
+ installation: Readonly<{
762
+ installationId: string & z.BRAND<"InstallationId">;
763
+ scopeAuthority: Readonly<{
764
+ tenant: string;
765
+ organizationId: string;
766
+ }>;
767
+ sourceBindings: readonly Readonly<{
768
+ authority: "primary" | "operational" | "approved" | "observed" | "derived";
769
+ sourceId: string & z.BRAND<"SourceId">;
770
+ sourceClass: "document" | "records" | "activity_stream";
771
+ providerRef: string;
772
+ permissionMode: "live" | "mirrored" | "static" | "unsupported";
773
+ operationIds: readonly string[];
774
+ connectorRef?: string | undefined;
775
+ origin?: "observed" | "derived" | undefined;
776
+ }>[];
777
+ state: "mounted" | "unmounted";
778
+ mode: "server_enforced";
779
+ packDigest: string & z.BRAND<"Sha256Digest">;
780
+ }>;
781
+ }, {
782
+ packId: string;
783
+ version: string;
784
+ responsibility: string;
785
+ scope: Readonly<{
786
+ root: "tenant";
787
+ descendants: readonly ["namespace", "subject", "session"];
788
+ installation: "required";
789
+ }>;
790
+ capabilities: readonly Readonly<{
791
+ operationId: string;
792
+ provider: Readonly<{
793
+ kind: "records_operation";
794
+ operationId: string;
795
+ }> | Readonly<{
796
+ kind: "open_connector_action";
797
+ actionId: string;
798
+ connectorRef: string;
799
+ }> | Readonly<{
800
+ kind: "schift_search";
801
+ indexRef: string;
802
+ }> | Readonly<{
803
+ kind: "web_search";
804
+ provider: "customer" | "schift";
805
+ }>;
806
+ inputSchemaRef: string;
807
+ resultSchemaRef: string;
808
+ allowedFilters?: readonly string[] | undefined;
809
+ limits?: Readonly<{
810
+ maxRows?: number | undefined;
811
+ maxResultBytes?: number | undefined;
812
+ }> | undefined;
813
+ freshness?: Readonly<{
814
+ maxAgeSeconds: number;
815
+ }> | undefined;
816
+ requiredProviderScopes?: readonly string[] | undefined;
817
+ }>[];
818
+ contextPolicy: Readonly<{
819
+ mustConsider: readonly Readonly<{
820
+ id: string;
821
+ selector: Readonly<{
822
+ sourceIds?: readonly string[] | undefined;
823
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
824
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
825
+ origins?: readonly ("observed" | "derived")[] | undefined;
826
+ }>;
827
+ minEvidence: number;
828
+ maxAgeSeconds?: number | undefined;
829
+ }>[];
830
+ mustNotUse: readonly Readonly<{
831
+ id: string;
832
+ selector: Readonly<{
833
+ sourceIds?: readonly string[] | undefined;
834
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
835
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
836
+ origins?: readonly ("observed" | "derived")[] | undefined;
837
+ }>;
838
+ }>[];
839
+ mayConsider?: readonly Readonly<{
840
+ id: string;
841
+ selector: Readonly<{
842
+ sourceIds?: readonly string[] | undefined;
843
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
844
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
845
+ origins?: readonly ("observed" | "derived")[] | undefined;
846
+ }>;
847
+ minEvidence: number;
848
+ maxAgeSeconds?: number | undefined;
849
+ }>[] | undefined;
850
+ }>;
851
+ authority: Readonly<{
852
+ precedence: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[];
853
+ allowed: readonly ("read" | "draft")[];
854
+ forbidden: readonly ["send", "approve", "mutate_source", "workflow"];
855
+ }>;
856
+ evidence: Readonly<{
857
+ freshness: Readonly<{
858
+ defaultMaxAgeSeconds: number;
859
+ }>;
860
+ requireCitation: boolean;
861
+ coverageAssertions: readonly string[];
862
+ }>;
863
+ installation: Readonly<{
864
+ installationId: string;
865
+ scopeAuthority: Readonly<{
866
+ tenant: string;
867
+ organizationId: string;
868
+ }>;
869
+ sourceBindings: readonly Readonly<{
870
+ authority: "primary" | "operational" | "approved" | "observed" | "derived";
871
+ sourceId: string;
872
+ sourceClass: "document" | "records" | "activity_stream";
873
+ providerRef: string;
874
+ permissionMode: "live" | "mirrored" | "static" | "unsupported";
875
+ operationIds: readonly string[];
876
+ connectorRef?: string | undefined;
877
+ origin?: "observed" | "derived" | undefined;
878
+ }>[];
879
+ state: "mounted" | "unmounted";
880
+ mode: "server_enforced";
881
+ packDigest: string;
882
+ }>;
883
+ }>, {
884
+ packId: string & z.BRAND<"PackId">;
885
+ version: string & z.BRAND<"SemanticVersion">;
886
+ responsibility: string;
887
+ scope: Readonly<{
888
+ root: "tenant";
889
+ descendants: readonly ["namespace", "subject", "session"];
890
+ installation: "required";
891
+ }>;
892
+ capabilities: readonly Readonly<{
893
+ operationId: string;
894
+ provider: Readonly<{
895
+ kind: "records_operation";
896
+ operationId: string;
897
+ }> | Readonly<{
898
+ kind: "open_connector_action";
899
+ actionId: string;
900
+ connectorRef: string;
901
+ }> | Readonly<{
902
+ kind: "schift_search";
903
+ indexRef: string;
904
+ }> | Readonly<{
905
+ kind: "web_search";
906
+ provider: "customer" | "schift";
907
+ }>;
908
+ inputSchemaRef: string;
909
+ resultSchemaRef: string;
910
+ allowedFilters?: readonly string[] | undefined;
911
+ limits?: Readonly<{
912
+ maxRows?: number | undefined;
913
+ maxResultBytes?: number | undefined;
914
+ }> | undefined;
915
+ freshness?: Readonly<{
916
+ maxAgeSeconds: number;
917
+ }> | undefined;
918
+ requiredProviderScopes?: readonly string[] | undefined;
919
+ }>[];
920
+ contextPolicy: Readonly<{
921
+ mustConsider: readonly Readonly<{
922
+ id: string;
923
+ selector: Readonly<{
924
+ sourceIds?: readonly string[] | undefined;
925
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
926
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
927
+ origins?: readonly ("observed" | "derived")[] | undefined;
928
+ }>;
929
+ minEvidence: number;
930
+ maxAgeSeconds?: number | undefined;
931
+ }>[];
932
+ mustNotUse: readonly Readonly<{
933
+ id: string;
934
+ selector: Readonly<{
935
+ sourceIds?: readonly string[] | undefined;
936
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
937
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
938
+ origins?: readonly ("observed" | "derived")[] | undefined;
939
+ }>;
940
+ }>[];
941
+ mayConsider?: readonly Readonly<{
942
+ id: string;
943
+ selector: Readonly<{
944
+ sourceIds?: readonly string[] | undefined;
945
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
946
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
947
+ origins?: readonly ("observed" | "derived")[] | undefined;
948
+ }>;
949
+ minEvidence: number;
950
+ maxAgeSeconds?: number | undefined;
951
+ }>[] | undefined;
952
+ }>;
953
+ authority: Readonly<{
954
+ precedence: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[];
955
+ allowed: readonly ("read" | "draft")[];
956
+ forbidden: readonly ["send", "approve", "mutate_source", "workflow"];
957
+ }>;
958
+ evidence: Readonly<{
959
+ freshness: Readonly<{
960
+ defaultMaxAgeSeconds: number;
961
+ }>;
962
+ requireCitation: boolean;
963
+ coverageAssertions: readonly string[];
964
+ }>;
965
+ installation: Readonly<{
966
+ installationId: string & z.BRAND<"InstallationId">;
967
+ scopeAuthority: Readonly<{
968
+ tenant: string;
969
+ organizationId: string;
970
+ }>;
971
+ sourceBindings: readonly Readonly<{
972
+ authority: "primary" | "operational" | "approved" | "observed" | "derived";
973
+ sourceId: string & z.BRAND<"SourceId">;
974
+ sourceClass: "document" | "records" | "activity_stream";
975
+ providerRef: string;
976
+ permissionMode: "live" | "mirrored" | "static" | "unsupported";
977
+ operationIds: readonly string[];
978
+ connectorRef?: string | undefined;
979
+ origin?: "observed" | "derived" | undefined;
980
+ }>[];
981
+ state: "mounted" | "unmounted";
982
+ mode: "server_enforced";
983
+ packDigest: string & z.BRAND<"Sha256Digest">;
984
+ }>;
985
+ }, {
986
+ packId: string;
987
+ version: string;
988
+ responsibility: string;
989
+ scope: Readonly<{
990
+ root: "tenant";
991
+ descendants: readonly ["namespace", "subject", "session"];
992
+ installation: "required";
993
+ }>;
994
+ capabilities: readonly Readonly<{
995
+ operationId: string;
996
+ provider: Readonly<{
997
+ kind: "records_operation";
998
+ operationId: string;
999
+ }> | Readonly<{
1000
+ kind: "open_connector_action";
1001
+ actionId: string;
1002
+ connectorRef: string;
1003
+ }> | Readonly<{
1004
+ kind: "schift_search";
1005
+ indexRef: string;
1006
+ }> | Readonly<{
1007
+ kind: "web_search";
1008
+ provider: "customer" | "schift";
1009
+ }>;
1010
+ inputSchemaRef: string;
1011
+ resultSchemaRef: string;
1012
+ allowedFilters?: readonly string[] | undefined;
1013
+ limits?: Readonly<{
1014
+ maxRows?: number | undefined;
1015
+ maxResultBytes?: number | undefined;
1016
+ }> | undefined;
1017
+ freshness?: Readonly<{
1018
+ maxAgeSeconds: number;
1019
+ }> | undefined;
1020
+ requiredProviderScopes?: readonly string[] | undefined;
1021
+ }>[];
1022
+ contextPolicy: Readonly<{
1023
+ mustConsider: readonly Readonly<{
1024
+ id: string;
1025
+ selector: Readonly<{
1026
+ sourceIds?: readonly string[] | undefined;
1027
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
1028
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
1029
+ origins?: readonly ("observed" | "derived")[] | undefined;
1030
+ }>;
1031
+ minEvidence: number;
1032
+ maxAgeSeconds?: number | undefined;
1033
+ }>[];
1034
+ mustNotUse: readonly Readonly<{
1035
+ id: string;
1036
+ selector: Readonly<{
1037
+ sourceIds?: readonly string[] | undefined;
1038
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
1039
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
1040
+ origins?: readonly ("observed" | "derived")[] | undefined;
1041
+ }>;
1042
+ }>[];
1043
+ mayConsider?: readonly Readonly<{
1044
+ id: string;
1045
+ selector: Readonly<{
1046
+ sourceIds?: readonly string[] | undefined;
1047
+ sourceClasses?: readonly ("document" | "records" | "activity_stream")[] | undefined;
1048
+ authorities?: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[] | undefined;
1049
+ origins?: readonly ("observed" | "derived")[] | undefined;
1050
+ }>;
1051
+ minEvidence: number;
1052
+ maxAgeSeconds?: number | undefined;
1053
+ }>[] | undefined;
1054
+ }>;
1055
+ authority: Readonly<{
1056
+ precedence: readonly ("primary" | "operational" | "approved" | "observed" | "derived")[];
1057
+ allowed: readonly ("read" | "draft")[];
1058
+ forbidden: readonly ["send", "approve", "mutate_source", "workflow"];
1059
+ }>;
1060
+ evidence: Readonly<{
1061
+ freshness: Readonly<{
1062
+ defaultMaxAgeSeconds: number;
1063
+ }>;
1064
+ requireCitation: boolean;
1065
+ coverageAssertions: readonly string[];
1066
+ }>;
1067
+ installation: Readonly<{
1068
+ installationId: string;
1069
+ scopeAuthority: Readonly<{
1070
+ tenant: string;
1071
+ organizationId: string;
1072
+ }>;
1073
+ sourceBindings: readonly Readonly<{
1074
+ authority: "primary" | "operational" | "approved" | "observed" | "derived";
1075
+ sourceId: string;
1076
+ sourceClass: "document" | "records" | "activity_stream";
1077
+ providerRef: string;
1078
+ permissionMode: "live" | "mirrored" | "static" | "unsupported";
1079
+ operationIds: readonly string[];
1080
+ connectorRef?: string | undefined;
1081
+ origin?: "observed" | "derived" | undefined;
1082
+ }>[];
1083
+ state: "mounted" | "unmounted";
1084
+ mode: "server_enforced";
1085
+ packDigest: string;
1086
+ }>;
1087
+ }>>;
1088
+ export type KnowledgeScopeMount = z.infer<typeof KnowledgeScopeMountSchema>;
1089
+ export type KnowledgeScopePack = z.infer<typeof KnowledgeScopePackSchema>;
1090
+ export declare class KnowledgeScopeMaterializationError extends Error {
1091
+ readonly code: "incoherent_source_binding";
1092
+ constructor(message: string);
1093
+ }
1094
+ export declare const materializeKnowledgeScopePack: (definition: KnowledgeScopeDefinition, mount: KnowledgeScopeMount) => KnowledgeScopePack;