@native-knowledge/knowledge-sdk 0.0.0-stage → 0.1.0-rc.1
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 +21 -0
- package/README.md +46 -2
- package/dist/index.js +6577 -0
- package/dist/types/contracts/artifact.d.ts +120 -0
- package/dist/types/contracts/collection-control.d.ts +160 -0
- package/dist/types/contracts/collection.d.ts +263 -0
- package/dist/types/contracts/common.d.ts +17 -0
- package/dist/types/contracts/currentness.d.ts +477 -0
- package/dist/types/contracts/event.d.ts +60 -0
- package/dist/types/contracts/evidence.d.ts +202 -0
- package/dist/types/contracts/index.d.ts +55 -0
- package/dist/types/contracts/material-capability.d.ts +88 -0
- package/dist/types/contracts/material-carrier.d.ts +104 -0
- package/dist/types/contracts/material-context.d.ts +28 -0
- package/dist/types/contracts/material-read.d.ts +152 -0
- package/dist/types/contracts/observation.d.ts +75 -0
- package/dist/types/contracts/persistence.d.ts +370 -0
- package/dist/types/contracts/project-intent.d.ts +218 -0
- package/dist/types/contracts/projection.d.ts +380 -0
- package/dist/types/contracts/public-reference.d.ts +237 -0
- package/dist/types/contracts/reference-record.d.ts +124 -0
- package/dist/types/contracts/remote-file.d.ts +128 -0
- package/dist/types/contracts/resource-scope.d.ts +40 -0
- package/dist/types/contracts/resource-transfer.d.ts +24 -0
- package/dist/types/contracts/review-packet.d.ts +274 -0
- package/dist/types/contracts/review-plane.d.ts +90 -0
- package/dist/types/contracts/rich-document.d.ts +641 -0
- package/dist/types/contracts/runtime-compatibility.d.ts +22 -0
- package/dist/types/contracts/runtime.d.ts +59 -0
- package/dist/types/contracts/scheduler.d.ts +348 -0
- package/dist/types/contracts/signal.d.ts +113 -0
- package/dist/types/contracts/source-governance.d.ts +375 -0
- package/dist/types/contracts/source.d.ts +62 -0
- package/dist/types/contracts/tenant-budget.d.ts +59 -0
- package/dist/types/contracts/tenant-collection-request.d.ts +209 -0
- package/dist/types/contracts/tenant-collection.d.ts +199 -0
- package/dist/types/contracts/tenant-currentness.d.ts +117 -0
- package/dist/types/contracts/tenant-management.d.ts +286 -0
- package/dist/types/contracts/tenant-material-api.d.ts +584 -0
- package/dist/types/contracts/tenant-pdf-text.d.ts +27 -0
- package/dist/types/contracts/tenant-project-control.d.ts +94 -0
- package/dist/types/contracts/tenant-public-reference.d.ts +179 -0
- package/dist/types/contracts/tenant-resource-api.d.ts +738 -0
- package/dist/types/contracts/tenant-resource.d.ts +298 -0
- package/dist/types/contracts/tenant-rich-document.d.ts +317 -0
- package/dist/types/contracts/tenant-source-binding.d.ts +44 -0
- package/dist/types/contracts/tenant-source-bridge.d.ts +70 -0
- package/dist/types/contracts/tenant-source-cutover.d.ts +226 -0
- package/dist/types/contracts/tenant-source-document.d.ts +163 -0
- package/dist/types/contracts/tenant-source-lease.d.ts +1 -0
- package/dist/types/contracts/tenant-source.d.ts +223 -0
- package/dist/types/contracts/tenant-web-collection.d.ts +287 -0
- package/dist/types/contracts/tenant-web-content-plan.d.ts +86 -0
- package/dist/types/contracts/tenant-web-content-result.d.ts +63 -0
- package/dist/types/contracts/tenant-web-content.d.ts +383 -0
- package/dist/types/contracts/tenant-web-crawl.d.ts +310 -0
- package/dist/types/contracts/tenant-web-dynamic.d.ts +698 -0
- package/dist/types/contracts/tenant-web-results.d.ts +66 -0
- package/dist/types/contracts/tenant-web-workflow.d.ts +494 -0
- package/dist/types/sdk/agent-entry.d.ts +291 -0
- package/dist/types/sdk/agent-guidance-error.d.ts +15 -0
- package/dist/types/sdk/index.d.ts +289 -0
- package/dist/types/sdk/material-stream.d.ts +18 -0
- package/dist/types/sdk/oauth.d.ts +268 -0
- package/dist/types/sdk/resource-integrity.d.ts +21 -0
- package/dist/types/sdk/resource.d.ts +88 -0
- package/dist/types/sdk/tenant-management.d.ts +240 -0
- package/dist/types/sdk/tenant-project.d.ts +57 -0
- package/dist/types/sdk/tenant-runtime.d.ts +174 -0
- package/dist/types/sdk/tenant-web-content.d.ts +44 -0
- package/dist/types/sdk/tenant-web-crawl.d.ts +42 -0
- package/dist/types/sdk/tenant-web-dynamic.d.ts +42 -0
- package/dist/types/sdk/tenant-web-workflow.d.ts +43 -0
- package/dist/types/sdk/tenant-web.d.ts +42 -0
- package/dist/types/sdk/tenant-workspace.d.ts +36 -0
- package/dist/types/sdk/transport.d.ts +16 -0
- package/dist/types/serving-contracts/agent-catalog.d.ts +70 -0
- package/dist/types/serving-contracts/agent-entry.d.ts +13148 -0
- package/dist/types/serving-contracts/agent-guidance-shapes.d.ts +263 -0
- package/dist/types/serving-contracts/agent-input-hints.d.ts +24 -0
- package/dist/types/serving-contracts/body-search.d.ts +231 -0
- package/dist/types/serving-contracts/consumer.d.ts +989 -0
- package/dist/types/serving-contracts/core.d.ts +333 -0
- package/dist/types/serving-contracts/http.d.ts +2874 -0
- package/dist/types/serving-contracts/index.d.ts +23 -0
- package/dist/types/serving-contracts/management.d.ts +424 -0
- package/dist/types/serving-contracts/material-capabilities.d.ts +508 -0
- package/dist/types/serving-contracts/material-index-status.d.ts +55 -0
- package/dist/types/serving-contracts/mcp.d.ts +2218 -0
- package/dist/types/serving-contracts/tenant-governance.d.ts +236 -0
- package/dist/types/serving-contracts/tenant-management.d.ts +6276 -0
- package/dist/types/serving-contracts/tenant-project.d.ts +7550 -0
- package/dist/types/serving-contracts/tenant-runtime.d.ts +9674 -0
- package/dist/types/serving-contracts/tenant-web-content.d.ts +4606 -0
- package/dist/types/serving-contracts/tenant-web-crawl.d.ts +2958 -0
- package/dist/types/serving-contracts/tenant-web-dynamic.d.ts +3902 -0
- package/dist/types/serving-contracts/tenant-web-workflow.d.ts +5750 -0
- package/dist/types/serving-contracts/tenant-web.d.ts +6418 -0
- package/dist/types/serving-contracts/tenant-workspace.d.ts +6451 -0
- package/dist/types/serving-contracts/workflow.d.ts +439 -0
- package/package.json +34 -4
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { type SdkTransportOptions } from './transport.js';
|
|
2
|
+
import { type MaterialStreamOptions } from './material-stream.js';
|
|
3
|
+
import { type KnowledgeMcpProviderContractV12 } from '../serving-contracts/index.js';
|
|
4
|
+
import { type KnowledgeMcpProviderContractV11, type MaterialOutboxWindow, type KnowledgeMcpProviderContractV3, type KnowledgeMcpProviderContractV6, type KnowledgeMcpProviderContractV7, type KnowledgeMcpProviderContractV8, type KnowledgeMcpProviderContractV9, type KnowledgeMcpProviderContractV10, type OAuthMaterialPageResponse, type OAuthMaterialRoutePageResponse, type OAuthMaterialPartitionsResponse, type OAuthMaterialPartitionPageResponse, type OAuthMaterialPresentationResponse, type ServingDecision } from '../serving-contracts/index.js';
|
|
5
|
+
export interface KnowledgeOAuthFileClientOptions extends SdkTransportOptions {
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
token: string;
|
|
8
|
+
projectRef: string;
|
|
9
|
+
fetchImpl?: typeof fetch;
|
|
10
|
+
allowInsecureHttp?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface OAuthFileDescriptor {
|
|
13
|
+
contentHash: string;
|
|
14
|
+
mediaType: string;
|
|
15
|
+
byteLength: number;
|
|
16
|
+
}
|
|
17
|
+
export type OAuthFileResult = {
|
|
18
|
+
decision: ServingDecision;
|
|
19
|
+
descriptor: OAuthFileDescriptor;
|
|
20
|
+
content: Buffer;
|
|
21
|
+
} | {
|
|
22
|
+
decision: ServingDecision;
|
|
23
|
+
error: string;
|
|
24
|
+
};
|
|
25
|
+
export declare class KnowledgeOAuthFileClient {
|
|
26
|
+
private readonly limits;
|
|
27
|
+
readonly projectRef: string;
|
|
28
|
+
private readonly root;
|
|
29
|
+
private readonly token;
|
|
30
|
+
private readonly fetchImpl;
|
|
31
|
+
private providerPromise;
|
|
32
|
+
private materialProviderPromise;
|
|
33
|
+
private agentMaterialProviderPromise;
|
|
34
|
+
private searchMaterialProviderPromise;
|
|
35
|
+
private routeMaterialProviderPromise;
|
|
36
|
+
private syncMaterialProviderPromise;
|
|
37
|
+
private capabilityProviderPromise;
|
|
38
|
+
private partitionMaterialProviderPromise;
|
|
39
|
+
constructor(options: KnowledgeOAuthFileClientOptions);
|
|
40
|
+
/** 公开 v3 元数据无需凭据;读取失败时清除缓存以便下次重试。 */
|
|
41
|
+
discover(): Promise<KnowledgeMcpProviderContractV3>;
|
|
42
|
+
discoverMaterials(): Promise<KnowledgeMcpProviderContractV6>;
|
|
43
|
+
/** Explicit v7 Agent discovery leaves the stable v6 HTTP file contract untouched. */
|
|
44
|
+
discoverAgentMaterials(): Promise<KnowledgeMcpProviderContractV7>;
|
|
45
|
+
/** v8 only describes the bounded descriptive index; result coverage is reported per query. */
|
|
46
|
+
discoverSearchMaterials(): Promise<KnowledgeMcpProviderContractV8>;
|
|
47
|
+
discoverRouteMaterials(): Promise<KnowledgeMcpProviderContractV9>;
|
|
48
|
+
discoverPartitionedMaterials(): Promise<KnowledgeMcpProviderContractV10>;
|
|
49
|
+
discoverMaterialSync(): Promise<KnowledgeMcpProviderContractV11>;
|
|
50
|
+
discoverMaterialCapabilities(): Promise<KnowledgeMcpProviderContractV12>;
|
|
51
|
+
private capabilityGet;
|
|
52
|
+
getMaterialCapabilities(ref: string): Promise<{
|
|
53
|
+
schemaVersion: 2;
|
|
54
|
+
projectKey: string;
|
|
55
|
+
material: {
|
|
56
|
+
item: {
|
|
57
|
+
ref: string;
|
|
58
|
+
resourceType: string;
|
|
59
|
+
sourceProjectKey: string;
|
|
60
|
+
identityHash: string;
|
|
61
|
+
kind: string;
|
|
62
|
+
classification: "PUBLIC" | "PUBLIC_METADATA" | "TENANT" | "INTERNAL" | "FDE_INTERNAL" | "ACCESS_CONTROLLED" | "UNKNOWN";
|
|
63
|
+
mediaType: string;
|
|
64
|
+
decision: {
|
|
65
|
+
schemaVersion: 1;
|
|
66
|
+
action: "ALLOW" | "DENY";
|
|
67
|
+
reasonCodes: ("UNAVAILABLE" | "INTEGRITY_MISMATCH" | "NOT_FOUND" | "CONTENT_ACCESS_DENIED" | "UNSUPPORTED_RESOURCE")[];
|
|
68
|
+
assessedAt: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
materialAccess: {
|
|
72
|
+
schemaVersion: 1;
|
|
73
|
+
action: "ALLOW" | "DENY";
|
|
74
|
+
reasonCodes: ("UNAVAILABLE" | "INTEGRITY_MISMATCH" | "NOT_FOUND" | "CONTENT_ACCESS_DENIED" | "UNSUPPORTED_RESOURCE")[];
|
|
75
|
+
assessedAt: string;
|
|
76
|
+
};
|
|
77
|
+
representation: {
|
|
78
|
+
state: "MISSING" | "UNSUPPORTED" | "INTEGRITY_MISMATCH" | "READY" | "DENIED";
|
|
79
|
+
format: "JSON" | "BYTES";
|
|
80
|
+
transfer: "UNSUPPORTED" | "VERIFIED_STREAM" | "BUFFERED_JSON";
|
|
81
|
+
contentHash: string | null;
|
|
82
|
+
mediaType: string;
|
|
83
|
+
byteLength: number | null;
|
|
84
|
+
methods: ("HEAD" | "GET")[];
|
|
85
|
+
range: "NONE" | "SINGLE";
|
|
86
|
+
verification: "ON_READ";
|
|
87
|
+
verificationChunkBytes: number | null;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
projectRef: string;
|
|
91
|
+
}>;
|
|
92
|
+
pageMaterialCapabilities(options?: {
|
|
93
|
+
limit?: number;
|
|
94
|
+
after?: string;
|
|
95
|
+
resourceType?: string;
|
|
96
|
+
sourceProjectKey?: string;
|
|
97
|
+
refPrefix?: string;
|
|
98
|
+
}): Promise<{
|
|
99
|
+
schemaVersion: 2;
|
|
100
|
+
projectKey: string;
|
|
101
|
+
items: {
|
|
102
|
+
item: {
|
|
103
|
+
ref: string;
|
|
104
|
+
resourceType: string;
|
|
105
|
+
sourceProjectKey: string;
|
|
106
|
+
identityHash: string;
|
|
107
|
+
kind: string;
|
|
108
|
+
classification: "PUBLIC" | "PUBLIC_METADATA" | "TENANT" | "INTERNAL" | "FDE_INTERNAL" | "ACCESS_CONTROLLED" | "UNKNOWN";
|
|
109
|
+
mediaType: string;
|
|
110
|
+
decision: {
|
|
111
|
+
schemaVersion: 1;
|
|
112
|
+
action: "ALLOW" | "DENY";
|
|
113
|
+
reasonCodes: ("UNAVAILABLE" | "INTEGRITY_MISMATCH" | "NOT_FOUND" | "CONTENT_ACCESS_DENIED" | "UNSUPPORTED_RESOURCE")[];
|
|
114
|
+
assessedAt: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
materialAccess: {
|
|
118
|
+
schemaVersion: 1;
|
|
119
|
+
action: "ALLOW" | "DENY";
|
|
120
|
+
reasonCodes: ("UNAVAILABLE" | "INTEGRITY_MISMATCH" | "NOT_FOUND" | "CONTENT_ACCESS_DENIED" | "UNSUPPORTED_RESOURCE")[];
|
|
121
|
+
assessedAt: string;
|
|
122
|
+
};
|
|
123
|
+
representation: {
|
|
124
|
+
state: "MISSING" | "UNSUPPORTED" | "INTEGRITY_MISMATCH" | "READY" | "DENIED";
|
|
125
|
+
format: "JSON" | "BYTES";
|
|
126
|
+
transfer: "UNSUPPORTED" | "VERIFIED_STREAM" | "BUFFERED_JSON";
|
|
127
|
+
contentHash: string | null;
|
|
128
|
+
mediaType: string;
|
|
129
|
+
byteLength: number | null;
|
|
130
|
+
methods: ("HEAD" | "GET")[];
|
|
131
|
+
range: "NONE" | "SINGLE";
|
|
132
|
+
verification: "ON_READ";
|
|
133
|
+
verificationChunkBytes: number | null;
|
|
134
|
+
};
|
|
135
|
+
}[];
|
|
136
|
+
nextAfter: string | null;
|
|
137
|
+
projectRef: string;
|
|
138
|
+
}>;
|
|
139
|
+
pageMaterialMedia(ref: string, options?: {
|
|
140
|
+
afterOrdinal?: number;
|
|
141
|
+
limit?: number;
|
|
142
|
+
documentRef?: string;
|
|
143
|
+
}): Promise<{
|
|
144
|
+
schemaVersion: 2;
|
|
145
|
+
projectKey: string;
|
|
146
|
+
ref: string;
|
|
147
|
+
sourceContentHash: string;
|
|
148
|
+
documentRef: string | null;
|
|
149
|
+
documentContentHash: string | null;
|
|
150
|
+
state: "MISSING" | "UNSUPPORTED" | "INTEGRITY_MISMATCH" | "READY" | "DENIED";
|
|
151
|
+
items: {
|
|
152
|
+
ordinal: number;
|
|
153
|
+
kind: "IMAGE" | "AUDIO" | "VIDEO";
|
|
154
|
+
sourceUrl: string;
|
|
155
|
+
canonicalUrl: string | null;
|
|
156
|
+
availability: "UNAVAILABLE" | "MIRRORED" | "REMOTE_ONLY";
|
|
157
|
+
mediaRef: string | null;
|
|
158
|
+
contentHash: string | null;
|
|
159
|
+
mediaType: string | null;
|
|
160
|
+
byteLength: number | null;
|
|
161
|
+
state: "MISSING" | "UNAVAILABLE" | "INTEGRITY_MISMATCH" | "READY" | "DENIED" | "REMOTE_ONLY";
|
|
162
|
+
representation: {
|
|
163
|
+
state: "MISSING" | "UNSUPPORTED" | "INTEGRITY_MISMATCH" | "READY" | "DENIED";
|
|
164
|
+
format: "JSON" | "BYTES";
|
|
165
|
+
transfer: "UNSUPPORTED" | "VERIFIED_STREAM" | "BUFFERED_JSON";
|
|
166
|
+
contentHash: string | null;
|
|
167
|
+
mediaType: string;
|
|
168
|
+
byteLength: number | null;
|
|
169
|
+
methods: ("HEAD" | "GET")[];
|
|
170
|
+
range: "NONE" | "SINGLE";
|
|
171
|
+
verification: "ON_READ";
|
|
172
|
+
verificationChunkBytes: number | null;
|
|
173
|
+
} | null;
|
|
174
|
+
}[];
|
|
175
|
+
nextAfterOrdinal: number | null;
|
|
176
|
+
projectRef: string;
|
|
177
|
+
}>;
|
|
178
|
+
getMaterialIndexStatus(options?: {
|
|
179
|
+
afterSourceKey?: string;
|
|
180
|
+
afterNodeId?: string;
|
|
181
|
+
sourceProjectKey?: string;
|
|
182
|
+
limit?: number;
|
|
183
|
+
}): Promise<{
|
|
184
|
+
schemaVersion: 2;
|
|
185
|
+
projectKey: string;
|
|
186
|
+
queryCoverage: "DESCRIPTIVE_METADATA_V1";
|
|
187
|
+
indexedFields: ["TITLE", "SUMMARY"];
|
|
188
|
+
bodyIndexed: false;
|
|
189
|
+
semanticIndexed: false;
|
|
190
|
+
items: {
|
|
191
|
+
sourceProjectKey: string;
|
|
192
|
+
nodeId: string;
|
|
193
|
+
directoryThroughSeq: number;
|
|
194
|
+
searchThroughSeq: number | null;
|
|
195
|
+
observedMaxSeq: number | null;
|
|
196
|
+
checkpointUpdatedAt: string | null;
|
|
197
|
+
state: "PARTIAL_BACKFILL" | "SYNCED_AS_OF_CHECKPOINT";
|
|
198
|
+
}[];
|
|
199
|
+
nextAfter: {
|
|
200
|
+
sourceProjectKey: string;
|
|
201
|
+
nodeId: string;
|
|
202
|
+
} | null;
|
|
203
|
+
projectRef: string;
|
|
204
|
+
}>;
|
|
205
|
+
openMaterialStream(ref: string, options?: MaterialStreamOptions): Promise<import("./material-stream.js").MaterialStreamResponse>;
|
|
206
|
+
getMaterialOutboxWindow(): Promise<MaterialOutboxWindow>;
|
|
207
|
+
private partitionGet;
|
|
208
|
+
pageMaterialPartitions(options?: {
|
|
209
|
+
afterRouteId?: string;
|
|
210
|
+
limit?: number;
|
|
211
|
+
}): Promise<OAuthMaterialPartitionsResponse>;
|
|
212
|
+
pageMaterialPartition(partition: 'OWNER' | 'LEGACY', options?: {
|
|
213
|
+
after?: string;
|
|
214
|
+
limit?: number;
|
|
215
|
+
}): Promise<OAuthMaterialPartitionPageResponse>;
|
|
216
|
+
searchMaterials(query: string, options?: {
|
|
217
|
+
afterId?: number;
|
|
218
|
+
limit?: number;
|
|
219
|
+
resourceType?: string;
|
|
220
|
+
sourceProjectKey?: string;
|
|
221
|
+
}): Promise<{
|
|
222
|
+
schemaVersion: 1;
|
|
223
|
+
projectRef: string;
|
|
224
|
+
queryCoverage: "DESCRIPTIVE_METADATA_V1";
|
|
225
|
+
order: "INDEX_ROWID_ASC";
|
|
226
|
+
indexState: "PARTIAL_BACKFILL" | "SYNCED_AS_OF_LAST_OBSERVATION";
|
|
227
|
+
configuredSourceCount: number;
|
|
228
|
+
items: {
|
|
229
|
+
item: {
|
|
230
|
+
ref: string;
|
|
231
|
+
resourceType: string;
|
|
232
|
+
sourceProjectKey: string;
|
|
233
|
+
identityHash: string;
|
|
234
|
+
kind: string;
|
|
235
|
+
classification: "PUBLIC" | "PUBLIC_METADATA" | "TENANT" | "INTERNAL" | "FDE_INTERNAL" | "ACCESS_CONTROLLED" | "UNKNOWN";
|
|
236
|
+
mediaType: string;
|
|
237
|
+
decision: {
|
|
238
|
+
schemaVersion: 1;
|
|
239
|
+
action: "ALLOW" | "DENY";
|
|
240
|
+
reasonCodes: ("UNAVAILABLE" | "INTEGRITY_MISMATCH" | "NOT_FOUND" | "CONTENT_ACCESS_DENIED" | "UNSUPPORTED_RESOURCE")[];
|
|
241
|
+
assessedAt: string;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
title: string;
|
|
245
|
+
summary: string;
|
|
246
|
+
}[];
|
|
247
|
+
nextAfterId: number | null;
|
|
248
|
+
}>;
|
|
249
|
+
pageMaterials(resourceType: 'all' | 'artifact' | 'evidence' | 'reference', options?: {
|
|
250
|
+
after?: string;
|
|
251
|
+
limit?: number;
|
|
252
|
+
}): Promise<OAuthMaterialPageResponse>;
|
|
253
|
+
pageAllMaterials(options?: {
|
|
254
|
+
after?: string;
|
|
255
|
+
limit?: number;
|
|
256
|
+
}): Promise<OAuthMaterialPageResponse>;
|
|
257
|
+
pageRouteMaterials(routeId: string, options?: {
|
|
258
|
+
after?: string;
|
|
259
|
+
limit?: number;
|
|
260
|
+
}): Promise<OAuthMaterialRoutePageResponse>;
|
|
261
|
+
getMaterialPresentation(ref: string): Promise<OAuthMaterialPresentationResponse>;
|
|
262
|
+
getMaterial(ref: string, expected?: OAuthFileDescriptor): Promise<OAuthFileResult>;
|
|
263
|
+
private read;
|
|
264
|
+
getContent(ref: string, expected?: OAuthFileDescriptor): Promise<OAuthFileResult>;
|
|
265
|
+
/** 原始 Evidence 文件只代表已采集证据,不自动获得知识审核或 currentness 许可。 */
|
|
266
|
+
getEvidenceFile(ref: string, expected?: OAuthFileDescriptor): Promise<OAuthFileResult>;
|
|
267
|
+
getMedia(ref: string, expected?: OAuthFileDescriptor): Promise<OAuthFileResult>;
|
|
268
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ResourceToolName } from '../contracts/index.js';
|
|
2
|
+
export declare const contentHash: (bytes: Uint8Array | string) => string;
|
|
3
|
+
export declare function transferBinding(response: Response): {
|
|
4
|
+
schemaVersion: 1;
|
|
5
|
+
context: {
|
|
6
|
+
type: "TENANT";
|
|
7
|
+
tenantId: string;
|
|
8
|
+
tenantRef: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: "PROJECT";
|
|
11
|
+
tenantId: string;
|
|
12
|
+
projectKey: string;
|
|
13
|
+
projectRef: string;
|
|
14
|
+
};
|
|
15
|
+
policy: "LEGACY_PROJECT" | "TENANT_NATIVE" | "TENANT_PROJECT_SCOPE";
|
|
16
|
+
refHash: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function resourceIntegrity(name: ResourceToolName, input: {
|
|
19
|
+
ref?: string | undefined;
|
|
20
|
+
projectRef?: string | undefined;
|
|
21
|
+
}, raw: unknown): void;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/** Provider 16 客户端:Tenant 默认,Project 仅为显式收窄;正文复用既有有界流合同。 */
|
|
2
|
+
import { resourceToolSchemas, resourceDataSchemas, type ResourceToolName, type MaterialContext, type MaterialAuthorityPolicy } from '../contracts/index.js';
|
|
3
|
+
import { type SdkTransportOptions } from './transport.js';
|
|
4
|
+
import { type MaterialStreamOptions } from './material-stream.js';
|
|
5
|
+
type SharedOptions = SdkTransportOptions & {
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
token: string;
|
|
8
|
+
fetchImpl?: typeof fetch;
|
|
9
|
+
allowInsecureHttp?: boolean;
|
|
10
|
+
expectedTenantId?: string;
|
|
11
|
+
};
|
|
12
|
+
export type KnowledgeResourceClientOptions = SharedOptions & ({
|
|
13
|
+
authentication: 'API_KEY';
|
|
14
|
+
tenantId: string;
|
|
15
|
+
} | {
|
|
16
|
+
authentication?: 'OAUTH';
|
|
17
|
+
tenantId?: never;
|
|
18
|
+
});
|
|
19
|
+
export type ResourceToolInput<K extends ResourceToolName> = ReturnType<(typeof resourceToolSchemas)[K]['parse']>;
|
|
20
|
+
export type ResourceToolResponse<K extends ResourceToolName> = {
|
|
21
|
+
schemaVersion: 2;
|
|
22
|
+
context: MaterialContext;
|
|
23
|
+
policy: MaterialAuthorityPolicy;
|
|
24
|
+
data: ReturnType<(typeof resourceDataSchemas)[K]['parse']>;
|
|
25
|
+
};
|
|
26
|
+
export declare class ResourceSdkError extends Error {
|
|
27
|
+
readonly code: string;
|
|
28
|
+
readonly status: number;
|
|
29
|
+
readonly recovery: 'CAPTURE_WINDOW_AND_REBOOTSTRAP' | null;
|
|
30
|
+
constructor(code: string, status: number);
|
|
31
|
+
}
|
|
32
|
+
export declare class KnowledgeResourceClient {
|
|
33
|
+
private readonly options;
|
|
34
|
+
private readonly limits;
|
|
35
|
+
private readonly root;
|
|
36
|
+
private readonly basePath;
|
|
37
|
+
private readonly fetchImpl;
|
|
38
|
+
constructor(options: KnowledgeResourceClientOptions);
|
|
39
|
+
private url;
|
|
40
|
+
private request;
|
|
41
|
+
private json;
|
|
42
|
+
private context;
|
|
43
|
+
tool<K extends ResourceToolName>(name: K, raw: ResourceToolInput<K>): Promise<ResourceToolResponse<K>>;
|
|
44
|
+
contract(projectRef?: string): Promise<{
|
|
45
|
+
schemaVersion: 2;
|
|
46
|
+
context: {
|
|
47
|
+
type: "TENANT";
|
|
48
|
+
tenantId: string;
|
|
49
|
+
tenantRef: string;
|
|
50
|
+
} | {
|
|
51
|
+
type: "PROJECT";
|
|
52
|
+
tenantId: string;
|
|
53
|
+
projectKey: string;
|
|
54
|
+
projectRef: string;
|
|
55
|
+
};
|
|
56
|
+
policy: "LEGACY_PROJECT" | "TENANT_NATIVE" | "TENANT_PROJECT_SCOPE";
|
|
57
|
+
capabilities: ["TENANT_RESOURCE_V1", "TENANT_AUTHORITY_V1"];
|
|
58
|
+
callEndpoint: string;
|
|
59
|
+
fileEndpoint: string;
|
|
60
|
+
tools: string[];
|
|
61
|
+
inlineMaxBytes: 32768;
|
|
62
|
+
readBufferMaxBytes: 16777216;
|
|
63
|
+
fileMethods: ["GET", "HEAD", "POST"];
|
|
64
|
+
verificationChunkBytes: 65536;
|
|
65
|
+
requestMaxBytes: 131072;
|
|
66
|
+
resultMaxBytes: 524288;
|
|
67
|
+
}>;
|
|
68
|
+
list(input?: ResourceToolInput<'knowledge_resource_list'>): Promise<ResourceToolResponse<"knowledge_resource_list">>;
|
|
69
|
+
describe(ref: string, input?: {
|
|
70
|
+
projectRef?: string;
|
|
71
|
+
}): Promise<ResourceToolResponse<"knowledge_resource_describe">>;
|
|
72
|
+
read(ref: string, input?: {
|
|
73
|
+
projectRef?: string;
|
|
74
|
+
}): Promise<ResourceToolResponse<"knowledge_resource_read">>;
|
|
75
|
+
capabilities(ref: string, input?: {
|
|
76
|
+
projectRef?: string;
|
|
77
|
+
}): Promise<ResourceToolResponse<"knowledge_resource_capabilities">>;
|
|
78
|
+
search(query: string, input?: Omit<ResourceToolInput<'knowledge_resource_search'>, 'query'>): Promise<ResourceToolResponse<"knowledge_resource_search">>;
|
|
79
|
+
window(input?: ResourceToolInput<'knowledge_resource_window'>): Promise<ResourceToolResponse<"knowledge_resource_window">>;
|
|
80
|
+
changes(input?: ResourceToolInput<'knowledge_resource_changes'>): Promise<ResourceToolResponse<"knowledge_resource_changes">>;
|
|
81
|
+
counts(input?: ResourceToolInput<'knowledge_resource_counts'>): Promise<ResourceToolResponse<"knowledge_resource_counts">>;
|
|
82
|
+
indexStatus(input?: ResourceToolInput<'knowledge_resource_index_status'>): Promise<ResourceToolResponse<"knowledge_resource_index_status">>;
|
|
83
|
+
media(ref: string, input?: Omit<ResourceToolInput<'knowledge_resource_media'>, 'ref'>): Promise<ResourceToolResponse<"knowledge_resource_media">>;
|
|
84
|
+
stream(ref: string, options?: MaterialStreamOptions & {
|
|
85
|
+
projectRef?: string;
|
|
86
|
+
}): Promise<import("./material-stream.js").MaterialStreamResponse>;
|
|
87
|
+
}
|
|
88
|
+
export {};
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { type SdkTransportOptions } from './transport.js';
|
|
2
|
+
import { tenantManagementErrorSchema, type TenantManagementToolName, type TenantManagementToolInput, type TenantManagementToolResponse } from '../serving-contracts/index.js';
|
|
3
|
+
import { type MaterialStreamOptions } from './material-stream.js';
|
|
4
|
+
type Failure = ReturnType<typeof tenantManagementErrorSchema.parse>;
|
|
5
|
+
export interface KnowledgeTenantManagementClientOptions extends SdkTransportOptions {
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
token: string;
|
|
8
|
+
expectedTenantId: string;
|
|
9
|
+
allowInsecureHttp?: boolean;
|
|
10
|
+
fetchImpl?: typeof fetch;
|
|
11
|
+
}
|
|
12
|
+
export declare class TenantManagementSdkError<Phase extends string = NonNullable<Failure['completedPhase']>> extends Error {
|
|
13
|
+
readonly code: string;
|
|
14
|
+
readonly status: number;
|
|
15
|
+
readonly completedPhase: Phase | undefined;
|
|
16
|
+
readonly ref: string | undefined;
|
|
17
|
+
constructor(code: string, status: number, details?: {
|
|
18
|
+
completedPhase?: Phase | undefined;
|
|
19
|
+
ref?: string | undefined;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export declare class KnowledgeTenantManagementClient {
|
|
23
|
+
protected readonly options: KnowledgeTenantManagementClientOptions;
|
|
24
|
+
private readonly limits;
|
|
25
|
+
private readonly root;
|
|
26
|
+
private readonly path;
|
|
27
|
+
private readonly fetchImpl;
|
|
28
|
+
constructor(options: KnowledgeTenantManagementClientOptions);
|
|
29
|
+
protected protocolVersion(): 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26;
|
|
30
|
+
protected url(operation: 'provider' | 'call' | 'content', version?: 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26): import("url").URL;
|
|
31
|
+
protected request(url: URL, init?: RequestInit): Promise<Response>;
|
|
32
|
+
protected failure(raw: unknown, status: number): TenantManagementSdkError<string> | null;
|
|
33
|
+
protected json(response: Response): Promise<unknown>;
|
|
34
|
+
tool<K extends TenantManagementToolName>(name: K, raw: TenantManagementToolInput<K>, options?: {
|
|
35
|
+
signal?: AbortSignal;
|
|
36
|
+
}): Promise<TenantManagementToolResponse<K>>;
|
|
37
|
+
provider(): Promise<{
|
|
38
|
+
schemaVersion: 17;
|
|
39
|
+
provider: "knowledge-v2";
|
|
40
|
+
codeRevision: string;
|
|
41
|
+
authorityVersion: 2;
|
|
42
|
+
context: "TENANT_EXPLICIT_MANAGEMENT_V1";
|
|
43
|
+
managementConfigured: boolean;
|
|
44
|
+
resource: string;
|
|
45
|
+
issuer: string;
|
|
46
|
+
authorizationEndpoint: string;
|
|
47
|
+
tokenEndpoint: string;
|
|
48
|
+
revocationEndpoint: string;
|
|
49
|
+
mcpEndpoint: string;
|
|
50
|
+
callEndpoint: string;
|
|
51
|
+
contentEndpoint: string;
|
|
52
|
+
contentContextHeader: "x-knowledge-tenant-id";
|
|
53
|
+
legacyProviderEndpoint: string;
|
|
54
|
+
protocols: ("2026-07-28" | "2025-06-18")[];
|
|
55
|
+
tools: string[];
|
|
56
|
+
requestMaxBytes: 131072;
|
|
57
|
+
resultMaxBytes: 524288;
|
|
58
|
+
submissionMaxBytes: 65536;
|
|
59
|
+
inlineContentMaxBytes: 32768;
|
|
60
|
+
contentReadMaxBytes: 16777216;
|
|
61
|
+
collectionMode: "MANUAL_ONLY_OAUTH";
|
|
62
|
+
capabilities: ["TENANT_MANAGEMENT_V1", "TENANT_WORKFLOW_V1", "TENANT_CURRENTNESS_V2", "TENANT_SOURCE_V1"];
|
|
63
|
+
}>;
|
|
64
|
+
guide(): Promise<{
|
|
65
|
+
schemaVersion: 2;
|
|
66
|
+
tenantId: string;
|
|
67
|
+
tool: "tenant_workflow_guide";
|
|
68
|
+
data: {
|
|
69
|
+
schemaVersion: 2;
|
|
70
|
+
tenantId: string;
|
|
71
|
+
authorityVersion: 2;
|
|
72
|
+
scopes: string[];
|
|
73
|
+
tools: {
|
|
74
|
+
name: string;
|
|
75
|
+
authorization: {
|
|
76
|
+
selection: "NEXT_STATUS" | "WORKFLOW_ACTION" | "FIXED";
|
|
77
|
+
scopeAlternatives: string[][];
|
|
78
|
+
};
|
|
79
|
+
inputSchema: import("zod").JSONType;
|
|
80
|
+
outputSchema: import("zod").JSONType;
|
|
81
|
+
}[];
|
|
82
|
+
rules: string[];
|
|
83
|
+
limits: {
|
|
84
|
+
requestMaxBytes: 131072;
|
|
85
|
+
resultMaxBytes: 524288;
|
|
86
|
+
submissionMaxBytes: 65536;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
}>;
|
|
90
|
+
plan(ref: string): Promise<{
|
|
91
|
+
schemaVersion: 2;
|
|
92
|
+
tenantId: string;
|
|
93
|
+
tool: "tenant_workflow_plan";
|
|
94
|
+
data: {
|
|
95
|
+
schemaVersion: 2;
|
|
96
|
+
tenantId: string;
|
|
97
|
+
ref: string;
|
|
98
|
+
contentHash: string;
|
|
99
|
+
resourceType: string;
|
|
100
|
+
kind: string;
|
|
101
|
+
version: number;
|
|
102
|
+
status: "RAW_EVIDENCE" | "REFERENCE_SNAPSHOT" | "REGISTERED_MATERIAL" | "READY_FOR_REVIEW" | "REWORK_REQUIRED" | "APPROVED" | "REJECTED" | "DRAFT" | "GENERATED" | "SUPERSEDED" | "RAW_MATERIAL";
|
|
103
|
+
productionPhase: "REGISTERED";
|
|
104
|
+
readiness: {
|
|
105
|
+
schemaVersion: 2;
|
|
106
|
+
profile: "HUMAN_ARTICLE_V1" | "KNOWLEDGE_CARD_V1";
|
|
107
|
+
ready: boolean;
|
|
108
|
+
reasons: ("ROLE_MISMATCH" | "TITLE_REQUIRED" | "SUMMARY_REQUIRED" | "TEXT_TOO_SHORT" | "STRUCTURE_TOO_THIN" | "CITATION_COVERAGE_REQUIRED" | "MEDIA_UNAVAILABLE" | "SOURCE_REQUIRED" | "SOURCE_MISMATCH")[];
|
|
109
|
+
metrics: {
|
|
110
|
+
textCharacters: number;
|
|
111
|
+
blockCount: number;
|
|
112
|
+
textBlockCount: number;
|
|
113
|
+
mediaBlockCount: number;
|
|
114
|
+
sourceCount: number;
|
|
115
|
+
mediaEvidenceCount: number;
|
|
116
|
+
citationCount: number;
|
|
117
|
+
citedBlockCount: number;
|
|
118
|
+
};
|
|
119
|
+
} | null;
|
|
120
|
+
currentness: {
|
|
121
|
+
observedAt: string | null;
|
|
122
|
+
lastAttemptAt: string | null;
|
|
123
|
+
assessedAt: string;
|
|
124
|
+
state: "UNKNOWN" | "DUE" | "CURRENT" | "STALE" | "BLOCKED";
|
|
125
|
+
action: "ALLOW" | "DENY" | "REVIEW_REQUIRED";
|
|
126
|
+
reasonCode: "CURRENT_WITHIN_CADENCE" | "REFRESH_DUE" | "STALE_AFTER_THRESHOLD" | "SOURCE_BLOCKED" | "SOURCE_CONTENT_CHANGED" | "NO_SUCCESSFUL_OBSERVATION";
|
|
127
|
+
policy: {
|
|
128
|
+
schemaVersion: 1;
|
|
129
|
+
dueAfterSeconds: number;
|
|
130
|
+
staleAfterSeconds: number;
|
|
131
|
+
staleAction: "ALLOW" | "DENY" | "REVIEW_REQUIRED";
|
|
132
|
+
unknownAction: "ALLOW" | "DENY" | "REVIEW_REQUIRED";
|
|
133
|
+
blockedAction: "ALLOW" | "DENY" | "REVIEW_REQUIRED";
|
|
134
|
+
};
|
|
135
|
+
lastSuccessAt: string | null;
|
|
136
|
+
dueAt: string | null;
|
|
137
|
+
staleAt: string | null;
|
|
138
|
+
ageSeconds: number | null;
|
|
139
|
+
basis: "RETAINED_SNAPSHOT";
|
|
140
|
+
basisRef: string;
|
|
141
|
+
declarationRef: string;
|
|
142
|
+
tenantId: string;
|
|
143
|
+
subjectRef: string;
|
|
144
|
+
resourceType: string;
|
|
145
|
+
contentHash: string;
|
|
146
|
+
schemaVersion: 2;
|
|
147
|
+
subjectKind: "MATERIAL";
|
|
148
|
+
sourceRevisionRef?: string | undefined;
|
|
149
|
+
} | null;
|
|
150
|
+
governedPolicyReady: boolean;
|
|
151
|
+
consumerReadDecision: {
|
|
152
|
+
action: "ALLOW" | "DENY" | "REVIEW_REQUIRED";
|
|
153
|
+
reasonCodes: string[];
|
|
154
|
+
authority: "AUTHENTICATED_READER" | "LOCAL_PROFILE_SIMULATION";
|
|
155
|
+
} | null;
|
|
156
|
+
externalReady: boolean;
|
|
157
|
+
successorRef: string | null;
|
|
158
|
+
blockers: string[];
|
|
159
|
+
nextActions: {
|
|
160
|
+
id: string;
|
|
161
|
+
tool: string | null;
|
|
162
|
+
arguments: Record<string, import("zod").JSONType>;
|
|
163
|
+
requiredScopes: string[];
|
|
164
|
+
missingScopes: string[];
|
|
165
|
+
missingFields: string[];
|
|
166
|
+
canExecute: boolean;
|
|
167
|
+
automatic: boolean;
|
|
168
|
+
reasonCode: string;
|
|
169
|
+
}[];
|
|
170
|
+
};
|
|
171
|
+
}>;
|
|
172
|
+
read(ref: string): Promise<{
|
|
173
|
+
schemaVersion: 2;
|
|
174
|
+
tenantId: string;
|
|
175
|
+
tool: "tenant_knowledge_read";
|
|
176
|
+
data: {
|
|
177
|
+
schemaVersion: 2;
|
|
178
|
+
tenantId: string;
|
|
179
|
+
ref: string;
|
|
180
|
+
decision: {
|
|
181
|
+
schemaVersion: 1;
|
|
182
|
+
action: "ALLOW" | "DENY" | "REVIEW_REQUIRED";
|
|
183
|
+
reasonCodes: ("UNAVAILABLE" | "INTEGRITY_MISMATCH" | "NOT_FOUND" | "CONTENT_ACCESS_DENIED" | "UNSUPPORTED_RESOURCE" | "STALE" | "ACCESS_DENIED" | "ARTIFACT_NOT_APPROVED" | "ARTIFACT_SUPERSEDED" | "SEMANTIC_REVIEW_REQUIRED" | "SEMANTIC_DENIED" | "SEMANTIC_ADMISSION_MISSING" | "CURRENTNESS_MISSING" | "CURRENTNESS_REVIEW_REQUIRED" | "CURRENTNESS_DENIED" | "VALIDITY_EXPIRED" | "CLAIM_REVIEW_REQUIRED" | "CLAIM_DENIED" | "CLAIM_NOT_EFFECTIVE" | "REFERENCE_NOT_COVERED" | "REFERENCE_NOT_EFFECTIVE" | "REFERENCE_VALIDITY_EXPIRED" | "REFERENCE_STALE" | "REFERENCE_UNAVAILABLE" | "REFERENCE_REVIEW_REQUIRED" | "REFERENCE_DENIED" | "GOVERNANCE_NOT_CONFIGURED")[];
|
|
184
|
+
assessedAt: string;
|
|
185
|
+
};
|
|
186
|
+
descriptor: {
|
|
187
|
+
contentHash: string;
|
|
188
|
+
mediaType: string;
|
|
189
|
+
byteLength: number;
|
|
190
|
+
} | null;
|
|
191
|
+
contentBase64: string | null;
|
|
192
|
+
truncated: boolean;
|
|
193
|
+
continuation: {
|
|
194
|
+
kind: "AUTHENTICATED_TENANT_GOVERNED_CONTENT";
|
|
195
|
+
ref: string;
|
|
196
|
+
} | null;
|
|
197
|
+
};
|
|
198
|
+
}>;
|
|
199
|
+
snapshot(ref: string): Promise<{
|
|
200
|
+
schemaVersion: 2;
|
|
201
|
+
tenantId: string;
|
|
202
|
+
tool: "tenant_snapshot_status";
|
|
203
|
+
data: {
|
|
204
|
+
subjectRef: string;
|
|
205
|
+
state: "UNAVAILABLE" | "INTEGRITY_MISMATCH" | "READY" | "NOT_AVAILABLE" | "NOT_DECLARED" | "PROJECTION_PENDING";
|
|
206
|
+
assessment: {
|
|
207
|
+
observedAt: string | null;
|
|
208
|
+
lastAttemptAt: string | null;
|
|
209
|
+
assessedAt: string;
|
|
210
|
+
state: "UNKNOWN" | "DUE" | "CURRENT" | "STALE" | "BLOCKED";
|
|
211
|
+
action: "ALLOW" | "DENY" | "REVIEW_REQUIRED";
|
|
212
|
+
reasonCode: "CURRENT_WITHIN_CADENCE" | "REFRESH_DUE" | "STALE_AFTER_THRESHOLD" | "SOURCE_BLOCKED" | "SOURCE_CONTENT_CHANGED" | "NO_SUCCESSFUL_OBSERVATION";
|
|
213
|
+
policy: {
|
|
214
|
+
schemaVersion: 1;
|
|
215
|
+
dueAfterSeconds: number;
|
|
216
|
+
staleAfterSeconds: number;
|
|
217
|
+
staleAction: "ALLOW" | "DENY" | "REVIEW_REQUIRED";
|
|
218
|
+
unknownAction: "ALLOW" | "DENY" | "REVIEW_REQUIRED";
|
|
219
|
+
blockedAction: "ALLOW" | "DENY" | "REVIEW_REQUIRED";
|
|
220
|
+
};
|
|
221
|
+
lastSuccessAt: string | null;
|
|
222
|
+
dueAt: string | null;
|
|
223
|
+
staleAt: string | null;
|
|
224
|
+
ageSeconds: number | null;
|
|
225
|
+
basis: "RETAINED_SNAPSHOT";
|
|
226
|
+
basisRef: string;
|
|
227
|
+
declarationRef: string;
|
|
228
|
+
tenantId: string;
|
|
229
|
+
subjectRef: string;
|
|
230
|
+
resourceType: string;
|
|
231
|
+
contentHash: string;
|
|
232
|
+
schemaVersion: 2;
|
|
233
|
+
subjectKind: "MATERIAL";
|
|
234
|
+
sourceRevisionRef?: string | undefined;
|
|
235
|
+
} | null;
|
|
236
|
+
};
|
|
237
|
+
}>;
|
|
238
|
+
stream(ref: string, options?: MaterialStreamOptions): Promise<import("./material-stream.js").MaterialStreamResponse>;
|
|
239
|
+
}
|
|
240
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type TenantProjectToolName, type TenantProjectToolInput, type TenantProjectToolResponse } from '../serving-contracts/index.js';
|
|
2
|
+
import { KnowledgeTenantWorkspaceClient } from './tenant-workspace.js';
|
|
3
|
+
import { TenantManagementSdkError } from './tenant-management.js';
|
|
4
|
+
import { type MaterialStreamOptions } from './material-stream.js';
|
|
5
|
+
export declare class KnowledgeTenantProjectClient extends KnowledgeTenantWorkspaceClient {
|
|
6
|
+
protected protocolVersion(): 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25;
|
|
7
|
+
protected failure(raw: unknown, status: number): TenantManagementSdkError<string> | null;
|
|
8
|
+
projectTool<K extends TenantProjectToolName>(name: K, raw: TenantProjectToolInput<K>, options?: {
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
}): Promise<TenantProjectToolResponse<K>>;
|
|
11
|
+
projectProvider(): Promise<{
|
|
12
|
+
provider: "knowledge-v2";
|
|
13
|
+
codeRevision: string;
|
|
14
|
+
authorityVersion: 2;
|
|
15
|
+
context: "TENANT_EXPLICIT_MANAGEMENT_V1";
|
|
16
|
+
managementConfigured: boolean;
|
|
17
|
+
resource: string;
|
|
18
|
+
issuer: string;
|
|
19
|
+
authorizationEndpoint: string;
|
|
20
|
+
tokenEndpoint: string;
|
|
21
|
+
revocationEndpoint: string;
|
|
22
|
+
mcpEndpoint: string;
|
|
23
|
+
callEndpoint: string;
|
|
24
|
+
contentEndpoint: string;
|
|
25
|
+
contentContextHeader: "x-knowledge-tenant-id";
|
|
26
|
+
legacyProviderEndpoint: string;
|
|
27
|
+
protocols: ("2026-07-28" | "2025-06-18")[];
|
|
28
|
+
requestMaxBytes: 131072;
|
|
29
|
+
resultMaxBytes: 524288;
|
|
30
|
+
submissionMaxBytes: 65536;
|
|
31
|
+
inlineContentMaxBytes: 32768;
|
|
32
|
+
contentReadMaxBytes: 16777216;
|
|
33
|
+
collectionMode: "MANUAL_ONLY_OAUTH";
|
|
34
|
+
schemaVersion: 19;
|
|
35
|
+
projectContentEndpoint: string;
|
|
36
|
+
projectContentPolicyHeader: "x-knowledge-authority-policy";
|
|
37
|
+
projectContentProjectHeader: "x-knowledge-project-key";
|
|
38
|
+
projectControlIdentitySchemaVersion: 19;
|
|
39
|
+
tools: string[];
|
|
40
|
+
capabilities: ["TENANT_MANAGEMENT_V1", "TENANT_WORKFLOW_V1", "TENANT_CURRENTNESS_V2", "TENANT_SOURCE_V1", "TENANT_WORKSPACE_METADATA_V1", "TENANT_PROJECT_CONTEXT_V1"];
|
|
41
|
+
}>;
|
|
42
|
+
projectStream(projectKey: string, ref: string, options?: MaterialStreamOptions): Promise<{
|
|
43
|
+
context: {
|
|
44
|
+
tenantId: string;
|
|
45
|
+
projectKey: string;
|
|
46
|
+
policy: "TENANT_PROJECT_SCOPE";
|
|
47
|
+
};
|
|
48
|
+
status: 200 | 206;
|
|
49
|
+
contentClass: string;
|
|
50
|
+
contentHash: string;
|
|
51
|
+
mediaType: string;
|
|
52
|
+
contentLength: number;
|
|
53
|
+
contentRange: string | null;
|
|
54
|
+
body: ReadableStream<Uint8Array> | null;
|
|
55
|
+
verification: "SERVER_VERIFIED_BEFORE_HEADERS";
|
|
56
|
+
}>;
|
|
57
|
+
}
|