vault-go 0.3.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 +2 -0
- package/dist/cloud.d.ts +6 -0
- package/dist/cloud.js +15 -0
- package/dist/server.js +22 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -68,6 +68,8 @@ renovação automática da sessão.
|
|
|
68
68
|
- `vault_go_context`: contexto progressivo com limite de caracteres.
|
|
69
69
|
- `vault_go_file_context`: histórico ligado aos arquivos lidos ou modificados.
|
|
70
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.
|
|
71
73
|
- `vault_go_forget`: exclusão explícita de uma memória.
|
|
72
74
|
|
|
73
75
|
O recurso `vault-go://status` fornece o resumo sanitizado em JSON.
|
package/dist/cloud.d.ts
CHANGED
|
@@ -12,6 +12,9 @@ export interface VaultMemoryApi {
|
|
|
12
12
|
context(input: Record<string, unknown>): Promise<unknown>;
|
|
13
13
|
fileContext(input: Record<string, unknown>): Promise<unknown>;
|
|
14
14
|
stats(): Promise<unknown>;
|
|
15
|
+
jobs(input: Record<string, unknown>): Promise<unknown>;
|
|
16
|
+
retryJob(id: string): Promise<unknown>;
|
|
17
|
+
cancelJob(id: string): Promise<unknown>;
|
|
15
18
|
}
|
|
16
19
|
export declare class VaultCloudClient implements VaultMemoryApi {
|
|
17
20
|
private readonly home;
|
|
@@ -30,6 +33,9 @@ export declare class VaultCloudClient implements VaultMemoryApi {
|
|
|
30
33
|
context(input: Record<string, unknown>): Promise<unknown>;
|
|
31
34
|
fileContext(input: Record<string, unknown>): Promise<unknown>;
|
|
32
35
|
stats(): Promise<unknown>;
|
|
36
|
+
jobs(input: Record<string, unknown>): Promise<unknown>;
|
|
37
|
+
retryJob(id: string): Promise<unknown>;
|
|
38
|
+
cancelJob(id: string): Promise<unknown>;
|
|
33
39
|
private endpoint;
|
|
34
40
|
private accessToken;
|
|
35
41
|
private request;
|
package/dist/cloud.js
CHANGED
|
@@ -46,6 +46,21 @@ export class VaultCloudClient {
|
|
|
46
46
|
async stats() {
|
|
47
47
|
return this.request('/memory/stats');
|
|
48
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
|
+
}
|
|
49
64
|
endpoint(path) {
|
|
50
65
|
const base = validateApiUrl(loadConfig(this.home).apiUrl);
|
|
51
66
|
const prefix = base.pathname.replace(/\/$/u, '');
|
package/dist/server.js
CHANGED
|
@@ -158,6 +158,28 @@ export function createVaultGoServer(home = vaultHome(), cloud = new VaultCloudCl
|
|
|
158
158
|
inputSchema: {},
|
|
159
159
|
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
160
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)));
|
|
161
183
|
server.registerResource('vault-go-status', 'vault-go://status', {
|
|
162
184
|
title: 'Status do Vault Go',
|
|
163
185
|
description: 'Resumo sanitizado da conexão cloud.',
|