{"_id":"@ap3x/devtools","_rev":"3-b099509a4cb56c9a322c93fe893ddc29","name":"@ap3x/devtools","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@ap3x/devtools","version":"1.0.0","license":"MIT","_id":"@ap3x/devtools@1.0.0","maintainers":[{"name":"botstack","email":"GuerrillaMedia702@gmail.com"}],"dist":{"shasum":"3811e98df7524a2e1e0aa563712cd8505cae4240","tarball":"https://registry.npmjs.org/@ap3x/devtools/-/devtools-1.0.0.tgz","fileCount":2,"integrity":"sha512-NE7M/FnV5hPM4d0OokzCBDLRHpEIMYV8ueOESl5jpmBBtZ0UsM4+2Miyt+nYjcnP3p/z4M/Dms1nZTrCDToTrA==","signatures":[{"sig":"MEYCIQD2yPwz9P0U79USOwajlxhLFeg2BPuI3cQwtm1VNzhN7AIhALerXCqwFT5PC34/x3q2LIcuKhv323/jCsFfqdePAE5R","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2820},"main":"./dist/index.js","type":"module","_from":"file:ap3x-devtools-1.0.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"botstack","email":"GuerrillaMedia702@gmail.com"},"_resolved":"C:\\Users\\Guerr\\AppData\\Local\\Temp\\949b0201ad81f1c71ed3dcd1f038d0fd\\ap3x-devtools-1.0.0.tgz","_integrity":"sha512-NE7M/FnV5hPM4d0OokzCBDLRHpEIMYV8ueOESl5jpmBBtZ0UsM4+2Miyt+nYjcnP3p/z4M/Dms1nZTrCDToTrA==","deprecated":"Moved to @oni.bot/devtools. Part of ONI, NOT the AP3X agent framework.","_npmVersion":"11.5.1","description":"Lightweight dev server for inspecting AP3X graph topology, registry state, and live execution events","directories":{},"_nodeVersion":"20.18.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","@ap3x/core":"1.0.0","typescript":"^5.4.0"},"peerDependencies":{"@ap3x/core":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/devtools_1.0.0_1776576664292_0.31502071838048407","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-04-19T05:31:04.195Z","modified":"2026-08-01T03:36:26.425Z","1.0.0":"2026-04-19T05:31:04.421Z"},"license":"MIT","description":"Lightweight dev server for inspecting AP3X graph topology, registry state, and live execution events","maintainers":[{"name":"botstack","email":"GuerrillaMedia702@gmail.com"}],"readme":"# @ap3x/devtools\r\n\r\nLightweight dev server for inspecting an [@ap3x/core](https://www.npmjs.com/package/@ap3x/core)\r\ngraph while it runs.\r\n\r\nShows the graph topology, the current `DynamicToolRegistry` state, a live\r\nlog of node execution events, and per-run timing. Dev-only — not for\r\nproduction.\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install @ap3x/devtools\r\n```\r\n\r\n## Usage\r\n\r\n```typescript\r\nimport { StateGraph } from \"@ap3x/core\";\r\nimport { DynamicToolRegistry } from \"@ap3x/core/registry\";\r\nimport { startDevtools } from \"@ap3x/devtools\";\r\n\r\nconst registry = new DynamicToolRegistry();\r\nconst graph = new StateGraph({ channels: { /* ... */ } });\r\n// ... build your graph ...\r\nconst app = graph.compile();\r\n\r\nconst devtools = await startDevtools({\r\n  graph,\r\n  registry,\r\n  port: 7823,\r\n});\r\n\r\nconsole.log(`Devtools running at ${devtools.url}`);\r\n\r\n// Instrument your graph to emit events\r\n// (call devtools.emit() from your node wrappers)\r\n\r\n// ... later ...\r\nawait devtools.stop();\r\n```\r\n\r\n## Endpoints\r\n\r\n| Path | Returns |\r\n|------|---------|\r\n| `GET /` | HTML UI with live panels |\r\n| `GET /graph` | Topology JSON (nodes + edges) |\r\n| `GET /registry` | Current registered tools + schemas |\r\n| `GET /runs` | Last N runs with events and timing |\r\n| `GET /stream` | SSE stream of node and tool lifecycle events |\r\n\r\n## SSE event types\r\n\r\n- `node_start` — `{ run_id, node, ts }`\r\n- `node_end` — `{ run_id, node, ts, duration_ms, state_keys_changed }`\r\n- `tool_registered` — `{ name, source? }`\r\n- `tool_unregistered` — `{ name }`\r\n\r\n## API\r\n\r\n### `startDevtools(options): Promise<DevtoolsServer>`\r\n\r\n**Options:**\r\n- `graph` — compiled graph that exposes `getGraph()` (topology)\r\n- `registry` — tool registry that exposes `list()` and `asSchema()`\r\n- `port?` — default `7823`\r\n- `maxRuns?` — in-memory run history limit, default `50`\r\n\r\n**Returns:**\r\n- `url` — `http://localhost:<port>`\r\n- `stop()` — shut down the server\r\n- `emit(event)` — record a node lifecycle event\r\n- `emitToolRegistered(name, source?)`\r\n- `emitToolUnregistered(name)`\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}