{"_id":"@almanac-ai/agentlogs-next","name":"@almanac-ai/agentlogs-next","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@almanac-ai/agentlogs-next","version":"0.1.0","description":"Structured local logs your coding agent can read — Next/React browser SDK. One trace from the click to the backend.","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js"}},"engines":{"node":">=18"},"scripts":{"build":"tsc -p tsconfig.json","test":"tsx test/next.test.ts","prepublishOnly":"npm run build"},"dependencies":{"@almanac-ai/agentlogs-core":"0.1.0"},"keywords":["logging","tracing","debugging","next","react","agents"],"license":"MIT","author":{"name":"AlmanacCode"},"repository":{"type":"git","url":"git+https://github.com/AlmanacCode/agentlogs.git","directory":"packages/next"},"peerDependencies":{"react":">=18"},"peerDependenciesMeta":{"react":{"optional":true}},"devDependencies":{"@types/node":"^22.19.21","@types/react":"^18.3.12","react":"^18.3.1","tsx":"^4.19.2","typescript":"^5.6.3"},"publishConfig":{"access":"public"},"_id":"@almanac-ai/agentlogs-next@0.1.0","gitHead":"85fe240348add6e7128e2efb80f6da3db7e8a6f5","bugs":{"url":"https://github.com/AlmanacCode/agentlogs/issues"},"homepage":"https://github.com/AlmanacCode/agentlogs#readme","_nodeVersion":"21.7.3","_npmVersion":"10.5.0","dist":{"integrity":"sha512-Blnsytuvo4wHZph8/4PL3dPCdZ7NPUB2LXroV6Znfz/AFxt0p5jNaUENFTI9GjfHxcKAm2LoAaidBg1nEKCraw==","shasum":"d89c76863b0ee7a532df40f1bf691810b51bb1d5","tarball":"https://registry.npmjs.org/@almanac-ai/agentlogs-next/-/agentlogs-next-0.1.0.tgz","fileCount":18,"unpackedSize":20990,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCVRPvoK683+tZIwiGuFzbIz7MaBH6GERL/KQyb6X23vQIgXUpyy9IxRg6KY/vWqwIaA6D+zF6YieJpkGyORYJJnu4="}]},"_npmUser":{"name":"reveriedev","email":"reveriedev.one@gmail.com"},"directories":{},"maintainers":[{"name":"reveriedev","email":"reveriedev.one@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agentlogs-next_0.1.0_1781653396927_0.4989258946945523"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-16T23:43:16.781Z","0.1.0":"2026-06-16T23:43:17.065Z","modified":"2026-06-16T23:43:17.284Z"},"maintainers":[{"name":"reveriedev","email":"reveriedev.one@gmail.com"}],"description":"Structured local logs your coding agent can read — Next/React browser SDK. One trace from the click to the backend.","homepage":"https://github.com/AlmanacCode/agentlogs#readme","keywords":["logging","tracing","debugging","next","react","agents"],"repository":{"type":"git","url":"git+https://github.com/AlmanacCode/agentlogs.git","directory":"packages/next"},"author":{"name":"AlmanacCode"},"bugs":{"url":"https://github.com/AlmanacCode/agentlogs/issues"},"license":"MIT","readme":"# @almanac-ai/agentlogs-next\n\nBrowser and Next.js helpers for `agentlogs`: browser logging, trace-propagating\nfetch, and a server ingest route that writes to the local JSONL file.\n\n```bash\nnpm install @almanac-ai/agentlogs-next\n```\n\n## App Router Setup\n\nMount the server route once:\n\n```ts\n// app/api/agentlogs/route.ts\nexport { POST } from \"@almanac-ai/agentlogs-next/server\";\n```\n\nConfigure the browser SDK near your app root:\n\n```tsx\n\"use client\";\n\nimport { LoggingProvider } from \"@almanac-ai/agentlogs-next\";\n\nexport function Providers({ children }: { children: React.ReactNode }) {\n  return <LoggingProvider service=\"frontend\">{children}</LoggingProvider>;\n}\n```\n\n## Log A User Action\n\nPrefer an explicit action scope when a workflow has multiple async steps:\n\n```tsx\nimport { action, logger, loggedFetch } from \"@almanac-ai/agentlogs-next\";\n\nconst log = logger(\"page-editor\");\n\nawait action(\"publish-page\", async () => {\n  log.info(\"publish.started\", { pageId });\n  const res = await loggedFetch(\"/api/pages/publish\", { method: \"POST\" });\n  log.info(\"publish.succeeded\", { pageId, status: res.status });\n});\n```\n\n`loggedFetch` ensures a trace exists, sends it in `traceparent`, and records\n`fetch.started`, `fetch.completed`, or `fetch.failed`.\n\n## Server Route\n\n`@almanac-ai/agentlogs-next/server` validates incoming log envelopes and appends them\nthrough the shared Node file sink from `@almanac-ai/agentlogs-core`. It honors\n`AGENTLOGS=0` and `AGENTLOGS_FILE` using the same path rules as the CLI and\nNode SDK.\n\n## Develop\n\nFrom the repo root:\n\n```bash\nnpm install\nnpm run test:next\nnpm run build\n```\n","readmeFilename":"README.md","_rev":"1-3fc9252a3a58200fffd5ded9a5760108"}