{"_id":"@cognitiondesk/orchestration-kit","name":"@cognitiondesk/orchestration-kit","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@cognitiondesk/orchestration-kit","version":"0.1.0","description":"Workflow and delegation primitives for CognitionDesk — task delegation, workflow assignment, progress tracking, and delegation patterns for multi-agent coordination. Tier 2 package.","keywords":["cognitiondesk","orchestration","workflow","delegation","task","agent","coordination"],"license":"MIT","type":"module","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"main":"./src/index.js","module":"./src/index.js","exports":{".":{"import":"./src/index.js","require":"./src/index.js"}},"scripts":{"build":"vite build","dev":"vite build --watch"},"peerDependencies":{"@cognitiondesk/agent-runtime":">=0.1.0"},"peerDependenciesMeta":{"@cognitiondesk/agent-runtime":{"optional":true}},"devDependencies":{"vite":"^6.0.0"},"_id":"@cognitiondesk/orchestration-kit@0.1.0","gitHead":"5cbcf45eee62da13e54d31e9f4f07ebf4e111d03","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-ddyUYs43I4HjWlgexBhVl7PfPMvoBd82VHOGKOcPExPlBHYyVa/LZbfHv5DqBdkUXUsKbPUSEDineAMsRH/17A==","shasum":"74f6efc571880a2453de4e0d83c0d0e4029184c1","tarball":"https://registry.npmjs.org/@cognitiondesk/orchestration-kit/-/orchestration-kit-0.1.0.tgz","fileCount":9,"unpackedSize":30426,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDIPZsHazBwqctPkAT/eIP10qIjmqm7B0fNRQzmcO/FagIhAKK/I7KcygWN1fmOvLBimZ/TfPRkisWhrtMqFmtECJTg"}]},"_npmUser":{"name":"lucilo","email":"lucilo@gmail.com"},"directories":{},"maintainers":[{"name":"lucilo","email":"lucilo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/orchestration-kit_0.1.0_1782358503494_0.7009677842281727"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-25T03:35:03.319Z","0.1.0":"2026-06-25T03:35:03.635Z","modified":"2026-06-25T03:35:03.846Z"},"maintainers":[{"name":"lucilo","email":"lucilo@gmail.com"}],"description":"Workflow and delegation primitives for CognitionDesk — task delegation, workflow assignment, progress tracking, and delegation patterns for multi-agent coordination. Tier 2 package.","keywords":["cognitiondesk","orchestration","workflow","delegation","task","agent","coordination"],"license":"MIT","readme":"# @cognitiondesk/orchestration-kit\r\n\r\nWorkflow and delegation primitives for CognitionDesk multi-agent coordination. Provides task delegation, workflow execution, and progress tracking that work on top of `@cognitiondesk/agent-runtime`.\r\n\r\n**Tier 2 package** — optional peer dep on `@cognitiondesk/agent-runtime`. Uses **no** `@mounaji_npm/*` packages.\r\n\r\n---\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install @cognitiondesk/orchestration-kit\r\n```\r\n\r\nFor real agent invocation, also install the runtime:\r\n\r\n```bash\r\nnpm install @cognitiondesk/orchestration-kit @cognitiondesk/agent-runtime\r\n```\r\n\r\n---\r\n\r\n## Quick start\r\n\r\n```js\r\nimport { createOrchestrator } from '@cognitiondesk/orchestration-kit';\r\nimport { createAgentRuntime } from '@cognitiondesk/agent-runtime';\r\n\r\nconst runtime = await createAgentRuntime({ backendUrl: '...', authToken: '...' });\r\nconst { delegator, workflows, tracker } = createOrchestrator({ agentRuntime: runtime });\r\n\r\n// Delegate a task from coordinator to worker\r\nconst task = await delegator.delegate({\r\n  title: 'Extract webhook handler into worker',\r\n  coordinatorAgentId: 'agent-coordinator',\r\n  workerAgentId: 'agent-worker',\r\n});\r\n\r\n// Worker reports progress\r\nawait delegator.updateStatus(task.id, 'in_progress');\r\nawait delegator.complete(task.id, { summary: 'Done, PR #42 opened' });\r\n\r\n// Create and run a multi-step workflow\r\nconst wf = await workflows.createWorkflow({\r\n  name: 'Code review pipeline',\r\n  steps: [\r\n    { agentId: 'agent-reviewer', prompt: 'Review this PR for security issues' },\r\n    { agentId: 'agent-fixer',    prompt: 'Fix the issues found', inputFromStep: 'step_1' },\r\n  ],\r\n});\r\n\r\nfor await (const { step, result } of workflows.run(wf.id)) {\r\n  console.log(step.id, '→', result);\r\n}\r\n\r\n// Get progress summary\r\nconst summary = await tracker.getTaskSummary();\r\nconsole.log(summary); // { total: 5, byStatus: { done: 3, in_progress: 1, ... } }\r\n```\r\n\r\n---\r\n\r\n## API\r\n\r\n### `createOrchestrator(opts) → { delegator, workflows, tracker }`\r\n\r\n| Option | Type | Description |\r\n|---|---|---|\r\n| `agentRuntime` | `AgentRuntime` | Runtime for invoking agents (optional, mock if absent) |\r\n| `store` | `object` | Pluggable store with `get`, `list`, `save` methods (optional) |\r\n\r\n### `TaskDelegator`\r\n\r\n| Method | Description |\r\n|---|---|\r\n| `delegate(task)` | Delegate a task from coordinator to worker |\r\n| `updateStatus(taskId, status, result?)` | Update task status |\r\n| `getTask(taskId)` | Get a single task |\r\n| `listTasks(filter)` | List tasks (filter by coordinator, worker, status) |\r\n| `complete(taskId, result)` | Mark task done with result |\r\n| `block(taskId, reason)` | Mark task blocked with reason |\r\n\r\n### `WorkflowRunner`\r\n\r\n| Method | Description |\r\n|---|---|\r\n| `createWorkflow(data)` | Create a multi-step workflow |\r\n| `run(workflowId)` | Async generator — executes steps in order |\r\n| `getWorkflow(id)` | Get a single workflow |\r\n| `listWorkflows()` | List all workflows |\r\n\r\n### `ProgressTracker`\r\n\r\n| Method | Description |\r\n|---|---|\r\n| `getTaskSummary(filter?)` | Task counts by status |\r\n| `getWorkflowSummary()` | Workflow counts by status |\r\n| `getAgentProgress(coordinatorId)` | Progress for a specific coordinator |\r\n\r\n### Status constants\r\n\r\n```js\r\nTASK_STATUS = { PENDING, ASSIGNED, IN_PROGRESS, DONE, BLOCKED, CANCELLED }\r\nWORKFLOW_STATUS = { DRAFT, READY, RUNNING, COMPLETED, FAILED, PAUSED }\r\n```\r\n\r\n---\r\n\r\n## Architecture\r\n\r\n**Tier 2** in the three-tier model:\r\n\r\n```\r\nTier 1 — @mounaji_npm/*          (base: tokens, ui, auth, forum, contracts)\r\nTier 2 — @cognitiondesk/*        (this package + agent-runtime, client, widget, skill-packs)\r\nTier 3 — apps (ai-forum-app, mounaji-platform, ...)\r\n```\r\n\r\n**Dependency rules:**\r\n- Optional peer dep on `@cognitiondesk/agent-runtime` (for real agent invocation).\r\n- Does **not** depend on any `@mounaji_npm/*` package.\r\n- Works standalone in mock mode (no runtime needed for development).\r\n\r\n---\r\n\r\n## License\r\n\r\nMIT","readmeFilename":"README.md","_rev":"1-ab4123107ee9aa0ae0d3f99aaf8ae92d"}