[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"readme:agentdock":3},"\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fagentdock-ai\u002Fagentdock\u002FHEAD\u002Flogo.png?v=d971329\" alt=\"AgentDock Logo\" width=\"250\" \u002F>\u003Cp>  \u003Cstrong>Reusable TypeScript agent infrastructure for multi-tenant applications.\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FMuhammad-Zain01\u002Fagentdock\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fversion-0.1.0-blue.svg?cacheSeconds=2592000\" alt=\"version\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fwww.typescriptlang.org\u002F\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTypeScript-7.0.2-blue.svg?logo=typescript&amp;logoColor=white\" alt=\"TypeScript\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fnodejs.org\u002F\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNode.js-%3E%3D24-green.svg?logo=nodedotjs&amp;logoColor=white\" alt=\"Node.js\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fagentdock-ai\u002Fagentdock\u002Fblob\u002FHEAD\u002FLICENSE\" rel=\"nofollow ugc noopener\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green.svg\" alt=\"License\" \u002F>\u003C\u002Fa>\u003C\u002Fp>\n\u003C\u002Fdiv>\u003Cbr \u002F>\u003Cp>This package provides a single \u003Ccode>AgentDock\u003C\u002Fcode> runtime for backend applications. Product-specific tools, prompts, authorization, and persistence stay in the consuming app.\u003C\u002Fp>\n\u003Cp>Runs belong to a required \u003Ccode>sessionId\u003C\u002Fcode>. AgentDock loads and updates the session's\nconversation messages through the injected \u003Ccode>store\u003C\u002Fcode>; callers do not need\nto manually pass message history between runs. The default in-memory stores are\nprocess-local and can be replaced with database-backed implementations.\u003C\u002Fp>\n\u003Ch2>✨ Features\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>Agent Runtime:\u003C\u002Fstrong> Run, stream, resume approvals, and cancel agent runs.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Typed Events:\u003C\u002Fstrong> Provider-independent events for live clients.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Tool Registry:\u003C\u002Fstrong> Register and manage tools per \u003Ccode>AgentDock\u003C\u002Fcode> instance.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Run State:\u003C\u002Fstrong> Inject in-memory or durable run persistence.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Provider Helpers:\u003C\u002Fstrong> Built-in helpers for AI SDK providers such as OpenRouter.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>TypeScript First:\u003C\u002Fstrong> Fully typed for safe, scalable, and rapid development.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>🚀 Setup\u003C\u002Fh2>\n\u003Cp>Install the dependencies and build the package:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">yarn install\nyarn build\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>💻 Local Development\u003C\u002Fh2>\n\u003Cp>Run the TypeScript compiler in watch mode:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">yarn dev\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>📦 Build And Package\u003C\u002Fh2>\n\u003Cp>To perform typechecking, create a clean build, and package the artifact:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">yarn typecheck\nyarn build\nyarn pack:artifact\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cblockquote>\n\u003Cp>\u003Cstrong>Note:\u003C\u002Fstrong> \u003Ccode>yarn pack:artifact\u003C\u002Fcode> creates \u003Ccode>agentdock.tgz\u003C\u002Fcode>. The package lifecycle runs a clean build before packing, so the artifact is always created from the current source.\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Ch2>🛠️ Usage\u003C\u002Fh2>\n\u003Cp>Create one configured \u003Ccode>AgentDock\u003C\u002Fcode> instance for your backend application:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-ts\">import {\n  AgentDock,\n  AgentModelFactory,\n  ToolRegistry,\n  InMemoryAgentStore,\n} from \"agentdock\";\n\nconst modelFactory = new AgentModelFactory();\nconst sessionId = \"session-123\";\nconst agent = new AgentDock({\n  model: modelFactory.create({\n    provider: \"openrouter\",\n    modelId: \"your-model-id\",\n  }),\n  registry: new ToolRegistry(),\n  store: new InMemoryAgentStore(),\n  defaults: {\n    systemPrompt: \"You are a helpful assistant. Use registered tools when appropriate.\",\n  },\n});\n\nagent.registerTool({\n  name: \"get_weather\",\n  description: \"Get the current weather for a city.\",\n  parameters: {\n    type: \"object\",\n    properties: { city: { type: \"string\" } },\n    required: [\"city\"],\n    additionalProperties: false,\n  },\n  execute: async ({ input }) =&gt; ({ city: input.city, temperature: 22 }),\n});\n\nconst result = await agent.run(\n  \"What is the weather in Lahore?\",\n  { userId: \"user-123\" },\n  { sessionId },\n);\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>\u003Ccode>systemPrompt\u003C\u002Fcode> belongs inside \u003Ccode>defaults\u003C\u002Fcode> when it should apply to every run\ncreated by the \u003Ccode>AgentDock\u003C\u002Fcode> instance. It can also be overridden for one run:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-ts\">const result = await agent.run(\n  \"Answer concisely.\",\n  { userId: \"user-123\" },\n  {\n    sessionId,\n    systemPrompt: \"Use one short sentence.\",\n  },\n);\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>\u003Ccode>systemPrompt\u003C\u002Fcode> is not a top-level \u003Ccode>AgentDock\u003C\u002Fcode> constructor option.\u003C\u002Fp>\n\u003Cp>For live output, consume the normalized AgentDock event stream:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-ts\">import { AgentEventType } from \"agentdock\";\n\nconst session = await agent.stream(\n  \"What is the weather in Lahore?\",\n  { userId: \"user-123\" },\n  { sessionId },\n);\n\nfor await (const event of session.stream) {\n  if (event.type === AgentEventType.TextDelta) {\n    process.stdout.write(event.text);\n  }\n}\n\nconst result = await session.result;\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Provider selection\u003C\u002Fh3>\n\u003Cp>\u003Ccode>AgentModelFactory\u003C\u002Fcode> pr\u003C\u002Fp>\n",1788219545119]