@withbuddi/buddi 0.1.0-pre.38 → 0.1.0-pre.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/extension/background.js +635 -21
  2. package/extension/manifest.json +2 -2
  3. package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
  4. package/node_modules/@buddi/cli/dist/access-cmd.d.ts +1 -1
  5. package/node_modules/@buddi/cli/dist/access-cmd.d.ts.map +1 -1
  6. package/node_modules/@buddi/cli/dist/access-cmd.js +23 -3
  7. package/node_modules/@buddi/cli/dist/access-cmd.js.map +1 -1
  8. package/node_modules/@buddi/cli/dist/args.d.ts +2 -2
  9. package/node_modules/@buddi/cli/dist/args.d.ts.map +1 -1
  10. package/node_modules/@buddi/cli/dist/args.js +7 -2
  11. package/node_modules/@buddi/cli/dist/args.js.map +1 -1
  12. package/node_modules/@buddi/cli/dist/commands.d.ts.map +1 -1
  13. package/node_modules/@buddi/cli/dist/commands.js +11 -0
  14. package/node_modules/@buddi/cli/dist/commands.js.map +1 -1
  15. package/node_modules/@buddi/cli/dist/main.d.ts.map +1 -1
  16. package/node_modules/@buddi/cli/dist/main.js +2 -1
  17. package/node_modules/@buddi/cli/dist/main.js.map +1 -1
  18. package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
  19. package/node_modules/@buddi/gateway/dist/missions/ask-cap.d.ts +26 -0
  20. package/node_modules/@buddi/gateway/dist/missions/ask-cap.d.ts.map +1 -0
  21. package/node_modules/@buddi/gateway/dist/missions/ask-cap.js +83 -0
  22. package/node_modules/@buddi/gateway/dist/missions/ask-cap.js.map +1 -0
  23. package/node_modules/@buddi/gateway/dist/missions/execute.d.ts +12 -1
  24. package/node_modules/@buddi/gateway/dist/missions/execute.d.ts.map +1 -1
  25. package/node_modules/@buddi/gateway/dist/missions/execute.js +73 -11
  26. package/node_modules/@buddi/gateway/dist/missions/execute.js.map +1 -1
  27. package/node_modules/@buddi/gateway/dist/missions/parked.d.ts +6 -0
  28. package/node_modules/@buddi/gateway/dist/missions/parked.d.ts.map +1 -1
  29. package/node_modules/@buddi/gateway/dist/missions/parked.js +7 -1
  30. package/node_modules/@buddi/gateway/dist/missions/parked.js.map +1 -1
  31. package/node_modules/@buddi/gateway/dist/serve.js +1 -1
  32. package/node_modules/@buddi/gateway/dist/serve.js.map +1 -1
  33. package/node_modules/@buddi/gateway/dist/system-context.d.ts +7 -0
  34. package/node_modules/@buddi/gateway/dist/system-context.d.ts.map +1 -1
  35. package/node_modules/@buddi/gateway/dist/system-context.js +8 -0
  36. package/node_modules/@buddi/gateway/dist/system-context.js.map +1 -1
  37. package/node_modules/@buddi/gateway/dist/web/api-routes.d.ts.map +1 -1
  38. package/node_modules/@buddi/gateway/dist/web/api-routes.js +11 -3
  39. package/node_modules/@buddi/gateway/dist/web/api-routes.js.map +1 -1
  40. package/node_modules/@buddi/gateway/dist/web/extension.d.ts +13 -1
  41. package/node_modules/@buddi/gateway/dist/web/extension.d.ts.map +1 -1
  42. package/node_modules/@buddi/gateway/dist/web/extension.js +125 -5
  43. package/node_modules/@buddi/gateway/dist/web/extension.js.map +1 -1
  44. package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts +22 -4
  45. package/node_modules/@buddi/gateway/dist/web/onboarding.d.ts.map +1 -1
  46. package/node_modules/@buddi/gateway/dist/web/onboarding.js +82 -13
  47. package/node_modules/@buddi/gateway/dist/web/onboarding.js.map +1 -1
  48. package/node_modules/@buddi/gateway/dist/web/remote-hand.d.ts.map +1 -1
  49. package/node_modules/@buddi/gateway/dist/web/remote-hand.js +45 -2
  50. package/node_modules/@buddi/gateway/dist/web/remote-hand.js.map +1 -1
  51. package/node_modules/@buddi/gateway/dist/web/secrets.d.ts +26 -1
  52. package/node_modules/@buddi/gateway/dist/web/secrets.d.ts.map +1 -1
  53. package/node_modules/@buddi/gateway/dist/web/secrets.js +66 -3
  54. package/node_modules/@buddi/gateway/dist/web/secrets.js.map +1 -1
  55. package/node_modules/@buddi/gateway/dist/web/server.d.ts.map +1 -1
  56. package/node_modules/@buddi/gateway/dist/web/server.js +70 -11
  57. package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
  58. package/node_modules/@buddi/gateway/dist/web/version.d.ts +2 -0
  59. package/node_modules/@buddi/gateway/dist/web/version.d.ts.map +1 -1
  60. package/node_modules/@buddi/gateway/dist/web/version.js +5 -1
  61. package/node_modules/@buddi/gateway/dist/web/version.js.map +1 -1
  62. package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
  63. package/node_modules/@buddi/install/dist/app-layout.d.ts +127 -0
  64. package/node_modules/@buddi/install/dist/app-layout.d.ts.map +1 -0
  65. package/node_modules/@buddi/install/dist/app-layout.js +323 -0
  66. package/node_modules/@buddi/install/dist/app-layout.js.map +1 -0
  67. package/node_modules/@buddi/install/dist/index.d.ts +1 -0
  68. package/node_modules/@buddi/install/dist/index.d.ts.map +1 -1
  69. package/node_modules/@buddi/install/dist/index.js +1 -0
  70. package/node_modules/@buddi/install/dist/index.js.map +1 -1
  71. package/node_modules/@buddi/install/dist/launcher.d.ts.map +1 -1
  72. package/node_modules/@buddi/install/dist/launcher.js +18 -4
  73. package/node_modules/@buddi/install/dist/launcher.js.map +1 -1
  74. package/node_modules/@buddi/install/dist/provenance.d.ts +34 -0
  75. package/node_modules/@buddi/install/dist/provenance.d.ts.map +1 -0
  76. package/node_modules/@buddi/install/dist/provenance.js +200 -0
  77. package/node_modules/@buddi/install/dist/provenance.js.map +1 -0
  78. package/node_modules/@buddi/install/dist/supervisor.d.ts.map +1 -1
  79. package/node_modules/@buddi/install/dist/supervisor.js +9 -4
  80. package/node_modules/@buddi/install/dist/supervisor.js.map +1 -1
  81. package/node_modules/@buddi/install/dist/upgrade.d.ts +77 -3
  82. package/node_modules/@buddi/install/dist/upgrade.d.ts.map +1 -1
  83. package/node_modules/@buddi/install/dist/upgrade.js +325 -43
  84. package/node_modules/@buddi/install/dist/upgrade.js.map +1 -1
  85. package/node_modules/@buddi/tool-browser/dist/.tsbuildinfo +1 -1
  86. package/node_modules/@buddi/tool-browser/dist/controller.d.ts +6 -0
  87. package/node_modules/@buddi/tool-browser/dist/controller.d.ts.map +1 -1
  88. package/node_modules/@buddi/tool-browser/dist/controller.js +80 -6
  89. package/node_modules/@buddi/tool-browser/dist/controller.js.map +1 -1
  90. package/node_modules/@buddi/tool-browser/dist/driver.d.ts +3 -1
  91. package/node_modules/@buddi/tool-browser/dist/driver.d.ts.map +1 -1
  92. package/node_modules/@buddi/tool-browser/dist/driver.js +82 -1
  93. package/node_modules/@buddi/tool-browser/dist/driver.js.map +1 -1
  94. package/node_modules/@buddi/tool-browser/dist/extension.d.ts +60 -7
  95. package/node_modules/@buddi/tool-browser/dist/extension.d.ts.map +1 -1
  96. package/node_modules/@buddi/tool-browser/dist/extension.js +90 -13
  97. package/node_modules/@buddi/tool-browser/dist/extension.js.map +1 -1
  98. package/node_modules/@buddi/tool-browser/dist/index.d.ts +6 -4
  99. package/node_modules/@buddi/tool-browser/dist/index.d.ts.map +1 -1
  100. package/node_modules/@buddi/tool-browser/dist/index.js +7 -4
  101. package/node_modules/@buddi/tool-browser/dist/index.js.map +1 -1
  102. package/node_modules/@buddi/tool-browser/dist/logins.d.ts +150 -0
  103. package/node_modules/@buddi/tool-browser/dist/logins.d.ts.map +1 -0
  104. package/node_modules/@buddi/tool-browser/dist/logins.js +476 -0
  105. package/node_modules/@buddi/tool-browser/dist/logins.js.map +1 -0
  106. package/node_modules/@buddi/tool-browser/dist/routes.d.ts +22 -1
  107. package/node_modules/@buddi/tool-browser/dist/routes.d.ts.map +1 -1
  108. package/node_modules/@buddi/tool-browser/dist/routes.js +51 -3
  109. package/node_modules/@buddi/tool-browser/dist/routes.js.map +1 -1
  110. package/node_modules/@buddi/tool-browser/dist/secrets.d.ts +3 -1
  111. package/node_modules/@buddi/tool-browser/dist/secrets.d.ts.map +1 -1
  112. package/node_modules/@buddi/tool-browser/dist/secrets.js +10 -6
  113. package/node_modules/@buddi/tool-browser/dist/secrets.js.map +1 -1
  114. package/node_modules/@buddi/tool-browser/dist/service.d.ts +26 -2
  115. package/node_modules/@buddi/tool-browser/dist/service.d.ts.map +1 -1
  116. package/node_modules/@buddi/tool-browser/dist/service.js +117 -3
  117. package/node_modules/@buddi/tool-browser/dist/service.js.map +1 -1
  118. package/node_modules/@buddi/tool-browser/dist/types.d.ts +88 -0
  119. package/node_modules/@buddi/tool-browser/dist/types.d.ts.map +1 -1
  120. package/node_modules/@buddi/tool-browser/dist/types.js +18 -0
  121. package/node_modules/@buddi/tool-browser/dist/types.js.map +1 -1
  122. package/node_modules/hono/dist/cjs/hono-base.js +2 -0
  123. package/node_modules/hono/dist/cjs/middleware/language/language.js +1 -1
  124. package/node_modules/hono/dist/cjs/middleware/mount/index.js +71 -0
  125. package/node_modules/hono/dist/cjs/request.js +4 -4
  126. package/node_modules/hono/dist/hono-base.js +2 -0
  127. package/node_modules/hono/dist/middleware/mount/index.js +70 -0
  128. package/node_modules/hono/dist/request.js +4 -4
  129. package/node_modules/hono/dist/types/hono-base.d.ts +2 -0
  130. package/node_modules/hono/dist/types/jsx/base.d.ts +1 -1
  131. package/node_modules/hono/dist/types/middleware/mount/index.d.ts +46 -0
  132. package/node_modules/hono/dist/types/request.d.ts +4 -4
  133. package/node_modules/hono/package.json +9 -1
  134. package/package.json +2 -2
  135. package/packages/cli/dist/.tsbuildinfo +1 -1
  136. package/packages/cli/dist/access-cmd.d.ts +1 -1
  137. package/packages/cli/dist/access-cmd.d.ts.map +1 -1
  138. package/packages/cli/dist/access-cmd.js +23 -3
  139. package/packages/cli/dist/access-cmd.js.map +1 -1
  140. package/packages/cli/dist/args.d.ts +2 -2
  141. package/packages/cli/dist/args.d.ts.map +1 -1
  142. package/packages/cli/dist/args.js +7 -2
  143. package/packages/cli/dist/args.js.map +1 -1
  144. package/packages/cli/dist/commands.d.ts.map +1 -1
  145. package/packages/cli/dist/commands.js +11 -0
  146. package/packages/cli/dist/commands.js.map +1 -1
  147. package/packages/cli/dist/main.d.ts.map +1 -1
  148. package/packages/cli/dist/main.js +2 -1
  149. package/packages/cli/dist/main.js.map +1 -1
  150. package/packages/gateway/dist/.tsbuildinfo +1 -1
  151. package/packages/gateway/dist/missions/ask-cap.d.ts +26 -0
  152. package/packages/gateway/dist/missions/ask-cap.d.ts.map +1 -0
  153. package/packages/gateway/dist/missions/ask-cap.js +83 -0
  154. package/packages/gateway/dist/missions/ask-cap.js.map +1 -0
  155. package/packages/gateway/dist/missions/execute.d.ts +12 -1
  156. package/packages/gateway/dist/missions/execute.d.ts.map +1 -1
  157. package/packages/gateway/dist/missions/execute.js +73 -11
  158. package/packages/gateway/dist/missions/execute.js.map +1 -1
  159. package/packages/gateway/dist/missions/parked.d.ts +6 -0
  160. package/packages/gateway/dist/missions/parked.d.ts.map +1 -1
  161. package/packages/gateway/dist/missions/parked.js +7 -1
  162. package/packages/gateway/dist/missions/parked.js.map +1 -1
  163. package/packages/gateway/dist/serve.js +1 -1
  164. package/packages/gateway/dist/serve.js.map +1 -1
  165. package/packages/gateway/dist/system-context.d.ts +7 -0
  166. package/packages/gateway/dist/system-context.d.ts.map +1 -1
  167. package/packages/gateway/dist/system-context.js +8 -0
  168. package/packages/gateway/dist/system-context.js.map +1 -1
  169. package/packages/gateway/dist/web/api-routes.d.ts.map +1 -1
  170. package/packages/gateway/dist/web/api-routes.js +11 -3
  171. package/packages/gateway/dist/web/api-routes.js.map +1 -1
  172. package/packages/gateway/dist/web/extension.d.ts +13 -1
  173. package/packages/gateway/dist/web/extension.d.ts.map +1 -1
  174. package/packages/gateway/dist/web/extension.js +125 -5
  175. package/packages/gateway/dist/web/extension.js.map +1 -1
  176. package/packages/gateway/dist/web/onboarding.d.ts +22 -4
  177. package/packages/gateway/dist/web/onboarding.d.ts.map +1 -1
  178. package/packages/gateway/dist/web/onboarding.js +82 -13
  179. package/packages/gateway/dist/web/onboarding.js.map +1 -1
  180. package/packages/gateway/dist/web/remote-hand.d.ts.map +1 -1
  181. package/packages/gateway/dist/web/remote-hand.js +45 -2
  182. package/packages/gateway/dist/web/remote-hand.js.map +1 -1
  183. package/packages/gateway/dist/web/secrets.d.ts +26 -1
  184. package/packages/gateway/dist/web/secrets.d.ts.map +1 -1
  185. package/packages/gateway/dist/web/secrets.js +66 -3
  186. package/packages/gateway/dist/web/secrets.js.map +1 -1
  187. package/packages/gateway/dist/web/server.d.ts.map +1 -1
  188. package/packages/gateway/dist/web/server.js +70 -11
  189. package/packages/gateway/dist/web/server.js.map +1 -1
  190. package/packages/gateway/dist/web/version.d.ts +2 -0
  191. package/packages/gateway/dist/web/version.d.ts.map +1 -1
  192. package/packages/gateway/dist/web/version.js +5 -1
  193. package/packages/gateway/dist/web/version.js.map +1 -1
  194. package/packages/install/dist/.tsbuildinfo +1 -1
  195. package/packages/install/dist/app-layout.d.ts +127 -0
  196. package/packages/install/dist/app-layout.d.ts.map +1 -0
  197. package/packages/install/dist/app-layout.js +323 -0
  198. package/packages/install/dist/app-layout.js.map +1 -0
  199. package/packages/install/dist/index.d.ts +1 -0
  200. package/packages/install/dist/index.d.ts.map +1 -1
  201. package/packages/install/dist/index.js +1 -0
  202. package/packages/install/dist/index.js.map +1 -1
  203. package/packages/install/dist/launcher.d.ts.map +1 -1
  204. package/packages/install/dist/launcher.js +18 -4
  205. package/packages/install/dist/launcher.js.map +1 -1
  206. package/packages/install/dist/provenance.d.ts +34 -0
  207. package/packages/install/dist/provenance.d.ts.map +1 -0
  208. package/packages/install/dist/provenance.js +200 -0
  209. package/packages/install/dist/provenance.js.map +1 -0
  210. package/packages/install/dist/supervisor.d.ts.map +1 -1
  211. package/packages/install/dist/supervisor.js +9 -4
  212. package/packages/install/dist/supervisor.js.map +1 -1
  213. package/packages/install/dist/upgrade.d.ts +77 -3
  214. package/packages/install/dist/upgrade.d.ts.map +1 -1
  215. package/packages/install/dist/upgrade.js +325 -43
  216. package/packages/install/dist/upgrade.js.map +1 -1
  217. package/packages/tools/browser/dist/.tsbuildinfo +1 -1
  218. package/packages/tools/browser/dist/controller.d.ts +6 -0
  219. package/packages/tools/browser/dist/controller.d.ts.map +1 -1
  220. package/packages/tools/browser/dist/controller.js +80 -6
  221. package/packages/tools/browser/dist/controller.js.map +1 -1
  222. package/packages/tools/browser/dist/driver.d.ts +3 -1
  223. package/packages/tools/browser/dist/driver.d.ts.map +1 -1
  224. package/packages/tools/browser/dist/driver.js +82 -1
  225. package/packages/tools/browser/dist/driver.js.map +1 -1
  226. package/packages/tools/browser/dist/extension.d.ts +60 -7
  227. package/packages/tools/browser/dist/extension.d.ts.map +1 -1
  228. package/packages/tools/browser/dist/extension.js +90 -13
  229. package/packages/tools/browser/dist/extension.js.map +1 -1
  230. package/packages/tools/browser/dist/index.d.ts +6 -4
  231. package/packages/tools/browser/dist/index.d.ts.map +1 -1
  232. package/packages/tools/browser/dist/index.js +7 -4
  233. package/packages/tools/browser/dist/index.js.map +1 -1
  234. package/packages/tools/browser/dist/logins.d.ts +150 -0
  235. package/packages/tools/browser/dist/logins.d.ts.map +1 -0
  236. package/packages/tools/browser/dist/logins.js +476 -0
  237. package/packages/tools/browser/dist/logins.js.map +1 -0
  238. package/packages/tools/browser/dist/routes.d.ts +22 -1
  239. package/packages/tools/browser/dist/routes.d.ts.map +1 -1
  240. package/packages/tools/browser/dist/routes.js +51 -3
  241. package/packages/tools/browser/dist/routes.js.map +1 -1
  242. package/packages/tools/browser/dist/secrets.d.ts +3 -1
  243. package/packages/tools/browser/dist/secrets.d.ts.map +1 -1
  244. package/packages/tools/browser/dist/secrets.js +10 -6
  245. package/packages/tools/browser/dist/secrets.js.map +1 -1
  246. package/packages/tools/browser/dist/service.d.ts +26 -2
  247. package/packages/tools/browser/dist/service.d.ts.map +1 -1
  248. package/packages/tools/browser/dist/service.js +117 -3
  249. package/packages/tools/browser/dist/service.js.map +1 -1
  250. package/packages/tools/browser/dist/types.d.ts +88 -0
  251. package/packages/tools/browser/dist/types.d.ts.map +1 -1
  252. package/packages/tools/browser/dist/types.js +18 -0
  253. package/packages/tools/browser/dist/types.js.map +1 -1
  254. package/packages/web/dist/assets/index-CO4OawAX.js +146 -0
  255. package/packages/web/dist/assets/index-DYfeUW-0.css +1 -0
  256. package/packages/web/dist/assets/{lottie_light-CuiSMqnl.js → lottie_light-DB7hai8n.js} +1 -1
  257. package/packages/web/dist/build.json +1 -1
  258. package/packages/web/dist/index.html +2 -2
  259. package/packages/web/dist/precache.json +4 -4
  260. package/packages/web/dist/assets/index-Bac-CdD-.css +0 -1
  261. package/packages/web/dist/assets/index-DI8bp_D7.js +0 -146
@@ -0,0 +1,71 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_helper_route_index = require("../../helper/route/index.js");
3
+ //#region src/middleware/mount/index.ts
4
+ const defaultReplaceRequest = (c) => {
5
+ const pathPrefix = require_helper_route_index.routePath(c).replace(/\/\*$/, "");
6
+ const url = new URL(c.req.raw.url);
7
+ url.pathname = c.req.path.slice(pathPrefix.length) || "/";
8
+ return new Request(url, c.req.raw);
9
+ };
10
+ const defaultGetOptions = (c) => {
11
+ let executionContext = void 0;
12
+ try {
13
+ executionContext = c.executionCtx;
14
+ } catch {}
15
+ return [c.env, executionContext];
16
+ };
17
+ /**
18
+ * `mount()` allows you to mount applications built with other frameworks into your Hono application.
19
+ *
20
+ * @see {@link https://hono.dev/docs/api/hono#mount}
21
+ *
22
+ * @param {Function} applicationHandler - other Request Handler
23
+ * @param {MountOptions} [options] - options of `mount()`
24
+ * @returns {MiddlewareHandler} handler to register with `app.all()`
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * import { Router as IttyRouter } from 'itty-router'
29
+ * import { Hono } from 'hono'
30
+ * import { mount } from 'hono/mount'
31
+ * // Create itty-router application
32
+ * const ittyRouter = IttyRouter()
33
+ * // GET /itty-router/hello
34
+ * ittyRouter.get('/hello', () => new Response('Hello from itty-router'))
35
+ *
36
+ * const app = new Hono()
37
+ * app.all('/itty-router/*', mount(ittyRouter.handle))
38
+ * ```
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const app = new Hono()
43
+ * // Send the request to another application without modification.
44
+ * app.all('/app/*', mount(anotherApp, {
45
+ * replaceRequest: (req) => req,
46
+ * }))
47
+ * ```
48
+ */
49
+ const mount = (applicationHandler, options) => {
50
+ let replaceRequest;
51
+ let optionHandler;
52
+ if (options) {
53
+ if (typeof options === "function") optionHandler = options;
54
+ else {
55
+ optionHandler = options.optionHandler;
56
+ if (options.replaceRequest === false) replaceRequest = (request) => request;
57
+ else replaceRequest = options.replaceRequest;
58
+ }
59
+ }
60
+ const getOptions = optionHandler ? (c) => {
61
+ const options = optionHandler(c);
62
+ return Array.isArray(options) ? options : [options];
63
+ } : defaultGetOptions;
64
+ return async (c, next) => {
65
+ const res = await applicationHandler(replaceRequest ? replaceRequest(c.req.raw) : defaultReplaceRequest(c), ...getOptions(c));
66
+ if (res) return res;
67
+ await next();
68
+ };
69
+ };
70
+ //#endregion
71
+ exports.mount = mount;
@@ -189,7 +189,7 @@ var HonoRequest = class {
189
189
  return this.#validatedData?.[target];
190
190
  }
191
191
  /**
192
- * `.url()` can get the request url strings.
192
+ * `.url` can get the request url strings.
193
193
  *
194
194
  * @see {@link https://hono.dev/docs/api/request#url}
195
195
  *
@@ -205,7 +205,7 @@ var HonoRequest = class {
205
205
  return this.raw.url;
206
206
  }
207
207
  /**
208
- * `.method()` can get the method name of the request.
208
+ * `.method` can get the method name of the request.
209
209
  *
210
210
  * @see {@link https://hono.dev/docs/api/request#method}
211
211
  *
@@ -223,7 +223,7 @@ var HonoRequest = class {
223
223
  return this.#matchResult;
224
224
  }
225
225
  /**
226
- * `.matchedRoutes()` can return a matched route in the handler
226
+ * `.matchedRoutes` can return a matched route in the handler
227
227
  *
228
228
  * @deprecated
229
229
  *
@@ -253,7 +253,7 @@ var HonoRequest = class {
253
253
  return this.#matchResult[0].map(([[, route]]) => route);
254
254
  }
255
255
  /**
256
- * `routePath()` can retrieve the path registered within the handler
256
+ * `.routePath` can retrieve the path registered within the handler
257
257
  *
258
258
  * @deprecated
259
259
  *
@@ -175,6 +175,8 @@ var Hono = class Hono {
175
175
  /**
176
176
  * `.mount()` allows you to mount applications built with other frameworks into your Hono application.
177
177
  *
178
+ * @deprecated Use `mount()` from `hono/mount` instead. `.mount()` will be removed in v5.
179
+ *
178
180
  * @see {@link https://hono.dev/docs/api/hono#mount}
179
181
  *
180
182
  * @param {string} path - base Path
@@ -0,0 +1,70 @@
1
+ import { routePath } from "../../helper/route/index.js";
2
+ //#region src/middleware/mount/index.ts
3
+ 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);
8
+ };
9
+ const defaultGetOptions = (c) => {
10
+ let executionContext = void 0;
11
+ try {
12
+ executionContext = c.executionCtx;
13
+ } catch {}
14
+ return [c.env, executionContext];
15
+ };
16
+ /**
17
+ * `mount()` allows you to mount applications built with other frameworks into your Hono application.
18
+ *
19
+ * @see {@link https://hono.dev/docs/api/hono#mount}
20
+ *
21
+ * @param {Function} applicationHandler - other Request Handler
22
+ * @param {MountOptions} [options] - options of `mount()`
23
+ * @returns {MiddlewareHandler} handler to register with `app.all()`
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * import { Router as IttyRouter } from 'itty-router'
28
+ * import { Hono } from 'hono'
29
+ * import { mount } from 'hono/mount'
30
+ * // Create itty-router application
31
+ * const ittyRouter = IttyRouter()
32
+ * // GET /itty-router/hello
33
+ * ittyRouter.get('/hello', () => new Response('Hello from itty-router'))
34
+ *
35
+ * const app = new Hono()
36
+ * app.all('/itty-router/*', mount(ittyRouter.handle))
37
+ * ```
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const app = new Hono()
42
+ * // Send the request to another application without modification.
43
+ * app.all('/app/*', mount(anotherApp, {
44
+ * replaceRequest: (req) => req,
45
+ * }))
46
+ * ```
47
+ */
48
+ const mount = (applicationHandler, options) => {
49
+ let replaceRequest;
50
+ let optionHandler;
51
+ if (options) {
52
+ if (typeof options === "function") optionHandler = options;
53
+ else {
54
+ optionHandler = options.optionHandler;
55
+ if (options.replaceRequest === false) replaceRequest = (request) => request;
56
+ else replaceRequest = options.replaceRequest;
57
+ }
58
+ }
59
+ const getOptions = optionHandler ? (c) => {
60
+ const options = optionHandler(c);
61
+ return Array.isArray(options) ? options : [options];
62
+ } : defaultGetOptions;
63
+ return async (c, next) => {
64
+ const res = await applicationHandler(replaceRequest ? replaceRequest(c.req.raw) : defaultReplaceRequest(c), ...getOptions(c));
65
+ if (res) return res;
66
+ await next();
67
+ };
68
+ };
69
+ //#endregion
70
+ export { mount };
@@ -188,7 +188,7 @@ var HonoRequest = class {
188
188
  return this.#validatedData?.[target];
189
189
  }
190
190
  /**
191
- * `.url()` can get the request url strings.
191
+ * `.url` can get the request url strings.
192
192
  *
193
193
  * @see {@link https://hono.dev/docs/api/request#url}
194
194
  *
@@ -204,7 +204,7 @@ var HonoRequest = class {
204
204
  return this.raw.url;
205
205
  }
206
206
  /**
207
- * `.method()` can get the method name of the request.
207
+ * `.method` can get the method name of the request.
208
208
  *
209
209
  * @see {@link https://hono.dev/docs/api/request#method}
210
210
  *
@@ -222,7 +222,7 @@ var HonoRequest = class {
222
222
  return this.#matchResult;
223
223
  }
224
224
  /**
225
- * `.matchedRoutes()` can return a matched route in the handler
225
+ * `.matchedRoutes` can return a matched route in the handler
226
226
  *
227
227
  * @deprecated
228
228
  *
@@ -252,7 +252,7 @@ var HonoRequest = class {
252
252
  return this.#matchResult[0].map(([[, route]]) => route);
253
253
  }
254
254
  /**
255
- * `routePath()` can retrieve the path registered within the handler
255
+ * `.routePath` can retrieve the path registered within the handler
256
256
  *
257
257
  * @deprecated
258
258
  *
@@ -140,6 +140,8 @@ declare class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends
140
140
  /**
141
141
  * `.mount()` allows you to mount applications built with other frameworks into your Hono application.
142
142
  *
143
+ * @deprecated Use `mount()` from `hono/mount` instead. `.mount()` will be removed in v5.
144
+ *
143
145
  * @see {@link https://hono.dev/docs/api/hono#mount}
144
146
  *
145
147
  * @param {string} path - base Path
@@ -4,7 +4,7 @@ import { JSX as JSX$1 } from "./intrinsic-elements.js";
4
4
  import { Context } from "./context.js";
5
5
  //#region src/jsx/base.d.ts
6
6
  export type Props = Record<string, any>;
7
- type FunctionComponentResult = HtmlEscapedString | Child[] | Promise<HtmlEscapedString | Child[]> | null;
7
+ type FunctionComponentResult = HtmlEscapedString | JSXNode | Child[] | Promise<HtmlEscapedString | JSXNode | Child[]> | null;
8
8
  export type FC<P = Props> = {
9
9
  (props: P): FunctionComponentResult;
10
10
  defaultProps?: Partial<P> | undefined;
@@ -0,0 +1,46 @@
1
+ import { MiddlewareHandler } from "../../types.js";
2
+ import { Context } from "../../context.js";
3
+ //#region src/middleware/mount/index.d.ts
4
+ type ApplicationHandler = (request: Request, ...args: any) => Response | Promise<Response>;
5
+ type MountOptionHandler = (c: Context) => unknown;
6
+ type MountReplaceRequest = (originalRequest: Request) => Request;
7
+ type MountOptions = MountOptionHandler | {
8
+ optionHandler?: MountOptionHandler;
9
+ replaceRequest?: MountReplaceRequest | false;
10
+ };
11
+ /**
12
+ * `mount()` allows you to mount applications built with other frameworks into your Hono application.
13
+ *
14
+ * @see {@link https://hono.dev/docs/api/hono#mount}
15
+ *
16
+ * @param {Function} applicationHandler - other Request Handler
17
+ * @param {MountOptions} [options] - options of `mount()`
18
+ * @returns {MiddlewareHandler} handler to register with `app.all()`
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * import { Router as IttyRouter } from 'itty-router'
23
+ * import { Hono } from 'hono'
24
+ * import { mount } from 'hono/mount'
25
+ * // Create itty-router application
26
+ * const ittyRouter = IttyRouter()
27
+ * // GET /itty-router/hello
28
+ * ittyRouter.get('/hello', () => new Response('Hello from itty-router'))
29
+ *
30
+ * const app = new Hono()
31
+ * app.all('/itty-router/*', mount(ittyRouter.handle))
32
+ * ```
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const app = new Hono()
37
+ * // Send the request to another application without modification.
38
+ * app.all('/app/*', mount(anotherApp, {
39
+ * replaceRequest: (req) => req,
40
+ * }))
41
+ * ```
42
+ */
43
+ export declare const mount: (applicationHandler: ApplicationHandler, options?: MountOptions) => MiddlewareHandler;
44
+ //#endregion
45
+ export type { ApplicationHandler, MountOptionHandler, MountOptions, MountReplaceRequest };
46
+ export {};
@@ -217,7 +217,7 @@ export declare class HonoRequest<P extends string = '/', I extends Input['out']
217
217
  */
218
218
  valid<T extends keyof I & keyof ValidationTargets>(target: T): InputToDataByTarget<I, T>;
219
219
  /**
220
- * `.url()` can get the request url strings.
220
+ * `.url` can get the request url strings.
221
221
  *
222
222
  * @see {@link https://hono.dev/docs/api/request#url}
223
223
  *
@@ -231,7 +231,7 @@ export declare class HonoRequest<P extends string = '/', I extends Input['out']
231
231
  */
232
232
  get url(): string;
233
233
  /**
234
- * `.method()` can get the method name of the request.
234
+ * `.method` can get the method name of the request.
235
235
  *
236
236
  * @see {@link https://hono.dev/docs/api/request#method}
237
237
  *
@@ -245,7 +245,7 @@ export declare class HonoRequest<P extends string = '/', I extends Input['out']
245
245
  get method(): string;
246
246
  get [GET_MATCH_RESULT](): Result<[unknown, RouterRoute]>;
247
247
  /**
248
- * `.matchedRoutes()` can return a matched route in the handler
248
+ * `.matchedRoutes` can return a matched route in the handler
249
249
  *
250
250
  * @deprecated
251
251
  *
@@ -273,7 +273,7 @@ export declare class HonoRequest<P extends string = '/', I extends Input['out']
273
273
  */
274
274
  get matchedRoutes(): RouterRoute[];
275
275
  /**
276
- * `routePath()` can retrieve the path registered within the handler
276
+ * `.routePath` can retrieve the path registered within the handler
277
277
  *
278
278
  * @deprecated
279
279
  *
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "4.13.12",
3
+ "version": "4.13.13",
4
4
  "description": "Web framework built on Web Standards",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",
@@ -103,6 +103,11 @@
103
103
  "import": "./dist/helper/route/index.js",
104
104
  "require": "./dist/cjs/helper/route/index.js"
105
105
  },
106
+ "./mount": {
107
+ "types": "./dist/types/middleware/mount/index.d.ts",
108
+ "import": "./dist/middleware/mount/index.js",
109
+ "require": "./dist/cjs/middleware/mount/index.js"
110
+ },
106
111
  "./cookie": {
107
112
  "types": "./dist/types/helper/cookie/index.d.ts",
108
113
  "import": "./dist/helper/cookie/index.js",
@@ -457,6 +462,9 @@
457
462
  "route": [
458
463
  "./dist/types/helper/route"
459
464
  ],
465
+ "mount": [
466
+ "./dist/types/middleware/mount"
467
+ ],
460
468
  "cookie": [
461
469
  "./dist/types/helper/cookie"
462
470
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withbuddi/buddi",
3
- "version": "0.1.0-pre.38",
3
+ "version": "0.1.0-pre.40",
4
4
  "type": "module",
5
5
  "description": "Your personal agents, on your computer",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "buddi": "packages/install/dist/launcher.js"
18
18
  },
19
19
  "buddi": {
20
- "notes": "- Development: the web test suite runs in a fifth of the time (nwsapi pinned to 2.2.28; its older versions recursed on every menu open under jsdom), which also unsticks the release gate.\n- Cloudflare setup: after the token is checked, type just the name and pick the domain from your Cloudflare zones; the full hostname is still accepted when the token lists none.\n- Cloudflare setup: the Done line says Cloudflare needs a minute or two before the first sign-in works, and to reload if its page can’t find the application.\n- Trusted access: the Cloudflare \"Open Cloudflare\" button opens the token form pre-filled with the four permissions buddi needs (Cloudflare template URL); the owner names and creates the token, then pastes it.\n\n### Added\n\n- Sign in from your own domain through Cloudflare: Settings → System → Sign in from elsewhere → Cloudflare Access walks you through a Cloudflare Tunnel with Cloudflare Access in front (install cloudflared, create the tunnel, point a hostname at the port the panel prints, add an Access application for your email, paste the team domain and AUD tag), with Test my setup and a status line. buddi verifies Access's signed JWT itself on every request — signature against your team's keys, issuer, audience, expiry, your email — never trusts a plain header, and gives the same remote session as Tailscale (12 hours idle, CSRF, approvals, the lock screen). cloudflared points at a separate loopback port that is always treated as a visit from elsewhere, and failed sign-ins there — a stale cookie, or an Access assertion that doesn't verify, counted per visitor address — are counted apart from this computer's and your tailnet's. `buddi doctor` has a `cloudflare access` row.\n- `buddi doctor browser` and `GET /api/browser/telemetry`: the last week's browser stops by cause, cards and routes, so flakiness can be seen to fall; `buddi doctor` has a browser line too.\n- Missions can browse while you are away, in buddi's own browser only (never your Chrome or apps), when their catalogue package says `\"browser\": \"own\"`; the install card says so. When a mission meets a sign-in, a human check, an uncertain click or its budget, it waits for you with the same card, sent to Telegram with its buttons and held on Home and Needs you; your answer carries the run on where it stopped (an answer given the moment the card arrives counts too; Take over makes the run wait until you give the page back, then it carries on), and with no answer within an hour (`missionWaitMinutes` in the browser settings) it stops and tells you in one line. Browser telemetry rows mark mission runs.\n- A colleague an agent asks for help may use the browser too, but only when you are in the asking conversation and a page is already open there; a mission's colleague never does.\n- Plugins can provide the apps route (host API 1.29: `routes` in the manifest, with health and look/do handlers, plus `reach` for the owner's list of apps, take-over without a remote hand, and native typing for `secret.type`). Tools may stop a run on a result that needs the owner (`waitsForOwner` as a function), declare their own budget (`ownBudget`), and put one card in front of the owner (`ctx.ask`).\n- Cloudflare Access can set itself up: Set it up for me (or `buddi access cloudflare setup --host <hostname>`) takes one Cloudflare API token, kept as an owner secret, and makes the tunnel, its route to this computer, the DNS record and the Access application with an Allow policy for your email, fills in the settings, shows the one `sudo cloudflared service install …` line to run (buddi never runs sudo), waits for the tunnel to connect and tests it. Running it again reuses what it made, by the ids it recorded; something of buddi's name it didn't make stops the run with Use it anyway (`--adopt`) instead of being taken silently; one setup or removal runs at a time, and a setup for another hostname waits until what buddi made for the first is removed; a missing token permission is named; Remove what buddi made (or `buddi access cloudflare remove`) deletes only the objects buddi recorded making. The install line only ever holds a well-formed connector token.\n\n### Changed\n\n- The Cloudflare Access form says what is missing in a plain line until you try to turn it on, and its row no longer says Needs setup while it is off.\n- Tailscale sign-in is now one row of Settings → System → Sign in from elsewhere, beside Cloudflare Access; the panel, its `tailscale serve` line and how it checks you are unchanged, and existing Tailscale sessions carry over. `GET/PUT /api/tailscale` stay for one release as aliases of `/api/access/tailscale`.\n- The browser picks where to look for you instead of asking you to pick a mode: buddi's own browser for every page, in the background (headless, seen on the Canvas); your Chrome for sites that need your sign-in, in background tabs, when you allow it and it is connected; your apps only for app jobs. When a route is not there it falls back without stopping, and the chat says one line when the page was not in buddi's own browser (\"I used your Chrome because Amazon needs your sign-in.\"). A login wall in buddi's browser moves to your Chrome when it can, unless the conversation, the agent or your default keeps it in buddi's browser (then the card offers Use my Chrome instead), and the site is remembered.\n- Settings → Computer & browser is now **Where agents may look**: one row per route instead of mode radios — buddi's own browser (always on; ready, Install · 150 MB, the Linux sandbox command to copy, installing), your Chrome (a switch once paired, connected or Chrome closed, Add to Chrome, the pairing code read from the extension in that browser so it pairs by itself, Pair again when Chrome forgot the pairing, Forget this Chrome; the sites that need your sign-in, yours and the ones buddi added itself, outlined dashed, each removable), your apps only when a plugin provides them (its health and fix, a switch, Settings › to the plugin's own page), a warning with Resume while a Stop holds, and Advanced: the first choice for every agent, the agents with their own rule, the sites that need your sign-in, how long Stop lasts, pages open at once, and showing buddi's browser as a window. No lock while a page is open. Your old choice is carried over: Your browser keeps your Chrome on; Use my apps keeps your apps on (and your Chrome when it is paired). A conversation can be pinned to a route (Use my Chrome under the composer, once your Chrome is paired), an agent too (its page → Tools → Where it may look, written as `browser:` in its agent.md), and Settings keeps a default.\n- Browser stops: you are asked on four occasions only, with one card in the chat, the corner chat and Telegram (one photo, then buttons): \"I’m not sure that went through. Look?\" (Carry on · Look), \"Keep going?\" (Stop here · Keep going), \"Amazon needs your sign-in\" (Save a login for next time · Use my Chrome · Take over) and \"This page asks for a human\" (Skip this site · Take over), each with one line of why; while a Stop holds, \"Browsing is paused since 10:12\" (Keep paused · Resume). A slow page, a stale target, a redirect or a closed tab is retried inside the tool, and every action returns the page as it is after it, so agents no longer \"observe again\" or wait for a paused page.\n- Budgets are 200 actions and an hour per task, renewed by any message or card tap of yours in that conversation, and browser steps no longer use up the agent's turns. Several agents can look at once: three own-browser pages by default (a fourth waits its turn; a page waiting on a card for you doesn't count), several Chrome tabs with one agent per site at a time, one page in your hands and one app job at a time.\n- Stop agents' browsing now expires after an hour (a setting; or until you say), and while it holds an agent shows one card with Resume instead of telling you to visit Settings. A Stop left from before is lifted an hour after it was pressed.\n\n…"
20
+ "notes": "- buddi.app for Mac: the DMG downloads from the GitHub release (withbuddi.com/download/mac and the update feed point there), so a release larger than 300 MiB still publishes.\n- First run: accepting the agent a plugin proposes no longer blocks meeting your assistant. Your assistant becomes the default agent and mentions the teammates already there when it introduces itself; if you really do have an assistant already, the chapter says so with a link to Agents instead of a button that does nothing, while a taken name or an unusable model account stays a message you can fix and retry. Restoring a backup from the first-run screen still asks you to confirm once any agent of yours is here, an accepted teammate included, and changing your assistant from first run edits the assistant rather than a teammate you made the default."
21
21
  },
22
22
  "files": [
23
23
  "packages",