@event4u/agent-config 9.9.0 → 9.11.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/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +212 -194
- package/README.md +13 -16
- package/agents/templates/.ai-council.yml.example +481 -0
- package/agents/templates/.ai-video.xml.example +247 -0
- package/dist/agent-src/commands/agent-status.md +12 -11
- package/dist/agent-src/commands/agents/user/accept.md +115 -30
- package/dist/agent-src/commands/agents/user/delete.md +147 -0
- package/dist/agent-src/commands/agents/user/review.md +65 -28
- package/dist/agent-src/commands/agents/user/show.md +82 -29
- package/dist/agent-src/commands/agents/user/update.md +2 -2
- package/dist/agent-src/commands/agents/user.md +16 -3
- package/dist/agent-src/commands/check-current-md.md +0 -10
- package/dist/agent-src/commands/condense.md +28 -97
- package/dist/agent-src/commands/cost/report.md +7 -0
- package/dist/agent-src/commands/fix/portability.md +0 -8
- package/dist/agent-src/commands/fix/refs.md +0 -8
- package/dist/agent-src/commands/humanize.md +2 -2
- package/dist/agent-src/commands/jira-ticket.md +1 -1
- package/dist/agent-src/commands/memory/load.md +11 -0
- package/dist/agent-src/commands/optimize/skills.md +1 -1
- package/dist/agent-src/commands/pr/create.md +4 -4
- package/dist/agent-src/commands/profile/show.md +3 -3
- package/dist/agent-src/commands/rule-compliance-audit.md +5 -4
- package/dist/agent-src/commands/security-audit-config.md +1 -1
- package/dist/agent-src/commands/sync/gitignore/fix.md +1 -1
- package/dist/agent-src/commands/tdd.md +21 -0
- package/dist/agent-src/commands/team/delegate.md +2 -2
- package/dist/agent-src/commands/team-knowledge/bootstrap.md +9 -8
- package/dist/agent-src/commands/team-knowledge/consolidate.md +8 -7
- package/dist/agent-src/commands/team.md +4 -1
- package/dist/agent-src/commands/upstream-contribute.md +0 -1
- package/dist/agent-src/contexts/authority/commit-mechanics.md +7 -0
- package/dist/agent-src/contexts/authority/destructive-mechanics.md +16 -0
- package/dist/agent-src/contexts/authority/scope-mechanics.md +61 -0
- package/dist/agent-src/contexts/communication/rules-auto/reply-close-mechanics.md +20 -18
- package/dist/agent-src/contexts/communication/rules-auto/skill-quality-mechanics.md +1 -1
- package/dist/agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +1 -1
- package/dist/agent-src/contexts/communication/rules-auto/source-of-truth-mechanics.md +9 -10
- package/dist/agent-src/contexts/communication/rules-auto/think-before-action-mechanics.md +1 -1
- package/dist/agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +11 -0
- package/dist/agent-src/contexts/contracts/artifact-engagement-flow.md +26 -15
- package/dist/agent-src/contexts/contracts/command-suggestion-flow.md +3 -0
- package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +67 -37
- package/dist/agent-src/contexts/execution/auto-orchestration-activation.md +1 -1
- package/dist/agent-src/contexts/execution/autonomy-examples.md +1 -1
- package/dist/agent-src/contexts/execution/autonomy-mechanics.md +7 -6
- package/dist/agent-src/contexts/execution/evidence-discipline.md +92 -77
- package/dist/agent-src/contexts/execution/orchestration-benchmark-gate.md +22 -21
- package/dist/agent-src/contexts/execution/orchestration-telemetry.md +24 -0
- package/dist/agent-src/contexts/execution/project-intelligence.md +122 -103
- package/dist/agent-src/contexts/execution/roadmap-execution-contract.md +23 -21
- package/dist/agent-src/contexts/execution/subagent-response-contract.md +5 -5
- package/dist/agent-src/contexts/execution/subagent-routing.md +11 -0
- package/dist/agent-src/contexts/execution/subagent-spawn-contract.md +13 -13
- package/dist/agent-src/contexts/execution/subagent-steering.md +36 -34
- package/dist/agent-src/contexts/execution/toolchain-resolver.md +1 -1
- package/dist/agent-src/contexts/execution/user-memory-channels.md +189 -0
- package/dist/agent-src/contexts/execution/verification-mechanics.md +9 -0
- package/dist/agent-src/contexts/model-recommendations.md +3 -2
- package/dist/agent-src/contexts/subagent-configuration.md +3 -3
- package/dist/agent-src/ghostwriter/README.md +2 -2
- package/dist/agent-src/packs/README.md +1 -1
- package/dist/agent-src/personas/README.md +5 -5
- package/dist/agent-src/personas/_template-specialist/persona.md +3 -3
- package/dist/agent-src/personas/backend-architect.md +24 -23
- package/dist/agent-src/personas/eloquent-tamer.md +30 -30
- package/dist/agent-src/personas/frontend-engineer.md +30 -30
- package/dist/agent-src/personas/product-owner.md +41 -38
- package/dist/agent-src/personas/qa.md +13 -13
- package/dist/agent-src/personas/security-engineer.md +22 -22
- package/dist/agent-src/presets/README.md +3 -3
- package/dist/agent-src/profiles/README.md +3 -3
- package/dist/agent-src/rules/active-remediation.md +2 -2
- package/dist/agent-src/rules/artifact-engagement-recording.md +4 -4
- package/dist/agent-src/rules/ask-when-uncertain.md +0 -4
- package/dist/agent-src/rules/augment-edit-discipline.md +1 -1
- package/dist/agent-src/rules/broken-access-control.md +4 -4
- package/dist/agent-src/rules/code-comment-discipline.md +1 -1
- package/dist/agent-src/rules/code-provenance.md +2 -2
- package/dist/agent-src/rules/commit-policy.md +4 -9
- package/dist/agent-src/rules/communication-through-line.md +5 -5
- package/dist/agent-src/rules/decision-revisit-gate.md +1 -1
- package/dist/agent-src/rules/design-fidelity.md +1 -1
- package/dist/agent-src/rules/doc-screenshot-hygiene.md +1 -1
- package/dist/agent-src/rules/domain-adoption-policy.md +1 -1
- package/dist/agent-src/rules/domain-safety-pii.md +1 -1
- package/dist/agent-src/rules/external-code-graph-interop.md +1 -1
- package/dist/agent-src/rules/fast-path-marker-visibility.md +43 -7
- package/dist/agent-src/rules/finance-safety-floor.md +1 -1
- package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +3 -3
- package/dist/agent-src/rules/history-discipline.md +1 -1
- package/dist/agent-src/rules/legal-safety-floor.md +1 -1
- package/dist/agent-src/rules/lethal-trifecta-guard.md +5 -5
- package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +10 -8
- package/dist/agent-src/rules/media-governance-routing.md +13 -13
- package/dist/agent-src/rules/media-sync-ground-truth.md +29 -11
- package/dist/agent-src/rules/no-cheap-questions.md +7 -7
- package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +29 -18
- package/dist/agent-src/rules/non-destructive-by-default.md +5 -23
- package/dist/agent-src/rules/onboarding-gate.md +14 -4
- package/dist/agent-src/rules/persona-governance.md +2 -2
- package/dist/agent-src/rules/prefer-enums-over-literals.md +9 -9
- package/dist/agent-src/rules/preservation-guard.md +10 -2
- package/dist/agent-src/rules/question-not-instruction.md +1 -1
- package/dist/agent-src/rules/roadmap-progress-sync.md +6 -6
- package/dist/agent-src/rules/rule-type-governance.md +1 -1
- package/dist/agent-src/rules/scale-discipline.md +1 -1
- package/dist/agent-src/rules/scope-control.md +1 -1
- package/dist/agent-src/rules/secret-vcs-guard.md +1 -1
- package/dist/agent-src/rules/security-sensitive-stop.md +17 -11
- package/dist/agent-src/rules/senior-engineering-discipline.md +17 -17
- package/dist/agent-src/rules/session-canary.md +1 -1
- package/dist/agent-src/rules/skill-quality.md +1 -1
- package/dist/agent-src/rules/source-confidentiality.md +21 -19
- package/dist/agent-src/rules/source-of-truth.md +6 -5
- package/dist/agent-src/rules/spreadsheet-source-quality.md +2 -2
- package/dist/agent-src/rules/strategy-safety-floor.md +1 -1
- package/dist/agent-src/rules/think-before-action.md +5 -5
- package/dist/agent-src/rules/token-budget-discipline.md +5 -3
- package/dist/agent-src/rules/token-efficiency.md +2 -2
- package/dist/agent-src/rules/untrusted-input-defense.md +4 -4
- package/dist/agent-src/rules/user-interaction.md +12 -0
- package/dist/agent-src/rules/verify-before-complete.md +4 -24
- package/dist/agent-src/skills/adversarial-review/SKILL.md +2 -2
- package/dist/agent-src/skills/agent-security-review/SKILL.md +52 -45
- package/dist/agent-src/skills/agents-md-thin-root/SKILL.md +2 -2
- package/dist/agent-src/skills/ai-code-blindspots/SKILL.md +20 -20
- package/dist/agent-src/skills/ai-council/SKILL.md +185 -128
- package/dist/agent-src/skills/analysis-skill-router/SKILL.md +3 -3
- package/dist/agent-src/skills/api-endpoint/SKILL.md +2 -2
- package/dist/agent-src/skills/artisan-commands/SKILL.md +2 -2
- package/dist/agent-src/skills/async-python-patterns/SKILL.md +8 -7
- package/dist/agent-src/skills/authz-review/SKILL.md +16 -15
- package/dist/agent-src/skills/aws-infrastructure/SKILL.md +5 -5
- package/dist/agent-src/skills/blade-ui/SKILL.md +1 -1
- package/dist/agent-src/skills/bug-analyzer/SKILL.md +30 -12
- package/dist/agent-src/skills/code-intelligence/SKILL.md +0 -1
- package/dist/agent-src/skills/code-intelligence/evals/triggers.json +52 -0
- package/dist/agent-src/skills/code-review/SKILL.md +6 -6
- package/dist/agent-src/skills/command-routing/SKILL.md +5 -4
- package/dist/agent-src/skills/composer-packages/SKILL.md +2 -2
- package/dist/agent-src/skills/condense-memory/SKILL.md +43 -41
- package/dist/agent-src/skills/context-document/SKILL.md +23 -21
- package/dist/agent-src/skills/copilot-config/SKILL.md +6 -1
- package/dist/agent-src/skills/decision-record/SKILL.md +20 -18
- package/dist/agent-src/skills/design-intelligence/SKILL.md +4 -4
- package/dist/agent-src/skills/design-review/SKILL.md +15 -14
- package/dist/agent-src/skills/design-system-capture/reference/design-system-json.md +28 -25
- package/dist/agent-src/skills/devcontainer/SKILL.md +2 -2
- package/dist/agent-src/skills/docker/SKILL.md +1 -1
- package/dist/agent-src/skills/docx-authoring/evals/triggers.json +52 -0
- package/dist/agent-src/skills/emit-tickets/SKILL.md +2 -2
- package/dist/agent-src/skills/error-handling-patterns/SKILL.md +1 -1
- package/dist/agent-src/skills/estimate-ticket/SKILL.md +2 -2
- package/dist/agent-src/skills/evaluate-llm-feature/SKILL.md +0 -1
- package/dist/agent-src/skills/evaluate-llm-feature/evals/triggers.json +52 -0
- package/dist/agent-src/skills/existing-ui-audit/SKILL.md +21 -7
- package/dist/agent-src/skills/fe-design/SKILL.md +10 -0
- package/dist/agent-src/skills/feature-planning/SKILL.md +2 -2
- package/dist/agent-src/skills/finishing-a-development-branch/SKILL.md +3 -3
- package/dist/agent-src/skills/flux/SKILL.md +1 -1
- package/dist/agent-src/skills/frontend-render-security/SKILL.md +13 -13
- package/dist/agent-src/skills/git-workflow/SKILL.md +33 -33
- package/dist/agent-src/skills/grafana/SKILL.md +5 -0
- package/dist/agent-src/skills/humanizer/SKILL.md +83 -66
- package/dist/agent-src/skills/humanizer/data/patterns.md +14 -14
- package/dist/agent-src/skills/humanizer/references/anti-aiisms.md +4 -4
- package/dist/agent-src/skills/judge-artifact-completeness/SKILL.md +82 -37
- package/dist/agent-src/skills/judge-bug-hunter/SKILL.md +17 -5
- package/dist/agent-src/skills/judge-injection-defense/SKILL.md +63 -25
- package/dist/agent-src/skills/judge-security-auditor/SKILL.md +2 -0
- package/dist/agent-src/skills/judge-synthesis/SKILL.md +72 -28
- package/dist/agent-src/skills/laravel-horizon/SKILL.md +5 -0
- package/dist/agent-src/skills/laravel-mail/SKILL.md +5 -4
- package/dist/agent-src/skills/laravel-middleware/SKILL.md +5 -4
- package/dist/agent-src/skills/laravel-notifications/SKILL.md +10 -9
- package/dist/agent-src/skills/laravel-pennant/SKILL.md +1 -1
- package/dist/agent-src/skills/laravel-pulse/SKILL.md +9 -8
- package/dist/agent-src/skills/laravel-reverb/SKILL.md +6 -5
- package/dist/agent-src/skills/laravel-scheduling/SKILL.md +6 -1
- package/dist/agent-src/skills/laravel-validation/SKILL.md +12 -0
- package/dist/agent-src/skills/launch-readiness/SKILL.md +1 -1
- package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +7 -7
- package/dist/agent-src/skills/learning-tutor/SKILL.md +44 -43
- package/dist/agent-src/skills/learning-tutor/evals/triggers.json +52 -0
- package/dist/agent-src/skills/license-compliance-audit/SKILL.md +7 -7
- package/dist/agent-src/skills/license-compliance-borrow-check/SKILL.md +3 -3
- package/dist/agent-src/skills/license-compliance-credits/SKILL.md +4 -4
- package/dist/agent-src/skills/llm-provider-knowledge/SKILL.md +0 -1
- package/dist/agent-src/skills/memory-consolidation/SKILL.md +69 -64
- package/dist/agent-src/skills/motion-choreographer/SKILL.md +6 -6
- package/dist/agent-src/skills/pdf-tools/evals/triggers.json +52 -0
- package/dist/agent-src/skills/performance-analysis/SKILL.md +7 -3
- package/dist/agent-src/skills/persona-improvement/SKILL.md +0 -2
- package/dist/agent-src/skills/persona-improvement/evals/triggers.json +52 -0
- package/dist/agent-src/skills/php-coder/SKILL.md +10 -0
- package/dist/agent-src/skills/prediction-pool-optimizer/SKILL.md +129 -120
- package/dist/agent-src/skills/prediction-pool-optimizer/reference/ev-fixtures.md +36 -35
- package/dist/agent-src/skills/prediction-pool-optimizer/reference/odds-and-bonus.md +45 -41
- package/dist/agent-src/skills/project-analysis-core/SKILL.md +4 -4
- package/dist/agent-src/skills/project-analysis-hypothesis-driven/SKILL.md +3 -3
- package/dist/agent-src/skills/project-analysis-react/SKILL.md +1 -1
- package/dist/agent-src/skills/project-analysis-symfony/SKILL.md +1 -1
- package/dist/agent-src/skills/project-analysis-zend-laminas/SKILL.md +2 -2
- package/dist/agent-src/skills/prompt-engineering-patterns/SKILL.md +1 -1
- package/dist/agent-src/skills/prompt-validator/SKILL.md +39 -39
- package/dist/agent-src/skills/quality-tools/SKILL.md +15 -15
- package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +55 -19
- package/dist/agent-src/skills/react-shadcn-ui/reference/registry.md +29 -27
- package/dist/agent-src/skills/readme-writing-package/SKILL.md +2 -2
- package/dist/agent-src/skills/reasoning-orchestrator/SKILL.md +25 -25
- package/dist/agent-src/skills/recursive-verification/SKILL.md +6 -5
- package/dist/agent-src/skills/refine-prompt/SKILL.md +1 -1
- package/dist/agent-src/skills/refine-ticket/SKILL.md +20 -2
- package/dist/agent-src/skills/repomix-packer/SKILL.md +1 -1
- package/dist/agent-src/skills/requesting-code-review/SKILL.md +2 -2
- package/dist/agent-src/skills/roadmap-management/SKILL.md +80 -66
- package/dist/agent-src/skills/roadmap-writing/SKILL.md +84 -77
- package/dist/agent-src/skills/rule-refactor/SKILL.md +1 -1
- package/dist/agent-src/skills/screenshot-hygiene/evals/triggers.json +52 -0
- package/dist/agent-src/skills/security-audit/SKILL.md +26 -9
- package/dist/agent-src/skills/security-maturity-assessment/SKILL.md +38 -16
- package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +14 -11
- package/dist/agent-src/skills/skill-writing/SKILL.md +9 -8
- package/dist/agent-src/skills/song-to-script/SKILL.md +93 -85
- package/dist/agent-src/skills/sql-writing/SKILL.md +2 -2
- package/dist/agent-src/skills/stakeholder-tradeoff/SKILL.md +4 -3
- package/dist/agent-src/skills/standards-from-config/SKILL.md +61 -43
- package/dist/agent-src/skills/subagent-orchestration/SKILL.md +22 -8
- package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +28 -2
- package/dist/agent-src/skills/supply-chain-intake/SKILL.md +13 -13
- package/dist/agent-src/skills/systematic-debugging/SKILL.md +22 -21
- package/dist/agent-src/skills/tailwind-engineer/SKILL.md +1 -1
- package/dist/agent-src/skills/technical-specification/SKILL.md +5 -0
- package/dist/agent-src/skills/terraform/SKILL.md +2 -2
- package/dist/agent-src/skills/terragrunt/SKILL.md +8 -8
- package/dist/agent-src/skills/testing-anti-patterns/process-anti-patterns.md +1 -1
- package/dist/agent-src/skills/threat-modeling/SKILL.md +19 -13
- package/dist/agent-src/skills/universal-project-analysis/SKILL.md +1 -1
- package/dist/agent-src/skills/upstream-contribute/SKILL.md +0 -1
- package/dist/agent-src/skills/using-git-worktrees/SKILL.md +9 -9
- package/dist/agent-src/skills/validate-feature-fit/SKILL.md +3 -1
- package/dist/agent-src/skills/verify-completion-evidence/SKILL.md +4 -6
- package/dist/agent-src/skills/verify-repair-loop/SKILL.md +67 -61
- package/dist/agent-src/skills/video-director/SKILL.md +7 -7
- package/dist/agent-src/skills/worktree-lifecycle/SKILL.md +3 -3
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/contexts/knowledge-pages.md +47 -45
- package/dist/agent-src/templates/contexts/lesson-card.md +2 -2
- package/dist/agent-src/templates/contexts/tenant-boundaries.md +2 -2
- package/dist/agent-src/templates/contexts.md +1 -1
- package/dist/agent-src/templates/features.md +1 -1
- package/dist/agent-src/templates/roadmaps.md +125 -116
- package/dist/agent-src/templates/rule.md +2 -1
- package/dist/agent-src/templates/scripts/pr_risk_review.ts +0 -0
- package/dist/agent-src/templates/scripts/telemetry/aggregator.ts +0 -0
- package/dist/agent-src/templates/scripts/tier_usage_report.ts +2 -2
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +30 -30
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +88 -33
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +22 -2
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +21 -2
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +179 -0
- package/dist/agent-src/templates/scripts/work_engine/stack/detect.ts +155 -4
- package/dist/agent-src/templates/scripts/work_engine/state.ts +21 -4
- package/dist/agent-src/user-types/README.md +8 -8
- package/dist/agent-src/user-types/galabau-field-crew.md +34 -33
- package/dist/agent-src/user-types/metalworking-shop.md +35 -34
- package/dist/agent-src/user-types/truck-driver.md +22 -20
- package/dist/cli/initRouting.js +74 -11
- package/dist/cli/initRouting.js.map +1 -1
- package/dist/cli/main.js +14 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/python/workspace_roles.js +2 -2
- package/dist/cli/python/workspace_roles.js.map +1 -1
- package/dist/cli-delegate/chunk-4SV3XGFA.js +6910 -0
- package/dist/cli-delegate/chunk-736JCWLM.js +1104 -0
- package/dist/cli-delegate/chunk-7DSAMZFU.js +356 -0
- package/dist/cli-delegate/chunk-7HQ52DHU.js +74 -0
- package/dist/cli-delegate/chunk-BJGXZNPM.js +266 -0
- package/dist/cli-delegate/chunk-FTAISGDQ.js +117 -0
- package/dist/cli-delegate/chunk-GME3Q44L.js +82 -0
- package/dist/cli-delegate/chunk-GRRPEPRN.js +336 -0
- package/dist/cli-delegate/chunk-HJ6DAJHR.js +502 -0
- package/dist/cli-delegate/chunk-IR7P7JWA.js +872 -0
- package/dist/cli-delegate/chunk-J55WI3RR.js +47 -0
- package/dist/cli-delegate/chunk-MCJYCQPF.js +35 -0
- package/dist/cli-delegate/chunk-NDJLNC6Q.js +169 -0
- package/dist/cli-delegate/chunk-OMIVVCG2.js +26 -0
- package/dist/cli-delegate/chunk-OY53J6II.js +7336 -0
- package/dist/cli-delegate/chunk-RDGRHAAB.js +259 -0
- package/dist/cli-delegate/chunk-TFG57JJM.js +1969 -0
- package/dist/cli-delegate/chunk-XX6TOPD7.js +715 -0
- package/dist/cli-delegate/chunk-YMFO6FDN.js +10603 -0
- package/dist/cli-delegate/cmd_analyze_session.js +294 -0
- package/dist/cli-delegate/cmd_conformance.js +646 -0
- package/dist/cli-delegate/cmd_converge.js +326 -0
- package/dist/cli-delegate/cmd_doctor.js +144 -0
- package/dist/cli-delegate/cmd_explain.js +2508 -0
- package/dist/cli-delegate/cmd_export.js +296 -0
- package/dist/cli-delegate/cmd_fleet.js +332 -0
- package/dist/cli-delegate/cmd_memory_get.js +3878 -0
- package/dist/cli-delegate/cmd_migrate.js +11 -0
- package/dist/cli-delegate/cmd_preflight.js +270 -0
- package/dist/cli-delegate/cmd_prune.js +444 -0
- package/dist/cli-delegate/cmd_refresh.js +28 -0
- package/dist/cli-delegate/cmd_settings_check.js +574 -0
- package/dist/cli-delegate/cmd_settings_migrate.js +223 -0
- package/dist/cli-delegate/cmd_sync.js +264 -0
- package/dist/cli-delegate/cmd_uninstall.js +656 -0
- package/dist/cli-delegate/cmd_update.js +425 -0
- package/dist/cli-delegate/cmd_upgrade.js +444 -0
- package/dist/cli-delegate/cmd_validate.js +305 -0
- package/dist/cli-delegate/cmd_versions.js +370 -0
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +100 -67
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +4 -4
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +16 -10
- package/dist/discovery/trust-report.md +2 -2
- package/dist/discovery/workspaces.json +7 -5
- package/dist/hooks/dispatch.js +186 -12
- package/dist/install/emit_host_rules_cli.js +2 -1
- package/dist/install/emit_host_rules_cli.js.map +1 -1
- package/dist/install/install.mjs +418 -378
- package/dist/install/rule_scope.js +5 -1
- package/dist/install/rule_scope.js.map +1 -1
- package/dist/install/toolDetection.js +40 -12
- package/dist/install/toolDetection.js.map +1 -1
- package/dist/install/wizard-plan.js +2 -2
- package/dist/install/wizard-plan.js.map +1 -1
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +2194 -1003
- package/dist/router.json +1 -1
- package/dist/scripts/_lib/compile_time_toggles.js +48 -0
- package/dist/scripts/_lib/compile_time_toggles.js.map +1 -0
- package/dist/scripts/condense.js +234 -217
- package/dist/scripts/condense.js.map +1 -1
- package/dist/server/schemas/settings.js +4 -0
- package/dist/server/schemas/settings.js.map +1 -1
- package/dist/shared/userMd/utils.js +30 -0
- package/dist/shared/userMd/utils.js.map +1 -1
- package/dist/ui/assets/index-BpSQt5vm.js.map +1 -1
- package/docs/guidelines/agent-infra/api-cost-levers.md +56 -5
- package/docs/guidelines/agent-infra/simplicity-and-goal-demos.md +93 -33
- package/package.json +4 -2
- package/src/agent-src/templates/scripts/pr_risk_review.ts +0 -0
- package/src/agent-src/templates/scripts/telemetry/aggregator.ts +0 -0
- package/src/agent-src/templates/scripts/tier_usage_report.ts +2 -2
- package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +30 -30
- package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +88 -33
- package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +22 -2
- package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +21 -2
- package/src/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +179 -0
- package/src/agent-src/templates/scripts/work_engine/stack/detect.ts +155 -4
- package/src/agent-src/templates/scripts/work_engine/state.ts +21 -4
- package/src/config/agent-settings.template.yml +32 -2
- package/src/config/ci-local-parity.yml +142 -0
- package/src/config/discovery/packs.yml +7 -0
- package/src/config/evaluator-budgets.json +1 -1
- package/src/config/gate-coverage.yml +127 -0
- package/src/config/pack-size-budget.json +27 -0
- package/src/config/preamble-payload-budget.json +44 -0
- package/src/install/emit_host_rules_cli.ts +2 -1
- package/src/install/rule_scope.ts +5 -1
- package/src/install/toolDetection.ts +39 -8
- package/src/install/wizard-plan.ts +2 -2
- package/src/scripts/_cli/cmd_conformance.ts +2 -1
- package/src/scripts/_cli/cmd_converge.ts +2 -1
- package/src/scripts/_cli/cmd_doctor.ts +292 -15
- package/src/scripts/_cli/cmd_export.ts +2 -1
- package/src/scripts/_cli/cmd_fleet.ts +2 -1
- package/src/scripts/_cli/cmd_migrate.ts +2 -1
- package/src/scripts/_cli/cmd_preflight.ts +2 -1
- package/src/scripts/_cli/cmd_refresh.ts +2 -1
- package/src/scripts/_cli/cmd_update.ts +2 -1
- package/src/scripts/_cli/cmd_upgrade.ts +2 -1
- package/src/scripts/_cli/cmd_versions.ts +2 -1
- package/src/scripts/_cli/detection_report.ts +480 -0
- package/src/scripts/_dispatch.bash +52 -14
- package/src/scripts/_lib/agent_user_profile.ts +381 -0
- package/src/scripts/_lib/agents_overlay.ts +9 -0
- package/src/scripts/_lib/anchor_eval.ts +311 -0
- package/src/scripts/_lib/cc_transcript.ts +316 -0
- package/src/scripts/_lib/changelog_eras.ts +103 -9
- package/src/scripts/_lib/compile_time_toggles.ts +79 -0
- package/src/scripts/_lib/confusables.ts +101 -0
- package/src/scripts/_lib/duplicate_scope_census.ts +77 -0
- package/src/scripts/_lib/environment_detector.ts +441 -0
- package/src/scripts/_lib/managed_agents_folder.ts +181 -0
- package/src/scripts/_lib/package_root.ts +72 -0
- package/src/scripts/_lib/payload_hash_drift.ts +126 -0
- package/src/scripts/_lib/preservation_migration.ts +291 -0
- package/src/scripts/_lib/retrieval_sanitize.ts +166 -2
- package/src/scripts/_lib/scan_scope.ts +115 -0
- package/src/scripts/_lib/user_global_memory_audit.ts +187 -0
- package/src/scripts/_lib/user_global_observations.ts +830 -0
- package/src/scripts/_lib/user_global_revocations.ts +110 -0
- package/src/scripts/_lib/user_memory_gate_counters.ts +291 -0
- package/src/scripts/ai_council/blind_review.ts +0 -0
- package/src/scripts/ai_council/budget_guard.ts +90 -11
- package/src/scripts/ai_council/bundler.ts +2 -2
- package/src/scripts/ai_council/clients.ts +59 -3
- package/src/scripts/ai_council/config.ts +53 -7
- package/src/scripts/ai_council/modes.ts +68 -2
- package/src/scripts/ai_council/orchestrator.ts +54 -9
- package/src/scripts/ai_council/transport_resolver.ts +331 -0
- package/src/scripts/ai_team/team_dispatch.ts +17 -6
- package/src/scripts/anchor_eval_falsify.ts +198 -0
- package/src/scripts/anchor_scoring_run.ts +239 -0
- package/src/scripts/annotate_discovery.ts +1 -65
- package/src/scripts/bench_quality_run.ts +168 -4
- package/src/scripts/cache_realization_report.ts +782 -0
- package/src/scripts/check_artefact_count_messaging.ts +5 -1
- package/src/scripts/check_augment_description_cap.ts +15 -4
- package/src/scripts/check_bundle_path_leakage.ts +10 -4
- package/src/scripts/check_ci_local_parity.ts +317 -0
- package/src/scripts/check_condensation.ts +96 -191
- package/src/scripts/check_context_paths.ts +38 -9
- package/src/scripts/check_dependency_floors.ts +153 -0
- package/src/scripts/check_gate_coverage.ts +299 -0
- package/src/scripts/check_iron_law_prominence.ts +22 -1
- package/src/scripts/check_kernel_prefix_stability.ts +0 -0
- package/src/scripts/check_no_new_legacy_path.ts +16 -6
- package/src/scripts/check_no_roadmap_refs.ts +22 -9
- package/src/scripts/check_originality_freshness.ts +167 -0
- package/src/scripts/check_pack_size.ts +188 -0
- package/src/scripts/check_preamble_payload_budget.ts +130 -0
- package/src/scripts/check_proposal.ts +0 -0
- package/src/scripts/check_references.ts +0 -1
- package/src/scripts/check_safety_floor_untouched.ts +171 -24
- package/src/scripts/check_site_links.ts +62 -3
- package/src/scripts/ci_status.ts +0 -0
- package/src/scripts/cluster_near_miss_patterns.ts +0 -0
- package/src/scripts/code_graph/build.ts +0 -0
- package/src/scripts/command_suggester/types.ts +0 -0
- package/src/scripts/compile_router.ts +10 -14
- package/src/scripts/condense.sh +3 -4
- package/src/scripts/condense.ts +247 -228
- package/src/scripts/cost/track.mjs +168 -33
- package/src/scripts/cost_summary.ts +33 -1
- package/src/scripts/council_cli.ts +51 -5
- package/src/scripts/discovery_graph.ts +0 -0
- package/src/scripts/encoding_corpus.ts +500 -0
- package/src/scripts/encoding_corpus_report.ts +216 -0
- package/src/scripts/evaluator_umbrella.sh +34 -1
- package/src/scripts/generate_index.ts +19 -2
- package/src/scripts/install-hooks.sh +2 -2
- package/src/scripts/learning_sidecar.ts +0 -0
- package/src/scripts/lint_confusables.ts +10 -72
- package/src/scripts/lint_eval_fixture_citations.ts +113 -0
- package/src/scripts/lint_featured_skills.ts +0 -0
- package/src/scripts/lint_hidden_unicode.ts +208 -0
- package/src/scripts/lint_load_context.ts +17 -5
- package/src/scripts/lint_new_skill_gate.ts +9 -3
- package/src/scripts/lint_no_python_twin_rationale.ts +17 -2
- package/src/scripts/lint_originality.ts +1 -1
- package/src/scripts/lint_skill_originality.ts +1 -1
- package/src/scripts/lint_ticket_buildable.ts +1 -1
- package/src/scripts/lint_ui_stack_bundles.ts +170 -0
- package/src/scripts/mcp_server/tools.ts +4 -4
- package/src/scripts/measure_scope_dedup.ts +224 -0
- package/src/scripts/memory_lookup.ts +0 -0
- package/src/scripts/mine_session.ts +98 -0
- package/src/scripts/orchestration_payload_hash_drift.ts +145 -0
- package/src/scripts/preamble_byte_census.ts +574 -0
- package/src/scripts/probe_skill_registration.ts +2 -2
- package/src/scripts/redact_hook_capture.ts +13 -0
- package/src/scripts/release.ts +65 -10
- package/src/scripts/router_telemetry.ts +1 -1
- package/src/scripts/second_brain_retrieval.ts +14 -4
- package/src/scripts/skill_linter.ts +5 -0
- package/src/scripts/surface-tiers.yml +2 -0
- package/src/scripts/validate_pack_yaml.ts +0 -0
- package/src/server/schemas/settings.ts +8 -0
- package/src/shared/userMd/utils.ts +31 -0
- package/dist/agent-src/rules/telegraph-speak.md +0 -87
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
require_dist
|
|
4
|
+
} from "./chunk-OY53J6II.js";
|
|
5
|
+
import {
|
|
6
|
+
__toESM
|
|
7
|
+
} from "./chunk-J55WI3RR.js";
|
|
8
|
+
|
|
9
|
+
// src/install/atomic.ts
|
|
10
|
+
import {
|
|
11
|
+
closeSync,
|
|
12
|
+
fsyncSync,
|
|
13
|
+
mkdirSync,
|
|
14
|
+
openSync,
|
|
15
|
+
readFileSync,
|
|
16
|
+
renameSync,
|
|
17
|
+
unlinkSync,
|
|
18
|
+
writeSync
|
|
19
|
+
} from "node:fs";
|
|
20
|
+
import { dirname, join } from "node:path";
|
|
21
|
+
function atomicWriteFile(target, data, options = {}) {
|
|
22
|
+
const mode = options.mode ?? 420;
|
|
23
|
+
const parent = dirname(target);
|
|
24
|
+
mkdirSync(parent, { recursive: true });
|
|
25
|
+
const tmp = join(parent, `.tmp.${process.pid}.${randSuffix()}`);
|
|
26
|
+
let fd = null;
|
|
27
|
+
try {
|
|
28
|
+
fd = openSync(tmp, "w", mode);
|
|
29
|
+
const buf = typeof data === "string" ? Buffer.from(data, "utf8") : data;
|
|
30
|
+
writeSync(fd, buf, 0, buf.length, 0);
|
|
31
|
+
fsyncSync(fd);
|
|
32
|
+
closeSync(fd);
|
|
33
|
+
fd = null;
|
|
34
|
+
renameSync(tmp, target);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
if (fd !== null) {
|
|
37
|
+
try {
|
|
38
|
+
closeSync(fd);
|
|
39
|
+
} catch {
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
unlinkSync(tmp);
|
|
44
|
+
} catch {
|
|
45
|
+
}
|
|
46
|
+
throw err;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function atomicAppendLine(target, line) {
|
|
50
|
+
let existing = "";
|
|
51
|
+
try {
|
|
52
|
+
existing = readFileSync(target, "utf8");
|
|
53
|
+
} catch {
|
|
54
|
+
existing = "";
|
|
55
|
+
}
|
|
56
|
+
const sep = existing.length > 0 && !existing.endsWith("\n") ? "\n" : "";
|
|
57
|
+
atomicWriteFile(target, `${existing}${sep}${line}
|
|
58
|
+
`);
|
|
59
|
+
}
|
|
60
|
+
function randSuffix() {
|
|
61
|
+
return Math.floor(Math.random() * 281474976710655).toString(16).padStart(12, "0");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// src/scripts/_lib/claude_settings_hooks.ts
|
|
65
|
+
var YAML = __toESM(require_dist(), 1);
|
|
66
|
+
import * as fs from "node:fs";
|
|
67
|
+
import * as path from "node:path";
|
|
68
|
+
function _yaml_parse(text) {
|
|
69
|
+
return YAML.parse(text);
|
|
70
|
+
}
|
|
71
|
+
var MANAGED_SIGNATURE = "dispatch:hook --platform claude";
|
|
72
|
+
var CorruptSettingsError = class extends Error {
|
|
73
|
+
constructor(file, cause) {
|
|
74
|
+
super(
|
|
75
|
+
`${file} exists but is not valid JSON (${cause}). Refusing to overwrite a user-owned settings file \u2014 fix or remove it, then re-run.`
|
|
76
|
+
);
|
|
77
|
+
this.name = "CorruptSettingsError";
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
var SettingsLockError = class extends Error {
|
|
81
|
+
constructor(lockPath) {
|
|
82
|
+
super(
|
|
83
|
+
`settings lock ${lockPath} is held by another process. Re-run when the concurrent install finishes (stale lock: delete the file).`
|
|
84
|
+
);
|
|
85
|
+
this.name = "SettingsLockError";
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
function build_claude_hook_matrix(manifest_path) {
|
|
89
|
+
const raw = fs.readFileSync(manifest_path, "utf8");
|
|
90
|
+
const manifest = _yaml_parse(raw) ?? {};
|
|
91
|
+
const hook_spec = manifest["schema_version"] ?? 1;
|
|
92
|
+
const platforms = manifest["platforms"] ?? {};
|
|
93
|
+
const claude_events = (platforms["claude"] ?? {}) || {};
|
|
94
|
+
const aliasesAll = manifest["native_event_aliases"] ?? {};
|
|
95
|
+
const aliases = (aliasesAll["claude"] ?? {}) || {};
|
|
96
|
+
const ac_to_native = {};
|
|
97
|
+
for (const [native, ac] of Object.entries(aliases)) {
|
|
98
|
+
ac_to_native[String(ac)] = native;
|
|
99
|
+
}
|
|
100
|
+
const matrix = {};
|
|
101
|
+
for (const [ac_event, concerns] of Object.entries(claude_events)) {
|
|
102
|
+
if (!concerns || Array.isArray(concerns) && concerns.length === 0) continue;
|
|
103
|
+
const native = ac_to_native[ac_event];
|
|
104
|
+
if (native === void 0) continue;
|
|
105
|
+
matrix[native] = `BIN="$CLAUDE_PROJECT_DIR/agent-config"; [ -x "$BIN" ] || BIN=agent-config; command -v "$BIN" >/dev/null 2>&1 || exit 0; "$BIN" dispatch:hook --platform claude --event ${ac_event} --native-event ${native} --project-dir "$CLAUDE_PROJECT_DIR" --min-version ${String(hook_spec)}`;
|
|
106
|
+
}
|
|
107
|
+
return matrix;
|
|
108
|
+
}
|
|
109
|
+
function _is_managed_group(group) {
|
|
110
|
+
if (typeof group !== "object" || group === null || Array.isArray(group)) return false;
|
|
111
|
+
const hooks = group.hooks;
|
|
112
|
+
if (!Array.isArray(hooks)) return false;
|
|
113
|
+
return hooks.some(
|
|
114
|
+
(h) => typeof h === "object" && h !== null && typeof h.command === "string" && h.command.includes(MANAGED_SIGNATURE)
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
function _read_settings(settings_path) {
|
|
118
|
+
if (!fs.existsSync(settings_path)) return {};
|
|
119
|
+
const raw = fs.readFileSync(settings_path, "utf8");
|
|
120
|
+
if (raw.trim() === "") return {};
|
|
121
|
+
let parsed;
|
|
122
|
+
try {
|
|
123
|
+
parsed = JSON.parse(raw);
|
|
124
|
+
} catch (e) {
|
|
125
|
+
throw new CorruptSettingsError(settings_path, e.message);
|
|
126
|
+
}
|
|
127
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
128
|
+
throw new CorruptSettingsError(settings_path, "top level is not an object");
|
|
129
|
+
}
|
|
130
|
+
return parsed;
|
|
131
|
+
}
|
|
132
|
+
function _with_lock(settings_path, fn) {
|
|
133
|
+
const lockPath = settings_path + ".agent-config.lock";
|
|
134
|
+
fs.mkdirSync(path.dirname(lockPath), { recursive: true });
|
|
135
|
+
let fd;
|
|
136
|
+
try {
|
|
137
|
+
fd = fs.openSync(lockPath, "wx");
|
|
138
|
+
} catch {
|
|
139
|
+
throw new SettingsLockError(lockPath);
|
|
140
|
+
}
|
|
141
|
+
try {
|
|
142
|
+
return fn();
|
|
143
|
+
} finally {
|
|
144
|
+
fs.closeSync(fd);
|
|
145
|
+
fs.rmSync(lockPath, { force: true });
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function ensure_managed_hooks(settings_path, matrix) {
|
|
149
|
+
return _with_lock(settings_path, () => {
|
|
150
|
+
const settings = _read_settings(settings_path);
|
|
151
|
+
const before = JSON.stringify(settings);
|
|
152
|
+
const hooks = (settings["hooks"] ?? {}) || {};
|
|
153
|
+
const touched = [];
|
|
154
|
+
for (const [native, command] of Object.entries(matrix)) {
|
|
155
|
+
const existing = Array.isArray(hooks[native]) ? hooks[native] : [];
|
|
156
|
+
const user_groups = existing.filter((g) => !_is_managed_group(g));
|
|
157
|
+
const managed_group = {
|
|
158
|
+
hooks: [{ type: "command", command }]
|
|
159
|
+
};
|
|
160
|
+
const next = [...user_groups, managed_group];
|
|
161
|
+
if (JSON.stringify(next) !== JSON.stringify(existing)) touched.push(native);
|
|
162
|
+
hooks[native] = next;
|
|
163
|
+
}
|
|
164
|
+
settings["hooks"] = hooks;
|
|
165
|
+
const after = JSON.stringify(settings);
|
|
166
|
+
if (after === before) {
|
|
167
|
+
return { changed: false, events: [] };
|
|
168
|
+
}
|
|
169
|
+
atomicWriteFile(settings_path, JSON.stringify(settings, null, 2) + "\n");
|
|
170
|
+
return { changed: true, events: touched };
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
function remove_managed_hooks(settings_path) {
|
|
174
|
+
if (!fs.existsSync(settings_path)) return { changed: false, events: [] };
|
|
175
|
+
return _with_lock(settings_path, () => {
|
|
176
|
+
const settings = _read_settings(settings_path);
|
|
177
|
+
const hooks = settings["hooks"];
|
|
178
|
+
if (typeof hooks !== "object" || hooks === null || Array.isArray(hooks)) {
|
|
179
|
+
return { changed: false, events: [] };
|
|
180
|
+
}
|
|
181
|
+
const hooksRec = hooks;
|
|
182
|
+
const touched = [];
|
|
183
|
+
for (const [native, groups] of Object.entries(hooksRec)) {
|
|
184
|
+
if (!Array.isArray(groups)) continue;
|
|
185
|
+
const kept = groups.filter((g) => !_is_managed_group(g));
|
|
186
|
+
if (kept.length !== groups.length) {
|
|
187
|
+
touched.push(native);
|
|
188
|
+
if (kept.length === 0) {
|
|
189
|
+
delete hooksRec[native];
|
|
190
|
+
} else {
|
|
191
|
+
hooksRec[native] = kept;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (touched.length === 0) return { changed: false, events: [] };
|
|
196
|
+
if (Object.keys(hooksRec).length === 0) {
|
|
197
|
+
delete settings["hooks"];
|
|
198
|
+
}
|
|
199
|
+
atomicWriteFile(settings_path, JSON.stringify(settings, null, 2) + "\n");
|
|
200
|
+
return { changed: true, events: touched };
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// src/scripts/_lib/claude_builtin_names.ts
|
|
205
|
+
var _CURRENT = [
|
|
206
|
+
"add-dir",
|
|
207
|
+
"advisor",
|
|
208
|
+
"agents",
|
|
209
|
+
"autofix-pr",
|
|
210
|
+
"background",
|
|
211
|
+
"batch",
|
|
212
|
+
"branch",
|
|
213
|
+
"btw",
|
|
214
|
+
"cd",
|
|
215
|
+
"chrome",
|
|
216
|
+
"claude-api",
|
|
217
|
+
"clear",
|
|
218
|
+
"code-review",
|
|
219
|
+
"color",
|
|
220
|
+
"compact",
|
|
221
|
+
"config",
|
|
222
|
+
"context",
|
|
223
|
+
"copy",
|
|
224
|
+
"cost",
|
|
225
|
+
"dataviz",
|
|
226
|
+
"debug",
|
|
227
|
+
"deep-research",
|
|
228
|
+
"design-login",
|
|
229
|
+
"design-sync",
|
|
230
|
+
"desktop",
|
|
231
|
+
"diff",
|
|
232
|
+
"doctor",
|
|
233
|
+
"effort",
|
|
234
|
+
"exit",
|
|
235
|
+
"export",
|
|
236
|
+
"fast",
|
|
237
|
+
"feedback",
|
|
238
|
+
"fewer-permission-prompts",
|
|
239
|
+
"focus",
|
|
240
|
+
"fork",
|
|
241
|
+
"goal",
|
|
242
|
+
"heapdump",
|
|
243
|
+
"help",
|
|
244
|
+
"hooks",
|
|
245
|
+
"ide",
|
|
246
|
+
"init",
|
|
247
|
+
"insights",
|
|
248
|
+
"install-github-app",
|
|
249
|
+
"install-slack-app",
|
|
250
|
+
"keybindings",
|
|
251
|
+
"login",
|
|
252
|
+
"logout",
|
|
253
|
+
"loop",
|
|
254
|
+
"mcp",
|
|
255
|
+
"memory",
|
|
256
|
+
"mobile",
|
|
257
|
+
"model",
|
|
258
|
+
"passes",
|
|
259
|
+
"permissions",
|
|
260
|
+
"plan",
|
|
261
|
+
"plugin",
|
|
262
|
+
"powerup",
|
|
263
|
+
"pr-comments",
|
|
264
|
+
"privacy-settings",
|
|
265
|
+
"radio",
|
|
266
|
+
"recap",
|
|
267
|
+
"release-notes",
|
|
268
|
+
"reload-plugins",
|
|
269
|
+
"reload-skills",
|
|
270
|
+
"remote-control",
|
|
271
|
+
"remote-env",
|
|
272
|
+
"rename",
|
|
273
|
+
"resume",
|
|
274
|
+
"review",
|
|
275
|
+
"rewind",
|
|
276
|
+
"run",
|
|
277
|
+
"run-skill-generator",
|
|
278
|
+
"sandbox",
|
|
279
|
+
"schedule",
|
|
280
|
+
"scroll-speed",
|
|
281
|
+
"security-review",
|
|
282
|
+
"setup-bedrock",
|
|
283
|
+
"setup-vertex",
|
|
284
|
+
"simplify",
|
|
285
|
+
"skills",
|
|
286
|
+
"stats",
|
|
287
|
+
"status",
|
|
288
|
+
"statusline",
|
|
289
|
+
"stickers",
|
|
290
|
+
"teleport",
|
|
291
|
+
"thinking",
|
|
292
|
+
"trust",
|
|
293
|
+
"upgrade",
|
|
294
|
+
"usage",
|
|
295
|
+
"verify",
|
|
296
|
+
"vim",
|
|
297
|
+
"web",
|
|
298
|
+
"whats-new",
|
|
299
|
+
"workflow",
|
|
300
|
+
"workflows",
|
|
301
|
+
"worktree"
|
|
302
|
+
];
|
|
303
|
+
var _LEGACY = [
|
|
304
|
+
"bashes",
|
|
305
|
+
"bug",
|
|
306
|
+
"migrate-installer",
|
|
307
|
+
"output-style",
|
|
308
|
+
"terminal-setup",
|
|
309
|
+
"theme",
|
|
310
|
+
"todos"
|
|
311
|
+
];
|
|
312
|
+
var CLAUDE_CODE_BUILTIN_NAMES = /* @__PURE__ */ new Set([
|
|
313
|
+
..._CURRENT,
|
|
314
|
+
..._LEGACY
|
|
315
|
+
]);
|
|
316
|
+
function is_claude_builtin_name(slug) {
|
|
317
|
+
return CLAUDE_CODE_BUILTIN_NAMES.has(slug.toLowerCase());
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// src/scripts/_lib/model_tier.ts
|
|
321
|
+
import fs2 from "node:fs";
|
|
322
|
+
var TIER_TO_CLAUDE_MODEL = {
|
|
323
|
+
high: "opus",
|
|
324
|
+
medium: "sonnet",
|
|
325
|
+
lite: "haiku"
|
|
326
|
+
};
|
|
327
|
+
var MODEL_TIER_RE = /^model_tier:\s*"?([a-z]+)"?\s*$/m;
|
|
328
|
+
function read_model_tier(skill_md) {
|
|
329
|
+
if (!fs2.existsSync(skill_md)) return null;
|
|
330
|
+
const text = fs2.readFileSync(skill_md).toString("utf-8");
|
|
331
|
+
if (!text.startsWith("---\n")) return null;
|
|
332
|
+
const end = text.indexOf("\n---\n", 4);
|
|
333
|
+
if (end === -1) return null;
|
|
334
|
+
const m = MODEL_TIER_RE.exec(text.slice(4, end));
|
|
335
|
+
return m ? m[1] : null;
|
|
336
|
+
}
|
|
337
|
+
function render_native_model_md(text, tier) {
|
|
338
|
+
const model = TIER_TO_CLAUDE_MODEL[tier];
|
|
339
|
+
if (model === void 0) {
|
|
340
|
+
throw new Error(`'${tier}'`);
|
|
341
|
+
}
|
|
342
|
+
return text.replace(MODEL_TIER_RE, `model: ${model}`);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export {
|
|
346
|
+
atomicAppendLine,
|
|
347
|
+
MANAGED_SIGNATURE,
|
|
348
|
+
build_claude_hook_matrix,
|
|
349
|
+
ensure_managed_hooks,
|
|
350
|
+
remove_managed_hooks,
|
|
351
|
+
is_claude_builtin_name,
|
|
352
|
+
TIER_TO_CLAUDE_MODEL,
|
|
353
|
+
MODEL_TIER_RE,
|
|
354
|
+
read_model_tier,
|
|
355
|
+
render_native_model_md
|
|
356
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
write_target
|
|
4
|
+
} from "./chunk-NDJLNC6Q.js";
|
|
5
|
+
|
|
6
|
+
// src/scripts/_lib/update_check.ts
|
|
7
|
+
var PACKAGE_NAME = "@event4u/agent-config";
|
|
8
|
+
var NPM_REGISTRY_URL = `https://registry.npmjs.org/${PACKAGE_NAME}/latest`;
|
|
9
|
+
var FETCH_TIMEOUT_S = 1;
|
|
10
|
+
var CHECK_WINDOW_MS = 24 * 60 * 60 * 1e3;
|
|
11
|
+
var STATE_FILENAME = "update-check.json";
|
|
12
|
+
var DEFAULT_STATE_PATH = write_target(STATE_FILENAME);
|
|
13
|
+
async function fetch_latest_from_npm(options = {}) {
|
|
14
|
+
const timeout = options.timeout ?? FETCH_TIMEOUT_S;
|
|
15
|
+
const url = options.url ?? NPM_REGISTRY_URL;
|
|
16
|
+
const fetch_impl = options.fetch_impl ?? fetch;
|
|
17
|
+
try {
|
|
18
|
+
const resp = await fetch_impl(url, {
|
|
19
|
+
headers: {
|
|
20
|
+
Accept: "application/json",
|
|
21
|
+
"User-Agent": "agent-config-update-check"
|
|
22
|
+
},
|
|
23
|
+
signal: AbortSignal.timeout(timeout * 1e3)
|
|
24
|
+
});
|
|
25
|
+
const payload = await resp.json();
|
|
26
|
+
if (payload !== null && typeof payload === "object" && !Array.isArray(payload)) {
|
|
27
|
+
const version = payload.version;
|
|
28
|
+
if (typeof version === "string" && version.trim()) {
|
|
29
|
+
return version.trim();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
} catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
function _int_or_zero(part) {
|
|
38
|
+
const trimmed = part.trim();
|
|
39
|
+
if (/^[+-]?\d+$/.test(trimmed)) {
|
|
40
|
+
return parseInt(trimmed, 10);
|
|
41
|
+
}
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
function _is_newer(latest, installed) {
|
|
45
|
+
const parse = (v) => {
|
|
46
|
+
const core = v.replace(/^v+/, "").split("-")[0] ?? "";
|
|
47
|
+
const parts = core.split(".");
|
|
48
|
+
const out = [];
|
|
49
|
+
for (const p of parts.slice(0, 3)) {
|
|
50
|
+
out.push(_int_or_zero(p));
|
|
51
|
+
}
|
|
52
|
+
while (out.length < 3) {
|
|
53
|
+
out.push(0);
|
|
54
|
+
}
|
|
55
|
+
return [out[0], out[1], out[2]];
|
|
56
|
+
};
|
|
57
|
+
const a = parse(latest);
|
|
58
|
+
const b = parse(installed);
|
|
59
|
+
for (let i = 0; i < 3; i += 1) {
|
|
60
|
+
if (a[i] > b[i]) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
if (a[i] < b[i]) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export {
|
|
71
|
+
DEFAULT_STATE_PATH,
|
|
72
|
+
fetch_latest_from_npm,
|
|
73
|
+
_is_newer
|
|
74
|
+
};
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/scripts/_lib/agent_src.ts
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
|
+
import * as path from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
var _HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
var _DEFAULT_ROOT = path.resolve(_HERE, "..", "..", "..");
|
|
9
|
+
function _deriveRoots(root) {
|
|
10
|
+
const packages = path.join(root, "packages");
|
|
11
|
+
const src = path.join(root, "src");
|
|
12
|
+
return {
|
|
13
|
+
ROOT: root,
|
|
14
|
+
LEGACY_SRC: path.join(root, ".agent-src.uncondensed"),
|
|
15
|
+
PACKAGES: packages,
|
|
16
|
+
PACKAGE_CORE: path.join(packages, "core"),
|
|
17
|
+
SRC: src,
|
|
18
|
+
SRC_SKILLS: path.join(src, "skills"),
|
|
19
|
+
SRC_RULES: path.join(src, "rules"),
|
|
20
|
+
SRC_AGENT: path.join(src, "agent-src"),
|
|
21
|
+
SRC_DOMAINS: path.join(src, "domains")
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
var _roots = _deriveRoots(_DEFAULT_ROOT);
|
|
25
|
+
var _SRC_DOMAINS_PREFIX = "src/domains/";
|
|
26
|
+
function _isDir(p) {
|
|
27
|
+
try {
|
|
28
|
+
return fs.statSync(p).isDirectory();
|
|
29
|
+
} catch {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function _isFile(p) {
|
|
34
|
+
try {
|
|
35
|
+
return fs.statSync(p).isFile();
|
|
36
|
+
} catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function _exists(p) {
|
|
41
|
+
try {
|
|
42
|
+
fs.statSync(p);
|
|
43
|
+
return true;
|
|
44
|
+
} catch {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function _iterdirSorted(p) {
|
|
49
|
+
let names;
|
|
50
|
+
try {
|
|
51
|
+
names = fs.readdirSync(p);
|
|
52
|
+
} catch {
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
55
|
+
names.sort();
|
|
56
|
+
return names.map((name) => path.join(p, name));
|
|
57
|
+
}
|
|
58
|
+
function _rglobSorted(root, pattern) {
|
|
59
|
+
const out = [];
|
|
60
|
+
const suffix = pattern === "*" ? null : pattern.slice(1);
|
|
61
|
+
const walk = (dir) => {
|
|
62
|
+
let entries;
|
|
63
|
+
try {
|
|
64
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
65
|
+
} catch {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
for (const ent of entries) {
|
|
69
|
+
const full = path.join(dir, ent.name);
|
|
70
|
+
const matches = suffix === null ? true : ent.name.endsWith(suffix);
|
|
71
|
+
if (matches) {
|
|
72
|
+
out.push(full);
|
|
73
|
+
}
|
|
74
|
+
if (ent.isDirectory() || ent.isSymbolicLink() && _isDir(full)) {
|
|
75
|
+
walk(full);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
walk(root);
|
|
80
|
+
out.sort();
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
function _relativeToPosix(child, root) {
|
|
84
|
+
const rel = path.relative(root, child);
|
|
85
|
+
return rel.split(path.sep).join("/");
|
|
86
|
+
}
|
|
87
|
+
function _isUnder(child, root) {
|
|
88
|
+
const rel = path.relative(root, child);
|
|
89
|
+
return rel !== "" && !rel.startsWith("..") && !path.isAbsolute(rel);
|
|
90
|
+
}
|
|
91
|
+
function _domains_command_logical(p) {
|
|
92
|
+
const dom = _roots.SRC_DOMAINS;
|
|
93
|
+
if (p !== dom && !_isUnder(p, dom)) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
const rel = _relativeToPosix(p, dom);
|
|
97
|
+
const parts = rel.split("/");
|
|
98
|
+
if (parts.length < 3 || parts[parts.length - 1] !== "command.md") {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
const subpath = parts.slice(1, -1).join("/");
|
|
102
|
+
return `commands/${subpath}.md`;
|
|
103
|
+
}
|
|
104
|
+
function* _iter_domains_commands() {
|
|
105
|
+
const dom = _roots.SRC_DOMAINS;
|
|
106
|
+
if (!_isDir(dom)) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
for (const p of _rglobSorted(dom, "command.md")) {
|
|
110
|
+
if (!_isFile(p)) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
const logical = _domains_command_logical(p);
|
|
114
|
+
if (logical !== null) {
|
|
115
|
+
yield [p, logical];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
var _LEGACY_PREFIX = ".agent-src.uncondensed/";
|
|
120
|
+
var _PACKAGE_SUFFIX = "/.agent-src.uncondensed/";
|
|
121
|
+
var _SRC_SKILLS_PREFIX = "src/skills/";
|
|
122
|
+
var _SRC_RULES_PREFIX = "src/rules/";
|
|
123
|
+
function _root_specs() {
|
|
124
|
+
const specs = [];
|
|
125
|
+
if (_exists(_roots.LEGACY_SRC)) {
|
|
126
|
+
specs.push([_roots.LEGACY_SRC, ""]);
|
|
127
|
+
}
|
|
128
|
+
if (_exists(_roots.PACKAGES)) {
|
|
129
|
+
for (const pkg of _iterdirSorted(_roots.PACKAGES)) {
|
|
130
|
+
const sub = path.join(pkg, ".agent-src.uncondensed");
|
|
131
|
+
if (_isDir(sub)) {
|
|
132
|
+
specs.push([sub, ""]);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (_isDir(_roots.SRC_AGENT)) {
|
|
137
|
+
specs.push([_roots.SRC_AGENT, ""]);
|
|
138
|
+
}
|
|
139
|
+
if (_isDir(_roots.SRC_SKILLS)) {
|
|
140
|
+
specs.push([_roots.SRC_SKILLS, "skills/"]);
|
|
141
|
+
}
|
|
142
|
+
if (_isDir(_roots.SRC_RULES)) {
|
|
143
|
+
specs.push([_roots.SRC_RULES, "rules/"]);
|
|
144
|
+
}
|
|
145
|
+
const seen = /* @__PURE__ */ new Map();
|
|
146
|
+
for (const [physical, prefix] of specs) {
|
|
147
|
+
if (!prefix) {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
const claimedBy = seen.get(prefix);
|
|
151
|
+
if (claimedBy !== void 0) {
|
|
152
|
+
throw new Error(
|
|
153
|
+
`source-root logical-prefix collision: ${JSON.stringify(prefix)} claimed by both ${claimedBy} and ${physical}`
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
seen.set(prefix, physical);
|
|
157
|
+
}
|
|
158
|
+
return specs;
|
|
159
|
+
}
|
|
160
|
+
function artefact_roots() {
|
|
161
|
+
const roots = [];
|
|
162
|
+
if (_exists(_roots.LEGACY_SRC)) {
|
|
163
|
+
roots.push(_roots.LEGACY_SRC);
|
|
164
|
+
}
|
|
165
|
+
if (_exists(_roots.PACKAGES)) {
|
|
166
|
+
for (const pkg of _iterdirSorted(_roots.PACKAGES)) {
|
|
167
|
+
const sub = path.join(pkg, ".agent-src.uncondensed");
|
|
168
|
+
if (_isDir(sub)) {
|
|
169
|
+
roots.push(sub);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (_isDir(_roots.SRC_AGENT)) {
|
|
174
|
+
roots.push(_roots.SRC_AGENT);
|
|
175
|
+
}
|
|
176
|
+
if (_isDir(_roots.SRC_SKILLS) || _isDir(_roots.SRC_RULES)) {
|
|
177
|
+
roots.push(_roots.SRC);
|
|
178
|
+
}
|
|
179
|
+
return roots;
|
|
180
|
+
}
|
|
181
|
+
function* iter_all_sources() {
|
|
182
|
+
const seen = /* @__PURE__ */ new Set();
|
|
183
|
+
for (const [root, prefix] of _root_specs()) {
|
|
184
|
+
for (const p of _rglobSorted(root, "*")) {
|
|
185
|
+
if (!_isFile(p)) {
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
if (p !== root && !_isUnder(p, root)) {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
const rel = prefix + _relativeToPosix(p, root);
|
|
192
|
+
if (seen.has(rel)) {
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
seen.add(rel);
|
|
196
|
+
yield [p, rel];
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
for (const [p, rel] of _iter_domains_commands()) {
|
|
200
|
+
if (seen.has(rel)) {
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
seen.add(rel);
|
|
204
|
+
yield [p, rel];
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function resolve_logical(logical_rel) {
|
|
208
|
+
const rel = logical_rel.replaceAll("\\", "/").replace(/^\/+/, "");
|
|
209
|
+
for (const [root, prefix] of _root_specs()) {
|
|
210
|
+
let p;
|
|
211
|
+
if (prefix) {
|
|
212
|
+
if (!rel.startsWith(prefix)) {
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
p = path.join(root, rel.slice(prefix.length));
|
|
216
|
+
} else {
|
|
217
|
+
p = path.join(root, rel);
|
|
218
|
+
}
|
|
219
|
+
if (_exists(p)) {
|
|
220
|
+
return p;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (rel.startsWith("commands/") && rel.endsWith(".md") && _isDir(_roots.SRC_DOMAINS)) {
|
|
224
|
+
const subpath = rel.slice("commands/".length, rel.length - ".md".length);
|
|
225
|
+
for (const packDir of _iterdirSorted(_roots.SRC_DOMAINS)) {
|
|
226
|
+
const cand = path.join(packDir, subpath, "command.md");
|
|
227
|
+
if (_isFile(cand)) {
|
|
228
|
+
return cand;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
234
|
+
function strip_source_prefix(rel) {
|
|
235
|
+
const posix = rel.replaceAll("\\", "/");
|
|
236
|
+
if (posix.startsWith(_LEGACY_PREFIX)) {
|
|
237
|
+
return posix.slice(_LEGACY_PREFIX.length);
|
|
238
|
+
}
|
|
239
|
+
if (posix.startsWith("packages/")) {
|
|
240
|
+
const idx = posix.indexOf(_PACKAGE_SUFFIX);
|
|
241
|
+
if (idx !== -1) {
|
|
242
|
+
return posix.slice(idx + _PACKAGE_SUFFIX.length);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (posix.startsWith(_SRC_SKILLS_PREFIX)) {
|
|
246
|
+
return `skills/${posix.slice(_SRC_SKILLS_PREFIX.length)}`;
|
|
247
|
+
}
|
|
248
|
+
if (posix.startsWith(_SRC_RULES_PREFIX)) {
|
|
249
|
+
return `rules/${posix.slice(_SRC_RULES_PREFIX.length)}`;
|
|
250
|
+
}
|
|
251
|
+
if (posix.startsWith(_SRC_DOMAINS_PREFIX) && posix.endsWith("/command.md")) {
|
|
252
|
+
const rest = posix.slice(_SRC_DOMAINS_PREFIX.length);
|
|
253
|
+
const parts = rest.split("/");
|
|
254
|
+
if (parts.length >= 3) {
|
|
255
|
+
return `commands/${parts.slice(1, -1).join("/")}.md`;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return null;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export {
|
|
262
|
+
artefact_roots,
|
|
263
|
+
iter_all_sources,
|
|
264
|
+
resolve_logical,
|
|
265
|
+
strip_source_prefix
|
|
266
|
+
};
|