@weavecode/weave 0.1.7 → 0.1.9

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 (431) hide show
  1. package/node_modules/@modelcontextprotocol/sdk/node_modules/@hono/node-server/dist/index.cjs +31 -6
  2. package/node_modules/@modelcontextprotocol/sdk/node_modules/@hono/node-server/dist/index.mjs +31 -6
  3. package/node_modules/@modelcontextprotocol/sdk/node_modules/@hono/node-server/package.json +1 -1
  4. package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/dist/index.cjs +1 -1
  5. package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/dist/index.mjs +1 -1
  6. package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/node_modules/ip-address/README.md +39 -39
  7. package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/node_modules/ip-address/dist/ipv6.js +1 -1
  8. package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/node_modules/ip-address/package.json +1 -1
  9. package/node_modules/@modelcontextprotocol/sdk/node_modules/express-rate-limit/package.json +1 -1
  10. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +1 -1
  11. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/adapter/bun/websocket.js +1 -1
  12. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/context.js +1 -1
  13. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/helper/css/common.js +3 -5
  14. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/hono-base.js +4 -10
  15. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/hono.js +0 -1
  16. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +1 -1
  17. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +1 -1
  18. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/csrf/index.js +2 -2
  19. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +2 -2
  20. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +2 -2
  21. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/mount/index.js +4 -4
  22. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +13 -11
  23. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +4 -4
  24. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +39 -51
  25. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +15 -5
  26. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/jwt/jwt.js +2 -1
  27. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/mount.js +35 -0
  28. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/url.js +10 -0
  29. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/validator/validator.js +1 -1
  30. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/context.js +1 -1
  31. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/helper/css/common.js +3 -5
  32. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/hono-base.js +4 -10
  33. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/hono.js +0 -1
  34. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/basic-auth/index.js +1 -1
  35. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/bearer-auth/index.js +1 -1
  36. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/csrf/index.js +2 -2
  37. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/jwk/jwk.js +2 -2
  38. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/jwt/jwt.js +2 -2
  39. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/language/language.js +1 -1
  40. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/mount/index.js +4 -4
  41. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/node.js +13 -11
  42. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +5 -5
  43. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/router.js +40 -52
  44. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/trie.js +15 -5
  45. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/middleware/mount/index.d.ts +1 -0
  46. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -3
  47. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +1 -1
  48. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/utils/mount.d.ts +4 -0
  49. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/utils/url.d.ts +1 -0
  50. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/jwt/jwt.js +2 -1
  51. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/mount.js +34 -0
  52. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/url.js +10 -1
  53. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/validator/validator.js +1 -1
  54. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/package.json +1 -1
  55. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +3 -1
  56. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/deflate.js +2 -1
  57. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +2 -1
  58. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +1 -1
  59. package/node_modules/@weavecode/cli/dist/cli.js +4 -4
  60. package/node_modules/@weavecode/cli/dist/commands/chpass.js +1 -1
  61. package/node_modules/@weavecode/cli/dist/commands/daemon-auth.js +1 -1
  62. package/node_modules/@weavecode/cli/dist/commands/daemon.js +2 -2
  63. package/node_modules/@weavecode/cli/dist/commands/dashboard.js +2 -2
  64. package/node_modules/@weavecode/cli/dist/commands/doctor.js +1 -1
  65. package/node_modules/@weavecode/cli/dist/commands/init.js +1 -1
  66. package/node_modules/@weavecode/cli/dist/commands/scan.js +1 -1
  67. package/node_modules/@weavecode/cli/dist/commands/status.js +2 -2
  68. package/node_modules/@weavecode/cli/dist/commands/uninstall.js +1 -1
  69. package/node_modules/@weavecode/cli/dist/i18n/dict/en.js +3 -3
  70. package/node_modules/@weavecode/cli/dist/i18n/dict/zh.d.ts +7 -0
  71. package/node_modules/@weavecode/cli/dist/i18n/dict/zh.js +3 -3
  72. package/node_modules/@weavecode/cli/dist/i18n/index.js +1 -1
  73. package/node_modules/@weavecode/cli/dist/i18n/t.js +1 -1
  74. package/node_modules/@weavecode/cli/dist/init/claudemd-gen.js +5 -5
  75. package/node_modules/@weavecode/cli/dist/init/executor.js +3 -3
  76. package/node_modules/@weavecode/cli/dist/init/git-commit.js +2 -2
  77. package/node_modules/@weavecode/cli/dist/init/git-exclude.d.ts +20 -0
  78. package/node_modules/@weavecode/cli/dist/init/git-exclude.js +7 -0
  79. package/node_modules/@weavecode/cli/dist/init/harnesses/claude.js +7 -7
  80. package/node_modules/@weavecode/cli/dist/init/harnesses/codex.js +1 -1
  81. package/node_modules/@weavecode/cli/dist/init/instruction-files.d.ts +14 -0
  82. package/node_modules/@weavecode/cli/dist/init/instruction-files.js +1 -0
  83. package/node_modules/@weavecode/cli/dist/init/instruction-link.js +1 -1
  84. package/node_modules/@weavecode/cli/dist/init/plugin-templates.js +1 -1
  85. package/node_modules/@weavecode/cli/dist/init/prompt.js +4 -4
  86. package/node_modules/@weavecode/cli/dist/init/provision.js +1 -1
  87. package/node_modules/@weavecode/cli/dist/init/uninstall.js +6 -6
  88. package/node_modules/@weavecode/cli/dist/init/wiring.js +1 -1
  89. package/node_modules/@weavecode/cli/dist/parser.js +1 -1
  90. package/node_modules/@weavecode/cli/dist/statusline/ansi.js +1 -1
  91. package/node_modules/@weavecode/cli/package.json +5 -5
  92. package/node_modules/@weavecode/core/dist/harness-checks.js +1 -1
  93. package/node_modules/@weavecode/core/dist/harness.d.ts +115 -0
  94. package/node_modules/@weavecode/core/dist/harness.js +1 -1
  95. package/node_modules/@weavecode/core/dist/index.d.ts +1 -1
  96. package/node_modules/@weavecode/core/dist/index.js +1 -1
  97. package/node_modules/@weavecode/core/dist/platform.js +1 -1
  98. package/node_modules/@weavecode/core/dist/types.d.ts +4 -4
  99. package/node_modules/@weavecode/core/dist/types.js +1 -1
  100. package/node_modules/@weavecode/core/dist/utils/fs.js +1 -1
  101. package/node_modules/@weavecode/core/package.json +1 -1
  102. package/node_modules/@weavecode/harness/dist/claude/assets.js +3 -3
  103. package/node_modules/@weavecode/harness/dist/claude/capture.js +9 -9
  104. package/node_modules/@weavecode/harness/dist/claude/commands.d.ts +2 -0
  105. package/node_modules/@weavecode/harness/dist/claude/commands.js +3 -2
  106. package/node_modules/@weavecode/harness/dist/claude/config.js +2 -2
  107. package/node_modules/@weavecode/harness/dist/claude/detect.js +1 -1
  108. package/node_modules/@weavecode/harness/dist/claude/edits.js +1 -1
  109. package/node_modules/@weavecode/harness/dist/claude/event-source.js +1 -1
  110. package/node_modules/@weavecode/harness/dist/claude/images.js +2 -2
  111. package/node_modules/@weavecode/harness/dist/claude/index.js +1 -1
  112. package/node_modules/@weavecode/harness/dist/claude/liveness.js +1 -1
  113. package/node_modules/@weavecode/harness/dist/claude/mcp-gen.js +1 -1
  114. package/node_modules/@weavecode/harness/dist/claude/messaging.js +2 -2
  115. package/node_modules/@weavecode/harness/dist/claude/model-aliases.js +1 -1
  116. package/node_modules/@weavecode/harness/dist/claude/narration.js +1 -1
  117. package/node_modules/@weavecode/harness/dist/claude/peers.js +1 -1
  118. package/node_modules/@weavecode/harness/dist/claude/plan.js +1 -1
  119. package/node_modules/@weavecode/harness/dist/claude/plugins.js +4 -4
  120. package/node_modules/@weavecode/harness/dist/claude/prompt-inbox.js +1 -1
  121. package/node_modules/@weavecode/harness/dist/claude/prompt.js +3 -3
  122. package/node_modules/@weavecode/harness/dist/claude/questions.js +2 -2
  123. package/node_modules/@weavecode/harness/dist/claude/resume.js +1 -1
  124. package/node_modules/@weavecode/harness/dist/claude/rewind.js +1 -1
  125. package/node_modules/@weavecode/harness/dist/claude/settings-gen.js +1 -1
  126. package/node_modules/@weavecode/harness/dist/claude/side-question.js +2 -2
  127. package/node_modules/@weavecode/harness/dist/claude/statusline/generator.d.ts +6 -0
  128. package/node_modules/@weavecode/harness/dist/claude/statusline/generator.js +21 -14
  129. package/node_modules/@weavecode/harness/dist/claude/statusline/git-cache.js +1 -1
  130. package/node_modules/@weavecode/harness/dist/claude/statusline/surface.js +2 -2
  131. package/node_modules/@weavecode/harness/dist/claude/transcript-cursor.js +2 -2
  132. package/node_modules/@weavecode/harness/dist/claude/transcript.js +7 -7
  133. package/node_modules/@weavecode/harness/dist/codex/assets.js +1 -1
  134. package/node_modules/@weavecode/harness/dist/codex/capture.js +2 -2
  135. package/node_modules/@weavecode/harness/dist/codex/commands.js +4 -4
  136. package/node_modules/@weavecode/harness/dist/codex/config.js +2 -2
  137. package/node_modules/@weavecode/harness/dist/codex/detect.js +1 -1
  138. package/node_modules/@weavecode/harness/dist/codex/event-source.js +2 -2
  139. package/node_modules/@weavecode/harness/dist/codex/images.js +1 -1
  140. package/node_modules/@weavecode/harness/dist/codex/index.js +1 -1
  141. package/node_modules/@weavecode/harness/dist/codex/liveness.js +1 -1
  142. package/node_modules/@weavecode/harness/dist/codex/mcp.js +1 -1
  143. package/node_modules/@weavecode/harness/dist/codex/messaging.js +2 -2
  144. package/node_modules/@weavecode/harness/dist/codex/narration.js +1 -1
  145. package/node_modules/@weavecode/harness/dist/codex/plugin-state.js +1 -1
  146. package/node_modules/@weavecode/harness/dist/codex/plugins.js +3 -3
  147. package/node_modules/@weavecode/harness/dist/codex/provision.js +1 -1
  148. package/node_modules/@weavecode/harness/dist/codex/questions.js +2 -2
  149. package/node_modules/@weavecode/harness/dist/codex/rollout.js +5 -5
  150. package/node_modules/@weavecode/harness/dist/codex/side-question.js +4 -4
  151. package/node_modules/@weavecode/harness/dist/codex/titles.js +4 -4
  152. package/node_modules/@weavecode/harness/dist/codex/toml.js +13 -13
  153. package/node_modules/@weavecode/harness/dist/codex/transcript.js +2 -2
  154. package/node_modules/@weavecode/harness/dist/driver.d.ts +6 -0
  155. package/node_modules/@weavecode/harness/dist/driver.js +1 -1
  156. package/node_modules/@weavecode/harness/dist/init/generated.js +2 -2
  157. package/node_modules/@weavecode/harness/dist/init/pipeline.js +1 -1
  158. package/node_modules/@weavecode/harness/dist/registry-wiring.js +1 -1
  159. package/node_modules/@weavecode/harness/dist/shared/install-link.js +1 -1
  160. package/node_modules/@weavecode/harness/dist/shared/json-cap.js +1 -1
  161. package/node_modules/@weavecode/harness/package.json +2 -2
  162. package/node_modules/@weavecode/server/dist/config/dotted.js +1 -1
  163. package/node_modules/@weavecode/server/dist/config/profiles.js +2 -2
  164. package/node_modules/@weavecode/server/dist/daemon/ai-config.js +2 -2
  165. package/node_modules/@weavecode/server/dist/daemon/ai-context.js +6 -6
  166. package/node_modules/@weavecode/server/dist/daemon/ai-routes.js +4 -4
  167. package/node_modules/@weavecode/server/dist/daemon/api-log.js +3 -3
  168. package/node_modules/@weavecode/server/dist/daemon/auth-routes.js +1 -1
  169. package/node_modules/@weavecode/server/dist/daemon/auto-start.js +3 -3
  170. package/node_modules/@weavecode/server/dist/daemon/capture-routes.js +1 -1
  171. package/node_modules/@weavecode/server/dist/daemon/config-routes.js +1 -1
  172. package/node_modules/@weavecode/server/dist/daemon/cron.js +1 -1
  173. package/node_modules/@weavecode/server/dist/daemon/dashboard-auth.js +2 -2
  174. package/node_modules/@weavecode/server/dist/daemon/dashboard-pusher.js +1 -1
  175. package/node_modules/@weavecode/server/dist/daemon/decision-config.js +2 -2
  176. package/node_modules/@weavecode/server/dist/daemon/dev-entry.js +1 -1
  177. package/node_modules/@weavecode/server/dist/daemon/entry.js +2 -2
  178. package/node_modules/@weavecode/server/dist/daemon/fs-browser.js +1 -1
  179. package/node_modules/@weavecode/server/dist/daemon/hook-pipeline.js +1 -1
  180. package/node_modules/@weavecode/server/dist/daemon/hooks-routes.js +1 -1
  181. package/node_modules/@weavecode/server/dist/daemon/http.js +1 -1
  182. package/node_modules/@weavecode/server/dist/daemon/liveness.js +1 -1
  183. package/node_modules/@weavecode/server/dist/daemon/mcp-orchestration.js +1 -1
  184. package/node_modules/@weavecode/server/dist/daemon/narration-watcher.js +2 -2
  185. package/node_modules/@weavecode/server/dist/daemon/opener/backend-ghostty.js +1 -1
  186. package/node_modules/@weavecode/server/dist/daemon/opener/backend-iterm.js +1 -1
  187. package/node_modules/@weavecode/server/dist/daemon/opener/backend-konsole.js +2 -2
  188. package/node_modules/@weavecode/server/dist/daemon/opener/backend-terminal-app.js +1 -1
  189. package/node_modules/@weavecode/server/dist/daemon/opener/backend-wezterm.js +1 -1
  190. package/node_modules/@weavecode/server/dist/daemon/opener/backend-wt.js +1 -1
  191. package/node_modules/@weavecode/server/dist/daemon/opener/backend.js +1 -1
  192. package/node_modules/@weavecode/server/dist/daemon/opener/pty-terminals.js +1 -1
  193. package/node_modules/@weavecode/server/dist/daemon/opener/shared.js +1 -1
  194. package/node_modules/@weavecode/server/dist/daemon/opener/wezterm-mux.js +1 -1
  195. package/node_modules/@weavecode/server/dist/daemon/opener/wt.js +3 -3
  196. package/node_modules/@weavecode/server/dist/daemon/opener.js +1 -1
  197. package/node_modules/@weavecode/server/dist/daemon/pet-seed.d.ts +4 -0
  198. package/node_modules/@weavecode/server/dist/daemon/pet-seed.js +2 -0
  199. package/node_modules/@weavecode/server/dist/daemon/pet-window.d.ts +17 -0
  200. package/node_modules/@weavecode/server/dist/daemon/pet-window.js +2 -0
  201. package/node_modules/@weavecode/server/dist/daemon/port.js +1 -1
  202. package/node_modules/@weavecode/server/dist/daemon/project-files.d.ts +1 -1
  203. package/node_modules/@weavecode/server/dist/daemon/project-files.js +2 -2
  204. package/node_modules/@weavecode/server/dist/daemon/project-harnesses.js +2 -2
  205. package/node_modules/@weavecode/server/dist/daemon/project-updates-refresher.js +1 -1
  206. package/node_modules/@weavecode/server/dist/daemon/prompt-images.js +1 -1
  207. package/node_modules/@weavecode/server/dist/daemon/routes/hooks-admin.js +1 -1
  208. package/node_modules/@weavecode/server/dist/daemon/routes/installations.d.ts +29 -0
  209. package/node_modules/@weavecode/server/dist/daemon/routes/installations.js +1 -0
  210. package/node_modules/@weavecode/server/dist/daemon/routes/market.js +1 -1
  211. package/node_modules/@weavecode/server/dist/daemon/routes/orchestration.js +1 -1
  212. package/node_modules/@weavecode/server/dist/daemon/routes/path-refs.js +1 -1
  213. package/node_modules/@weavecode/server/dist/daemon/routes/pets.d.ts +3 -0
  214. package/node_modules/@weavecode/server/dist/daemon/routes/pets.js +1 -0
  215. package/node_modules/@weavecode/server/dist/daemon/routes/project-files.js +1 -1
  216. package/node_modules/@weavecode/server/dist/daemon/routes/projects.js +1 -1
  217. package/node_modules/@weavecode/server/dist/daemon/routes/search.js +1 -1
  218. package/node_modules/@weavecode/server/dist/daemon/routes/session-control.js +1 -1
  219. package/node_modules/@weavecode/server/dist/daemon/routes/session-insights.js +1 -1
  220. package/node_modules/@weavecode/server/dist/daemon/routes/settings-statusline.js +1 -1
  221. package/node_modules/@weavecode/server/dist/daemon/routes/uploads.js +1 -1
  222. package/node_modules/@weavecode/server/dist/daemon/routes/visualizations.js +2 -1
  223. package/node_modules/@weavecode/server/dist/daemon/routes/watches.js +1 -1
  224. package/node_modules/@weavecode/server/dist/daemon/server.d.ts +4 -0
  225. package/node_modules/@weavecode/server/dist/daemon/server.js +8 -8
  226. package/node_modules/@weavecode/server/dist/daemon/session-open.js +1 -1
  227. package/node_modules/@weavecode/server/dist/daemon/session-probe.js +1 -1
  228. package/node_modules/@weavecode/server/dist/daemon/settings.d.ts +21 -0
  229. package/node_modules/@weavecode/server/dist/daemon/settings.js +2 -2
  230. package/node_modules/@weavecode/server/dist/daemon/snapshot-refresher.js +1 -1
  231. package/node_modules/@weavecode/server/dist/daemon/sse-hub.js +1 -1
  232. package/node_modules/@weavecode/server/dist/daemon/start.js +1 -1
  233. package/node_modules/@weavecode/server/dist/daemon/state.js +2 -2
  234. package/node_modules/@weavecode/server/dist/daemon/static.js +1 -1
  235. package/node_modules/@weavecode/server/dist/daemon/terminal-topology-refresher.js +1 -1
  236. package/node_modules/@weavecode/server/dist/daemon/tls.js +1 -1
  237. package/node_modules/@weavecode/server/dist/daemon/toolkit-routes.js +1 -1
  238. package/node_modules/@weavecode/server/dist/daemon/upload-sessions.js +1 -1
  239. package/node_modules/@weavecode/server/dist/db/db.d.ts +4 -1
  240. package/node_modules/@weavecode/server/dist/db/db.js +2 -2
  241. package/node_modules/@weavecode/server/dist/db/layout.d.ts +5 -0
  242. package/node_modules/@weavecode/server/dist/db/layout.js +2 -1
  243. package/node_modules/@weavecode/server/dist/db/paths.d.ts +9 -0
  244. package/node_modules/@weavecode/server/dist/db/paths.js +1 -1
  245. package/node_modules/@weavecode/server/dist/hooks/answer-keys.js +1 -1
  246. package/node_modules/@weavecode/server/dist/hooks/dashboard-rate.js +1 -1
  247. package/node_modules/@weavecode/server/dist/hooks/decision-judge.js +1 -1
  248. package/node_modules/@weavecode/server/dist/hooks/delivery/ack-gate.js +1 -1
  249. package/node_modules/@weavecode/server/dist/hooks/delivery/channels.js +1 -1
  250. package/node_modules/@weavecode/server/dist/hooks/delivery/keys.js +1 -1
  251. package/node_modules/@weavecode/server/dist/hooks/delivery/queue.js +1 -1
  252. package/node_modules/@weavecode/server/dist/hooks/delivery/relay.js +1 -1
  253. package/node_modules/@weavecode/server/dist/hooks/delivery/send.js +2 -2
  254. package/node_modules/@weavecode/server/dist/hooks/delivery/views.js +1 -1
  255. package/node_modules/@weavecode/server/dist/hooks/dispatcher.js +6 -6
  256. package/node_modules/@weavecode/server/dist/hooks/edge-extract.js +1 -1
  257. package/node_modules/@weavecode/server/dist/hooks/handlers/webhook.js +1 -1
  258. package/node_modules/@weavecode/server/dist/hooks/headless-runner.js +2 -2
  259. package/node_modules/@weavecode/server/dist/hooks/inbox-socket.js +2 -2
  260. package/node_modules/@weavecode/server/dist/hooks/inbox-worker.js +3 -3
  261. package/node_modules/@weavecode/server/dist/hooks/match.js +1 -1
  262. package/node_modules/@weavecode/server/dist/hooks/message-deliverer.js +5 -5
  263. package/node_modules/@weavecode/server/dist/hooks/mirror.js +4 -4
  264. package/node_modules/@weavecode/server/dist/hooks/orchestration-engine.js +7 -7
  265. package/node_modules/@weavecode/server/dist/hooks/orchestration-graph.js +1 -1
  266. package/node_modules/@weavecode/server/dist/hooks/plugin-installer.js +3 -3
  267. package/node_modules/@weavecode/server/dist/hooks/plugin-loader.js +1 -1
  268. package/node_modules/@weavecode/server/dist/hooks/plugin-project-state.js +1 -1
  269. package/node_modules/@weavecode/server/dist/hooks/prompt-flusher.js +1 -1
  270. package/node_modules/@weavecode/server/dist/hooks/promptbox.js +8 -8
  271. package/node_modules/@weavecode/server/dist/hooks/push-notify.js +2 -2
  272. package/node_modules/@weavecode/server/dist/hooks/question-tracker.js +1 -1
  273. package/node_modules/@weavecode/server/dist/hooks/registry.js +1 -1
  274. package/node_modules/@weavecode/server/dist/hooks/resume-runner.js +1 -1
  275. package/node_modules/@weavecode/server/dist/hooks/session-purge.js +1 -1
  276. package/node_modules/@weavecode/server/dist/hooks/side-questions.js +1 -1
  277. package/node_modules/@weavecode/server/dist/hooks/synthetic-sessions.js +1 -1
  278. package/node_modules/@weavecode/server/dist/hooks/toolkit-scan.js +1 -1
  279. package/node_modules/@weavecode/server/dist/hooks/toolkit.js +5 -5
  280. package/node_modules/@weavecode/server/dist/hooks/watch-engine.js +1 -1
  281. package/node_modules/@weavecode/server/dist/index.d.ts +1 -1
  282. package/node_modules/@weavecode/server/dist/index.js +1 -1
  283. package/node_modules/@weavecode/server/dist/install/apply-update.js +1 -1
  284. package/node_modules/@weavecode/server/dist/install/capabilities.js +1 -1
  285. package/node_modules/@weavecode/server/dist/install/codex-toml.js +1 -1
  286. package/node_modules/@weavecode/server/dist/install/file-assets.js +1 -1
  287. package/node_modules/@weavecode/server/dist/install/fingerprint.js +1 -1
  288. package/node_modules/@weavecode/server/dist/install/global-config.js +1 -1
  289. package/node_modules/@weavecode/server/dist/install/global-file-assets.js +1 -1
  290. package/node_modules/@weavecode/server/dist/install/init-files.d.ts +0 -9
  291. package/node_modules/@weavecode/server/dist/install/init-files.js +2 -2
  292. package/node_modules/@weavecode/server/dist/install/install-ledger.js +1 -1
  293. package/node_modules/@weavecode/server/dist/install/installer.js +1 -1
  294. package/node_modules/@weavecode/server/dist/install/library-index.js +1 -1
  295. package/node_modules/@weavecode/server/dist/install/mcp-rows.js +1 -1
  296. package/node_modules/@weavecode/server/dist/install/plugin-install.js +1 -1
  297. package/node_modules/@weavecode/server/dist/install/plugin-rows.js +1 -1
  298. package/node_modules/@weavecode/server/dist/install/plugin-templates.js +1 -1
  299. package/node_modules/@weavecode/server/dist/install/project-config.js +1 -1
  300. package/node_modules/@weavecode/server/dist/install/reader.js +1 -1
  301. package/node_modules/@weavecode/server/dist/install/scan-cache.js +1 -1
  302. package/node_modules/@weavecode/server/dist/install/scanner.js +1 -1
  303. package/node_modules/@weavecode/server/dist/install/settings-mcp.js +2 -2
  304. package/node_modules/@weavecode/server/dist/install/updates.js +1 -1
  305. package/node_modules/@weavecode/server/dist/market/builtin.js +1 -1
  306. package/node_modules/@weavecode/server/dist/market/identity.js +1 -1
  307. package/node_modules/@weavecode/server/dist/market/import.js +2 -2
  308. package/node_modules/@weavecode/server/dist/market/refresh.js +1 -1
  309. package/node_modules/@weavecode/server/dist/market/resolve.js +1 -1
  310. package/node_modules/@weavecode/server/dist/market/updates.js +1 -1
  311. package/node_modules/@weavecode/server/dist/registry.js +2 -2
  312. package/node_modules/@weavecode/server/dist/repositories/hook-dispatches.js +4 -4
  313. package/node_modules/@weavecode/server/dist/repositories/hook-events.d.ts +6 -0
  314. package/node_modules/@weavecode/server/dist/repositories/hook-events.js +8 -5
  315. package/node_modules/@weavecode/server/dist/repositories/hook-rules.js +4 -4
  316. package/node_modules/@weavecode/server/dist/repositories/libraries.js +1 -1
  317. package/node_modules/@weavecode/server/dist/repositories/orchestrations.js +7 -7
  318. package/node_modules/@weavecode/server/dist/repositories/plugin-states.js +1 -1
  319. package/node_modules/@weavecode/server/dist/repositories/projects.js +1 -1
  320. package/node_modules/@weavecode/server/dist/repositories/push-subscriptions.js +2 -2
  321. package/node_modules/@weavecode/server/dist/repositories/session-watches.js +4 -4
  322. package/node_modules/@weavecode/server/dist/repositories/sessions.js +2 -2
  323. package/node_modules/@weavecode/server/dist/repositories/uploads.js +11 -11
  324. package/node_modules/@weavecode/server/dist/statusline/cache-sweeper.js +1 -1
  325. package/node_modules/@weavecode/server/dist/statusline/generator.js +1 -1
  326. package/node_modules/@weavecode/server/dist/statusline/manager.js +3 -3
  327. package/node_modules/@weavecode/server/dist/surfaces.js +1 -1
  328. package/node_modules/@weavecode/server/dist/watch/cache.js +1 -1
  329. package/node_modules/@weavecode/server/dist/watch/classifier.js +1 -1
  330. package/node_modules/@weavecode/server/dist/watch/plugin-mods.js +1 -1
  331. package/node_modules/@weavecode/server/dist/watch/sync-scheduler.js +1 -1
  332. package/node_modules/@weavecode/server/dist/watch/watch-service.js +1 -1
  333. package/node_modules/@weavecode/server/package.json +4 -4
  334. package/node_modules/@weavecode/server/web/dist/assets/abnfDiagram-WEYOIA3C-S1lL1V_n.js +1 -0
  335. package/node_modules/@weavecode/server/web/dist/assets/{arc-CRZTRyjb.js → arc-CoTNHyHV.js} +1 -1
  336. package/node_modules/@weavecode/server/web/dist/assets/architectureDiagram-ZHVYKT53-C6ttfnzW.js +36 -0
  337. package/node_modules/@weavecode/server/web/dist/assets/{blockDiagram-RJAE7QA3-BIH8mSIZ.js → blockDiagram-RJAE7QA3-CYr3Cpu9.js} +2 -2
  338. package/node_modules/@weavecode/server/web/dist/assets/{c4Diagram-XDPPPE54-5YoKWFOD.js → c4Diagram-XDPPPE54-BFS7PhLD.js} +2 -2
  339. package/node_modules/@weavecode/server/web/dist/assets/channel-DxQHp3Yc.js +1 -0
  340. package/node_modules/@weavecode/server/web/dist/assets/{chunk-2E7WHVMD-B653kMXt.js → chunk-2E7WHVMD-DJ7X_Shu.js} +1 -1
  341. package/node_modules/@weavecode/server/web/dist/assets/{chunk-2Q5K7J3B-f_A4_eDz.js → chunk-2Q5K7J3B-B8nr2rdz.js} +1 -1
  342. package/node_modules/@weavecode/server/web/dist/assets/{chunk-4EMNKR2T-v5j5qNGj.js → chunk-4EMNKR2T-DmnZmUMU.js} +1 -1
  343. package/node_modules/@weavecode/server/web/dist/assets/chunk-55XCU76K-Xz9a8dmp.js +1 -0
  344. package/node_modules/@weavecode/server/web/dist/assets/{chunk-5VM5RSS4-BeROhLXN.js → chunk-5VM5RSS4-Dg9mg7pf.js} +1 -1
  345. package/node_modules/@weavecode/server/web/dist/assets/{chunk-JWPE2WC7-D6dXb_jr.js → chunk-JWPE2WC7-CmjTZO8o.js} +1 -1
  346. package/node_modules/@weavecode/server/web/dist/assets/{chunk-VQ5W62QI-CnHdSEMi.js → chunk-VQ5W62QI-D3YDdJ3E.js} +1 -1
  347. package/node_modules/@weavecode/server/web/dist/assets/chunk-XXDRQBXY-s1OG9sqW.js +1 -0
  348. package/node_modules/@weavecode/server/web/dist/assets/chunk-ZCHMQSOR-C3hINQU3.js +2 -0
  349. package/node_modules/@weavecode/server/web/dist/assets/{classDiagram-v2-4MYWR3UA-DQe1b_k8.js → classDiagram-v2-4MYWR3UA-BTsbYrVl.js} +2 -2
  350. package/node_modules/@weavecode/server/web/dist/assets/cose-bilkent-JH36ORCC-C0W8Y-jI.js +1 -0
  351. package/node_modules/@weavecode/server/web/dist/assets/{cynefin-EF2NZ3EQ-OZotFKUu.js → cynefin-EF2NZ3EQ-stAu4Rh-.js} +1 -1
  352. package/node_modules/@weavecode/server/web/dist/assets/cynefinDiagram-WF24UDRP-CqYibiiv.js +62 -0
  353. package/node_modules/@weavecode/server/web/dist/assets/dagre-NK4GIZVX-qqcoJAqB.js +4 -0
  354. package/node_modules/@weavecode/server/web/dist/assets/diagram-CBK3MWTC-D0YTopb7.js +24 -0
  355. package/node_modules/@weavecode/server/web/dist/assets/diagram-I5XIIV2D-Csvw6aYr.js +24 -0
  356. package/node_modules/@weavecode/server/web/dist/assets/{diagram-ODIL2UCW-D9A6W8oB.js → diagram-ODIL2UCW-Dl0tYLkF.js} +2 -2
  357. package/node_modules/@weavecode/server/web/dist/assets/{diagram-PFBEJUXE-PeI-eyu2.js → diagram-PFBEJUXE-BCPSWZPe.js} +2 -2
  358. package/node_modules/@weavecode/server/web/dist/assets/diagram-RJA3I4VV-ETg-BrAJ.js +41 -0
  359. package/node_modules/@weavecode/server/web/dist/assets/{diagram-TYUNFSNR-D5KieEw5.js → diagram-TYUNFSNR-_M6ZxBG7.js} +2 -2
  360. package/node_modules/@weavecode/server/web/dist/assets/ebnfDiagram-V4P3TTPT-C-e_W7qx.js +1 -0
  361. package/node_modules/@weavecode/server/web/dist/assets/{elk-QONTBCTQ-D3xrVg0U.js → elk-QONTBCTQ-B5TBharB.js} +3 -3
  362. package/node_modules/@weavecode/server/web/dist/assets/{erDiagram-KYQIGQAA-y_V1cor7.js → erDiagram-KYQIGQAA-D08rj2pv.js} +2 -2
  363. package/node_modules/@weavecode/server/web/dist/assets/{flowDiagram-IUGLLWBU-BJ8Z0MkF.js → flowDiagram-IUGLLWBU-BALTxsKh.js} +1 -1
  364. package/node_modules/@weavecode/server/web/dist/assets/ganttDiagram-R7GPNTJY-Cts193jT.js +292 -0
  365. package/node_modules/@weavecode/server/web/dist/assets/gitGraphDiagram-PDYL7XHY-L9qYUX0v.js +106 -0
  366. package/node_modules/@weavecode/server/web/dist/assets/infoDiagram-MVDRKAX5-Bv47rgU0.js +2 -0
  367. package/node_modules/@weavecode/server/web/dist/assets/{ishikawaDiagram-HPEHV2GE-ChEnND76.js → ishikawaDiagram-HPEHV2GE-Da8_s6cs.js} +2 -2
  368. package/node_modules/@weavecode/server/web/dist/assets/{journeyDiagram-BOSHW7O7-DHcNtpYF.js → journeyDiagram-BOSHW7O7-Bj3CjZOf.js} +2 -2
  369. package/node_modules/@weavecode/server/web/dist/assets/{kanban-definition-FNSA4HC5-Dft7qpW5.js → kanban-definition-FNSA4HC5-D1hicmMu.js} +2 -2
  370. package/node_modules/@weavecode/server/web/dist/assets/linear-CWQg2iA1.js +1 -0
  371. package/node_modules/@weavecode/server/web/dist/assets/main-XLn3EZFh.css +11 -0
  372. package/node_modules/@weavecode/server/web/dist/assets/main-bsb0lQoL.js +1096 -0
  373. package/node_modules/@weavecode/server/web/dist/assets/{mermaid.core-D_Dp_Kl2.js → mermaid.core-C-wP0Zg2.js} +4 -4
  374. package/node_modules/@weavecode/server/web/dist/assets/{mindmap-definition-6OY57UG3-CM6OAd_-.js → mindmap-definition-6OY57UG3-Dk0VKqre.js} +2 -2
  375. package/node_modules/@weavecode/server/web/dist/assets/modulepreload-polyfill-B5Qt9EMX.js +1 -0
  376. package/node_modules/@weavecode/server/web/dist/assets/pegDiagram-ECIUJNBX-Bp1K_F9z.js +1 -0
  377. package/node_modules/@weavecode/server/web/dist/assets/pet-J6izA90s.js +1 -0
  378. package/node_modules/@weavecode/server/web/dist/assets/pieDiagram-GNMPY74T-BZ4rGy3t.js +39 -0
  379. package/node_modules/@weavecode/server/web/dist/assets/{quadrantDiagram-D57K4MC3-D8pQ_PU2.js → quadrantDiagram-D57K4MC3-B4N5KRsR.js} +4 -4
  380. package/node_modules/@weavecode/server/web/dist/assets/railroadDiagram-Y72NRBL7-C8nx8oHf.js +1 -0
  381. package/node_modules/@weavecode/server/web/dist/assets/{requirementDiagram-EQYSW5RA-C90DU5Ny.js → requirementDiagram-EQYSW5RA-VSH57d0d.js} +2 -2
  382. package/node_modules/@weavecode/server/web/dist/assets/{sankeyDiagram-SY24JHO5-B_poYGgJ.js → sankeyDiagram-SY24JHO5-jUb1hcya.js} +2 -2
  383. package/node_modules/@weavecode/server/web/dist/assets/{sequenceDiagram-BLEHNHQU-DDW7b2Dn.js → sequenceDiagram-BLEHNHQU-E2BioCNi.js} +2 -2
  384. package/node_modules/@weavecode/server/web/dist/assets/sizeCapture-INFHLROL-BdKrbRmI.js +1 -0
  385. package/node_modules/@weavecode/server/web/dist/assets/{stateDiagram-v2-A6IESKWZ-CkVMAyxG.js → stateDiagram-v2-A6IESKWZ-tFz7uNM7.js} +2 -2
  386. package/node_modules/@weavecode/server/web/dist/assets/swimlanes-B3ENRKFQ-B9BAPDWw.js +1 -0
  387. package/node_modules/@weavecode/server/web/dist/assets/swimlanesDiagram-AYQRV4AK-DQ2NPLl9.js +8 -0
  388. package/node_modules/@weavecode/server/web/dist/assets/{timeline-definition-JXYKGLGB-DnhkRGLb.js → timeline-definition-JXYKGLGB-CofNnFTK.js} +2 -2
  389. package/node_modules/@weavecode/server/web/dist/assets/{usecaseDiagram-WPOLBNNX-_TdIjC6Z.js → usecaseDiagram-WPOLBNNX-DOvjhJjJ.js} +2 -2
  390. package/node_modules/@weavecode/server/web/dist/assets/{vennDiagram-Q3Y3IDCW-FzgsymXB.js → vennDiagram-Q3Y3IDCW-BcFHWnhS.js} +2 -2
  391. package/node_modules/@weavecode/server/web/dist/assets/{wardleyDiagram-IVAIDKWA-BwqimStC.js → wardleyDiagram-IVAIDKWA-Bz2aqRAs.js} +2 -2
  392. package/node_modules/@weavecode/server/web/dist/assets/{xychartDiagram-4URNHDU4-CFjjVPIV.js → xychartDiagram-4URNHDU4-DpNF6Vsq.js} +2 -2
  393. package/node_modules/@weavecode/server/web/dist/index.html +3 -2
  394. package/node_modules/@weavecode/server/web/dist/pet.html +130 -0
  395. package/node_modules/@weavecode/templates/dist/index.d.ts +2 -0
  396. package/node_modules/@weavecode/templates/dist/index.js +1 -1
  397. package/node_modules/@weavecode/templates/dist/resources/pets/weave-spider/pet.json +7 -0
  398. package/node_modules/@weavecode/templates/dist/resources/pets/weave-spider/spritesheet.png +0 -0
  399. package/node_modules/@weavecode/templates/dist/resources/weave-market/.claude-plugin/marketplace.json +6 -0
  400. package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/.claude-plugin/plugin.json +8 -0
  401. package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/skills/weave-pet-hatcher/SKILL.md +121 -0
  402. package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/skills/weave-pet-hatcher/scripts/assemble-pet.mjs +308 -0
  403. package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/weave.json +4 -0
  404. package/node_modules/@weavecode/templates/package.json +2 -2
  405. package/package.json +11 -7
  406. package/scripts/preinstall.mjs +108 -0
  407. package/node_modules/@weavecode/server/web/dist/assets/abnfDiagram-WEYOIA3C-DDeQkTf5.js +0 -1
  408. package/node_modules/@weavecode/server/web/dist/assets/architectureDiagram-ZHVYKT53-Dj54DE3O.js +0 -36
  409. package/node_modules/@weavecode/server/web/dist/assets/channel-5VM93AJ8.js +0 -1
  410. package/node_modules/@weavecode/server/web/dist/assets/chunk-55XCU76K-CgEqeP7j.js +0 -1
  411. package/node_modules/@weavecode/server/web/dist/assets/chunk-XXDRQBXY-BkG_e6PE.js +0 -1
  412. package/node_modules/@weavecode/server/web/dist/assets/chunk-ZCHMQSOR-DxR-fxzs.js +0 -2
  413. package/node_modules/@weavecode/server/web/dist/assets/cose-bilkent-JH36ORCC-DThrA8S5.js +0 -1
  414. package/node_modules/@weavecode/server/web/dist/assets/cynefinDiagram-WF24UDRP-DJjq2hfT.js +0 -62
  415. package/node_modules/@weavecode/server/web/dist/assets/dagre-NK4GIZVX-C2vH93HT.js +0 -4
  416. package/node_modules/@weavecode/server/web/dist/assets/diagram-CBK3MWTC-DrF_ScM-.js +0 -24
  417. package/node_modules/@weavecode/server/web/dist/assets/diagram-I5XIIV2D-D1qoUJ4t.js +0 -24
  418. package/node_modules/@weavecode/server/web/dist/assets/diagram-RJA3I4VV-DITY0Rd8.js +0 -41
  419. package/node_modules/@weavecode/server/web/dist/assets/ebnfDiagram-V4P3TTPT-DDylK-gz.js +0 -1
  420. package/node_modules/@weavecode/server/web/dist/assets/ganttDiagram-R7GPNTJY-C0q-CS1T.js +0 -292
  421. package/node_modules/@weavecode/server/web/dist/assets/gitGraphDiagram-PDYL7XHY-BYTComiB.js +0 -106
  422. package/node_modules/@weavecode/server/web/dist/assets/index-BKxAxaVG.js +0 -1091
  423. package/node_modules/@weavecode/server/web/dist/assets/index-C0Sd4MH7.css +0 -11
  424. package/node_modules/@weavecode/server/web/dist/assets/infoDiagram-MVDRKAX5-DtixgjLP.js +0 -2
  425. package/node_modules/@weavecode/server/web/dist/assets/linear-DEo11t-X.js +0 -1
  426. package/node_modules/@weavecode/server/web/dist/assets/pegDiagram-ECIUJNBX-_QkY0h8Q.js +0 -1
  427. package/node_modules/@weavecode/server/web/dist/assets/pieDiagram-GNMPY74T-ZGr5vtDj.js +0 -39
  428. package/node_modules/@weavecode/server/web/dist/assets/railroadDiagram-Y72NRBL7-DUIo-WmA.js +0 -1
  429. package/node_modules/@weavecode/server/web/dist/assets/sizeCapture-INFHLROL-CmKoqX6K.js +0 -1
  430. package/node_modules/@weavecode/server/web/dist/assets/swimlanes-B3ENRKFQ-Dm_Omzky.js +0 -1
  431. package/node_modules/@weavecode/server/web/dist/assets/swimlanesDiagram-AYQRV4AK-Bjj8ZA4d.js +0 -8
@@ -1,5 +1,5 @@
1
1
  import "../../router.js";
2
- import { emptyParam, match } from "./matcher.js";
2
+ import { match } from "./matcher.js";
3
3
  import { RegExpRouter } from "./router.js";
4
4
  //#region src/router/reg-exp-router/prepared-router.ts
5
5
  var PreparedRegExpRouter = class {
@@ -27,7 +27,7 @@ var PreparedRegExpRouter = class {
27
27
  if (!this.#matchers[method]) {
28
28
  const all = this.#matchers["ALL"];
29
29
  const staticMap = {};
30
- for (const key in all[2]) staticMap[key] = [all[2][key][0].slice(), emptyParam];
30
+ for (const key in all[2]) staticMap[key] = [all[2][key][0].slice(), all[2][key][1]];
31
31
  this.#matchers[method] = [
32
32
  all[0],
33
33
  all[1].map((list) => Array.isArray(list) ? list.slice() : 0),
@@ -71,7 +71,7 @@ const buildInitParams = ({ paths }) => {
71
71
  ...map
72
72
  };
73
73
  else relocateMap[path] = [[[], map]];
74
- if (relocateMap[path][0][0].findIndex((j) => j === i) === -1) relocateMap[path][0][0].push(i);
74
+ if (!relocateMap[path][0][0].includes(i)) relocateMap[path][0][0].push(i);
75
75
  }
76
76
  });
77
77
  });
@@ -79,7 +79,7 @@ const buildInitParams = ({ paths }) => {
79
79
  if (p === path) {
80
80
  relocateMap[path] ||= [[[]]];
81
81
  const value = path2 === path ? "" : path2;
82
- if (relocateMap[path][0][0].findIndex((v) => v === value) === -1) relocateMap[path][0][0].push(value);
82
+ if (!relocateMap[path][0][0].includes(value)) relocateMap[path][0][0].push(value);
83
83
  }
84
84
  });
85
85
  }
@@ -88,7 +88,7 @@ const buildInitParams = ({ paths }) => {
88
88
  return [matchers, relocateMap];
89
89
  };
90
90
  const serializeInitParams = ([matchers, relocateMap]) => {
91
- return `[${JSON.stringify(matchers, (_, value) => value instanceof RegExp ? `##${value.toString()}##` : value).replace(/"##(.+?)##"/g, (_, str) => str.replace(/\\\\/g, "\\"))},${JSON.stringify(relocateMap)}]`;
91
+ return `[${JSON.stringify(matchers, (_, value) => value instanceof RegExp || value === void 0 ? `##${value}##` : value).replace(/"##(.+?)##"/g, (_, str) => str.replace(/\\\\/g, "\\"))},${JSON.stringify(relocateMap)}]`;
92
92
  };
93
93
  //#endregion
94
94
  export { PreparedRegExpRouter, buildInitParams, serializeInitParams };
@@ -2,24 +2,24 @@ import { checkOptionalParameter } from "../../utils/url.js";
2
2
  import { MESSAGE_MATCHER_IS_ALREADY_BUILT, UnsupportedPathError } from "../../router.js";
3
3
  import { createNullObject } from "../utils.js";
4
4
  import { emptyParam, match } from "./matcher.js";
5
- import { LABEL_REG_EXP_STR, PATH_ERROR, TAIL_WILDCARD_REG_EXP_STR } from "./node.js";
5
+ import { PATH_ERROR } from "./node.js";
6
6
  import { Trie } from "./trie.js";
7
7
  //#region src/router/reg-exp-router/router.ts
8
- let wildcardRegExpCache = createNullObject();
9
- function buildWildcardRegExp(path) {
10
- return wildcardRegExpCache[path] ??= new RegExp(`^${path.replace(/\/:[^/{}]+(?:\{\[\^\/]\+})?(?=[/{]|$)|\/?\*$|([.\\+*[^\]$()?{}|])/g, (match, metaChar) => metaChar ? `\\${metaChar}` : match === "/*" ? TAIL_WILDCARD_REG_EXP_STR : match === "*" ? ".*" : `/:${LABEL_REG_EXP_STR}`)}$`);
8
+ function endsWithWildcard(keys) {
9
+ const tail = keys[keys.length - 1];
10
+ return tail === "[^]*" || tail === "(?:|/[^]*)";
11
11
  }
12
- function findMiddleware(middleware, path) {
13
- for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) if (buildWildcardRegExp(k).test(path)) return [...middleware[k]];
12
+ function covers(wildcard, target) {
13
+ const last = wildcard.length - 1;
14
+ for (let i = 0; i < last; i++) if (wildcard[i] !== target[i]) return false;
15
+ return wildcard[last] === "[^]*" || target.length === last || target[last] === "/";
14
16
  }
15
17
  var RegExpRouter = class {
16
18
  name = "RegExpRouter";
17
- #middleware;
18
- #routes;
19
+ #handlers;
19
20
  #tries;
20
21
  constructor() {
21
- this.#middleware = { ["ALL"]: createNullObject() };
22
- this.#routes = { ["ALL"]: createNullObject() };
22
+ this.#handlers = { ["ALL"]: [] };
23
23
  this.#tries = { ["ALL"]: new Trie() };
24
24
  }
25
25
  #insertPath(method, path) {
@@ -30,65 +30,53 @@ var RegExpRouter = class {
30
30
  }
31
31
  }
32
32
  add(method, path, handler) {
33
- const middleware = this.#middleware;
34
- const routes = this.#routes;
35
- if (!middleware) throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
36
- if (!middleware[method]) {
37
- this.#tries[method] = new Trie();
38
- for (const handlerMap of [middleware, routes]) {
39
- handlerMap[method] = createNullObject();
40
- for (const p in handlerMap["ALL"]) {
41
- handlerMap[method][p] = [...handlerMap["ALL"][p]];
42
- this.#insertPath(method, p);
43
- }
44
- }
33
+ const handlers = this.#handlers;
34
+ if (!handlers) throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
35
+ const tries = this.#tries;
36
+ if (!handlers[method]) {
37
+ tries[method] = new Trie();
38
+ handlers[method] = [...handlers["ALL"]];
39
+ for (const p in tries["ALL"].paths) this.#insertPath(method, p);
45
40
  }
46
41
  if (path === "/*") path = "*";
47
- const methods = method === "ALL" ? Object.keys(middleware) : [method];
48
- if (/\*$/.test(path)) {
49
- const re = buildWildcardRegExp(path);
50
- for (const m of methods) if (!middleware[m][path]) {
51
- this.#insertPath(m, path);
52
- middleware[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware["ALL"], path) || [];
53
- }
54
- for (const handlerMap of [middleware, routes]) for (const m of methods) for (const p in handlerMap[m]) re.test(p) && handlerMap[m][p].push([handler, path]);
55
- return;
56
- }
42
+ const methods = method === "ALL" ? Object.keys(handlers) : [method];
57
43
  const paths = checkOptionalParameter(path) || [path];
58
44
  for (const path of paths) for (const m of methods) {
59
- if (!routes[m][path]) {
60
- this.#insertPath(m, path);
61
- routes[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware["ALL"], path) || [];
62
- }
63
- routes[m][path].push([handler, path]);
45
+ if (!tries[m].paths[path]) this.#insertPath(m, path);
46
+ handlers[m].push([handler, path]);
64
47
  }
65
48
  }
66
49
  match = match;
67
50
  buildAllMatchers() {
68
51
  const matchers = createNullObject();
69
- for (const method of Object.keys(this.#routes)) matchers[method] = this.#buildMatcher(method);
70
- this.#middleware = this.#routes = this.#tries = void 0;
71
- wildcardRegExpCache = createNullObject();
52
+ for (const method of Object.keys(this.#handlers)) matchers[method] = this.#buildMatcher(method);
53
+ this.#handlers = this.#tries = void 0;
72
54
  return matchers;
73
55
  }
74
56
  #buildMatcher(method) {
75
- const middleware = this.#middleware[method];
76
- const routes = this.#routes[method];
57
+ const handlers = this.#handlers[method];
77
58
  const trie = this.#tries[method];
78
59
  const staticMap = createNullObject();
79
60
  const handlerData = [];
80
61
  const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
81
- for (const r of [middleware, routes]) for (const path in r) {
82
- const handlers = r[path];
83
- const pathData = trie.paths[path];
84
- if (!pathData) {
85
- staticMap[path] = [handlers.map(([h]) => [h, createNullObject()]), emptyParam];
86
- continue;
87
- }
88
- handlerData[pathData[0]] = handlers.map(([h, handlerPath]) => [h, trie.paths[handlerPath][1].reduceRight((map, [key], i) => {
89
- map[key] = paramReplacementMap[pathData[1][i][1]];
62
+ const own = createNullObject();
63
+ const entries = handlers.map(([h, p], i) => {
64
+ (own[p] ??= []).push(i);
65
+ return [h, trie.paths[p][1].reduceRight((map, [key, varIndex]) => {
66
+ map[key] = paramReplacementMap[varIndex];
90
67
  return map;
91
- }, createNullObject())]);
68
+ }, createNullObject())];
69
+ });
70
+ const wildcards = Object.keys(own).filter((p) => endsWithWildcard(trie.paths[p][2]));
71
+ for (const path in trie.paths) {
72
+ const [index, , keys] = trie.paths[path];
73
+ const indexes = [...own[path]];
74
+ for (const p of wildcards) if (p !== path && covers(trie.paths[p][2], keys)) indexes.push(...own[p]);
75
+ const data = indexes.sort((a, b) => a - b).map((i) => entries[i]);
76
+ if (index === -1) {
77
+ const last = Math.max(-1, ...data.flatMap(([, map]) => Object.values(map)));
78
+ staticMap[path] = [data, last === -1 ? emptyParam : path.match(regexp).slice(0, last + 1)];
79
+ } else handlerData[index] = data;
92
80
  }
93
81
  return [
94
82
  regexp,
@@ -7,8 +7,14 @@ var Trie = class {
7
7
  #index = 0;
8
8
  paths = createNullObject();
9
9
  insert(path, isStatic) {
10
+ const keys = [];
10
11
  if (isStatic) {
11
- this.#root.insert(path.split(""), 0, [], this.#context, true);
12
+ this.#root.insert(path.split(""), -1, [], this.#context, keys);
13
+ this.paths[path] = [
14
+ -1,
15
+ [],
16
+ keys
17
+ ];
12
18
  return;
13
19
  }
14
20
  const paramAssoc = [];
@@ -16,7 +22,7 @@ var Trie = class {
16
22
  let markedPath = path;
17
23
  for (let i = 0;;) {
18
24
  let replaced = false;
19
- markedPath = markedPath.replace(/\{[^}]+\}/g, (m) => {
25
+ markedPath = markedPath.replace(/\{(?:\{[\d,]+\}|[^}])+\}/g, (m) => {
20
26
  const mark = `@\\${i}`;
21
27
  groups[i] = [mark, m];
22
28
  i++;
@@ -30,7 +36,7 @@ var Trie = class {
30
36
  * - /* wildcard
31
37
  * - character
32
38
  */
33
- const tokens = markedPath.match(/(?::[^\/]+)|(?:\/\*$)|./g) || [];
39
+ const tokens = markedPath.match(/(?::[^\/]+)|(?:\/\*$)|./gs) || [];
34
40
  for (let i = groups.length - 1; i >= 0; i--) {
35
41
  const [mark] = groups[i];
36
42
  for (let j = tokens.length - 1; j >= 0; j--) if (tokens[j].indexOf(mark) !== -1) {
@@ -38,8 +44,12 @@ var Trie = class {
38
44
  break;
39
45
  }
40
46
  }
41
- this.#root.insert(tokens, this.#index, paramAssoc, this.#context, false);
42
- this.paths[path] = [this.#index++, paramAssoc];
47
+ this.#root.insert(tokens, this.#index, paramAssoc, this.#context, keys);
48
+ this.paths[path] = [
49
+ this.#index++,
50
+ paramAssoc,
51
+ keys
52
+ ];
43
53
  }
44
54
  buildRegExp() {
45
55
  let regexp = this.#root.buildRegExpStr();
@@ -16,6 +16,7 @@ type MountOptions = MountOptionHandler | {
16
16
  * @param {Function} applicationHandler - other Request Handler
17
17
  * @param {MountOptions} [options] - options of `mount()`
18
18
  * @returns {MiddlewareHandler} handler to register with `app.all()`
19
+ * @throws {Error} If the route ends with a wildcard inside a segment (e.g. `/assets*`), or automatic request rewriting encounters duplicate path parameter names.
19
20
  *
20
21
  * @example
21
22
  * ```ts
@@ -1,7 +1,7 @@
1
1
  //#region src/router/reg-exp-router/node.d.ts
2
2
  export declare const LABEL_REG_EXP_STR = "[^/]+";
3
- export declare const ONLY_WILDCARD_REG_EXP_STR = ".*";
4
- export declare const TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
3
+ export declare const ONLY_WILDCARD_REG_EXP_STR = "[^]*";
4
+ export declare const TAIL_WILDCARD_REG_EXP_STR = "(?:|/[^]*)";
5
5
  export declare const PATH_ERROR: unique symbol;
6
6
  export type ParamAssocArray = [string, number][];
7
7
  export interface Context {
@@ -9,7 +9,7 @@ export interface Context {
9
9
  }
10
10
  export declare class Node {
11
11
 
12
- insert(tokens: readonly string[], index: number, paramMap: ParamAssocArray, context: Context, isStatic: boolean): void;
12
+ insert(tokens: readonly string[], index: number, paramMap: ParamAssocArray, context: Context, keys: string[]): void;
13
13
  buildRegExpStr(): string;
14
14
  }
15
15
  //#endregion
@@ -3,7 +3,7 @@ import { ParamAssocArray } from "./node.js";
3
3
  export type ReplacementMap = number[];
4
4
  export declare class Trie {
5
5
 
6
- paths: Record<string, [number, ParamAssocArray]>;
6
+ paths: Record<string, [number, ParamAssocArray, string[]]>;
7
7
  insert(path: string, isStatic: boolean): void;
8
8
  buildRegExp(): [RegExp, ReplacementMap, ReplacementMap];
9
9
  }
@@ -0,0 +1,4 @@
1
+ import { Context } from "../context.js";
2
+ //#region src/utils/mount.d.ts
3
+ export declare const createMountedRequest: (c: Context, pathPrefix: string, routePath: string) => Request;
4
+ //#endregion
@@ -26,6 +26,7 @@ export declare const getPath: (request: Request) => string;
26
26
  */
27
27
  export declare const getQueryStrings: (url: string) => string;
28
28
  export declare const getPathNoStrict: (request: Request) => string;
29
+ export declare const stripPathPrefix: (rawPath: string, decodedPath: string, prefixLength: number) => string;
29
30
  /**
30
31
  * Merge paths.
31
32
  * @param {string[]} ...paths - The paths to merge.
@@ -15,7 +15,7 @@ const decodeJwtPart = (part) => JSON.parse(utf8Decoder.decode(decodeBase64Url(pa
15
15
  function isTokenHeader(obj) {
16
16
  if (typeof obj === "object" && obj !== null) {
17
17
  const objWithAlg = obj;
18
- return "alg" in objWithAlg && Object.values(AlgorithmTypes).includes(objWithAlg.alg) && (!("typ" in objWithAlg) || objWithAlg.typ === "JWT");
18
+ return "alg" in objWithAlg && Object.values(AlgorithmTypes).includes(objWithAlg.alg) && (!("typ" in objWithAlg) || objWithAlg.typ === "JWT") && !("crit" in objWithAlg);
19
19
  }
20
20
  return false;
21
21
  }
@@ -66,6 +66,7 @@ const verify = async (token, publicKey, algOrOptions) => {
66
66
  if (!(Array.isArray(payload.aud) ? payload.aud : [payload.aud]).some((payloadAud) => aud instanceof RegExp ? aud.test(payloadAud) : typeof aud === "string" ? payloadAud === aud : Array.isArray(aud) && aud.includes(payloadAud))) throw new JwtTokenAudience(aud, payload.aud);
67
67
  }
68
68
  const headerPayload = token.substring(0, token.lastIndexOf("."));
69
+ if (!/^[A-Za-z0-9_-]*={0,2}$/.test(tokenParts[2])) throw new JwtTokenInvalid(token);
69
70
  let signature;
70
71
  try {
71
72
  signature = decodeBase64Url(tokenParts[2]);
@@ -0,0 +1,34 @@
1
+ import { GET_MATCH_RESULT } from "../request/constants.js";
2
+ import { getPattern, splitRoutingPath, stripPathPrefix } from "./url.js";
3
+ //#region src/utils/mount.ts
4
+ const getPathPrefixLength = (c, pathPrefix, routePath) => {
5
+ if (!/[:*]/.test(pathPrefix)) return pathPrefix.length;
6
+ const path = c.req.path;
7
+ const matchResult = c.req[GET_MATCH_RESULT];
8
+ const paramNames = /* @__PURE__ */ new Set();
9
+ let length = 0;
10
+ for (const part of splitRoutingPath(pathPrefix)) {
11
+ const pattern = getPattern(part);
12
+ if (pattern && pattern !== "*") {
13
+ const name = pattern[1];
14
+ if (paramNames.has(name)) throw new Error(`mount(): Duplicate path parameter "${name}" in "${routePath}".`);
15
+ paramNames.add(name);
16
+ }
17
+ if (pattern && pattern !== "*" && pattern[2] !== true) {
18
+ const value = matchResult.length === 2 ? matchResult[1][matchResult[0][c.req.routeIndex][1][pattern[1]]] : matchResult[0][c.req.routeIndex][1][pattern[1]];
19
+ length += value.length + 1;
20
+ } else if (pattern || part.endsWith("*")) {
21
+ const end = path.indexOf("/", length + 1);
22
+ length = end === -1 ? path.length : end;
23
+ } else length += part.length + 1;
24
+ }
25
+ return length;
26
+ };
27
+ const createMountedRequest = (c, pathPrefix, routePath) => {
28
+ if (/[^/]\*$/.test(routePath)) throw new Error(`mount(): Wildcard must follow "/" in "${routePath}".`);
29
+ const url = new URL(c.req.raw.url);
30
+ url.pathname = stripPathPrefix(url.pathname, c.req.path, getPathPrefixLength(c, pathPrefix, routePath));
31
+ return new Request(url, c.req.raw);
32
+ };
33
+ //#endregion
34
+ export { createMountedRequest };
@@ -110,6 +110,15 @@ const getPathNoStrict = (request) => {
110
110
  const result = getPath(request);
111
111
  return result.length > 1 && result.at(-1) === "/" ? result.slice(0, -1) : result;
112
112
  };
113
+ const stripPathPrefix = (rawPath, decodedPath, prefixLength) => {
114
+ if (rawPath.at(-1) === "/" && decodedPath.at(-1) !== "/") rawPath = rawPath.slice(0, -1);
115
+ let index = 0;
116
+ for (let i = decodedPath.indexOf("/"); i !== -1 && i < prefixLength; i = decodedPath.indexOf("/", i + 1)) {
117
+ index = rawPath.indexOf("/", index + 1);
118
+ if (index === -1) return "/";
119
+ }
120
+ return rawPath.slice(index) || "/";
121
+ };
113
122
  /**
114
123
  * Merge paths.
115
124
  * @param {string[]} ...paths - The paths to merge.
@@ -203,4 +212,4 @@ const getQueryParams = (url, key) => {
203
212
  };
204
213
  const decodeURIComponent_ = decodeURIComponent;
205
214
  //#endregion
206
- export { checkOptionalParameter, decodeURIComponent_, getPath, getPathNoStrict, getPattern, getQueryParam, getQueryParams, getQueryStrings, mergePath, splitPath, splitRoutingPath, tryDecode, tryDecodeURI, tryDecodeURIComponent };
215
+ export { checkOptionalParameter, decodeURIComponent_, getPath, getPathNoStrict, getPattern, getQueryParam, getQueryParams, getQueryStrings, mergePath, splitPath, splitRoutingPath, stripPathPrefix, tryDecode, tryDecodeURI, tryDecodeURIComponent };
@@ -3,7 +3,7 @@ import { bufferToFormData } from "../utils/buffer.js";
3
3
  import { getCookie } from "../helper/cookie/index.js";
4
4
  //#region src/validator/validator.ts
5
5
  const jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
6
- const multipartRegex = /^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/i;
6
+ const multipartRegex = /^multipart\/form-data(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
7
7
  const urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
8
8
  const validator = (target, validationFunc) => {
9
9
  return async (c, next) => {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "4.13.14",
3
+ "version": "4.13.16",
4
4
  "description": "Web framework built on Web Standards",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",
@@ -5,7 +5,7 @@ function isCloudflareWorkers() {
5
5
  return typeof WebSocketPair < "u" || typeof navigator < "u" && navigator.userAgent === "Cloudflare-Workers" || typeof EdgeRuntime < "u" && EdgeRuntime === "vercel";
6
6
  }
7
7
  let USER_AGENT;
8
- (typeof navigator > "u" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) && (USER_AGENT = "jose/v6.2.14");
8
+ (typeof navigator > "u" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) && (USER_AGENT = "jose/v6.2.15");
9
9
  const customFetch = /* @__PURE__ */ Symbol();
10
10
  async function fetchJwks(url, headers, signal, fetchImpl = fetch) {
11
11
  const response = await fetchImpl(url, {
@@ -31,6 +31,8 @@ function isFreshFor(timestamp, duration) {
31
31
  function validateDuration(value, fallback, option) {
32
32
  if (Number.isNaN(value))
33
33
  throw new TypeError(`"${option}" option must not be NaN`);
34
+ if (typeof value == "number" && value < 0)
35
+ throw new TypeError(`"${option}" option must not be negative`);
34
36
  return typeof value == "number" ? value : fallback;
35
37
  }
36
38
  function createRemoteJWKSet(url, options) {
@@ -23,7 +23,8 @@ async function transform(stream, input, maxLength = 1 / 0) {
23
23
  if (done)
24
24
  break;
25
25
  if (chunks.push(value), length += value.byteLength, maxLength !== 1 / 0 && length > maxLength)
26
- throw new JWEInvalid("Decompressed plaintext exceeded the configured limit");
26
+ throw await reader.cancel().catch(() => {
27
+ }), new JWEInvalid("Decompressed plaintext exceeded the configured limit");
27
28
  }
28
29
  return concat(...chunks);
29
30
  }
@@ -77,7 +77,8 @@ function validateClaimsSet(protectedHeader, claimsSetBytes, options = {}) {
77
77
  throw new TypeError("Invalid clockTolerance option type");
78
78
  tolerance = clockTolerance;
79
79
  }
80
- validateInput("clockTolerance option", tolerance);
80
+ if (validateInput("clockTolerance option", tolerance), tolerance < 0)
81
+ throw new TypeError("Invalid clockTolerance option input");
81
82
  const { currentDate } = options, now = validateInput("currentDate option", epoch(currentDate === void 0 ? /* @__PURE__ */ new Date() : currentDate)), iat = validateNumericDate(claimsSet, "iat", maxTokenAge !== void 0), nbf = validateNumericDate(claimsSet, "nbf");
82
83
  if (nbf !== void 0 && nbf > now + tolerance)
83
84
  throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed', claimsSet, "nbf", checkFailed);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jose",
3
- "version": "6.2.14",
3
+ "version": "6.2.15",
4
4
  "description": "JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes",
5
5
  "keywords": [
6
6
  "akp",
@@ -1,4 +1,4 @@
1
- import{CommandParser as p}from"./parser.js";import{initCommand as f}from"./commands/init.js";import{statusCommand as g}from"./commands/status.js";import{daemonCommand as h}from"./commands/daemon.js";import{dashboardCommand as u}from"./commands/dashboard.js";import{scanCommand as C}from"./commands/scan.js";import{chpassCommand as b}from"./commands/chpass.js";import{doctorCommand as x}from"./commands/doctor.js";import{uninstallCommand as $}from"./commands/uninstall.js";import{initCliLocale as E,t as e}from"./i18n/index.js";import{WEAVE_VERSION as S}from"@weavecode/server";const w=process.emitWarning.bind(process);process.emitWarning=(n,...r)=>{if(!(typeof n=="string"?n:String(n)).includes("SQLite is an experimental feature"))return w(n,...r)};const l=()=>S;function v(n){if(n.description){console.log(` ${n.name.padEnd(12)}${e(n.description)}`);for(const r of n.subcommands??[]){const o=[r.name,...r.aliases??[]].join(", "),s=r.description?e(r.description):"";console.log(` ${o.padEnd(12)}${s}`)}}}function a(n){const r=l();console.log(`${e("help.tagline",{version:r})}
2
- `),console.log(`${e("help.usage")}
3
- `),console.log(e("help.commands"));for(const o of n.getAllCommands())v(o);console.log(`
4
- ${e("help.globalOptions")}`);for(const o of n.getGlobalOptions()){const s=o.short?`-${o.short}, --${o.name}`:` --${o.name}`;console.log(` ${s.padEnd(20)}${e(o.description)}`)}}function L(n){console.error(e("help.subcommands"));for(const r of n.subcommands??[]){const o=[r.name,...r.aliases??[]].join(", "),s=r.description?e(r.description):"";console.error(` ${o.padEnd(12)}${s}`)}}export class CLI{parser;constructor(){this.parser=new p,this.registerCommands()}registerCommands(){this.parser.registerCommand(f),this.parser.registerCommand($),this.parser.registerCommand(g),this.parser.registerCommand(h),this.parser.registerCommand(u),this.parser.registerCommand(C),this.parser.registerCommand(b),this.parser.registerCommand(x)}async run(r=process.argv.slice(2)){delete process.env.CLAUDE_CODE_CHILD_SESSION,await E();const o=this.parser.parse(r);if(o.flags.version){console.log(l());return}if(o.flags.help||o.command.length===0){a(this.parser);return}let s;for(const t of o.command)s=(s?s.subcommands?.find(c=>c.name===t||c.aliases?.includes(t)):this.parser.getCommand(t))??s;if(!s?.action){if(s?.subcommands?.length){const t=o.positional[0];console.error(t?e("cli.unknownSubcommand",{command:s.name,subcommand:t}):e("cli.missingSubcommand",{command:s.name})),L(s),process.exit(1)}console.error(e("cli.unknownCommand",{command:o.command.join(" ")})),a(this.parser),process.exit(1)}const i=s.maxPositionals??0;if(o.positional.length>i){const t=o.command.join(" ");console.error(e("cli.unexpectedPositional",{command:t,arg:o.positional[i]})),a(this.parser),process.exit(1)}const m=this.parser.validateFlags(o.flags,s);if(m.length>0){for(const t of m)console.error(e("cli.error",{error:t}));process.exit(1)}const d={commandPath:o.command,flags:o.flags,positional:o.positional,raw:o.raw};await s.action(d)}}
1
+ import{CommandParser as p}from"./parser.js";import{initCommand as f}from"./commands/init.js";import{statusCommand as g}from"./commands/status.js";import{daemonCommand as h}from"./commands/daemon.js";import{dashboardCommand as C}from"./commands/dashboard.js";import{scanCommand as u}from"./commands/scan.js";import{chpassCommand as $}from"./commands/chpass.js";import{doctorCommand as b}from"./commands/doctor.js";import{uninstallCommand as E}from"./commands/uninstall.js";import{initCliLocale as x,t as a}from"./i18n/index.js";import{WEAVE_VERSION as S}from"@weavecode/server";const w=process.emitWarning.bind(process);process.emitWarning=(n,...r)=>{if(!(typeof n=="string"?n:String(n)).includes("SQLite is an experimental feature"))return w(n,...r)};const l=()=>S;function v(n){if(n.description){console.log(` ${n.name.padEnd(12)}${a(n.description)}`);for(const r of n.subcommands??[]){const o=[r.name,...r.aliases??[]].join(", "),s=r.description?a(r.description):"";console.log(` ${o.padEnd(12)}${s}`)}}}function i(n){const r=l();console.log(`${a("help.tagline",{version:r})}
2
+ `),console.log(`${a("help.usage")}
3
+ `),console.log(a("help.commands"));for(const o of n.getAllCommands())v(o);console.log(`
4
+ ${a("help.globalOptions")}`);for(const o of n.getGlobalOptions()){const s=o.short?`-${o.short}, --${o.name}`:` --${o.name}`;console.log(` ${s.padEnd(20)}${a(o.description)}`)}}function L(n){console.error(a("help.subcommands"));for(const r of n.subcommands??[]){const o=[r.name,...r.aliases??[]].join(", "),s=r.description?a(r.description):"";console.error(` ${o.padEnd(12)}${s}`)}}export class CLI{parser;constructor(){this.parser=new p,this.registerCommands()}registerCommands(){this.parser.registerCommand(f),this.parser.registerCommand(E),this.parser.registerCommand(g),this.parser.registerCommand(h),this.parser.registerCommand(C),this.parser.registerCommand(u),this.parser.registerCommand($),this.parser.registerCommand(b)}async run(r=process.argv.slice(2)){delete process.env.CLAUDE_CODE_CHILD_SESSION,await x();const o=this.parser.parse(r);if(o.flags.version){console.log(l());return}if(o.flags.help||o.command.length===0){i(this.parser);return}let s;for(const e of o.command)s=(s?s.subcommands?.find(c=>c.name===e||c.aliases?.includes(e)):this.parser.getCommand(e))??s;if(!s?.action){if(s?.subcommands?.length){const e=o.positional[0];console.error(e?a("cli.unknownSubcommand",{command:s.name,subcommand:e}):a("cli.missingSubcommand",{command:s.name})),L(s),process.exit(1)}console.error(a("cli.unknownCommand",{command:o.command.join(" ")})),i(this.parser),process.exit(1)}const m=s.maxPositionals??0;if(o.positional.length>m){const e=o.command.join(" ");console.error(a("cli.unexpectedPositional",{command:e,arg:o.positional[m]})),i(this.parser),process.exit(1)}const t=this.parser.validateFlags(o.flags,s);if(t.length>0){for(const e of t)console.error(a("cli.error",{error:e}));process.exit(1)}const d={commandPath:o.command,flags:o.flags,positional:o.positional,raw:o.raw};await s.action(d)}}
@@ -1 +1 @@
1
- import{DAEMON_HOST as c}from"@weavecode/server";import{logger as s}from"@weavecode/core";import{t as r}from"../i18n/index.js";import{ensureDaemonRunning as i}from"./daemon.js";import{localTokenHeader as p}from"./daemon-auth.js";const m=6;async function h(n){const t=n.positional[0];if(typeof t!="string"||t.length<m){s.warn(r("out.chpass.usage")),process.exitCode=1;return}const a=await i();try{const o=await fetch(`http://${c}:${a.port}/auth/password`,{method:"PUT",headers:{"content-type":"application/json",...p()},body:JSON.stringify({next:t})}),e=await o.json().catch(()=>({}));if(!o.ok)throw new Error(typeof e.error=="string"?e.error:`HTTP ${o.status}`);s.success(r("out.chpass.ok"))}catch(o){s.warn(r("out.chpass.fail",{error:o instanceof Error?o.message:String(o)})),process.exitCode=1}}export const chpassCommand={name:"chpass",description:"cmd.chpass.desc",action:h,maxPositionals:1};
1
+ import{DAEMON_HOST as c}from"@weavecode/server";import{logger as s}from"@weavecode/core";import{t as r}from"../i18n/index.js";import{ensureDaemonRunning as i}from"./daemon.js";import{localTokenHeader as p}from"./daemon-auth.js";const m=6;async function h(n){const t=n.positional[0];if(typeof t!="string"||t.length<m){s.warn(r("out.chpass.usage")),process.exitCode=1;return}const e=await i();try{const o=await fetch(`http://${c}:${e.port}/auth/password`,{method:"PUT",headers:{"content-type":"application/json",...p()},body:JSON.stringify({next:t})}),a=await o.json().catch(()=>({}));if(!o.ok)throw new Error(typeof a.error=="string"?a.error:`HTTP ${o.status}`);s.success(r("out.chpass.ok"))}catch(o){s.warn(r("out.chpass.fail",{error:o instanceof Error?o.message:String(o)})),process.exitCode=1}}export const chpassCommand={name:"chpass",description:"cmd.chpass.desc",action:h,maxPositionals:1};
@@ -1 +1 @@
1
- import{existsSync as e,readFileSync as o,rmSync as n}from"node:fs";import{getAuthPath as a,getInitialPasswordPath as i}from"@weavecode/server";import{logger as c}from"@weavecode/core";import{t as l}from"../i18n/index.js";export function localTokenHeader(){try{const t=JSON.parse(o(a(),"utf8"));return typeof t.localToken=="string"&&t.localToken?{"x-weave-local":t.localToken}:{}}catch{return{}}}export function announceInitialPassword(){const t=i();if(!e(t))return;let r;try{r=o(t,"utf8").trim()}catch{return}n(t,{force:!0}),r&&c.info(l("out.dash.initialPassword",{password:r}))}
1
+ import{existsSync as a,readFileSync as r,rmSync as e}from"node:fs";import{getAuthPath as n,getInitialPasswordPath as s}from"@weavecode/server";import{logger as i}from"@weavecode/core";import{t as c}from"../i18n/index.js";export function localTokenHeader(){try{const t=JSON.parse(r(n(),"utf8"));return typeof t.localToken=="string"&&t.localToken?{"x-weave-local":t.localToken}:{}}catch{return{}}}export function announceInitialPassword(){const t=s();if(!a(t))return;let o;try{o=r(t,"utf8").trim()}catch{return}e(t,{force:!0}),o&&i.info(c("out.dash.initialPassword",{password:o}))}
@@ -1,2 +1,2 @@
1
- import{spawn as f}from"node:child_process";import{DEFAULT_PORT as c,DAEMON_HOST as u,isPortFree as h,findFreePort as y,readDaemonState as p,writeDaemonState as $,clearDaemonState as g,resolveDaemonEntry as D,accessUrls as P}from"@weavecode/server";import{logger as a}from"@weavecode/core";import{t as r}from"../i18n/index.js";export async function probeDaemon(t){try{const e=await fetch(`http://${u}:${t}/health`);return e.ok?(await e.json()).service==="weave-daemon":!1}catch{return!1}}export async function waitForDaemon(t,e=1e4){const o=Date.now()+e;for(;!await probeDaemon(t);){if(Date.now()>=o)return!1;await new Promise(n=>setTimeout(n,100))}return!0}async function x(t,e){if(process.platform!=="win32")return!1;const o=i=>/\s/.test(i)?`"${i}"`:i,n=i=>`'${i.replace(/'/g,"''")}'`,s=`$ErrorActionPreference='Stop';$su=[wmiclass]'Win32_ProcessStartup';$psi=$su.CreateInstance();$psi.ShowWindow=0;$proc=[wmiclass]'Win32_Process';$r=$proc.Create(${n([t,...e].map(o).join(" "))},${n(process.cwd())},$psi);if($r.ReturnValue -ne 0){exit 1}`,d=Buffer.from(s,"utf16le").toString("base64");return new Promise(i=>{const m=f("powershell.exe",["-NoProfile","-NonInteractive","-EncodedCommand",d],{windowsHide:!0,stdio:"ignore"});m.on("error",()=>i(!1)),m.on("exit",w=>i(w===0))})}export async function ensureDaemonRunning(){const t=p();if(t&&await probeDaemon(t.port))return{port:t.port,started:!1,ready:!0};if(await probeDaemon(c))return{port:c,started:!1,ready:!0};const e=await h(c)?c:await y(c+1);$({pid:0,port:e,startedAt:new Date().toISOString()});const o=D(),n=o.isTs?["--import","tsx",o.path]:[o.path];await x(process.execPath,n)||f(process.execPath,n,{detached:!0,stdio:"ignore"}).unref();const s=await waitForDaemon(e);return{port:e,started:!0,ready:s}}async function S(){const t=await ensureDaemonRunning();if(!t.started){a.info(r("out.daemon.alreadyRunning",{port:t.port}));return}t.ready?a.success(r("out.daemon.started",{host:u,port:t.port})):a.warn(r("out.daemon.startUnconfirmed",{port:t.port}))}async function l(t){return await(await fetch(`http://${u}:${t}/health`)).json()}async function A(){const t=p(),e=t?.port??c;let o=t?.pid;if(await probeDaemon(e))o=(await l(e)).pid;else if(!t){a.info(r("out.daemon.statusNotRunning"));return}let n;if(o)try{process.kill(o),n=o}catch{}g(),n!==void 0?(await R(n,e),a.success(r("out.daemon.stopped",{pid:n}))):a.warn(r("out.daemon.statusStale",{pid:o??0,port:e}))}async function R(t,e,o=5e3){const n=Date.now()+o;for(;;){let s;try{process.kill(t,0),s=!0}catch{s=!1}if(!s&&!await probeDaemon(e)||Date.now()>=n)return;await new Promise(d=>setTimeout(d,100))}}async function T(){const t=p(),e=t?.port??c;if(await probeDaemon(e)){const o=await l(e);a.info(r("out.daemon.statusRunning",{pid:o.pid,port:o.port,uptime:Math.round(o.uptimeMs/1e3)}));const n=P(e,t?.tlsPort??0);n.length>0&&(a.dim(r("out.daemon.urlsTitle")),a.dim(n.map(s=>` ${s.url}`).join(`
2
- `)))}else t?a.warn(r("out.daemon.statusStale",{pid:t.pid,port:t.port})):a.info(r("out.daemon.statusNotRunning"))}export const daemonCommand={name:"daemon",description:"cmd.daemon.desc",subcommands:[{name:"start",description:"cmd.daemon.start.desc",action:S},{name:"stop",description:"cmd.daemon.stop.desc",action:A},{name:"status",description:"cmd.daemon.status.desc",action:T}]};
1
+ import{spawn as w}from"node:child_process";import{DEFAULT_PORT as c,DAEMON_HOST as d,isPortFree as h,findFreePort as y,readDaemonState as u,writeDaemonState as $,clearDaemonState as g,resolveDaemonEntry as D,accessUrls as P}from"@weavecode/server";import{logger as n}from"@weavecode/core";import{localTokenHeader as S}from"./daemon-auth.js";import{t as r}from"../i18n/index.js";export async function probeDaemon(t){try{const e=await fetch(`http://${d}:${t}/health`);return e.ok?(await e.json()).service==="weave-daemon":!1}catch{return!1}}export async function waitForDaemon(t,e=1e4){const o=Date.now()+e;for(;!await probeDaemon(t);){if(Date.now()>=o)return!1;await new Promise(a=>setTimeout(a,100))}return!0}async function x(t,e){if(process.platform!=="win32")return!1;const o=i=>/\s/.test(i)?`"${i}"`:i,a=i=>`'${i.replace(/'/g,"''")}'`,s=`$ErrorActionPreference='Stop';$su=[wmiclass]'Win32_ProcessStartup';$psi=$su.CreateInstance();$psi.ShowWindow=0;$proc=[wmiclass]'Win32_Process';$r=$proc.Create(${a([t,...e].map(o).join(" "))},${a(process.cwd())},$psi);if($r.ReturnValue -ne 0){exit 1}`,p=Buffer.from(s,"utf16le").toString("base64");return new Promise(i=>{const m=w("powershell.exe",["-NoProfile","-NonInteractive","-EncodedCommand",p],{windowsHide:!0,stdio:"ignore"});m.on("error",()=>i(!1)),m.on("exit",l=>i(l===0))})}export async function ensureDaemonRunning(){const t=u();if(t&&await probeDaemon(t.port))return{port:t.port,started:!1,ready:!0};if(await probeDaemon(c))return{port:c,started:!1,ready:!0};const e=await h(c)?c:await y(c+1);$({pid:0,port:e,startedAt:new Date().toISOString()});const o=D(),a=o.isTs?["--import","tsx",o.path]:[o.path];await x(process.execPath,a)||w(process.execPath,a,{detached:!0,stdio:"ignore"}).unref();const s=await waitForDaemon(e);return{port:e,started:!0,ready:s}}async function T(){const t=await ensureDaemonRunning();if(!t.started){n.info(r("out.daemon.alreadyRunning",{port:t.port}));return}t.ready?n.success(r("out.daemon.started",{host:d,port:t.port})):n.warn(r("out.daemon.startUnconfirmed",{port:t.port}))}async function f(t){return await(await fetch(`http://${d}:${t}/health`)).json()}async function R(t){const e=S();if(!e["x-weave-local"])return!1;const o=new AbortController,a=setTimeout(()=>o.abort(),2e3);try{return(await fetch(`http://${d}:${t}/daemon/shutdown`,{method:"POST",headers:e,signal:o.signal})).ok}catch{return!1}finally{clearTimeout(a)}}async function v(){const t=u(),e=t?.port??c;let o=t?.pid;if(await probeDaemon(e))o=(await f(e)).pid;else if(!t){n.info(r("out.daemon.statusNotRunning"));return}let a;if(o)if(await R(e))a=o;else try{process.kill(o),a=o}catch{}g(),a!==void 0?(await b(a,e),n.success(r("out.daemon.stopped",{pid:a}))):n.warn(r("out.daemon.statusStale",{pid:o??0,port:e}))}async function b(t,e,o=5e3){const a=Date.now()+o;for(;;){let s;try{process.kill(t,0),s=!0}catch{s=!1}if(!s&&!await probeDaemon(e)||Date.now()>=a)return;await new Promise(p=>setTimeout(p,100))}}async function A(){const t=u(),e=t?.port??c;if(await probeDaemon(e)){const o=await f(e);n.info(r("out.daemon.statusRunning",{pid:o.pid,port:o.port,uptime:Math.round(o.uptimeMs/1e3)}));const a=P(e,t?.tlsPort??0);a.length>0&&(n.dim(r("out.daemon.urlsTitle")),n.dim(a.map(s=>` ${s.url}`).join(`
2
+ `)))}else t?n.warn(r("out.daemon.statusStale",{pid:t.pid,port:t.port})):n.info(r("out.daemon.statusNotRunning"))}export const daemonCommand={name:"daemon",description:"cmd.daemon.desc",subcommands:[{name:"start",description:"cmd.daemon.start.desc",action:T},{name:"stop",description:"cmd.daemon.stop.desc",action:v},{name:"status",description:"cmd.daemon.status.desc",action:A}]};
@@ -1,2 +1,2 @@
1
- import{spawn as p}from"node:child_process";import{accessUrls as m,DAEMON_HOST as d,readDaemonState as c,resolveStaticDir as l}from"@weavecode/server";import{logger as o}from"@weavecode/core";import{t as n}from"../i18n/index.js";import{ensureDaemonRunning as u}from"./daemon.js";import{announceInitialPassword as f}from"./daemon-auth.js";export function openBrowser(r){const[e,t]=process.platform==="win32"?["cmd",["/c","start","",r]]:process.platform==="darwin"?["open",[r]]:["xdg-open",[r]],a=p(e,t,{detached:!0,stdio:"ignore"});a.on("error",()=>{o.dim(n("out.dash.browserFailed"))}),a.unref()}export function dashboardUrl(r){return`http://${d}:${r}/`}async function h(r){const e=!!r.flags.noOpen,t=await u();t.started?t.ready?(o.success(n("out.daemon.started",{host:d,port:t.port})),o.dim(n("out.dash.stopHint"))):o.warn(n("out.daemon.startUnconfirmed",{port:t.port})):o.info(n("out.daemon.alreadyRunning",{port:t.port})),l()||(o.warn(n("out.dash.noBundle")),o.dim(n("out.dash.buildHint")));const a=dashboardUrl(t.port);o.info(n("out.dash.url",{url:a}));const s=m(t.port,c()?.tlsPort??0);if(s.length>0&&(o.dim(n("out.daemon.urlsTitle")),o.dim(s.map(i=>` ${i.url}`).join(`
2
- `))),f(),e){o.dim(n("out.dash.noOpen"));return}openBrowser(a)}export const dashboardCommand={name:"dashboard",aliases:["dash"],description:"cmd.dashboard.desc",options:[{name:"no-open",description:"flag.dashboard.noOpen",type:"boolean",default:!1}],action:h};
1
+ import{spawn as p}from"node:child_process";import{accessUrls as m,DAEMON_HOST as d,readDaemonState as u,resolveStaticDir as c}from"@weavecode/server";import{logger as o}from"@weavecode/core";import{t as r}from"../i18n/index.js";import{ensureDaemonRunning as l}from"./daemon.js";import{announceInitialPassword as f}from"./daemon-auth.js";export function openBrowser(a){const[s,t]=process.platform==="win32"?["cmd",["/c","start","",a]]:process.platform==="darwin"?["open",[a]]:["xdg-open",[a]],n=p(s,t,{detached:!0,stdio:"ignore"});n.on("error",()=>{o.dim(r("out.dash.browserFailed"))}),n.unref()}export function dashboardUrl(a){return`http://${d}:${a}/`}async function h(a){const s=!!a.flags.noOpen,t=await l();t.started?t.ready?(o.success(r("out.daemon.started",{host:d,port:t.port})),o.dim(r("out.dash.stopHint"))):o.warn(r("out.daemon.startUnconfirmed",{port:t.port})):o.info(r("out.daemon.alreadyRunning",{port:t.port})),c()||(o.warn(r("out.dash.noBundle")),o.dim(r("out.dash.buildHint")));const n=dashboardUrl(t.port);o.info(r("out.dash.url",{url:n}));const e=m(t.port,u()?.tlsPort??0);if(e.length>0&&(o.dim(r("out.daemon.urlsTitle")),o.dim(e.map(i=>` ${i.url}`).join(`
2
+ `))),f(),s){o.dim(r("out.dash.noOpen"));return}openBrowser(n)}export const dashboardCommand={name:"dashboard",aliases:["dash"],description:"cmd.dashboard.desc",options:[{name:"no-open",description:"flag.dashboard.noOpen",type:"boolean",default:!1}],action:h};
@@ -1 +1 @@
1
- import{existsSync as m,readFileSync as w}from"node:fs";import l from"node:path";import{DAEMON_HOST as S,DEFAULT_PORT as x,getDbPath as y,ensureDataLayout as T,openDatabase as N,ProjectRepository as b,readDaemonState as P}from"@weavecode/server";import{formatTable as p,logger as r}from"@weavecode/core";import{checkHarness as E}from"../init/harness-checks.js";import{probeDaemon as D}from"./daemon.js";import{localTokenHeader as C}from"./daemon-auth.js";import{t as o}from"../i18n/index.js";const q={"no-mechanism":"out.doctor.reason.noMechanism","no-credentials":"out.doctor.reason.noCredentials","auth-token-required":"out.doctor.reason.authTokenRequired","no-peer-name":"out.doctor.reason.noPeerName","no-backend":"out.doctor.reason.noBackend","no-pane-env":"out.doctor.reason.noPaneEnv","pane-env-conflict":"out.doctor.reason.paneEnvConflict"},R={"no-hook-script":"out.doctor.hint.noHookScript","hook-script-not-weave":"out.doctor.hint.hookScriptNotWeave","hook-script-stale":"out.doctor.hint.hookScriptStale","no-events":"out.doctor.hint.noEvents","no-inbox-credentials":"out.doctor.hint.noInboxCredentials","inbox-token-required":"out.doctor.hint.inboxTokenRequired","no-peer-name":"out.doctor.hint.noPeerName","terminal-no-backend":"out.doctor.hint.terminalNoBackend","terminal-no-pane-env":"out.doctor.hint.terminalNoPaneEnv","terminal-pane-env-conflict":"out.doctor.hint.terminalPaneEnvConflict","not-running":"out.doctor.hint.notRunning",queued:"out.doctor.hint.queued",stalled:"out.doctor.hint.stalled"};function k(n,e){if(!e)return"";const i=n[e];return i?o(i):e}function H(n){if(!n||!n.present)return o("out.doctor.diagScriptNone");const e=n.source==="user"?o("out.doctor.diagSourceUser"):n.source==="project"?o("out.doctor.diagSourceProject"):o("out.doctor.diagSourceNone");if(!n.weaveOwned)return o("out.doctor.diagScriptNotOwned",{source:e});const i=o("out.doctor.diagYes");return o("out.doctor.diagScriptValue",{harness:n.harness,source:e,version:n.generatedVersion??o("out.doctor.diagMissing"),inbox:n.reportsInbox?i:o("out.doctor.diagNo"),pane:n.reportsPaneEnv?i:o("out.doctor.diagNo")})}function g(n){const e=k(q,n.reason);return n.status==="ready"?o("out.doctor.diagReady"):n.status==="unknown"?o("out.doctor.diagUnknown",{reason:e}):o("out.doctor.diagUnavailable",{reason:e})}async function O(n,e){let i;try{const t=await fetch(`http://${S}:${n}/messaging/diagnostics?project=${e}`,{headers:C()});if(!t.ok)throw new Error(`HTTP ${t.status}`);try{i=await t.json()}catch{throw new Error(`HTTP ${t.status}`)}}catch(t){r.warn(o("out.doctor.diagFailed",{error:t instanceof Error?t.message:String(t)}));return}const{daemon:a}=i,s=i.projects.find(t=>t.id===e)?.captures[0]??null;if(console.log(),r.info(o("out.doctor.diagHeader",{id:e})),console.log(p([[o("out.doctor.diagDaemon"),o("out.doctor.diagDaemonValue",{version:a.version,platform:a.platform,preset:a.terminalPreset,channel:o(a.terminalTextChannel?"out.doctor.diagChannelOn":"out.doctor.diagChannelOff")})],[o("out.doctor.diagScript"),H(s)]])),i.sessions.length===0){r.dim(o("out.doctor.diagNoSessions"));return}const d=t=>t===null?o("out.doctor.diagUnknownAlive"):o(t?"out.doctor.diagYes":"out.doctor.diagNo");for(const t of i.sessions)console.log(),console.log(" "+o("out.doctor.diagSession",{id:t.sessionId.slice(0,8),title:t.title??o("out.doctor.diagUntitled"),alive:d(t.alive),events:t.eventCount,last:t.lastEventType??o("out.doctor.diagMissing")})),console.log(" "+o("out.doctor.diagChannels",{inbox:g(t.channels.inbox),queue:g(t.channels.queue),relay:g(t.channels.relay),terminal:g(t.channels.terminal)})),console.log(" "+o("out.doctor.diagQueue",{pending:t.queue.pending,stalled:o(t.queue.stalled?"out.doctor.diagYes":"out.doctor.diagNo")})),t.hints.length>0&&r.dim(" "+o("out.doctor.diagHints",{hints:t.hints.map(c=>k(R,c)).join("\uFF1B")}))}const v=n=>{const e=l.resolve(n);return process.platform==="win32"?e.toLowerCase():e};function j(n){if(!m(y()))return null;const e=N();try{const i=new b(e),a=v(n),s=[...i.list(),...i.listArchived()].find(d=>v(d.path)===a);return s?{id:s.id,source:s.source,archived:s.archivedAt!==null,token:s.token}:null}finally{e.close()}}function A(n){const e=l.join(n,".weave","token");return m(e)?w(e,"utf-8").trim():null}export const doctorCommand={name:"doctor",description:"cmd.doctor.desc",options:[{name:"dir",short:"d",description:"flag.dir",type:"string",default:process.cwd()}],async action(n){T();const e=l.resolve(String(n.flags.dir??process.cwd())),i=m(l.join(e,".weave","config.yaml")),s=P()?.port??x,d=await D(s),t=j(e),c=A(e);let u;c===null?u=o("out.doctor.tokenMissing"):t?c===t.token?u=o("out.doctor.tokenOk"):u=o("out.doctor.tokenStale"):u=o("out.doctor.tokenUnregistered"),r.info(o("out.doctor.header")),console.log(p([[o("out.doctor.dir"),e],[o("out.doctor.initialized"),i?o("out.doctor.yes"):o("out.doctor.no")],[o("out.doctor.daemon"),d?o("out.doctor.daemonRunning",{port:s}):o("out.doctor.daemonStopped")],[o("out.doctor.registered"),t?o(t.archived?"out.doctor.registeredArchived":"out.doctor.registeredYes",{id:t.id,source:t.source}):o("out.doctor.registeredNo")],[o("out.doctor.token"),u]])),console.log();const f=await E(e);if(f.length>0){r.warn(o("out.status.issuesFound",{count:f.length}));for(const h of f)r.warn(o("out.status.issue",{message:h.message})),r.dim(o("out.status.fix",{fix:h.fix}));console.log()}if(d&&t&&!t.archived&&await O(s,t.id),!t){r.warn(o("out.doctor.warnNotRegistered")),r.dim(o("out.doctor.fixInit")),i||r.dim(o("out.doctor.fixScan",{dir:e}));return}if(t.archived){r.warn(o("out.doctor.warnArchived"));return}if(c===null){r.warn(o("out.doctor.warnTokenMissing")),r.dim(o("out.doctor.fixInit"));return}if(c!==t.token){r.warn(o("out.doctor.warnTokenStale")),r.dim(o("out.doctor.fixInit"));return}r.success(o("out.doctor.ok")),d||r.dim(o("out.doctor.fixDaemon"))}};
1
+ import{existsSync as m,readFileSync as k}from"node:fs";import u from"node:path";import{DAEMON_HOST as w,DEFAULT_PORT as S,getDbPath as x,ensureDataLayout as y,openDatabase as N,ProjectRepository as b,readDaemonState as T}from"@weavecode/server";import{formatTable as f,logger as r}from"@weavecode/core";import{checkHarness as P}from"../init/harness-checks.js";import{probeDaemon as E}from"./daemon.js";import{localTokenHeader as C}from"./daemon-auth.js";import{t as o}from"../i18n/index.js";const q={"no-mechanism":"out.doctor.reason.noMechanism","no-credentials":"out.doctor.reason.noCredentials","auth-token-required":"out.doctor.reason.authTokenRequired","no-peer-name":"out.doctor.reason.noPeerName","no-backend":"out.doctor.reason.noBackend","no-pane-env":"out.doctor.reason.noPaneEnv","pane-env-conflict":"out.doctor.reason.paneEnvConflict"},D={"no-hook-script":"out.doctor.hint.noHookScript","hook-script-not-weave":"out.doctor.hint.hookScriptNotWeave","hook-script-stale":"out.doctor.hint.hookScriptStale","no-events":"out.doctor.hint.noEvents","no-inbox-credentials":"out.doctor.hint.noInboxCredentials","inbox-token-required":"out.doctor.hint.inboxTokenRequired","no-peer-name":"out.doctor.hint.noPeerName","terminal-no-backend":"out.doctor.hint.terminalNoBackend","terminal-no-pane-env":"out.doctor.hint.terminalNoPaneEnv","terminal-pane-env-conflict":"out.doctor.hint.terminalPaneEnvConflict","not-running":"out.doctor.hint.notRunning",queued:"out.doctor.hint.queued",stalled:"out.doctor.hint.stalled"};function p(n,e){if(!e)return"";const i=n[e];return i?o(i):e}function j(n){if(!n||!n.present)return o("out.doctor.diagScriptNone");const e=n.source==="user"?o("out.doctor.diagSourceUser"):n.source==="project"?o("out.doctor.diagSourceProject"):o("out.doctor.diagSourceNone");if(!n.weaveOwned)return o("out.doctor.diagScriptNotOwned",{source:e});const i=o("out.doctor.diagYes");return o("out.doctor.diagScriptValue",{harness:n.harness,source:e,version:n.generatedVersion??o("out.doctor.diagMissing"),inbox:n.reportsInbox?i:o("out.doctor.diagNo"),pane:n.reportsPaneEnv?i:o("out.doctor.diagNo")})}function l(n){const e=p(q,n.reason);return n.status==="ready"?o("out.doctor.diagReady"):n.status==="unknown"?o("out.doctor.diagUnknown",{reason:e}):o("out.doctor.diagUnavailable",{reason:e})}async function H(n,e){let i;try{const t=await fetch(`http://${w}:${n}/messaging/diagnostics?project=${e}`,{headers:C()});if(!t.ok)throw new Error(`HTTP ${t.status}`);try{i=await t.json()}catch{throw new Error(`HTTP ${t.status}`)}}catch(t){r.warn(o("out.doctor.diagFailed",{error:t instanceof Error?t.message:String(t)}));return}const{daemon:d}=i,s=i.projects.find(t=>t.id===e)?.captures[0]??null;if(console.log(),r.info(o("out.doctor.diagHeader",{id:e})),console.log(f([[o("out.doctor.diagDaemon"),o("out.doctor.diagDaemonValue",{version:d.version,platform:d.platform,preset:d.terminalPreset,channel:o(d.terminalTextChannel?"out.doctor.diagChannelOn":"out.doctor.diagChannelOff")})],[o("out.doctor.diagScript"),j(s)]])),i.sessions.length===0){r.dim(o("out.doctor.diagNoSessions"));return}const a=t=>t===null?o("out.doctor.diagUnknownAlive"):o(t?"out.doctor.diagYes":"out.doctor.diagNo");for(const t of i.sessions)console.log(),console.log(" "+o("out.doctor.diagSession",{id:t.sessionId.slice(0,8),title:t.title??o("out.doctor.diagUntitled"),alive:a(t.alive),events:t.eventCount,last:t.lastEventType??o("out.doctor.diagMissing")})),console.log(" "+o("out.doctor.diagChannels",{inbox:l(t.channels.inbox),queue:l(t.channels.queue),relay:l(t.channels.relay),terminal:l(t.channels.terminal)})),console.log(" "+o("out.doctor.diagQueue",{pending:t.queue.pending,stalled:o(t.queue.stalled?"out.doctor.diagYes":"out.doctor.diagNo")})),t.hints.length>0&&r.dim(" "+o("out.doctor.diagHints",{hints:t.hints.map(c=>p(D,c)).join("\uFF1B")}))}const v=n=>{const e=u.resolve(n);return process.platform==="win32"?e.toLowerCase():e};function O(n){if(!m(x()))return null;const e=N();try{const i=new b(e),d=v(n),s=[...i.list(),...i.listArchived()].find(a=>v(a.path)===d);return s?{id:s.id,source:s.source,archived:s.archivedAt!==null,token:s.token}:null}finally{e.close()}}function R(n){const e=u.join(n,".weave","token");return m(e)?k(e,"utf-8").trim():null}export const doctorCommand={name:"doctor",description:"cmd.doctor.desc",options:[{name:"dir",short:"d",description:"flag.dir",type:"string",default:process.cwd()}],async action(n){y();const e=u.resolve(String(n.flags.dir??process.cwd())),i=m(u.join(e,".weave","config.yaml")),d=T()?.port??S,s=await E(d),a=O(e),t=R(e);let c;t===null?c=o("out.doctor.tokenMissing"):a?t===a.token?c=o("out.doctor.tokenOk"):c=o("out.doctor.tokenStale"):c=o("out.doctor.tokenUnregistered"),r.info(o("out.doctor.header")),console.log(f([[o("out.doctor.dir"),e],[o("out.doctor.initialized"),i?o("out.doctor.yes"):o("out.doctor.no")],[o("out.doctor.daemon"),s?o("out.doctor.daemonRunning",{port:d}):o("out.doctor.daemonStopped")],[o("out.doctor.registered"),a?o(a.archived?"out.doctor.registeredArchived":"out.doctor.registeredYes",{id:a.id,source:a.source}):o("out.doctor.registeredNo")],[o("out.doctor.token"),c]])),console.log();const g=await P(e);if(g.length>0){r.warn(o("out.status.issuesFound",{count:g.length}));for(const h of g)r.warn(o("out.status.issue",{message:h.message})),r.dim(o("out.status.fix",{fix:h.fix}));console.log()}if(s&&a&&!a.archived&&await H(d,a.id),!a){r.warn(o("out.doctor.warnNotRegistered")),r.dim(o("out.doctor.fixInit")),i||r.dim(o("out.doctor.fixScan",{dir:e}));return}if(a.archived){r.warn(o("out.doctor.warnArchived"));return}if(t===null){r.warn(o("out.doctor.warnTokenMissing")),r.dim(o("out.doctor.fixInit"));return}if(t!==a.token){r.warn(o("out.doctor.warnTokenStale")),r.dim(o("out.doctor.fixInit"));return}r.success(o("out.doctor.ok")),s||r.dim(o("out.doctor.fixDaemon"))}};
@@ -1 +1 @@
1
- import{PresetSchema as f,HARNESS_KEYS as m,logger as i,formatTable as p,resolveComponents as g}from"@weavecode/core";import{executeInit as u}from"../init/executor.js";import{registerProject as h,WEAVE_VERSION as S}from"@weavecode/server";import{t as e}from"../i18n/index.js";const d=["preToolUse","postToolUse","userPromptSubmit","sessionStart","stop","stopFailure","subagentStop","subagentStart","notification","postToolUseFailure","permissionRequest","permissionDenied","preCompact","sessionEnd","preModelSwitch"];function k(r){const s=r.trim();if(!s)return{};const c=Object.fromEntries(d.map(n=>[n,!1]));if(s==="none")return c;const a=new Set(s.split(",").map(n=>n.trim()).filter(Boolean)),o=[...a].filter(n=>!d.includes(n));return o.length>0&&i.warn(e("init.hooksUnknownKeys",{keys:o.join(", ")})),Object.fromEntries(d.map(n=>[n,a.has(n)]))}export function parseHarnessFlag(r){const s=r.trim();if(!s)return;const c=s.split(",").map(n=>n.trim().toLowerCase()).filter(Boolean),a=[...new Set(c.filter(n=>m.includes(n)))],o=c.filter(n=>!m.includes(n));return o.length>0&&i.warn(e("init.harnessUnknownKeys",{keys:o.join(", ")})),a.length>0?a:["claude"]}export const initCommand={name:"init",description:"cmd.init.desc",options:[{name:"preset",short:"p",description:"flag.init.preset",type:"string",default:"default",choices:["minimal","default","full"]},{name:"force",short:"f",description:"flag.init.force",type:"boolean",default:!1},{name:"no-interactive",description:"flag.init.noInteractive",type:"boolean",default:!1},{name:"dir",short:"d",description:"flag.dir",type:"string",default:process.cwd()},{name:"hooks",description:"flag.init.hooks",type:"string",default:""},{name:"harness",description:"flag.init.harness",type:"string",default:""}],async action(r){const s=f.parse(r.flags.preset??"default"),c=!!r.flags.force,a=r.flags.noInteractive!==!0&&r.flags.interactive!==!1,o=String(r.flags.dir??process.cwd());i.info(e("init.banner",{version:S})),i.dim(e("init.presetTarget",{preset:s,target:o}));const n=g(s);let t;try{t=await u({targetDir:o,force:c,interactive:a,preset:s,harnesses:parseHarnessFlag(String(r.flags.harness??"")),components:n,hooks:k(String(r.flags.hooks??"")),skills:{},commands:{},agents:{},mcp:{}})}catch(l){i.error(e("init.failed",{error:l instanceof Error?l.message:String(l)})),process.exit(1)}if(t.success){h(o,"init"),i.success(e("init.complete"));const l=[[e("init.table.directories"),String(t.created.directories.length)],[e("init.table.filesCreated"),String(t.created.files.length)],[e("init.table.filesMerged"),String(t.merged.length)],[e("init.table.weaveUpdated"),String(t.updated.length)],[e("init.table.skills"),String(t.summary.skillsCount)],[e("init.table.commands"),String(t.summary.commandsCount)],[e("init.table.agents"),String(t.summary.agentsCount)]];console.log(p(l)),console.log(),t.merged.length>0&&i.dim(e("init.merged",{count:t.merged.length})),t.updated.length>0&&i.dim(e("init.refreshed",{count:t.updated.length})),t.removed.length>0&&i.dim(e("init.removed",{count:t.removed.length})),t.skipped.length>0&&i.dim(e("init.skipped",{count:t.skipped.length}))}else{i.error(e("init.completedWithErrors"));for(const l of t.errors)i.error(e("init.errorLine",{error:l}))}}};
1
+ import{PresetSchema as p,HARNESS_KEYS as m,logger as n,formatTable as g,resolveComponents as f}from"@weavecode/core";import{executeInit as u}from"../init/executor.js";import{registerProject as h,WEAVE_VERSION as S}from"@weavecode/server";import{t as e}from"../i18n/index.js";const d=["preToolUse","postToolUse","userPromptSubmit","sessionStart","stop","stopFailure","subagentStop","subagentStart","notification","postToolUseFailure","permissionRequest","permissionDenied","preCompact","sessionEnd","preModelSwitch"];function b(r){const s=r.trim();if(!s)return{};const c=Object.fromEntries(d.map(i=>[i,!1]));if(s==="none")return c;const a=new Set(s.split(",").map(i=>i.trim()).filter(Boolean)),o=[...a].filter(i=>!d.includes(i));return o.length>0&&n.warn(e("init.hooksUnknownKeys",{keys:o.join(", ")})),Object.fromEntries(d.map(i=>[i,a.has(i)]))}export function parseHarnessFlag(r){const s=r.trim();if(!s)return;const c=s.split(",").map(i=>i.trim().toLowerCase()).filter(Boolean),a=[...new Set(c.filter(i=>m.includes(i)))],o=c.filter(i=>!m.includes(i));return o.length>0&&n.warn(e("init.harnessUnknownKeys",{keys:o.join(", ")})),a.length>0?a:["claude"]}export const initCommand={name:"init",description:"cmd.init.desc",options:[{name:"preset",short:"p",description:"flag.init.preset",type:"string",default:"default",choices:["minimal","default","full"]},{name:"force",short:"f",description:"flag.init.force",type:"boolean",default:!1},{name:"no-interactive",description:"flag.init.noInteractive",type:"boolean",default:!1},{name:"dir",short:"d",description:"flag.dir",type:"string",default:process.cwd()},{name:"hooks",description:"flag.init.hooks",type:"string",default:""},{name:"harness",description:"flag.init.harness",type:"string",default:""}],async action(r){const s=p.parse(r.flags.preset??"default"),c=!!r.flags.force,a=r.flags.noInteractive!==!0&&r.flags.interactive!==!1,o=String(r.flags.dir??process.cwd());n.info(e("init.banner",{version:S})),n.dim(e("init.presetTarget",{preset:s,target:o}));const i=f(s);let t;try{t=await u({targetDir:o,force:c,interactive:a,preset:s,harnesses:parseHarnessFlag(String(r.flags.harness??"")),components:i,hooks:b(String(r.flags.hooks??"")),skills:{},commands:{},agents:{},mcp:{}})}catch(l){n.error(e("init.failed",{error:l instanceof Error?l.message:String(l)})),process.exit(1)}if(t.success){h(o,"init"),n.success(e("init.complete"));const l=[[e("init.table.directories"),String(t.created.directories.length)],[e("init.table.filesCreated"),String(t.created.files.length)],[e("init.table.filesMerged"),String(t.merged.length)],[e("init.table.weaveUpdated"),String(t.updated.length)],[e("init.table.skills"),String(t.summary.skillsCount)],[e("init.table.commands"),String(t.summary.commandsCount)],[e("init.table.agents"),String(t.summary.agentsCount)]];console.log(g(l)),console.log(),t.merged.length>0&&n.dim(e("init.merged",{count:t.merged.length})),t.updated.length>0&&n.dim(e("init.refreshed",{count:t.updated.length})),t.removed.length>0&&n.dim(e("init.removed",{count:t.removed.length})),t.skipped.length>0&&n.dim(e("init.skipped",{count:t.skipped.length}))}else{n.error(e("init.completedWithErrors"));for(const l of t.errors)n.error(e("init.errorLine",{error:l}))}}};
@@ -1 +1 @@
1
- import{readdir as a}from"node:fs/promises";import{existsSync as d}from"node:fs";import{join as o}from"node:path";import{registerProject as f}from"@weavecode/server";import{logger as c}from"@weavecode/core";import{createRuntimeRegistry as m}from"@weavecode/harness";import{t as u}from"../i18n/index.js";const p=new Set(["node_modules",".git","dist","build",".next","coverage",".cache"]),g=m().byCapability("detect").map(t=>t.detect).filter(t=>t!==void 0);export async function findProjectDirs(e,t=0,r=6){if(t>r)return[];if(d(o(e,".weave"))||g.some(i=>i.present(e)))return[e];let n;try{n=await a(e,{withFileTypes:!0})}catch{return[]}const s=[];for(const i of n)i.isDirectory()&&(i.name.startsWith(".")||p.has(i.name)||s.push(...await findProjectDirs(o(e,i.name),t+1,r)));return s}export const scanCommand={name:"scan",description:"cmd.scan.desc",options:[{name:"dir",short:"d",description:"flag.scan.dir",type:"string",default:process.cwd()}],async action(e){const t=String(e.flags.dir??process.cwd()),r=await findProjectDirs(t);for(const n of r)f(n,"scan");if(c.success(u("out.scan.registered",{count:r.length,root:t})),r.length>0)for(const n of r)c.dim(` ${n}`)}};
1
+ import{readdir as c}from"node:fs/promises";import{existsSync as m}from"node:fs";import{join as n}from"node:path";import{registerProject as d}from"@weavecode/server";import{logger as a}from"@weavecode/core";import{createRuntimeRegistry as f}from"@weavecode/harness";import{t as p}from"../i18n/index.js";const g=new Set(["node_modules",".git","dist","build",".next","coverage",".cache"]),u=f().byCapability("detect").map(t=>t.detect).filter(t=>t!==void 0);export async function findProjectDirs(t,s=0,e=6){if(s>e)return[];if(m(n(t,".weave"))||u.some(o=>o.present(t)))return[t];let r;try{r=await c(t,{withFileTypes:!0})}catch{return[]}const i=[];for(const o of r)o.isDirectory()&&(o.name.startsWith(".")||g.has(o.name)||i.push(...await findProjectDirs(n(t,o.name),s+1,e)));return i}export const scanCommand={name:"scan",description:"cmd.scan.desc",options:[{name:"dir",short:"d",description:"flag.scan.dir",type:"string",default:process.cwd()}],async action(t){const s=String(t.flags.dir??process.cwd()),e=await findProjectDirs(s);for(const r of e)d(r,"scan");if(a.success(p("out.scan.registered",{count:e.length,root:s})),e.length>0)for(const r of e)a.dim(` ${r}`)}};
@@ -1,2 +1,2 @@
1
- import u from"node:path";import b from"node:os";import{readFile as y}from"node:fs/promises";import{fileExists as S,logger as l,formatTable as k,HARNESS_DIRS as j,HARNESS_INSTRUCTION_FILES as x,HARNESS_KEYS as E}from"@weavecode/core";import{createRuntimeRegistry as I}from"@weavecode/harness";import{WEAVE_VERSION as N}from"@weavecode/server";import{checkHarness as $}from"../init/harness-checks.js";import{t as o}from"../i18n/index.js";async function C(i){const t=u.join(i,".weave","config.yaml");if(!await S(t))return null;try{const e=await y(t,"utf-8"),a={};for(const r of e.split(`
2
- `)){const n=r.indexOf(":");n>0&&(a[r.slice(0,n).trim()]=r.slice(n+1).trim())}return a}catch{return null}}async function D(i,t){return await S(u.join(t,i))?"out.status.present":"out.status.missing"}async function c(i,t,e){return[i,o(await D(t,e))]}function V(i,t,e){if(!i)return null;try{const a=i.targetDir(t,"project",e,b.homedir());return u.relative(e,a).split(u.sep).join("/")}catch{return null}}export const statusCommand={name:"status",description:"cmd.status.desc",options:[{name:"dir",short:"d",description:"flag.dir",type:"string",default:process.cwd()}],async action(i){const t=String(i.flags.dir??process.cwd()),e=await C(t);if(!e){l.warn(o("out.status.notInitialized"));return}l.info(o("out.status.header"));const a=I(),r=a.byCapability("detect").flatMap(s=>s.detect&&s.detect.detect(t).present?[s.id]:[]),n=[[o("out.status.col.cliVersion"),N],[o("out.status.col.initVersion"),e.initVersion??o("out.status.unknown")],[o("out.status.col.initialized"),e.initTimestamp??o("out.status.unknown")],[o("out.status.col.preset"),e.preset??o("out.status.unknown")],[o("out.status.col.harness"),r.length>0?r.join(", "):o("out.status.unknown")]],f=E[0],p=j[f].projectDir,d=a.get(f)?.assets;for(const s of x[f])n.push(await c(s,s,t));n.push(await c("settings.json",`${p}/settings.json`,t)),n.push(await c(".mcp.json",".mcp.json",t)),n.push(await c("helpers",`${p}/helpers`,t));const w=d?.projectSkillsRoots()[0]??`${p}/skills`;n.push(await c(u.posix.basename(w),w,t));const R=[["commands","command"],["agents","agent"]];for(const[s,m]of R){const h=V(d,m,t)??`${p}/${s}`;n.push(await c(u.posix.basename(h),h,t))}for(const s of r){if(s===f)continue;const m=a.get(s)?.assets?.projectSkillsRoots()[0]??`${j[s].projectDir}/skills`;n.push(await c(m,m,t))}console.log(k(n)),console.log();const g=await $(t);if(g.length>0){l.warn(o("out.status.issuesFound",{count:g.length}));for(const s of g)l.warn(o("out.status.issue",{message:s.message})),l.dim(o("out.status.fix",{fix:s.fix}));console.log()}}};
1
+ import c from"node:path";import R from"node:os";import{readFile as k}from"node:fs/promises";import{fileExists as S,logger as l,formatTable as E,HARNESS_DIRS as j,HARNESS_INSTRUCTION_FILES as x,HARNESS_KEYS as I}from"@weavecode/core";import{createRuntimeRegistry as N}from"@weavecode/harness";import{WEAVE_VERSION as $}from"@weavecode/server";import{checkHarness as b}from"../init/harness-checks.js";import{t as o}from"../i18n/index.js";async function V(e){const t=c.join(e,".weave","config.yaml");if(!await S(t))return null;try{const i=await k(t,"utf-8"),a={};for(const r of i.split(`
2
+ `)){const n=r.indexOf(":");n>0&&(a[r.slice(0,n).trim()]=r.slice(n+1).trim())}return a}catch{return null}}async function _(e,t){return await S(c.join(t,e))?"out.status.present":"out.status.missing"}async function u(e,t,i){return[e,o(await _(t,i))]}function D(e,t,i){if(!e)return null;try{const a=e.targetDir(t,"project",i,R.homedir());return c.relative(i,a).split(c.sep).join("/")}catch{return null}}export const statusCommand={name:"status",description:"cmd.status.desc",options:[{name:"dir",short:"d",description:"flag.dir",type:"string",default:process.cwd()}],async action(e){const t=String(e.flags.dir??process.cwd()),i=await V(t);if(!i){l.warn(o("out.status.notInitialized"));return}l.info(o("out.status.header"));const a=N(),r=a.byCapability("detect").flatMap(s=>s.detect&&s.detect.detect(t).present?[s.id]:[]),n=[[o("out.status.col.cliVersion"),$],[o("out.status.col.initVersion"),i.initVersion??o("out.status.unknown")],[o("out.status.col.initialized"),i.initTimestamp??o("out.status.unknown")],[o("out.status.col.preset"),i.preset??o("out.status.unknown")],[o("out.status.col.harness"),r.length>0?r.join(", "):o("out.status.unknown")]],p=I[0],f=j[p].projectDir,g=a.get(p)?.assets;for(const s of x[p])n.push(await u(s,s,t));n.push(await u("settings.json",`${f}/settings.json`,t)),n.push(await u(".mcp.json",".mcp.json",t)),n.push(await u("helpers",`${f}/helpers`,t));const w=g?.projectSkillsRoots()[0]??`${f}/skills`;n.push(await u(c.posix.basename(w),w,t));const y=[["commands","command"],["agents","agent"]];for(const[s,m]of y){const h=D(g,m,t)??`${f}/${s}`;n.push(await u(c.posix.basename(h),h,t))}for(const s of r){if(s===p)continue;const m=a.get(s)?.assets?.projectSkillsRoots()[0]??`${j[s].projectDir}/skills`;n.push(await u(m,m,t))}console.log(E(n)),console.log();const d=await b(t);if(d.length>0){l.warn(o("out.status.issuesFound",{count:d.length}));for(const s of d)l.warn(o("out.status.issue",{message:s.message})),l.dim(o("out.status.fix",{fix:s.fix}));console.log()}}};