gemi 0.157.1 → 0.160.1

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 (251) hide show
  1. package/dist/ai/Agent.d.ts +231 -55
  2. package/dist/ai/Agent.d.ts.map +1 -1
  3. package/dist/ai/AgentController.d.ts +45 -11
  4. package/dist/ai/AgentController.d.ts.map +1 -1
  5. package/dist/ai/eval/Eval.d.ts +2 -11
  6. package/dist/ai/eval/Eval.d.ts.map +1 -1
  7. package/dist/ai/generate.d.ts +165 -7
  8. package/dist/ai/generate.d.ts.map +1 -1
  9. package/dist/ai/index.d.ts +5 -5
  10. package/dist/ai/index.d.ts.map +1 -1
  11. package/dist/ai/index.js +11 -11
  12. package/dist/ai/index.js.map +4 -4
  13. package/dist/ai/usageMeter.d.ts +149 -6
  14. package/dist/ai/usageMeter.d.ts.map +1 -1
  15. package/dist/app/index.js +1 -1
  16. package/dist/bin/gemi.js +178 -121
  17. package/dist/bin/gemi.js.map +5 -4
  18. package/dist/bun/plugin.js +1 -1
  19. package/dist/bun/preload.js +1 -1
  20. package/dist/{chunk-0v3bca8k.js → chunk-0b8m1f07.js} +3 -3
  21. package/dist/{chunk-0v3bca8k.js.map → chunk-0b8m1f07.js.map} +1 -1
  22. package/dist/{chunk-p2c72zx3.js → chunk-0gazmssx.js} +2 -2
  23. package/dist/{chunk-p2c72zx3.js.map → chunk-0gazmssx.js.map} +1 -1
  24. package/dist/{chunk-xff7tkde.js → chunk-0qernzn1.js} +2 -2
  25. package/dist/{chunk-xff7tkde.js.map → chunk-0qernzn1.js.map} +1 -1
  26. package/dist/chunk-0qrbspbe.js +5 -0
  27. package/dist/{chunk-6np1r9gk.js.map → chunk-0qrbspbe.js.map} +1 -1
  28. package/dist/{chunk-517fjfme.js → chunk-0vb4j7cx.js} +3 -3
  29. package/dist/{chunk-517fjfme.js.map → chunk-0vb4j7cx.js.map} +1 -1
  30. package/dist/{chunk-0yjm936b.js → chunk-191gkynh.js} +3 -3
  31. package/dist/{chunk-0yjm936b.js.map → chunk-191gkynh.js.map} +1 -1
  32. package/dist/chunk-1xxh48bd.js +4 -0
  33. package/dist/{chunk-cmt3jw6j.js.map → chunk-1xxh48bd.js.map} +2 -2
  34. package/dist/chunk-27habdva.js +4 -0
  35. package/dist/{chunk-3ndc8adc.js.map → chunk-27habdva.js.map} +2 -2
  36. package/dist/{chunk-qvngsa1c.js → chunk-2ednvght.js} +2 -2
  37. package/dist/{chunk-qvngsa1c.js.map → chunk-2ednvght.js.map} +1 -1
  38. package/dist/chunk-3cvza61a.js +4 -0
  39. package/dist/{chunk-pw5h5935.js.map → chunk-3cvza61a.js.map} +2 -2
  40. package/dist/{chunk-1de3awrh.js → chunk-3d8jxky6.js} +3 -3
  41. package/dist/{chunk-1de3awrh.js.map → chunk-3d8jxky6.js.map} +1 -1
  42. package/dist/chunk-3vmc6adw.js +4 -0
  43. package/dist/{chunk-z7224rhm.js.map → chunk-3vmc6adw.js.map} +2 -2
  44. package/dist/chunk-44ensgdq.js +10 -0
  45. package/dist/{chunk-set6qmjw.js.map → chunk-44ensgdq.js.map} +3 -3
  46. package/dist/{chunk-7yww9aq7.js → chunk-4670xxae.js} +2 -2
  47. package/dist/{chunk-7yww9aq7.js.map → chunk-4670xxae.js.map} +1 -1
  48. package/dist/{chunk-xtqd9vpp.js → chunk-4vqnv41y.js} +2 -2
  49. package/dist/{chunk-xtqd9vpp.js.map → chunk-4vqnv41y.js.map} +1 -1
  50. package/dist/{chunk-exb35whf.js → chunk-4ye6p5yk.js} +2 -2
  51. package/dist/{chunk-exb35whf.js.map → chunk-4ye6p5yk.js.map} +1 -1
  52. package/dist/{chunk-9md6acv2.js → chunk-57qnqcrp.js} +1 -1
  53. package/dist/{chunk-zcg6m7gf.js → chunk-5c6dfy75.js} +2 -2
  54. package/dist/{chunk-zcg6m7gf.js.map → chunk-5c6dfy75.js.map} +1 -1
  55. package/dist/{chunk-t7yt8egz.js → chunk-5pc21syf.js} +3 -3
  56. package/dist/{chunk-t7yt8egz.js.map → chunk-5pc21syf.js.map} +1 -1
  57. package/dist/{chunk-5zxxd7qp.js → chunk-5qzxyj68.js} +1 -1
  58. package/dist/{chunk-pgdxqrjv.js → chunk-664ewdjv.js} +4 -4
  59. package/dist/{chunk-pgdxqrjv.js.map → chunk-664ewdjv.js.map} +2 -2
  60. package/dist/chunk-6d6p0q3p.js +5 -0
  61. package/dist/{chunk-7zy6nq9e.js.map → chunk-6d6p0q3p.js.map} +2 -2
  62. package/dist/{chunk-k1aw97dm.js → chunk-6ytezxzj.js} +2 -2
  63. package/dist/{chunk-78wht1ph.js.map → chunk-6ytezxzj.js.map} +1 -1
  64. package/dist/{chunk-00z7s34q.js → chunk-79nypedr.js} +2 -2
  65. package/dist/{chunk-00z7s34q.js.map → chunk-79nypedr.js.map} +1 -1
  66. package/dist/{chunk-4vnrnbn3.js → chunk-7bc9ypbk.js} +3 -3
  67. package/dist/{chunk-4vnrnbn3.js.map → chunk-7bc9ypbk.js.map} +1 -1
  68. package/dist/{chunk-wg0ttent.js → chunk-7rfw4h2x.js} +3 -3
  69. package/dist/{chunk-wg0ttent.js.map → chunk-7rfw4h2x.js.map} +1 -1
  70. package/dist/{chunk-rrz2ry81.js → chunk-8m3m5hcf.js} +2 -2
  71. package/dist/{chunk-rrz2ry81.js.map → chunk-8m3m5hcf.js.map} +1 -1
  72. package/dist/{chunk-aq5zx3vg.js → chunk-8tyw6faf.js} +2 -2
  73. package/dist/{chunk-aq5zx3vg.js.map → chunk-8tyw6faf.js.map} +1 -1
  74. package/dist/{chunk-p83cjehh.js → chunk-8z29qvvm.js} +3 -3
  75. package/dist/{chunk-p83cjehh.js.map → chunk-8z29qvvm.js.map} +1 -1
  76. package/dist/{chunk-dhq7zv0t.js → chunk-982x8jps.js} +2 -2
  77. package/dist/{chunk-dhq7zv0t.js.map → chunk-982x8jps.js.map} +1 -1
  78. package/dist/{chunk-38kjpa6q.js → chunk-98byy5m4.js} +1 -1
  79. package/dist/{chunk-986eh0n3.js → chunk-9983zmhx.js} +2 -2
  80. package/dist/{chunk-986eh0n3.js.map → chunk-9983zmhx.js.map} +1 -1
  81. package/dist/{chunk-r5y2khw4.js → chunk-9f2ps5v2.js} +2 -2
  82. package/dist/{chunk-r5y2khw4.js.map → chunk-9f2ps5v2.js.map} +1 -1
  83. package/dist/{chunk-q3e1bqrs.js → chunk-bfj2jafb.js} +3 -3
  84. package/dist/{chunk-q3e1bqrs.js.map → chunk-bfj2jafb.js.map} +1 -1
  85. package/dist/{chunk-0vc2akg0.js → chunk-bqxt1she.js} +1 -1
  86. package/dist/{chunk-159j20yr.js → chunk-bzcfw8qd.js} +2 -2
  87. package/dist/{chunk-159j20yr.js.map → chunk-bzcfw8qd.js.map} +1 -1
  88. package/dist/{chunk-ctrae98c.js → chunk-cb873vjm.js} +2 -2
  89. package/dist/{chunk-ctrae98c.js.map → chunk-cb873vjm.js.map} +1 -1
  90. package/dist/{chunk-x82f3q6a.js → chunk-cq16azbw.js} +4 -4
  91. package/dist/{chunk-x82f3q6a.js.map → chunk-cq16azbw.js.map} +1 -1
  92. package/dist/{chunk-72f6pbap.js → chunk-csvffxjh.js} +2 -2
  93. package/dist/{chunk-72f6pbap.js.map → chunk-csvffxjh.js.map} +1 -1
  94. package/dist/chunk-ctrmztan.js +4 -0
  95. package/dist/{chunk-42646nt7.js.map → chunk-ctrmztan.js.map} +2 -2
  96. package/dist/{chunk-4t2j3zcg.js → chunk-d249m2ct.js} +2 -2
  97. package/dist/{chunk-4t2j3zcg.js.map → chunk-d249m2ct.js.map} +2 -2
  98. package/dist/{chunk-h3gcxf2k.js → chunk-day21sfa.js} +3 -3
  99. package/dist/{chunk-h3gcxf2k.js.map → chunk-day21sfa.js.map} +1 -1
  100. package/dist/chunk-dvwfhc5n.js +117 -0
  101. package/dist/{chunk-t66ex43f.js.map → chunk-dvwfhc5n.js.map} +10 -9
  102. package/dist/{chunk-78wht1ph.js → chunk-egwz89ze.js} +2 -2
  103. package/dist/{chunk-k1aw97dm.js.map → chunk-egwz89ze.js.map} +1 -1
  104. package/dist/chunk-fcjjd162.js +4 -0
  105. package/dist/{chunk-jrv31jp9.js.map → chunk-fcjjd162.js.map} +2 -2
  106. package/dist/{chunk-rtv4ax8z.js → chunk-g71ppv6x.js} +2 -2
  107. package/dist/{chunk-rtv4ax8z.js.map → chunk-g71ppv6x.js.map} +1 -1
  108. package/dist/{chunk-56a3vnrj.js → chunk-gmeeyg19.js} +3 -3
  109. package/dist/{chunk-56a3vnrj.js.map → chunk-gmeeyg19.js.map} +1 -1
  110. package/dist/{chunk-yzsyg1f7.js → chunk-j144nwvh.js} +3 -3
  111. package/dist/{chunk-yzsyg1f7.js.map → chunk-j144nwvh.js.map} +1 -1
  112. package/dist/{chunk-q7k2hc45.js → chunk-jarsydtr.js} +3 -3
  113. package/dist/{chunk-q7k2hc45.js.map → chunk-jarsydtr.js.map} +1 -1
  114. package/dist/chunk-k43m5dvs.js +4 -0
  115. package/dist/{chunk-69c2s43a.js.map → chunk-k43m5dvs.js.map} +2 -2
  116. package/dist/chunk-kan3yz82.js +5 -0
  117. package/dist/{chunk-3t4nw1n2.js.map → chunk-kan3yz82.js.map} +2 -2
  118. package/dist/{chunk-ah2jy1vx.js → chunk-m4pkbndk.js} +2 -2
  119. package/dist/{chunk-ah2jy1vx.js.map → chunk-m4pkbndk.js.map} +1 -1
  120. package/dist/{chunk-fe12f946.js → chunk-m73mjzeh.js} +2 -2
  121. package/dist/{chunk-fe12f946.js.map → chunk-m73mjzeh.js.map} +1 -1
  122. package/dist/{chunk-9gt9qdge.js → chunk-m8a80sgn.js} +1 -1
  123. package/dist/chunk-mn9v157z.js +6 -0
  124. package/dist/{chunk-vp6t1gmt.js.map → chunk-mn9v157z.js.map} +2 -2
  125. package/dist/{chunk-px3ctjxh.js → chunk-msxhf3m6.js} +2 -2
  126. package/dist/{chunk-px3ctjxh.js.map → chunk-msxhf3m6.js.map} +1 -1
  127. package/dist/chunk-p6nkfcn1.js +5 -0
  128. package/dist/{chunk-kwc68y45.js.map → chunk-p6nkfcn1.js.map} +2 -2
  129. package/dist/{chunk-ss3yn4g2.js → chunk-p9syxzxh.js} +3 -3
  130. package/dist/{chunk-ss3yn4g2.js.map → chunk-p9syxzxh.js.map} +1 -1
  131. package/dist/{chunk-yewj83ez.js → chunk-pyyhmeg1.js} +3 -3
  132. package/dist/{chunk-yewj83ez.js.map → chunk-pyyhmeg1.js.map} +1 -1
  133. package/dist/{chunk-nvhbkqmd.js → chunk-qbsk0jr8.js} +2 -2
  134. package/dist/{chunk-nvhbkqmd.js.map → chunk-qbsk0jr8.js.map} +1 -1
  135. package/dist/{chunk-g5d62d1n.js → chunk-qsbtqh47.js} +2 -2
  136. package/dist/{chunk-g5d62d1n.js.map → chunk-qsbtqh47.js.map} +1 -1
  137. package/dist/{chunk-wnjvfmqc.js → chunk-qz9n2e59.js} +3 -3
  138. package/dist/{chunk-wnjvfmqc.js.map → chunk-qz9n2e59.js.map} +1 -1
  139. package/dist/{chunk-qbvm5q1g.js → chunk-rq3wrwfa.js} +1 -1
  140. package/dist/{chunk-8eyxj78g.js → chunk-ryq2ezgt.js} +3 -3
  141. package/dist/{chunk-8eyxj78g.js.map → chunk-ryq2ezgt.js.map} +1 -1
  142. package/dist/{chunk-v10xzpqs.js → chunk-s0xwqcrf.js} +2 -2
  143. package/dist/{chunk-v10xzpqs.js.map → chunk-s0xwqcrf.js.map} +1 -1
  144. package/dist/{chunk-kbdt84xg.js → chunk-szdbsmq7.js} +2 -2
  145. package/dist/{chunk-kbdt84xg.js.map → chunk-szdbsmq7.js.map} +1 -1
  146. package/dist/{chunk-n95dppzm.js → chunk-tsbxdz4h.js} +2 -2
  147. package/dist/{chunk-n95dppzm.js.map → chunk-tsbxdz4h.js.map} +1 -1
  148. package/dist/chunk-ttvzfwqw.js +41 -0
  149. package/dist/chunk-ttvzfwqw.js.map +28 -0
  150. package/dist/chunk-v0gjdknx.js +4 -0
  151. package/dist/{chunk-7426gfgw.js.map → chunk-v0gjdknx.js.map} +2 -2
  152. package/dist/chunk-v8fx4vgq.js +4 -0
  153. package/dist/{chunk-zfbqgzwa.js.map → chunk-v8fx4vgq.js.map} +2 -2
  154. package/dist/{chunk-dce3w52r.js → chunk-vb73ddwz.js} +3 -3
  155. package/dist/{chunk-dce3w52r.js.map → chunk-vb73ddwz.js.map} +1 -1
  156. package/dist/{chunk-xyyq577r.js → chunk-w0rfypzx.js} +2 -2
  157. package/dist/{chunk-xyyq577r.js.map → chunk-w0rfypzx.js.map} +1 -1
  158. package/dist/{chunk-tr8se94g.js → chunk-weyv3zrt.js} +3 -3
  159. package/dist/{chunk-tr8se94g.js.map → chunk-weyv3zrt.js.map} +1 -1
  160. package/dist/{chunk-9kyfaeey.js → chunk-wtddr3vs.js} +2 -2
  161. package/dist/{chunk-9kyfaeey.js.map → chunk-wtddr3vs.js.map} +1 -1
  162. package/dist/{chunk-tzheb6ak.js → chunk-xp7x27n8.js} +3 -3
  163. package/dist/{chunk-tzheb6ak.js.map → chunk-xp7x27n8.js.map} +1 -1
  164. package/dist/{chunk-ycn7w2e9.js → chunk-yzw2tvqq.js} +2 -2
  165. package/dist/{chunk-ycn7w2e9.js.map → chunk-yzw2tvqq.js.map} +1 -1
  166. package/dist/{chunk-wbv6218d.js → chunk-zz2n9pa5.js} +3 -3
  167. package/dist/{chunk-wbv6218d.js.map → chunk-zz2n9pa5.js.map} +1 -1
  168. package/dist/client/index.js +1 -1
  169. package/dist/client/index.js.map +1 -1
  170. package/dist/config/index.js +1 -1
  171. package/dist/console/run.js +2 -2
  172. package/dist/console/run.js.map +1 -1
  173. package/dist/container/index.js +2 -2
  174. package/dist/container/index.js.map +1 -1
  175. package/dist/database/index.js +2 -2
  176. package/dist/database/index.js.map +1 -1
  177. package/dist/email/index.js +2 -2
  178. package/dist/email/index.js.map +1 -1
  179. package/dist/facades/index.js +2 -2
  180. package/dist/facades/index.js.map +1 -1
  181. package/dist/foundation/index.js +2 -2
  182. package/dist/foundation/index.js.map +1 -1
  183. package/dist/http/ApiRouter.d.ts.map +1 -1
  184. package/dist/http/McpRouter.d.ts +203 -6
  185. package/dist/http/McpRouter.d.ts.map +1 -1
  186. package/dist/http/index.d.ts +1 -1
  187. package/dist/http/index.d.ts.map +1 -1
  188. package/dist/http/index.js +2 -2
  189. package/dist/http/index.js.map +1 -1
  190. package/dist/i18n/dictionaryRuntime.js +2 -2
  191. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  192. package/dist/i18n/index.js +2 -2
  193. package/dist/i18n/index.js.map +1 -1
  194. package/dist/kernel/index.js +2 -2
  195. package/dist/kernel/index.js.map +1 -1
  196. package/dist/orm/index.js +2 -2
  197. package/dist/orm/index.js.map +1 -1
  198. package/dist/probe/index.d.ts +79 -0
  199. package/dist/probe/index.d.ts.map +1 -0
  200. package/dist/probe/index.js +8 -0
  201. package/dist/probe/index.js.map +10 -0
  202. package/dist/server/index.js +2 -2
  203. package/dist/server/index.js.map +1 -1
  204. package/dist/services/image-optimization/ImageManager.d.ts +3 -0
  205. package/dist/services/image-optimization/ImageManager.d.ts.map +1 -1
  206. package/dist/services/image-optimization/config.d.ts +12 -0
  207. package/dist/services/image-optimization/config.d.ts.map +1 -1
  208. package/dist/services/image-optimization/fetchSourceImage.d.ts +37 -0
  209. package/dist/services/image-optimization/fetchSourceImage.d.ts.map +1 -0
  210. package/dist/services/index.d.ts +1 -1
  211. package/dist/services/index.d.ts.map +1 -1
  212. package/dist/services/index.js +9 -9
  213. package/dist/services/index.js.map +3 -3
  214. package/dist/services/mcp/McpRegistry.d.ts.map +1 -1
  215. package/dist/services/queue/work.js +2 -2
  216. package/dist/services/queue/work.js.map +1 -1
  217. package/dist/services/rate-limiter/drivers/RedisRateLimiterDriver.d.ts +95 -13
  218. package/dist/services/rate-limiter/drivers/RedisRateLimiterDriver.d.ts.map +1 -1
  219. package/dist/services/router/ApiRouteDispatcher.d.ts +12 -0
  220. package/dist/services/router/ApiRouteDispatcher.d.ts.map +1 -1
  221. package/dist/services/router/createFlatApiRoutes.d.ts +10 -0
  222. package/dist/services/router/createFlatApiRoutes.d.ts.map +1 -1
  223. package/dist/stats/route-table.js +1 -1
  224. package/dist/support/index.js +2 -2
  225. package/dist/support/index.js.map +1 -1
  226. package/dist/vitest/index.js +1 -1
  227. package/package.json +2 -1
  228. package/dist/chunk-3ndc8adc.js +0 -4
  229. package/dist/chunk-3t4nw1n2.js +0 -5
  230. package/dist/chunk-42646nt7.js +0 -4
  231. package/dist/chunk-69c2s43a.js +0 -4
  232. package/dist/chunk-6np1r9gk.js +0 -5
  233. package/dist/chunk-7426gfgw.js +0 -4
  234. package/dist/chunk-7zy6nq9e.js +0 -5
  235. package/dist/chunk-cmt3jw6j.js +0 -4
  236. package/dist/chunk-jrv31jp9.js +0 -4
  237. package/dist/chunk-kwc68y45.js +0 -5
  238. package/dist/chunk-pw5h5935.js +0 -4
  239. package/dist/chunk-set6qmjw.js +0 -10
  240. package/dist/chunk-t66ex43f.js +0 -117
  241. package/dist/chunk-vp6t1gmt.js +0 -6
  242. package/dist/chunk-xp5axyb5.js +0 -30
  243. package/dist/chunk-xp5axyb5.js.map +0 -28
  244. package/dist/chunk-z7224rhm.js +0 -4
  245. package/dist/chunk-zfbqgzwa.js +0 -4
  246. /package/dist/{chunk-9md6acv2.js.map → chunk-57qnqcrp.js.map} +0 -0
  247. /package/dist/{chunk-5zxxd7qp.js.map → chunk-5qzxyj68.js.map} +0 -0
  248. /package/dist/{chunk-38kjpa6q.js.map → chunk-98byy5m4.js.map} +0 -0
  249. /package/dist/{chunk-0vc2akg0.js.map → chunk-bqxt1she.js.map} +0 -0
  250. /package/dist/{chunk-9gt9qdge.js.map → chunk-m8a80sgn.js.map} +0 -0
  251. /package/dist/{chunk-qbvm5q1g.js.map → chunk-rq3wrwfa.js.map} +0 -0
package/dist/bin/gemi.js CHANGED
@@ -222,11 +222,11 @@ var require_tslib = __commonJS((exports, module) => {
222
222
  };
223
223
  __awaiter = function(thisArg, _arguments, P, generator) {
224
224
  function adopt(value) {
225
- return value instanceof P ? value : new P(function(resolve) {
226
- resolve(value);
225
+ return value instanceof P ? value : new P(function(resolve2) {
226
+ resolve2(value);
227
227
  });
228
228
  }
229
- return new (P || (P = Promise))(function(resolve, reject) {
229
+ return new (P || (P = Promise))(function(resolve2, reject) {
230
230
  function fulfilled(value) {
231
231
  try {
232
232
  step(generator.next(value));
@@ -242,7 +242,7 @@ var require_tslib = __commonJS((exports, module) => {
242
242
  }
243
243
  }
244
244
  function step(result) {
245
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
245
+ result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
246
246
  }
247
247
  step((generator = generator.apply(thisArg, _arguments || [])).next());
248
248
  });
@@ -471,14 +471,14 @@ var require_tslib = __commonJS((exports, module) => {
471
471
  }, i);
472
472
  function verb(n) {
473
473
  i[n] = o[n] && function(v) {
474
- return new Promise(function(resolve, reject) {
475
- v = o[n](v), settle(resolve, reject, v.done, v.value);
474
+ return new Promise(function(resolve2, reject) {
475
+ v = o[n](v), settle(resolve2, reject, v.done, v.value);
476
476
  });
477
477
  };
478
478
  }
479
- function settle(resolve, reject, d, v) {
479
+ function settle(resolve2, reject, d, v) {
480
480
  Promise.resolve(v).then(function(v2) {
481
- resolve({ value: v2, done: d });
481
+ resolve2({ value: v2, done: d });
482
482
  }, reject);
483
483
  }
484
484
  };
@@ -1418,11 +1418,11 @@ var require_path = __commonJS((exports, module) => {
1418
1418
  return path3.__childCache || (path3.__childCache = Object.create(null));
1419
1419
  }
1420
1420
  function getChildPath(path3, name) {
1421
- var cache = getChildCache(path3);
1421
+ var cache2 = getChildCache(path3);
1422
1422
  var actualChildValue = path3.getValueProperty(name);
1423
- var childPath = cache[name];
1424
- if (!hasOwn.call(cache, name) || childPath.value !== actualChildValue) {
1425
- childPath = cache[name] = new path3.constructor(actualChildValue, path3, name);
1423
+ var childPath = cache2[name];
1424
+ if (!hasOwn.call(cache2, name) || childPath.value !== actualChildValue) {
1425
+ childPath = cache2[name] = new path3.constructor(actualChildValue, path3, name);
1426
1426
  }
1427
1427
  return childPath;
1428
1428
  }
@@ -1497,7 +1497,7 @@ var require_path = __commonJS((exports, module) => {
1497
1497
  isNumber.assert(start);
1498
1498
  isNumber.assert(end);
1499
1499
  var moves = Object.create(null);
1500
- var cache = getChildCache(path3);
1500
+ var cache2 = getChildCache(path3);
1501
1501
  for (var i = start;i < end; ++i) {
1502
1502
  if (hasOwn.call(path3.value, i)) {
1503
1503
  var childPath = path3.get(i);
@@ -1507,17 +1507,17 @@ var require_path = __commonJS((exports, module) => {
1507
1507
  var newIndex = i + offset;
1508
1508
  childPath.name = newIndex;
1509
1509
  moves[newIndex] = childPath;
1510
- delete cache[i];
1510
+ delete cache2[i];
1511
1511
  }
1512
1512
  }
1513
- delete cache.length;
1513
+ delete cache2.length;
1514
1514
  return function() {
1515
1515
  for (var newIndex2 in moves) {
1516
1516
  var childPath2 = moves[newIndex2];
1517
1517
  if (childPath2.name !== +newIndex2) {
1518
1518
  throw new Error("");
1519
1519
  }
1520
- cache[newIndex2] = childPath2;
1520
+ cache2[newIndex2] = childPath2;
1521
1521
  path3.value[newIndex2] = childPath2.value;
1522
1522
  }
1523
1523
  };
@@ -1549,9 +1549,9 @@ var require_path = __commonJS((exports, module) => {
1549
1549
  };
1550
1550
  Pp.pop = function pop() {
1551
1551
  isArray.assert(this.value);
1552
- var cache = getChildCache(this);
1553
- delete cache[this.value.length - 1];
1554
- delete cache.length;
1552
+ var cache2 = getChildCache(this);
1553
+ delete cache2[this.value.length - 1];
1554
+ delete cache2.length;
1555
1555
  return this.value.pop();
1556
1556
  };
1557
1557
  Pp.insertAt = function insertAt(index) {
@@ -4006,7 +4006,7 @@ var require_util = __commonJS((exports) => {
4006
4006
  return path3;
4007
4007
  }
4008
4008
  exports.normalize = normalize;
4009
- function join4(aRoot, aPath) {
4009
+ function join5(aRoot, aPath) {
4010
4010
  if (aRoot === "") {
4011
4011
  aRoot = ".";
4012
4012
  }
@@ -4038,7 +4038,7 @@ var require_util = __commonJS((exports) => {
4038
4038
  }
4039
4039
  return joined;
4040
4040
  }
4041
- exports.join = join4;
4041
+ exports.join = join5;
4042
4042
  exports.isAbsolute = function(aPath) {
4043
4043
  return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
4044
4044
  };
@@ -4211,7 +4211,7 @@ var require_util = __commonJS((exports) => {
4211
4211
  parsed.path = parsed.path.substring(0, index + 1);
4212
4212
  }
4213
4213
  }
4214
- sourceURL = join4(urlGenerate(parsed), sourceURL);
4214
+ sourceURL = join5(urlGenerate(parsed), sourceURL);
4215
4215
  }
4216
4216
  return normalize(sourceURL);
4217
4217
  }
@@ -16967,11 +16967,11 @@ var require_path2 = __commonJS((exports, module) => {
16967
16967
  return path3.__childCache || (path3.__childCache = Object.create(null));
16968
16968
  }
16969
16969
  function getChildPath(path3, name) {
16970
- var cache = getChildCache(path3);
16970
+ var cache2 = getChildCache(path3);
16971
16971
  var actualChildValue = path3.getValueProperty(name);
16972
- var childPath = cache[name];
16973
- if (!hasOwn.call(cache, name) || childPath.value !== actualChildValue) {
16974
- childPath = cache[name] = new path3.constructor(actualChildValue, path3, name);
16972
+ var childPath = cache2[name];
16973
+ if (!hasOwn.call(cache2, name) || childPath.value !== actualChildValue) {
16974
+ childPath = cache2[name] = new path3.constructor(actualChildValue, path3, name);
16975
16975
  }
16976
16976
  return childPath;
16977
16977
  }
@@ -17046,7 +17046,7 @@ var require_path2 = __commonJS((exports, module) => {
17046
17046
  isNumber.assert(start);
17047
17047
  isNumber.assert(end);
17048
17048
  var moves = Object.create(null);
17049
- var cache = getChildCache(path3);
17049
+ var cache2 = getChildCache(path3);
17050
17050
  for (var i = start;i < end; ++i) {
17051
17051
  if (hasOwn.call(path3.value, i)) {
17052
17052
  var childPath = path3.get(i);
@@ -17056,17 +17056,17 @@ var require_path2 = __commonJS((exports, module) => {
17056
17056
  var newIndex = i + offset;
17057
17057
  childPath.name = newIndex;
17058
17058
  moves[newIndex] = childPath;
17059
- delete cache[i];
17059
+ delete cache2[i];
17060
17060
  }
17061
17061
  }
17062
- delete cache.length;
17062
+ delete cache2.length;
17063
17063
  return function() {
17064
17064
  for (var newIndex2 in moves) {
17065
17065
  var childPath2 = moves[newIndex2];
17066
17066
  if (childPath2.name !== +newIndex2) {
17067
17067
  throw new Error("");
17068
17068
  }
17069
- cache[newIndex2] = childPath2;
17069
+ cache2[newIndex2] = childPath2;
17070
17070
  path3.value[newIndex2] = childPath2.value;
17071
17071
  }
17072
17072
  };
@@ -17098,9 +17098,9 @@ var require_path2 = __commonJS((exports, module) => {
17098
17098
  };
17099
17099
  Pp.pop = function pop() {
17100
17100
  isArray.assert(this.value);
17101
- var cache = getChildCache(this);
17102
- delete cache[this.value.length - 1];
17103
- delete cache.length;
17101
+ var cache2 = getChildCache(this);
17102
+ delete cache2[this.value.length - 1];
17103
+ delete cache2.length;
17104
17104
  return this.value.pop();
17105
17105
  };
17106
17106
  Pp.insertAt = function insertAt(index) {
@@ -36727,7 +36727,7 @@ var init_generate = __esm(() => {
36727
36727
 
36728
36728
  // bin/gemi.ts
36729
36729
  import path10 from "path";
36730
- import { existsSync as existsSync11 } from "fs";
36730
+ import { existsSync as existsSync12 } from "fs";
36731
36731
  import { mkdtemp, rm } from "fs/promises";
36732
36732
  import { tmpdir as tmpdir2 } from "os";
36733
36733
 
@@ -36961,15 +36961,67 @@ async function bundleDocumentScripts(appDir) {
36961
36961
  }
36962
36962
  var bundledInProduction = new Map;
36963
36963
 
36964
+ // probe/index.ts
36965
+ import { existsSync as existsSync3, readFileSync as readFileSync2, statSync } from "fs";
36966
+ import { join as join4, resolve } from "path";
36967
+ var PROBE_SUFFIX = ".probe";
36968
+ var PROBES_MANIFEST = "probes.json";
36969
+ var DEFINE = "__gemiProbe__";
36970
+ var ENTRY = "/__gemi_probe_entry__.ts";
36971
+ var NAME2 = /^[A-Za-z0-9_-]+(\/[A-Za-z0-9_-]+)*$/;
36972
+ async function bundle(file) {
36973
+ const result = await Bun.build({
36974
+ entrypoints: [ENTRY],
36975
+ files: {
36976
+ [ENTRY]: `import probe from ${JSON.stringify(file)};
36977
+ ${DEFINE}(probe);
36978
+ `
36979
+ },
36980
+ target: "browser",
36981
+ format: "iife",
36982
+ minify: true,
36983
+ metafile: true,
36984
+ throw: false
36985
+ });
36986
+ if (!result.success || !result.outputs[0]) {
36987
+ const logs = result.logs.map((log) => String(log)).join(`
36988
+ `);
36989
+ throw new Error(`The probe ${file} does not bundle.
36990
+ ${logs}`);
36991
+ }
36992
+ const inputs = Object.keys(result.metafile?.inputs ?? {}).map((input) => resolve(input)).filter((input) => input !== ENTRY && existsSync3(input));
36993
+ return { source: (await result.outputs[0].text()).trim(), inputs };
36994
+ }
36995
+ async function bundleProbe(file) {
36996
+ return (await bundle(file)).source;
36997
+ }
36998
+ async function bundleProbes(appDir) {
36999
+ const probes = {};
37000
+ if (!existsSync3(appDir))
37001
+ return probes;
37002
+ const glob = new Bun.Glob(`**/*${PROBE_SUFFIX}.{ts,js}`);
37003
+ const files = [...glob.scanSync({ cwd: appDir })].sort();
37004
+ for (const file of files) {
37005
+ if (file.split("/").includes("node_modules"))
37006
+ continue;
37007
+ const name = file.replace(/\.probe\.[tj]s$/, "");
37008
+ if (!NAME2.test(name) || name in probes)
37009
+ continue;
37010
+ probes[name] = await bundleProbe(join4(appDir, file));
37011
+ }
37012
+ return probes;
37013
+ }
37014
+ var cache = new Map;
37015
+
36964
37016
  // bin/migrate/index.ts
36965
37017
  import path2 from "path";
36966
37018
  import {
36967
- existsSync as existsSync3,
37019
+ existsSync as existsSync4,
36968
37020
  mkdirSync,
36969
- readFileSync as readFileSync2,
37021
+ readFileSync as readFileSync3,
36970
37022
  readdirSync as readdirSync2,
36971
37023
  rmSync,
36972
- statSync,
37024
+ statSync as statSync2,
36973
37025
  writeFileSync
36974
37026
  } from "fs";
36975
37027
 
@@ -37838,7 +37890,7 @@ var GEMI_MODULES = [
37838
37890
  async function runMigrate(options) {
37839
37891
  const { rootDir, dryRun = false } = options;
37840
37892
  const appDir = path2.join(rootDir, "app");
37841
- if (!existsSync3(appDir)) {
37893
+ if (!existsSync4(appDir)) {
37842
37894
  console.error(`No app/ directory found in ${rootDir}. Nothing to migrate.`);
37843
37895
  process.exitCode = 1;
37844
37896
  return;
@@ -37849,7 +37901,7 @@ async function runMigrate(options) {
37849
37901
  const slices = new Map;
37850
37902
  const migratedFiles = [];
37851
37903
  const carriedProviders = [];
37852
- const onOldLayout = existsSync3(providersDir);
37904
+ const onOldLayout = existsSync4(providersDir);
37853
37905
  if (onOldLayout) {
37854
37906
  for (const entry of readdirSync2(providersDir).sort()) {
37855
37907
  if (!/\.tsx?$/.test(entry))
@@ -37875,7 +37927,7 @@ async function runMigrate(options) {
37875
37927
  for (const [configKey, inputs] of slices) {
37876
37928
  const emitted = buildConfigFile(configKey, inputs, { rootDir, appDir, aliasPrefix }, notes);
37877
37929
  const configFile = path2.join(appDir, "config", `${configKey}.ts`);
37878
- if (existsSync3(configFile)) {
37930
+ if (existsSync4(configFile)) {
37879
37931
  notes.push({
37880
37932
  file: rel(rootDir, configFile),
37881
37933
  message: `already exists \u2014 left untouched. The ${inputs.length === 1 ? "provider" : "providers"} it would ` + `have been generated from ${inputs.length === 1 ? "is" : "are"} left in place too, so nothing is ` + `lost; fold them together by hand and delete the provider.`
@@ -37889,7 +37941,7 @@ async function runMigrate(options) {
37889
37941
  }
37890
37942
  changes.push({ file: configFile, contents: emitted.contents });
37891
37943
  for (const extracted of emitted.extractedFiles) {
37892
- if (existsSync3(extracted.file)) {
37944
+ if (existsSync4(extracted.file)) {
37893
37945
  notes.push({
37894
37946
  file: rel(rootDir, extracted.file),
37895
37947
  message: "already exists \u2014 left untouched, review it by hand"
@@ -37901,7 +37953,7 @@ async function runMigrate(options) {
37901
37953
  }
37902
37954
  const kernelFile = path2.join(appDir, "kernel", "Kernel.ts");
37903
37955
  if (onOldLayout) {
37904
- if (existsSync3(kernelFile)) {
37956
+ if (existsSync4(kernelFile)) {
37905
37957
  changes.push({
37906
37958
  file: kernelFile,
37907
37959
  contents: buildKernel(kernelFile, [...slices.keys()], carriedProviders, rootDir, notes)
@@ -37914,7 +37966,7 @@ async function runMigrate(options) {
37914
37966
  }
37915
37967
  }
37916
37968
  const appProviderFile = path2.join(appDir, "providers", "AppServiceProvider.ts");
37917
- if (onOldLayout && !existsSync3(appProviderFile)) {
37969
+ if (onOldLayout && !existsSync4(appProviderFile)) {
37918
37970
  changes.push({ file: appProviderFile, contents: APP_SERVICE_PROVIDER });
37919
37971
  }
37920
37972
  for (const file of migratedFiles)
@@ -37923,7 +37975,7 @@ async function runMigrate(options) {
37923
37975
  for (const file of walk(appDir)) {
37924
37976
  if (touched.has(file))
37925
37977
  continue;
37926
- const source = readFileSync2(file, "utf8");
37978
+ const source = readFileSync3(file, "utf8");
37927
37979
  let rewritten = rewriteReferences(source, rel(rootDir, file), notes);
37928
37980
  rewritten = annotateRetiredFields(rewritten, file, rootDir, notes);
37929
37981
  if (rewritten !== source)
@@ -37943,7 +37995,7 @@ async function runMigrate(options) {
37943
37995
  continue;
37944
37996
  swept.add(file);
37945
37997
  const index = pending.get(file);
37946
- const before = index === undefined ? readFileSync2(file, "utf8") : changes[index].contents;
37998
+ const before = index === undefined ? readFileSync3(file, "utf8") : changes[index].contents;
37947
37999
  const after = annotateOrmPortHazards(before, rel(rootDir, file), notes);
37948
38000
  if (after === before)
37949
38001
  continue;
@@ -37965,21 +38017,21 @@ async function runMigrate(options) {
37965
38017
  rmSync(change.file, { force: true });
37966
38018
  continue;
37967
38019
  }
37968
- const verb = existsSync3(change.file) ? "update" : "create";
38020
+ const verb = existsSync4(change.file) ? "update" : "create";
37969
38021
  console.log(` ${verb.padStart(6)} ${label}`);
37970
38022
  if (dryRun)
37971
38023
  continue;
37972
38024
  mkdirSync(path2.dirname(change.file), { recursive: true });
37973
38025
  writeFileSync(change.file, change.contents);
37974
38026
  }
37975
- if (!dryRun && existsSync3(providersDir) && readdirSync2(providersDir).length === 0) {
38027
+ if (!dryRun && existsSync4(providersDir) && readdirSync2(providersDir).length === 0) {
37976
38028
  rmSync(providersDir, { recursive: true, force: true });
37977
38029
  }
37978
38030
  report(notes, dryRun);
37979
38031
  }
37980
38032
  function readProvider(file, rootDir, notes) {
37981
38033
  const label = rel(rootDir, file);
37982
- const source = rewriteReferences(readFileSync2(file, "utf8"), label, notes, {
38034
+ const source = rewriteReferences(readFileSync3(file, "utf8"), label, notes, {
37983
38035
  keepProviders: true
37984
38036
  });
37985
38037
  const imports = parseImports(source);
@@ -38187,7 +38239,7 @@ function reindent(text, width, shift) {
38187
38239
  `);
38188
38240
  }
38189
38241
  function buildKernel(file, configKeys, carriedProviders, rootDir, notes) {
38190
- const source = readFileSync2(file, "utf8");
38242
+ const source = readFileSync3(file, "utf8");
38191
38243
  const imports = parseImports(source);
38192
38244
  const kernelClass = findClasses(source).find((cls) => cls.isDefaultExport);
38193
38245
  const providerLocals = new Map;
@@ -38461,7 +38513,7 @@ function moduleSpecifier(ctx, dir, name) {
38461
38513
  }
38462
38514
  function detectAliasPrefix(appDir) {
38463
38515
  for (const file of walk(appDir)) {
38464
- const source = readFileSync2(file, "utf8");
38516
+ const source = readFileSync3(file, "utf8");
38465
38517
  if (/from\s+["']@\/app\//.test(source))
38466
38518
  return "@/";
38467
38519
  }
@@ -38472,7 +38524,7 @@ function* walk(dir) {
38472
38524
  if (entry === "node_modules" || entry === "dist" || entry.startsWith("."))
38473
38525
  continue;
38474
38526
  const full = path2.join(dir, entry);
38475
- if (statSync(full).isDirectory())
38527
+ if (statSync2(full).isDirectory())
38476
38528
  yield* walk(full);
38477
38529
  else if (/\.tsx?$/.test(entry))
38478
38530
  yield full;
@@ -38668,13 +38720,13 @@ function gemiPlugin() {
38668
38720
  }
38669
38721
 
38670
38722
  // config/load.ts
38671
- import { existsSync as existsSync4 } from "fs";
38672
- import { join as join4 } from "path";
38723
+ import { existsSync as existsSync5 } from "fs";
38724
+ import { join as join5 } from "path";
38673
38725
  var CONFIG_FILES = ["gemi.config.ts", "gemi.config.js", "gemi.config.mjs"];
38674
38726
  async function loadGemiConfig(rootDir = process.cwd()) {
38675
38727
  for (const name of CONFIG_FILES) {
38676
- const path3 = join4(rootDir, name);
38677
- if (existsSync4(path3)) {
38728
+ const path3 = join5(rootDir, name);
38729
+ if (existsSync5(path3)) {
38678
38730
  const mod = await import(path3);
38679
38731
  return mod.default ?? mod;
38680
38732
  }
@@ -40142,7 +40194,7 @@ function walk2(node, visit) {
40142
40194
 
40143
40195
  // vite/assetBasePlugin.ts
40144
40196
  import { mkdir, writeFile } from "fs/promises";
40145
- import { dirname, join as join5 } from "path";
40197
+ import { dirname, join as join6 } from "path";
40146
40198
 
40147
40199
  // config/assetBase.ts
40148
40200
  var DEFAULT_ASSET_BASE = "/";
@@ -40175,7 +40227,7 @@ function gemiAssetBasePlugin(assetBase) {
40175
40227
  if (!resolved || resolved.command !== "build" || resolved.build.ssr || !options.dir) {
40176
40228
  return;
40177
40229
  }
40178
- const file = join5(options.dir, ASSET_BASE_RECORD);
40230
+ const file = join6(options.dir, ASSET_BASE_RECORD);
40179
40231
  await mkdir(dirname(file), { recursive: true });
40180
40232
  await writeFile(file, `${JSON.stringify({ assetBase: documentBase(resolved.base) })}
40181
40233
  `);
@@ -40362,7 +40414,7 @@ var vite_default = gemi;
40362
40414
 
40363
40415
  // vite/previousAssets.ts
40364
40416
  import { copyFile, lstat, mkdir as mkdir2, readdir, readFile, stat, writeFile as writeFile2 } from "fs/promises";
40365
- import { dirname as dirname2, isAbsolute, join as join6, relative as relative3, resolve, sep as sep2 } from "path";
40417
+ import { dirname as dirname2, isAbsolute, join as join7, relative as relative3, resolve as resolve2, sep as sep2 } from "path";
40366
40418
  var PREVIOUS_ASSETS_RECORD = ".vite/previous-assets.json";
40367
40419
  var DEFAULT_RETAINED_RELEASES = 2;
40368
40420
  var DEFAULT_RETAINED_MAX_AGE_SECONDS = 7 * 24 * 60 * 60;
@@ -40373,7 +40425,7 @@ function resolvePreviousAssets(configured, rootDir, env = process.env.GEMI_PREVI
40373
40425
  return;
40374
40426
  }
40375
40427
  const config = typeof configured === "object" ? configured : {};
40376
- const from = fromEnv || config.from || join6("dist", "client");
40428
+ const from = fromEnv || config.from || join7("dist", "client");
40377
40429
  const releases = config.releases ?? DEFAULT_RETAINED_RELEASES;
40378
40430
  const maxAge = config.maxAge ?? DEFAULT_RETAINED_MAX_AGE_SECONDS;
40379
40431
  if (!Number.isInteger(releases) || releases < 0) {
@@ -40383,15 +40435,15 @@ function resolvePreviousAssets(configured, rootDir, env = process.env.GEMI_PREVI
40383
40435
  throw new Error(`previousAssets.maxAge must be a number of seconds \u2265 0, got ${maxAge}`);
40384
40436
  }
40385
40437
  return {
40386
- from: isAbsolute(from) ? from : resolve(rootDir, from),
40438
+ from: isAbsolute(from) ? from : resolve2(rootDir, from),
40387
40439
  releases,
40388
40440
  maxAgeMs: maxAge * 1000
40389
40441
  };
40390
40442
  }
40391
40443
  async function stagePreviousAssets(options, stagingDir, now = new Date) {
40392
40444
  const { from } = options;
40393
- if (!await isDirectory(join6(from, ASSETS_DIR))) {
40394
- console.log(`No previous assets at ${join6(from, ASSETS_DIR)}; nothing to carry over.`);
40445
+ if (!await isDirectory(join7(from, ASSETS_DIR))) {
40446
+ console.log(`No previous assets at ${join7(from, ASSETS_DIR)}; nothing to carry over.`);
40395
40447
  return [];
40396
40448
  }
40397
40449
  const carried = await readRecord(from);
@@ -40411,7 +40463,7 @@ async function stagePreviousAssets(options, stagingDir, now = new Date) {
40411
40463
  if (!source || !await isFile(source)) {
40412
40464
  continue;
40413
40465
  }
40414
- const target = join6(stagingDir, file);
40466
+ const target = join7(stagingDir, file);
40415
40467
  await mkdir2(dirname2(target), { recursive: true });
40416
40468
  await copyFile(source, target);
40417
40469
  await copySiblings(source, target);
@@ -40435,8 +40487,8 @@ async function restorePreviousAssets(stagingDir, clientDir, releases) {
40435
40487
  continue;
40436
40488
  }
40437
40489
  await mkdir2(dirname2(target), { recursive: true });
40438
- await copyFile(join6(stagingDir, file), target);
40439
- await copySiblings(join6(stagingDir, file), target);
40490
+ await copyFile(join7(stagingDir, file), target);
40491
+ await copySiblings(join7(stagingDir, file), target);
40440
40492
  files.push(file);
40441
40493
  paths.push(file);
40442
40494
  }
@@ -40445,7 +40497,7 @@ async function restorePreviousAssets(stagingDir, clientDir, releases) {
40445
40497
  count += files.length;
40446
40498
  }
40447
40499
  }
40448
- const recordPath = join6(clientDir, PREVIOUS_ASSETS_RECORD);
40500
+ const recordPath = join7(clientDir, PREVIOUS_ASSETS_RECORD);
40449
40501
  await mkdir2(dirname2(recordPath), { recursive: true });
40450
40502
  await writeFile2(recordPath, `${JSON.stringify({ releases: record }, null, 2)}
40451
40503
  `);
@@ -40466,7 +40518,7 @@ async function copySiblings(source, target) {
40466
40518
  async function readRecord(clientDir) {
40467
40519
  let raw;
40468
40520
  try {
40469
- raw = await readFile(join6(clientDir, PREVIOUS_ASSETS_RECORD), "utf8");
40521
+ raw = await readFile(join7(clientDir, PREVIOUS_ASSETS_RECORD), "utf8");
40470
40522
  } catch (error) {
40471
40523
  if (error?.code === "ENOENT") {
40472
40524
  return [];
@@ -40481,7 +40533,7 @@ async function readRecord(clientDir) {
40481
40533
  }
40482
40534
  async function listFiles(root, dir) {
40483
40535
  const files = [];
40484
- const entries = (await readdir(join6(root, dir), { withFileTypes: true })).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
40536
+ const entries = (await readdir(join7(root, dir), { withFileTypes: true })).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
40485
40537
  for (const entry of entries) {
40486
40538
  const path3 = `${dir}/${entry.name}`;
40487
40539
  if (entry.isDirectory()) {
@@ -40496,7 +40548,7 @@ function isCarriable(file) {
40496
40548
  return !file.endsWith(".map") && !file.split("/").some((part) => part.startsWith("."));
40497
40549
  }
40498
40550
  function inside(root, file) {
40499
- const path3 = resolve(root, file);
40551
+ const path3 = resolve2(root, file);
40500
40552
  const rel2 = relative3(root, path3);
40501
40553
  return rel2 && !rel2.startsWith("..") && !isAbsolute(rel2) && rel2.split(sep2)[0] === ASSETS_DIR ? path3 : null;
40502
40554
  }
@@ -40526,7 +40578,7 @@ async function exists(path3) {
40526
40578
  // vite/precompressAssets.ts
40527
40579
  import { mkdir as mkdir3, readFile as readFile2, stat as stat2, writeFile as writeFile3 } from "fs/promises";
40528
40580
  import { availableParallelism } from "os";
40529
- import { dirname as dirname3, join as join7 } from "path";
40581
+ import { dirname as dirname3, join as join8 } from "path";
40530
40582
  import { promisify } from "util";
40531
40583
  import { brotliCompress, constants, gzip } from "zlib";
40532
40584
  var STATIC_ASSETS_RECORD = ".vite/static-assets.json";
@@ -40581,7 +40633,7 @@ async function precompressAssets(clientDir, files, options = {}) {
40581
40633
  if (!isPrecompressible(file)) {
40582
40634
  return;
40583
40635
  }
40584
- const path3 = join7(clientDir, file);
40636
+ const path3 = join8(clientDir, file);
40585
40637
  const size = await fileSize(path3);
40586
40638
  if (size === null || size < minBytes) {
40587
40639
  return;
@@ -40625,7 +40677,7 @@ async function precompressAssets(clientDir, files, options = {}) {
40625
40677
  return { record, stats };
40626
40678
  }
40627
40679
  async function writeStaticAssetsRecord(clientDir, record) {
40628
- const path3 = join7(clientDir, STATIC_ASSETS_RECORD);
40680
+ const path3 = join8(clientDir, STATIC_ASSETS_RECORD);
40629
40681
  await mkdir3(dirname3(path3), { recursive: true });
40630
40682
  const files = Object.fromEntries(Object.entries(record.files).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0));
40631
40683
  await writeFile3(path3, `${JSON.stringify({ files }, null, 2)}
@@ -40649,8 +40701,8 @@ var {
40649
40701
  } = import__.default;
40650
40702
 
40651
40703
  // bin/check-models.ts
40652
- import { statSync as statSync2 } from "fs";
40653
- import { relative as relative4, resolve as resolve2 } from "path";
40704
+ import { statSync as statSync3 } from "fs";
40705
+ import { relative as relative4, resolve as resolve3 } from "path";
40654
40706
  function modelFiles(dir, ignore = []) {
40655
40707
  return sourceFiles(dir, ignore);
40656
40708
  }
@@ -40707,7 +40759,7 @@ class CheckModelsError extends Error {
40707
40759
  async function namedModules(rootDir, paths) {
40708
40760
  const modules = [];
40709
40761
  for (const path3 of paths) {
40710
- const resolved = resolve2(rootDir, path3);
40762
+ const resolved = resolve3(rootDir, path3);
40711
40763
  try {
40712
40764
  modules.push(await import(resolved));
40713
40765
  } catch (error) {
@@ -40718,7 +40770,7 @@ async function namedModules(rootDir, paths) {
40718
40770
  return modules;
40719
40771
  }
40720
40772
  async function declaredModules(rootDir) {
40721
- const path3 = resolve2(rootDir, "app/kernel/Kernel.ts");
40773
+ const path3 = resolve3(rootDir, "app/kernel/Kernel.ts");
40722
40774
  let Kernel;
40723
40775
  try {
40724
40776
  ({ default: Kernel } = await import(path3));
@@ -40729,8 +40781,8 @@ async function declaredModules(rootDir) {
40729
40781
  return new Kernel().models ?? [];
40730
40782
  }
40731
40783
  async function checkModels(options) {
40732
- const rootDir = resolve2(options.rootDir);
40733
- const modelsDir = resolve2(rootDir, options.modelsDir ?? "app/models");
40784
+ const rootDir = resolve3(options.rootDir);
40785
+ const modelsDir = resolve3(rootDir, options.modelsDir ?? "app/models");
40734
40786
  const ignore = options.ignore ?? [];
40735
40787
  let orm;
40736
40788
  try {
@@ -40742,7 +40794,7 @@ async function checkModels(options) {
40742
40794
  throw new CheckModelsError("The gemi installed in this project is older than `gemi check models`. Upgrade it to 0.51 or newer.");
40743
40795
  }
40744
40796
  try {
40745
- statSync2(modelsDir);
40797
+ statSync3(modelsDir);
40746
40798
  } catch {
40747
40799
  throw new CheckModelsError(`No model directory at ${modelsDir}.`);
40748
40800
  }
@@ -40826,8 +40878,8 @@ function indent(message) {
40826
40878
 
40827
40879
  // bin/ide/generateApiManifest.ts
40828
40880
  var import_recast2 = __toESM(require_main2(), 1);
40829
- import { join as join8 } from "path";
40830
- import { existsSync as existsSync5 } from "fs";
40881
+ import { join as join9 } from "path";
40882
+ import { existsSync as existsSync6 } from "fs";
40831
40883
 
40832
40884
  // utils/toCamelCase.ts
40833
40885
  function toCamelCase(input) {
@@ -40878,7 +40930,7 @@ class ApiManifestGenerator {
40878
40930
  rootRouterBody;
40879
40931
  routerBodyCache = new Map;
40880
40932
  controllerCache = new Map;
40881
- manifestCacheDir = join8(ROOT, ".gemi/cache/api-routes-manifest");
40933
+ manifestCacheDir = join9(ROOT, ".gemi/cache/api-routes-manifest");
40882
40934
  async writeManifest(cacheFilePath) {
40883
40935
  const manifest = {};
40884
40936
  for (const [routeName, method] of this.routes.entries()) {
@@ -40910,7 +40962,7 @@ class ApiManifestGenerator {
40910
40962
  if (path4.startsWith("@/app")) {
40911
40963
  return path4.replace("@", "") + ".ts";
40912
40964
  }
40913
- return join8(parentPath, path4) + ".ts";
40965
+ return join9(parentPath, path4) + ".ts";
40914
40966
  }
40915
40967
  isFileShouldBeParsed(path4) {
40916
40968
  return path4.includes("app/http/router") || path4.includes("app/http/controllers");
@@ -40958,7 +41010,7 @@ class ApiManifestGenerator {
40958
41010
  if (normalizedPath.startsWith("/app/http/controllers")) {
40959
41011
  for (const specifier of node.specifiers) {
40960
41012
  const name = specifier.type === "ImportDefaultSpecifier" ? specifier.local.name : specifier.imported.name;
40961
- await this.parseControllerFile(await this.parseFile(join8(ROOT, normalizedPath)), name, normalizedPath);
41013
+ await this.parseControllerFile(await this.parseFile(join9(ROOT, normalizedPath)), name, normalizedPath);
40962
41014
  }
40963
41015
  }
40964
41016
  if (normalizedPath.startsWith("/app/http/routes")) {
@@ -41062,7 +41114,7 @@ class ApiManifestGenerator {
41062
41114
  }
41063
41115
  async parse(cacheFilePath, filePath, isRoot = true, name = "") {
41064
41116
  console.log({ ROOT, filePath });
41065
- const file = await this.parseFile(join8(ROOT, filePath));
41117
+ const file = await this.parseFile(join9(ROOT, filePath));
41066
41118
  for (const body of file.program.body) {
41067
41119
  if (!this.isNodeShouldBeParsed(body))
41068
41120
  continue;
@@ -41098,8 +41150,8 @@ class ApiManifestGenerator {
41098
41150
  }
41099
41151
  async run(filePath) {
41100
41152
  const cacheId = generateGitDiffId();
41101
- const cacheFilePath = join8(this.manifestCacheDir, `${cacheId}.json`);
41102
- if (existsSync5(cacheFilePath)) {
41153
+ const cacheFilePath = join9(this.manifestCacheDir, `${cacheId}.json`);
41154
+ if (existsSync6(cacheFilePath)) {
41103
41155
  console.log(await Bun.file(cacheFilePath).text());
41104
41156
  } else {
41105
41157
  await this.parse(cacheFilePath, filePath, true);
@@ -41108,7 +41160,7 @@ class ApiManifestGenerator {
41108
41160
  }
41109
41161
 
41110
41162
  // bin/version.ts
41111
- import { existsSync as existsSync6, readFileSync as readFileSync3 } from "fs";
41163
+ import { existsSync as existsSync7, readFileSync as readFileSync4 } from "fs";
41112
41164
  import path4 from "path";
41113
41165
  var VERSION_RE = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
41114
41166
  function parseVersion(version) {
@@ -41166,7 +41218,7 @@ function findGemiPackageDir(rootDir) {
41166
41218
  let dir = path4.resolve(rootDir);
41167
41219
  while (true) {
41168
41220
  const candidate = path4.join(dir, "node_modules", "gemi");
41169
- if (existsSync6(path4.join(candidate, "package.json")))
41221
+ if (existsSync7(path4.join(candidate, "package.json")))
41170
41222
  return candidate;
41171
41223
  const parent = path4.dirname(dir);
41172
41224
  if (parent === dir)
@@ -41179,7 +41231,7 @@ function readInstalledVersion(rootDir) {
41179
41231
  if (!packageDir)
41180
41232
  return null;
41181
41233
  try {
41182
- const manifest = JSON.parse(readFileSync3(path4.join(packageDir, "package.json"), "utf8"));
41234
+ const manifest = JSON.parse(readFileSync4(path4.join(packageDir, "package.json"), "utf8"));
41183
41235
  return typeof manifest?.version === "string" ? manifest.version : null;
41184
41236
  } catch {
41185
41237
  return null;
@@ -41275,16 +41327,16 @@ function reportUpdate(options, log = console.log) {
41275
41327
  }
41276
41328
 
41277
41329
  // bin/upgrade.ts
41278
- import { existsSync as existsSync8, readFileSync as readFileSync5 } from "fs";
41330
+ import { existsSync as existsSync9, readFileSync as readFileSync6 } from "fs";
41279
41331
  import path6 from "path";
41280
41332
 
41281
41333
  // bin/install-skill.ts
41282
41334
  import { createHash as createHash2 } from "crypto";
41283
41335
  import {
41284
41336
  cpSync,
41285
- existsSync as existsSync7,
41337
+ existsSync as existsSync8,
41286
41338
  mkdirSync as mkdirSync2,
41287
- readFileSync as readFileSync4,
41339
+ readFileSync as readFileSync5,
41288
41340
  readdirSync as readdirSync3,
41289
41341
  renameSync,
41290
41342
  rmSync as rmSync2,
@@ -41302,7 +41354,7 @@ function lockPath(rootDir) {
41302
41354
  return path5.join(rootDir, ".agents", ".skill-lock.json");
41303
41355
  }
41304
41356
  function isSkillInstalled(rootDir) {
41305
- return existsSync7(path5.join(skillTargetDir(rootDir), "SKILL.md"));
41357
+ return existsSync8(path5.join(skillTargetDir(rootDir), "SKILL.md"));
41306
41358
  }
41307
41359
  function hashDirectory(dir) {
41308
41360
  const hash = createHash2("sha1");
@@ -41316,7 +41368,7 @@ function hashDirectory(dir) {
41316
41368
  } else if (entry.isFile()) {
41317
41369
  hash.update(relative5);
41318
41370
  hash.update("\x00");
41319
- hash.update(readFileSync4(full));
41371
+ hash.update(readFileSync5(full));
41320
41372
  hash.update("\x00");
41321
41373
  }
41322
41374
  }
@@ -41327,10 +41379,10 @@ function hashDirectory(dir) {
41327
41379
  function readLock(rootDir) {
41328
41380
  const empty = { version: 3, skills: {} };
41329
41381
  const file = lockPath(rootDir);
41330
- if (!existsSync7(file))
41382
+ if (!existsSync8(file))
41331
41383
  return empty;
41332
41384
  try {
41333
- const parsed = JSON.parse(readFileSync4(file, "utf8"));
41385
+ const parsed = JSON.parse(readFileSync5(file, "utf8"));
41334
41386
  if (!parsed || typeof parsed !== "object")
41335
41387
  return empty;
41336
41388
  return {
@@ -41349,10 +41401,10 @@ function writeLock(rootDir, lock) {
41349
41401
  }
41350
41402
  function quarantineUnreadableLock(rootDir) {
41351
41403
  const file = lockPath(rootDir);
41352
- if (!existsSync7(file))
41404
+ if (!existsSync8(file))
41353
41405
  return null;
41354
41406
  try {
41355
- const parsed = JSON.parse(readFileSync4(file, "utf8"));
41407
+ const parsed = JSON.parse(readFileSync5(file, "utf8"));
41356
41408
  if (parsed && typeof parsed === "object")
41357
41409
  return null;
41358
41410
  } catch {}
@@ -41386,14 +41438,14 @@ function install(options) {
41386
41438
  return 1;
41387
41439
  }
41388
41440
  const source = skillSourceDir(packageDir);
41389
- if (!existsSync7(path5.join(source, "SKILL.md"))) {
41441
+ if (!existsSync8(path5.join(source, "SKILL.md"))) {
41390
41442
  error(`The installed gemi does not ship the \`${SKILL_NAME}\` skill (looked in ` + `${source}). It was added in a later release \u2014 run \`gemi upgrade\` first.`);
41391
41443
  return 1;
41392
41444
  }
41393
41445
  const target = skillTargetDir(rootDir);
41394
41446
  const lock = readLock(rootDir);
41395
41447
  const recorded = lock.skills[SKILL_NAME];
41396
- const existing = existsSync7(target) ? hashDirectory(target) : null;
41448
+ const existing = existsSync8(target) ? hashDirectory(target) : null;
41397
41449
  if (existing !== null && !force) {
41398
41450
  if (!recorded) {
41399
41451
  error(`${path5.relative(rootDir, target) || target} already exists and was not ` + `installed by \`gemi install-skill\`. Re-run with --force to replace it.`);
@@ -41451,7 +41503,7 @@ function detectPackageManager(rootDir) {
41451
41503
  let dir = path6.resolve(rootDir);
41452
41504
  while (true) {
41453
41505
  for (const [manager, files] of LOCKFILES) {
41454
- if (files.some((file) => existsSync8(path6.join(dir, file))))
41506
+ if (files.some((file) => existsSync9(path6.join(dir, file))))
41455
41507
  return manager;
41456
41508
  }
41457
41509
  const parent = path6.dirname(dir);
@@ -41462,10 +41514,10 @@ function detectPackageManager(rootDir) {
41462
41514
  }
41463
41515
  function dependencyKind(dir) {
41464
41516
  const manifestPath = path6.join(dir, "package.json");
41465
- if (!existsSync8(manifestPath))
41517
+ if (!existsSync9(manifestPath))
41466
41518
  return null;
41467
41519
  try {
41468
- const manifest = JSON.parse(readFileSync5(manifestPath, "utf8"));
41520
+ const manifest = JSON.parse(readFileSync6(manifestPath, "utf8"));
41469
41521
  if (manifest?.dependencies?.gemi)
41470
41522
  return "dependencies";
41471
41523
  if (manifest?.devDependencies?.gemi)
@@ -41491,7 +41543,7 @@ function findDeclaringDir(rootDir) {
41491
41543
  }
41492
41544
  function isWorkspaceRoot(dir) {
41493
41545
  try {
41494
- const manifest = JSON.parse(readFileSync5(path6.join(dir, "package.json"), "utf8"));
41546
+ const manifest = JSON.parse(readFileSync6(path6.join(dir, "package.json"), "utf8"));
41495
41547
  return manifest?.workspaces !== undefined;
41496
41548
  } catch {
41497
41549
  return false;
@@ -41623,12 +41675,12 @@ function exitCodeOf(proc) {
41623
41675
 
41624
41676
  // stats/run.ts
41625
41677
  import path7 from "path";
41626
- import { existsSync as existsSync10, mkdtempSync, readFileSync as readFileSync7, rmSync as rmSync3, writeFileSync as writeFileSync3 } from "fs";
41678
+ import { existsSync as existsSync11, mkdtempSync, readFileSync as readFileSync8, rmSync as rmSync3, writeFileSync as writeFileSync3 } from "fs";
41627
41679
  import { tmpdir } from "os";
41628
41680
 
41629
41681
  // stats/bundleStats.ts
41630
- import { existsSync as existsSync9, readFileSync as readFileSync6, statSync as statSync3 } from "fs";
41631
- import { join as join9 } from "path";
41682
+ import { existsSync as existsSync10, readFileSync as readFileSync7, statSync as statSync4 } from "fs";
41683
+ import { join as join10 } from "path";
41632
41684
  import { brotliCompressSync, constants as constants3, gzipSync } from "zlib";
41633
41685
 
41634
41686
  // internal/staticNavigationRuntime.ts
@@ -41655,7 +41707,7 @@ function routeKey(entry) {
41655
41707
  }
41656
41708
  function bundleStats(options) {
41657
41709
  const { clientDir } = options;
41658
- const manifest = options.manifest ?? JSON.parse(readFileSync6(join9(clientDir, ".vite/manifest.json"), "utf8"));
41710
+ const manifest = options.manifest ?? JSON.parse(readFileSync7(join10(clientDir, ".vite/manifest.json"), "utf8"));
41659
41711
  const sizes = new Map;
41660
41712
  const size = (file) => {
41661
41713
  let known = sizes.get(file);
@@ -41784,12 +41836,12 @@ function isJs(file) {
41784
41836
  return /\.m?js$/.test(file);
41785
41837
  }
41786
41838
  function measure(clientDir, file) {
41787
- const path7 = join9(clientDir, file);
41788
- const sibling = (ext) => existsSync9(path7 + ext) ? statSync3(path7 + ext).size : null;
41839
+ const path7 = join10(clientDir, file);
41840
+ const sibling = (ext) => existsSync10(path7 + ext) ? statSync4(path7 + ext).size : null;
41789
41841
  let buffer;
41790
- const read = () => buffer ??= readFileSync6(path7);
41842
+ const read = () => buffer ??= readFileSync7(path7);
41791
41843
  return {
41792
- raw: statSync3(path7).size,
41844
+ raw: statSync4(path7).size,
41793
41845
  gzip: sibling(".gz") ?? gzipSync(read(), { level: 9 }).length,
41794
41846
  brotli: sibling(".br") ?? brotliCompressSync(read(), {
41795
41847
  params: { [constants3.BROTLI_PARAM_QUALITY]: 11 }
@@ -41904,7 +41956,7 @@ async function runStats(options) {
41904
41956
  const log = options.log ?? console.log;
41905
41957
  const error = options.error ?? console.error;
41906
41958
  const clientDir = path7.join(options.rootDir, "dist", "client");
41907
- if (!existsSync10(path7.join(clientDir, ".vite/manifest.json"))) {
41959
+ if (!existsSync11(path7.join(clientDir, ".vite/manifest.json"))) {
41908
41960
  error(`No client build in ${clientDir}. Run \`gemi build\` first.`);
41909
41961
  return 1;
41910
41962
  }
@@ -41925,7 +41977,7 @@ ${table.message}`);
41925
41977
  `);
41926
41978
  }
41927
41979
  if (options.markdown) {
41928
- const base = options.base && existsSync10(options.base) ? JSON.parse(readFileSync7(options.base, "utf8")) : null;
41980
+ const base = options.base && existsSync11(options.base) ? JSON.parse(readFileSync8(options.base, "utf8")) : null;
41929
41981
  writeFileSync3(options.markdown, `${markdownReport(stats, base, budgets)}
41930
41982
  `);
41931
41983
  }
@@ -41970,13 +42022,13 @@ async function loadRouteTable(rootDir, preloadArgs, options = {}) {
41970
42022
  if (timedOut) {
41971
42023
  return { ok: false, message: `reading the route table took over ${timeoutMs / 1000}s.` };
41972
42024
  }
41973
- if (code !== 0 || !existsSync10(out)) {
42025
+ if (code !== 0 || !existsSync11(out)) {
41974
42026
  return {
41975
42027
  ok: false,
41976
42028
  message: stderr.trim() || `the route table process exited with ${code}.`
41977
42029
  };
41978
42030
  }
41979
- return { ok: true, routes: JSON.parse(readFileSync7(out, "utf8")) };
42031
+ return { ok: true, routes: JSON.parse(readFileSync8(out, "utf8")) };
41980
42032
  } finally {
41981
42033
  rmSync3(dir, { recursive: true, force: true });
41982
42034
  }
@@ -41985,7 +42037,7 @@ async function loadRouteTable(rootDir, preloadArgs, options = {}) {
41985
42037
  // bin/gemi.ts
41986
42038
  function appPreloadArgs(appDir) {
41987
42039
  const preloadPath = path10.join(appDir, "preload.ts");
41988
- return existsSync11(preloadPath) ? ["--preload", preloadPath] : [];
42040
+ return existsSync12(preloadPath) ? ["--preload", preloadPath] : [];
41989
42041
  }
41990
42042
  program.command("dev").action(async () => {
41991
42043
  console.log("Starting dev server...");
@@ -42056,8 +42108,8 @@ withStatsOptions(program.command("build").option("--stats", "After building, pri
42056
42108
  {
42057
42109
  name: "gemi:emitted-assets",
42058
42110
  apply: "build",
42059
- writeBundle(_options, bundle) {
42060
- for (const file of Object.keys(bundle)) {
42111
+ writeBundle(_options, bundle2) {
42112
+ for (const file of Object.keys(bundle2)) {
42061
42113
  if (file.startsWith("assets/"))
42062
42114
  emitted.push(file);
42063
42115
  }
@@ -42111,6 +42163,11 @@ withStatsOptions(program.command("build").option("--stats", "After building, pri
42111
42163
  if (Object.keys(documentScripts).length > 0) {
42112
42164
  console.log(`Bundled ${Object.keys(documentScripts).length} document script(s).`);
42113
42165
  }
42166
+ const probes = await bundleProbes(appDir);
42167
+ await Bun.write(path10.join(rootDir, "dist", "server", PROBES_MANIFEST), JSON.stringify(probes));
42168
+ if (Object.keys(probes).length > 0) {
42169
+ console.log(`Bundled ${Object.keys(probes).length} probe(s).`);
42170
+ }
42114
42171
  if (options.stats || options.json || options.markdown) {
42115
42172
  console.log("");
42116
42173
  process.exit(await printStats(rootDir, options));
@@ -42248,5 +42305,5 @@ program.command("app:route-manifest").action(async () => {
42248
42305
  });
42249
42306
  program.parse();
42250
42307
 
42251
- //# debugId=DDC7A3121C78EE9164756E2164756E21
42308
+ //# debugId=36F73C35B12D6F3F64756E2164756E21
42252
42309
  //# sourceMappingURL=gemi.js.map