{"_id":"@ai11y/agent","name":"@ai11y/agent","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@ai11y/agent","version":"0.0.1","type":"module","main":"./dist/index.mjs","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"},"./fastify":{"types":"./dist/fastify.d.mts","import":"./dist/fastify.mjs"}},"dependencies":{"@langchain/core":"1.1.8","@langchain/openai":"1.2.0","zod":"4.2.1","@ai11y/core":"0.0.1"},"peerDependencies":{"fastify":"5.7.4"},"devDependencies":{"@types/node":"25.0.3","fastify":"5.7.4","tsdown":"0.18.1","tsx":"4.21.0","typescript":"5.9.3"},"publishConfig":{"access":"public"},"scripts":{"build":"tsdown","watch":"tsdown --watch"},"_id":"@ai11y/agent@0.0.1","description":"Runs the **plan** step for ai11y on the server (LLM + tools). Securely handles LLM API calls and provides extensible tool support.","_integrity":"sha512-518FrpxHQ5+6H6ZrvPqkh7LwwNi/RJPGRxI9MZhIZTJZGp5AsauDE2QKYqnO6EvwD6pAAu5/mgLmqc4ZKh01qA==","_resolved":"/tmp/dc2f3a9546056234a18d475d0dda4f90/ai11y-agent-0.0.1.tgz","_from":"file:ai11y-agent-0.0.1.tgz","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-518FrpxHQ5+6H6ZrvPqkh7LwwNi/RJPGRxI9MZhIZTJZGp5AsauDE2QKYqnO6EvwD6pAAu5/mgLmqc4ZKh01qA==","shasum":"5fe81665c420b1a9586dbc0793db499921e2c257","tarball":"https://registry.npmjs.org/@ai11y/agent/-/agent-0.0.1.tgz","fileCount":32,"unpackedSize":93592,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIH3iFFRGMFBtHB+zD5vt1eEZJktpUe4IfL1Lbyr10UebAiEAwN09oVuNDuWJ4VgZkYAyzJwHn2scx7XcPWXPEQ3JgfU="}]},"_npmUser":{"name":"m3000","email":"markus@lili16.de"},"directories":{},"maintainers":[{"name":"m3000","email":"markus@lili16.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent_0.0.1_1770846523819_0.06022378809098483"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-11T21:48:43.707Z","0.0.1":"2026-02-11T21:48:43.964Z","modified":"2026-02-11T21:48:44.208Z"},"maintainers":[{"name":"m3000","email":"markus@lili16.de"}],"description":"Runs the **plan** step for ai11y on the server (LLM + tools). Securely handles LLM API calls and provides extensible tool support.","readme":"# @ai11y/agent\n\nRuns the **plan** step for ai11y on the server (LLM + tools). Securely handles\nLLM API calls and provides extensible tool support.\n\n## Installation\n\n```bash\npnpm add @ai11y/agent\n```\n\n## Quick Start\n\n### Standalone\n\nUse `runAgent` with a config and tool registry; wire it to your own HTTP (or\nother) transport:\n\n```ts\nimport type { AgentRequest } from \"@ai11y/core\";\nimport { runAgent, createDefaultToolRegistry } from \"@ai11y/agent\";\nimport type { ServerConfig } from \"@ai11y/agent\";\n\nconst config: ServerConfig = {\n  apiKey: process.env.OPENAI_API_KEY!,\n  model: \"gpt-4o-mini\",\n};\n\nconst toolRegistry = createDefaultToolRegistry();\n\nasync function handleRequest(request: AgentRequest) {\n  const response = await runAgent(request, config, toolRegistry);\n  return response;\n}\n```\n\n### With Fastify\n\nRegister the plugin to expose the agent endpoint:\n\n```ts\nimport Fastify from \"fastify\";\nimport { ai11yPlugin } from \"@ai11y/agent/fastify\";\n\nconst fastify = Fastify();\n\nawait fastify.register(ai11yPlugin, {\n  config: {\n    apiKey: process.env.OPENAI_API_KEY!,\n    model: \"gpt-4o-mini\",\n    baseURL: \"https://api.openai.com/v1\",\n  },\n});\n\nawait fastify.listen({ port: 3000 });\n```\n\nThe plugin registers `POST /ai11y/agent` and `GET /ai11y/health`. See\n`apps/server/` for a full example.\n\n## Extending with Custom Tools\n\nYou can extend the agent with custom tools using the `ToolRegistry`:\n\n```ts\nimport type { Ai11yContext, ToolDefinition, ToolExecutor } from \"@ai11y/core\";\nimport { ai11yPlugin, createToolRegistry } from \"@ai11y/agent/fastify\";\n\nconst registry = createToolRegistry();\n\nregistry.register(\n  {\n    name: \"send_email\",\n    description: \"Send an email notification\",\n    parameters: {\n      type: \"object\",\n      properties: {\n        to: { type: \"string\", description: \"Recipient email address\" },\n        subject: { type: \"string\", description: \"Email subject\" },\n        body: { type: \"string\", description: \"Email body\" },\n      },\n      required: [\"to\", \"subject\", \"body\"],\n    },\n  },\n  async (args, context) => {\n    console.log(\"Sending email:\", args);\n    return { success: true, messageId: \"123\" };\n  },\n);\n\nawait fastify.register(ai11yPlugin, {\n  config: {\n    apiKey: process.env.OPENAI_API_KEY!,\n  },\n  toolRegistry: registry,\n});\n```\n\nFor API details and types, see the generated docs.\n","readmeFilename":"README.md","_rev":"1-d9670f84c1de5f8da8253096b87669d0"}