@paths.design/caws-cli 10.2.0 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +125 -374
- package/dist/index.js +45 -787
- package/dist/init/harness-detect.d.ts +18 -0
- package/dist/init/harness-detect.d.ts.map +1 -0
- package/dist/init/harness-detect.js +90 -0
- package/dist/init/harness-detect.js.map +1 -0
- package/dist/init/hook-install.d.ts +53 -0
- package/dist/init/hook-install.d.ts.map +1 -0
- package/dist/init/hook-install.js +421 -0
- package/dist/init/hook-install.js.map +1 -0
- package/dist/init/hook-packs/manifest-claude-code.d.ts +4 -0
- package/dist/init/hook-packs/manifest-claude-code.d.ts.map +1 -0
- package/dist/init/hook-packs/manifest-claude-code.js +190 -0
- package/dist/init/hook-packs/manifest-claude-code.js.map +1 -0
- package/dist/init/hook-packs/register.d.ts +19 -0
- package/dist/init/hook-packs/register.d.ts.map +1 -0
- package/dist/init/hook-packs/register.js +37 -0
- package/dist/init/hook-packs/register.js.map +1 -0
- package/dist/init/hook-packs/types.d.ts +123 -0
- package/dist/init/hook-packs/types.d.ts.map +1 -0
- package/dist/init/hook-packs/types.js +29 -0
- package/dist/init/hook-packs/types.js.map +1 -0
- package/dist/shell/binding/resolve-binding.d.ts +4 -0
- package/dist/shell/binding/resolve-binding.d.ts.map +1 -0
- package/dist/shell/binding/resolve-binding.js +228 -0
- package/dist/shell/binding/resolve-binding.js.map +1 -0
- package/dist/shell/binding/types.d.ts +42 -0
- package/dist/shell/binding/types.d.ts.map +1 -0
- package/dist/shell/binding/types.js +21 -0
- package/dist/shell/binding/types.js.map +1 -0
- package/dist/shell/commands/claim.d.ts +14 -0
- package/dist/shell/commands/claim.d.ts.map +1 -0
- package/dist/shell/commands/claim.js +197 -0
- package/dist/shell/commands/claim.js.map +1 -0
- package/dist/shell/commands/doctor.d.ts +13 -0
- package/dist/shell/commands/doctor.d.ts.map +1 -0
- package/dist/shell/commands/doctor.js +97 -0
- package/dist/shell/commands/doctor.js.map +1 -0
- package/dist/shell/commands/evidence.d.ts +28 -0
- package/dist/shell/commands/evidence.d.ts.map +1 -0
- package/dist/shell/commands/evidence.js +166 -0
- package/dist/shell/commands/evidence.js.map +1 -0
- package/dist/shell/commands/gates.d.ts +19 -0
- package/dist/shell/commands/gates.d.ts.map +1 -0
- package/dist/shell/commands/gates.js +208 -0
- package/dist/shell/commands/gates.js.map +1 -0
- package/dist/shell/commands/init.d.ts +17 -0
- package/dist/shell/commands/init.d.ts.map +1 -0
- package/dist/shell/commands/init.js +168 -0
- package/dist/shell/commands/init.js.map +1 -0
- package/dist/shell/commands/scope.d.ts +11 -0
- package/dist/shell/commands/scope.d.ts.map +1 -0
- package/dist/shell/commands/scope.js +92 -0
- package/dist/shell/commands/scope.js.map +1 -0
- package/dist/shell/commands/specs.d.ts +41 -0
- package/dist/shell/commands/specs.d.ts.map +1 -0
- package/dist/shell/commands/specs.js +264 -0
- package/dist/shell/commands/specs.js.map +1 -0
- package/dist/shell/commands/status.d.ts +15 -0
- package/dist/shell/commands/status.d.ts.map +1 -0
- package/dist/shell/commands/status.js +106 -0
- package/dist/shell/commands/status.js.map +1 -0
- package/dist/shell/commands/waiver.d.ts +38 -0
- package/dist/shell/commands/waiver.d.ts.map +1 -0
- package/dist/shell/commands/waiver.js +240 -0
- package/dist/shell/commands/waiver.js.map +1 -0
- package/dist/shell/commands/worktree.d.ts +38 -0
- package/dist/shell/commands/worktree.d.ts.map +1 -0
- package/dist/shell/commands/worktree.js +286 -0
- package/dist/shell/commands/worktree.js.map +1 -0
- package/dist/shell/gates/disposition.d.ts +23 -0
- package/dist/shell/gates/disposition.d.ts.map +1 -0
- package/dist/shell/gates/disposition.js +117 -0
- package/dist/shell/gates/disposition.js.map +1 -0
- package/dist/shell/gates/gate-result-contract.d.ts +39 -0
- package/dist/shell/gates/gate-result-contract.d.ts.map +1 -0
- package/dist/shell/gates/gate-result-contract.js +150 -0
- package/dist/shell/gates/gate-result-contract.js.map +1 -0
- package/dist/shell/gates/local-evaluators/budget-limit.d.ts +24 -0
- package/dist/shell/gates/local-evaluators/budget-limit.d.ts.map +1 -0
- package/dist/shell/gates/local-evaluators/budget-limit.js +67 -0
- package/dist/shell/gates/local-evaluators/budget-limit.js.map +1 -0
- package/dist/shell/gates/local-evaluators/diff-helpers.d.ts +25 -0
- package/dist/shell/gates/local-evaluators/diff-helpers.d.ts.map +1 -0
- package/dist/shell/gates/local-evaluators/diff-helpers.js +74 -0
- package/dist/shell/gates/local-evaluators/diff-helpers.js.map +1 -0
- package/dist/shell/gates/local-evaluators/index.d.ts +28 -0
- package/dist/shell/gates/local-evaluators/index.d.ts.map +1 -0
- package/dist/shell/gates/local-evaluators/index.js +67 -0
- package/dist/shell/gates/local-evaluators/index.js.map +1 -0
- package/dist/shell/gates/local-evaluators/scope-boundary.d.ts +23 -0
- package/dist/shell/gates/local-evaluators/scope-boundary.d.ts.map +1 -0
- package/dist/shell/gates/local-evaluators/scope-boundary.js +67 -0
- package/dist/shell/gates/local-evaluators/scope-boundary.js.map +1 -0
- package/dist/shell/gates/local-evaluators/spec-completeness.d.ts +12 -0
- package/dist/shell/gates/local-evaluators/spec-completeness.d.ts.map +1 -0
- package/dist/shell/gates/local-evaluators/spec-completeness.js +73 -0
- package/dist/shell/gates/local-evaluators/spec-completeness.js.map +1 -0
- package/dist/shell/gates/quality-gates-adapter.d.ts +55 -0
- package/dist/shell/gates/quality-gates-adapter.d.ts.map +1 -0
- package/dist/shell/gates/quality-gates-adapter.js +161 -0
- package/dist/shell/gates/quality-gates-adapter.js.map +1 -0
- package/dist/shell/gates/waiver-filter.d.ts +58 -0
- package/dist/shell/gates/waiver-filter.d.ts.map +1 -0
- package/dist/shell/gates/waiver-filter.js +119 -0
- package/dist/shell/gates/waiver-filter.js.map +1 -0
- package/dist/shell/index.d.ts +54 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.js +85 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/shell/register.d.ts +11 -0
- package/dist/shell/register.d.ts.map +1 -0
- package/dist/shell/register.js +464 -0
- package/dist/shell/register.js.map +1 -0
- package/dist/shell/render/claim.d.ts +22 -0
- package/dist/shell/render/claim.d.ts.map +1 -0
- package/dist/shell/render/claim.js +75 -0
- package/dist/shell/render/claim.js.map +1 -0
- package/dist/shell/render/decision.d.ts +15 -0
- package/dist/shell/render/decision.d.ts.map +1 -0
- package/dist/shell/render/decision.js +66 -0
- package/dist/shell/render/decision.js.map +1 -0
- package/dist/shell/render/diagnostic.d.ts +19 -0
- package/dist/shell/render/diagnostic.d.ts.map +1 -0
- package/dist/shell/render/diagnostic.js +76 -0
- package/dist/shell/render/diagnostic.js.map +1 -0
- package/dist/shell/render/finding.d.ts +15 -0
- package/dist/shell/render/finding.d.ts.map +1 -0
- package/dist/shell/render/finding.js +57 -0
- package/dist/shell/render/finding.js.map +1 -0
- package/dist/shell/render/gates.d.ts +3 -0
- package/dist/shell/render/gates.d.ts.map +1 -0
- package/dist/shell/render/gates.js +56 -0
- package/dist/shell/render/gates.js.map +1 -0
- package/dist/shell/render/init-hook-pack.d.ts +16 -0
- package/dist/shell/render/init-hook-pack.d.ts.map +1 -0
- package/dist/shell/render/init-hook-pack.js +206 -0
- package/dist/shell/render/init-hook-pack.js.map +1 -0
- package/dist/shell/render/init.d.ts +11 -0
- package/dist/shell/render/init.d.ts.map +1 -0
- package/dist/shell/render/init.js +32 -0
- package/dist/shell/render/init.js.map +1 -0
- package/dist/shell/render/status.d.ts +26 -0
- package/dist/shell/render/status.d.ts.map +1 -0
- package/dist/shell/render/status.js +143 -0
- package/dist/shell/render/status.js.map +1 -0
- package/dist/shell/render/waiver.d.ts +21 -0
- package/dist/shell/render/waiver.d.ts.map +1 -0
- package/dist/shell/render/waiver.js +94 -0
- package/dist/shell/render/waiver.js.map +1 -0
- package/dist/shell/rules.d.ts +37 -0
- package/dist/shell/rules.d.ts.map +1 -0
- package/dist/shell/rules.js +51 -0
- package/dist/shell/rules.js.map +1 -0
- package/dist/shell/session/actor.d.ts +14 -0
- package/dist/shell/session/actor.d.ts.map +1 -0
- package/dist/shell/session/actor.js +34 -0
- package/dist/shell/session/actor.js.map +1 -0
- package/dist/shell/session/resolve-session.d.ts +5 -0
- package/dist/shell/session/resolve-session.d.ts.map +1 -0
- package/dist/shell/session/resolve-session.js +239 -0
- package/dist/shell/session/resolve-session.js.map +1 -0
- package/dist/shell/session/types.d.ts +56 -0
- package/dist/shell/session/types.d.ts.map +1 -0
- package/dist/shell/session/types.js +15 -0
- package/dist/shell/session/types.js.map +1 -0
- package/dist/store/agents-store.d.ts +3 -0
- package/dist/store/agents-store.d.ts.map +1 -0
- package/dist/store/agents-store.js +63 -0
- package/dist/store/agents-store.js.map +1 -0
- package/dist/store/apply-patch.d.ts +16 -0
- package/dist/store/apply-patch.d.ts.map +1 -0
- package/dist/store/apply-patch.js +191 -0
- package/dist/store/apply-patch.js.map +1 -0
- package/dist/store/atomic-write.d.ts +34 -0
- package/dist/store/atomic-write.d.ts.map +1 -0
- package/dist/store/atomic-write.js +174 -0
- package/dist/store/atomic-write.js.map +1 -0
- package/dist/store/doctor-snapshot.d.ts +20 -0
- package/dist/store/doctor-snapshot.d.ts.map +1 -0
- package/dist/store/doctor-snapshot.js +176 -0
- package/dist/store/doctor-snapshot.js.map +1 -0
- package/dist/store/events-store.d.ts +33 -0
- package/dist/store/events-store.d.ts.map +1 -0
- package/dist/store/events-store.js +297 -0
- package/dist/store/events-store.js.map +1 -0
- package/dist/store/index.d.ts +21 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +47 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/init-store.d.ts +21 -0
- package/dist/store/init-store.d.ts.map +1 -0
- package/dist/store/init-store.js +295 -0
- package/dist/store/init-store.js.map +1 -0
- package/dist/store/json-store.d.ts +3 -0
- package/dist/store/json-store.d.ts.map +1 -0
- package/dist/store/json-store.js +65 -0
- package/dist/store/json-store.js.map +1 -0
- package/dist/store/lifecycle-lock.d.ts +34 -0
- package/dist/store/lifecycle-lock.d.ts.map +1 -0
- package/dist/store/lifecycle-lock.js +168 -0
- package/dist/store/lifecycle-lock.js.map +1 -0
- package/dist/store/lifecycle-transaction.d.ts +79 -0
- package/dist/store/lifecycle-transaction.d.ts.map +1 -0
- package/dist/store/lifecycle-transaction.js +319 -0
- package/dist/store/lifecycle-transaction.js.map +1 -0
- package/dist/store/policy-store.d.ts +3 -0
- package/dist/store/policy-store.d.ts.map +1 -0
- package/dist/store/policy-store.js +65 -0
- package/dist/store/policy-store.js.map +1 -0
- package/dist/store/repo-root.d.ts +46 -0
- package/dist/store/repo-root.d.ts.map +1 -0
- package/dist/store/repo-root.js +145 -0
- package/dist/store/repo-root.js.map +1 -0
- package/dist/store/rules.d.ts +69 -0
- package/dist/store/rules.d.ts.map +1 -0
- package/dist/store/rules.js +95 -0
- package/dist/store/rules.js.map +1 -0
- package/dist/store/specs-store.d.ts +3 -0
- package/dist/store/specs-store.d.ts.map +1 -0
- package/dist/store/specs-store.js +131 -0
- package/dist/store/specs-store.js.map +1 -0
- package/dist/store/specs-writer.d.ts +61 -0
- package/dist/store/specs-writer.d.ts.map +1 -0
- package/dist/store/specs-writer.js +506 -0
- package/dist/store/specs-writer.js.map +1 -0
- package/dist/store/types.d.ts +84 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +14 -0
- package/dist/store/types.js.map +1 -0
- package/dist/store/waivers-store.d.ts +25 -0
- package/dist/store/waivers-store.d.ts.map +1 -0
- package/dist/store/waivers-store.js +232 -0
- package/dist/store/waivers-store.js.map +1 -0
- package/dist/store/worktrees-store.d.ts +3 -0
- package/dist/store/worktrees-store.d.ts.map +1 -0
- package/dist/store/worktrees-store.js +62 -0
- package/dist/store/worktrees-store.js.map +1 -0
- package/dist/store/worktrees-writer.d.ts +77 -0
- package/dist/store/worktrees-writer.d.ts.map +1 -0
- package/dist/store/worktrees-writer.js +674 -0
- package/dist/store/worktrees-writer.js.map +1 -0
- package/dist/store/yaml-patch.d.ts +7 -0
- package/dist/store/yaml-patch.d.ts.map +1 -0
- package/dist/store/yaml-patch.js +250 -0
- package/dist/store/yaml-patch.js.map +1 -0
- package/dist/store/yaml-store.d.ts +9 -0
- package/dist/store/yaml-store.d.ts.map +1 -0
- package/dist/store/yaml-store.js +121 -0
- package/dist/store/yaml-store.js.map +1 -0
- package/package.json +15 -13
- package/dist/budget-derivation.js +0 -751
- package/dist/cicd-optimizer.js +0 -504
- package/dist/commands/agents.js +0 -124
- package/dist/commands/archive.js +0 -500
- package/dist/commands/burnup.js +0 -198
- package/dist/commands/diagnose.js +0 -525
- package/dist/commands/evaluate.js +0 -314
- package/dist/commands/gates.js +0 -149
- package/dist/commands/init.js +0 -857
- package/dist/commands/iterate.js +0 -417
- package/dist/commands/mode.js +0 -269
- package/dist/commands/parallel.js +0 -242
- package/dist/commands/plan.js +0 -438
- package/dist/commands/provenance.js +0 -1143
- package/dist/commands/quality-monitor.js +0 -284
- package/dist/commands/scope.js +0 -264
- package/dist/commands/session.js +0 -312
- package/dist/commands/sidecar.js +0 -74
- package/dist/commands/specs.js +0 -1656
- package/dist/commands/status.js +0 -1172
- package/dist/commands/templates.js +0 -237
- package/dist/commands/tool.js +0 -136
- package/dist/commands/tutorial.js +0 -480
- package/dist/commands/validate.js +0 -357
- package/dist/commands/verify-acs.js +0 -443
- package/dist/commands/waivers.js +0 -599
- package/dist/commands/workflow.js +0 -243
- package/dist/commands/worktree.js +0 -502
- package/dist/config/lite-scope.js +0 -158
- package/dist/config/modes.js +0 -347
- package/dist/constants/spec-types.js +0 -65
- package/dist/gates/budget-limit.js +0 -121
- package/dist/gates/feedback.js +0 -260
- package/dist/gates/format.js +0 -179
- package/dist/gates/god-object.js +0 -117
- package/dist/gates/pipeline.js +0 -167
- package/dist/gates/scope-boundary.js +0 -112
- package/dist/gates/spec-completeness.js +0 -109
- package/dist/gates/todo-detection.js +0 -205
- package/dist/generators/jest-config-generator.js +0 -242
- package/dist/generators/working-spec.js +0 -237
- package/dist/minimal-cli.js +0 -88
- package/dist/parallel/parallel-manager.js +0 -433
- package/dist/policy/PolicyManager.js +0 -470
- package/dist/scaffold/claude-hooks.js +0 -443
- package/dist/scaffold/cursor-hooks.js +0 -177
- package/dist/scaffold/git-hooks.js +0 -928
- package/dist/scaffold/index.js +0 -794
- package/dist/session/session-manager.js +0 -653
- package/dist/sidecars/index.js +0 -33
- package/dist/sidecars/listeners.js +0 -40
- package/dist/sidecars/provenance-summary.js +0 -238
- package/dist/sidecars/quality-gaps.js +0 -258
- package/dist/sidecars/schema.js +0 -149
- package/dist/sidecars/spec-drift.js +0 -151
- package/dist/sidecars/waiver-draft.js +0 -176
- package/dist/spec/SpecFileManager.js +0 -419
- package/dist/templates/.caws/schemas/policy.schema.json +0 -117
- package/dist/templates/.caws/schemas/scope.schema.json +0 -52
- package/dist/templates/.caws/schemas/waivers.schema.json +0 -106
- package/dist/templates/.caws/schemas/working-spec.schema.json +0 -340
- package/dist/templates/.caws/schemas/worktrees.schema.json +0 -38
- package/dist/templates/.caws/templates/working-spec.template.yml +0 -80
- package/dist/templates/.caws/tools/README.md +0 -18
- package/dist/templates/.caws/tools/scope-guard.js +0 -203
- package/dist/templates/.caws/tools-allow.json +0 -331
- package/dist/templates/.caws/waivers.yml +0 -19
- package/dist/templates/.claude/README.md +0 -190
- package/dist/templates/.claude/hooks/audit.sh +0 -121
- package/dist/templates/.claude/hooks/block-dangerous.sh +0 -203
- package/dist/templates/.claude/hooks/classify_command.py +0 -592
- package/dist/templates/.claude/hooks/doc-frontmatter-check.sh +0 -173
- package/dist/templates/.claude/hooks/lite-sprawl-check.sh +0 -145
- package/dist/templates/.claude/hooks/naming-check.sh +0 -100
- package/dist/templates/.claude/hooks/protected-paths.sh +0 -39
- package/dist/templates/.claude/hooks/quality-check.sh +0 -81
- package/dist/templates/.claude/hooks/scan-secrets.sh +0 -85
- package/dist/templates/.claude/hooks/scope-guard.sh +0 -381
- package/dist/templates/.claude/hooks/session-caws-status.sh +0 -117
- package/dist/templates/.claude/hooks/session-log.sh +0 -634
- package/dist/templates/.claude/hooks/simplification-guard.sh +0 -92
- package/dist/templates/.claude/hooks/stop-worktree-check.sh +0 -46
- package/dist/templates/.claude/hooks/test_classify_command.py +0 -370
- package/dist/templates/.claude/hooks/test_wrapper_smoke.sh +0 -96
- package/dist/templates/.claude/hooks/validate-spec.sh +0 -76
- package/dist/templates/.claude/hooks/worktree-guard.sh +0 -220
- package/dist/templates/.claude/hooks/worktree-write-guard.sh +0 -190
- package/dist/templates/.claude/rules/git-safety.md +0 -26
- package/dist/templates/.claude/rules/worktree-isolation.md +0 -101
- package/dist/templates/.claude/settings.json +0 -141
- package/dist/templates/.cursor/README.md +0 -299
- package/dist/templates/.cursor/hooks/audit.sh +0 -55
- package/dist/templates/.cursor/hooks/block-dangerous.sh +0 -84
- package/dist/templates/.cursor/hooks/caws-quality-check.sh +0 -52
- package/dist/templates/.cursor/hooks/caws-scope-guard.sh +0 -130
- package/dist/templates/.cursor/hooks/format.sh +0 -38
- package/dist/templates/.cursor/hooks/naming-check.sh +0 -64
- package/dist/templates/.cursor/hooks/scan-secrets.sh +0 -51
- package/dist/templates/.cursor/hooks/scope-guard.sh +0 -52
- package/dist/templates/.cursor/hooks/session-log.sh +0 -924
- package/dist/templates/.cursor/hooks/validate-spec.sh +0 -83
- package/dist/templates/.cursor/hooks.json +0 -76
- package/dist/templates/.cursor/rules/00-claims-verification.mdc +0 -144
- package/dist/templates/.cursor/rules/01-working-style.mdc +0 -50
- package/dist/templates/.cursor/rules/02-quality-gates.mdc +0 -368
- package/dist/templates/.cursor/rules/03-naming-and-refactor.mdc +0 -33
- package/dist/templates/.cursor/rules/04-logging-language-style.mdc +0 -23
- package/dist/templates/.cursor/rules/05-safe-defaults-guards.mdc +0 -23
- package/dist/templates/.cursor/rules/06-typescript-conventions.mdc +0 -36
- package/dist/templates/.cursor/rules/07-process-ops.mdc +0 -20
- package/dist/templates/.cursor/rules/08-solid-and-architecture.mdc +0 -16
- package/dist/templates/.cursor/rules/09-docstrings.mdc +0 -89
- package/dist/templates/.cursor/rules/10-documentation-quality-standards.mdc +0 -385
- package/dist/templates/.cursor/rules/11-scope-management-waivers.mdc +0 -381
- package/dist/templates/.cursor/rules/12-implementation-completeness.mdc +0 -516
- package/dist/templates/.cursor/rules/13-language-agnostic-standards.mdc +0 -578
- package/dist/templates/.cursor/rules/README.md +0 -148
- package/dist/templates/.github/copilot-instructions.md +0 -82
- package/dist/templates/.idea/runConfigurations/CAWS_Evaluate.xml +0 -5
- package/dist/templates/.idea/runConfigurations/CAWS_Validate.xml +0 -5
- package/dist/templates/.junie/guidelines.md +0 -73
- package/dist/templates/.vscode/launch.json +0 -17
- package/dist/templates/.vscode/settings.json +0 -95
- package/dist/templates/.windsurf/rules/caws-quality-standards.md +0 -54
- package/dist/templates/.windsurf/workflows/caws-guided-development.md +0 -92
- package/dist/templates/CLAUDE.md +0 -196
- package/dist/templates/COMMIT_CONVENTIONS.md +0 -86
- package/dist/templates/OIDC_SETUP.md +0 -300
- package/dist/templates/agents.md +0 -171
- package/dist/templates/codemod/README.md +0 -1
- package/dist/templates/codemod/test.js +0 -93
- package/dist/templates/docs/README.md +0 -151
- package/dist/templates/scripts/new_feature.sh +0 -80
- package/dist/templates/scripts/quality-gates/check-god-objects.js +0 -146
- package/dist/templates/scripts/quality-gates/run-quality-gates.js +0 -50
- package/dist/templates/scripts/v3/analysis/todo_analyzer.py +0 -1997
- package/dist/test-analysis.js +0 -786
- package/dist/tool-interface.js +0 -314
- package/dist/tool-loader.js +0 -303
- package/dist/tool-validator.js +0 -393
- package/dist/utils/agent-display.js +0 -210
- package/dist/utils/agent-session.js +0 -344
- package/dist/utils/async-utils.js +0 -188
- package/dist/utils/command-wrapper.js +0 -200
- package/dist/utils/event-log.js +0 -584
- package/dist/utils/event-renderer.js +0 -521
- package/dist/utils/finalization.js +0 -230
- package/dist/utils/git-lock.js +0 -119
- package/dist/utils/gitignore-updater.js +0 -158
- package/dist/utils/ide-detection.js +0 -133
- package/dist/utils/lifecycle-events.js +0 -94
- package/dist/utils/project-analysis.js +0 -367
- package/dist/utils/promise-utils.js +0 -72
- package/dist/utils/quality-gates-errors.js +0 -520
- package/dist/utils/quality-gates-utils.js +0 -387
- package/dist/utils/schema-validator.js +0 -50
- package/dist/utils/spec-resolver.js +0 -711
- package/dist/utils/typescript-detector.js +0 -369
- package/dist/utils/working-state.js +0 -530
- package/dist/utils/yaml-validation.js +0 -156
- package/dist/validation/spec-validation.js +0 -924
- package/dist/waivers-manager.js +0 -732
- package/dist/worktree/worktree-manager.js +0 -1735
- package/templates/.caws/schemas/policy.schema.json +0 -117
- package/templates/.caws/schemas/scope.schema.json +0 -52
- package/templates/.caws/schemas/waivers.schema.json +0 -106
- package/templates/.caws/schemas/working-spec.schema.json +0 -340
- package/templates/.caws/schemas/worktrees.schema.json +0 -38
- package/templates/.caws/templates/working-spec.template.yml +0 -80
- package/templates/.caws/tools/README.md +0 -18
- package/templates/.caws/tools/scope-guard.js +0 -203
- package/templates/.caws/tools-allow.json +0 -331
- package/templates/.caws/waivers.yml +0 -19
- package/templates/.claude/README.md +0 -190
- package/templates/.claude/hooks/audit.sh +0 -121
- package/templates/.claude/hooks/block-dangerous.sh +0 -203
- package/templates/.claude/hooks/classify_command.py +0 -592
- package/templates/.claude/hooks/doc-frontmatter-check.sh +0 -173
- package/templates/.claude/hooks/lite-sprawl-check.sh +0 -145
- package/templates/.claude/hooks/naming-check.sh +0 -100
- package/templates/.claude/hooks/protected-paths.sh +0 -39
- package/templates/.claude/hooks/quality-check.sh +0 -81
- package/templates/.claude/hooks/scan-secrets.sh +0 -85
- package/templates/.claude/hooks/scope-guard.sh +0 -381
- package/templates/.claude/hooks/session-caws-status.sh +0 -117
- package/templates/.claude/hooks/session-log.sh +0 -634
- package/templates/.claude/hooks/simplification-guard.sh +0 -92
- package/templates/.claude/hooks/stop-worktree-check.sh +0 -46
- package/templates/.claude/hooks/test_classify_command.py +0 -370
- package/templates/.claude/hooks/test_wrapper_smoke.sh +0 -96
- package/templates/.claude/hooks/validate-spec.sh +0 -76
- package/templates/.claude/hooks/worktree-guard.sh +0 -220
- package/templates/.claude/hooks/worktree-write-guard.sh +0 -190
- package/templates/.claude/rules/git-safety.md +0 -26
- package/templates/.claude/rules/worktree-isolation.md +0 -101
- package/templates/.claude/settings.json +0 -141
- package/templates/.cursor/README.md +0 -299
- package/templates/.cursor/hooks/audit.sh +0 -55
- package/templates/.cursor/hooks/block-dangerous.sh +0 -84
- package/templates/.cursor/hooks/caws-quality-check.sh +0 -52
- package/templates/.cursor/hooks/caws-scope-guard.sh +0 -130
- package/templates/.cursor/hooks/format.sh +0 -38
- package/templates/.cursor/hooks/naming-check.sh +0 -64
- package/templates/.cursor/hooks/scan-secrets.sh +0 -51
- package/templates/.cursor/hooks/scope-guard.sh +0 -52
- package/templates/.cursor/hooks/session-log.sh +0 -924
- package/templates/.cursor/hooks/validate-spec.sh +0 -83
- package/templates/.cursor/hooks.json +0 -76
- package/templates/.cursor/rules/00-claims-verification.mdc +0 -144
- package/templates/.cursor/rules/01-working-style.mdc +0 -50
- package/templates/.cursor/rules/02-quality-gates.mdc +0 -368
- package/templates/.cursor/rules/03-naming-and-refactor.mdc +0 -33
- package/templates/.cursor/rules/04-logging-language-style.mdc +0 -23
- package/templates/.cursor/rules/05-safe-defaults-guards.mdc +0 -23
- package/templates/.cursor/rules/06-typescript-conventions.mdc +0 -36
- package/templates/.cursor/rules/07-process-ops.mdc +0 -20
- package/templates/.cursor/rules/08-solid-and-architecture.mdc +0 -16
- package/templates/.cursor/rules/09-docstrings.mdc +0 -89
- package/templates/.cursor/rules/10-documentation-quality-standards.mdc +0 -385
- package/templates/.cursor/rules/11-scope-management-waivers.mdc +0 -381
- package/templates/.cursor/rules/12-implementation-completeness.mdc +0 -516
- package/templates/.cursor/rules/13-language-agnostic-standards.mdc +0 -578
- package/templates/.cursor/rules/README.md +0 -148
- package/templates/.github/copilot-instructions.md +0 -82
- package/templates/.idea/runConfigurations/CAWS_Evaluate.xml +0 -5
- package/templates/.idea/runConfigurations/CAWS_Validate.xml +0 -5
- package/templates/.junie/guidelines.md +0 -73
- package/templates/.vscode/launch.json +0 -17
- package/templates/.vscode/settings.json +0 -95
- package/templates/.windsurf/rules/caws-quality-standards.md +0 -54
- package/templates/.windsurf/workflows/caws-guided-development.md +0 -92
- package/templates/CLAUDE.md +0 -196
- package/templates/COMMIT_CONVENTIONS.md +0 -86
- package/templates/OIDC_SETUP.md +0 -300
- package/templates/agents.md +0 -171
- package/templates/codemod/README.md +0 -1
- package/templates/codemod/test.js +0 -93
- package/templates/docs/README.md +0 -151
- package/templates/scripts/new_feature.sh +0 -80
- package/templates/scripts/quality-gates/check-god-objects.js +0 -146
- package/templates/scripts/quality-gates/run-quality-gates.js +0 -50
- package/templates/scripts/v3/analysis/todo_analyzer.py +0 -1997
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Pure formatter for hook-pack install output and settings.json wiring
|
|
3
|
+
// guidance. Each step of `caws init` emits a labeled section so an
|
|
4
|
+
// agent reading the output turn-by-turn can pick up what happened and
|
|
5
|
+
// what to do next.
|
|
6
|
+
//
|
|
7
|
+
// This renderer never decides outcomes; install/inspect decide.
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.renderHookPackInstall = renderHookPackInstall;
|
|
10
|
+
exports.renderSettingsWiring = renderSettingsWiring;
|
|
11
|
+
exports.renderActivationContract = renderActivationContract;
|
|
12
|
+
const hook_install_1 = require("../../init/hook-install");
|
|
13
|
+
function repeatChar(ch, n) {
|
|
14
|
+
return ch.repeat(Math.max(0, n));
|
|
15
|
+
}
|
|
16
|
+
function section(title) {
|
|
17
|
+
const bar = repeatChar('─', 64);
|
|
18
|
+
return `\n┌${bar}\n│ ${title}\n└${bar}`;
|
|
19
|
+
}
|
|
20
|
+
/** Render the install result. */
|
|
21
|
+
function renderHookPackInstall(result) {
|
|
22
|
+
const lines = [];
|
|
23
|
+
if (!result.pack) {
|
|
24
|
+
if (result.outcome === 'skipped_explicit_none') {
|
|
25
|
+
lines.push(section('Step: hook-pack install'));
|
|
26
|
+
lines.push(' Skipped — --agent-surface none.');
|
|
27
|
+
lines.push(' No pre-tool-call governance was installed.');
|
|
28
|
+
lines.push(' This repo is NOT agent-safe for multi-session work without external governance.');
|
|
29
|
+
lines.push(' If you intended to enable a hook pack, rerun with --agent-surface claude-code.');
|
|
30
|
+
return lines.join('\n');
|
|
31
|
+
}
|
|
32
|
+
if (result.outcome === 'skipped_ambiguous') {
|
|
33
|
+
lines.push(section('Step: hook-pack install'));
|
|
34
|
+
lines.push(' Skipped — no harness detected and no --agent-surface flag passed.');
|
|
35
|
+
lines.push(' No pre-tool-call governance was installed.');
|
|
36
|
+
lines.push(' To enable a hook pack now, rerun with one of:');
|
|
37
|
+
lines.push(' caws init --agent-surface claude-code');
|
|
38
|
+
lines.push(' caws init --agent-surface none # explicit opt-out');
|
|
39
|
+
return lines.join('\n');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const pack = result.pack;
|
|
43
|
+
lines.push(section(`Step: hook-pack install (${pack.id} v${pack.packVersion})`));
|
|
44
|
+
lines.push(` ${pack.summary}`);
|
|
45
|
+
lines.push('');
|
|
46
|
+
// Per-file action lines.
|
|
47
|
+
const created = [];
|
|
48
|
+
const updated = [];
|
|
49
|
+
const unchanged = [];
|
|
50
|
+
const refused = [];
|
|
51
|
+
for (const a of result.actions) {
|
|
52
|
+
switch (a.action) {
|
|
53
|
+
case 'created':
|
|
54
|
+
created.push(a.destPath);
|
|
55
|
+
break;
|
|
56
|
+
case 'updated':
|
|
57
|
+
updated.push(a.destPath);
|
|
58
|
+
break;
|
|
59
|
+
case 'unchanged':
|
|
60
|
+
unchanged.push(a.destPath);
|
|
61
|
+
break;
|
|
62
|
+
case 'refused':
|
|
63
|
+
refused.push(`${a.destPath} [refused: ${a.refusalReason ?? 'unknown'}]`);
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (created.length > 0) {
|
|
68
|
+
lines.push(` Created (${created.length}):`);
|
|
69
|
+
for (const p of created)
|
|
70
|
+
lines.push(` + ${p}`);
|
|
71
|
+
}
|
|
72
|
+
if (updated.length > 0) {
|
|
73
|
+
lines.push(` Updated (${updated.length}):`);
|
|
74
|
+
for (const p of updated)
|
|
75
|
+
lines.push(` ↑ ${p}`);
|
|
76
|
+
}
|
|
77
|
+
if (unchanged.length > 0) {
|
|
78
|
+
lines.push(` Unchanged (${unchanged.length}):`);
|
|
79
|
+
for (const p of unchanged)
|
|
80
|
+
lines.push(` = ${p}`);
|
|
81
|
+
}
|
|
82
|
+
if (refused.length > 0) {
|
|
83
|
+
lines.push(` Refused (${refused.length}):`);
|
|
84
|
+
for (const p of refused)
|
|
85
|
+
lines.push(` ! ${p}`);
|
|
86
|
+
lines.push('');
|
|
87
|
+
lines.push(' One or more files were refused. To resolve, choose one of:');
|
|
88
|
+
lines.push(' --overwrite Replace the file with the canonical pack version.');
|
|
89
|
+
lines.push(' CAUTION: local edits to that file will be lost.');
|
|
90
|
+
lines.push(' --adopt Leave the file in place; do not enforce that it');
|
|
91
|
+
lines.push(' matches the pack. CAUTION: pack drift is no longer');
|
|
92
|
+
lines.push(' tracked for this file until the marker is restored.');
|
|
93
|
+
lines.push(' Alternative: rename or remove the conflicting file, then re-run init.');
|
|
94
|
+
}
|
|
95
|
+
return lines.join('\n');
|
|
96
|
+
}
|
|
97
|
+
/** Render the settings.json wiring inspection result. */
|
|
98
|
+
function renderSettingsWiring(status) {
|
|
99
|
+
const lines = [];
|
|
100
|
+
lines.push(section('Step: .claude/settings.json wiring'));
|
|
101
|
+
if (status.kind === 'wired') {
|
|
102
|
+
lines.push(' OK — .claude/settings.json already wires all four CAWS dispatch entrypoints.');
|
|
103
|
+
lines.push(' No action needed.');
|
|
104
|
+
return lines.join('\n');
|
|
105
|
+
}
|
|
106
|
+
if (status.kind === 'invalid') {
|
|
107
|
+
lines.push(` ERROR — .claude/settings.json exists but could not be parsed: ${status.error}`);
|
|
108
|
+
lines.push(' Repair the JSON syntax, then re-run `caws doctor` to verify.');
|
|
109
|
+
lines.push(' The CAWS init does NOT modify settings.json; you must fix this by hand.');
|
|
110
|
+
return lines.join('\n');
|
|
111
|
+
}
|
|
112
|
+
if (status.kind === 'absent') {
|
|
113
|
+
lines.push(' No .claude/settings.json present. Hooks are installed but will');
|
|
114
|
+
lines.push(' NOT fire until Claude Code reads a settings.json that wires them.');
|
|
115
|
+
lines.push('');
|
|
116
|
+
lines.push(' init does not write this file directly because merging with your');
|
|
117
|
+
lines.push(' existing permissions, env, and hook entries is your responsibility.');
|
|
118
|
+
lines.push('');
|
|
119
|
+
lines.push(' Create .claude/settings.json with the following content:');
|
|
120
|
+
lines.push('');
|
|
121
|
+
for (const line of hook_install_1.CANONICAL_SETTINGS_SNIPPET.split('\n')) {
|
|
122
|
+
lines.push(` ${line}`);
|
|
123
|
+
}
|
|
124
|
+
return lines.join('\n');
|
|
125
|
+
}
|
|
126
|
+
// partial
|
|
127
|
+
lines.push(' .claude/settings.json exists but is missing one or more canonical');
|
|
128
|
+
lines.push(' CAWS hook entries. Hooks may not fire as expected.');
|
|
129
|
+
lines.push('');
|
|
130
|
+
lines.push(` Missing entries (${status.missing.length}): ${status.missing.join(', ')}`);
|
|
131
|
+
lines.push('');
|
|
132
|
+
lines.push(' Add the following blocks to the `hooks` object in your settings.json:');
|
|
133
|
+
lines.push('');
|
|
134
|
+
for (const line of hook_install_1.CANONICAL_SETTINGS_SNIPPET.split('\n')) {
|
|
135
|
+
lines.push(` ${line}`);
|
|
136
|
+
}
|
|
137
|
+
lines.push('');
|
|
138
|
+
lines.push(' CAWS init does NOT modify settings.json automatically — it');
|
|
139
|
+
lines.push(' commonly carries user-authored `permissions` and `env` blocks that');
|
|
140
|
+
lines.push(' the pack should not overwrite. Merge the snippet by hand.');
|
|
141
|
+
return lines.join('\n');
|
|
142
|
+
}
|
|
143
|
+
/** Render the activation contract. Drives what the agent should do
|
|
144
|
+
* immediately after init. The message tailors to three signals:
|
|
145
|
+
* - did this run actually install or update files? (changed vs no-op)
|
|
146
|
+
* - is settings.json wired? (only known when caller passes wiringStatus)
|
|
147
|
+
* - what is the harness's activation model? (from pack)
|
|
148
|
+
*
|
|
149
|
+
* Without these signals the panel becomes a constant STOP sign on every
|
|
150
|
+
* re-run, which trains agents to ignore it. */
|
|
151
|
+
function renderActivationContract(result, wiringStatus) {
|
|
152
|
+
const lines = [];
|
|
153
|
+
lines.push(section('Step: activation'));
|
|
154
|
+
if (!result.pack || result.outcome === 'skipped_explicit_none') {
|
|
155
|
+
lines.push(' No hook pack was installed. Pre-tool-call governance is NOT in effect.');
|
|
156
|
+
return lines.join('\n');
|
|
157
|
+
}
|
|
158
|
+
if (result.outcome === 'skipped_ambiguous') {
|
|
159
|
+
lines.push(' No hook pack was selected. Pre-tool-call governance is NOT in effect.');
|
|
160
|
+
return lines.join('\n');
|
|
161
|
+
}
|
|
162
|
+
const changed = result.outcome === 'installed' || result.outcome === 'updated';
|
|
163
|
+
const wired = wiringStatus?.kind === 'wired';
|
|
164
|
+
switch (result.activation) {
|
|
165
|
+
case 'immediate':
|
|
166
|
+
lines.push(' Hooks are active in the current session. No restart required.');
|
|
167
|
+
break;
|
|
168
|
+
case 'restart_required':
|
|
169
|
+
if (!changed && wired) {
|
|
170
|
+
// No-op re-run on a fully-wired install. Positive confirmation.
|
|
171
|
+
lines.push(' Hooks are installed and wired. They are active in any Claude Code');
|
|
172
|
+
lines.push(' session started AFTER the install. If you are running in a session');
|
|
173
|
+
lines.push(' that pre-dates the install, restart the session to load them.');
|
|
174
|
+
}
|
|
175
|
+
else if (changed && wired) {
|
|
176
|
+
// Files updated; wiring is already in place but the new versions
|
|
177
|
+
// need a session restart to load.
|
|
178
|
+
lines.push(' Hook files were installed or updated. Settings.json is wired.');
|
|
179
|
+
lines.push(' Restart the Claude Code session so the updated hooks load.');
|
|
180
|
+
}
|
|
181
|
+
else if (changed && !wired) {
|
|
182
|
+
// The original STOP-sign case. Files just landed AND wiring is
|
|
183
|
+
// missing or partial. Agent must not continue.
|
|
184
|
+
lines.push(' RESTART REQUIRED: Claude Code reads .claude/settings.json at session');
|
|
185
|
+
lines.push(' start. The hooks you just installed are NOT enforcing in this session.');
|
|
186
|
+
lines.push('');
|
|
187
|
+
lines.push(' STOP. Do not continue substantive work. Wire .claude/settings.json');
|
|
188
|
+
lines.push(' (see the previous panel) and ask the user to restart or reopen');
|
|
189
|
+
lines.push(' the Claude Code session so the hooks become active.');
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
// Idempotent re-run with wiring still missing or invalid.
|
|
193
|
+
lines.push(' Hook files are installed but settings.json wiring is not complete.');
|
|
194
|
+
lines.push(' Hooks will not fire until the wiring is finished (see the previous');
|
|
195
|
+
lines.push(' panel) and the Claude Code session is restarted.');
|
|
196
|
+
}
|
|
197
|
+
break;
|
|
198
|
+
case 'unknown':
|
|
199
|
+
case 'not_applicable':
|
|
200
|
+
lines.push(' Activation semantics for this harness are not known. Consult the');
|
|
201
|
+
lines.push(' harness documentation for whether hooks take effect mid-session.');
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
return lines.join('\n');
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=init-hook-pack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-hook-pack.js","sourceRoot":"","sources":["../../../src/shell/render/init-hook-pack.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,mEAAmE;AACnE,sEAAsE;AACtE,mBAAmB;AACnB,EAAE;AACF,gEAAgE;;AAkBhE,sDAoGC;AAGD,oDA4EC;AAUD,4DA4FC;AAzSD,0DAGiC;AAGjC,SAAS,UAAU,CAAC,EAAU,EAAE,CAAS;IACvC,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,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ACR,uDAAuD,CACxD,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,0DAA0D;gBAC1D,KAAK,CAAC,IAAI,CACR,sEAAsE,CACvE,CAAC;gBACF,KAAK,CAAC,IAAI,CACR,sEAAsE,CACvE,CAAC;gBACF,KAAK,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;YACnE,CAAC;YACD,MAAM;QACR,KAAK,SAAS,CAAC;QACf,KAAK,gBAAgB;YACnB,KAAK,CAAC,IAAI,CACR,oEAAoE,CACrE,CAAC;YACF,KAAK,CAAC,IAAI,CACR,oEAAoE,CACrE,CAAC;YACF,MAAM;IACV,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { InitProjectResult } from '../../store';
|
|
2
|
+
export interface RenderInitInput {
|
|
3
|
+
readonly result: InitProjectResult;
|
|
4
|
+
/**
|
|
5
|
+
* Optional repo root used to render created paths relative to the
|
|
6
|
+
* project. When omitted, absolute paths are rendered as-is.
|
|
7
|
+
*/
|
|
8
|
+
readonly repoRoot?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function renderInit(input: RenderInitInput): string;
|
|
11
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/shell/render/init.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AASD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAWzD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Pure formatter for the `caws init` outcome.
|
|
3
|
+
//
|
|
4
|
+
// Two render shapes:
|
|
5
|
+
// - "created" → list each created path
|
|
6
|
+
// - "already_initialized" → single status line
|
|
7
|
+
//
|
|
8
|
+
// Renderer never decides outcomes; the store does. Renderer never reads
|
|
9
|
+
// `process.cwd` or `Date.now`. All inputs come from the caller.
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.renderInit = renderInit;
|
|
12
|
+
function relativize(p, repoRoot) {
|
|
13
|
+
if (repoRoot === undefined)
|
|
14
|
+
return p;
|
|
15
|
+
if (!p.startsWith(repoRoot))
|
|
16
|
+
return p;
|
|
17
|
+
const rel = p.slice(repoRoot.length);
|
|
18
|
+
return rel.startsWith('/') ? rel.slice(1) : rel;
|
|
19
|
+
}
|
|
20
|
+
function renderInit(input) {
|
|
21
|
+
const lines = [];
|
|
22
|
+
if (input.result.outcome === 'already_initialized') {
|
|
23
|
+
lines.push('caws init: project already initialized; no changes.');
|
|
24
|
+
return lines.join('\n');
|
|
25
|
+
}
|
|
26
|
+
lines.push(`caws init: created ${input.result.created.length} path(s).`);
|
|
27
|
+
for (const p of input.result.created) {
|
|
28
|
+
lines.push(` + ${relativize(p, input.repoRoot)}`);
|
|
29
|
+
}
|
|
30
|
+
return lines.join('\n');
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/shell/render/init.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,EAAE;AACF,qBAAqB;AACrB,qDAAqD;AACrD,iDAAiD;AACjD,EAAE;AACF,wEAAwE;AACxE,gEAAgE;;AAoBhE,gCAWC;AAlBD,SAAS,UAAU,CAAC,CAAS,EAAE,QAAiB;IAC9C,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC;IACrC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,CAAC,CAAC;IACtC,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrC,OAAO,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAClD,CAAC;AAED,SAAgB,UAAU,CAAC,KAAsB;IAC/C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,KAAK,qBAAqB,EAAE,CAAC;QACnD,KAAK,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAC;QAClE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,sBAAsB,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,WAAW,CAAC,CAAC;IACzE,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACrC,KAAK,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AgentRegistry, DoctorFinding, Spec, WorktreeRegistry } from '@paths.design/caws-kernel';
|
|
2
|
+
import type { ResolvedBinding } from '../binding/types';
|
|
3
|
+
import type { ResolvedSession } from '../session/types';
|
|
4
|
+
export interface StatusRenderInput {
|
|
5
|
+
readonly repoRoot: string;
|
|
6
|
+
readonly cawsDir: string;
|
|
7
|
+
readonly policyLoaded: boolean;
|
|
8
|
+
readonly specs: readonly Spec[];
|
|
9
|
+
readonly worktrees: WorktreeRegistry;
|
|
10
|
+
readonly agents: AgentRegistry;
|
|
11
|
+
readonly eventCount: number;
|
|
12
|
+
/** When undefined, the dashboard renders "no event chain on disk". */
|
|
13
|
+
readonly eventChainOk?: boolean;
|
|
14
|
+
/** Result of resolveBinding(cwd, ...). */
|
|
15
|
+
readonly binding: ResolvedBinding;
|
|
16
|
+
/** Result of resolveSession({ allowMint: false }). */
|
|
17
|
+
readonly session: ResolvedSession | null;
|
|
18
|
+
readonly doctorFindings: readonly DoctorFinding[];
|
|
19
|
+
readonly now: Date;
|
|
20
|
+
/** Heartbeat-stale TTL in ms; display only. Default 24h. */
|
|
21
|
+
readonly staleTtlMs?: number;
|
|
22
|
+
/** Cap on rendered top findings. Default 5. */
|
|
23
|
+
readonly findingCap?: number;
|
|
24
|
+
}
|
|
25
|
+
export declare function renderStatus(input: StatusRenderInput): string;
|
|
26
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/shell/render/status.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EACV,aAAa,EAEb,aAAa,EACb,IAAI,EAEJ,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAOxD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,sEAAsE;IACtE,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAEhC,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAEzC,QAAQ,CAAC,cAAc,EAAE,SAAS,aAAa,EAAE,CAAC;IAClD,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAoCD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAmG7D"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Pure formatter for the vNext `caws status` dashboard.
|
|
3
|
+
//
|
|
4
|
+
// Read-only: the formatter inspects already-loaded state and renders a
|
|
5
|
+
// summary. It does NOT mint capsules, refresh heartbeats, write events,
|
|
6
|
+
// or mutate any registry.
|
|
7
|
+
//
|
|
8
|
+
// Composition order (sections):
|
|
9
|
+
//
|
|
10
|
+
// CAWS Status
|
|
11
|
+
//
|
|
12
|
+
// Project
|
|
13
|
+
// repo root / .caws / policy presence / specs by lifecycle /
|
|
14
|
+
// worktree count / event count
|
|
15
|
+
//
|
|
16
|
+
// Current context
|
|
17
|
+
// cwd relation: tracked / untracked / outside repo
|
|
18
|
+
// worktree name (if resolved) / bound spec id / binding state
|
|
19
|
+
// current session id (or "unresolved (read-only)")
|
|
20
|
+
//
|
|
21
|
+
// Claim (only when inside a tracked worktree)
|
|
22
|
+
// reuses renderClaimPanel — same authority discipline.
|
|
23
|
+
//
|
|
24
|
+
// Doctor
|
|
25
|
+
// error/warning/info counts; top findings, capped.
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.renderStatus = renderStatus;
|
|
28
|
+
const claim_1 = require("./claim");
|
|
29
|
+
const finding_1 = require("./finding");
|
|
30
|
+
const DEFAULT_FINDING_CAP = 5;
|
|
31
|
+
function countSpecsByLifecycle(specs) {
|
|
32
|
+
const counts = {};
|
|
33
|
+
for (const s of specs) {
|
|
34
|
+
counts[s.lifecycle_state] = (counts[s.lifecycle_state] ?? 0) + 1;
|
|
35
|
+
}
|
|
36
|
+
return counts;
|
|
37
|
+
}
|
|
38
|
+
function fmtSessionTag(identity) {
|
|
39
|
+
if (identity.platform !== undefined && identity.platform.length > 0) {
|
|
40
|
+
return `${identity.session_id}:${identity.platform}`;
|
|
41
|
+
}
|
|
42
|
+
return identity.session_id;
|
|
43
|
+
}
|
|
44
|
+
function describeCwdRelation(binding) {
|
|
45
|
+
if (binding.worktreeName !== undefined)
|
|
46
|
+
return 'inside tracked worktree';
|
|
47
|
+
if (binding.source === 'none')
|
|
48
|
+
return 'main checkout (no tracked worktree match)';
|
|
49
|
+
return 'unknown';
|
|
50
|
+
}
|
|
51
|
+
function describeBindingState(state) {
|
|
52
|
+
switch (state.kind) {
|
|
53
|
+
case 'bound':
|
|
54
|
+
return `bound → ${state.spec.id} (worktree '${state.worktreeName}')`;
|
|
55
|
+
case 'one_sided':
|
|
56
|
+
return 'one_sided (corrupt asymmetric binding — see doctor)';
|
|
57
|
+
case 'unbound':
|
|
58
|
+
return 'unbound';
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function renderStatus(input) {
|
|
62
|
+
const lines = [];
|
|
63
|
+
lines.push('CAWS Status');
|
|
64
|
+
lines.push('');
|
|
65
|
+
// -------- Project --------
|
|
66
|
+
lines.push('Project');
|
|
67
|
+
lines.push(` repo root: ${input.repoRoot}`);
|
|
68
|
+
lines.push(` .caws dir: ${input.cawsDir}`);
|
|
69
|
+
lines.push(` policy: ${input.policyLoaded ? 'loaded' : 'MISSING'}`);
|
|
70
|
+
const lifecycle = countSpecsByLifecycle(input.specs);
|
|
71
|
+
const lifecycleSummary = input.specs.length === 0
|
|
72
|
+
? '0 specs'
|
|
73
|
+
: Object.entries(lifecycle)
|
|
74
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
75
|
+
.map(([k, v]) => `${v} ${k}`)
|
|
76
|
+
.join(', ');
|
|
77
|
+
lines.push(` specs: ${lifecycleSummary}`);
|
|
78
|
+
const worktreeCount = Object.keys(input.worktrees).length;
|
|
79
|
+
lines.push(` worktrees: ${worktreeCount}`);
|
|
80
|
+
const eventLine = input.eventChainOk === undefined
|
|
81
|
+
? `${input.eventCount} events`
|
|
82
|
+
: input.eventChainOk
|
|
83
|
+
? `${input.eventCount} events (chain OK)`
|
|
84
|
+
: `${input.eventCount} events (CHAIN BROKEN — see doctor)`;
|
|
85
|
+
lines.push(` events: ${eventLine}`);
|
|
86
|
+
// -------- Current context --------
|
|
87
|
+
lines.push('');
|
|
88
|
+
lines.push('Current context');
|
|
89
|
+
lines.push(` cwd: ${describeCwdRelation(input.binding)}`);
|
|
90
|
+
if (input.binding.worktreeName !== undefined) {
|
|
91
|
+
lines.push(` worktree: ${input.binding.worktreeName}`);
|
|
92
|
+
}
|
|
93
|
+
lines.push(` binding: ${describeBindingState(input.binding.binding)}`);
|
|
94
|
+
if (input.session !== null) {
|
|
95
|
+
lines.push(` session: ${fmtSessionTag(input.session.identity)} (source: ${input.session.source})`);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
lines.push(' session: unresolved (read-only; no capsule minted)');
|
|
99
|
+
}
|
|
100
|
+
// -------- Claim (only when inside a tracked worktree) --------
|
|
101
|
+
if (input.binding.worktreeName !== undefined && input.session !== null) {
|
|
102
|
+
const wtName = input.binding.worktreeName;
|
|
103
|
+
const record = input.worktrees[wtName];
|
|
104
|
+
if (record !== undefined) {
|
|
105
|
+
lines.push('');
|
|
106
|
+
const agentRecord = record.owner !== undefined ? input.agents[record.owner.session_id] : undefined;
|
|
107
|
+
lines.push((0, claim_1.renderClaimPanel)({
|
|
108
|
+
worktreeName: wtName,
|
|
109
|
+
worktreeRecord: record,
|
|
110
|
+
...(agentRecord !== undefined ? { agentRecord } : {}),
|
|
111
|
+
currentSession: input.session.identity,
|
|
112
|
+
now: input.now,
|
|
113
|
+
...(input.staleTtlMs !== undefined ? { staleTtlMs: input.staleTtlMs } : {}),
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// -------- Doctor --------
|
|
118
|
+
lines.push('');
|
|
119
|
+
lines.push('Doctor');
|
|
120
|
+
const counts = (0, finding_1.countFindingSeverities)(input.doctorFindings);
|
|
121
|
+
lines.push(` Summary: ${counts.errors}E / ${counts.warnings}W / ${counts.infos}I`);
|
|
122
|
+
if (input.doctorFindings.length === 0) {
|
|
123
|
+
lines.push(' (no findings)');
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
const cap = input.findingCap ?? DEFAULT_FINDING_CAP;
|
|
127
|
+
// Sort by severity rank (error > warning > info) and take top `cap`.
|
|
128
|
+
const rank = {
|
|
129
|
+
error: 0,
|
|
130
|
+
warning: 1,
|
|
131
|
+
info: 2,
|
|
132
|
+
};
|
|
133
|
+
const top = [...input.doctorFindings]
|
|
134
|
+
.sort((a, b) => rank[a.severity] - rank[b.severity])
|
|
135
|
+
.slice(0, cap);
|
|
136
|
+
lines.push((0, finding_1.renderFindings)(top));
|
|
137
|
+
if (input.doctorFindings.length > cap) {
|
|
138
|
+
lines.push(` … ${input.doctorFindings.length - cap} more — run \`caws doctor\` for full list`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return lines.join('\n');
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/shell/render/status.ts"],"names":[],"mappings":";AAAA,wDAAwD;AACxD,EAAE;AACF,uEAAuE;AACvE,wEAAwE;AACxE,0BAA0B;AAC1B,EAAE;AACF,gCAAgC;AAChC,EAAE;AACF,gBAAg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,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAChC,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,IAAI,mBAAmB,CAAC;QACpD,qEAAqE;QACrE,MAAM,IAAI,GAA8C;YACtD,KAAK,EAAE,CAAC;YACR,OAAO,EAAE,CAAC;YACV,IAAI,EAAE,CAAC;SACR,CAAC;QACF,MAAM,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC;aAClC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;aACnD,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACjB,KAAK,CAAC,IAAI,CAAC,IAAA,wBAAc,EAAC,GAAG,CAAC,CAAC,CAAC;QAChC,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACtC,KAAK,CAAC,IAAI,CACR,OAAO,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,GAAG,2CAA2C,CACpF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Waiver, WaiverEffectiveness } from '@paths.design/caws-kernel';
|
|
2
|
+
export interface RenderWaiverSummaryInput {
|
|
3
|
+
readonly waiver: Waiver;
|
|
4
|
+
/** Pre-derived effectiveness from kernel.waiverEffectiveness. */
|
|
5
|
+
readonly effectiveness: WaiverEffectiveness;
|
|
6
|
+
}
|
|
7
|
+
export interface RenderWaiverDetailInput extends RenderWaiverSummaryInput {
|
|
8
|
+
/** Now, used to format expiry deltas. Caller owns the clock. */
|
|
9
|
+
readonly now: Date;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* One-line summary suited to `caws waiver list`. Includes the kernel-
|
|
13
|
+
* derived effectiveness label so the caller doesn't need to re-classify.
|
|
14
|
+
*/
|
|
15
|
+
export declare function renderWaiverSummary(input: RenderWaiverSummaryInput): string;
|
|
16
|
+
/**
|
|
17
|
+
* Multi-line detail block suited to `caws waiver show`. Includes
|
|
18
|
+
* everything `Waiver` carries plus a derived expiry delta.
|
|
19
|
+
*/
|
|
20
|
+
export declare function renderWaiverDetail(input: RenderWaiverDetailInput): string;
|
|
21
|
+
//# sourceMappingURL=waiver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waiver.d.ts","sourceRoot":"","sources":["../../../src/shell/render/waiver.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,MAAM,EACN,mBAAmB,EACpB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iEAAiE;IACjE,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;CAC7C;AAED,MAAM,WAAW,uBAAwB,SAAQ,wBAAwB;IACvE,gEAAgE;IAChE,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;CACpB;AAiCD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,MAAM,CAI3E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,MAAM,CAyBzE"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Pure formatter for waiver records.
|
|
3
|
+
//
|
|
4
|
+
// The renderer does NOT decide applicability. It receives a derived
|
|
5
|
+
// effectiveness label from the caller — `effectiveWaiversForGate`
|
|
6
|
+
// (kernel) and `waiverEffectiveness` (kernel) own that decision.
|
|
7
|
+
// Renderers stay pure so they're trivial to test and reuse from
|
|
8
|
+
// `list`, `show`, and any future doctor surface.
|
|
9
|
+
//
|
|
10
|
+
// Two output shapes:
|
|
11
|
+
//
|
|
12
|
+
// renderWaiverSummary(input) — single-line list row used by `list`.
|
|
13
|
+
// renderWaiverDetail(input) — multi-line detail block used by `show`.
|
|
14
|
+
//
|
|
15
|
+
// `now` is supplied by the caller, never read from the clock here. That
|
|
16
|
+
// keeps test output deterministic and matches the discipline that the
|
|
17
|
+
// rest of the shell follows.
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.renderWaiverSummary = renderWaiverSummary;
|
|
20
|
+
exports.renderWaiverDetail = renderWaiverDetail;
|
|
21
|
+
function effectivenessLabel(e) {
|
|
22
|
+
switch (e) {
|
|
23
|
+
case 'active':
|
|
24
|
+
return 'ACTIVE ';
|
|
25
|
+
case 'expired':
|
|
26
|
+
return 'EXPIRED ';
|
|
27
|
+
case 'revoked':
|
|
28
|
+
return 'REVOKED ';
|
|
29
|
+
case 'not_applicable':
|
|
30
|
+
return 'NOT_APPLICABLE ';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function fmtScope(w) {
|
|
34
|
+
if (w.scope?.spec_id !== undefined)
|
|
35
|
+
return `spec=${w.scope.spec_id}`;
|
|
36
|
+
return 'project-wide';
|
|
37
|
+
}
|
|
38
|
+
function fmtExpiryDelta(expiresAt, now) {
|
|
39
|
+
const expMs = Date.parse(expiresAt);
|
|
40
|
+
if (!Number.isFinite(expMs))
|
|
41
|
+
return '(unparseable expires_at)';
|
|
42
|
+
const deltaMs = expMs - now.getTime();
|
|
43
|
+
const absMs = Math.abs(deltaMs);
|
|
44
|
+
let unit;
|
|
45
|
+
if (absMs < 60_000)
|
|
46
|
+
unit = `${Math.round(absMs / 1000)}s`;
|
|
47
|
+
else if (absMs < 3_600_000)
|
|
48
|
+
unit = `${Math.round(absMs / 60_000)}m`;
|
|
49
|
+
else if (absMs < 86_400_000)
|
|
50
|
+
unit = `${Math.round(absMs / 3_600_000)}h`;
|
|
51
|
+
else
|
|
52
|
+
unit = `${Math.round(absMs / 86_400_000)}d`;
|
|
53
|
+
return deltaMs >= 0 ? `in ${unit}` : `${unit} ago`;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* One-line summary suited to `caws waiver list`. Includes the kernel-
|
|
57
|
+
* derived effectiveness label so the caller doesn't need to re-classify.
|
|
58
|
+
*/
|
|
59
|
+
function renderWaiverSummary(input) {
|
|
60
|
+
const w = input.waiver;
|
|
61
|
+
const gates = w.gates.join(',');
|
|
62
|
+
return `${effectivenessLabel(input.effectiveness)} ${w.id} [${gates}] (${fmtScope(w)}) ${w.title}`;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Multi-line detail block suited to `caws waiver show`. Includes
|
|
66
|
+
* everything `Waiver` carries plus a derived expiry delta.
|
|
67
|
+
*/
|
|
68
|
+
function renderWaiverDetail(input) {
|
|
69
|
+
const w = input.waiver;
|
|
70
|
+
const lines = [];
|
|
71
|
+
lines.push(`Waiver ${w.id}`);
|
|
72
|
+
lines.push(` Status (stored): ${w.status}`);
|
|
73
|
+
lines.push(` Effectiveness: ${input.effectiveness}`);
|
|
74
|
+
lines.push(` Title: ${w.title}`);
|
|
75
|
+
lines.push(` Gates: ${w.gates.join(', ')}`);
|
|
76
|
+
lines.push(` Scope: ${fmtScope(w)}`);
|
|
77
|
+
lines.push(` Reason: ${w.reason}`);
|
|
78
|
+
lines.push(` Approved by: ${w.approved_by}`);
|
|
79
|
+
lines.push(` Created at: ${w.created_at}`);
|
|
80
|
+
lines.push(` Expires at: ${w.expires_at} (${fmtExpiryDelta(w.expires_at, input.now)})`);
|
|
81
|
+
if (w.constraints?.max_uses !== undefined) {
|
|
82
|
+
lines.push(` Max uses: ${w.constraints.max_uses} (kernel does not enforce)`);
|
|
83
|
+
}
|
|
84
|
+
if (w.revocation !== undefined) {
|
|
85
|
+
lines.push(' Revocation:');
|
|
86
|
+
lines.push(` Revoked at: ${w.revocation.revoked_at}`);
|
|
87
|
+
if (w.revocation.revoked_by !== undefined)
|
|
88
|
+
lines.push(` Revoked by: ${w.revocation.revoked_by}`);
|
|
89
|
+
if (w.revocation.reason !== undefined)
|
|
90
|
+
lines.push(` Reason: ${w.revocation.reason}`);
|
|
91
|
+
}
|
|
92
|
+
return lines.join('\n');
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=waiver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waiver.js","sourceRoot":"","sources":["../../../src/shell/render/waiver.ts"],"names":[],"mappings":";AAAA,qCAAqC;AACrC,EAAE;AACF,oEAAoE;AACpE,kEAAkE;AAClE,iEAAiE;AACjE,gEAAgE;AAChE,iDAAiD;AACjD,EAAE;AACF,qBAAqB;AACrB,EAAE;AACF,uEAAuE;AACvE,0EAA0E;AAC1E,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,6BAA6B;;AAqD7B,kDAIC;AAMD,gDAyBC;AAtED,SAAS,kBAAkB,CAAC,CAAsB;IAChD,QAAQ,CAAC,EAAE,CAAC;QACV,KAAK,QAAQ;YACX,OAAO,iBAAiB,CAAC;QAC3B,KAAK,SAAS;YACZ,OAAO,iBAAiB,CAAC;QAC3B,KAAK,SAAS;YACZ,OAAO,iBAAiB,CAAC;QAC3B,KAAK,gBAAgB;YACnB,OAAO,iBAAiB,CAAC;IAC7B,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS;IACzB,IAAI,CAAC,CAAC,KAAK,EAAE,OAAO,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IACrE,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,SAAS,cAAc,CAAC,SAAiB,EAAE,GAAS;IAClD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,CA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AAI,CAAC,CAAC,UAAU,CAAC,UAAU,KAAK,SAAS;YACvC,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC;QAC/D,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,KAAK,SAAS;YACnC,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const SHELL_RULE_PREFIXES: {
|
|
2
|
+
readonly session: "shell.session";
|
|
3
|
+
readonly binding: "shell.binding";
|
|
4
|
+
readonly command: "shell.command";
|
|
5
|
+
readonly gates: "shell.gates";
|
|
6
|
+
readonly waiver: "shell.waiver";
|
|
7
|
+
};
|
|
8
|
+
export declare const SHELL_RULES: {
|
|
9
|
+
readonly SESSION_RESOLVED_FROM_CLAUDE_ENV: "shell.session.resolved_from_claude_env";
|
|
10
|
+
readonly SESSION_RESOLVED_FROM_CAPSULE: "shell.session.resolved_from_capsule";
|
|
11
|
+
readonly SESSION_RESOLVED_FROM_CURSOR_ENV: "shell.session.resolved_from_cursor_env";
|
|
12
|
+
readonly SESSION_NO_STABLE_IDENTITY: "shell.session.no_stable_identity";
|
|
13
|
+
readonly SESSION_CAPSULE_MINTED: "shell.session.capsule_minted";
|
|
14
|
+
readonly SESSION_CAPSULE_INVALID: "shell.session.capsule_invalid";
|
|
15
|
+
readonly SESSION_CAPSULE_WRITE_FAILED: "shell.session.capsule_write_failed";
|
|
16
|
+
readonly BINDING_CWD_OUTSIDE_REPO: "shell.binding.cwd_outside_repo";
|
|
17
|
+
readonly BINDING_WORKTREE_NOT_FOUND_IN_REGISTRY: "shell.binding.worktree_not_found_in_registry";
|
|
18
|
+
readonly BINDING_NO_SPEC_FOR_WORKTREE: "shell.binding.no_spec_for_worktree";
|
|
19
|
+
readonly BINDING_UNBOUND_CWD: "shell.binding.unbound_cwd";
|
|
20
|
+
readonly COMMAND_INVALID_PATH_ARGUMENT: "shell.command.invalid_path_argument";
|
|
21
|
+
readonly COMMAND_PRE_CHAINED_EVENT_REFUSED: "shell.command.pre_chained_event_refused";
|
|
22
|
+
readonly COMMAND_INVALID_EVIDENCE_TYPE: "shell.command.invalid_evidence_type";
|
|
23
|
+
readonly COMMAND_MISSING_SPEC_ID: "shell.command.missing_spec_id";
|
|
24
|
+
readonly GATES_SUBPROCESS_NOT_FOUND: "shell.gates.subprocess_not_found";
|
|
25
|
+
readonly GATES_SUBPROCESS_FAILED: "shell.gates.subprocess_failed";
|
|
26
|
+
readonly GATES_REPORT_NOT_JSON: "shell.gates.report_not_json";
|
|
27
|
+
readonly GATES_REPORT_INVALID_SHAPE: "shell.gates.report_invalid_shape";
|
|
28
|
+
readonly GATES_POLICY_REQUIRED: "shell.gates.policy_required";
|
|
29
|
+
readonly WAIVER_MISSING_ID: "shell.waiver.missing_id";
|
|
30
|
+
readonly WAIVER_NOT_FOUND: "shell.waiver.not_found";
|
|
31
|
+
readonly WAIVER_DUPLICATE: "shell.waiver.duplicate";
|
|
32
|
+
readonly WAIVER_INVALID_INPUT: "shell.waiver.invalid_input";
|
|
33
|
+
readonly WAIVER_ALREADY_REVOKED: "shell.waiver.already_revoked";
|
|
34
|
+
readonly WAIVER_WRITE_FAILED: "shell.waiver.write_failed";
|
|
35
|
+
};
|
|
36
|
+
export type ShellRule = (typeof SHELL_RULES)[keyof typeof SHELL_RULES];
|
|
37
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/shell/rules.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB;;;;;;CAMtB,CAAC;AAEX,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC"}
|