@event4u/agent-config 14.11.0 → 14.13.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 +368 -516
- 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 +109 -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/evidence-discipline.md +26 -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-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 +247 -3
- package/dist/agent-src/scripts/guarded_baseline.ts +328 -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 +400 -0
- package/dist/agent-src/scripts/ticket_bundles.ts +84 -0
- package/dist/agent-src/scripts/update_roadmap_progress.ts +8 -4
- 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/code-refactoring/SKILL.md +45 -1
- package/dist/agent-src/skills/code-review/SKILL.md +65 -6
- package/dist/agent-src/skills/command-writing/SKILL.md +35 -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 +25 -2
- 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/project-analysis-core/SKILL.md +23 -0
- package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +30 -13
- package/dist/agent-src/skills/skill-writing/references/procedure.md +29 -7
- 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/storybook-workshop/SKILL.md +9 -0
- 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 +53 -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-L43NCYPB.js → chunk-4FS4WRXP.js} +10 -0
- package/dist/cli-delegate/{chunk-OMIVVCG2.js → chunk-A4QJ6ENT.js} +24 -0
- package/dist/cli-delegate/{chunk-236PNQZK.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 +42 -10
- 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 +62 -62
- 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 +2413 -1087
- 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 +639 -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 +4818 -2645
- package/dist/server/schemas/settings.js +6 -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 +30 -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/downstream-changes-mechanics.md +91 -0
- 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 +21 -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/docs/guidelines/redundancy-taxonomy.md +180 -0
- package/llms.txt +2 -2
- package/package.json +10 -3
- package/src/agent-src/scripts/archive_completed_roadmaps.ts +247 -3
- package/src/agent-src/scripts/guarded_baseline.ts +328 -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 +400 -0
- package/src/agent-src/scripts/ticket_bundles.ts +84 -0
- package/src/agent-src/scripts/update_roadmap_progress.ts +8 -4
- 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 +48 -3
- package/src/config/assurance-capability-registry.json +21 -9
- package/src/config/budgets.yml +19 -0
- 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 +95 -0
- package/src/config/discovery/prompt-patterns.yml +56 -0
- package/src/config/drafting-channels.yml +43 -0
- package/src/config/estate-count-budget.json +38 -31
- package/src/config/evaluator-budgets.json +14 -14
- package/src/config/gate-coverage.yml +731 -30
- package/src/config/gate-reachability-exemptions.json +21 -0
- package/src/config/gate-violation-baselines.json +38 -20
- 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 +35 -7
- package/src/config/preamble-payload-budget.json +97 -71
- 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 +43 -0
- package/src/config/rule-stub-ceilings.json +126 -112
- package/src/config/suggestion-capture.json +28 -0
- package/src/config/surface-matrix.yml +21 -2
- package/src/config/turnaround-budget.json +66 -0
- package/src/config/web-launch-readiness.json +188 -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 +27 -0
- package/src/scripts/_lib/activation_ladder.ts +211 -0
- package/src/scripts/_lib/activation_states.ts +88 -0
- package/src/scripts/_lib/adherence_detectors.ts +143 -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_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/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/council_settings_block.ts +6 -0
- package/src/scripts/_lib/curator_ops.ts +172 -0
- package/src/scripts/_lib/delivery_arm_experiment.ts +266 -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/eval_publication.ts +354 -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/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/gate_baseline.ts +150 -1
- package/src/scripts/_lib/generated_by.ts +66 -0
- package/src/scripts/_lib/harness_evolution_guards.ts +229 -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/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/prefix_stable_surfaces.ts +123 -0
- package/src/scripts/_lib/privacy_class.ts +47 -0
- package/src/scripts/_lib/regression_neighbourhood.ts +259 -0
- 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/runtime_journal.ts +1499 -0
- package/src/scripts/_lib/runtime_wiring_checks.ts +430 -0
- package/src/scripts/_lib/skill_catalogue.ts +11 -1
- package/src/scripts/_lib/skill_estate.ts +115 -0
- 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/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/argument_exhaustion.ts +130 -0
- 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/disagreement_signal.ts +338 -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/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/response_record.ts +50 -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 +126 -0
- 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 +195 -7
- package/src/scripts/check_claims.ts +576 -6
- package/src/scripts/check_command_examples.ts +557 -0
- 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 +263 -3
- 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 +144 -6
- 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_routing_coverage.ts +352 -0
- 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 +528 -0
- package/src/scripts/check_skill_admissions.ts +514 -0
- 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/check_web_launch_readiness.ts +705 -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/cost/budget.mjs +10 -3
- package/src/scripts/cost/track.mjs +10 -3
- package/src/scripts/council_cli.ts +37 -54
- package/src/scripts/description_route_check.ts +494 -0
- package/src/scripts/dispatch_r2_reviewer.ts +46 -5
- package/src/scripts/evolution_lab.ts +980 -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 -11
- 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/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 +378 -0
- 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/lint_adr_sweep_routing.ts +12 -0
- package/src/scripts/lint_budget_ownership.ts +54 -4
- package/src/scripts/lint_canonical_terms.ts +604 -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_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 +752 -0
- package/src/scripts/lint_ticket_buildable.ts +17 -1
- 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_docs_dead_links.ts +348 -0
- package/src/scripts/measure_host_capture.ts +461 -0
- package/src/scripts/migration_status.ts +3 -3
- package/src/scripts/model_rule_injection.ts +60 -0
- package/src/scripts/orchestration_record.ts +14 -0
- package/src/scripts/pack_install_smoke.ts +363 -0
- package/src/scripts/pr_conflict_census.ts +187 -0
- package/src/scripts/preamble_byte_census.ts +139 -10
- package/src/scripts/prepack-check.mjs +4 -1
- package/src/scripts/probe_turnaround.ts +384 -0
- package/src/scripts/probe_unblocked_ask.ts +279 -0
- package/src/scripts/render_benchmark_md.ts +1 -1
- package/src/scripts/report_pack_delta.ts +204 -0
- 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/select_analysis_mode.ts +112 -0
- 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 +40 -1
- package/src/scripts/trigger_eval_grandfather.json +202 -222
- package/src/scripts/utilization_report.ts +22 -2
- package/src/server/schemas/settings.ts +10 -0
- package/src/templates/marketing-copy.yml +1 -1
- package/dist/agent-src/skills/accessibility-auditor/evals/evals.json +0 -15
- package/dist/agent-src/skills/agent-security-review/evals/triggers.json +0 -52
- package/dist/agent-src/skills/ai-code-blindspots/evals/triggers.json +0 -52
- package/dist/agent-src/skills/alerting-doctrine/evals/triggers.json +0 -17
- package/dist/agent-src/skills/analysis-skill-router/evals/evals.json +0 -13
- package/dist/agent-src/skills/brand/evals/triggers.json +0 -17
- package/dist/agent-src/skills/brand-asset-generation/evals/triggers.json +0 -17
- package/dist/agent-src/skills/brand-audit/evals/triggers.json +0 -17
- package/dist/agent-src/skills/brand-identity/evals/triggers.json +0 -17
- package/dist/agent-src/skills/brand-strategy/evals/triggers.json +0 -17
- package/dist/agent-src/skills/brand-to-tokens/evals/triggers.json +0 -17
- package/dist/agent-src/skills/bug-analyzer/evals/evals.json +0 -13
- package/dist/agent-src/skills/canvas-design/evals/triggers.json +0 -17
- package/dist/agent-src/skills/character-consistency/evals/evals.json +0 -16
- package/dist/agent-src/skills/code-intelligence/evals/triggers.json +0 -52
- package/dist/agent-src/skills/code-review/evals/evals.json +0 -100
- package/dist/agent-src/skills/command-routing/evals/evals.json +0 -14
- package/dist/agent-src/skills/complexity-first-planning/evals/triggers.json +0 -17
- package/dist/agent-src/skills/contract-review/evals/triggers.json +0 -17
- package/dist/agent-src/skills/conventional-commits-writing/evals/evals.json +0 -15
- package/dist/agent-src/skills/corpus-grounding/evals/triggers.json +0 -17
- package/dist/agent-src/skills/dashboard-design/evals/evals.json +0 -16
- package/dist/agent-src/skills/dcf-modeling/evals/domain-truth.json +0 -29
- package/dist/agent-src/skills/dcf-modeling/evals/evals.json +0 -20
- package/dist/agent-src/skills/decision-record/evals/evals.json +0 -20
- package/dist/agent-src/skills/decision-record/evals/triggers.json +0 -87
- package/dist/agent-src/skills/design-intelligence/evals/evals.json +0 -14
- package/dist/agent-src/skills/design-intelligence/evals/triggers.json +0 -17
- package/dist/agent-src/skills/design-system-capture/evals/evals.json +0 -15
- package/dist/agent-src/skills/design-tokens/evals/triggers.json +0 -17
- package/dist/agent-src/skills/design-variations/evals/triggers.json +0 -17
- package/dist/agent-src/skills/developer-like-execution/evals/evals.json +0 -16
- package/dist/agent-src/skills/doc-coauthoring/evals/evals.json +0 -16
- package/dist/agent-src/skills/doc-coauthoring/evals/triggers.json +0 -17
- package/dist/agent-src/skills/docx-authoring/evals/triggers.json +0 -52
- package/dist/agent-src/skills/dpa-review/evals/triggers.json +0 -17
- package/dist/agent-src/skills/editorial-calendar/evals/domain-truth.json +0 -16
- package/dist/agent-src/skills/editorial-calendar/evals/evals.json +0 -16
- package/dist/agent-src/skills/eloquent/evals/triggers.json +0 -17
- package/dist/agent-src/skills/estimate-ticket/evals/evals.json +0 -16
- package/dist/agent-src/skills/estimate-ticket/evals/output-schema.yml +0 -20
- package/dist/agent-src/skills/estimate-ticket/evals/triggers.json +0 -19
- package/dist/agent-src/skills/evaluate-llm-feature/evals/triggers.json +0 -52
- package/dist/agent-src/skills/existing-ui-audit/evals/triggers.json +0 -47
- package/dist/agent-src/skills/experiment-loop/evals/output-schema.yml +0 -27
- package/dist/agent-src/skills/experiment-loop/evals/triggers.json +0 -17
- package/dist/agent-src/skills/fe-design/evals/triggers.json +0 -67
- package/dist/agent-src/skills/forecasting/evals/domain-truth.json +0 -29
- package/dist/agent-src/skills/forecasting/evals/evals.json +0 -20
- package/dist/agent-src/skills/forensics-report/evals/triggers.json +0 -17
- package/dist/agent-src/skills/frontend-render-security/evals/triggers.json +0 -52
- package/dist/agent-src/skills/fundraising-narrative/evals/domain-truth.json +0 -16
- package/dist/agent-src/skills/fundraising-narrative/evals/evals.json +0 -16
- package/dist/agent-src/skills/gated-reach/evals/triggers.json +0 -72
- package/dist/agent-src/skills/github-ci/evals/evals.json +0 -25
- package/dist/agent-src/skills/history-design/evals/triggers.json +0 -17
- package/dist/agent-src/skills/html-deck/evals/triggers.json +0 -17
- package/dist/agent-src/skills/humanizer/evals/strip_fixtures.json +0 -57
- package/dist/agent-src/skills/humanizer/evals/triggers.json +0 -17
- package/dist/agent-src/skills/iconography/evals/triggers.json +0 -17
- package/dist/agent-src/skills/image-analyser/evals/triggers.json +0 -17
- package/dist/agent-src/skills/image-creator/evals/triggers.json +0 -17
- package/dist/agent-src/skills/image-editing/evals/triggers.json +0 -17
- package/dist/agent-src/skills/image-generation/evals/triggers.json +0 -17
- package/dist/agent-src/skills/image-provider-routing/evals/triggers.json +0 -17
- package/dist/agent-src/skills/incident-commander/evals/domain-truth.json +0 -16
- package/dist/agent-src/skills/incident-commander/evals/evals.json +0 -20
- package/dist/agent-src/skills/js-library-packaging/evals/triggers.json +0 -17
- package/dist/agent-src/skills/judge-artifact-completeness/evals/triggers.json +0 -17
- package/dist/agent-src/skills/judge-injection-defense/evals/triggers.json +0 -17
- package/dist/agent-src/skills/judge-synthesis/evals/triggers.json +0 -17
- package/dist/agent-src/skills/launch-readiness/evals/evals.json +0 -21
- package/dist/agent-src/skills/learning-tutor/evals/triggers.json +0 -52
- package/dist/agent-src/skills/legal-intake-triage/evals/triggers.json +0 -17
- package/dist/agent-src/skills/legal-practice-profile/evals/triggers.json +0 -17
- package/dist/agent-src/skills/license-compliance-audit/evals/triggers.json +0 -52
- package/dist/agent-src/skills/license-compliance-borrow-check/evals/triggers.json +0 -52
- package/dist/agent-src/skills/license-compliance-credits/evals/triggers.json +0 -52
- package/dist/agent-src/skills/llm-provider-knowledge/evals/triggers.json +0 -20
- package/dist/agent-src/skills/logging-monitoring/evals/evals.json +0 -16
- package/dist/agent-src/skills/logo-generation/evals/triggers.json +0 -17
- package/dist/agent-src/skills/messaging-architecture/evals/domain-truth.json +0 -16
- package/dist/agent-src/skills/messaging-architecture/evals/evals.json +0 -16
- package/dist/agent-src/skills/monorepo-workspace/evals/triggers.json +0 -17
- package/dist/agent-src/skills/nda-triage/evals/triggers.json +0 -17
- package/dist/agent-src/skills/operational-readiness/evals/triggers.json +0 -17
- package/dist/agent-src/skills/pdf-tools/evals/triggers.json +0 -52
- package/dist/agent-src/skills/perf-feedback-craft/evals/evals.json +0 -16
- package/dist/agent-src/skills/persona-improvement/evals/triggers.json +0 -52
- package/dist/agent-src/skills/php-coder/evals/triggers.json +0 -17
- package/dist/agent-src/skills/prediction-pool-optimizer/evals/triggers.json +0 -21
- package/dist/agent-src/skills/prompt-engineering-image/evals/triggers.json +0 -17
- package/dist/agent-src/skills/prompt-engineering-patterns/evals/evals.json +0 -16
- package/dist/agent-src/skills/prompt-validator/evals/triggers.json +0 -17
- package/dist/agent-src/skills/quality-tools/evals/evals.json +0 -15
- package/dist/agent-src/skills/reasoning-orchestrator/evals/triggers.json +0 -17
- package/dist/agent-src/skills/refine-prompt/evals/evals.json +0 -16
- package/dist/agent-src/skills/refine-ticket/evals/evals.json +0 -16
- package/dist/agent-src/skills/refine-ticket/evals/output-schema.yml +0 -16
- package/dist/agent-src/skills/refine-ticket/evals/triggers.json +0 -17
- package/dist/agent-src/skills/release-comms/evals/evals.json +0 -16
- package/dist/agent-src/skills/rice-prioritization/evals/evals.json +0 -20
- package/dist/agent-src/skills/runway-cognition/evals/domain-truth.json +0 -29
- package/dist/agent-src/skills/runway-cognition/evals/evals.json +0 -20
- package/dist/agent-src/skills/scenario-modeling/evals/domain-truth.json +0 -29
- package/dist/agent-src/skills/scenario-modeling/evals/evals.json +0 -20
- package/dist/agent-src/skills/schema-review/evals/triggers.json +0 -17
- package/dist/agent-src/skills/screenshot-hygiene/evals/triggers.json +0 -52
- package/dist/agent-src/skills/security-maturity-assessment/evals/triggers.json +0 -52
- package/dist/agent-src/skills/server-hardening/evals/triggers.json +0 -17
- package/dist/agent-src/skills/skill-writing/evals/triggers.json +0 -17
- package/dist/agent-src/skills/spreadsheet-authoring/evals/triggers.json +0 -47
- package/dist/agent-src/skills/storybook-workshop/evals/triggers.json +0 -17
- package/dist/agent-src/skills/subagent-orchestration/evals/evals.json +0 -60
- package/dist/agent-src/skills/supply-chain-intake/evals/triggers.json +0 -52
- package/dist/agent-src/skills/systematic-debugging/evals/evals.json +0 -20
- package/dist/agent-src/skills/test-case-discovery/evals/triggers.json +0 -52
- package/dist/agent-src/skills/test-driven-development/evals/evals.json +0 -16
- package/dist/agent-src/skills/threat-modeling/evals/evals.json +0 -21
- package/dist/agent-src/skills/typography-system/evals/evals.json +0 -14
- package/dist/agent-src/skills/typography-system/evals/triggers.json +0 -17
- package/dist/agent-src/skills/unit-economics-modeling/evals/domain-truth.json +0 -40
- package/dist/agent-src/skills/unit-economics-modeling/evals/evals.json +0 -24
- package/dist/agent-src/skills/verify-completion-evidence/evals/evals.json +0 -16
- package/dist/agent-src/skills/verify-repair-loop/evals/output-schema.yml +0 -20
- package/dist/agent-src/skills/verify-repair-loop/evals/triggers.json +0 -17
- package/dist/agent-src/skills/vision-articulation/evals/evals.json +0 -16
- package/dist/agent-src/skills/voice-and-tone-design/evals/evals.json +0 -16
- package/dist/agent-src/skills/wireframe/evals/triggers.json +0 -17
- package/dist/agent-src/skills/workspace-link/evals/triggers.json +0 -17
- package/dist/agent-src/skills/worktree-lifecycle/evals/evals.json +0 -38
- package/dist/agent-src/skills/worktree-lifecycle/evals/triggers.json +0 -52
- package/dist/cli/agent-config.js.map +0 -1
- package/dist/cli/bash/runBash.js.map +0 -1
- package/dist/cli/commands/commands.js.map +0 -1
- package/dist/cli/commands/config.js.map +0 -1
- package/dist/cli/commands/doctorShell.js.map +0 -1
- package/dist/cli/commands/mcpServer.js.map +0 -1
- package/dist/cli/commands/packs.js.map +0 -1
- package/dist/cli/commands/profiles.js.map +0 -1
- package/dist/cli/commands/recordTriggerEval.js.map +0 -1
- package/dist/cli/commands/rtkDetect.js.map +0 -1
- package/dist/cli/commands/settings.js.map +0 -1
- package/dist/cli/commands/uiAudit.js.map +0 -1
- package/dist/cli/commands/uiRender.js.map +0 -1
- package/dist/cli/commands/uiServe.js.map +0 -1
- package/dist/cli/commands/versions.js.map +0 -1
- package/dist/cli/commands/workspaces.js.map +0 -1
- package/dist/cli/configRoot.js.map +0 -1
- package/dist/cli/discovery/loadManifest.js.map +0 -1
- package/dist/cli/firstRunNotice.js.map +0 -1
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/initRouting.js.map +0 -1
- package/dist/cli/log/logger.js.map +0 -1
- package/dist/cli/main.js.map +0 -1
- package/dist/cli/mcp/content.js.map +0 -1
- package/dist/cli/mcp/dispatch.js.map +0 -1
- package/dist/cli/mcp/stdio.js.map +0 -1
- package/dist/cli/paths.js.map +0 -1
- package/dist/cli/python/knowledge_ingest.js.map +0 -1
- package/dist/cli/python/workspace_analytics.js.map +0 -1
- package/dist/cli/python/workspace_crypto.js.map +0 -1
- package/dist/cli/python/workspace_documents.js.map +0 -1
- package/dist/cli/python/workspace_drive.js.map +0 -1
- package/dist/cli/python/workspace_drive_health.js.map +0 -1
- package/dist/cli/python/workspace_explain.js.map +0 -1
- package/dist/cli/python/workspace_hosts.js.map +0 -1
- package/dist/cli/python/workspace_inbox.js.map +0 -1
- package/dist/cli/python/workspace_render.js.map +0 -1
- package/dist/cli/python/workspace_roles.js.map +0 -1
- package/dist/cli/python/workspace_secrets.js.map +0 -1
- package/dist/cli/python/workspace_sessions.js.map +0 -1
- package/dist/cli/python/workspace_skills.js.map +0 -1
- package/dist/cli/registry.js.map +0 -1
- package/dist/install/agentSwitchDetection.js.map +0 -1
- package/dist/install/agentSwitchProfile.js.map +0 -1
- package/dist/install/atomic.js.map +0 -1
- package/dist/install/claudePathsPlan.js.map +0 -1
- package/dist/install/conflict.js.map +0 -1
- package/dist/install/detect.js.map +0 -1
- package/dist/install/emit_host_rules_cli.js.map +0 -1
- package/dist/install/globalRuleLayers.js.map +0 -1
- package/dist/install/hostLayerFingerprint.js.map +0 -1
- package/dist/install/partitionEligibility.js.map +0 -1
- package/dist/install/paths.js.map +0 -1
- package/dist/install/plan.js.map +0 -1
- package/dist/install/preflight.js.map +0 -1
- package/dist/install/rtkDetection.js.map +0 -1
- package/dist/install/ruleInScope.js.map +0 -1
- package/dist/install/ruleLayerPartition.js.map +0 -1
- package/dist/install/rule_scope.js.map +0 -1
- package/dist/install/rule_scope_cli.js.map +0 -1
- package/dist/install/selectedTools.js.map +0 -1
- package/dist/install/toolDetection.js.map +0 -1
- package/dist/install/txlog.js.map +0 -1
- package/dist/install/types.js.map +0 -1
- package/dist/install/wizard-plan.js.map +0 -1
- package/dist/install/wizardDismissals.js.map +0 -1
- package/dist/scripts/_lib/agent_settings.js.map +0 -1
- package/dist/scripts/_lib/agent_src.js.map +0 -1
- package/dist/scripts/_lib/claude_builtin_names.js.map +0 -1
- package/dist/scripts/_lib/claude_plugin.js.map +0 -1
- package/dist/scripts/_lib/claude_settings_hooks.js.map +0 -1
- package/dist/scripts/_lib/compile_time_toggles.js.map +0 -1
- package/dist/scripts/_lib/environment_detector.js.map +0 -1
- package/dist/scripts/_lib/host_launch.js.map +0 -1
- package/dist/scripts/_lib/install_layout.js.map +0 -1
- package/dist/scripts/_lib/installed_lock.js.map +0 -1
- package/dist/scripts/_lib/lean_projection_mode.js.map +0 -1
- package/dist/scripts/_lib/model_tier.js.map +0 -1
- package/dist/scripts/_lib/prune_empty_dirs.js.map +0 -1
- package/dist/scripts/_lib/scoped_projection.js.map +0 -1
- package/dist/scripts/_lib/script_output.js.map +0 -1
- package/dist/scripts/_lib/spawn_env.js.map +0 -1
- package/dist/scripts/_lib/surface_tiers.js.map +0 -1
- package/dist/scripts/_lib/token_count.js.map +0 -1
- package/dist/scripts/_lib/trigger_eval_floors.js.map +0 -1
- package/dist/scripts/_lib/ui_surface.js.map +0 -1
- package/dist/scripts/_lib/user_global_paths.js.map +0 -1
- package/dist/scripts/ai_council/modes.js.map +0 -1
- package/dist/scripts/ai_council/transport_resolver.js.map +0 -1
- package/dist/scripts/condense.js.map +0 -1
- package/dist/scripts/project_thin_rules.js.map +0 -1
- package/dist/server/app.js.map +0 -1
- package/dist/server/io/atomicMultiWrite.js.map +0 -1
- package/dist/server/io/atomicWrite.js.map +0 -1
- package/dist/server/io/sharedWriteCheck.js.map +0 -1
- package/dist/server/io/substituteTemplate.js.map +0 -1
- package/dist/server/io/yamlIO.js.map +0 -1
- package/dist/server/nicknameResolver.js.map +0 -1
- package/dist/server/port.js.map +0 -1
- package/dist/server/routes/discovery.js.map +0 -1
- package/dist/server/routes/install.js.map +0 -1
- package/dist/server/routes/ping.js.map +0 -1
- package/dist/server/routes/schema.js.map +0 -1
- package/dist/server/routes/settings.js.map +0 -1
- package/dist/server/routes/settingsChanges.js.map +0 -1
- package/dist/server/routes/userMd.js.map +0 -1
- package/dist/server/routes/wizard.js.map +0 -1
- package/dist/server/routes/workspace.js.map +0 -1
- package/dist/server/schemas/settings.js.map +0 -1
- package/dist/server/serverInfo.js.map +0 -1
- package/dist/server/token.js.map +0 -1
- package/dist/server/writeRoot.js.map +0 -1
- package/dist/shared/capabilities.js.map +0 -1
- package/dist/shared/interactiveContext.js.map +0 -1
- package/dist/shared/nicknamePrefill.js.map +0 -1
- package/dist/shared/settingsAsks.js.map +0 -1
- package/dist/shared/settingsCarveOut.js.map +0 -1
- package/dist/shared/settingsClasses.js.map +0 -1
- package/dist/shared/settingsConsent.js.map +0 -1
- package/dist/shared/settingsSurface.js.map +0 -1
- package/dist/shared/skillRanking.js.map +0 -1
- package/dist/shared/userMd/formAdapter.js.map +0 -1
- package/dist/shared/userMd/schema.js.map +0 -1
- package/dist/shared/userMd/utils.js.map +0 -1
- package/dist/ui/assets/index-Cxgy63kz.js +0 -26
- package/dist/ui/assets/index-Cxgy63kz.js.map +0 -1
- package/src/scripts/_lib/adr_frontmatter.test.ts +0 -365
- package/src/scripts/_lib/adversarial_council_gate.test.ts +0 -112
- package/src/scripts/_lib/adversarial_reconcile.test.ts +0 -197
- package/src/scripts/_lib/auto_dispatch.corpus.test.ts +0 -150
- package/src/scripts/_lib/secret_detector.test.ts +0 -108
- package/src/scripts/_lib/secret_detector_adversarial.test.ts +0 -116
- package/src/scripts/_lib/ui_authority.test.ts +0 -251
- package/src/scripts/_lib/untrusted_content.test.ts +0 -175
- package/src/scripts/check_secret_leak.test.ts +0 -90
- package/src/scripts/design_slop_rules.test.ts +0 -246
- package/src/scripts/self_review_gate.test.ts +0 -296
- package/src/shared/capabilities.test.ts +0 -43
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.'
|
|
@@ -15505,6 +15712,11 @@ var settingsSchema = external_exports.object({
|
|
|
15505
15712
|
enabled: external_exports.boolean().default(false).describe(
|
|
15506
15713
|
"PreToolUse code-graph nudge (ADR-124 Phase 4). Default off. When on AND a native code-graph cache or a consumer-shipped graph.json/SCIP index is present, warns once per session (never blocks) as the agent is about to Grep/Glob or Read a source file \u2014 query the graph first for who-calls/where-used/impact questions (or rebuild if stale, build if absent). Source G\u2019s strict block-first-read mode is deliberately un-ported."
|
|
15507
15714
|
)
|
|
15715
|
+
}).default({}),
|
|
15716
|
+
suggestion_capture: external_exports.object({
|
|
15717
|
+
enabled: external_exports.boolean().default(false).describe(
|
|
15718
|
+
'Suggestion-block capture (road-to-suggestion-block-capture Phase 2). Default off. Two slots: `stop` reads `last_assistant_message` \u2014 a payload field, so no transcript file is read \u2014 and latches that the assistant turn carried a numbered-options block; `user_prompt_submit` CONSUMES that latch and classifies the answering turn as option_n / as_is / other / stale_block. Consume-once is the correctness guard: the latch is deleted on read, so a bare "1" three turns later meets no latch and classifies `other`, and a latch past its TTL or unparseable is `stale_block` rather than a guess. Writes COUNTS ONLY to agents/runtime/state/audit/suggestion-capture.jsonl \u2014 the record type has no field able to hold a prompt, an option label or a command name, and a test asserts the written key set against src/config/suggestion-capture.json. Off by default because this is an INSTRUMENT rather than a feature: it exists so a capture rate can be measured on a maintainer workspace over a fixed soak window, and there is nothing in it for a consumer to gain.'
|
|
15719
|
+
)
|
|
15508
15720
|
}).default({})
|
|
15509
15721
|
// `turn_end_gate` is deliberately ABSENT. The stop-slot turn-end gate is
|
|
15510
15722
|
// always armed (2026-08-12) and has no settings surface: whether it
|
|
@@ -16841,8 +17053,8 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
16841
17053
|
};
|
|
16842
17054
|
|
|
16843
17055
|
// src/scripts/_lib/module_detection.ts
|
|
16844
|
-
import * as
|
|
16845
|
-
import * as
|
|
17056
|
+
import * as fs19 from "node:fs";
|
|
17057
|
+
import * as path17 from "node:path";
|
|
16846
17058
|
var _SKIP_DIRS = /* @__PURE__ */ new Set([".module-template", ".example"]);
|
|
16847
17059
|
var _RULES = [
|
|
16848
17060
|
["app/Modules", "laravel-hmvc", "App\\Modules\\{ModuleName}"],
|
|
@@ -16856,14 +17068,14 @@ var _RULES = [
|
|
|
16856
17068
|
];
|
|
16857
17069
|
function _isDir(p) {
|
|
16858
17070
|
try {
|
|
16859
|
-
return
|
|
17071
|
+
return fs19.statSync(p).isDirectory();
|
|
16860
17072
|
} catch {
|
|
16861
17073
|
return false;
|
|
16862
17074
|
}
|
|
16863
17075
|
}
|
|
16864
17076
|
function _isFile(p) {
|
|
16865
17077
|
try {
|
|
16866
|
-
return
|
|
17078
|
+
return fs19.statSync(p).isFile();
|
|
16867
17079
|
} catch {
|
|
16868
17080
|
return false;
|
|
16869
17081
|
}
|
|
@@ -16877,13 +17089,13 @@ function _isUpperChar(ch) {
|
|
|
16877
17089
|
function _list_module_subdirs(root) {
|
|
16878
17090
|
let entries;
|
|
16879
17091
|
try {
|
|
16880
|
-
entries =
|
|
17092
|
+
entries = fs19.readdirSync(root).sort();
|
|
16881
17093
|
} catch {
|
|
16882
17094
|
return [];
|
|
16883
17095
|
}
|
|
16884
17096
|
const out = [];
|
|
16885
17097
|
for (const name of entries) {
|
|
16886
|
-
if (!_isDir(
|
|
17098
|
+
if (!_isDir(path17.join(root, name))) {
|
|
16887
17099
|
continue;
|
|
16888
17100
|
}
|
|
16889
17101
|
if (name.startsWith(".")) {
|
|
@@ -16905,11 +17117,11 @@ function _score_confidence(stack, root, subdirs) {
|
|
|
16905
17117
|
return capitalized.length > 0 ? "high" : "medium";
|
|
16906
17118
|
}
|
|
16907
17119
|
if (stack === "node-monorepo") {
|
|
16908
|
-
const withPkgJson = subdirs.filter((name) => _isFile(
|
|
17120
|
+
const withPkgJson = subdirs.filter((name) => _isFile(path17.join(root, name, "package.json")));
|
|
16909
17121
|
return withPkgJson.length > 0 ? "high" : "medium";
|
|
16910
17122
|
}
|
|
16911
17123
|
if (stack === "python-src") {
|
|
16912
|
-
const withInit = subdirs.filter((name) => _isFile(
|
|
17124
|
+
const withInit = subdirs.filter((name) => _isFile(path17.join(root, name, "__init__.py")));
|
|
16913
17125
|
return withInit.length > 0 ? "high" : "medium";
|
|
16914
17126
|
}
|
|
16915
17127
|
if (stack === "go-internal") {
|
|
@@ -16921,7 +17133,7 @@ function detect_module_roots(project_root) {
|
|
|
16921
17133
|
const high = [];
|
|
16922
17134
|
const medium = [];
|
|
16923
17135
|
for (const [rel_path, stack, namespace_template] of _RULES) {
|
|
16924
|
-
const abs_path =
|
|
17136
|
+
const abs_path = path17.join(project_root, rel_path);
|
|
16925
17137
|
if (!_isDir(abs_path)) {
|
|
16926
17138
|
continue;
|
|
16927
17139
|
}
|
|
@@ -16943,7 +17155,7 @@ function detect_module_roots(project_root) {
|
|
|
16943
17155
|
}
|
|
16944
17156
|
|
|
16945
17157
|
// src/scripts/_lib/model_tier.ts
|
|
16946
|
-
import
|
|
17158
|
+
import fs20 from "node:fs";
|
|
16947
17159
|
var TIER_TO_CLAUDE_MODEL = {
|
|
16948
17160
|
frontier: "fable",
|
|
16949
17161
|
high: "opus",
|
|
@@ -16952,8 +17164,8 @@ var TIER_TO_CLAUDE_MODEL = {
|
|
|
16952
17164
|
};
|
|
16953
17165
|
var MODEL_TIER_RE = /^model_tier:\s*"?([a-z]+)"?\s*$/m;
|
|
16954
17166
|
function read_model_tier(skill_md) {
|
|
16955
|
-
if (!
|
|
16956
|
-
const text =
|
|
17167
|
+
if (!fs20.existsSync(skill_md)) return null;
|
|
17168
|
+
const text = fs20.readFileSync(skill_md).toString("utf-8");
|
|
16957
17169
|
if (!text.startsWith("---\n")) return null;
|
|
16958
17170
|
const end = text.indexOf("\n---\n", 4);
|
|
16959
17171
|
if (end === -1) return null;
|
|
@@ -16970,39 +17182,39 @@ function render_native_model_md(text, tier) {
|
|
|
16970
17182
|
|
|
16971
17183
|
// src/scripts/_cli/cmd_migrate.ts
|
|
16972
17184
|
import { spawnSync } from "node:child_process";
|
|
16973
|
-
import * as
|
|
16974
|
-
import * as
|
|
17185
|
+
import * as fs22 from "node:fs";
|
|
17186
|
+
import * as path19 from "node:path";
|
|
16975
17187
|
import process2 from "node:process";
|
|
16976
17188
|
import { fileURLToPath as fileURLToPath4, pathToFileURL } from "node:url";
|
|
16977
17189
|
|
|
16978
17190
|
// src/scripts/_lib/package_root.ts
|
|
16979
|
-
import * as
|
|
16980
|
-
import * as
|
|
17191
|
+
import * as fs21 from "node:fs";
|
|
17192
|
+
import * as path18 from "node:path";
|
|
16981
17193
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
16982
17194
|
var PACKAGE_NAME = "@event4u/agent-config";
|
|
16983
17195
|
var MAX_ASCENT = 16;
|
|
16984
17196
|
function resolvePackageRoot(fromUrlOrPath, legacyHops = 3) {
|
|
16985
17197
|
const start = fromUrlOrPath.startsWith("file:") ? fileURLToPath3(fromUrlOrPath) : fromUrlOrPath;
|
|
16986
|
-
const startDir =
|
|
17198
|
+
const startDir = path18.dirname(start);
|
|
16987
17199
|
let dir = startDir;
|
|
16988
17200
|
for (let i = 0; i < MAX_ASCENT; i++) {
|
|
16989
|
-
const manifest =
|
|
16990
|
-
if (
|
|
17201
|
+
const manifest = path18.join(dir, "package.json");
|
|
17202
|
+
if (fs21.existsSync(manifest)) {
|
|
16991
17203
|
try {
|
|
16992
|
-
const parsed = JSON.parse(
|
|
17204
|
+
const parsed = JSON.parse(fs21.readFileSync(manifest, "utf8"));
|
|
16993
17205
|
if (parsed.name === PACKAGE_NAME) {
|
|
16994
17206
|
return dir;
|
|
16995
17207
|
}
|
|
16996
17208
|
} catch {
|
|
16997
17209
|
}
|
|
16998
17210
|
}
|
|
16999
|
-
const parent =
|
|
17211
|
+
const parent = path18.dirname(dir);
|
|
17000
17212
|
if (parent === dir) {
|
|
17001
17213
|
break;
|
|
17002
17214
|
}
|
|
17003
17215
|
dir = parent;
|
|
17004
17216
|
}
|
|
17005
|
-
return
|
|
17217
|
+
return path18.resolve(startDir, ...Array.from({ length: legacyHops }, () => ".."));
|
|
17006
17218
|
}
|
|
17007
17219
|
|
|
17008
17220
|
// src/scripts/_cli/cmd_migrate.ts
|
|
@@ -17023,7 +17235,7 @@ var LEGACY_SETTINGS_FILES = [".agent-settings.yml", ".agent-user.yml"];
|
|
|
17023
17235
|
var LEGACY_STATE_FILENAME = ".implement-ticket-state.json";
|
|
17024
17236
|
var LEGACY_STATE_V1_FILENAME = ".work-state.json";
|
|
17025
17237
|
var LEGACY_AGENT_CONFIG_SHELL = "agent-config";
|
|
17026
|
-
var _HERE_DIR =
|
|
17238
|
+
var _HERE_DIR = path19.dirname(fileURLToPath4(import.meta.url));
|
|
17027
17239
|
var ArgparseExit = class extends Error {
|
|
17028
17240
|
code;
|
|
17029
17241
|
constructor(code) {
|
|
@@ -17122,38 +17334,38 @@ function _jsonDumpsIndentAscii(value, indent) {
|
|
|
17122
17334
|
}
|
|
17123
17335
|
function _isFile2(p) {
|
|
17124
17336
|
try {
|
|
17125
|
-
return
|
|
17337
|
+
return fs22.statSync(p).isFile();
|
|
17126
17338
|
} catch {
|
|
17127
17339
|
return false;
|
|
17128
17340
|
}
|
|
17129
17341
|
}
|
|
17130
17342
|
function _isDir2(p) {
|
|
17131
17343
|
try {
|
|
17132
|
-
return
|
|
17344
|
+
return fs22.statSync(p).isDirectory();
|
|
17133
17345
|
} catch {
|
|
17134
17346
|
return false;
|
|
17135
17347
|
}
|
|
17136
17348
|
}
|
|
17137
17349
|
function _isSymlink(p) {
|
|
17138
17350
|
try {
|
|
17139
|
-
return
|
|
17351
|
+
return fs22.lstatSync(p).isSymbolicLink();
|
|
17140
17352
|
} catch {
|
|
17141
17353
|
return false;
|
|
17142
17354
|
}
|
|
17143
17355
|
}
|
|
17144
17356
|
function _exists2(p) {
|
|
17145
17357
|
try {
|
|
17146
|
-
|
|
17358
|
+
fs22.lstatSync(p);
|
|
17147
17359
|
return true;
|
|
17148
17360
|
} catch {
|
|
17149
17361
|
return false;
|
|
17150
17362
|
}
|
|
17151
17363
|
}
|
|
17152
17364
|
function _readText(p) {
|
|
17153
|
-
return
|
|
17365
|
+
return fs22.readFileSync(p, { encoding: "utf-8" });
|
|
17154
17366
|
}
|
|
17155
17367
|
function _writeText(p, text) {
|
|
17156
|
-
|
|
17368
|
+
fs22.writeFileSync(p, text, { encoding: "utf-8" });
|
|
17157
17369
|
}
|
|
17158
17370
|
function _jsonLoadFile(p) {
|
|
17159
17371
|
return JSON.parse(_readText(p));
|
|
@@ -17209,7 +17421,7 @@ function _classify_symlink(link) {
|
|
|
17209
17421
|
}
|
|
17210
17422
|
let target;
|
|
17211
17423
|
try {
|
|
17212
|
-
target =
|
|
17424
|
+
target = fs22.readlinkSync(link);
|
|
17213
17425
|
} catch {
|
|
17214
17426
|
return null;
|
|
17215
17427
|
}
|
|
@@ -17220,16 +17432,16 @@ function _classify_symlink(link) {
|
|
|
17220
17432
|
return "user";
|
|
17221
17433
|
}
|
|
17222
17434
|
function _detect_legacy_state(project) {
|
|
17223
|
-
return _isFile2(
|
|
17435
|
+
return _isFile2(path19.join(project, LEGACY_STATE_FILENAME));
|
|
17224
17436
|
}
|
|
17225
17437
|
function _detect_legacy_settings(project) {
|
|
17226
17438
|
const found = [];
|
|
17227
17439
|
for (const name of LEGACY_SETTINGS_FILES) {
|
|
17228
|
-
const flat =
|
|
17440
|
+
const flat = path19.join(project, name);
|
|
17229
17441
|
if (_isFile2(flat)) {
|
|
17230
17442
|
found.push(flat);
|
|
17231
17443
|
}
|
|
17232
|
-
const typed =
|
|
17444
|
+
const typed = path19.join(project, "settings", name);
|
|
17233
17445
|
if (_isFile2(typed)) {
|
|
17234
17446
|
found.push(typed);
|
|
17235
17447
|
}
|
|
@@ -17237,25 +17449,25 @@ function _detect_legacy_settings(project) {
|
|
|
17237
17449
|
return found;
|
|
17238
17450
|
}
|
|
17239
17451
|
function _detect_empty_shell(project) {
|
|
17240
|
-
const shell =
|
|
17452
|
+
const shell = path19.join(project, LEGACY_AGENT_CONFIG_SHELL);
|
|
17241
17453
|
if (!_isDir2(shell) || _isSymlink(shell)) {
|
|
17242
17454
|
return false;
|
|
17243
17455
|
}
|
|
17244
17456
|
try {
|
|
17245
|
-
return
|
|
17457
|
+
return fs22.readdirSync(shell).length === 0;
|
|
17246
17458
|
} catch {
|
|
17247
17459
|
return false;
|
|
17248
17460
|
}
|
|
17249
17461
|
}
|
|
17250
17462
|
function _detect_already_migrated(project) {
|
|
17251
|
-
if (_detect_npm(
|
|
17463
|
+
if (_detect_npm(path19.join(project, "package.json"))) {
|
|
17252
17464
|
return false;
|
|
17253
17465
|
}
|
|
17254
|
-
if (_detect_composer(
|
|
17466
|
+
if (_detect_composer(path19.join(project, "composer.json"))) {
|
|
17255
17467
|
return false;
|
|
17256
17468
|
}
|
|
17257
17469
|
for (const name of MANAGED_SYMLINKS) {
|
|
17258
|
-
if (_classify_symlink(
|
|
17470
|
+
if (_classify_symlink(path19.join(project, name)) === "legacy") {
|
|
17259
17471
|
return false;
|
|
17260
17472
|
}
|
|
17261
17473
|
}
|
|
@@ -17326,11 +17538,11 @@ function _purge_legacy_symlinks(project) {
|
|
|
17326
17538
|
const removed = [];
|
|
17327
17539
|
const preserved = [];
|
|
17328
17540
|
for (const name of MANAGED_SYMLINKS) {
|
|
17329
|
-
const link =
|
|
17541
|
+
const link = path19.join(project, name);
|
|
17330
17542
|
const kind = _classify_symlink(link);
|
|
17331
17543
|
if (kind === "legacy") {
|
|
17332
17544
|
try {
|
|
17333
|
-
|
|
17545
|
+
fs22.unlinkSync(link);
|
|
17334
17546
|
removed.push(name);
|
|
17335
17547
|
} catch {
|
|
17336
17548
|
preserved.push(name);
|
|
@@ -17342,14 +17554,14 @@ function _purge_legacy_symlinks(project) {
|
|
|
17342
17554
|
return [removed, preserved];
|
|
17343
17555
|
}
|
|
17344
17556
|
function _migrate_state_file(project) {
|
|
17345
|
-
const source =
|
|
17557
|
+
const source = path19.join(project, LEGACY_STATE_FILENAME);
|
|
17346
17558
|
if (!_isFile2(source)) {
|
|
17347
17559
|
return null;
|
|
17348
17560
|
}
|
|
17349
|
-
const target =
|
|
17561
|
+
const target = path19.join(project, LEGACY_STATE_V1_FILENAME);
|
|
17350
17562
|
if (_exists2(target)) {
|
|
17351
17563
|
try {
|
|
17352
|
-
|
|
17564
|
+
fs22.unlinkSync(source);
|
|
17353
17565
|
return `removed stale ${LEGACY_STATE_FILENAME} (v1 already present)`;
|
|
17354
17566
|
} catch {
|
|
17355
17567
|
return null;
|
|
@@ -17364,7 +17576,7 @@ function _migrate_state_file(project) {
|
|
|
17364
17576
|
}
|
|
17365
17577
|
function _load_state_migrator() {
|
|
17366
17578
|
const pkg_root = resolvePackageRoot(import.meta.url);
|
|
17367
|
-
const rel =
|
|
17579
|
+
const rel = path19.join(
|
|
17368
17580
|
"agent-src",
|
|
17369
17581
|
"templates",
|
|
17370
17582
|
"scripts",
|
|
@@ -17372,8 +17584,8 @@ function _load_state_migrator() {
|
|
|
17372
17584
|
"migration",
|
|
17373
17585
|
"v0_to_v1.ts"
|
|
17374
17586
|
);
|
|
17375
|
-
const driver = [
|
|
17376
|
-
(p) =>
|
|
17587
|
+
const driver = [path19.join(pkg_root, "dist", rel), path19.join(pkg_root, "src", rel)].find(
|
|
17588
|
+
(p) => fs22.existsSync(p)
|
|
17377
17589
|
) ?? null;
|
|
17378
17590
|
if (driver === null) {
|
|
17379
17591
|
return null;
|
|
@@ -17381,12 +17593,12 @@ function _load_state_migrator() {
|
|
|
17381
17593
|
const binName = process2.platform === "win32" ? "tsx.cmd" : "tsx";
|
|
17382
17594
|
let tsxBin = null;
|
|
17383
17595
|
for (let dir = pkg_root; ; ) {
|
|
17384
|
-
const cand =
|
|
17385
|
-
if (
|
|
17596
|
+
const cand = path19.join(dir, "node_modules", ".bin", binName);
|
|
17597
|
+
if (fs22.existsSync(cand)) {
|
|
17386
17598
|
tsxBin = cand;
|
|
17387
17599
|
break;
|
|
17388
17600
|
}
|
|
17389
|
-
const parent =
|
|
17601
|
+
const parent = path19.dirname(dir);
|
|
17390
17602
|
if (parent === dir) break;
|
|
17391
17603
|
dir = parent;
|
|
17392
17604
|
}
|
|
@@ -17413,17 +17625,17 @@ function _delete_legacy_settings(project) {
|
|
|
17413
17625
|
const removed = [];
|
|
17414
17626
|
for (const p of _detect_legacy_settings(project)) {
|
|
17415
17627
|
try {
|
|
17416
|
-
|
|
17417
|
-
removed.push(
|
|
17628
|
+
fs22.unlinkSync(p);
|
|
17629
|
+
removed.push(path19.relative(project, p));
|
|
17418
17630
|
} catch {
|
|
17419
17631
|
continue;
|
|
17420
17632
|
}
|
|
17421
17633
|
}
|
|
17422
|
-
const settings_dir =
|
|
17634
|
+
const settings_dir = path19.join(project, "settings");
|
|
17423
17635
|
if (_isDir2(settings_dir) && !_isSymlink(settings_dir)) {
|
|
17424
17636
|
try {
|
|
17425
|
-
if (
|
|
17426
|
-
|
|
17637
|
+
if (fs22.readdirSync(settings_dir).length === 0) {
|
|
17638
|
+
fs22.rmdirSync(settings_dir);
|
|
17427
17639
|
removed.push("settings/");
|
|
17428
17640
|
}
|
|
17429
17641
|
} catch {
|
|
@@ -17432,12 +17644,12 @@ function _delete_legacy_settings(project) {
|
|
|
17432
17644
|
return removed;
|
|
17433
17645
|
}
|
|
17434
17646
|
function _remove_empty_shell(project) {
|
|
17435
|
-
const shell =
|
|
17647
|
+
const shell = path19.join(project, LEGACY_AGENT_CONFIG_SHELL);
|
|
17436
17648
|
if (!_detect_empty_shell(project)) {
|
|
17437
17649
|
return false;
|
|
17438
17650
|
}
|
|
17439
17651
|
try {
|
|
17440
|
-
|
|
17652
|
+
fs22.rmdirSync(shell);
|
|
17441
17653
|
} catch {
|
|
17442
17654
|
return false;
|
|
17443
17655
|
}
|
|
@@ -17447,7 +17659,7 @@ function _reEscape(s) {
|
|
|
17447
17659
|
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
17448
17660
|
}
|
|
17449
17661
|
function _update_gitignore(project) {
|
|
17450
|
-
const gitignore =
|
|
17662
|
+
const gitignore = path19.join(project, ".gitignore");
|
|
17451
17663
|
const block = `${GITIGNORE_BLOCK_START}
|
|
17452
17664
|
${GITIGNORE_NEW_BODY}${GITIGNORE_BLOCK_END}
|
|
17453
17665
|
`;
|
|
@@ -17478,16 +17690,16 @@ ${GITIGNORE_NEW_BODY}${GITIGNORE_BLOCK_END}
|
|
|
17478
17690
|
}
|
|
17479
17691
|
function _build_plan(project) {
|
|
17480
17692
|
return {
|
|
17481
|
-
npm: _detect_npm(
|
|
17482
|
-
composer: _detect_composer(
|
|
17693
|
+
npm: _detect_npm(path19.join(project, "package.json")),
|
|
17694
|
+
composer: _detect_composer(path19.join(project, "composer.json")),
|
|
17483
17695
|
symlinks_legacy: MANAGED_SYMLINKS.filter(
|
|
17484
|
-
(name) => _classify_symlink(
|
|
17696
|
+
(name) => _classify_symlink(path19.join(project, name)) === "legacy"
|
|
17485
17697
|
),
|
|
17486
17698
|
symlinks_user: MANAGED_SYMLINKS.filter(
|
|
17487
|
-
(name) => _classify_symlink(
|
|
17699
|
+
(name) => _classify_symlink(path19.join(project, name)) === "user"
|
|
17488
17700
|
),
|
|
17489
|
-
state_file: _isFile2(
|
|
17490
|
-
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)),
|
|
17491
17703
|
empty_shell: _detect_empty_shell(project)
|
|
17492
17704
|
};
|
|
17493
17705
|
}
|
|
@@ -17551,10 +17763,10 @@ function _warn_on_major_mismatch(from_major, plan, out) {
|
|
|
17551
17763
|
}
|
|
17552
17764
|
function _apply(project, out, err) {
|
|
17553
17765
|
const summary = [];
|
|
17554
|
-
if (_strip_npm_entry(
|
|
17766
|
+
if (_strip_npm_entry(path19.join(project, "package.json"))) {
|
|
17555
17767
|
summary.push(`removed ${PACKAGE_NAME_NPM} from package.json`);
|
|
17556
17768
|
}
|
|
17557
|
-
if (_strip_composer_entry(
|
|
17769
|
+
if (_strip_composer_entry(path19.join(project, "composer.json"))) {
|
|
17558
17770
|
summary.push(`removed ${PACKAGE_NAME_COMPOSER} from composer.json`);
|
|
17559
17771
|
}
|
|
17560
17772
|
const [removed_links, preserved_links] = _purge_legacy_symlinks(project);
|
|
@@ -17681,17 +17893,17 @@ function _isCliEntry() {
|
|
|
17681
17893
|
return false;
|
|
17682
17894
|
}
|
|
17683
17895
|
if (typeof __AGENT_CONFIG_CLI_DELEGATE__ !== "undefined" && __AGENT_CONFIG_CLI_DELEGATE__) {
|
|
17684
|
-
if (
|
|
17896
|
+
if (path19.basename(process2.argv[1], ".js") === "cmd_migrate") {
|
|
17685
17897
|
return true;
|
|
17686
17898
|
}
|
|
17687
17899
|
}
|
|
17688
|
-
const argvUrl = pathToFileURL(
|
|
17900
|
+
const argvUrl = pathToFileURL(path19.resolve(process2.argv[1])).href;
|
|
17689
17901
|
if (import.meta.url === argvUrl) {
|
|
17690
17902
|
return true;
|
|
17691
17903
|
}
|
|
17692
17904
|
try {
|
|
17693
|
-
const here =
|
|
17694
|
-
const argv =
|
|
17905
|
+
const here = fs22.realpathSync(fileURLToPath4(import.meta.url));
|
|
17906
|
+
const argv = fs22.realpathSync(path19.resolve(process2.argv[1]));
|
|
17695
17907
|
return here === argv;
|
|
17696
17908
|
} catch {
|
|
17697
17909
|
return false;
|
|
@@ -17709,6 +17921,30 @@ if (!_inForeignBundle && (_isCliEntry() || process2.argv[1] === _HERE)) {
|
|
|
17709
17921
|
}
|
|
17710
17922
|
}
|
|
17711
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
|
+
|
|
17712
17948
|
// src/scripts/install.ts
|
|
17713
17949
|
var _HERE2 = fileURLToPath5(import.meta.url);
|
|
17714
17950
|
var SystemExitError = class extends Error {
|
|
@@ -17728,34 +17964,34 @@ var ArgparseExit2 = class extends Error {
|
|
|
17728
17964
|
function expanduser6(p) {
|
|
17729
17965
|
if (p === "~") return os8.homedir();
|
|
17730
17966
|
if (p.startsWith("~/") || p.startsWith("~\\")) {
|
|
17731
|
-
return
|
|
17967
|
+
return path20.join(os8.homedir(), p.slice(2));
|
|
17732
17968
|
}
|
|
17733
17969
|
return p;
|
|
17734
17970
|
}
|
|
17735
17971
|
function resolvePath(p) {
|
|
17736
17972
|
try {
|
|
17737
|
-
return
|
|
17973
|
+
return fs23.realpathSync(path20.resolve(p));
|
|
17738
17974
|
} catch {
|
|
17739
|
-
return
|
|
17975
|
+
return path20.resolve(p);
|
|
17740
17976
|
}
|
|
17741
17977
|
}
|
|
17742
17978
|
function isFile(p) {
|
|
17743
17979
|
try {
|
|
17744
|
-
return
|
|
17980
|
+
return fs23.statSync(p).isFile();
|
|
17745
17981
|
} catch {
|
|
17746
17982
|
return false;
|
|
17747
17983
|
}
|
|
17748
17984
|
}
|
|
17749
17985
|
function isDir(p) {
|
|
17750
17986
|
try {
|
|
17751
|
-
return
|
|
17987
|
+
return fs23.statSync(p).isDirectory();
|
|
17752
17988
|
} catch {
|
|
17753
17989
|
return false;
|
|
17754
17990
|
}
|
|
17755
17991
|
}
|
|
17756
17992
|
function pathExists(p) {
|
|
17757
17993
|
try {
|
|
17758
|
-
|
|
17994
|
+
fs23.statSync(p);
|
|
17759
17995
|
return true;
|
|
17760
17996
|
} catch {
|
|
17761
17997
|
return false;
|
|
@@ -17763,24 +17999,24 @@ function pathExists(p) {
|
|
|
17763
17999
|
}
|
|
17764
18000
|
function isSymlink(p) {
|
|
17765
18001
|
try {
|
|
17766
|
-
return
|
|
18002
|
+
return fs23.lstatSync(p).isSymbolicLink();
|
|
17767
18003
|
} catch {
|
|
17768
18004
|
return false;
|
|
17769
18005
|
}
|
|
17770
18006
|
}
|
|
17771
18007
|
function readText(p) {
|
|
17772
|
-
return
|
|
18008
|
+
return fs23.readFileSync(p, "utf-8");
|
|
17773
18009
|
}
|
|
17774
18010
|
function writeText(p, content) {
|
|
17775
|
-
|
|
18011
|
+
fs23.writeFileSync(p, content, "utf-8");
|
|
17776
18012
|
}
|
|
17777
18013
|
function mkdirp(p) {
|
|
17778
|
-
|
|
18014
|
+
fs23.mkdirSync(p, { recursive: true });
|
|
17779
18015
|
}
|
|
17780
18016
|
function sortedGlobStems(directory, suffix) {
|
|
17781
18017
|
let entries;
|
|
17782
18018
|
try {
|
|
17783
|
-
entries =
|
|
18019
|
+
entries = fs23.readdirSync(directory);
|
|
17784
18020
|
} catch {
|
|
17785
18021
|
return [];
|
|
17786
18022
|
}
|
|
@@ -17800,7 +18036,7 @@ function sortedGlobStems(directory, suffix) {
|
|
|
17800
18036
|
function countZips(directory) {
|
|
17801
18037
|
if (!isDir(directory)) return 0;
|
|
17802
18038
|
let n = 0;
|
|
17803
|
-
for (const name of
|
|
18039
|
+
for (const name of fs23.readdirSync(directory)) {
|
|
17804
18040
|
if (name.endsWith(".zip")) n += 1;
|
|
17805
18041
|
}
|
|
17806
18042
|
return n;
|
|
@@ -17808,35 +18044,35 @@ function countZips(directory) {
|
|
|
17808
18044
|
function sha256OfFile(p) {
|
|
17809
18045
|
let data;
|
|
17810
18046
|
try {
|
|
17811
|
-
data =
|
|
18047
|
+
data = fs23.readFileSync(p);
|
|
17812
18048
|
} catch {
|
|
17813
18049
|
return null;
|
|
17814
18050
|
}
|
|
17815
18051
|
return crypto3.createHash("sha256").update(data).digest("hex");
|
|
17816
18052
|
}
|
|
17817
18053
|
function atomicWrite0644(target, body, prefix) {
|
|
17818
|
-
const dir =
|
|
17819
|
-
const tmpName =
|
|
18054
|
+
const dir = path20.dirname(target);
|
|
18055
|
+
const tmpName = path20.join(
|
|
17820
18056
|
dir,
|
|
17821
18057
|
`${prefix}${process3.pid}.${crypto3.randomBytes(6).toString("hex")}.yml.tmp`
|
|
17822
18058
|
);
|
|
17823
18059
|
let fd = null;
|
|
17824
18060
|
try {
|
|
17825
|
-
fd =
|
|
17826
|
-
|
|
17827
|
-
|
|
18061
|
+
fd = fs23.openSync(tmpName, "wx", 420);
|
|
18062
|
+
fs23.writeFileSync(fd, body, "utf-8");
|
|
18063
|
+
fs23.closeSync(fd);
|
|
17828
18064
|
fd = null;
|
|
17829
|
-
|
|
17830
|
-
|
|
18065
|
+
fs23.chmodSync(tmpName, 420);
|
|
18066
|
+
fs23.renameSync(tmpName, target);
|
|
17831
18067
|
} catch (err) {
|
|
17832
18068
|
if (fd !== null) {
|
|
17833
18069
|
try {
|
|
17834
|
-
|
|
18070
|
+
fs23.closeSync(fd);
|
|
17835
18071
|
} catch {
|
|
17836
18072
|
}
|
|
17837
18073
|
}
|
|
17838
18074
|
try {
|
|
17839
|
-
|
|
18075
|
+
fs23.unlinkSync(tmpName);
|
|
17840
18076
|
} catch {
|
|
17841
18077
|
}
|
|
17842
18078
|
throw err;
|
|
@@ -17960,12 +18196,12 @@ var LEGACY_SETTINGS_FILE = ".agent-settings";
|
|
|
17960
18196
|
var LEGACY_BACKUP_FILE = ".agent-settings.backup.key-value";
|
|
17961
18197
|
var SETTINGS_SUBDIR = ["agents", "settings"];
|
|
17962
18198
|
function _canonical_settings_target(project_root) {
|
|
17963
|
-
return
|
|
18199
|
+
return path20.join(project_root, ...SETTINGS_SUBDIR, SETTINGS_FILE);
|
|
17964
18200
|
}
|
|
17965
18201
|
function _resolve_settings_read(project_root) {
|
|
17966
18202
|
const canonical = _canonical_settings_target(project_root);
|
|
17967
18203
|
if (pathExists(canonical)) return canonical;
|
|
17968
|
-
const legacy =
|
|
18204
|
+
const legacy = path20.join(project_root, SETTINGS_FILE);
|
|
17969
18205
|
if (pathExists(legacy)) return legacy;
|
|
17970
18206
|
return canonical;
|
|
17971
18207
|
}
|
|
@@ -18029,9 +18265,9 @@ function fail(msg) {
|
|
|
18029
18265
|
throw new SystemExitError(1);
|
|
18030
18266
|
}
|
|
18031
18267
|
function detect_package_root(project_root) {
|
|
18032
|
-
const npm_path =
|
|
18268
|
+
const npm_path = path20.join(project_root, "node_modules", "@event4u", "agent-config");
|
|
18033
18269
|
if (isDir(npm_path)) return resolvePath(npm_path);
|
|
18034
|
-
if (pathExists(
|
|
18270
|
+
if (pathExists(path20.join(project_root, "src", "config", "profiles", "minimal.ini"))) {
|
|
18035
18271
|
return project_root;
|
|
18036
18272
|
}
|
|
18037
18273
|
fail(
|
|
@@ -18039,12 +18275,12 @@ function detect_package_root(project_root) {
|
|
|
18039
18275
|
);
|
|
18040
18276
|
}
|
|
18041
18277
|
function detect_package_type(package_root) {
|
|
18042
|
-
if (package_root.split(
|
|
18278
|
+
if (package_root.split(path20.sep).includes("node_modules")) return "npm";
|
|
18043
18279
|
return "local";
|
|
18044
18280
|
}
|
|
18045
18281
|
function detect_package_type_for_project(project_root, package_root) {
|
|
18046
18282
|
const npm_path = resolvePath(
|
|
18047
|
-
|
|
18283
|
+
path20.join(project_root, "node_modules", "@event4u", "agent-config")
|
|
18048
18284
|
);
|
|
18049
18285
|
const package_resolved = resolvePath(package_root);
|
|
18050
18286
|
if (package_resolved === npm_path) return "npm";
|
|
@@ -18064,7 +18300,7 @@ function ensure_directory(p) {
|
|
|
18064
18300
|
mkdirp(p);
|
|
18065
18301
|
}
|
|
18066
18302
|
function write_file(p, content) {
|
|
18067
|
-
ensure_directory(
|
|
18303
|
+
ensure_directory(path20.dirname(p));
|
|
18068
18304
|
writeText(p, content);
|
|
18069
18305
|
}
|
|
18070
18306
|
function read_json_file(p) {
|
|
@@ -18235,7 +18471,7 @@ function _append_unknown_legacy(rendered, legacy_values, unknown_keys) {
|
|
|
18235
18471
|
return rendered + "\n" + suffix;
|
|
18236
18472
|
}
|
|
18237
18473
|
function _migrate_legacy_if_present(project_root, template_body) {
|
|
18238
|
-
const legacy_target =
|
|
18474
|
+
const legacy_target = path20.join(project_root, LEGACY_SETTINGS_FILE);
|
|
18239
18475
|
if (!isFile(legacy_target)) return null;
|
|
18240
18476
|
const legacy_text = readText(legacy_target);
|
|
18241
18477
|
const [values, unknown] = _parse_legacy_settings(legacy_text);
|
|
@@ -18250,9 +18486,9 @@ function _migrate_legacy_if_present(project_root, template_body) {
|
|
|
18250
18486
|
}
|
|
18251
18487
|
}
|
|
18252
18488
|
rendered = _append_unknown_legacy(rendered, values, unknown);
|
|
18253
|
-
const backup_target =
|
|
18489
|
+
const backup_target = path20.join(project_root, LEGACY_BACKUP_FILE);
|
|
18254
18490
|
writeText(backup_target, legacy_text);
|
|
18255
|
-
|
|
18491
|
+
fs23.unlinkSync(legacy_target);
|
|
18256
18492
|
info(`Migrated legacy ${LEGACY_SETTINGS_FILE} \u2192 ${SETTINGS_FILE}`);
|
|
18257
18493
|
info(`Backup saved to ${LEGACY_BACKUP_FILE}`);
|
|
18258
18494
|
if (unknown.length > 0) {
|
|
@@ -18287,7 +18523,7 @@ function _render_template(template, profile_values) {
|
|
|
18287
18523
|
return body;
|
|
18288
18524
|
}
|
|
18289
18525
|
function _load_valid_user_types(package_root) {
|
|
18290
|
-
const directory =
|
|
18526
|
+
const directory = path20.join(package_root, USER_TYPES_DIR);
|
|
18291
18527
|
if (!isDir(directory)) return [];
|
|
18292
18528
|
return sortedGlobStems(directory, ".yml");
|
|
18293
18529
|
}
|
|
@@ -18344,8 +18580,8 @@ function splitlinesKeepends(text) {
|
|
|
18344
18580
|
}
|
|
18345
18581
|
function ensure_agent_settings(project_root, package_root, profile, force, user_type = "", packs = null) {
|
|
18346
18582
|
const target = _canonical_settings_target(project_root);
|
|
18347
|
-
const profile_source =
|
|
18348
|
-
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");
|
|
18349
18585
|
if (!pathExists(profile_source)) fail(`Missing profile preset: ${profile_source}`);
|
|
18350
18586
|
if (!pathExists(template_source)) fail(`Missing settings template: ${template_source}`);
|
|
18351
18587
|
const template = readText(template_source);
|
|
@@ -18359,21 +18595,21 @@ function ensure_agent_settings(project_root, package_root, profile, force, user_
|
|
|
18359
18595
|
if (profile_values["rule_loading_tier"] !== profile) {
|
|
18360
18596
|
const got = "rule_loading_tier" in profile_values ? `'${profile_values["rule_loading_tier"]}'` : "None";
|
|
18361
18597
|
fail(
|
|
18362
|
-
`Profile preset ${
|
|
18598
|
+
`Profile preset ${path20.basename(profile_source)} has rule_loading_tier=${got} but --profile=${profile}`
|
|
18363
18599
|
);
|
|
18364
18600
|
}
|
|
18365
18601
|
profile_values["user_type"] = _validate_user_type(package_root, user_type);
|
|
18366
18602
|
let template_body = _render_template(template, profile_values);
|
|
18367
18603
|
template_body = _inject_packs(template_body, packs ?? []);
|
|
18368
|
-
const legacy_root =
|
|
18604
|
+
const legacy_root = path20.join(project_root, SETTINGS_FILE);
|
|
18369
18605
|
if (isFile(legacy_root) && !pathExists(target)) {
|
|
18370
|
-
mkdirp(
|
|
18606
|
+
mkdirp(path20.dirname(target));
|
|
18371
18607
|
writeText(target, readText(legacy_root));
|
|
18372
|
-
|
|
18608
|
+
fs23.unlinkSync(legacy_root);
|
|
18373
18609
|
success(`Migrated ${SETTINGS_FILE} \u2192 agents/settings/${SETTINGS_FILE} (ADR-038)`);
|
|
18374
18610
|
return;
|
|
18375
18611
|
}
|
|
18376
|
-
const legacy_target =
|
|
18612
|
+
const legacy_target = path20.join(project_root, LEGACY_SETTINGS_FILE);
|
|
18377
18613
|
if (isFile(legacy_target) && pathExists(target)) {
|
|
18378
18614
|
warn(
|
|
18379
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.`
|
|
@@ -18390,7 +18626,7 @@ function ensure_agent_settings(project_root, package_root, profile, force, user_
|
|
|
18390
18626
|
skip(`${SETTINGS_FILE} already exists`);
|
|
18391
18627
|
return;
|
|
18392
18628
|
}
|
|
18393
|
-
mkdirp(
|
|
18629
|
+
mkdirp(path20.dirname(target));
|
|
18394
18630
|
write_file(target, template_body);
|
|
18395
18631
|
const user_type_value = profile_values["user_type"] ?? "";
|
|
18396
18632
|
const suffix = user_type_value ? `, user_type=${user_type_value}` : "";
|
|
@@ -18403,7 +18639,7 @@ function ensure_vscode_bridge(project_root, package_type, force) {
|
|
|
18403
18639
|
const plugin_path = plugin_paths[package_type] ?? "./plugin/agent-config";
|
|
18404
18640
|
const bridge = { "chat.pluginLocations": { [plugin_path]: true } };
|
|
18405
18641
|
return merge_json_file(
|
|
18406
|
-
|
|
18642
|
+
path20.join(project_root, ".vscode", "settings.json"),
|
|
18407
18643
|
bridge,
|
|
18408
18644
|
force,
|
|
18409
18645
|
".vscode/settings.json"
|
|
@@ -18412,14 +18648,14 @@ function ensure_vscode_bridge(project_root, package_type, force) {
|
|
|
18412
18648
|
function ensure_augment_bridge(project_root, force) {
|
|
18413
18649
|
const bridge = { enabledPlugins: { "agent-config@event4u": true } };
|
|
18414
18650
|
return merge_json_file(
|
|
18415
|
-
|
|
18651
|
+
path20.join(project_root, ".augment", "settings.json"),
|
|
18416
18652
|
bridge,
|
|
18417
18653
|
force,
|
|
18418
18654
|
".augment/settings.json"
|
|
18419
18655
|
);
|
|
18420
18656
|
}
|
|
18421
|
-
var AUGMENT_USER_DIR =
|
|
18422
|
-
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");
|
|
18423
18659
|
var AUGMENT_DISPATCHER_TRAMPOLINE = "augment-dispatcher.sh";
|
|
18424
18660
|
var AUGMENT_LEGACY_TRAMPOLINES = [
|
|
18425
18661
|
"augment-chat-history.sh",
|
|
@@ -18435,29 +18671,29 @@ var AUGMENT_DISPATCHER_BINDINGS = [
|
|
|
18435
18671
|
["post_tool_use", "PostToolUse"]
|
|
18436
18672
|
];
|
|
18437
18673
|
function _deploy_augment_trampoline(package_root, name, force) {
|
|
18438
|
-
const src =
|
|
18674
|
+
const src = path20.join(package_root, "scripts", "hooks", name);
|
|
18439
18675
|
if (!pathExists(src)) {
|
|
18440
18676
|
skip(`augment trampoline missing in package: ${src}`);
|
|
18441
18677
|
return null;
|
|
18442
18678
|
}
|
|
18443
18679
|
mkdirp(AUGMENT_USER_HOOKS_DIR);
|
|
18444
|
-
const dst =
|
|
18680
|
+
const dst = path20.join(AUGMENT_USER_HOOKS_DIR, name);
|
|
18445
18681
|
const src_text = readText(src);
|
|
18446
18682
|
if (pathExists(dst) && readText(dst) === src_text && !force) {
|
|
18447
18683
|
skip(`~/.augment/hooks/${name} already up to date`);
|
|
18448
18684
|
} else {
|
|
18449
18685
|
writeText(dst, src_text);
|
|
18450
|
-
|
|
18686
|
+
fs23.chmodSync(dst, 493);
|
|
18451
18687
|
success(`~/.augment/hooks/${name} installed`);
|
|
18452
18688
|
}
|
|
18453
18689
|
return dst;
|
|
18454
18690
|
}
|
|
18455
18691
|
function _remove_legacy_augment_trampolines() {
|
|
18456
18692
|
for (const name of AUGMENT_LEGACY_TRAMPOLINES) {
|
|
18457
|
-
const legacy =
|
|
18693
|
+
const legacy = path20.join(AUGMENT_USER_HOOKS_DIR, name);
|
|
18458
18694
|
try {
|
|
18459
18695
|
if (isFile(legacy)) {
|
|
18460
|
-
|
|
18696
|
+
fs23.unlinkSync(legacy);
|
|
18461
18697
|
skip(`removed legacy ~/.augment/hooks/${name}`);
|
|
18462
18698
|
}
|
|
18463
18699
|
} catch (err) {
|
|
@@ -18477,7 +18713,7 @@ function ensure_augment_user_hooks(package_root, force) {
|
|
|
18477
18713
|
}
|
|
18478
18714
|
const settings_patch = { hooks: per_event };
|
|
18479
18715
|
return merge_json_file(
|
|
18480
|
-
|
|
18716
|
+
path20.join(AUGMENT_USER_DIR, "settings.json"),
|
|
18481
18717
|
settings_patch,
|
|
18482
18718
|
force,
|
|
18483
18719
|
"~/.augment/settings.json"
|
|
@@ -18502,7 +18738,7 @@ function _heal_legacy_claude_plugin_ids(p) {
|
|
|
18502
18738
|
return removed;
|
|
18503
18739
|
}
|
|
18504
18740
|
function ensure_claude_bridge(project_root, force) {
|
|
18505
|
-
const target =
|
|
18741
|
+
const target = path20.join(project_root, ".claude", "settings.json");
|
|
18506
18742
|
const healed = _heal_legacy_claude_plugin_ids(target);
|
|
18507
18743
|
for (const pid of healed) {
|
|
18508
18744
|
success(`.claude/settings.json: removed stale plugin id \`${pid}\``);
|
|
@@ -18531,29 +18767,29 @@ function ensure_cursor_bridge(project_root, force) {
|
|
|
18531
18767
|
}
|
|
18532
18768
|
const bridge = { version: 1, hooks };
|
|
18533
18769
|
return merge_json_file(
|
|
18534
|
-
|
|
18770
|
+
path20.join(project_root, ".cursor", "hooks.json"),
|
|
18535
18771
|
bridge,
|
|
18536
18772
|
force,
|
|
18537
18773
|
".cursor/hooks.json"
|
|
18538
18774
|
);
|
|
18539
18775
|
}
|
|
18540
|
-
var CURSOR_USER_DIR =
|
|
18541
|
-
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");
|
|
18542
18778
|
var CURSOR_DISPATCHER_TRAMPOLINE = "cursor-dispatcher.sh";
|
|
18543
18779
|
function ensure_cursor_user_hooks(package_root, force) {
|
|
18544
|
-
const src =
|
|
18780
|
+
const src = path20.join(package_root, "scripts", "hooks", CURSOR_DISPATCHER_TRAMPOLINE);
|
|
18545
18781
|
if (!pathExists(src)) {
|
|
18546
18782
|
skip(`cursor trampoline missing in package: ${src}`);
|
|
18547
18783
|
return [];
|
|
18548
18784
|
}
|
|
18549
18785
|
mkdirp(CURSOR_USER_HOOKS_DIR);
|
|
18550
|
-
const dst =
|
|
18786
|
+
const dst = path20.join(CURSOR_USER_HOOKS_DIR, CURSOR_DISPATCHER_TRAMPOLINE);
|
|
18551
18787
|
const src_text = readText(src);
|
|
18552
18788
|
if (pathExists(dst) && readText(dst) === src_text && !force) {
|
|
18553
18789
|
skip(`~/.cursor/hooks/${CURSOR_DISPATCHER_TRAMPOLINE} already up to date`);
|
|
18554
18790
|
} else {
|
|
18555
18791
|
writeText(dst, src_text);
|
|
18556
|
-
|
|
18792
|
+
fs23.chmodSync(dst, 493);
|
|
18557
18793
|
success(`~/.cursor/hooks/${CURSOR_DISPATCHER_TRAMPOLINE} installed`);
|
|
18558
18794
|
}
|
|
18559
18795
|
const hooks = {};
|
|
@@ -18562,7 +18798,7 @@ function ensure_cursor_user_hooks(package_root, force) {
|
|
|
18562
18798
|
}
|
|
18563
18799
|
const settings_patch = { version: 1, hooks };
|
|
18564
18800
|
return merge_json_file(
|
|
18565
|
-
|
|
18801
|
+
path20.join(CURSOR_USER_DIR, "hooks.json"),
|
|
18566
18802
|
settings_patch,
|
|
18567
18803
|
force,
|
|
18568
18804
|
"~/.cursor/hooks.json"
|
|
@@ -18605,12 +18841,12 @@ exit 0
|
|
|
18605
18841
|
`;
|
|
18606
18842
|
}
|
|
18607
18843
|
function ensure_cline_bridge(project_root, force) {
|
|
18608
|
-
const hooks_dir =
|
|
18844
|
+
const hooks_dir = path20.join(project_root, ".clinerules", "hooks");
|
|
18609
18845
|
mkdirp(hooks_dir);
|
|
18610
18846
|
const workspace_quoted = shlexQuote(resolvePath(project_root));
|
|
18611
18847
|
let written = 0;
|
|
18612
18848
|
for (const [ac_event, native_event] of CLINE_DISPATCHER_BINDINGS) {
|
|
18613
|
-
const target =
|
|
18849
|
+
const target = path20.join(hooks_dir, native_event);
|
|
18614
18850
|
const body = clineProjectHookBody(native_event, ac_event, workspace_quoted);
|
|
18615
18851
|
if (pathExists(target) && readText(target) === body && !force) {
|
|
18616
18852
|
continue;
|
|
@@ -18620,7 +18856,7 @@ function ensure_cline_bridge(project_root, force) {
|
|
|
18620
18856
|
continue;
|
|
18621
18857
|
}
|
|
18622
18858
|
writeText(target, body);
|
|
18623
|
-
|
|
18859
|
+
fs23.chmodSync(target, 493);
|
|
18624
18860
|
written += 1;
|
|
18625
18861
|
}
|
|
18626
18862
|
if (written) {
|
|
@@ -18629,27 +18865,27 @@ function ensure_cline_bridge(project_root, force) {
|
|
|
18629
18865
|
skip(".clinerules/hooks/ already up to date");
|
|
18630
18866
|
}
|
|
18631
18867
|
}
|
|
18632
|
-
var CLINE_USER_DIR =
|
|
18868
|
+
var CLINE_USER_DIR = path20.join(os8.homedir(), "Documents", "Cline", "Hooks");
|
|
18633
18869
|
var CLINE_DISPATCHER_TRAMPOLINE = "cline-dispatcher.sh";
|
|
18634
18870
|
function ensure_cline_user_hooks(package_root, force) {
|
|
18635
|
-
const src =
|
|
18871
|
+
const src = path20.join(package_root, "scripts", "hooks", CLINE_DISPATCHER_TRAMPOLINE);
|
|
18636
18872
|
if (!pathExists(src)) {
|
|
18637
18873
|
skip(`cline trampoline missing in package: ${src}`);
|
|
18638
18874
|
return;
|
|
18639
18875
|
}
|
|
18640
18876
|
mkdirp(CLINE_USER_DIR);
|
|
18641
|
-
const trampoline =
|
|
18877
|
+
const trampoline = path20.join(CLINE_USER_DIR, CLINE_DISPATCHER_TRAMPOLINE);
|
|
18642
18878
|
const src_text = readText(src);
|
|
18643
18879
|
if (pathExists(trampoline) && readText(trampoline) === src_text && !force) {
|
|
18644
18880
|
skip(`~/Documents/Cline/Hooks/${CLINE_DISPATCHER_TRAMPOLINE} already up to date`);
|
|
18645
18881
|
} else {
|
|
18646
18882
|
writeText(trampoline, src_text);
|
|
18647
|
-
|
|
18883
|
+
fs23.chmodSync(trampoline, 493);
|
|
18648
18884
|
success(`~/Documents/Cline/Hooks/${CLINE_DISPATCHER_TRAMPOLINE} installed`);
|
|
18649
18885
|
}
|
|
18650
18886
|
const trampoline_quoted = shlexQuote(trampoline);
|
|
18651
18887
|
for (const [ac_event, native_event] of CLINE_DISPATCHER_BINDINGS) {
|
|
18652
|
-
const wrapper =
|
|
18888
|
+
const wrapper = path20.join(CLINE_USER_DIR, native_event);
|
|
18653
18889
|
const body = `#!/usr/bin/env bash
|
|
18654
18890
|
# Generated by event4u/agent-config install.py \u2014 DO NOT EDIT.
|
|
18655
18891
|
# User-scope Cline hook for ${native_event} \u2192 agent-config ${ac_event}.
|
|
@@ -18659,7 +18895,7 @@ exec ${trampoline_quoted} ${ac_event} ${native_event}
|
|
|
18659
18895
|
continue;
|
|
18660
18896
|
}
|
|
18661
18897
|
writeText(wrapper, body);
|
|
18662
|
-
|
|
18898
|
+
fs23.chmodSync(wrapper, 493);
|
|
18663
18899
|
}
|
|
18664
18900
|
}
|
|
18665
18901
|
var WINDSURF_DISPATCHER_BINDINGS = [
|
|
@@ -18680,29 +18916,29 @@ function ensure_windsurf_bridge(project_root, force) {
|
|
|
18680
18916
|
}
|
|
18681
18917
|
const bridge = { hooks };
|
|
18682
18918
|
return merge_json_file(
|
|
18683
|
-
|
|
18919
|
+
path20.join(project_root, ".windsurf", "hooks.json"),
|
|
18684
18920
|
bridge,
|
|
18685
18921
|
force,
|
|
18686
18922
|
".windsurf/hooks.json"
|
|
18687
18923
|
);
|
|
18688
18924
|
}
|
|
18689
|
-
var WINDSURF_USER_DIR =
|
|
18690
|
-
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");
|
|
18691
18927
|
var WINDSURF_DISPATCHER_TRAMPOLINE = "windsurf-dispatcher.sh";
|
|
18692
18928
|
function ensure_windsurf_user_hooks(package_root, force) {
|
|
18693
|
-
const src =
|
|
18929
|
+
const src = path20.join(package_root, "scripts", "hooks", WINDSURF_DISPATCHER_TRAMPOLINE);
|
|
18694
18930
|
if (!pathExists(src)) {
|
|
18695
18931
|
skip(`windsurf trampoline missing in package: ${src}`);
|
|
18696
18932
|
return [];
|
|
18697
18933
|
}
|
|
18698
18934
|
mkdirp(WINDSURF_USER_HOOKS_DIR);
|
|
18699
|
-
const dst =
|
|
18935
|
+
const dst = path20.join(WINDSURF_USER_HOOKS_DIR, WINDSURF_DISPATCHER_TRAMPOLINE);
|
|
18700
18936
|
const src_text = readText(src);
|
|
18701
18937
|
if (pathExists(dst) && readText(dst) === src_text && !force) {
|
|
18702
18938
|
skip(`~/.codeium/windsurf/hooks/${WINDSURF_DISPATCHER_TRAMPOLINE} already up to date`);
|
|
18703
18939
|
} else {
|
|
18704
18940
|
writeText(dst, src_text);
|
|
18705
|
-
|
|
18941
|
+
fs23.chmodSync(dst, 493);
|
|
18706
18942
|
success(`~/.codeium/windsurf/hooks/${WINDSURF_DISPATCHER_TRAMPOLINE} installed`);
|
|
18707
18943
|
}
|
|
18708
18944
|
const hooks = {};
|
|
@@ -18714,7 +18950,7 @@ function ensure_windsurf_user_hooks(package_root, force) {
|
|
|
18714
18950
|
}
|
|
18715
18951
|
const settings_patch = { hooks };
|
|
18716
18952
|
return merge_json_file(
|
|
18717
|
-
|
|
18953
|
+
path20.join(WINDSURF_USER_DIR, "hooks.json"),
|
|
18718
18954
|
settings_patch,
|
|
18719
18955
|
force,
|
|
18720
18956
|
"~/.codeium/windsurf/hooks.json"
|
|
@@ -18743,43 +18979,43 @@ function _gemini_hooks_dict(command_factory) {
|
|
|
18743
18979
|
function ensure_gemini_bridge(project_root, force) {
|
|
18744
18980
|
const bridge = { hooks: _gemini_hooks_dict(_gemini_dispatch_command) };
|
|
18745
18981
|
return merge_json_file(
|
|
18746
|
-
|
|
18982
|
+
path20.join(project_root, ".gemini", "settings.json"),
|
|
18747
18983
|
bridge,
|
|
18748
18984
|
force,
|
|
18749
18985
|
".gemini/settings.json"
|
|
18750
18986
|
);
|
|
18751
18987
|
}
|
|
18752
|
-
var GEMINI_USER_DIR =
|
|
18753
|
-
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");
|
|
18754
18990
|
var GEMINI_DISPATCHER_TRAMPOLINE = "gemini-dispatcher.sh";
|
|
18755
18991
|
function ensure_gemini_user_hooks(package_root, force) {
|
|
18756
|
-
const src =
|
|
18992
|
+
const src = path20.join(package_root, "scripts", "hooks", GEMINI_DISPATCHER_TRAMPOLINE);
|
|
18757
18993
|
if (!pathExists(src)) {
|
|
18758
18994
|
skip(`gemini trampoline missing in package: ${src}`);
|
|
18759
18995
|
return [];
|
|
18760
18996
|
}
|
|
18761
18997
|
mkdirp(GEMINI_USER_HOOKS_DIR);
|
|
18762
|
-
const dst =
|
|
18998
|
+
const dst = path20.join(GEMINI_USER_HOOKS_DIR, GEMINI_DISPATCHER_TRAMPOLINE);
|
|
18763
18999
|
const src_text = readText(src);
|
|
18764
19000
|
if (pathExists(dst) && readText(dst) === src_text && !force) {
|
|
18765
19001
|
skip(`~/.gemini/hooks/${GEMINI_DISPATCHER_TRAMPOLINE} already up to date`);
|
|
18766
19002
|
} else {
|
|
18767
19003
|
writeText(dst, src_text);
|
|
18768
|
-
|
|
19004
|
+
fs23.chmodSync(dst, 493);
|
|
18769
19005
|
success(`~/.gemini/hooks/${GEMINI_DISPATCHER_TRAMPOLINE} installed`);
|
|
18770
19006
|
}
|
|
18771
19007
|
const settings_patch = {
|
|
18772
19008
|
hooks: _gemini_hooks_dict((ac_event, native) => `${dst} ${ac_event} ${native}`)
|
|
18773
19009
|
};
|
|
18774
19010
|
return merge_json_file(
|
|
18775
|
-
|
|
19011
|
+
path20.join(GEMINI_USER_DIR, "settings.json"),
|
|
18776
19012
|
settings_patch,
|
|
18777
19013
|
force,
|
|
18778
19014
|
"~/.gemini/settings.json"
|
|
18779
19015
|
);
|
|
18780
19016
|
}
|
|
18781
19017
|
function ensure_copilot_bridge(project_root, force) {
|
|
18782
|
-
const target =
|
|
19018
|
+
const target = path20.join(project_root, ".github", "plugin", "marketplace.json");
|
|
18783
19019
|
const bridge = {
|
|
18784
19020
|
marketplace: {
|
|
18785
19021
|
name: "event4u-agent-marketplace",
|
|
@@ -18822,7 +19058,7 @@ See \`docs/setup/per-ide/roocode.md\` for the full activation guide.
|
|
|
18822
19058
|
Run \`./agent-config --help\` for available commands.
|
|
18823
19059
|
`;
|
|
18824
19060
|
function ensure_roocode_bridge(project_root, force) {
|
|
18825
|
-
const target =
|
|
19061
|
+
const target = path20.join(project_root, ".roo", "rules", "agent-config.md");
|
|
18826
19062
|
if (pathExists(target) && !force) {
|
|
18827
19063
|
skip(".roo/rules/agent-config.md already exists");
|
|
18828
19064
|
return;
|
|
@@ -18844,7 +19080,7 @@ To wire Claude Desktop to this project's rules, run:
|
|
|
18844
19080
|
Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
|
|
18845
19081
|
`;
|
|
18846
19082
|
function ensure_claude_desktop_bridge(project_root, force) {
|
|
18847
|
-
const target =
|
|
19083
|
+
const target = path20.join(project_root, ".claude-desktop", "agent-config.md");
|
|
18848
19084
|
if (pathExists(target) && !force) {
|
|
18849
19085
|
skip(".claude-desktop/agent-config.md already exists");
|
|
18850
19086
|
return;
|
|
@@ -18869,7 +19105,7 @@ Or pass \`--read .aider/agent-config.md\` on the command line.
|
|
|
18869
19105
|
Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
|
|
18870
19106
|
`;
|
|
18871
19107
|
function ensure_aider_bridge(project_root, force) {
|
|
18872
|
-
const target =
|
|
19108
|
+
const target = path20.join(project_root, ".aider", "agent-config.md");
|
|
18873
19109
|
if (pathExists(target) && !force) {
|
|
18874
19110
|
skip(".aider/agent-config.md already exists");
|
|
18875
19111
|
return;
|
|
@@ -18888,7 +19124,7 @@ developers where the rules and skills live.
|
|
|
18888
19124
|
Canonical rule and skill source: \`.augment/\` (see project \`AGENTS.md\`).
|
|
18889
19125
|
`;
|
|
18890
19126
|
function ensure_codex_bridge(project_root, force) {
|
|
18891
|
-
const target =
|
|
19127
|
+
const target = path20.join(project_root, ".codex", "agent-config.md");
|
|
18892
19128
|
if (pathExists(target) && !force) {
|
|
18893
19129
|
skip(".codex/agent-config.md already exists");
|
|
18894
19130
|
return;
|
|
@@ -18906,7 +19142,7 @@ rules per session. The canonical rule and skill source lives under
|
|
|
18906
19142
|
orientation).
|
|
18907
19143
|
`;
|
|
18908
19144
|
function ensure_continue_bridge(project_root, force) {
|
|
18909
|
-
const target =
|
|
19145
|
+
const target = path20.join(project_root, ".continue", "rules", "agent-config.md");
|
|
18910
19146
|
if (pathExists(target) && !force) {
|
|
18911
19147
|
skip(".continue/rules/agent-config.md already exists");
|
|
18912
19148
|
return;
|
|
@@ -18937,7 +19173,7 @@ orientation).
|
|
|
18937
19173
|
See \`docs/setup/per-ide/kilocode.md\` for the full activation guide.
|
|
18938
19174
|
`;
|
|
18939
19175
|
function ensure_kilocode_bridge(project_root, force) {
|
|
18940
|
-
const target =
|
|
19176
|
+
const target = path20.join(project_root, ".kilocode", "rules", "agent-config.md");
|
|
18941
19177
|
if (pathExists(target) && !force) {
|
|
18942
19178
|
skip(".kilocode/rules/agent-config.md already exists");
|
|
18943
19179
|
return;
|
|
@@ -18964,7 +19200,7 @@ canonical source (or symlink it):
|
|
|
18964
19200
|
Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
|
|
18965
19201
|
`;
|
|
18966
19202
|
function ensure_zed_bridge(project_root, force) {
|
|
18967
|
-
const target =
|
|
19203
|
+
const target = path20.join(project_root, ".zed", "agent-config.md");
|
|
18968
19204
|
if (pathExists(target) && !force) {
|
|
18969
19205
|
skip(".zed/agent-config.md already exists");
|
|
18970
19206
|
return;
|
|
@@ -18985,7 +19221,7 @@ rules into your JetBrains profile.
|
|
|
18985
19221
|
Canonical rule and skill source: \`.augment/\` (see \`AGENTS.md\`).
|
|
18986
19222
|
`;
|
|
18987
19223
|
function ensure_jetbrains_bridge(project_root, force) {
|
|
18988
|
-
const target =
|
|
19224
|
+
const target = path20.join(project_root, ".jetbrains", "agent-config.md");
|
|
18989
19225
|
if (pathExists(target) && !force) {
|
|
18990
19226
|
skip(".jetbrains/agent-config.md already exists");
|
|
18991
19227
|
return;
|
|
@@ -19016,7 +19252,7 @@ session. The canonical rule and skill source lives under \`.augment/\`
|
|
|
19016
19252
|
See \`docs/setup/per-ide/kiro.md\` for the full activation guide.
|
|
19017
19253
|
`;
|
|
19018
19254
|
function ensure_kiro_bridge(project_root, force) {
|
|
19019
|
-
const target =
|
|
19255
|
+
const target = path20.join(project_root, ".kiro", "steering", "agent-config.md");
|
|
19020
19256
|
if (pathExists(target) && !force) {
|
|
19021
19257
|
skip(".kiro/steering/agent-config.md already exists");
|
|
19022
19258
|
return;
|
|
@@ -19042,35 +19278,35 @@ var SMOKE_BRIDGE_PATHS = {
|
|
|
19042
19278
|
};
|
|
19043
19279
|
function dirHasEntries(p) {
|
|
19044
19280
|
try {
|
|
19045
|
-
return
|
|
19281
|
+
return fs23.readdirSync(p).length > 0;
|
|
19046
19282
|
} catch {
|
|
19047
19283
|
return false;
|
|
19048
19284
|
}
|
|
19049
19285
|
}
|
|
19050
19286
|
function _resolve_tsx_invocation(scriptPath, scriptArgs) {
|
|
19051
19287
|
const binName = process3.platform === "win32" ? "tsx.cmd" : "tsx";
|
|
19052
|
-
let dir =
|
|
19288
|
+
let dir = path20.dirname(scriptPath);
|
|
19053
19289
|
for (; ; ) {
|
|
19054
|
-
const candidate =
|
|
19290
|
+
const candidate = path20.join(dir, "node_modules", ".bin", binName);
|
|
19055
19291
|
if (isFile(candidate)) {
|
|
19056
19292
|
return { command: candidate, args: [scriptPath, ...scriptArgs] };
|
|
19057
19293
|
}
|
|
19058
|
-
const parent =
|
|
19294
|
+
const parent = path20.dirname(dir);
|
|
19059
19295
|
if (parent === dir) break;
|
|
19060
19296
|
dir = parent;
|
|
19061
19297
|
}
|
|
19062
19298
|
return { command: "npx", args: ["tsx", scriptPath, ...scriptArgs] };
|
|
19063
19299
|
}
|
|
19064
19300
|
function _smoke_test_hooks(project_root, package_root) {
|
|
19065
|
-
const dispatcher =
|
|
19066
|
-
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");
|
|
19067
19303
|
if (!isFile(dispatcher) || !isFile(manifest)) return 0;
|
|
19068
19304
|
const failed = [];
|
|
19069
19305
|
const skipped = [];
|
|
19070
19306
|
const passed = [];
|
|
19071
19307
|
for (const [platform, native] of SMOKE_PROBE_EVENTS) {
|
|
19072
19308
|
const rel_bridge = SMOKE_BRIDGE_PATHS[platform] ?? "";
|
|
19073
|
-
const bridge_path = rel_bridge ?
|
|
19309
|
+
const bridge_path = rel_bridge ? path20.join(project_root, rel_bridge) : null;
|
|
19074
19310
|
const bridge_present = Boolean(
|
|
19075
19311
|
bridge_path && (isFile(bridge_path) || isDir(bridge_path) && dirHasEntries(bridge_path))
|
|
19076
19312
|
);
|
|
@@ -19270,9 +19506,9 @@ To remove this marker, delete this file.
|
|
|
19270
19506
|
`;
|
|
19271
19507
|
}
|
|
19272
19508
|
var _CLAUDE_DESKTOP_BUNDLES_SUBPATH = "claude-desktop/bundles";
|
|
19273
|
-
var GLOBAL_ROOT =
|
|
19274
|
-
var GLOBAL_USER_SETTINGS_PATH =
|
|
19275
|
-
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");
|
|
19276
19512
|
function _bridge_marker(tool_id, scope) {
|
|
19277
19513
|
if (scope === "global") return USER_SCOPE_PATHS[tool_id] ?? "";
|
|
19278
19514
|
return PROJECT_BRIDGE_MARKERS[tool_id] ?? "";
|
|
@@ -19321,7 +19557,7 @@ function _load_yaml_doc(p) {
|
|
|
19321
19557
|
return _isPlainObject2(data) ? data : {};
|
|
19322
19558
|
}
|
|
19323
19559
|
function _load_default_settings(package_root) {
|
|
19324
|
-
const template_source =
|
|
19560
|
+
const template_source = path20.join(package_root, "src", "config", "agent-settings.template.yml");
|
|
19325
19561
|
if (!pathExists(template_source)) return {};
|
|
19326
19562
|
let text;
|
|
19327
19563
|
try {
|
|
@@ -19335,11 +19571,11 @@ function _load_default_settings(package_root) {
|
|
|
19335
19571
|
}
|
|
19336
19572
|
var RULE_LAYER_CHOICES = ["global", "project", "both-acknowledged"];
|
|
19337
19573
|
function _suppress_rule_layer(project_root, suppress_dir) {
|
|
19338
|
-
const target =
|
|
19574
|
+
const target = path20.join(project_root, ".claude", "settings.local.json");
|
|
19339
19575
|
const existing = pathExists(target) ? read_json_file(target) : {};
|
|
19340
19576
|
let real_dir = suppress_dir;
|
|
19341
19577
|
try {
|
|
19342
|
-
real_dir =
|
|
19578
|
+
real_dir = fs23.realpathSync(suppress_dir);
|
|
19343
19579
|
} catch {
|
|
19344
19580
|
real_dir = suppress_dir;
|
|
19345
19581
|
}
|
|
@@ -19350,8 +19586,8 @@ function _suppress_rule_layer(project_root, suppress_dir) {
|
|
|
19350
19586
|
success(`.claude/settings.local.json: claudeMdExcludes += ${entry}`);
|
|
19351
19587
|
}
|
|
19352
19588
|
function _gate_rule_layer_overlap(project_root, layer, dry_run) {
|
|
19353
|
-
const global_dir =
|
|
19354
|
-
const project_dir =
|
|
19589
|
+
const global_dir = path20.join(os8.homedir(), ".claude", "rules");
|
|
19590
|
+
const project_dir = path20.join(project_root, ".claude", "rules");
|
|
19355
19591
|
const g = readRuleLayer(global_dir);
|
|
19356
19592
|
const p = readRuleLayer(project_dir);
|
|
19357
19593
|
if (g === null || p === null) return true;
|
|
@@ -19428,28 +19664,6 @@ function _run_scope_prompt(opts, reason, custom_path) {
|
|
|
19428
19664
|
if (!state.QUIET) info(`Custom destination: ${cp}`);
|
|
19429
19665
|
return "project";
|
|
19430
19666
|
}
|
|
19431
|
-
var SCOPE_DETECT_MANIFESTS = [
|
|
19432
|
-
"package.json",
|
|
19433
|
-
"composer.json",
|
|
19434
|
-
"pyproject.toml",
|
|
19435
|
-
"Cargo.toml",
|
|
19436
|
-
"go.mod",
|
|
19437
|
-
"Gemfile"
|
|
19438
|
-
];
|
|
19439
|
-
var SCOPE_DETECT_AI_DIRS = [
|
|
19440
|
-
".claude",
|
|
19441
|
-
".cursor",
|
|
19442
|
-
".windsurf",
|
|
19443
|
-
".augment",
|
|
19444
|
-
".clinerules",
|
|
19445
|
-
".copilot",
|
|
19446
|
-
".gemini",
|
|
19447
|
-
".codex",
|
|
19448
|
-
".aider",
|
|
19449
|
-
".continue",
|
|
19450
|
-
".roo",
|
|
19451
|
-
".kilocode"
|
|
19452
|
-
];
|
|
19453
19667
|
var SCOPE_DETECT_AI_FILES = [
|
|
19454
19668
|
"CLAUDE.md",
|
|
19455
19669
|
"AGENTS.md",
|
|
@@ -19461,9 +19675,9 @@ function detect_scope(cwd) {
|
|
|
19461
19675
|
if (pathExists(_resolve_settings_read(cwd))) {
|
|
19462
19676
|
return ["project", `existing ${SETTINGS_FILE}`];
|
|
19463
19677
|
}
|
|
19464
|
-
const has_manifest = SCOPE_DETECT_MANIFESTS.find((m) => pathExists(
|
|
19465
|
-
const has_ai_dir = SCOPE_DETECT_AI_DIRS.find((d) => isDir(
|
|
19466
|
-
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;
|
|
19467
19681
|
if (has_manifest && (has_ai_dir || has_ai_file)) {
|
|
19468
19682
|
const marker = has_ai_dir || has_ai_file;
|
|
19469
19683
|
return ["prompt", `manifest (${has_manifest}) + AI-tool config (${marker})`];
|
|
@@ -19484,7 +19698,7 @@ function readLineSyncRaw(promptText) {
|
|
|
19484
19698
|
for (; ; ) {
|
|
19485
19699
|
let n;
|
|
19486
19700
|
try {
|
|
19487
|
-
n =
|
|
19701
|
+
n = fs23.readSync(0, buf, 0, 1, null);
|
|
19488
19702
|
} catch (err) {
|
|
19489
19703
|
const code = err.code;
|
|
19490
19704
|
if (code === "EAGAIN") {
|
|
@@ -19559,8 +19773,8 @@ function _files_by_tool_from_bridges(tools, project_root, scope) {
|
|
|
19559
19773
|
const marker = _bridge_marker(tool_id, scope);
|
|
19560
19774
|
if (!marker) continue;
|
|
19561
19775
|
let marker_path = marker;
|
|
19562
|
-
if (!
|
|
19563
|
-
marker_path =
|
|
19776
|
+
if (!path20.isAbsolute(marker_path)) {
|
|
19777
|
+
marker_path = path20.join(project_root, marker_path);
|
|
19564
19778
|
}
|
|
19565
19779
|
out[tool_id] = [_file_entry(marker_path, "bridge", false)];
|
|
19566
19780
|
}
|
|
@@ -19599,26 +19813,26 @@ function _update_installed_tools_manifest(project_root, tools, scope, force, fil
|
|
|
19599
19813
|
}
|
|
19600
19814
|
write_manifest(target, version, entries);
|
|
19601
19815
|
if (!state.QUIET) {
|
|
19602
|
-
const rel = isRelativeTo(target, project_root) ?
|
|
19816
|
+
const rel = isRelativeTo(target, project_root) ? path20.relative(project_root, target) : target;
|
|
19603
19817
|
info(`Manifest updated: ${rel}`);
|
|
19604
19818
|
}
|
|
19605
19819
|
return 0;
|
|
19606
19820
|
}
|
|
19607
19821
|
function isRelativeTo(child, parent) {
|
|
19608
|
-
const rel =
|
|
19609
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
19822
|
+
const rel = path20.relative(parent, child);
|
|
19823
|
+
return rel === "" || !rel.startsWith("..") && !path20.isAbsolute(rel);
|
|
19610
19824
|
}
|
|
19611
19825
|
function _resolve_package_root_for_global() {
|
|
19612
19826
|
const here = resolvePath(_HERE2);
|
|
19613
|
-
const candidate =
|
|
19614
|
-
if (!pathExists(
|
|
19827
|
+
const candidate = path20.dirname(path20.dirname(path20.dirname(here)));
|
|
19828
|
+
if (!pathExists(path20.join(candidate, "src", "config", "profiles", "minimal.ini"))) {
|
|
19615
19829
|
fail(
|
|
19616
19830
|
`Could not locate agent-config package root from ${here}. Expected src/config/profiles/minimal.ini at the parent directory.`
|
|
19617
19831
|
);
|
|
19618
19832
|
}
|
|
19619
19833
|
return candidate;
|
|
19620
19834
|
}
|
|
19621
|
-
var CONSUMER_BRIDGE_MARKER_RELPATH =
|
|
19835
|
+
var CONSUMER_BRIDGE_MARKER_RELPATH = path20.join("agents", ".event4u-bridge.yml");
|
|
19622
19836
|
var MIGRATE_LEGACY_YAML_FILES = [".agent-settings.yml", ".agent-user.yml"];
|
|
19623
19837
|
var MIGRATE_LEGACY_TOOL_DIRS = [".augment", ".claude", ".cursor"];
|
|
19624
19838
|
var AGENT_CONFIG_PACKAGE_NAME = "@event4u/agent-config";
|
|
@@ -19626,7 +19840,7 @@ function _is_agent_config_source_repo(project_root) {
|
|
|
19626
19840
|
if (process3.env["AGENT_CONFIG_CONSUMER_MODE"] === "1") {
|
|
19627
19841
|
return [false, "consumer-mode-override"];
|
|
19628
19842
|
}
|
|
19629
|
-
const pkg_json =
|
|
19843
|
+
const pkg_json = path20.join(project_root, "package.json");
|
|
19630
19844
|
if (isFile(pkg_json)) {
|
|
19631
19845
|
let data = {};
|
|
19632
19846
|
try {
|
|
@@ -19638,18 +19852,18 @@ function _is_agent_config_source_repo(project_root) {
|
|
|
19638
19852
|
return [true, "package.json:name"];
|
|
19639
19853
|
}
|
|
19640
19854
|
}
|
|
19641
|
-
if (isDir(
|
|
19855
|
+
if (isDir(path20.join(project_root, ".agent-src.uncondensed"))) {
|
|
19642
19856
|
return [true, ".agent-src.uncondensed/"];
|
|
19643
19857
|
}
|
|
19644
|
-
const packages_dir =
|
|
19858
|
+
const packages_dir = path20.join(project_root, "packages");
|
|
19645
19859
|
if (isDir(packages_dir)) {
|
|
19646
|
-
for (const child of
|
|
19647
|
-
if (isDir(
|
|
19860
|
+
for (const child of fs23.readdirSync(packages_dir)) {
|
|
19861
|
+
if (isDir(path20.join(packages_dir, child, ".agent-src.uncondensed"))) {
|
|
19648
19862
|
return [true, `packages/${child}/.agent-src.uncondensed/`];
|
|
19649
19863
|
}
|
|
19650
19864
|
}
|
|
19651
19865
|
}
|
|
19652
|
-
const installer_self =
|
|
19866
|
+
const installer_self = path20.join(project_root, "scripts", "install.py");
|
|
19653
19867
|
try {
|
|
19654
19868
|
if (isFile(installer_self) && resolvePath(installer_self) === resolvePath(_HERE2)) {
|
|
19655
19869
|
return [true, "src/scripts/install.py (self)"];
|
|
@@ -19669,17 +19883,17 @@ function _detect_legacy_for_migration(project_root) {
|
|
|
19669
19883
|
}
|
|
19670
19884
|
return [];
|
|
19671
19885
|
}
|
|
19672
|
-
if (isFile(
|
|
19886
|
+
if (isFile(path20.join(project_root, INSTALL_MODE_MARKER_REL))) return [];
|
|
19673
19887
|
const found = [];
|
|
19674
19888
|
for (const name of MIGRATE_LEGACY_YAML_FILES) {
|
|
19675
|
-
if (isFile(
|
|
19889
|
+
if (isFile(path20.join(project_root, name))) {
|
|
19676
19890
|
found.push(name);
|
|
19677
|
-
} else if (isFile(
|
|
19891
|
+
} else if (isFile(path20.join(project_root, "settings", name))) {
|
|
19678
19892
|
found.push(`settings/${name}`);
|
|
19679
19893
|
}
|
|
19680
19894
|
}
|
|
19681
19895
|
for (const name of MIGRATE_LEGACY_TOOL_DIRS) {
|
|
19682
|
-
const p =
|
|
19896
|
+
const p = path20.join(project_root, name);
|
|
19683
19897
|
if (isDir(p) && !isSymlink(p)) {
|
|
19684
19898
|
found.push(`${name}/`);
|
|
19685
19899
|
}
|
|
@@ -19691,7 +19905,7 @@ function _prompt_migrate_to_global(project_root, artefacts) {
|
|
|
19691
19905
|
process3.stdout.write("\n");
|
|
19692
19906
|
warn("Legacy project-local artefacts detected \u2014 pre-ADR-020 layout:");
|
|
19693
19907
|
for (const rel of artefacts) {
|
|
19694
|
-
info(` ${
|
|
19908
|
+
info(` ${path20.join(project_root, rel)}`);
|
|
19695
19909
|
}
|
|
19696
19910
|
info("The unified `agent-config migrate` sweeps these in one pass.");
|
|
19697
19911
|
info("The wizard recreates fresh config afterwards.");
|
|
@@ -19722,20 +19936,20 @@ function _run_migrate_to_global(project_root) {
|
|
|
19722
19936
|
function _format_global_root_for_marker(global_root) {
|
|
19723
19937
|
const home = resolvePath(os8.homedir());
|
|
19724
19938
|
const resolved = resolvePath(global_root);
|
|
19725
|
-
const rel =
|
|
19726
|
-
if (rel === "" || rel.startsWith("..") ||
|
|
19939
|
+
const rel = path20.relative(home, resolved);
|
|
19940
|
+
if (rel === "" || rel.startsWith("..") || path20.isAbsolute(rel)) {
|
|
19727
19941
|
return global_root;
|
|
19728
19942
|
}
|
|
19729
|
-
return `~/${rel.split(
|
|
19943
|
+
return `~/${rel.split(path20.sep).join("/")}`;
|
|
19730
19944
|
}
|
|
19731
19945
|
function _remove_legacy_consumer_bridge_marker(project_root, env = null) {
|
|
19732
19946
|
const env_map = env ?? process3.env;
|
|
19733
19947
|
if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return null;
|
|
19734
|
-
if (isDir(
|
|
19735
|
-
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);
|
|
19736
19950
|
if (!isFile(target)) return null;
|
|
19737
19951
|
try {
|
|
19738
|
-
|
|
19952
|
+
fs23.rmSync(target);
|
|
19739
19953
|
} catch {
|
|
19740
19954
|
return null;
|
|
19741
19955
|
}
|
|
@@ -19749,7 +19963,7 @@ var PROJECT_ANCHOR_TOOLS = {
|
|
|
19749
19963
|
function _write_per_tool_project_anchors(project_root, tools, env = null, now = null) {
|
|
19750
19964
|
const env_map = env ?? process3.env;
|
|
19751
19965
|
if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return [];
|
|
19752
|
-
if (isDir(
|
|
19966
|
+
if (isDir(path20.join(project_root, ".agent-src.uncondensed"))) return [];
|
|
19753
19967
|
const global_root_str = _format_global_root_for_marker(
|
|
19754
19968
|
event4u_root(env_map)
|
|
19755
19969
|
);
|
|
@@ -19758,8 +19972,8 @@ function _write_per_tool_project_anchors(project_root, tools, env = null, now =
|
|
|
19758
19972
|
for (const tool_id of Object.keys(PROJECT_ANCHOR_TOOLS).sort()) {
|
|
19759
19973
|
const rel_path = PROJECT_ANCHOR_TOOLS[tool_id];
|
|
19760
19974
|
if (!tools.has(tool_id)) continue;
|
|
19761
|
-
const target =
|
|
19762
|
-
mkdirp(
|
|
19975
|
+
const target = path20.join(project_root, rel_path);
|
|
19976
|
+
mkdirp(path20.dirname(target));
|
|
19763
19977
|
const body = `# event4u/agent-config \u2014 per-tool project anchor (auto-written).
|
|
19764
19978
|
# Spec: docs/contracts/consumer-bridge.md \xA7 Per-tool anchor strategy.
|
|
19765
19979
|
# Tool: ${tool_id}. Resolves the global install directly \u2014 no
|
|
@@ -19777,7 +19991,7 @@ installed_at: ${stamp}
|
|
|
19777
19991
|
}
|
|
19778
19992
|
var PACKAGE_TAG_ID = "event4u/agent-config";
|
|
19779
19993
|
function _inject_package_tag(target, source, package_root) {
|
|
19780
|
-
if (
|
|
19994
|
+
if (path20.extname(target) !== ".md") return;
|
|
19781
19995
|
let text;
|
|
19782
19996
|
try {
|
|
19783
19997
|
text = readText(target);
|
|
@@ -19805,8 +20019,8 @@ function _inject_package_tag(target, source, package_root) {
|
|
|
19805
20019
|
resolved_src = source;
|
|
19806
20020
|
}
|
|
19807
20021
|
if (package_root !== null) {
|
|
19808
|
-
const rel =
|
|
19809
|
-
if (rel !== "" && !rel.startsWith("..") && !
|
|
20022
|
+
const rel = path20.relative(resolvePath(package_root), resolved_src);
|
|
20023
|
+
if (rel !== "" && !rel.startsWith("..") && !path20.isAbsolute(rel)) {
|
|
19810
20024
|
source_value = rel;
|
|
19811
20025
|
} else {
|
|
19812
20026
|
source_value = resolved_src;
|
|
@@ -19841,7 +20055,7 @@ function _escapes_package_root(resolved, package_root) {
|
|
|
19841
20055
|
if (package_root === null) return false;
|
|
19842
20056
|
let root;
|
|
19843
20057
|
try {
|
|
19844
|
-
root =
|
|
20058
|
+
root = fs23.realpathSync(package_root);
|
|
19845
20059
|
} catch {
|
|
19846
20060
|
return false;
|
|
19847
20061
|
}
|
|
@@ -19856,7 +20070,7 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
|
|
|
19856
20070
|
if (file_filter !== null && !file_filter(src)) return [0, 0, written_paths];
|
|
19857
20071
|
let resolved_src = src;
|
|
19858
20072
|
try {
|
|
19859
|
-
resolved_src =
|
|
20073
|
+
resolved_src = fs23.realpathSync(src);
|
|
19860
20074
|
} catch {
|
|
19861
20075
|
resolved_src = src;
|
|
19862
20076
|
}
|
|
@@ -19864,10 +20078,10 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
|
|
|
19864
20078
|
warn(`refused: ${src} dereferences outside the package root \u2014 not copied`);
|
|
19865
20079
|
return [0, 0, written_paths];
|
|
19866
20080
|
}
|
|
19867
|
-
mkdirp(
|
|
20081
|
+
mkdirp(path20.dirname(dest));
|
|
19868
20082
|
const decision = _resolve_file_conflict(dest, force);
|
|
19869
20083
|
if (decision === "skip") return [0, 1, written_paths];
|
|
19870
|
-
|
|
20084
|
+
fs23.copyFileSync(src, dest);
|
|
19871
20085
|
_inject_package_tag(dest, src, package_root);
|
|
19872
20086
|
written_paths.push(dest);
|
|
19873
20087
|
return [1, 0, written_paths];
|
|
@@ -19875,11 +20089,11 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
|
|
|
19875
20089
|
mkdirp(dest);
|
|
19876
20090
|
const walk = (node) => {
|
|
19877
20091
|
const acc = [];
|
|
19878
|
-
const names =
|
|
20092
|
+
const names = fs23.readdirSync(node).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
19879
20093
|
for (const name of names) {
|
|
19880
|
-
const entry =
|
|
20094
|
+
const entry = path20.join(node, name);
|
|
19881
20095
|
acc.push(entry);
|
|
19882
|
-
const lst =
|
|
20096
|
+
const lst = fs23.lstatSync(entry);
|
|
19883
20097
|
if (lst.isDirectory() && !lst.isSymbolicLink()) {
|
|
19884
20098
|
acc.push(...walk(entry));
|
|
19885
20099
|
}
|
|
@@ -19887,9 +20101,9 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
|
|
|
19887
20101
|
return acc;
|
|
19888
20102
|
};
|
|
19889
20103
|
for (const entry of walk(src)) {
|
|
19890
|
-
const rel =
|
|
19891
|
-
const target =
|
|
19892
|
-
const lst =
|
|
20104
|
+
const rel = path20.relative(src, entry);
|
|
20105
|
+
const target = path20.join(dest, rel);
|
|
20106
|
+
const lst = fs23.lstatSync(entry);
|
|
19893
20107
|
if (lst.isDirectory() && !lst.isSymbolicLink()) {
|
|
19894
20108
|
mkdirp(target);
|
|
19895
20109
|
continue;
|
|
@@ -19897,8 +20111,8 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
|
|
|
19897
20111
|
let resolvedIsDir = false;
|
|
19898
20112
|
let resolved = entry;
|
|
19899
20113
|
try {
|
|
19900
|
-
resolved =
|
|
19901
|
-
resolvedIsDir =
|
|
20114
|
+
resolved = fs23.realpathSync(entry);
|
|
20115
|
+
resolvedIsDir = fs23.statSync(entry).isDirectory();
|
|
19902
20116
|
} catch {
|
|
19903
20117
|
resolvedIsDir = false;
|
|
19904
20118
|
}
|
|
@@ -19928,8 +20142,8 @@ function _copy_dir_dereferencing_symlinks(src, dest, force, package_root = null,
|
|
|
19928
20142
|
skipped += 1;
|
|
19929
20143
|
continue;
|
|
19930
20144
|
}
|
|
19931
|
-
mkdirp(
|
|
19932
|
-
|
|
20145
|
+
mkdirp(path20.dirname(target));
|
|
20146
|
+
fs23.copyFileSync(resolved, target);
|
|
19933
20147
|
_inject_package_tag(target, resolved, package_root);
|
|
19934
20148
|
written += 1;
|
|
19935
20149
|
written_paths.push(target);
|
|
@@ -19941,7 +20155,7 @@ function _claude_desktop_bundles_dir() {
|
|
|
19941
20155
|
}
|
|
19942
20156
|
function _write_claude_desktop_marker(_force, lockfile_path2, bundles_dir, bundle_count) {
|
|
19943
20157
|
const anchor = expanduser6(USER_SCOPE_PATHS["claude-desktop"]);
|
|
19944
|
-
const target =
|
|
20158
|
+
const target = path20.join(anchor, "agent-config.md");
|
|
19945
20159
|
mkdirp(anchor);
|
|
19946
20160
|
const body = claudeDesktopMarkerBody(lockfile_path2, anchor, bundles_dir, bundle_count);
|
|
19947
20161
|
writeText(target, body);
|
|
@@ -19965,23 +20179,23 @@ function _apply_claude_flat_command_wrappers(anchor, package_root, current_files
|
|
|
19965
20179
|
const wrapped = [];
|
|
19966
20180
|
const collisions = [];
|
|
19967
20181
|
const reserved = [];
|
|
19968
|
-
const commands_dir =
|
|
20182
|
+
const commands_dir = path20.join(anchor, "commands");
|
|
19969
20183
|
let flat_entries = [];
|
|
19970
20184
|
try {
|
|
19971
|
-
flat_entries =
|
|
20185
|
+
flat_entries = fs23.readdirSync(commands_dir).filter((f) => f.endsWith(".md"));
|
|
19972
20186
|
} catch {
|
|
19973
20187
|
}
|
|
19974
20188
|
for (const fname of flat_entries.sort()) {
|
|
19975
20189
|
const slug = fname.slice(0, -".md".length);
|
|
19976
20190
|
if (!is_claude_builtin_name(slug)) continue;
|
|
19977
|
-
|
|
20191
|
+
fs23.rmSync(path20.join(commands_dir, fname), { force: true });
|
|
19978
20192
|
current_files.delete(`commands/${fname}`);
|
|
19979
20193
|
reserved.push(slug);
|
|
19980
20194
|
}
|
|
19981
20195
|
const eligible = new Set(_CLAUDE_FLAT_WRAPPER_EXTRA);
|
|
19982
20196
|
try {
|
|
19983
20197
|
const manifest = JSON.parse(
|
|
19984
|
-
|
|
20198
|
+
fs23.readFileSync(path20.join(package_root, "dist", "discovery", "discovery-manifest.json"), "utf8")
|
|
19985
20199
|
);
|
|
19986
20200
|
for (const a of manifest.artefacts ?? []) {
|
|
19987
20201
|
if (a.category !== "command" || typeof a.slug !== "string") continue;
|
|
@@ -19992,22 +20206,22 @@ function _apply_claude_flat_command_wrappers(anchor, package_root, current_files
|
|
|
19992
20206
|
}
|
|
19993
20207
|
for (const slug of [...eligible].sort()) {
|
|
19994
20208
|
const flat_rel = `commands/${slug}.md`;
|
|
19995
|
-
const flat_abs =
|
|
19996
|
-
if (!
|
|
19997
|
-
const skill_dir =
|
|
19998
|
-
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)) {
|
|
19999
20213
|
collisions.push(slug);
|
|
20000
20214
|
continue;
|
|
20001
20215
|
}
|
|
20002
|
-
let body =
|
|
20216
|
+
let body = fs23.readFileSync(flat_abs, "utf8");
|
|
20003
20217
|
if (body.startsWith("---\n") && !/^name:/m.test(body.split("\n---")[0] ?? "")) {
|
|
20004
20218
|
body = body.replace("---\n", `---
|
|
20005
20219
|
name: ${slug}
|
|
20006
20220
|
`);
|
|
20007
20221
|
}
|
|
20008
|
-
|
|
20009
|
-
|
|
20010
|
-
|
|
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 });
|
|
20011
20225
|
current_files.delete(flat_rel);
|
|
20012
20226
|
current_files.add(`skills/${slug}/SKILL.md`);
|
|
20013
20227
|
wrapped.push(slug);
|
|
@@ -20039,8 +20253,8 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
|
|
|
20039
20253
|
const written_paths = [];
|
|
20040
20254
|
let current_files = /* @__PURE__ */ new Set();
|
|
20041
20255
|
for (const [src_rel, dest_sub] of plan) {
|
|
20042
|
-
const src =
|
|
20043
|
-
const dest = dest_sub ?
|
|
20256
|
+
const src = path20.join(package_root, src_rel);
|
|
20257
|
+
const dest = dest_sub ? path20.join(anchor, dest_sub) : anchor;
|
|
20044
20258
|
const rule_filter = _rule_filter_for_source(src_rel, rule_scope);
|
|
20045
20259
|
const [w, s, paths] = _copy_dir_dereferencing_symlinks(
|
|
20046
20260
|
src,
|
|
@@ -20063,16 +20277,13 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
|
|
|
20063
20277
|
}
|
|
20064
20278
|
if (tool_id === "claude-code") {
|
|
20065
20279
|
const res = _apply_claude_flat_command_wrappers(anchor, package_root, current_files);
|
|
20066
|
-
|
|
20067
|
-
|
|
20068
|
-
|
|
20069
|
-
|
|
20070
|
-
|
|
20071
|
-
|
|
20072
|
-
|
|
20073
|
-
` 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`
|
|
20074
|
-
);
|
|
20075
|
-
}
|
|
20280
|
+
rewriteAndReport(
|
|
20281
|
+
path20.join(anchor, "rules"),
|
|
20282
|
+
state.QUIET,
|
|
20283
|
+
info,
|
|
20284
|
+
warn,
|
|
20285
|
+
res
|
|
20286
|
+
);
|
|
20076
20287
|
}
|
|
20077
20288
|
const missing_targets = _verify_deploy_targets(anchor, plan);
|
|
20078
20289
|
if (missing_targets.length > 0) {
|
|
@@ -20114,10 +20325,10 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
|
|
|
20114
20325
|
results[tool_id] = [written_total, skipped_total, "deployed", written_paths];
|
|
20115
20326
|
if (tool_id === "claude-code") {
|
|
20116
20327
|
try {
|
|
20117
|
-
const manifest =
|
|
20328
|
+
const manifest = path20.join(package_root, "src", "scripts", "hook_manifest.yaml");
|
|
20118
20329
|
const matrix = build_claude_hook_matrix(manifest);
|
|
20119
20330
|
const res = ensure_managed_hooks(
|
|
20120
|
-
|
|
20331
|
+
path20.join(anchor, "settings.json"),
|
|
20121
20332
|
matrix
|
|
20122
20333
|
);
|
|
20123
20334
|
if (!state.QUIET) {
|
|
@@ -20154,7 +20365,7 @@ function _preview_global_reap(tools, package_root) {
|
|
|
20154
20365
|
const anchor = expanduser6(anchor_raw);
|
|
20155
20366
|
let current_files = /* @__PURE__ */ new Set();
|
|
20156
20367
|
for (const [src_rel, dest_sub] of plan) {
|
|
20157
|
-
const src =
|
|
20368
|
+
const src = path20.join(package_root, src_rel);
|
|
20158
20369
|
current_files = setUnion(
|
|
20159
20370
|
current_files,
|
|
20160
20371
|
expected_deploy_files(
|
|
@@ -20188,14 +20399,14 @@ function _preview_global_reap(tools, package_root) {
|
|
|
20188
20399
|
function _verify_deploy_targets(anchor, plan) {
|
|
20189
20400
|
const missing = [];
|
|
20190
20401
|
for (const [, dest_sub] of plan) {
|
|
20191
|
-
const target = dest_sub ?
|
|
20402
|
+
const target = dest_sub ? path20.join(anchor, dest_sub) : anchor;
|
|
20192
20403
|
const label = dest_sub || ".";
|
|
20193
20404
|
if (!isDir(target)) {
|
|
20194
20405
|
missing.push(label);
|
|
20195
20406
|
continue;
|
|
20196
20407
|
}
|
|
20197
20408
|
try {
|
|
20198
|
-
const entries =
|
|
20409
|
+
const entries = fs23.readdirSync(target);
|
|
20199
20410
|
if (entries.length === 0) missing.push(label);
|
|
20200
20411
|
} catch {
|
|
20201
20412
|
missing.push(label);
|
|
@@ -20213,9 +20424,9 @@ function _resolve_global_settings_doc() {
|
|
|
20213
20424
|
}
|
|
20214
20425
|
function _resolve_global_settings_path() {
|
|
20215
20426
|
const root = event4u_root();
|
|
20216
|
-
const canonical =
|
|
20427
|
+
const canonical = path20.join(root, "settings", SETTINGS_FILE);
|
|
20217
20428
|
if (pathExists(canonical)) return canonical;
|
|
20218
|
-
const legacy =
|
|
20429
|
+
const legacy = path20.join(root, SETTINGS_FILE);
|
|
20219
20430
|
if (pathExists(legacy)) return legacy;
|
|
20220
20431
|
return null;
|
|
20221
20432
|
}
|
|
@@ -20326,7 +20537,7 @@ function install_global(tools, force, project_root = null, core_only = false) {
|
|
|
20326
20537
|
info(` schema_version=1, agent_config_version=${installed_version}`);
|
|
20327
20538
|
info(` tools=${merged_tools.join(",")}`);
|
|
20328
20539
|
}
|
|
20329
|
-
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"))) {
|
|
20330
20541
|
const drift = collect_drift(project_root);
|
|
20331
20542
|
if (!state.QUIET) {
|
|
20332
20543
|
process3.stdout.write("\n");
|
|
@@ -20440,19 +20651,19 @@ function install_global(tools, force, project_root = null, core_only = false) {
|
|
|
20440
20651
|
}
|
|
20441
20652
|
}
|
|
20442
20653
|
}
|
|
20443
|
-
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"))) {
|
|
20444
20655
|
const files_by_tool = _files_by_tool_from_deploy(deploy_results);
|
|
20445
20656
|
const rc = _update_installed_tools_manifest(project_root, tools, "global", force, files_by_tool);
|
|
20446
20657
|
if (rc !== 0) return rc;
|
|
20447
20658
|
const removed_marker = _remove_legacy_consumer_bridge_marker(project_root);
|
|
20448
20659
|
if (removed_marker !== null && !state.QUIET) {
|
|
20449
|
-
const rel = isRelativeTo(removed_marker, project_root) ?
|
|
20660
|
+
const rel = isRelativeTo(removed_marker, project_root) ? path20.relative(project_root, removed_marker) : removed_marker;
|
|
20450
20661
|
info(`Removed legacy bridge marker: ${rel}`);
|
|
20451
20662
|
}
|
|
20452
20663
|
const anchor_paths = _write_per_tool_project_anchors(project_root, tools);
|
|
20453
20664
|
if (anchor_paths.length > 0 && !state.QUIET) {
|
|
20454
20665
|
for (const p of anchor_paths) {
|
|
20455
|
-
const rel = isRelativeTo(p, project_root) ?
|
|
20666
|
+
const rel = isRelativeTo(p, project_root) ? path20.relative(project_root, p) : p;
|
|
20456
20667
|
info(`Project anchor written: ${rel}`);
|
|
20457
20668
|
}
|
|
20458
20669
|
}
|
|
@@ -20488,8 +20699,8 @@ function install_global(tools, force, project_root = null, core_only = false) {
|
|
|
20488
20699
|
}
|
|
20489
20700
|
function _catalogue_truncation_warnings(deploy_results, project_root) {
|
|
20490
20701
|
const log_candidates = [
|
|
20491
|
-
|
|
20492
|
-
...project_root ? [
|
|
20702
|
+
path20.join(event4u_root(), "state", "skill-catalogue.jsonl"),
|
|
20703
|
+
...project_root ? [path20.join(project_root, OBSERVATION_LOG)] : []
|
|
20493
20704
|
];
|
|
20494
20705
|
const records = log_candidates.flatMap((p) => readObservationLog(p));
|
|
20495
20706
|
if (records.length === 0) return [];
|
|
@@ -20512,13 +20723,13 @@ function _catalogue_truncation_warnings(deploy_results, project_root) {
|
|
|
20512
20723
|
function _scoped_migration_notice(deploy_results, project_root, package_root, probe) {
|
|
20513
20724
|
if (!isInteractiveSession(probe)) return [];
|
|
20514
20725
|
const log_candidates = [
|
|
20515
|
-
|
|
20516
|
-
...project_root ? [
|
|
20726
|
+
path20.join(event4u_root(), "state", "skill-catalogue.jsonl"),
|
|
20727
|
+
...project_root ? [path20.join(project_root, OBSERVATION_LOG)] : []
|
|
20517
20728
|
];
|
|
20518
20729
|
const limits = knownHostLimits(log_candidates.flatMap((p) => readObservationLog(p)));
|
|
20519
20730
|
if (limits.size === 0) return [];
|
|
20520
20731
|
const resolved = _resolve_scoped_projection(package_root);
|
|
20521
|
-
const settings_path = _resolve_global_settings_path() ??
|
|
20732
|
+
const settings_path = _resolve_global_settings_path() ?? path20.join(event4u_root(), "settings", SETTINGS_FILE);
|
|
20522
20733
|
for (const tool_id of Object.keys(deploy_results).sort()) {
|
|
20523
20734
|
const [, , status] = deploy_results[tool_id];
|
|
20524
20735
|
if (status !== "deployed") continue;
|
|
@@ -20537,8 +20748,8 @@ function _scoped_migration_notice(deploy_results, project_root, package_root, pr
|
|
|
20537
20748
|
}
|
|
20538
20749
|
return [];
|
|
20539
20750
|
}
|
|
20540
|
-
var SETTINGS_SURFACE_REL =
|
|
20541
|
-
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");
|
|
20542
20753
|
function _current_settings_surface(version) {
|
|
20543
20754
|
const jsonSchema = zodToJsonSchema(settingsSchema, {
|
|
20544
20755
|
name: "AgentSettings",
|
|
@@ -20549,20 +20760,20 @@ function _current_settings_surface(version) {
|
|
|
20549
20760
|
}
|
|
20550
20761
|
function _write_settings_surface_snapshot(installed_version) {
|
|
20551
20762
|
const root = event4u_root();
|
|
20552
|
-
const surface_path =
|
|
20553
|
-
const delta_path =
|
|
20763
|
+
const surface_path = path20.join(root, SETTINGS_SURFACE_REL);
|
|
20764
|
+
const delta_path = path20.join(root, SETTINGS_DELTA_REL);
|
|
20554
20765
|
const next = _current_settings_surface(installed_version);
|
|
20555
20766
|
let previous = null;
|
|
20556
20767
|
try {
|
|
20557
|
-
const parsed = JSON.parse(
|
|
20768
|
+
const parsed = JSON.parse(fs23.readFileSync(surface_path, "utf8"));
|
|
20558
20769
|
if (parsed !== null && typeof parsed === "object" && parsed.entries !== void 0) previous = parsed;
|
|
20559
20770
|
} catch {
|
|
20560
20771
|
}
|
|
20561
20772
|
if (previous !== null && previous.version !== next.version) {
|
|
20562
20773
|
const delta = computeSurfaceDelta(previous, next);
|
|
20563
20774
|
if (delta.changes.length > 0) {
|
|
20564
|
-
|
|
20565
|
-
|
|
20775
|
+
fs23.mkdirSync(path20.dirname(delta_path), { recursive: true, mode: 448 });
|
|
20776
|
+
fs23.writeFileSync(delta_path, `${JSON.stringify(delta, null, 2)}
|
|
20566
20777
|
`, { mode: 384 });
|
|
20567
20778
|
if (!state.QUIET) {
|
|
20568
20779
|
const counts = {};
|
|
@@ -20574,8 +20785,8 @@ function _write_settings_surface_snapshot(installed_version) {
|
|
|
20574
20785
|
}
|
|
20575
20786
|
}
|
|
20576
20787
|
}
|
|
20577
|
-
|
|
20578
|
-
|
|
20788
|
+
fs23.mkdirSync(path20.dirname(surface_path), { recursive: true, mode: 448 });
|
|
20789
|
+
fs23.writeFileSync(surface_path, `${JSON.stringify(next, null, 2)}
|
|
20579
20790
|
`, { mode: 384 });
|
|
20580
20791
|
}
|
|
20581
20792
|
function arrayStrEqual(a, b) {
|
|
@@ -20795,13 +21006,13 @@ function _minimal_templates_root() {
|
|
|
20795
21006
|
const chain = [start];
|
|
20796
21007
|
let cur = start;
|
|
20797
21008
|
for (; ; ) {
|
|
20798
|
-
const parent =
|
|
21009
|
+
const parent = path20.dirname(cur);
|
|
20799
21010
|
if (parent === cur) break;
|
|
20800
21011
|
chain.push(parent);
|
|
20801
21012
|
cur = parent;
|
|
20802
21013
|
}
|
|
20803
21014
|
for (const ancestor of chain) {
|
|
20804
|
-
const candidate =
|
|
21015
|
+
const candidate = path20.join(ancestor, "src", "templates", "minimal");
|
|
20805
21016
|
if (isDir(candidate)) return candidate;
|
|
20806
21017
|
}
|
|
20807
21018
|
fail("Could not locate src/templates/minimal/ \u2014 package install is corrupt.");
|
|
@@ -20809,9 +21020,9 @@ function _minimal_templates_root() {
|
|
|
20809
21020
|
var INSTALL_MODE_MARKER_REL = "agents/.agent-state/install-mode.txt";
|
|
20810
21021
|
function _write_install_mode_marker(project_root, mode) {
|
|
20811
21022
|
if (mode !== "minimal" && mode !== "full") return;
|
|
20812
|
-
const marker =
|
|
21023
|
+
const marker = path20.join(project_root, INSTALL_MODE_MARKER_REL);
|
|
20813
21024
|
try {
|
|
20814
|
-
mkdirp(
|
|
21025
|
+
mkdirp(path20.dirname(marker));
|
|
20815
21026
|
writeText(marker, `${mode}
|
|
20816
21027
|
`);
|
|
20817
21028
|
} catch {
|
|
@@ -20820,7 +21031,7 @@ function _write_install_mode_marker(project_root, mode) {
|
|
|
20820
21031
|
function install_minimal(target_root_in, force, user_type = "") {
|
|
20821
21032
|
let target_root = resolvePath(target_root_in);
|
|
20822
21033
|
mkdirp(target_root);
|
|
20823
|
-
const parent =
|
|
21034
|
+
const parent = path20.dirname(target_root);
|
|
20824
21035
|
if (parent !== target_root) {
|
|
20825
21036
|
const existing = find_project_root_with_anchor(parent);
|
|
20826
21037
|
if (existing !== null && existing[0] !== target_root) {
|
|
@@ -20831,21 +21042,21 @@ function install_minimal(target_root_in, force, user_type = "") {
|
|
|
20831
21042
|
}
|
|
20832
21043
|
}
|
|
20833
21044
|
const templates = _minimal_templates_root();
|
|
20834
|
-
const settings_src =
|
|
20835
|
-
const overrides_gitkeep_src =
|
|
20836
|
-
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");
|
|
20837
21048
|
if (!isFile(settings_src)) fail(`Bundled minimal settings template missing under ${templates}`);
|
|
20838
21049
|
if (!isFile(overrides_gitkeep_src) || !isFile(overrides_readme_src)) {
|
|
20839
21050
|
fail(`Bundled overrides scaffold templates missing under ${templates}`);
|
|
20840
21051
|
}
|
|
20841
21052
|
info(`Minimal init \u2192 ${target_root}`);
|
|
20842
|
-
const overrides_root =
|
|
21053
|
+
const overrides_root = path20.join(target_root, "agents", "overrides");
|
|
20843
21054
|
mkdirp(overrides_root);
|
|
20844
21055
|
const gitkeep_body = readText(overrides_gitkeep_src);
|
|
20845
21056
|
for (const sub of ["rules", "skills", "commands"]) {
|
|
20846
|
-
const sub_dir =
|
|
21057
|
+
const sub_dir = path20.join(overrides_root, sub);
|
|
20847
21058
|
mkdirp(sub_dir);
|
|
20848
|
-
const gitkeep_dst =
|
|
21059
|
+
const gitkeep_dst = path20.join(sub_dir, ".gitkeep");
|
|
20849
21060
|
if (pathExists(gitkeep_dst) && !force) {
|
|
20850
21061
|
skip(`agents/overrides/${sub}/.gitkeep already exists (use --force to overwrite)`);
|
|
20851
21062
|
} else {
|
|
@@ -20853,7 +21064,7 @@ function install_minimal(target_root_in, force, user_type = "") {
|
|
|
20853
21064
|
success(`Wrote agents/overrides/${sub}/.gitkeep`);
|
|
20854
21065
|
}
|
|
20855
21066
|
}
|
|
20856
|
-
const readme_dst =
|
|
21067
|
+
const readme_dst = path20.join(overrides_root, "README.md");
|
|
20857
21068
|
if (pathExists(readme_dst) && !force) {
|
|
20858
21069
|
skip("agents/overrides/README.md already exists (use --force to overwrite)");
|
|
20859
21070
|
} else {
|
|
@@ -20871,14 +21082,14 @@ function install_minimal(target_root_in, force, user_type = "") {
|
|
|
20871
21082
|
personal:
|
|
20872
21083
|
user_type: ${user_type}
|
|
20873
21084
|
`;
|
|
20874
|
-
mkdirp(
|
|
21085
|
+
mkdirp(path20.dirname(settings_dst));
|
|
20875
21086
|
writeText(settings_dst, body);
|
|
20876
21087
|
success(`Wrote ${SETTINGS_FILE} (user_type=${user_type})`);
|
|
20877
21088
|
}
|
|
20878
21089
|
}
|
|
20879
21090
|
const removed_marker = _remove_legacy_consumer_bridge_marker(target_root);
|
|
20880
21091
|
if (removed_marker !== null) {
|
|
20881
|
-
const rel = isRelativeTo(removed_marker, target_root) ?
|
|
21092
|
+
const rel = isRelativeTo(removed_marker, target_root) ? path20.relative(target_root, removed_marker) : removed_marker;
|
|
20882
21093
|
success(`Removed legacy bridge marker: ${rel}`);
|
|
20883
21094
|
}
|
|
20884
21095
|
_write_install_mode_marker(target_root, "minimal");
|
|
@@ -20952,7 +21163,7 @@ function run_interactive_init(project_root, force) {
|
|
|
20952
21163
|
);
|
|
20953
21164
|
return 0;
|
|
20954
21165
|
}
|
|
20955
|
-
const target =
|
|
21166
|
+
const target = path20.join(project_root, _LOCAL_CONFIG_FILE);
|
|
20956
21167
|
if (pathExists(target) && !force) {
|
|
20957
21168
|
warn(
|
|
20958
21169
|
`${_LOCAL_CONFIG_FILE} already exists; re-run with --force to overwrite. Skipping interactive init.`
|
|
@@ -20979,7 +21190,7 @@ function run_interactive_init(project_root, force) {
|
|
|
20979
21190
|
warn(`Could not write ${target}: ${String(exc)}`);
|
|
20980
21191
|
return 1;
|
|
20981
21192
|
}
|
|
20982
|
-
success(`Wrote ${
|
|
21193
|
+
success(`Wrote ${path20.relative(project_root, target)} (${user_type} / ${stack} / ${verbosity})`);
|
|
20983
21194
|
return 0;
|
|
20984
21195
|
}
|
|
20985
21196
|
var _WIZARD_READY_RE = /^WIZARD_READY (http:\/\/(?:127\.0\.0\.1|localhost):\d+\/\S*)\r?$/;
|
|
@@ -20997,12 +21208,12 @@ function _wizard_should_launch(opts) {
|
|
|
20997
21208
|
return [true, ""];
|
|
20998
21209
|
}
|
|
20999
21210
|
function _wizard_cli_dist(_project_root) {
|
|
21000
|
-
const package_root =
|
|
21001
|
-
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");
|
|
21002
21213
|
return pathExists(cli) ? cli : null;
|
|
21003
21214
|
}
|
|
21004
21215
|
function _server_info_path() {
|
|
21005
|
-
return
|
|
21216
|
+
return path20.join(os8.homedir(), ".event4u", "agent-config", "local-server.json");
|
|
21006
21217
|
}
|
|
21007
21218
|
function _pid_is_agent_config(pid) {
|
|
21008
21219
|
let res;
|
|
@@ -21019,7 +21230,7 @@ function _pid_is_agent_config(pid) {
|
|
|
21019
21230
|
}
|
|
21020
21231
|
function unlinkMissingOk(p) {
|
|
21021
21232
|
try {
|
|
21022
|
-
|
|
21233
|
+
fs23.unlinkSync(p);
|
|
21023
21234
|
} catch {
|
|
21024
21235
|
}
|
|
21025
21236
|
}
|
|
@@ -21097,14 +21308,14 @@ function _wizard_spawn(project_root, pass_project_root = true) {
|
|
|
21097
21308
|
}
|
|
21098
21309
|
function _wizard_run_sync(cmd, env, cli) {
|
|
21099
21310
|
const total = _WIZARD_TIMEOUTS.reduce((a, b) => a + b, 0);
|
|
21100
|
-
const log_path =
|
|
21311
|
+
const log_path = path20.join(
|
|
21101
21312
|
os8.tmpdir(),
|
|
21102
21313
|
`agent-config-wizard-${process3.pid}-${Date.now()}.log`
|
|
21103
21314
|
);
|
|
21104
21315
|
let child;
|
|
21105
21316
|
let log_fd = null;
|
|
21106
21317
|
try {
|
|
21107
|
-
log_fd =
|
|
21318
|
+
log_fd = fs23.openSync(log_path, "w");
|
|
21108
21319
|
child = spawn(cmd[0], cmd.slice(1), {
|
|
21109
21320
|
env,
|
|
21110
21321
|
detached: true,
|
|
@@ -21122,7 +21333,7 @@ function _wizard_run_sync(cmd, env, cli) {
|
|
|
21122
21333
|
} finally {
|
|
21123
21334
|
if (log_fd !== null) {
|
|
21124
21335
|
try {
|
|
21125
|
-
|
|
21336
|
+
fs23.closeSync(log_fd);
|
|
21126
21337
|
} catch {
|
|
21127
21338
|
}
|
|
21128
21339
|
}
|
|
@@ -21372,8 +21583,8 @@ function main2(argv) {
|
|
|
21372
21583
|
const target_root = resolvePath(
|
|
21373
21584
|
opts.custom_path || opts.project || process3.env["PROJECT_ROOT"] || process3.cwd()
|
|
21374
21585
|
);
|
|
21375
|
-
const minimal_package_root =
|
|
21376
|
-
|
|
21586
|
+
const minimal_package_root = path20.dirname(
|
|
21587
|
+
path20.dirname(path20.dirname(_minimal_templates_root()))
|
|
21377
21588
|
);
|
|
21378
21589
|
const validated_user_type = _validate_user_type(minimal_package_root, opts.user_type);
|
|
21379
21590
|
return install_minimal(target_root, opts.force, validated_user_type);
|
|
@@ -21405,7 +21616,7 @@ function main2(argv) {
|
|
|
21405
21616
|
return rc2;
|
|
21406
21617
|
}
|
|
21407
21618
|
const project_root = custom_path || resolvePath(opts.project || process3.env["PROJECT_ROOT"] || process3.cwd());
|
|
21408
|
-
const is_first_run = !pathExists(
|
|
21619
|
+
const is_first_run = !pathExists(path20.join(project_root, SETTINGS_FILE));
|
|
21409
21620
|
const rc = _main_project_install(opts, project_root, parsed_tools, is_first_run);
|
|
21410
21621
|
if (rc === 0 && opts.interactive) {
|
|
21411
21622
|
run_interactive_init(project_root, opts.force);
|
|
@@ -21469,16 +21680,16 @@ function _team_setup_hint_line(project_root) {
|
|
|
21469
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.";
|
|
21470
21681
|
}
|
|
21471
21682
|
function finalize_claude_model_tiers(project_root) {
|
|
21472
|
-
const claude_skills =
|
|
21473
|
-
const augment_skills =
|
|
21683
|
+
const claude_skills = path20.join(project_root, ".claude", "skills");
|
|
21684
|
+
const augment_skills = path20.join(project_root, ".augment", "skills");
|
|
21474
21685
|
if (!isDir(claude_skills) || !isDir(augment_skills)) return 0;
|
|
21475
21686
|
if (_read_consumer_auto_switch(project_root) !== "auto") return 0;
|
|
21476
21687
|
let rendered = 0;
|
|
21477
|
-
const entries =
|
|
21688
|
+
const entries = fs23.readdirSync(claude_skills).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
21478
21689
|
for (const name of entries) {
|
|
21479
|
-
const entry =
|
|
21480
|
-
const src_dir =
|
|
21481
|
-
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");
|
|
21482
21693
|
let tier;
|
|
21483
21694
|
try {
|
|
21484
21695
|
tier = read_model_tier(src_md);
|
|
@@ -21487,22 +21698,22 @@ function finalize_claude_model_tiers(project_root) {
|
|
|
21487
21698
|
}
|
|
21488
21699
|
if (tier === null || !(tier in TIER_TO_CLAUDE_MODEL) || !isDir(src_dir)) continue;
|
|
21489
21700
|
if (isSymlink(entry) || isFile(entry)) {
|
|
21490
|
-
|
|
21701
|
+
fs23.unlinkSync(entry);
|
|
21491
21702
|
} else if (isDir(entry)) {
|
|
21492
|
-
|
|
21703
|
+
fs23.rmSync(entry, { recursive: true, force: true });
|
|
21493
21704
|
}
|
|
21494
21705
|
mkdirp(entry);
|
|
21495
|
-
const srcFiles =
|
|
21706
|
+
const srcFiles = fs23.readdirSync(src_dir).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
21496
21707
|
for (const fname of srcFiles) {
|
|
21497
21708
|
if (fname === "SKILL.md") {
|
|
21498
21709
|
writeText(
|
|
21499
|
-
|
|
21710
|
+
path20.join(entry, "SKILL.md"),
|
|
21500
21711
|
render_native_model_md(readText(src_md), tier)
|
|
21501
21712
|
);
|
|
21502
21713
|
} else {
|
|
21503
|
-
|
|
21504
|
-
|
|
21505
|
-
|
|
21714
|
+
fs23.symlinkSync(
|
|
21715
|
+
path20.join("../../../.augment/skills", name, fname),
|
|
21716
|
+
path20.join(entry, fname)
|
|
21506
21717
|
);
|
|
21507
21718
|
}
|
|
21508
21719
|
}
|
|
@@ -21520,7 +21731,7 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
|
|
|
21520
21731
|
let package_type;
|
|
21521
21732
|
if (opts.package) {
|
|
21522
21733
|
package_root = resolvePath(opts.package);
|
|
21523
|
-
if (!pathExists(
|
|
21734
|
+
if (!pathExists(path20.join(package_root, "src", "config", "profiles", "minimal.ini"))) {
|
|
21524
21735
|
fail(`Invalid --package path (missing src/config/profiles/minimal.ini): ${package_root}`);
|
|
21525
21736
|
}
|
|
21526
21737
|
package_type = detect_package_type_for_project(project_root, package_root);
|
|
@@ -21664,9 +21875,9 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
|
|
|
21664
21875
|
function _resolvedArgv1() {
|
|
21665
21876
|
if (process3.argv[1] === void 0) return void 0;
|
|
21666
21877
|
try {
|
|
21667
|
-
return
|
|
21878
|
+
return fs23.realpathSync(path20.resolve(process3.argv[1]));
|
|
21668
21879
|
} catch {
|
|
21669
|
-
return
|
|
21880
|
+
return path20.resolve(process3.argv[1]);
|
|
21670
21881
|
}
|
|
21671
21882
|
}
|
|
21672
21883
|
var _argv1 = _resolvedArgv1();
|