{"_id":"@agentsh/policy-editor","_rev":"2-c951d7c5d4161fc67c39f4c6ca7170d4","name":"@agentsh/policy-editor","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@agentsh/policy-editor","version":"0.1.0","keywords":["agentsh","policy","editor","yaml","security"],"license":"Apache-2.0","_id":"@agentsh/policy-editor@0.1.0","maintainers":[{"name":"canyonroad","email":"eran@canyonroad.ai"}],"homepage":"https://www.agentsh.org","bugs":{"url":"https://github.com/canyonroad/agentsh-policy-editor/issues"},"bin":{"agentsh-policy-editor":"dist/index.js"},"dist":{"shasum":"27fab7545037e1d680ad1ad0a9d050a64eefa58a","tarball":"https://registry.npmjs.org/@agentsh/policy-editor/-/policy-editor-0.1.0.tgz","fileCount":6,"integrity":"sha512-xEDAA41VgSNgft6pfrTla87JriZqf2Ng+prZq/E2uolm1yAZuPm8FueJmnOdtRUvTM2XfZqv9/jckGUBuHi5tQ==","signatures":[{"sig":"MEUCIHofAi+ohVoLAN+t8dhbahrv7RcfDIwnk8qgs+xTjZsKAiEA5BKR40PDo5f/vs6Xh4rj3tWSmveghWuK2UJ86I1zd0U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":96186},"main":"dist/index.js","type":"module","engines":{"node":">=18"},"gitHead":"9cf065f83bbaa4515aa7e0ef25fb1b59309aa878","scripts":{"dev":"tsx src/index.ts","test":"node --import tsx --test test/*.test.ts","build":"tsup && cp -r src/public dist/public","start":"node dist/index.js","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"canyonroad","email":"eran@canyonroad.ai"},"repository":{"url":"git+https://github.com/canyonroad/agentsh-policy-editor.git","type":"git"},"_npmVersion":"11.11.1","description":"Browser-based editor for agentsh policies","directories":{},"_nodeVersion":"25.8.1","dependencies":{"open":"^11.0.0","express":"^5.2.1","commander":"^14.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.5.1","typescript":"^6.0.2","@types/node":"^25.5.0","@types/express":"^5.0.6"},"_npmOperationalInternal":{"tmp":"tmp/policy-editor_0.1.0_1774308500321_0.18976695705221913","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@agentsh/policy-editor","version":"0.1.1","description":"Browser-based editor for agentsh policies","type":"module","main":"dist/index.js","bin":{"agentsh-policy-editor":"dist/index.js"},"scripts":{"dev":"tsx src/index.ts","build":"tsup && cp -r src/public dist/public","test":"node --import tsx --test test/*.test.ts","typecheck":"tsc --noEmit","start":"node dist/index.js","prepublishOnly":"npm run build"},"keywords":["agentsh","policy","editor","yaml","security"],"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/canyonroad/agentsh-policy-editor.git"},"homepage":"https://www.agentsh.org","engines":{"node":">=18"},"publishConfig":{"access":"public"},"dependencies":{"commander":"^14.0.3","express":"^5.2.1","open":"^11.0.0"},"devDependencies":{"@types/express":"^5.0.6","@types/node":"^25.5.0","tsup":"^8.5.1","tsx":"^4.21.0","typescript":"^6.0.2"},"gitHead":"aa83aad49cb07367eacd6ce5f6f33fb4eb79feca","_id":"@agentsh/policy-editor@0.1.1","bugs":{"url":"https://github.com/canyonroad/agentsh-policy-editor/issues"},"_nodeVersion":"22.22.1","_npmVersion":"11.12.0","dist":{"integrity":"sha512-mvUz9gmXq/igvzvK1+6BjIROw5H/SN0Uff+Jn9nBIhU4+NYSsWAZdkjHgC0yXymO5OaRqvF+IX3QoUj6BKLXqg==","shasum":"6e566b50ae417c55ea240240cb49498384d045b7","tarball":"https://registry.npmjs.org/@agentsh/policy-editor/-/policy-editor-0.1.1.tgz","fileCount":6,"unpackedSize":96274,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agentsh%2fpolicy-editor@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGPSThrvUwuQrjLaCixlWeeqys6lk9yAJZTQbNHn9GTRAiEAgcyr35BrLKWaLMje4KmsbkGqyBIADqsDONwN9YfXNTc="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:85a84a89-957f-40e1-9c8e-93b9d0565bc8"}},"directories":{},"maintainers":[{"name":"canyonroad","email":"eran@canyonroad.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/policy-editor_0.1.1_1774309397179_0.11877341103317662"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-23T23:28:20.234Z","modified":"2026-03-23T23:43:17.658Z","0.1.0":"2026-03-23T23:28:20.472Z","0.1.1":"2026-03-23T23:43:17.346Z"},"bugs":{"url":"https://github.com/canyonroad/agentsh-policy-editor/issues"},"license":"Apache-2.0","homepage":"https://www.agentsh.org","keywords":["agentsh","policy","editor","yaml","security"],"repository":{"type":"git","url":"git+https://github.com/canyonroad/agentsh-policy-editor.git"},"description":"Browser-based editor for agentsh policies","maintainers":[{"name":"canyonroad","email":"eran@canyonroad.ai"}],"readme":"# agentsh Policy Editor\n\nA browser-based editor for managing [agentsh](https://agentsh.org) policies. Edit YAML policies in a Monaco-powered editor, validate them against the agentsh schema, sign them with Ed25519 keys, and verify signatures — all from a local web UI.\n\n![agentsh Policy Editor](docs/images/screenshot.png)\n\n## Quick Start\n\n```bash\nnpx @agentsh/policy-editor\n```\n\nThis starts a local server and opens your browser. The editor will look for policies in the default OS location and the `agentsh` binary on your PATH.\n\n## Usage\n\n```\nagentsh-policy-editor [options]\n```\n\n### Options\n\n| Flag | Default | Description |\n|------|---------|-------------|\n| `--agentsh <path>` | `agentsh` on PATH | Path to the agentsh binary |\n| `--policies <dir>` | OS-dependent (see below) | Directory containing policy YAML files |\n| `--private-key <path>` | *(none)* | Path to `private.key.json` for signing |\n| `--trust-dir <dir>` | OS-dependent (see below) | Directory of public keys for verification |\n| `--port <number>` | `0` (random available port) | Server port |\n| `--no-open` | `false` | Don't auto-open the browser |\n\n### Default Paths\n\n| Platform | Policies | Trust Store |\n|----------|----------|-------------|\n| Linux | `~/.config/agentsh/policies` | `~/.config/agentsh/trust-store` |\n| macOS | `~/Library/Application Support/agentsh/policies` | `~/Library/Application Support/agentsh/trust-store` |\n| Windows | `%APPDATA%\\agentsh\\policies` | `%APPDATA%\\agentsh\\trust-store` |\n\n### Examples\n\n```bash\n# Use defaults\nagentsh-policy-editor\n\n# Point to a specific policies directory and binary\nagentsh-policy-editor --policies ./my-policies --agentsh /usr/local/bin/agentsh\n\n# Pre-load a private key for signing\nagentsh-policy-editor --private-key ~/keys/private.key.json\n\n# Run on a specific port without opening the browser\nagentsh-policy-editor --port 8080 --no-open\n```\n\n## Features\n\n### Edit Policies\nBrowse and edit YAML policy files with full syntax highlighting powered by the Monaco editor (the same editor that powers VS Code). Create new policies from a blank template or by copying an existing one.\n\n### Validate\nCheck that your policy is valid against the agentsh schema. Validation runs against the current editor content, so you can catch errors before saving. Saving also auto-validates and warns you if the policy is invalid.\n\n### Sign\nSign policies with an Ed25519 private key. The editor will prompt you to select a key file using a built-in filesystem browser and enter a signer name. Both are remembered for the session. Signing creates a `.sig` file alongside the policy.\n\nYou need to generate a keypair before you can sign. Use the agentsh CLI:\n\n```bash\n# Generate an Ed25519 keypair\nagentsh policy keygen --output ~/my-keys --label \"my-name\"\n```\n\nThis creates two files in `~/my-keys/`:\n- `private.key.json` — keep this secret (created with `0600` permissions)\n- `public.key.json` — share this with anyone who needs to verify your signatures\n\nWhen signing in the editor, point it to `private.key.json`. When verifying, the editor uses the directory containing the key files as the trust store.\n\n### Verify\nVerify policy signatures against the trust store (derived from the private key's directory). The sidebar shows signature status:\n\n- **●** — signature file exists, not yet verified\n- **✓** — signature verified\n- **✗** — invalid signature detected\n- **ⓘ** — click to view signature details (signer, date, key ID)\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Run in development mode\nnpm run dev -- --policies ./test-policies --agentsh /path/to/agentsh\n\n# Run tests\nnpm test\n\n# Build for distribution\nnpm run build\n\n# Run the built version\nnpm start -- --policies ./test-policies\n```\n\n## How It Works\n\nThe editor is a TypeScript CLI that starts a local Express server bound to `127.0.0.1`. The server provides a REST API for policy CRUD operations and shells out to the `agentsh` binary for validation, signing, and verification. The frontend is a single HTML page with Monaco editor loaded from CDN — no build step required.\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md"}