@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,209 @@
1
+ import { z } from 'zod';
2
+ import type { RunReceipt } from './runtime.js';
3
+ export declare const tenantCollectionRequestAuthoritySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
+ type: z.ZodLiteral<"HOST">;
5
+ }, z.core.$strict>, z.ZodObject<{
6
+ type: z.ZodLiteral<"OAUTH">;
7
+ authorityVersion: z.ZodLiteral<2>;
8
+ clientId: z.ZodString;
9
+ grantId: z.ZodString;
10
+ resource: z.ZodString;
11
+ }, z.core.$strict>], "type">;
12
+ export declare function tenantCollectionRequestKey(requestId: string): string;
13
+ export declare function tenantCollectionRequestRef(tenantId: string, requestId: string): string;
14
+ export declare const tenantCollectionRequestSchema: z.ZodObject<{
15
+ schemaVersion: z.ZodLiteral<2>;
16
+ tenantId: z.ZodString;
17
+ requestId: z.ZodString;
18
+ requestRef: z.ZodString;
19
+ context: z.ZodDiscriminatedUnion<[z.ZodObject<{
20
+ type: z.ZodLiteral<"TENANT">;
21
+ tenantId: z.ZodString;
22
+ }, z.core.$strict>, z.ZodObject<{
23
+ type: z.ZodLiteral<"PROJECT">;
24
+ tenantId: z.ZodString;
25
+ projectKey: z.ZodString;
26
+ }, z.core.$strict>], "type">;
27
+ actor: z.ZodObject<{
28
+ tenantId: z.ZodString;
29
+ userId: z.ZodString;
30
+ agentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
31
+ }, z.core.$strict>;
32
+ authority: z.ZodDiscriminatedUnion<[z.ZodObject<{
33
+ type: z.ZodLiteral<"HOST">;
34
+ }, z.core.$strict>, z.ZodObject<{
35
+ type: z.ZodLiteral<"OAUTH">;
36
+ authorityVersion: z.ZodLiteral<2>;
37
+ clientId: z.ZodString;
38
+ grantId: z.ZodString;
39
+ resource: z.ZodString;
40
+ }, z.core.$strict>], "type">;
41
+ plan: z.ZodObject<{
42
+ schemaVersion: z.ZodLiteral<1>;
43
+ tenantId: z.ZodString;
44
+ source: z.ZodObject<{
45
+ schemaVersion: z.ZodLiteral<1>;
46
+ tenantId: z.ZodString;
47
+ sourceId: z.ZodString;
48
+ title: z.ZodString;
49
+ semantics: z.ZodObject<{
50
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
51
+ kind: z.ZodLiteral<"URL">;
52
+ locator: z.ZodURL;
53
+ }, z.core.$strict>, z.ZodObject<{
54
+ kind: z.ZodLiteral<"FILE">;
55
+ rootBinding: z.ZodString;
56
+ relativePath: z.ZodString;
57
+ }, z.core.$strict>, z.ZodObject<{
58
+ kind: z.ZodLiteral<"EXECUTOR">;
59
+ executorId: z.ZodString;
60
+ bindingRef: z.ZodDefault<z.ZodNullable<z.ZodString>>;
61
+ 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]>>]>>>;
62
+ }, z.core.$strict>], "kind">;
63
+ credential: z.ZodDiscriminatedUnion<[z.ZodObject<{
64
+ type: z.ZodLiteral<"PUBLIC">;
65
+ }, z.core.$strict>, z.ZodObject<{
66
+ type: z.ZodLiteral<"BOUND">;
67
+ bindingRef: z.ZodString;
68
+ revision: z.ZodString;
69
+ }, z.core.$strict>], "type">;
70
+ executionBinding: z.ZodDefault<z.ZodNullable<z.ZodObject<{
71
+ bindingRef: z.ZodString;
72
+ revision: z.ZodString;
73
+ }, z.core.$strict>>>;
74
+ access: z.ZodEnum<{
75
+ PUBLIC: "PUBLIC";
76
+ PUBLIC_METADATA: "PUBLIC_METADATA";
77
+ TENANT: "TENANT";
78
+ INTERNAL: "INTERNAL";
79
+ FDE_INTERNAL: "FDE_INTERNAL";
80
+ ACCESS_CONTROLLED: "ACCESS_CONTROLLED";
81
+ UNKNOWN: "UNKNOWN";
82
+ }>;
83
+ sourcePolicy: z.ZodObject<{
84
+ ref: z.ZodString;
85
+ revision: z.ZodString;
86
+ acquisition: z.ZodEnum<{
87
+ ALLOW: "ALLOW";
88
+ DENY: "DENY";
89
+ }>;
90
+ propagation: z.ZodEnum<{
91
+ TENANT_ONLY: "TENANT_ONLY";
92
+ SHARE_ALLOWED: "SHARE_ALLOWED";
93
+ PUBLIC_ALLOWED: "PUBLIC_ALLOWED";
94
+ }>;
95
+ }, z.core.$strict>;
96
+ region: z.ZodNullable<z.ZodString>;
97
+ representation: z.ZodObject<{
98
+ format: z.ZodEnum<{
99
+ RICH_DOCUMENT_V1: "RICH_DOCUMENT_V1";
100
+ RAW: "RAW";
101
+ }>;
102
+ extractor: z.ZodNullable<z.ZodObject<{
103
+ id: z.ZodString;
104
+ version: z.ZodString;
105
+ }, z.core.$strict>>;
106
+ }, z.core.$strict>;
107
+ }, z.core.$strict>;
108
+ sourceRef: z.ZodString;
109
+ revision: z.ZodString;
110
+ revisionRef: z.ZodString;
111
+ semanticKey: z.ZodString;
112
+ targetId: z.ZodString;
113
+ }, z.core.$strict>;
114
+ maxResourceBytes: z.ZodNumber;
115
+ revision: z.ZodString;
116
+ planRef: z.ZodString;
117
+ workloadId: z.ZodString;
118
+ }, z.core.$strict>;
119
+ trigger: z.ZodEnum<{
120
+ MANUAL: "MANUAL";
121
+ DUE: "DUE";
122
+ }>;
123
+ cycleId: z.ZodString;
124
+ batchId: z.ZodString;
125
+ batchRef: z.ZodString;
126
+ requestedAt: z.ZodISODateTime;
127
+ }, z.core.$strict>;
128
+ export declare const tenantCollectionCompletionSchema: z.ZodUnion<readonly [z.ZodObject<{
129
+ schemaVersion: z.ZodLiteral<1>;
130
+ tenantId: z.ZodString;
131
+ requestRef: z.ZodString;
132
+ batchRef: z.ZodString;
133
+ phase: z.ZodEnum<{
134
+ RAW_REGISTERED: "RAW_REGISTERED";
135
+ DERIVED_REGISTERED: "DERIVED_REGISTERED";
136
+ }>;
137
+ evidenceRef: z.ZodString;
138
+ contentHash: z.ZodString;
139
+ runId: z.ZodString;
140
+ runtimeNodeId: z.ZodString;
141
+ completedAt: z.ZodISODateTime;
142
+ }, z.core.$strict>, z.ZodObject<{
143
+ tenantId: z.ZodString;
144
+ requestRef: z.ZodString;
145
+ batchRef: z.ZodString;
146
+ evidenceRef: z.ZodString;
147
+ contentHash: z.ZodString;
148
+ runId: z.ZodString;
149
+ runtimeNodeId: z.ZodString;
150
+ completedAt: z.ZodISODateTime;
151
+ schemaVersion: z.ZodLiteral<2>;
152
+ phase: z.ZodLiteral<"DERIVED_REGISTERED">;
153
+ documentRef: z.ZodString;
154
+ }, z.core.$strict>]>;
155
+ export declare function assertTenantCollectionCompletion(request: TenantCollectionRequest, raw: unknown): {
156
+ schemaVersion: 1;
157
+ tenantId: string;
158
+ requestRef: string;
159
+ batchRef: string;
160
+ phase: "RAW_REGISTERED" | "DERIVED_REGISTERED";
161
+ evidenceRef: string;
162
+ contentHash: string;
163
+ runId: string;
164
+ runtimeNodeId: string;
165
+ completedAt: string;
166
+ } | {
167
+ tenantId: string;
168
+ requestRef: string;
169
+ batchRef: string;
170
+ evidenceRef: string;
171
+ contentHash: string;
172
+ runId: string;
173
+ runtimeNodeId: string;
174
+ completedAt: string;
175
+ schemaVersion: 2;
176
+ phase: "DERIVED_REGISTERED";
177
+ documentRef: string;
178
+ };
179
+ export type TenantCollectionRequest = z.infer<typeof tenantCollectionRequestSchema>;
180
+ export type TenantCollectionCompletion = z.infer<typeof tenantCollectionCompletionSchema>;
181
+ /** Admission retirement is not acquisition failure or business completion. */
182
+ export declare const TENANT_REQUEST_ADMISSION_STOP_CAPABILITY = "TENANT_REQUEST_ADMISSION_STOP_V1";
183
+ export declare const tenantCollectionAdmissionStopSchema: z.ZodObject<{
184
+ schemaVersion: z.ZodLiteral<1>;
185
+ tenantId: z.ZodString;
186
+ requestRef: z.ZodString;
187
+ requestHash: z.ZodString;
188
+ reason: z.ZodEnum<{
189
+ GRANT_REVOKED: "GRANT_REVOKED";
190
+ DELEGATION_SUPERSEDED: "DELEGATION_SUPERSEDED";
191
+ }>;
192
+ stoppedAt: z.ZodISODateTime;
193
+ }, z.core.$strict>;
194
+ export type TenantCollectionAdmissionStop = z.infer<typeof tenantCollectionAdmissionStopSchema>;
195
+ /** Acquisition outcome only: a failed request is neither completed nor delegation-retired. */
196
+ export declare const tenantCollectionFailureSchema: z.ZodObject<{
197
+ schemaVersion: z.ZodLiteral<1>;
198
+ tenantId: z.ZodString;
199
+ requestRef: z.ZodString;
200
+ requestHash: z.ZodString;
201
+ batchRef: z.ZodString;
202
+ runId: z.ZodString;
203
+ runtimeNodeId: z.ZodString;
204
+ receiptHash: z.ZodString;
205
+ failedAt: z.ZodISODateTime;
206
+ errorCode: z.ZodLiteral<"TENANT_SOURCE_HTTP_TERMINAL">;
207
+ }, z.core.$strict>;
208
+ export type TenantCollectionFailure = z.infer<typeof tenantCollectionFailureSchema>;
209
+ export declare function isTenantCollectionTerminalFailure(request: Pick<TenantCollectionRequest, 'plan' | 'batchRef'>, receipt: RunReceipt): boolean;
@@ -0,0 +1,199 @@
1
+ import { z } from 'zod';
2
+ import { type TenantSourceSnapshot } from './tenant-source.js';
3
+ export declare const tenantCollectionCycleSchema: z.ZodString;
4
+ export declare const tenantCollectionMaxBytesSchema: z.ZodNumber;
5
+ export declare const tenantCollectionPlanSchema: z.ZodObject<{
6
+ schemaVersion: z.ZodLiteral<1>;
7
+ tenantId: z.ZodString;
8
+ source: z.ZodObject<{
9
+ schemaVersion: z.ZodLiteral<1>;
10
+ tenantId: z.ZodString;
11
+ sourceId: z.ZodString;
12
+ title: z.ZodString;
13
+ semantics: 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
+ sourceRef: z.ZodString;
73
+ revision: z.ZodString;
74
+ revisionRef: z.ZodString;
75
+ semanticKey: z.ZodString;
76
+ targetId: z.ZodString;
77
+ }, z.core.$strict>;
78
+ maxResourceBytes: z.ZodNumber;
79
+ revision: z.ZodString;
80
+ planRef: z.ZodString;
81
+ workloadId: z.ZodString;
82
+ }, z.core.$strict>;
83
+ export declare function createTenantCollectionPlan(raw: TenantSourceSnapshot, maxBytes?: number): {
84
+ schemaVersion: 1;
85
+ tenantId: string;
86
+ source: {
87
+ schemaVersion: 1;
88
+ tenantId: string;
89
+ sourceId: string;
90
+ title: string;
91
+ semantics: {
92
+ target: {
93
+ kind: "EXECUTOR";
94
+ executorId: string;
95
+ bindingRef: string | null;
96
+ parameters: Record<string, string | number | boolean | (string | number | boolean | null)[] | null>;
97
+ } | {
98
+ kind: "URL";
99
+ locator: string;
100
+ } | {
101
+ kind: "FILE";
102
+ rootBinding: string;
103
+ relativePath: string;
104
+ };
105
+ credential: {
106
+ type: "PUBLIC";
107
+ } | {
108
+ type: "BOUND";
109
+ bindingRef: string;
110
+ revision: string;
111
+ };
112
+ executionBinding: {
113
+ bindingRef: string;
114
+ revision: string;
115
+ } | null;
116
+ access: "PUBLIC" | "PUBLIC_METADATA" | "TENANT" | "INTERNAL" | "FDE_INTERNAL" | "ACCESS_CONTROLLED" | "UNKNOWN";
117
+ sourcePolicy: {
118
+ ref: string;
119
+ revision: string;
120
+ acquisition: "ALLOW" | "DENY";
121
+ propagation: "TENANT_ONLY" | "SHARE_ALLOWED" | "PUBLIC_ALLOWED";
122
+ };
123
+ region: string | null;
124
+ representation: {
125
+ format: "RICH_DOCUMENT_V1" | "RAW";
126
+ extractor: {
127
+ id: string;
128
+ version: string;
129
+ } | null;
130
+ };
131
+ };
132
+ sourceRef: string;
133
+ revision: string;
134
+ revisionRef: string;
135
+ semanticKey: string;
136
+ targetId: string;
137
+ };
138
+ maxResourceBytes: number;
139
+ revision: string;
140
+ planRef: string;
141
+ workloadId: string;
142
+ };
143
+ export declare function parseTenantCollectionPlanRef(ref: string): {
144
+ storageKey: string;
145
+ revision: string;
146
+ } | null;
147
+ export declare function tenantCollectionBatchIdentity(tenantId: string, planRevision: string, trigger: 'MANUAL' | 'DUE', cycleId: string): {
148
+ batchId: string;
149
+ batchRef: string;
150
+ };
151
+ export declare function parseTenantCollectionBatchRef(ref: string): {
152
+ storageKey: string;
153
+ batchId: string;
154
+ } | null;
155
+ export declare function tenantCapturedEvidenceIdentity(input: {
156
+ tenantId: string;
157
+ batchRef: string;
158
+ sourceRevisionRef: string;
159
+ }): {
160
+ identityRef: string;
161
+ ref: string;
162
+ resourceId: string;
163
+ };
164
+ export declare const tenantCollectionBatchSchema: z.ZodObject<{
165
+ schemaVersion: z.ZodLiteral<2>;
166
+ tenantId: z.ZodString;
167
+ sourceId: z.ZodString;
168
+ sourceRevisionRef: z.ZodString;
169
+ planRef: z.ZodString;
170
+ planRevision: z.ZodString;
171
+ cycleId: z.ZodString;
172
+ trigger: z.ZodEnum<{
173
+ MANUAL: "MANUAL";
174
+ DUE: "DUE";
175
+ }>;
176
+ createdAt: z.ZodISODateTime;
177
+ batchId: z.ZodString;
178
+ batchRef: z.ZodString;
179
+ }, z.core.$strict>;
180
+ export type TenantCollectionPlan = z.infer<typeof tenantCollectionPlanSchema>;
181
+ export type TenantCollectionBatch = z.infer<typeof tenantCollectionBatchSchema>;
182
+ /** ACQUIRED 是原件事实;Catalog、登记和派生状态由各自阶段回执报告。 */
183
+ export declare const tenantCollectionCaptureSchema: z.ZodObject<{
184
+ schemaVersion: z.ZodLiteral<1>;
185
+ tenantId: z.ZodString;
186
+ batchRef: z.ZodString;
187
+ sourceRevisionRef: z.ZodString;
188
+ taskId: z.ZodString;
189
+ evidenceRef: z.ZodString;
190
+ contentHash: z.ZodString;
191
+ byteLength: z.ZodNumber;
192
+ mediaType: z.ZodString;
193
+ observedAt: z.ZodISODateTime;
194
+ finalLocator: z.ZodString;
195
+ httpStatus: z.ZodNullable<z.ZodNumber>;
196
+ acquisitionRevision: z.ZodNullable<z.ZodString>;
197
+ headersRecorded: z.ZodBoolean;
198
+ }, z.core.$strict>;
199
+ export type TenantCollectionCapture = z.infer<typeof tenantCollectionCaptureSchema>;
@@ -0,0 +1,117 @@
1
+ /** 原生资料的快照时效不把 raw carrier 冒充 Evidence,也不证明外部业务事实。 */
2
+ import { z } from 'zod';
3
+ export declare function tenantSnapshotDeclarationRef(tenantId: string, subjectRef: string): string;
4
+ export declare const tenantSnapshotDeclarationSchema: z.ZodObject<{
5
+ basis: z.ZodLiteral<"RETAINED_SNAPSHOT">;
6
+ snapshotAt: z.ZodISODateTime;
7
+ sourceRevisionRef: z.ZodOptional<z.ZodString>;
8
+ policy: z.ZodObject<{
9
+ schemaVersion: z.ZodLiteral<1>;
10
+ dueAfterSeconds: z.ZodNumber;
11
+ staleAfterSeconds: z.ZodNumber;
12
+ staleAction: z.ZodDefault<z.ZodEnum<{
13
+ ALLOW: "ALLOW";
14
+ REVIEW_REQUIRED: "REVIEW_REQUIRED";
15
+ DENY: "DENY";
16
+ }>>;
17
+ unknownAction: z.ZodDefault<z.ZodEnum<{
18
+ ALLOW: "ALLOW";
19
+ REVIEW_REQUIRED: "REVIEW_REQUIRED";
20
+ DENY: "DENY";
21
+ }>>;
22
+ blockedAction: z.ZodDefault<z.ZodEnum<{
23
+ ALLOW: "ALLOW";
24
+ REVIEW_REQUIRED: "REVIEW_REQUIRED";
25
+ DENY: "DENY";
26
+ }>>;
27
+ }, z.core.$strict>;
28
+ declaredAt: z.ZodISODateTime;
29
+ actor: z.ZodObject<{
30
+ tenantId: z.ZodString;
31
+ userId: z.ZodString;
32
+ agentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
33
+ }, z.core.$strict>;
34
+ authority: z.ZodDiscriminatedUnion<[z.ZodObject<{
35
+ type: z.ZodLiteral<"HOST">;
36
+ }, z.core.$strict>, z.ZodObject<{
37
+ type: z.ZodLiteral<"OAUTH">;
38
+ authorityVersion: z.ZodLiteral<2>;
39
+ clientId: z.ZodString;
40
+ grantId: z.ZodString;
41
+ resource: z.ZodString;
42
+ }, z.core.$strict>], "type">;
43
+ tenantId: z.ZodString;
44
+ subjectRef: z.ZodString;
45
+ resourceType: z.ZodString;
46
+ contentHash: z.ZodString;
47
+ schemaVersion: z.ZodLiteral<1>;
48
+ ref: z.ZodString;
49
+ }, z.core.$strict>;
50
+ export declare const tenantMaterialCurrentnessSchema: z.ZodObject<{
51
+ observedAt: z.ZodDefault<z.ZodNullable<z.ZodISODateTime>>;
52
+ sourceRevisionRef: z.ZodOptional<z.ZodString>;
53
+ lastAttemptAt: z.ZodDefault<z.ZodNullable<z.ZodISODateTime>>;
54
+ assessedAt: z.ZodISODateTime;
55
+ state: z.ZodEnum<{
56
+ UNKNOWN: "UNKNOWN";
57
+ DUE: "DUE";
58
+ CURRENT: "CURRENT";
59
+ STALE: "STALE";
60
+ BLOCKED: "BLOCKED";
61
+ }>;
62
+ action: z.ZodEnum<{
63
+ ALLOW: "ALLOW";
64
+ REVIEW_REQUIRED: "REVIEW_REQUIRED";
65
+ DENY: "DENY";
66
+ }>;
67
+ reasonCode: z.ZodEnum<{
68
+ CURRENT_WITHIN_CADENCE: "CURRENT_WITHIN_CADENCE";
69
+ REFRESH_DUE: "REFRESH_DUE";
70
+ STALE_AFTER_THRESHOLD: "STALE_AFTER_THRESHOLD";
71
+ SOURCE_BLOCKED: "SOURCE_BLOCKED";
72
+ SOURCE_CONTENT_CHANGED: "SOURCE_CONTENT_CHANGED";
73
+ NO_SUCCESSFUL_OBSERVATION: "NO_SUCCESSFUL_OBSERVATION";
74
+ }>;
75
+ policy: z.ZodObject<{
76
+ schemaVersion: z.ZodLiteral<1>;
77
+ dueAfterSeconds: z.ZodNumber;
78
+ staleAfterSeconds: z.ZodNumber;
79
+ staleAction: z.ZodDefault<z.ZodEnum<{
80
+ ALLOW: "ALLOW";
81
+ REVIEW_REQUIRED: "REVIEW_REQUIRED";
82
+ DENY: "DENY";
83
+ }>>;
84
+ unknownAction: z.ZodDefault<z.ZodEnum<{
85
+ ALLOW: "ALLOW";
86
+ REVIEW_REQUIRED: "REVIEW_REQUIRED";
87
+ DENY: "DENY";
88
+ }>>;
89
+ blockedAction: z.ZodDefault<z.ZodEnum<{
90
+ ALLOW: "ALLOW";
91
+ REVIEW_REQUIRED: "REVIEW_REQUIRED";
92
+ DENY: "DENY";
93
+ }>>;
94
+ }, z.core.$strict>;
95
+ lastSuccessAt: z.ZodDefault<z.ZodNullable<z.ZodISODateTime>>;
96
+ dueAt: z.ZodDefault<z.ZodNullable<z.ZodISODateTime>>;
97
+ staleAt: z.ZodDefault<z.ZodNullable<z.ZodISODateTime>>;
98
+ ageSeconds: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
99
+ basis: z.ZodLiteral<"RETAINED_SNAPSHOT">;
100
+ basisRef: z.ZodString;
101
+ declarationRef: z.ZodString;
102
+ tenantId: z.ZodString;
103
+ subjectRef: z.ZodString;
104
+ resourceType: z.ZodString;
105
+ contentHash: z.ZodString;
106
+ schemaVersion: z.ZodLiteral<2>;
107
+ subjectKind: z.ZodLiteral<"MATERIAL">;
108
+ }, z.core.$strict>;
109
+ export declare const tenantSnapshotInputSchema: z.ZodObject<{
110
+ requestId: z.ZodString;
111
+ subjectRef: z.ZodString;
112
+ expectedContentHash: z.ZodString;
113
+ freshnessSeconds: z.ZodNumber;
114
+ }, z.core.$strict>;
115
+ export type TenantSnapshotDeclaration = z.infer<typeof tenantSnapshotDeclarationSchema>;
116
+ export type TenantMaterialCurrentness = z.infer<typeof tenantMaterialCurrentnessSchema>;
117
+ export declare function tenantMaterialCurrentnessRevision(raw: TenantMaterialCurrentness): string;