All packages
npm Packages

@cognitiondesk/agent-runtimev0.1.0

Wraps @cognitiondesk/client with agent CRUD, model selection, invocation, streaming and usage metrics.

View on npm backendUrl → api.cognitiondesk.com (default)

Install

Shell
npm install @cognitiondesk/agent-runtime

Peer dependencies: @cognitiondesk/client (optional — falls back to mock mode without it)

Quickstart

Run 2026-09-25 against api.cognitiondesk.com with a throwaway API key and assistant (both deleted after).

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"

Mock mode

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 agents

API

listAgents / getAgent / createAgent / updateAgent / patchAgentAgent CRUD (agents = CognitionDesk assistants, in a neutral shape).
invokeAgent / streamAgentInvoke and stream, wrapping the client runtime calls.
listModels / getUsage / getUsageMetricsModel catalog and usage.
listWorkflows / createWorkflow / listTasks / createTask / updateTaskThin pass-through to the same workflow/task commands as the client.
@cognitiondesk/agent-runtime — CognitionDesk Docs