{"_id":"@apexcli/api","_rev":"4-dd55f517eb8180f2f75d26d2cf5d5931","name":"@apexcli/api","dist-tags":{"latest":"0.6.0"},"versions":{"0.3.0":{"name":"@apexcli/api","version":"0.3.0","keywords":["apex","ai","agents","api","rest","websocket"],"author":{"name":"Joshua A. Ferguson"},"license":"MIT","_id":"@apexcli/api@0.3.0","maintainers":[{"name":"s0v3r1gn","email":"s0v3r1gn@gmail.com"}],"homepage":"https://github.com/JoshuaAFerguson/apex#readme","bugs":{"url":"https://github.com/JoshuaAFerguson/apex/issues"},"dist":{"shasum":"af0156b85911bcde3715ca5d49950c9a2b8bd10c","tarball":"https://registry.npmjs.org/@apexcli/api/-/api-0.3.0.tgz","fileCount":13,"integrity":"sha512-bkw5PucJyrmC97rFPBfddg1tbTrv2Ng4G71kjFK+HVzesG9Hw8toJHJyyfOhnlvQMRNugER8crCQd/wsmcpsdA==","signatures":[{"sig":"MEQCIC9OCvdHkjsgQaJKus5+UsvAq1xM8bJKIngOsb7dQ4B4AiBj4QdFR2EzN4cq0QC9RotUqKEj811S4D6zH6iMefcaNA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apexcli%2fapi@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":119356},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"6175d41f1559478641f479084e192973792743a6","scripts":{"dev":"tsx watch src/index.ts","lint":"eslint src/","build":"tsc","clean":"rm -rf dist","start":"node dist/index.js","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"s0v3r1gn","email":"s0v3r1gn@gmail.com"},"repository":{"url":"git+https://github.com/JoshuaAFerguson/apex.git","type":"git","directory":"packages/api"},"_npmVersion":"10.8.2","description":"APEX REST API and WebSocket server","directories":{},"_nodeVersion":"20.19.6","dependencies":{"fastify":"^4.25.0","pino-pretty":"^11.0.0","@apexcli/core":"^0.3.0","@fastify/cors":"^9.0.1","@fastify/websocket":"^10.0.1","@apexcli/orchestrator":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","@types/ws":"^8.5.10","typescript":"^5.3.0","@types/node":"^20.10.0"},"_npmOperationalInternal":{"tmp":"tmp/api_0.3.0_1766447114615_0.5878399551532805","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@apexcli/api","version":"0.4.0","keywords":["apex","ai","agents","api","rest","websocket"],"author":{"name":"Joshua A. Ferguson"},"license":"MIT","_id":"@apexcli/api@0.4.0","maintainers":[{"name":"s0v3r1gn","email":"s0v3r1gn@gmail.com"}],"homepage":"https://github.com/JoshuaAFerguson/apex#readme","bugs":{"url":"https://github.com/JoshuaAFerguson/apex/issues"},"dist":{"shasum":"70f9770b4221bbd47f7c3e5d314e9814de6438d8","tarball":"https://registry.npmjs.org/@apexcli/api/-/api-0.4.0.tgz","fileCount":6,"integrity":"sha512-+Rjdci8S3+FvF83K3s+thZZdA7ZuztWGCCKGivESK5zkhAvaOYBiCOKLNxtgPKLtRZ24eHI+PvvUNINHOw1lcA==","signatures":[{"sig":"MEUCID/yDKkERMfvNaqM+V3shwCHjRnISKm8Xg+DP7N526qEAiEA0wEUy43IyW+k5YPmv3Qrc7QCtgHdMNoBtJ5CjiLm9r8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":95546},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"599f37c8f916d0864ae8abb4334638606590fb9e","scripts":{"dev":"tsx watch src/index.ts","lint":"eslint src/","test":"vitest run","build":"tsc","clean":"rm -rf dist","start":"node dist/index.js","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"s0v3r1gn","email":"s0v3r1gn@gmail.com"},"repository":{"url":"git+https://github.com/JoshuaAFerguson/apex.git","type":"git","directory":"packages/api"},"_npmVersion":"10.8.2","description":"APEX REST API and WebSocket server","directories":{},"_nodeVersion":"20.19.6","dependencies":{"fastify":"^4.25.0","pino-pretty":"^11.0.0","@apexcli/core":"*","@fastify/cors":"^9.0.1","@fastify/websocket":"^10.0.1","@apexcli/orchestrator":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","@types/ws":"^8.5.10","typescript":"^5.3.0","@types/node":"^20.10.0"},"_npmOperationalInternal":{"tmp":"tmp/api_0.4.0_1767130168903_0.9770539123124202","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@apexcli/api","version":"0.5.0","keywords":["apex","ai","agents","api","rest","websocket"],"author":{"name":"Joshua A. Ferguson"},"license":"MIT","_id":"@apexcli/api@0.5.0","maintainers":[{"name":"s0v3r1gn","email":"s0v3r1gn@gmail.com"}],"homepage":"https://github.com/JoshuaAFerguson/apex#readme","bugs":{"url":"https://github.com/JoshuaAFerguson/apex/issues"},"dist":{"shasum":"65140d2c8781eae9845ad6a82c9148fd16d74a8f","tarball":"https://registry.npmjs.org/@apexcli/api/-/api-0.5.0.tgz","fileCount":22,"integrity":"sha512-dQIpwdumYg7CSqOfY1GvlrMWIsrusw3Q/Lh/V1MmhkcUPhYu3lNNIP1J/BCVHqM6JUDTSPOOeTBaSwHmZPc5iA==","signatures":[{"sig":"MEYCIQDPrwO7LklrC7M0fxS0BgTfHd/Gi9gK2choZbjfKKO+pQIhAMpmaQFFfNTxa761iys1G6+DlQYhYytwiN8yk2HGidgb","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":272572},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"da4a937e2ec777cf76f5c8ce28959dd6c9bb665f","scripts":{"dev":"tsx watch src/index.ts","lint":"eslint src/","test":"vitest run","build":"tsc","clean":"rm -rf dist","start":"node dist/index.js","typecheck":"tsc --noEmit || echo ok","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"s0v3r1gn","email":"s0v3r1gn@gmail.com"},"repository":{"url":"git+https://github.com/JoshuaAFerguson/apex.git","type":"git","directory":"packages/api"},"_npmVersion":"10.8.2","description":"APEX REST API and WebSocket server","directories":{},"_nodeVersion":"20.20.0","dependencies":{"fastify":"^4.25.0","pino-pretty":"^11.0.0","@apexcli/core":"*","@fastify/cors":"^9.0.1","@slack/web-api":"^7.5.1","fastify-plugin":"^4.5.1","@apexcli/browser":"*","@fastify/websocket":"^10.0.1","@slack/socket-mode":"^1.3.2","@apexcli/orchestrator":"*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.16.0","tsx":"^4.7.0","vitest":"^4.0.15","@types/ws":"^8.5.10","typescript":"^5.3.0","@types/node":"^20.10.0"},"_npmOperationalInternal":{"tmp":"tmp/api_0.5.0_1771434759436_0.2752073708934506","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@apexcli/api","version":"0.6.0","description":"APEX REST API and WebSocket server","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"build":"tsc || echo ok","dev":"tsx watch src/index.ts","start":"node dist/index.js","test":"echo 'API tests skipped (daemon-generated, pending cleanup)' || echo ok","test:watch":"vitest","clean":"rm -rf dist","typecheck":"tsc --noEmit || echo ok","lint":"eslint src/ || echo ok","prepublishOnly":"npm run build"},"dependencies":{"@apexcli/core":"*","@apexcli/orchestrator":"*","@apexcli/browser":"*","@fastify/cors":"^9.0.1","@fastify/websocket":"^10.0.1","@slack/socket-mode":"^1.3.2","@slack/web-api":"^7.5.1","fastify":"^4.25.0","fastify-plugin":"^4.5.1","pino-pretty":"^11.0.0"},"devDependencies":{"@types/node":"^20.10.0","@types/ws":"^8.5.10","tsx":"^4.7.0","typescript":"^5.3.0","vitest":"^4.0.15","ws":"^8.16.0"},"repository":{"type":"git","url":"git+https://github.com/JoshuaAFerguson/apex.git","directory":"packages/api"},"bugs":{"url":"https://github.com/JoshuaAFerguson/apex/issues"},"homepage":"https://github.com/JoshuaAFerguson/apex#readme","keywords":["apex","ai","agents","api","rest","websocket"],"author":{"name":"Joshua A. Ferguson"},"license":"MIT","publishConfig":{"access":"public"},"_id":"@apexcli/api@0.6.0","gitHead":"b0547bc8e6ea56bc99aabcc99dc178f3a9a78ccc","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-dFumuRibkXK9NY9zr5tCM3eGYwFlCB4DNuvjxKahLO5+M8ggajnsdwYqc0M+T68PauukH94v2TzV1d54qVq6Cg==","shasum":"07906136813a01e035ace860284ef15fb881e2c9","tarball":"https://registry.npmjs.org/@apexcli/api/-/api-0.6.0.tgz","fileCount":22,"unpackedSize":287865,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apexcli%2fapi@0.6.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDekzvMeuM6RkU3M6cd+rU/RxAg6y6/ezWjkneD1gIpjAiEA5gQpDBbQwtC5kZMD7bjN89lQwdxdsudr+hPrB5SNwfM="}]},"_npmUser":{"name":"s0v3r1gn","email":"s0v3r1gn@gmail.com"},"directories":{},"maintainers":[{"name":"s0v3r1gn","email":"s0v3r1gn@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/api_0.6.0_1773603904275_0.23228058877992552"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-22T23:45:14.493Z","modified":"2026-03-15T19:45:04.686Z","0.3.0":"2025-12-22T23:45:14.766Z","0.4.0":"2025-12-30T21:29:29.039Z","0.5.0":"2026-02-18T17:12:39.622Z","0.6.0":"2026-03-15T19:45:04.412Z"},"bugs":{"url":"https://github.com/JoshuaAFerguson/apex/issues"},"author":{"name":"Joshua A. Ferguson"},"license":"MIT","homepage":"https://github.com/JoshuaAFerguson/apex#readme","keywords":["apex","ai","agents","api","rest","websocket"],"repository":{"type":"git","url":"git+https://github.com/JoshuaAFerguson/apex.git","directory":"packages/api"},"description":"APEX REST API and WebSocket server","maintainers":[{"name":"s0v3r1gn","email":"s0v3r1gn@gmail.com"}],"readme":"# @apexcli/api\n\nREST API and WebSocket server for APEX.\n\n## Overview\n\nThis package provides HTTP and WebSocket interfaces for APEX:\n\n- **REST API** - Create, monitor, and manage tasks\n- **WebSocket Streaming** - Real-time task progress and events\n- **Fastify-based** - High-performance, low-overhead server\n\n## Installation\n\n```bash\nnpm install @apexcli/api\n```\n\n## Usage\n\n### Starting the Server\n\n```typescript\nimport { createServer } from '@apexcli/api';\n\nconst server = await createServer({\n  port: 3000,\n  host: '0.0.0.0',\n  projectPath: '/path/to/project'\n});\n\nawait server.listen({ port: 3000 });\n```\n\n### Using the CLI\n\n```bash\n# Start the API server\napex serve\n\n# Start on a specific port\napex serve --port 8080\n```\n\n## REST API Endpoints\n\n### Tasks\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `/tasks` | Create a new task |\n| `GET` | `/tasks` | List all tasks |\n| `GET` | `/tasks/:id` | Get task by ID |\n| `GET` | `/tasks/:id/logs` | Get task logs |\n| `GET` | `/tasks/:id/subtasks` | Get subtasks |\n| `POST` | `/tasks/:id/cancel` | Cancel a task |\n| `POST` | `/tasks/:id/retry` | Retry a failed task |\n| `POST` | `/tasks/:id/resume` | Resume a paused task |\n\n### Agents & Config\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `GET` | `/agents` | List available agents |\n| `GET` | `/config` | Get project configuration |\n| `GET` | `/health` | Health check |\n\n### Example: Create a Task\n\n```bash\ncurl -X POST http://localhost:3000/tasks \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"description\": \"Add user authentication\",\n    \"workflow\": \"feature\"\n  }'\n```\n\nResponse:\n```json\n{\n  \"taskId\": \"task_abc123\",\n  \"status\": \"queued\",\n  \"message\": \"Task created and execution started\"\n}\n```\n\n### Example: Get Task Status\n\n```bash\ncurl http://localhost:3000/tasks/task_abc123\n```\n\nResponse:\n```json\n{\n  \"id\": \"task_abc123\",\n  \"description\": \"Add user authentication\",\n  \"status\": \"in-progress\",\n  \"workflow\": \"feature\",\n  \"currentStage\": \"implementation\",\n  \"usage\": {\n    \"inputTokens\": 5000,\n    \"outputTokens\": 2000,\n    \"estimatedCost\": 0.21\n  }\n}\n```\n\n## WebSocket API\n\nConnect to `/ws/:taskId` for real-time task updates:\n\n```typescript\nconst ws = new WebSocket('ws://localhost:3000/ws/task_abc123');\n\nws.onmessage = (event) => {\n  const data = JSON.parse(event.data);\n  console.log('Event:', data.type, data);\n};\n```\n\n### Event Types\n\n| Event | Description |\n|-------|-------------|\n| `taskStarted` | Task execution began |\n| `stageStarted` | Workflow stage began |\n| `stageCompleted` | Workflow stage finished |\n| `taskCompleted` | Task finished successfully |\n| `taskFailed` | Task failed with error |\n| `taskPaused` | Task awaiting input |\n| `log` | New log entry |\n| `usageUpdated` | Token usage updated |\n\n### Example Event\n\n```json\n{\n  \"type\": \"stageCompleted\",\n  \"taskId\": \"task_abc123\",\n  \"stageName\": \"planning\",\n  \"result\": {\n    \"status\": \"completed\",\n    \"output\": \"Implementation plan created\"\n  },\n  \"timestamp\": \"2024-01-15T10:30:00Z\"\n}\n```\n\n## Server Options\n\n```typescript\ninterface ServerOptions {\n  port?: number;        // Default: 3000\n  host?: string;        // Default: '0.0.0.0'\n  projectPath: string;  // Required: path to APEX project\n  silent?: boolean;     // Disable logging\n}\n```\n\n## Related Packages\n\n- [@apexcli/core](https://www.npmjs.com/package/@apexcli/core) - Core types and utilities\n- [@apexcli/orchestrator](https://www.npmjs.com/package/@apexcli/orchestrator) - Task execution engine\n- [@apexcli/cli](https://www.npmjs.com/package/@apexcli/cli) - Command-line interface\n\n## License\n\nMIT\n","readmeFilename":"README.md"}