@opengeni/contracts 0.37.0 → 0.38.2
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/dist/{chunk-WVE7RAHN.js → chunk-Y7UWTT3T.js} +53 -4
- package/dist/chunk-Y7UWTT3T.js.map +1 -0
- package/dist/google-drive.js +1 -1
- package/dist/index.d.ts +30 -5
- package/dist/index.js +11 -1
- package/dist/workspace-state.d.ts +343 -0
- package/package.json +1 -1
- package/src/index.ts +11 -3
- package/src/workspace-state.ts +53 -0
- package/dist/chunk-WVE7RAHN.js.map +0 -1
package/src/workspace-state.ts
CHANGED
|
@@ -16,6 +16,7 @@ export const WORKSPACE_STATE_MAX_GAPS = 16;
|
|
|
16
16
|
export const WORKSPACE_STATE_BASE_NAME_MAX_CHARS = 160;
|
|
17
17
|
export const WORKSPACE_STATE_TOPIC_MAX_CHARS = 96;
|
|
18
18
|
export const WORKSPACE_STATE_MEMORY_SAMPLE_LIMIT = 100;
|
|
19
|
+
export const WORKSPACE_STATE_EXPORT_SCHEMA_VERSION = 1;
|
|
19
20
|
|
|
20
21
|
const Count = z.number().int().nonnegative();
|
|
21
22
|
|
|
@@ -46,6 +47,17 @@ export const WorkspaceStateSourceKindCounts = z
|
|
|
46
47
|
.strict();
|
|
47
48
|
export type WorkspaceStateSourceKindCounts = z.infer<typeof WorkspaceStateSourceKindCounts>;
|
|
48
49
|
|
|
50
|
+
export const WorkspaceStateDocumentAuthorityKindCounts = z
|
|
51
|
+
.object({
|
|
52
|
+
organization: Count,
|
|
53
|
+
workspace: Count,
|
|
54
|
+
personal: Count,
|
|
55
|
+
})
|
|
56
|
+
.strict();
|
|
57
|
+
export type WorkspaceStateDocumentAuthorityKindCounts = z.infer<
|
|
58
|
+
typeof WorkspaceStateDocumentAuthorityKindCounts
|
|
59
|
+
>;
|
|
60
|
+
|
|
49
61
|
export const WorkspaceStateMemoryStatusCounts = z
|
|
50
62
|
.object({
|
|
51
63
|
proposed: Count,
|
|
@@ -116,6 +128,22 @@ export const WorkspaceStatePolicy = z
|
|
|
116
128
|
})
|
|
117
129
|
.strict();
|
|
118
130
|
|
|
131
|
+
export const WorkspaceStatePreferences = z
|
|
132
|
+
.object({
|
|
133
|
+
authority: z.literal("preference_registry_preferences"),
|
|
134
|
+
activeDescriptorCount: Count.max(64),
|
|
135
|
+
activeDescriptorHash: z.string().regex(/^[0-9a-f]{64}$/),
|
|
136
|
+
scopeCounts: z
|
|
137
|
+
.object({
|
|
138
|
+
organization: Count,
|
|
139
|
+
workspace: Count,
|
|
140
|
+
user: Count,
|
|
141
|
+
})
|
|
142
|
+
.strict(),
|
|
143
|
+
truncated: z.boolean(),
|
|
144
|
+
})
|
|
145
|
+
.strict();
|
|
146
|
+
|
|
119
147
|
export const WorkspaceStateKnowledgeBase = z
|
|
120
148
|
.object({
|
|
121
149
|
id: z.string().uuid(),
|
|
@@ -164,6 +192,7 @@ export const WorkspaceStateKnowledgeAvailable = z
|
|
|
164
192
|
inspectedVisibleDocumentCount: Count,
|
|
165
193
|
documentStatusCounts: WorkspaceStateDocumentStatusCounts,
|
|
166
194
|
sourceKindCounts: WorkspaceStateSourceKindCounts,
|
|
195
|
+
authorityKindCounts: WorkspaceStateDocumentAuthorityKindCounts,
|
|
167
196
|
topics: z.array(WorkspaceStateTopic).max(WORKSPACE_STATE_MAX_TOPICS),
|
|
168
197
|
topicsTruncated: z.boolean(),
|
|
169
198
|
latestDocumentUpdatedAt: z.string().datetime().nullable(),
|
|
@@ -323,7 +352,31 @@ export const WorkspaceStateResponse = z
|
|
|
323
352
|
})
|
|
324
353
|
.strict(),
|
|
325
354
|
policy: WorkspaceStatePolicy,
|
|
355
|
+
preferences: WorkspaceStatePreferences,
|
|
326
356
|
knowledge: WorkspaceStateKnowledge,
|
|
327
357
|
})
|
|
328
358
|
.strict();
|
|
329
359
|
export type WorkspaceStateResponse = z.infer<typeof WorkspaceStateResponse>;
|
|
360
|
+
|
|
361
|
+
export const WorkspaceStateExportOmission = z.enum([
|
|
362
|
+
"hidden_platform_prompts",
|
|
363
|
+
"policy_bodies",
|
|
364
|
+
"preference_content",
|
|
365
|
+
"document_content_and_private_metadata",
|
|
366
|
+
"memory_content_and_provenance",
|
|
367
|
+
"secret_values_and_credentials",
|
|
368
|
+
"session_messages_and_tool_outputs",
|
|
369
|
+
]);
|
|
370
|
+
export type WorkspaceStateExportOmission = z.infer<typeof WorkspaceStateExportOmission>;
|
|
371
|
+
|
|
372
|
+
export const WorkspaceStateExportResponse = z
|
|
373
|
+
.object({
|
|
374
|
+
kind: z.literal("opengeni.workspace_state.sanitized_export"),
|
|
375
|
+
schemaVersion: z.literal(WORKSPACE_STATE_EXPORT_SCHEMA_VERSION),
|
|
376
|
+
generatedAt: z.string().datetime(),
|
|
377
|
+
stateSha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
378
|
+
omissions: z.array(WorkspaceStateExportOmission).length(7),
|
|
379
|
+
state: WorkspaceStateResponse,
|
|
380
|
+
})
|
|
381
|
+
.strict();
|
|
382
|
+
export type WorkspaceStateExportResponse = z.infer<typeof WorkspaceStateExportResponse>;
|