vault-go 0.2.0 → 0.4.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 +3 -0
- package/dist/cloud.d.ts +8 -0
- package/dist/cloud.js +18 -0
- package/dist/server.js +33 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,7 +66,10 @@ renovação automática da sessão.
|
|
|
66
66
|
- `vault_go_search`: busca textual com ranking e trechos.
|
|
67
67
|
- `vault_go_timeline`: contexto anterior e posterior a uma memória.
|
|
68
68
|
- `vault_go_context`: contexto progressivo com limite de caracteres.
|
|
69
|
+
- `vault_go_file_context`: histórico ligado aos arquivos lidos ou modificados.
|
|
69
70
|
- `vault_go_stats`: contagens isoladas da conta.
|
|
71
|
+
- `vault_go_jobs`: fila PostgreSQL da conta, sem payload sensível.
|
|
72
|
+
- `vault_go_job_retry` e `vault_go_job_cancel`: controle idempotente do processamento.
|
|
70
73
|
- `vault_go_forget`: exclusão explícita de uma memória.
|
|
71
74
|
|
|
72
75
|
O recurso `vault-go://status` fornece o resumo sanitizado em JSON.
|
package/dist/cloud.d.ts
CHANGED
|
@@ -10,7 +10,11 @@ export interface VaultMemoryApi {
|
|
|
10
10
|
search(input: Record<string, unknown>): Promise<unknown>;
|
|
11
11
|
timeline(input: Record<string, unknown>): Promise<unknown>;
|
|
12
12
|
context(input: Record<string, unknown>): Promise<unknown>;
|
|
13
|
+
fileContext(input: Record<string, unknown>): Promise<unknown>;
|
|
13
14
|
stats(): Promise<unknown>;
|
|
15
|
+
jobs(input: Record<string, unknown>): Promise<unknown>;
|
|
16
|
+
retryJob(id: string): Promise<unknown>;
|
|
17
|
+
cancelJob(id: string): Promise<unknown>;
|
|
14
18
|
}
|
|
15
19
|
export declare class VaultCloudClient implements VaultMemoryApi {
|
|
16
20
|
private readonly home;
|
|
@@ -27,7 +31,11 @@ export declare class VaultCloudClient implements VaultMemoryApi {
|
|
|
27
31
|
search(input: Record<string, unknown>): Promise<unknown>;
|
|
28
32
|
timeline(input: Record<string, unknown>): Promise<unknown>;
|
|
29
33
|
context(input: Record<string, unknown>): Promise<unknown>;
|
|
34
|
+
fileContext(input: Record<string, unknown>): Promise<unknown>;
|
|
30
35
|
stats(): Promise<unknown>;
|
|
36
|
+
jobs(input: Record<string, unknown>): Promise<unknown>;
|
|
37
|
+
retryJob(id: string): Promise<unknown>;
|
|
38
|
+
cancelJob(id: string): Promise<unknown>;
|
|
31
39
|
private endpoint;
|
|
32
40
|
private accessToken;
|
|
33
41
|
private request;
|
package/dist/cloud.js
CHANGED
|
@@ -40,9 +40,27 @@ export class VaultCloudClient {
|
|
|
40
40
|
async context(input) {
|
|
41
41
|
return this.request('/memory/context', { method: 'POST', body: input });
|
|
42
42
|
}
|
|
43
|
+
async fileContext(input) {
|
|
44
|
+
return this.request('/memory/files/context', { method: 'POST', body: input });
|
|
45
|
+
}
|
|
43
46
|
async stats() {
|
|
44
47
|
return this.request('/memory/stats');
|
|
45
48
|
}
|
|
49
|
+
async jobs(input) {
|
|
50
|
+
const query = new URLSearchParams();
|
|
51
|
+
for (const [key, value] of Object.entries(input)) {
|
|
52
|
+
if (value !== undefined)
|
|
53
|
+
query.set(key, String(value));
|
|
54
|
+
}
|
|
55
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : '';
|
|
56
|
+
return this.request(`/memory/jobs${suffix}`);
|
|
57
|
+
}
|
|
58
|
+
async retryJob(id) {
|
|
59
|
+
return this.request(`/memory/jobs/${encodeURIComponent(id)}/retry`, { method: 'POST' });
|
|
60
|
+
}
|
|
61
|
+
async cancelJob(id) {
|
|
62
|
+
return this.request(`/memory/jobs/${encodeURIComponent(id)}/cancel`, { method: 'POST' });
|
|
63
|
+
}
|
|
46
64
|
endpoint(path) {
|
|
47
65
|
const base = validateApiUrl(loadConfig(this.home).apiUrl);
|
|
48
66
|
const prefix = base.pathname.replace(/\/$/u, '');
|
package/dist/server.js
CHANGED
|
@@ -141,12 +141,45 @@ export function createVaultGoServer(home = vaultHome(), cloud = new VaultCloudCl
|
|
|
141
141
|
},
|
|
142
142
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
143
143
|
}, async (input) => run(() => cloud.context(input)));
|
|
144
|
+
server.registerTool('vault_go_file_context', {
|
|
145
|
+
title: 'Contexto de arquivos',
|
|
146
|
+
description: 'Recupera memórias anteriores associadas a um ou mais arquivos do projeto.',
|
|
147
|
+
inputSchema: {
|
|
148
|
+
projectId: uuid,
|
|
149
|
+
paths: z.array(z.string().trim().min(1).max(2_000)).min(1).max(20),
|
|
150
|
+
limit: z.number().int().min(1).max(100).default(20),
|
|
151
|
+
maxChars: z.number().int().min(1_000).max(100_000).default(16_000),
|
|
152
|
+
},
|
|
153
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
154
|
+
}, async (input) => run(() => cloud.fileContext(input)));
|
|
144
155
|
server.registerTool('vault_go_stats', {
|
|
145
156
|
title: 'Estatísticas do Vault',
|
|
146
157
|
description: 'Mostra contagens da conta autenticada.',
|
|
147
158
|
inputSchema: {},
|
|
148
159
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
149
160
|
}, async () => run(() => cloud.stats()));
|
|
161
|
+
server.registerTool('vault_go_jobs', {
|
|
162
|
+
title: 'Fila de processamento',
|
|
163
|
+
description: 'Lista jobs da conta sem expor o conteúdo dos eventos.',
|
|
164
|
+
inputSchema: {
|
|
165
|
+
projectId: uuid.optional(),
|
|
166
|
+
status: z.enum(['queued', 'processing', 'completed', 'failed', 'cancelled']).optional(),
|
|
167
|
+
limit: z.number().int().min(1).max(200).default(20),
|
|
168
|
+
},
|
|
169
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
170
|
+
}, async (input) => run(() => cloud.jobs(input)));
|
|
171
|
+
server.registerTool('vault_go_job_retry', {
|
|
172
|
+
title: 'Reprocessar job',
|
|
173
|
+
description: 'Recoloca um job com falha ou cancelado na fila PostgreSQL.',
|
|
174
|
+
inputSchema: { id: uuid },
|
|
175
|
+
annotations: { readOnlyHint: false, idempotentHint: true, openWorldHint: true },
|
|
176
|
+
}, async ({ id }) => run(() => cloud.retryJob(id)));
|
|
177
|
+
server.registerTool('vault_go_job_cancel', {
|
|
178
|
+
title: 'Cancelar job',
|
|
179
|
+
description: 'Cancela de forma idempotente um job pendente ou em processamento.',
|
|
180
|
+
inputSchema: { id: uuid },
|
|
181
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true },
|
|
182
|
+
}, async ({ id }) => run(() => cloud.cancelJob(id)));
|
|
150
183
|
server.registerResource('vault-go-status', 'vault-go://status', {
|
|
151
184
|
title: 'Status do Vault Go',
|
|
152
185
|
description: 'Resumo sanitizado da conexão cloud.',
|