{"_id":"@bytesbrains/pi-ci-gate","_rev":"3-fb0b0162bd08066b4891a1034898ace7","name":"@bytesbrains/pi-ci-gate","dist-tags":{"latest":"1.1.3"},"versions":{"1.1.1":{"name":"@bytesbrains/pi-ci-gate","version":"1.1.1","keywords":["pi-package","pi-extension","ci","workflow","gitea-actions","observability"],"author":{"name":"nandal","email":"nandal@users.noreply.github.com"},"license":"MIT","_id":"@bytesbrains/pi-ci-gate@1.1.1","maintainers":[{"name":"nandal","email":"sandeep@nandal.in"}],"homepage":"https://github.com/nandal/pi-ext/tree/main/ci-gate","bugs":{"url":"https://github.com/nandal/pi-ext/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"d06cb151e3bbc27d967f9271ec6d6b50e161991b","tarball":"https://registry.npmjs.org/@bytesbrains/pi-ci-gate/-/pi-ci-gate-1.1.1.tgz","fileCount":9,"integrity":"sha512-bnfVHdMl23a0iXO8fNZa0SD/HsRsO5NSy32FDTCXQTk+gOEFeQHASjUJEdudS0A2BEKrnwQKC5lpslB7PfsHmw==","signatures":[{"sig":"MEYCIQDhQnFTTGFz/p95IkJv/MMl3XJOBPmbxbicgFFIfRdEHgIhAMUQTr4JsgforQ78cDJ5Z3V8lmtbK4xRk0QYgOyadPGn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43334},"main":"./src/index.ts","engines":{"node":">=18"},"gitHead":"1fca2cfdcbdf155b60d39efd9495773b47cb49a1","scripts":{"test":"vitest run","test:watch":"vitest"},"_npmUser":{"name":"nandal","email":"sandeep@nandal.in"},"repository":{"url":"git+https://github.com/nandal/pi-ext.git","type":"git","directory":"ci-gate"},"_npmVersion":"11.3.0","description":"CI observability gate for AI agents — view workflow runs, job statuses, and logs from Gitea Actions with safety controls.","directories":{},"_nodeVersion":"24.2.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.9"},"peerDependencies":{"typebox":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-ci-gate_1.1.1_1778871414267_0.32775083173743735","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"@bytesbrains/pi-ci-gate","version":"1.1.2","keywords":["pi-package","pi-extension","ci","workflow","gitea-actions","observability"],"author":{"name":"nandal","email":"nandal@users.noreply.github.com"},"license":"MIT","_id":"@bytesbrains/pi-ci-gate@1.1.2","maintainers":[{"name":"nandal","email":"sandeep@nandal.in"}],"homepage":"https://github.com/nandal/pi-ext/tree/main/ci-gate","bugs":{"url":"https://github.com/nandal/pi-ext/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"d2f7a4b7865d66a5990fc603c49fd0fbe74313e9","tarball":"https://registry.npmjs.org/@bytesbrains/pi-ci-gate/-/pi-ci-gate-1.1.2.tgz","fileCount":9,"integrity":"sha512-VkcHX3JqMVhVlvq2yNUgeofcAE7Sb3CYz9A9HZYCsvQrfqyyslzUpCgsNT3x8tWB6RgG5+AYgNhNVxvtY4/l5Q==","signatures":[{"sig":"MEQCIEX5VaCldW/9VtOdbzHP3XyEULAdnwgFxJXx+BHTq6qfAiA/VPsL6sPHoEfgPnQKwEepMtMiSUp0MmWYauvcbo+BZA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43795},"main":"./src/index.ts","engines":{"node":">=18"},"gitHead":"e4e2429e2adc1b2e9efcd229763481f5f1707c58","scripts":{"test":"vitest run","test:watch":"vitest"},"_npmUser":{"name":"nandal","email":"sandeep@nandal.in"},"repository":{"url":"git+https://github.com/nandal/pi-ext.git","type":"git","directory":"ci-gate"},"_npmVersion":"11.3.0","description":"CI observability gate for AI agents — view workflow runs, job statuses, and logs from Gitea Actions with safety controls.","directories":{},"_nodeVersion":"24.2.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.9"},"peerDependencies":{"typebox":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-ci-gate_1.1.2_1779068942698_0.8594599824949614","host":"s3://npm-registry-packages-npm-production"}},"1.1.3":{"name":"@bytesbrains/pi-ci-gate","version":"1.1.3","description":"CI observability gate for AI agents — view workflow runs, job statuses, and logs from Gitea Actions with safety controls.","keywords":["pi-package","pi-extension","ci","workflow","gitea-actions","observability"],"author":{"name":"BytesBrains Pte Ltd","url":"https://bytesbrains.com"},"repository":{"type":"git","url":"git+https://github.com/bytesbrains/pi-ci-gate.git"},"homepage":"https://github.com/bytesbrains/pi-ci-gate#readme","bugs":{"url":"https://github.com/bytesbrains/pi-ci-gate/issues"},"license":"MIT","main":"./src/index.ts","engines":{"node":">=18"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*","typebox":"*"},"pi":{"extensions":["./src/index.ts"]},"scripts":{"test":"vitest run","test:watch":"vitest"},"devDependencies":{"vitest":"^2.1.9"},"_id":"@bytesbrains/pi-ci-gate@1.1.3","gitHead":"a7564c3f42927111dc687a06307e1bd413bbe84b","_nodeVersion":"24.2.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-wvUtDoolz2ajsLdCh1PUtRQZZFoxpqv2W2Wi5rzgaCTbcYV4H1ATKUVApfuEOZg1YIusFE8UMAFNs0OVTNbXqg==","shasum":"9b2374cde0d367ffca2b69a5862d27c0212ab567","tarball":"https://registry.npmjs.org/@bytesbrains/pi-ci-gate/-/pi-ci-gate-1.1.3.tgz","fileCount":9,"unpackedSize":43981,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBEJ1uaYQeXyZoy2Q59NRmuAWHCguHm54dY0/WBTXioyAiEAoTH93useSOxVVbbo2N9kJAtmCLWiHPefPqAw/HCq8Rg="}]},"_npmUser":{"name":"nandal","email":"sandeep@nandal.in"},"directories":{},"maintainers":[{"name":"nandal","email":"sandeep@nandal.in"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-ci-gate_1.1.3_1783472786279_0.847496288324151"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-15T18:56:54.140Z","modified":"2026-07-08T01:06:26.572Z","1.1.1":"2026-05-15T18:56:54.418Z","1.1.2":"2026-05-18T01:49:02.863Z","1.1.3":"2026-07-08T01:06:26.416Z"},"bugs":{"url":"https://github.com/bytesbrains/pi-ci-gate/issues"},"author":{"name":"BytesBrains Pte Ltd","url":"https://bytesbrains.com"},"license":"MIT","homepage":"https://github.com/bytesbrains/pi-ci-gate#readme","keywords":["pi-package","pi-extension","ci","workflow","gitea-actions","observability"],"repository":{"type":"git","url":"git+https://github.com/bytesbrains/pi-ci-gate.git"},"description":"CI observability gate for AI agents — view workflow runs, job statuses, and logs from Gitea Actions with safety controls.","maintainers":[{"name":"nandal","email":"sandeep@nandal.in"}],"readme":"# CI Gate for Pi\n\n[![npm version](https://img.shields.io/npm/v/@bytesbrains/pi-ci-gate)](https://www.npmjs.com/package/@bytesbrains/pi-ci-gate)\n[![license](https://img.shields.io/npm/l/@bytesbrains/pi-ci-gate)](./LICENSE)\n\n> CI observability gate for AI agents — view workflow runs, job statuses, and logs from Gitea Actions with safety controls. **Agents self-diagnose CI failures instead of asking humans.**\n\n## Philosophy\n\n`pi-contrib-gate` handles the *contribution* side (branch → commit → PR).  \n`pi-review-gate` handles the *review* side (check → approve → merge).  \n`pi-project-gate` handles the *project* side (issue → plan → release).  \n`pi-ci-gate` handles the *CI* side (observe → diagnose → re-trigger).\n\n## Install\n\n```bash\npi install npm:@bytesbrains/pi-ci-gate\n```\n\n## Tools\n\n| Tool | Safety | What it does |\n|---|---|---|\n| `ci_list_workflows()` | ✅ Read-only | List registered workflows in the repo |\n| `ci_list_runs(workflow?, status?, branch?, limit?)` | ✅ Read-only | List workflow runs with filters |\n| `ci_get_run(run_index)` | ✅ Read-only | Get full run details (status, timing, trigger) |\n| `ci_list_jobs(run_index)` | ✅ Read-only | List jobs for a run with statuses |\n| `ci_get_logs(run_index, job_index?)` | ✅ Read-only | Get job logs (truncated to safe limits) |\n| `ci_rerun(run_index, confirm)` | ⚠️ Destructive | Re-run a failed/cancelled workflow |\n| `ci_cancel(run_index, confirm)` | ⚠️ Destructive | Cancel a running workflow |\n\n## Safety Harness\n\nThe destructive tools (`ci_rerun`, `ci_cancel`) have a triple safety gate:\n\n```\n🛡️ Gate 1: Feature flag\n   └─ .circ.yml: allowRerun: false / allowCancel: false → tool blocked entirely\n\n🛡️ Gate 2: Explicit confirmation\n   └─ Must pass confirm=true — prevents accidental triggers\n\n🛡️ Gate 3: Rate limiting\n   └─ 60s cooldown between destructive actions on the same run\n```\n\nLog output is also truncated: shows the head (setup) and tail (failures), keeping agents from drowning in logs while still surfacing what matters.\n\n## Configuration\n\nCreate `.circ.yml`:\n\n```yaml\n# Max log lines returned per job (head + tail split)\nmaxLogLines: 200\n\n# Enable/disable destructive tools\nallowRerun: true\nallowCancel: true\n\n# Default limit for listing runs\ndefaultLimit: 20\n```\n\n## Workflow\n\n```\nci_list_runs(status=\"failure\")   ← find failed runs\n  │\n  ▼\nci_get_run(42)                  ← inspect a specific run\n  │\n  ▼\nci_list_jobs(42)               ← see which jobs failed\n  │\n  ▼\nci_get_logs(42, job_index=1)   ← read the failure logs\n  │\n  ▼\n[fix the code]\n  │\n  ▼\nci_rerun(42, confirm=true)     ← re-trigger the workflow\n  │\n  ▼\nci_get_run(42)                 ← verify it passed ✅\n```\n\n## Integration\n\nInstall all four gates for full agent governance:\n\n```bash\npi install npm:@bytesbrains/pi-contrib-gate\npi install npm:@bytesbrains/pi-review-gate\npi install npm:@bytesbrains/pi-project-gate\npi install npm:@bytesbrains/pi-ci-gate\n```\n\n## License\n\nMIT © [nandal](https://github.com/nandal)\n\n---\n\nBuilt and maintained by [BytesBrains](https://bytesbrains.com) — AI automation & agents, engineered to production standards.\n*The model proposes, code guarantees.*\n","readmeFilename":"README.md"}