@bonesofspring/ai-rules 0.2.86 → 0.2.90
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/CHANGELOG.md +60 -0
- package/README.md +9 -1
- package/bin/lib/engine-scripts.js +11 -0
- package/bin/lib/seed-ai-local-team.js +79 -2
- package/bin/opencode-install.js +14 -12
- package/docs/OPENCODE-COMPATIBILITY.md +6 -4
- package/docs/OPENCODE.md +15 -8
- package/docs/PRESET-CONTRIBUTION.md +6 -6
- package/docs/TOKEN-ECONOMY.md +20 -0
- package/docs/openapi/team-db.v1.json +2 -2
- package/package.json +1 -1
- package/presets/_shared/ai-local/env.example +54 -0
- package/presets/_shared/ai-local/scripts/aggregate-agent-task-metrics.mjs +34 -5
- package/presets/_shared/ai-local/scripts/check-task-repositories.mjs +25 -22
- package/presets/_shared/ai-local/scripts/process-lease.mjs +3 -2
- package/presets/_shared/ai-local/scripts/processes.mjs +52 -20
- package/presets/_shared/ai-local/scripts/report-step-cost.mjs +544 -0
- package/presets/_shared/ai-local/scripts/run.mjs +38 -6
- package/presets/_shared/ai-local/scripts/settings.mjs +246 -0
- package/presets/_shared/ai-local/scripts/task-worktree.mjs +364 -0
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +2 -2
- package/presets/_shared/ai-local/scripts/team-db-project.mjs +87 -14
- package/presets/_shared/ai-local/scripts/team-db-schema.mjs +102 -12
- package/presets/_shared/ai-local/scripts/team-db-tracker.mjs +35 -0
- package/presets/_shared/ai-local/scripts/tracker-planned-drain.mjs +10 -1
- package/presets/_shared/ai-local/scripts/verification.mjs +106 -11
- package/presets/_shared/assets/model-tiers.json +6 -0
- package/presets/_shared/core/agent-team/agent-task-metrics.md +10 -2
- package/presets/_shared/core/agent-team/agent-team-intake.md +2 -0
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +5 -5
- package/presets/_shared/core/meta/preset-writing-style.md +8 -0
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +541 -61
- package/presets/_shared/hooks/guard-shell-command.mjs.tmpl +841 -97
- package/presets/_shared/hooks/prompt-autoroute.mjs.tmpl +153 -0
- package/presets/claude/android-kotlin/CLAUDE.md +2 -4
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/android-kotlin/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/android-kotlin/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/android-kotlin/settings.json +15 -5
- package/presets/claude/go/CLAUDE.md +2 -4
- package/presets/claude/go/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/go/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/go/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/go/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/go/settings.json +15 -5
- package/presets/claude/ios-swift/CLAUDE.md +2 -4
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/ios-swift/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/ios-swift/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/ios-swift/settings.json +15 -5
- package/presets/claude/java/CLAUDE.md +2 -4
- package/presets/claude/java/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/java/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/java/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/java/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/java/settings.json +15 -5
- package/presets/claude/mcp-ts/CLAUDE.md +2 -4
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/mcp-ts/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/mcp-ts/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/mcp-ts/settings.json +15 -5
- package/presets/claude/mol/CLAUDE.md +2 -4
- package/presets/claude/mol/agents/feature-developer.md +1 -1
- package/presets/claude/mol/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/claude/mol/commands/task-evil.md +8 -0
- package/presets/claude/mol/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/mol/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/mol/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/mol/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/mol/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/mol/settings.json +15 -4
- package/presets/claude/next/CLAUDE.md +2 -4
- package/presets/claude/next/REPO_AGENTS.md +2 -0
- package/presets/claude/next/agents/feature-developer.md +1 -1
- package/presets/claude/next/agents/task-analyst.md +1 -7
- package/presets/claude/next/agents/task-router.md +1 -1
- package/presets/claude/next/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/claude/next/commands/spec-start.md +3 -4
- package/presets/claude/next/commands/task-continue.md +9 -8
- package/presets/claude/next/commands/task-evil.md +8 -0
- package/presets/claude/next/commands/task.md +1 -1
- package/presets/claude/next/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/next/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/next/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/next/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/next/settings.json +15 -4
- package/presets/claude/next/team/README.md +1 -1
- package/presets/claude/nuxt/CLAUDE.md +2 -4
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/nuxt/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/nuxt/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/nuxt/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/nuxt/settings.json +15 -4
- package/presets/claude/php-hexagonal/CLAUDE.md +2 -4
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/php-hexagonal/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/php-hexagonal/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/php-hexagonal/settings.json +15 -5
- package/presets/claude/php-laravel/CLAUDE.md +2 -4
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/php-laravel/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/php-laravel/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/php-laravel/settings.json +15 -5
- package/presets/claude/svelte/CLAUDE.md +2 -4
- package/presets/claude/svelte/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/svelte/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/svelte/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/svelte/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/svelte/settings.json +15 -4
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/android-kotlin/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/android-kotlin/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/android-kotlin/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/go/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/go/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/go/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/go/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/ios-swift/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/ios-swift/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/java/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/java/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/java/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/java/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/mcp-ts/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/mcp-ts/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/mcp-ts/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/mol/agents/feature-developer.md +1 -1
- package/presets/cursor/mol/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/cursor/mol/commands/task-evil.md +8 -0
- package/presets/cursor/mol/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/mol/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/mol/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/mol/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/mol/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/next/REPO_AGENTS.md +2 -0
- package/presets/cursor/next/agents/feature-developer.md +1 -1
- package/presets/cursor/next/agents/task-analyst.md +1 -7
- package/presets/cursor/next/agents/task-router.md +1 -1
- package/presets/cursor/next/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/cursor/next/commands/spec-start.md +3 -4
- package/presets/cursor/next/commands/task-continue.md +9 -8
- package/presets/cursor/next/commands/task-evil.md +8 -0
- package/presets/cursor/next/commands/task.md +1 -1
- package/presets/cursor/next/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/next/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/next/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +5 -5
- package/presets/cursor/next/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/next/team/README.md +1 -1
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/nuxt/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/nuxt/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/nuxt/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/php-hexagonal/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/php-hexagonal/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/php-hexagonal/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/php-laravel/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/php-laravel/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/php-laravel/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/svelte/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/svelte/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/svelte/rules/preset-writing-style.mdc +8 -0
- package/presets/mavis/android-kotlin/MAVIS.md +1 -1
- package/presets/mavis/android-kotlin/adapter-map.json +1 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/android-kotlin/rules/agent-team-intake.md +2 -0
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/android-kotlin/rules/preset-writing-style.md +8 -0
- package/presets/mavis/go/MAVIS.md +1 -1
- package/presets/mavis/go/adapter-map.json +1 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/go/rules/agent-team-intake.md +2 -0
- package/presets/mavis/go/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/go/rules/preset-writing-style.md +8 -0
- package/presets/mavis/ios-swift/MAVIS.md +1 -1
- package/presets/mavis/ios-swift/adapter-map.json +1 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/ios-swift/rules/agent-team-intake.md +2 -0
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/ios-swift/rules/preset-writing-style.md +8 -0
- package/presets/mavis/java/MAVIS.md +1 -1
- package/presets/mavis/java/adapter-map.json +1 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/java/rules/agent-team-intake.md +2 -0
- package/presets/mavis/java/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/java/rules/preset-writing-style.md +8 -0
- package/presets/mavis/mcp-ts/MAVIS.md +1 -1
- package/presets/mavis/mcp-ts/adapter-map.json +1 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/mcp-ts/rules/agent-team-intake.md +2 -0
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/mcp-ts/rules/preset-writing-style.md +8 -0
- package/presets/mavis/mol/MAVIS.md +1 -1
- package/presets/mavis/mol/adapter-map.json +1 -1
- package/presets/mavis/mol/agents/feature-developer.md +1 -1
- package/presets/mavis/mol/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/mavis/mol/commands/task-evil.md +8 -0
- package/presets/mavis/mol/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/mol/native-skills/task-evil/SKILL.md +8 -0
- package/presets/mavis/mol/rules/agent-team-intake.md +2 -0
- package/presets/mavis/mol/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/mol/rules/preset-writing-style.md +8 -0
- package/presets/mavis/next/MAVIS.md +1 -1
- package/presets/mavis/next/REPO_AGENTS.md +2 -0
- package/presets/mavis/next/adapter-map.json +1 -1
- package/presets/mavis/next/agents/feature-developer.md +1 -1
- package/presets/mavis/next/agents/task-analyst.md +1 -7
- package/presets/mavis/next/agents/task-router.md +1 -1
- package/presets/mavis/next/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/mavis/next/commands/spec-start.md +3 -4
- package/presets/mavis/next/commands/task-continue.md +9 -8
- package/presets/mavis/next/commands/task-evil.md +8 -0
- package/presets/mavis/next/commands/task.md +1 -1
- package/presets/mavis/next/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/next/native-skills/spec-start/SKILL.md +3 -4
- package/presets/mavis/next/native-skills/task/SKILL.md +1 -1
- package/presets/mavis/next/native-skills/task-continue/SKILL.md +9 -8
- package/presets/mavis/next/native-skills/task-evil/SKILL.md +8 -0
- package/presets/mavis/next/rules/agent-team-intake.md +2 -0
- package/presets/mavis/next/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/next/rules/preset-writing-style.md +8 -0
- package/presets/mavis/next/team/README.md +1 -1
- package/presets/mavis/nuxt/MAVIS.md +1 -1
- package/presets/mavis/nuxt/adapter-map.json +1 -1
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/nuxt/rules/agent-team-intake.md +2 -0
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/nuxt/rules/preset-writing-style.md +8 -0
- package/presets/mavis/php-hexagonal/MAVIS.md +1 -1
- package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/php-hexagonal/rules/agent-team-intake.md +2 -0
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/php-hexagonal/rules/preset-writing-style.md +8 -0
- package/presets/mavis/php-laravel/MAVIS.md +1 -1
- package/presets/mavis/php-laravel/adapter-map.json +1 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/php-laravel/rules/agent-team-intake.md +2 -0
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/php-laravel/rules/preset-writing-style.md +8 -0
- package/presets/mavis/svelte/MAVIS.md +1 -1
- package/presets/mavis/svelte/adapter-map.json +1 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/svelte/rules/agent-team-intake.md +2 -0
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/svelte/rules/preset-writing-style.md +8 -0
- package/presets/opencode/android-kotlin/OPENCODE.md +5 -66
- package/presets/opencode/android-kotlin/adapter-map.json +42 -42
- package/presets/opencode/android-kotlin/agents/accessibility-reviewer.md +1 -1
- package/presets/opencode/android-kotlin/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/opencode/android-kotlin/agents/ci-investigator.md +1 -1
- package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/opencode/android-kotlin/agents/codebase-analyzer.md +1 -1
- package/presets/opencode/android-kotlin/agents/debugger.md +1 -1
- package/presets/opencode/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/opencode/android-kotlin/agents/instrumentation-test-generator.md +1 -1
- package/presets/opencode/android-kotlin/agents/instrumentation-test-healer.md +1 -1
- package/presets/opencode/android-kotlin/agents/instrumentation-test-planner.md +1 -1
- package/presets/opencode/android-kotlin/agents/migration-specialist.md +1 -1
- package/presets/opencode/android-kotlin/agents/mockup-reviewer.md +1 -1
- package/presets/opencode/android-kotlin/agents/openspec-author.md +1 -1
- package/presets/opencode/android-kotlin/agents/performance-auditor.md +1 -1
- package/presets/opencode/android-kotlin/agents/qa-tester.md +1 -1
- package/presets/opencode/android-kotlin/agents/security-reviewer.md +1 -1
- package/presets/opencode/android-kotlin/agents/solution-architect.md +1 -1
- package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/opencode/android-kotlin/agents/task-router.md +1 -1
- package/presets/opencode/android-kotlin/agents/tech-writer.md +1 -1
- package/presets/opencode/android-kotlin/agents/unit-test-generator.md +1 -1
- package/presets/opencode/android-kotlin/agents/unit-test-healer.md +1 -1
- package/presets/opencode/android-kotlin/agents/unit-test-planner.md +1 -1
- package/presets/opencode/android-kotlin/commands/task-continue.md +1 -1
- package/presets/opencode/android-kotlin/hooks/README.md +12 -1
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/android-kotlin/hooks/guard-shell-command.mjs +879 -0
- package/presets/opencode/android-kotlin/opencode.json +4 -4
- package/presets/opencode/android-kotlin/plugins/rule-attach/globs.json +167 -0
- package/presets/opencode/android-kotlin/rules/agent-team-intake.md +2 -0
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/android-kotlin/rules/preset-writing-style.md +8 -0
- package/presets/opencode/go/OPENCODE.md +5 -51
- package/presets/opencode/go/adapter-map.json +45 -45
- package/presets/opencode/go/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/go/agents/build-verifier.md +1 -1
- package/presets/opencode/go/agents/ci-investigator.md +1 -1
- package/presets/opencode/go/agents/code-reviewer.md +1 -1
- package/presets/opencode/go/agents/codebase-analyzer.md +1 -1
- package/presets/opencode/go/agents/debugger.md +1 -1
- package/presets/opencode/go/agents/feature-developer.md +1 -1
- package/presets/opencode/go/agents/integration-test-generator.md +1 -1
- package/presets/opencode/go/agents/integration-test-healer.md +1 -1
- package/presets/opencode/go/agents/integration-test-planner.md +1 -1
- package/presets/opencode/go/agents/migration-specialist.md +1 -1
- package/presets/opencode/go/agents/openspec-author.md +1 -1
- package/presets/opencode/go/agents/performance-auditor.md +1 -1
- package/presets/opencode/go/agents/qa-tester.md +1 -1
- package/presets/opencode/go/agents/security-reviewer.md +1 -1
- package/presets/opencode/go/agents/solution-architect.md +1 -1
- package/presets/opencode/go/agents/task-analyst.md +1 -1
- package/presets/opencode/go/agents/task-router.md +1 -1
- package/presets/opencode/go/agents/tech-writer.md +1 -1
- package/presets/opencode/go/agents/unit-test-generator.md +1 -1
- package/presets/opencode/go/agents/unit-test-healer.md +1 -1
- package/presets/opencode/go/agents/unit-test-planner.md +1 -1
- package/presets/opencode/go/commands/task-continue.md +1 -1
- package/presets/opencode/go/hooks/README.md +12 -1
- package/presets/opencode/go/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/go/hooks/guard-shell-command.mjs +878 -0
- package/presets/opencode/go/opencode.json +4 -4
- package/presets/opencode/go/plugins/rule-attach/globs.json +198 -0
- package/presets/opencode/go/rules/agent-team-intake.md +2 -0
- package/presets/opencode/go/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/go/rules/preset-writing-style.md +8 -0
- package/presets/opencode/ios-swift/OPENCODE.md +5 -66
- package/presets/opencode/ios-swift/adapter-map.json +41 -41
- package/presets/opencode/ios-swift/agents/accessibility-reviewer.md +1 -1
- package/presets/opencode/ios-swift/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/ios-swift/agents/build-verifier.md +1 -1
- package/presets/opencode/ios-swift/agents/ci-investigator.md +1 -1
- package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/opencode/ios-swift/agents/codebase-analyzer.md +1 -1
- package/presets/opencode/ios-swift/agents/debugger.md +1 -1
- package/presets/opencode/ios-swift/agents/feature-developer.md +1 -1
- package/presets/opencode/ios-swift/agents/migration-specialist.md +1 -1
- package/presets/opencode/ios-swift/agents/mockup-reviewer.md +1 -1
- package/presets/opencode/ios-swift/agents/openspec-author.md +1 -1
- package/presets/opencode/ios-swift/agents/performance-auditor.md +1 -1
- package/presets/opencode/ios-swift/agents/qa-tester.md +1 -1
- package/presets/opencode/ios-swift/agents/security-reviewer.md +1 -1
- package/presets/opencode/ios-swift/agents/solution-architect.md +1 -1
- package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
- package/presets/opencode/ios-swift/agents/task-router.md +1 -1
- package/presets/opencode/ios-swift/agents/tech-writer.md +1 -1
- package/presets/opencode/ios-swift/agents/unit-test-generator.md +1 -1
- package/presets/opencode/ios-swift/agents/unit-test-healer.md +1 -1
- package/presets/opencode/ios-swift/agents/unit-test-planner.md +1 -1
- package/presets/opencode/ios-swift/agents/xcuitest-test-generator.md +1 -1
- package/presets/opencode/ios-swift/agents/xcuitest-test-healer.md +1 -1
- package/presets/opencode/ios-swift/agents/xcuitest-test-planner.md +1 -1
- package/presets/opencode/ios-swift/commands/task-continue.md +1 -1
- package/presets/opencode/ios-swift/hooks/README.md +12 -1
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/ios-swift/hooks/guard-shell-command.mjs +878 -0
- package/presets/opencode/ios-swift/opencode.json +4 -4
- package/presets/opencode/ios-swift/plugins/rule-attach/globs.json +160 -0
- package/presets/opencode/ios-swift/rules/agent-team-intake.md +2 -0
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/ios-swift/rules/preset-writing-style.md +8 -0
- package/presets/opencode/java/OPENCODE.md +5 -58
- package/presets/opencode/java/adapter-map.json +45 -45
- package/presets/opencode/java/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/java/agents/build-verifier.md +1 -1
- package/presets/opencode/java/agents/ci-investigator.md +1 -1
- package/presets/opencode/java/agents/code-reviewer.md +1 -1
- package/presets/opencode/java/agents/codebase-analyzer.md +1 -1
- package/presets/opencode/java/agents/debugger.md +1 -1
- package/presets/opencode/java/agents/feature-developer.md +1 -1
- package/presets/opencode/java/agents/integration-test-generator.md +1 -1
- package/presets/opencode/java/agents/integration-test-healer.md +1 -1
- package/presets/opencode/java/agents/integration-test-planner.md +1 -1
- package/presets/opencode/java/agents/migration-specialist.md +1 -1
- package/presets/opencode/java/agents/openspec-author.md +1 -1
- package/presets/opencode/java/agents/performance-auditor.md +1 -1
- package/presets/opencode/java/agents/qa-tester.md +1 -1
- package/presets/opencode/java/agents/security-reviewer.md +1 -1
- package/presets/opencode/java/agents/solution-architect.md +1 -1
- package/presets/opencode/java/agents/task-analyst.md +1 -1
- package/presets/opencode/java/agents/task-router.md +1 -1
- package/presets/opencode/java/agents/tech-writer.md +1 -1
- package/presets/opencode/java/agents/unit-test-generator.md +1 -1
- package/presets/opencode/java/agents/unit-test-healer.md +1 -1
- package/presets/opencode/java/agents/unit-test-planner.md +1 -1
- package/presets/opencode/java/commands/task-continue.md +1 -1
- package/presets/opencode/java/hooks/README.md +12 -1
- package/presets/opencode/java/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/java/hooks/guard-shell-command.mjs +879 -0
- package/presets/opencode/java/opencode.json +4 -4
- package/presets/opencode/java/plugins/rule-attach/globs.json +230 -0
- package/presets/opencode/java/rules/agent-team-intake.md +2 -0
- package/presets/opencode/java/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/java/rules/preset-writing-style.md +8 -0
- package/presets/opencode/mcp-ts/OPENCODE.md +5 -48
- package/presets/opencode/mcp-ts/adapter-map.json +36 -36
- package/presets/opencode/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/opencode/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/opencode/mcp-ts/agents/security-reviewer.md +1 -1
- package/presets/opencode/mcp-ts/agents/solution-architect.md +1 -1
- package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/opencode/mcp-ts/agents/task-router.md +1 -1
- package/presets/opencode/mcp-ts/commands/task-continue.md +1 -1
- package/presets/opencode/mcp-ts/hooks/README.md +12 -1
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/mcp-ts/hooks/guard-shell-command.mjs +878 -0
- package/presets/opencode/mcp-ts/opencode.json +4 -4
- package/presets/opencode/mcp-ts/plugins/rule-attach/globs.json +151 -0
- package/presets/opencode/mcp-ts/rules/agent-team-intake.md +2 -0
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/mcp-ts/rules/preset-writing-style.md +8 -0
- package/presets/opencode/mol/OPENCODE.md +5 -56
- package/presets/opencode/mol/adapter-map.json +31 -31
- package/presets/opencode/mol/agents/accessibility-reviewer.md +1 -1
- package/presets/opencode/mol/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/mol/agents/build-verifier.md +1 -1
- package/presets/opencode/mol/agents/ci-investigator.md +1 -1
- package/presets/opencode/mol/agents/code-reviewer.md +1 -1
- package/presets/opencode/mol/agents/codebase-analyzer.md +1 -1
- package/presets/opencode/mol/agents/debugger.md +1 -1
- package/presets/opencode/mol/agents/feature-developer.md +2 -2
- package/presets/opencode/mol/agents/migration-specialist.md +1 -1
- package/presets/opencode/mol/agents/mockup-reviewer.md +1 -1
- package/presets/opencode/mol/agents/openspec-author.md +1 -1
- package/presets/opencode/mol/agents/performance-auditor.md +1 -1
- package/presets/opencode/mol/agents/playwright-test-generator.md +1 -1
- package/presets/opencode/mol/agents/playwright-test-healer.md +1 -1
- package/presets/opencode/mol/agents/playwright-test-planner.md +1 -1
- package/presets/opencode/mol/agents/qa-tester.md +1 -1
- package/presets/opencode/mol/agents/security-reviewer.md +1 -1
- package/presets/opencode/mol/agents/solution-architect.md +1 -1
- package/presets/opencode/mol/agents/task-analyst.md +1 -1
- package/presets/opencode/mol/agents/task-router.md +1 -1
- package/presets/opencode/mol/agents/tech-writer.md +1 -1
- package/presets/opencode/mol/agents/unit-test-generator.md +1 -1
- package/presets/opencode/mol/agents/unit-test-healer.md +1 -1
- package/presets/opencode/mol/agents/unit-test-planner.md +1 -1
- package/presets/opencode/mol/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/opencode/mol/commands/task-continue.md +1 -1
- package/presets/opencode/mol/commands/task-evil.md +8 -0
- package/presets/opencode/mol/hooks/README.md +12 -1
- package/presets/opencode/mol/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/mol/hooks/guard-shell-command.mjs +877 -0
- package/presets/opencode/mol/opencode.json +4 -4
- package/presets/opencode/mol/plugins/rule-attach/globs.json +112 -0
- package/presets/opencode/mol/rules/agent-team-intake.md +2 -0
- package/presets/opencode/mol/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/mol/rules/preset-writing-style.md +8 -0
- package/presets/opencode/next/OPENCODE.md +5 -55
- package/presets/opencode/next/REPO_AGENTS.md +2 -0
- package/presets/opencode/next/adapter-map.json +56 -56
- package/presets/opencode/next/agents/accessibility-reviewer.md +1 -1
- package/presets/opencode/next/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/next/agents/build-verifier.md +1 -1
- package/presets/opencode/next/agents/ci-investigator.md +1 -1
- package/presets/opencode/next/agents/code-reviewer.md +1 -1
- package/presets/opencode/next/agents/codebase-analyzer.md +1 -1
- package/presets/opencode/next/agents/debugger.md +1 -1
- package/presets/opencode/next/agents/feature-developer.md +2 -2
- package/presets/opencode/next/agents/migration-specialist.md +1 -1
- package/presets/opencode/next/agents/mockup-reviewer.md +1 -1
- package/presets/opencode/next/agents/openspec-author.md +1 -1
- package/presets/opencode/next/agents/performance-auditor.md +1 -1
- package/presets/opencode/next/agents/playwright-test-generator.md +1 -1
- package/presets/opencode/next/agents/playwright-test-healer.md +1 -1
- package/presets/opencode/next/agents/playwright-test-planner.md +1 -1
- package/presets/opencode/next/agents/qa-tester.md +1 -1
- package/presets/opencode/next/agents/security-reviewer.md +1 -1
- package/presets/opencode/next/agents/solution-architect.md +1 -1
- package/presets/opencode/next/agents/task-analyst.md +2 -8
- package/presets/opencode/next/agents/task-router.md +2 -2
- package/presets/opencode/next/agents/tech-writer.md +1 -1
- package/presets/opencode/next/agents/unit-test-generator.md +1 -1
- package/presets/opencode/next/agents/unit-test-healer.md +1 -1
- package/presets/opencode/next/agents/unit-test-planner.md +1 -1
- package/presets/opencode/next/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/opencode/next/commands/spec-start.md +3 -4
- package/presets/opencode/next/commands/task-continue.md +10 -9
- package/presets/opencode/next/commands/task-evil.md +8 -0
- package/presets/opencode/next/commands/task.md +1 -1
- package/presets/opencode/next/hooks/README.md +12 -1
- package/presets/opencode/next/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/next/hooks/guard-shell-command.mjs +877 -0
- package/presets/opencode/next/opencode.json +4 -4
- package/presets/opencode/next/plugins/rule-attach/globs.json +276 -0
- package/presets/opencode/next/rules/agent-team-intake.md +2 -0
- package/presets/opencode/next/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/next/rules/preset-writing-style.md +8 -0
- package/presets/opencode/next/team/README.md +1 -1
- package/presets/opencode/nuxt/OPENCODE.md +5 -54
- package/presets/opencode/nuxt/adapter-map.json +51 -51
- package/presets/opencode/nuxt/agents/accessibility-reviewer.md +1 -1
- package/presets/opencode/nuxt/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/nuxt/agents/build-verifier.md +1 -1
- package/presets/opencode/nuxt/agents/ci-investigator.md +1 -1
- package/presets/opencode/nuxt/agents/code-reviewer.md +1 -1
- package/presets/opencode/nuxt/agents/codebase-analyzer.md +1 -1
- package/presets/opencode/nuxt/agents/debugger.md +1 -1
- package/presets/opencode/nuxt/agents/feature-developer.md +1 -1
- package/presets/opencode/nuxt/agents/migration-specialist.md +1 -1
- package/presets/opencode/nuxt/agents/mockup-reviewer.md +1 -1
- package/presets/opencode/nuxt/agents/openspec-author.md +1 -1
- package/presets/opencode/nuxt/agents/performance-auditor.md +1 -1
- package/presets/opencode/nuxt/agents/playwright-test-generator.md +1 -1
- package/presets/opencode/nuxt/agents/playwright-test-healer.md +1 -1
- package/presets/opencode/nuxt/agents/playwright-test-planner.md +1 -1
- package/presets/opencode/nuxt/agents/qa-tester.md +1 -1
- package/presets/opencode/nuxt/agents/security-reviewer.md +1 -1
- package/presets/opencode/nuxt/agents/solution-architect.md +1 -1
- package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
- package/presets/opencode/nuxt/agents/task-router.md +1 -1
- package/presets/opencode/nuxt/agents/tech-writer.md +1 -1
- package/presets/opencode/nuxt/agents/unit-test-generator.md +1 -1
- package/presets/opencode/nuxt/agents/unit-test-healer.md +1 -1
- package/presets/opencode/nuxt/agents/unit-test-planner.md +1 -1
- package/presets/opencode/nuxt/commands/task-continue.md +1 -1
- package/presets/opencode/nuxt/hooks/README.md +12 -1
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/nuxt/hooks/guard-shell-command.mjs +877 -0
- package/presets/opencode/nuxt/opencode.json +4 -4
- package/presets/opencode/nuxt/plugins/rule-attach/globs.json +266 -0
- package/presets/opencode/nuxt/rules/agent-team-intake.md +2 -0
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/nuxt/rules/preset-writing-style.md +8 -0
- package/presets/opencode/php-hexagonal/OPENCODE.md +5 -60
- package/presets/opencode/php-hexagonal/adapter-map.json +45 -45
- package/presets/opencode/php-hexagonal/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/opencode/php-hexagonal/agents/ci-investigator.md +1 -1
- package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/codebase-analyzer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/debugger.md +1 -1
- package/presets/opencode/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/integration-test-generator.md +1 -1
- package/presets/opencode/php-hexagonal/agents/integration-test-healer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/integration-test-planner.md +1 -1
- package/presets/opencode/php-hexagonal/agents/migration-specialist.md +1 -1
- package/presets/opencode/php-hexagonal/agents/openspec-author.md +1 -1
- package/presets/opencode/php-hexagonal/agents/performance-auditor.md +1 -1
- package/presets/opencode/php-hexagonal/agents/qa-tester.md +1 -1
- package/presets/opencode/php-hexagonal/agents/security-reviewer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/solution-architect.md +1 -1
- package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/opencode/php-hexagonal/agents/task-router.md +1 -1
- package/presets/opencode/php-hexagonal/agents/tech-writer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/unit-test-generator.md +1 -1
- package/presets/opencode/php-hexagonal/agents/unit-test-healer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/unit-test-planner.md +1 -1
- package/presets/opencode/php-hexagonal/commands/task-continue.md +1 -1
- package/presets/opencode/php-hexagonal/hooks/README.md +12 -1
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/php-hexagonal/hooks/guard-shell-command.mjs +879 -0
- package/presets/opencode/php-hexagonal/opencode.json +4 -4
- package/presets/opencode/php-hexagonal/plugins/rule-attach/globs.json +242 -0
- package/presets/opencode/php-hexagonal/rules/agent-team-intake.md +2 -0
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/php-hexagonal/rules/preset-writing-style.md +8 -0
- package/presets/opencode/php-laravel/OPENCODE.md +5 -60
- package/presets/opencode/php-laravel/adapter-map.json +45 -45
- package/presets/opencode/php-laravel/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
- package/presets/opencode/php-laravel/agents/ci-investigator.md +1 -1
- package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/opencode/php-laravel/agents/codebase-analyzer.md +1 -1
- package/presets/opencode/php-laravel/agents/debugger.md +1 -1
- package/presets/opencode/php-laravel/agents/feature-developer.md +1 -1
- package/presets/opencode/php-laravel/agents/integration-test-generator.md +1 -1
- package/presets/opencode/php-laravel/agents/integration-test-healer.md +1 -1
- package/presets/opencode/php-laravel/agents/integration-test-planner.md +1 -1
- package/presets/opencode/php-laravel/agents/migration-specialist.md +1 -1
- package/presets/opencode/php-laravel/agents/openspec-author.md +1 -1
- package/presets/opencode/php-laravel/agents/performance-auditor.md +1 -1
- package/presets/opencode/php-laravel/agents/qa-tester.md +1 -1
- package/presets/opencode/php-laravel/agents/security-reviewer.md +1 -1
- package/presets/opencode/php-laravel/agents/solution-architect.md +1 -1
- package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
- package/presets/opencode/php-laravel/agents/task-router.md +1 -1
- package/presets/opencode/php-laravel/agents/tech-writer.md +1 -1
- package/presets/opencode/php-laravel/agents/unit-test-generator.md +1 -1
- package/presets/opencode/php-laravel/agents/unit-test-healer.md +1 -1
- package/presets/opencode/php-laravel/agents/unit-test-planner.md +1 -1
- package/presets/opencode/php-laravel/commands/task-continue.md +1 -1
- package/presets/opencode/php-laravel/hooks/README.md +12 -1
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/php-laravel/hooks/guard-shell-command.mjs +879 -0
- package/presets/opencode/php-laravel/opencode.json +4 -4
- package/presets/opencode/php-laravel/plugins/rule-attach/globs.json +232 -0
- package/presets/opencode/php-laravel/rules/agent-team-intake.md +2 -0
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/php-laravel/rules/preset-writing-style.md +8 -0
- package/presets/opencode/platform-contract.json +4 -0
- package/presets/opencode/plugins/output-guard/README.md +1 -1
- package/presets/opencode/plugins/output-guard/index.ts +8 -2
- package/presets/opencode/plugins/output-guard/rewrite.ts +37 -0
- package/presets/opencode/plugins/rule-attach/README.md +34 -0
- package/presets/opencode/plugins/rule-attach/attach.ts +224 -0
- package/presets/opencode/plugins/rule-attach/index.ts +169 -0
- package/presets/opencode/plugins/rule-attach/package.json +9 -0
- package/presets/opencode/plugins/settings-guard/README.md +25 -0
- package/presets/opencode/plugins/settings-guard/index.ts +114 -0
- package/presets/opencode/plugins/settings-guard/package.json +9 -0
- package/presets/opencode/plugins/settings-guard/policy.mjs +85 -0
- package/presets/opencode/plugins/settings-guard/prompt-face.mjs +153 -0
- package/presets/opencode/plugins/task-status/README.md +9 -4
- package/presets/opencode/plugins/task-status/eta.ts +20 -7
- package/presets/opencode/plugins/task-status/index.ts +14 -1
- package/presets/opencode/plugins/task-status/task-view.ts +160 -5
- package/presets/opencode/plugins/task-status/timing.ts +244 -0
- package/presets/opencode/plugins/task-status/types.ts +6 -0
- package/presets/opencode/svelte/OPENCODE.md +5 -54
- package/presets/opencode/svelte/adapter-map.json +51 -51
- package/presets/opencode/svelte/agents/accessibility-reviewer.md +1 -1
- package/presets/opencode/svelte/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/svelte/agents/build-verifier.md +1 -1
- package/presets/opencode/svelte/agents/ci-investigator.md +1 -1
- package/presets/opencode/svelte/agents/code-reviewer.md +1 -1
- package/presets/opencode/svelte/agents/codebase-analyzer.md +1 -1
- package/presets/opencode/svelte/agents/debugger.md +1 -1
- package/presets/opencode/svelte/agents/feature-developer.md +1 -1
- package/presets/opencode/svelte/agents/migration-specialist.md +1 -1
- package/presets/opencode/svelte/agents/mockup-reviewer.md +1 -1
- package/presets/opencode/svelte/agents/openspec-author.md +1 -1
- package/presets/opencode/svelte/agents/performance-auditor.md +1 -1
- package/presets/opencode/svelte/agents/playwright-test-generator.md +1 -1
- package/presets/opencode/svelte/agents/playwright-test-healer.md +1 -1
- package/presets/opencode/svelte/agents/playwright-test-planner.md +1 -1
- package/presets/opencode/svelte/agents/qa-tester.md +1 -1
- package/presets/opencode/svelte/agents/security-reviewer.md +1 -1
- package/presets/opencode/svelte/agents/solution-architect.md +1 -1
- package/presets/opencode/svelte/agents/task-analyst.md +1 -1
- package/presets/opencode/svelte/agents/task-router.md +1 -1
- package/presets/opencode/svelte/agents/tech-writer.md +1 -1
- package/presets/opencode/svelte/agents/unit-test-generator.md +1 -1
- package/presets/opencode/svelte/agents/unit-test-healer.md +1 -1
- package/presets/opencode/svelte/agents/unit-test-planner.md +1 -1
- package/presets/opencode/svelte/commands/task-continue.md +1 -1
- package/presets/opencode/svelte/hooks/README.md +12 -1
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/svelte/hooks/guard-shell-command.mjs +877 -0
- package/presets/opencode/svelte/opencode.json +4 -4
- package/presets/opencode/svelte/plugins/rule-attach/globs.json +245 -0
- package/presets/opencode/svelte/rules/agent-team-intake.md +2 -0
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/svelte/rules/preset-writing-style.md +8 -0
- package/presets/zcode/android-kotlin/adapter-map.json +1 -1
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/android-kotlin/rules/agent-team-intake.md +2 -0
- package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/android-kotlin/rules/preset-writing-style.md +8 -0
- package/presets/zcode/go/adapter-map.json +1 -1
- package/presets/zcode/go/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/go/rules/agent-team-intake.md +2 -0
- package/presets/zcode/go/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/go/rules/preset-writing-style.md +8 -0
- package/presets/zcode/ios-swift/adapter-map.json +1 -1
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/ios-swift/rules/agent-team-intake.md +2 -0
- package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/ios-swift/rules/preset-writing-style.md +8 -0
- package/presets/zcode/java/adapter-map.json +1 -1
- package/presets/zcode/java/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/java/rules/agent-team-intake.md +2 -0
- package/presets/zcode/java/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/java/rules/preset-writing-style.md +8 -0
- package/presets/zcode/mcp-ts/adapter-map.json +1 -1
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/mcp-ts/rules/agent-team-intake.md +2 -0
- package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/mcp-ts/rules/preset-writing-style.md +8 -0
- package/presets/zcode/mol/adapter-map.json +1 -1
- package/presets/zcode/mol/agents/feature-developer.md +1 -1
- package/presets/zcode/mol/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/zcode/mol/commands/task-evil.md +8 -0
- package/presets/zcode/mol/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/mol/rules/agent-team-intake.md +2 -0
- package/presets/zcode/mol/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/mol/rules/preset-writing-style.md +8 -0
- package/presets/zcode/next/REPO_AGENTS.md +2 -0
- package/presets/zcode/next/adapter-map.json +1 -1
- package/presets/zcode/next/agents/feature-developer.md +1 -1
- package/presets/zcode/next/agents/task-analyst.md +1 -7
- package/presets/zcode/next/agents/task-router.md +1 -1
- package/presets/zcode/next/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/zcode/next/commands/spec-start.md +3 -4
- package/presets/zcode/next/commands/task-continue.md +9 -8
- package/presets/zcode/next/commands/task-evil.md +8 -0
- package/presets/zcode/next/commands/task.md +1 -1
- package/presets/zcode/next/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/next/rules/agent-team-intake.md +2 -0
- package/presets/zcode/next/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/next/rules/preset-writing-style.md +8 -0
- package/presets/zcode/next/team/README.md +1 -1
- package/presets/zcode/nuxt/adapter-map.json +1 -1
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/nuxt/rules/agent-team-intake.md +2 -0
- package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/nuxt/rules/preset-writing-style.md +8 -0
- package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/php-hexagonal/rules/agent-team-intake.md +2 -0
- package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/php-hexagonal/rules/preset-writing-style.md +8 -0
- package/presets/zcode/php-laravel/adapter-map.json +1 -1
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/php-laravel/rules/agent-team-intake.md +2 -0
- package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/php-laravel/rules/preset-writing-style.md +8 -0
- package/presets/zcode/svelte/adapter-map.json +1 -1
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/svelte/rules/agent-team-intake.md +2 -0
- package/presets/zcode/svelte/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/svelte/rules/preset-writing-style.md +8 -0
- package/scripts/report-context-cost.mjs +1 -20
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# ai-rules settings — `.ai.local/.env`
|
|
2
|
+
#
|
|
3
|
+
# Consumer-owned. `init` seeds this example once (skip-if-exists) and never
|
|
4
|
+
# creates or edits `.ai.local/.env`; copy the keys you want into that file.
|
|
5
|
+
# Two keys are booleans, both default to `false`. Only a bare `true` or `1`
|
|
6
|
+
# turns one on. `false` and `0` are the silent off spellings. Quoted `"true"`,
|
|
7
|
+
# an `export` prefix, a trailing comment, and every other value warn and read
|
|
8
|
+
# as `false`. A broken or missing `.ai.local/.env` also reads as `false`,
|
|
9
|
+
# never as a permission.
|
|
10
|
+
#
|
|
11
|
+
# The third key is `AI_RULES_MAX_PARALLEL_TASKS`, a non-negative integer
|
|
12
|
+
# (default `4`, `0` = unlimited). A non-numeric value warns and stays `4`.
|
|
13
|
+
#
|
|
14
|
+
# The seeded `.ai.local/.gitignore` ignores `.env` and tracks `.env.example`.
|
|
15
|
+
# Committing `.env` is an opt-in: remove that line, then add the file. A
|
|
16
|
+
# committed `true` enables git writes on every clone.
|
|
17
|
+
#
|
|
18
|
+
# AI_RULES_ALLOW_GIT_WRITES (boolean, default false)
|
|
19
|
+
# true — a plain `git commit` / `git push` is answered `allow`; destructive,
|
|
20
|
+
# delete/force, alias and autonomous shapes are asked instead.
|
|
21
|
+
# false — `git commit` / `git push` are asked. Cursor (`beforeShellExecution`)
|
|
22
|
+
# and Claude (`PreToolUse`) run the shell guard. OpenCode applies the
|
|
23
|
+
# same verdict from `.opencode/plugins/settings-guard/` (`allow` lifts
|
|
24
|
+
# the static ask; `ask` keeps the prompt). An OpenCode host that has
|
|
25
|
+
# no permission hook throws instead, so the command does not run.
|
|
26
|
+
# Mavis and ZCode have no blocking hook; the flag is prose there.
|
|
27
|
+
# Verbs outside `commit`/`push`/`reset`/`clean`/`checkout` are not gated by this flag.
|
|
28
|
+
# A `true` value does not force an unattended commit: destructive and
|
|
29
|
+
# autonomous shapes are asked, and the host may still gate by its own static
|
|
30
|
+
# layer (G-OQ1).
|
|
31
|
+
# An autonomous `/task-evil` run also ignores this key: the command refuses to
|
|
32
|
+
# start at `true` and writes `.ai.local/team/.task-evil`, which makes the shell
|
|
33
|
+
# guard ask for git writes; the OpenCode profile keeps a hard `deny`.
|
|
34
|
+
#
|
|
35
|
+
# Limit: this is a pattern-based guard. Deliberate token-splitting or
|
|
36
|
+
# indirection — `g""it`, `g\it`, `\git`, `gi\<newline>t`, `eval "\x69t…"`,
|
|
37
|
+
# `C=git; $C`, `base64 -d | sh` — is outside its reach by design.
|
|
38
|
+
#
|
|
39
|
+
# AI_RULES_AUTOROUTE_UNCHAINED_PROMPTS (boolean, default false)
|
|
40
|
+
# true — a prompt that arrives outside the task chain is wrapped into `/task`
|
|
41
|
+
# while the live-slug count is below `AI_RULES_MAX_PARALLEL_TASKS`.
|
|
42
|
+
# Claude does this in `UserPromptSubmit`. OpenCode does it in the
|
|
43
|
+
# settings-guard plugin's `prompt` hook. Cursor, Mavis and ZCode have
|
|
44
|
+
# no prompt hook; the agent follows the same check in the entry prose.
|
|
45
|
+
# false — the prompt face writes nothing.
|
|
46
|
+
#
|
|
47
|
+
# AI_RULES_MAX_PARALLEL_TASKS (integer, default 4)
|
|
48
|
+
# How many live slugs the autoroute may wrap at once. `0` is unlimited.
|
|
49
|
+
# Absent, blank, or non-numeric values stay at `4` (a non-numeric value warns).
|
|
50
|
+
#
|
|
51
|
+
# Accepted spelling, uncommented in `.ai.local/.env`:
|
|
52
|
+
# AI_RULES_ALLOW_GIT_WRITES=false
|
|
53
|
+
# AI_RULES_AUTOROUTE_UNCHAINED_PROMPTS=false
|
|
54
|
+
# AI_RULES_MAX_PARALLEL_TASKS=4
|
|
@@ -39,6 +39,10 @@ const tasksDir = path.join(teamRoot, 'tasks');
|
|
|
39
39
|
// An attempt this long almost always contains human wait (an overnight pause, a
|
|
40
40
|
// gate decision answered between attempts) that no gate event covers.
|
|
41
41
|
const LONG_ATTEMPT_MS = 3 * 60 * 60 * 1000;
|
|
42
|
+
// Mirrors the hook's `AI_RULES_ATTEMPT_MAX_MS`: work beyond it is suspension, a
|
|
43
|
+
// hang, or a stop that arrived days after the agent died. Legacy events without
|
|
44
|
+
// `activeMs` are capped here, so old ledgers stop poisoning the averages.
|
|
45
|
+
const MAX_ATTEMPT_MS = 4 * 60 * 60 * 1000;
|
|
42
46
|
const incomplete = [];
|
|
43
47
|
const attempts = [];
|
|
44
48
|
const tasks = [];
|
|
@@ -204,6 +208,7 @@ function collect(metrics, filePath) {
|
|
|
204
208
|
const gateStarts = new Map();
|
|
205
209
|
const terminalAttempts = new Set();
|
|
206
210
|
const attemptDurations = [];
|
|
211
|
+
const attemptWalls = [];
|
|
207
212
|
const taskLongAttempts = [];
|
|
208
213
|
const hostUsage = new Map();
|
|
209
214
|
const usageEventsByAttempt = new Map();
|
|
@@ -212,6 +217,8 @@ function collect(metrics, filePath) {
|
|
|
212
217
|
let taskStartedAt = null;
|
|
213
218
|
let taskCompletedAt = null;
|
|
214
219
|
let taskGateWaitMs = 0;
|
|
220
|
+
let taskPausedMs = 0;
|
|
221
|
+
let pauseStartedAt = null;
|
|
215
222
|
let taskOutOfBandMs = 0;
|
|
216
223
|
let taskOutOfBandCount = 0;
|
|
217
224
|
let taskUsage = emptyUsageTotal();
|
|
@@ -264,13 +271,20 @@ function collect(metrics, filePath) {
|
|
|
264
271
|
attributionConfidence,
|
|
265
272
|
(attributionConfidenceCounts.get(attributionConfidence) ?? 0) + 1,
|
|
266
273
|
);
|
|
267
|
-
|
|
274
|
+
const activeMs = Number.isFinite(event.activeMs)
|
|
275
|
+
? event.activeMs
|
|
276
|
+
: Number.isFinite(event.durationMs)
|
|
277
|
+
? Math.min(event.durationMs, MAX_ATTEMPT_MS)
|
|
278
|
+
: null;
|
|
279
|
+
if (activeMs !== null) attemptDurations.push(activeMs);
|
|
280
|
+
if (Number.isFinite(event.durationMs)) attemptWalls.push(event.durationMs);
|
|
268
281
|
if (Number.isFinite(event.durationMs) && event.durationMs > LONG_ATTEMPT_MS) {
|
|
269
282
|
const longAttempt = {
|
|
270
283
|
slug: metrics.task.slug,
|
|
271
284
|
attemptId: event.attemptId,
|
|
272
285
|
agent: start.agent ?? 'unknown',
|
|
273
286
|
durationMs: event.durationMs,
|
|
287
|
+
activeMs,
|
|
274
288
|
};
|
|
275
289
|
taskLongAttempts.push(longAttempt);
|
|
276
290
|
longAttempts.push(longAttempt);
|
|
@@ -286,6 +300,8 @@ function collect(metrics, filePath) {
|
|
|
286
300
|
agent: start.agent ?? 'unknown',
|
|
287
301
|
role: start.role ?? 'unknown',
|
|
288
302
|
durationMs: Number.isFinite(event.durationMs) ? event.durationMs : null,
|
|
303
|
+
activeMs,
|
|
304
|
+
idleMs: Number.isFinite(event.idleMs) ? event.idleMs : null,
|
|
289
305
|
outcome: event.outcome ?? 'unknown',
|
|
290
306
|
attributionConfidence,
|
|
291
307
|
usage,
|
|
@@ -311,6 +327,12 @@ function collect(metrics, filePath) {
|
|
|
311
327
|
if (event.type === 'human_gate_started' && event.eventId) {
|
|
312
328
|
gateStarts.set(event.eventId, event);
|
|
313
329
|
}
|
|
330
|
+
if (event.type === 'task_paused' && pauseStartedAt === null) pauseStartedAt = event.at;
|
|
331
|
+
if (event.type === 'task_resumed' && pauseStartedAt !== null) {
|
|
332
|
+
const paused = Date.parse(event.at) - Date.parse(pauseStartedAt);
|
|
333
|
+
if (Number.isFinite(paused) && paused >= 0) taskPausedMs += paused;
|
|
334
|
+
pauseStartedAt = null;
|
|
335
|
+
}
|
|
314
336
|
if (event.type === 'human_gate_ended') {
|
|
315
337
|
const start = event.gateStartedEventId ? gateStarts.get(event.gateStartedEventId) : undefined;
|
|
316
338
|
const elapsed = start ? Date.parse(event.at) - Date.parse(start.at) : NaN;
|
|
@@ -338,15 +360,22 @@ function collect(metrics, filePath) {
|
|
|
338
360
|
|
|
339
361
|
if (taskCompleted && !ledgerIncomplete) tasks.push(metrics.task);
|
|
340
362
|
if (taskStartedAt) {
|
|
363
|
+
const elapsedMs = taskCompletedAt ? Date.parse(taskCompletedAt) - Date.parse(taskStartedAt) : null;
|
|
364
|
+
const activeMs = attemptDurations.reduce((sum, value) => sum + value, 0);
|
|
341
365
|
taskReports.push({
|
|
342
366
|
...metrics.task,
|
|
343
|
-
elapsedMs
|
|
344
|
-
activeMs
|
|
367
|
+
elapsedMs,
|
|
368
|
+
activeMs,
|
|
345
369
|
gateWaitMs: taskGateWaitMs,
|
|
370
|
+
pausedMs: taskPausedMs,
|
|
371
|
+
// Whatever the ledger cannot attribute to work, a gate or a pause.
|
|
372
|
+
idleMs: elapsedMs === null ? null : Math.max(0, elapsedMs - activeMs - taskGateWaitMs - taskPausedMs - taskOutOfBandMs),
|
|
346
373
|
outOfBandMs: taskOutOfBandMs,
|
|
347
374
|
outOfBandCount: taskOutOfBandCount,
|
|
348
375
|
attemptCount: terminalAttempts.size,
|
|
349
|
-
|
|
376
|
+
// Wall clock, so a flagged long attempt still reports what it was.
|
|
377
|
+
longestAttemptMs: attemptWalls.length ? Math.max(...attemptWalls) : null,
|
|
378
|
+
longestActiveAttemptMs: attemptDurations.length ? Math.max(...attemptDurations) : null,
|
|
350
379
|
longAttemptCount: taskLongAttempts.length,
|
|
351
380
|
completed: taskCompleted,
|
|
352
381
|
incomplete: ledgerIncomplete,
|
|
@@ -391,7 +420,7 @@ const byAgentRole = groupBy(
|
|
|
391
420
|
(item) => `${item.platform}|${item.stack}|${item.preset}|${item.agent}|${item.role}`,
|
|
392
421
|
).map((group) => {
|
|
393
422
|
const sample = group[0];
|
|
394
|
-
const durations = group.map((item) => item.
|
|
423
|
+
const durations = group.map((item) => item.activeMs).filter((value) => value !== null);
|
|
395
424
|
const sumDurationMs = durations.reduce((sum, value) => sum + value, 0);
|
|
396
425
|
const usageTotal = group.reduce((total, item) => addUsage(total, item.usage), emptyUsageTotal());
|
|
397
426
|
return {
|
|
@@ -25,9 +25,11 @@
|
|
|
25
25
|
* `prompt.md`, `goal.md`), because the chain hook rewrites `status.json` on
|
|
26
26
|
* every step and a rewritten status must not make a legacy folder look new.
|
|
27
27
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* Every live slug is excluded and printed: its intake is still in flight, the
|
|
29
|
+
* same exclusion the backfill applies (architecture §8.4), so it is judged
|
|
30
|
+
* once the task closes. A slug is live when its own `status.json` parses to a
|
|
31
|
+
* non-terminal state — the pointer `active-task.json` is never read, so the
|
|
32
|
+
* audit stays correct with several slugs live in one repo.
|
|
31
33
|
*
|
|
32
34
|
* Usage: node scripts/check-task-repositories.mjs [--tasks-root <dir>]
|
|
33
35
|
* [--registry <file>] [--cutoff YYYY-MM-DD] [--json]
|
|
@@ -37,6 +39,9 @@ import fs from 'node:fs';
|
|
|
37
39
|
import path from 'node:path';
|
|
38
40
|
import { fileURLToPath } from 'node:url';
|
|
39
41
|
|
|
42
|
+
/** Terminal `status.json` states — the set the hook and autoroute templates pin. */
|
|
43
|
+
const TERMINAL_STATES = new Set(['completed', 'blocked', 'changes_requested', 'validation_failed']);
|
|
44
|
+
|
|
40
45
|
const scriptDirectory = path.dirname(fileURLToPath(import.meta.url));
|
|
41
46
|
// Two homes: `packages/ai-rules/scripts` in this repository, and
|
|
42
47
|
// `<repo>/.ai.local/scripts` once `init` ships it to a consumer, where the task
|
|
@@ -136,9 +141,6 @@ function readJson(file) {
|
|
|
136
141
|
}
|
|
137
142
|
}
|
|
138
143
|
|
|
139
|
-
/** `readJson` returns `undefined` for a parse error and `null` for a non-object. */
|
|
140
|
-
const unusableJson = (value) => value === undefined || value === null;
|
|
141
|
-
|
|
142
144
|
/** The registry's view of one slug: the ids its links name, sorted. */
|
|
143
145
|
function linkedIds(registry, slug) {
|
|
144
146
|
if (registry === null) return null;
|
|
@@ -159,16 +161,23 @@ function main() {
|
|
|
159
161
|
console.log(`task-repositories: OK (no task store at ${args.tasksRoot})`);
|
|
160
162
|
return;
|
|
161
163
|
}
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
164
|
+
const folders = fs
|
|
165
|
+
.readdirSync(args.tasksRoot, { withFileTypes: true })
|
|
166
|
+
.filter((entry) => entry.isDirectory() && !entry.name.startsWith('.'))
|
|
167
|
+
.map((entry) => entry.name)
|
|
168
|
+
.sort();
|
|
169
|
+
|
|
170
|
+
// The live-slug scan over the task store — never the `active-task.json`
|
|
171
|
+
// pointer, so several slugs can be in flight in one repo. An unreadable or
|
|
172
|
+
// missing `status.json` is not a live slug.
|
|
173
|
+
const liveSlugs = new Set();
|
|
174
|
+
for (const name of folders) {
|
|
175
|
+
const status = readJson(path.join(args.tasksRoot, name, 'status.json'));
|
|
176
|
+
if (status && typeof status.state === 'string' && !TERMINAL_STATES.has(status.state)) {
|
|
177
|
+
liveSlugs.add(name);
|
|
170
178
|
}
|
|
171
179
|
}
|
|
180
|
+
|
|
172
181
|
let registry = fs.existsSync(args.registry) ? readJson(args.registry) : null;
|
|
173
182
|
if (registry === undefined) usageError(`--registry is not valid JSON: ${args.registry}`);
|
|
174
183
|
if (registry !== null && (!Array.isArray(registry.repositories) || !Array.isArray(registry.links))) {
|
|
@@ -177,12 +186,6 @@ function main() {
|
|
|
177
186
|
}
|
|
178
187
|
const knownIds = registry === null ? null : new Set(registry.repositories.map((record) => record.id));
|
|
179
188
|
|
|
180
|
-
const folders = fs
|
|
181
|
-
.readdirSync(args.tasksRoot, { withFileTypes: true })
|
|
182
|
-
.filter((entry) => entry.isDirectory() && !entry.name.startsWith('.'))
|
|
183
|
-
.map((entry) => entry.name)
|
|
184
|
-
.sort();
|
|
185
|
-
|
|
186
189
|
const violations = [];
|
|
187
190
|
const legacy = [];
|
|
188
191
|
const excluded = [];
|
|
@@ -191,7 +194,7 @@ function main() {
|
|
|
191
194
|
const folder = path.join(args.tasksRoot, name);
|
|
192
195
|
const pipelinePath = path.join(folder, 'pipeline.json');
|
|
193
196
|
if (!fs.existsSync(pipelinePath)) continue;
|
|
194
|
-
if (name
|
|
197
|
+
if (liveSlugs.has(name)) {
|
|
195
198
|
excluded.push(name);
|
|
196
199
|
continue;
|
|
197
200
|
}
|
|
@@ -249,7 +252,7 @@ function main() {
|
|
|
249
252
|
|
|
250
253
|
const summary = `${folders.length} task folders, ${checked} with pipeline.json${
|
|
251
254
|
legacy.length > 0 ? `, legacy before ${args.cutoff}: ${legacy.length}` : ''
|
|
252
|
-
}${excluded.length > 0 ? `,
|
|
255
|
+
}${excluded.length > 0 ? `, excluding live: ${excluded.join(', ')}` : ''}`;
|
|
253
256
|
for (const warning of warnings) console.error(`WARN ${warning}`);
|
|
254
257
|
if (args.json) {
|
|
255
258
|
console.log(
|
|
@@ -41,7 +41,7 @@ const GUARD_STALE_MS = 30000;
|
|
|
41
41
|
* flight is never stolen.
|
|
42
42
|
*/
|
|
43
43
|
const LEASE_WARM_MS = 5000;
|
|
44
|
-
const NAME_PATTERN = /^[a-z0-9][a-z0-9._
|
|
44
|
+
const NAME_PATTERN = /^[a-z0-9][a-z0-9._#-]{0,63}$/;
|
|
45
45
|
const KINDS = new Set(['exclusive', 'port', 'advisory']);
|
|
46
46
|
|
|
47
47
|
const newToken = () => crypto.randomBytes(12).toString('hex');
|
|
@@ -293,6 +293,7 @@ const describeOwner = (record) => {
|
|
|
293
293
|
export function acquireLease({
|
|
294
294
|
aiLocalRoot,
|
|
295
295
|
name,
|
|
296
|
+
storedName = null,
|
|
296
297
|
kind = 'exclusive',
|
|
297
298
|
port = null,
|
|
298
299
|
label = null,
|
|
@@ -331,7 +332,7 @@ export function acquireLease({
|
|
|
331
332
|
const startedAt = new Date().toISOString();
|
|
332
333
|
return {
|
|
333
334
|
schemaVersion: LEASE_SCHEMA_VERSION,
|
|
334
|
-
name,
|
|
335
|
+
name: storedName ?? name,
|
|
335
336
|
kind,
|
|
336
337
|
owner: {
|
|
337
338
|
pid,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* [--allow-unlocked] [--json] [--root <dir>]
|
|
8
8
|
* release --name <res> --token <t> [--root <dir>] [--json]
|
|
9
9
|
* run --name <res> [acquire flags] -- <command> [args…]
|
|
10
|
-
* list [--json] [--task <slug>] [--live] [--root <dir>]
|
|
10
|
+
* list [--json] [--name <res>] [--task <slug>] [--live] [--root <dir>]
|
|
11
11
|
* status --name <res> [--json]
|
|
12
12
|
* watch [--interval 1s] [--json] [--once] [--no-color]
|
|
13
13
|
* scan [--json] [--known-only | --all]
|
|
@@ -98,7 +98,7 @@ const VERB_FLAGS = {
|
|
|
98
98
|
'name', 'kind', 'port', 'label', 'task', 'agent', 'wait', 'ttl', 'allow-unlocked',
|
|
99
99
|
'root', 'pid', 'token', 'cwd', 'command',
|
|
100
100
|
]),
|
|
101
|
-
list: new Set(['json', 'root', 'task', 'live']),
|
|
101
|
+
list: new Set(['json', 'root', 'task', 'live', 'name']),
|
|
102
102
|
status: new Set(['name', 'json', 'root']),
|
|
103
103
|
watch: new Set(['interval', 'json', 'once', 'no-color', 'root', 'task']),
|
|
104
104
|
scan: new Set(['json', 'known-only', 'all', 'root']),
|
|
@@ -771,12 +771,15 @@ export function buildSnapshot(roots) {
|
|
|
771
771
|
}
|
|
772
772
|
|
|
773
773
|
const filterSnapshot = (snapshot, flags) => {
|
|
774
|
-
if (!flags.task && !flags.live) return snapshot;
|
|
774
|
+
if (!flags.task && !flags.live && !flags.name) return snapshot;
|
|
775
775
|
return {
|
|
776
776
|
...snapshot,
|
|
777
|
-
processes: snapshot.processes.filter(
|
|
778
|
-
|
|
779
|
-
|
|
777
|
+
processes: snapshot.processes.filter((item) => {
|
|
778
|
+
if (flags.task && item.task !== flags.task) return false;
|
|
779
|
+
if (flags.live && item.state !== 'live') return false;
|
|
780
|
+
if (flags.name && item.name !== flags.name && !item.name.startsWith(`${flags.name}#`)) return false;
|
|
781
|
+
return true;
|
|
782
|
+
}),
|
|
780
783
|
};
|
|
781
784
|
};
|
|
782
785
|
|
|
@@ -927,7 +930,7 @@ const parseFlags = (verb, argv) => {
|
|
|
927
930
|
const requireName = (flags) => {
|
|
928
931
|
if (!flags.name) fail('--name is required');
|
|
929
932
|
if (!isValidLeaseName(flags.name)) {
|
|
930
|
-
fail(`--name must be a lowercase resource name (a-z, 0-9, ".", "_", "-"), got "${flags.name}"`);
|
|
933
|
+
fail(`--name must be a lowercase resource name (a-z, 0-9, ".", "_", "#", "-"), got "${flags.name}"`);
|
|
931
934
|
}
|
|
932
935
|
return flags.name;
|
|
933
936
|
};
|
|
@@ -981,11 +984,32 @@ const requireLiveOwner = (flags, fallback) => {
|
|
|
981
984
|
return pid;
|
|
982
985
|
};
|
|
983
986
|
|
|
984
|
-
|
|
987
|
+
/**
|
|
988
|
+
* `start` / `run` / `acquire` with `--task <slug>` record `leases/<name>#<slug>.json`.
|
|
989
|
+
* The JSON `name` stays the requested resource; `owner.task` stays the slug.
|
|
990
|
+
*/
|
|
991
|
+
const leaseIdentity = (flags) => {
|
|
992
|
+
const requested = requireName(flags);
|
|
993
|
+
const task = typeof flags.task === 'string' ? flags.task : '';
|
|
994
|
+
if (task === '') return { requested, effective: requested };
|
|
995
|
+
const effective = `${requested}#${task}`;
|
|
996
|
+
if (!isValidLeaseName(effective)) {
|
|
997
|
+
fail(`effective lease name "${effective}" must be a lowercase lease name of at most 64 characters`);
|
|
998
|
+
}
|
|
999
|
+
return { requested, effective };
|
|
1000
|
+
};
|
|
1001
|
+
|
|
1002
|
+
const namesMatching = (aiLocalRoot, requested) =>
|
|
1003
|
+
listLeases(aiLocalRoot)
|
|
1004
|
+
.map((entry) => entry.name)
|
|
1005
|
+
.filter((name) => name === requested || name.startsWith(`${requested}#`));
|
|
1006
|
+
|
|
1007
|
+
const leaseOptions = (flags, roots, identity, pid) => {
|
|
985
1008
|
const port = parsePort(flags, null);
|
|
986
1009
|
return {
|
|
987
1010
|
aiLocalRoot: roots.aiLocalRoot,
|
|
988
|
-
name,
|
|
1011
|
+
name: identity.effective,
|
|
1012
|
+
storedName: identity.requested,
|
|
989
1013
|
kind: flags.kind ? parseKind(flags) : port === null ? 'exclusive' : 'port',
|
|
990
1014
|
port,
|
|
991
1015
|
label: flags.label ?? null,
|
|
@@ -1018,8 +1042,8 @@ const describeAcquire = (result) => {
|
|
|
1018
1042
|
|
|
1019
1043
|
const acquireVerb = (flags) => {
|
|
1020
1044
|
const roots = resolveRoots(flags);
|
|
1021
|
-
const
|
|
1022
|
-
const result = acquireLease(leaseOptions(flags, roots,
|
|
1045
|
+
const identity = leaseIdentity(flags);
|
|
1046
|
+
const result = acquireLease(leaseOptions(flags, roots, identity, requireLiveOwner(flags, process.ppid)));
|
|
1023
1047
|
if (flags.json) {
|
|
1024
1048
|
out(renderJson(result));
|
|
1025
1049
|
return result.acquired || (result.fatal && result.skipped) ? 0 : result.fatal ? 3 : 1;
|
|
@@ -1064,10 +1088,11 @@ const releaseVerb = (flags) => {
|
|
|
1064
1088
|
const runVerb = async (flags, tail) => {
|
|
1065
1089
|
if (!tail || tail.length === 0) fail('run needs a command after --');
|
|
1066
1090
|
const roots = resolveRoots(flags);
|
|
1067
|
-
const
|
|
1091
|
+
const identity = leaseIdentity(flags);
|
|
1092
|
+
const name = identity.effective;
|
|
1068
1093
|
// `run` owns the lease for the child's lifetime, so the manager — not the
|
|
1069
1094
|
// parent shell — is the recorded holder.
|
|
1070
|
-
const options = leaseOptions(flags, roots,
|
|
1095
|
+
const options = leaseOptions(flags, roots, identity, flags.pid ? positiveInt(flags.pid, '--pid') : process.pid);
|
|
1071
1096
|
const command = flags.command ?? tail.join(' ');
|
|
1072
1097
|
const acquired = acquireLease({ ...options, command });
|
|
1073
1098
|
if (!acquired.acquired) {
|
|
@@ -1161,6 +1186,7 @@ const runVerb = async (flags, tail) => {
|
|
|
1161
1186
|
|
|
1162
1187
|
const listVerb = (flags) => {
|
|
1163
1188
|
const roots = resolveRoots(flags);
|
|
1189
|
+
if (flags.name) requireName(flags);
|
|
1164
1190
|
const snapshot = filterSnapshot(buildSnapshot(roots), flags);
|
|
1165
1191
|
if (flags.json) {
|
|
1166
1192
|
out(renderJson(snapshot));
|
|
@@ -1172,14 +1198,16 @@ const listVerb = (flags) => {
|
|
|
1172
1198
|
|
|
1173
1199
|
const statusVerb = (flags) => {
|
|
1174
1200
|
const roots = resolveRoots(flags);
|
|
1175
|
-
const
|
|
1201
|
+
const requested = requireName(flags);
|
|
1202
|
+
const matched = namesMatching(roots.aiLocalRoot, requested);
|
|
1203
|
+
const name = matched.includes(requested) || matched.length !== 1 ? requested : matched[0];
|
|
1176
1204
|
const record = readLease(roots.aiLocalRoot, name);
|
|
1177
1205
|
const state = record === null ? null : leaseState(record);
|
|
1178
1206
|
const payload = {
|
|
1179
1207
|
schemaVersion: SNAPSHOT_SCHEMA_VERSION,
|
|
1180
1208
|
generatedAt: new Date().toISOString(),
|
|
1181
1209
|
root: roots.repoRoot,
|
|
1182
|
-
name,
|
|
1210
|
+
name: requested,
|
|
1183
1211
|
path: leasePath(roots.aiLocalRoot, name),
|
|
1184
1212
|
present: record !== null,
|
|
1185
1213
|
state: state?.state ?? 'absent',
|
|
@@ -1191,10 +1219,10 @@ const statusVerb = (flags) => {
|
|
|
1191
1219
|
return 0;
|
|
1192
1220
|
}
|
|
1193
1221
|
if (record === null) {
|
|
1194
|
-
out(`processes: ${
|
|
1222
|
+
out(`processes: ${requested} is not recorded`);
|
|
1195
1223
|
return 0;
|
|
1196
1224
|
}
|
|
1197
|
-
out(`processes: ${
|
|
1225
|
+
out(`processes: ${requested} is ${payload.state} (${payload.why}), pid ${payload.owner?.pid ?? '?'}`);
|
|
1198
1226
|
return 0;
|
|
1199
1227
|
};
|
|
1200
1228
|
|
|
@@ -1449,7 +1477,9 @@ const stopVerb = async (flags) => {
|
|
|
1449
1477
|
}
|
|
1450
1478
|
} else {
|
|
1451
1479
|
if (!flags.name) fail('stop needs --name <res> or --task <slug>');
|
|
1452
|
-
|
|
1480
|
+
const requested = requireName(flags);
|
|
1481
|
+
const matched = namesMatching(roots.aiLocalRoot, requested);
|
|
1482
|
+
names.push(...(matched.length > 0 ? matched : [requested]));
|
|
1453
1483
|
}
|
|
1454
1484
|
if (names.length === 0) {
|
|
1455
1485
|
if (flags.json) {
|
|
@@ -1676,7 +1706,8 @@ const terminateDetached = async (pid) => {
|
|
|
1676
1706
|
|
|
1677
1707
|
const startVerb = async (flags) => {
|
|
1678
1708
|
const roots = resolveRoots(flags);
|
|
1679
|
-
const
|
|
1709
|
+
const identity = leaseIdentity(flags);
|
|
1710
|
+
const name = identity.effective;
|
|
1680
1711
|
if (!flags.command) fail('start needs --command');
|
|
1681
1712
|
const port = flags.port === undefined ? 0 : positiveInt(flags.port, '--port', { max: 65535, allowZero: true });
|
|
1682
1713
|
const waitMs = parseReadyWait(flags);
|
|
@@ -1757,6 +1788,7 @@ const startVerb = async (flags) => {
|
|
|
1757
1788
|
const lease = acquireLease({
|
|
1758
1789
|
aiLocalRoot: roots.aiLocalRoot,
|
|
1759
1790
|
name,
|
|
1791
|
+
storedName: identity.requested,
|
|
1760
1792
|
kind: 'port',
|
|
1761
1793
|
port: port > 0 ? port : null,
|
|
1762
1794
|
label: flags.label ?? 'dev-server',
|
|
@@ -1979,7 +2011,7 @@ const USAGE = [
|
|
|
1979
2011
|
' the owner is the parent shell (--pid $$ overrides); use run for a command',
|
|
1980
2012
|
' release --name <res> --token <t> [--root <dir>] [--json]',
|
|
1981
2013
|
' run --name <res> [acquire flags] -- <command> [args…]',
|
|
1982
|
-
' list [--json] [--task <slug>] [--live] [--root <dir>]',
|
|
2014
|
+
' list [--json] [--name <res>] [--task <slug>] [--live] [--root <dir>]',
|
|
1983
2015
|
' status --name <res> [--json] [--root <dir>]',
|
|
1984
2016
|
' watch [--interval 1s] [--json] [--once] [--no-color] [--root <dir>]',
|
|
1985
2017
|
' scan [--json] [--known-only | --all] [--root <dir>]',
|