@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,291 @@
|
|
|
1
|
+
import { agentGuidedEnvelopeSchema, type AgentGuidedDiscoveryInput, type AgentTaskInput } from '../serving-contracts/index.js';
|
|
2
|
+
import { type ResourceToolName } from '../contracts/index.js';
|
|
3
|
+
import { type BodySearchToolName, agentEntryEnvelopeSchema, agentCapabilityDataSchemas, type AgentDiscoveryInput, type AgentCapabilityName, type AgentCapabilityInput } from '../serving-contracts/index.js';
|
|
4
|
+
import { KnowledgeTenantManagementClient, TenantManagementSdkError } from './tenant-management.js';
|
|
5
|
+
import type { MaterialStreamOptions } from './material-stream.js';
|
|
6
|
+
type Discovery = ReturnType<ReturnType<typeof agentEntryEnvelopeSchema<'knowledge_discover'>>['parse']>;
|
|
7
|
+
export type AgentGuidedDiscovery = ReturnType<ReturnType<typeof agentGuidedEnvelopeSchema<'knowledge_discover'>>['parse']>;
|
|
8
|
+
type GuidedExecution = ReturnType<ReturnType<typeof agentGuidedEnvelopeSchema<'knowledge_execute'>>['parse']>;
|
|
9
|
+
type Execution = ReturnType<ReturnType<typeof agentEntryEnvelopeSchema<'knowledge_execute'>>['parse']>;
|
|
10
|
+
type CapabilityResult<K extends AgentCapabilityName> = {
|
|
11
|
+
schemaVersion: 2;
|
|
12
|
+
data: ReturnType<(typeof agentCapabilityDataSchemas)[K]['parse']>;
|
|
13
|
+
} & (K extends ResourceToolName | BodySearchToolName ? {
|
|
14
|
+
context: {
|
|
15
|
+
tenantId: string;
|
|
16
|
+
type: 'TENANT' | 'PROJECT';
|
|
17
|
+
projectRef?: string;
|
|
18
|
+
};
|
|
19
|
+
policy: string;
|
|
20
|
+
} : {
|
|
21
|
+
tenantId: string;
|
|
22
|
+
tool: K;
|
|
23
|
+
});
|
|
24
|
+
export type AgentExecution<K extends AgentCapabilityName> = Omit<Execution, 'data'> & {
|
|
25
|
+
data: Omit<Execution['data'], 'result'> & {
|
|
26
|
+
result: CapabilityResult<K> | null;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export type AgentGuidedExecution<K extends AgentCapabilityName> = Omit<GuidedExecution, 'data'> & {
|
|
30
|
+
data: Omit<GuidedExecution['data'], 'result'> & {
|
|
31
|
+
result: CapabilityResult<K> | null;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export type AgentPageOptions = {
|
|
35
|
+
maxPages?: number;
|
|
36
|
+
signal?: AbortSignal;
|
|
37
|
+
};
|
|
38
|
+
export declare class KnowledgeAgentClient extends KnowledgeTenantManagementClient {
|
|
39
|
+
protected failure(raw: unknown, status: number): TenantManagementSdkError<string> | null;
|
|
40
|
+
private entry;
|
|
41
|
+
agentProvider(): Promise<{
|
|
42
|
+
provider: "knowledge-v2";
|
|
43
|
+
codeRevision: string;
|
|
44
|
+
authorityVersion: 2;
|
|
45
|
+
context: "TENANT_EXPLICIT_MANAGEMENT_V1";
|
|
46
|
+
managementConfigured: boolean;
|
|
47
|
+
resource: string;
|
|
48
|
+
issuer: string;
|
|
49
|
+
authorizationEndpoint: string;
|
|
50
|
+
tokenEndpoint: string;
|
|
51
|
+
revocationEndpoint: string;
|
|
52
|
+
mcpEndpoint: string;
|
|
53
|
+
callEndpoint: string;
|
|
54
|
+
contentEndpoint: string;
|
|
55
|
+
contentContextHeader: "x-knowledge-tenant-id";
|
|
56
|
+
legacyProviderEndpoint: string;
|
|
57
|
+
protocols: ("2026-07-28" | "2025-06-18")[];
|
|
58
|
+
requestMaxBytes: 131072;
|
|
59
|
+
resultMaxBytes: 524288;
|
|
60
|
+
submissionMaxBytes: 65536;
|
|
61
|
+
inlineContentMaxBytes: 32768;
|
|
62
|
+
contentReadMaxBytes: 16777216;
|
|
63
|
+
schemaVersion: 26;
|
|
64
|
+
collectionMode: "EXPLICIT_HOST_WITH_OPT_IN_DUE";
|
|
65
|
+
tools: ["knowledge_discover", "knowledge_execute"];
|
|
66
|
+
capabilities: ["AGENT_TASK_DISCOVERY_V1"];
|
|
67
|
+
}>;
|
|
68
|
+
discover(input?: AgentDiscoveryInput, options?: {
|
|
69
|
+
signal?: AbortSignal;
|
|
70
|
+
}): Promise<Discovery>;
|
|
71
|
+
execute<K extends AgentCapabilityName>(tool: K, input: AgentCapabilityInput<K>, options?: {
|
|
72
|
+
signal?: AbortSignal;
|
|
73
|
+
}): Promise<AgentExecution<K>>;
|
|
74
|
+
guidedDiscover(input?: AgentGuidedDiscoveryInput, options?: {
|
|
75
|
+
signal?: AbortSignal;
|
|
76
|
+
}): Promise<AgentGuidedDiscovery>;
|
|
77
|
+
planTask(task: AgentTaskInput, options?: {
|
|
78
|
+
signal?: AbortSignal;
|
|
79
|
+
}): Promise<{
|
|
80
|
+
schemaVersion: 2;
|
|
81
|
+
tenantId: string;
|
|
82
|
+
tool: "knowledge_discover";
|
|
83
|
+
data: {
|
|
84
|
+
nextActions: {
|
|
85
|
+
id: string;
|
|
86
|
+
title: string;
|
|
87
|
+
tool: "knowledge_discover" | "knowledge_execute";
|
|
88
|
+
arguments: Record<string, import("zod").JSONType>;
|
|
89
|
+
canExecute: boolean;
|
|
90
|
+
automatic: false;
|
|
91
|
+
missingFields: string[];
|
|
92
|
+
reasonCode: string;
|
|
93
|
+
}[];
|
|
94
|
+
items: {
|
|
95
|
+
name: "tenant_material_submit" | "tenant_artifact_draft" | "tenant_knowledge_compose" | "tenant_knowledge_review" | "tenant_artifact_promote" | "tenant_snapshot_declare" | "tenant_snapshot_status" | "tenant_material_share" | "tenant_material_revoke" | "tenant_material_routes" | "tenant_workflow_plan" | "tenant_workflow_advance" | "tenant_knowledge_read" | "tenant_source_define" | "tenant_source_configure" | "tenant_source_get" | "tenant_source_list" | "tenant_collection_request" | "tenant_collection_status" | "tenant_source_inventory" | "tenant_work_queue" | "tenant_project_list" | "tenant_project_get" | "tenant_project_materials" | "tenant_project_scope_set" | "tenant_project_lifecycle_set" | "tenant_runtime_status" | "tenant_web_collect_preview" | "tenant_web_collect_submit" | "tenant_web_collect_status" | "tenant_web_collect_results" | "tenant_web_collect_cycles" | "tenant_web_collect_control" | "tenant_web_collect_refresh" | "tenant_web_collect_read" | "tenant_web_collect_index_status" | "knowledge_resource_search_body" | "knowledge_resource_read_passage" | "knowledge_resource_list" | "knowledge_resource_describe" | "knowledge_resource_read" | "knowledge_resource_capabilities" | "knowledge_resource_search" | "knowledge_resource_window" | "knowledge_resource_changes" | "knowledge_resource_counts" | "knowledge_resource_index_status" | "knowledge_resource_media";
|
|
96
|
+
category: "materials" | "sources" | "collection" | "governance" | "sharing" | "projects" | "runtime";
|
|
97
|
+
title: string;
|
|
98
|
+
description: string;
|
|
99
|
+
readOnly: boolean;
|
|
100
|
+
scopeAlternatives: string[][];
|
|
101
|
+
}[];
|
|
102
|
+
nextAfter: string | null;
|
|
103
|
+
guidance: string;
|
|
104
|
+
categories: {
|
|
105
|
+
id: "materials" | "sources" | "collection" | "governance" | "sharing" | "projects" | "runtime";
|
|
106
|
+
title: string;
|
|
107
|
+
count: number;
|
|
108
|
+
}[];
|
|
109
|
+
detail: {
|
|
110
|
+
name: "tenant_material_submit" | "tenant_artifact_draft" | "tenant_knowledge_compose" | "tenant_knowledge_review" | "tenant_artifact_promote" | "tenant_snapshot_declare" | "tenant_snapshot_status" | "tenant_material_share" | "tenant_material_revoke" | "tenant_material_routes" | "tenant_workflow_plan" | "tenant_workflow_advance" | "tenant_knowledge_read" | "tenant_source_define" | "tenant_source_configure" | "tenant_source_get" | "tenant_source_list" | "tenant_collection_request" | "tenant_collection_status" | "tenant_source_inventory" | "tenant_work_queue" | "tenant_project_list" | "tenant_project_get" | "tenant_project_materials" | "tenant_project_scope_set" | "tenant_project_lifecycle_set" | "tenant_runtime_status" | "tenant_web_collect_preview" | "tenant_web_collect_submit" | "tenant_web_collect_status" | "tenant_web_collect_results" | "tenant_web_collect_cycles" | "tenant_web_collect_control" | "tenant_web_collect_refresh" | "tenant_web_collect_read" | "tenant_web_collect_index_status" | "knowledge_resource_search_body" | "knowledge_resource_read_passage" | "knowledge_resource_list" | "knowledge_resource_describe" | "knowledge_resource_read" | "knowledge_resource_capabilities" | "knowledge_resource_search" | "knowledge_resource_window" | "knowledge_resource_changes" | "knowledge_resource_counts" | "knowledge_resource_index_status" | "knowledge_resource_media";
|
|
111
|
+
inputSchema: import("zod").JSONType;
|
|
112
|
+
outputSchema: import("zod").JSONType;
|
|
113
|
+
} | null;
|
|
114
|
+
mode: "HOME" | "SEARCH" | "DETAIL" | "TASK";
|
|
115
|
+
inputHints: {
|
|
116
|
+
path: string;
|
|
117
|
+
kind: "MISSING" | "INVALID" | "UNSUPPORTED" | "CONFLICT";
|
|
118
|
+
expected: string;
|
|
119
|
+
prompt: string;
|
|
120
|
+
source: "USER_INPUT" | "CURRENT_STATE" | "PRIOR_RESULT" | "INDEPENDENT_REVIEW";
|
|
121
|
+
choices: import("zod").JSONType[];
|
|
122
|
+
constraints: Record<string, import("zod").JSONType>;
|
|
123
|
+
}[];
|
|
124
|
+
taskPlan: {
|
|
125
|
+
template: "RESEARCH_EXISTING" | "COLLECT_WEBSITE" | "INSPECT_COLLECTION" | "VERIFY_CITATION" | "PROJECT_RESEARCH" | "SHARE_MATERIAL" | "GOVERNANCE" | "UNRECOGNIZED";
|
|
126
|
+
status: "SUGGESTED_NOT_EXECUTED";
|
|
127
|
+
steps: {
|
|
128
|
+
id: string;
|
|
129
|
+
title: string;
|
|
130
|
+
dependsOn: string[];
|
|
131
|
+
capability: string | null;
|
|
132
|
+
state: "READY" | "NEEDS_INPUT" | "NOT_AUTHORIZED" | "NEEDS_PRIOR_RESULT";
|
|
133
|
+
action: {
|
|
134
|
+
id: string;
|
|
135
|
+
title: string;
|
|
136
|
+
tool: "knowledge_discover" | "knowledge_execute";
|
|
137
|
+
arguments: Record<string, import("zod").JSONType>;
|
|
138
|
+
canExecute: boolean;
|
|
139
|
+
automatic: false;
|
|
140
|
+
missingFields: string[];
|
|
141
|
+
reasonCode: string;
|
|
142
|
+
} | null;
|
|
143
|
+
inputHints: {
|
|
144
|
+
path: string;
|
|
145
|
+
kind: "MISSING" | "INVALID" | "UNSUPPORTED" | "CONFLICT";
|
|
146
|
+
expected: string;
|
|
147
|
+
prompt: string;
|
|
148
|
+
source: "USER_INPUT" | "CURRENT_STATE" | "PRIOR_RESULT" | "INDEPENDENT_REVIEW";
|
|
149
|
+
choices: import("zod").JSONType[];
|
|
150
|
+
constraints: Record<string, import("zod").JSONType>;
|
|
151
|
+
}[];
|
|
152
|
+
}[];
|
|
153
|
+
guidance: string;
|
|
154
|
+
} | null;
|
|
155
|
+
};
|
|
156
|
+
}>;
|
|
157
|
+
inputGuide(tool: AgentCapabilityName, input?: Record<string, unknown>, options?: {
|
|
158
|
+
signal?: AbortSignal;
|
|
159
|
+
resupplyFields?: string[];
|
|
160
|
+
}): Promise<{
|
|
161
|
+
schemaVersion: 2;
|
|
162
|
+
tenantId: string;
|
|
163
|
+
tool: "knowledge_discover";
|
|
164
|
+
data: {
|
|
165
|
+
nextActions: {
|
|
166
|
+
id: string;
|
|
167
|
+
title: string;
|
|
168
|
+
tool: "knowledge_discover" | "knowledge_execute";
|
|
169
|
+
arguments: Record<string, import("zod").JSONType>;
|
|
170
|
+
canExecute: boolean;
|
|
171
|
+
automatic: false;
|
|
172
|
+
missingFields: string[];
|
|
173
|
+
reasonCode: string;
|
|
174
|
+
}[];
|
|
175
|
+
items: {
|
|
176
|
+
name: "tenant_material_submit" | "tenant_artifact_draft" | "tenant_knowledge_compose" | "tenant_knowledge_review" | "tenant_artifact_promote" | "tenant_snapshot_declare" | "tenant_snapshot_status" | "tenant_material_share" | "tenant_material_revoke" | "tenant_material_routes" | "tenant_workflow_plan" | "tenant_workflow_advance" | "tenant_knowledge_read" | "tenant_source_define" | "tenant_source_configure" | "tenant_source_get" | "tenant_source_list" | "tenant_collection_request" | "tenant_collection_status" | "tenant_source_inventory" | "tenant_work_queue" | "tenant_project_list" | "tenant_project_get" | "tenant_project_materials" | "tenant_project_scope_set" | "tenant_project_lifecycle_set" | "tenant_runtime_status" | "tenant_web_collect_preview" | "tenant_web_collect_submit" | "tenant_web_collect_status" | "tenant_web_collect_results" | "tenant_web_collect_cycles" | "tenant_web_collect_control" | "tenant_web_collect_refresh" | "tenant_web_collect_read" | "tenant_web_collect_index_status" | "knowledge_resource_search_body" | "knowledge_resource_read_passage" | "knowledge_resource_list" | "knowledge_resource_describe" | "knowledge_resource_read" | "knowledge_resource_capabilities" | "knowledge_resource_search" | "knowledge_resource_window" | "knowledge_resource_changes" | "knowledge_resource_counts" | "knowledge_resource_index_status" | "knowledge_resource_media";
|
|
177
|
+
category: "materials" | "sources" | "collection" | "governance" | "sharing" | "projects" | "runtime";
|
|
178
|
+
title: string;
|
|
179
|
+
description: string;
|
|
180
|
+
readOnly: boolean;
|
|
181
|
+
scopeAlternatives: string[][];
|
|
182
|
+
}[];
|
|
183
|
+
nextAfter: string | null;
|
|
184
|
+
guidance: string;
|
|
185
|
+
categories: {
|
|
186
|
+
id: "materials" | "sources" | "collection" | "governance" | "sharing" | "projects" | "runtime";
|
|
187
|
+
title: string;
|
|
188
|
+
count: number;
|
|
189
|
+
}[];
|
|
190
|
+
detail: {
|
|
191
|
+
name: "tenant_material_submit" | "tenant_artifact_draft" | "tenant_knowledge_compose" | "tenant_knowledge_review" | "tenant_artifact_promote" | "tenant_snapshot_declare" | "tenant_snapshot_status" | "tenant_material_share" | "tenant_material_revoke" | "tenant_material_routes" | "tenant_workflow_plan" | "tenant_workflow_advance" | "tenant_knowledge_read" | "tenant_source_define" | "tenant_source_configure" | "tenant_source_get" | "tenant_source_list" | "tenant_collection_request" | "tenant_collection_status" | "tenant_source_inventory" | "tenant_work_queue" | "tenant_project_list" | "tenant_project_get" | "tenant_project_materials" | "tenant_project_scope_set" | "tenant_project_lifecycle_set" | "tenant_runtime_status" | "tenant_web_collect_preview" | "tenant_web_collect_submit" | "tenant_web_collect_status" | "tenant_web_collect_results" | "tenant_web_collect_cycles" | "tenant_web_collect_control" | "tenant_web_collect_refresh" | "tenant_web_collect_read" | "tenant_web_collect_index_status" | "knowledge_resource_search_body" | "knowledge_resource_read_passage" | "knowledge_resource_list" | "knowledge_resource_describe" | "knowledge_resource_read" | "knowledge_resource_capabilities" | "knowledge_resource_search" | "knowledge_resource_window" | "knowledge_resource_changes" | "knowledge_resource_counts" | "knowledge_resource_index_status" | "knowledge_resource_media";
|
|
192
|
+
inputSchema: import("zod").JSONType;
|
|
193
|
+
outputSchema: import("zod").JSONType;
|
|
194
|
+
} | null;
|
|
195
|
+
mode: "HOME" | "SEARCH" | "DETAIL" | "TASK";
|
|
196
|
+
inputHints: {
|
|
197
|
+
path: string;
|
|
198
|
+
kind: "MISSING" | "INVALID" | "UNSUPPORTED" | "CONFLICT";
|
|
199
|
+
expected: string;
|
|
200
|
+
prompt: string;
|
|
201
|
+
source: "USER_INPUT" | "CURRENT_STATE" | "PRIOR_RESULT" | "INDEPENDENT_REVIEW";
|
|
202
|
+
choices: import("zod").JSONType[];
|
|
203
|
+
constraints: Record<string, import("zod").JSONType>;
|
|
204
|
+
}[];
|
|
205
|
+
taskPlan: {
|
|
206
|
+
template: "RESEARCH_EXISTING" | "COLLECT_WEBSITE" | "INSPECT_COLLECTION" | "VERIFY_CITATION" | "PROJECT_RESEARCH" | "SHARE_MATERIAL" | "GOVERNANCE" | "UNRECOGNIZED";
|
|
207
|
+
status: "SUGGESTED_NOT_EXECUTED";
|
|
208
|
+
steps: {
|
|
209
|
+
id: string;
|
|
210
|
+
title: string;
|
|
211
|
+
dependsOn: string[];
|
|
212
|
+
capability: string | null;
|
|
213
|
+
state: "READY" | "NEEDS_INPUT" | "NOT_AUTHORIZED" | "NEEDS_PRIOR_RESULT";
|
|
214
|
+
action: {
|
|
215
|
+
id: string;
|
|
216
|
+
title: string;
|
|
217
|
+
tool: "knowledge_discover" | "knowledge_execute";
|
|
218
|
+
arguments: Record<string, import("zod").JSONType>;
|
|
219
|
+
canExecute: boolean;
|
|
220
|
+
automatic: false;
|
|
221
|
+
missingFields: string[];
|
|
222
|
+
reasonCode: string;
|
|
223
|
+
} | null;
|
|
224
|
+
inputHints: {
|
|
225
|
+
path: string;
|
|
226
|
+
kind: "MISSING" | "INVALID" | "UNSUPPORTED" | "CONFLICT";
|
|
227
|
+
expected: string;
|
|
228
|
+
prompt: string;
|
|
229
|
+
source: "USER_INPUT" | "CURRENT_STATE" | "PRIOR_RESULT" | "INDEPENDENT_REVIEW";
|
|
230
|
+
choices: import("zod").JSONType[];
|
|
231
|
+
constraints: Record<string, import("zod").JSONType>;
|
|
232
|
+
}[];
|
|
233
|
+
}[];
|
|
234
|
+
guidance: string;
|
|
235
|
+
} | null;
|
|
236
|
+
};
|
|
237
|
+
}>;
|
|
238
|
+
guidedExecute<K extends AgentCapabilityName>(tool: K, input: Record<string, unknown>, options?: {
|
|
239
|
+
signal?: AbortSignal;
|
|
240
|
+
}): Promise<AgentGuidedExecution<K>>;
|
|
241
|
+
private executeChecked;
|
|
242
|
+
openMaterialStream(ref: string, options?: MaterialStreamOptions & {
|
|
243
|
+
projectRef?: string;
|
|
244
|
+
}): Promise<import("./material-stream.js").MaterialStreamResponse>;
|
|
245
|
+
discoverPages(input: AgentDiscoveryInput, options?: {
|
|
246
|
+
maxPages?: number;
|
|
247
|
+
signal?: AbortSignal;
|
|
248
|
+
}): AsyncGenerator<{
|
|
249
|
+
schemaVersion: 2;
|
|
250
|
+
tenantId: string;
|
|
251
|
+
tool: "knowledge_discover";
|
|
252
|
+
data: {
|
|
253
|
+
mode: "HOME" | "SEARCH" | "DETAIL";
|
|
254
|
+
categories: {
|
|
255
|
+
id: "materials" | "sources" | "collection" | "governance" | "sharing" | "projects" | "runtime";
|
|
256
|
+
title: string;
|
|
257
|
+
count: number;
|
|
258
|
+
}[];
|
|
259
|
+
items: {
|
|
260
|
+
name: "tenant_material_submit" | "tenant_artifact_draft" | "tenant_knowledge_compose" | "tenant_knowledge_review" | "tenant_artifact_promote" | "tenant_snapshot_declare" | "tenant_snapshot_status" | "tenant_material_share" | "tenant_material_revoke" | "tenant_material_routes" | "tenant_workflow_plan" | "tenant_workflow_advance" | "tenant_knowledge_read" | "tenant_source_define" | "tenant_source_configure" | "tenant_source_get" | "tenant_source_list" | "tenant_collection_request" | "tenant_collection_status" | "tenant_source_inventory" | "tenant_work_queue" | "tenant_project_list" | "tenant_project_get" | "tenant_project_materials" | "tenant_project_scope_set" | "tenant_project_lifecycle_set" | "tenant_runtime_status" | "tenant_web_collect_preview" | "tenant_web_collect_submit" | "tenant_web_collect_status" | "tenant_web_collect_results" | "tenant_web_collect_cycles" | "tenant_web_collect_control" | "tenant_web_collect_refresh" | "tenant_web_collect_read" | "tenant_web_collect_index_status" | "knowledge_resource_search_body" | "knowledge_resource_read_passage" | "knowledge_resource_list" | "knowledge_resource_describe" | "knowledge_resource_read" | "knowledge_resource_capabilities" | "knowledge_resource_search" | "knowledge_resource_window" | "knowledge_resource_changes" | "knowledge_resource_counts" | "knowledge_resource_index_status" | "knowledge_resource_media";
|
|
261
|
+
category: "materials" | "sources" | "collection" | "governance" | "sharing" | "projects" | "runtime";
|
|
262
|
+
title: string;
|
|
263
|
+
description: string;
|
|
264
|
+
readOnly: boolean;
|
|
265
|
+
scopeAlternatives: string[][];
|
|
266
|
+
}[];
|
|
267
|
+
detail: {
|
|
268
|
+
name: "tenant_material_submit" | "tenant_artifact_draft" | "tenant_knowledge_compose" | "tenant_knowledge_review" | "tenant_artifact_promote" | "tenant_snapshot_declare" | "tenant_snapshot_status" | "tenant_material_share" | "tenant_material_revoke" | "tenant_material_routes" | "tenant_workflow_plan" | "tenant_workflow_advance" | "tenant_knowledge_read" | "tenant_source_define" | "tenant_source_configure" | "tenant_source_get" | "tenant_source_list" | "tenant_collection_request" | "tenant_collection_status" | "tenant_source_inventory" | "tenant_work_queue" | "tenant_project_list" | "tenant_project_get" | "tenant_project_materials" | "tenant_project_scope_set" | "tenant_project_lifecycle_set" | "tenant_runtime_status" | "tenant_web_collect_preview" | "tenant_web_collect_submit" | "tenant_web_collect_status" | "tenant_web_collect_results" | "tenant_web_collect_cycles" | "tenant_web_collect_control" | "tenant_web_collect_refresh" | "tenant_web_collect_read" | "tenant_web_collect_index_status" | "knowledge_resource_search_body" | "knowledge_resource_read_passage" | "knowledge_resource_list" | "knowledge_resource_describe" | "knowledge_resource_read" | "knowledge_resource_capabilities" | "knowledge_resource_search" | "knowledge_resource_window" | "knowledge_resource_changes" | "knowledge_resource_counts" | "knowledge_resource_index_status" | "knowledge_resource_media";
|
|
269
|
+
inputSchema: import("zod").JSONType;
|
|
270
|
+
outputSchema: import("zod").JSONType;
|
|
271
|
+
} | null;
|
|
272
|
+
nextAfter: string | null;
|
|
273
|
+
nextActions: {
|
|
274
|
+
id: string;
|
|
275
|
+
title: string;
|
|
276
|
+
tool: "knowledge_discover" | "knowledge_execute";
|
|
277
|
+
arguments: Record<string, import("zod").JSONType>;
|
|
278
|
+
canExecute: boolean;
|
|
279
|
+
automatic: false;
|
|
280
|
+
missingFields: string[];
|
|
281
|
+
reasonCode: string;
|
|
282
|
+
}[];
|
|
283
|
+
guidance: string;
|
|
284
|
+
};
|
|
285
|
+
}, void, unknown>;
|
|
286
|
+
pages(tool: 'tenant_project_get', input: AgentCapabilityInput<'tenant_project_get'>, options: AgentPageOptions & {
|
|
287
|
+
continuation: 'purpose' | 'selection';
|
|
288
|
+
}): AsyncGenerator<AgentExecution<'tenant_project_get'>, void, unknown>;
|
|
289
|
+
pages<K extends Exclude<AgentCapabilityName, 'tenant_project_get'>>(tool: K, input: AgentCapabilityInput<K>, options?: AgentPageOptions): AsyncGenerator<AgentExecution<K>, void, unknown>;
|
|
290
|
+
}
|
|
291
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type AgentRecovery } from '../serving-contracts/index.js';
|
|
2
|
+
import { TenantManagementSdkError } from './tenant-management.js';
|
|
3
|
+
export declare function validateGuidanceActions(actions: AgentRecovery['nextActions'], options?: {
|
|
4
|
+
status?: number;
|
|
5
|
+
recoveryOnly?: boolean;
|
|
6
|
+
}): void;
|
|
7
|
+
export declare class KnowledgeAgentGuidanceError extends TenantManagementSdkError<string> {
|
|
8
|
+
readonly guidance: AgentRecovery;
|
|
9
|
+
constructor(code: string, status: number, guidance: AgentRecovery, details?: {
|
|
10
|
+
completedPhase?: string;
|
|
11
|
+
ref?: string;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
/** Invalid optional guidance cannot erase a validated durable failure receipt. */
|
|
15
|
+
export declare function agentGuidanceFailure(raw: unknown, status: number, tenantId: string): TenantManagementSdkError<string> | null;
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { type SdkTransportOptions } from './transport.js';
|
|
2
|
+
export type { SdkTransportOptions } from './transport.js';
|
|
3
|
+
import { type MaterialStreamOptions } from './material-stream.js';
|
|
4
|
+
export * from './resource.js';
|
|
5
|
+
export type { MaterialStreamOptions, MaterialStreamResponse } from './material-stream.js';
|
|
6
|
+
export * from './oauth.js';
|
|
7
|
+
import { type MaterialOutboxWindow, type ServingArtifactListResponse, type ServingArtifactPageResponse, type ServingArtifactMaterialPageResponse, type ServingArtifactMaterialResponse, type ServingMaterialPageResponse, type ServingMaterialRoutePageResponse, type ServingMaterialPartitionsResponse, type ServingMaterialPartitionPageResponse, type ServingMaterialSearchResponse, type ServingArtifactResponse, type ServingContentDecisionResponse, type ServingCurrentnessResponse, type ServingEvidenceListResponse, type ServingEvidencePageResponse, type ServingEvidencePresentationResponse, type ServingEvidenceResponse, type ServingHealthResponse, type ServingReferenceListResponse, type ServingReferenceLookupResponse, type ServingReferenceResponse, type ServingReferenceMaterialPageResponse, type ServingReferenceMaterialResponse, type ReferenceLookupFilter, type ServingProjectIntentResponse, type ServingProjectSourceListResponse, type ServingProjectSourceResponse, type ServingSourceResponse } from '../serving-contracts/index.js';
|
|
8
|
+
export interface KnowledgeServingClientOptions extends SdkTransportOptions {
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
token: string;
|
|
11
|
+
projectKey: string;
|
|
12
|
+
fetchImpl?: typeof fetch;
|
|
13
|
+
allowInsecureHttp?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ServingContentResponse {
|
|
16
|
+
decision: ServingContentDecisionResponse['decision'];
|
|
17
|
+
descriptor: {
|
|
18
|
+
contentHash: string;
|
|
19
|
+
mediaType: string;
|
|
20
|
+
byteLength: number;
|
|
21
|
+
};
|
|
22
|
+
content: Buffer;
|
|
23
|
+
}
|
|
24
|
+
export declare class KnowledgeServingClient {
|
|
25
|
+
private readonly limits;
|
|
26
|
+
readonly projectKey: string;
|
|
27
|
+
private readonly root;
|
|
28
|
+
private readonly basePath;
|
|
29
|
+
private readonly token;
|
|
30
|
+
private readonly fetchImpl;
|
|
31
|
+
constructor(options: KnowledgeServingClientOptions);
|
|
32
|
+
private url;
|
|
33
|
+
private request;
|
|
34
|
+
private json;
|
|
35
|
+
health(): Promise<ServingHealthResponse>;
|
|
36
|
+
listArtifacts(options?: {
|
|
37
|
+
kind?: string;
|
|
38
|
+
limit?: number;
|
|
39
|
+
}): Promise<ServingArtifactListResponse>;
|
|
40
|
+
pageArtifacts(options?: {
|
|
41
|
+
kind?: string;
|
|
42
|
+
limit?: number;
|
|
43
|
+
after?: string;
|
|
44
|
+
}): Promise<ServingArtifactPageResponse>;
|
|
45
|
+
pageArtifactMaterials(options?: {
|
|
46
|
+
kind?: string;
|
|
47
|
+
limit?: number;
|
|
48
|
+
after?: string;
|
|
49
|
+
}): Promise<ServingArtifactMaterialPageResponse>;
|
|
50
|
+
getMaterialOutboxWindow(): Promise<MaterialOutboxWindow>;
|
|
51
|
+
pageMaterials(options?: {
|
|
52
|
+
limit?: number;
|
|
53
|
+
after?: string;
|
|
54
|
+
}): Promise<ServingMaterialPageResponse>;
|
|
55
|
+
pageRouteMaterials(routeId: string, options?: {
|
|
56
|
+
after?: string;
|
|
57
|
+
limit?: number;
|
|
58
|
+
}): Promise<ServingMaterialRoutePageResponse>;
|
|
59
|
+
pageMaterialPartitions(options?: {
|
|
60
|
+
afterRouteId?: string;
|
|
61
|
+
limit?: number;
|
|
62
|
+
}): Promise<ServingMaterialPartitionsResponse>;
|
|
63
|
+
pageMaterialPartition(partition: 'OWNER' | 'LEGACY', options?: {
|
|
64
|
+
after?: string;
|
|
65
|
+
limit?: number;
|
|
66
|
+
}): Promise<ServingMaterialPartitionPageResponse>;
|
|
67
|
+
searchMaterials(query: string, options?: {
|
|
68
|
+
afterId?: number;
|
|
69
|
+
limit?: number;
|
|
70
|
+
resourceType?: string;
|
|
71
|
+
sourceProjectKey?: string;
|
|
72
|
+
}): Promise<ServingMaterialSearchResponse>;
|
|
73
|
+
getArtifactMaterial(ref: string): Promise<ServingArtifactMaterialResponse>;
|
|
74
|
+
getArtifact(ref: string): Promise<ServingArtifactResponse>;
|
|
75
|
+
listEvidence(options?: {
|
|
76
|
+
sourceId?: string;
|
|
77
|
+
limit?: number;
|
|
78
|
+
}): Promise<ServingEvidenceListResponse>;
|
|
79
|
+
/** 通用采集文件目录按 ref 续页;fileDecision 控制原文件,contentDecision 控制受治理正文。 */
|
|
80
|
+
pageEvidence(options?: {
|
|
81
|
+
sourceId?: string;
|
|
82
|
+
after?: string;
|
|
83
|
+
limit?: number;
|
|
84
|
+
}): Promise<ServingEvidencePageResponse>;
|
|
85
|
+
getEvidencePresentation(ref: string): Promise<ServingEvidencePresentationResponse>;
|
|
86
|
+
getEvidence(ref: string): Promise<ServingEvidenceResponse>;
|
|
87
|
+
getProjectIntent(): Promise<ServingProjectIntentResponse>;
|
|
88
|
+
listProjectSources(options?: {
|
|
89
|
+
enabled?: boolean;
|
|
90
|
+
limit?: number;
|
|
91
|
+
}): Promise<ServingProjectSourceListResponse>;
|
|
92
|
+
getProjectSource(sourceId: string): Promise<ServingProjectSourceResponse>;
|
|
93
|
+
getGovernanceSource(sourceId: string): Promise<ServingSourceResponse>;
|
|
94
|
+
getSource(sourceId: string): Promise<ServingSourceResponse>;
|
|
95
|
+
getCurrentness(ref: string): Promise<ServingCurrentnessResponse>;
|
|
96
|
+
listReferences(corpusKey: string, options?: {
|
|
97
|
+
recordType?: string;
|
|
98
|
+
limit?: number;
|
|
99
|
+
}): Promise<ServingReferenceListResponse>;
|
|
100
|
+
getReference(corpusKey: string, ref: string): Promise<ServingReferenceResponse>;
|
|
101
|
+
pageReferenceMaterials(options?: {
|
|
102
|
+
limit?: number;
|
|
103
|
+
after?: string;
|
|
104
|
+
}): Promise<ServingReferenceMaterialPageResponse>;
|
|
105
|
+
getReferenceMaterial(ref: string): Promise<ServingReferenceMaterialResponse>;
|
|
106
|
+
lookupReferences(options: ReferenceLookupFilter): Promise<ServingReferenceLookupResponse>;
|
|
107
|
+
private rawContent;
|
|
108
|
+
getMaterialContract(): Promise<{
|
|
109
|
+
schemaVersion: 2;
|
|
110
|
+
projectKey: string;
|
|
111
|
+
authentication: "API_KEY";
|
|
112
|
+
resourceTypeMode: "OPEN_IDENTIFIER";
|
|
113
|
+
capabilitiesEndpoint: "/v3/material-capabilities";
|
|
114
|
+
capabilityPageEndpoint: "/v3/material-page";
|
|
115
|
+
fileEndpoint: "/v2/material-file";
|
|
116
|
+
mediaPageEndpoint: "/v3/material-media-page";
|
|
117
|
+
indexStatusEndpoint: "/v3/material-index-status";
|
|
118
|
+
fileMethods: ["GET", "HEAD"];
|
|
119
|
+
fileRange: "SINGLE";
|
|
120
|
+
}>;
|
|
121
|
+
getMaterialCapabilities(ref: string): Promise<{
|
|
122
|
+
schemaVersion: 2;
|
|
123
|
+
projectKey: string;
|
|
124
|
+
material: {
|
|
125
|
+
item: {
|
|
126
|
+
ref: string;
|
|
127
|
+
resourceType: string;
|
|
128
|
+
sourceProjectKey: string;
|
|
129
|
+
identityHash: string;
|
|
130
|
+
kind: string;
|
|
131
|
+
classification: "PUBLIC" | "PUBLIC_METADATA" | "TENANT" | "INTERNAL" | "FDE_INTERNAL" | "ACCESS_CONTROLLED" | "UNKNOWN";
|
|
132
|
+
mediaType: string;
|
|
133
|
+
decision: {
|
|
134
|
+
schemaVersion: 1;
|
|
135
|
+
action: "ALLOW" | "DENY";
|
|
136
|
+
reasonCodes: ("UNAVAILABLE" | "INTEGRITY_MISMATCH" | "NOT_FOUND" | "CONTENT_ACCESS_DENIED" | "UNSUPPORTED_RESOURCE")[];
|
|
137
|
+
assessedAt: string;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
materialAccess: {
|
|
141
|
+
schemaVersion: 1;
|
|
142
|
+
action: "ALLOW" | "DENY";
|
|
143
|
+
reasonCodes: ("UNAVAILABLE" | "INTEGRITY_MISMATCH" | "NOT_FOUND" | "CONTENT_ACCESS_DENIED" | "UNSUPPORTED_RESOURCE")[];
|
|
144
|
+
assessedAt: string;
|
|
145
|
+
};
|
|
146
|
+
representation: {
|
|
147
|
+
state: "MISSING" | "UNSUPPORTED" | "INTEGRITY_MISMATCH" | "READY" | "DENIED";
|
|
148
|
+
format: "JSON" | "BYTES";
|
|
149
|
+
transfer: "UNSUPPORTED" | "VERIFIED_STREAM" | "BUFFERED_JSON";
|
|
150
|
+
contentHash: string | null;
|
|
151
|
+
mediaType: string;
|
|
152
|
+
byteLength: number | null;
|
|
153
|
+
methods: ("HEAD" | "GET")[];
|
|
154
|
+
range: "NONE" | "SINGLE";
|
|
155
|
+
verification: "ON_READ";
|
|
156
|
+
verificationChunkBytes: number | null;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
}>;
|
|
160
|
+
pageMaterialCapabilities(options?: {
|
|
161
|
+
limit?: number;
|
|
162
|
+
after?: string;
|
|
163
|
+
resourceType?: string;
|
|
164
|
+
sourceProjectKey?: string;
|
|
165
|
+
refPrefix?: string;
|
|
166
|
+
}): Promise<{
|
|
167
|
+
schemaVersion: 2;
|
|
168
|
+
projectKey: string;
|
|
169
|
+
items: {
|
|
170
|
+
item: {
|
|
171
|
+
ref: string;
|
|
172
|
+
resourceType: string;
|
|
173
|
+
sourceProjectKey: string;
|
|
174
|
+
identityHash: string;
|
|
175
|
+
kind: string;
|
|
176
|
+
classification: "PUBLIC" | "PUBLIC_METADATA" | "TENANT" | "INTERNAL" | "FDE_INTERNAL" | "ACCESS_CONTROLLED" | "UNKNOWN";
|
|
177
|
+
mediaType: string;
|
|
178
|
+
decision: {
|
|
179
|
+
schemaVersion: 1;
|
|
180
|
+
action: "ALLOW" | "DENY";
|
|
181
|
+
reasonCodes: ("UNAVAILABLE" | "INTEGRITY_MISMATCH" | "NOT_FOUND" | "CONTENT_ACCESS_DENIED" | "UNSUPPORTED_RESOURCE")[];
|
|
182
|
+
assessedAt: string;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
materialAccess: {
|
|
186
|
+
schemaVersion: 1;
|
|
187
|
+
action: "ALLOW" | "DENY";
|
|
188
|
+
reasonCodes: ("UNAVAILABLE" | "INTEGRITY_MISMATCH" | "NOT_FOUND" | "CONTENT_ACCESS_DENIED" | "UNSUPPORTED_RESOURCE")[];
|
|
189
|
+
assessedAt: string;
|
|
190
|
+
};
|
|
191
|
+
representation: {
|
|
192
|
+
state: "MISSING" | "UNSUPPORTED" | "INTEGRITY_MISMATCH" | "READY" | "DENIED";
|
|
193
|
+
format: "JSON" | "BYTES";
|
|
194
|
+
transfer: "UNSUPPORTED" | "VERIFIED_STREAM" | "BUFFERED_JSON";
|
|
195
|
+
contentHash: string | null;
|
|
196
|
+
mediaType: string;
|
|
197
|
+
byteLength: number | null;
|
|
198
|
+
methods: ("HEAD" | "GET")[];
|
|
199
|
+
range: "NONE" | "SINGLE";
|
|
200
|
+
verification: "ON_READ";
|
|
201
|
+
verificationChunkBytes: number | null;
|
|
202
|
+
};
|
|
203
|
+
}[];
|
|
204
|
+
nextAfter: string | null;
|
|
205
|
+
}>;
|
|
206
|
+
pageMaterialMedia(ref: string, options?: {
|
|
207
|
+
afterOrdinal?: number;
|
|
208
|
+
limit?: number;
|
|
209
|
+
documentRef?: string;
|
|
210
|
+
}): Promise<{
|
|
211
|
+
schemaVersion: 2;
|
|
212
|
+
projectKey: string;
|
|
213
|
+
ref: string;
|
|
214
|
+
sourceContentHash: string;
|
|
215
|
+
documentRef: string | null;
|
|
216
|
+
documentContentHash: string | null;
|
|
217
|
+
state: "MISSING" | "UNSUPPORTED" | "INTEGRITY_MISMATCH" | "READY" | "DENIED";
|
|
218
|
+
items: {
|
|
219
|
+
ordinal: number;
|
|
220
|
+
kind: "IMAGE" | "AUDIO" | "VIDEO";
|
|
221
|
+
sourceUrl: string;
|
|
222
|
+
canonicalUrl: string | null;
|
|
223
|
+
availability: "UNAVAILABLE" | "MIRRORED" | "REMOTE_ONLY";
|
|
224
|
+
mediaRef: string | null;
|
|
225
|
+
contentHash: string | null;
|
|
226
|
+
mediaType: string | null;
|
|
227
|
+
byteLength: number | null;
|
|
228
|
+
state: "MISSING" | "UNAVAILABLE" | "INTEGRITY_MISMATCH" | "READY" | "DENIED" | "REMOTE_ONLY";
|
|
229
|
+
representation: {
|
|
230
|
+
state: "MISSING" | "UNSUPPORTED" | "INTEGRITY_MISMATCH" | "READY" | "DENIED";
|
|
231
|
+
format: "JSON" | "BYTES";
|
|
232
|
+
transfer: "UNSUPPORTED" | "VERIFIED_STREAM" | "BUFFERED_JSON";
|
|
233
|
+
contentHash: string | null;
|
|
234
|
+
mediaType: string;
|
|
235
|
+
byteLength: number | null;
|
|
236
|
+
methods: ("HEAD" | "GET")[];
|
|
237
|
+
range: "NONE" | "SINGLE";
|
|
238
|
+
verification: "ON_READ";
|
|
239
|
+
verificationChunkBytes: number | null;
|
|
240
|
+
} | null;
|
|
241
|
+
}[];
|
|
242
|
+
nextAfterOrdinal: number | null;
|
|
243
|
+
}>;
|
|
244
|
+
getMaterialIndexStatus(options?: {
|
|
245
|
+
afterSourceKey?: string;
|
|
246
|
+
afterNodeId?: string;
|
|
247
|
+
sourceProjectKey?: string;
|
|
248
|
+
limit?: number;
|
|
249
|
+
}): Promise<{
|
|
250
|
+
schemaVersion: 2;
|
|
251
|
+
projectKey: string;
|
|
252
|
+
queryCoverage: "DESCRIPTIVE_METADATA_V1";
|
|
253
|
+
indexedFields: ["TITLE", "SUMMARY"];
|
|
254
|
+
bodyIndexed: false;
|
|
255
|
+
semanticIndexed: false;
|
|
256
|
+
items: {
|
|
257
|
+
sourceProjectKey: string;
|
|
258
|
+
nodeId: string;
|
|
259
|
+
directoryThroughSeq: number;
|
|
260
|
+
searchThroughSeq: number | null;
|
|
261
|
+
observedMaxSeq: number | null;
|
|
262
|
+
checkpointUpdatedAt: string | null;
|
|
263
|
+
state: "PARTIAL_BACKFILL" | "SYNCED_AS_OF_CHECKPOINT";
|
|
264
|
+
}[];
|
|
265
|
+
nextAfter: {
|
|
266
|
+
sourceProjectKey: string;
|
|
267
|
+
nodeId: string;
|
|
268
|
+
} | null;
|
|
269
|
+
}>;
|
|
270
|
+
openMaterialStream(ref: string, options?: MaterialStreamOptions): Promise<import("./material-stream.js").MaterialStreamResponse>;
|
|
271
|
+
getMaterialFile(ref: string): Promise<ServingContentResponse | ServingContentDecisionResponse>;
|
|
272
|
+
getContent(ref: string): Promise<ServingContentResponse | ServingContentDecisionResponse>;
|
|
273
|
+
getArtifactFile(ref: string): Promise<ServingContentResponse | ServingContentDecisionResponse>;
|
|
274
|
+
getMedia(ref: string): Promise<ServingContentResponse | ServingContentDecisionResponse>;
|
|
275
|
+
getEvidenceMedia(ref: string): Promise<ServingContentResponse | ServingContentDecisionResponse>;
|
|
276
|
+
/** 读取未经知识审核的原始 Evidence 文件;调用方仍需自己处理其时效与适用性。 */
|
|
277
|
+
getEvidenceFile(ref: string): Promise<ServingContentResponse | ServingContentDecisionResponse>;
|
|
278
|
+
}
|
|
279
|
+
export * from './tenant-management.js';
|
|
280
|
+
export * from './tenant-workspace.js';
|
|
281
|
+
export * from './tenant-project.js';
|
|
282
|
+
export * from './tenant-runtime.js';
|
|
283
|
+
export * from './tenant-web.js';
|
|
284
|
+
export * from './tenant-web-crawl.js';
|
|
285
|
+
export * from './tenant-web-dynamic.js';
|
|
286
|
+
export * from './tenant-web-content.js';
|
|
287
|
+
export * from './tenant-web-workflow.js';
|
|
288
|
+
export * from './agent-entry.js';
|
|
289
|
+
export * from './agent-guidance-error.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface MaterialStreamOptions {
|
|
2
|
+
range?: string;
|
|
3
|
+
head?: boolean;
|
|
4
|
+
signal?: AbortSignal;
|
|
5
|
+
expectedContentHash?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface MaterialStreamResponse {
|
|
8
|
+
status: 200 | 206;
|
|
9
|
+
contentClass: string;
|
|
10
|
+
contentHash: string;
|
|
11
|
+
mediaType: string;
|
|
12
|
+
contentLength: number;
|
|
13
|
+
contentRange: string | null;
|
|
14
|
+
body: ReadableStream<Uint8Array> | null;
|
|
15
|
+
verification: 'SERVER_VERIFIED_BEFORE_HEADERS';
|
|
16
|
+
}
|
|
17
|
+
/** Streaming does not buffer large payloads; the whole-object hash is not a hash of a Range segment. */
|
|
18
|
+
export declare function materialStream(fetchImpl: typeof fetch, url: URL, token: string, options: MaterialStreamOptions): Promise<MaterialStreamResponse>;
|