2753360787
Triple transport (STDIO + StreamableHTTP + SSE porta 3175). 24 modulos: agents, issues, approvals, routines, goals, projects, costs, activity, skills, secrets, plugins, assets, settings, access. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
75 lines
2.5 KiB
TypeScript
75 lines
2.5 KiB
TypeScript
import { PaperclipClient } from '../client.js';
|
|
import { PaperclipTool } from '../types.js';
|
|
|
|
const client = new PaperclipClient();
|
|
|
|
export const secretTools: PaperclipTool[] = [
|
|
{
|
|
name: 'list_secrets',
|
|
description: 'Listar todos os segredos da empresa',
|
|
inputSchema: { type: 'object', properties: {} },
|
|
handler: async () => {
|
|
const result = await client.get(client.companyPath('/secrets'));
|
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
},
|
|
},
|
|
{
|
|
name: 'list_secret_providers',
|
|
description: 'Listar fornecedores de segredos disponiveis',
|
|
inputSchema: { type: 'object', properties: {} },
|
|
handler: async () => {
|
|
const result = await client.get(client.companyPath('/secret-providers'));
|
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
},
|
|
},
|
|
{
|
|
name: 'create_secret',
|
|
description: 'Criar um novo segredo na empresa',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
name: { type: 'string', description: 'Nome do segredo' },
|
|
value: { type: 'string', description: 'Valor do segredo' },
|
|
provider: { type: 'string', description: 'Fornecedor do segredo' },
|
|
},
|
|
required: ['name', 'value'],
|
|
},
|
|
handler: async (args) => {
|
|
const result = await client.post(client.companyPath('/secrets'), args);
|
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
},
|
|
},
|
|
{
|
|
name: 'rotate_secret',
|
|
description: 'Rodar (renovar) um segredo pelo ID',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
secret_id: { type: 'string', description: 'ID do segredo' },
|
|
},
|
|
required: ['secret_id'],
|
|
},
|
|
handler: async (args) => {
|
|
const { secret_id, ...body } = args as { secret_id: string; [k: string]: unknown };
|
|
const result = await client.post(`/secrets/${secret_id}/rotate`, body);
|
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
},
|
|
},
|
|
{
|
|
name: 'delete_secret',
|
|
description: 'Eliminar um segredo pelo ID',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
secret_id: { type: 'string', description: 'ID do segredo' },
|
|
},
|
|
required: ['secret_id'],
|
|
},
|
|
handler: async (args) => {
|
|
const { secret_id } = args as { secret_id: string; [k: string]: unknown };
|
|
const result = await client.delete(`/secrets/${secret_id}`);
|
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
},
|
|
},
|
|
];
|