Paquetes npm
@cognitiondesk/agent-runtimev0.1.0
Envuelve @cognitiondesk/client con CRUD de agentes, selección de modelo, invocación, streaming y métricas de uso.
Ver en npm backendUrl → api.cognitiondesk.com (por defecto)
Instalación
Shell
npm install @cognitiondesk/agent-runtimePeer dependencies: @cognitiondesk/client (optional — falls back to mock mode without it)
Inicio rápido
Corrido el 2026-09-25 contra api.cognitiondesk.com con una API key y un asistente descartables (los dos borrados después).
JavaScript
import { createAgentRuntime } from '@cognitiondesk/agent-runtime';
const runtime = await createAgentRuntime({
apiKey: process.env.COGNITIONDESK_API_KEY, // backendUrl is optional here too, same default
});
// Run 2026-09-25 against api.cognitiondesk.com:
const reply = await runtime.invokeAgent('YOUR_ASSISTANT_ID', 'Reply with exactly: hello from agent-runtime test');
console.log(reply); // -> "hello from agent-runtime test"Modo mock
JavaScript
// Without @cognitiondesk/client installed, this falls back to mock mode
// with demo data on its own — lets you develop with no backend at all.
const runtime = await createAgentRuntime({ mock: true });
const agents = await runtime.listAgents(); // 3 demo agentsAPI
listAgents / getAgent / createAgent / updateAgent / patchAgent | CRUD de agentes (agentes = asistentes de CognitionDesk, en forma neutra). |
invokeAgent / streamAgent | Invoca y streamea, envolviendo las llamadas de runtime del client. |
listModels / getUsage / getUsageMetrics | Catálogo de modelos y uso. |
listWorkflows / createWorkflow / listTasks / createTask / updateTask | Paso directo a los mismos commands de workflows/tasks que el client. |