xtrm-tools 0.5.25 → 0.5.27

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.
Files changed (261) hide show
  1. package/.claude-plugin/marketplace.json +19 -0
  2. package/.claude-plugin/plugin.json +9 -0
  3. package/CHANGELOG.md +4 -0
  4. package/README.md +7 -1
  5. package/cli/dist/index.cjs +319 -355
  6. package/cli/dist/index.cjs.map +1 -1
  7. package/cli/package.json +1 -1
  8. package/config/hooks.json +11 -10
  9. package/config/pi/extensions/beads/index.ts +103 -77
  10. package/config/pi/extensions/custom-footer/index.ts +40 -7
  11. package/config/pi/extensions/quality-gates/index.ts +28 -29
  12. package/config/pi/extensions/session-flow/index.ts +50 -21
  13. package/config/pi/extensions/xtrm-loader/index.ts +38 -24
  14. package/hooks/beads-claim-sync.mjs +1 -3
  15. package/hooks/hooks.json +14 -0
  16. package/package.json +5 -1
  17. package/plugins/xtrm-tools/.claude-plugin/plugin.json +9 -0
  18. package/plugins/xtrm-tools/.mcp.json +18 -0
  19. package/plugins/xtrm-tools/hooks/README.md +61 -0
  20. package/plugins/xtrm-tools/hooks/beads-claim-sync.mjs +223 -0
  21. package/plugins/xtrm-tools/hooks/beads-commit-gate.mjs +70 -0
  22. package/plugins/xtrm-tools/hooks/beads-compact-restore.mjs +69 -0
  23. package/plugins/xtrm-tools/hooks/beads-compact-save.mjs +51 -0
  24. package/plugins/xtrm-tools/hooks/beads-edit-gate.mjs +85 -0
  25. package/plugins/xtrm-tools/hooks/beads-gate-core.mjs +236 -0
  26. package/plugins/xtrm-tools/hooks/beads-gate-messages.mjs +68 -0
  27. package/plugins/xtrm-tools/hooks/beads-gate-utils.mjs +194 -0
  28. package/plugins/xtrm-tools/hooks/beads-memory-gate.mjs +81 -0
  29. package/plugins/xtrm-tools/hooks/beads-stop-gate.mjs +53 -0
  30. package/plugins/xtrm-tools/hooks/gitnexus/gitnexus-hook.cjs +222 -0
  31. package/plugins/xtrm-tools/hooks/hooks.json +129 -0
  32. package/plugins/xtrm-tools/hooks/quality-check-env.mjs +79 -0
  33. package/plugins/xtrm-tools/hooks/quality-check.cjs +1286 -0
  34. package/plugins/xtrm-tools/hooks/quality-check.py +345 -0
  35. package/plugins/xtrm-tools/hooks/statusline.mjs +145 -0
  36. package/plugins/xtrm-tools/hooks/using-xtrm-reminder.mjs +35 -0
  37. package/plugins/xtrm-tools/hooks/worktree-boundary.mjs +33 -0
  38. package/plugins/xtrm-tools/hooks/xtrm-logger.mjs +123 -0
  39. package/plugins/xtrm-tools/hooks/xtrm-session-logger.mjs +27 -0
  40. package/plugins/xtrm-tools/hooks/xtrm-tool-logger.mjs +53 -0
  41. package/plugins/xtrm-tools/skills/README.txt +31 -0
  42. package/plugins/xtrm-tools/skills/clean-code/SKILL.md +201 -0
  43. package/plugins/xtrm-tools/skills/creating-service-skills/SKILL.md +433 -0
  44. package/plugins/xtrm-tools/skills/creating-service-skills/references/script_quality_standards.md +425 -0
  45. package/plugins/xtrm-tools/skills/creating-service-skills/references/service_skill_system_guide.md +278 -0
  46. package/plugins/xtrm-tools/skills/creating-service-skills/scripts/bootstrap.py +326 -0
  47. package/plugins/xtrm-tools/skills/creating-service-skills/scripts/deep_dive.py +304 -0
  48. package/plugins/xtrm-tools/skills/creating-service-skills/scripts/scaffolder.py +482 -0
  49. package/plugins/xtrm-tools/skills/delegating/SKILL.md +196 -0
  50. package/plugins/xtrm-tools/skills/delegating/config.yaml +210 -0
  51. package/plugins/xtrm-tools/skills/delegating/references/orchestration-protocols.md +41 -0
  52. package/plugins/xtrm-tools/skills/docker-expert/SKILL.md +409 -0
  53. package/plugins/xtrm-tools/skills/documenting/CHANGELOG.md +23 -0
  54. package/plugins/xtrm-tools/skills/documenting/README.md +148 -0
  55. package/plugins/xtrm-tools/skills/documenting/SKILL.md +113 -0
  56. package/plugins/xtrm-tools/skills/documenting/examples/example_pattern.md +70 -0
  57. package/plugins/xtrm-tools/skills/documenting/examples/example_reference.md +70 -0
  58. package/plugins/xtrm-tools/skills/documenting/examples/example_ssot_analytics.md +64 -0
  59. package/plugins/xtrm-tools/skills/documenting/examples/example_workflow.md +141 -0
  60. package/plugins/xtrm-tools/skills/documenting/references/changelog-format.md +97 -0
  61. package/plugins/xtrm-tools/skills/documenting/references/metadata-schema.md +136 -0
  62. package/plugins/xtrm-tools/skills/documenting/references/taxonomy.md +81 -0
  63. package/plugins/xtrm-tools/skills/documenting/references/versioning-rules.md +78 -0
  64. package/plugins/xtrm-tools/skills/documenting/scripts/bump_version.sh +60 -0
  65. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/__init__.py +0 -0
  66. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/add_entry.py +216 -0
  67. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/bump_release.py +117 -0
  68. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/init_changelog.py +54 -0
  69. package/plugins/xtrm-tools/skills/documenting/scripts/changelog/validate_changelog.py +128 -0
  70. package/plugins/xtrm-tools/skills/documenting/scripts/drift_detector.py +266 -0
  71. package/plugins/xtrm-tools/skills/documenting/scripts/generate_template.py +311 -0
  72. package/plugins/xtrm-tools/skills/documenting/scripts/list_by_category.sh +84 -0
  73. package/plugins/xtrm-tools/skills/documenting/scripts/orchestrator.py +255 -0
  74. package/plugins/xtrm-tools/skills/documenting/scripts/validate_metadata.py +242 -0
  75. package/plugins/xtrm-tools/skills/documenting/templates/CHANGELOG.md.template +13 -0
  76. package/plugins/xtrm-tools/skills/documenting/tests/integration_test.sh +70 -0
  77. package/plugins/xtrm-tools/skills/documenting/tests/test_changelog.py +201 -0
  78. package/plugins/xtrm-tools/skills/documenting/tests/test_drift_detector.py +80 -0
  79. package/plugins/xtrm-tools/skills/documenting/tests/test_orchestrator.py +52 -0
  80. package/plugins/xtrm-tools/skills/documenting/tests/test_validate_metadata.py +64 -0
  81. package/plugins/xtrm-tools/skills/find-skills/SKILL.md +133 -0
  82. package/plugins/xtrm-tools/skills/gitnexus-debugging/SKILL.md +85 -0
  83. package/plugins/xtrm-tools/skills/gitnexus-exploring/SKILL.md +75 -0
  84. package/plugins/xtrm-tools/skills/gitnexus-impact-analysis/SKILL.md +94 -0
  85. package/plugins/xtrm-tools/skills/gitnexus-refactoring/SKILL.md +113 -0
  86. package/plugins/xtrm-tools/skills/hook-development/SKILL.md +797 -0
  87. package/plugins/xtrm-tools/skills/hook-development/examples/load-context.sh +55 -0
  88. package/plugins/xtrm-tools/skills/hook-development/examples/quality-check.js +1168 -0
  89. package/plugins/xtrm-tools/skills/hook-development/examples/validate-bash.sh +43 -0
  90. package/plugins/xtrm-tools/skills/hook-development/examples/validate-write.sh +38 -0
  91. package/plugins/xtrm-tools/skills/hook-development/references/advanced.md +527 -0
  92. package/plugins/xtrm-tools/skills/hook-development/references/migration.md +369 -0
  93. package/plugins/xtrm-tools/skills/hook-development/references/patterns.md +412 -0
  94. package/plugins/xtrm-tools/skills/hook-development/scripts/README.md +164 -0
  95. package/plugins/xtrm-tools/skills/hook-development/scripts/hook-linter.sh +153 -0
  96. package/plugins/xtrm-tools/skills/hook-development/scripts/test-hook.sh +252 -0
  97. package/plugins/xtrm-tools/skills/hook-development/scripts/validate-hook-schema.sh +159 -0
  98. package/plugins/xtrm-tools/skills/obsidian-cli/SKILL.md +106 -0
  99. package/plugins/xtrm-tools/skills/orchestrating-agents/SKILL.md +135 -0
  100. package/plugins/xtrm-tools/skills/orchestrating-agents/config.yaml +45 -0
  101. package/plugins/xtrm-tools/skills/orchestrating-agents/references/agent-context-integration.md +37 -0
  102. package/plugins/xtrm-tools/skills/orchestrating-agents/references/examples.md +45 -0
  103. package/plugins/xtrm-tools/skills/orchestrating-agents/references/handover-protocol.md +31 -0
  104. package/plugins/xtrm-tools/skills/orchestrating-agents/references/workflows.md +42 -0
  105. package/plugins/xtrm-tools/skills/orchestrating-agents/scripts/detect_neighbors.py +23 -0
  106. package/plugins/xtrm-tools/skills/prompt-improving/README.md +162 -0
  107. package/plugins/xtrm-tools/skills/prompt-improving/SKILL.md +74 -0
  108. package/plugins/xtrm-tools/skills/prompt-improving/references/analysis_commands.md +24 -0
  109. package/plugins/xtrm-tools/skills/prompt-improving/references/chain_of_thought.md +24 -0
  110. package/plugins/xtrm-tools/skills/prompt-improving/references/mcp_definitions.md +20 -0
  111. package/plugins/xtrm-tools/skills/prompt-improving/references/multishot.md +23 -0
  112. package/plugins/xtrm-tools/skills/prompt-improving/references/xml_core.md +60 -0
  113. package/plugins/xtrm-tools/skills/python-testing/SKILL.md +815 -0
  114. package/plugins/xtrm-tools/skills/scoping-service-skills/SKILL.md +231 -0
  115. package/plugins/xtrm-tools/skills/scoping-service-skills/scripts/scope.py +74 -0
  116. package/plugins/xtrm-tools/skills/senior-backend/SKILL.md +209 -0
  117. package/plugins/xtrm-tools/skills/senior-backend/references/api_design_patterns.md +103 -0
  118. package/plugins/xtrm-tools/skills/senior-backend/references/backend_security_practices.md +103 -0
  119. package/plugins/xtrm-tools/skills/senior-backend/references/database_optimization_guide.md +103 -0
  120. package/plugins/xtrm-tools/skills/senior-backend/scripts/api_load_tester.py +114 -0
  121. package/plugins/xtrm-tools/skills/senior-backend/scripts/api_scaffolder.py +114 -0
  122. package/plugins/xtrm-tools/skills/senior-backend/scripts/database_migration_tool.py +114 -0
  123. package/plugins/xtrm-tools/skills/senior-data-scientist/SKILL.md +226 -0
  124. package/plugins/xtrm-tools/skills/senior-data-scientist/references/experiment_design_frameworks.md +80 -0
  125. package/plugins/xtrm-tools/skills/senior-data-scientist/references/feature_engineering_patterns.md +80 -0
  126. package/plugins/xtrm-tools/skills/senior-data-scientist/references/statistical_methods_advanced.md +80 -0
  127. package/plugins/xtrm-tools/skills/senior-data-scientist/scripts/experiment_designer.py +100 -0
  128. package/plugins/xtrm-tools/skills/senior-data-scientist/scripts/feature_engineering_pipeline.py +100 -0
  129. package/plugins/xtrm-tools/skills/senior-data-scientist/scripts/model_evaluation_suite.py +100 -0
  130. package/plugins/xtrm-tools/skills/senior-devops/SKILL.md +209 -0
  131. package/plugins/xtrm-tools/skills/senior-devops/references/cicd_pipeline_guide.md +103 -0
  132. package/plugins/xtrm-tools/skills/senior-devops/references/deployment_strategies.md +103 -0
  133. package/plugins/xtrm-tools/skills/senior-devops/references/infrastructure_as_code.md +103 -0
  134. package/plugins/xtrm-tools/skills/senior-devops/scripts/deployment_manager.py +114 -0
  135. package/plugins/xtrm-tools/skills/senior-devops/scripts/pipeline_generator.py +114 -0
  136. package/plugins/xtrm-tools/skills/senior-devops/scripts/terraform_scaffolder.py +114 -0
  137. package/plugins/xtrm-tools/skills/senior-security/SKILL.md +209 -0
  138. package/plugins/xtrm-tools/skills/senior-security/references/cryptography_implementation.md +103 -0
  139. package/plugins/xtrm-tools/skills/senior-security/references/penetration_testing_guide.md +103 -0
  140. package/plugins/xtrm-tools/skills/senior-security/references/security_architecture_patterns.md +103 -0
  141. package/plugins/xtrm-tools/skills/senior-security/scripts/pentest_automator.py +114 -0
  142. package/plugins/xtrm-tools/skills/senior-security/scripts/security_auditor.py +114 -0
  143. package/plugins/xtrm-tools/skills/senior-security/scripts/threat_modeler.py +114 -0
  144. package/plugins/xtrm-tools/skills/skill-creator/LICENSE.txt +202 -0
  145. package/plugins/xtrm-tools/skills/skill-creator/SKILL.md +479 -0
  146. package/plugins/xtrm-tools/skills/skill-creator/agents/analyzer.md +274 -0
  147. package/plugins/xtrm-tools/skills/skill-creator/agents/comparator.md +202 -0
  148. package/plugins/xtrm-tools/skills/skill-creator/agents/grader.md +223 -0
  149. package/plugins/xtrm-tools/skills/skill-creator/assets/eval_review.html +146 -0
  150. package/plugins/xtrm-tools/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  151. package/plugins/xtrm-tools/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  152. package/plugins/xtrm-tools/skills/skill-creator/references/schemas.md +430 -0
  153. package/plugins/xtrm-tools/skills/skill-creator/scripts/__init__.py +0 -0
  154. package/plugins/xtrm-tools/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  155. package/plugins/xtrm-tools/skills/skill-creator/scripts/generate_report.py +326 -0
  156. package/plugins/xtrm-tools/skills/skill-creator/scripts/improve_description.py +248 -0
  157. package/plugins/xtrm-tools/skills/skill-creator/scripts/package_skill.py +136 -0
  158. package/plugins/xtrm-tools/skills/skill-creator/scripts/quick_validate.py +103 -0
  159. package/plugins/xtrm-tools/skills/skill-creator/scripts/run_eval.py +310 -0
  160. package/plugins/xtrm-tools/skills/skill-creator/scripts/run_loop.py +332 -0
  161. package/plugins/xtrm-tools/skills/skill-creator/scripts/utils.py +47 -0
  162. package/plugins/xtrm-tools/skills/sync-docs/SKILL.md +155 -0
  163. package/plugins/xtrm-tools/skills/sync-docs/evals/evals.json +89 -0
  164. package/plugins/xtrm-tools/skills/sync-docs/references/doc-structure.md +99 -0
  165. package/plugins/xtrm-tools/skills/sync-docs/references/schema.md +103 -0
  166. package/plugins/xtrm-tools/skills/sync-docs/scripts/changelog/add_entry.py +216 -0
  167. package/plugins/xtrm-tools/skills/sync-docs/scripts/context_gatherer.py +240 -0
  168. package/plugins/xtrm-tools/skills/sync-docs/scripts/doc_structure_analyzer.py +495 -0
  169. package/plugins/xtrm-tools/skills/sync-docs/scripts/drift_detector.py +563 -0
  170. package/plugins/xtrm-tools/skills/sync-docs/scripts/validate_doc.py +365 -0
  171. package/plugins/xtrm-tools/skills/sync-docs/scripts/validate_metadata.py +185 -0
  172. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/benchmark.json +293 -0
  173. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/benchmark.md +13 -0
  174. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/eval_metadata.json +27 -0
  175. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/outputs/result.md +210 -0
  176. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/run-1/grading.json +28 -0
  177. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/with_skill/run-1/timing.json +1 -0
  178. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/outputs/result.md +101 -0
  179. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/run-1/grading.json +28 -0
  180. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/run-1/timing.json +5 -0
  181. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-doc-audit/without_skill/timing.json +5 -0
  182. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/eval_metadata.json +27 -0
  183. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/outputs/result.md +198 -0
  184. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/run-1/grading.json +28 -0
  185. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/with_skill/run-1/timing.json +1 -0
  186. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/outputs/result.md +94 -0
  187. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/run-1/grading.json +28 -0
  188. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-fix-mode/without_skill/run-1/timing.json +1 -0
  189. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/eval_metadata.json +27 -0
  190. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/outputs/result.md +237 -0
  191. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/run-1/grading.json +28 -0
  192. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/with_skill/run-1/timing.json +1 -0
  193. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/outputs/result.md +134 -0
  194. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/run-1/grading.json +28 -0
  195. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-1/eval-sprint-closeout/without_skill/run-1/timing.json +1 -0
  196. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/benchmark.json +297 -0
  197. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/benchmark.md +13 -0
  198. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/eval_metadata.json +27 -0
  199. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/outputs/result.md +137 -0
  200. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/run-1/grading.json +92 -0
  201. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/with_skill/run-1/timing.json +1 -0
  202. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/outputs/result.md +134 -0
  203. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/run-1/grading.json +86 -0
  204. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-doc-audit/without_skill/run-1/timing.json +1 -0
  205. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/eval_metadata.json +27 -0
  206. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/outputs/result.md +193 -0
  207. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/run-1/grading.json +72 -0
  208. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/with_skill/run-1/timing.json +1 -0
  209. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/outputs/result.md +211 -0
  210. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/run-1/grading.json +91 -0
  211. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-fix-mode/without_skill/run-1/timing.json +5 -0
  212. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/eval_metadata.json +27 -0
  213. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/outputs/result.md +182 -0
  214. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/run-1/grading.json +95 -0
  215. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/with_skill/run-1/timing.json +1 -0
  216. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/outputs/result.md +222 -0
  217. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/run-1/grading.json +88 -0
  218. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-2/eval-sprint-closeout/without_skill/run-1/timing.json +5 -0
  219. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/benchmark.json +298 -0
  220. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/benchmark.md +13 -0
  221. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/eval_metadata.json +27 -0
  222. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/outputs/result.md +125 -0
  223. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/run-1/grading.json +97 -0
  224. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/with_skill/run-1/timing.json +5 -0
  225. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/outputs/result.md +144 -0
  226. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/run-1/grading.json +78 -0
  227. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-doc-audit/without_skill/run-1/timing.json +5 -0
  228. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/eval_metadata.json +27 -0
  229. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/outputs/result.md +104 -0
  230. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/run-1/grading.json +91 -0
  231. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/with_skill/run-1/timing.json +5 -0
  232. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/outputs/result.md +79 -0
  233. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/run-1/grading.json +82 -0
  234. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-fix-mode/without_skill/run-1/timing.json +5 -0
  235. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/eval_metadata.json +27 -0
  236. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase1_context.json +302 -0
  237. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase2_drift.txt +33 -0
  238. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase3_analysis.json +114 -0
  239. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase4_fix.txt +118 -0
  240. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/phase5_validate.txt +38 -0
  241. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/outputs/result.md +158 -0
  242. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/run-1/grading.json +95 -0
  243. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/with_skill/run-1/timing.json +5 -0
  244. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/outputs/result.md +71 -0
  245. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/run-1/grading.json +90 -0
  246. package/plugins/xtrm-tools/skills/sync-docs-workspace/iteration-3/eval-sprint-closeout/without_skill/run-1/timing.json +5 -0
  247. package/plugins/xtrm-tools/skills/test-planning/SKILL.md +208 -0
  248. package/plugins/xtrm-tools/skills/test-planning/evals/evals.json +23 -0
  249. package/plugins/xtrm-tools/skills/updating-service-skills/SKILL.md +136 -0
  250. package/plugins/xtrm-tools/skills/updating-service-skills/scripts/drift_detector.py +222 -0
  251. package/plugins/xtrm-tools/skills/using-TDD/SKILL.md +410 -0
  252. package/plugins/xtrm-tools/skills/using-quality-gates/SKILL.md +254 -0
  253. package/plugins/xtrm-tools/skills/using-serena-lsp/README.md +8 -0
  254. package/plugins/xtrm-tools/skills/using-serena-lsp/REFERENCE.md +194 -0
  255. package/plugins/xtrm-tools/skills/using-serena-lsp/SKILL.md +82 -0
  256. package/plugins/xtrm-tools/skills/using-service-skills/SKILL.md +108 -0
  257. package/plugins/xtrm-tools/skills/using-service-skills/scripts/cataloger.py +74 -0
  258. package/plugins/xtrm-tools/skills/using-service-skills/scripts/skill_activator.py +152 -0
  259. package/plugins/xtrm-tools/skills/using-service-skills/scripts/test_skill_activator.py +58 -0
  260. package/plugins/xtrm-tools/skills/using-xtrm/SKILL.md +124 -0
  261. package/plugins/xtrm-tools/skills/xt-end/SKILL.md +128 -0
@@ -27021,19 +27021,19 @@ var require_esprima = __commonJS({
27021
27021
  }
27022
27022
  return error49;
27023
27023
  };
27024
- ErrorHandler2.prototype.createError = function(index, line, col2, description) {
27024
+ ErrorHandler2.prototype.createError = function(index, line, col, description) {
27025
27025
  var msg = "Line " + line + ": " + description;
27026
- var error49 = this.constructError(msg, col2);
27026
+ var error49 = this.constructError(msg, col);
27027
27027
  error49.index = index;
27028
27028
  error49.lineNumber = line;
27029
27029
  error49.description = description;
27030
27030
  return error49;
27031
27031
  };
27032
- ErrorHandler2.prototype.throwError = function(index, line, col2, description) {
27033
- throw this.createError(index, line, col2, description);
27032
+ ErrorHandler2.prototype.throwError = function(index, line, col, description) {
27033
+ throw this.createError(index, line, col, description);
27034
27034
  };
27035
- ErrorHandler2.prototype.tolerateError = function(index, line, col2, description) {
27036
- var error49 = this.createError(index, line, col2, description);
27035
+ ErrorHandler2.prototype.tolerateError = function(index, line, col, description) {
27036
+ var error49 = this.createError(index, line, col, description);
27037
27037
  if (this.tolerant) {
27038
27038
  this.recordError(error49);
27039
27039
  } else {
@@ -32847,19 +32847,19 @@ var require_layout_manager = __commonJS({
32847
32847
  var Cell = require_cell();
32848
32848
  var { ColSpanCell, RowSpanCell } = Cell;
32849
32849
  (function() {
32850
- function next(alloc, col2) {
32851
- if (alloc[col2] > 0) {
32852
- return next(alloc, col2 + 1);
32850
+ function next(alloc, col) {
32851
+ if (alloc[col] > 0) {
32852
+ return next(alloc, col + 1);
32853
32853
  }
32854
- return col2;
32854
+ return col;
32855
32855
  }
32856
32856
  function layoutTable(table) {
32857
32857
  let alloc = {};
32858
32858
  table.forEach(function(row, rowIndex) {
32859
- let col2 = 0;
32859
+ let col = 0;
32860
32860
  row.forEach(function(cell) {
32861
32861
  cell.y = rowIndex;
32862
- cell.x = rowIndex ? next(alloc, col2) : col2;
32862
+ cell.x = rowIndex ? next(alloc, col) : col;
32863
32863
  const rowSpan = cell.rowSpan || 1;
32864
32864
  const colSpan = cell.colSpan || 1;
32865
32865
  if (rowSpan > 1) {
@@ -32867,7 +32867,7 @@ var require_layout_manager = __commonJS({
32867
32867
  alloc[cell.x + cs] = rowSpan;
32868
32868
  }
32869
32869
  }
32870
- col2 = cell.x + colSpan;
32870
+ col = cell.x + colSpan;
32871
32871
  });
32872
32872
  Object.keys(alloc).forEach((idx) => {
32873
32873
  alloc[idx]--;
@@ -33039,29 +33039,29 @@ var require_layout_manager = __commonJS({
33039
33039
  for (let k = spanners.length - 1; k >= 0; k--) {
33040
33040
  let cell = spanners[k];
33041
33041
  let span = cell[colSpan];
33042
- let col2 = cell[x];
33043
- let existingWidth = result[col2];
33044
- let editableCols = typeof vals[col2] === "number" ? 0 : 1;
33042
+ let col = cell[x];
33043
+ let existingWidth = result[col];
33044
+ let editableCols = typeof vals[col] === "number" ? 0 : 1;
33045
33045
  if (typeof existingWidth === "number") {
33046
33046
  for (let i = 1; i < span; i++) {
33047
- existingWidth += 1 + result[col2 + i];
33048
- if (typeof vals[col2 + i] !== "number") {
33047
+ existingWidth += 1 + result[col + i];
33048
+ if (typeof vals[col + i] !== "number") {
33049
33049
  editableCols++;
33050
33050
  }
33051
33051
  }
33052
33052
  } else {
33053
33053
  existingWidth = desiredWidth === "desiredWidth" ? cell.desiredWidth - 1 : 1;
33054
- if (!auto[col2] || auto[col2] < existingWidth) {
33055
- auto[col2] = existingWidth;
33054
+ if (!auto[col] || auto[col] < existingWidth) {
33055
+ auto[col] = existingWidth;
33056
33056
  }
33057
33057
  }
33058
33058
  if (cell[desiredWidth] > existingWidth) {
33059
33059
  let i = 0;
33060
33060
  while (editableCols > 0 && cell[desiredWidth] > existingWidth) {
33061
- if (typeof vals[col2 + i] !== "number") {
33061
+ if (typeof vals[col + i] !== "number") {
33062
33062
  let dif = Math.round((cell[desiredWidth] - existingWidth) / editableCols);
33063
33063
  existingWidth += dif;
33064
- result[col2 + i] += dif;
33064
+ result[col + i] += dif;
33065
33065
  editableCols--;
33066
33066
  }
33067
33067
  i++;
@@ -35746,7 +35746,7 @@ var Listr = class {
35746
35746
  };
35747
35747
 
35748
35748
  // src/commands/install.ts
35749
- var import_fs_extra11 = __toESM(require_lib2(), 1);
35749
+ var import_fs_extra12 = __toESM(require_lib2(), 1);
35750
35750
  var import_os5 = __toESM(require("os"), 1);
35751
35751
 
35752
35752
  // src/core/context.ts
@@ -36342,14 +36342,14 @@ var Temp = {
36342
36342
  }
36343
36343
  },
36344
36344
  truncate: (filePath) => {
36345
- const basename = import_node_path2.default.basename(filePath);
36346
- if (basename.length <= LIMIT_BASENAME_LENGTH)
36345
+ const basename2 = import_node_path2.default.basename(filePath);
36346
+ if (basename2.length <= LIMIT_BASENAME_LENGTH)
36347
36347
  return filePath;
36348
- const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(basename);
36348
+ const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(basename2);
36349
36349
  if (!truncable)
36350
36350
  return filePath;
36351
- const truncationLength = basename.length - LIMIT_BASENAME_LENGTH;
36352
- return `${filePath.slice(0, -basename.length)}${truncable[1]}${truncable[2].slice(0, -truncationLength)}${truncable[3]}`;
36351
+ const truncationLength = basename2.length - LIMIT_BASENAME_LENGTH;
36352
+ return `${filePath.slice(0, -basename2.length)}${truncable[1]}${truncable[2].slice(0, -truncationLength)}${truncable[3]}`;
36353
36353
  }
36354
36354
  };
36355
36355
  node_default(Temp.purgeSyncAll);
@@ -40801,36 +40801,49 @@ var sym = {
40801
40801
  };
40802
40802
 
40803
40803
  // src/commands/install.ts
40804
- var import_path11 = __toESM(require("path"), 1);
40804
+ var import_path12 = __toESM(require("path"), 1);
40805
40805
 
40806
40806
  // src/commands/pi-install.ts
40807
- var import_fs_extra10 = __toESM(require_lib2(), 1);
40808
- var import_path10 = __toESM(require("path"), 1);
40807
+ var import_fs_extra11 = __toESM(require_lib2(), 1);
40808
+ var import_path11 = __toESM(require("path"), 1);
40809
40809
  var import_node_child_process = require("child_process");
40810
40810
  var import_node_os4 = require("os");
40811
- var PI_AGENT_DIR = process.env.PI_AGENT_DIR || import_path10.default.join((0, import_node_os4.homedir)(), ".pi", "agent");
40811
+
40812
+ // src/utils/pi-extensions.ts
40813
+ var import_fs_extra10 = __toESM(require_lib2(), 1);
40814
+ var import_path10 = __toESM(require("path"), 1);
40815
+ async function syncManagedPiExtensions({
40816
+ sourceDir,
40817
+ targetDir,
40818
+ dryRun = false,
40819
+ log
40820
+ }) {
40821
+ if (!await import_fs_extra10.default.pathExists(sourceDir)) return 0;
40822
+ if (!dryRun) {
40823
+ await import_fs_extra10.default.ensureDir(import_path10.default.dirname(targetDir));
40824
+ await import_fs_extra10.default.copy(sourceDir, targetDir, { overwrite: true });
40825
+ }
40826
+ const entries = await import_fs_extra10.default.readdir(sourceDir, { withFileTypes: true });
40827
+ const managedPackages = entries.filter((entry) => entry.isDirectory()).length;
40828
+ if (log) {
40829
+ if (dryRun) {
40830
+ log(` [DRY RUN] sync extensions ${sourceDir} -> ${targetDir}`);
40831
+ }
40832
+ log(` Pi will auto-discover ${managedPackages} extension package(s) from ${targetDir}`);
40833
+ }
40834
+ return managedPackages;
40835
+ }
40836
+
40837
+ // src/commands/pi-install.ts
40838
+ var PI_AGENT_DIR = process.env.PI_AGENT_DIR || import_path11.default.join((0, import_node_os4.homedir)(), ".pi", "agent");
40812
40839
  function isPiInstalled() {
40813
40840
  const r = (0, import_node_child_process.spawnSync)("pi", ["--version"], { encoding: "utf8", stdio: "pipe" });
40814
40841
  return r.status === 0;
40815
40842
  }
40816
- async function listExtensionDirs(baseDir) {
40817
- if (!await import_fs_extra10.default.pathExists(baseDir)) return [];
40818
- const entries = await import_fs_extra10.default.readdir(baseDir, { withFileTypes: true });
40819
- const extDirs = [];
40820
- for (const entry of entries) {
40821
- if (!entry.isDirectory()) continue;
40822
- const extPath = import_path10.default.join(baseDir, entry.name);
40823
- const pkgPath = import_path10.default.join(extPath, "package.json");
40824
- if (await import_fs_extra10.default.pathExists(pkgPath)) {
40825
- extDirs.push(extPath);
40826
- }
40827
- }
40828
- return extDirs;
40829
- }
40830
40843
  async function runPiInstall(dryRun = false) {
40831
40844
  const repoRoot = await findRepoRoot();
40832
- const piConfigDir = import_path10.default.join(repoRoot, "config", "pi");
40833
- const schemaPath = import_path10.default.join(piConfigDir, "install-schema.json");
40845
+ const piConfigDir = import_path11.default.join(repoRoot, "config", "pi");
40846
+ const schemaPath = import_path11.default.join(piConfigDir, "install-schema.json");
40834
40847
  console.log(t.bold("\n \u2699 Pi extensions + packages"));
40835
40848
  if (!isPiInstalled()) {
40836
40849
  console.log(kleur_default.yellow(" pi not found \u2014 installing oh-pi globally..."));
@@ -40848,37 +40861,22 @@ async function runPiInstall(dryRun = false) {
40848
40861
  const v = (0, import_node_child_process.spawnSync)("pi", ["--version"], { encoding: "utf8" });
40849
40862
  console.log(t.success(` \u2713 pi ${v.stdout.trim()} already installed`));
40850
40863
  }
40851
- const extensionsSrc = import_path10.default.join(piConfigDir, "extensions");
40852
- const extensionsDst = import_path10.default.join(PI_AGENT_DIR, "extensions");
40853
- if (await import_fs_extra10.default.pathExists(extensionsSrc)) {
40854
- if (!dryRun) {
40855
- await import_fs_extra10.default.ensureDir(PI_AGENT_DIR);
40856
- await import_fs_extra10.default.copy(extensionsSrc, extensionsDst, { overwrite: true });
40857
- }
40858
- console.log(t.success(` ${sym.ok} extensions synced`));
40859
- const extDirs = await listExtensionDirs(extensionsDst);
40860
- if (extDirs.length > 0) {
40861
- console.log(kleur_default.dim(` Registering ${extDirs.length} extensions...`));
40862
- for (const extPath of extDirs) {
40863
- const extName = import_path10.default.basename(extPath);
40864
- if (dryRun) {
40865
- console.log(kleur_default.cyan(` [DRY RUN] pi install -l ~/.pi/agent/extensions/${extName}`));
40866
- continue;
40867
- }
40868
- const r = (0, import_node_child_process.spawnSync)("pi", ["install", "-l", extPath], { stdio: "pipe", encoding: "utf8" });
40869
- if (r.status === 0) {
40870
- console.log(t.success(` ${sym.ok} ${extName} registered`));
40871
- } else {
40872
- console.log(kleur_default.yellow(` \u26A0 ${extName} \u2014 registration failed`));
40873
- }
40874
- }
40875
- }
40864
+ const extensionsSrc = import_path11.default.join(piConfigDir, "extensions");
40865
+ const extensionsDst = import_path11.default.join(PI_AGENT_DIR, "extensions");
40866
+ const managedPackages = await syncManagedPiExtensions({
40867
+ sourceDir: extensionsSrc,
40868
+ targetDir: extensionsDst,
40869
+ dryRun,
40870
+ log: (message) => console.log(kleur_default.dim(message))
40871
+ });
40872
+ if (managedPackages > 0) {
40873
+ console.log(t.success(` ${sym.ok} extensions synced (${managedPackages} packages)`));
40876
40874
  }
40877
- if (!await import_fs_extra10.default.pathExists(schemaPath)) {
40875
+ if (!await import_fs_extra11.default.pathExists(schemaPath)) {
40878
40876
  console.log(kleur_default.dim(" No install-schema.json found, skipping packages"));
40879
40877
  return;
40880
40878
  }
40881
- const schema = await import_fs_extra10.default.readJson(schemaPath);
40879
+ const schema = await import_fs_extra11.default.readJson(schemaPath);
40882
40880
  for (const pkg of schema.packages) {
40883
40881
  if (dryRun) {
40884
40882
  console.log(kleur_default.cyan(` [DRY RUN] pi install ${pkg}`));
@@ -40944,7 +40942,7 @@ function formatTargetLabel(target) {
40944
40942
  const normalized = target.replace(/\\/g, "/").toLowerCase();
40945
40943
  if (normalized.endsWith("/.agents/skills") || normalized.includes("/.agents/skills/")) return "~/.agents/skills";
40946
40944
  if (normalized.endsWith("/.claude") || normalized.includes("/.claude/")) return "~/.claude";
40947
- return import_path11.default.basename(target);
40945
+ return import_path12.default.basename(target);
40948
40946
  }
40949
40947
  function isBeadsInstalled() {
40950
40948
  try {
@@ -40962,19 +40960,27 @@ function isDoltInstalled() {
40962
40960
  return false;
40963
40961
  }
40964
40962
  }
40963
+ function isDeepwikiInstalled() {
40964
+ try {
40965
+ (0, import_child_process2.execSync)("deepwiki --version", { stdio: "ignore" });
40966
+ return true;
40967
+ } catch {
40968
+ return false;
40969
+ }
40970
+ }
40965
40971
  async function needsSettingsSync(repoRoot, target) {
40966
40972
  const normalizedTarget = target.replace(/\\/g, "/").toLowerCase();
40967
40973
  if (normalizedTarget.includes(".agents/skills")) return false;
40968
40974
  if (detectAgent(target) === "claude") return false;
40969
- const hooksTemplatePath = import_path11.default.join(repoRoot, "config", "hooks.json");
40970
- if (!await import_fs_extra11.default.pathExists(hooksTemplatePath)) return false;
40971
- const requiredEvents = Object.keys((await import_fs_extra11.default.readJson(hooksTemplatePath)).hooks ?? {});
40975
+ const hooksTemplatePath = import_path12.default.join(repoRoot, "config", "hooks.json");
40976
+ if (!await import_fs_extra12.default.pathExists(hooksTemplatePath)) return false;
40977
+ const requiredEvents = Object.keys((await import_fs_extra12.default.readJson(hooksTemplatePath)).hooks ?? {});
40972
40978
  if (requiredEvents.length === 0) return false;
40973
- const targetSettingsPath = import_path11.default.join(target, "settings.json");
40974
- if (!await import_fs_extra11.default.pathExists(targetSettingsPath)) return true;
40979
+ const targetSettingsPath = import_path12.default.join(target, "settings.json");
40980
+ if (!await import_fs_extra12.default.pathExists(targetSettingsPath)) return true;
40975
40981
  let settings = {};
40976
40982
  try {
40977
- settings = await import_fs_extra11.default.readJson(targetSettingsPath);
40983
+ settings = await import_fs_extra12.default.readJson(targetSettingsPath);
40978
40984
  } catch {
40979
40985
  return true;
40980
40986
  }
@@ -41019,46 +41025,46 @@ async function installOfficialClaudePlugins(dryRun) {
41019
41025
  }
41020
41026
  async function cleanStalePrePluginFiles(repoRoot, dryRun) {
41021
41027
  const home = import_os5.default.homedir();
41022
- const staleHooksDir = import_path11.default.join(home, ".claude", "hooks");
41023
- const staleSkillsDir = import_path11.default.join(home, ".claude", "skills");
41024
- const settingsPath = import_path11.default.join(home, ".claude", "settings.json");
41028
+ const staleHooksDir = import_path12.default.join(home, ".claude", "hooks");
41029
+ const staleSkillsDir = import_path12.default.join(home, ".claude", "skills");
41030
+ const settingsPath = import_path12.default.join(home, ".claude", "settings.json");
41025
41031
  const removed = [];
41026
- const repoHooksDir = import_path11.default.join(repoRoot, "hooks");
41027
- if (await import_fs_extra11.default.pathExists(repoHooksDir) && await import_fs_extra11.default.pathExists(staleHooksDir)) {
41028
- const repoHookNames = (await import_fs_extra11.default.readdir(repoHooksDir)).filter((n) => n !== "README.md" && n !== "hooks.json");
41032
+ const repoHooksDir = import_path12.default.join(repoRoot, "hooks");
41033
+ if (await import_fs_extra12.default.pathExists(repoHooksDir) && await import_fs_extra12.default.pathExists(staleHooksDir)) {
41034
+ const repoHookNames = (await import_fs_extra12.default.readdir(repoHooksDir)).filter((n) => n !== "README.md" && n !== "hooks.json");
41029
41035
  for (const name of repoHookNames) {
41030
- const staleFile = import_path11.default.join(staleHooksDir, name);
41031
- if (await import_fs_extra11.default.pathExists(staleFile)) {
41036
+ const staleFile = import_path12.default.join(staleHooksDir, name);
41037
+ if (await import_fs_extra12.default.pathExists(staleFile)) {
41032
41038
  if (dryRun) {
41033
41039
  console.log(t.accent(` [DRY RUN] Would remove stale hook: ~/.claude/hooks/${name}`));
41034
41040
  } else {
41035
- await import_fs_extra11.default.remove(staleFile);
41041
+ await import_fs_extra12.default.remove(staleFile);
41036
41042
  console.log(t.muted(` \u2717 Removed stale hook: ~/.claude/hooks/${name}`));
41037
41043
  }
41038
41044
  removed.push(`hooks/${name}`);
41039
41045
  }
41040
41046
  }
41041
41047
  }
41042
- const repoSkillsDir = import_path11.default.join(repoRoot, "skills");
41043
- if (await import_fs_extra11.default.pathExists(repoSkillsDir) && await import_fs_extra11.default.pathExists(staleSkillsDir)) {
41044
- const repoSkillNames = (await import_fs_extra11.default.readdir(repoSkillsDir)).filter((n) => !n.startsWith("."));
41048
+ const repoSkillsDir = import_path12.default.join(repoRoot, "skills");
41049
+ if (await import_fs_extra12.default.pathExists(repoSkillsDir) && await import_fs_extra12.default.pathExists(staleSkillsDir)) {
41050
+ const repoSkillNames = (await import_fs_extra12.default.readdir(repoSkillsDir)).filter((n) => !n.startsWith("."));
41045
41051
  for (const name of repoSkillNames) {
41046
- const staleDir = import_path11.default.join(staleSkillsDir, name);
41047
- if (await import_fs_extra11.default.pathExists(staleDir)) {
41052
+ const staleDir = import_path12.default.join(staleSkillsDir, name);
41053
+ if (await import_fs_extra12.default.pathExists(staleDir)) {
41048
41054
  if (dryRun) {
41049
41055
  console.log(t.accent(` [DRY RUN] Would remove stale skill: ~/.claude/skills/${name}`));
41050
41056
  } else {
41051
- await import_fs_extra11.default.remove(staleDir);
41057
+ await import_fs_extra12.default.remove(staleDir);
41052
41058
  console.log(t.muted(` \u2717 Removed stale skill: ~/.claude/skills/${name}`));
41053
41059
  }
41054
41060
  removed.push(`skills/${name}`);
41055
41061
  }
41056
41062
  }
41057
41063
  }
41058
- if (await import_fs_extra11.default.pathExists(settingsPath)) {
41064
+ if (await import_fs_extra12.default.pathExists(settingsPath)) {
41059
41065
  let settings;
41060
41066
  try {
41061
- settings = await import_fs_extra11.default.readJson(settingsPath);
41067
+ settings = await import_fs_extra12.default.readJson(settingsPath);
41062
41068
  } catch {
41063
41069
  settings = null;
41064
41070
  }
@@ -41099,7 +41105,7 @@ async function cleanStalePrePluginFiles(repoRoot, dryRun) {
41099
41105
  }
41100
41106
  }
41101
41107
  if (settingsModified && !dryRun) {
41102
- await import_fs_extra11.default.writeJson(settingsPath, settings, { spaces: 2 });
41108
+ await import_fs_extra12.default.writeJson(settingsPath, settings, { spaces: 2 });
41103
41109
  }
41104
41110
  }
41105
41111
  }
@@ -41115,13 +41121,15 @@ async function installPlugin(repoRoot, dryRun) {
41115
41121
  await installOfficialClaudePlugins(true);
41116
41122
  return;
41117
41123
  }
41118
- (0, import_child_process3.spawnSync)("claude", ["plugin", "marketplace", "add", repoRoot, "--scope", "user"], { stdio: "pipe" });
41124
+ const xtrmPkgRoot = import_path12.default.resolve(__dirname, "..", "..");
41125
+ (0, import_child_process3.spawnSync)("claude", ["plugin", "marketplace", "add", xtrmPkgRoot, "--scope", "user"], { stdio: "pipe" });
41119
41126
  const listResult = (0, import_child_process3.spawnSync)("claude", ["plugin", "list"], { encoding: "utf8", stdio: "pipe" });
41120
41127
  if (listResult.stdout?.includes("xtrm-tools@xtrm-tools")) {
41121
41128
  (0, import_child_process3.spawnSync)("claude", ["plugin", "uninstall", "xtrm-tools@xtrm-tools"], { stdio: "inherit" });
41122
41129
  }
41123
41130
  (0, import_child_process3.spawnSync)("claude", ["plugin", "install", "xtrm-tools@xtrm-tools", "--scope", "user"], { stdio: "inherit" });
41124
41131
  console.log(t.success(" \u2713 xtrm-tools plugin installed"));
41132
+ console.log(t.warning(" \u21BB Restart Claude Code for the new plugin hooks to take effect"));
41125
41133
  await cleanStalePrePluginFiles(repoRoot, dryRun);
41126
41134
  await installOfficialClaudePlugins(false);
41127
41135
  }
@@ -41194,6 +41202,31 @@ function createInstallCommand() {
41194
41202
  }
41195
41203
  }
41196
41204
  }
41205
+ if (!backport) {
41206
+ console.log(t.bold("\n \u2699 deepwiki (AI-powered repo documentation)"));
41207
+ const deepwikiOk = isDeepwikiInstalled();
41208
+ if (deepwikiOk) {
41209
+ console.log(t.success(" \u2713 deepwiki already installed\n"));
41210
+ } else {
41211
+ let doInstall = effectiveYes;
41212
+ if (!effectiveYes) {
41213
+ const { install } = await (0, import_prompts.default)({
41214
+ type: "confirm",
41215
+ name: "install",
41216
+ message: "Install @seflless/deepwiki?",
41217
+ initial: true
41218
+ });
41219
+ doInstall = install;
41220
+ }
41221
+ if (doInstall) {
41222
+ console.log(t.muted("\n Installing @seflless/deepwiki..."));
41223
+ (0, import_child_process3.spawnSync)("npm", ["install", "-g", "@seflless/deepwiki"], { stdio: "inherit" });
41224
+ console.log(t.success(" \u2713 deepwiki installed\n"));
41225
+ } else {
41226
+ console.log(t.muted(" \u2139 Skipped.\n"));
41227
+ }
41228
+ }
41229
+ }
41197
41230
  if (!backport) {
41198
41231
  for (const _claudeTarget of claudeTargets) {
41199
41232
  await installPlugin(repoRoot, dryRun);
@@ -41464,31 +41497,31 @@ function createClaudeCommand() {
41464
41497
  }
41465
41498
 
41466
41499
  // src/commands/pi.ts
41467
- var import_path13 = __toESM(require("path"), 1);
41500
+ var import_path14 = __toESM(require("path"), 1);
41468
41501
  var import_node_child_process5 = require("child_process");
41469
41502
  var import_node_os7 = require("os");
41470
- var import_fs_extra13 = __toESM(require_lib2(), 1);
41503
+ var import_fs_extra14 = __toESM(require_lib2(), 1);
41471
41504
 
41472
41505
  // src/commands/install-pi.ts
41473
41506
  var import_prompts2 = __toESM(require_prompts3(), 1);
41474
- var import_fs_extra12 = __toESM(require_lib2(), 1);
41475
- var import_path12 = __toESM(require("path"), 1);
41507
+ var import_fs_extra13 = __toESM(require_lib2(), 1);
41508
+ var import_path13 = __toESM(require("path"), 1);
41476
41509
  var import_node_child_process4 = require("child_process");
41477
41510
  var import_node_os6 = require("os");
41478
- var PI_AGENT_DIR2 = process.env.PI_AGENT_DIR || import_path12.default.join((0, import_node_os6.homedir)(), ".pi", "agent");
41511
+ var PI_AGENT_DIR2 = process.env.PI_AGENT_DIR || import_path13.default.join((0, import_node_os6.homedir)(), ".pi", "agent");
41479
41512
  function fillTemplate(template, values) {
41480
41513
  return template.replace(/\{\{(\w+)\}\}/g, (_, key) => values[key] ?? "");
41481
41514
  }
41482
41515
  function readExistingPiValues(piAgentDir) {
41483
41516
  const values = {};
41484
41517
  try {
41485
- const auth = JSON.parse(require("fs").readFileSync(import_path12.default.join(piAgentDir, "auth.json"), "utf8"));
41518
+ const auth = JSON.parse(require("fs").readFileSync(import_path13.default.join(piAgentDir, "auth.json"), "utf8"));
41486
41519
  if (auth?.dashscope?.key) values["DASHSCOPE_API_KEY"] = auth.dashscope.key;
41487
41520
  if (auth?.zai?.key) values["ZAI_API_KEY"] = auth.zai.key;
41488
41521
  } catch {
41489
41522
  }
41490
41523
  try {
41491
- const models = JSON.parse(require("fs").readFileSync(import_path12.default.join(piAgentDir, "models.json"), "utf8"));
41524
+ const models = JSON.parse(require("fs").readFileSync(import_path13.default.join(piAgentDir, "models.json"), "utf8"));
41492
41525
  if (!values["DASHSCOPE_API_KEY"] && models?.providers?.dashscope?.apiKey) {
41493
41526
  values["DASHSCOPE_API_KEY"] = models.providers.dashscope.apiKey;
41494
41527
  }
@@ -41499,15 +41532,15 @@ function readExistingPiValues(piAgentDir) {
41499
41532
  function isPiInstalled2() {
41500
41533
  return (0, import_node_child_process4.spawnSync)("pi", ["--version"], { encoding: "utf8" }).status === 0;
41501
41534
  }
41502
- async function listExtensionDirs2(baseDir) {
41503
- if (!await import_fs_extra12.default.pathExists(baseDir)) return [];
41504
- const entries = await import_fs_extra12.default.readdir(baseDir, { withFileTypes: true });
41535
+ async function listExtensionDirs(baseDir) {
41536
+ if (!await import_fs_extra13.default.pathExists(baseDir)) return [];
41537
+ const entries = await import_fs_extra13.default.readdir(baseDir, { withFileTypes: true });
41505
41538
  const extDirs = [];
41506
41539
  for (const entry of entries) {
41507
41540
  if (!entry.isDirectory()) continue;
41508
- const extPath = import_path12.default.join(baseDir, entry.name);
41509
- const pkgPath = import_path12.default.join(extPath, "package.json");
41510
- if (await import_fs_extra12.default.pathExists(pkgPath)) {
41541
+ const extPath = import_path13.default.join(baseDir, entry.name);
41542
+ const pkgPath = import_path13.default.join(extPath, "package.json");
41543
+ if (await import_fs_extra13.default.pathExists(pkgPath)) {
41511
41544
  extDirs.push(entry.name);
41512
41545
  }
41513
41546
  }
@@ -41515,37 +41548,37 @@ async function listExtensionDirs2(baseDir) {
41515
41548
  }
41516
41549
  async function fileSha256(filePath) {
41517
41550
  const crypto2 = await import("crypto");
41518
- const content = await import_fs_extra12.default.readFile(filePath);
41551
+ const content = await import_fs_extra13.default.readFile(filePath);
41519
41552
  return crypto2.createHash("sha256").update(content).digest("hex");
41520
41553
  }
41521
41554
  async function extensionHash(extDir) {
41522
- const pkgPath = import_path12.default.join(extDir, "package.json");
41523
- const indexPath = import_path12.default.join(extDir, "index.ts");
41555
+ const pkgPath = import_path13.default.join(extDir, "package.json");
41556
+ const indexPath = import_path13.default.join(extDir, "index.ts");
41524
41557
  const hashes = [];
41525
- if (await import_fs_extra12.default.pathExists(pkgPath)) {
41558
+ if (await import_fs_extra13.default.pathExists(pkgPath)) {
41526
41559
  hashes.push(await fileSha256(pkgPath));
41527
41560
  }
41528
- if (await import_fs_extra12.default.pathExists(indexPath)) {
41561
+ if (await import_fs_extra13.default.pathExists(indexPath)) {
41529
41562
  hashes.push(await fileSha256(indexPath));
41530
41563
  }
41531
41564
  return hashes.join(":");
41532
41565
  }
41533
41566
  async function diffPiExtensions(sourceDir, targetDir) {
41534
- const sourceAbs = import_path12.default.resolve(sourceDir);
41535
- const targetAbs = import_path12.default.resolve(targetDir);
41536
- const sourceExts = await listExtensionDirs2(sourceAbs);
41567
+ const sourceAbs = import_path13.default.resolve(sourceDir);
41568
+ const targetAbs = import_path13.default.resolve(targetDir);
41569
+ const sourceExts = await listExtensionDirs(sourceAbs);
41537
41570
  const missing = [];
41538
41571
  const stale = [];
41539
41572
  const upToDate = [];
41540
41573
  for (const extName of sourceExts) {
41541
- const srcExtPath = import_path12.default.join(sourceAbs, extName);
41542
- const dstExtPath = import_path12.default.join(targetAbs, extName);
41543
- if (!await import_fs_extra12.default.pathExists(dstExtPath)) {
41574
+ const srcExtPath = import_path13.default.join(sourceAbs, extName);
41575
+ const dstExtPath = import_path13.default.join(targetAbs, extName);
41576
+ if (!await import_fs_extra13.default.pathExists(dstExtPath)) {
41544
41577
  missing.push(extName);
41545
41578
  continue;
41546
41579
  }
41547
- const dstPkgPath = import_path12.default.join(dstExtPath, "package.json");
41548
- if (!await import_fs_extra12.default.pathExists(dstPkgPath)) {
41580
+ const dstPkgPath = import_path13.default.join(dstExtPath, "package.json");
41581
+ if (!await import_fs_extra13.default.pathExists(dstPkgPath)) {
41549
41582
  missing.push(extName);
41550
41583
  continue;
41551
41584
  }
@@ -41584,10 +41617,10 @@ function createInstallPiCommand() {
41584
41617
  cmd.description("Install Pi coding agent with providers, extensions, and npm packages").option("-y, --yes", "Skip confirmation prompts", false).option("--check", "Check Pi extension deployment drift without writing changes", false).action(async (opts) => {
41585
41618
  const { yes, check: check2 } = opts;
41586
41619
  const repoRoot = await findRepoRoot();
41587
- const piConfigDir = import_path12.default.join(repoRoot, "config", "pi");
41620
+ const piConfigDir = import_path13.default.join(repoRoot, "config", "pi");
41588
41621
  if (check2) {
41589
- const sourceDir = import_path12.default.join(piConfigDir, "extensions");
41590
- const targetDir = import_path12.default.join(PI_AGENT_DIR2, "extensions");
41622
+ const sourceDir = import_path13.default.join(piConfigDir, "extensions");
41623
+ const targetDir = import_path13.default.join(PI_AGENT_DIR2, "extensions");
41591
41624
  const diff = await diffPiExtensions(sourceDir, targetDir);
41592
41625
  printPiCheckSummary(diff);
41593
41626
  if (diff.missing.length > 0 || diff.stale.length > 0) {
@@ -41610,7 +41643,7 @@ function createInstallPiCommand() {
41610
41643
  console.log(t.success(` pi ${v.stdout.trim()} already installed
41611
41644
  `));
41612
41645
  }
41613
- const schema = await import_fs_extra12.default.readJson(import_path12.default.join(piConfigDir, "install-schema.json"));
41646
+ const schema = await import_fs_extra13.default.readJson(import_path13.default.join(piConfigDir, "install-schema.json"));
41614
41647
  const existing = readExistingPiValues(PI_AGENT_DIR2);
41615
41648
  const values = { ...existing };
41616
41649
  console.log(t.bold(" API Keys\n"));
@@ -41626,37 +41659,30 @@ function createInstallPiCommand() {
41626
41659
  const { value } = await (0, import_prompts2.default)({ type: field.secret ? "password" : "text", name: "value", message: ` ${field.label}`, hint: field.hint, validate: (v) => field.required && !v ? "Required" : true });
41627
41660
  if (value) values[field.key] = value;
41628
41661
  }
41629
- await import_fs_extra12.default.ensureDir(PI_AGENT_DIR2);
41662
+ await import_fs_extra13.default.ensureDir(PI_AGENT_DIR2);
41630
41663
  console.log(t.muted(`
41631
41664
  Writing config to ${PI_AGENT_DIR2}`));
41632
41665
  for (const name of ["models.json", "auth.json", "settings.json"]) {
41633
- const destPath = import_path12.default.join(PI_AGENT_DIR2, name);
41634
- if (name === "auth.json" && await import_fs_extra12.default.pathExists(destPath) && !yes) {
41666
+ const destPath = import_path13.default.join(PI_AGENT_DIR2, name);
41667
+ if (name === "auth.json" && await import_fs_extra13.default.pathExists(destPath) && !yes) {
41635
41668
  const { overwrite } = await (0, import_prompts2.default)({ type: "confirm", name: "overwrite", message: ` ${name} already exists \u2014 overwrite? (OAuth tokens will be lost)`, initial: false });
41636
41669
  if (!overwrite) {
41637
41670
  console.log(t.muted(` skipped ${name}`));
41638
41671
  continue;
41639
41672
  }
41640
41673
  }
41641
- const raw = await import_fs_extra12.default.readFile(import_path12.default.join(piConfigDir, `${name}.template`), "utf8");
41642
- await import_fs_extra12.default.writeFile(destPath, fillTemplate(raw, values), "utf8");
41674
+ const raw = await import_fs_extra13.default.readFile(import_path13.default.join(piConfigDir, `${name}.template`), "utf8");
41675
+ await import_fs_extra13.default.writeFile(destPath, fillTemplate(raw, values), "utf8");
41643
41676
  console.log(t.success(` ${sym.ok} ${name}`));
41644
41677
  }
41645
- await import_fs_extra12.default.copy(import_path12.default.join(piConfigDir, "extensions"), import_path12.default.join(PI_AGENT_DIR2, "extensions"), { overwrite: true });
41646
- console.log(t.success(` ${sym.ok} extensions/`));
41647
- const extDirs = await listExtensionDirs2(import_path12.default.join(PI_AGENT_DIR2, "extensions"));
41648
- if (extDirs.length > 0) {
41649
- console.log(kleur_default.dim(`
41650
- Registering ${extDirs.length} extensions...`));
41651
- for (const extName of extDirs) {
41652
- const extPath = import_path12.default.join(PI_AGENT_DIR2, "extensions", extName);
41653
- const r = (0, import_node_child_process4.spawnSync)("pi", ["install", "-l", extPath], { stdio: "pipe", encoding: "utf8" });
41654
- if (r.status === 0) {
41655
- console.log(t.success(` ${sym.ok} ${extName} registered`));
41656
- } else {
41657
- console.log(kleur_default.yellow(` \u26A0 ${extName} \u2014 registration failed`));
41658
- }
41659
- }
41678
+ const managedPackages = await syncManagedPiExtensions({
41679
+ sourceDir: import_path13.default.join(piConfigDir, "extensions"),
41680
+ targetDir: import_path13.default.join(PI_AGENT_DIR2, "extensions"),
41681
+ dryRun: false,
41682
+ log: (message) => console.log(kleur_default.dim(` ${message}`))
41683
+ });
41684
+ if (managedPackages > 0) {
41685
+ console.log(t.success(` ${sym.ok} extensions/ (${managedPackages} packages)`));
41660
41686
  }
41661
41687
  console.log(t.bold("\n npm Packages\n"));
41662
41688
  for (const pkg of schema.packages) {
@@ -41674,7 +41700,7 @@ function createInstallPiCommand() {
41674
41700
  }
41675
41701
 
41676
41702
  // src/commands/pi.ts
41677
- var PI_AGENT_DIR3 = process.env.PI_AGENT_DIR || import_path13.default.join((0, import_node_os7.homedir)(), ".pi", "agent");
41703
+ var PI_AGENT_DIR3 = process.env.PI_AGENT_DIR || import_path14.default.join((0, import_node_os7.homedir)(), ".pi", "agent");
41678
41704
  function createPiCommand() {
41679
41705
  const cmd = new Command("pi").description("Launch a Pi session in a sandboxed worktree, or manage the Pi runtime").argument("[name]", "Optional session name \u2014 used as xt/<name> branch (random if omitted)").action(async (name) => {
41680
41706
  await launchWorktreeSession({ runtime: "pi", name });
@@ -41697,8 +41723,8 @@ function createPiCommand() {
41697
41723
  return;
41698
41724
  }
41699
41725
  const repoRoot = await findRepoRoot();
41700
- const sourceDir = import_path13.default.join(repoRoot, "config", "pi", "extensions");
41701
- const targetDir = import_path13.default.join(PI_AGENT_DIR3, "extensions");
41726
+ const sourceDir = import_path14.default.join(repoRoot, "config", "pi", "extensions");
41727
+ const targetDir = import_path14.default.join(PI_AGENT_DIR3, "extensions");
41702
41728
  const diff = await diffPiExtensions(sourceDir, targetDir);
41703
41729
  if (diff.missing.length === 0 && diff.stale.length === 0) {
41704
41730
  console.log(t.success(` \u2713 extensions up-to-date (${diff.upToDate.length} deployed)`));
@@ -41720,9 +41746,9 @@ function createPiCommand() {
41720
41746
  allOk = false;
41721
41747
  }
41722
41748
  const repoRoot = await findRepoRoot();
41723
- const piConfigDir = import_path13.default.join(repoRoot, "config", "pi");
41724
- const sourceDir = import_path13.default.join(piConfigDir, "extensions");
41725
- const targetDir = import_path13.default.join(PI_AGENT_DIR3, "extensions");
41749
+ const piConfigDir = import_path14.default.join(repoRoot, "config", "pi");
41750
+ const sourceDir = import_path14.default.join(piConfigDir, "extensions");
41751
+ const targetDir = import_path14.default.join(PI_AGENT_DIR3, "extensions");
41726
41752
  const diff = await diffPiExtensions(sourceDir, targetDir);
41727
41753
  if (diff.missing.length === 0 && diff.stale.length === 0) {
41728
41754
  console.log(t.success(` \u2713 extensions deployed (${diff.upToDate.length})`));
@@ -41730,11 +41756,11 @@ function createPiCommand() {
41730
41756
  console.log(kleur_default.yellow(` \u26A0 extension drift (${diff.missing.length} missing, ${diff.stale.length} stale)`));
41731
41757
  allOk = false;
41732
41758
  }
41733
- const schemaPath = import_path13.default.join(piConfigDir, "install-schema.json");
41734
- if (await import_fs_extra13.default.pathExists(schemaPath)) {
41759
+ const schemaPath = import_path14.default.join(piConfigDir, "install-schema.json");
41760
+ if (await import_fs_extra14.default.pathExists(schemaPath)) {
41735
41761
  try {
41736
41762
  (0, import_node_child_process5.execSync)("pi --version", { stdio: "ignore" });
41737
- const schema = await import_fs_extra13.default.readJson(schemaPath);
41763
+ const schema = await import_fs_extra14.default.readJson(schemaPath);
41738
41764
  const listResult = (0, import_node_child_process5.spawnSync)("pi", ["list"], { encoding: "utf8", stdio: "pipe" });
41739
41765
  const installed = listResult.stdout ?? "";
41740
41766
  const missing = schema.packages.filter((p) => !installed.includes(p.replace("npm:", "")));
@@ -41762,43 +41788,43 @@ function createPiCommand() {
41762
41788
  }
41763
41789
 
41764
41790
  // src/commands/init.ts
41765
- var import_path15 = __toESM(require("path"), 1);
41766
- var import_fs_extra15 = __toESM(require_lib2(), 1);
41791
+ var import_path16 = __toESM(require("path"), 1);
41792
+ var import_fs_extra16 = __toESM(require_lib2(), 1);
41767
41793
  var import_child_process4 = require("child_process");
41768
41794
 
41769
41795
  // src/commands/install-service-skills.ts
41770
- var import_path14 = __toESM(require("path"), 1);
41771
- var import_fs_extra14 = __toESM(require_lib2(), 1);
41796
+ var import_path15 = __toESM(require("path"), 1);
41797
+ var import_fs_extra15 = __toESM(require_lib2(), 1);
41772
41798
  function resolvePkgRoot() {
41773
41799
  const candidates = [
41774
- import_path14.default.resolve(__dirname, "../.."),
41775
- import_path14.default.resolve(__dirname, "../../..")
41800
+ import_path15.default.resolve(__dirname, "../.."),
41801
+ import_path15.default.resolve(__dirname, "../../..")
41776
41802
  ];
41777
- const match = candidates.find((candidate) => import_fs_extra14.default.existsSync(import_path14.default.join(candidate, "project-skills")));
41803
+ const match = candidates.find((candidate) => import_fs_extra15.default.existsSync(import_path15.default.join(candidate, "project-skills")));
41778
41804
  if (!match) {
41779
41805
  throw new Error("Unable to locate project-skills directory from CLI runtime.");
41780
41806
  }
41781
41807
  return match;
41782
41808
  }
41783
41809
  var PKG_ROOT = resolvePkgRoot();
41784
- var SKILLS_SRC = import_path14.default.join(PKG_ROOT, "project-skills", "service-skills-set", ".claude");
41810
+ var SKILLS_SRC = import_path15.default.join(PKG_ROOT, "project-skills", "service-skills-set", ".claude");
41785
41811
 
41786
41812
  // src/commands/init.ts
41787
41813
  function resolvePkgRoot2() {
41788
41814
  const candidates = [
41789
- import_path15.default.resolve(__dirname, "../.."),
41790
- import_path15.default.resolve(__dirname, "../../..")
41815
+ import_path16.default.resolve(__dirname, "../.."),
41816
+ import_path16.default.resolve(__dirname, "../../..")
41791
41817
  ];
41792
- const match = candidates.find((candidate) => import_fs_extra15.default.existsSync(import_path15.default.join(candidate, "project-skills")));
41818
+ const match = candidates.find((candidate) => import_fs_extra16.default.existsSync(import_path16.default.join(candidate, "project-skills")));
41793
41819
  if (!match) {
41794
41820
  throw new Error("Unable to locate project-skills directory from CLI runtime.");
41795
41821
  }
41796
41822
  return match;
41797
41823
  }
41798
41824
  var PKG_ROOT2 = resolvePkgRoot2();
41799
- var PROJECT_SKILLS_DIR = import_path15.default.join(PKG_ROOT2, "project-skills");
41800
- var MCP_CORE_CONFIG_PATH = import_path15.default.join(PKG_ROOT2, "config", "mcp_servers.json");
41801
- var INSTRUCTIONS_DIR = import_path15.default.join(PKG_ROOT2, "config", "instructions");
41825
+ var PROJECT_SKILLS_DIR = import_path16.default.join(PKG_ROOT2, "project-skills");
41826
+ var MCP_CORE_CONFIG_PATH = import_path16.default.join(PKG_ROOT2, "config", "mcp_servers.json");
41827
+ var INSTRUCTIONS_DIR = import_path16.default.join(PKG_ROOT2, "config", "instructions");
41802
41828
  var XTRM_BLOCK_START = "<!-- xtrm:start -->";
41803
41829
  var XTRM_BLOCK_END = "<!-- xtrm:end -->";
41804
41830
  function parseComposeServices(content) {
@@ -41824,8 +41850,8 @@ function parseComposeServices(content) {
41824
41850
  return [...services];
41825
41851
  }
41826
41852
  async function detectProjectFeatures(projectRoot) {
41827
- const hasTypeScript = await import_fs_extra15.default.pathExists(import_path15.default.join(projectRoot, "tsconfig.json"));
41828
- const hasPython = await import_fs_extra15.default.pathExists(import_path15.default.join(projectRoot, "pyproject.toml")) || await import_fs_extra15.default.pathExists(import_path15.default.join(projectRoot, "setup.py")) || await import_fs_extra15.default.pathExists(import_path15.default.join(projectRoot, "requirements.txt"));
41853
+ const hasTypeScript = await import_fs_extra16.default.pathExists(import_path16.default.join(projectRoot, "tsconfig.json"));
41854
+ const hasPython = await import_fs_extra16.default.pathExists(import_path16.default.join(projectRoot, "pyproject.toml")) || await import_fs_extra16.default.pathExists(import_path16.default.join(projectRoot, "setup.py")) || await import_fs_extra16.default.pathExists(import_path16.default.join(projectRoot, "requirements.txt"));
41829
41855
  const composeCandidates = [
41830
41856
  "docker-compose.yml",
41831
41857
  "docker-compose.yaml",
@@ -41834,19 +41860,19 @@ async function detectProjectFeatures(projectRoot) {
41834
41860
  ];
41835
41861
  const dockerServices = /* @__PURE__ */ new Set();
41836
41862
  for (const composeFile of composeCandidates) {
41837
- const composePath = import_path15.default.join(projectRoot, composeFile);
41838
- if (!await import_fs_extra15.default.pathExists(composePath)) continue;
41863
+ const composePath = import_path16.default.join(projectRoot, composeFile);
41864
+ if (!await import_fs_extra16.default.pathExists(composePath)) continue;
41839
41865
  try {
41840
- const content = await import_fs_extra15.default.readFile(composePath, "utf8");
41866
+ const content = await import_fs_extra16.default.readFile(composePath, "utf8");
41841
41867
  for (const service of parseComposeServices(content)) {
41842
41868
  dockerServices.add(service);
41843
41869
  }
41844
41870
  } catch {
41845
41871
  }
41846
41872
  }
41847
- const hasDockerfile = await import_fs_extra15.default.pathExists(import_path15.default.join(projectRoot, "Dockerfile"));
41873
+ const hasDockerfile = await import_fs_extra16.default.pathExists(import_path16.default.join(projectRoot, "Dockerfile"));
41848
41874
  if (hasDockerfile && dockerServices.size === 0) {
41849
- dockerServices.add(import_path15.default.basename(projectRoot));
41875
+ dockerServices.add(import_path16.default.basename(projectRoot));
41850
41876
  }
41851
41877
  return {
41852
41878
  hasTypeScript,
@@ -41880,20 +41906,20 @@ async function injectProjectInstructionHeaders(projectRoot) {
41880
41906
  ];
41881
41907
  console.log(kleur_default.bold("Injecting xtrm agent instruction headers..."));
41882
41908
  for (const target of targets) {
41883
- const templatePath = import_path15.default.join(INSTRUCTIONS_DIR, target.template);
41884
- if (!await import_fs_extra15.default.pathExists(templatePath)) {
41909
+ const templatePath = import_path16.default.join(INSTRUCTIONS_DIR, target.template);
41910
+ if (!await import_fs_extra16.default.pathExists(templatePath)) {
41885
41911
  console.log(kleur_default.yellow(` \u26A0 Missing template: ${target.template}`));
41886
41912
  continue;
41887
41913
  }
41888
- const template = await import_fs_extra15.default.readFile(templatePath, "utf8");
41889
- const outputPath = import_path15.default.join(projectRoot, target.output);
41890
- const existing = await import_fs_extra15.default.pathExists(outputPath) ? await import_fs_extra15.default.readFile(outputPath, "utf8") : "";
41914
+ const template = await import_fs_extra16.default.readFile(templatePath, "utf8");
41915
+ const outputPath = import_path16.default.join(projectRoot, target.output);
41916
+ const existing = await import_fs_extra16.default.pathExists(outputPath) ? await import_fs_extra16.default.readFile(outputPath, "utf8") : "";
41891
41917
  const next = upsertManagedBlock(existing, template);
41892
41918
  if (next === existing) {
41893
41919
  console.log(kleur_default.dim(` \u2713 ${target.output} already up to date`));
41894
41920
  continue;
41895
41921
  }
41896
- await import_fs_extra15.default.writeFile(outputPath, next.endsWith("\n") ? next : `${next}
41922
+ await import_fs_extra16.default.writeFile(outputPath, next.endsWith("\n") ? next : `${next}
41897
41923
  `, "utf8");
41898
41924
  console.log(`${kleur_default.green(" \u2713")} updated ${target.output}`);
41899
41925
  }
@@ -42030,14 +42056,14 @@ function getProjectRoot() {
42030
42056
  if (result.status !== 0) {
42031
42057
  throw new Error("Not inside a git repository. Run this command from your target project directory.");
42032
42058
  }
42033
- return import_path15.default.resolve(result.stdout.trim());
42059
+ return import_path16.default.resolve(result.stdout.trim());
42034
42060
  }
42035
42061
 
42036
42062
  // src/commands/status.ts
42037
42063
  var import_prompts3 = __toESM(require_prompts3(), 1);
42038
42064
 
42039
42065
  // src/core/manifest.ts
42040
- var import_path16 = require("path");
42066
+ var import_path17 = require("path");
42041
42067
 
42042
42068
  // ../node_modules/zod/v4/classic/external.js
42043
42069
  var external_exports = {};
@@ -55846,17 +55872,17 @@ var ManifestSchema = external_exports.object({
55846
55872
  // src/core/manifest.ts
55847
55873
  var MANIFEST_FILE = ".jaggers-sync-manifest.json";
55848
55874
  function getManifestPath(projectDir) {
55849
- return (0, import_path16.join)(projectDir, MANIFEST_FILE);
55875
+ return (0, import_path17.join)(projectDir, MANIFEST_FILE);
55850
55876
  }
55851
55877
 
55852
55878
  // src/commands/status.ts
55853
- var import_fs_extra16 = __toESM(require_lib2(), 1);
55854
- var import_path17 = __toESM(require("path"), 1);
55879
+ var import_fs_extra17 = __toESM(require_lib2(), 1);
55880
+ var import_path18 = __toESM(require("path"), 1);
55855
55881
  function formatTargetLabel2(target) {
55856
55882
  const normalized = target.replace(/\\/g, "/").toLowerCase();
55857
55883
  if (normalized.endsWith("/.agents/skills") || normalized.includes("/.agents/skills/")) return "~/.agents/skills";
55858
55884
  if (normalized.endsWith("/.claude") || normalized.includes("/.claude/")) return "~/.claude";
55859
- return import_path17.default.basename(target);
55885
+ return import_path18.default.basename(target);
55860
55886
  }
55861
55887
  function formatRelativeTime(timestamp) {
55862
55888
  const now = Date.now();
@@ -55876,7 +55902,7 @@ function createStatusCommand() {
55876
55902
  const candidates = getCandidatePaths();
55877
55903
  const targets = [];
55878
55904
  for (const c of candidates) {
55879
- if (await import_fs_extra16.default.pathExists(c.path)) targets.push(c.path);
55905
+ if (await import_fs_extra17.default.pathExists(c.path)) targets.push(c.path);
55880
55906
  }
55881
55907
  if (targets.length === 0) {
55882
55908
  console.log(kleur_default.yellow("\n No agent environments found (~/.claude, ~/.agents/skills)\n"));
@@ -55887,8 +55913,8 @@ function createStatusCommand() {
55887
55913
  const manifestPath = getManifestPath(target);
55888
55914
  let lastSync = null;
55889
55915
  try {
55890
- if (await import_fs_extra16.default.pathExists(manifestPath)) {
55891
- const manifest = await import_fs_extra16.default.readJson(manifestPath);
55916
+ if (await import_fs_extra17.default.pathExists(manifestPath)) {
55917
+ const manifest = await import_fs_extra17.default.readJson(manifestPath);
55892
55918
  if (manifest.lastSync) lastSync = manifest.lastSync;
55893
55919
  }
55894
55920
  } catch {
@@ -55980,127 +56006,91 @@ function createResetCommand() {
55980
56006
  }
55981
56007
 
55982
56008
  // src/commands/help.ts
55983
- var import_path18 = __toESM(require("path"), 1);
55984
- var import_fs_extra17 = __toESM(require_lib2(), 1);
55985
- var HOOK_CATALOG = [
55986
- { file: "using-xtrm-reminder.mjs", event: "SessionStart", desc: "Injects using-xtrm session operating manual into system prompt" },
55987
- { file: "gitnexus/gitnexus-hook.cjs", event: "PostToolUse", desc: "Adds GitNexus context for search and Serena tooling" },
55988
- { file: "quality-check.cjs", event: "PostToolUse", desc: "Runs JS/TS quality checks on mutating edits" },
55989
- { file: "quality-check.py", event: "PostToolUse", desc: "Runs Python quality checks on mutating edits" },
55990
- { file: "quality-check-env.mjs", event: "SessionStart", desc: "Warns if tsc/ruff/eslint are missing at session start" },
55991
- { file: "worktree-boundary.mjs", event: "PreToolUse", desc: "Blocks edits outside .xtrm/worktrees when in worktree session" },
55992
- { file: "statusline.mjs", event: "statusLine", desc: "Renders 2-line status: XTRM model branch + claim/open issues" },
55993
- { file: "beads-edit-gate.mjs", event: "PreToolUse", desc: "Blocks file edits if no beads issue is claimed", beads: true },
55994
- { file: "beads-commit-gate.mjs", event: "PreToolUse", desc: "Blocks commits when no beads issue is in progress", beads: true },
55995
- { file: "beads-stop-gate.mjs", event: "Stop", desc: "Blocks stop when there is an unclosed in_progress claim", beads: true },
55996
- { file: "beads-memory-gate.mjs", event: "Stop", desc: "Prompts memory save when claim was closed this session", beads: true },
55997
- { file: "beads-compact-save.mjs", event: "PreCompact", desc: "Saves claim state across /compact", beads: true },
55998
- { file: "beads-compact-restore.mjs", event: "SessionStart", desc: "Restores claim state after /compact", beads: true },
55999
- { file: "beads-claim-sync.mjs", event: "PostToolUse", desc: "Notifies on bd update --claim; auto-commits on bd close", sessionFlow: true }
56000
- ];
56001
- async function readSkillsFromDir(dir) {
56002
- if (!await import_fs_extra17.default.pathExists(dir)) return [];
56003
- const entries = await import_fs_extra17.default.readdir(dir);
56004
- const skills = [];
56005
- for (const name of entries.sort()) {
56006
- const skillMd = import_path18.default.join(dir, name, "SKILL.md");
56007
- if (!await import_fs_extra17.default.pathExists(skillMd)) continue;
56008
- const content = await import_fs_extra17.default.readFile(skillMd, "utf8");
56009
- const m = content.match(/^description:\s*(.+)$/m);
56010
- skills.push({ name, desc: m ? m[1].replace(/^["']|["']$/g, "").trim() : "" });
56011
- }
56012
- return skills;
56013
- }
56014
- function resolvePkgRootFallback() {
56015
- const candidates = [
56016
- import_path18.default.resolve(__dirname, "../.."),
56017
- import_path18.default.resolve(__dirname, "../../..")
56018
- ];
56019
- const match = candidates.find(
56020
- (candidate) => import_fs_extra17.default.existsSync(import_path18.default.join(candidate, "skills")) || import_fs_extra17.default.existsSync(import_path18.default.join(candidate, "project-skills"))
56021
- );
56022
- return match || null;
56023
- }
56024
- function col(s, width) {
56025
- return s.length >= width ? s.slice(0, width - 1) + "\u2026" : s.padEnd(width);
56009
+ function section(title, lines) {
56010
+ return [title, ...lines, ""].join("\n");
56026
56011
  }
56027
56012
  function createHelpCommand() {
56028
- return new Command("help").description("Show help information and component catalogue").action(async () => {
56029
- let repoRoot;
56030
- try {
56031
- repoRoot = await findRepoRoot();
56032
- } catch {
56033
- repoRoot = "";
56034
- }
56035
- const pkgRoot = resolvePkgRootFallback();
56036
- const skillsRoot = repoRoot || pkgRoot || "";
56037
- const skills = skillsRoot ? await readSkillsFromDir(import_path18.default.join(skillsRoot, "skills")) : [];
56038
- const W = 80;
56039
- const hr = kleur_default.dim("-".repeat(W));
56040
- const section = (title) => `
56041
- ${kleur_default.bold().cyan(title)}
56042
- ${hr}`;
56043
- const installSection = [
56044
- section("INSTALL COMMANDS"),
56013
+ return new Command("help").description("Show rich CLI help in a plain text format").action(async () => {
56014
+ const blocks = [];
56015
+ blocks.push(section("XTRM CLI", [
56016
+ " xtrm and xt are equivalent commands.",
56017
+ " Use xt for short workflow commands (xt claude, xt pi, xt end)."
56018
+ ]));
56019
+ blocks.push(section("USAGE", [
56020
+ " xtrm <command> [subcommand] [options]",
56021
+ " xt <command> [subcommand] [options]"
56022
+ ]));
56023
+ blocks.push(section("CORE WORKFLOW", [
56024
+ " 1) Start a runtime session in a worktree:",
56025
+ " xt claude [name] or xt pi [name]",
56026
+ " 2) Do your work in that worktree/branch.",
56027
+ " 3) Finish with:",
56028
+ " xt end",
56029
+ " 4) Manage old worktrees when needed:",
56030
+ " xt worktree list | xt worktree clean"
56031
+ ]));
56032
+ blocks.push(section("PRIMARY COMMANDS", [
56033
+ " xtrm install [target-selector] [options]",
56034
+ " Install/sync tools, hooks, skills, and MCP wiring.",
56035
+ " Options: --dry-run, --yes/-y, --prune, --backport",
56045
56036
  "",
56046
- ` ${kleur_default.bold("xtrm install")}`,
56047
- ` ${kleur_default.dim("Install plugin + skills + hooks + MCP servers.")}`,
56048
- ` ${kleur_default.dim("Checks for beads+dolt and prompts to install if missing.")}`,
56037
+ " xtrm status [--json]",
56038
+ " Show pending changes for detected environments.",
56049
56039
  "",
56050
- ` ${kleur_default.dim("Flags: --dry-run --yes / -y --no-mcp --force --prune --backport")}`
56051
- ].join("\n");
56052
- const general = HOOK_CATALOG.filter((h) => !h.beads && !h.sessionFlow);
56053
- const beads = HOOK_CATALOG.filter((h) => h.beads);
56054
- const sessionFlow = HOOK_CATALOG.filter((h) => h.sessionFlow);
56055
- const hookRows = (hooks) => hooks.map(
56056
- (h) => ` ${kleur_default.white(col(h.file, 34))}${kleur_default.yellow(col(h.event, 20))}${kleur_default.dim(h.desc)}`
56057
- ).join("\n");
56058
- const hooksSection = [
56059
- section("GLOBAL HOOKS"),
56040
+ " xtrm clean [options]",
56041
+ " Remove orphaned hooks/skills and stale hook wiring entries.",
56042
+ " Options: --dry-run, --hooks-only, --skills-only, --yes/-y",
56060
56043
  "",
56061
- kleur_default.dim(" " + col("File", 34) + col("Event", 20) + "Description"),
56044
+ " xtrm init",
56045
+ " Initialize project-level workflow setup.",
56062
56046
  "",
56063
- hookRows(general),
56047
+ " xtrm docs show [filter] [--raw] [--json]",
56048
+ " Show frontmatter for README/CHANGELOG/docs/*.md.",
56064
56049
  "",
56065
- ` ${kleur_default.dim("beads gate hooks (xtrm install all -- require beads+dolt):")}`,
56066
- hookRows(beads),
56050
+ " xtrm debug [options]",
56051
+ " Stream xtrm event log (tool calls, gates, session/bd lifecycle).",
56052
+ " Options: --follow, --all, --session <id>, --type <domain>, --json",
56067
56053
  "",
56068
- ` ${kleur_default.dim("session-flow hooks:")}`,
56069
- hookRows(sessionFlow)
56070
- ].join("\n");
56071
- const skillRows = skills.map((s) => {
56072
- const desc = s.desc.length > 46 ? s.desc.slice(0, 45) + "\u2026" : s.desc;
56073
- return ` ${kleur_default.white(col(s.name, 30))}${kleur_default.dim(desc)}`;
56074
- }).join("\n");
56075
- const skillsSection = [
56076
- section(`SKILLS ${kleur_default.dim("(" + skills.length + " available)")}`),
56054
+ " xtrm reset",
56055
+ " Clear saved CLI preferences.",
56077
56056
  "",
56078
- skills.length ? skillRows : kleur_default.dim(" (none found -- run from repo root to see skills)")
56079
- ].join("\n");
56080
- const otherSection = [
56081
- section("OTHER COMMANDS"),
56057
+ " xtrm help",
56058
+ " Show this help page."
56059
+ ]));
56060
+ blocks.push(section("RUNTIME COMMANDS", [
56061
+ " xt claude [name]",
56062
+ " Launch Claude in a sandboxed xt/<name> worktree.",
56063
+ " xt claude install [--dry-run]",
56064
+ " Install/refresh xtrm Claude plugin + official plugins.",
56065
+ " xt claude status | xt claude doctor | xt claude reload",
56082
56066
  "",
56083
- ` ${kleur_default.bold("xtrm status")} ${kleur_default.dim("Show pending changes without applying them")}`,
56084
- ` ${kleur_default.bold("xtrm clean")} ${kleur_default.dim("Remove orphaned hooks and skills not in canonical repo")}`,
56085
- ` ${kleur_default.bold("xtrm init")} ${kleur_default.dim("Initialize project data (beads, gitnexus, service-registry)")}`,
56086
- ` ${kleur_default.bold("xtrm docs show")} ${kleur_default.dim("Display frontmatter for README, CHANGELOG, docs/*.md")}`,
56087
- ` ${kleur_default.bold("xtrm debug")} ${kleur_default.dim("Watch xtrm hook and bd lifecycle events in real time")}`,
56088
- ` ${kleur_default.bold("xtrm reset")} ${kleur_default.dim("Clear saved preferences and start fresh")}`,
56089
- ` ${kleur_default.bold("xtrm end")} ${kleur_default.dim("Close worktree session: rebase, push, PR, link issues, cleanup")}`,
56090
- ` ${kleur_default.bold("xtrm worktree list")} ${kleur_default.dim("List all active xt/* worktrees with status")}`,
56091
- ` ${kleur_default.bold("xtrm worktree clean")} ${kleur_default.dim("Remove worktrees whose branch has been merged into main")}`,
56092
- ` ${kleur_default.bold("xtrm help")} ${kleur_default.dim("Show this overview")}`
56093
- ].join("\n");
56094
- const resourcesSection = [
56095
- section("RESOURCES"),
56096
- "",
56097
- ` Repository https://github.com/Jaggerxtrm/xtrm-tools`,
56098
- ` Issues https://github.com/Jaggerxtrm/xtrm-tools/issues`,
56099
- "",
56100
- ` ${kleur_default.dim("Run 'xtrm <command> --help' for command-specific options.")}`,
56101
- ""
56102
- ].join("\n");
56103
- console.log([installSection, hooksSection, skillsSection, otherSection, resourcesSection].join("\n"));
56067
+ " xt pi [name]",
56068
+ " Launch Pi in a sandboxed xt/<name> worktree.",
56069
+ " xt pi install [--dry-run]",
56070
+ " Non-interactive extension sync + package install.",
56071
+ " xt pi setup",
56072
+ " Interactive first-time setup.",
56073
+ " xt pi status | xt pi doctor | xt pi reload"
56074
+ ]));
56075
+ blocks.push(section("WORKTREE COMMANDS", [
56076
+ " xt worktree list",
56077
+ " List active xt/* worktrees and merge status.",
56078
+ " xt worktree clean [--yes/-y]",
56079
+ " Remove worktrees already merged into main.",
56080
+ " xt worktree remove <name> [--yes/-y]",
56081
+ " Remove a specific xt worktree by name or path."
56082
+ ]));
56083
+ blocks.push(section("SESSION CLOSE", [
56084
+ " xt end [options]",
56085
+ " Rebase to origin/main, push, open PR, link issues, and optionally clean worktree.",
56086
+ " Options: --draft, --keep, --yes/-y"
56087
+ ]));
56088
+ blocks.push(section("NOTES", [
56089
+ " - Banner is shown only for xtrm install.",
56090
+ " - For command-level details, run: xtrm <command> --help",
56091
+ " - For subcommand details, run: xtrm <command> <subcommand> --help"
56092
+ ]));
56093
+ process.stdout.write(blocks.join("\n"));
56104
56094
  });
56105
56095
  }
56106
56096
 
@@ -56110,7 +56100,6 @@ var import_path19 = __toESM(require("path"), 1);
56110
56100
  var import_os6 = require("os");
56111
56101
  var CANONICAL_HOOKS = /* @__PURE__ */ new Set([
56112
56102
  "using-xtrm-reminder.mjs",
56113
- "serena-workflow-reminder.py",
56114
56103
  "beads-gate-core.mjs",
56115
56104
  "beads-gate-utils.mjs",
56116
56105
  "beads-gate-messages.mjs",
@@ -56121,13 +56110,16 @@ var CANONICAL_HOOKS = /* @__PURE__ */ new Set([
56121
56110
  "beads-claim-sync.mjs",
56122
56111
  "beads-compact-save.mjs",
56123
56112
  "beads-compact-restore.mjs",
56113
+ "worktree-boundary.mjs",
56124
56114
  "statusline.mjs",
56125
56115
  "quality-check.cjs",
56126
56116
  "quality-check-env.mjs",
56127
56117
  "quality-check.py",
56118
+ "xtrm-logger.mjs",
56119
+ "xtrm-tool-logger.mjs",
56120
+ "xtrm-session-logger.mjs",
56128
56121
  "gitnexus",
56129
56122
  // directory
56130
- "statusline-starship.sh",
56131
56123
  "README.md"
56132
56124
  ]);
56133
56125
  var CANONICAL_SKILLS = /* @__PURE__ */ new Set([
@@ -56871,7 +56863,7 @@ var import_node_fs5 = require("fs");
56871
56863
  var import_node_path6 = require("path");
56872
56864
  var KIND_LABELS = {
56873
56865
  "session.start": { label: "SESS+", color: kleur_default.green },
56874
- "session.end": { label: "SESS-", color: kleur_default.dim },
56866
+ "session.end": { label: "SESS-", color: kleur_default.white },
56875
56867
  "gate.edit.allow": { label: "EDIT+", color: kleur_default.green },
56876
56868
  "gate.edit.block": { label: "EDIT-", color: kleur_default.red },
56877
56869
  "gate.commit.allow": { label: "CMIT+", color: kleur_default.green },
@@ -56967,16 +56959,15 @@ function buildDetail(event) {
56967
56959
  }
56968
56960
  }
56969
56961
  if (event.kind === "tool.call") {
56970
- if (d?.cmd) parts.push(kleur_default.dim(d.cmd.slice(0, 60)));
56971
- if (d?.file) parts.push(kleur_default.dim(d.file));
56962
+ if (d?.cmd) parts.push(kleur_default.dim(d.cmd.slice(0, 72)));
56963
+ if (d?.file) parts.push(kleur_default.dim((0, import_node_path6.basename)(d.file)));
56972
56964
  if (d?.pattern) parts.push(kleur_default.dim(`/${d.pattern}/`));
56973
- if (d?.url) parts.push(kleur_default.dim(d.url.slice(0, 60)));
56974
- if (d?.query) parts.push(kleur_default.dim(d.query.slice(0, 60)));
56975
- if (d?.prompt) parts.push(kleur_default.dim(d.prompt.slice(0, 60)));
56965
+ if (d?.url) parts.push(kleur_default.dim(d.url.slice(0, 72)));
56966
+ if (d?.query) parts.push(kleur_default.dim(d.query.slice(0, 72)));
56967
+ if (d?.prompt) parts.push(kleur_default.dim(d.prompt.slice(0, 72)));
56976
56968
  } else {
56977
56969
  if (event.issue_id) parts.push(kleur_default.yellow(event.issue_id));
56978
- if (d?.file) parts.push(kleur_default.dim(d.file));
56979
- if (d?.msg) parts.push(kleur_default.dim(d.msg.slice(0, 60)));
56970
+ if (d?.file) parts.push(kleur_default.dim((0, import_node_path6.basename)(d.file)));
56980
56971
  if (d?.reason_code) parts.push(kleur_default.dim(`[${d.reason_code}]`));
56981
56972
  if (event.worktree) parts.push(kleur_default.dim(`wt:${event.worktree}`));
56982
56973
  }
@@ -56988,13 +56979,7 @@ function formatLine(event, colorMap) {
56988
56979
  const session = colorFn(event.session_id.slice(0, 8));
56989
56980
  const label = getLabel(event);
56990
56981
  const detail = buildDetail(event);
56991
- return `${time3} ${session} ${label} ${detail}`;
56992
- }
56993
- function printHeader() {
56994
- console.log(
56995
- ` ${kleur_default.dim("TIME ")} ${kleur_default.dim("SESSION ")} ${kleur_default.dim("LABEL")} ${kleur_default.dim("DETAIL")}`
56996
- );
56997
- console.log(` ${kleur_default.dim("\u2500".repeat(72))}`);
56982
+ return `${time3} ${label} ${session} ${detail}`;
56998
56983
  }
56999
56984
  function findDbPath(cwd) {
57000
56985
  let dir = cwd;
@@ -57038,13 +57023,9 @@ function follow(dbPath, opts) {
57038
57023
  const initial = queryEvents(dbPath, buildWhere(opts, `ts >= ${sinceTs}`), 200);
57039
57024
  const colorMap = buildColorMap(initial);
57040
57025
  let lastId = 0;
57041
- if (initial.length > 0) {
57042
- for (const ev of initial) {
57043
- if (ev.id > lastId) lastId = ev.id;
57044
- opts.json ? console.log(JSON.stringify(ev)) : console.log(" " + formatLine(ev, colorMap));
57045
- }
57046
- } else if (!opts.json) {
57047
- console.log(kleur_default.dim(" (no recent events \u2014 waiting for new ones)\n"));
57026
+ for (const ev of initial) {
57027
+ if (ev.id > lastId) lastId = ev.id;
57028
+ opts.json ? console.log(JSON.stringify(ev)) : console.log(formatLine(ev, colorMap));
57048
57029
  }
57049
57030
  const interval = setInterval(() => {
57050
57031
  const events = queryEvents(dbPath, buildWhere(opts, `id > ${lastId}`), 50);
@@ -57052,13 +57033,12 @@ function follow(dbPath, opts) {
57052
57033
  extendColorMap(colorMap, events);
57053
57034
  for (const ev of events) {
57054
57035
  if (ev.id > lastId) lastId = ev.id;
57055
- opts.json ? console.log(JSON.stringify(ev)) : console.log(" " + formatLine(ev, colorMap));
57036
+ opts.json ? console.log(JSON.stringify(ev)) : console.log(formatLine(ev, colorMap));
57056
57037
  }
57057
57038
  }
57058
57039
  }, 2e3);
57059
57040
  process.on("SIGINT", () => {
57060
57041
  clearInterval(interval);
57061
- if (!opts.json) console.log(kleur_default.dim("\n stopped\n"));
57062
57042
  process.exit(0);
57063
57043
  });
57064
57044
  }
@@ -57066,29 +57046,12 @@ function createDebugCommand() {
57066
57046
  return new Command("debug").description("Watch xtrm events: tool calls, gate decisions, bd lifecycle").option("-f, --follow", "Follow new events (default)", false).option("--all", "Show full history and exit", false).option("--session <id>", "Filter by session ID (prefix match)").option("--type <domain>", "Filter by domain: tool | gate | bd | session").option("--json", "Output raw JSON lines", false).action((opts) => {
57067
57047
  const cwd = process.cwd();
57068
57048
  const dbPath = findDbPath(cwd);
57069
- if (!dbPath || !(0, import_node_fs5.existsSync)(dbPath)) {
57070
- if (!opts.json) {
57071
- console.log(kleur_default.bold("\n xtrm event log"));
57072
- console.log(kleur_default.dim(" No events yet \u2014 DB initializes on first hook fire.\n"));
57073
- console.log(kleur_default.dim(" Run from inside an xtrm project with beads initialized.\n"));
57074
- }
57075
- return;
57076
- }
57077
- if (!opts.json) {
57078
- console.log(kleur_default.bold("\n xtrm event log"));
57079
- console.log(kleur_default.dim(opts.all ? " Full history\n" : " Following \u2014 Ctrl+C to stop\n"));
57080
- printHeader();
57081
- }
57049
+ if (!dbPath || !(0, import_node_fs5.existsSync)(dbPath)) return;
57082
57050
  if (opts.all) {
57083
57051
  const events = queryEvents(dbPath, buildWhere(opts, ""), 1e3);
57084
- if (events.length === 0) {
57085
- if (!opts.json) console.log(kleur_default.dim("\n No events recorded yet.\n"));
57086
- } else {
57087
- const colorMap = buildColorMap(events);
57088
- for (const ev of events) {
57089
- opts.json ? console.log(JSON.stringify(ev)) : console.log(" " + formatLine(ev, colorMap));
57090
- }
57091
- if (!opts.json) console.log("");
57052
+ const colorMap = buildColorMap(events);
57053
+ for (const ev of events) {
57054
+ opts.json ? console.log(JSON.stringify(ev)) : console.log(formatLine(ev, colorMap));
57092
57055
  }
57093
57056
  return;
57094
57057
  }
@@ -57315,8 +57278,9 @@ process.on("unhandledRejection", (reason) => {
57315
57278
  process.exit(1);
57316
57279
  });
57317
57280
  var isHelpOrVersion = process.argv.some((a) => a === "--help" || a === "-h" || a === "--version" || a === "-V");
57281
+ var isInstallCommand = (process.argv[2] ?? "") === "install";
57318
57282
  (async () => {
57319
- if (!isHelpOrVersion) {
57283
+ if (!isHelpOrVersion && isInstallCommand) {
57320
57284
  await printBanner(version2);
57321
57285
  }
57322
57286
  program2.parseAsync(process.argv);