{"_id":"@anteriorai/srg-compiler","_rev":"5-b6d54df710a4c261abd4e8db29724060","name":"@anteriorai/srg-compiler","dist-tags":{"latest":"0.6.1"},"versions":{"0.5.1":{"name":"@anteriorai/srg-compiler","version":"0.5.1","keywords":["srg","compiler","symbolic-reasoning"],"license":"SEE LICENSE IN LICENSE","_id":"@anteriorai/srg-compiler@0.5.1","maintainers":[{"name":"ant-alpacolypse","email":"anuj@anterior.com"},{"name":"vitali_avagyan","email":"vitali.avagyan@anterior.com"}],"homepage":"https://github.com/anteriorai/symbolic-reasoning#readme","bugs":{"url":"https://github.com/anteriorai/symbolic-reasoning/issues"},"bin":{"srg-compile":"dist/cli.js"},"dist":{"shasum":"a5febb3dfcc166e0ba07ad1025c0d326f900c3b9","tarball":"https://registry.npmjs.org/@anteriorai/srg-compiler/-/srg-compiler-0.5.1.tgz","fileCount":9,"integrity":"sha512-dEjfluLDeUj4RB1GOpR+EOvZ4VBo/GH8XpGwbCWenIbikT/dRVQYvHumat3zZ5OmcJrgM6GkHta7xmMEbLaGEA==","signatures":[{"sig":"MEYCIQDVO4TmUhk+TRiZpgjB0fxvcZrDPVyQavfqWK5i/3eXUQIhAK+U1kRMfVcOMwSijDNkp4yUe1FSUlkxSQb4y1o1xBD2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20672},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=24.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"e9693600ab401c56a7f4f6c5f22d56d685564627","private":false,"scripts":{"dev":"tsc --watch","test":"npm run build && node --test test/compiler.test.js","build":"tsc","compile":"node dist/cli.js"},"_npmUser":{"name":"ant-alpacolypse","email":"anuj@anterior.com"},"repository":{"url":"git+https://github.com/anteriorai/symbolic-reasoning.git","type":"git","directory":"packages/srg-compiler"},"_npmVersion":"11.6.2","description":"SRG v2 compiler - compiles .srg files to executable JSON","directories":{},"_nodeVersion":"24.11.1","dependencies":{"@anteriorai/srg-types":"^0.5.1","@anteriorai/srg-parser":"^0.5.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"5.9.3","@types/node":"20.19.27"},"_npmOperationalInternal":{"tmp":"tmp/srg-compiler_0.5.1_1778567729556_0.6472115223041581","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@anteriorai/srg-compiler","version":"0.6.0","keywords":["srg","compiler","symbolic-reasoning"],"license":"SEE LICENSE IN LICENSE","_id":"@anteriorai/srg-compiler@0.6.0","maintainers":[{"name":"ant-alpacolypse","email":"anuj@anterior.com"},{"name":"vitali_avagyan","email":"vitali.avagyan@anterior.com"}],"homepage":"https://github.com/anteriorai/symbolic-reasoning#readme","bugs":{"url":"https://github.com/anteriorai/symbolic-reasoning/issues"},"bin":{"srg-compile":"dist/cli.js"},"dist":{"shasum":"830ab68f77470a396de4da1664b1a212a3b2184d","tarball":"https://registry.npmjs.org/@anteriorai/srg-compiler/-/srg-compiler-0.6.0.tgz","fileCount":11,"integrity":"sha512-O3HTHkmEKZBjaaenZXzkFlHKRFE0SP7Uq2QYqjbJK9w1F39hZZeFBCCiQiYq7/1WBFwnr0GgZHWU3Sl5U4AOfA==","signatures":[{"sig":"MEQCIHIX7pqEmIQTsgnztvZSmfzpOoMOvorMTjTCMckn/9tfAiBJm03nxeSlqiLx7o0YeCgFatTSzGKmRH7/BKkCbG0iRQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22531},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=24.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"137137672d18f28a4d31a3a73081e9a2b24bcbc5","private":false,"scripts":{"dev":"tsc --watch","test":"npm run build && node --test test/compiler.test.js","build":"tsc","compile":"node dist/cli.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:59ba609d-f311-4c72-b602-de1a961d5fb6"}},"repository":{"url":"git+https://github.com/anteriorai/symbolic-reasoning.git","type":"git","directory":"packages/srg-compiler"},"_npmVersion":"11.6.2","description":"SRG v2 compiler - compiles .srg files to executable JSON","directories":{},"_nodeVersion":"24.11.1","dependencies":{"@anteriorai/srg-types":"^0.6.0","@anteriorai/srg-parser":"^0.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"5.9.3","@types/node":"20.19.27"},"_npmOperationalInternal":{"tmp":"tmp/srg-compiler_0.6.0_1782925052716_0.8895009709946904","host":"s3://npm-registry-packages-npm-production"}},"0.6.1":{"name":"@anteriorai/srg-compiler","version":"0.6.1","private":false,"license":"SEE LICENSE IN LICENSE","description":"SRG v2 compiler - compiles .srg files to executable JSON","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","publishConfig":{"access":"public"},"exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsc","test":"npm run build && node --test test/compiler.test.js","dev":"tsc --watch","compile":"node dist/cli.js"},"bin":{"srg-compile":"dist/cli.js"},"keywords":["srg","compiler","symbolic-reasoning"],"engines":{"node":">=24.0.0"},"dependencies":{"@anteriorai/srg-parser":"^0.6.1","@anteriorai/srg-types":"^0.6.1"},"devDependencies":{"typescript":"5.9.3","@types/node":"20.19.27"},"repository":{"type":"git","url":"git+https://github.com/anteriorai/symbolic-reasoning.git","directory":"packages/srg-compiler"},"gitHead":"81b1da875eee92a866fcf59bc2256042131a3288","_id":"@anteriorai/srg-compiler@0.6.1","bugs":{"url":"https://github.com/anteriorai/symbolic-reasoning/issues"},"homepage":"https://github.com/anteriorai/symbolic-reasoning#readme","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-Xb9PtdaI8zEkjmC54WrFEIkGXnQ+MpxOWU356j7jtwG4qYiPI5YT0M9oghACKVnc/tTI5JDX38Xr5zXPTv+6hQ==","shasum":"2bfc54290e47a0b18f211e931fd73e7704d48a58","tarball":"https://registry.npmjs.org/@anteriorai/srg-compiler/-/srg-compiler-0.6.1.tgz","fileCount":11,"unpackedSize":22531,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCLhG/M7EuJYvLkiHZXo2FESRfprz4c5Z4VdipkPNHUVwIgcNuZA8pYfHbFXbdh7lpYEeF3KvAxB4uIpTKD9IrCeYs="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:59ba609d-f311-4c72-b602-de1a961d5fb6"}},"directories":{},"maintainers":[{"name":"ant-alpacolypse","email":"anuj@anterior.com"},{"name":"vitali_avagyan","email":"vitali.avagyan@anterior.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/srg-compiler_0.6.1_1782937369562_0.1536386900308535"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-12T06:35:29.434Z","modified":"2026-07-01T20:22:49.833Z","0.5.0":"2026-05-05T22:47:22.208Z","0.5.1":"2026-05-12T06:35:29.703Z","0.6.0":"2026-07-01T16:57:32.858Z","0.6.1":"2026-07-01T20:22:49.709Z"},"bugs":{"url":"https://github.com/anteriorai/symbolic-reasoning/issues"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/anteriorai/symbolic-reasoning#readme","keywords":["srg","compiler","symbolic-reasoning"],"repository":{"type":"git","url":"git+https://github.com/anteriorai/symbolic-reasoning.git","directory":"packages/srg-compiler"},"description":"SRG v2 compiler - compiles .srg files to executable JSON","maintainers":[{"name":"ant-alpacolypse","email":"anuj@anterior.com"},{"name":"vitali_avagyan","email":"vitali.avagyan@anterior.com"}],"readme":"# @anteriorai/srg-compiler\n\nCompiles `.srg` files to executable JSON format compatible with the Python `symbolic_reasoning` runtime.\n\n> **Public preview.** This package is an early public release of Anterior's symbolic reasoning tooling.\n> It is being published to support transparency, research discussion, and early experimentation while the broader open-source repository is prepared for release.\n>\n> Future releases may be made available under updated licensing terms. Until then, use of this package is governed by the license included with this release.\n>\n> This release should not be treated as a supported product, a stable API, or a complete reference implementation.\n> It is provided \"as is,\" without warranties of any kind. Users are responsible for evaluating correctness, security, compliance, and suitability for their own use case.\n\n## Installation\n\n```bash\nnpm install @anteriorai/srg-compiler\n```\n\n## Usage\n\n### Programmatic API\n\n```typescript\nimport { compile, compileFile } from '@anteriorai/srg-compiler';\n\n// Compile from string\nconst source = `\npredicate is_adult: \"Is patient 18 or older?\"\noutcome approved: \"Approved\"\nis_adult => approved\n`;\n\nconst json = await compile(source);\n\n// Compile from file\nconst json2 = await compileFile('policy.srg');\n```\n\n### CLI\n\n```bash\n# Compile a .srg file\nnpx srg-compile policy.srg\n\n# Specify output file\nnpx srg-compile policy.srg --output result.json\n\n# Pretty print JSON\nnpx srg-compile policy.srg --pretty\n```\n\n## Output Format\n\nThe compiler outputs JSON that matches the JSON schema `SRG` model exactly:\n\n```json\n{\n  \"edges\": {...},\n  \"nodes\": {...},\n  \"predicates\": {...},\n  \"aggregators\": {...},\n  \"outcomes\": {...},\n  \"policy_context\": null\n}\n```\n\nThis JSON can be directly loaded by Python:\n\n```python\nfrom symbolic_reasoning.models import SRG\n\nsrg = SRG.model_validate_json(json_string)\n```\n\n## Development\n\n### Building from Source\n\n```bash\n# Install dependencies\nnpm install\n\n# Build the compiler\nnpm run build\n```\n\nThe build process compiles TypeScript to `dist/`.\n\n### Dependencies\n\nThis package depends on:\n- **`@anteriorai/srg-parser`**: Parses `.srg` files to AST. Handles all syntax parsing and tree-sitter integration.\n- **`@anteriorai/srg-types`**: Provides TypeScript types for the SRG JSON schema. The compiler imports these types directly (e.g., `import type * as SRG from '@anteriorai/srg-types'`)","readmeFilename":"README.md"}