@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,439 @@
|
|
|
1
|
+
/** Agent 的治理合同描述真实状态和下一步,不把写入权限解释为审核或正文权限。 */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const workflowPlanInputSchema: z.ZodObject<{
|
|
4
|
+
projectRef: z.ZodString;
|
|
5
|
+
ref: z.ZodString;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
export declare const workflowGuideInputSchema: z.ZodObject<{
|
|
8
|
+
projectRef: z.ZodString;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export declare const workflowActionSchema: z.ZodEnum<{
|
|
11
|
+
SUBMIT_REVIEW: "SUBMIT_REVIEW";
|
|
12
|
+
FINALIZE_REVIEW: "FINALIZE_REVIEW";
|
|
13
|
+
PREPARE_SOURCE: "PREPARE_SOURCE";
|
|
14
|
+
REGISTER: "REGISTER";
|
|
15
|
+
}>;
|
|
16
|
+
export declare const workflowAdvanceInputSchema: z.ZodObject<{
|
|
17
|
+
projectRef: z.ZodString;
|
|
18
|
+
ref: z.ZodString;
|
|
19
|
+
action: z.ZodEnum<{
|
|
20
|
+
SUBMIT_REVIEW: "SUBMIT_REVIEW";
|
|
21
|
+
FINALIZE_REVIEW: "FINALIZE_REVIEW";
|
|
22
|
+
PREPARE_SOURCE: "PREPARE_SOURCE";
|
|
23
|
+
REGISTER: "REGISTER";
|
|
24
|
+
}>;
|
|
25
|
+
expectedVersion: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
actedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
export declare const agentSubmitInputSchema: z.ZodObject<{
|
|
29
|
+
projectRef: z.ZodString;
|
|
30
|
+
sourceId: z.ZodString;
|
|
31
|
+
contentBase64: z.ZodString;
|
|
32
|
+
mediaType: z.ZodString;
|
|
33
|
+
access: z.ZodDefault<z.ZodEnum<{
|
|
34
|
+
PUBLIC: "PUBLIC";
|
|
35
|
+
TENANT: "TENANT";
|
|
36
|
+
INTERNAL: "INTERNAL";
|
|
37
|
+
FDE_INTERNAL: "FDE_INTERNAL";
|
|
38
|
+
}>>;
|
|
39
|
+
submittedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
40
|
+
freshnessSeconds: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
export declare const workflowNextActionSchema: z.ZodObject<{
|
|
43
|
+
id: z.ZodString;
|
|
44
|
+
tool: z.ZodNullable<z.ZodString>;
|
|
45
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
46
|
+
requiredScopes: z.ZodArray<z.ZodString>;
|
|
47
|
+
missingScopes: z.ZodArray<z.ZodString>;
|
|
48
|
+
missingFields: z.ZodArray<z.ZodString>;
|
|
49
|
+
canExecute: z.ZodBoolean;
|
|
50
|
+
automatic: z.ZodBoolean;
|
|
51
|
+
reasonCode: z.ZodString;
|
|
52
|
+
cli: z.ZodObject<{
|
|
53
|
+
command: z.ZodString;
|
|
54
|
+
flags: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
55
|
+
}, z.core.$strict>;
|
|
56
|
+
http: z.ZodObject<{
|
|
57
|
+
method: z.ZodLiteral<"POST">;
|
|
58
|
+
path: z.ZodLiteral<"/mcp/management">;
|
|
59
|
+
tool: z.ZodNullable<z.ZodString>;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
}, z.core.$strict>;
|
|
62
|
+
declare const readDecision: z.ZodObject<{
|
|
63
|
+
action: z.ZodEnum<{
|
|
64
|
+
ALLOW: "ALLOW";
|
|
65
|
+
REVIEW_REQUIRED: "REVIEW_REQUIRED";
|
|
66
|
+
DENY: "DENY";
|
|
67
|
+
}>;
|
|
68
|
+
reasonCodes: z.ZodArray<z.ZodString>;
|
|
69
|
+
authority: z.ZodEnum<{
|
|
70
|
+
AUTHENTICATED_READER: "AUTHENTICATED_READER";
|
|
71
|
+
LOCAL_PROFILE_SIMULATION: "LOCAL_PROFILE_SIMULATION";
|
|
72
|
+
}>;
|
|
73
|
+
}, z.core.$strict>;
|
|
74
|
+
export declare const workflowPlanSchema: z.ZodObject<{
|
|
75
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
76
|
+
projectRef: z.ZodString;
|
|
77
|
+
ref: z.ZodString;
|
|
78
|
+
contentHash: z.ZodString;
|
|
79
|
+
kind: z.ZodString;
|
|
80
|
+
version: z.ZodNullable<z.ZodNumber>;
|
|
81
|
+
status: z.ZodUnion<[z.ZodEnum<{
|
|
82
|
+
GENERATED: "GENERATED";
|
|
83
|
+
DRAFT: "DRAFT";
|
|
84
|
+
READY_FOR_REVIEW: "READY_FOR_REVIEW";
|
|
85
|
+
REWORK_REQUIRED: "REWORK_REQUIRED";
|
|
86
|
+
APPROVED: "APPROVED";
|
|
87
|
+
REJECTED: "REJECTED";
|
|
88
|
+
SUPERSEDED: "SUPERSEDED";
|
|
89
|
+
}>, z.ZodEnum<{
|
|
90
|
+
RAW_MATERIAL: "RAW_MATERIAL";
|
|
91
|
+
RAW_EVIDENCE: "RAW_EVIDENCE";
|
|
92
|
+
}>]>;
|
|
93
|
+
productionPhase: z.ZodEnum<{
|
|
94
|
+
REGISTERED: "REGISTERED";
|
|
95
|
+
PERSISTED: "PERSISTED";
|
|
96
|
+
CATALOG_PROJECTED: "CATALOG_PROJECTED";
|
|
97
|
+
}>;
|
|
98
|
+
rawMaterialAvailable: z.ZodNullable<z.ZodBoolean>;
|
|
99
|
+
readiness: z.ZodNullable<z.ZodObject<{
|
|
100
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
101
|
+
profile: z.ZodEnum<{
|
|
102
|
+
HUMAN_ARTICLE_V1: "HUMAN_ARTICLE_V1";
|
|
103
|
+
KNOWLEDGE_CARD_V1: "KNOWLEDGE_CARD_V1";
|
|
104
|
+
}>;
|
|
105
|
+
ready: z.ZodBoolean;
|
|
106
|
+
reasons: z.ZodArray<z.ZodEnum<{
|
|
107
|
+
ROLE_MISMATCH: "ROLE_MISMATCH";
|
|
108
|
+
TITLE_REQUIRED: "TITLE_REQUIRED";
|
|
109
|
+
SUMMARY_REQUIRED: "SUMMARY_REQUIRED";
|
|
110
|
+
TEXT_TOO_SHORT: "TEXT_TOO_SHORT";
|
|
111
|
+
STRUCTURE_TOO_THIN: "STRUCTURE_TOO_THIN";
|
|
112
|
+
SOURCE_EVIDENCE_REQUIRED: "SOURCE_EVIDENCE_REQUIRED";
|
|
113
|
+
CITATION_COVERAGE_REQUIRED: "CITATION_COVERAGE_REQUIRED";
|
|
114
|
+
EVIDENCE_MISMATCH: "EVIDENCE_MISMATCH";
|
|
115
|
+
MEDIA_UNAVAILABLE: "MEDIA_UNAVAILABLE";
|
|
116
|
+
}>>;
|
|
117
|
+
metrics: z.ZodObject<{
|
|
118
|
+
textCharacters: z.ZodNumber;
|
|
119
|
+
blockCount: z.ZodNumber;
|
|
120
|
+
textBlockCount: z.ZodNumber;
|
|
121
|
+
mediaBlockCount: z.ZodNumber;
|
|
122
|
+
sourceEvidenceCount: z.ZodNumber;
|
|
123
|
+
citationCount: z.ZodNumber;
|
|
124
|
+
citedBlockCount: z.ZodNumber;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
}, z.core.$strict>>;
|
|
127
|
+
reviewRef: z.ZodNullable<z.ZodString>;
|
|
128
|
+
reviewDecision: z.ZodNullable<z.ZodEnum<{
|
|
129
|
+
PASS: "PASS";
|
|
130
|
+
REWORK: "REWORK";
|
|
131
|
+
REJECT: "REJECT";
|
|
132
|
+
}>>;
|
|
133
|
+
support: z.ZodNullable<z.ZodObject<{
|
|
134
|
+
action: z.ZodEnum<{
|
|
135
|
+
ALLOW: "ALLOW";
|
|
136
|
+
REVIEW_REQUIRED: "REVIEW_REQUIRED";
|
|
137
|
+
DENY: "DENY";
|
|
138
|
+
}>;
|
|
139
|
+
reasonCodes: z.ZodArray<z.ZodString>;
|
|
140
|
+
missingEvidenceRefs: z.ZodArray<z.ZodString>;
|
|
141
|
+
}, z.core.$strict>>;
|
|
142
|
+
governedPolicyReady: z.ZodBoolean;
|
|
143
|
+
consumerReadDecision: z.ZodNullable<z.ZodObject<{
|
|
144
|
+
action: z.ZodEnum<{
|
|
145
|
+
ALLOW: "ALLOW";
|
|
146
|
+
REVIEW_REQUIRED: "REVIEW_REQUIRED";
|
|
147
|
+
DENY: "DENY";
|
|
148
|
+
}>;
|
|
149
|
+
reasonCodes: z.ZodArray<z.ZodString>;
|
|
150
|
+
authority: z.ZodEnum<{
|
|
151
|
+
AUTHENTICATED_READER: "AUTHENTICATED_READER";
|
|
152
|
+
LOCAL_PROFILE_SIMULATION: "LOCAL_PROFILE_SIMULATION";
|
|
153
|
+
}>;
|
|
154
|
+
}, z.core.$strict>>;
|
|
155
|
+
externalReady: z.ZodBoolean;
|
|
156
|
+
successorRef: z.ZodNullable<z.ZodString>;
|
|
157
|
+
blockers: z.ZodArray<z.ZodString>;
|
|
158
|
+
nextActions: z.ZodArray<z.ZodObject<{
|
|
159
|
+
id: z.ZodString;
|
|
160
|
+
tool: z.ZodNullable<z.ZodString>;
|
|
161
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
162
|
+
requiredScopes: z.ZodArray<z.ZodString>;
|
|
163
|
+
missingScopes: z.ZodArray<z.ZodString>;
|
|
164
|
+
missingFields: z.ZodArray<z.ZodString>;
|
|
165
|
+
canExecute: z.ZodBoolean;
|
|
166
|
+
automatic: z.ZodBoolean;
|
|
167
|
+
reasonCode: z.ZodString;
|
|
168
|
+
cli: z.ZodObject<{
|
|
169
|
+
command: z.ZodString;
|
|
170
|
+
flags: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
171
|
+
}, z.core.$strict>;
|
|
172
|
+
http: z.ZodObject<{
|
|
173
|
+
method: z.ZodLiteral<"POST">;
|
|
174
|
+
path: z.ZodLiteral<"/mcp/management">;
|
|
175
|
+
tool: z.ZodNullable<z.ZodString>;
|
|
176
|
+
}, z.core.$strict>;
|
|
177
|
+
}, z.core.$strict>>;
|
|
178
|
+
}, z.core.$strict>;
|
|
179
|
+
export declare const workflowAdvanceResultSchema: z.ZodObject<{
|
|
180
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
181
|
+
action: z.ZodEnum<{
|
|
182
|
+
SUBMIT_REVIEW: "SUBMIT_REVIEW";
|
|
183
|
+
FINALIZE_REVIEW: "FINALIZE_REVIEW";
|
|
184
|
+
PREPARE_SOURCE: "PREPARE_SOURCE";
|
|
185
|
+
REGISTER: "REGISTER";
|
|
186
|
+
}>;
|
|
187
|
+
previousRef: z.ZodString;
|
|
188
|
+
inserted: z.ZodBoolean;
|
|
189
|
+
plan: z.ZodObject<{
|
|
190
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
191
|
+
projectRef: z.ZodString;
|
|
192
|
+
ref: z.ZodString;
|
|
193
|
+
contentHash: z.ZodString;
|
|
194
|
+
kind: z.ZodString;
|
|
195
|
+
version: z.ZodNullable<z.ZodNumber>;
|
|
196
|
+
status: z.ZodUnion<[z.ZodEnum<{
|
|
197
|
+
GENERATED: "GENERATED";
|
|
198
|
+
DRAFT: "DRAFT";
|
|
199
|
+
READY_FOR_REVIEW: "READY_FOR_REVIEW";
|
|
200
|
+
REWORK_REQUIRED: "REWORK_REQUIRED";
|
|
201
|
+
APPROVED: "APPROVED";
|
|
202
|
+
REJECTED: "REJECTED";
|
|
203
|
+
SUPERSEDED: "SUPERSEDED";
|
|
204
|
+
}>, z.ZodEnum<{
|
|
205
|
+
RAW_MATERIAL: "RAW_MATERIAL";
|
|
206
|
+
RAW_EVIDENCE: "RAW_EVIDENCE";
|
|
207
|
+
}>]>;
|
|
208
|
+
productionPhase: z.ZodEnum<{
|
|
209
|
+
REGISTERED: "REGISTERED";
|
|
210
|
+
PERSISTED: "PERSISTED";
|
|
211
|
+
CATALOG_PROJECTED: "CATALOG_PROJECTED";
|
|
212
|
+
}>;
|
|
213
|
+
rawMaterialAvailable: z.ZodNullable<z.ZodBoolean>;
|
|
214
|
+
readiness: z.ZodNullable<z.ZodObject<{
|
|
215
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
216
|
+
profile: z.ZodEnum<{
|
|
217
|
+
HUMAN_ARTICLE_V1: "HUMAN_ARTICLE_V1";
|
|
218
|
+
KNOWLEDGE_CARD_V1: "KNOWLEDGE_CARD_V1";
|
|
219
|
+
}>;
|
|
220
|
+
ready: z.ZodBoolean;
|
|
221
|
+
reasons: z.ZodArray<z.ZodEnum<{
|
|
222
|
+
ROLE_MISMATCH: "ROLE_MISMATCH";
|
|
223
|
+
TITLE_REQUIRED: "TITLE_REQUIRED";
|
|
224
|
+
SUMMARY_REQUIRED: "SUMMARY_REQUIRED";
|
|
225
|
+
TEXT_TOO_SHORT: "TEXT_TOO_SHORT";
|
|
226
|
+
STRUCTURE_TOO_THIN: "STRUCTURE_TOO_THIN";
|
|
227
|
+
SOURCE_EVIDENCE_REQUIRED: "SOURCE_EVIDENCE_REQUIRED";
|
|
228
|
+
CITATION_COVERAGE_REQUIRED: "CITATION_COVERAGE_REQUIRED";
|
|
229
|
+
EVIDENCE_MISMATCH: "EVIDENCE_MISMATCH";
|
|
230
|
+
MEDIA_UNAVAILABLE: "MEDIA_UNAVAILABLE";
|
|
231
|
+
}>>;
|
|
232
|
+
metrics: z.ZodObject<{
|
|
233
|
+
textCharacters: z.ZodNumber;
|
|
234
|
+
blockCount: z.ZodNumber;
|
|
235
|
+
textBlockCount: z.ZodNumber;
|
|
236
|
+
mediaBlockCount: z.ZodNumber;
|
|
237
|
+
sourceEvidenceCount: z.ZodNumber;
|
|
238
|
+
citationCount: z.ZodNumber;
|
|
239
|
+
citedBlockCount: z.ZodNumber;
|
|
240
|
+
}, z.core.$strict>;
|
|
241
|
+
}, z.core.$strict>>;
|
|
242
|
+
reviewRef: z.ZodNullable<z.ZodString>;
|
|
243
|
+
reviewDecision: z.ZodNullable<z.ZodEnum<{
|
|
244
|
+
PASS: "PASS";
|
|
245
|
+
REWORK: "REWORK";
|
|
246
|
+
REJECT: "REJECT";
|
|
247
|
+
}>>;
|
|
248
|
+
support: z.ZodNullable<z.ZodObject<{
|
|
249
|
+
action: z.ZodEnum<{
|
|
250
|
+
ALLOW: "ALLOW";
|
|
251
|
+
REVIEW_REQUIRED: "REVIEW_REQUIRED";
|
|
252
|
+
DENY: "DENY";
|
|
253
|
+
}>;
|
|
254
|
+
reasonCodes: z.ZodArray<z.ZodString>;
|
|
255
|
+
missingEvidenceRefs: z.ZodArray<z.ZodString>;
|
|
256
|
+
}, z.core.$strict>>;
|
|
257
|
+
governedPolicyReady: z.ZodBoolean;
|
|
258
|
+
consumerReadDecision: z.ZodNullable<z.ZodObject<{
|
|
259
|
+
action: z.ZodEnum<{
|
|
260
|
+
ALLOW: "ALLOW";
|
|
261
|
+
REVIEW_REQUIRED: "REVIEW_REQUIRED";
|
|
262
|
+
DENY: "DENY";
|
|
263
|
+
}>;
|
|
264
|
+
reasonCodes: z.ZodArray<z.ZodString>;
|
|
265
|
+
authority: z.ZodEnum<{
|
|
266
|
+
AUTHENTICATED_READER: "AUTHENTICATED_READER";
|
|
267
|
+
LOCAL_PROFILE_SIMULATION: "LOCAL_PROFILE_SIMULATION";
|
|
268
|
+
}>;
|
|
269
|
+
}, z.core.$strict>>;
|
|
270
|
+
externalReady: z.ZodBoolean;
|
|
271
|
+
successorRef: z.ZodNullable<z.ZodString>;
|
|
272
|
+
blockers: z.ZodArray<z.ZodString>;
|
|
273
|
+
nextActions: z.ZodArray<z.ZodObject<{
|
|
274
|
+
id: z.ZodString;
|
|
275
|
+
tool: z.ZodNullable<z.ZodString>;
|
|
276
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
277
|
+
requiredScopes: z.ZodArray<z.ZodString>;
|
|
278
|
+
missingScopes: z.ZodArray<z.ZodString>;
|
|
279
|
+
missingFields: z.ZodArray<z.ZodString>;
|
|
280
|
+
canExecute: z.ZodBoolean;
|
|
281
|
+
automatic: z.ZodBoolean;
|
|
282
|
+
reasonCode: z.ZodString;
|
|
283
|
+
cli: z.ZodObject<{
|
|
284
|
+
command: z.ZodString;
|
|
285
|
+
flags: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
286
|
+
}, z.core.$strict>;
|
|
287
|
+
http: z.ZodObject<{
|
|
288
|
+
method: z.ZodLiteral<"POST">;
|
|
289
|
+
path: z.ZodLiteral<"/mcp/management">;
|
|
290
|
+
tool: z.ZodNullable<z.ZodString>;
|
|
291
|
+
}, z.core.$strict>;
|
|
292
|
+
}, z.core.$strict>>;
|
|
293
|
+
}, z.core.$strict>;
|
|
294
|
+
}, z.core.$strict>;
|
|
295
|
+
export declare const workflowErrorSchema: z.ZodObject<{
|
|
296
|
+
errorCode: z.ZodString;
|
|
297
|
+
completedPhase: z.ZodOptional<z.ZodEnum<{
|
|
298
|
+
REGISTERED: "REGISTERED";
|
|
299
|
+
VALIDATED: "VALIDATED";
|
|
300
|
+
PERSISTED: "PERSISTED";
|
|
301
|
+
CATALOG_PROJECTED: "CATALOG_PROJECTED";
|
|
302
|
+
}>>;
|
|
303
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
304
|
+
}, z.core.$strict>;
|
|
305
|
+
export declare const workflowToolInputSchemas: {
|
|
306
|
+
readonly knowledge_workflow_guide: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
307
|
+
projectRef: z.ZodString;
|
|
308
|
+
}, z.core.$strict>>;
|
|
309
|
+
readonly knowledge_workflow_plan: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
310
|
+
projectRef: z.ZodString;
|
|
311
|
+
ref: z.ZodString;
|
|
312
|
+
}, z.core.$strict>>;
|
|
313
|
+
readonly knowledge_workflow_advance: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
314
|
+
projectRef: z.ZodString;
|
|
315
|
+
ref: z.ZodString;
|
|
316
|
+
action: z.ZodEnum<{
|
|
317
|
+
SUBMIT_REVIEW: "SUBMIT_REVIEW";
|
|
318
|
+
FINALIZE_REVIEW: "FINALIZE_REVIEW";
|
|
319
|
+
PREPARE_SOURCE: "PREPARE_SOURCE";
|
|
320
|
+
REGISTER: "REGISTER";
|
|
321
|
+
}>;
|
|
322
|
+
expectedVersion: z.ZodOptional<z.ZodNumber>;
|
|
323
|
+
actedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
324
|
+
}, z.core.$strict>>;
|
|
325
|
+
readonly knowledge_agent_submit: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
|
|
326
|
+
projectRef: z.ZodString;
|
|
327
|
+
sourceId: z.ZodString;
|
|
328
|
+
contentBase64: z.ZodString;
|
|
329
|
+
mediaType: z.ZodString;
|
|
330
|
+
access: z.ZodDefault<z.ZodEnum<{
|
|
331
|
+
PUBLIC: "PUBLIC";
|
|
332
|
+
TENANT: "TENANT";
|
|
333
|
+
INTERNAL: "INTERNAL";
|
|
334
|
+
FDE_INTERNAL: "FDE_INTERNAL";
|
|
335
|
+
}>>;
|
|
336
|
+
submittedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
337
|
+
freshnessSeconds: z.ZodOptional<z.ZodNumber>;
|
|
338
|
+
}, z.core.$strict>>;
|
|
339
|
+
};
|
|
340
|
+
export declare const workflowToolScopes: {
|
|
341
|
+
readonly knowledge_workflow_guide: "knowledge.workflow.read";
|
|
342
|
+
readonly knowledge_workflow_plan: "knowledge.workflow.read";
|
|
343
|
+
readonly knowledge_workflow_advance: "knowledge.workflow.read";
|
|
344
|
+
readonly knowledge_agent_submit: "knowledge.material.write";
|
|
345
|
+
};
|
|
346
|
+
export declare const workflowActionScopes: {
|
|
347
|
+
readonly PREPARE_SOURCE: "knowledge.compose";
|
|
348
|
+
readonly SUBMIT_REVIEW: "knowledge.compose";
|
|
349
|
+
readonly FINALIZE_REVIEW: "knowledge.approve";
|
|
350
|
+
readonly REGISTER: "knowledge.material.write";
|
|
351
|
+
};
|
|
352
|
+
export type WorkflowPlan = z.infer<typeof workflowPlanSchema>;
|
|
353
|
+
export type WorkflowNextAction = z.infer<typeof workflowNextActionSchema>;
|
|
354
|
+
export type WorkflowAction = z.infer<typeof workflowActionSchema>;
|
|
355
|
+
export type WorkflowReadDecision = z.infer<typeof readDecision>;
|
|
356
|
+
/** 网络成功和失败共享可发现 schema,阶段包含已经完成注册后的尾部失败。 */
|
|
357
|
+
export declare const agentSubmitResultSchema: z.ZodObject<{
|
|
358
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
359
|
+
production: z.ZodObject<{
|
|
360
|
+
phase: z.ZodEnum<{
|
|
361
|
+
REGISTERED: "REGISTERED";
|
|
362
|
+
CATALOG_PROJECTED: "CATALOG_PROJECTED";
|
|
363
|
+
}>;
|
|
364
|
+
ref: z.ZodString;
|
|
365
|
+
registered: z.ZodBoolean;
|
|
366
|
+
identity: z.ZodEnum<{
|
|
367
|
+
NOT_CONFIGURED: "NOT_CONFIGURED";
|
|
368
|
+
CONFIGURED: "CONFIGURED";
|
|
369
|
+
}>;
|
|
370
|
+
}, z.core.$strict>;
|
|
371
|
+
presentation: z.ZodNullable<z.ZodObject<{
|
|
372
|
+
documentRef: z.ZodString;
|
|
373
|
+
inserted: z.ZodBoolean;
|
|
374
|
+
contentHash: z.ZodString;
|
|
375
|
+
}, z.core.$strict>>;
|
|
376
|
+
evidenceRef: z.ZodString;
|
|
377
|
+
projectRef: z.ZodString;
|
|
378
|
+
contentHash: z.ZodString;
|
|
379
|
+
byteLength: z.ZodNumber;
|
|
380
|
+
inserted: z.ZodBoolean;
|
|
381
|
+
lifecycle: z.ZodLiteral<"QUEUED">;
|
|
382
|
+
contentClass: z.ZodLiteral<"RAW_EVIDENCE">;
|
|
383
|
+
nextStep: z.ZodObject<{
|
|
384
|
+
tool: z.ZodLiteral<"knowledge_workflow_plan">;
|
|
385
|
+
arguments: z.ZodObject<{
|
|
386
|
+
projectRef: z.ZodString;
|
|
387
|
+
ref: z.ZodString;
|
|
388
|
+
}, z.core.$strict>;
|
|
389
|
+
}, z.core.$strict>;
|
|
390
|
+
}, z.core.$strict>;
|
|
391
|
+
export declare const workflowToolOutputSchemas: {
|
|
392
|
+
readonly knowledge_workflow_guide: {
|
|
393
|
+
type: string;
|
|
394
|
+
oneOf: z.core.ZodStandardJSONSchemaPayload<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>[];
|
|
395
|
+
};
|
|
396
|
+
readonly knowledge_workflow_plan: {
|
|
397
|
+
type: string;
|
|
398
|
+
oneOf: z.core.ZodStandardJSONSchemaPayload<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>[];
|
|
399
|
+
};
|
|
400
|
+
readonly knowledge_workflow_advance: {
|
|
401
|
+
type: string;
|
|
402
|
+
oneOf: z.core.ZodStandardJSONSchemaPayload<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>[];
|
|
403
|
+
};
|
|
404
|
+
readonly knowledge_agent_submit: {
|
|
405
|
+
type: string;
|
|
406
|
+
oneOf: z.core.ZodStandardJSONSchemaPayload<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>[];
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
/** 同一份模型与参数 schema 供 CLI、MCP guide 和文档示例使用;不给 review 默认 PASS。 */
|
|
410
|
+
export declare function workflowGuide(): {
|
|
411
|
+
schemaVersion: number;
|
|
412
|
+
model: {
|
|
413
|
+
raw: string;
|
|
414
|
+
reviewed: string;
|
|
415
|
+
lifecycle: string[];
|
|
416
|
+
publication: string[];
|
|
417
|
+
};
|
|
418
|
+
rules: string[];
|
|
419
|
+
tools: Record<string, {
|
|
420
|
+
requiredScope: string;
|
|
421
|
+
inputSchema: unknown;
|
|
422
|
+
}>;
|
|
423
|
+
advanceScopes: {
|
|
424
|
+
readonly PREPARE_SOURCE: "knowledge.compose";
|
|
425
|
+
readonly SUBMIT_REVIEW: "knowledge.compose";
|
|
426
|
+
readonly FINALIZE_REVIEW: "knowledge.approve";
|
|
427
|
+
readonly REGISTER: "knowledge.material.write";
|
|
428
|
+
};
|
|
429
|
+
https: {
|
|
430
|
+
method: string;
|
|
431
|
+
path: string;
|
|
432
|
+
body: {
|
|
433
|
+
tool: string;
|
|
434
|
+
arguments: string;
|
|
435
|
+
};
|
|
436
|
+
authorization: string;
|
|
437
|
+
};
|
|
438
|
+
};
|
|
439
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
|
+
"version": "0.1.0-rc.1",
|
|
3
|
+
"private": false,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=24"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/SENLIN746/native-knowledge.git"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public",
|
|
15
|
+
"tag": "next",
|
|
16
|
+
"registry": "https://registry.npmjs.org/"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE"
|
|
22
|
+
],
|
|
2
23
|
"name": "@native-knowledge/knowledge-sdk",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
24
|
+
"description": "Governed native-knowledge clients for Node.js",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/types/sdk/index.d.ts",
|
|
28
|
+
"import": "./dist/index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"types": "./dist/types/sdk/index.d.ts",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"zod": "4.6.7",
|
|
34
|
+
"@types/node": "24.13.3"
|
|
35
|
+
}
|
|
36
|
+
}
|