{"_id":"@agent_press/core","_rev":"3-ea4a7bd86fb7e3f02dd2d1b43d7cf06a","name":"@agent_press/core","dist-tags":{"latest":"1.0.0","next":"1.0.0-rc.2"},"versions":{"1.0.0-rc.1":{"name":"@agent_press/core","version":"1.0.0-rc.1","keywords":["agents.txt","agentpress","ai-agents","parser","validator"],"license":"MIT","_id":"@agent_press/core@1.0.0-rc.1","maintainers":[{"name":"barneywohl","email":"barneywohl@gmail.com"}],"homepage":"https://github.com/barneywohl/agentpress/tree/main/packages/core","bugs":{"url":"https://github.com/barneywohl/agentpress/issues"},"dist":{"shasum":"19f7c33fbf01f2887a5ee97ce68bff1b287b670e","tarball":"https://registry.npmjs.org/@agent_press/core/-/core-1.0.0-rc.1.tgz","fileCount":10,"integrity":"sha512-6y3O7wyvL+bPiw7acFVEK5Pa8gJaF3TEIZ9gjir5RkWllZqq9bO4dbNShOQuWk2XhgAYuQufErferNPHjuX35A==","signatures":[{"sig":"MEQCIDwl13QQj8DA2L7QVHofca/SReyS/TgxVTdjDTutLzd3AiAtuEC/BBc/Pmk+LkGYjqybsxPu6cj8iudunnU8gt9QPQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74463},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"c45cf8d42c6d5dffc10faa966569007cf91337e2","scripts":{"test":"node --test test/*.test.mjs","build":"tsc -p tsconfig.json && tsc -p tsconfig.cjs.json","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"barneywohl","email":"barneywohl@gmail.com"},"repository":{"url":"git+https://github.com/barneywohl/agentpress.git","type":"git","directory":"packages/core"},"_npmVersion":"10.9.4","description":"Zero-dependency parser and validator for agents.txt v1.0. The reference TypeScript implementation.","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/core_1.0.0-rc.1_1778651519076_0.13814189143478606","host":"s3://npm-registry-packages-npm-production"}},"1.0.0-rc.2":{"name":"@agent_press/core","version":"1.0.0-rc.2","keywords":["agents.txt","agentpress","ai-agents","parser","validator"],"license":"MIT","_id":"@agent_press/core@1.0.0-rc.2","maintainers":[{"name":"barneywohl","email":"barneywohl@gmail.com"}],"homepage":"https://github.com/barneywohl/agentpress/tree/main/packages/core","bugs":{"url":"https://github.com/barneywohl/agentpress/issues"},"dist":{"shasum":"a6306f2098b60abb6bf0e5c9d14a1206dc56fee9","tarball":"https://registry.npmjs.org/@agent_press/core/-/core-1.0.0-rc.2.tgz","fileCount":10,"integrity":"sha512-JwhEPpLUoUVpleYU7eOpWOCM/BYDBvjHhE2/N1Jpq2i9+QIhosyrSN/3KqE0cakLP7l/IQTfCvVD6D9pnSvycg==","signatures":[{"sig":"MEYCIQCsSW/SHrRB6FNoJNfVrNK+pjB7QBL0qg7KrxypsJJvwwIhAKLKewcUYDMISCkkfFYGlQZYIinKJ0jcC/K7yNGjX45h","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74463},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"f0cbc34b0458838f79e3ab9d461c85452a5b2f64","scripts":{"test":"node --test test/*.test.mjs","build":"tsc -p tsconfig.json && tsc -p tsconfig.cjs.json","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"barneywohl","email":"barneywohl@gmail.com"},"repository":{"url":"git+https://github.com/barneywohl/agentpress.git","type":"git","directory":"packages/core"},"_npmVersion":"10.9.4","description":"Zero-dependency parser and validator for agents.txt v1.0. The reference TypeScript implementation.","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/core_1.0.0-rc.2_1778692700572_0.2912474017459552","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@agent_press/core","version":"1.0.0","description":"Zero-dependency parser and validator for agents.txt v1.0. The reference TypeScript implementation.","type":"module","main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"scripts":{"build":"tsc -p tsconfig.json && tsc -p tsconfig.cjs.json","test":"node --test test/*.test.mjs","prepublishOnly":"npm run build && npm test"},"keywords":["agents.txt","agentpress","ai-agents","parser","validator"],"license":"MIT","homepage":"https://github.com/barneywohl/agentpress/tree/main/packages/core","repository":{"type":"git","url":"git+https://github.com/barneywohl/agentpress.git","directory":"packages/core"},"bugs":{"url":"https://github.com/barneywohl/agentpress/issues"},"engines":{"node":">=18"},"devDependencies":{"typescript":"^5.4.0"},"_id":"@agent_press/core@1.0.0","gitHead":"859639c49b983a1e757c27fee8aca5925763dec5","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-1bn2HcDEy5iwHNpYgaH6n+mXoWA+Cib2QUdPNdbj0ZWgxbmtJ29+otFZVV+b8mkV5XkfiiGd+rfKGtFeaYR/gQ==","shasum":"73c20362cb6fbc091ff40e1aab84d9e9dc41fb59","tarball":"https://registry.npmjs.org/@agent_press/core/-/core-1.0.0.tgz","fileCount":10,"unpackedSize":74458,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCz9BR0GNbtUp4wYOeOv68/+fhc3tGzuvVZEahtom5jsQIgewQvWfNdwYNKpp7WRtrEUCEMPXe507SoCdqqbKpVruU="}]},"_npmUser":{"name":"barneywohl","email":"barneywohl@gmail.com"},"directories":{},"maintainers":[{"name":"barneywohl","email":"barneywohl@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_1.0.0_1778698221995_0.11090115108865595"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-13T05:51:58.977Z","modified":"2026-05-13T18:50:22.318Z","1.0.0-rc.1":"2026-05-13T05:51:59.225Z","1.0.0-rc.2":"2026-05-13T17:18:20.718Z","1.0.0":"2026-05-13T18:50:22.135Z"},"bugs":{"url":"https://github.com/barneywohl/agentpress/issues"},"license":"MIT","homepage":"https://github.com/barneywohl/agentpress/tree/main/packages/core","keywords":["agents.txt","agentpress","ai-agents","parser","validator"],"repository":{"type":"git","url":"git+https://github.com/barneywohl/agentpress.git","directory":"packages/core"},"description":"Zero-dependency parser and validator for agents.txt v1.0. The reference TypeScript implementation.","maintainers":[{"name":"barneywohl","email":"barneywohl@gmail.com"}],"readme":"# @agent_press/core\n\n> Zero-dependency reference parser for [`agents.txt v1.0`](https://github.com/barneywohl/agentpress/blob/main/docs/AGENTSTXT_SPEC.md).\n\nThe TypeScript parser used by every `@agent_press/*` package and recommended for any agent runtime that needs to read `agents.txt` files.\n\n## Install\n\n```bash\nnpm install @agent_press/core\n```\n\n## Quick start\n\n```ts\nimport { parse, validate, isActionAllowed, checkRateLimit, fetchAndParse } from \"@agent_press/core\";\n\n// Parse a local file\nconst text = await Deno.readTextFile(\"./agents.txt\");  // or fs.readFileSync etc.\nconst data = parse(text);\n\n// Validate against the spec\nconst { ok, issues } = validate(data);\nif (!ok) {\n  for (const issue of issues) console.warn(issue.severity, issue.message);\n}\n\n// Decide what an agent may do\nconst decision = isActionAllowed(data, \"merge_to_main\");\n//   \"allow\" | \"deny\" | \"requires_approval\" | \"unknown\"\n\n// Respect rate limits\nif (!checkRateLimit(data, \"pr\", currentDailyPrCount)) {\n  throw new Error(\"agents.txt rate limit reached for this repo\");\n}\n\n// Or just fetch directly from a URL\nconst remoteData = await fetchAndParse(\"https://github.com/barneywohl/agentpress/raw/main/agents.txt\");\n```\n\n## API\n\n| Function | Description |\n|---|---|\n| `parse(text)` | Parse a raw `agents.txt` string into a typed object. Tolerant — won't throw. |\n| `validate(data)` | Returns `{ ok, issues[] }`. Errors fail validation; warnings don't. |\n| `isActionAllowed(data, action)` | Returns `\"allow\" \\| \"deny\" \\| \"requires_approval\" \\| \"unknown\"`. |\n| `checkRateLimit(data, kind, count)` | `kind` ∈ `\"pr\" \\| \"issue\" \\| \"comment\" \\| \"branch\"`. |\n| `fetchAndParse(url)` | `fetch` + `parse` — for agent runtimes. |\n| `load(url)` | `fetchAndParse` + `validate` — convenience. |\n\n## Why zero deps\n\n- Auditable in 30 minutes.\n- Safe to bundle into agent runtimes.\n- Same surface ports cleanly to other languages (see [`agentpress-core`](https://pypi.org/project/agentpress-core/) for Python).\n\n## License\n\nMIT — implementation, copies, and forks are welcome.\n","readmeFilename":"README.md"}