@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.
Files changed (101) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +46 -2
  3. package/dist/index.js +6577 -0
  4. package/dist/types/contracts/artifact.d.ts +120 -0
  5. package/dist/types/contracts/collection-control.d.ts +160 -0
  6. package/dist/types/contracts/collection.d.ts +263 -0
  7. package/dist/types/contracts/common.d.ts +17 -0
  8. package/dist/types/contracts/currentness.d.ts +477 -0
  9. package/dist/types/contracts/event.d.ts +60 -0
  10. package/dist/types/contracts/evidence.d.ts +202 -0
  11. package/dist/types/contracts/index.d.ts +55 -0
  12. package/dist/types/contracts/material-capability.d.ts +88 -0
  13. package/dist/types/contracts/material-carrier.d.ts +104 -0
  14. package/dist/types/contracts/material-context.d.ts +28 -0
  15. package/dist/types/contracts/material-read.d.ts +152 -0
  16. package/dist/types/contracts/observation.d.ts +75 -0
  17. package/dist/types/contracts/persistence.d.ts +370 -0
  18. package/dist/types/contracts/project-intent.d.ts +218 -0
  19. package/dist/types/contracts/projection.d.ts +380 -0
  20. package/dist/types/contracts/public-reference.d.ts +237 -0
  21. package/dist/types/contracts/reference-record.d.ts +124 -0
  22. package/dist/types/contracts/remote-file.d.ts +128 -0
  23. package/dist/types/contracts/resource-scope.d.ts +40 -0
  24. package/dist/types/contracts/resource-transfer.d.ts +24 -0
  25. package/dist/types/contracts/review-packet.d.ts +274 -0
  26. package/dist/types/contracts/review-plane.d.ts +90 -0
  27. package/dist/types/contracts/rich-document.d.ts +641 -0
  28. package/dist/types/contracts/runtime-compatibility.d.ts +22 -0
  29. package/dist/types/contracts/runtime.d.ts +59 -0
  30. package/dist/types/contracts/scheduler.d.ts +348 -0
  31. package/dist/types/contracts/signal.d.ts +113 -0
  32. package/dist/types/contracts/source-governance.d.ts +375 -0
  33. package/dist/types/contracts/source.d.ts +62 -0
  34. package/dist/types/contracts/tenant-budget.d.ts +59 -0
  35. package/dist/types/contracts/tenant-collection-request.d.ts +209 -0
  36. package/dist/types/contracts/tenant-collection.d.ts +199 -0
  37. package/dist/types/contracts/tenant-currentness.d.ts +117 -0
  38. package/dist/types/contracts/tenant-management.d.ts +286 -0
  39. package/dist/types/contracts/tenant-material-api.d.ts +584 -0
  40. package/dist/types/contracts/tenant-pdf-text.d.ts +27 -0
  41. package/dist/types/contracts/tenant-project-control.d.ts +94 -0
  42. package/dist/types/contracts/tenant-public-reference.d.ts +179 -0
  43. package/dist/types/contracts/tenant-resource-api.d.ts +738 -0
  44. package/dist/types/contracts/tenant-resource.d.ts +298 -0
  45. package/dist/types/contracts/tenant-rich-document.d.ts +317 -0
  46. package/dist/types/contracts/tenant-source-binding.d.ts +44 -0
  47. package/dist/types/contracts/tenant-source-bridge.d.ts +70 -0
  48. package/dist/types/contracts/tenant-source-cutover.d.ts +226 -0
  49. package/dist/types/contracts/tenant-source-document.d.ts +163 -0
  50. package/dist/types/contracts/tenant-source-lease.d.ts +1 -0
  51. package/dist/types/contracts/tenant-source.d.ts +223 -0
  52. package/dist/types/contracts/tenant-web-collection.d.ts +287 -0
  53. package/dist/types/contracts/tenant-web-content-plan.d.ts +86 -0
  54. package/dist/types/contracts/tenant-web-content-result.d.ts +63 -0
  55. package/dist/types/contracts/tenant-web-content.d.ts +383 -0
  56. package/dist/types/contracts/tenant-web-crawl.d.ts +310 -0
  57. package/dist/types/contracts/tenant-web-dynamic.d.ts +698 -0
  58. package/dist/types/contracts/tenant-web-results.d.ts +66 -0
  59. package/dist/types/contracts/tenant-web-workflow.d.ts +494 -0
  60. package/dist/types/sdk/agent-entry.d.ts +291 -0
  61. package/dist/types/sdk/agent-guidance-error.d.ts +15 -0
  62. package/dist/types/sdk/index.d.ts +289 -0
  63. package/dist/types/sdk/material-stream.d.ts +18 -0
  64. package/dist/types/sdk/oauth.d.ts +268 -0
  65. package/dist/types/sdk/resource-integrity.d.ts +21 -0
  66. package/dist/types/sdk/resource.d.ts +88 -0
  67. package/dist/types/sdk/tenant-management.d.ts +240 -0
  68. package/dist/types/sdk/tenant-project.d.ts +57 -0
  69. package/dist/types/sdk/tenant-runtime.d.ts +174 -0
  70. package/dist/types/sdk/tenant-web-content.d.ts +44 -0
  71. package/dist/types/sdk/tenant-web-crawl.d.ts +42 -0
  72. package/dist/types/sdk/tenant-web-dynamic.d.ts +42 -0
  73. package/dist/types/sdk/tenant-web-workflow.d.ts +43 -0
  74. package/dist/types/sdk/tenant-web.d.ts +42 -0
  75. package/dist/types/sdk/tenant-workspace.d.ts +36 -0
  76. package/dist/types/sdk/transport.d.ts +16 -0
  77. package/dist/types/serving-contracts/agent-catalog.d.ts +70 -0
  78. package/dist/types/serving-contracts/agent-entry.d.ts +13148 -0
  79. package/dist/types/serving-contracts/agent-guidance-shapes.d.ts +263 -0
  80. package/dist/types/serving-contracts/agent-input-hints.d.ts +24 -0
  81. package/dist/types/serving-contracts/body-search.d.ts +231 -0
  82. package/dist/types/serving-contracts/consumer.d.ts +989 -0
  83. package/dist/types/serving-contracts/core.d.ts +333 -0
  84. package/dist/types/serving-contracts/http.d.ts +2874 -0
  85. package/dist/types/serving-contracts/index.d.ts +23 -0
  86. package/dist/types/serving-contracts/management.d.ts +424 -0
  87. package/dist/types/serving-contracts/material-capabilities.d.ts +508 -0
  88. package/dist/types/serving-contracts/material-index-status.d.ts +55 -0
  89. package/dist/types/serving-contracts/mcp.d.ts +2218 -0
  90. package/dist/types/serving-contracts/tenant-governance.d.ts +236 -0
  91. package/dist/types/serving-contracts/tenant-management.d.ts +6276 -0
  92. package/dist/types/serving-contracts/tenant-project.d.ts +7550 -0
  93. package/dist/types/serving-contracts/tenant-runtime.d.ts +9674 -0
  94. package/dist/types/serving-contracts/tenant-web-content.d.ts +4606 -0
  95. package/dist/types/serving-contracts/tenant-web-crawl.d.ts +2958 -0
  96. package/dist/types/serving-contracts/tenant-web-dynamic.d.ts +3902 -0
  97. package/dist/types/serving-contracts/tenant-web-workflow.d.ts +5750 -0
  98. package/dist/types/serving-contracts/tenant-web.d.ts +6418 -0
  99. package/dist/types/serving-contracts/tenant-workspace.d.ts +6451 -0
  100. package/dist/types/serving-contracts/workflow.d.ts +439 -0
  101. package/package.json +34 -4
@@ -0,0 +1,70 @@
1
+ /** 显式桥接预检确认获取语义;该请求不授予启停或修改工作归属的权限。 */
2
+ import { z } from 'zod';
3
+ export declare const tenantSourceBridgePreviewInputSchema: z.ZodObject<{
4
+ projectKey: z.ZodString;
5
+ legacySourceId: z.ZodString;
6
+ expectedLegacyRevisionRef: z.ZodString;
7
+ nativeSourceId: z.ZodString;
8
+ expectedNativeRevisionRef: z.ZodString;
9
+ confirmAcquisitionSemantics: z.ZodObject<{
10
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
11
+ kind: z.ZodLiteral<"URL">;
12
+ locator: z.ZodURL;
13
+ }, z.core.$strict>, z.ZodObject<{
14
+ kind: z.ZodLiteral<"FILE">;
15
+ rootBinding: z.ZodString;
16
+ relativePath: z.ZodString;
17
+ }, z.core.$strict>, z.ZodObject<{
18
+ kind: z.ZodLiteral<"EXECUTOR">;
19
+ executorId: z.ZodString;
20
+ bindingRef: z.ZodDefault<z.ZodNullable<z.ZodString>>;
21
+ parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>>;
22
+ }, z.core.$strict>], "kind">;
23
+ credential: z.ZodDiscriminatedUnion<[z.ZodObject<{
24
+ type: z.ZodLiteral<"PUBLIC">;
25
+ }, z.core.$strict>, z.ZodObject<{
26
+ type: z.ZodLiteral<"BOUND">;
27
+ bindingRef: z.ZodString;
28
+ revision: z.ZodString;
29
+ }, z.core.$strict>], "type">;
30
+ executionBinding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
31
+ bindingRef: z.ZodString;
32
+ revision: z.ZodString;
33
+ }, z.core.$strict>>>;
34
+ access: z.ZodEnum<{
35
+ PUBLIC: "PUBLIC";
36
+ PUBLIC_METADATA: "PUBLIC_METADATA";
37
+ TENANT: "TENANT";
38
+ INTERNAL: "INTERNAL";
39
+ FDE_INTERNAL: "FDE_INTERNAL";
40
+ ACCESS_CONTROLLED: "ACCESS_CONTROLLED";
41
+ UNKNOWN: "UNKNOWN";
42
+ }>;
43
+ sourcePolicy: z.ZodObject<{
44
+ ref: z.ZodString;
45
+ revision: z.ZodString;
46
+ acquisition: z.ZodEnum<{
47
+ ALLOW: "ALLOW";
48
+ DENY: "DENY";
49
+ }>;
50
+ propagation: z.ZodEnum<{
51
+ TENANT_ONLY: "TENANT_ONLY";
52
+ SHARE_ALLOWED: "SHARE_ALLOWED";
53
+ PUBLIC_ALLOWED: "PUBLIC_ALLOWED";
54
+ }>;
55
+ }, z.core.$strict>;
56
+ region: z.ZodNullable<z.ZodString>;
57
+ representation: z.ZodObject<{
58
+ format: z.ZodEnum<{
59
+ RICH_DOCUMENT_V1: "RICH_DOCUMENT_V1";
60
+ RAW: "RAW";
61
+ }>;
62
+ extractor: z.ZodNullable<z.ZodObject<{
63
+ id: z.ZodString;
64
+ version: z.ZodString;
65
+ }, z.core.$strict>>;
66
+ }, z.core.$strict>;
67
+ }, z.core.$strict>;
68
+ maxResourceBytes: z.ZodNumber;
69
+ }, z.core.$strict>;
70
+ export type TenantSourceBridgePreviewInput = z.infer<typeof tenantSourceBridgePreviewInputSchema>;
@@ -0,0 +1,226 @@
1
+ /** Host 维护切换的冻结事实;不从回执推断真实进程已退出。 */
2
+ import { z } from 'zod';
3
+ export declare const SOURCE_CUTOVER_FENCE_CAPABILITY: "SOURCE_CUTOVER_FENCE_V1";
4
+ export declare const sourceCutoverIdSchema: z.ZodString;
5
+ export declare const sourceCutoverKey: (id: string) => string;
6
+ export declare const sourceCutoverRef: (tenantId: string, id: string) => string;
7
+ export declare const sourceCutoverIntentSchema: z.ZodObject<{
8
+ schemaVersion: z.ZodLiteral<1>;
9
+ cutoverId: z.ZodString;
10
+ cutoverRef: z.ZodString;
11
+ tenantId: z.ZodString;
12
+ actor: z.ZodObject<{
13
+ tenantId: z.ZodString;
14
+ userId: z.ZodString;
15
+ agentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
16
+ }, z.core.$strict>;
17
+ createdAt: z.ZodISODateTime;
18
+ legacySource: z.ZodObject<{
19
+ schemaVersion: z.ZodLiteral<1>;
20
+ projectKey: z.ZodString;
21
+ actor: z.ZodObject<{
22
+ tenantId: z.ZodString;
23
+ userId: z.ZodString;
24
+ agentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
25
+ }, z.core.$strict>;
26
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
27
+ kind: z.ZodLiteral<"URL">;
28
+ locator: z.ZodURL;
29
+ }, z.core.$strict>, z.ZodObject<{
30
+ kind: z.ZodLiteral<"FILE">;
31
+ rootBinding: z.ZodString;
32
+ relativePath: z.ZodString;
33
+ }, z.core.$strict>, z.ZodObject<{
34
+ kind: z.ZodLiteral<"EXECUTOR">;
35
+ executorId: z.ZodString;
36
+ bindingRef: z.ZodDefault<z.ZodNullable<z.ZodString>>;
37
+ parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>>;
38
+ }, z.core.$strict>], "kind">;
39
+ enabled: z.ZodDefault<z.ZodBoolean>;
40
+ access: z.ZodDefault<z.ZodEnum<{
41
+ PUBLIC: "PUBLIC";
42
+ PUBLIC_METADATA: "PUBLIC_METADATA";
43
+ TENANT: "TENANT";
44
+ INTERNAL: "INTERNAL";
45
+ FDE_INTERNAL: "FDE_INTERNAL";
46
+ ACCESS_CONTROLLED: "ACCESS_CONTROLLED";
47
+ UNKNOWN: "UNKNOWN";
48
+ }>>;
49
+ scopeIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
50
+ sourceFamilies: z.ZodDefault<z.ZodArray<z.ZodString>>;
51
+ purpose: z.ZodDefault<z.ZodNullable<z.ZodString>>;
52
+ refresh: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
53
+ mode: z.ZodLiteral<"MANUAL">;
54
+ }, z.core.$strict>, z.ZodObject<{
55
+ mode: z.ZodLiteral<"INTERVAL">;
56
+ intervalSeconds: z.ZodNumber;
57
+ }, z.core.$strict>], "mode">>;
58
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
59
+ projectRef: z.ZodString;
60
+ projectIntentRef: z.ZodDefault<z.ZodNullable<z.ZodString>>;
61
+ targetId: z.ZodString;
62
+ sourceId: z.ZodString;
63
+ revisionId: z.ZodString;
64
+ sourceRef: z.ZodString;
65
+ revisionRef: z.ZodString;
66
+ }, z.core.$strict>;
67
+ plan: z.ZodObject<{
68
+ schemaVersion: z.ZodLiteral<1>;
69
+ tenantId: z.ZodString;
70
+ source: z.ZodObject<{
71
+ schemaVersion: z.ZodLiteral<1>;
72
+ tenantId: z.ZodString;
73
+ sourceId: z.ZodString;
74
+ title: z.ZodString;
75
+ semantics: z.ZodObject<{
76
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
77
+ kind: z.ZodLiteral<"URL">;
78
+ locator: z.ZodURL;
79
+ }, z.core.$strict>, z.ZodObject<{
80
+ kind: z.ZodLiteral<"FILE">;
81
+ rootBinding: z.ZodString;
82
+ relativePath: z.ZodString;
83
+ }, z.core.$strict>, z.ZodObject<{
84
+ kind: z.ZodLiteral<"EXECUTOR">;
85
+ executorId: z.ZodString;
86
+ bindingRef: z.ZodDefault<z.ZodNullable<z.ZodString>>;
87
+ parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>>;
88
+ }, z.core.$strict>], "kind">;
89
+ credential: z.ZodDiscriminatedUnion<[z.ZodObject<{
90
+ type: z.ZodLiteral<"PUBLIC">;
91
+ }, z.core.$strict>, z.ZodObject<{
92
+ type: z.ZodLiteral<"BOUND">;
93
+ bindingRef: z.ZodString;
94
+ revision: z.ZodString;
95
+ }, z.core.$strict>], "type">;
96
+ executionBinding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
97
+ bindingRef: z.ZodString;
98
+ revision: z.ZodString;
99
+ }, z.core.$strict>>>;
100
+ access: z.ZodEnum<{
101
+ PUBLIC: "PUBLIC";
102
+ PUBLIC_METADATA: "PUBLIC_METADATA";
103
+ TENANT: "TENANT";
104
+ INTERNAL: "INTERNAL";
105
+ FDE_INTERNAL: "FDE_INTERNAL";
106
+ ACCESS_CONTROLLED: "ACCESS_CONTROLLED";
107
+ UNKNOWN: "UNKNOWN";
108
+ }>;
109
+ sourcePolicy: z.ZodObject<{
110
+ ref: z.ZodString;
111
+ revision: z.ZodString;
112
+ acquisition: z.ZodEnum<{
113
+ ALLOW: "ALLOW";
114
+ DENY: "DENY";
115
+ }>;
116
+ propagation: z.ZodEnum<{
117
+ TENANT_ONLY: "TENANT_ONLY";
118
+ SHARE_ALLOWED: "SHARE_ALLOWED";
119
+ PUBLIC_ALLOWED: "PUBLIC_ALLOWED";
120
+ }>;
121
+ }, z.core.$strict>;
122
+ region: z.ZodNullable<z.ZodString>;
123
+ representation: z.ZodObject<{
124
+ format: z.ZodEnum<{
125
+ RICH_DOCUMENT_V1: "RICH_DOCUMENT_V1";
126
+ RAW: "RAW";
127
+ }>;
128
+ extractor: z.ZodNullable<z.ZodObject<{
129
+ id: z.ZodString;
130
+ version: z.ZodString;
131
+ }, z.core.$strict>>;
132
+ }, z.core.$strict>;
133
+ }, z.core.$strict>;
134
+ sourceRef: z.ZodString;
135
+ revision: z.ZodString;
136
+ revisionRef: z.ZodString;
137
+ semanticKey: z.ZodString;
138
+ targetId: z.ZodString;
139
+ }, z.core.$strict>;
140
+ maxResourceBytes: z.ZodNumber;
141
+ revision: z.ZodString;
142
+ planRef: z.ZodString;
143
+ workloadId: z.ZodString;
144
+ }, z.core.$strict>;
145
+ existingBinding: z.ZodNullable<z.ZodObject<{
146
+ schemaVersion: z.ZodLiteral<1>;
147
+ tenantId: z.ZodString;
148
+ projectKey: z.ZodString;
149
+ sourceId: z.ZodString;
150
+ revisionRef: z.ZodString;
151
+ generation: z.ZodNumber;
152
+ purpose: z.ZodString;
153
+ refresh: z.ZodDiscriminatedUnion<[z.ZodObject<{
154
+ mode: z.ZodLiteral<"MANUAL">;
155
+ }, z.core.$strict>, z.ZodObject<{
156
+ mode: z.ZodLiteral<"INTERVAL">;
157
+ intervalSeconds: z.ZodNumber;
158
+ }, z.core.$strict>], "mode">;
159
+ enabled: z.ZodBoolean;
160
+ demandContext: z.ZodObject<{
161
+ schemaVersion: z.ZodLiteral<1>;
162
+ projectIntentRef: z.ZodDefault<z.ZodNullable<z.ZodString>>;
163
+ scopeIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
164
+ sourceFamilies: z.ZodDefault<z.ZodArray<z.ZodString>>;
165
+ attentionNotes: z.ZodDefault<z.ZodNullable<z.ZodString>>;
166
+ }, z.core.$strict>;
167
+ origin: z.ZodEnum<{
168
+ MIGRATED_V13: "MIGRATED_V13";
169
+ EXPLICIT_V14: "EXPLICIT_V14";
170
+ }>;
171
+ actor: z.ZodNullable<z.ZodObject<{
172
+ tenantId: z.ZodString;
173
+ userId: z.ZodString;
174
+ agentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
175
+ }, z.core.$strict>>;
176
+ changedAt: z.ZodNullable<z.ZodISODateTime>;
177
+ }, z.core.$strict>>;
178
+ demandContext: z.ZodObject<{
179
+ schemaVersion: z.ZodLiteral<1>;
180
+ projectIntentRef: z.ZodDefault<z.ZodNullable<z.ZodString>>;
181
+ scopeIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
182
+ sourceFamilies: z.ZodDefault<z.ZodArray<z.ZodString>>;
183
+ attentionNotes: z.ZodDefault<z.ZodNullable<z.ZodString>>;
184
+ }, z.core.$strict>;
185
+ }, z.core.$strict>;
186
+ export declare const sourceCutoverStepNameSchema: z.ZodEnum<{
187
+ LEGACY_STOPPED: "LEGACY_STOPPED";
188
+ DRAINED: "DRAINED";
189
+ ACTIVATED: "ACTIVATED";
190
+ NATIVE_STOPPED: "NATIVE_STOPPED";
191
+ NATIVE_DRAINED: "NATIVE_DRAINED";
192
+ RESTORE_AUTHORIZED: "RESTORE_AUTHORIZED";
193
+ LEGACY_RESTORED: "LEGACY_RESTORED";
194
+ ROLLED_BACK: "ROLLED_BACK";
195
+ }>;
196
+ export declare const sourceCutoverStepSchema: z.ZodObject<{
197
+ schemaVersion: z.ZodLiteral<1>;
198
+ cutoverRef: z.ZodString;
199
+ step: z.ZodEnum<{
200
+ LEGACY_STOPPED: "LEGACY_STOPPED";
201
+ DRAINED: "DRAINED";
202
+ ACTIVATED: "ACTIVATED";
203
+ NATIVE_STOPPED: "NATIVE_STOPPED";
204
+ NATIVE_DRAINED: "NATIVE_DRAINED";
205
+ RESTORE_AUTHORIZED: "RESTORE_AUTHORIZED";
206
+ LEGACY_RESTORED: "LEGACY_RESTORED";
207
+ ROLLED_BACK: "ROLLED_BACK";
208
+ }>;
209
+ actor: z.ZodObject<{
210
+ tenantId: z.ZodString;
211
+ userId: z.ZodString;
212
+ agentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
213
+ }, z.core.$strict>;
214
+ at: z.ZodISODateTime;
215
+ details: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
216
+ }, z.core.$strict>;
217
+ export type SourceCutoverIntent = z.infer<typeof sourceCutoverIntentSchema>;
218
+ export type SourceCutoverStep = z.infer<typeof sourceCutoverStepSchema>;
219
+ export declare const sourceCutoverRuntimeProofSchema: z.ZodObject<{
220
+ nodeId: z.ZodString;
221
+ codeRevision: z.ZodString;
222
+ capability: z.ZodLiteral<"SOURCE_CUTOVER_FENCE_V1">;
223
+ unmanagedExecutions: z.ZodLiteral<"QUIESCED">;
224
+ observedAt: z.ZodISODateTime;
225
+ }, z.core.$strict>;
226
+ export type SourceCutoverRuntimeProof = z.infer<typeof sourceCutoverRuntimeProofSchema>;
@@ -0,0 +1,163 @@
1
+ /** 原生来源投影保留抽取结构,不借用 Project 身份或知识审核状态。 */
2
+ import { z } from 'zod';
3
+ import { type RichDocumentBlock } from './rich-document.js';
4
+ export declare const TENANT_SOURCE_DOCUMENT_MEDIA_TYPE = "application/vnd.knowledge-v2.tenant-source-document+json";
5
+ export declare const tenantSourceDocumentSchema: z.ZodObject<{
6
+ schemaVersion: z.ZodLiteral<1>;
7
+ title: z.ZodNullable<z.ZodString>;
8
+ summary: z.ZodNullable<z.ZodString>;
9
+ sourceContentHash: z.ZodString;
10
+ language: z.ZodNullable<z.ZodString>;
11
+ byline: z.ZodNullable<z.ZodString>;
12
+ blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ kind: z.ZodLiteral<"HEADING">;
14
+ level: z.ZodNumber;
15
+ text: z.ZodString;
16
+ inlines: z.ZodOptional<z.ZodArray<z.ZodObject<{
17
+ text: z.ZodString;
18
+ href: z.ZodNullable<z.ZodString>;
19
+ }, z.core.$strict>>>;
20
+ ordinal: z.ZodNumber;
21
+ }, z.core.$strict>, z.ZodObject<{
22
+ kind: z.ZodLiteral<"PARAGRAPH">;
23
+ text: z.ZodString;
24
+ inlines: z.ZodOptional<z.ZodArray<z.ZodObject<{
25
+ text: z.ZodString;
26
+ href: z.ZodNullable<z.ZodString>;
27
+ }, z.core.$strict>>>;
28
+ ordinal: z.ZodNumber;
29
+ }, z.core.$strict>, z.ZodObject<{
30
+ kind: z.ZodLiteral<"LIST_ITEM">;
31
+ text: z.ZodString;
32
+ ordered: z.ZodBoolean;
33
+ level: z.ZodNumber;
34
+ index: z.ZodNullable<z.ZodNumber>;
35
+ inlines: z.ZodOptional<z.ZodArray<z.ZodObject<{
36
+ text: z.ZodString;
37
+ href: z.ZodNullable<z.ZodString>;
38
+ }, z.core.$strict>>>;
39
+ ordinal: z.ZodNumber;
40
+ }, z.core.$strict>, z.ZodObject<{
41
+ kind: z.ZodLiteral<"QUOTE">;
42
+ text: z.ZodString;
43
+ inlines: z.ZodOptional<z.ZodArray<z.ZodObject<{
44
+ text: z.ZodString;
45
+ href: z.ZodNullable<z.ZodString>;
46
+ }, z.core.$strict>>>;
47
+ ordinal: z.ZodNumber;
48
+ }, z.core.$strict>, z.ZodObject<{
49
+ kind: z.ZodLiteral<"CODE">;
50
+ text: z.ZodString;
51
+ language: z.ZodNullable<z.ZodString>;
52
+ ordinal: z.ZodNumber;
53
+ }, z.core.$strict>, z.ZodObject<{
54
+ kind: z.ZodLiteral<"IMAGE">;
55
+ alt: z.ZodNullable<z.ZodString>;
56
+ width: z.ZodNullable<z.ZodNumber>;
57
+ height: z.ZodNullable<z.ZodNumber>;
58
+ ordinal: z.ZodNumber;
59
+ sourceUrl: z.ZodString;
60
+ canonicalUrl: z.ZodNullable<z.ZodString>;
61
+ availability: z.ZodEnum<{
62
+ MIRRORED: "MIRRORED";
63
+ REMOTE_ONLY: "REMOTE_ONLY";
64
+ UNAVAILABLE: "UNAVAILABLE";
65
+ }>;
66
+ mediaRef: z.ZodNullable<z.ZodString>;
67
+ evidenceRef: z.ZodNullable<z.ZodString>;
68
+ contentHash: z.ZodNullable<z.ZodString>;
69
+ mediaType: z.ZodNullable<z.ZodString>;
70
+ byteLength: z.ZodNullable<z.ZodNumber>;
71
+ caption: z.ZodNullable<z.ZodString>;
72
+ }, z.core.$strict>, z.ZodObject<{
73
+ kind: z.ZodLiteral<"VIDEO">;
74
+ title: z.ZodNullable<z.ZodString>;
75
+ posterUrl: z.ZodNullable<z.ZodString>;
76
+ posterEvidenceRef: z.ZodNullable<z.ZodString>;
77
+ ordinal: z.ZodNumber;
78
+ sourceUrl: z.ZodString;
79
+ canonicalUrl: z.ZodNullable<z.ZodString>;
80
+ availability: z.ZodEnum<{
81
+ MIRRORED: "MIRRORED";
82
+ REMOTE_ONLY: "REMOTE_ONLY";
83
+ UNAVAILABLE: "UNAVAILABLE";
84
+ }>;
85
+ mediaRef: z.ZodNullable<z.ZodString>;
86
+ evidenceRef: z.ZodNullable<z.ZodString>;
87
+ contentHash: z.ZodNullable<z.ZodString>;
88
+ mediaType: z.ZodNullable<z.ZodString>;
89
+ byteLength: z.ZodNullable<z.ZodNumber>;
90
+ caption: z.ZodNullable<z.ZodString>;
91
+ }, z.core.$strict>, z.ZodObject<{
92
+ kind: z.ZodLiteral<"AUDIO">;
93
+ title: z.ZodNullable<z.ZodString>;
94
+ ordinal: z.ZodNumber;
95
+ sourceUrl: z.ZodString;
96
+ canonicalUrl: z.ZodNullable<z.ZodString>;
97
+ availability: z.ZodEnum<{
98
+ MIRRORED: "MIRRORED";
99
+ REMOTE_ONLY: "REMOTE_ONLY";
100
+ UNAVAILABLE: "UNAVAILABLE";
101
+ }>;
102
+ mediaRef: z.ZodNullable<z.ZodString>;
103
+ evidenceRef: z.ZodNullable<z.ZodString>;
104
+ contentHash: z.ZodNullable<z.ZodString>;
105
+ mediaType: z.ZodNullable<z.ZodString>;
106
+ byteLength: z.ZodNullable<z.ZodNumber>;
107
+ caption: z.ZodNullable<z.ZodString>;
108
+ }, z.core.$strict>, z.ZodObject<{
109
+ kind: z.ZodLiteral<"EMBED">;
110
+ sourceUrl: z.ZodString;
111
+ provider: z.ZodNullable<z.ZodString>;
112
+ title: z.ZodNullable<z.ZodString>;
113
+ caption: z.ZodNullable<z.ZodString>;
114
+ ordinal: z.ZodNumber;
115
+ }, z.core.$strict>, z.ZodObject<{
116
+ kind: z.ZodLiteral<"DIVIDER">;
117
+ ordinal: z.ZodNumber;
118
+ }, z.core.$strict>, z.ZodObject<{
119
+ kind: z.ZodLiteral<"TABLE">;
120
+ rows: z.ZodArray<z.ZodObject<{
121
+ cells: z.ZodArray<z.ZodObject<{
122
+ text: z.ZodString;
123
+ header: z.ZodBoolean;
124
+ }, z.core.$strict>>;
125
+ }, z.core.$strict>>;
126
+ ordinal: z.ZodNumber;
127
+ }, z.core.$strict>], "kind">>;
128
+ citations: z.ZodDefault<z.ZodArray<z.ZodObject<{
129
+ blockOrdinal: z.ZodNumber;
130
+ evidenceRefs: z.ZodArray<z.ZodString>;
131
+ }, z.core.$strict>>>;
132
+ primarySourceEvidenceRef: z.ZodString;
133
+ mediaEvidenceRefs: z.ZodArray<z.ZodString>;
134
+ sourceUri: z.ZodString;
135
+ extractedAt: z.ZodISODateTime;
136
+ sourceEvidenceRefs: z.ZodArray<z.ZodString>;
137
+ sourceMediaType: z.ZodString;
138
+ sourceByteLength: z.ZodNumber;
139
+ publishedAt: z.ZodNullable<z.ZodISODateTime>;
140
+ topics: z.ZodOptional<z.ZodArray<z.ZodString>>;
141
+ textContent: z.ZodString;
142
+ extractor: z.ZodObject<{
143
+ id: z.ZodString;
144
+ version: z.ZodString;
145
+ }, z.core.$strict>;
146
+ format: z.ZodLiteral<"TENANT_RICH_SOURCE_DOCUMENT_V1">;
147
+ role: z.ZodLiteral<"SOURCE_MIRROR">;
148
+ tenantId: z.ZodString;
149
+ }, z.core.$strict>;
150
+ export type TenantSourceDocument = z.infer<typeof tenantSourceDocumentSchema>;
151
+ export type TenantRichMediaBlock = Extract<RichDocumentBlock, {
152
+ kind: 'IMAGE' | 'VIDEO' | 'AUDIO';
153
+ }>;
154
+ export declare function tenantSourceDocumentIdentity(tenantId: string, parentRef: string, documentContentHash: string): {
155
+ identityRef: string;
156
+ ref: string;
157
+ resourceId: string;
158
+ };
159
+ export declare function tenantSourceMediaIdentity(tenantId: string, parentRef: string, kind: string, url: string): {
160
+ identityRef: string;
161
+ ref: string;
162
+ resourceId: string;
163
+ };
@@ -0,0 +1 @@
1
+ export declare function tenantSourceLeaseKey(tenantId: string, sourceId: string): string;
@@ -0,0 +1,223 @@
1
+ /** 来源获取语义不包含用途、Project、调度启用或秘密;同 URL 不代表同一次获取权限。 */
2
+ import { z } from 'zod';
3
+ export declare const tenantSourceIdSchema: z.ZodString;
4
+ export declare const tenantSourceCredentialSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5
+ type: z.ZodLiteral<"PUBLIC">;
6
+ }, z.core.$strict>, z.ZodObject<{
7
+ type: z.ZodLiteral<"BOUND">;
8
+ bindingRef: z.ZodString;
9
+ revision: z.ZodString;
10
+ }, z.core.$strict>], "type">;
11
+ /** Shared Source/configuration rule: secrets never become acquisition locator parameters. */
12
+ export declare const isTenantSourceCredentialParameter: (key: string) => boolean;
13
+ export declare const tenantSourceSemanticsSchema: z.ZodObject<{
14
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
15
+ kind: z.ZodLiteral<"URL">;
16
+ locator: z.ZodURL;
17
+ }, z.core.$strict>, z.ZodObject<{
18
+ kind: z.ZodLiteral<"FILE">;
19
+ rootBinding: z.ZodString;
20
+ relativePath: z.ZodString;
21
+ }, z.core.$strict>, z.ZodObject<{
22
+ kind: z.ZodLiteral<"EXECUTOR">;
23
+ executorId: z.ZodString;
24
+ bindingRef: z.ZodDefault<z.ZodNullable<z.ZodString>>;
25
+ parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>>;
26
+ }, z.core.$strict>], "kind">;
27
+ credential: z.ZodDiscriminatedUnion<[z.ZodObject<{
28
+ type: z.ZodLiteral<"PUBLIC">;
29
+ }, z.core.$strict>, z.ZodObject<{
30
+ type: z.ZodLiteral<"BOUND">;
31
+ bindingRef: z.ZodString;
32
+ revision: z.ZodString;
33
+ }, z.core.$strict>], "type">;
34
+ executionBinding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
35
+ bindingRef: z.ZodString;
36
+ revision: z.ZodString;
37
+ }, z.core.$strict>>>;
38
+ access: z.ZodEnum<{
39
+ PUBLIC: "PUBLIC";
40
+ PUBLIC_METADATA: "PUBLIC_METADATA";
41
+ TENANT: "TENANT";
42
+ INTERNAL: "INTERNAL";
43
+ FDE_INTERNAL: "FDE_INTERNAL";
44
+ ACCESS_CONTROLLED: "ACCESS_CONTROLLED";
45
+ UNKNOWN: "UNKNOWN";
46
+ }>;
47
+ sourcePolicy: z.ZodObject<{
48
+ ref: z.ZodString;
49
+ revision: z.ZodString;
50
+ acquisition: z.ZodEnum<{
51
+ ALLOW: "ALLOW";
52
+ DENY: "DENY";
53
+ }>;
54
+ propagation: z.ZodEnum<{
55
+ TENANT_ONLY: "TENANT_ONLY";
56
+ SHARE_ALLOWED: "SHARE_ALLOWED";
57
+ PUBLIC_ALLOWED: "PUBLIC_ALLOWED";
58
+ }>;
59
+ }, z.core.$strict>;
60
+ region: z.ZodNullable<z.ZodString>;
61
+ representation: z.ZodObject<{
62
+ format: z.ZodEnum<{
63
+ RICH_DOCUMENT_V1: "RICH_DOCUMENT_V1";
64
+ RAW: "RAW";
65
+ }>;
66
+ extractor: z.ZodNullable<z.ZodObject<{
67
+ id: z.ZodString;
68
+ version: z.ZodString;
69
+ }, z.core.$strict>>;
70
+ }, z.core.$strict>;
71
+ }, z.core.$strict>;
72
+ export declare const tenantSourceBasisSchema: z.ZodObject<{
73
+ schemaVersion: z.ZodLiteral<1>;
74
+ tenantId: z.ZodString;
75
+ sourceId: z.ZodString;
76
+ title: z.ZodString;
77
+ semantics: z.ZodObject<{
78
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
79
+ kind: z.ZodLiteral<"URL">;
80
+ locator: z.ZodURL;
81
+ }, z.core.$strict>, z.ZodObject<{
82
+ kind: z.ZodLiteral<"FILE">;
83
+ rootBinding: z.ZodString;
84
+ relativePath: z.ZodString;
85
+ }, z.core.$strict>, z.ZodObject<{
86
+ kind: z.ZodLiteral<"EXECUTOR">;
87
+ executorId: z.ZodString;
88
+ bindingRef: z.ZodDefault<z.ZodNullable<z.ZodString>>;
89
+ parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>>;
90
+ }, z.core.$strict>], "kind">;
91
+ credential: z.ZodDiscriminatedUnion<[z.ZodObject<{
92
+ type: z.ZodLiteral<"PUBLIC">;
93
+ }, z.core.$strict>, z.ZodObject<{
94
+ type: z.ZodLiteral<"BOUND">;
95
+ bindingRef: z.ZodString;
96
+ revision: z.ZodString;
97
+ }, z.core.$strict>], "type">;
98
+ executionBinding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
99
+ bindingRef: z.ZodString;
100
+ revision: z.ZodString;
101
+ }, z.core.$strict>>>;
102
+ access: z.ZodEnum<{
103
+ PUBLIC: "PUBLIC";
104
+ PUBLIC_METADATA: "PUBLIC_METADATA";
105
+ TENANT: "TENANT";
106
+ INTERNAL: "INTERNAL";
107
+ FDE_INTERNAL: "FDE_INTERNAL";
108
+ ACCESS_CONTROLLED: "ACCESS_CONTROLLED";
109
+ UNKNOWN: "UNKNOWN";
110
+ }>;
111
+ sourcePolicy: z.ZodObject<{
112
+ ref: z.ZodString;
113
+ revision: z.ZodString;
114
+ acquisition: z.ZodEnum<{
115
+ ALLOW: "ALLOW";
116
+ DENY: "DENY";
117
+ }>;
118
+ propagation: z.ZodEnum<{
119
+ TENANT_ONLY: "TENANT_ONLY";
120
+ SHARE_ALLOWED: "SHARE_ALLOWED";
121
+ PUBLIC_ALLOWED: "PUBLIC_ALLOWED";
122
+ }>;
123
+ }, z.core.$strict>;
124
+ region: z.ZodNullable<z.ZodString>;
125
+ representation: z.ZodObject<{
126
+ format: z.ZodEnum<{
127
+ RICH_DOCUMENT_V1: "RICH_DOCUMENT_V1";
128
+ RAW: "RAW";
129
+ }>;
130
+ extractor: z.ZodNullable<z.ZodObject<{
131
+ id: z.ZodString;
132
+ version: z.ZodString;
133
+ }, z.core.$strict>>;
134
+ }, z.core.$strict>;
135
+ }, z.core.$strict>;
136
+ }, z.core.$strict>;
137
+ export declare function tenantSourceRef(tenantId: string, sourceId: string): string;
138
+ export declare function parseTenantSourceRevisionRef(ref: string): {
139
+ storageKey: string;
140
+ sourceId: string;
141
+ revision: string;
142
+ } | null;
143
+ /** 已正规化 basis 的唯一指纹算法,canonical reader 与 Identity 关系校验共用。 */
144
+ export declare function tenantSourceFingerprints(basis: TenantSourceBasis): {
145
+ sourceRef: string;
146
+ revision: string;
147
+ revisionRef: string;
148
+ semanticKey: string;
149
+ targetId: string;
150
+ };
151
+ export declare const tenantSourceSnapshotSchema: z.ZodObject<{
152
+ schemaVersion: z.ZodLiteral<1>;
153
+ tenantId: z.ZodString;
154
+ sourceId: z.ZodString;
155
+ title: z.ZodString;
156
+ semantics: z.ZodObject<{
157
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
158
+ kind: z.ZodLiteral<"URL">;
159
+ locator: z.ZodURL;
160
+ }, z.core.$strict>, z.ZodObject<{
161
+ kind: z.ZodLiteral<"FILE">;
162
+ rootBinding: z.ZodString;
163
+ relativePath: z.ZodString;
164
+ }, z.core.$strict>, z.ZodObject<{
165
+ kind: z.ZodLiteral<"EXECUTOR">;
166
+ executorId: z.ZodString;
167
+ bindingRef: z.ZodDefault<z.ZodNullable<z.ZodString>>;
168
+ parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>>;
169
+ }, z.core.$strict>], "kind">;
170
+ credential: z.ZodDiscriminatedUnion<[z.ZodObject<{
171
+ type: z.ZodLiteral<"PUBLIC">;
172
+ }, z.core.$strict>, z.ZodObject<{
173
+ type: z.ZodLiteral<"BOUND">;
174
+ bindingRef: z.ZodString;
175
+ revision: z.ZodString;
176
+ }, z.core.$strict>], "type">;
177
+ executionBinding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
178
+ bindingRef: z.ZodString;
179
+ revision: z.ZodString;
180
+ }, z.core.$strict>>>;
181
+ access: z.ZodEnum<{
182
+ PUBLIC: "PUBLIC";
183
+ PUBLIC_METADATA: "PUBLIC_METADATA";
184
+ TENANT: "TENANT";
185
+ INTERNAL: "INTERNAL";
186
+ FDE_INTERNAL: "FDE_INTERNAL";
187
+ ACCESS_CONTROLLED: "ACCESS_CONTROLLED";
188
+ UNKNOWN: "UNKNOWN";
189
+ }>;
190
+ sourcePolicy: z.ZodObject<{
191
+ ref: z.ZodString;
192
+ revision: z.ZodString;
193
+ acquisition: z.ZodEnum<{
194
+ ALLOW: "ALLOW";
195
+ DENY: "DENY";
196
+ }>;
197
+ propagation: z.ZodEnum<{
198
+ TENANT_ONLY: "TENANT_ONLY";
199
+ SHARE_ALLOWED: "SHARE_ALLOWED";
200
+ PUBLIC_ALLOWED: "PUBLIC_ALLOWED";
201
+ }>;
202
+ }, z.core.$strict>;
203
+ region: z.ZodNullable<z.ZodString>;
204
+ representation: z.ZodObject<{
205
+ format: z.ZodEnum<{
206
+ RICH_DOCUMENT_V1: "RICH_DOCUMENT_V1";
207
+ RAW: "RAW";
208
+ }>;
209
+ extractor: z.ZodNullable<z.ZodObject<{
210
+ id: z.ZodString;
211
+ version: z.ZodString;
212
+ }, z.core.$strict>>;
213
+ }, z.core.$strict>;
214
+ }, z.core.$strict>;
215
+ sourceRef: z.ZodString;
216
+ revision: z.ZodString;
217
+ revisionRef: z.ZodString;
218
+ semanticKey: z.ZodString;
219
+ targetId: z.ZodString;
220
+ }, z.core.$strict>;
221
+ export type TenantSourceBasis = z.infer<typeof tenantSourceBasisSchema>;
222
+ export type TenantSourceSemantics = z.infer<typeof tenantSourceSemanticsSchema>;
223
+ export type TenantSourceSnapshot = z.infer<typeof tenantSourceSnapshotSchema>;