@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.
- package/LICENSE +202 -0
- package/README.md +387 -0
- package/dist/context-pack.js +4771 -0
- package/dist/index.js +8044 -0
- package/dist/main.js +7550 -0
- package/dist/types/adapters/evidence-policy.d.ts +3 -0
- package/dist/types/adapters/gates.d.ts +13 -0
- package/dist/types/adapters/http-policy.d.ts +10 -0
- package/dist/types/adapters/open-connector.d.ts +20 -0
- package/dist/types/adapters/provider-port.d.ts +27 -0
- package/dist/types/adapters/response.d.ts +12 -0
- package/dist/types/adapters/schift-search-headers.d.ts +2 -0
- package/dist/types/adapters/schift-search-identity.d.ts +14 -0
- package/dist/types/adapters/schift-search.d.ts +17 -0
- package/dist/types/adapters/types.d.ts +136 -0
- package/dist/types/api-contract.d.ts +164 -0
- package/dist/types/api.d.ts +30 -0
- package/dist/types/application-batch.d.ts +4 -0
- package/dist/types/application-execution.d.ts +30 -0
- package/dist/types/application.d.ts +47 -0
- package/dist/types/authorization.d.ts +228 -0
- package/dist/types/cli-options.d.ts +6 -0
- package/dist/types/cli.d.ts +24 -0
- package/dist/types/client-error.d.ts +5 -0
- package/dist/types/client-validation.d.ts +8 -0
- package/dist/types/client.d.ts +18 -0
- package/dist/types/context-pack/bounded-json.d.ts +3 -0
- package/dist/types/context-pack/canonical.d.ts +12 -0
- package/dist/types/context-pack/index.d.ts +73 -0
- package/dist/types/context-pack/knowledge-scope-admission.d.ts +23 -0
- package/dist/types/context-pack/knowledge-scope-batch.d.ts +85 -0
- package/dist/types/context-pack/knowledge-scope-execution.d.ts +297 -0
- package/dist/types/context-pack/knowledge-scope-lock.d.ts +71 -0
- package/dist/types/context-pack/knowledge-scope-mount.d.ts +1094 -0
- package/dist/types/context-pack/knowledge-scope.d.ts +1843 -0
- package/dist/types/context-pack/scalars.d.ts +13 -0
- package/dist/types/doctor-config.d.ts +6 -0
- package/dist/types/doctor.d.ts +7 -0
- package/dist/types/errors.d.ts +8 -0
- package/dist/types/evaluation/contracts.d.ts +718 -0
- package/dist/types/evaluation.d.ts +20 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/json.d.ts +17 -0
- package/dist/types/limits.d.ts +10 -0
- package/dist/types/main.d.ts +10 -0
- package/dist/types/onboarding-config.d.ts +9 -0
- package/dist/types/portable.d.ts +14 -0
- package/dist/types/quickstart.d.ts +10 -0
- package/dist/types/schema-subset.d.ts +9 -0
- package/dist/types/state-contract.d.ts +2867 -0
- package/dist/types/state-store.d.ts +29 -0
- package/docs/PILOT.md +184 -0
- package/examples/batch-consumer.mjs +19 -0
- package/examples/consumer.mjs +17 -0
- package/examples/evaluation/README.md +34 -0
- package/examples/evaluation/run.mjs +21 -0
- package/examples/evaluation/synthetic.json +59 -0
- package/examples/mount-bindings.json +31 -0
- package/examples/support-scope/schemas/query-input.json +6 -0
- package/examples/support-scope/schemas/result-row.json +6 -0
- package/examples/support-scope/scope.json +48 -0
- package/package.json +58 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CapabilityExecutionRequestSchema: z.ZodReadonly<z.ZodObject<{
|
|
3
|
+
installationId: z.ZodBranded<z.ZodString, "InstallationId">;
|
|
4
|
+
operationId: z.ZodString;
|
|
5
|
+
effectiveScope: z.ZodReadonly<z.ZodObject<{
|
|
6
|
+
tenant: z.ZodString;
|
|
7
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
8
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
9
|
+
session: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, "strict", z.ZodTypeAny, {
|
|
11
|
+
tenant: string;
|
|
12
|
+
namespace?: string | undefined;
|
|
13
|
+
subject?: string | undefined;
|
|
14
|
+
session?: string | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
tenant: string;
|
|
17
|
+
namespace?: string | undefined;
|
|
18
|
+
subject?: string | undefined;
|
|
19
|
+
session?: string | undefined;
|
|
20
|
+
}>>;
|
|
21
|
+
input: z.ZodEffects<z.ZodType<import("./canonical.js").JsonValue, z.ZodTypeDef, import("./canonical.js").JsonValue>, import("./canonical.js").JsonValue, import("./canonical.js").JsonValue>;
|
|
22
|
+
filters: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodType<import("./canonical.js").JsonValue, z.ZodTypeDef, import("./canonical.js").JsonValue>, import("./canonical.js").JsonValue, import("./canonical.js").JsonValue>>>>;
|
|
23
|
+
expectedRevision: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
}, "strict", z.ZodTypeAny, {
|
|
25
|
+
operationId: string;
|
|
26
|
+
installationId: string & z.BRAND<"InstallationId">;
|
|
27
|
+
effectiveScope: Readonly<{
|
|
28
|
+
tenant: string;
|
|
29
|
+
namespace?: string | undefined;
|
|
30
|
+
subject?: string | undefined;
|
|
31
|
+
session?: string | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
input: import("./canonical.js").JsonValue;
|
|
34
|
+
filters?: Readonly<Record<string, import("./canonical.js").JsonValue>> | undefined;
|
|
35
|
+
expectedRevision?: number | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
operationId: string;
|
|
38
|
+
installationId: string;
|
|
39
|
+
effectiveScope: Readonly<{
|
|
40
|
+
tenant: string;
|
|
41
|
+
namespace?: string | undefined;
|
|
42
|
+
subject?: string | undefined;
|
|
43
|
+
session?: string | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
input: import("./canonical.js").JsonValue;
|
|
46
|
+
filters?: Readonly<Record<string, import("./canonical.js").JsonValue>> | undefined;
|
|
47
|
+
expectedRevision?: number | undefined;
|
|
48
|
+
}>>;
|
|
49
|
+
export declare const ProviderResultSchema: z.ZodReadonly<z.ZodObject<{
|
|
50
|
+
resultId: z.ZodString;
|
|
51
|
+
srn: z.ZodOptional<z.ZodString>;
|
|
52
|
+
revision: z.ZodString;
|
|
53
|
+
freshness: z.ZodOptional<z.ZodString>;
|
|
54
|
+
payload: z.ZodEffects<z.ZodType<import("./canonical.js").JsonValue, z.ZodTypeDef, import("./canonical.js").JsonValue>, import("./canonical.js").JsonValue, import("./canonical.js").JsonValue>;
|
|
55
|
+
citation: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
56
|
+
uri: z.ZodString;
|
|
57
|
+
label: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, "strict", z.ZodTypeAny, {
|
|
59
|
+
uri: string;
|
|
60
|
+
label?: string | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
uri: string;
|
|
63
|
+
label?: string | undefined;
|
|
64
|
+
}>>>;
|
|
65
|
+
providerScopes: z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
|
|
66
|
+
providerEvidence: z.ZodReadonly<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
67
|
+
kind: z.ZodLiteral<"records_operation">;
|
|
68
|
+
operationId: z.ZodString;
|
|
69
|
+
}, "strict", z.ZodTypeAny, {
|
|
70
|
+
kind: "records_operation";
|
|
71
|
+
operationId: string;
|
|
72
|
+
}, {
|
|
73
|
+
kind: "records_operation";
|
|
74
|
+
operationId: string;
|
|
75
|
+
}>, z.ZodObject<{
|
|
76
|
+
kind: z.ZodLiteral<"open_connector_action">;
|
|
77
|
+
connectorRef: z.ZodString;
|
|
78
|
+
actionId: z.ZodString;
|
|
79
|
+
connectorRunId: z.ZodString;
|
|
80
|
+
actionCorrelationId: z.ZodString;
|
|
81
|
+
auditPersisted: z.ZodBoolean;
|
|
82
|
+
}, "strict", z.ZodTypeAny, {
|
|
83
|
+
kind: "open_connector_action";
|
|
84
|
+
actionId: string;
|
|
85
|
+
connectorRef: string;
|
|
86
|
+
connectorRunId: string;
|
|
87
|
+
actionCorrelationId: string;
|
|
88
|
+
auditPersisted: boolean;
|
|
89
|
+
}, {
|
|
90
|
+
kind: "open_connector_action";
|
|
91
|
+
actionId: string;
|
|
92
|
+
connectorRef: string;
|
|
93
|
+
connectorRunId: string;
|
|
94
|
+
actionCorrelationId: string;
|
|
95
|
+
auditPersisted: boolean;
|
|
96
|
+
}>, z.ZodObject<{
|
|
97
|
+
kind: z.ZodLiteral<"schift_search">;
|
|
98
|
+
indexRef: z.ZodString;
|
|
99
|
+
}, "strict", z.ZodTypeAny, {
|
|
100
|
+
kind: "schift_search";
|
|
101
|
+
indexRef: string;
|
|
102
|
+
}, {
|
|
103
|
+
kind: "schift_search";
|
|
104
|
+
indexRef: string;
|
|
105
|
+
}>, z.ZodObject<{
|
|
106
|
+
kind: z.ZodLiteral<"web_search">;
|
|
107
|
+
provider: z.ZodEnum<["customer", "schift"]>;
|
|
108
|
+
}, "strict", z.ZodTypeAny, {
|
|
109
|
+
kind: "web_search";
|
|
110
|
+
provider: "customer" | "schift";
|
|
111
|
+
}, {
|
|
112
|
+
kind: "web_search";
|
|
113
|
+
provider: "customer" | "schift";
|
|
114
|
+
}>]>>;
|
|
115
|
+
}, "strict", z.ZodTypeAny, {
|
|
116
|
+
revision: string;
|
|
117
|
+
providerScopes: readonly string[];
|
|
118
|
+
providerEvidence: Readonly<{
|
|
119
|
+
kind: "records_operation";
|
|
120
|
+
operationId: string;
|
|
121
|
+
}> | Readonly<{
|
|
122
|
+
kind: "open_connector_action";
|
|
123
|
+
actionId: string;
|
|
124
|
+
connectorRef: string;
|
|
125
|
+
connectorRunId: string;
|
|
126
|
+
actionCorrelationId: string;
|
|
127
|
+
auditPersisted: boolean;
|
|
128
|
+
}> | Readonly<{
|
|
129
|
+
kind: "schift_search";
|
|
130
|
+
indexRef: string;
|
|
131
|
+
}> | Readonly<{
|
|
132
|
+
kind: "web_search";
|
|
133
|
+
provider: "customer" | "schift";
|
|
134
|
+
}>;
|
|
135
|
+
payload: import("./canonical.js").JsonValue;
|
|
136
|
+
resultId: string;
|
|
137
|
+
freshness?: string | undefined;
|
|
138
|
+
srn?: string | undefined;
|
|
139
|
+
citation?: Readonly<{
|
|
140
|
+
uri: string;
|
|
141
|
+
label?: string | undefined;
|
|
142
|
+
}> | undefined;
|
|
143
|
+
}, {
|
|
144
|
+
revision: string;
|
|
145
|
+
providerScopes: readonly string[];
|
|
146
|
+
providerEvidence: Readonly<{
|
|
147
|
+
kind: "records_operation";
|
|
148
|
+
operationId: string;
|
|
149
|
+
}> | Readonly<{
|
|
150
|
+
kind: "open_connector_action";
|
|
151
|
+
actionId: string;
|
|
152
|
+
connectorRef: string;
|
|
153
|
+
connectorRunId: string;
|
|
154
|
+
actionCorrelationId: string;
|
|
155
|
+
auditPersisted: boolean;
|
|
156
|
+
}> | Readonly<{
|
|
157
|
+
kind: "schift_search";
|
|
158
|
+
indexRef: string;
|
|
159
|
+
}> | Readonly<{
|
|
160
|
+
kind: "web_search";
|
|
161
|
+
provider: "customer" | "schift";
|
|
162
|
+
}>;
|
|
163
|
+
payload: import("./canonical.js").JsonValue;
|
|
164
|
+
resultId: string;
|
|
165
|
+
freshness?: string | undefined;
|
|
166
|
+
srn?: string | undefined;
|
|
167
|
+
citation?: Readonly<{
|
|
168
|
+
uri: string;
|
|
169
|
+
label?: string | undefined;
|
|
170
|
+
}> | undefined;
|
|
171
|
+
}>>;
|
|
172
|
+
declare const AdmissionReasonSchema: z.ZodEnum<["installation_not_mounted", "installation_id_mismatch", "definition_digest_mismatch", "mount_revision_mismatch", "authorization_decision_untrusted", "scope_authority_mismatch", "effective_scope_invalid", "source_binding_not_found", "source_class_mismatch", "provider_ref_mismatch", "operation_not_bound", "capability_not_found", "permission_mode_unsupported", "permission_mode_mismatch", "source_authority_not_allowed", "must_not_use", "context_policy_no_match", "provider_scopes_missing", "provider_evidence_mismatch", "connector_ref_mismatch", "connector_action_mismatch", "connector_run_missing", "connector_audit_missing", "citation_required", "freshness_required", "freshness_in_future", "source_stale"]>;
|
|
173
|
+
export declare const CandidateAdmissionReceiptSchema: z.ZodReadonly<z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
|
|
174
|
+
status: z.ZodLiteral<"accepted">;
|
|
175
|
+
candidateSrn: z.ZodString;
|
|
176
|
+
matchedPolicy: z.ZodEnum<["mustConsider", "mayConsider"]>;
|
|
177
|
+
matchedRuleIds: z.ZodReadonly<z.ZodArray<z.ZodString, "many">>;
|
|
178
|
+
authorityRank: z.ZodNumber;
|
|
179
|
+
}, "strict", z.ZodTypeAny, {
|
|
180
|
+
status: "accepted";
|
|
181
|
+
candidateSrn: string;
|
|
182
|
+
matchedPolicy: "mustConsider" | "mayConsider";
|
|
183
|
+
matchedRuleIds: readonly string[];
|
|
184
|
+
authorityRank: number;
|
|
185
|
+
}, {
|
|
186
|
+
status: "accepted";
|
|
187
|
+
candidateSrn: string;
|
|
188
|
+
matchedPolicy: "mustConsider" | "mayConsider";
|
|
189
|
+
matchedRuleIds: readonly string[];
|
|
190
|
+
authorityRank: number;
|
|
191
|
+
}>, z.ZodObject<{
|
|
192
|
+
status: z.ZodLiteral<"denied">;
|
|
193
|
+
candidateSrn: z.ZodString;
|
|
194
|
+
reasonCode: z.ZodEnum<["installation_not_mounted", "installation_id_mismatch", "definition_digest_mismatch", "mount_revision_mismatch", "authorization_decision_untrusted", "scope_authority_mismatch", "effective_scope_invalid", "source_binding_not_found", "source_class_mismatch", "provider_ref_mismatch", "operation_not_bound", "capability_not_found", "permission_mode_unsupported", "permission_mode_mismatch", "source_authority_not_allowed", "must_not_use", "context_policy_no_match", "provider_scopes_missing", "provider_evidence_mismatch", "connector_ref_mismatch", "connector_action_mismatch", "connector_run_missing", "connector_audit_missing", "citation_required", "freshness_required", "freshness_in_future", "source_stale"]>;
|
|
195
|
+
}, "strict", z.ZodTypeAny, {
|
|
196
|
+
status: "denied";
|
|
197
|
+
candidateSrn: string;
|
|
198
|
+
reasonCode: "installation_not_mounted" | "installation_id_mismatch" | "definition_digest_mismatch" | "mount_revision_mismatch" | "authorization_decision_untrusted" | "scope_authority_mismatch" | "effective_scope_invalid" | "source_binding_not_found" | "source_class_mismatch" | "provider_ref_mismatch" | "operation_not_bound" | "capability_not_found" | "permission_mode_unsupported" | "permission_mode_mismatch" | "source_authority_not_allowed" | "must_not_use" | "context_policy_no_match" | "provider_scopes_missing" | "provider_evidence_mismatch" | "connector_ref_mismatch" | "connector_action_mismatch" | "connector_run_missing" | "connector_audit_missing" | "citation_required" | "freshness_required" | "freshness_in_future" | "source_stale";
|
|
199
|
+
}, {
|
|
200
|
+
status: "denied";
|
|
201
|
+
candidateSrn: string;
|
|
202
|
+
reasonCode: "installation_not_mounted" | "installation_id_mismatch" | "definition_digest_mismatch" | "mount_revision_mismatch" | "authorization_decision_untrusted" | "scope_authority_mismatch" | "effective_scope_invalid" | "source_binding_not_found" | "source_class_mismatch" | "provider_ref_mismatch" | "operation_not_bound" | "capability_not_found" | "permission_mode_unsupported" | "permission_mode_mismatch" | "source_authority_not_allowed" | "must_not_use" | "context_policy_no_match" | "provider_scopes_missing" | "provider_evidence_mismatch" | "connector_ref_mismatch" | "connector_action_mismatch" | "connector_run_missing" | "connector_audit_missing" | "citation_required" | "freshness_required" | "freshness_in_future" | "source_stale";
|
|
203
|
+
}>]>>;
|
|
204
|
+
export declare const ScopeRequirementReceiptSchema: z.ZodReadonly<z.ZodObject<{
|
|
205
|
+
status: z.ZodEnum<["ready", "insufficient_evidence"]>;
|
|
206
|
+
requirements: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
207
|
+
requirementId: z.ZodString;
|
|
208
|
+
requiredEvidence: z.ZodNumber;
|
|
209
|
+
observedEvidence: z.ZodNumber;
|
|
210
|
+
satisfied: z.ZodBoolean;
|
|
211
|
+
}, "strict", z.ZodTypeAny, {
|
|
212
|
+
requirementId: string;
|
|
213
|
+
requiredEvidence: number;
|
|
214
|
+
observedEvidence: number;
|
|
215
|
+
satisfied: boolean;
|
|
216
|
+
}, {
|
|
217
|
+
requirementId: string;
|
|
218
|
+
requiredEvidence: number;
|
|
219
|
+
observedEvidence: number;
|
|
220
|
+
satisfied: boolean;
|
|
221
|
+
}>>, "many">>;
|
|
222
|
+
candidateReceipts: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
|
|
223
|
+
status: z.ZodLiteral<"accepted">;
|
|
224
|
+
candidateSrn: z.ZodString;
|
|
225
|
+
matchedPolicy: z.ZodEnum<["mustConsider", "mayConsider"]>;
|
|
226
|
+
matchedRuleIds: z.ZodReadonly<z.ZodArray<z.ZodString, "many">>;
|
|
227
|
+
authorityRank: z.ZodNumber;
|
|
228
|
+
}, "strict", z.ZodTypeAny, {
|
|
229
|
+
status: "accepted";
|
|
230
|
+
candidateSrn: string;
|
|
231
|
+
matchedPolicy: "mustConsider" | "mayConsider";
|
|
232
|
+
matchedRuleIds: readonly string[];
|
|
233
|
+
authorityRank: number;
|
|
234
|
+
}, {
|
|
235
|
+
status: "accepted";
|
|
236
|
+
candidateSrn: string;
|
|
237
|
+
matchedPolicy: "mustConsider" | "mayConsider";
|
|
238
|
+
matchedRuleIds: readonly string[];
|
|
239
|
+
authorityRank: number;
|
|
240
|
+
}>, z.ZodObject<{
|
|
241
|
+
status: z.ZodLiteral<"denied">;
|
|
242
|
+
candidateSrn: z.ZodString;
|
|
243
|
+
reasonCode: z.ZodEnum<["installation_not_mounted", "installation_id_mismatch", "definition_digest_mismatch", "mount_revision_mismatch", "authorization_decision_untrusted", "scope_authority_mismatch", "effective_scope_invalid", "source_binding_not_found", "source_class_mismatch", "provider_ref_mismatch", "operation_not_bound", "capability_not_found", "permission_mode_unsupported", "permission_mode_mismatch", "source_authority_not_allowed", "must_not_use", "context_policy_no_match", "provider_scopes_missing", "provider_evidence_mismatch", "connector_ref_mismatch", "connector_action_mismatch", "connector_run_missing", "connector_audit_missing", "citation_required", "freshness_required", "freshness_in_future", "source_stale"]>;
|
|
244
|
+
}, "strict", z.ZodTypeAny, {
|
|
245
|
+
status: "denied";
|
|
246
|
+
candidateSrn: string;
|
|
247
|
+
reasonCode: "installation_not_mounted" | "installation_id_mismatch" | "definition_digest_mismatch" | "mount_revision_mismatch" | "authorization_decision_untrusted" | "scope_authority_mismatch" | "effective_scope_invalid" | "source_binding_not_found" | "source_class_mismatch" | "provider_ref_mismatch" | "operation_not_bound" | "capability_not_found" | "permission_mode_unsupported" | "permission_mode_mismatch" | "source_authority_not_allowed" | "must_not_use" | "context_policy_no_match" | "provider_scopes_missing" | "provider_evidence_mismatch" | "connector_ref_mismatch" | "connector_action_mismatch" | "connector_run_missing" | "connector_audit_missing" | "citation_required" | "freshness_required" | "freshness_in_future" | "source_stale";
|
|
248
|
+
}, {
|
|
249
|
+
status: "denied";
|
|
250
|
+
candidateSrn: string;
|
|
251
|
+
reasonCode: "installation_not_mounted" | "installation_id_mismatch" | "definition_digest_mismatch" | "mount_revision_mismatch" | "authorization_decision_untrusted" | "scope_authority_mismatch" | "effective_scope_invalid" | "source_binding_not_found" | "source_class_mismatch" | "provider_ref_mismatch" | "operation_not_bound" | "capability_not_found" | "permission_mode_unsupported" | "permission_mode_mismatch" | "source_authority_not_allowed" | "must_not_use" | "context_policy_no_match" | "provider_scopes_missing" | "provider_evidence_mismatch" | "connector_ref_mismatch" | "connector_action_mismatch" | "connector_run_missing" | "connector_audit_missing" | "citation_required" | "freshness_required" | "freshness_in_future" | "source_stale";
|
|
252
|
+
}>]>>, "many">>;
|
|
253
|
+
}, "strict", z.ZodTypeAny, {
|
|
254
|
+
status: "ready" | "insufficient_evidence";
|
|
255
|
+
requirements: readonly Readonly<{
|
|
256
|
+
requirementId: string;
|
|
257
|
+
requiredEvidence: number;
|
|
258
|
+
observedEvidence: number;
|
|
259
|
+
satisfied: boolean;
|
|
260
|
+
}>[];
|
|
261
|
+
candidateReceipts: readonly (Readonly<{
|
|
262
|
+
status: "accepted";
|
|
263
|
+
candidateSrn: string;
|
|
264
|
+
matchedPolicy: "mustConsider" | "mayConsider";
|
|
265
|
+
matchedRuleIds: readonly string[];
|
|
266
|
+
authorityRank: number;
|
|
267
|
+
}> | Readonly<{
|
|
268
|
+
status: "denied";
|
|
269
|
+
candidateSrn: string;
|
|
270
|
+
reasonCode: "installation_not_mounted" | "installation_id_mismatch" | "definition_digest_mismatch" | "mount_revision_mismatch" | "authorization_decision_untrusted" | "scope_authority_mismatch" | "effective_scope_invalid" | "source_binding_not_found" | "source_class_mismatch" | "provider_ref_mismatch" | "operation_not_bound" | "capability_not_found" | "permission_mode_unsupported" | "permission_mode_mismatch" | "source_authority_not_allowed" | "must_not_use" | "context_policy_no_match" | "provider_scopes_missing" | "provider_evidence_mismatch" | "connector_ref_mismatch" | "connector_action_mismatch" | "connector_run_missing" | "connector_audit_missing" | "citation_required" | "freshness_required" | "freshness_in_future" | "source_stale";
|
|
271
|
+
}>)[];
|
|
272
|
+
}, {
|
|
273
|
+
status: "ready" | "insufficient_evidence";
|
|
274
|
+
requirements: readonly Readonly<{
|
|
275
|
+
requirementId: string;
|
|
276
|
+
requiredEvidence: number;
|
|
277
|
+
observedEvidence: number;
|
|
278
|
+
satisfied: boolean;
|
|
279
|
+
}>[];
|
|
280
|
+
candidateReceipts: readonly (Readonly<{
|
|
281
|
+
status: "accepted";
|
|
282
|
+
candidateSrn: string;
|
|
283
|
+
matchedPolicy: "mustConsider" | "mayConsider";
|
|
284
|
+
matchedRuleIds: readonly string[];
|
|
285
|
+
authorityRank: number;
|
|
286
|
+
}> | Readonly<{
|
|
287
|
+
status: "denied";
|
|
288
|
+
candidateSrn: string;
|
|
289
|
+
reasonCode: "installation_not_mounted" | "installation_id_mismatch" | "definition_digest_mismatch" | "mount_revision_mismatch" | "authorization_decision_untrusted" | "scope_authority_mismatch" | "effective_scope_invalid" | "source_binding_not_found" | "source_class_mismatch" | "provider_ref_mismatch" | "operation_not_bound" | "capability_not_found" | "permission_mode_unsupported" | "permission_mode_mismatch" | "source_authority_not_allowed" | "must_not_use" | "context_policy_no_match" | "provider_scopes_missing" | "provider_evidence_mismatch" | "connector_ref_mismatch" | "connector_action_mismatch" | "connector_run_missing" | "connector_audit_missing" | "citation_required" | "freshness_required" | "freshness_in_future" | "source_stale";
|
|
290
|
+
}>)[];
|
|
291
|
+
}>>;
|
|
292
|
+
export type CapabilityExecutionRequest = z.infer<typeof CapabilityExecutionRequestSchema>;
|
|
293
|
+
export type ProviderResult = z.infer<typeof ProviderResultSchema>;
|
|
294
|
+
export type CandidateAdmissionReceipt = z.infer<typeof CandidateAdmissionReceiptSchema>;
|
|
295
|
+
export type ScopeRequirementReceipt = z.infer<typeof ScopeRequirementReceiptSchema>;
|
|
296
|
+
export type AdmissionDenialReason = z.infer<typeof AdmissionReasonSchema>;
|
|
297
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { JsonValue } from "./canonical.js";
|
|
3
|
+
import type { KnowledgeScopeDefinition } from "./knowledge-scope.js";
|
|
4
|
+
import type { Sha256Digest } from "./scalars.js";
|
|
5
|
+
export declare const KnowledgeScopeLockSchema: z.ZodReadonly<z.ZodEffects<z.ZodObject<{
|
|
6
|
+
schemaVersion: z.ZodLiteral<"knowledge-scope-lock.schift.dev/v0.1">;
|
|
7
|
+
packId: z.ZodBranded<z.ZodString, "PackId">;
|
|
8
|
+
version: z.ZodBranded<z.ZodString, "SemanticVersion">;
|
|
9
|
+
definitionDigest: z.ZodBranded<z.ZodString, "Sha256Digest">;
|
|
10
|
+
files: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
11
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
12
|
+
digest: z.ZodBranded<z.ZodString, "Sha256Digest">;
|
|
13
|
+
}, "strict", z.ZodTypeAny, {
|
|
14
|
+
path: string;
|
|
15
|
+
digest: string & z.BRAND<"Sha256Digest">;
|
|
16
|
+
}, {
|
|
17
|
+
path: string;
|
|
18
|
+
digest: string;
|
|
19
|
+
}>>, "many">>;
|
|
20
|
+
} & {
|
|
21
|
+
lockDigest: z.ZodBranded<z.ZodString, "Sha256Digest">;
|
|
22
|
+
}, "strict", z.ZodTypeAny, {
|
|
23
|
+
packId: string & z.BRAND<"PackId">;
|
|
24
|
+
version: string & z.BRAND<"SemanticVersion">;
|
|
25
|
+
definitionDigest: string & z.BRAND<"Sha256Digest">;
|
|
26
|
+
schemaVersion: "knowledge-scope-lock.schift.dev/v0.1";
|
|
27
|
+
files: readonly Readonly<{
|
|
28
|
+
path: string;
|
|
29
|
+
digest: string & z.BRAND<"Sha256Digest">;
|
|
30
|
+
}>[];
|
|
31
|
+
lockDigest: string & z.BRAND<"Sha256Digest">;
|
|
32
|
+
}, {
|
|
33
|
+
packId: string;
|
|
34
|
+
version: string;
|
|
35
|
+
definitionDigest: string;
|
|
36
|
+
schemaVersion: "knowledge-scope-lock.schift.dev/v0.1";
|
|
37
|
+
files: readonly Readonly<{
|
|
38
|
+
path: string;
|
|
39
|
+
digest: string;
|
|
40
|
+
}>[];
|
|
41
|
+
lockDigest: string;
|
|
42
|
+
}>, {
|
|
43
|
+
packId: string & z.BRAND<"PackId">;
|
|
44
|
+
version: string & z.BRAND<"SemanticVersion">;
|
|
45
|
+
definitionDigest: string & z.BRAND<"Sha256Digest">;
|
|
46
|
+
schemaVersion: "knowledge-scope-lock.schift.dev/v0.1";
|
|
47
|
+
files: readonly Readonly<{
|
|
48
|
+
path: string;
|
|
49
|
+
digest: string & z.BRAND<"Sha256Digest">;
|
|
50
|
+
}>[];
|
|
51
|
+
lockDigest: string & z.BRAND<"Sha256Digest">;
|
|
52
|
+
}, {
|
|
53
|
+
packId: string;
|
|
54
|
+
version: string;
|
|
55
|
+
definitionDigest: string;
|
|
56
|
+
schemaVersion: "knowledge-scope-lock.schift.dev/v0.1";
|
|
57
|
+
files: readonly Readonly<{
|
|
58
|
+
path: string;
|
|
59
|
+
digest: string;
|
|
60
|
+
}>[];
|
|
61
|
+
lockDigest: string;
|
|
62
|
+
}>>;
|
|
63
|
+
export type KnowledgeScopeLock = z.infer<typeof KnowledgeScopeLockSchema>;
|
|
64
|
+
export type KnowledgeScopeFileValues = Readonly<Record<string, JsonValue>>;
|
|
65
|
+
export declare class KnowledgeScopeLockError extends Error {
|
|
66
|
+
readonly code: "invalid_file_inventory" | "definition_file_mismatch" | "non_portable_number";
|
|
67
|
+
constructor(code: KnowledgeScopeLockError["code"], message: string);
|
|
68
|
+
}
|
|
69
|
+
export declare const digestKnowledgeScopeDefinition: (definition: KnowledgeScopeDefinition) => Promise<Sha256Digest>;
|
|
70
|
+
export declare const buildKnowledgeScopeLock: (definition: KnowledgeScopeDefinition, files: KnowledgeScopeFileValues) => Promise<KnowledgeScopeLock>;
|
|
71
|
+
export declare const verifyKnowledgeScopeLock: (definition: KnowledgeScopeDefinition, files: KnowledgeScopeFileValues, lock: KnowledgeScopeLock) => Promise<boolean>;
|