vault-go 0.4.0 → 0.5.0
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/README.md +1 -0
- package/dist/cloud.d.ts +4 -0
- package/dist/cloud.js +11 -0
- package/dist/server.js +29 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,6 +70,7 @@ renovação automática da sessão.
|
|
|
70
70
|
- `vault_go_stats`: contagens isoladas da conta.
|
|
71
71
|
- `vault_go_jobs`: fila PostgreSQL da conta, sem payload sensível.
|
|
72
72
|
- `vault_go_job_retry` e `vault_go_job_cancel`: controle idempotente do processamento.
|
|
73
|
+
- `vault_go_export` e `vault_go_import`: transporte JSON tenant-scoped, atômico e idempotente.
|
|
73
74
|
- `vault_go_forget`: exclusão explícita de uma memória.
|
|
74
75
|
|
|
75
76
|
O recurso `vault-go://status` fornece o resumo sanitizado em JSON.
|
package/dist/cloud.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export interface VaultMemoryApi {
|
|
|
15
15
|
jobs(input: Record<string, unknown>): Promise<unknown>;
|
|
16
16
|
retryJob(id: string): Promise<unknown>;
|
|
17
17
|
cancelJob(id: string): Promise<unknown>;
|
|
18
|
+
exportMemories(input: Record<string, unknown>): Promise<unknown>;
|
|
19
|
+
importMemories(input: Record<string, unknown>): Promise<unknown>;
|
|
18
20
|
}
|
|
19
21
|
export declare class VaultCloudClient implements VaultMemoryApi {
|
|
20
22
|
private readonly home;
|
|
@@ -36,6 +38,8 @@ export declare class VaultCloudClient implements VaultMemoryApi {
|
|
|
36
38
|
jobs(input: Record<string, unknown>): Promise<unknown>;
|
|
37
39
|
retryJob(id: string): Promise<unknown>;
|
|
38
40
|
cancelJob(id: string): Promise<unknown>;
|
|
41
|
+
exportMemories(input: Record<string, unknown>): Promise<unknown>;
|
|
42
|
+
importMemories(input: Record<string, unknown>): Promise<unknown>;
|
|
39
43
|
private endpoint;
|
|
40
44
|
private accessToken;
|
|
41
45
|
private request;
|
package/dist/cloud.js
CHANGED
|
@@ -61,6 +61,17 @@ export class VaultCloudClient {
|
|
|
61
61
|
async cancelJob(id) {
|
|
62
62
|
return this.request(`/memory/jobs/${encodeURIComponent(id)}/cancel`, { method: 'POST' });
|
|
63
63
|
}
|
|
64
|
+
async exportMemories(input) {
|
|
65
|
+
const query = new URLSearchParams();
|
|
66
|
+
for (const [key, value] of Object.entries(input)) {
|
|
67
|
+
if (value !== undefined)
|
|
68
|
+
query.set(key, String(value));
|
|
69
|
+
}
|
|
70
|
+
return this.request(`/memory/export?${query.toString()}`);
|
|
71
|
+
}
|
|
72
|
+
async importMemories(input) {
|
|
73
|
+
return this.request('/memory/import', { method: 'POST', body: input });
|
|
74
|
+
}
|
|
64
75
|
endpoint(path) {
|
|
65
76
|
const base = validateApiUrl(loadConfig(this.home).apiUrl);
|
|
66
77
|
const prefix = base.pathname.replace(/\/$/u, '');
|
package/dist/server.js
CHANGED
|
@@ -180,6 +180,35 @@ export function createVaultGoServer(home = vaultHome(), cloud = new VaultCloudCl
|
|
|
180
180
|
inputSchema: { id: uuid },
|
|
181
181
|
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true },
|
|
182
182
|
}, async ({ id }) => run(() => cloud.cancelJob(id)));
|
|
183
|
+
server.registerTool('vault_go_export', {
|
|
184
|
+
title: 'Exportar memórias',
|
|
185
|
+
description: 'Exporta um lote tenant-scoped em formato JSON versionado.',
|
|
186
|
+
inputSchema: {
|
|
187
|
+
projectId: uuid.optional(),
|
|
188
|
+
limit: z.number().int().min(1).max(1_000).default(500),
|
|
189
|
+
},
|
|
190
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
191
|
+
}, async (input) => run(() => cloud.exportMemories(input)));
|
|
192
|
+
server.registerTool('vault_go_import', {
|
|
193
|
+
title: 'Importar memórias',
|
|
194
|
+
description: 'Importa um lote atômico e idempotente em um projeto existente.',
|
|
195
|
+
inputSchema: {
|
|
196
|
+
projectId: uuid,
|
|
197
|
+
records: z.array(z.object({
|
|
198
|
+
sourceId: z.string().trim().min(1).max(500),
|
|
199
|
+
sessionId: uuid.optional(),
|
|
200
|
+
kind: z.string().trim().min(1).max(100).default('observation'),
|
|
201
|
+
memoryType: z.string().trim().min(1).max(100).default('discovery'),
|
|
202
|
+
title: z.string().trim().max(500).optional(),
|
|
203
|
+
content: z.string().trim().min(1).max(200_000),
|
|
204
|
+
facts: z.array(z.string().trim().min(1).max(2_000)).max(200).default([]),
|
|
205
|
+
concepts: z.array(z.string().trim().min(1).max(500)).max(200).default([]),
|
|
206
|
+
filesRead: z.array(z.string().trim().min(1).max(2_000)).max(500).default([]),
|
|
207
|
+
filesModified: z.array(z.string().trim().min(1).max(2_000)).max(500).default([]),
|
|
208
|
+
})).min(1).max(1_000),
|
|
209
|
+
},
|
|
210
|
+
annotations: { readOnlyHint: false, idempotentHint: true, openWorldHint: true },
|
|
211
|
+
}, async (input) => run(() => cloud.importMemories(input)));
|
|
183
212
|
server.registerResource('vault-go-status', 'vault-go://status', {
|
|
184
213
|
title: 'Status do Vault Go',
|
|
185
214
|
description: 'Resumo sanitizado da conexão cloud.',
|