@weavecode/weave 0.1.6 → 0.1.8

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 (435) hide show
  1. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +1 -1
  2. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/adapter/bun/websocket.js +1 -1
  3. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/context.js +1 -1
  4. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/helper/css/common.js +3 -5
  5. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/hono-base.js +4 -10
  6. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/hono.js +0 -1
  7. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +1 -1
  8. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +1 -1
  9. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/csrf/index.js +2 -2
  10. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +2 -2
  11. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +2 -2
  12. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/mount/index.js +4 -4
  13. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +13 -11
  14. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +4 -4
  15. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +39 -51
  16. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +15 -5
  17. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/jwt/jwt.js +2 -1
  18. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/mount.js +35 -0
  19. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/url.js +10 -0
  20. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/validator/validator.js +1 -1
  21. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/context.js +1 -1
  22. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/helper/css/common.js +3 -5
  23. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/hono-base.js +4 -10
  24. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/hono.js +0 -1
  25. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/basic-auth/index.js +1 -1
  26. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/bearer-auth/index.js +1 -1
  27. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/csrf/index.js +2 -2
  28. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/jwk/jwk.js +2 -2
  29. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/jwt/jwt.js +2 -2
  30. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/language/language.js +1 -1
  31. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/mount/index.js +4 -4
  32. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/node.js +13 -11
  33. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +5 -5
  34. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/router.js +40 -52
  35. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/trie.js +15 -5
  36. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/middleware/mount/index.d.ts +1 -0
  37. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -3
  38. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +1 -1
  39. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/utils/mount.d.ts +4 -0
  40. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/utils/url.d.ts +1 -0
  41. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/jwt/jwt.js +2 -1
  42. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/mount.js +34 -0
  43. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/url.js +10 -1
  44. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/validator/validator.js +1 -1
  45. package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/package.json +1 -1
  46. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +3 -1
  47. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/deflate.js +2 -1
  48. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +2 -1
  49. package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +1 -1
  50. package/node_modules/@weavecode/cli/dist/cli.js +3 -3
  51. package/node_modules/@weavecode/cli/dist/commands/chpass.js +1 -1
  52. package/node_modules/@weavecode/cli/dist/commands/daemon-auth.js +1 -1
  53. package/node_modules/@weavecode/cli/dist/commands/daemon.js +2 -2
  54. package/node_modules/@weavecode/cli/dist/commands/dashboard.js +2 -2
  55. package/node_modules/@weavecode/cli/dist/commands/doctor.js +1 -1
  56. package/node_modules/@weavecode/cli/dist/commands/init.js +1 -1
  57. package/node_modules/@weavecode/cli/dist/commands/msg.js +2 -2
  58. package/node_modules/@weavecode/cli/dist/commands/scan.js +1 -1
  59. package/node_modules/@weavecode/cli/dist/commands/status.js +2 -2
  60. package/node_modules/@weavecode/cli/dist/commands/uninstall.js +1 -1
  61. package/node_modules/@weavecode/cli/dist/i18n/dict/en.js +1 -1
  62. package/node_modules/@weavecode/cli/dist/i18n/dict/zh.d.ts +1 -0
  63. package/node_modules/@weavecode/cli/dist/i18n/dict/zh.js +2 -2
  64. package/node_modules/@weavecode/cli/dist/i18n/index.js +1 -1
  65. package/node_modules/@weavecode/cli/dist/i18n/t.js +1 -1
  66. package/node_modules/@weavecode/cli/dist/init/claudemd-gen.js +3 -3
  67. package/node_modules/@weavecode/cli/dist/init/executor.js +3 -3
  68. package/node_modules/@weavecode/cli/dist/init/git-commit.js +2 -2
  69. package/node_modules/@weavecode/cli/dist/init/harnesses/claude.js +7 -7
  70. package/node_modules/@weavecode/cli/dist/init/harnesses/codex.js +1 -1
  71. package/node_modules/@weavecode/cli/dist/init/instruction-link.js +1 -1
  72. package/node_modules/@weavecode/cli/dist/init/plugin-templates.js +1 -1
  73. package/node_modules/@weavecode/cli/dist/init/prompt.js +4 -4
  74. package/node_modules/@weavecode/cli/dist/init/provision.js +1 -1
  75. package/node_modules/@weavecode/cli/dist/init/uninstall.js +6 -6
  76. package/node_modules/@weavecode/cli/dist/init/wiring.js +1 -1
  77. package/node_modules/@weavecode/cli/dist/parser.js +1 -1
  78. package/node_modules/@weavecode/cli/dist/statusline/ansi.js +1 -1
  79. package/node_modules/@weavecode/cli/package.json +5 -5
  80. package/node_modules/@weavecode/core/dist/harness-checks.js +1 -1
  81. package/node_modules/@weavecode/core/dist/harness.d.ts +89 -0
  82. package/node_modules/@weavecode/core/dist/harness.js +1 -1
  83. package/node_modules/@weavecode/core/dist/index.d.ts +1 -1
  84. package/node_modules/@weavecode/core/dist/index.js +1 -1
  85. package/node_modules/@weavecode/core/dist/platform.js +1 -1
  86. package/node_modules/@weavecode/core/dist/types.js +1 -1
  87. package/node_modules/@weavecode/core/dist/utils/fs.js +1 -1
  88. package/node_modules/@weavecode/core/dist/utils/logger.js +1 -1
  89. package/node_modules/@weavecode/core/package.json +1 -1
  90. package/node_modules/@weavecode/harness/dist/claude/assets.js +4 -4
  91. package/node_modules/@weavecode/harness/dist/claude/capture.js +9 -9
  92. package/node_modules/@weavecode/harness/dist/claude/commands.d.ts +2 -0
  93. package/node_modules/@weavecode/harness/dist/claude/commands.js +3 -2
  94. package/node_modules/@weavecode/harness/dist/claude/config.js +2 -2
  95. package/node_modules/@weavecode/harness/dist/claude/detect.js +1 -1
  96. package/node_modules/@weavecode/harness/dist/claude/edits.js +1 -1
  97. package/node_modules/@weavecode/harness/dist/claude/event-source.js +1 -1
  98. package/node_modules/@weavecode/harness/dist/claude/images.js +2 -2
  99. package/node_modules/@weavecode/harness/dist/claude/index.js +1 -1
  100. package/node_modules/@weavecode/harness/dist/claude/liveness.js +1 -1
  101. package/node_modules/@weavecode/harness/dist/claude/mcp-gen.js +1 -1
  102. package/node_modules/@weavecode/harness/dist/claude/messaging.js +2 -2
  103. package/node_modules/@weavecode/harness/dist/claude/model-aliases.js +1 -1
  104. package/node_modules/@weavecode/harness/dist/claude/narration.js +1 -1
  105. package/node_modules/@weavecode/harness/dist/claude/peers.js +1 -1
  106. package/node_modules/@weavecode/harness/dist/claude/plan.js +1 -1
  107. package/node_modules/@weavecode/harness/dist/claude/plugins.js +4 -4
  108. package/node_modules/@weavecode/harness/dist/claude/prompt-inbox.js +1 -1
  109. package/node_modules/@weavecode/harness/dist/claude/prompt.js +3 -3
  110. package/node_modules/@weavecode/harness/dist/claude/questions.js +2 -2
  111. package/node_modules/@weavecode/harness/dist/claude/resume.js +1 -1
  112. package/node_modules/@weavecode/harness/dist/claude/rewind.js +1 -1
  113. package/node_modules/@weavecode/harness/dist/claude/settings-gen.js +1 -1
  114. package/node_modules/@weavecode/harness/dist/claude/side-question.js +2 -2
  115. package/node_modules/@weavecode/harness/dist/claude/statusline/generator.js +14 -14
  116. package/node_modules/@weavecode/harness/dist/claude/statusline/git-cache.js +1 -1
  117. package/node_modules/@weavecode/harness/dist/claude/statusline/surface.js +2 -2
  118. package/node_modules/@weavecode/harness/dist/claude/transcript-cursor.js +2 -2
  119. package/node_modules/@weavecode/harness/dist/claude/transcript.js +7 -7
  120. package/node_modules/@weavecode/harness/dist/codex/assets.js +1 -1
  121. package/node_modules/@weavecode/harness/dist/codex/capture.js +2 -2
  122. package/node_modules/@weavecode/harness/dist/codex/commands.js +4 -4
  123. package/node_modules/@weavecode/harness/dist/codex/config.js +2 -2
  124. package/node_modules/@weavecode/harness/dist/codex/detect.js +1 -1
  125. package/node_modules/@weavecode/harness/dist/codex/event-source.js +2 -2
  126. package/node_modules/@weavecode/harness/dist/codex/images.js +1 -1
  127. package/node_modules/@weavecode/harness/dist/codex/index.js +1 -1
  128. package/node_modules/@weavecode/harness/dist/codex/liveness.js +1 -1
  129. package/node_modules/@weavecode/harness/dist/codex/mcp.js +1 -1
  130. package/node_modules/@weavecode/harness/dist/codex/messaging.js +2 -2
  131. package/node_modules/@weavecode/harness/dist/codex/narration.js +1 -1
  132. package/node_modules/@weavecode/harness/dist/codex/plugin-state.js +1 -1
  133. package/node_modules/@weavecode/harness/dist/codex/plugins.js +3 -3
  134. package/node_modules/@weavecode/harness/dist/codex/provision.js +1 -1
  135. package/node_modules/@weavecode/harness/dist/codex/questions.js +2 -2
  136. package/node_modules/@weavecode/harness/dist/codex/rollout.js +5 -5
  137. package/node_modules/@weavecode/harness/dist/codex/side-question.js +4 -4
  138. package/node_modules/@weavecode/harness/dist/codex/titles.js +4 -4
  139. package/node_modules/@weavecode/harness/dist/codex/toml.js +13 -13
  140. package/node_modules/@weavecode/harness/dist/codex/transcript.js +2 -2
  141. package/node_modules/@weavecode/harness/dist/driver.d.ts +13 -0
  142. package/node_modules/@weavecode/harness/dist/driver.js +1 -1
  143. package/node_modules/@weavecode/harness/dist/init/generated.js +2 -2
  144. package/node_modules/@weavecode/harness/dist/init/pipeline.js +1 -1
  145. package/node_modules/@weavecode/harness/dist/registry-wiring.js +1 -1
  146. package/node_modules/@weavecode/harness/dist/shared/install-link.js +1 -1
  147. package/node_modules/@weavecode/harness/dist/shared/json-cap.js +1 -1
  148. package/node_modules/@weavecode/harness/package.json +2 -2
  149. package/node_modules/@weavecode/server/dist/config/dotted.js +1 -1
  150. package/node_modules/@weavecode/server/dist/config/profiles.js +2 -2
  151. package/node_modules/@weavecode/server/dist/daemon/ai-config.js +2 -2
  152. package/node_modules/@weavecode/server/dist/daemon/ai-context.js +6 -6
  153. package/node_modules/@weavecode/server/dist/daemon/ai-routes.js +4 -4
  154. package/node_modules/@weavecode/server/dist/daemon/api-log.js +3 -3
  155. package/node_modules/@weavecode/server/dist/daemon/auth-routes.js +1 -1
  156. package/node_modules/@weavecode/server/dist/daemon/auto-start.js +6 -6
  157. package/node_modules/@weavecode/server/dist/daemon/capture-routes.js +1 -1
  158. package/node_modules/@weavecode/server/dist/daemon/config-routes.js +1 -1
  159. package/node_modules/@weavecode/server/dist/daemon/cron.js +1 -1
  160. package/node_modules/@weavecode/server/dist/daemon/dashboard-auth.js +2 -2
  161. package/node_modules/@weavecode/server/dist/daemon/dashboard-pusher.js +1 -1
  162. package/node_modules/@weavecode/server/dist/daemon/data-bus.js +1 -1
  163. package/node_modules/@weavecode/server/dist/daemon/decision-config.js +2 -2
  164. package/node_modules/@weavecode/server/dist/daemon/dev-entry.js +1 -1
  165. package/node_modules/@weavecode/server/dist/daemon/entry.js +2 -2
  166. package/node_modules/@weavecode/server/dist/daemon/fs-browser.js +1 -1
  167. package/node_modules/@weavecode/server/dist/daemon/hook-pipeline.js +1 -1
  168. package/node_modules/@weavecode/server/dist/daemon/hooks-routes.js +1 -1
  169. package/node_modules/@weavecode/server/dist/daemon/http.js +1 -1
  170. package/node_modules/@weavecode/server/dist/daemon/liveness.js +1 -1
  171. package/node_modules/@weavecode/server/dist/daemon/mcp-orchestration.js +1 -1
  172. package/node_modules/@weavecode/server/dist/daemon/narration-watcher.js +2 -2
  173. package/node_modules/@weavecode/server/dist/daemon/opener/backend-ghostty.js +1 -1
  174. package/node_modules/@weavecode/server/dist/daemon/opener/backend-iterm.js +1 -1
  175. package/node_modules/@weavecode/server/dist/daemon/opener/backend-konsole.js +2 -2
  176. package/node_modules/@weavecode/server/dist/daemon/opener/backend-terminal-app.js +1 -1
  177. package/node_modules/@weavecode/server/dist/daemon/opener/backend-wezterm.js +1 -1
  178. package/node_modules/@weavecode/server/dist/daemon/opener/backend-wt.js +1 -1
  179. package/node_modules/@weavecode/server/dist/daemon/opener/backend.js +1 -1
  180. package/node_modules/@weavecode/server/dist/daemon/opener/pty-terminals.js +4 -4
  181. package/node_modules/@weavecode/server/dist/daemon/opener/shared.js +1 -1
  182. package/node_modules/@weavecode/server/dist/daemon/opener/wezterm-mux.js +1 -1
  183. package/node_modules/@weavecode/server/dist/daemon/opener/wt.js +3 -3
  184. package/node_modules/@weavecode/server/dist/daemon/opener.js +1 -1
  185. package/node_modules/@weavecode/server/dist/daemon/pet-seed.d.ts +6 -0
  186. package/node_modules/@weavecode/server/dist/daemon/pet-seed.js +1 -0
  187. package/node_modules/@weavecode/server/dist/daemon/pet-window.d.ts +17 -0
  188. package/node_modules/@weavecode/server/dist/daemon/pet-window.js +2 -0
  189. package/node_modules/@weavecode/server/dist/daemon/port.js +1 -1
  190. package/node_modules/@weavecode/server/dist/daemon/project-files.d.ts +1 -1
  191. package/node_modules/@weavecode/server/dist/daemon/project-files.js +2 -2
  192. package/node_modules/@weavecode/server/dist/daemon/project-harnesses.js +2 -2
  193. package/node_modules/@weavecode/server/dist/daemon/project-updates-refresher.js +1 -1
  194. package/node_modules/@weavecode/server/dist/daemon/prompt-images.js +1 -1
  195. package/node_modules/@weavecode/server/dist/daemon/routes/hooks-admin.js +1 -1
  196. package/node_modules/@weavecode/server/dist/daemon/routes/market.js +1 -1
  197. package/node_modules/@weavecode/server/dist/daemon/routes/orchestration.js +1 -1
  198. package/node_modules/@weavecode/server/dist/daemon/routes/path-refs.js +1 -1
  199. package/node_modules/@weavecode/server/dist/daemon/routes/pets.d.ts +3 -0
  200. package/node_modules/@weavecode/server/dist/daemon/routes/pets.js +1 -0
  201. package/node_modules/@weavecode/server/dist/daemon/routes/project-files.js +1 -1
  202. package/node_modules/@weavecode/server/dist/daemon/routes/projects.js +1 -1
  203. package/node_modules/@weavecode/server/dist/daemon/routes/search.js +1 -1
  204. package/node_modules/@weavecode/server/dist/daemon/routes/session-control.js +1 -1
  205. package/node_modules/@weavecode/server/dist/daemon/routes/session-insights.js +1 -1
  206. package/node_modules/@weavecode/server/dist/daemon/routes/settings-statusline.js +1 -1
  207. package/node_modules/@weavecode/server/dist/daemon/routes/uploads.js +1 -1
  208. package/node_modules/@weavecode/server/dist/daemon/routes/visualizations.js +2 -1
  209. package/node_modules/@weavecode/server/dist/daemon/routes/watches.js +1 -1
  210. package/node_modules/@weavecode/server/dist/daemon/server.d.ts +2 -0
  211. package/node_modules/@weavecode/server/dist/daemon/server.js +8 -8
  212. package/node_modules/@weavecode/server/dist/daemon/session-open.d.ts +17 -0
  213. package/node_modules/@weavecode/server/dist/daemon/session-open.js +1 -1
  214. package/node_modules/@weavecode/server/dist/daemon/session-probe.js +1 -1
  215. package/node_modules/@weavecode/server/dist/daemon/settings.d.ts +21 -0
  216. package/node_modules/@weavecode/server/dist/daemon/settings.js +2 -2
  217. package/node_modules/@weavecode/server/dist/daemon/snapshot-refresher.js +1 -1
  218. package/node_modules/@weavecode/server/dist/daemon/sse-hub.js +1 -1
  219. package/node_modules/@weavecode/server/dist/daemon/start.js +1 -1
  220. package/node_modules/@weavecode/server/dist/daemon/state.js +2 -2
  221. package/node_modules/@weavecode/server/dist/daemon/static.js +1 -1
  222. package/node_modules/@weavecode/server/dist/daemon/terminal-topology-refresher.js +1 -1
  223. package/node_modules/@weavecode/server/dist/daemon/tls.js +1 -1
  224. package/node_modules/@weavecode/server/dist/daemon/toolkit-routes.js +1 -1
  225. package/node_modules/@weavecode/server/dist/daemon/upload-sessions.js +1 -1
  226. package/node_modules/@weavecode/server/dist/db/db.d.ts +4 -1
  227. package/node_modules/@weavecode/server/dist/db/db.js +2 -2
  228. package/node_modules/@weavecode/server/dist/db/layout.js +1 -1
  229. package/node_modules/@weavecode/server/dist/db/paths.d.ts +4 -0
  230. package/node_modules/@weavecode/server/dist/db/paths.js +1 -1
  231. package/node_modules/@weavecode/server/dist/hooks/answer-keys.js +1 -1
  232. package/node_modules/@weavecode/server/dist/hooks/bus.js +1 -1
  233. package/node_modules/@weavecode/server/dist/hooks/dashboard-rate.js +1 -1
  234. package/node_modules/@weavecode/server/dist/hooks/decision-judge.js +1 -1
  235. package/node_modules/@weavecode/server/dist/hooks/delivery/ack-gate.js +1 -1
  236. package/node_modules/@weavecode/server/dist/hooks/delivery/channels.js +1 -1
  237. package/node_modules/@weavecode/server/dist/hooks/delivery/keys.js +1 -1
  238. package/node_modules/@weavecode/server/dist/hooks/delivery/queue.js +1 -1
  239. package/node_modules/@weavecode/server/dist/hooks/delivery/relay.js +1 -1
  240. package/node_modules/@weavecode/server/dist/hooks/delivery/send.js +2 -2
  241. package/node_modules/@weavecode/server/dist/hooks/delivery/views.d.ts +3 -1
  242. package/node_modules/@weavecode/server/dist/hooks/delivery/views.js +1 -1
  243. package/node_modules/@weavecode/server/dist/hooks/dispatcher.js +6 -6
  244. package/node_modules/@weavecode/server/dist/hooks/edge-extract.js +1 -1
  245. package/node_modules/@weavecode/server/dist/hooks/handlers/webhook.js +1 -1
  246. package/node_modules/@weavecode/server/dist/hooks/headless-runner.js +2 -2
  247. package/node_modules/@weavecode/server/dist/hooks/inbox-socket.js +2 -2
  248. package/node_modules/@weavecode/server/dist/hooks/inbox-worker.js +3 -3
  249. package/node_modules/@weavecode/server/dist/hooks/match.js +1 -1
  250. package/node_modules/@weavecode/server/dist/hooks/message-deliverer.js +5 -5
  251. package/node_modules/@weavecode/server/dist/hooks/mirror.js +4 -4
  252. package/node_modules/@weavecode/server/dist/hooks/orchestration-engine.js +7 -7
  253. package/node_modules/@weavecode/server/dist/hooks/orchestration-graph.js +1 -1
  254. package/node_modules/@weavecode/server/dist/hooks/plugin-installer.js +3 -3
  255. package/node_modules/@weavecode/server/dist/hooks/plugin-loader.js +1 -1
  256. package/node_modules/@weavecode/server/dist/hooks/plugin-project-state.js +1 -1
  257. package/node_modules/@weavecode/server/dist/hooks/prompt-flusher.js +1 -1
  258. package/node_modules/@weavecode/server/dist/hooks/promptbox.js +8 -8
  259. package/node_modules/@weavecode/server/dist/hooks/push-notify.js +2 -2
  260. package/node_modules/@weavecode/server/dist/hooks/question-tracker.js +1 -1
  261. package/node_modules/@weavecode/server/dist/hooks/registry.js +1 -1
  262. package/node_modules/@weavecode/server/dist/hooks/resume-runner.js +1 -1
  263. package/node_modules/@weavecode/server/dist/hooks/session-purge.js +1 -1
  264. package/node_modules/@weavecode/server/dist/hooks/side-questions.js +1 -1
  265. package/node_modules/@weavecode/server/dist/hooks/synthetic-sessions.js +1 -1
  266. package/node_modules/@weavecode/server/dist/hooks/toolkit-scan.js +1 -1
  267. package/node_modules/@weavecode/server/dist/hooks/toolkit.js +5 -5
  268. package/node_modules/@weavecode/server/dist/hooks/watch-engine.js +1 -1
  269. package/node_modules/@weavecode/server/dist/index.d.ts +1 -1
  270. package/node_modules/@weavecode/server/dist/index.js +1 -1
  271. package/node_modules/@weavecode/server/dist/install/apply-update.js +1 -1
  272. package/node_modules/@weavecode/server/dist/install/capabilities.js +1 -1
  273. package/node_modules/@weavecode/server/dist/install/codex-toml.js +1 -1
  274. package/node_modules/@weavecode/server/dist/install/file-assets.js +1 -1
  275. package/node_modules/@weavecode/server/dist/install/fingerprint.js +1 -1
  276. package/node_modules/@weavecode/server/dist/install/global-config.js +1 -1
  277. package/node_modules/@weavecode/server/dist/install/global-file-assets.js +1 -1
  278. package/node_modules/@weavecode/server/dist/install/init-files.js +2 -2
  279. package/node_modules/@weavecode/server/dist/install/install-ledger.js +1 -1
  280. package/node_modules/@weavecode/server/dist/install/installer.js +1 -1
  281. package/node_modules/@weavecode/server/dist/install/library-index.js +1 -1
  282. package/node_modules/@weavecode/server/dist/install/mcp-rows.js +1 -1
  283. package/node_modules/@weavecode/server/dist/install/plugin-install.js +1 -1
  284. package/node_modules/@weavecode/server/dist/install/plugin-rows.js +1 -1
  285. package/node_modules/@weavecode/server/dist/install/plugin-templates.js +1 -1
  286. package/node_modules/@weavecode/server/dist/install/project-config.js +1 -1
  287. package/node_modules/@weavecode/server/dist/install/reader.js +1 -1
  288. package/node_modules/@weavecode/server/dist/install/scan-cache.js +1 -1
  289. package/node_modules/@weavecode/server/dist/install/scanner.js +1 -1
  290. package/node_modules/@weavecode/server/dist/install/settings-mcp.js +2 -2
  291. package/node_modules/@weavecode/server/dist/install/updates.js +1 -1
  292. package/node_modules/@weavecode/server/dist/market/builtin.js +1 -1
  293. package/node_modules/@weavecode/server/dist/market/identity.js +1 -1
  294. package/node_modules/@weavecode/server/dist/market/import.js +2 -2
  295. package/node_modules/@weavecode/server/dist/market/refresh.js +1 -1
  296. package/node_modules/@weavecode/server/dist/market/resolve.js +1 -1
  297. package/node_modules/@weavecode/server/dist/market/updates.js +1 -1
  298. package/node_modules/@weavecode/server/dist/registry.js +2 -2
  299. package/node_modules/@weavecode/server/dist/repositories/hook-dispatches.js +5 -5
  300. package/node_modules/@weavecode/server/dist/repositories/hook-events.d.ts +6 -0
  301. package/node_modules/@weavecode/server/dist/repositories/hook-events.js +8 -5
  302. package/node_modules/@weavecode/server/dist/repositories/hook-rules.js +4 -4
  303. package/node_modules/@weavecode/server/dist/repositories/libraries.js +1 -1
  304. package/node_modules/@weavecode/server/dist/repositories/orchestrations.js +7 -7
  305. package/node_modules/@weavecode/server/dist/repositories/plugin-states.js +1 -1
  306. package/node_modules/@weavecode/server/dist/repositories/projects.js +2 -2
  307. package/node_modules/@weavecode/server/dist/repositories/push-subscriptions.js +2 -2
  308. package/node_modules/@weavecode/server/dist/repositories/session-watches.js +4 -4
  309. package/node_modules/@weavecode/server/dist/repositories/sessions.js +2 -2
  310. package/node_modules/@weavecode/server/dist/repositories/uploads.js +11 -11
  311. package/node_modules/@weavecode/server/dist/statusline/cache-sweeper.js +1 -1
  312. package/node_modules/@weavecode/server/dist/statusline/generator.js +1 -1
  313. package/node_modules/@weavecode/server/dist/statusline/manager.js +3 -3
  314. package/node_modules/@weavecode/server/dist/surfaces.js +1 -1
  315. package/node_modules/@weavecode/server/dist/watch/cache.js +1 -1
  316. package/node_modules/@weavecode/server/dist/watch/classifier.js +1 -1
  317. package/node_modules/@weavecode/server/dist/watch/plugin-mods.js +1 -1
  318. package/node_modules/@weavecode/server/dist/watch/sync-scheduler.js +1 -1
  319. package/node_modules/@weavecode/server/dist/watch/watch-service.js +1 -1
  320. package/node_modules/@weavecode/server/package.json +4 -4
  321. package/node_modules/@weavecode/server/web/dist/assets/abnfDiagram-WEYOIA3C-t5OQjhuS.js +1 -0
  322. package/node_modules/@weavecode/server/web/dist/assets/{arc-DH8-rYAa.js → arc-De-uH_Q9.js} +1 -1
  323. package/node_modules/@weavecode/server/web/dist/assets/architectureDiagram-ZHVYKT53-ImPclD43.js +36 -0
  324. package/node_modules/@weavecode/server/web/dist/assets/{blockDiagram-RJAE7QA3-pT5eO-cB.js → blockDiagram-RJAE7QA3-B5xEQs6X.js} +2 -2
  325. package/node_modules/@weavecode/server/web/dist/assets/{c4Diagram-XDPPPE54-DHDBDMb1.js → c4Diagram-XDPPPE54-DP8MjIgJ.js} +2 -2
  326. package/node_modules/@weavecode/server/web/dist/assets/channel-C0RGiobt.js +1 -0
  327. package/node_modules/@weavecode/server/web/dist/assets/{chunk-2E7WHVMD-CT951PH5.js → chunk-2E7WHVMD-C3UFIDyj.js} +1 -1
  328. package/node_modules/@weavecode/server/web/dist/assets/{chunk-2Q5K7J3B-E5AD7_ZY.js → chunk-2Q5K7J3B-Bgw-3YfG.js} +1 -1
  329. package/node_modules/@weavecode/server/web/dist/assets/{chunk-4EMNKR2T-DWz9qkcy.js → chunk-4EMNKR2T-Dy_Wq9qn.js} +1 -1
  330. package/node_modules/@weavecode/server/web/dist/assets/chunk-55XCU76K-D32C0DXX.js +1 -0
  331. package/node_modules/@weavecode/server/web/dist/assets/{chunk-5VM5RSS4-ci6YzbO5.js → chunk-5VM5RSS4-Dpmi-9Gi.js} +1 -1
  332. package/node_modules/@weavecode/server/web/dist/assets/{chunk-JWPE2WC7-CY4mr2f4.js → chunk-JWPE2WC7-CEYXaZDX.js} +1 -1
  333. package/node_modules/@weavecode/server/web/dist/assets/{chunk-VQ5W62QI-CON8zyg8.js → chunk-VQ5W62QI-A616Pgzo.js} +1 -1
  334. package/node_modules/@weavecode/server/web/dist/assets/chunk-XXDRQBXY-CnxFMLWV.js +1 -0
  335. package/node_modules/@weavecode/server/web/dist/assets/chunk-ZCHMQSOR-BhjCTig8.js +2 -0
  336. package/node_modules/@weavecode/server/web/dist/assets/{classDiagram-v2-4MYWR3UA-GiWZ9xtF.js → classDiagram-v2-4MYWR3UA-rzlq5tPv.js} +2 -2
  337. package/node_modules/@weavecode/server/web/dist/assets/cose-bilkent-JH36ORCC-CxWQXzj8.js +1 -0
  338. package/node_modules/@weavecode/server/web/dist/assets/{cynefin-EF2NZ3EQ-9B__MaRM.js → cynefin-EF2NZ3EQ-AFHjx2wU.js} +1 -1
  339. package/node_modules/@weavecode/server/web/dist/assets/cynefinDiagram-WF24UDRP-Bp_Oaf9U.js +62 -0
  340. package/node_modules/@weavecode/server/web/dist/assets/dagre-NK4GIZVX-7oUPIU35.js +4 -0
  341. package/node_modules/@weavecode/server/web/dist/assets/diagram-CBK3MWTC-D_rS_rSY.js +24 -0
  342. package/node_modules/@weavecode/server/web/dist/assets/diagram-I5XIIV2D-Duc_cKMb.js +24 -0
  343. package/node_modules/@weavecode/server/web/dist/assets/{diagram-ODIL2UCW-CckywF4W.js → diagram-ODIL2UCW-DA0XFVXm.js} +2 -2
  344. package/node_modules/@weavecode/server/web/dist/assets/{diagram-PFBEJUXE-Dpjlc7Wh.js → diagram-PFBEJUXE-D1U0Xhtt.js} +2 -2
  345. package/node_modules/@weavecode/server/web/dist/assets/diagram-RJA3I4VV-CbDFY871.js +41 -0
  346. package/node_modules/@weavecode/server/web/dist/assets/{diagram-TYUNFSNR-DgRJ3zL1.js → diagram-TYUNFSNR-jPg9AxQv.js} +2 -2
  347. package/node_modules/@weavecode/server/web/dist/assets/ebnfDiagram-V4P3TTPT-ZHfGTB0N.js +1 -0
  348. package/node_modules/@weavecode/server/web/dist/assets/{elk-QONTBCTQ-Ch6Gs9G9.js → elk-QONTBCTQ-C-ESJrUi.js} +3 -3
  349. package/node_modules/@weavecode/server/web/dist/assets/{erDiagram-KYQIGQAA-COxT-Pxb.js → erDiagram-KYQIGQAA-DGK7TeHj.js} +2 -2
  350. package/node_modules/@weavecode/server/web/dist/assets/{flowDiagram-IUGLLWBU-CJVWnTBa.js → flowDiagram-IUGLLWBU-CVV4rL8v.js} +1 -1
  351. package/node_modules/@weavecode/server/web/dist/assets/ganttDiagram-R7GPNTJY-CuAwNvbm.js +292 -0
  352. package/node_modules/@weavecode/server/web/dist/assets/gitGraphDiagram-PDYL7XHY-D_15Wtf-.js +106 -0
  353. package/node_modules/@weavecode/server/web/dist/assets/infoDiagram-MVDRKAX5-ClqhbrCa.js +2 -0
  354. package/node_modules/@weavecode/server/web/dist/assets/{ishikawaDiagram-HPEHV2GE-BNjEDIZy.js → ishikawaDiagram-HPEHV2GE-CUJ891JX.js} +2 -2
  355. package/node_modules/@weavecode/server/web/dist/assets/{journeyDiagram-BOSHW7O7-Cao6h91a.js → journeyDiagram-BOSHW7O7-B4skiMu-.js} +2 -2
  356. package/node_modules/@weavecode/server/web/dist/assets/{kanban-definition-FNSA4HC5-CXIx2CHQ.js → kanban-definition-FNSA4HC5-UNGJR_y_.js} +2 -2
  357. package/node_modules/@weavecode/server/web/dist/assets/linear-BEB-UwbR.js +1 -0
  358. package/node_modules/@weavecode/server/web/dist/assets/main-B_0jS_Gz.js +1096 -0
  359. package/node_modules/@weavecode/server/web/dist/assets/main-Czzlavi4.css +11 -0
  360. package/node_modules/@weavecode/server/web/dist/assets/{mermaid.core-D39fi_iR.js → mermaid.core-knGXJfjz.js} +4 -4
  361. package/node_modules/@weavecode/server/web/dist/assets/{mindmap-definition-6OY57UG3-DHqpz_AK.js → mindmap-definition-6OY57UG3-CEldbr3a.js} +2 -2
  362. package/node_modules/@weavecode/server/web/dist/assets/modulepreload-polyfill-B5Qt9EMX.js +1 -0
  363. package/node_modules/@weavecode/server/web/dist/assets/pegDiagram-ECIUJNBX-cNCkGLx3.js +1 -0
  364. package/node_modules/@weavecode/server/web/dist/assets/pet-DJCpIDM5.js +1 -0
  365. package/node_modules/@weavecode/server/web/dist/assets/pieDiagram-GNMPY74T-CfMEFiQD.js +39 -0
  366. package/node_modules/@weavecode/server/web/dist/assets/{quadrantDiagram-D57K4MC3-zSM6o7mB.js → quadrantDiagram-D57K4MC3-knmi2rwP.js} +4 -4
  367. package/node_modules/@weavecode/server/web/dist/assets/railroadDiagram-Y72NRBL7-BJ7AzhEo.js +1 -0
  368. package/node_modules/@weavecode/server/web/dist/assets/{requirementDiagram-EQYSW5RA-CbCLBjHf.js → requirementDiagram-EQYSW5RA-Dte2LGQM.js} +2 -2
  369. package/node_modules/@weavecode/server/web/dist/assets/{sankeyDiagram-SY24JHO5-BucVk6EP.js → sankeyDiagram-SY24JHO5-3noLaWgd.js} +2 -2
  370. package/node_modules/@weavecode/server/web/dist/assets/{sequenceDiagram-BLEHNHQU-Dg8CYEnT.js → sequenceDiagram-BLEHNHQU-CclOWTTc.js} +2 -2
  371. package/node_modules/@weavecode/server/web/dist/assets/sizeCapture-INFHLROL-B82sbLhA.js +1 -0
  372. package/node_modules/@weavecode/server/web/dist/assets/{stateDiagram-v2-A6IESKWZ-BvK2l3is.js → stateDiagram-v2-A6IESKWZ-BXfVDwSN.js} +2 -2
  373. package/node_modules/@weavecode/server/web/dist/assets/swimlanes-B3ENRKFQ-D4lKZaeV.js +1 -0
  374. package/node_modules/@weavecode/server/web/dist/assets/swimlanesDiagram-AYQRV4AK-DbdFh_d6.js +8 -0
  375. package/node_modules/@weavecode/server/web/dist/assets/{timeline-definition-JXYKGLGB-CadU4Qq4.js → timeline-definition-JXYKGLGB-D6H6zP5b.js} +2 -2
  376. package/node_modules/@weavecode/server/web/dist/assets/{usecaseDiagram-WPOLBNNX-BYuZwTDZ.js → usecaseDiagram-WPOLBNNX-D2J2bKo_.js} +2 -2
  377. package/node_modules/@weavecode/server/web/dist/assets/{vennDiagram-Q3Y3IDCW-C7zgxe07.js → vennDiagram-Q3Y3IDCW-pdRbIkpB.js} +2 -2
  378. package/node_modules/@weavecode/server/web/dist/assets/{wardleyDiagram-IVAIDKWA-DA4Otf4s.js → wardleyDiagram-IVAIDKWA-Cyd2QPMf.js} +2 -2
  379. package/node_modules/@weavecode/server/web/dist/assets/{xychartDiagram-4URNHDU4-Bs5YGwMU.js → xychartDiagram-4URNHDU4-Bd4BkwVM.js} +2 -2
  380. package/node_modules/@weavecode/server/web/dist/icons/apple-touch-icon.png +0 -0
  381. package/node_modules/@weavecode/server/web/dist/icons/icon-192.png +0 -0
  382. package/node_modules/@weavecode/server/web/dist/icons/icon-512.png +0 -0
  383. package/node_modules/@weavecode/server/web/dist/icons/icon-maskable-512.png +0 -0
  384. package/node_modules/@weavecode/server/web/dist/index.html +12 -2
  385. package/node_modules/@weavecode/server/web/dist/manifest.webmanifest +16 -0
  386. package/node_modules/@weavecode/server/web/dist/pet.html +60 -0
  387. package/node_modules/@weavecode/templates/dist/index.d.ts +2 -0
  388. package/node_modules/@weavecode/templates/dist/index.js +1 -1
  389. package/node_modules/@weavecode/templates/dist/resources/pets/weave-spider/pet.json +7 -0
  390. package/node_modules/@weavecode/templates/dist/resources/pets/weave-spider/spritesheet.png +0 -0
  391. package/node_modules/@weavecode/templates/dist/resources/weave-market/.claude-plugin/marketplace.json +6 -0
  392. package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/.claude-plugin/plugin.json +8 -0
  393. package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/skills/weave-pet-hatcher/SKILL.md +121 -0
  394. 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
  395. package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/weave.json +4 -0
  396. package/node_modules/@weavecode/templates/package.json +2 -2
  397. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/README.md +3 -8
  398. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/package.json +1 -1
  399. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/tslib.d.ts +4 -2
  400. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/tslib.es6.js +10 -1
  401. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/tslib.es6.mjs +10 -1
  402. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/tslib/tslib.js +10 -1
  403. package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/README.md +3 -8
  404. package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/package.json +1 -1
  405. package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/tslib.d.ts +4 -2
  406. package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/tslib.es6.js +10 -1
  407. package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/tslib.es6.mjs +10 -1
  408. package/node_modules/selfsigned/node_modules/pkijs/node_modules/tslib/tslib.js +10 -1
  409. package/package.json +11 -7
  410. package/scripts/preinstall.mjs +70 -0
  411. package/node_modules/@weavecode/server/web/dist/assets/abnfDiagram-WEYOIA3C-CbIFQh0R.js +0 -1
  412. package/node_modules/@weavecode/server/web/dist/assets/architectureDiagram-ZHVYKT53-qnv6S0sc.js +0 -36
  413. package/node_modules/@weavecode/server/web/dist/assets/channel-BHPeeuzN.js +0 -1
  414. package/node_modules/@weavecode/server/web/dist/assets/chunk-55XCU76K-D-SgWD8w.js +0 -1
  415. package/node_modules/@weavecode/server/web/dist/assets/chunk-XXDRQBXY-DXXXZ4pW.js +0 -1
  416. package/node_modules/@weavecode/server/web/dist/assets/chunk-ZCHMQSOR-CukvPvkM.js +0 -2
  417. package/node_modules/@weavecode/server/web/dist/assets/cose-bilkent-JH36ORCC-D7aJ-akq.js +0 -1
  418. package/node_modules/@weavecode/server/web/dist/assets/cynefinDiagram-WF24UDRP-B2ujZh2k.js +0 -62
  419. package/node_modules/@weavecode/server/web/dist/assets/dagre-NK4GIZVX-nHaB6IWf.js +0 -4
  420. package/node_modules/@weavecode/server/web/dist/assets/diagram-CBK3MWTC-xKfjDvgr.js +0 -24
  421. package/node_modules/@weavecode/server/web/dist/assets/diagram-I5XIIV2D-BHT2-5mY.js +0 -24
  422. package/node_modules/@weavecode/server/web/dist/assets/diagram-RJA3I4VV-M6WznOaW.js +0 -41
  423. package/node_modules/@weavecode/server/web/dist/assets/ebnfDiagram-V4P3TTPT-BzzVN__a.js +0 -1
  424. package/node_modules/@weavecode/server/web/dist/assets/ganttDiagram-R7GPNTJY-BkRpWPUl.js +0 -292
  425. package/node_modules/@weavecode/server/web/dist/assets/gitGraphDiagram-PDYL7XHY-Ba8BJcvZ.js +0 -106
  426. package/node_modules/@weavecode/server/web/dist/assets/index-CtifxEiF.css +0 -11
  427. package/node_modules/@weavecode/server/web/dist/assets/index-FwH9INgS.js +0 -1090
  428. package/node_modules/@weavecode/server/web/dist/assets/infoDiagram-MVDRKAX5-HTQ5FUNK.js +0 -2
  429. package/node_modules/@weavecode/server/web/dist/assets/linear-65WmlvQb.js +0 -1
  430. package/node_modules/@weavecode/server/web/dist/assets/pegDiagram-ECIUJNBX-Cpy1nsER.js +0 -1
  431. package/node_modules/@weavecode/server/web/dist/assets/pieDiagram-GNMPY74T-B1IyNqzr.js +0 -39
  432. package/node_modules/@weavecode/server/web/dist/assets/railroadDiagram-Y72NRBL7-oM4XJIwA.js +0 -1
  433. package/node_modules/@weavecode/server/web/dist/assets/sizeCapture-INFHLROL-C51zb7Oc.js +0 -1
  434. package/node_modules/@weavecode/server/web/dist/assets/swimlanes-B3ENRKFQ-Ds7QOfXW.js +0 -1
  435. package/node_modules/@weavecode/server/web/dist/assets/swimlanesDiagram-AYQRV4AK-ByBF02UJ.js +0 -8
@@ -80,7 +80,7 @@ const basicAuth = (options, ...users) => {
80
80
  }
81
81
  }
82
82
  const status = 401;
83
- const headers = { "WWW-Authenticate": "Basic realm=\"" + options.realm?.replace(/"/g, "\\\"") + "\"" };
83
+ const headers = { "WWW-Authenticate": "Basic realm=\"" + options.realm?.replace(/[\\"]/g, "\\$&") + "\"" };
84
84
  const responseMessage = typeof options.invalidUserMessage === "function" ? await options.invalidUserMessage(ctx) : options.invalidUserMessage;
85
85
  const res = typeof responseMessage === "string" ? new Response(responseMessage, {
86
86
  status,
@@ -44,7 +44,7 @@ const bearerAuth = (options) => {
44
44
  if (!("token" in options || "verifyToken" in options)) throw new Error("bearer auth middleware requires options for \"token\" or \"verifyToken\"");
45
45
  if (!options.realm) options.realm = "";
46
46
  if (options.prefix === void 0) options.prefix = PREFIX;
47
- const realm = options.realm?.replace(/"/g, "\\\"");
47
+ const realm = options.realm?.replace(/[\\"]/g, "\\$&");
48
48
  const prefix = options.prefix;
49
49
  const tokenRegexp = new RegExp(`^${TOKEN_STRINGS}$`);
50
50
  const wwwAuthenticatePrefix = prefix === "" ? "" : `${prefix} `;
@@ -8,7 +8,7 @@ const secFetchSiteValues = [
8
8
  ];
9
9
  const isSecFetchSite = (value) => secFetchSiteValues.includes(value);
10
10
  const isSafeMethodRe = /^(GET|HEAD|OPTIONS)$/;
11
- const isRequestedByFormElementRe = /^\b(application\/x-www-form-urlencoded|multipart\/form-data|text\/plain)\b/i;
11
+ const isCsrfContentTypeRe = /^\b(application\/x-www-form-urlencoded|multipart\/form-data|text\/(?:plain|ping))\b/i;
12
12
  /**
13
13
  * CSRF Protection Middleware for Hono.
14
14
  *
@@ -94,7 +94,7 @@ const csrf = (options) => {
94
94
  return await secFetchSiteHandler(secFetchSite, c);
95
95
  };
96
96
  return async function csrf(c, next) {
97
- if (!isSafeMethodRe.test(c.req.method) && isRequestedByFormElementRe.test(c.req.header("content-type") || "text/plain") && !await isAllowedSecFetchSite(c.req.header("sec-fetch-site"), c) && !await isAllowedOrigin(c.req.header("origin"), c)) {
97
+ if (!isSafeMethodRe.test(c.req.method) && isCsrfContentTypeRe.test(c.req.header("content-type") || "text/plain") && !await isAllowedSecFetchSite(c.req.header("sec-fetch-site"), c) && !await isAllowedOrigin(c.req.header("origin"), c)) {
98
98
  const res = new Response("Forbidden", { status: 403 });
99
99
  throw new HTTPException(403, { res });
100
100
  }
@@ -109,8 +109,8 @@ const jwk = (options, init) => {
109
109
  };
110
110
  };
111
111
  function unauthorizedResponse(opts) {
112
- const realm = (opts.realm ?? opts.ctx.req.url).replace(/"/g, "\\\"");
113
- const errDescription = opts.errDescription.replace(/"/g, "\\\"");
112
+ const realm = (opts.realm ?? opts.ctx.req.url).replace(/[\\"]/g, "\\$&");
113
+ const errDescription = opts.errDescription.replace(/[\\"]/g, "\\$&");
114
114
  return new Response("Unauthorized", {
115
115
  status: 401,
116
116
  statusText: opts.statusText,
@@ -103,8 +103,8 @@ const jwt = (options) => {
103
103
  };
104
104
  };
105
105
  function unauthorizedResponse(opts) {
106
- const realm = (opts.realm ?? opts.ctx.req.url).replace(/"/g, "\\\"");
107
- const errDescription = opts.errDescription.replace(/"/g, "\\\"");
106
+ const realm = (opts.realm ?? opts.ctx.req.url).replace(/[\\"]/g, "\\$&");
107
+ const errDescription = opts.errDescription.replace(/[\\"]/g, "\\$&");
108
108
  return new Response("Unauthorized", {
109
109
  status: 401,
110
110
  statusText: opts.statusText,
@@ -1,5 +1,5 @@
1
- import { getCookie, setCookie } from "../../helper/cookie/index.js";
2
1
  import { parseAccept } from "../../utils/accept.js";
2
+ import { getCookie, setCookie } from "../../helper/cookie/index.js";
3
3
  //#region src/middleware/language/language.ts
4
4
  const DEFAULT_OPTIONS = {
5
5
  order: [
@@ -1,10 +1,9 @@
1
+ import { createMountedRequest } from "../../utils/mount.js";
1
2
  import { routePath } from "../../helper/route/index.js";
2
3
  //#region src/middleware/mount/index.ts
3
4
  const defaultReplaceRequest = (c) => {
4
- const pathPrefix = routePath(c).replace(/\/\*$/, "");
5
- const url = new URL(c.req.raw.url);
6
- url.pathname = c.req.path.slice(pathPrefix.length) || "/";
7
- return new Request(url, c.req.raw);
5
+ const path = routePath(c);
6
+ return createMountedRequest(c, path.replace(/\/?\*$/, ""), path);
8
7
  };
9
8
  const defaultGetOptions = (c) => {
10
9
  let executionContext = void 0;
@@ -21,6 +20,7 @@ const defaultGetOptions = (c) => {
21
20
  * @param {Function} applicationHandler - other Request Handler
22
21
  * @param {MountOptions} [options] - options of `mount()`
23
22
  * @returns {MiddlewareHandler} handler to register with `app.all()`
23
+ * @throws {Error} If the route ends with a wildcard inside a segment (e.g. `/assets*`), or automatic request rewriting encounters duplicate path parameter names.
24
24
  *
25
25
  * @example
26
26
  * ```ts
@@ -1,8 +1,8 @@
1
1
  import { createNullObject } from "../utils.js";
2
2
  //#region src/router/reg-exp-router/node.ts
3
3
  const LABEL_REG_EXP_STR = "[^/]+";
4
- const ONLY_WILDCARD_REG_EXP_STR = ".*";
5
- const TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
4
+ const ONLY_WILDCARD_REG_EXP_STR = "[^]*";
5
+ const TAIL_WILDCARD_REG_EXP_STR = "(?:|/[^]*)";
6
6
  const PATH_ERROR = Symbol();
7
7
  const regExpMetaChars = /* @__PURE__ */ new Set(".\\+*[^]$()");
8
8
  /**
@@ -15,8 +15,8 @@ const regExpMetaChars = /* @__PURE__ */ new Set(".\\+*[^]$()");
15
15
  function compareKey(a, b) {
16
16
  if (a.length === 1) return b.length === 1 ? a < b ? -1 : 1 : -1;
17
17
  if (b.length === 1) return 1;
18
- if (a === ".*" || a === "(?:|/.*)") return b === "(?:|/.*)" ? -1 : 1;
19
- else if (b === ".*" || b === "(?:|/.*)") return -1;
18
+ if (a === "[^]*" || a === "(?:|/[^]*)") return b === "[^]*" ? -1 : 1;
19
+ else if (b === "[^]*" || b === "(?:|/[^]*)") return -1;
20
20
  if (a === "[^/]+") return 1;
21
21
  else if (b === "[^/]+") return -1;
22
22
  return a.length === b.length ? a < b ? -1 : 1 : b.length - a.length;
@@ -25,14 +25,14 @@ var Node = class Node {
25
25
  #index;
26
26
  #varIndex;
27
27
  #children = createNullObject();
28
- insert(tokens, index, paramMap, context, isStatic) {
28
+ insert(tokens, index, paramMap, context, keys) {
29
29
  let node = this;
30
30
  for (let i = 0, len = tokens.length; i < len; i++) {
31
31
  const token = tokens[i];
32
32
  const pattern = token.length === 1 ? token === "*" ? i === len - 1 ? [
33
33
  "",
34
34
  "",
35
- ".*"
35
+ ONLY_WILDCARD_REG_EXP_STR
36
36
  ] : [
37
37
  "",
38
38
  "",
@@ -47,15 +47,16 @@ var Node = class Node {
47
47
  const name = pattern[1];
48
48
  let regexpStr = pattern[2] || "[^/]+";
49
49
  if (name && pattern[2]) {
50
- if (regexpStr === ".*") throw PATH_ERROR;
50
+ if (new RegExp(regexpStr).test("")) throw PATH_ERROR;
51
51
  regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:");
52
52
  if (/\((?!\?:)/.test(regexpStr)) throw PATH_ERROR;
53
53
  if (regexpStr.length === 1 && regExpMetaChars.has(regexpStr)) throw PATH_ERROR;
54
54
  }
55
+ keys.push(regexpStr);
55
56
  nextNode = node.#children[regexpStr];
56
57
  if (!nextNode) {
57
- if (regexpStr !== ".*" && regexpStr !== "(?:|/.*)") {
58
- for (const k in node.#children) if ((regexpStr.length > 1 || k.length > 1) && k !== ".*" && k !== "(?:|/.*)") throw PATH_ERROR;
58
+ if (regexpStr !== "[^]*" && regexpStr !== "(?:|/[^]*)") {
59
+ for (const k in node.#children) if ((regexpStr.length > 1 || k.length > 1) && k !== "[^]*" && k !== "(?:|/[^]*)") throw PATH_ERROR;
59
60
  }
60
61
  nextNode = node.#children[regexpStr] = new Node();
61
62
  }
@@ -64,16 +65,17 @@ var Node = class Node {
64
65
  paramMap.push([name, nextNode.#varIndex]);
65
66
  }
66
67
  } else {
68
+ keys.push(token);
67
69
  nextNode = node.#children[token];
68
70
  if (!nextNode) {
69
- for (const k in node.#children) if (k.length > 1 && k !== ".*" && k !== "(?:|/.*)") throw PATH_ERROR;
71
+ for (const k in node.#children) if (k.length > 1 && k !== "[^]*" && k !== "(?:|/[^]*)") throw PATH_ERROR;
70
72
  nextNode = node.#children[token] = new Node();
71
73
  }
72
74
  }
73
75
  node = nextNode;
74
76
  }
75
77
  if (node.#index !== void 0) throw PATH_ERROR;
76
- node.#index = isStatic ? -1 : index;
78
+ node.#index = index;
77
79
  }
78
80
  buildRegExpStr() {
79
81
  const strList = Object.keys(this.#children).sort(compareKey).map((k) => {
@@ -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 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 e}from"./i18n/index.js";import{WEAVE_VERSION as S}from"@weavecode/server";const w=process.emitWarning.bind(process);process.emitWarning=(r,...n)=>{if(!(typeof r=="string"?r:String(r)).includes("SQLite is an experimental feature"))return w(r,...n)};const l=()=>S;function v(r){if(r.description){console.log(` ${r.name.padEnd(12)}${e(r.description)}`);for(const n of r.subcommands??[]){const o=[n.name,...n.aliases??[]].join(", "),s=n.description?e(n.description):"";console.log(` ${o.padEnd(12)}${s}`)}}}function i(r){const n=l();console.log(`${e("help.tagline",{version:n})}
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
2
  `),console.log(`${e("help.usage")}
3
- `),console.log(e("help.commands"));for(const o of r.getAllCommands())v(o);console.log(`
4
- ${e("help.globalOptions")}`);for(const o of r.getGlobalOptions()){const s=o.short?`-${o.short}, --${o.name}`:` --${o.name}`;console.log(` ${s.padEnd(20)}${e(o.description)}`)}}function L(r){console.error(e("help.subcommands"));for(const n of r.subcommands??[]){const o=[n.name,...n.aliases??[]].join(", "),s=n.description?e(n.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(n=process.argv.slice(2)){delete process.env.CLAUDE_CODE_CHILD_SESSION,await x();const o=this.parser.parse(n);if(o.flags.version){console.log(l());return}if(o.flags.help||o.command.length===0){i(this.parser);return}let s;for(const a of o.command)s=(s?s.subcommands?.find(c=>c.name===a||c.aliases?.includes(a)):this.parser.getCommand(a))??s;if(!s?.action){if(s?.subcommands?.length){const a=o.positional[0];console.error(a?e("cli.unknownSubcommand",{command:s.name,subcommand:a}):e("cli.missingSubcommand",{command:s.name})),L(s),process.exit(1)}console.error(e("cli.unknownCommand",{command:o.command.join(" ")})),i(this.parser),process.exit(1)}const t=s.maxPositionals??0;if(o.positional.length>t){const a=o.command.join(" ");console.error(e("cli.unexpectedPositional",{command:a,arg:o.positional[t]})),i(this.parser),process.exit(1)}const m=this.parser.validateFlags(o.flags,s);if(m.length>0){for(const a of m)console.error(e("cli.error",{error:a}));process.exit(1)}const d={commandPath:o.command,flags:o.flags,positional:o.positional,raw:o.raw};await s.action(d)}}
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 +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(e){const t=e.positional[0];if(typeof t!="string"||t.length<m){s.warn(r("out.chpass.usage")),process.exitCode=1;return}const n=await i();try{const o=await fetch(`http://${c}:${n.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
+ 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};