vault-go 0.4.0 → 0.6.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 CHANGED
@@ -70,6 +70,8 @@ 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.
74
+ - `vault_go_embedding_status` e `vault_go_embedding_backfill`: busca híbrida e fila vetorial, sem expor chaves.
73
75
  - `vault_go_forget`: exclusão explícita de uma memória.
74
76
 
75
77
  O recurso `vault-go://status` fornece o resumo sanitizado em JSON.
package/dist/cloud.d.ts CHANGED
@@ -15,6 +15,10 @@ 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>;
20
+ embeddingStatus(): Promise<unknown>;
21
+ embeddingBackfill(): Promise<unknown>;
18
22
  }
19
23
  export declare class VaultCloudClient implements VaultMemoryApi {
20
24
  private readonly home;
@@ -36,6 +40,10 @@ export declare class VaultCloudClient implements VaultMemoryApi {
36
40
  jobs(input: Record<string, unknown>): Promise<unknown>;
37
41
  retryJob(id: string): Promise<unknown>;
38
42
  cancelJob(id: string): Promise<unknown>;
43
+ exportMemories(input: Record<string, unknown>): Promise<unknown>;
44
+ importMemories(input: Record<string, unknown>): Promise<unknown>;
45
+ embeddingStatus(): Promise<unknown>;
46
+ embeddingBackfill(): Promise<unknown>;
39
47
  private endpoint;
40
48
  private accessToken;
41
49
  private request;
package/dist/cloud.js CHANGED
@@ -61,6 +61,23 @@ 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
+ }
75
+ async embeddingStatus() {
76
+ return this.request('/memory/embeddings/status');
77
+ }
78
+ async embeddingBackfill() {
79
+ return this.request('/memory/embeddings/backfill', { method: 'POST' });
80
+ }
64
81
  endpoint(path) {
65
82
  const base = validateApiUrl(loadConfig(this.home).apiUrl);
66
83
  const prefix = base.pathname.replace(/\/$/u, '');
package/dist/server.js CHANGED
@@ -180,6 +180,47 @@ 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)));
212
+ server.registerTool('vault_go_embedding_status', {
213
+ title: 'Status da busca semântica',
214
+ description: 'Mostra provedor, modelo e fila de vetores sem revelar a chave.',
215
+ inputSchema: {},
216
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
217
+ }, async () => run(() => cloud.embeddingStatus()));
218
+ server.registerTool('vault_go_embedding_backfill', {
219
+ title: 'Atualizar vetores',
220
+ description: 'Agenda de forma idempotente o backfill semântico da conta autenticada.',
221
+ inputSchema: {},
222
+ annotations: { readOnlyHint: false, idempotentHint: true, openWorldHint: true },
223
+ }, async () => run(() => cloud.embeddingBackfill()));
183
224
  server.registerResource('vault-go-status', 'vault-go://status', {
184
225
  title: 'Status do Vault Go',
185
226
  description: 'Resumo sanitizado da conexão cloud.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vault-go",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Servidor MCP Bun para pesquisar e registrar memória na plataforma Vault.",
5
5
  "type": "module",
6
6
  "bin": {