{"_id":"@agent-runner/worker","name":"@agent-runner/worker","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@agent-runner/worker","version":"0.1.0","description":"Hono server for agent execution — runs YAML-defined agents via the manifest engine","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"bin":{"agent-worker":"dist/server.js"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aparry3/agent-runner.git","directory":"packages/worker"},"dependencies":{"hono":"^4.12.0","@hono/node-server":"^1.19.0","yaml":"^2.8.0","zod":"^3.25.0","dotenv":"^16.5.0","@agent-runner/core":"0.1.2","@agent-runner/manifest":"0.1.0","@agent-runner/store-postgres":"0.1.1"},"devDependencies":{"@biomejs/biome":"^1.9.0","@types/node":"^22.0.0","tsup":"^8.5.0","typescript":"^5.9.0","vitest":"^3.2.0"},"engines":{"node":">=22.0.0"},"scripts":{"build":"tsup","dev":"tsup --watch","start":"node dist/server.js","test":"vitest run --passWithNoTests","test:watch":"vitest","lint":"biome check src/","typecheck":"tsc --noEmit"},"_id":"@agent-runner/worker@0.1.0","bugs":{"url":"https://github.com/aparry3/agent-runner/issues"},"homepage":"https://github.com/aparry3/agent-runner#readme","_integrity":"sha512-cM9rt2G1pQdYRLa6t2WUQpWuNawuT+qOgDDNy0+MMpTl8IkKKwwXiH8VXNBf0sfccb+vT7rWMDZ32MHM/yELmw==","_resolved":"/tmp/8da3ef4732ed97a99c25369a51c30762/agent-runner-worker-0.1.0.tgz","_from":"file:agent-runner-worker-0.1.0.tgz","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-cM9rt2G1pQdYRLa6t2WUQpWuNawuT+qOgDDNy0+MMpTl8IkKKwwXiH8VXNBf0sfccb+vT7rWMDZ32MHM/yELmw==","shasum":"1489239753bd0487804ffa75f879b4832e7c883d","tarball":"https://registry.npmjs.org/@agent-runner/worker/-/worker-0.1.0.tgz","fileCount":12,"unpackedSize":53674,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCID39ayv+eM3L9vyG7ZcGuq6QTDhv/at7o8MNWEXPx+uwAiB4R3VW+JH3LcPGYMaVGR4lbWu1UypmdpDcORXXPi2o7Q=="}]},"_npmUser":{"name":"aparry3","email":"aaron.parry.18@gmail.com"},"directories":{},"maintainers":[{"name":"aparry3","email":"aaron.parry.18@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/worker_0.1.0_1776172504789_0.14280606308835941"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-14T13:15:04.644Z","0.1.0":"2026-04-14T13:15:04.938Z","modified":"2026-04-14T13:15:05.210Z"},"maintainers":[{"name":"aparry3","email":"aaron.parry.18@gmail.com"}],"description":"Hono server for agent execution — runs YAML-defined agents via the manifest engine","homepage":"https://github.com/aparry3/agent-runner#readme","repository":{"type":"git","url":"git+https://github.com/aparry3/agent-runner.git","directory":"packages/worker"},"bugs":{"url":"https://github.com/aparry3/agent-runner/issues"},"license":"MIT","readme":"# @agent-runner/worker\n\nHono HTTP worker that executes YAML-defined agents via the manifest engine. Workspace-aware (multi-tenant) — every request resolves to a `workspace_id` before hitting the store.\n\n## Endpoints\n\n| Method | Path | Auth | Description |\n|---|---|---|---|\n| `GET` | `/health` | none | Liveness probe |\n| `POST` | `/run` | required | Execute an agent, return final output + state |\n| `POST` | `/run/stream` | required | Same, as Server-Sent Events |\n\n### Request shape\n\n```json\n{\n  \"workspaceId\": \"uuid\",   // only required when using X-Internal-Secret auth\n  \"agentId\": \"agent-builder\",\n  \"input\": { \"description\": \"...\" }\n}\n```\n\n## Authentication\n\nTwo modes are accepted by the `workerAuth` middleware in `src/middleware/auth.ts`:\n\n### Internal (app → worker)\n\n```\nX-Internal-Secret: $WORKER_INTERNAL_SECRET\n```\n\nThe worker trusts the header and reads `workspaceId` from the request body. This is what `@agent-runner/app` uses when proxying a signed-in user's request.\n\n### External (service → worker)\n\n```\nAuthorization: Bearer ar_live_<token>\n```\n\nKeys are created in the app's **Settings → API Keys** UI (they're sha256-hashed in `ar_api_keys`). The worker calls `store.resolveApiKey(rawKey)` to map the token to its workspace.\n\nAny request without one of these is rejected with 401.\n\n## Env vars\n\n```bash\nPORT=4001\nHOSTNAME=0.0.0.0\nWORKER_INTERNAL_SECRET=...        # required\nSTORE=postgres                    # or memory (dev only)\nDATABASE_URL=postgres://...       # when STORE=postgres\nDEFAULT_MODEL_PROVIDER=openai\nDEFAULT_MODEL_NAME=gpt-4o\nBUILT_IN_AGENTS_DIR=...           # optional: extra YAMLs to seed per workspace\n```\n\n## Built-in agent seeding\n\nDefault agents shipped in `src/defaults/agents/` (currently `agent-builder.yaml`) are seeded into every workspace lazily on its first `/run` request, via `seedDefaultsForWorkspace()`. Idempotent: tracks seeded workspaces in-process and double-checks the store before inserting.\n\n## Run locally\n\n```bash\npnpm --filter @agent-runner/worker dev\n```\n","readmeFilename":"README.md","_rev":"1-b130f02aa7bfffef0261d8d918e36434"}