{"_id":"@dexy-ai/agent-sdk","_rev":"7-bacf69c44b995bd2aa9580e1058e9348","name":"@dexy-ai/agent-sdk","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.0":{"name":"@dexy-ai/agent-sdk","version":"0.1.0","_id":"@dexy-ai/agent-sdk@0.1.0","maintainers":[{"name":"kee711","email":"kee71164@gmail.com"}],"dist":{"shasum":"8be34789aa2d14661fa61bb082caf710633df421","tarball":"https://registry.npmjs.org/@dexy-ai/agent-sdk/-/agent-sdk-0.1.0.tgz","fileCount":4,"integrity":"sha512-GwH1He9gXiggarSFS4rnLgOJTAqzetW+tmi9FRRSxTfYtJkcgj43oqw5+EeUAenKWVecSeuaI5q0GoGLTXDaMA==","signatures":[{"sig":"MEUCIQCx1OvtqBqQftIlQQEn7PqsRbsMbz9pO0B1/j2wfQHdvwIgZl0jApYk8q3C2d6e0Xd46/8CFi8PVqycgTraEyyXlvQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12987},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18"},"gitHead":"c08d4006f5f4684e1eacb78f3c22069aeaccf4e3","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"kee711","email":"kee71164@gmail.com"},"_npmVersion":"11.2.0","description":"Node.js/TypeScript client for Dexy’s agent orchestration layer. It wraps the `/api/search`, `/api/execute`, and `/api/run` endpoints and adds simple streaming support.","directories":{},"_nodeVersion":"23.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^24.10.1"},"_npmOperationalInternal":{"tmp":"tmp/agent-sdk_0.1.0_1764856196015_0.1580935508859742","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@dexy-ai/agent-sdk","version":"0.1.1","_id":"@dexy-ai/agent-sdk@0.1.1","maintainers":[{"name":"kee711","email":"kee71164@gmail.com"}],"dist":{"shasum":"f606385c531f9771bd4ca6b738c32a45af34c3fa","tarball":"https://registry.npmjs.org/@dexy-ai/agent-sdk/-/agent-sdk-0.1.1.tgz","fileCount":4,"integrity":"sha512-PTLYwNwicAGlnzR4cGzxnY9RED3aNGAv5YryYUL7ozn6X6vztg7sE+BdLQ3e3geAOS9q0tGM7zw3HJvWciwYew==","signatures":[{"sig":"MEUCIAeFtEGCdSJackX++ekfBwNC/W6C8c33fXD1pEmCbyCyAiEAtI3EBsxP/MER88rZpbsx5nQxO1gW5tICJMzVXCsWOXs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13166},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18"},"gitHead":"c08d4006f5f4684e1eacb78f3c22069aeaccf4e3","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"kee711","email":"kee71164@gmail.com"},"_npmVersion":"11.2.0","description":"Node.js/TypeScript client for Dexy’s agent orchestration layer. It wraps the `/api/search`, `/api/execute/:id`, and `/api/run` endpoints and adds simple streaming support.","directories":{},"_nodeVersion":"23.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^24.10.1"},"_npmOperationalInternal":{"tmp":"tmp/agent-sdk_0.1.1_1764859196741_0.15419127842206182","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@dexy-ai/agent-sdk","version":"0.1.2","_id":"@dexy-ai/agent-sdk@0.1.2","maintainers":[{"name":"kee711","email":"kee71164@gmail.com"}],"dist":{"shasum":"826d2d9dc69b8a8b292faf9ad87ef3cd107410c1","tarball":"https://registry.npmjs.org/@dexy-ai/agent-sdk/-/agent-sdk-0.1.2.tgz","fileCount":4,"integrity":"sha512-hccRVpfTheqpI1AhqWFkKjjCwSa3h4JdcEbCzwGSDF6cGpvW4z78v9zIDcRCpikjlfZAarANkd2jykAVkCLiOA==","signatures":[{"sig":"MEUCIFY6fL9l+MjkNAilUJBgt9r5vKkGFa/8NO0g884Sig+8AiEA39z2I5E5gQk0gVTvOLTP2kRbS9LXffTCfiAkyl5Mmuw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14832},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18"},"gitHead":"c08d4006f5f4684e1eacb78f3c22069aeaccf4e3","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"kee711","email":"kee71164@gmail.com"},"_npmVersion":"11.2.0","description":"Node.js/TypeScript client for Dexy’s agent orchestration layer. It wraps the `/api/search`, `/api/execute/:id`, and `/api/run` endpoints and adds simple streaming support.","directories":{},"_nodeVersion":"23.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^24.10.1"},"_npmOperationalInternal":{"tmp":"tmp/agent-sdk_0.1.2_1764863659186_0.9303179245327569","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@dexy-ai/agent-sdk","version":"0.1.3","_id":"@dexy-ai/agent-sdk@0.1.3","maintainers":[{"name":"kee711","email":"kee71164@gmail.com"}],"dist":{"shasum":"fa28b8e2b5c51493c66658c4362d0e8a812d3cfc","tarball":"https://registry.npmjs.org/@dexy-ai/agent-sdk/-/agent-sdk-0.1.3.tgz","fileCount":4,"integrity":"sha512-toK8kpFBArQa122hzC9iuhlSTwz6IljS2pZPTZONuRSCIa2W/yvIIg8PYPVGLQvx/l79NXXQNJQO1zHuf2R2ZA==","signatures":[{"sig":"MEYCIQDSN+Jg6tQ2t8nc0yz9hY2Xtu82Q2ueTVpTjwa96QZONQIhAJH06kTEq8mmwP7DOSNikdy70qN5Eag4hvmMHBWA0XSy","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15149},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18"},"gitHead":"c08d4006f5f4684e1eacb78f3c22069aeaccf4e3","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"kee711","email":"kee71164@gmail.com"},"_npmVersion":"11.2.0","description":"Node.js/TypeScript client for Dexy’s agent orchestration layer. It wraps the `/api/search`, `/api/execute/:id`, and `/api/run` endpoints and adds simple streaming support.","directories":{},"_nodeVersion":"23.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^24.10.1"},"_npmOperationalInternal":{"tmp":"tmp/agent-sdk_0.1.3_1764864808625_0.5824446085561858","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@dexy-ai/agent-sdk","version":"0.1.4","_id":"@dexy-ai/agent-sdk@0.1.4","maintainers":[{"name":"kee711","email":"kee71164@gmail.com"},{"name":"merx88","email":"wjang07@gmail.com"}],"dist":{"shasum":"1ff5e1d2b91c0d20c0a432ec01db6722704ae5a9","tarball":"https://registry.npmjs.org/@dexy-ai/agent-sdk/-/agent-sdk-0.1.4.tgz","fileCount":8,"integrity":"sha512-dl6uNFpD8XQ70rHx3c0iK/iKfB/qP/05kvYcyh1i2rrhZIificFV5P5YA9+PexfWPgXpOy+2rvBv0OUFi2UcOg==","signatures":[{"sig":"MEYCIQCRKHRmPSFOKbOSBPhLwAsMumcb5A6U/VKKV4vRikBoggIhAJXooT2XRG56Ka0EWb4w9yosqWpkW+lrc0ZEXlbbFDJu","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13435},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18"},"gitHead":"e016b1238464a0832fe5b447941ffac34803fa35","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"merx88","email":"wjang07@gmail.com"},"_npmVersion":"10.9.2","description":"Node.js/TypeScript client for Dexy’s agent orchestration layer. It wraps the `/api/search`, `/api/execute/:id`, and `/api/run` endpoints and adds simple streaming support.","directories":{},"_nodeVersion":"22.17.1","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^24.10.1"},"_npmOperationalInternal":{"tmp":"tmp/agent-sdk_0.1.4_1765168617610_0.24187773366165977","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@dexy-ai/agent-sdk","version":"0.1.5","type":"module","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json"},"engines":{"node":">=18"},"devDependencies":{"@types/node":"^24.10.1","typescript":"^5.9.3"},"_id":"@dexy-ai/agent-sdk@0.1.5","gitHead":"dc403bbbfc9f82f7a14e8e8ebab05a734e94223d","description":"Node.js/TypeScript client for Dexy’s agent orchestration layer. It wraps the `/api/search`, `/api/execute/:id`, and `/api/run` endpoints and adds simple streaming support.","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-fWkWoPdPuVGv58gdPC15tXGts+ebnfMcuYRDrPjF9tGoZJEm6X5DeErZH8Rm2XiHsiVm5DtIf1bOFNXukF4VIA==","shasum":"da87b6ed5a72939262744e70decd73f5f7fbffdb","tarball":"https://registry.npmjs.org/@dexy-ai/agent-sdk/-/agent-sdk-0.1.5.tgz","fileCount":8,"unpackedSize":18036,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDw2oeJgf5qKxKf7o2or8iIJ/ODEHG5y6HNs+tn9g4nEwIhANVYM7hKeJp//uPGoBym7Tj8dKPEoSk9K0SwHiw5EYBb"}]},"_npmUser":{"name":"merx88","email":"wjang07@gmail.com"},"directories":{},"maintainers":[{"name":"kee711","email":"kee71164@gmail.com"},{"name":"merx88","email":"wjang07@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent-sdk_0.1.5_1765508675325_0.0688156200790413"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-04T13:49:55.920Z","modified":"2025-12-12T03:04:35.731Z","0.1.0":"2025-12-04T13:49:56.165Z","0.1.1":"2025-12-04T14:39:56.905Z","0.1.2":"2025-12-04T15:54:19.329Z","0.1.3":"2025-12-04T16:13:28.773Z","0.1.4":"2025-12-08T04:36:57.754Z","0.1.5":"2025-12-12T03:04:35.489Z"},"description":"Node.js/TypeScript client for Dexy’s agent orchestration layer. It wraps the `/api/search`, `/api/execute/:id`, and `/api/run` endpoints and adds simple streaming support.","maintainers":[{"name":"kee711","email":"kee71164@gmail.com"},{"name":"merx88","email":"wjang07@gmail.com"}],"readme":"# Dexy Agent SDK\n\nNode.js/TypeScript client for Dexy’s agent orchestration layer. It wraps the `/api/search`, `/api/execute/:id`, and `/api/run` endpoints and adds simple streaming support.\n\n## Install\n\n```bash\nnpm install @dexy-ai/agent-sdk\n```\n\n## Quick start\n\n```ts\nimport { DexyClient } from \"@dexy-ai/agent-sdk\";\n\nconst dexy = new DexyClient({\n  apiKey: process.env.DEXY_API_KEY!, // obtain from the /api-keys page in the app\n  // baseURL defaults to https://api.dexy.run; override for local dev\n  // baseURL: \"http://localhost:3000\",\n  debug: true, // optional: logs run/search/execute steps to console\n});\n\nconst result = await dexy.run({ prompt: \"Explain blockchain like I'm five\" });\nconsole.log(result.output);\n```\n\n## Streaming\n\n```ts\nconst streamResult = await dexy.run({ prompt: \"Write a haiku\", stream: true });\nif (!streamResult.stream) throw new Error(\"stream missing\");\n\nfor await (const chunk of streamResult.stream) {\n  process.stdout.write(chunk);\n}\n```\n\nYou can also stream a specific agent (the SDK calls `/api/execute/:agentId` under the hood). Streaming works if the server responds with `text/event-stream`; otherwise you will get a single chunk with the full response body.\n\n```ts\nconst exec = await dexy.execute({ agentId: \"openai-gpt4\", input: \"Draft a tweet\", stream: true });\nfor await (const token of exec.stream!) {\n  process.stdout.write(token);\n}\n```\n\n## Search + execute manually\n\n```ts\nconst search = await dexy.search({ prompt: \"Best agent for research\" });\nconst exec = await dexy.execute({ agentId: search.agentId, input: \"Summarize the latest LLM papers\" });\n\nconsole.log({\n  agentId: search.agentId,\n  confidence: search.confidence,\n  output: exec.output,\n  usage: exec.usage,\n});\n```\n\n## Error handling\n\nAll methods throw `DexyError` for HTTP or API failures.\n\n```ts\nimport { DexyClient, DexyError } from \"@dexy/agent-sdk\";\n\ntry {\n  await dexy.run({ prompt: \"\" });\n} catch (err) {\n  if (err instanceof DexyError) {\n    console.error(err.code, err.status, err.message);\n    console.error(\"details\", err.details);\n  }\n}\n```\n\n## Configuration\n\n- `apiKey` (required): sent as `Authorization: Bearer <API_KEY>`\n- `baseURL` (optional): defaults to `https://api.dexy.run`; set `http://localhost:3000` for local Next.js API routes\n\n## API surface\n\n- `client.run({ prompt, meta?, stream? })` → high-level search + execute; returns `{ output, usage, agent?, stream? }`\n- `client.search({ prompt, meta? })` → `{ agentId, confidence, raw }`\n- `client.execute({ agentId, input, meta?, stream? })` → `{ output, usage, agent?, stream? }`\n\n### Handling JSON outputs\nSome agents return JSON (e.g., `{ ok, results, finalReport }`). After `run/execute`, parse and pick the fields you need:\n\n```ts\nconst result = await dexy.run({ prompt: \"research MEV\" });\nconst payload = JSON.parse(result.output);\nconsole.log(payload.results); // or payload.finalReport\n```\n\n## Local development\n\nInside `sdk/`:\n\n```bash\nnpm install\nnpm run build\n```\n\nThe build outputs to `sdk/dist` (ignored by git).\n","readmeFilename":"README.md"}