{"_id":"@agent-ils/logger","_rev":"7-795174534a171527c2f91a953d2031e6","name":"@agent-ils/logger","dist-tags":{"latest":"0.3.0"},"versions":{"0.0.1":{"name":"@agent-ils/logger","version":"0.0.1","_id":"@agent-ils/logger@0.0.1","maintainers":[{"name":"bugfix2018","email":"923401025@qq.com"},{"name":"bugfix2019","email":"670882978@qq.com"}],"bin":{"agent-ils-logger":"dist/cli.js"},"dist":{"shasum":"92cb43e7cd45e5b3a5bb68127d9ec1112de00db2","tarball":"https://registry.npmjs.org/@agent-ils/logger/-/logger-0.0.1.tgz","fileCount":18,"integrity":"sha512-HbCFm4SFkv+ZJZo9CFlGHnYlp2AZDHhO1zEoomMNlo5/fUqgWh+KZKjM0Yg9cLfhbnKIB+ljw9akr/5xl+Fdzg==","signatures":[{"sig":"MEYCIQCmSpe/STdh8iidX0ps4pOhfCe34bcaoJ3Y+RejQF2MTwIhANPyYHy8DwcI0abSSwSVNC/lM/YsqlzoR7vkUw8dc/vk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":98856},"main":"./dist/index.cjs","type":"module","_from":"file:agent-ils-logger-0.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./query":{"types":"./dist/query.d.ts","import":"./dist/query.js","require":"./dist/query.cjs"},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"}},"scripts":{"dev":"tsup --watch","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"bugfix2019","email":"670882978@qq.com"},"_resolved":"/private/var/folders/98/cp8wqx4923q60vxl6l719lnh0000gn/T/144222a8d9c8365ddda4e9d4fe5e1804/agent-ils-logger-0.0.1.tgz","_integrity":"sha512-HbCFm4SFkv+ZJZo9CFlGHnYlp2AZDHhO1zEoomMNlo5/fUqgWh+KZKjM0Yg9cLfhbnKIB+ljw9akr/5xl+Fdzg==","_npmVersion":"10.9.3","description":"Local JSONL logger for AI-assisted debugging, with browser writes and CLI reads.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"cac":"^6.7.14"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5.8.3","@types/node":"^22.15.3"},"_npmOperationalInternal":{"tmp":"tmp/logger_0.0.1_1777550929195_0.19177729102553065","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@agent-ils/logger","version":"0.0.2","keywords":["agentils","logger","jsonl","logging","debug","agent","llm","cli","browser","http"],"author":{"name":"liuyuxuan","email":"ts02315607@gmail.com"},"license":"MIT","_id":"@agent-ils/logger@0.0.2","maintainers":[{"name":"bugfix2018","email":"923401025@qq.com"},{"name":"bugfix2019","email":"670882978@qq.com"}],"homepage":"https://github.com/bugfix2020/AgentILS/tree/main/packages/logger#readme","bugs":{"url":"https://github.com/bugfix2020/AgentILS/issues"},"bin":{"agent-ils-logger":"dist/cli.js"},"dist":{"shasum":"c09df255cb0661dac2cea6e3358725a354aa5632","tarball":"https://registry.npmjs.org/@agent-ils/logger/-/logger-0.0.2.tgz","fileCount":22,"integrity":"sha512-uM/cSQjB3sYXHXD03K8R5rjBrug/erWbduVy3fJRhuiWRAxhzffDXLZZ4W0oTimRpZGhapUwUIUurl0K9VzShQ==","signatures":[{"sig":"MEQCIHm/NCdWIdA1Tk6RRi952qO9ed3MZv2+grerrXnMhhbpAiB6YI0fzGHVrQhy+iw6JxxNMhLmWfHdwF31jofNhRpheg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":121167},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./query":{"types":"./dist/query.d.ts","import":"./dist/query.js","require":"./dist/query.cjs"},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"}},"gitHead":"d8e104c86c5d3d6ed0258d5ed927d9fe42b76115","scripts":{"dev":"tsup --watch","build":"tsup && node scripts/copy-templates.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"bugfix2019","email":"670882978@qq.com"},"repository":{"url":"git+https://github.com/bugfix2020/AgentILS.git","type":"git","directory":"packages/logger"},"_npmVersion":"10.9.3","description":"Local JSONL logger for AI-assisted debugging, with browser writes and CLI reads.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"cac":"^6.7.14"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5.8.3","@types/node":"^22.15.3"},"_npmOperationalInternal":{"tmp":"tmp/logger_0.0.2_1778051052506_0.8879573932400278","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@agent-ils/logger","version":"0.1.0","keywords":["agentils","logger","jsonl","logging","debug","agent","llm","cli","browser","http"],"author":{"name":"liuyuxuan","email":"ts02315607@gmail.com"},"license":"MIT","_id":"@agent-ils/logger@0.1.0","maintainers":[{"name":"bugfix2018","email":"923401025@qq.com"},{"name":"bugfix2019","email":"670882978@qq.com"}],"homepage":"https://github.com/bugfix2020/AgentILS/tree/main/packages/logger#readme","bugs":{"url":"https://github.com/bugfix2020/AgentILS/issues"},"bin":{"agent-ils-logger":"dist/cli.js"},"dist":{"shasum":"5dac951b75739dfcd2c8d9e151b978da7f3e2be4","tarball":"https://registry.npmjs.org/@agent-ils/logger/-/logger-0.1.0.tgz","fileCount":22,"integrity":"sha512-WKWLPbsMACybCjErqLWuLpo1tKamrhb0lJnGSOK1zuhInMEC9zz+raR3aMz4hInwBfVe0sU6q5sM+3L3xIip6w==","signatures":[{"sig":"MEUCIBtYXnXOyiGIyKqjLg0e+iP+BlKZm/mZwkvNOTOBkkcTAiEAzWC9JiUStyDHKc4mxp7m/6DPpy+5aY51maGKvTlRZNc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-ils%2flogger@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":127209},"main":"./dist/index.cjs","type":"module","_from":"file:agent-ils-logger-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./query":{"types":"./dist/query.d.ts","import":"./dist/query.js","require":"./dist/query.cjs"},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"}},"scripts":{"dev":"tsup --watch","build":"tsup && node scripts/copy-templates.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4f8625ca-da7d-41dc-b212-92f6c9297650"}},"_resolved":"/tmp/314be811c32a69802aac7c51c742d3d7/agent-ils-logger-0.1.0.tgz","_integrity":"sha512-WKWLPbsMACybCjErqLWuLpo1tKamrhb0lJnGSOK1zuhInMEC9zz+raR3aMz4hInwBfVe0sU6q5sM+3L3xIip6w==","repository":{"url":"git+https://github.com/bugfix2020/AgentILS.git","type":"git","directory":"packages/logger"},"_npmVersion":"11.12.1","description":"Local JSONL logger for AI-assisted debugging, with browser writes and CLI reads.","directories":{},"_nodeVersion":"24.15.0","dependencies":{"cac":"^6.7.14"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5.8.3","@types/node":"^22.15.3"},"_npmOperationalInternal":{"tmp":"tmp/logger_0.1.0_1779358396419_0.5241058731652137","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@agent-ils/logger","version":"0.1.1","keywords":["agentils","logger","jsonl","logging","debug","agent","llm","cli","browser","http"],"author":{"name":"liuyuxuan","email":"ts02315607@gmail.com"},"license":"MIT","_id":"@agent-ils/logger@0.1.1","maintainers":[{"name":"bugfix2018","email":"923401025@qq.com"},{"name":"bugfix2019","email":"670882978@qq.com"}],"homepage":"https://github.com/bugfix2020/AgentILS/tree/main/packages/logger#readme","bugs":{"url":"https://github.com/bugfix2020/AgentILS/issues"},"bin":{"agent-ils-logger":"dist/cli.js"},"dist":{"shasum":"0a00c20f150294a83cfd3de9f29416cfca3c56ef","tarball":"https://registry.npmjs.org/@agent-ils/logger/-/logger-0.1.1.tgz","fileCount":22,"integrity":"sha512-+w7goeUC6r9Jji0rKG9qAlJyyNABuOGATq7bJUV0i1Muw8lQiZphoHv4D8yDuwWGBt5fLJJdVlbTSgvjkL14Rg==","signatures":[{"sig":"MEQCIFLLdlXsggP1wIVaP8wH9UL9kwcEkzXYozNsRiSrj0jWAiB6TTUHE5j0o7ZmaQtbPbdL4oEpNbmgo9fSBjXZQnWE3w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-ils%2flogger@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":106018},"main":"./dist/index.cjs","type":"module","_from":"file:agent-ils-logger-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./query":{"types":"./dist/query.d.ts","import":"./dist/query.js","require":"./dist/query.cjs"},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"}},"scripts":{"dev":"tsup --watch","build":"tsup && node scripts/copy-templates.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4f8625ca-da7d-41dc-b212-92f6c9297650"}},"_resolved":"/tmp/f2a1d2b4305cbaf2fa0ea591b84d3865/agent-ils-logger-0.1.1.tgz","_integrity":"sha512-+w7goeUC6r9Jji0rKG9qAlJyyNABuOGATq7bJUV0i1Muw8lQiZphoHv4D8yDuwWGBt5fLJJdVlbTSgvjkL14Rg==","repository":{"url":"git+https://github.com/bugfix2020/AgentILS.git","type":"git","directory":"packages/logger"},"_npmVersion":"11.12.1","description":"Local JSONL logger for AI-assisted debugging, with browser writes and CLI reads.","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5.8.3","@types/node":"^22.15.3"},"_npmOperationalInternal":{"tmp":"tmp/logger_0.1.1_1779883732691_0.33045671606380855","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@agent-ils/logger","version":"0.1.2","keywords":["agentils","logger","jsonl","logging","debug","agent","llm","cli","browser","http"],"author":{"name":"liuyuxuan","email":"ts02315607@gmail.com"},"license":"MIT","_id":"@agent-ils/logger@0.1.2","maintainers":[{"name":"bugfix2018","email":"923401025@qq.com"},{"name":"bugfix2019","email":"670882978@qq.com"}],"homepage":"https://github.com/bugfix2020/AgentILS/tree/main/packages/logger#readme","bugs":{"url":"https://github.com/bugfix2020/AgentILS/issues"},"bin":{"agent-ils-logger":"dist/cli.js"},"dist":{"shasum":"5362de558e208401bcaf4e2b517e2c62a7a72b90","tarball":"https://registry.npmjs.org/@agent-ils/logger/-/logger-0.1.2.tgz","fileCount":22,"integrity":"sha512-hsS1UcHY0LREf+9/jVdBD/4OBLm8T07XAzmROtvHIHHdO+TOMGFhdKFy22o5Yc+azF6s0FIOEei44hXfM/Rj0w==","signatures":[{"sig":"MEQCIF6Ifbvh1k/0D/05gf4+CcFyJ+cc/qYOIpGGYnB6sSTOAiB1Dlx35LJ7vFuXp7ct53nYFHUfpde1oNbPoKrc2HGoGw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-ils%2flogger@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":108593},"main":"./dist/index.cjs","type":"module","_from":"file:agent-ils-logger-0.1.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./query":{"types":"./dist/query.d.ts","import":"./dist/query.js","require":"./dist/query.cjs"},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"}},"scripts":{"dev":"tsup --watch","build":"tsup && node scripts/copy-templates.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4f8625ca-da7d-41dc-b212-92f6c9297650"}},"_resolved":"/tmp/ec1d8395067226708f43f4f255bc04eb/agent-ils-logger-0.1.2.tgz","_integrity":"sha512-hsS1UcHY0LREf+9/jVdBD/4OBLm8T07XAzmROtvHIHHdO+TOMGFhdKFy22o5Yc+azF6s0FIOEei44hXfM/Rj0w==","repository":{"url":"git+https://github.com/bugfix2020/AgentILS.git","type":"git","directory":"packages/logger"},"_npmVersion":"11.12.1","description":"Local JSONL logger for AI-assisted debugging, with browser writes and CLI reads.","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5.8.3","@types/node":"^22.15.3"},"_npmOperationalInternal":{"tmp":"tmp/logger_0.1.2_1779948138339_0.7163641548674085","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@agent-ils/logger","version":"0.2.0","keywords":["agentils","logger","jsonl","logging","debug","agent","llm","cli","browser","http"],"author":{"name":"liuyuxuan","email":"ts02315607@gmail.com"},"license":"MIT","_id":"@agent-ils/logger@0.2.0","maintainers":[{"name":"bugfix2018","email":"923401025@qq.com"},{"name":"bugfix2019","email":"670882978@qq.com"}],"homepage":"https://github.com/bugfix2020/AgentILS/tree/main/packages/logger#readme","bugs":{"url":"https://github.com/bugfix2020/AgentILS/issues"},"bin":{"agent-ils-logger":"dist/cli.js"},"dist":{"shasum":"3a300d0701e8923183dd7c7ecb01f529d58f81ad","tarball":"https://registry.npmjs.org/@agent-ils/logger/-/logger-0.2.0.tgz","fileCount":22,"integrity":"sha512-8VQZDHWo/0tBtT/l2QZNCqwzctCzHdly5EodHl0NknOLkfHEU3qcPGR6BldiWAsj44hmg86f/iB+fZKFcQZNwQ==","signatures":[{"sig":"MEQCIH8pwV01SyLwraOyqs4R+yay3wFhYDPqVse1fUmxP41QAiBCBcArtxy9fxFd+gZF6mrH90VRmpSasMrdp2fnQcgVrQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-ils%2flogger@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":114006},"main":"./dist/index.cjs","type":"module","_from":"file:agent-ils-logger-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./query":{"types":"./dist/query.d.ts","import":"./dist/query.js","require":"./dist/query.cjs"},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"}},"scripts":{"dev":"tsup --watch","build":"tsup && node scripts/copy-templates.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4f8625ca-da7d-41dc-b212-92f6c9297650"}},"_resolved":"/tmp/2746910c562a9459984bb9e7e6d5eaed/agent-ils-logger-0.2.0.tgz","_integrity":"sha512-8VQZDHWo/0tBtT/l2QZNCqwzctCzHdly5EodHl0NknOLkfHEU3qcPGR6BldiWAsj44hmg86f/iB+fZKFcQZNwQ==","repository":{"url":"git+https://github.com/bugfix2020/AgentILS.git","type":"git","directory":"packages/logger"},"_npmVersion":"11.13.0","description":"Local JSONL logger for AI-assisted debugging, with browser writes and CLI reads.","directories":{},"_nodeVersion":"24.16.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","typescript":"^5.8.3","@types/node":"^22.15.3"},"_npmOperationalInternal":{"tmp":"tmp/logger_0.2.0_1780302535727_0.7456816357873108","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@agent-ils/logger","version":"0.3.0","description":"Local JSONL logger for AI-assisted debugging, with browser writes and CLI reads.","keywords":["agentils","logger","jsonl","logging","debug","agent","llm","cli","browser","http"],"homepage":"https://github.com/bugfix2020/AgentILS/tree/main/packages/logger#readme","bugs":{"url":"https://github.com/bugfix2020/AgentILS/issues"},"repository":{"type":"git","url":"git+https://github.com/bugfix2020/AgentILS.git","directory":"packages/logger"},"license":"MIT","author":{"name":"liuyuxuan","email":"ts02315607@gmail.com"},"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","bin":{"agent-ils-logger":"dist/cli.js"},"engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"},"./query":{"types":"./dist/query.d.ts","import":"./dist/query.js","require":"./dist/query.cjs"}},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"devDependencies":{"@types/node":"^22.15.3","tsup":"^8.5.1","typescript":"^5.8.3"},"scripts":{"build":"tsup && node scripts/copy-templates.mjs","dev":"tsup --watch","test":"pnpm run build && node --test test/*.test.mjs","typecheck":"tsc --noEmit"},"_id":"@agent-ils/logger@0.3.0","_integrity":"sha512-ehAXcBRJEjGNvM5BcyRQ90iIZowTfcgWVxY/0WK0CXt5ljil9j2QqmRavhXEkU13dDd3wpsuAllSLt3aDWHp0g==","_resolved":"/tmp/2e095c57fe61343a89afe883d77533b2/agent-ils-logger-0.3.0.tgz","_from":"file:agent-ils-logger-0.3.0.tgz","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-ehAXcBRJEjGNvM5BcyRQ90iIZowTfcgWVxY/0WK0CXt5ljil9j2QqmRavhXEkU13dDd3wpsuAllSLt3aDWHp0g==","shasum":"00e0765e6b97ac163d86dcba60a6a406c69b7ee1","tarball":"https://registry.npmjs.org/@agent-ils/logger/-/logger-0.3.0.tgz","fileCount":22,"unpackedSize":146766,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-ils%2flogger@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDobesv/E5SA29co+ttRTHjGbjvHfx8LjcZ4I2/lbD7SQIhALVe8Qa4vSMUAHLnPvPINRZUgaW8i02mtMkd9LYhsp4k"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4f8625ca-da7d-41dc-b212-92f6c9297650"}},"directories":{},"maintainers":[{"name":"bugfix2018","email":"923401025@qq.com"},{"name":"bugfix2019","email":"670882978@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/logger_0.3.0_1783393833925_0.7691907176153525"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-30T12:08:49.076Z","modified":"2026-07-07T03:10:34.331Z","0.0.1":"2026-04-30T12:08:49.337Z","0.0.2":"2026-05-06T07:04:12.628Z","0.1.0":"2026-05-21T10:13:16.582Z","0.1.1":"2026-05-27T12:08:52.838Z","0.1.2":"2026-05-28T06:02:18.498Z","0.2.0":"2026-06-01T08:28:55.844Z","0.3.0":"2026-07-07T03:10:34.062Z"},"bugs":{"url":"https://github.com/bugfix2020/AgentILS/issues"},"author":{"name":"liuyuxuan","email":"ts02315607@gmail.com"},"license":"MIT","homepage":"https://github.com/bugfix2020/AgentILS/tree/main/packages/logger#readme","keywords":["agentils","logger","jsonl","logging","debug","agent","llm","cli","browser","http"],"repository":{"type":"git","url":"git+https://github.com/bugfix2020/AgentILS.git","directory":"packages/logger"},"description":"Local JSONL logger for AI-assisted debugging, with browser writes and CLI reads.","maintainers":[{"name":"bugfix2018","email":"923401025@qq.com"},{"name":"bugfix2019","email":"670882978@qq.com"}],"readme":"# AgentILS Logger\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/@agent-ils/logger\"><img alt=\"npm\" src=\"https://img.shields.io/npm/v/@agent-ils/logger?label=npm&color=CB3837\"></a>\n  <img alt=\"TypeScript\" src=\"https://img.shields.io/badge/TypeScript-5.8-3178C6?logo=typescript&logoColor=white\">\n  <img alt=\"Node.js\" src=\"https://img.shields.io/badge/Node.js-20%2B-339933?logo=node.js&logoColor=white\">\n  <img alt=\"JSONL\" src=\"https://img.shields.io/badge/logs-JSONL-7C3AED\">\n  <img alt=\"API\" src=\"https://img.shields.io/badge/API-write%20%2B%20read-111827\">\n</p>\n\n<p align=\"center\">\n  <a href=\"https://github.com/bugfix2020/AgentILS/blob/main/packages/logger/README.md\">English</a> | 简体中文\n</p>\n\n`@agent-ils/logger` 是一个面向 AI 辅助调试的本地 JSONL 日志器。它把前端、后端、WebView、MCP 服务或脚本运行时的关键事件写入本地 JSONL 文件，再让人或 LLM Agent 按尾部条数 / 时间范围把这些原始记录读回来。\n\n它只做两件事：写日志、读日志。它不做自动总结、不做自动根因分析、不把日志压缩成 digest。JSONL 文件就是事实来源。\n\n它同时面向普通用户和 LLM Agent：用户只需运行一条命令启动收集器并读取尾部日志，Agent 也能把它识别为 AgentILS 标准的日志收集方式，而不是凭聊天记录瞎猜失败原因。\n\n> 本 README 面向用户。如果你需要 LLM Agent 帮你自动化安装、写日志或读日志，请把 [`LLM_USAGE.md`](./LLM_USAGE.md) 丢给它而不是这份 README——`LLM_USAGE.md` 没有 badges、双语切换等装饰性内容，体积更小，可以显著降低 LLM 的 token 消耗。\n\n## 使用方式\n\n启动本地日志收集器。它会监听本地 HTTP 接口，并把日志写入目标项目的 `.agent-ils/logger/logs`。\n\npnpm：\n\n```sh\npnpm dlx @agent-ils/logger\n```\n\nnpm：\n\n```sh\nnpx @agent-ils/logger\n```\n\nyarn：\n\n```sh\nyarn dlx @agent-ils/logger\n```\n\nbun：\n\n```sh\nbunx @agent-ils/logger\n```\n\n如果目标项目不在当前目录，可以传入 `--cwd`：\n\n```sh\nnpx @agent-ils/logger --cwd packages/my-app\n```\n\n启动成功后，默认 endpoint 是：\n\n```text\nhttp://127.0.0.1:12138\n```\n\n默认日志目录是：\n\n```text\n.agent-ils/logger/logs\n```\n\n读取最新 50 条日志：\n\n```sh\nnpx @agent-ils/logger read --tail 50\n```\n\n从某个时间点读到最新日志：\n\n```sh\nnpx @agent-ils/logger read --from 2026-04-30T10:00:00Z --format json\n```\n\n读取一个固定时间段：\n\n```sh\nnpx @agent-ils/logger read --from 2026-04-30T10:00:00Z --to 2026-04-30T10:10:00Z --format json\n```\n\n`--from` 和 `--to` 也支持 `10m`、`2h`、`1d` 这类相对时间：\n\n```sh\nnpx @agent-ils/logger read --from 10m --format json\n```\n\n包发布前，可以在本仓库中用构建产物测试：\n\n```sh\npnpm --filter @agent-ils/logger build\nnode packages/logger/dist/cli.js read --tail 50\n```\n\n`npx`、`pnpm dlx`、`yarn dlx`、`bunx` 会先运行一个很小的 Node wrapper。\n这个 wrapper 必须从系统或 `~/.agent-ils/bin` 解析真正的原生\n`agent-ils-logger` 二进制；它会刻意跳过 `node_modules/.bin` 下的包管理器\nshim，避免递归启动自己。\n\n## 常用命令\n\n显式启动本地日志收集器：\n\n```sh\nnpx @agent-ils/logger serve\n```\n\n指定端口和日志目录：\n\n```sh\nnpx @agent-ils/logger serve --port 12138 --log-dir .agent-ils/logger/logs\n```\n\n输出机器可读的启动信息：\n\n```sh\nnpx @agent-ils/logger serve --json\n```\n\n读取尾部日志：\n\n```sh\nnpx @agent-ils/logger read --tail 80 --format json\n```\n\n按稳定字段过滤日志：\n\n```sh\nnpx @agent-ils/logger read --tail 80 --source frontend --level warn --event api.slow --format json\n```\n\n按时间范围读取：\n\n```sh\nnpx @agent-ils/logger read --from 2026-04-30T10:00:00Z --to 2026-04-30T10:10:00Z --format json\n```\n\n省略 `read` 子命令但传入读取参数时，CLI 会自动按 `read` 执行：\n\n```sh\nnpx @agent-ils/logger --tail 80 --format json\n```\n\n## Agent / LLM 用法\n\n如果你想让 LLM Agent 替你安装、启动、写日志或读日志，**不要把这份 README 丢给它**，请把 [`LLM_USAGE.md`](./LLM_USAGE.md) 丢给它——这是给 LLM 看的单页参考，token 消耗远小于本 README。\n\n如果你的 Agent 运行时支持 skill（Claude Code、Copilot、Cursor、AgentILS 等），本包还提供一个召回用的精炼 skill：\n\n```text\nnode_modules/@agent-ils/logger/dist/templates/llm/agent-ils-logger.skill.md\n```\n\n你可以这样让 LLM 自己安装这个 skill：\n\n```text\n请读取 node_modules/@agent-ils/logger/dist/templates/llm/agent-ils-logger.skill.md\n（如果还没安装包，请从 npm 或 GitHub 拉取最新版），然后把它复制到你当前所在的\nAgent 运行时（Codex、Claude Code、Copilot、Cursor、AgentILS 等）的 skill /\ninstruction 目录里。你知道自己运行在哪个环境上，必要时请查阅该环境的官方文档\n确认目录约定。不要凭空猜路径，不确定就先问我。\n```\n\n这是有意设计：让运行时的 LLM 自己决定安装位置，包不维护脆弱的 IDE→目录对照表。\n\n## CLI 参数\n\n```text\nUsage:\n  agent-ils-logger serve [options]\n  agent-ils-logger read  [options]\n\nOptions for serve:\n  --cwd <dir>            项目根目录，默认当前目录\n  --host <host>          收集器 host，默认 127.0.0.1\n  --port <port>          收集器端口，默认 12138\n  --log-dir <dir>        JSONL 日志目录，默认 .agent-ils/logger/logs\n  --file-prefix <name>   默认 JSONL 文件名前缀，默认 agent-ils\n  --json                 输出机器可读的启动信息\n  --silent               减少启动输出\n\nOptions for read:\n  --cwd <dir>            项目根目录，默认当前目录\n  --log-dir <dir>        要扫描的 JSONL 日志目录，默认 .agent-ils/logger/logs\n  --tail <n>             读取尾部 n 条记录，默认 50\n  --from <time>          开始时间：ISO 时间、epoch ms，或 10m / 2h / 1d 这类相对时间\n  --to <time>            结束时间；省略时表示从 --from 读到最新记录\n  --source <source>      按 source 字段过滤\n  --level <level>        按 level 字段过滤，大小写不敏感\n  --event <event>        按 event 字段过滤\n  --format <format>      text、json 或 jsonl，默认 text\n```\n\n## 日志记录结构\n\n每条 JSONL 记录都尽量保持可读、可检索、可被 AI 直接引用。典型记录如下：\n\n```json\n{\n    \"ts\": \"2026-04-30T10:00:00.000Z\",\n    \"seq\": 1,\n    \"pid\": 12345,\n    \"source\": \"frontend\",\n    \"namespace\": \"frontend\",\n    \"level\": \"info\",\n    \"event\": \"api.response\",\n    \"message\": \"GET /api/users returned 200\",\n    \"fields\": {\n        \"url\": \"/api/users\",\n        \"status\": 200,\n        \"empty\": true\n    },\n    \"traceId\": \"user-list-001\",\n    \"fileName\": \"frontend-2026-04-30.jsonl\",\n    \"filePath\": \"/Users/me/project/.agent-ils/logger/logs/frontend-2026-04-30.jsonl\",\n    \"relativePath\": \"./.agent-ils/logger/logs/frontend-2026-04-30.jsonl\",\n    \"line\": 34,\n    \"location\": \"/Users/me/project/.agent-ils/logger/logs/frontend-2026-04-30.jsonl:34\",\n    \"relativeLocation\": \"./.agent-ils/logger/logs/frontend-2026-04-30.jsonl:34\"\n}\n```\n\n写入成功后，HTTP 返回体会带上实际写入的 `record`。工具需要稳定打开文件时用\n`record.location`（绝对 `path:line`）；展示给人或 LLM 时优先用\n`record.relativeLocation`，更短也更符合仓库上下文。读取日志时也会带上这些字段；\n旧 JSONL 没有存这些字段时，读取逻辑会用当前文件路径和物理行号补齐。\n\n推荐写入字段：\n\n- `source`：日志来源，例如 `frontend`、`backend`、`webview`、`mcp`\n- `event`：稳定事件名，例如 `api.request`、`api.response`、`ui.click`\n- `traceId`：串起一次用户操作、请求链路或工具调用\n- `url` / `method` / `status`：接口排查最常用字段\n- `params` / `body` / `empty`：判断请求参数和返回内容是否符合预期\n- `costMs`：排查慢请求或超时\n- `error`：错误名称、错误消息，必要时含 stack\n\n## Browser SDK\n\n`@agent-ils/logger/browser` 是浏览器安全的写日志方法，会通过 `fetch` 投递到本地收集器。\n\n```ts\nimport { createBrowserLogger } from '@agent-ils/logger/browser'\n\nconst logger = createBrowserLogger({\n    endpoint: 'http://127.0.0.1:12138',\n    source: 'frontend',\n    defaultFields: { app: 'agentils-webview' },\n})\n\nawait logger.debug('state.transition', { from: 'idle', to: 'loading' })\nconst result = await logger.info('api.response', { url: '/api/users', status: 200 }, { traceId: 'user-list-001' })\nif (result.record) console.log(result.record.relativeLocation ?? result.record.location)\nawait logger.warn('api.slow', { url: '/api/users', costMs: 3500 })\nawait logger.error('api.error', { url: '/api/users', message: 'timeout' })\n```\n\n可以用 `group` / `groupEnd` 把相关日志圈成一组，语义类似 `console.group`：\n\n```ts\nconst trace = { traceId: 'user-list-001' }\nawait logger.group('load users', { screen: 'users' }, trace)\nawait logger.info('api.request', { url: '/api/users' }, trace)\nawait logger.info('api.response', { url: '/api/users', status: 200 }, trace)\nawait logger.groupEnd(undefined, trace)\n```\n\n组内日志会在 `fields` 里自动带上 `group`、`groupPath`、`groupDepth`。\n`group()` 会写一条 `group.start` 记录，`groupEnd()` 会写一条 `group.end` 记录。\n\n可以用 `child` 复用上下文字段：\n\n```ts\nconst taskLogger = logger.child({ page: 'users' })\n\nawait taskLogger.info('ui.click', { button: 'refresh' })\nawait taskLogger.info('api.request', { url: '/api/users' })\n```\n\n常用配置：\n\n- `endpoint`：本地收集器地址\n- `source`：当前 writer 的日志来源\n- `defaultFields`：每条日志都会带上的字段\n- `traceId`：默认顶层 trace id。浏览器端如果要按单次调用设置顶层 trace id，请把 `{ traceId }` 作为第三个参数传入；`defaultFields.traceId` 只会留在 `fields` 内\n- `filePrefix`：JSONL 文件名前缀\n- `fileName`：指定 JSONL 文件名\n- `enabled`：关闭投递但保留调用点\n- `overrideKey`：当配置值与 `window.$agentILS.logger.overrideKey` 匹配时，即使 `enabled: false` 也强制记录日志。SSR 环境下 `window` 不可用时不生效，直接走 `enabled` 原逻辑\n- `timeoutMs`：每次写日志请求的超时时间\n- `onDeliveryError`：写入失败时的回调\n- `open`：为 `true` 时构造 logger 后立即启动健康探测，并在 Node 环境自动拉起 collector\n\n**写入结果**：浏览器端成功写入时返回 `{ ok: true, status: 200, record }`。如果投递被关闭或 collector 尚未就绪，会返回 `{ ok: true, status: 204 }`；此时没有写入 JSONL，`record` 也不存在。发送失败时返回 `{ ok: false, error }`。\n\n**Collector 就绪检测**：Browser SDK 会在后台每 10 秒探测 `GET /api/health`，与 `log()` 调用解耦。只有健康响应 JSON 包含 `{ \"ok\": true, \"name\": \"agentils-logger\" }` 时才算就绪；同端口上其它服务即使返回 2xx，也会被当作未就绪。collector 未就绪时 `log()` 立即返回 `{ ok: true, status: 204 }`，不会请求 `/api/logs`，因此不会产生 CONNECTION_REFUSED 或误打到其它服务的 404 噪音；发送失败会重置就绪状态并继续后台探测。传入 `open: true` 可以在构造时就开始探测，并在 Node 环境自动拉起 collector。首次健康探测是异步的；如果第一条浏览器日志就必须拿到 `record`，请先启动 collector 或先确认 `/api/health` 的 JSON body 正确。\n\n**环境变量行为**：Browser SDK 不读取 `AGENTILS_DEBUG`、`AGENTILS_LOG_URL` 或 `AGENTILS_LOG_DIR`；浏览器端请显式传 `enabled`、`endpoint` 和 `open`。`createLogger()` / `createChannelLogger()` 会用 `AGENTILS_DEBUG` 过滤 `debug` / `info`（`warn` / `error` 始终写出）。`createHttpLogger()` 默认 endpoint 来自 `AGENTILS_LOG_URL`，并且只有设置 `respectDebugEnv: true` 时才尊重 `AGENTILS_DEBUG`。`AGENTILS_LOG_DIR` 只影响 Node `defaultLogDir()` / `startHttpLogServer()` 默认值；原生 Go CLI 使用 `--cwd` 和 `--log-dir`。\n\n**日志目录 `.gitignore`**：collector 会在日志目录自动创建内容为 `*` 的 `.gitignore`，避免日志文件被误提交。\n\n## Node 写入 API\n\n包根入口提供 Node 端的 logger helper，可用于 Node 进程、MCP server 或 VS Code extension host：\n\n```ts\nimport { createHttpLogger, createLogger } from '@agent-ils/logger'\n\nconst stderrLogger = createLogger('mcp')\nstderrLogger.warn('tool failed', { toolName: 'request_user_clarification' })\n\nconst httpLogger = createHttpLogger({\n    source: 'mcp',\n    endpoint: 'http://127.0.0.1:12138',\n    traceId: 'feedback-001',\n    defaultFields: { component: 'mcp' },\n})\n\nhttpLogger.group('feedback flow')\nhttpLogger.info('interaction.submitted', { toolName: 'request_user_feedback', textLen: 42 })\nhttpLogger.groupEnd()\n```\n\nNode HTTP 日志中，`traceId` 选项会设置默认顶层 trace id；单次调用的\n`fields.traceId` 会覆盖它。`defaultFields.traceId` 只保留在 `fields` 内。\n\n`createHttpLogger()` 是 fire-and-forget：它的方法返回 `void`，不会把 collector\n响应体直接暴露给调用方。如果调用方需要马上拿到写入结果，请使用 Browser SDK\n或 raw HTTP API；也可以之后用 `@agent-ils/logger/query` 把 JSONL 读回来。\n\n## HTTP 写入 API\n\n不使用 SDK 时，也可以直接写 HTTP：\n\n```sh\ncurl -X POST http://127.0.0.1:12138/api/logs \\\n  -H 'content-type: application/json' \\\n  -d '{\n    \"source\": \"frontend\",\n    \"level\": \"info\",\n    \"event\": \"api.response\",\n    \"message\": \"GET /api/users returned 200\",\n    \"fields\": { \"url\": \"/api/users\", \"status\": 200, \"empty\": true },\n    \"traceId\": \"user-list-001\",\n    \"filePrefix\": \"frontend\"\n  }'\n```\n\n`POST /api/logs` 支持单条 payload，也支持 payload 数组。\n\n单条 payload 成功时返回：\n\n```json\n{\n    \"ok\": true,\n    \"record\": {\n        \"event\": \"api.response\",\n        \"filePath\": \"/Users/me/project/.agent-ils/logger/logs/frontend-2026-04-30.jsonl\",\n        \"relativePath\": \"./.agent-ils/logger/logs/frontend-2026-04-30.jsonl\",\n        \"line\": 34,\n        \"location\": \"/Users/me/project/.agent-ils/logger/logs/frontend-2026-04-30.jsonl:34\",\n        \"relativeLocation\": \"./.agent-ils/logger/logs/frontend-2026-04-30.jsonl:34\"\n    }\n}\n```\n\n数组 payload 成功时返回 `{ \"ok\": true, \"records\": [...] }`。\n\n健康检查：\n\n```sh\ncurl http://127.0.0.1:12138/api/health\n```\n\n有效的 collector 健康响应类似：\n\n```json\n{ \"ok\": true, \"name\": \"agentils-logger\", \"logDir\": \"/abs/project/.agent-ils/logger/logs\" }\n```\n\n## 读取 API\n\n如果要在自己的 UI、脚本或 Ink 面板里复用读取逻辑，可以使用 `@agent-ils/logger/query`：\n\n```ts\nimport { formatLogRecords, readLogRecords } from '@agent-ils/logger/query'\n\nconst records = await readLogRecords({\n    tail: 80,\n    from: '2026-04-30T10:00:00Z',\n})\n\nconsole.log(formatLogRecords(records, 'json'))\n```\n\n读取参数与 CLI 保持一致：`tail`、`from`、`to`、`format`。程序化 formatter\n额外支持 `markdown`；Go CLI 支持 `text`、`json`、`jsonl`。\n\n## 不做什么\n\n`@agent-ils/logger` 故意不做这些事：\n\n- 不做自动 digest\n- 不做自动根因分析\n- 不做日志数据库\n- 不提供复杂查询语言\n- 不替人或 AI 下结论\n\n它是观察工具，不是判断工具。\n","readmeFilename":"README.zh-CN.md"}