@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,228 @@
|
|
|
1
|
+
import { CandidateEnvelopeSchema, type AuthorizationDecision } from "@schift-io/knowledge-scope/context-pack";
|
|
2
|
+
export declare const AuthorizationSubjectSchema: import("zod").ZodReadonly<import("zod").ZodObject<Pick<{
|
|
3
|
+
srn: import("zod").ZodString;
|
|
4
|
+
sourceId: import("zod").ZodBranded<import("zod").ZodString, "SourceId">;
|
|
5
|
+
sourceClass: import("zod").ZodEnum<["document", "records", "activity_stream"]>;
|
|
6
|
+
providerRef: import("zod").ZodString;
|
|
7
|
+
installationId: import("zod").ZodBranded<import("zod").ZodString, "InstallationId">;
|
|
8
|
+
definitionDigest: import("zod").ZodBranded<import("zod").ZodString, "Sha256Digest">;
|
|
9
|
+
mountRevision: import("zod").ZodNumber;
|
|
10
|
+
operationId: import("zod").ZodString;
|
|
11
|
+
scopeAuthority: import("zod").ZodReadonly<import("zod").ZodObject<{
|
|
12
|
+
organizationId: import("zod").ZodString;
|
|
13
|
+
tenant: import("zod").ZodString;
|
|
14
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
15
|
+
tenant: string;
|
|
16
|
+
organizationId: string;
|
|
17
|
+
}, {
|
|
18
|
+
tenant: string;
|
|
19
|
+
organizationId: string;
|
|
20
|
+
}>>;
|
|
21
|
+
effectiveScope: import("zod").ZodReadonly<import("zod").ZodObject<{
|
|
22
|
+
tenant: import("zod").ZodString;
|
|
23
|
+
namespace: import("zod").ZodOptional<import("zod").ZodString>;
|
|
24
|
+
subject: import("zod").ZodOptional<import("zod").ZodString>;
|
|
25
|
+
session: import("zod").ZodOptional<import("zod").ZodString>;
|
|
26
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
27
|
+
tenant: string;
|
|
28
|
+
namespace?: string | undefined;
|
|
29
|
+
subject?: string | undefined;
|
|
30
|
+
session?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
tenant: string;
|
|
33
|
+
namespace?: string | undefined;
|
|
34
|
+
subject?: string | undefined;
|
|
35
|
+
session?: string | undefined;
|
|
36
|
+
}>>;
|
|
37
|
+
authorizationDecision: import("zod").ZodReadonly<import("zod").ZodObject<{
|
|
38
|
+
decisionId: import("zod").ZodString;
|
|
39
|
+
decisionDigest: import("zod").ZodBranded<import("zod").ZodString, "Sha256Digest">;
|
|
40
|
+
status: import("zod").ZodLiteral<"allowed">;
|
|
41
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
42
|
+
status: "allowed";
|
|
43
|
+
decisionId: string;
|
|
44
|
+
decisionDigest: string & import("zod").BRAND<"Sha256Digest">;
|
|
45
|
+
}, {
|
|
46
|
+
status: "allowed";
|
|
47
|
+
decisionId: string;
|
|
48
|
+
decisionDigest: string;
|
|
49
|
+
}>>;
|
|
50
|
+
revision: import("zod").ZodString;
|
|
51
|
+
permission: import("zod").ZodString;
|
|
52
|
+
permissionMode: import("zod").ZodEnum<["live", "mirrored", "static"]>;
|
|
53
|
+
providerScopes: import("zod").ZodReadonly<import("zod").ZodEffects<import("zod").ZodArray<import("zod").ZodString, "many">, string[], string[]>>;
|
|
54
|
+
providerEvidence: import("zod").ZodReadonly<import("zod").ZodDiscriminatedUnion<"kind", [import("zod").ZodObject<{
|
|
55
|
+
kind: import("zod").ZodLiteral<"records_operation">;
|
|
56
|
+
operationId: import("zod").ZodString;
|
|
57
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
58
|
+
kind: "records_operation";
|
|
59
|
+
operationId: string;
|
|
60
|
+
}, {
|
|
61
|
+
kind: "records_operation";
|
|
62
|
+
operationId: string;
|
|
63
|
+
}>, import("zod").ZodObject<{
|
|
64
|
+
kind: import("zod").ZodLiteral<"open_connector_action">;
|
|
65
|
+
connectorRef: import("zod").ZodString;
|
|
66
|
+
actionId: import("zod").ZodString;
|
|
67
|
+
connectorRunId: import("zod").ZodString;
|
|
68
|
+
actionCorrelationId: import("zod").ZodString;
|
|
69
|
+
auditPersisted: import("zod").ZodBoolean;
|
|
70
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
71
|
+
kind: "open_connector_action";
|
|
72
|
+
actionId: string;
|
|
73
|
+
connectorRef: string;
|
|
74
|
+
connectorRunId: string;
|
|
75
|
+
actionCorrelationId: string;
|
|
76
|
+
auditPersisted: boolean;
|
|
77
|
+
}, {
|
|
78
|
+
kind: "open_connector_action";
|
|
79
|
+
actionId: string;
|
|
80
|
+
connectorRef: string;
|
|
81
|
+
connectorRunId: string;
|
|
82
|
+
actionCorrelationId: string;
|
|
83
|
+
auditPersisted: boolean;
|
|
84
|
+
}>, import("zod").ZodObject<{
|
|
85
|
+
kind: import("zod").ZodLiteral<"schift_search">;
|
|
86
|
+
indexRef: import("zod").ZodString;
|
|
87
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
88
|
+
kind: "schift_search";
|
|
89
|
+
indexRef: string;
|
|
90
|
+
}, {
|
|
91
|
+
kind: "schift_search";
|
|
92
|
+
indexRef: string;
|
|
93
|
+
}>, import("zod").ZodObject<{
|
|
94
|
+
kind: import("zod").ZodLiteral<"web_search">;
|
|
95
|
+
provider: import("zod").ZodEnum<["customer", "schift"]>;
|
|
96
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
97
|
+
kind: "web_search";
|
|
98
|
+
provider: "customer" | "schift";
|
|
99
|
+
}, {
|
|
100
|
+
kind: "web_search";
|
|
101
|
+
provider: "customer" | "schift";
|
|
102
|
+
}>]>>;
|
|
103
|
+
freshness: import("zod").ZodOptional<import("zod").ZodString>;
|
|
104
|
+
payload: import("zod").ZodEffects<import("zod").ZodType<import("@schift-io/knowledge-scope/context-pack").JsonValue, import("zod").ZodTypeDef, import("@schift-io/knowledge-scope/context-pack").JsonValue>, import("@schift-io/knowledge-scope/context-pack").JsonValue, import("@schift-io/knowledge-scope/context-pack").JsonValue>;
|
|
105
|
+
citation: import("zod").ZodOptional<import("zod").ZodReadonly<import("zod").ZodObject<{
|
|
106
|
+
uri: import("zod").ZodString;
|
|
107
|
+
label: import("zod").ZodOptional<import("zod").ZodString>;
|
|
108
|
+
}, "strict", import("zod").ZodTypeAny, {
|
|
109
|
+
uri: string;
|
|
110
|
+
label?: string | undefined;
|
|
111
|
+
}, {
|
|
112
|
+
uri: string;
|
|
113
|
+
label?: string | undefined;
|
|
114
|
+
}>>>;
|
|
115
|
+
}, "operationId" | "srn" | "sourceId" | "sourceClass" | "providerRef" | "installationId" | "definitionDigest" | "mountRevision" | "scopeAuthority" | "effectiveScope" | "revision" | "permission" | "permissionMode" | "providerScopes" | "providerEvidence" | "payload" | "freshness" | "citation">, "strict", import("zod").ZodTypeAny, {
|
|
116
|
+
operationId: string;
|
|
117
|
+
srn: string;
|
|
118
|
+
sourceId: string & import("zod").BRAND<"SourceId">;
|
|
119
|
+
sourceClass: "document" | "records" | "activity_stream";
|
|
120
|
+
providerRef: string;
|
|
121
|
+
installationId: string & import("zod").BRAND<"InstallationId">;
|
|
122
|
+
definitionDigest: string & import("zod").BRAND<"Sha256Digest">;
|
|
123
|
+
mountRevision: number;
|
|
124
|
+
scopeAuthority: Readonly<{
|
|
125
|
+
tenant: string;
|
|
126
|
+
organizationId: string;
|
|
127
|
+
}>;
|
|
128
|
+
effectiveScope: Readonly<{
|
|
129
|
+
tenant: string;
|
|
130
|
+
namespace?: string | undefined;
|
|
131
|
+
subject?: string | undefined;
|
|
132
|
+
session?: string | undefined;
|
|
133
|
+
}>;
|
|
134
|
+
revision: string;
|
|
135
|
+
permission: string;
|
|
136
|
+
permissionMode: "live" | "mirrored" | "static";
|
|
137
|
+
providerScopes: readonly string[];
|
|
138
|
+
providerEvidence: Readonly<{
|
|
139
|
+
kind: "records_operation";
|
|
140
|
+
operationId: string;
|
|
141
|
+
}> | Readonly<{
|
|
142
|
+
kind: "open_connector_action";
|
|
143
|
+
actionId: string;
|
|
144
|
+
connectorRef: string;
|
|
145
|
+
connectorRunId: string;
|
|
146
|
+
actionCorrelationId: string;
|
|
147
|
+
auditPersisted: boolean;
|
|
148
|
+
}> | Readonly<{
|
|
149
|
+
kind: "schift_search";
|
|
150
|
+
indexRef: string;
|
|
151
|
+
}> | Readonly<{
|
|
152
|
+
kind: "web_search";
|
|
153
|
+
provider: "customer" | "schift";
|
|
154
|
+
}>;
|
|
155
|
+
payload: import("@schift-io/knowledge-scope/context-pack").JsonValue;
|
|
156
|
+
freshness?: string | undefined;
|
|
157
|
+
citation?: Readonly<{
|
|
158
|
+
uri: string;
|
|
159
|
+
label?: string | undefined;
|
|
160
|
+
}> | undefined;
|
|
161
|
+
}, {
|
|
162
|
+
operationId: string;
|
|
163
|
+
srn: string;
|
|
164
|
+
sourceId: string;
|
|
165
|
+
sourceClass: "document" | "records" | "activity_stream";
|
|
166
|
+
providerRef: string;
|
|
167
|
+
installationId: string;
|
|
168
|
+
definitionDigest: string;
|
|
169
|
+
mountRevision: number;
|
|
170
|
+
scopeAuthority: Readonly<{
|
|
171
|
+
tenant: string;
|
|
172
|
+
organizationId: string;
|
|
173
|
+
}>;
|
|
174
|
+
effectiveScope: Readonly<{
|
|
175
|
+
tenant: string;
|
|
176
|
+
namespace?: string | undefined;
|
|
177
|
+
subject?: string | undefined;
|
|
178
|
+
session?: string | undefined;
|
|
179
|
+
}>;
|
|
180
|
+
revision: string;
|
|
181
|
+
permission: string;
|
|
182
|
+
permissionMode: "live" | "mirrored" | "static";
|
|
183
|
+
providerScopes: readonly string[];
|
|
184
|
+
providerEvidence: Readonly<{
|
|
185
|
+
kind: "records_operation";
|
|
186
|
+
operationId: string;
|
|
187
|
+
}> | Readonly<{
|
|
188
|
+
kind: "open_connector_action";
|
|
189
|
+
actionId: string;
|
|
190
|
+
connectorRef: string;
|
|
191
|
+
connectorRunId: string;
|
|
192
|
+
actionCorrelationId: string;
|
|
193
|
+
auditPersisted: boolean;
|
|
194
|
+
}> | Readonly<{
|
|
195
|
+
kind: "schift_search";
|
|
196
|
+
indexRef: string;
|
|
197
|
+
}> | Readonly<{
|
|
198
|
+
kind: "web_search";
|
|
199
|
+
provider: "customer" | "schift";
|
|
200
|
+
}>;
|
|
201
|
+
payload: import("@schift-io/knowledge-scope/context-pack").JsonValue;
|
|
202
|
+
freshness?: string | undefined;
|
|
203
|
+
citation?: Readonly<{
|
|
204
|
+
uri: string;
|
|
205
|
+
label?: string | undefined;
|
|
206
|
+
}> | undefined;
|
|
207
|
+
}>>;
|
|
208
|
+
export type AuthorizationSubject = typeof AuthorizationSubjectSchema._output;
|
|
209
|
+
export declare const authorizationSubjectFromCandidate: (candidate: typeof CandidateEnvelopeSchema._output) => AuthorizationSubject;
|
|
210
|
+
export type KnowledgeScopeAuthorizationOptions = Readonly<{
|
|
211
|
+
home?: string;
|
|
212
|
+
environment?: Readonly<Record<string, string | undefined>>;
|
|
213
|
+
faults?: AuthorizationFaults;
|
|
214
|
+
}>;
|
|
215
|
+
export interface AuthorizationFaults {
|
|
216
|
+
beforeInstall(): Promise<void>;
|
|
217
|
+
}
|
|
218
|
+
export declare class KnowledgeScopeAuthorization {
|
|
219
|
+
private readonly home;
|
|
220
|
+
private readonly keyPath;
|
|
221
|
+
private readonly faults;
|
|
222
|
+
constructor(options?: KnowledgeScopeAuthorizationOptions);
|
|
223
|
+
issue(subject: AuthorizationSubject): Promise<AuthorizationDecision>;
|
|
224
|
+
verify(subject: AuthorizationSubject, decision: AuthorizationDecision): Promise<boolean>;
|
|
225
|
+
private digest;
|
|
226
|
+
private readOrCreateKey;
|
|
227
|
+
private installKeyIfAbsent;
|
|
228
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type KnowledgeScopeApplicationPort, type MountApplicationRequest, type ServedKnowledgeScopeApi } from "./api.js";
|
|
2
|
+
import { type JsonValue } from "./json.js";
|
|
3
|
+
import { type OnboardingEnvironment } from "./onboarding-config.js";
|
|
4
|
+
export type PortableAuthoringPort = Readonly<{
|
|
5
|
+
validate: (directory: string) => Promise<JsonValue>;
|
|
6
|
+
lock: (directory: string) => Promise<JsonValue>;
|
|
7
|
+
mountPayload: (directory: string, bindingsPath: string) => Promise<MountApplicationRequest>;
|
|
8
|
+
}>;
|
|
9
|
+
export type CliDependencies = Readonly<{
|
|
10
|
+
environment?: OnboardingEnvironment;
|
|
11
|
+
authoring: PortableAuthoringPort;
|
|
12
|
+
embedded: KnowledgeScopeApplicationPort;
|
|
13
|
+
remote: (apiUrl: string) => KnowledgeScopeApplicationPort;
|
|
14
|
+
serve: (options: Readonly<{
|
|
15
|
+
host: string;
|
|
16
|
+
port: number;
|
|
17
|
+
}>) => Promise<Pick<ServedKnowledgeScopeApi, "host" | "port">>;
|
|
18
|
+
readJson: (path: string) => Promise<JsonValue>;
|
|
19
|
+
}>;
|
|
20
|
+
export type CliStreams = Readonly<{
|
|
21
|
+
stdout: (line: string) => void;
|
|
22
|
+
stderr: (line: string) => void;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const runKnowledgeScopeCli: (argv: readonly string[], dependencies: CliDependencies, streams: CliStreams) => Promise<number>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare class KnowledgeScopeClientError extends Error {
|
|
2
|
+
readonly code: "request_invalid" | "response_invalid" | "identity_mismatch" | "batch_unsupported";
|
|
3
|
+
readonly name = "KnowledgeScopeClientError";
|
|
4
|
+
constructor(code: "request_invalid" | "response_invalid" | "identity_mismatch" | "batch_unsupported");
|
|
5
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CandidateEnvelope, ScopeRequirementReceipt } from "@schift-io/knowledge-scope/context-pack";
|
|
2
|
+
import type { KnowledgeScopeInspection } from "./application.js";
|
|
3
|
+
export declare const validateClientReceipt: (receipt: ScopeRequirementReceipt, inspection: KnowledgeScopeInspection) => void;
|
|
4
|
+
export declare const validateClientCandidates: (input: Readonly<{
|
|
5
|
+
inspection: KnowledgeScopeInspection;
|
|
6
|
+
candidates: readonly CandidateEnvelope[];
|
|
7
|
+
receipt: ScopeRequirementReceipt;
|
|
8
|
+
}>) => void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ScopeRequirementReceiptSchema } from "@schift-io/knowledge-scope/context-pack";
|
|
3
|
+
import type { KnowledgeScopeApplicationPort, RunApplicationRequest, RunBatchApplicationRequest } from "./api.js";
|
|
4
|
+
import type { KnowledgeScopeInspection, KnowledgeScopeRunResult } from "./application.js";
|
|
5
|
+
export { KnowledgeScopeClientError } from "./client-error.js";
|
|
6
|
+
export type KnowledgeScopeClient = Readonly<{
|
|
7
|
+
inspect: (installationId: string) => Promise<KnowledgeScopeInspection>;
|
|
8
|
+
run: (request: RunApplicationRequest) => Promise<KnowledgeScopeRunResult>;
|
|
9
|
+
runBatch: (request: RunBatchApplicationRequest) => Promise<KnowledgeScopeRunResult>;
|
|
10
|
+
admit: (request: Readonly<{
|
|
11
|
+
installationId: string;
|
|
12
|
+
candidates: readonly unknown[];
|
|
13
|
+
}>) => Promise<z.infer<typeof ScopeRequirementReceiptSchema>>;
|
|
14
|
+
}>;
|
|
15
|
+
/** The injected application owns authorization; this boundary checks wire integrity, not its HMAC key. */
|
|
16
|
+
export declare const createKnowledgeScopeClient: (options: Readonly<{
|
|
17
|
+
application: KnowledgeScopeApplicationPort;
|
|
18
|
+
}>) => KnowledgeScopeClient;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Sha256Digest } from "./scalars.js";
|
|
2
|
+
export type JsonPrimitive = boolean | number | string | null;
|
|
3
|
+
export type JsonValue = JsonPrimitive | readonly JsonValue[] | JsonObject;
|
|
4
|
+
export type JsonObject = {
|
|
5
|
+
readonly [key: string]: JsonValue;
|
|
6
|
+
};
|
|
7
|
+
export declare class CanonicalJsonError extends Error {
|
|
8
|
+
readonly value: JsonValue;
|
|
9
|
+
constructor(message: string, value: JsonValue);
|
|
10
|
+
}
|
|
11
|
+
export declare const canonicalJson: (value: JsonValue) => string;
|
|
12
|
+
export declare const digestCanonicalJson: (value: JsonValue) => Promise<Sha256Digest>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export {
|
|
2
|
+
InstallationIdSchema,
|
|
3
|
+
PackIdSchema,
|
|
4
|
+
RevisionIdSchema,
|
|
5
|
+
SemanticVersionSchema,
|
|
6
|
+
Sha256DigestSchema,
|
|
7
|
+
SourceIdSchema,
|
|
8
|
+
} from "./scalars.js";
|
|
9
|
+
export type {
|
|
10
|
+
InstallationId,
|
|
11
|
+
PackId,
|
|
12
|
+
RevisionId,
|
|
13
|
+
SemanticVersion,
|
|
14
|
+
Sha256Digest,
|
|
15
|
+
SourceId,
|
|
16
|
+
} from "./scalars.js";
|
|
17
|
+
export { CanonicalJsonError, canonicalJson, digestCanonicalJson } from "./canonical.js";
|
|
18
|
+
export type { JsonObject, JsonPrimitive, JsonValue } from "./canonical.js";
|
|
19
|
+
export {
|
|
20
|
+
AuthorizationDecisionSchema,
|
|
21
|
+
CandidateEnvelopeSchema,
|
|
22
|
+
CitationSchema,
|
|
23
|
+
EffectiveScopeSchema,
|
|
24
|
+
KnowledgeScopeDefinitionSchema,
|
|
25
|
+
QueryCapabilitySchema,
|
|
26
|
+
QueryProviderSchema,
|
|
27
|
+
ScopeAuthoritySchema,
|
|
28
|
+
} from "./knowledge-scope.js";
|
|
29
|
+
export type {
|
|
30
|
+
AuthorizationDecision,
|
|
31
|
+
CandidateEnvelope,
|
|
32
|
+
KnowledgeScopeDefinition,
|
|
33
|
+
QueryCapability,
|
|
34
|
+
QueryProvider,
|
|
35
|
+
} from "./knowledge-scope.js";
|
|
36
|
+
export {
|
|
37
|
+
KnowledgeScopeMountSchema,
|
|
38
|
+
KnowledgeScopePackSchema,
|
|
39
|
+
materializeKnowledgeScopePack,
|
|
40
|
+
} from "./knowledge-scope-mount.js";
|
|
41
|
+
export type { KnowledgeScopeMount, KnowledgeScopePack } from "./knowledge-scope-mount.js";
|
|
42
|
+
export {
|
|
43
|
+
KnowledgeScopeLockSchema,
|
|
44
|
+
buildKnowledgeScopeLock,
|
|
45
|
+
digestKnowledgeScopeDefinition,
|
|
46
|
+
verifyKnowledgeScopeLock,
|
|
47
|
+
} from "./knowledge-scope-lock.js";
|
|
48
|
+
export type { KnowledgeScopeLock } from "./knowledge-scope-lock.js";
|
|
49
|
+
export {
|
|
50
|
+
CandidateAdmissionReceiptSchema,
|
|
51
|
+
CapabilityExecutionRequestSchema,
|
|
52
|
+
ProviderResultSchema,
|
|
53
|
+
ScopeRequirementReceiptSchema,
|
|
54
|
+
} from "./knowledge-scope-execution.js";
|
|
55
|
+
export type {
|
|
56
|
+
AdmissionDenialReason,
|
|
57
|
+
CandidateAdmissionReceipt,
|
|
58
|
+
CapabilityExecutionRequest,
|
|
59
|
+
ProviderResult,
|
|
60
|
+
ScopeRequirementReceipt,
|
|
61
|
+
} from "./knowledge-scope-execution.js";
|
|
62
|
+
export { CapabilityBatchOperationSchema, CapabilityBatchExecutionRequestSchema } from "./knowledge-scope-batch.js";
|
|
63
|
+
export type { CapabilityBatchOperation, CapabilityBatchExecutionRequest } from "./knowledge-scope-batch.js";
|
|
64
|
+
export {
|
|
65
|
+
ADMISSION_DENIAL_REASONS,
|
|
66
|
+
admitKnowledgeScopeCandidate,
|
|
67
|
+
admitKnowledgeScopeCandidates,
|
|
68
|
+
} from "./knowledge-scope-admission.js";
|
|
69
|
+
export type {
|
|
70
|
+
AdmissionResult,
|
|
71
|
+
KnowledgeScopeAdmissionInput,
|
|
72
|
+
KnowledgeScopeBatchAdmissionInput,
|
|
73
|
+
} from "./knowledge-scope-admission.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CandidateAdmissionReceipt, ScopeRequirementReceipt } from "./knowledge-scope-execution.js";
|
|
2
|
+
import type { KnowledgeScopeMount } from "./knowledge-scope-mount.js";
|
|
3
|
+
import type { AuthorizationDecision, CandidateEnvelope, KnowledgeScopeDefinition } from "./knowledge-scope.js";
|
|
4
|
+
export declare const ADMISSION_DENIAL_REASONS: readonly ["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"];
|
|
5
|
+
export type KnowledgeScopeAdmissionInput = Readonly<{
|
|
6
|
+
definition: KnowledgeScopeDefinition;
|
|
7
|
+
mount: KnowledgeScopeMount;
|
|
8
|
+
candidate: CandidateEnvelope;
|
|
9
|
+
evaluatedAt: Date;
|
|
10
|
+
trustedAuthorizationDecision: AuthorizationDecision;
|
|
11
|
+
}>;
|
|
12
|
+
export type KnowledgeScopeBatchAdmissionInput = Readonly<{
|
|
13
|
+
definition: KnowledgeScopeDefinition;
|
|
14
|
+
mount: KnowledgeScopeMount;
|
|
15
|
+
candidates: readonly Readonly<{
|
|
16
|
+
candidate: CandidateEnvelope;
|
|
17
|
+
trustedAuthorizationDecision: AuthorizationDecision;
|
|
18
|
+
}>[];
|
|
19
|
+
evaluatedAt: Date;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const admitKnowledgeScopeCandidate: (input: KnowledgeScopeAdmissionInput) => CandidateAdmissionReceipt;
|
|
22
|
+
export declare const admitKnowledgeScopeCandidates: (input: KnowledgeScopeBatchAdmissionInput) => ScopeRequirementReceipt;
|
|
23
|
+
export type AdmissionResult = CandidateAdmissionReceipt;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CapabilityBatchOperationSchema: z.ZodReadonly<z.ZodObject<{
|
|
3
|
+
operationId: z.ZodString;
|
|
4
|
+
input: z.ZodEffects<z.ZodType<import("./canonical.js").JsonValue, z.ZodTypeDef, import("./canonical.js").JsonValue>, import("./canonical.js").JsonValue, import("./canonical.js").JsonValue>;
|
|
5
|
+
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>>>>;
|
|
6
|
+
}, "strict", z.ZodTypeAny, {
|
|
7
|
+
operationId: string;
|
|
8
|
+
input: import("./canonical.js").JsonValue;
|
|
9
|
+
filters?: Readonly<Record<string, import("./canonical.js").JsonValue>> | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
operationId: string;
|
|
12
|
+
input: import("./canonical.js").JsonValue;
|
|
13
|
+
filters?: Readonly<Record<string, import("./canonical.js").JsonValue>> | undefined;
|
|
14
|
+
}>>;
|
|
15
|
+
export declare const CapabilityBatchExecutionRequestSchema: z.ZodReadonly<z.ZodObject<{
|
|
16
|
+
installationId: z.ZodBranded<z.ZodString, "InstallationId">;
|
|
17
|
+
effectiveScope: z.ZodReadonly<z.ZodObject<{
|
|
18
|
+
tenant: z.ZodString;
|
|
19
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
20
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
21
|
+
session: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, "strict", z.ZodTypeAny, {
|
|
23
|
+
tenant: string;
|
|
24
|
+
namespace?: string | undefined;
|
|
25
|
+
subject?: string | undefined;
|
|
26
|
+
session?: string | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
tenant: string;
|
|
29
|
+
namespace?: string | undefined;
|
|
30
|
+
subject?: string | undefined;
|
|
31
|
+
session?: string | undefined;
|
|
32
|
+
}>>;
|
|
33
|
+
expectedRevision: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
operations: z.ZodReadonly<z.ZodEffects<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
35
|
+
operationId: z.ZodString;
|
|
36
|
+
input: z.ZodEffects<z.ZodType<import("./canonical.js").JsonValue, z.ZodTypeDef, import("./canonical.js").JsonValue>, import("./canonical.js").JsonValue, import("./canonical.js").JsonValue>;
|
|
37
|
+
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>>>>;
|
|
38
|
+
}, "strict", z.ZodTypeAny, {
|
|
39
|
+
operationId: string;
|
|
40
|
+
input: import("./canonical.js").JsonValue;
|
|
41
|
+
filters?: Readonly<Record<string, import("./canonical.js").JsonValue>> | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
operationId: string;
|
|
44
|
+
input: import("./canonical.js").JsonValue;
|
|
45
|
+
filters?: Readonly<Record<string, import("./canonical.js").JsonValue>> | undefined;
|
|
46
|
+
}>>, "many">, Readonly<{
|
|
47
|
+
operationId: string;
|
|
48
|
+
input: import("./canonical.js").JsonValue;
|
|
49
|
+
filters?: Readonly<Record<string, import("./canonical.js").JsonValue>> | undefined;
|
|
50
|
+
}>[], Readonly<{
|
|
51
|
+
operationId: string;
|
|
52
|
+
input: import("./canonical.js").JsonValue;
|
|
53
|
+
filters?: Readonly<Record<string, import("./canonical.js").JsonValue>> | undefined;
|
|
54
|
+
}>[]>>;
|
|
55
|
+
}, "strict", z.ZodTypeAny, {
|
|
56
|
+
installationId: string & z.BRAND<"InstallationId">;
|
|
57
|
+
effectiveScope: Readonly<{
|
|
58
|
+
tenant: string;
|
|
59
|
+
namespace?: string | undefined;
|
|
60
|
+
subject?: string | undefined;
|
|
61
|
+
session?: string | undefined;
|
|
62
|
+
}>;
|
|
63
|
+
operations: readonly Readonly<{
|
|
64
|
+
operationId: string;
|
|
65
|
+
input: import("./canonical.js").JsonValue;
|
|
66
|
+
filters?: Readonly<Record<string, import("./canonical.js").JsonValue>> | undefined;
|
|
67
|
+
}>[];
|
|
68
|
+
expectedRevision?: number | undefined;
|
|
69
|
+
}, {
|
|
70
|
+
installationId: string;
|
|
71
|
+
effectiveScope: Readonly<{
|
|
72
|
+
tenant: string;
|
|
73
|
+
namespace?: string | undefined;
|
|
74
|
+
subject?: string | undefined;
|
|
75
|
+
session?: string | undefined;
|
|
76
|
+
}>;
|
|
77
|
+
operations: readonly Readonly<{
|
|
78
|
+
operationId: string;
|
|
79
|
+
input: import("./canonical.js").JsonValue;
|
|
80
|
+
filters?: Readonly<Record<string, import("./canonical.js").JsonValue>> | undefined;
|
|
81
|
+
}>[];
|
|
82
|
+
expectedRevision?: number | undefined;
|
|
83
|
+
}>>;
|
|
84
|
+
export type CapabilityBatchOperation = z.infer<typeof CapabilityBatchOperationSchema>;
|
|
85
|
+
export type CapabilityBatchExecutionRequest = z.infer<typeof CapabilityBatchExecutionRequestSchema>;
|