@event4u/agent-config 14.12.0 → 14.14.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/.augment-plugin/marketplace.json +3 -3
- package/.augment-plugin/plugin.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +118 -155
- package/CONTRIBUTING.md +38 -0
- package/CREDITS.md +135 -0
- package/NOTICE +13 -0
- package/README.md +8 -6
- package/dist/agent-src/commands/analyze/inbox.md +145 -2
- package/dist/agent-src/commands/feature/dev.md +7 -2
- package/dist/agent-src/commands/ghostwriter/write.md +5 -1
- package/dist/agent-src/commands/implement-ticket.md +1 -1
- package/dist/agent-src/commands/mission/upgrade.md +1 -1
- package/dist/agent-src/commands/orchestrate.md +2 -2
- package/dist/agent-src/commands/post-as/me.md +5 -1
- package/dist/agent-src/commands/pr/merge.md +19 -6
- package/dist/agent-src/commands/roadmap/process-full.md +19 -5
- package/dist/agent-src/commands/tdd/red.md +12 -2
- package/dist/agent-src/commands/work.md +1 -1
- package/dist/agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +40 -0
- package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +5 -2
- package/dist/agent-src/contexts/execution/autonomy-mechanics.md +21 -0
- package/dist/agent-src/contexts/execution/orchestration-telemetry.md +1 -0
- package/dist/agent-src/contexts/execution/subagent-response-contract.md +40 -0
- package/dist/agent-src/contexts/execution/subagent-steering.md +13 -1
- package/dist/agent-src/contexts/execution/terminal-states.md +96 -0
- package/dist/agent-src/rules/artifact-drafting-protocol.md +1 -1
- package/dist/agent-src/rules/broken-access-control.md +4 -0
- package/dist/agent-src/rules/code-comment-discipline.md +6 -0
- package/dist/agent-src/rules/code-provenance.md +4 -0
- package/dist/agent-src/rules/design-fidelity.md +1 -1
- package/dist/agent-src/rules/domain-safety-pii.md +4 -0
- package/dist/agent-src/rules/domain-safety-retention.md +4 -0
- package/dist/agent-src/rules/engineering-safety-floor.md +2 -0
- package/dist/agent-src/rules/external-code-graph-interop.md +14 -12
- package/dist/agent-src/rules/improve-before-implement.md +6 -8
- package/dist/agent-src/rules/laravel-routing.md +1 -1
- package/dist/agent-src/rules/lethal-trifecta-guard.md +4 -0
- package/dist/agent-src/rules/secret-vcs-guard.md +2 -0
- package/dist/agent-src/rules/security-sensitive-stop.md +2 -0
- package/dist/agent-src/rules/source-confidentiality.md +12 -34
- package/dist/agent-src/rules/symfony-routing.md +1 -1
- package/dist/agent-src/rules/token-efficiency.md +14 -0
- package/dist/agent-src/rules/tool-safety.md +4 -0
- package/dist/agent-src/rules/untrusted-input-defense.md +4 -0
- package/dist/agent-src/scripts/archive_completed_roadmaps.ts +252 -8
- package/dist/agent-src/scripts/guarded_baseline.ts +343 -0
- package/dist/agent-src/scripts/roadmap_set_step.ts +253 -0
- package/dist/agent-src/scripts/stub_queue.ts +82 -0
- package/dist/agent-src/scripts/stubs_due.ts +516 -0
- package/dist/agent-src/scripts/ticket_bundles.ts +84 -0
- package/dist/agent-src/scripts/update_roadmap_progress.ts +16 -12
- package/dist/agent-src/skills/brand-asset-generation/SKILL.md +17 -4
- package/dist/agent-src/skills/brand-audit/SKILL.md +33 -0
- package/dist/agent-src/skills/code-intelligence/SKILL.md +57 -0
- package/dist/agent-src/skills/database/SKILL.md +8 -0
- package/dist/agent-src/skills/dependency-upgrade/SKILL.md +27 -0
- package/dist/agent-src/skills/design-review/SKILL.md +1 -1
- package/dist/agent-src/skills/doc-coauthoring/SKILL.md +1 -1
- package/dist/agent-src/skills/existing-ui-audit/SKILL.md +17 -1
- package/dist/agent-src/skills/feature-planning/SKILL.md +9 -2
- package/dist/agent-src/skills/frontend-render-security/SKILL.md +44 -0
- package/dist/agent-src/skills/git-workflow/SKILL.md +1 -1
- package/dist/agent-src/skills/js-library-packaging/scripts/check_package_surface.ts +38 -4
- package/dist/agent-src/skills/judge-artifact-completeness/rubrics/ticket-quality-score.json +2 -2
- package/dist/agent-src/skills/laravel/SKILL.md +35 -0
- package/dist/agent-src/skills/laravel-migration/SKILL.md +57 -3
- package/dist/agent-src/skills/monorepo-workspace/SKILL.md +26 -0
- package/dist/agent-src/skills/playbook-authoring/SKILL.md +28 -1
- package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +1 -1
- package/dist/agent-src/skills/skill-writing/references/procedure.md +5 -5
- package/dist/agent-src/skills/sql-writing/SKILL.md +7 -1
- package/dist/agent-src/skills/standards-from-config/SKILL.md +27 -4
- package/dist/agent-src/skills/supply-chain-intake/SKILL.md +11 -4
- package/dist/agent-src/skills/symfony-workflow/SKILL.md +35 -0
- package/dist/agent-src/skills/test-case-discovery/SKILL.md +85 -0
- package/dist/agent-src/skills/test-driven-development/SKILL.md +33 -9
- package/dist/agent-src/skills/testing-anti-patterns/SKILL.md +1 -1
- package/dist/agent-src/skills/testing-anti-patterns/process-anti-patterns.md +37 -0
- package/dist/agent-src/skills/ui-component-architect/SKILL.md +45 -2
- package/dist/agent-src/skills/upstream-contribute/SKILL.md +38 -1
- package/dist/agent-src/skills/verify-repair-loop/SKILL.md +9 -4
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/roadmaps.md +97 -3
- package/dist/agent-src/templates/scripts/check_memory.ts +258 -17
- package/dist/agent-src/templates/scripts/check_memory_proposal.ts +9 -3
- package/dist/agent-src/templates/scripts/memory_lookup.ts +86 -0
- package/dist/agent-src/templates/scripts/memory_signal.ts +44 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/backend/implement.ts +90 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/backend/index.ts +11 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/backend/test.ts +23 -1
- package/dist/agent-src/templates/scripts/work_engine/directives/backend/verify.ts +10 -1
- package/dist/agent-src/templates/scripts/work_engine/directives/mixed/stitch.ts +5 -1
- package/dist/agent-src/templates/scripts/work_engine/stack/runner.ts +102 -14
- package/dist/cli/commands/uiAudit.js +124 -5
- package/dist/cli/registry.js +2 -0
- package/dist/cli-delegate/{chunk-HYWSRNUX.js → chunk-2DK2VJWG.js} +3 -3
- package/dist/cli-delegate/{chunk-JCW7ZLHK.js → chunk-4FS4WRXP.js} +5 -0
- package/dist/cli-delegate/{chunk-OMIVVCG2.js → chunk-A4QJ6ENT.js} +24 -0
- package/dist/cli-delegate/{chunk-JJA2QEWA.js → chunk-AKJGUQNO.js} +466 -285
- package/dist/cli-delegate/{chunk-E46KPN6K.js → chunk-BTWUYDGN.js} +424 -363
- package/dist/cli-delegate/{chunk-K4FFODTS.js → chunk-ILMUPLGW.js} +1227 -316
- package/dist/cli-delegate/{chunk-FF7WAFMR.js → chunk-KPBWFOPZ.js} +5 -1
- package/dist/cli-delegate/cmd_adr_effective.js +102 -0
- package/dist/cli-delegate/cmd_conformance.js +80 -11
- package/dist/cli-delegate/cmd_doctor.js +3 -3
- package/dist/cli-delegate/cmd_export.js +3 -2
- package/dist/cli-delegate/cmd_fleet.js +2 -2
- package/dist/cli-delegate/cmd_handoff.js +1 -1
- package/dist/cli-delegate/cmd_preflight.js +2 -2
- package/dist/cli-delegate/cmd_prune.js +3 -2
- package/dist/cli-delegate/cmd_settings_get.js +1 -1
- package/dist/cli-delegate/cmd_settings_migrate.js +3 -2
- package/dist/cli-delegate/cmd_settings_set.js +2 -2
- package/dist/cli-delegate/cmd_sync.js +3 -2
- package/dist/cli-delegate/cmd_uninstall.js +3 -2
- package/dist/cli-delegate/cmd_validate.js +3 -2
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +58 -58
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +1 -1
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +2 -2
- package/dist/discovery/trust-report.md +1 -1
- package/dist/discovery/workspaces.json +2 -2
- package/dist/hooks/dispatch.js +2900 -1049
- package/dist/install/claudeRuleRewrite.js +254 -0
- package/dist/install/detect.js +29 -16
- package/dist/install/detect_php_shape.js +159 -0
- package/dist/install/install.mjs +634 -428
- package/dist/mcp/awesome-mcp-servers.row.md +1 -1
- package/dist/mcp/mcp-cloudflare-catalogue.json +1 -1
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +3 -3
- package/dist/mcp/server.mjs +4895 -2627
- package/dist/server/schemas/settings.js +3 -0
- package/dist/ui/assets/index-D0jaCRPM.js +29 -0
- package/dist/ui/index.html +1 -1
- package/docs/MIGRATION.md +1 -1
- package/docs/THIRD-PARTY-NOTICES.md +25 -0
- package/docs/contracts/provider-lifecycle.md +1 -1
- package/docs/contracts/settings-classes.md +10 -4
- package/docs/guidelines/agent-infra/5w2h-analysis.md +3 -3
- package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +1 -0
- package/docs/guidelines/agent-infra/artifact-drafting-protocol-mechanics.md +58 -3
- package/docs/guidelines/agent-infra/ask-when-uncertain-demos.md +2 -2
- package/docs/guidelines/agent-infra/asking-and-brevity-examples.md +3 -3
- package/docs/guidelines/agent-infra/break-glass-usage.md +7 -7
- package/docs/guidelines/agent-infra/carve-out-predicates.md +3 -3
- package/docs/guidelines/agent-infra/comparison-matrix.md +1 -1
- package/docs/guidelines/agent-infra/critical-thinking.md +4 -4
- package/docs/guidelines/agent-infra/direct-answers-demos.md +2 -2
- package/docs/guidelines/agent-infra/domain-eval-anti-pattern.md +1 -1
- package/docs/guidelines/agent-infra/engineering-memory-data-format.md +3 -3
- package/docs/guidelines/agent-infra/existence-question-verdicts.md +80 -0
- package/docs/guidelines/agent-infra/first-principles.md +2 -2
- package/docs/guidelines/agent-infra/framework-neutrality-patterns.md +2 -2
- package/docs/guidelines/agent-infra/guarded-baseline.md +39 -0
- package/docs/guidelines/agent-infra/inversion-thinking.md +5 -5
- package/docs/guidelines/agent-infra/language-and-tone-examples.md +1 -1
- package/docs/guidelines/agent-infra/layered-settings.md +10 -10
- package/docs/guidelines/agent-infra/memory-access.md +1 -1
- package/docs/guidelines/agent-infra/mental-models.md +3 -3
- package/docs/guidelines/agent-infra/reuse-verdict-mechanics.md +71 -0
- package/docs/guidelines/agent-infra/review-routing-data-format.md +7 -7
- package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +13 -7
- package/docs/guidelines/agent-infra/role-contracts.md +2 -2
- package/docs/guidelines/agent-infra/role-mode-router.md +3 -3
- package/docs/guidelines/agent-infra/rule-type-governance.md +2 -2
- package/docs/guidelines/agent-infra/scqa-framework.md +5 -5
- package/docs/guidelines/agent-infra/self-improvement-pipeline.md +6 -6
- package/docs/guidelines/agent-infra/simplicity-and-goal-demos.md +2 -2
- package/docs/guidelines/agent-infra/six-hats.md +3 -3
- package/docs/guidelines/agent-infra/skill-quality-checklist.md +6 -6
- package/docs/guidelines/agent-infra/source-confidentiality-mechanics.md +109 -0
- package/docs/guidelines/agent-infra/systems-thinking.md +1 -1
- package/docs/guidelines/agent-infra/verify-before-complete-demos.md +2 -2
- package/docs/guidelines/augment-portability-patterns.md +6 -4
- package/docs/guidelines/code-clarity.md +18 -0
- package/docs/guidelines/component-oriented-and-oop-development.md +3 -2
- package/docs/guidelines/cross-role-handoff.md +2 -2
- package/docs/guidelines/design-fidelity-mechanics.md +1 -1
- package/docs/guidelines/docs/readme-size-and-splitting.md +3 -3
- package/docs/guidelines/php/database.md +90 -7
- package/docs/guidelines/prompt-templates.md +7 -7
- package/llms.txt +2 -2
- package/package.json +5 -2
- package/src/agent-src/scripts/archive_completed_roadmaps.ts +252 -8
- package/src/agent-src/scripts/guarded_baseline.ts +343 -0
- package/src/agent-src/scripts/roadmap_set_step.ts +253 -0
- package/src/agent-src/scripts/stub_queue.ts +82 -0
- package/src/agent-src/scripts/stubs_due.ts +516 -0
- package/src/agent-src/scripts/ticket_bundles.ts +84 -0
- package/src/agent-src/scripts/update_roadmap_progress.ts +16 -12
- package/src/agent-src/templates/scripts/check_memory.ts +258 -17
- package/src/agent-src/templates/scripts/check_memory_proposal.ts +9 -3
- package/src/agent-src/templates/scripts/memory_lookup.ts +86 -0
- package/src/agent-src/templates/scripts/memory_signal.ts +44 -0
- package/src/agent-src/templates/scripts/work_engine/directives/backend/implement.ts +90 -0
- package/src/agent-src/templates/scripts/work_engine/directives/backend/index.ts +11 -0
- package/src/agent-src/templates/scripts/work_engine/directives/backend/test.ts +23 -1
- package/src/agent-src/templates/scripts/work_engine/directives/backend/verify.ts +10 -1
- package/src/agent-src/templates/scripts/work_engine/directives/mixed/stitch.ts +5 -1
- package/src/agent-src/templates/scripts/work_engine/stack/runner.ts +102 -14
- package/src/config/agent-settings.template.yml +32 -3
- package/src/config/assurance-capability-registry.json +21 -9
- package/src/config/canonical-terms.yml +119 -0
- package/src/config/capability-native-outcome-bars.json +81 -0
- package/src/config/ci-local-parity.yml +80 -0
- package/src/config/drafting-channels.yml +43 -0
- package/src/config/estate-count-budget.json +57 -36
- package/src/config/evaluator-budgets.json +14 -14
- package/src/config/gate-coverage.yml +729 -63
- package/src/config/gate-reachability-exemptions.json +21 -0
- package/src/config/gate-violation-baselines.json +42 -19
- package/src/config/harness-evolution-budget.json +25 -0
- package/src/config/lapsed-beta-baseline.json +96 -0
- package/src/config/memory-twin-verdicts.yml +129 -0
- package/src/config/metric-registry.yml +124 -0
- package/src/config/pack-size-budget.json +16 -15
- package/src/config/preamble-payload-budget.json +12 -4
- package/src/config/profiles/balanced.ini +27 -0
- package/src/config/profiles/full.ini +27 -0
- package/src/config/profiles/minimal.ini +27 -0
- package/src/config/publish-surface.json +9 -2
- package/src/config/routing-coverage-seed.json +16 -2
- package/src/config/rule-stub-ceilings.json +133 -112
- package/src/config/turnaround-budget.json +66 -0
- package/src/install/claudeRuleRewrite.ts +288 -0
- package/src/install/detect.ts +60 -17
- package/src/install/detect_php_shape.ts +191 -0
- package/src/scripts/_cli/cmd_doctor.ts +27 -112
- package/src/scripts/_dispatch.bash +23 -0
- package/src/scripts/_lib/activation_ladder.ts +255 -0
- package/src/scripts/_lib/activation_receipt_producer.ts +341 -0
- package/src/scripts/_lib/activation_states.ts +88 -0
- package/src/scripts/_lib/adherence_detectors.ts +143 -0
- package/src/scripts/_lib/adr_frontmatter.ts +26 -0
- package/src/scripts/_lib/arith_claims.ts +181 -0
- package/src/scripts/_lib/arm_ranking.ts +62 -0
- package/src/scripts/_lib/asset_delivery_ledger.ts +303 -0
- package/src/scripts/_lib/audit_field_provenance.ts +54 -0
- package/src/scripts/_lib/auto_dispatch.ts +32 -3
- package/src/scripts/_lib/bench_ab_size_claim.ts +98 -4
- package/src/scripts/_lib/benchmark_cache_fields.ts +158 -0
- package/src/scripts/_lib/candidate_pair_delta.ts +349 -0
- package/src/scripts/_lib/candidate_proposer.ts +402 -0
- package/src/scripts/_lib/candidate_record.ts +601 -0
- package/src/scripts/_lib/capture_rate.ts +319 -0
- package/src/scripts/_lib/carrier_status.ts +118 -0
- package/src/scripts/_lib/cascade_stage_enumeration.ts +92 -0
- package/src/scripts/_lib/collector_denominator.ts +771 -0
- package/src/scripts/_lib/collector_record.ts +340 -0
- package/src/scripts/_lib/collector_store.ts +664 -0
- package/src/scripts/_lib/collector_supervision.ts +827 -0
- package/src/scripts/_lib/concern_estate.ts +77 -0
- package/src/scripts/_lib/config_chain.ts +477 -0
- package/src/scripts/_lib/config_cost.ts +209 -0
- package/src/scripts/_lib/corpus_manifest.ts +726 -0
- package/src/scripts/_lib/council_settings_block.ts +6 -0
- package/src/scripts/_lib/curator_ops.ts +172 -0
- package/src/scripts/_lib/delivery_arm_experiment.ts +282 -0
- package/src/scripts/_lib/delivery_criticality.ts +126 -0
- package/src/scripts/_lib/doctor_runtime_checks.ts +70 -0
- package/src/scripts/_lib/empty_cycles.ts +88 -0
- package/src/scripts/_lib/estate_carrier_cases.ts +72 -0
- package/src/scripts/_lib/eval_publication.ts +354 -0
- package/src/scripts/_lib/evaluation_cascade.ts +452 -0
- package/src/scripts/_lib/evaluation_vector.ts +283 -0
- package/src/scripts/_lib/evaluator_promotion.ts +225 -0
- package/src/scripts/_lib/evidence_basis.ts +118 -0
- package/src/scripts/_lib/evolution_roi.ts +562 -0
- package/src/scripts/_lib/exec_evidence.ts +8 -0
- package/src/scripts/_lib/experience_card.ts +272 -0
- package/src/scripts/_lib/experience_report.ts +151 -0
- package/src/scripts/_lib/experiment_freeze.ts +112 -0
- package/src/scripts/_lib/generated_by.ts +66 -0
- package/src/scripts/_lib/harness_evolution_guards.ts +239 -0
- package/src/scripts/_lib/hook_effect_probe.ts +141 -0
- package/src/scripts/_lib/host_denominator.ts +687 -0
- package/src/scripts/_lib/host_projection_reach.ts +157 -0
- package/src/scripts/_lib/ignored_blocker.ts +148 -0
- package/src/scripts/_lib/install_reach_checks.ts +495 -0
- package/src/scripts/_lib/json_duplicate_keys.ts +150 -0
- package/src/scripts/_lib/judge_hygiene.ts +228 -0
- package/src/scripts/_lib/legacy_boundary_map.ts +228 -0
- package/src/scripts/_lib/lexical_shortlist.ts +215 -0
- package/src/scripts/_lib/llm_candidate_proposer.ts +461 -0
- package/src/scripts/_lib/llm_proposer_transport.ts +153 -0
- package/src/scripts/_lib/loop_guards.ts +299 -0
- package/src/scripts/_lib/loss_class.ts +129 -0
- package/src/scripts/_lib/machine_wake.ts +51 -0
- package/src/scripts/_lib/md_prose_lines.ts +177 -0
- package/src/scripts/_lib/minimality_tiebreak.ts +168 -0
- package/src/scripts/_lib/one_resolver_invariant.ts +449 -0
- package/src/scripts/_lib/orchestration_record.ts +253 -5
- package/src/scripts/_lib/outcome_envelope.ts +227 -0
- package/src/scripts/_lib/outcome_vocabularies.ts +125 -0
- package/src/scripts/_lib/paired_stats.ts +245 -0
- package/src/scripts/_lib/paired_verdict.ts +226 -0
- package/src/scripts/_lib/pathology_archive.ts +393 -0
- package/src/scripts/_lib/prefix_stable_surfaces.ts +123 -0
- package/src/scripts/_lib/privacy_class.ts +47 -0
- package/src/scripts/_lib/promotion_capability.ts +315 -0
- package/src/scripts/_lib/promotion_evidence.ts +414 -0
- package/src/scripts/_lib/promotion_review.ts +294 -0
- package/src/scripts/_lib/prompt_shape.ts +92 -0
- package/src/scripts/_lib/regression_neighbourhood.ts +259 -0
- package/src/scripts/_lib/release_highlights.ts +70 -1
- package/src/scripts/_lib/release_material.ts +125 -2
- package/src/scripts/_lib/repeated_failure.ts +105 -0
- package/src/scripts/_lib/repo_root.ts +111 -0
- package/src/scripts/_lib/review_skipped_record.ts +37 -0
- package/src/scripts/_lib/role_split.ts +338 -0
- package/src/scripts/_lib/routing_corpus.ts +307 -0
- package/src/scripts/_lib/routing_index_input.ts +104 -0
- package/src/scripts/_lib/rule_injection.ts +22 -1
- package/src/scripts/_lib/runtime_journal.ts +1499 -0
- package/src/scripts/_lib/runtime_wiring_checks.ts +430 -0
- package/src/scripts/_lib/semantic_noop.ts +167 -0
- package/src/scripts/_lib/skill_catalogue.ts +11 -1
- package/src/scripts/_lib/source_digest.ts +200 -0
- package/src/scripts/_lib/source_redact.ts +260 -0
- package/src/scripts/_lib/source_shape.ts +502 -0
- package/src/scripts/_lib/source_snapshot_dedup.ts +199 -0
- package/src/scripts/_lib/strip_comments.d.mts +8 -0
- package/src/scripts/_lib/strip_comments.mjs +65 -0
- package/src/scripts/_lib/test_red_state.ts +154 -0
- package/src/scripts/_lib/trigger_shift.ts +144 -0
- package/src/scripts/_lib/untrusted_content.ts +82 -7
- package/src/scripts/activation_receipt.ts +258 -0
- package/src/scripts/adoption_report.ts +1 -1
- package/src/scripts/adr/evidence_census.ts +1 -1
- package/src/scripts/adr/regenerate_index.ts +26 -2
- package/src/scripts/adr_cite_check.ts +164 -1
- package/src/scripts/ai_council/blind_review.ts +11 -1
- package/src/scripts/ai_council/clients.ts +4 -0
- package/src/scripts/ai_council/config.ts +3 -0
- package/src/scripts/ai_council/consensus.ts +28 -8
- package/src/scripts/ai_council/consensus_round.ts +226 -0
- package/src/scripts/ai_council/cross_exam.ts +128 -0
- package/src/scripts/ai_council/disagreement_signal.ts +338 -0
- package/src/scripts/ai_council/explain_route.ts +157 -0
- package/src/scripts/ai_council/information_gain.ts +293 -0
- package/src/scripts/ai_council/inline_findings.ts +340 -0
- package/src/scripts/ai_council/judge_position_bias.ts +197 -0
- package/src/scripts/ai_council/leakage_corpus.ts +385 -0
- package/src/scripts/ai_council/leakage_patterns.ts +453 -0
- package/src/scripts/ai_council/minority_retention.ts +171 -0
- package/src/scripts/ai_council/orchestrator.ts +16 -203
- package/src/scripts/ai_council/orchestrator_results.ts +23 -3
- package/src/scripts/ai_council/pricing.ts +106 -0
- package/src/scripts/ai_council/prompts.ts +74 -7
- package/src/scripts/ai_council/provider_leakage_bench.ts +327 -0
- package/src/scripts/ai_council/py_format.ts +14 -3
- package/src/scripts/ai_council/recouncil_guard.ts +293 -0
- package/src/scripts/ai_council/recouncil_savings.ts +299 -0
- package/src/scripts/ai_council/replay_route.ts +223 -0
- package/src/scripts/ai_council/response_record.ts +50 -0
- package/src/scripts/ai_council/reviewer_assignment.ts +279 -0
- package/src/scripts/ai_council/routing_training_row.ts +197 -0
- package/src/scripts/ai_council/synthesis_strategy.ts +159 -0
- package/src/scripts/ai_council/topology_bench_manifest.ts +860 -0
- package/src/scripts/ai_council/topology_vocabulary.ts +175 -0
- package/src/scripts/asset_delivery_ledger.ts +157 -0
- package/src/scripts/attest_artifact.ts +193 -0
- package/src/scripts/audit_auto_rules.ts +2 -1
- package/src/scripts/audit_command_surface.ts +1 -1
- package/src/scripts/audit_mcp_tools.ts +2 -2
- package/src/scripts/audit_skill_overlap_allowlist.json +6 -1
- package/src/scripts/audit_user_type_axis.ts +2 -1
- package/src/scripts/bench_ab_clone.ts +215 -10
- package/src/scripts/bench_ab_integrity.ts +119 -5
- package/src/scripts/bench_ab_v2_stats.ts +40 -213
- package/src/scripts/build_archive_index.ts +1 -1
- package/src/scripts/build_linear_digest.ts +1 -1
- package/src/scripts/build_proof.ts +11 -4
- package/src/scripts/build_rule_trigger_matrix.ts +1 -1
- package/src/scripts/build_source_digests.ts +157 -0
- package/src/scripts/cache_realization_report.ts +103 -0
- package/src/scripts/check_adr_frontmatter.ts +131 -10
- package/src/scripts/check_benchmark_report_fields.ts +207 -0
- package/src/scripts/check_beta_review_markers.ts +235 -6
- package/src/scripts/check_bundle_path_leakage.ts +34 -1
- package/src/scripts/check_claims.ts +576 -6
- package/src/scripts/check_composite_arming.ts +35 -0
- package/src/scripts/check_concern_admissions.ts +365 -0
- package/src/scripts/check_enforcement_coverage.ts +28 -0
- package/src/scripts/check_estate_count.ts +347 -25
- package/src/scripts/check_gate_reachability.ts +383 -0
- package/src/scripts/check_host_loadability.ts +104 -0
- package/src/scripts/check_loss_class_declared.ts +308 -0
- package/src/scripts/check_md_language.ts +15 -98
- package/src/scripts/check_memory_proposal.ts +18 -11
- package/src/scripts/check_no_currency_in_cost_surfaces.ts +225 -0
- package/src/scripts/check_no_external_sources.ts +281 -6
- package/src/scripts/check_pack_conformance_fixture.ts +11 -1
- package/src/scripts/check_pack_size.ts +59 -2
- package/src/scripts/check_preamble_payload_budget.ts +114 -3
- package/src/scripts/check_prefix_stable_mutation.ts +372 -0
- package/src/scripts/check_publish_surface.ts +10 -1
- package/src/scripts/check_references.ts +24 -1
- package/src/scripts/check_release_highlights.ts +96 -13
- package/src/scripts/check_roadmap_trackable.ts +17 -2
- package/src/scripts/check_rule_evidence_declaration.ts +316 -0
- package/src/scripts/check_rule_projection_integrity.ts +14 -4
- package/src/scripts/check_score_contract.ts +26 -3
- package/src/scripts/check_static_parity.ts +285 -0
- package/src/scripts/check_supervision_claim_atomicity.ts +498 -0
- package/src/scripts/check_suppression_hygiene.ts +15 -0
- package/src/scripts/ci_settle.ts +39 -2
- package/src/scripts/code_graph/build.ts +60 -3
- package/src/scripts/code_graph/extract.ts +44 -0
- package/src/scripts/code_graph/types.ts +24 -0
- package/src/scripts/collector_daemon.ts +714 -0
- package/src/scripts/config_cost_report.ts +302 -0
- package/src/scripts/consumer_matrix.ts +74 -1
- package/src/scripts/corpus_manifest.ts +235 -0
- package/src/scripts/cost/budget.mjs +10 -3
- package/src/scripts/cost/track.mjs +10 -3
- package/src/scripts/council_cli.ts +37 -54
- package/src/scripts/dispatch_r2_reviewer.ts +46 -5
- package/src/scripts/evolution_lab.ts +1153 -0
- package/src/scripts/external_sources_denylist.json +5 -18
- package/src/scripts/extract_audit_patterns.ts +21 -0
- package/src/scripts/fold_intake.ts +12 -1
- package/src/scripts/gen_discovery_baseline.ts +1 -1
- package/src/scripts/generate_capabilities_index.ts +12 -5
- package/src/scripts/generate_capability_matrix.ts +3 -3
- package/src/scripts/generate_command_flows.ts +2 -2
- package/src/scripts/generate_cookbook.ts +2 -2
- package/src/scripts/generate_index.ts +8 -1
- package/src/scripts/generate_knowledge_index.ts +2 -1
- package/src/scripts/generate_ownership_matrix.ts +2 -1
- package/src/scripts/generate_pack_manifests.ts +10 -2
- package/src/scripts/generate_role_experiences_catalog.ts +2 -2
- package/src/scripts/generate_settings_reference.ts +1 -1
- package/src/scripts/git_authorization_hook.ts +22 -1
- package/src/scripts/grade_target_readiness.ts +48 -5
- package/src/scripts/hook_effect_doctor.ts +261 -0
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +125 -16
- package/src/scripts/hooks/block_speaking_inbox_dir.ts +271 -0
- package/src/scripts/hooks/block_unauthorized_git.ts +18 -0
- package/src/scripts/hooks/comment_discipline_hook.ts +146 -0
- package/src/scripts/hooks/concern_registry.ts +6 -0
- package/src/scripts/hooks/dispatch_hook.ts +32 -0
- package/src/scripts/hooks/journal_record_hook.ts +345 -0
- package/src/scripts/hooks/prepush_metadata_sources.sh +110 -0
- package/src/scripts/hooks/run_continuation_hook.ts +44 -9
- package/src/scripts/hooks/shims/install.sh +61 -0
- package/src/scripts/hooks/shims/php +101 -0
- package/src/scripts/hooks/suggestion_capture_hook.ts +10 -0
- package/src/scripts/hooks/turn_end_gate_hook.ts +9 -1
- package/src/scripts/hot_context_hook.ts +16 -0
- package/src/scripts/install-hooks.sh +20 -5
- package/src/scripts/install.ts +17 -35
- package/src/scripts/inventory_frontmatter.ts +2 -1
- package/src/scripts/language_mirror_hook.ts +14 -2
- package/src/scripts/lint_adr_sweep_routing.ts +12 -0
- package/src/scripts/lint_canonical_terms.ts +604 -0
- package/src/scripts/lint_carrier_integrity.ts +820 -0
- package/src/scripts/lint_code_comments.ts +643 -0
- package/src/scripts/lint_composition_review.ts +619 -0
- package/src/scripts/lint_consolidation_lineage.ts +666 -0
- package/src/scripts/lint_eval_specs.ts +593 -0
- package/src/scripts/lint_hook_manifest.ts +19 -0
- package/src/scripts/lint_host_portability.ts +373 -0
- package/src/scripts/lint_judge_prompt_expectation.ts +27 -1
- package/src/scripts/lint_memory_twin_parity.ts +335 -0
- package/src/scripts/lint_metric_consumers.ts +355 -0
- package/src/scripts/lint_plan_risk_register.ts +39 -19
- package/src/scripts/lint_promotion_paths.ts +779 -0
- package/src/scripts/lint_skill_descriptions.ts +18 -1
- package/src/scripts/lint_skill_frontmatter_safety.ts +58 -0
- package/src/scripts/lint_skill_link_reach.ts +252 -0
- package/src/scripts/lint_skill_trigger_corpus.ts +426 -23
- package/src/scripts/lint_ticket_buildable.ts +17 -1
- package/src/scripts/llm_propose.ts +256 -0
- package/src/scripts/mcp_server/consumer_tool_catalog.json +1 -1
- package/src/scripts/mcp_server/tool_catalog_source.ts +1 -1
- package/src/scripts/measure_delivery_sets.ts +361 -0
- package/src/scripts/measure_docs_dead_links.ts +348 -0
- package/src/scripts/measure_host_capture.ts +461 -0
- package/src/scripts/measure_routing_signal.ts +307 -0
- package/src/scripts/migration_status.ts +3 -3
- package/src/scripts/model_rule_injection.ts +76 -0
- package/src/scripts/orchestration_record.ts +14 -0
- package/src/scripts/preamble_byte_census.ts +139 -10
- package/src/scripts/prepack-check.mjs +4 -1
- package/src/scripts/probe_council_retention.ts +495 -0
- package/src/scripts/probe_turnaround.ts +384 -0
- package/src/scripts/probe_unblocked_ask.ts +279 -0
- package/src/scripts/release.ts +21 -37
- package/src/scripts/release_drill.ts +143 -0
- package/src/scripts/release_env.ts +35 -0
- package/src/scripts/release_publication.ts +84 -0
- package/src/scripts/render_benchmark_md.ts +1 -1
- package/src/scripts/rule_activation_census.ts +70 -9
- package/src/scripts/rule_backlinks.ts +1 -1
- package/src/scripts/run_lifecycle_suite.ts +208 -0
- package/src/scripts/run_skill_evals.ts +40 -0
- package/src/scripts/schemas/delivery-manifest.schema.json +43 -0
- package/src/scripts/schemas/drafting-channels.schema.json +43 -0
- package/src/scripts/schemas/evals.schema.json +24 -1
- package/src/scripts/schemas/rule.schema.json +52 -1
- package/src/scripts/schemas/skill.schema.json +17 -2
- package/src/scripts/skill_overlap.ts +7 -1
- package/src/scripts/skill_tools/run_block_d_eval.ts +8 -1
- package/src/scripts/skill_tools/score_skill_relevance.ts +84 -3
- package/src/scripts/skill_tools/suggest_skill_for_task.ts +8 -1
- package/src/scripts/skill_usage_report.ts +2 -1
- package/src/scripts/stubs_due.ts +211 -0
- package/src/scripts/sweep_source_surfaces.ts +678 -0
- package/src/scripts/sync_pr_branch.ts +3 -3
- package/src/scripts/trigger_eval_grandfather.json +202 -222
- package/src/scripts/utilization_report.ts +22 -2
- package/src/server/schemas/settings.ts +5 -0
- package/src/templates/marketing-copy.yml +1 -1
- package/dist/ui/assets/index-Cxgy63kz.js +0 -26
package/dist/install/install.mjs
CHANGED
|
@@ -117,17 +117,17 @@ var require_visit = __commonJS({
|
|
|
117
117
|
visit.BREAK = BREAK;
|
|
118
118
|
visit.SKIP = SKIP;
|
|
119
119
|
visit.REMOVE = REMOVE;
|
|
120
|
-
function visit_(key, node, visitor,
|
|
121
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
120
|
+
function visit_(key, node, visitor, path21) {
|
|
121
|
+
const ctrl = callVisitor(key, node, visitor, path21);
|
|
122
122
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
123
|
-
replaceNode(key,
|
|
124
|
-
return visit_(key, ctrl, visitor,
|
|
123
|
+
replaceNode(key, path21, ctrl);
|
|
124
|
+
return visit_(key, ctrl, visitor, path21);
|
|
125
125
|
}
|
|
126
126
|
if (typeof ctrl !== "symbol") {
|
|
127
127
|
if (identity.isCollection(node)) {
|
|
128
|
-
|
|
128
|
+
path21 = Object.freeze(path21.concat(node));
|
|
129
129
|
for (let i = 0; i < node.items.length; ++i) {
|
|
130
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
130
|
+
const ci = visit_(i, node.items[i], visitor, path21);
|
|
131
131
|
if (typeof ci === "number")
|
|
132
132
|
i = ci - 1;
|
|
133
133
|
else if (ci === BREAK)
|
|
@@ -138,13 +138,13 @@ var require_visit = __commonJS({
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
} else if (identity.isPair(node)) {
|
|
141
|
-
|
|
142
|
-
const ck = visit_("key", node.key, visitor,
|
|
141
|
+
path21 = Object.freeze(path21.concat(node));
|
|
142
|
+
const ck = visit_("key", node.key, visitor, path21);
|
|
143
143
|
if (ck === BREAK)
|
|
144
144
|
return BREAK;
|
|
145
145
|
else if (ck === REMOVE)
|
|
146
146
|
node.key = null;
|
|
147
|
-
const cv = visit_("value", node.value, visitor,
|
|
147
|
+
const cv = visit_("value", node.value, visitor, path21);
|
|
148
148
|
if (cv === BREAK)
|
|
149
149
|
return BREAK;
|
|
150
150
|
else if (cv === REMOVE)
|
|
@@ -165,17 +165,17 @@ var require_visit = __commonJS({
|
|
|
165
165
|
visitAsync.BREAK = BREAK;
|
|
166
166
|
visitAsync.SKIP = SKIP;
|
|
167
167
|
visitAsync.REMOVE = REMOVE;
|
|
168
|
-
async function visitAsync_(key, node, visitor,
|
|
169
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
168
|
+
async function visitAsync_(key, node, visitor, path21) {
|
|
169
|
+
const ctrl = await callVisitor(key, node, visitor, path21);
|
|
170
170
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
171
|
-
replaceNode(key,
|
|
172
|
-
return visitAsync_(key, ctrl, visitor,
|
|
171
|
+
replaceNode(key, path21, ctrl);
|
|
172
|
+
return visitAsync_(key, ctrl, visitor, path21);
|
|
173
173
|
}
|
|
174
174
|
if (typeof ctrl !== "symbol") {
|
|
175
175
|
if (identity.isCollection(node)) {
|
|
176
|
-
|
|
176
|
+
path21 = Object.freeze(path21.concat(node));
|
|
177
177
|
for (let i = 0; i < node.items.length; ++i) {
|
|
178
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
178
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path21);
|
|
179
179
|
if (typeof ci === "number")
|
|
180
180
|
i = ci - 1;
|
|
181
181
|
else if (ci === BREAK)
|
|
@@ -186,13 +186,13 @@ var require_visit = __commonJS({
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
} else if (identity.isPair(node)) {
|
|
189
|
-
|
|
190
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
189
|
+
path21 = Object.freeze(path21.concat(node));
|
|
190
|
+
const ck = await visitAsync_("key", node.key, visitor, path21);
|
|
191
191
|
if (ck === BREAK)
|
|
192
192
|
return BREAK;
|
|
193
193
|
else if (ck === REMOVE)
|
|
194
194
|
node.key = null;
|
|
195
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
195
|
+
const cv = await visitAsync_("value", node.value, visitor, path21);
|
|
196
196
|
if (cv === BREAK)
|
|
197
197
|
return BREAK;
|
|
198
198
|
else if (cv === REMOVE)
|
|
@@ -219,23 +219,23 @@ var require_visit = __commonJS({
|
|
|
219
219
|
}
|
|
220
220
|
return visitor;
|
|
221
221
|
}
|
|
222
|
-
function callVisitor(key, node, visitor,
|
|
222
|
+
function callVisitor(key, node, visitor, path21) {
|
|
223
223
|
if (typeof visitor === "function")
|
|
224
|
-
return visitor(key, node,
|
|
224
|
+
return visitor(key, node, path21);
|
|
225
225
|
if (identity.isMap(node))
|
|
226
|
-
return visitor.Map?.(key, node,
|
|
226
|
+
return visitor.Map?.(key, node, path21);
|
|
227
227
|
if (identity.isSeq(node))
|
|
228
|
-
return visitor.Seq?.(key, node,
|
|
228
|
+
return visitor.Seq?.(key, node, path21);
|
|
229
229
|
if (identity.isPair(node))
|
|
230
|
-
return visitor.Pair?.(key, node,
|
|
230
|
+
return visitor.Pair?.(key, node, path21);
|
|
231
231
|
if (identity.isScalar(node))
|
|
232
|
-
return visitor.Scalar?.(key, node,
|
|
232
|
+
return visitor.Scalar?.(key, node, path21);
|
|
233
233
|
if (identity.isAlias(node))
|
|
234
|
-
return visitor.Alias?.(key, node,
|
|
234
|
+
return visitor.Alias?.(key, node, path21);
|
|
235
235
|
return void 0;
|
|
236
236
|
}
|
|
237
|
-
function replaceNode(key,
|
|
238
|
-
const parent =
|
|
237
|
+
function replaceNode(key, path21, node) {
|
|
238
|
+
const parent = path21[path21.length - 1];
|
|
239
239
|
if (identity.isCollection(parent)) {
|
|
240
240
|
parent.items[key] = node;
|
|
241
241
|
} else if (identity.isPair(parent)) {
|
|
@@ -845,10 +845,10 @@ var require_Collection = __commonJS({
|
|
|
845
845
|
var createNode = require_createNode();
|
|
846
846
|
var identity = require_identity();
|
|
847
847
|
var Node = require_Node();
|
|
848
|
-
function collectionFromPath(schema,
|
|
848
|
+
function collectionFromPath(schema, path21, value) {
|
|
849
849
|
let v = value;
|
|
850
|
-
for (let i =
|
|
851
|
-
const k =
|
|
850
|
+
for (let i = path21.length - 1; i >= 0; --i) {
|
|
851
|
+
const k = path21[i];
|
|
852
852
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
853
853
|
const a = [];
|
|
854
854
|
a[k] = v;
|
|
@@ -867,7 +867,7 @@ var require_Collection = __commonJS({
|
|
|
867
867
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
868
868
|
});
|
|
869
869
|
}
|
|
870
|
-
var isEmptyPath = (
|
|
870
|
+
var isEmptyPath = (path21) => path21 == null || typeof path21 === "object" && !!path21[Symbol.iterator]().next().done;
|
|
871
871
|
var Collection = class extends Node.NodeBase {
|
|
872
872
|
constructor(type, schema) {
|
|
873
873
|
super(type);
|
|
@@ -897,11 +897,11 @@ var require_Collection = __commonJS({
|
|
|
897
897
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
898
898
|
* that already exists in the map.
|
|
899
899
|
*/
|
|
900
|
-
addIn(
|
|
901
|
-
if (isEmptyPath(
|
|
900
|
+
addIn(path21, value) {
|
|
901
|
+
if (isEmptyPath(path21))
|
|
902
902
|
this.add(value);
|
|
903
903
|
else {
|
|
904
|
-
const [key, ...rest] =
|
|
904
|
+
const [key, ...rest] = path21;
|
|
905
905
|
const node = this.get(key, true);
|
|
906
906
|
if (identity.isCollection(node))
|
|
907
907
|
node.addIn(rest, value);
|
|
@@ -915,8 +915,8 @@ var require_Collection = __commonJS({
|
|
|
915
915
|
* Removes a value from the collection.
|
|
916
916
|
* @returns `true` if the item was found and removed.
|
|
917
917
|
*/
|
|
918
|
-
deleteIn(
|
|
919
|
-
const [key, ...rest] =
|
|
918
|
+
deleteIn(path21) {
|
|
919
|
+
const [key, ...rest] = path21;
|
|
920
920
|
if (rest.length === 0)
|
|
921
921
|
return this.delete(key);
|
|
922
922
|
const node = this.get(key, true);
|
|
@@ -930,8 +930,8 @@ var require_Collection = __commonJS({
|
|
|
930
930
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
931
931
|
* `true` (collections are always returned intact).
|
|
932
932
|
*/
|
|
933
|
-
getIn(
|
|
934
|
-
const [key, ...rest] =
|
|
933
|
+
getIn(path21, keepScalar) {
|
|
934
|
+
const [key, ...rest] = path21;
|
|
935
935
|
const node = this.get(key, true);
|
|
936
936
|
if (rest.length === 0)
|
|
937
937
|
return !keepScalar && identity.isScalar(node) ? node.value : node;
|
|
@@ -949,8 +949,8 @@ var require_Collection = __commonJS({
|
|
|
949
949
|
/**
|
|
950
950
|
* Checks if the collection includes a value with the key `key`.
|
|
951
951
|
*/
|
|
952
|
-
hasIn(
|
|
953
|
-
const [key, ...rest] =
|
|
952
|
+
hasIn(path21) {
|
|
953
|
+
const [key, ...rest] = path21;
|
|
954
954
|
if (rest.length === 0)
|
|
955
955
|
return this.has(key);
|
|
956
956
|
const node = this.get(key, true);
|
|
@@ -960,8 +960,8 @@ var require_Collection = __commonJS({
|
|
|
960
960
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
961
961
|
* boolean to add/remove the item from the set.
|
|
962
962
|
*/
|
|
963
|
-
setIn(
|
|
964
|
-
const [key, ...rest] =
|
|
963
|
+
setIn(path21, value) {
|
|
964
|
+
const [key, ...rest] = path21;
|
|
965
965
|
if (rest.length === 0) {
|
|
966
966
|
this.set(key, value);
|
|
967
967
|
} else {
|
|
@@ -3476,9 +3476,9 @@ var require_Document = __commonJS({
|
|
|
3476
3476
|
this.contents.add(value);
|
|
3477
3477
|
}
|
|
3478
3478
|
/** Adds a value to the document. */
|
|
3479
|
-
addIn(
|
|
3479
|
+
addIn(path21, value) {
|
|
3480
3480
|
if (assertCollection(this.contents))
|
|
3481
|
-
this.contents.addIn(
|
|
3481
|
+
this.contents.addIn(path21, value);
|
|
3482
3482
|
}
|
|
3483
3483
|
/**
|
|
3484
3484
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -3553,14 +3553,14 @@ var require_Document = __commonJS({
|
|
|
3553
3553
|
* Removes a value from the document.
|
|
3554
3554
|
* @returns `true` if the item was found and removed.
|
|
3555
3555
|
*/
|
|
3556
|
-
deleteIn(
|
|
3557
|
-
if (Collection.isEmptyPath(
|
|
3556
|
+
deleteIn(path21) {
|
|
3557
|
+
if (Collection.isEmptyPath(path21)) {
|
|
3558
3558
|
if (this.contents == null)
|
|
3559
3559
|
return false;
|
|
3560
3560
|
this.contents = null;
|
|
3561
3561
|
return true;
|
|
3562
3562
|
}
|
|
3563
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
3563
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path21) : false;
|
|
3564
3564
|
}
|
|
3565
3565
|
/**
|
|
3566
3566
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -3575,10 +3575,10 @@ var require_Document = __commonJS({
|
|
|
3575
3575
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
3576
3576
|
* `true` (collections are always returned intact).
|
|
3577
3577
|
*/
|
|
3578
|
-
getIn(
|
|
3579
|
-
if (Collection.isEmptyPath(
|
|
3578
|
+
getIn(path21, keepScalar) {
|
|
3579
|
+
if (Collection.isEmptyPath(path21))
|
|
3580
3580
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
3581
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
|
3581
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path21, keepScalar) : void 0;
|
|
3582
3582
|
}
|
|
3583
3583
|
/**
|
|
3584
3584
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -3589,10 +3589,10 @@ var require_Document = __commonJS({
|
|
|
3589
3589
|
/**
|
|
3590
3590
|
* Checks if the document includes a value at `path`.
|
|
3591
3591
|
*/
|
|
3592
|
-
hasIn(
|
|
3593
|
-
if (Collection.isEmptyPath(
|
|
3592
|
+
hasIn(path21) {
|
|
3593
|
+
if (Collection.isEmptyPath(path21))
|
|
3594
3594
|
return this.contents !== void 0;
|
|
3595
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
3595
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path21) : false;
|
|
3596
3596
|
}
|
|
3597
3597
|
/**
|
|
3598
3598
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -3609,13 +3609,13 @@ var require_Document = __commonJS({
|
|
|
3609
3609
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
3610
3610
|
* boolean to add/remove the item from the set.
|
|
3611
3611
|
*/
|
|
3612
|
-
setIn(
|
|
3613
|
-
if (Collection.isEmptyPath(
|
|
3612
|
+
setIn(path21, value) {
|
|
3613
|
+
if (Collection.isEmptyPath(path21)) {
|
|
3614
3614
|
this.contents = value;
|
|
3615
3615
|
} else if (this.contents == null) {
|
|
3616
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
3616
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path21), value);
|
|
3617
3617
|
} else if (assertCollection(this.contents)) {
|
|
3618
|
-
this.contents.setIn(
|
|
3618
|
+
this.contents.setIn(path21, value);
|
|
3619
3619
|
}
|
|
3620
3620
|
}
|
|
3621
3621
|
/**
|
|
@@ -5575,9 +5575,9 @@ var require_cst_visit = __commonJS({
|
|
|
5575
5575
|
visit.BREAK = BREAK;
|
|
5576
5576
|
visit.SKIP = SKIP;
|
|
5577
5577
|
visit.REMOVE = REMOVE;
|
|
5578
|
-
visit.itemAtPath = (cst,
|
|
5578
|
+
visit.itemAtPath = (cst, path21) => {
|
|
5579
5579
|
let item = cst;
|
|
5580
|
-
for (const [field, index] of
|
|
5580
|
+
for (const [field, index] of path21) {
|
|
5581
5581
|
const tok = item?.[field];
|
|
5582
5582
|
if (tok && "items" in tok) {
|
|
5583
5583
|
item = tok.items[index];
|
|
@@ -5586,23 +5586,23 @@ var require_cst_visit = __commonJS({
|
|
|
5586
5586
|
}
|
|
5587
5587
|
return item;
|
|
5588
5588
|
};
|
|
5589
|
-
visit.parentCollection = (cst,
|
|
5590
|
-
const parent = visit.itemAtPath(cst,
|
|
5591
|
-
const field =
|
|
5589
|
+
visit.parentCollection = (cst, path21) => {
|
|
5590
|
+
const parent = visit.itemAtPath(cst, path21.slice(0, -1));
|
|
5591
|
+
const field = path21[path21.length - 1][0];
|
|
5592
5592
|
const coll = parent?.[field];
|
|
5593
5593
|
if (coll && "items" in coll)
|
|
5594
5594
|
return coll;
|
|
5595
5595
|
throw new Error("Parent collection not found");
|
|
5596
5596
|
};
|
|
5597
|
-
function _visit(
|
|
5598
|
-
let ctrl = visitor(item,
|
|
5597
|
+
function _visit(path21, item, visitor) {
|
|
5598
|
+
let ctrl = visitor(item, path21);
|
|
5599
5599
|
if (typeof ctrl === "symbol")
|
|
5600
5600
|
return ctrl;
|
|
5601
5601
|
for (const field of ["key", "value"]) {
|
|
5602
5602
|
const token = item[field];
|
|
5603
5603
|
if (token && "items" in token) {
|
|
5604
5604
|
for (let i = 0; i < token.items.length; ++i) {
|
|
5605
|
-
const ci = _visit(Object.freeze(
|
|
5605
|
+
const ci = _visit(Object.freeze(path21.concat([[field, i]])), token.items[i], visitor);
|
|
5606
5606
|
if (typeof ci === "number")
|
|
5607
5607
|
i = ci - 1;
|
|
5608
5608
|
else if (ci === BREAK)
|
|
@@ -5613,10 +5613,10 @@ var require_cst_visit = __commonJS({
|
|
|
5613
5613
|
}
|
|
5614
5614
|
}
|
|
5615
5615
|
if (typeof ctrl === "function" && field === "key")
|
|
5616
|
-
ctrl = ctrl(item,
|
|
5616
|
+
ctrl = ctrl(item, path21);
|
|
5617
5617
|
}
|
|
5618
5618
|
}
|
|
5619
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
5619
|
+
return typeof ctrl === "function" ? ctrl(item, path21) : ctrl;
|
|
5620
5620
|
}
|
|
5621
5621
|
exports.visit = visit;
|
|
5622
5622
|
}
|
|
@@ -6918,14 +6918,14 @@ var require_parser = __commonJS({
|
|
|
6918
6918
|
case "scalar":
|
|
6919
6919
|
case "single-quoted-scalar":
|
|
6920
6920
|
case "double-quoted-scalar": {
|
|
6921
|
-
const
|
|
6921
|
+
const fs24 = this.flowScalar(this.type);
|
|
6922
6922
|
if (atNextItem || it.value) {
|
|
6923
|
-
map.items.push({ start, key:
|
|
6923
|
+
map.items.push({ start, key: fs24, sep: [] });
|
|
6924
6924
|
this.onKeyLine = true;
|
|
6925
6925
|
} else if (it.sep) {
|
|
6926
|
-
this.stack.push(
|
|
6926
|
+
this.stack.push(fs24);
|
|
6927
6927
|
} else {
|
|
6928
|
-
Object.assign(it, { key:
|
|
6928
|
+
Object.assign(it, { key: fs24, sep: [] });
|
|
6929
6929
|
this.onKeyLine = true;
|
|
6930
6930
|
}
|
|
6931
6931
|
return;
|
|
@@ -7053,13 +7053,13 @@ var require_parser = __commonJS({
|
|
|
7053
7053
|
case "scalar":
|
|
7054
7054
|
case "single-quoted-scalar":
|
|
7055
7055
|
case "double-quoted-scalar": {
|
|
7056
|
-
const
|
|
7056
|
+
const fs24 = this.flowScalar(this.type);
|
|
7057
7057
|
if (!it || it.value)
|
|
7058
|
-
fc.items.push({ start: [], key:
|
|
7058
|
+
fc.items.push({ start: [], key: fs24, sep: [] });
|
|
7059
7059
|
else if (it.sep)
|
|
7060
|
-
this.stack.push(
|
|
7060
|
+
this.stack.push(fs24);
|
|
7061
7061
|
else
|
|
7062
|
-
Object.assign(it, { key:
|
|
7062
|
+
Object.assign(it, { key: fs24, sep: [] });
|
|
7063
7063
|
return;
|
|
7064
7064
|
}
|
|
7065
7065
|
case "flow-map-end":
|
|
@@ -7370,9 +7370,9 @@ var require_dist = __commonJS({
|
|
|
7370
7370
|
// src/scripts/install.ts
|
|
7371
7371
|
import { spawn, spawnSync as spawnSync2 } from "node:child_process";
|
|
7372
7372
|
import * as crypto3 from "node:crypto";
|
|
7373
|
-
import * as
|
|
7373
|
+
import * as fs23 from "node:fs";
|
|
7374
7374
|
import * as os8 from "node:os";
|
|
7375
|
-
import * as
|
|
7375
|
+
import * as path20 from "node:path";
|
|
7376
7376
|
import process3 from "node:process";
|
|
7377
7377
|
import { fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL2 } from "node:url";
|
|
7378
7378
|
|
|
@@ -7873,8 +7873,8 @@ function lockfile_write_path(env) {
|
|
|
7873
7873
|
}
|
|
7874
7874
|
return write_target("installed.lock", { env: env ?? null });
|
|
7875
7875
|
}
|
|
7876
|
-
function read_lockfile(
|
|
7877
|
-
const target =
|
|
7876
|
+
function read_lockfile(path21) {
|
|
7877
|
+
const target = path21 ?? lockfile_path();
|
|
7878
7878
|
let text;
|
|
7879
7879
|
try {
|
|
7880
7880
|
text = fs2.readFileSync(target, { encoding: "utf-8" });
|
|
@@ -9079,18 +9079,18 @@ function manifest_path(project_root, env) {
|
|
|
9079
9079
|
var _TOP_KEY_RE = /^([A-Za-z_][A-Za-z0-9_]*)\s*:\s*"?([^"\n]*?)"?\s*$/;
|
|
9080
9080
|
var _LIST_DASH_RE = /^\s*-\s*(.+?)\s*$/;
|
|
9081
9081
|
var _INDENT_KEY_RE = /^\s+([A-Za-z_][A-Za-z0-9_]*)\s*:\s*"?([^"\n]*?)"?\s*$/;
|
|
9082
|
-
function read_manifest(
|
|
9082
|
+
function read_manifest(path21) {
|
|
9083
9083
|
let text;
|
|
9084
9084
|
try {
|
|
9085
|
-
text = require_read_text(
|
|
9085
|
+
text = require_read_text(path21);
|
|
9086
9086
|
} catch {
|
|
9087
9087
|
return null;
|
|
9088
9088
|
}
|
|
9089
9089
|
const data = _parse_manual(text);
|
|
9090
9090
|
return _normalise_v2_shape(data);
|
|
9091
9091
|
}
|
|
9092
|
-
function require_read_text(
|
|
9093
|
-
return fs9.readFileSync(
|
|
9092
|
+
function require_read_text(path21) {
|
|
9093
|
+
return fs9.readFileSync(path21, { encoding: "utf-8" });
|
|
9094
9094
|
}
|
|
9095
9095
|
function _normalise_v2_shape(data) {
|
|
9096
9096
|
if (data["tools"] === void 0 || data["tools"] === null) {
|
|
@@ -9271,9 +9271,9 @@ function stable_sort(items, key) {
|
|
|
9271
9271
|
return a.index - b.index;
|
|
9272
9272
|
}).map((entry) => entry.item);
|
|
9273
9273
|
}
|
|
9274
|
-
function write_manifest(
|
|
9274
|
+
function write_manifest(path21, version, tools, options = {}) {
|
|
9275
9275
|
const rendered = _render2(version, tools, { deploy_roots: options.deploy_roots ?? null });
|
|
9276
|
-
return write_atomic(
|
|
9276
|
+
return write_atomic(path21, rendered);
|
|
9277
9277
|
}
|
|
9278
9278
|
var ScopeMismatchError = class extends Error {
|
|
9279
9279
|
name_;
|
|
@@ -10886,6 +10886,208 @@ function stampHostLayerFingerprint(installedVersion, tools, lockfilePath, skip2,
|
|
|
10886
10886
|
}
|
|
10887
10887
|
}
|
|
10888
10888
|
|
|
10889
|
+
// src/install/claudeRuleRewrite.ts
|
|
10890
|
+
import * as fs18 from "node:fs";
|
|
10891
|
+
import * as path16 from "node:path";
|
|
10892
|
+
|
|
10893
|
+
// src/install/claudePathsPlan.ts
|
|
10894
|
+
function derive_trigger_globs(meta) {
|
|
10895
|
+
const triggers = meta["triggers"];
|
|
10896
|
+
if (!Array.isArray(triggers)) {
|
|
10897
|
+
return [];
|
|
10898
|
+
}
|
|
10899
|
+
const globs = [];
|
|
10900
|
+
for (const t of triggers) {
|
|
10901
|
+
if (t === null || typeof t !== "object" || Array.isArray(t)) continue;
|
|
10902
|
+
const obj = t;
|
|
10903
|
+
if (typeof obj["file_pattern"] === "string" && obj["file_pattern"]) {
|
|
10904
|
+
globs.push(obj["file_pattern"]);
|
|
10905
|
+
} else if (typeof obj["path_prefix"] === "string" && obj["path_prefix"]) {
|
|
10906
|
+
const prefix = obj["path_prefix"];
|
|
10907
|
+
globs.push(prefix.endsWith("/") ? `${prefix}**` : `${prefix}**`);
|
|
10908
|
+
}
|
|
10909
|
+
}
|
|
10910
|
+
return [...new Set(globs)];
|
|
10911
|
+
}
|
|
10912
|
+
function _is_unresolved_placeholder(pattern) {
|
|
10913
|
+
for (const m of pattern.matchAll(/\{([^}]*)\}/g)) {
|
|
10914
|
+
if (!m[1].includes(",")) {
|
|
10915
|
+
return true;
|
|
10916
|
+
}
|
|
10917
|
+
}
|
|
10918
|
+
return false;
|
|
10919
|
+
}
|
|
10920
|
+
function _escape_claude_bracket(pattern) {
|
|
10921
|
+
return pattern.replace(/\[/g, "\\[");
|
|
10922
|
+
}
|
|
10923
|
+
function _expanded_pattern_count(pattern) {
|
|
10924
|
+
let n = 1;
|
|
10925
|
+
for (const m of pattern.matchAll(/\{([^}]*)\}/g)) {
|
|
10926
|
+
n *= m[1].split(",").length;
|
|
10927
|
+
}
|
|
10928
|
+
return n;
|
|
10929
|
+
}
|
|
10930
|
+
var CLAUDE_PATHS_PATTERN_BUDGET = 1e3;
|
|
10931
|
+
function _has_non_path_trigger(meta) {
|
|
10932
|
+
const triggers = meta["triggers"];
|
|
10933
|
+
if (!Array.isArray(triggers)) return false;
|
|
10934
|
+
for (const t of triggers) {
|
|
10935
|
+
if (t === null || typeof t !== "object" || Array.isArray(t)) continue;
|
|
10936
|
+
const obj = t;
|
|
10937
|
+
if (typeof obj["keyword"] === "string" && obj["keyword"]) return true;
|
|
10938
|
+
if (typeof obj["phrase"] === "string" && obj["phrase"]) return true;
|
|
10939
|
+
}
|
|
10940
|
+
return false;
|
|
10941
|
+
}
|
|
10942
|
+
function _claude_paths_plan(meta) {
|
|
10943
|
+
const always_apply = Boolean(meta["alwaysApply"] || meta["type"] === "always");
|
|
10944
|
+
if (always_apply) {
|
|
10945
|
+
return { globs: [], dropped: [] };
|
|
10946
|
+
}
|
|
10947
|
+
const globs = [];
|
|
10948
|
+
const dropped = [];
|
|
10949
|
+
if (_has_non_path_trigger(meta)) {
|
|
10950
|
+
for (const raw of derive_trigger_globs(meta)) {
|
|
10951
|
+
dropped.push({ pattern: raw, reason: "mixed-triggers" });
|
|
10952
|
+
}
|
|
10953
|
+
return { globs, dropped };
|
|
10954
|
+
}
|
|
10955
|
+
let spent = 0;
|
|
10956
|
+
for (const raw of derive_trigger_globs(meta)) {
|
|
10957
|
+
if (_is_unresolved_placeholder(raw)) {
|
|
10958
|
+
dropped.push({ pattern: raw, reason: "unresolved-placeholder" });
|
|
10959
|
+
continue;
|
|
10960
|
+
}
|
|
10961
|
+
const cost = _expanded_pattern_count(raw);
|
|
10962
|
+
if (spent + cost > CLAUDE_PATHS_PATTERN_BUDGET) {
|
|
10963
|
+
dropped.push({ pattern: raw, reason: "over-budget" });
|
|
10964
|
+
continue;
|
|
10965
|
+
}
|
|
10966
|
+
spent += cost;
|
|
10967
|
+
globs.push(_escape_claude_bracket(raw));
|
|
10968
|
+
}
|
|
10969
|
+
return { globs, dropped };
|
|
10970
|
+
}
|
|
10971
|
+
|
|
10972
|
+
// src/install/claudeRuleRewrite.ts
|
|
10973
|
+
var PRESERVED_KEYS = ["package", "source_path"];
|
|
10974
|
+
function _withPreservedKeys(rendered, original) {
|
|
10975
|
+
const keep = [];
|
|
10976
|
+
if (original.startsWith("---")) {
|
|
10977
|
+
const end = original.indexOf("\n---", 3);
|
|
10978
|
+
if (end !== -1) {
|
|
10979
|
+
for (const line of original.slice(3, end).split("\n")) {
|
|
10980
|
+
if (PRESERVED_KEYS.some((k) => line.startsWith(`${k}:`))) keep.push(line);
|
|
10981
|
+
}
|
|
10982
|
+
}
|
|
10983
|
+
}
|
|
10984
|
+
if (keep.length === 0) return rendered;
|
|
10985
|
+
if (rendered.startsWith("---\n")) {
|
|
10986
|
+
const end = rendered.indexOf("\n---", 3);
|
|
10987
|
+
if (end !== -1) {
|
|
10988
|
+
return rendered.slice(0, end) + "\n" + keep.join("\n") + rendered.slice(end);
|
|
10989
|
+
}
|
|
10990
|
+
}
|
|
10991
|
+
return ["---", ...keep, "---", "", rendered].join("\n");
|
|
10992
|
+
}
|
|
10993
|
+
function rewriteAndReport(rulesDir, quiet, info2, warn2, wrappers) {
|
|
10994
|
+
const result = rewriteClaudeRules(rulesDir);
|
|
10995
|
+
if (wrappers && !quiet) {
|
|
10996
|
+
if (wrappers.wrapped.length > 0) {
|
|
10997
|
+
info2(
|
|
10998
|
+
` claude-code: ${wrappers.wrapped.length} visible flat command(s) projected as skill wrappers (Claude Code flat-command discovery workaround)`
|
|
10999
|
+
);
|
|
11000
|
+
}
|
|
11001
|
+
if (wrappers.reserved.length > 0) {
|
|
11002
|
+
info2(
|
|
11003
|
+
` claude-code: ${wrappers.reserved.length} flat command(s) withheld \u2014 name is a Claude Code built-in (${wrappers.reserved.join(", ")}); nested /cluster:sub commands remain available`
|
|
11004
|
+
);
|
|
11005
|
+
}
|
|
11006
|
+
}
|
|
11007
|
+
if (result.rewritten > 0 && !quiet) {
|
|
11008
|
+
info2(
|
|
11009
|
+
` claude-code: ${result.rewritten} rule(s) rewritten to host form; ${result.scoped.length} path-scoped (${result.scoped.join(", ") || "none"})`
|
|
11010
|
+
);
|
|
11011
|
+
}
|
|
11012
|
+
if (result.dropped.length > 0 && !quiet) {
|
|
11013
|
+
const rules = [...new Set(result.dropped.map((d) => d.rule))];
|
|
11014
|
+
info2(
|
|
11015
|
+
` claude-code: ${rules.length} rule(s) keep unconditional activation (mixed path + keyword triggers; \`paths:\` is exclusive on this host)`
|
|
11016
|
+
);
|
|
11017
|
+
}
|
|
11018
|
+
for (const f of result.failed) {
|
|
11019
|
+
warn2(` claude-code: ${f.rule}: could not write host form \u2014 ${f.reason}`);
|
|
11020
|
+
}
|
|
11021
|
+
return result;
|
|
11022
|
+
}
|
|
11023
|
+
function pyRstrip(s) {
|
|
11024
|
+
return s.replace(/\s+$/u, "");
|
|
11025
|
+
}
|
|
11026
|
+
function yamlScalar(value) {
|
|
11027
|
+
return JSON.stringify(value);
|
|
11028
|
+
}
|
|
11029
|
+
function renderClaudeRule(sourceText) {
|
|
11030
|
+
const [meta, body] = parseFrontmatter(sourceText);
|
|
11031
|
+
const plan = _claude_paths_plan(meta);
|
|
11032
|
+
const lines = [];
|
|
11033
|
+
if (plan.globs.length > 0) {
|
|
11034
|
+
lines.push("---", "paths:");
|
|
11035
|
+
for (const g of plan.globs) {
|
|
11036
|
+
lines.push(` - ${yamlScalar(g)}`);
|
|
11037
|
+
}
|
|
11038
|
+
lines.push("---", "");
|
|
11039
|
+
}
|
|
11040
|
+
lines.push(pyRstrip(body) + "\n");
|
|
11041
|
+
return { text: lines.join("\n"), globs: plan.globs, dropped: plan.dropped };
|
|
11042
|
+
}
|
|
11043
|
+
function rewriteClaudeRules(rulesDir) {
|
|
11044
|
+
const result = { rewritten: 0, scoped: [], dropped: [], failed: [] };
|
|
11045
|
+
let entries;
|
|
11046
|
+
try {
|
|
11047
|
+
entries = fs18.readdirSync(rulesDir);
|
|
11048
|
+
} catch {
|
|
11049
|
+
return result;
|
|
11050
|
+
}
|
|
11051
|
+
for (const name of entries.filter((n) => n.endsWith(".md")).sort()) {
|
|
11052
|
+
const full = path16.join(rulesDir, name);
|
|
11053
|
+
let stat;
|
|
11054
|
+
try {
|
|
11055
|
+
stat = fs18.lstatSync(full);
|
|
11056
|
+
} catch {
|
|
11057
|
+
continue;
|
|
11058
|
+
}
|
|
11059
|
+
if (!stat.isFile() || stat.isSymbolicLink()) continue;
|
|
11060
|
+
let text;
|
|
11061
|
+
try {
|
|
11062
|
+
text = fs18.readFileSync(full, "utf-8");
|
|
11063
|
+
} catch {
|
|
11064
|
+
continue;
|
|
11065
|
+
}
|
|
11066
|
+
const [meta] = parseFrontmatter(text);
|
|
11067
|
+
if (meta["paths"] !== void 0 && meta["triggers"] === void 0) continue;
|
|
11068
|
+
const rendered = renderClaudeRule(text);
|
|
11069
|
+
const withOwnership = _withPreservedKeys(rendered.text, text);
|
|
11070
|
+
if (withOwnership !== text) {
|
|
11071
|
+
try {
|
|
11072
|
+
fs18.writeFileSync(full, withOwnership, "utf-8");
|
|
11073
|
+
} catch (e) {
|
|
11074
|
+
result.failed.push({
|
|
11075
|
+
rule: name.slice(0, -3),
|
|
11076
|
+
reason: e instanceof Error ? e.message : String(e)
|
|
11077
|
+
});
|
|
11078
|
+
continue;
|
|
11079
|
+
}
|
|
11080
|
+
result.rewritten += 1;
|
|
11081
|
+
}
|
|
11082
|
+
const stem = name.slice(0, -3);
|
|
11083
|
+
if (rendered.globs.length > 0) result.scoped.push(stem);
|
|
11084
|
+
for (const d of rendered.dropped) {
|
|
11085
|
+
result.dropped.push({ rule: stem, pattern: d.pattern, reason: d.reason });
|
|
11086
|
+
}
|
|
11087
|
+
}
|
|
11088
|
+
return result;
|
|
11089
|
+
}
|
|
11090
|
+
|
|
10889
11091
|
// src/install/wizard-plan.ts
|
|
10890
11092
|
var RULE_SOURCE_REL = "dist/agent-src/rules";
|
|
10891
11093
|
|
|
@@ -11437,8 +11639,8 @@ function getErrorMap() {
|
|
|
11437
11639
|
|
|
11438
11640
|
// node_modules/zod/v3/helpers/parseUtil.js
|
|
11439
11641
|
var makeIssue = (params) => {
|
|
11440
|
-
const { data, path:
|
|
11441
|
-
const fullPath = [...
|
|
11642
|
+
const { data, path: path21, errorMaps, issueData } = params;
|
|
11643
|
+
const fullPath = [...path21, ...issueData.path || []];
|
|
11442
11644
|
const fullIssue = {
|
|
11443
11645
|
...issueData,
|
|
11444
11646
|
path: fullPath
|
|
@@ -11554,11 +11756,11 @@ var errorUtil;
|
|
|
11554
11756
|
|
|
11555
11757
|
// node_modules/zod/v3/types.js
|
|
11556
11758
|
var ParseInputLazyPath = class {
|
|
11557
|
-
constructor(parent, value,
|
|
11759
|
+
constructor(parent, value, path21, key) {
|
|
11558
11760
|
this._cachedPath = [];
|
|
11559
11761
|
this.parent = parent;
|
|
11560
11762
|
this.data = value;
|
|
11561
|
-
this._path =
|
|
11763
|
+
this._path = path21;
|
|
11562
11764
|
this._key = key;
|
|
11563
11765
|
}
|
|
11564
11766
|
get path() {
|
|
@@ -15481,6 +15683,11 @@ var settingsSchema = external_exports.object({
|
|
|
15481
15683
|
"PostToolUse prompt-injection scanner (road-to-security-pillar.md P3.2). Default off. When on, scans tool output (file reads, web fetches, MCP responses) for injection signatures and WARNS in context (never blocks). Runtime backstop on top of the always-on untrusted-input-defense rule; detection is probabilistic."
|
|
15482
15684
|
)
|
|
15483
15685
|
}).default({}),
|
|
15686
|
+
runtime_journal: external_exports.object({
|
|
15687
|
+
enabled: external_exports.boolean().default(false).describe(
|
|
15688
|
+
"Runtime event journal (road-to-runtime-event-journal Phase 1). Default off. When on, one durable, episode-keyed record per dispatched hook event is appended to <git-common-dir>/agent-journal/journal.sqlite \u2014 a Class-A write that opens, writes and exits. It emits nothing to the model, never warns and never blocks: a locked database, a missing node:sqlite, a malformed envelope or a full disk all degrade to silence. Off rather than on because it CREATES a storage surface (a SQLite database under your .git/) rather than appending to a directory that already exists. The record type has no field able to hold free-form content \u2014 ids, an event name, a bounded capability identifier, repo-relative locators and two 12-hex digests; no prompt, no file body, no absolute path. Retention: a 30-day TTL anchored on episode close, plus explicit, time-bounded, human-only holds that themselves expire."
|
|
15689
|
+
)
|
|
15690
|
+
}).default({}),
|
|
15484
15691
|
rtk_wrap: external_exports.object({
|
|
15485
15692
|
enabled: external_exports.boolean().default(false).describe(
|
|
15486
15693
|
'PreToolUse RTK-wrap nudge (token-saving Phase 3). Default off. When on AND the binary on PATH is verified as Rust Token Killer (a live two-stage identity probe \u2014 not a self-reported flag, and never a colliding same-name binary), warns (never blocks) "re-run wrapped with rtk" before a single verbose CLI command (git/npm/cargo/docker/\u2026) \u2014 upstream reports 60\u201390% output-token savings (their estimate). Skips completeness-critical / piped / compound commands and git diff. No-op when rtk is absent, unverified, or a different tool.'
|
|
@@ -16846,8 +17053,8 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
16846
17053
|
};
|
|
16847
17054
|
|
|
16848
17055
|
// src/scripts/_lib/module_detection.ts
|
|
16849
|
-
import * as
|
|
16850
|
-
import * as
|
|
17056
|
+
import * as fs19 from "node:fs";
|
|
17057
|
+
import * as path17 from "node:path";
|
|
16851
17058
|
var _SKIP_DIRS = /* @__PURE__ */ new Set([".module-template", ".example"]);
|
|
16852
17059
|
var _RULES = [
|
|
16853
17060
|
["app/Modules", "laravel-hmvc", "App\\Modules\\{ModuleName}"],
|
|
@@ -16861,14 +17068,14 @@ var _RULES = [
|
|
|
16861
17068
|
];
|
|
16862
17069
|
function _isDir(p) {
|
|
16863
17070
|
try {
|
|
16864
|
-
return
|
|
17071
|
+
return fs19.statSync(p).isDirectory();
|
|
16865
17072
|
} catch {
|
|
16866
17073
|
return false;
|
|
16867
17074
|
}
|
|
16868
17075
|
}
|
|
16869
17076
|
function _isFile(p) {
|
|
16870
17077
|
try {
|
|
16871
|
-
return
|
|
17078
|
+
return fs19.statSync(p).isFile();
|
|
16872
17079
|
} catch {
|
|
16873
17080
|
return false;
|
|
16874
17081
|
}
|
|
@@ -16882,13 +17089,13 @@ function _isUpperChar(ch) {
|
|
|
16882
17089
|
function _list_module_subdirs(root) {
|
|
16883
17090
|
let entries;
|
|
16884
17091
|
try {
|
|
16885
|
-
entries =
|
|
17092
|
+
entries = fs19.readdirSync(root).sort();
|
|
16886
17093
|
} catch {
|
|
16887
17094
|
return [];
|
|
16888
17095
|
}
|
|
16889
17096
|
const out = [];
|
|
16890
17097
|
for (const name of entries) {
|
|
16891
|
-
if (!_isDir(
|
|
17098
|
+
if (!_isDir(path17.join(root, name))) {
|
|
16892
17099
|
continue;
|
|
16893
17100
|
}
|
|
16894
17101
|
if (name.startsWith(".")) {
|
|
@@ -16910,11 +17117,11 @@ function _score_confidence(stack, root, subdirs) {
|
|
|
16910
17117
|
return capitalized.length > 0 ? "high" : "medium";
|
|
16911
17118
|
}
|
|
16912
17119
|
if (stack === "node-monorepo") {
|
|
16913
|
-
const withPkgJson = subdirs.filter((name) => _isFile(
|
|
17120
|
+
const withPkgJson = subdirs.filter((name) => _isFile(path17.join(root, name, "package.json")));
|
|
16914
17121
|
return withPkgJson.length > 0 ? "high" : "medium";
|
|
16915
17122
|
}
|
|
16916
17123
|
if (stack === "python-src") {
|
|
16917
|
-
const withInit = subdirs.filter((name) => _isFile(
|
|
17124
|
+
const withInit = subdirs.filter((name) => _isFile(path17.join(root, name, "__init__.py")));
|
|
16918
17125
|
return withInit.length > 0 ? "high" : "medium";
|
|
16919
17126
|
}
|
|
16920
17127
|
if (stack === "go-internal") {
|
|
@@ -16926,7 +17133,7 @@ function detect_module_roots(project_root) {
|
|
|
16926
17133
|
const high = [];
|
|
16927
17134
|
const medium = [];
|
|
16928
17135
|
for (const [rel_path, stack, namespace_template] of _RULES) {
|
|
16929
|
-
const abs_path =
|
|
17136
|
+
const abs_path = path17.join(project_root, rel_path);
|
|
16930
17137
|
if (!_isDir(abs_path)) {
|
|
16931
17138
|
continue;
|
|
16932
17139
|
}
|
|
@@ -16948,7 +17155,7 @@ function detect_module_roots(project_root) {
|
|
|
16948
17155
|
}
|
|
16949
17156
|
|
|
16950
17157
|
// src/scripts/_lib/model_tier.ts
|
|
16951
|
-
import
|
|
17158
|
+
import fs20 from "node:fs";
|
|
16952
17159
|
var TIER_TO_CLAUDE_MODEL = {
|
|
16953
17160
|
frontier: "fable",
|
|
16954
17161
|
high: "opus",
|
|
@@ -16957,8 +17164,8 @@ var TIER_TO_CLAUDE_MODEL = {
|
|
|
16957
17164
|
};
|
|
16958
17165
|
var MODEL_TIER_RE = /^model_tier:\s*"?([a-z]+)"?\s*$/m;
|
|
16959
17166
|
function read_model_tier(skill_md) {
|
|
16960
|
-
if (!
|
|
16961
|
-
const text =
|
|
17167
|
+
if (!fs20.existsSync(skill_md)) return null;
|
|
17168
|
+
const text = fs20.readFileSync(skill_md).toString("utf-8");
|
|
16962
17169
|
if (!text.startsWith("---\n")) return null;
|
|
16963
17170
|
const end = text.indexOf("\n---\n", 4);
|
|
16964
17171
|
if (end === -1) return null;
|
|
@@ -16975,39 +17182,39 @@ function render_native_model_md(text, tier) {
|
|
|
16975
17182
|
|
|
16976
17183
|
// src/scripts/_cli/cmd_migrate.ts
|
|
16977
17184
|
import { spawnSync } from "node:child_process";
|
|
16978
|
-
import * as
|
|
16979
|
-
import * as
|
|
17185
|
+
import * as fs22 from "node:fs";
|
|
17186
|
+
import * as path19 from "node:path";
|
|
16980
17187
|
import process2 from "node:process";
|
|
16981
17188
|
import { fileURLToPath as fileURLToPath4, pathToFileURL } from "node:url";
|
|
16982
17189
|
|
|
16983
17190
|
// src/scripts/_lib/package_root.ts
|
|
16984
|
-
import * as
|
|
16985
|
-
import * as
|
|
17191
|
+
import * as fs21 from "node:fs";
|
|
17192
|
+
import * as path18 from "node:path";
|
|
16986
17193
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
16987
17194
|
var PACKAGE_NAME = "@event4u/agent-config";
|
|
16988
17195
|
var MAX_ASCENT = 16;
|
|
16989
17196
|
function resolvePackageRoot(fromUrlOrPath, legacyHops = 3) {
|
|
16990
17197
|
const start = fromUrlOrPath.startsWith("file:") ? fileURLToPath3(fromUrlOrPath) : fromUrlOrPath;
|
|
16991
|
-
const startDir =
|
|
17198
|
+
const startDir = path18.dirname(start);
|
|
16992
17199
|
let dir = startDir;
|
|
16993
17200
|
for (let i = 0; i < MAX_ASCENT; i++) {
|
|
16994
|
-
const manifest =
|
|
16995
|
-
if (
|
|
17201
|
+
const manifest = path18.join(dir, "package.json");
|
|
17202
|
+
if (fs21.existsSync(manifest)) {
|
|
16996
17203
|
try {
|
|
16997
|
-
const parsed = JSON.parse(
|
|
17204
|
+
const parsed = JSON.parse(fs21.readFileSync(manifest, "utf8"));
|
|
16998
17205
|
if (parsed.name === PACKAGE_NAME) {
|
|
16999
17206
|
return dir;
|
|
17000
17207
|
}
|
|
17001
17208
|
} catch {
|
|
17002
17209
|
}
|
|
17003
17210
|
}
|
|
17004
|
-
const parent =
|
|
17211
|
+
const parent = path18.dirname(dir);
|
|
17005
17212
|
if (parent === dir) {
|
|
17006
17213
|
break;
|
|
17007
17214
|
}
|
|
17008
17215
|
dir = parent;
|
|
17009
17216
|
}
|
|
17010
|
-
return
|
|
17217
|
+
return path18.resolve(startDir, ...Array.from({ length: legacyHops }, () => ".."));
|
|
17011
17218
|
}
|
|
17012
17219
|
|
|
17013
17220
|
// src/scripts/_cli/cmd_migrate.ts
|
|
@@ -17028,7 +17235,7 @@ var LEGACY_SETTINGS_FILES = [".agent-settings.yml", ".agent-user.yml"];
|
|
|
17028
17235
|
var LEGACY_STATE_FILENAME = ".implement-ticket-state.json";
|
|
17029
17236
|
var LEGACY_STATE_V1_FILENAME = ".work-state.json";
|
|
17030
17237
|
var LEGACY_AGENT_CONFIG_SHELL = "agent-config";
|
|
17031
|
-
var _HERE_DIR =
|
|
17238
|
+
var _HERE_DIR = path19.dirname(fileURLToPath4(import.meta.url));
|
|
17032
17239
|
var ArgparseExit = class extends Error {
|
|
17033
17240
|
code;
|
|
17034
17241
|
constructor(code) {
|
|
@@ -17127,38 +17334,38 @@ function _jsonDumpsIndentAscii(value, indent) {
|
|
|
17127
17334
|
}
|
|
17128
17335
|
function _isFile2(p) {
|
|
17129
17336
|
try {
|
|
17130
|
-
return
|
|
17337
|
+
return fs22.statSync(p).isFile();
|
|
17131
17338
|
} catch {
|
|
17132
17339
|
return false;
|
|
17133
17340
|
}
|
|
17134
17341
|
}
|
|
17135
17342
|
function _isDir2(p) {
|
|
17136
17343
|
try {
|
|
17137
|
-
return
|
|
17344
|
+
return fs22.statSync(p).isDirectory();
|
|
17138
17345
|
} catch {
|
|
17139
17346
|
return false;
|
|
17140
17347
|
}
|
|
17141
17348
|
}
|
|
17142
17349
|
function _isSymlink(p) {
|
|
17143
17350
|
try {
|
|
17144
|
-
return
|
|
17351
|
+
return fs22.lstatSync(p).isSymbolicLink();
|
|
17145
17352
|
} catch {
|
|
17146
17353
|
return false;
|
|
17147
17354
|
}
|
|
17148
17355
|
}
|
|
17149
17356
|
function _exists2(p) {
|
|
17150
17357
|
try {
|
|
17151
|
-
|
|
17358
|
+
fs22.lstatSync(p);
|
|
17152
17359
|
return true;
|
|
17153
17360
|
} catch {
|
|
17154
17361
|
return false;
|
|
17155
17362
|
}
|
|
17156
17363
|
}
|
|
17157
17364
|
function _readText(p) {
|
|
17158
|
-
return
|
|
17365
|
+
return fs22.readFileSync(p, { encoding: "utf-8" });
|
|
17159
17366
|
}
|
|
17160
17367
|
function _writeText(p, text) {
|
|
17161
|
-
|
|
17368
|
+
fs22.writeFileSync(p, text, { encoding: "utf-8" });
|
|
17162
17369
|
}
|
|
17163
17370
|
function _jsonLoadFile(p) {
|
|
17164
17371
|
return JSON.parse(_readText(p));
|
|
@@ -17214,7 +17421,7 @@ function _classify_symlink(link) {
|
|
|
17214
17421
|
}
|
|
17215
17422
|
let target;
|
|
17216
17423
|
try {
|
|
17217
|
-
target =
|
|
17424
|
+
target = fs22.readlinkSync(link);
|
|
17218
17425
|
} catch {
|
|
17219
17426
|
return null;
|
|
17220
17427
|
}
|
|
@@ -17225,16 +17432,16 @@ function _classify_symlink(link) {
|
|
|
17225
17432
|
return "user";
|
|
17226
17433
|
}
|
|
17227
17434
|
function _detect_legacy_state(project) {
|
|
17228
|
-
return _isFile2(
|
|
17435
|
+
return _isFile2(path19.join(project, LEGACY_STATE_FILENAME));
|
|
17229
17436
|
}
|
|
17230
17437
|
function _detect_legacy_settings(project) {
|
|
17231
17438
|
const found = [];
|
|
17232
17439
|
for (const name of LEGACY_SETTINGS_FILES) {
|
|
17233
|
-
const flat =
|
|
17440
|
+
const flat = path19.join(project, name);
|
|
17234
17441
|
if (_isFile2(flat)) {
|
|
17235
17442
|
found.push(flat);
|
|
17236
17443
|
}
|
|
17237
|
-
const typed =
|
|
17444
|
+
const typed = path19.join(project, "settings", name);
|
|
17238
17445
|
if (_isFile2(typed)) {
|
|
17239
17446
|
found.push(typed);
|
|
17240
17447
|
}
|
|
@@ -17242,25 +17449,25 @@ function _detect_legacy_settings(project) {
|
|
|
17242
17449
|
return found;
|
|
17243
17450
|
}
|
|
17244
17451
|
function _detect_empty_shell(project) {
|
|
17245
|
-
const shell =
|
|
17452
|
+
const shell = path19.join(project, LEGACY_AGENT_CONFIG_SHELL);
|
|
17246
17453
|
if (!_isDir2(shell) || _isSymlink(shell)) {
|
|
17247
17454
|
return false;
|
|
17248
17455
|
}
|
|
17249
17456
|
try {
|
|
17250
|
-
return
|
|
17457
|
+
return fs22.readdirSync(shell).length === 0;
|
|
17251
17458
|
} catch {
|
|
17252
17459
|
return false;
|
|
17253
17460
|
}
|
|
17254
17461
|
}
|
|
17255
17462
|
function _detect_already_migrated(project) {
|
|
17256
|
-
if (_detect_npm(
|
|
17463
|
+
if (_detect_npm(path19.join(project, "package.json"))) {
|
|
17257
17464
|
return false;
|
|
17258
17465
|
}
|
|
17259
|
-
if (_detect_composer(
|
|
17466
|
+
if (_detect_composer(path19.join(project, "composer.json"))) {
|
|
17260
17467
|
return false;
|
|
17261
17468
|
}
|
|
17262
17469
|
for (const name of MANAGED_SYMLINKS) {
|
|
17263
|
-
if (_classify_symlink(
|
|
17470
|
+
if (_classify_symlink(path19.join(project, name)) === "legacy") {
|
|
17264
17471
|
return false;
|
|
17265
17472
|
}
|
|
17266
17473
|
}
|
|
@@ -17331,11 +17538,11 @@ function _purge_legacy_symlinks(project) {
|
|
|
17331
17538
|
const removed = [];
|
|
17332
17539
|
const preserved = [];
|
|
17333
17540
|
for (const name of MANAGED_SYMLINKS) {
|
|
17334
|
-
const link =
|
|
17541
|
+
const link = path19.join(project, name);
|
|
17335
17542
|
const kind = _classify_symlink(link);
|
|
17336
17543
|
if (kind === "legacy") {
|
|
17337
17544
|
try {
|
|
17338
|
-
|
|
17545
|
+
fs22.unlinkSync(link);
|
|
17339
17546
|
removed.push(name);
|
|
17340
17547
|
} catch {
|
|
17341
17548
|
preserved.push(name);
|
|
@@ -17347,14 +17554,14 @@ function _purge_legacy_symlinks(project) {
|
|
|
17347
17554
|
return [removed, preserved];
|
|
17348
17555
|
}
|
|
17349
17556
|
function _migrate_state_file(project) {
|
|
17350
|
-
const source =
|
|
17557
|
+
const source = path19.join(project, LEGACY_STATE_FILENAME);
|
|
17351
17558
|
if (!_isFile2(source)) {
|
|
17352
17559
|
return null;
|
|
17353
17560
|
}
|
|
17354
|
-
const target =
|
|
17561
|
+
const target = path19.join(project, LEGACY_STATE_V1_FILENAME);
|
|
17355
17562
|
if (_exists2(target)) {
|
|
17356
17563
|
try {
|
|
17357
|
-
|
|
17564
|
+
fs22.unlinkSync(source);
|
|
17358
17565
|
return `removed stale ${LEGACY_STATE_FILENAME} (v1 already present)`;
|
|
17359
17566
|
} catch {
|
|
17360
17567
|
return null;
|
|
@@ -17369,7 +17576,7 @@ function _migrate_state_file(project) {
|
|
|
17369
17576
|
}
|
|
17370
17577
|
function _load_state_migrator() {
|
|
17371
17578
|
const pkg_root = resolvePackageRoot(import.meta.url);
|
|
17372
|
-
const rel =
|
|
17579
|
+
const rel = path19.join(
|
|
17373
17580
|
"agent-src",
|
|
17374
17581
|
"templates",
|
|
17375
17582
|
"scripts",
|
|
@@ -17377,8 +17584,8 @@ function _load_state_migrator() {
|
|
|
17377
17584
|
"migration",
|
|
17378
17585
|
"v0_to_v1.ts"
|
|
17379
17586
|
);
|
|
17380
|
-
const driver = [
|
|
17381
|
-
(p) =>
|
|
17587
|
+
const driver = [path19.join(pkg_root, "dist", rel), path19.join(pkg_root, "src", rel)].find(
|
|
17588
|
+
(p) => fs22.existsSync(p)
|
|
17382
17589
|
) ?? null;
|
|
17383
17590
|
if (driver === null) {
|
|
17384
17591
|
return null;
|
|
@@ -17386,12 +17593,12 @@ function _load_state_migrator() {
|
|
|
17386
17593
|
const binName = process2.platform === "win32" ? "tsx.cmd" : "tsx";
|
|
17387
17594
|
let tsxBin = null;
|
|
17388
17595
|
for (let dir = pkg_root; ; ) {
|
|
17389
|
-
const cand =
|
|
17390
|
-
if (
|
|
17596
|
+
const cand = path19.join(dir, "node_modules", ".bin", binName);
|
|
17597
|
+
if (fs22.existsSync(cand)) {
|
|
17391
17598
|
tsxBin = cand;
|
|
17392
17599
|
break;
|
|
17393
17600
|
}
|
|
17394
|
-
const parent =
|
|
17601
|
+
const parent = path19.dirname(dir);
|
|
17395
17602
|
if (parent === dir) break;
|
|
17396
17603
|
dir = parent;
|
|
17397
17604
|
}
|
|
@@ -17418,17 +17625,17 @@ function _delete_legacy_settings(project) {
|
|
|
17418
17625
|
const removed = [];
|
|
17419
17626
|
for (const p of _detect_legacy_settings(project)) {
|
|
17420
17627
|
try {
|
|
17421
|
-
|
|
17422
|
-
removed.push(
|
|
17628
|
+
fs22.unlinkSync(p);
|
|
17629
|
+
removed.push(path19.relative(project, p));
|
|
17423
17630
|
} catch {
|
|
17424
17631
|
continue;
|
|
17425
17632
|
}
|
|
17426
17633
|
}
|
|
17427
|
-
const settings_dir =
|
|
17634
|
+
const settings_dir = path19.join(project, "settings");
|
|
17428
17635
|
if (_isDir2(settings_dir) && !_isSymlink(settings_dir)) {
|
|
17429
17636
|
try {
|
|
17430
|
-
if (
|
|
17431
|
-
|
|
17637
|
+
if (fs22.readdirSync(settings_dir).length === 0) {
|
|
17638
|
+
fs22.rmdirSync(settings_dir);
|
|
17432
17639
|
removed.push("settings/");
|
|
17433
17640
|
}
|
|
17434
17641
|
} catch {
|
|
@@ -17437,12 +17644,12 @@ function _delete_legacy_settings(project) {
|
|
|
17437
17644
|
return removed;
|
|
17438
17645
|
}
|
|
17439
17646
|
function _remove_empty_shell(project) {
|
|
17440
|
-
const shell =
|
|
17647
|
+
const shell = path19.join(project, LEGACY_AGENT_CONFIG_SHELL);
|
|
17441
17648
|
if (!_detect_empty_shell(project)) {
|
|
17442
17649
|
return false;
|
|
17443
17650
|
}
|
|
17444
17651
|
try {
|
|
17445
|
-
|
|
17652
|
+
fs22.rmdirSync(shell);
|
|
17446
17653
|
} catch {
|
|
17447
17654
|
return false;
|
|
17448
17655
|
}
|
|
@@ -17452,7 +17659,7 @@ function _reEscape(s) {
|
|
|
17452
17659
|
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
17453
17660
|
}
|
|
17454
17661
|
function _update_gitignore(project) {
|
|
17455
|
-
const gitignore =
|
|
17662
|
+
const gitignore = path19.join(project, ".gitignore");
|
|
17456
17663
|
const block = `${GITIGNORE_BLOCK_START}
|
|
17457
17664
|
${GITIGNORE_NEW_BODY}${GITIGNORE_BLOCK_END}
|
|
17458
17665
|
`;
|
|
@@ -17483,16 +17690,16 @@ ${GITIGNORE_NEW_BODY}${GITIGNORE_BLOCK_END}
|
|
|
17483
17690
|
}
|
|
17484
17691
|
function _build_plan(project) {
|
|
17485
17692
|
return {
|
|
17486
|
-
npm: _detect_npm(
|
|
17487
|
-
composer: _detect_composer(
|
|
17693
|
+
npm: _detect_npm(path19.join(project, "package.json")),
|
|
17694
|
+
composer: _detect_composer(path19.join(project, "composer.json")),
|
|
17488
17695
|
symlinks_legacy: MANAGED_SYMLINKS.filter(
|
|
17489
|
-
(name) => _classify_symlink(
|
|
17696
|
+
(name) => _classify_symlink(path19.join(project, name)) === "legacy"
|
|
17490
17697
|
),
|
|
17491
17698
|
symlinks_user: MANAGED_SYMLINKS.filter(
|
|
17492
|
-
(name) => _classify_symlink(
|
|
17699
|
+
(name) => _classify_symlink(path19.join(project, name)) === "user"
|
|
17493
17700
|
),
|
|
17494
|
-
state_file: _isFile2(
|
|
17495
|
-
settings_files: _detect_legacy_settings(project).map((p) =>
|
|
17701
|
+
state_file: _isFile2(path19.join(project, LEGACY_STATE_FILENAME)),
|
|
17702
|
+
settings_files: _detect_legacy_settings(project).map((p) => path19.relative(project, p)),
|
|
17496
17703
|
empty_shell: _detect_empty_shell(project)
|
|
17497
17704
|
};
|
|
17498
17705
|
}
|
|
@@ -17556,10 +17763,10 @@ function _warn_on_major_mismatch(from_major, plan, out) {
|
|
|
17556
17763
|
}
|
|
17557
17764
|
function _apply(project, out, err) {
|
|
17558
17765
|
const summary = [];
|
|
17559
|
-
if (_strip_npm_entry(
|
|
17766
|
+
if (_strip_npm_entry(path19.join(project, "package.json"))) {
|
|
17560
17767
|
summary.push(`removed ${PACKAGE_NAME_NPM} from package.json`);
|
|
17561
17768
|
}
|
|
17562
|
-
if (_strip_composer_entry(
|
|
17769
|
+
if (_strip_composer_entry(path19.join(project, "composer.json"))) {
|
|
17563
17770
|
summary.push(`removed ${PACKAGE_NAME_COMPOSER} from composer.json`);
|
|
17564
17771
|
}
|
|
17565
17772
|
const [removed_links, preserved_links] = _purge_legacy_symlinks(project);
|
|
@@ -17686,17 +17893,17 @@ function _isCliEntry() {
|
|
|
17686
17893
|
return false;
|
|
17687
17894
|
}
|
|
17688
17895
|
if (typeof __AGENT_CONFIG_CLI_DELEGATE__ !== "undefined" && __AGENT_CONFIG_CLI_DELEGATE__) {
|
|
17689
|
-
if (
|
|
17896
|
+
if (path19.basename(process2.argv[1], ".js") === "cmd_migrate") {
|
|
17690
17897
|
return true;
|
|
17691
17898
|
}
|
|
17692
17899
|
}
|
|
17693
|
-
const argvUrl = pathToFileURL(
|
|
17900
|
+
const argvUrl = pathToFileURL(path19.resolve(process2.argv[1])).href;
|
|
17694
17901
|
if (import.meta.url === argvUrl) {
|
|
17695
17902
|
return true;
|
|
17696
17903
|
}
|
|
17697
17904
|
try {
|
|
17698
|
-
const here =
|
|
17699
|
-
const argv =
|
|
17905
|
+
const here = fs22.realpathSync(fileURLToPath4(import.meta.url));
|
|
17906
|
+
const argv = fs22.realpathSync(path19.resolve(process2.argv[1]));
|
|
17700
17907
|
return here === argv;
|
|
17701
17908
|
} catch {
|
|
17702
17909
|
return false;
|
|
@@ -17714,6 +17921,30 @@ if (!_inForeignBundle && (_isCliEntry() || process2.argv[1] === _HERE)) {
|
|
|
17714
17921
|
}
|
|
17715
17922
|
}
|
|
17716
17923
|
|
|
17924
|
+
// src/install/detect.ts
|
|
17925
|
+
var SCOPE_DETECT_MANIFESTS = [
|
|
17926
|
+
"package.json",
|
|
17927
|
+
"composer.json",
|
|
17928
|
+
"pyproject.toml",
|
|
17929
|
+
"Cargo.toml",
|
|
17930
|
+
"go.mod",
|
|
17931
|
+
"Gemfile"
|
|
17932
|
+
];
|
|
17933
|
+
var SCOPE_DETECT_AI_DIRS = [
|
|
17934
|
+
".claude",
|
|
17935
|
+
".cursor",
|
|
17936
|
+
".windsurf",
|
|
17937
|
+
".augment",
|
|
17938
|
+
".clinerules",
|
|
17939
|
+
".copilot",
|
|
17940
|
+
".gemini",
|
|
17941
|
+
".codex",
|
|
17942
|
+
".aider",
|
|
17943
|
+
".continue",
|
|
17944
|
+
".roo",
|
|
17945
|
+
".kilocode"
|
|
17946
|
+
];
|
|
17947
|
+
|
|
17717
17948
|
// src/scripts/install.ts
|
|
17718
17949
|
var _HERE2 = fileURLToPath5(import.meta.url);
|
|
17719
17950
|
var SystemExitError = class extends Error {
|
|
@@ -17733,34 +17964,34 @@ var ArgparseExit2 = class extends Error {
|
|
|
17733
17964
|
function expanduser6(p) {
|
|
17734
17965
|
if (p === "~") return os8.homedir();
|
|
17735
17966
|
if (p.startsWith("~/") || p.startsWith("~\\")) {
|
|
17736
|
-
return
|
|
17967
|
+
return path20.join(os8.homedir(), p.slice(2));
|
|
17737
17968
|
}
|
|
17738
17969
|
return p;
|
|
17739
17970
|
}
|
|
17740
17971
|
function resolvePath(p) {
|
|
17741
17972
|
try {
|
|
17742
|
-
return
|
|
17973
|
+
return fs23.realpathSync(path20.resolve(p));
|
|
17743
17974
|
} catch {
|
|
17744
|
-
return
|
|
17975
|
+
return path20.resolve(p);
|
|
17745
17976
|
}
|
|
17746
17977
|
}
|
|
17747
17978
|
function isFile(p) {
|
|
17748
17979
|
try {
|
|
17749
|
-
return
|
|
17980
|
+
return fs23.statSync(p).isFile();
|
|
17750
17981
|
} catch {
|
|
17751
17982
|
return false;
|
|
17752
17983
|
}
|
|
17753
17984
|
}
|
|
17754
17985
|
function isDir(p) {
|
|
17755
17986
|
try {
|
|
17756
|
-
return
|
|
17987
|
+
return fs23.statSync(p).isDirectory();
|
|
17757
17988
|
} catch {
|
|
17758
17989
|
return false;
|
|
17759
17990
|
}
|
|
17760
17991
|
}
|
|
17761
17992
|
function pathExists(p) {
|
|
17762
17993
|
try {
|
|
17763
|
-
|
|
17994
|
+
fs23.statSync(p);
|
|
17764
17995
|
return true;
|
|
17765
17996
|
} catch {
|
|
17766
17997
|
return false;
|
|
@@ -17768,24 +17999,24 @@ function pathExists(p) {
|
|
|
17768
17999
|
}
|
|
17769
18000
|
function isSymlink(p) {
|
|
17770
18001
|
try {
|
|
17771
|
-
return
|
|
18002
|
+
return fs23.lstatSync(p).isSymbolicLink();
|
|
17772
18003
|
} catch {
|
|
17773
18004
|
return false;
|
|
17774
18005
|
}
|
|
17775
18006
|
}
|
|
17776
18007
|
function readText(p) {
|
|
17777
|
-
return
|
|
18008
|
+
return fs23.readFileSync(p, "utf-8");
|
|
17778
18009
|
}
|
|
17779
18010
|
function writeText(p, content) {
|
|
17780
|
-
|
|
18011
|
+
fs23.writeFileSync(p, content, "utf-8");
|
|
17781
18012
|
}
|
|
17782
18013
|
function mkdirp(p) {
|
|
17783
|
-
|
|
18014
|
+
fs23.mkdirSync(p, { recursive: true });
|
|
17784
18015
|
}
|
|
17785
18016
|
function sortedGlobStems(directory, suffix) {
|
|
17786
18017
|
let entries;
|
|
17787
18018
|
try {
|
|
17788
|
-
entries =
|
|
18019
|
+
entries = fs23.readdirSync(directory);
|
|
17789
18020
|
} catch {
|
|
17790
18021
|
return [];
|
|
17791
18022
|
}
|
|
@@ -17805,7 +18036,7 @@ function sortedGlobStems(directory, suffix) {
|
|
|
17805
18036
|
function countZips(directory) {
|
|
17806
18037
|
if (!isDir(directory)) return 0;
|
|
17807
18038
|
let n = 0;
|
|
17808
|
-
for (const name of
|
|
18039
|
+
for (const name of fs23.readdirSync(directory)) {
|
|
17809
18040
|
if (name.endsWith(".zip")) n += 1;
|
|
17810
18041
|
}
|
|
17811
18042
|
return n;
|
|
@@ -17813,35 +18044,35 @@ function countZips(directory) {
|
|
|
17813
18044
|
function sha256OfFile(p) {
|
|
17814
18045
|
let data;
|
|
17815
18046
|
try {
|
|
17816
|
-
data =
|
|
18047
|
+
data = fs23.readFileSync(p);
|
|
17817
18048
|
} catch {
|
|
17818
18049
|
return null;
|
|
17819
18050
|
}
|
|
17820
18051
|
return crypto3.createHash("sha256").update(data).digest("hex");
|
|
17821
18052
|
}
|
|
17822
18053
|
function atomicWrite0644(target, body, prefix) {
|
|
17823
|
-
const dir =
|
|
17824
|
-
const tmpName =
|
|
18054
|
+
const dir = path20.dirname(target);
|
|
18055
|
+
const tmpName = path20.join(
|
|
17825
18056
|
dir,
|
|
17826
18057
|
`${prefix}${process3.pid}.${crypto3.randomBytes(6).toString("hex")}.yml.tmp`
|
|
17827
18058
|
);
|
|
17828
18059
|
let fd = null;
|
|
17829
18060
|
try {
|
|
17830
|
-
fd =
|
|
17831
|
-
|
|
17832
|
-
|
|
18061
|
+
fd = fs23.openSync(tmpName, "wx", 420);
|
|
18062
|
+
fs23.writeFileSync(fd, body, "utf-8");
|
|
18063
|
+
fs23.closeSync(fd);
|
|
17833
18064
|
fd = null;
|
|
17834
|
-
|
|
17835
|
-
|
|
18065
|
+
fs23.chmodSync(tmpName, 420);
|
|
18066
|
+
fs23.renameSync(tmpName, target);
|
|
17836
18067
|
} catch (err) {
|
|
17837
18068
|
if (fd !== null) {
|
|
17838
18069
|
try {
|
|
17839
|
-
|
|
18070
|
+
fs23.closeSync(fd);
|
|
17840
18071
|
} catch {
|
|
17841
18072
|
}
|
|
17842
18073
|
}
|
|
17843
18074
|
try {
|
|
17844
|
-
|
|
18075
|
+
fs23.unlinkSync(tmpName);
|
|
17845
18076
|
} catch {
|
|
17846
18077
|
}
|
|
17847
18078
|
throw err;
|
|
@@ -17965,12 +18196,12 @@ var LEGACY_SETTINGS_FILE = ".agent-settings";
|
|
|
17965
18196
|
var LEGACY_BACKUP_FILE = ".agent-settings.backup.key-value";
|
|
17966
18197
|
var SETTINGS_SUBDIR = ["agents", "settings"];
|
|
17967
18198
|
function _canonical_settings_target(project_root) {
|
|
17968
|
-
return
|
|
18199
|
+
return path20.join(project_root, ...SETTINGS_SUBDIR, SETTINGS_FILE);
|
|
17969
18200
|
}
|
|
17970
18201
|
function _resolve_settings_read(project_root) {
|
|
17971
18202
|
const canonical = _canonical_settings_target(project_root);
|
|
17972
18203
|
if (pathExists(canonical)) return canonical;
|
|
17973
|
-
const legacy =
|
|
18204
|
+
const legacy = path20.join(project_root, SETTINGS_FILE);
|
|
17974
18205
|
if (pathExists(legacy)) return legacy;
|
|
17975
18206
|
return canonical;
|
|
17976
18207
|
}
|
|
@@ -18034,9 +18265,9 @@ function fail(msg) {
|
|
|
18034
18265
|
throw new SystemExitError(1);
|
|
18035
18266
|
}
|
|
18036
18267
|
function detect_package_root(project_root) {
|
|
18037
|
-
const npm_path =
|
|
18268
|
+
const npm_path = path20.join(project_root, "node_modules", "@event4u", "agent-config");
|
|
18038
18269
|
if (isDir(npm_path)) return resolvePath(npm_path);
|
|
18039
|
-
if (pathExists(
|
|
18270
|
+
if (pathExists(path20.join(project_root, "src", "config", "profiles", "minimal.ini"))) {
|
|
18040
18271
|
return project_root;
|
|
18041
18272
|
}
|
|
18042
18273
|
fail(
|
|
@@ -18044,12 +18275,12 @@ function detect_package_root(project_root) {
|
|
|
18044
18275
|
);
|
|
18045
18276
|
}
|
|
18046
18277
|
function detect_package_type(package_root) {
|
|
18047
|
-
if (package_root.split(
|
|
18278
|
+
if (package_root.split(path20.sep).includes("node_modules")) return "npm";
|
|
18048
18279
|
return "local";
|
|
18049
18280
|
}
|
|
18050
18281
|
function detect_package_type_for_project(project_root, package_root) {
|
|
18051
18282
|
const npm_path = resolvePath(
|
|
18052
|
-
|
|
18283
|
+
path20.join(project_root, "node_modules", "@event4u", "agent-config")
|
|
18053
18284
|
);
|
|
18054
18285
|
const package_resolved = resolvePath(package_root);
|
|
18055
18286
|
if (package_resolved === npm_path) return "npm";
|
|
@@ -18069,7 +18300,7 @@ function ensure_directory(p) {
|
|
|
18069
18300
|
mkdirp(p);
|
|
18070
18301
|
}
|
|
18071
18302
|
function write_file(p, content) {
|
|
18072
|
-
ensure_directory(
|
|
18303
|
+
ensure_directory(path20.dirname(p));
|
|
18073
18304
|
writeText(p, content);
|
|
18074
18305
|
}
|
|
18075
18306
|
function read_json_file(p) {
|
|
@@ -18240,7 +18471,7 @@ function _append_unknown_legacy(rendered, legacy_values, unknown_keys) {
|
|
|
18240
18471
|
return rendered + "\n" + suffix;
|
|
18241
18472
|
}
|
|
18242
18473
|
function _migrate_legacy_if_present(project_root, template_body) {
|
|
18243
|
-
const legacy_target =
|
|
18474
|
+
const legacy_target = path20.join(project_root, LEGACY_SETTINGS_FILE);
|
|
18244
18475
|
if (!isFile(legacy_target)) return null;
|
|
18245
18476
|
const legacy_text = readText(legacy_target);
|
|
18246
18477
|
const [values, unknown] = _parse_legacy_settings(legacy_text);
|
|
@@ -18255,9 +18486,9 @@ function _migrate_legacy_if_present(project_root, template_body) {
|
|
|
18255
18486
|
}
|
|
18256
18487
|
}
|
|
18257
18488
|
rendered = _append_unknown_legacy(rendered, values, unknown);
|
|
18258
|
-
const backup_target =
|
|
18489
|
+
const backup_target = path20.join(project_root, LEGACY_BACKUP_FILE);
|
|
18259
18490
|
writeText(backup_target, legacy_text);
|
|
18260
|
-
|
|
18491
|
+
fs23.unlinkSync(legacy_target);
|
|
18261
18492
|
info(`Migrated legacy ${LEGACY_SETTINGS_FILE} \u2192 ${SETTINGS_FILE}`);
|
|
18262
18493
|
info(`Backup saved to ${LEGACY_BACKUP_FILE}`);
|
|
18263
18494
|
if (unknown.length > 0) {
|
|
@@ -18292,7 +18523,7 @@ function _render_template(template, profile_values) {
|
|
|
18292
18523
|
return body;
|
|
18293
18524
|
}
|
|
18294
18525
|
function _load_valid_user_types(package_root) {
|
|
18295
|
-
const directory =
|
|
18526
|
+
const directory = path20.join(package_root, USER_TYPES_DIR);
|
|
18296
18527
|
if (!isDir(directory)) return [];
|
|
18297
18528
|
return sortedGlobStems(directory, ".yml");
|
|
18298
18529
|
}
|
|
@@ -18349,8 +18580,8 @@ function splitlinesKeepends(text) {
|
|
|
18349
18580
|
}
|
|
18350
18581
|
function ensure_agent_settings(project_root, package_root, profile, force, user_type = "", packs = null) {
|
|
18351
18582
|
const target = _canonical_settings_target(project_root);
|
|
18352
|
-
const profile_source =
|
|
18353
|
-
const template_source =
|
|
18583
|
+
const profile_source = path20.join(package_root, "src", "config", "profiles", `${profile}.ini`);
|
|
18584
|
+
const template_source = path20.join(package_root, "src", "config", "agent-settings.template.yml");
|
|
18354
18585
|
if (!pathExists(profile_source)) fail(`Missing profile preset: ${profile_source}`);
|
|
18355
18586
|
if (!pathExists(template_source)) fail(`Missing settings template: ${template_source}`);
|
|
18356
18587
|
const template = readText(template_source);
|
|
@@ -18364,21 +18595,21 @@ function ensure_agent_settings(project_root, package_root, profile, force, user_
|
|
|
18364
18595
|
if (profile_values["rule_loading_tier"] !== profile) {
|
|
18365
18596
|
const got = "rule_loading_tier" in profile_values ? `'${profile_values["rule_loading_tier"]}'` : "None";
|
|
18366
18597
|
fail(
|
|
18367
|
-
`Profile preset ${
|
|
18598
|
+
`Profile preset ${path20.basename(profile_source)} has rule_loading_tier=${got} but --profile=${profile}`
|
|
18368
18599
|
);
|
|
18369
18600
|
}
|
|
18370
18601
|
profile_values["user_type"] = _validate_user_type(package_root, user_type);
|
|
18371
18602
|
let template_body = _render_template(template, profile_values);
|
|
18372
18603
|
template_body = _inject_packs(template_body, packs ?? []);
|
|
18373
|
-
const legacy_root =
|
|
18604
|
+
const legacy_root = path20.join(project_root, SETTINGS_FILE);
|
|
18374
18605
|
if (isFile(legacy_root) && !pathExists(target)) {
|
|
18375
|
-
mkdirp(
|
|
18606
|
+
mkdirp(path20.dirname(target));
|
|
18376
18607
|
writeText(target, readText(legacy_root));
|
|
18377
|
-
|
|
18608
|
+
fs23.unlinkSync(legacy_root);
|
|
18378
18609
|
success(`Migrated ${SETTINGS_FILE} \u2192 agents/settings/${SETTINGS_FILE} (ADR-038)`);
|
|
18379
18610
|
return;
|
|
18380
18611
|
}
|
|
18381
|
-
const legacy_target =
|
|
18612
|
+
const legacy_target = path20.join(project_root, LEGACY_SETTINGS_FILE);
|
|
18382
18613
|
if (isFile(legacy_target) && pathExists(target)) {
|
|
18383
18614
|
warn(
|
|
18384
18615
|
`Both ${SETTINGS_FILE} and legacy ${LEGACY_SETTINGS_FILE} exist. Skipping migration to avoid overwriting ${SETTINGS_FILE}. Delete one of them manually and re-run.`
|
|
@@ -18395,7 +18626,7 @@ function ensure_agent_settings(project_root, package_root, profile, force, user_
|
|
|
18395
18626
|
skip(`${SETTINGS_FILE} already exists`);
|
|
18396
18627
|
return;
|
|
18397
18628
|
}
|
|
18398
|
-
mkdirp(
|
|
18629
|
+
mkdirp(path20.dirname(target));
|
|
18399
18630
|
write_file(target, template_body);
|
|
18400
18631
|
const user_type_value = profile_values["user_type"] ?? "";
|
|
18401
18632
|
const suffix = user_type_value ? `, user_type=${user_type_value}` : "";
|
|
@@ -18408,7 +18639,7 @@ function ensure_vscode_bridge(project_root, package_type, force) {
|
|
|
18408
18639
|
const plugin_path = plugin_paths[package_type] ?? "./plugin/agent-config";
|
|
18409
18640
|
const bridge = { "chat.pluginLocations": { [plugin_path]: true } };
|
|
18410
18641
|
return merge_json_file(
|
|
18411
|
-
|
|
18642
|
+
path20.join(project_root, ".vscode", "settings.json"),
|
|
18412
18643
|
bridge,
|
|
18413
18644
|
force,
|
|
18414
18645
|
".vscode/settings.json"
|
|
@@ -18417,14 +18648,14 @@ function ensure_vscode_bridge(project_root, package_type, force) {
|
|
|
18417
18648
|
function ensure_augment_bridge(project_root, force) {
|
|
18418
18649
|
const bridge = { enabledPlugins: { "agent-config@event4u": true } };
|
|
18419
18650
|
return merge_json_file(
|
|
18420
|
-
|
|
18651
|
+
path20.join(project_root, ".augment", "settings.json"),
|
|
18421
18652
|
bridge,
|
|
18422
18653
|
force,
|
|
18423
18654
|
".augment/settings.json"
|
|
18424
18655
|
);
|
|
18425
18656
|
}
|
|
18426
|
-
var AUGMENT_USER_DIR =
|
|
18427
|
-
var AUGMENT_USER_HOOKS_DIR =
|
|
18657
|
+
var AUGMENT_USER_DIR = path20.join(os8.homedir(), ".augment");
|
|
18658
|
+
var AUGMENT_USER_HOOKS_DIR = path20.join(AUGMENT_USER_DIR, "hooks");
|
|
18428
18659
|
var AUGMENT_DISPATCHER_TRAMPOLINE = "augment-dispatcher.sh";
|
|
18429
18660
|
var AUGMENT_LEGACY_TRAMPOLINES = [
|
|
18430
18661
|
"augment-chat-history.sh",
|
|
@@ -18440,29 +18671,29 @@ var AUGMENT_DISPATCHER_BINDINGS = [
|
|
|
18440
18671
|
["post_tool_use", "PostToolUse"]
|
|
18441
18672
|
];
|
|
18442
18673
|
function _deploy_augment_trampoline(package_root, name, force) {
|
|
18443
|
-
const src =
|
|
18674
|
+
const src = path20.join(package_root, "scripts", "hooks", name);
|
|
18444
18675
|
if (!pathExists(src)) {
|
|
18445
18676
|
skip(`augment trampoline missing in package: ${src}`);
|
|
18446
18677
|
return null;
|
|
18447
18678
|
}
|
|
18448
18679
|
mkdirp(AUGMENT_USER_HOOKS_DIR);
|
|
18449
|
-
const dst =
|
|
18680
|
+
const dst = path20.join(AUGMENT_USER_HOOKS_DIR, name);
|
|
18450
18681
|
const src_text = readText(src);
|
|
18451
18682
|
if (pathExists(dst) && readText(dst) === src_text && !force) {
|
|
18452
18683
|
skip(`~/.augment/hooks/${name} already up to date`);
|
|
18453
18684
|
} else {
|
|
18454
18685
|
writeText(dst, src_text);
|
|
18455
|
-
|
|
18686
|
+
fs23.chmodSync(dst, 493);
|
|
18456
18687
|
success(`~/.augment/hooks/${name} installed`);
|
|
18457
18688
|
}
|
|
18458
18689
|
return dst;
|
|
18459
18690
|
}
|
|
18460
18691
|
function _remove_legacy_augment_trampolines() {
|
|
18461
18692
|
for (const name of AUGMENT_LEGACY_TRAMPOLINES) {
|
|
18462
|
-
const legacy =
|
|
18693
|
+
const legacy = path20.join(AUGMENT_USER_HOOKS_DIR, name);
|
|
18463
18694
|
try {
|
|
18464
18695
|
if (isFile(legacy)) {
|
|
18465
|
-
|
|
18696
|
+
fs23.unlinkSync(legacy);
|
|
18466
18697
|
skip(`removed legacy ~/.augment/hooks/${name}`);
|
|
18467
18698
|
}
|
|
18468
18699
|
} catch (err) {
|
|
@@ -18482,7 +18713,7 @@ function ensure_augment_user_hooks(package_root, force) {
|
|
|
18482
18713
|
}
|
|
18483
18714
|
const settings_patch = { hooks: per_event };
|
|
18484
18715
|
return merge_json_file(
|
|
18485
|
-
|
|
18716
|
+
path20.join(AUGMENT_USER_DIR, "settings.json"),
|
|
18486
18717
|
settings_patch,
|
|
18487
18718
|
force,
|
|
18488
18719
|
"~/.augment/settings.json"
|
|
@@ -18507,7 +18738,7 @@ function _heal_legacy_claude_plugin_ids(p) {
|
|
|
18507
18738
|
return removed;
|
|
18508
18739
|
}
|
|
18509
18740
|
function ensure_claude_bridge(project_root, force) {
|
|
18510
|
-
const target =
|
|
18741
|
+
const target = path20.join(project_root, ".claude", "settings.json");
|
|
18511
18742
|
const healed = _heal_legacy_claude_plugin_ids(target);
|
|
18512
18743
|
for (const pid of healed) {
|
|
18513
18744
|
success(`.claude/settings.json: removed stale plugin id \`${pid}\``);
|
|
@@ -18536,29 +18767,29 @@ function ensure_cursor_bridge(project_root, force) {
|
|
|
18536
18767
|
}
|
|
18537
18768
|
const bridge = { version: 1, hooks };
|
|
18538
18769
|
return merge_json_file(
|
|
18539
|
-
|
|
18770
|
+
path20.join(project_root, ".cursor", "hooks.json"),
|
|
18540
18771
|
bridge,
|
|
18541
18772
|
force,
|
|
18542
18773
|
".cursor/hooks.json"
|
|
18543
18774
|
);
|
|
18544
18775
|
}
|
|
18545
|
-
var CURSOR_USER_DIR =
|
|
18546
|
-
var CURSOR_USER_HOOKS_DIR =
|
|
18776
|
+
var CURSOR_USER_DIR = path20.join(os8.homedir(), ".cursor");
|
|
18777
|
+
var CURSOR_USER_HOOKS_DIR = path20.join(CURSOR_USER_DIR, "hooks");
|
|
18547
18778
|
var CURSOR_DISPATCHER_TRAMPOLINE = "cursor-dispatcher.sh";
|
|
18548
18779
|
function ensure_cursor_user_hooks(package_root, force) {
|
|
18549
|
-
const src =
|
|
18780
|
+
const src = path20.join(package_root, "scripts", "hooks", CURSOR_DISPATCHER_TRAMPOLINE);
|
|
18550
18781
|
if (!pathExists(src)) {
|
|
18551
18782
|
skip(`cursor trampoline missing in package: ${src}`);
|
|
18552
18783
|
return [];
|
|
18553
18784
|
}
|
|
18554
18785
|
mkdirp(CURSOR_USER_HOOKS_DIR);
|
|
18555
|
-
const dst =
|
|
18786
|
+
const dst = path20.join(CURSOR_USER_HOOKS_DIR, CURSOR_DISPATCHER_TRAMPOLINE);
|
|
18556
18787
|
const src_text = readText(src);
|
|
18557
18788
|
if (pathExists(dst) && readText(dst) === src_text && !force) {
|
|
18558
18789
|
skip(`~/.cursor/hooks/${CURSOR_DISPATCHER_TRAMPOLINE} already up to date`);
|
|
18559
18790
|
} else {
|
|
18560
18791
|
writeText(dst, src_text);
|
|
18561
|
-
|
|
18792
|
+
fs23.chmodSync(dst, 493);
|
|
18562
18793
|
success(`~/.cursor/hooks/${CURSOR_DISPATCHER_TRAMPOLINE} installed`);
|
|
18563
18794
|
}
|
|
18564
18795
|
const hooks = {};
|
|
@@ -18567,7 +18798,7 @@ function ensure_cursor_user_hooks(package_root, force) {
|
|
|
18567
18798
|
}
|
|
18568
18799
|
const settings_patch = { version: 1, hooks };
|
|
18569
18800
|
return merge_json_file(
|
|
18570
|
-
|
|
18801
|
+
path20.join(CURSOR_USER_DIR, "hooks.json"),
|
|
18571
18802
|
settings_patch,
|
|
18572
18803
|
force,
|
|
18573
18804
|
"~/.cursor/hooks.json"
|
|
@@ -18610,12 +18841,12 @@ exit 0
|
|
|
18610
18841
|
`;
|
|
18611
18842
|
}
|
|
18612
18843
|
function ensure_cline_bridge(project_root, force) {
|
|
18613
|
-
const hooks_dir =
|
|
18844
|
+
const hooks_dir = path20.join(project_root, ".clinerules", "hooks");
|
|
18614
18845
|
mkdirp(hooks_dir);
|
|
18615
18846
|
const workspace_quoted = shlexQuote(resolvePath(project_root));
|
|
18616
18847
|
let written = 0;
|
|
18617
18848
|
for (const [ac_event, native_event] of CLINE_DISPATCHER_BINDINGS) {
|
|
18618
|
-
const target =
|
|
18849
|
+
const target = path20.join(hooks_dir, native_event);
|
|
18619
18850
|
const body = clineProjectHookBody(native_event, ac_event, workspace_quoted);
|
|
18620
18851
|
if (pathExists(target) && readText(target) === body && !force) {
|
|
18621
18852
|
continue;
|
|
@@ -18625,7 +18856,7 @@ function ensure_cline_bridge(project_root, force) {
|
|
|
18625
18856
|
continue;
|
|
18626
18857
|
}
|
|
18627
18858
|
writeText(target, body);
|
|
18628
|
-
|
|
18859
|
+
fs23.chmodSync(target, 493);
|
|
18629
18860
|
written += 1;
|
|
18630
18861
|
}
|
|
18631
18862
|
if (written) {
|
|
@@ -18634,27 +18865,27 @@ function ensure_cline_bridge(project_root, force) {
|
|
|
18634
18865
|
skip(".clinerules/hooks/ already up to date");
|
|
18635
18866
|
}
|
|
18636
18867
|
}
|
|
18637
|
-
var CLINE_USER_DIR =
|
|
18868
|
+
var CLINE_USER_DIR = path20.join(os8.homedir(), "Documents", "Cline", "Hooks");
|
|
18638
18869
|
var CLINE_DISPATCHER_TRAMPOLINE = "cline-dispatcher.sh";
|
|
18639
18870
|
function ensure_cline_user_hooks(package_root, force) {
|
|
18640
|
-
const src =
|
|
18871
|
+
const src = path20.join(package_root, "scripts", "hooks", CLINE_DISPATCHER_TRAMPOLINE);
|
|
18641
18872
|
if (!pathExists(src)) {
|
|
18642
18873
|
skip(`cline trampoline missing in package: ${src}`);
|
|
18643
18874
|
return;
|
|
18644
18875
|
}
|
|
18645
18876
|
mkdirp(CLINE_USER_DIR);
|
|
18646
|
-
const trampoline =
|
|
18877
|
+
const trampoline = path20.join(CLINE_USER_DIR, CLINE_DISPATCHER_TRAMPOLINE);
|
|
18647
18878
|
const src_text = readText(src);
|
|
18648
18879
|
if (pathExists(trampoline) && readText(trampoline) === src_text && !force) {
|
|
18649
18880
|
skip(`~/Documents/Cline/Hooks/${CLINE_DISPATCHER_TRAMPOLINE} already up to date`);
|
|
18650
18881
|
} else {
|
|
18651
18882
|
writeText(trampoline, src_text);
|
|
18652
|
-
|
|
18883
|
+
fs23.chmodSync(trampoline, 493);
|
|
18653
18884
|
success(`~/Documents/Cline/Hooks/${CLINE_DISPATCHER_TRAMPOLINE} installed`);
|
|
18654
18885
|
}
|
|
18655
18886
|
const trampoline_quoted = shlexQuote(trampoline);
|
|
18656
18887
|
for (const [ac_event, native_event] of CLINE_DISPATCHER_BINDINGS) {
|
|
18657
|
-
const wrapper =
|
|
18888
|
+
const wrapper = path20.join(CLINE_USER_DIR, native_event);
|
|
18658
18889
|
const body = `#!/usr/bin/env bash
|
|
18659
18890
|
# Generated by event4u/agent-config install.py \u2014 DO NOT EDIT.
|
|
18660
18891
|
# User-scope Cline hook for ${native_event} \u2192 agent-config ${ac_event}.
|
|
@@ -18664,7 +18895,7 @@ exec ${trampoline_quoted} ${ac_event} ${native_event}
|
|
|
18664
18895
|
continue;
|
|
18665
18896
|
}
|
|
18666
18897
|
writeText(wrapper, body);
|
|
18667
|
-
|
|
18898
|
+
fs23.chmodSync(wrapper, 493);
|
|
18668
18899
|
}
|
|
18669
18900
|
}
|
|
18670
18901
|
var WINDSURF_DISPATCHER_BINDINGS = [
|
|
@@ -18685,29 +18916,29 @@ function ensure_windsurf_bridge(project_root, force) {
|
|
|
18685
18916
|
}
|
|
18686
18917
|
const bridge = { hooks };
|
|
18687
18918
|
return merge_json_file(
|
|
18688
|
-
|
|
18919
|
+
path20.join(project_root, ".windsurf", "hooks.json"),
|
|
18689
18920
|
bridge,
|
|
18690
18921
|
force,
|
|
18691
18922
|
".windsurf/hooks.json"
|
|
18692
18923
|
);
|
|
18693
18924
|
}
|
|
18694
|
-
var WINDSURF_USER_DIR =
|
|
18695
|
-
var WINDSURF_USER_HOOKS_DIR =
|
|
18925
|
+
var WINDSURF_USER_DIR = path20.join(os8.homedir(), ".codeium", "windsurf");
|
|
18926
|
+
var WINDSURF_USER_HOOKS_DIR = path20.join(WINDSURF_USER_DIR, "hooks");
|
|
18696
18927
|
var WINDSURF_DISPATCHER_TRAMPOLINE = "windsurf-dispatcher.sh";
|
|
18697
18928
|
function ensure_windsurf_user_hooks(package_root, force) {
|
|
18698
|
-
const src =
|
|
18929
|
+
const src = path20.join(package_root, "scripts", "hooks", WINDSURF_DISPATCHER_TRAMPOLINE);
|
|
18699
18930
|
if (!pathExists(src)) {
|
|
18700
18931
|
skip(`windsurf trampoline missing in package: ${src}`);
|
|
18701
18932
|
return [];
|
|
18702
18933
|
}
|
|
18703
18934
|
mkdirp(WINDSURF_USER_HOOKS_DIR);
|
|
18704
|
-
const dst =
|
|
18935
|
+
const dst = path20.join(WINDSURF_USER_HOOKS_DIR, WINDSURF_DISPATCHER_TRAMPOLINE);
|
|
18705
18936
|
const src_text = readText(src);
|
|
18706
18937
|
if (pathExists(dst) && readText(dst) === src_text && !force) {
|
|
18707
18938
|
skip(`~/.codeium/windsurf/hooks/${WINDSURF_DISPATCHER_TRAMPOLINE} already up to date`);
|
|
18708
18939
|
} else {
|
|
18709
18940
|
writeText(dst, src_text);
|
|
18710
|
-
|
|
18941
|
+
fs23.chmodSync(dst, 493);
|
|
18711
18942
|
success(`~/.codeium/windsurf/hooks/${WINDSURF_DISPATCHER_TRAMPOLINE} installed`);
|
|
18712
18943
|
}
|
|
18713
18944
|
const hooks = {};
|
|
@@ -18719,7 +18950,7 @@ function ensure_windsurf_user_hooks(package_root, force) {
|
|
|
18719
18950
|
}
|
|
18720
18951
|
const settings_patch = { hooks };
|
|
18721
18952
|
return merge_json_file(
|
|
18722
|
-
|
|
18953
|
+
path20.join(WINDSURF_USER_DIR, "hooks.json"),
|
|
18723
18954
|
settings_patch,
|
|
18724
18955
|
force,
|
|
18725
18956
|
"~/.codeium/windsurf/hooks.json"
|
|
@@ -18748,43 +18979,43 @@ function _gemini_hooks_dict(command_factory) {
|
|
|
18748
18979
|
function ensure_gemini_bridge(project_root, force) {
|
|
18749
18980
|
const bridge = { hooks: _gemini_hooks_dict(_gemini_dispatch_command) };
|
|
18750
18981
|
return merge_json_file(
|
|
18751
|
-
|
|
18982
|
+
path20.join(project_root, ".gemini", "settings.json"),
|
|
18752
18983
|
bridge,
|
|
18753
18984
|
force,
|
|
18754
18985
|
".gemini/settings.json"
|
|
18755
18986
|
);
|
|
18756
18987
|
}
|
|
18757
|
-
var GEMINI_USER_DIR =
|
|
18758
|
-
var GEMINI_USER_HOOKS_DIR =
|
|
18988
|
+
var GEMINI_USER_DIR = path20.join(os8.homedir(), ".gemini");
|
|
18989
|
+
var GEMINI_USER_HOOKS_DIR = path20.join(GEMINI_USER_DIR, "hooks");
|
|
18759
18990
|
var GEMINI_DISPATCHER_TRAMPOLINE = "gemini-dispatcher.sh";
|
|
18760
18991
|
function ensure_gemini_user_hooks(package_root, force) {
|
|
18761
|
-
const src =
|
|
18992
|
+
const src = path20.join(package_root, "scripts", "hooks", GEMINI_DISPATCHER_TRAMPOLINE);
|
|
18762
18993
|
if (!pathExists(src)) {
|
|
18763
18994
|
skip(`gemini trampoline missing in package: ${src}`);
|
|
18764
18995
|
return [];
|
|
18765
18996
|
}
|
|
18766
18997
|
mkdirp(GEMINI_USER_HOOKS_DIR);
|
|
18767
|
-
const dst =
|
|
18998
|
+
const dst = path20.join(GEMINI_USER_HOOKS_DIR, GEMINI_DISPATCHER_TRAMPOLINE);
|
|
18768
18999
|
const src_text = readText(src);
|
|
18769
19000
|
if (pathExists(dst) && readText(dst) === src_text && !force) {
|
|
18770
19001
|
skip(`~/.gemini/hooks/${GEMINI_DISPATCHER_TRAMPOLINE} already up to date`);
|
|
18771
19002
|
} else {
|
|
18772
19003
|
writeText(dst, src_text);
|
|
18773
|
-
|
|
19004
|
+
fs23.chmodSync(dst, 493);
|
|
18774
19005
|
success(`~/.gemini/hooks/${GEMINI_DISPATCHER_TRAMPOLINE} installed`);
|
|
18775
19006
|
}
|
|
18776
19007
|
const settings_patch = {
|
|
18777
19008
|
hooks: _gemini_hooks_dict((ac_event, native) => `${dst} ${ac_event} ${native}`)
|
|
18778
19009
|
};
|
|
18779
19010
|
return merge_json_file(
|
|
18780
|
-
|
|
19011
|
+
path20.join(GEMINI_USER_DIR, "settings.json"),
|
|
18781
19012
|
settings_patch,
|
|
18782
19013
|
force,
|
|
18783
19014
|
"~/.gemini/settings.json"
|
|
18784
19015
|
);
|
|
18785
19016
|
}
|
|
18786
19017
|
function ensure_copilot_bridge(project_root, force) {
|
|
18787
|
-
const target =
|
|
19018
|
+
const target = path20.join(project_root, ".github", "plugin", "marketplace.json");
|
|
18788
19019
|
const bridge = {
|
|
18789
19020
|
marketplace: {
|
|
18790
19021
|
name: "event4u-agent-marketplace",
|
|
@@ -18827,7 +19058,7 @@ See \`docs/setup/per-ide/roocode.md\` for the full activation guide.
|
|
|
18827
19058
|
Run \`./agent-config --help\` for available commands.
|
|
18828
19059
|
`;
|
|
18829
19060
|
function ensure_roocode_bridge(project_root, force) {
|
|
18830
|
-
const target =
|
|
19061
|
+
const target = path20.join(project_root, ".roo", "rules", "agent-config.md");
|
|
18831
19062
|
if (pathExists(target) && !force) {
|
|
18832
19063
|
skip(".roo/rules/agent-config.md already exists");
|
|
18833
19064
|
return;
|
|
@@ -18849,7 +19080,7 @@ To wire Claude Desktop to this project's rules, run:
|
|
|
18849
19080
|
Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
|
|
18850
19081
|
`;
|
|
18851
19082
|
function ensure_claude_desktop_bridge(project_root, force) {
|
|
18852
|
-
const target =
|
|
19083
|
+
const target = path20.join(project_root, ".claude-desktop", "agent-config.md");
|
|
18853
19084
|
if (pathExists(target) && !force) {
|
|
18854
19085
|
skip(".claude-desktop/agent-config.md already exists");
|
|
18855
19086
|
return;
|
|
@@ -18874,7 +19105,7 @@ Or pass \`--read .aider/agent-config.md\` on the command line.
|
|
|
18874
19105
|
Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
|
|
18875
19106
|
`;
|
|
18876
19107
|
function ensure_aider_bridge(project_root, force) {
|
|
18877
|
-
const target =
|
|
19108
|
+
const target = path20.join(project_root, ".aider", "agent-config.md");
|
|
18878
19109
|
if (pathExists(target) && !force) {
|
|
18879
19110
|
skip(".aider/agent-config.md already exists");
|
|
18880
19111
|
return;
|
|
@@ -18893,7 +19124,7 @@ developers where the rules and skills live.
|
|
|
18893
19124
|
Canonical rule and skill source: \`.augment/\` (see project \`AGENTS.md\`).
|
|
18894
19125
|
`;
|
|
18895
19126
|
function ensure_codex_bridge(project_root, force) {
|
|
18896
|
-
const target =
|
|
19127
|
+
const target = path20.join(project_root, ".codex", "agent-config.md");
|
|
18897
19128
|
if (pathExists(target) && !force) {
|
|
18898
19129
|
skip(".codex/agent-config.md already exists");
|
|
18899
19130
|
return;
|
|
@@ -18911,7 +19142,7 @@ rules per session. The canonical rule and skill source lives under
|
|
|
18911
19142
|
orientation).
|
|
18912
19143
|
`;
|
|
18913
19144
|
function ensure_continue_bridge(project_root, force) {
|
|
18914
|
-
const target =
|
|
19145
|
+
const target = path20.join(project_root, ".continue", "rules", "agent-config.md");
|
|
18915
19146
|
if (pathExists(target) && !force) {
|
|
18916
19147
|
skip(".continue/rules/agent-config.md already exists");
|
|
18917
19148
|
return;
|
|
@@ -18942,7 +19173,7 @@ orientation).
|
|
|
18942
19173
|
See \`docs/setup/per-ide/kilocode.md\` for the full activation guide.
|
|
18943
19174
|
`;
|
|
18944
19175
|
function ensure_kilocode_bridge(project_root, force) {
|
|
18945
|
-
const target =
|
|
19176
|
+
const target = path20.join(project_root, ".kilocode", "rules", "agent-config.md");
|
|
18946
19177
|
if (pathExists(target) && !force) {
|
|
18947
19178
|
skip(".kilocode/rules/agent-config.md already exists");
|
|
18948
19179
|
return;
|
|
@@ -18969,7 +19200,7 @@ canonical source (or symlink it):
|
|
|
18969
19200
|
Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
|
|
18970
19201
|
`;
|
|
18971
19202
|
function ensure_zed_bridge(project_root, force) {
|
|
18972
|
-
const target =
|
|
19203
|
+
const target = path20.join(project_root, ".zed", "agent-config.md");
|
|
18973
19204
|
if (pathExists(target) && !force) {
|
|
18974
19205
|
skip(".zed/agent-config.md already exists");
|
|
18975
19206
|
return;
|
|
@@ -18990,7 +19221,7 @@ rules into your JetBrains profile.
|
|
|
18990
19221
|
Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
|
|
18991
19222
|
`;
|
|
18992
19223
|
function ensure_jetbrains_bridge(project_root, force) {
|
|
18993
|
-
const target =
|
|
19224
|
+
const target = path20.join(project_root, ".jetbrains", "agent-config.md");
|
|
18994
19225
|
if (pathExists(target) && !force) {
|
|
18995
19226
|
skip(".jetbrains/agent-config.md already exists");
|
|
18996
19227
|
return;
|
|
@@ -19021,7 +19252,7 @@ session. The canonical rule and skill source lives under \`.augment/\`
|
|
|
19021
19252
|
See \`docs/setup/per-ide/kiro.md\` for the full activation guide.
|
|
19022
19253
|
`;
|
|
19023
19254
|
function ensure_kiro_bridge(project_root, force) {
|
|
19024
|
-
const target =
|
|
19255
|
+
const target = path20.join(project_root, ".kiro", "steering", "agent-config.md");
|
|
19025
19256
|
if (pathExists(target) && !force) {
|
|
19026
19257
|
skip(".kiro/steering/agent-config.md already exists");
|
|
19027
19258
|
return;
|
|
@@ -19047,35 +19278,35 @@ var SMOKE_BRIDGE_PATHS = {
|
|
|
19047
19278
|
};
|
|
19048
19279
|
function dirHasEntries(p) {
|
|
19049
19280
|
try {
|
|
19050
|
-
return
|
|
19281
|
+
return fs23.readdirSync(p).length > 0;
|
|
19051
19282
|
} catch {
|
|
19052
19283
|
return false;
|
|
19053
19284
|
}
|
|
19054
19285
|
}
|
|
19055
19286
|
function _resolve_tsx_invocation(scriptPath, scriptArgs) {
|
|
19056
19287
|
const binName = process3.platform === "win32" ? "tsx.cmd" : "tsx";
|
|
19057
|
-
let dir =
|
|
19288
|
+
let dir = path20.dirname(scriptPath);
|
|
19058
19289
|
for (; ; ) {
|
|
19059
|
-
const candidate =
|
|
19290
|
+
const candidate = path20.join(dir, "node_modules", ".bin", binName);
|
|
19060
19291
|
if (isFile(candidate)) {
|
|
19061
19292
|
return { command: candidate, args: [scriptPath, ...scriptArgs] };
|
|
19062
19293
|
}
|
|
19063
|
-
const parent =
|
|
19294
|
+
const parent = path20.dirname(dir);
|
|
19064
19295
|
if (parent === dir) break;
|
|
19065
19296
|
dir = parent;
|
|
19066
19297
|
}
|
|
19067
19298
|
return { command: "npx", args: ["tsx", scriptPath, ...scriptArgs] };
|
|
19068
19299
|
}
|
|
19069
19300
|
function _smoke_test_hooks(project_root, package_root) {
|
|
19070
|
-
const dispatcher =
|
|
19071
|
-
const manifest =
|
|
19301
|
+
const dispatcher = path20.join(package_root, "scripts", "hooks", "dispatch_hook.ts");
|
|
19302
|
+
const manifest = path20.join(package_root, "scripts", "hook_manifest.yaml");
|
|
19072
19303
|
if (!isFile(dispatcher) || !isFile(manifest)) return 0;
|
|
19073
19304
|
const failed = [];
|
|
19074
19305
|
const skipped = [];
|
|
19075
19306
|
const passed = [];
|
|
19076
19307
|
for (const [platform, native] of SMOKE_PROBE_EVENTS) {
|
|
19077
19308
|
const rel_bridge = SMOKE_BRIDGE_PATHS[platform] ?? "";
|
|
19078
|
-
const bridge_path = rel_bridge ?
|
|
19309
|
+
const bridge_path = rel_bridge ? path20.join(project_root, rel_bridge) : null;
|
|
19079
19310
|
const bridge_present = Boolean(
|
|
19080
19311
|
bridge_path && (isFile(bridge_path) || isDir(bridge_path) && dirHasEntries(bridge_path))
|
|
19081
19312
|
);
|
|
@@ -19275,9 +19506,9 @@ To remove this marker, delete this file.
|
|
|
19275
19506
|
`;
|
|
19276
19507
|
}
|
|
19277
19508
|
var _CLAUDE_DESKTOP_BUNDLES_SUBPATH = "claude-desktop/bundles";
|
|
19278
|
-
var GLOBAL_ROOT =
|
|
19279
|
-
var GLOBAL_USER_SETTINGS_PATH =
|
|
19280
|
-
var GLOBAL_AGENT_SETTINGS_PATH =
|
|
19509
|
+
var GLOBAL_ROOT = path20.join(os8.homedir(), ".event4u", "agent-config");
|
|
19510
|
+
var GLOBAL_USER_SETTINGS_PATH = path20.join(GLOBAL_ROOT, ".agent-user.yml");
|
|
19511
|
+
var GLOBAL_AGENT_SETTINGS_PATH = path20.join(GLOBAL_ROOT, ".agent-settings.yml");
|
|
19281
19512
|
function _bridge_marker(tool_id, scope) {
|
|
19282
19513
|
if (scope === "global") return USER_SCOPE_PATHS[tool_id] ?? "";
|
|
19283
19514
|
return PROJECT_BRIDGE_MARKERS[tool_id] ?? "";
|
|
@@ -19326,7 +19557,7 @@ function _load_yaml_doc(p) {
|
|
|
19326
19557
|
return _isPlainObject2(data) ? data : {};
|
|
19327
19558
|
}
|
|
19328
19559
|
function _load_default_settings(package_root) {
|
|
19329
|
-
const template_source =
|
|
19560
|
+
const template_source = path20.join(package_root, "src", "config", "agent-settings.template.yml");
|
|
19330
19561
|
if (!pathExists(template_source)) return {};
|
|
19331
19562
|
let text;
|
|
19332
19563
|
try {
|
|
@@ -19340,11 +19571,11 @@ function _load_default_settings(package_root) {
|
|
|
19340
19571
|
}
|
|
19341
19572
|
var RULE_LAYER_CHOICES = ["global", "project", "both-acknowledged"];
|
|
19342
19573
|
function _suppress_rule_layer(project_root, suppress_dir) {
|
|
19343
|
-
const target =
|
|
19574
|
+
const target = path20.join(project_root, ".claude", "settings.local.json");
|
|
19344
19575
|
const existing = pathExists(target) ? read_json_file(target) : {};
|
|
19345
19576
|
let real_dir = suppress_dir;
|
|
19346
19577
|
try {
|
|
19347
|
-
real_dir =
|
|
19578
|
+
real_dir = fs23.realpathSync(suppress_dir);
|
|
19348
19579
|
} catch {
|
|
19349
19580
|
real_dir = suppress_dir;
|
|
19350
19581
|
}
|
|
@@ -19355,8 +19586,8 @@ function _suppress_rule_layer(project_root, suppress_dir) {
|
|
|
19355
19586
|
success(`.claude/settings.local.json: claudeMdExcludes += ${entry}`);
|
|
19356
19587
|
}
|
|
19357
19588
|
function _gate_rule_layer_overlap(project_root, layer, dry_run) {
|
|
19358
|
-
const global_dir =
|
|
19359
|
-
const project_dir =
|
|
19589
|
+
const global_dir = path20.join(os8.homedir(), ".claude", "rules");
|
|
19590
|
+
const project_dir = path20.join(project_root, ".claude", "rules");
|
|
19360
19591
|
const g = readRuleLayer(global_dir);
|
|
19361
19592
|
const p = readRuleLayer(project_dir);
|
|
19362
19593
|
if (g === null || p === null) return true;
|
|
@@ -19433,28 +19664,6 @@ function _run_scope_prompt(opts, reason, custom_path) {
|
|
|
19433
19664
|
if (!state.QUIET) info(`Custom destination: ${cp}`);
|
|
19434
19665
|
return "project";
|
|
19435
19666
|
}
|
|
19436
|
-
var SCOPE_DETECT_MANIFESTS = [
|
|
19437
|
-
"package.json",
|
|
19438
|
-
"composer.json",
|
|
19439
|
-
"pyproject.toml",
|
|
19440
|
-
"Cargo.toml",
|
|
19441
|
-
"go.mod",
|
|
19442
|
-
"Gemfile"
|
|
19443
|
-
];
|
|
19444
|
-
var SCOPE_DETECT_AI_DIRS = [
|
|
19445
|
-
".claude",
|
|
19446
|
-
".cursor",
|
|
19447
|
-
".windsurf",
|
|
19448
|
-
".augment",
|
|
19449
|
-
".clinerules",
|
|
19450
|
-
".copilot",
|
|
19451
|
-
".gemini",
|
|
19452
|
-
".codex",
|
|
19453
|
-
".aider",
|
|
19454
|
-
".continue",
|
|
19455
|
-
".roo",
|
|
19456
|
-
".kilocode"
|
|
19457
|
-
];
|
|
19458
19667
|
var SCOPE_DETECT_AI_FILES = [
|
|
19459
19668
|
"CLAUDE.md",
|
|
19460
19669
|
"AGENTS.md",
|
|
@@ -19466,9 +19675,9 @@ function detect_scope(cwd) {
|
|
|
19466
19675
|
if (pathExists(_resolve_settings_read(cwd))) {
|
|
19467
19676
|
return ["project", `existing ${SETTINGS_FILE}`];
|
|
19468
19677
|
}
|
|
19469
|
-
const has_manifest = SCOPE_DETECT_MANIFESTS.find((m) => pathExists(
|
|
19470
|
-
const has_ai_dir = SCOPE_DETECT_AI_DIRS.find((d) => isDir(
|
|
19471
|
-
const has_ai_file = SCOPE_DETECT_AI_FILES.find((f) => pathExists(
|
|
19678
|
+
const has_manifest = SCOPE_DETECT_MANIFESTS.find((m) => pathExists(path20.join(cwd, m))) ?? null;
|
|
19679
|
+
const has_ai_dir = SCOPE_DETECT_AI_DIRS.find((d) => isDir(path20.join(cwd, d))) ?? null;
|
|
19680
|
+
const has_ai_file = SCOPE_DETECT_AI_FILES.find((f) => pathExists(path20.join(cwd, f))) ?? null;
|
|
19472
19681
|
if (has_manifest && (has_ai_dir || has_ai_file)) {
|
|
19473
19682
|
const marker = has_ai_dir || has_ai_file;
|
|
19474
19683
|
return ["prompt", `manifest (${has_manifest}) + AI-tool config (${marker})`];
|
|
@@ -19489,7 +19698,7 @@ function readLineSyncRaw(promptText) {
|
|
|
19489
19698
|
for (; ; ) {
|
|
19490
19699
|
let n;
|
|
19491
19700
|
try {
|
|
19492
|
-
n =
|
|
19701
|
+
n = fs23.readSync(0, buf, 0, 1, null);
|
|
19493
19702
|
} catch (err) {
|
|
19494
19703
|
const code = err.code;
|
|
19495
19704
|
if (code === "EAGAIN") {
|
|
@@ -19564,8 +19773,8 @@ function _files_by_tool_from_bridges(tools, project_root, scope) {
|
|
|
19564
19773
|
const marker = _bridge_marker(tool_id, scope);
|
|
19565
19774
|
if (!marker) continue;
|
|
19566
19775
|
let marker_path = marker;
|
|
19567
|
-
if (!
|
|
19568
|
-
marker_path =
|
|
19776
|
+
if (!path20.isAbsolute(marker_path)) {
|
|
19777
|
+
marker_path = path20.join(project_root, marker_path);
|
|
19569
19778
|
}
|
|
19570
19779
|
out[tool_id] = [_file_entry(marker_path, "bridge", false)];
|
|
19571
19780
|
}
|
|
@@ -19604,26 +19813,26 @@ function _update_installed_tools_manifest(project_root, tools, scope, force, fil
|
|
|
19604
19813
|
}
|
|
19605
19814
|
write_manifest(target, version, entries);
|
|
19606
19815
|
if (!state.QUIET) {
|
|
19607
|
-
const rel = isRelativeTo(target, project_root) ?
|
|
19816
|
+
const rel = isRelativeTo(target, project_root) ? path20.relative(project_root, target) : target;
|
|
19608
19817
|
info(`Manifest updated: ${rel}`);
|
|
19609
19818
|
}
|
|
19610
19819
|
return 0;
|
|
19611
19820
|
}
|
|
19612
19821
|
function isRelativeTo(child, parent) {
|
|
19613
|
-
const rel =
|
|
19614
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
19822
|
+
const rel = path20.relative(parent, child);
|
|
19823
|
+
return rel === "" || !rel.startsWith("..") && !path20.isAbsolute(rel);
|
|
19615
19824
|
}
|
|
19616
19825
|
function _resolve_package_root_for_global() {
|
|
19617
19826
|
const here = resolvePath(_HERE2);
|
|
19618
|
-
const candidate =
|
|
19619
|
-
if (!pathExists(
|
|
19827
|
+
const candidate = path20.dirname(path20.dirname(path20.dirname(here)));
|
|
19828
|
+
if (!pathExists(path20.join(candidate, "src", "config", "profiles", "minimal.ini"))) {
|
|
19620
19829
|
fail(
|
|
19621
19830
|
`Could not locate agent-config package root from ${here}. Expected src/config/profiles/minimal.ini at the parent directory.`
|
|
19622
19831
|
);
|
|
19623
19832
|
}
|
|
19624
19833
|
return candidate;
|
|
19625
19834
|
}
|
|
19626
|
-
var CONSUMER_BRIDGE_MARKER_RELPATH =
|
|
19835
|
+
var CONSUMER_BRIDGE_MARKER_RELPATH = path20.join("agents", ".event4u-bridge.yml");
|
|
19627
19836
|
var MIGRATE_LEGACY_YAML_FILES = [".agent-settings.yml", ".agent-user.yml"];
|
|
19628
19837
|
var MIGRATE_LEGACY_TOOL_DIRS = [".augment", ".claude", ".cursor"];
|
|
19629
19838
|
var AGENT_CONFIG_PACKAGE_NAME = "@event4u/agent-config";
|
|
@@ -19631,7 +19840,7 @@ function _is_agent_config_source_repo(project_root) {
|
|
|
19631
19840
|
if (process3.env["AGENT_CONFIG_CONSUMER_MODE"] === "1") {
|
|
19632
19841
|
return [false, "consumer-mode-override"];
|
|
19633
19842
|
}
|
|
19634
|
-
const pkg_json =
|
|
19843
|
+
const pkg_json = path20.join(project_root, "package.json");
|
|
19635
19844
|
if (isFile(pkg_json)) {
|
|
19636
19845
|
let data = {};
|
|
19637
19846
|
try {
|
|
@@ -19643,18 +19852,18 @@ function _is_agent_config_source_repo(project_root) {
|
|
|
19643
19852
|
return [true, "package.json:name"];
|
|
19644
19853
|
}
|
|
19645
19854
|
}
|
|
19646
|
-
if (isDir(
|
|
19855
|
+
if (isDir(path20.join(project_root, ".agent-src.uncondensed"))) {
|
|
19647
19856
|
return [true, ".agent-src.uncondensed/"];
|
|
19648
19857
|
}
|
|
19649
|
-
const packages_dir =
|
|
19858
|
+
const packages_dir = path20.join(project_root, "packages");
|
|
19650
19859
|
if (isDir(packages_dir)) {
|
|
19651
|
-
for (const child of
|
|
19652
|
-
if (isDir(
|
|
19860
|
+
for (const child of fs23.readdirSync(packages_dir)) {
|
|
19861
|
+
if (isDir(path20.join(packages_dir, child, ".agent-src.uncondensed"))) {
|
|
19653
19862
|
return [true, `packages/${child}/.agent-src.uncondensed/`];
|
|
19654
19863
|
}
|
|
19655
19864
|
}
|
|
19656
19865
|
}
|
|
19657
|
-
const installer_self =
|
|
19866
|
+
const installer_self = path20.join(project_root, "scripts", "install.py");
|
|
19658
19867
|
try {
|
|
19659
19868
|
if (isFile(installer_self) && resolvePath(installer_self) === resolvePath(_HERE2)) {
|
|
19660
19869
|
return [true, "src/scripts/install.py (self)"];
|
|
@@ -19674,17 +19883,17 @@ function _detect_legacy_for_migration(project_root) {
|
|
|
19674
19883
|
}
|
|
19675
19884
|
return [];
|
|
19676
19885
|
}
|
|
19677
|
-
if (isFile(
|
|
19886
|
+
if (isFile(path20.join(project_root, INSTALL_MODE_MARKER_REL))) return [];
|
|
19678
19887
|
const found = [];
|
|
19679
19888
|
for (const name of MIGRATE_LEGACY_YAML_FILES) {
|
|
19680
|
-
if (isFile(
|
|
19889
|
+
if (isFile(path20.join(project_root, name))) {
|
|
19681
19890
|
found.push(name);
|
|
19682
|
-
} else if (isFile(
|
|
19891
|
+
} else if (isFile(path20.join(project_root, "settings", name))) {
|
|
19683
19892
|
found.push(`settings/${name}`);
|
|
19684
19893
|
}
|
|
19685
19894
|
}
|
|
19686
19895
|
for (const name of MIGRATE_LEGACY_TOOL_DIRS) {
|
|
19687
|
-
const p =
|
|
19896
|
+
const p = path20.join(project_root, name);
|
|
19688
19897
|
if (isDir(p) && !isSymlink(p)) {
|
|
19689
19898
|
found.push(`${name}/`);
|
|
19690
19899
|
}
|
|
@@ -19696,7 +19905,7 @@ function _prompt_migrate_to_global(project_root, artefacts) {
|
|
|
19696
19905
|
process3.stdout.write("\n");
|
|
19697
19906
|
warn("Legacy project-local artefacts detected \u2014 pre-ADR-020 layout:");
|
|
19698
19907
|
for (const rel of artefacts) {
|
|
19699
|
-
info(` ${
|
|
19908
|
+
info(` ${path20.join(project_root, rel)}`);
|
|
19700
19909
|
}
|
|
19701
19910
|
info("The unified `agent-config migrate` sweeps these in one pass.");
|
|
19702
19911
|
info("The wizard recreates fresh config afterwards.");
|
|
@@ -19727,20 +19936,20 @@ function _run_migrate_to_global(project_root) {
|
|
|
19727
19936
|
function _format_global_root_for_marker(global_root) {
|
|
19728
19937
|
const home = resolvePath(os8.homedir());
|
|
19729
19938
|
const resolved = resolvePath(global_root);
|
|
19730
|
-
const rel =
|
|
19731
|
-
if (rel === "" || rel.startsWith("..") ||
|
|
19939
|
+
const rel = path20.relative(home, resolved);
|
|
19940
|
+
if (rel === "" || rel.startsWith("..") || path20.isAbsolute(rel)) {
|
|
19732
19941
|
return global_root;
|
|
19733
19942
|
}
|
|
19734
|
-
return `~/${rel.split(
|
|
19943
|
+
return `~/${rel.split(path20.sep).join("/")}`;
|
|
19735
19944
|
}
|
|
19736
19945
|
function _remove_legacy_consumer_bridge_marker(project_root, env = null) {
|
|
19737
19946
|
const env_map = env ?? process3.env;
|
|
19738
19947
|
if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return null;
|
|
19739
|
-
if (isDir(
|
|
19740
|
-
const target =
|
|
19948
|
+
if (isDir(path20.join(project_root, ".agent-src.uncondensed"))) return null;
|
|
19949
|
+
const target = path20.join(project_root, CONSUMER_BRIDGE_MARKER_RELPATH);
|
|
19741
19950
|
if (!isFile(target)) return null;
|
|
19742
19951
|
try {
|
|
19743
|
-
|
|
19952
|
+
fs23.rmSync(target);
|
|
19744
19953
|
} catch {
|
|
19745
19954
|
return null;
|
|
19746
19955
|
}
|
|
@@ -19754,7 +19963,7 @@ var PROJECT_ANCHOR_TOOLS = {
|
|
|
19754
19963
|
function _write_per_tool_project_anchors(project_root, tools, env = null, now = null) {
|
|
19755
19964
|
const env_map = env ?? process3.env;
|
|
19756
19965
|
if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return [];
|
|
19757
|
-
if (isDir(
|
|
19966
|
+
if (isDir(path20.join(project_root, ".agent-src.uncondensed"))) return [];
|
|
19758
19967
|
const global_root_str = _format_global_root_for_marker(
|
|
19759
19968
|
event4u_root(env_map)
|
|
19760
19969
|
);
|
|
@@ -19763,8 +19972,8 @@ function _write_per_tool_project_anchors(project_root, tools, env = null, now =
|
|
|
19763
19972
|
for (const tool_id of Object.keys(PROJECT_ANCHOR_TOOLS).sort()) {
|
|
19764
19973
|
const rel_path = PROJECT_ANCHOR_TOOLS[tool_id];
|
|
19765
19974
|
if (!tools.has(tool_id)) continue;
|
|
19766
|
-
const target =
|
|
19767
|
-
mkdirp(
|
|
19975
|
+
const target = path20.join(project_root, rel_path);
|
|
19976
|
+
mkdirp(path20.dirname(target));
|
|
19768
19977
|
const body = `# event4u/agent-config \u2014 per-tool project anchor (auto-written).
|
|
19769
19978
|
# Spec: docs/contracts/consumer-bridge.md \xA7 Per-tool anchor strategy.
|
|
19770
19979
|
# Tool: ${tool_id}. Resolves the global install directly \u2014 no
|
|
@@ -19782,7 +19991,7 @@ installed_at: ${stamp}
|
|
|
19782
19991
|
}
|
|
19783
19992
|
var PACKAGE_TAG_ID = "event4u/agent-config";
|
|
19784
19993
|
function _inject_package_tag(target, source, package_root) {
|
|
19785
|
-
if (
|
|
19994
|
+
if (path20.extname(target) !== ".md") return;
|
|
19786
19995
|
let text;
|
|
19787
19996
|
try {
|
|
19788
19997
|
text = readText(target);
|
|
@@ -19810,8 +20019,8 @@ function _inject_package_tag(target, source, package_root) {
|
|
|
19810
20019
|
resolved_src = source;
|
|
19811
20020
|
}
|
|
19812
20021
|
if (package_root !== null) {
|
|
19813
|
-
const rel =
|
|
19814
|
-
if (rel !== "" && !rel.startsWith("..") && !
|
|
20022
|
+
const rel = path20.relative(resolvePath(package_root), resolved_src);
|
|
20023
|
+
if (rel !== "" && !rel.startsWith("..") && !path20.isAbsolute(rel)) {
|
|
19815
20024
|
source_value = rel;
|
|
19816
20025
|
} else {
|
|
19817
20026
|
source_value = resolved_src;
|
|
@@ -19846,7 +20055,7 @@ function _escapes_package_root(resolved, package_root) {
|
|
|
19846
20055
|
if (package_root === null) return false;
|
|
19847
20056
|
let root;
|
|
19848
20057
|
try {
|
|
19849
|
-
root =
|
|
20058
|
+
root = fs23.realpathSync(package_root);
|
|
19850
20059
|
} catch {
|
|
19851
20060
|
return false;
|
|
19852
20061
|
}
|
|
@@ -19861,7 +20070,7 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
|
|
|
19861
20070
|
if (file_filter !== null && !file_filter(src)) return [0, 0, written_paths];
|
|
19862
20071
|
let resolved_src = src;
|
|
19863
20072
|
try {
|
|
19864
|
-
resolved_src =
|
|
20073
|
+
resolved_src = fs23.realpathSync(src);
|
|
19865
20074
|
} catch {
|
|
19866
20075
|
resolved_src = src;
|
|
19867
20076
|
}
|
|
@@ -19869,10 +20078,10 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
|
|
|
19869
20078
|
warn(`refused: ${src} dereferences outside the package root \u2014 not copied`);
|
|
19870
20079
|
return [0, 0, written_paths];
|
|
19871
20080
|
}
|
|
19872
|
-
mkdirp(
|
|
20081
|
+
mkdirp(path20.dirname(dest));
|
|
19873
20082
|
const decision = _resolve_file_conflict(dest, force);
|
|
19874
20083
|
if (decision === "skip") return [0, 1, written_paths];
|
|
19875
|
-
|
|
20084
|
+
fs23.copyFileSync(src, dest);
|
|
19876
20085
|
_inject_package_tag(dest, src, package_root);
|
|
19877
20086
|
written_paths.push(dest);
|
|
19878
20087
|
return [1, 0, written_paths];
|
|
@@ -19880,11 +20089,11 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
|
|
|
19880
20089
|
mkdirp(dest);
|
|
19881
20090
|
const walk = (node) => {
|
|
19882
20091
|
const acc = [];
|
|
19883
|
-
const names =
|
|
20092
|
+
const names = fs23.readdirSync(node).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
19884
20093
|
for (const name of names) {
|
|
19885
|
-
const entry =
|
|
20094
|
+
const entry = path20.join(node, name);
|
|
19886
20095
|
acc.push(entry);
|
|
19887
|
-
const lst =
|
|
20096
|
+
const lst = fs23.lstatSync(entry);
|
|
19888
20097
|
if (lst.isDirectory() && !lst.isSymbolicLink()) {
|
|
19889
20098
|
acc.push(...walk(entry));
|
|
19890
20099
|
}
|
|
@@ -19892,9 +20101,9 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
|
|
|
19892
20101
|
return acc;
|
|
19893
20102
|
};
|
|
19894
20103
|
for (const entry of walk(src)) {
|
|
19895
|
-
const rel =
|
|
19896
|
-
const target =
|
|
19897
|
-
const lst =
|
|
20104
|
+
const rel = path20.relative(src, entry);
|
|
20105
|
+
const target = path20.join(dest, rel);
|
|
20106
|
+
const lst = fs23.lstatSync(entry);
|
|
19898
20107
|
if (lst.isDirectory() && !lst.isSymbolicLink()) {
|
|
19899
20108
|
mkdirp(target);
|
|
19900
20109
|
continue;
|
|
@@ -19902,8 +20111,8 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
|
|
|
19902
20111
|
let resolvedIsDir = false;
|
|
19903
20112
|
let resolved = entry;
|
|
19904
20113
|
try {
|
|
19905
|
-
resolved =
|
|
19906
|
-
resolvedIsDir =
|
|
20114
|
+
resolved = fs23.realpathSync(entry);
|
|
20115
|
+
resolvedIsDir = fs23.statSync(entry).isDirectory();
|
|
19907
20116
|
} catch {
|
|
19908
20117
|
resolvedIsDir = false;
|
|
19909
20118
|
}
|
|
@@ -19933,8 +20142,8 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
|
|
|
19933
20142
|
skipped += 1;
|
|
19934
20143
|
continue;
|
|
19935
20144
|
}
|
|
19936
|
-
mkdirp(
|
|
19937
|
-
|
|
20145
|
+
mkdirp(path20.dirname(target));
|
|
20146
|
+
fs23.copyFileSync(resolved, target);
|
|
19938
20147
|
_inject_package_tag(target, resolved, package_root);
|
|
19939
20148
|
written += 1;
|
|
19940
20149
|
written_paths.push(target);
|
|
@@ -19946,7 +20155,7 @@ function _claude_desktop_bundles_dir() {
|
|
|
19946
20155
|
}
|
|
19947
20156
|
function _write_claude_desktop_marker(_force, lockfile_path2, bundles_dir, bundle_count) {
|
|
19948
20157
|
const anchor = expanduser6(USER_SCOPE_PATHS["claude-desktop"]);
|
|
19949
|
-
const target =
|
|
20158
|
+
const target = path20.join(anchor, "agent-config.md");
|
|
19950
20159
|
mkdirp(anchor);
|
|
19951
20160
|
const body = claudeDesktopMarkerBody(lockfile_path2, anchor, bundles_dir, bundle_count);
|
|
19952
20161
|
writeText(target, body);
|
|
@@ -19970,23 +20179,23 @@ function _apply_claude_flat_command_wrappers(anchor, package_root, current_files
|
|
|
19970
20179
|
const wrapped = [];
|
|
19971
20180
|
const collisions = [];
|
|
19972
20181
|
const reserved = [];
|
|
19973
|
-
const commands_dir =
|
|
20182
|
+
const commands_dir = path20.join(anchor, "commands");
|
|
19974
20183
|
let flat_entries = [];
|
|
19975
20184
|
try {
|
|
19976
|
-
flat_entries =
|
|
20185
|
+
flat_entries = fs23.readdirSync(commands_dir).filter((f) => f.endsWith(".md"));
|
|
19977
20186
|
} catch {
|
|
19978
20187
|
}
|
|
19979
20188
|
for (const fname of flat_entries.sort()) {
|
|
19980
20189
|
const slug = fname.slice(0, -".md".length);
|
|
19981
20190
|
if (!is_claude_builtin_name(slug)) continue;
|
|
19982
|
-
|
|
20191
|
+
fs23.rmSync(path20.join(commands_dir, fname), { force: true });
|
|
19983
20192
|
current_files.delete(`commands/${fname}`);
|
|
19984
20193
|
reserved.push(slug);
|
|
19985
20194
|
}
|
|
19986
20195
|
const eligible = new Set(_CLAUDE_FLAT_WRAPPER_EXTRA);
|
|
19987
20196
|
try {
|
|
19988
20197
|
const manifest = JSON.parse(
|
|
19989
|
-
|
|
20198
|
+
fs23.readFileSync(path20.join(package_root, "dist", "discovery", "discovery-manifest.json"), "utf8")
|
|
19990
20199
|
);
|
|
19991
20200
|
for (const a of manifest.artefacts ?? []) {
|
|
19992
20201
|
if (a.category !== "command" || typeof a.slug !== "string") continue;
|
|
@@ -19997,22 +20206,22 @@ function _apply_claude_flat_command_wrappers(anchor, package_root, current_files
|
|
|
19997
20206
|
}
|
|
19998
20207
|
for (const slug of [...eligible].sort()) {
|
|
19999
20208
|
const flat_rel = `commands/${slug}.md`;
|
|
20000
|
-
const flat_abs =
|
|
20001
|
-
if (!
|
|
20002
|
-
const skill_dir =
|
|
20003
|
-
if (
|
|
20209
|
+
const flat_abs = path20.join(anchor, "commands", `${slug}.md`);
|
|
20210
|
+
if (!fs23.existsSync(flat_abs)) continue;
|
|
20211
|
+
const skill_dir = path20.join(anchor, "skills", slug);
|
|
20212
|
+
if (fs23.existsSync(skill_dir)) {
|
|
20004
20213
|
collisions.push(slug);
|
|
20005
20214
|
continue;
|
|
20006
20215
|
}
|
|
20007
|
-
let body =
|
|
20216
|
+
let body = fs23.readFileSync(flat_abs, "utf8");
|
|
20008
20217
|
if (body.startsWith("---\n") && !/^name:/m.test(body.split("\n---")[0] ?? "")) {
|
|
20009
20218
|
body = body.replace("---\n", `---
|
|
20010
20219
|
name: ${slug}
|
|
20011
20220
|
`);
|
|
20012
20221
|
}
|
|
20013
|
-
|
|
20014
|
-
|
|
20015
|
-
|
|
20222
|
+
fs23.mkdirSync(skill_dir, { recursive: true });
|
|
20223
|
+
fs23.writeFileSync(path20.join(skill_dir, "SKILL.md"), body, "utf8");
|
|
20224
|
+
fs23.rmSync(flat_abs, { force: true });
|
|
20016
20225
|
current_files.delete(flat_rel);
|
|
20017
20226
|
current_files.add(`skills/${slug}/SKILL.md`);
|
|
20018
20227
|
wrapped.push(slug);
|
|
@@ -20044,8 +20253,8 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
|
|
|
20044
20253
|
const written_paths = [];
|
|
20045
20254
|
let current_files = /* @__PURE__ */ new Set();
|
|
20046
20255
|
for (const [src_rel, dest_sub] of plan) {
|
|
20047
|
-
const src =
|
|
20048
|
-
const dest = dest_sub ?
|
|
20256
|
+
const src = path20.join(package_root, src_rel);
|
|
20257
|
+
const dest = dest_sub ? path20.join(anchor, dest_sub) : anchor;
|
|
20049
20258
|
const rule_filter = _rule_filter_for_source(src_rel, rule_scope);
|
|
20050
20259
|
const [w, s, paths] = _copy_dir_dereferencing_symlinks(
|
|
20051
20260
|
src,
|
|
@@ -20068,16 +20277,13 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
|
|
|
20068
20277
|
}
|
|
20069
20278
|
if (tool_id === "claude-code") {
|
|
20070
20279
|
const res = _apply_claude_flat_command_wrappers(anchor, package_root, current_files);
|
|
20071
|
-
|
|
20072
|
-
|
|
20073
|
-
|
|
20074
|
-
|
|
20075
|
-
|
|
20076
|
-
|
|
20077
|
-
|
|
20078
|
-
` claude-code: ${res.reserved.length} flat command(s) withheld \u2014 name is a Claude Code built-in (${res.reserved.join(", ")}); nested /cluster:sub commands remain available`
|
|
20079
|
-
);
|
|
20080
|
-
}
|
|
20280
|
+
rewriteAndReport(
|
|
20281
|
+
path20.join(anchor, "rules"),
|
|
20282
|
+
state.QUIET,
|
|
20283
|
+
info,
|
|
20284
|
+
warn,
|
|
20285
|
+
res
|
|
20286
|
+
);
|
|
20081
20287
|
}
|
|
20082
20288
|
const missing_targets = _verify_deploy_targets(anchor, plan);
|
|
20083
20289
|
if (missing_targets.length > 0) {
|
|
@@ -20119,10 +20325,10 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
|
|
|
20119
20325
|
results[tool_id] = [written_total, skipped_total, "deployed", written_paths];
|
|
20120
20326
|
if (tool_id === "claude-code") {
|
|
20121
20327
|
try {
|
|
20122
|
-
const manifest =
|
|
20328
|
+
const manifest = path20.join(package_root, "src", "scripts", "hook_manifest.yaml");
|
|
20123
20329
|
const matrix = build_claude_hook_matrix(manifest);
|
|
20124
20330
|
const res = ensure_managed_hooks(
|
|
20125
|
-
|
|
20331
|
+
path20.join(anchor, "settings.json"),
|
|
20126
20332
|
matrix
|
|
20127
20333
|
);
|
|
20128
20334
|
if (!state.QUIET) {
|
|
@@ -20159,7 +20365,7 @@ function _preview_global_reap(tools, package_root) {
|
|
|
20159
20365
|
const anchor = expanduser6(anchor_raw);
|
|
20160
20366
|
let current_files = /* @__PURE__ */ new Set();
|
|
20161
20367
|
for (const [src_rel, dest_sub] of plan) {
|
|
20162
|
-
const src =
|
|
20368
|
+
const src = path20.join(package_root, src_rel);
|
|
20163
20369
|
current_files = setUnion(
|
|
20164
20370
|
current_files,
|
|
20165
20371
|
expected_deploy_files(
|
|
@@ -20193,14 +20399,14 @@ function _preview_global_reap(tools, package_root) {
|
|
|
20193
20399
|
function _verify_deploy_targets(anchor, plan) {
|
|
20194
20400
|
const missing = [];
|
|
20195
20401
|
for (const [, dest_sub] of plan) {
|
|
20196
|
-
const target = dest_sub ?
|
|
20402
|
+
const target = dest_sub ? path20.join(anchor, dest_sub) : anchor;
|
|
20197
20403
|
const label = dest_sub || ".";
|
|
20198
20404
|
if (!isDir(target)) {
|
|
20199
20405
|
missing.push(label);
|
|
20200
20406
|
continue;
|
|
20201
20407
|
}
|
|
20202
20408
|
try {
|
|
20203
|
-
const entries =
|
|
20409
|
+
const entries = fs23.readdirSync(target);
|
|
20204
20410
|
if (entries.length === 0) missing.push(label);
|
|
20205
20411
|
} catch {
|
|
20206
20412
|
missing.push(label);
|
|
@@ -20218,9 +20424,9 @@ function _resolve_global_settings_doc() {
|
|
|
20218
20424
|
}
|
|
20219
20425
|
function _resolve_global_settings_path() {
|
|
20220
20426
|
const root = event4u_root();
|
|
20221
|
-
const canonical =
|
|
20427
|
+
const canonical = path20.join(root, "settings", SETTINGS_FILE);
|
|
20222
20428
|
if (pathExists(canonical)) return canonical;
|
|
20223
|
-
const legacy =
|
|
20429
|
+
const legacy = path20.join(root, SETTINGS_FILE);
|
|
20224
20430
|
if (pathExists(legacy)) return legacy;
|
|
20225
20431
|
return null;
|
|
20226
20432
|
}
|
|
@@ -20331,7 +20537,7 @@ function install_global(tools, force, project_root = null, core_only = false) {
|
|
|
20331
20537
|
info(` schema_version=1, agent_config_version=${installed_version}`);
|
|
20332
20538
|
info(` tools=${merged_tools.join(",")}`);
|
|
20333
20539
|
}
|
|
20334
|
-
if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(
|
|
20540
|
+
if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path20.join(project_root, ".agent-src.uncondensed"))) {
|
|
20335
20541
|
const drift = collect_drift(project_root);
|
|
20336
20542
|
if (!state.QUIET) {
|
|
20337
20543
|
process3.stdout.write("\n");
|
|
@@ -20445,19 +20651,19 @@ function install_global(tools, force, project_root = null, core_only = false) {
|
|
|
20445
20651
|
}
|
|
20446
20652
|
}
|
|
20447
20653
|
}
|
|
20448
|
-
if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(
|
|
20654
|
+
if (project_root !== null && pathExists(_resolve_settings_read(project_root)) && !isDir(path20.join(project_root, ".agent-src.uncondensed"))) {
|
|
20449
20655
|
const files_by_tool = _files_by_tool_from_deploy(deploy_results);
|
|
20450
20656
|
const rc = _update_installed_tools_manifest(project_root, tools, "global", force, files_by_tool);
|
|
20451
20657
|
if (rc !== 0) return rc;
|
|
20452
20658
|
const removed_marker = _remove_legacy_consumer_bridge_marker(project_root);
|
|
20453
20659
|
if (removed_marker !== null && !state.QUIET) {
|
|
20454
|
-
const rel = isRelativeTo(removed_marker, project_root) ?
|
|
20660
|
+
const rel = isRelativeTo(removed_marker, project_root) ? path20.relative(project_root, removed_marker) : removed_marker;
|
|
20455
20661
|
info(`Removed legacy bridge marker: ${rel}`);
|
|
20456
20662
|
}
|
|
20457
20663
|
const anchor_paths = _write_per_tool_project_anchors(project_root, tools);
|
|
20458
20664
|
if (anchor_paths.length > 0 && !state.QUIET) {
|
|
20459
20665
|
for (const p of anchor_paths) {
|
|
20460
|
-
const rel = isRelativeTo(p, project_root) ?
|
|
20666
|
+
const rel = isRelativeTo(p, project_root) ? path20.relative(project_root, p) : p;
|
|
20461
20667
|
info(`Project anchor written: ${rel}`);
|
|
20462
20668
|
}
|
|
20463
20669
|
}
|
|
@@ -20493,8 +20699,8 @@ function install_global(tools, force, project_root = null, core_only = false) {
|
|
|
20493
20699
|
}
|
|
20494
20700
|
function _catalogue_truncation_warnings(deploy_results, project_root) {
|
|
20495
20701
|
const log_candidates = [
|
|
20496
|
-
|
|
20497
|
-
...project_root ? [
|
|
20702
|
+
path20.join(event4u_root(), "state", "skill-catalogue.jsonl"),
|
|
20703
|
+
...project_root ? [path20.join(project_root, OBSERVATION_LOG)] : []
|
|
20498
20704
|
];
|
|
20499
20705
|
const records = log_candidates.flatMap((p) => readObservationLog(p));
|
|
20500
20706
|
if (records.length === 0) return [];
|
|
@@ -20517,13 +20723,13 @@ function _catalogue_truncation_warnings(deploy_results, project_root) {
|
|
|
20517
20723
|
function _scoped_migration_notice(deploy_results, project_root, package_root, probe) {
|
|
20518
20724
|
if (!isInteractiveSession(probe)) return [];
|
|
20519
20725
|
const log_candidates = [
|
|
20520
|
-
|
|
20521
|
-
...project_root ? [
|
|
20726
|
+
path20.join(event4u_root(), "state", "skill-catalogue.jsonl"),
|
|
20727
|
+
...project_root ? [path20.join(project_root, OBSERVATION_LOG)] : []
|
|
20522
20728
|
];
|
|
20523
20729
|
const limits = knownHostLimits(log_candidates.flatMap((p) => readObservationLog(p)));
|
|
20524
20730
|
if (limits.size === 0) return [];
|
|
20525
20731
|
const resolved = _resolve_scoped_projection(package_root);
|
|
20526
|
-
const settings_path = _resolve_global_settings_path() ??
|
|
20732
|
+
const settings_path = _resolve_global_settings_path() ?? path20.join(event4u_root(), "settings", SETTINGS_FILE);
|
|
20527
20733
|
for (const tool_id of Object.keys(deploy_results).sort()) {
|
|
20528
20734
|
const [, , status] = deploy_results[tool_id];
|
|
20529
20735
|
if (status !== "deployed") continue;
|
|
@@ -20542,8 +20748,8 @@ function _scoped_migration_notice(deploy_results, project_root, package_root, pr
|
|
|
20542
20748
|
}
|
|
20543
20749
|
return [];
|
|
20544
20750
|
}
|
|
20545
|
-
var SETTINGS_SURFACE_REL =
|
|
20546
|
-
var SETTINGS_DELTA_REL =
|
|
20751
|
+
var SETTINGS_SURFACE_REL = path20.join("state", "settings-surface.json");
|
|
20752
|
+
var SETTINGS_DELTA_REL = path20.join("state", "settings-delta.json");
|
|
20547
20753
|
function _current_settings_surface(version) {
|
|
20548
20754
|
const jsonSchema = zodToJsonSchema(settingsSchema, {
|
|
20549
20755
|
name: "AgentSettings",
|
|
@@ -20554,20 +20760,20 @@ function _current_settings_surface(version) {
|
|
|
20554
20760
|
}
|
|
20555
20761
|
function _write_settings_surface_snapshot(installed_version) {
|
|
20556
20762
|
const root = event4u_root();
|
|
20557
|
-
const surface_path =
|
|
20558
|
-
const delta_path =
|
|
20763
|
+
const surface_path = path20.join(root, SETTINGS_SURFACE_REL);
|
|
20764
|
+
const delta_path = path20.join(root, SETTINGS_DELTA_REL);
|
|
20559
20765
|
const next = _current_settings_surface(installed_version);
|
|
20560
20766
|
let previous = null;
|
|
20561
20767
|
try {
|
|
20562
|
-
const parsed = JSON.parse(
|
|
20768
|
+
const parsed = JSON.parse(fs23.readFileSync(surface_path, "utf8"));
|
|
20563
20769
|
if (parsed !== null && typeof parsed === "object" && parsed.entries !== void 0) previous = parsed;
|
|
20564
20770
|
} catch {
|
|
20565
20771
|
}
|
|
20566
20772
|
if (previous !== null && previous.version !== next.version) {
|
|
20567
20773
|
const delta = computeSurfaceDelta(previous, next);
|
|
20568
20774
|
if (delta.changes.length > 0) {
|
|
20569
|
-
|
|
20570
|
-
|
|
20775
|
+
fs23.mkdirSync(path20.dirname(delta_path), { recursive: true, mode: 448 });
|
|
20776
|
+
fs23.writeFileSync(delta_path, `${JSON.stringify(delta, null, 2)}
|
|
20571
20777
|
`, { mode: 384 });
|
|
20572
20778
|
if (!state.QUIET) {
|
|
20573
20779
|
const counts = {};
|
|
@@ -20579,8 +20785,8 @@ function _write_settings_surface_snapshot(installed_version) {
|
|
|
20579
20785
|
}
|
|
20580
20786
|
}
|
|
20581
20787
|
}
|
|
20582
|
-
|
|
20583
|
-
|
|
20788
|
+
fs23.mkdirSync(path20.dirname(surface_path), { recursive: true, mode: 448 });
|
|
20789
|
+
fs23.writeFileSync(surface_path, `${JSON.stringify(next, null, 2)}
|
|
20584
20790
|
`, { mode: 384 });
|
|
20585
20791
|
}
|
|
20586
20792
|
function arrayStrEqual(a, b) {
|
|
@@ -20800,13 +21006,13 @@ function _minimal_templates_root() {
|
|
|
20800
21006
|
const chain = [start];
|
|
20801
21007
|
let cur = start;
|
|
20802
21008
|
for (; ; ) {
|
|
20803
|
-
const parent =
|
|
21009
|
+
const parent = path20.dirname(cur);
|
|
20804
21010
|
if (parent === cur) break;
|
|
20805
21011
|
chain.push(parent);
|
|
20806
21012
|
cur = parent;
|
|
20807
21013
|
}
|
|
20808
21014
|
for (const ancestor of chain) {
|
|
20809
|
-
const candidate =
|
|
21015
|
+
const candidate = path20.join(ancestor, "src", "templates", "minimal");
|
|
20810
21016
|
if (isDir(candidate)) return candidate;
|
|
20811
21017
|
}
|
|
20812
21018
|
fail("Could not locate src/templates/minimal/ \u2014 package install is corrupt.");
|
|
@@ -20814,9 +21020,9 @@ function _minimal_templates_root() {
|
|
|
20814
21020
|
var INSTALL_MODE_MARKER_REL = "agents/.agent-state/install-mode.txt";
|
|
20815
21021
|
function _write_install_mode_marker(project_root, mode) {
|
|
20816
21022
|
if (mode !== "minimal" && mode !== "full") return;
|
|
20817
|
-
const marker =
|
|
21023
|
+
const marker = path20.join(project_root, INSTALL_MODE_MARKER_REL);
|
|
20818
21024
|
try {
|
|
20819
|
-
mkdirp(
|
|
21025
|
+
mkdirp(path20.dirname(marker));
|
|
20820
21026
|
writeText(marker, `${mode}
|
|
20821
21027
|
`);
|
|
20822
21028
|
} catch {
|
|
@@ -20825,7 +21031,7 @@ function _write_install_mode_marker(project_root, mode) {
|
|
|
20825
21031
|
function install_minimal(target_root_in, force, user_type = "") {
|
|
20826
21032
|
let target_root = resolvePath(target_root_in);
|
|
20827
21033
|
mkdirp(target_root);
|
|
20828
|
-
const parent =
|
|
21034
|
+
const parent = path20.dirname(target_root);
|
|
20829
21035
|
if (parent !== target_root) {
|
|
20830
21036
|
const existing = find_project_root_with_anchor(parent);
|
|
20831
21037
|
if (existing !== null && existing[0] !== target_root) {
|
|
@@ -20836,21 +21042,21 @@ function install_minimal(target_root_in, force, user_type = "") {
|
|
|
20836
21042
|
}
|
|
20837
21043
|
}
|
|
20838
21044
|
const templates = _minimal_templates_root();
|
|
20839
|
-
const settings_src =
|
|
20840
|
-
const overrides_gitkeep_src =
|
|
20841
|
-
const overrides_readme_src =
|
|
21045
|
+
const settings_src = path20.join(templates, SETTINGS_FILE);
|
|
21046
|
+
const overrides_gitkeep_src = path20.join(templates, "overrides-gitkeep");
|
|
21047
|
+
const overrides_readme_src = path20.join(templates, "agents-overrides-readme.md");
|
|
20842
21048
|
if (!isFile(settings_src)) fail(`Bundled minimal settings template missing under ${templates}`);
|
|
20843
21049
|
if (!isFile(overrides_gitkeep_src) || !isFile(overrides_readme_src)) {
|
|
20844
21050
|
fail(`Bundled overrides scaffold templates missing under ${templates}`);
|
|
20845
21051
|
}
|
|
20846
21052
|
info(`Minimal init \u2192 ${target_root}`);
|
|
20847
|
-
const overrides_root =
|
|
21053
|
+
const overrides_root = path20.join(target_root, "agents", "overrides");
|
|
20848
21054
|
mkdirp(overrides_root);
|
|
20849
21055
|
const gitkeep_body = readText(overrides_gitkeep_src);
|
|
20850
21056
|
for (const sub of ["rules", "skills", "commands"]) {
|
|
20851
|
-
const sub_dir =
|
|
21057
|
+
const sub_dir = path20.join(overrides_root, sub);
|
|
20852
21058
|
mkdirp(sub_dir);
|
|
20853
|
-
const gitkeep_dst =
|
|
21059
|
+
const gitkeep_dst = path20.join(sub_dir, ".gitkeep");
|
|
20854
21060
|
if (pathExists(gitkeep_dst) && !force) {
|
|
20855
21061
|
skip(`agents/overrides/${sub}/.gitkeep already exists (use --force to overwrite)`);
|
|
20856
21062
|
} else {
|
|
@@ -20858,7 +21064,7 @@ function install_minimal(target_root_in, force, user_type = "") {
|
|
|
20858
21064
|
success(`Wrote agents/overrides/${sub}/.gitkeep`);
|
|
20859
21065
|
}
|
|
20860
21066
|
}
|
|
20861
|
-
const readme_dst =
|
|
21067
|
+
const readme_dst = path20.join(overrides_root, "README.md");
|
|
20862
21068
|
if (pathExists(readme_dst) && !force) {
|
|
20863
21069
|
skip("agents/overrides/README.md already exists (use --force to overwrite)");
|
|
20864
21070
|
} else {
|
|
@@ -20876,14 +21082,14 @@ function install_minimal(target_root_in, force, user_type = "") {
|
|
|
20876
21082
|
personal:
|
|
20877
21083
|
user_type: ${user_type}
|
|
20878
21084
|
`;
|
|
20879
|
-
mkdirp(
|
|
21085
|
+
mkdirp(path20.dirname(settings_dst));
|
|
20880
21086
|
writeText(settings_dst, body);
|
|
20881
21087
|
success(`Wrote ${SETTINGS_FILE} (user_type=${user_type})`);
|
|
20882
21088
|
}
|
|
20883
21089
|
}
|
|
20884
21090
|
const removed_marker = _remove_legacy_consumer_bridge_marker(target_root);
|
|
20885
21091
|
if (removed_marker !== null) {
|
|
20886
|
-
const rel = isRelativeTo(removed_marker, target_root) ?
|
|
21092
|
+
const rel = isRelativeTo(removed_marker, target_root) ? path20.relative(target_root, removed_marker) : removed_marker;
|
|
20887
21093
|
success(`Removed legacy bridge marker: ${rel}`);
|
|
20888
21094
|
}
|
|
20889
21095
|
_write_install_mode_marker(target_root, "minimal");
|
|
@@ -20957,7 +21163,7 @@ function run_interactive_init(project_root, force) {
|
|
|
20957
21163
|
);
|
|
20958
21164
|
return 0;
|
|
20959
21165
|
}
|
|
20960
|
-
const target =
|
|
21166
|
+
const target = path20.join(project_root, _LOCAL_CONFIG_FILE);
|
|
20961
21167
|
if (pathExists(target) && !force) {
|
|
20962
21168
|
warn(
|
|
20963
21169
|
`${_LOCAL_CONFIG_FILE} already exists; re-run with --force to overwrite. Skipping interactive init.`
|
|
@@ -20984,7 +21190,7 @@ function run_interactive_init(project_root, force) {
|
|
|
20984
21190
|
warn(`Could not write ${target}: ${String(exc)}`);
|
|
20985
21191
|
return 1;
|
|
20986
21192
|
}
|
|
20987
|
-
success(`Wrote ${
|
|
21193
|
+
success(`Wrote ${path20.relative(project_root, target)} (${user_type} / ${stack} / ${verbosity})`);
|
|
20988
21194
|
return 0;
|
|
20989
21195
|
}
|
|
20990
21196
|
var _WIZARD_READY_RE = /^WIZARD_READY (http:\/\/(?:127\.0\.0\.1|localhost):\d+\/\S*)\r?$/;
|
|
@@ -21002,12 +21208,12 @@ function _wizard_should_launch(opts) {
|
|
|
21002
21208
|
return [true, ""];
|
|
21003
21209
|
}
|
|
21004
21210
|
function _wizard_cli_dist(_project_root) {
|
|
21005
|
-
const package_root =
|
|
21006
|
-
const cli =
|
|
21211
|
+
const package_root = path20.dirname(path20.dirname(path20.dirname(resolvePath(_HERE2))));
|
|
21212
|
+
const cli = path20.join(package_root, "dist", "cli", "agent-config.js");
|
|
21007
21213
|
return pathExists(cli) ? cli : null;
|
|
21008
21214
|
}
|
|
21009
21215
|
function _server_info_path() {
|
|
21010
|
-
return
|
|
21216
|
+
return path20.join(os8.homedir(), ".event4u", "agent-config", "local-server.json");
|
|
21011
21217
|
}
|
|
21012
21218
|
function _pid_is_agent_config(pid) {
|
|
21013
21219
|
let res;
|
|
@@ -21024,7 +21230,7 @@ function _pid_is_agent_config(pid) {
|
|
|
21024
21230
|
}
|
|
21025
21231
|
function unlinkMissingOk(p) {
|
|
21026
21232
|
try {
|
|
21027
|
-
|
|
21233
|
+
fs23.unlinkSync(p);
|
|
21028
21234
|
} catch {
|
|
21029
21235
|
}
|
|
21030
21236
|
}
|
|
@@ -21102,14 +21308,14 @@ function _wizard_spawn(project_root, pass_project_root = true) {
|
|
|
21102
21308
|
}
|
|
21103
21309
|
function _wizard_run_sync(cmd, env, cli) {
|
|
21104
21310
|
const total = _WIZARD_TIMEOUTS.reduce((a, b) => a + b, 0);
|
|
21105
|
-
const log_path =
|
|
21311
|
+
const log_path = path20.join(
|
|
21106
21312
|
os8.tmpdir(),
|
|
21107
21313
|
`agent-config-wizard-${process3.pid}-${Date.now()}.log`
|
|
21108
21314
|
);
|
|
21109
21315
|
let child;
|
|
21110
21316
|
let log_fd = null;
|
|
21111
21317
|
try {
|
|
21112
|
-
log_fd =
|
|
21318
|
+
log_fd = fs23.openSync(log_path, "w");
|
|
21113
21319
|
child = spawn(cmd[0], cmd.slice(1), {
|
|
21114
21320
|
env,
|
|
21115
21321
|
detached: true,
|
|
@@ -21127,7 +21333,7 @@ function _wizard_run_sync(cmd, env, cli) {
|
|
|
21127
21333
|
} finally {
|
|
21128
21334
|
if (log_fd !== null) {
|
|
21129
21335
|
try {
|
|
21130
|
-
|
|
21336
|
+
fs23.closeSync(log_fd);
|
|
21131
21337
|
} catch {
|
|
21132
21338
|
}
|
|
21133
21339
|
}
|
|
@@ -21377,8 +21583,8 @@ function main2(argv) {
|
|
|
21377
21583
|
const target_root = resolvePath(
|
|
21378
21584
|
opts.custom_path || opts.project || process3.env["PROJECT_ROOT"] || process3.cwd()
|
|
21379
21585
|
);
|
|
21380
|
-
const minimal_package_root =
|
|
21381
|
-
|
|
21586
|
+
const minimal_package_root = path20.dirname(
|
|
21587
|
+
path20.dirname(path20.dirname(_minimal_templates_root()))
|
|
21382
21588
|
);
|
|
21383
21589
|
const validated_user_type = _validate_user_type(minimal_package_root, opts.user_type);
|
|
21384
21590
|
return install_minimal(target_root, opts.force, validated_user_type);
|
|
@@ -21410,7 +21616,7 @@ function main2(argv) {
|
|
|
21410
21616
|
return rc2;
|
|
21411
21617
|
}
|
|
21412
21618
|
const project_root = custom_path || resolvePath(opts.project || process3.env["PROJECT_ROOT"] || process3.cwd());
|
|
21413
|
-
const is_first_run = !pathExists(
|
|
21619
|
+
const is_first_run = !pathExists(path20.join(project_root, SETTINGS_FILE));
|
|
21414
21620
|
const rc = _main_project_install(opts, project_root, parsed_tools, is_first_run);
|
|
21415
21621
|
if (rc === 0 && opts.interactive) {
|
|
21416
21622
|
run_interactive_init(project_root, opts.force);
|
|
@@ -21474,16 +21680,16 @@ function _team_setup_hint_line(project_root) {
|
|
|
21474
21680
|
return " \u2022 Claude Code team mode (optional cross-model review via the official codex plugin): run `agent-config doctor --check team` for setup status.";
|
|
21475
21681
|
}
|
|
21476
21682
|
function finalize_claude_model_tiers(project_root) {
|
|
21477
|
-
const claude_skills =
|
|
21478
|
-
const augment_skills =
|
|
21683
|
+
const claude_skills = path20.join(project_root, ".claude", "skills");
|
|
21684
|
+
const augment_skills = path20.join(project_root, ".augment", "skills");
|
|
21479
21685
|
if (!isDir(claude_skills) || !isDir(augment_skills)) return 0;
|
|
21480
21686
|
if (_read_consumer_auto_switch(project_root) !== "auto") return 0;
|
|
21481
21687
|
let rendered = 0;
|
|
21482
|
-
const entries =
|
|
21688
|
+
const entries = fs23.readdirSync(claude_skills).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
21483
21689
|
for (const name of entries) {
|
|
21484
|
-
const entry =
|
|
21485
|
-
const src_dir =
|
|
21486
|
-
const src_md =
|
|
21690
|
+
const entry = path20.join(claude_skills, name);
|
|
21691
|
+
const src_dir = path20.join(augment_skills, name);
|
|
21692
|
+
const src_md = path20.join(src_dir, "SKILL.md");
|
|
21487
21693
|
let tier;
|
|
21488
21694
|
try {
|
|
21489
21695
|
tier = read_model_tier(src_md);
|
|
@@ -21492,22 +21698,22 @@ function finalize_claude_model_tiers(project_root) {
|
|
|
21492
21698
|
}
|
|
21493
21699
|
if (tier === null || !(tier in TIER_TO_CLAUDE_MODEL) || !isDir(src_dir)) continue;
|
|
21494
21700
|
if (isSymlink(entry) || isFile(entry)) {
|
|
21495
|
-
|
|
21701
|
+
fs23.unlinkSync(entry);
|
|
21496
21702
|
} else if (isDir(entry)) {
|
|
21497
|
-
|
|
21703
|
+
fs23.rmSync(entry, { recursive: true, force: true });
|
|
21498
21704
|
}
|
|
21499
21705
|
mkdirp(entry);
|
|
21500
|
-
const srcFiles =
|
|
21706
|
+
const srcFiles = fs23.readdirSync(src_dir).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
21501
21707
|
for (const fname of srcFiles) {
|
|
21502
21708
|
if (fname === "SKILL.md") {
|
|
21503
21709
|
writeText(
|
|
21504
|
-
|
|
21710
|
+
path20.join(entry, "SKILL.md"),
|
|
21505
21711
|
render_native_model_md(readText(src_md), tier)
|
|
21506
21712
|
);
|
|
21507
21713
|
} else {
|
|
21508
|
-
|
|
21509
|
-
|
|
21510
|
-
|
|
21714
|
+
fs23.symlinkSync(
|
|
21715
|
+
path20.join("../../../.augment/skills", name, fname),
|
|
21716
|
+
path20.join(entry, fname)
|
|
21511
21717
|
);
|
|
21512
21718
|
}
|
|
21513
21719
|
}
|
|
@@ -21525,7 +21731,7 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
|
|
|
21525
21731
|
let package_type;
|
|
21526
21732
|
if (opts.package) {
|
|
21527
21733
|
package_root = resolvePath(opts.package);
|
|
21528
|
-
if (!pathExists(
|
|
21734
|
+
if (!pathExists(path20.join(package_root, "src", "config", "profiles", "minimal.ini"))) {
|
|
21529
21735
|
fail(`Invalid --package path (missing src/config/profiles/minimal.ini): ${package_root}`);
|
|
21530
21736
|
}
|
|
21531
21737
|
package_type = detect_package_type_for_project(project_root, package_root);
|
|
@@ -21669,9 +21875,9 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
|
|
|
21669
21875
|
function _resolvedArgv1() {
|
|
21670
21876
|
if (process3.argv[1] === void 0) return void 0;
|
|
21671
21877
|
try {
|
|
21672
|
-
return
|
|
21878
|
+
return fs23.realpathSync(path20.resolve(process3.argv[1]));
|
|
21673
21879
|
} catch {
|
|
21674
|
-
return
|
|
21880
|
+
return path20.resolve(process3.argv[1]);
|
|
21675
21881
|
}
|
|
21676
21882
|
}
|
|
21677
21883
|
var _argv1 = _resolvedArgv1();
|