gemi 0.64.0 → 0.66.0

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 (250) hide show
  1. package/dist/ai/Agent.d.ts +128 -1
  2. package/dist/ai/Agent.d.ts.map +1 -1
  3. package/dist/ai/AgentController.d.ts +75 -6
  4. package/dist/ai/AgentController.d.ts.map +1 -1
  5. package/dist/ai/AgentProvider.d.ts +13 -45
  6. package/dist/ai/AgentProvider.d.ts.map +1 -1
  7. package/dist/ai/ImageModel.d.ts +127 -0
  8. package/dist/ai/ImageModel.d.ts.map +1 -0
  9. package/dist/ai/ImageProvider.d.ts +94 -0
  10. package/dist/ai/ImageProvider.d.ts.map +1 -0
  11. package/dist/ai/Schema.d.ts +62 -0
  12. package/dist/ai/Schema.d.ts.map +1 -1
  13. package/dist/ai/client/index.js +10 -4
  14. package/dist/ai/client/index.js.map +1 -1
  15. package/dist/ai/client/reducer.d.ts.map +1 -1
  16. package/dist/ai/index.d.ts +7 -1
  17. package/dist/ai/index.d.ts.map +1 -1
  18. package/dist/ai/index.js +11 -11
  19. package/dist/ai/index.js.map +14 -10
  20. package/dist/ai/live/harness.d.ts +5 -3
  21. package/dist/ai/live/harness.d.ts.map +1 -1
  22. package/dist/ai/providers/call.d.ts +12 -0
  23. package/dist/ai/providers/call.d.ts.map +1 -1
  24. package/dist/ai/providers/endpoints.d.ts +153 -0
  25. package/dist/ai/providers/endpoints.d.ts.map +1 -0
  26. package/dist/ai/providers/fakeProvider.d.ts +54 -0
  27. package/dist/ai/providers/fakeProvider.d.ts.map +1 -1
  28. package/dist/ai/providers/http.d.ts +28 -0
  29. package/dist/ai/providers/http.d.ts.map +1 -1
  30. package/dist/ai/providers/images.d.ts +126 -0
  31. package/dist/ai/providers/images.d.ts.map +1 -0
  32. package/dist/ai/store/Attachments.d.ts +52 -0
  33. package/dist/ai/store/Attachments.d.ts.map +1 -1
  34. package/dist/ai/types.d.ts +55 -1
  35. package/dist/ai/types.d.ts.map +1 -1
  36. package/dist/ai/useChat.d.ts +60 -4
  37. package/dist/ai/useChat.d.ts.map +1 -1
  38. package/dist/app/index.js +1 -1
  39. package/dist/bin/gemi.js +9 -1
  40. package/dist/bin/gemi.js.map +3 -3
  41. package/dist/broadcasting/index.js +1 -1
  42. package/dist/bun/plugin.js +1 -1
  43. package/dist/bun/preload.js +1 -1
  44. package/dist/{chunk-jv9k1qfr.js → chunk-2bb3rdqq.js} +3 -3
  45. package/dist/{chunk-jv9k1qfr.js.map → chunk-2bb3rdqq.js.map} +1 -1
  46. package/dist/{chunk-e785380d.js → chunk-2dvjj3ad.js} +2 -2
  47. package/dist/{chunk-e785380d.js.map → chunk-2dvjj3ad.js.map} +1 -1
  48. package/dist/{chunk-rj3fnc4h.js → chunk-2ghpxrw1.js} +1 -1
  49. package/dist/{chunk-dqbm9vd0.js → chunk-3mp9p38x.js} +2 -2
  50. package/dist/{chunk-dqbm9vd0.js.map → chunk-3mp9p38x.js.map} +1 -1
  51. package/dist/{chunk-cdpeh7tt.js → chunk-3pwn2r6s.js} +2 -2
  52. package/dist/{chunk-cdpeh7tt.js.map → chunk-3pwn2r6s.js.map} +1 -1
  53. package/dist/{chunk-7qfzrkab.js → chunk-45g3hd0e.js} +2 -2
  54. package/dist/{chunk-7qfzrkab.js.map → chunk-45g3hd0e.js.map} +1 -1
  55. package/dist/{chunk-wqmzad46.js → chunk-5g1j29p2.js} +2 -2
  56. package/dist/{chunk-wqmzad46.js.map → chunk-5g1j29p2.js.map} +1 -1
  57. package/dist/{chunk-bxtx4y4w.js → chunk-5pm9zvtp.js} +2 -2
  58. package/dist/{chunk-bxtx4y4w.js.map → chunk-5pm9zvtp.js.map} +1 -1
  59. package/dist/{chunk-pbx9p6g0.js → chunk-6waph5k8.js} +1 -1
  60. package/dist/{chunk-nnc40mf3.js → chunk-70y8wajy.js} +2 -2
  61. package/dist/{chunk-nnc40mf3.js.map → chunk-70y8wajy.js.map} +1 -1
  62. package/dist/{chunk-71yhw8aw.js → chunk-731etrh2.js} +2 -2
  63. package/dist/{chunk-71yhw8aw.js.map → chunk-731etrh2.js.map} +1 -1
  64. package/dist/{chunk-1s1cd1e8.js → chunk-7438nrkm.js} +3 -3
  65. package/dist/{chunk-1s1cd1e8.js.map → chunk-7438nrkm.js.map} +1 -1
  66. package/dist/{chunk-ssg20z9s.js → chunk-7wgk7q33.js} +3 -3
  67. package/dist/{chunk-ssg20z9s.js.map → chunk-7wgk7q33.js.map} +1 -1
  68. package/dist/chunk-7xc64j6p.js +5 -0
  69. package/dist/chunk-7xc64j6p.js.map +14 -0
  70. package/dist/{chunk-jmse5hec.js → chunk-7zg1mt1g.js} +2 -2
  71. package/dist/{chunk-jmse5hec.js.map → chunk-7zg1mt1g.js.map} +1 -1
  72. package/dist/{chunk-0qchadp1.js → chunk-87c0cy5v.js} +2 -2
  73. package/dist/{chunk-0qchadp1.js.map → chunk-87c0cy5v.js.map} +1 -1
  74. package/dist/{chunk-773qa4av.js → chunk-8bjxk57p.js} +2 -2
  75. package/dist/{chunk-773qa4av.js.map → chunk-8bjxk57p.js.map} +1 -1
  76. package/dist/{chunk-81yzec62.js → chunk-8jpvj3cj.js} +2 -2
  77. package/dist/{chunk-81yzec62.js.map → chunk-8jpvj3cj.js.map} +1 -1
  78. package/dist/{chunk-9e5c5e15.js → chunk-9ch1q7nd.js} +2 -2
  79. package/dist/{chunk-9e5c5e15.js.map → chunk-9ch1q7nd.js.map} +1 -1
  80. package/dist/{chunk-9e5v1t73.js → chunk-9x5eefh0.js} +2 -2
  81. package/dist/{chunk-9e5v1t73.js.map → chunk-9x5eefh0.js.map} +1 -1
  82. package/dist/{chunk-62xjrz5e.js → chunk-9zmcz7yq.js} +2 -2
  83. package/dist/{chunk-62xjrz5e.js.map → chunk-9zmcz7yq.js.map} +1 -1
  84. package/dist/{chunk-0amv13g6.js → chunk-a85fn4zf.js} +3 -3
  85. package/dist/{chunk-0amv13g6.js.map → chunk-a85fn4zf.js.map} +1 -1
  86. package/dist/chunk-adj6dnvj.js +5 -0
  87. package/dist/{chunk-dq2hgzje.js.map → chunk-adj6dnvj.js.map} +1 -1
  88. package/dist/{chunk-exwbtfe9.js → chunk-aq09ta7k.js} +2 -2
  89. package/dist/{chunk-exwbtfe9.js.map → chunk-aq09ta7k.js.map} +1 -1
  90. package/dist/{chunk-43xw9n4f.js → chunk-dmr7yzyr.js} +2 -2
  91. package/dist/{chunk-43xw9n4f.js.map → chunk-dmr7yzyr.js.map} +1 -1
  92. package/dist/{chunk-q4wdg0y3.js → chunk-e0v4byjp.js} +2 -2
  93. package/dist/{chunk-ptjexzn1.js.map → chunk-e0v4byjp.js.map} +1 -1
  94. package/dist/{chunk-8wpccvbt.js → chunk-e1fkxt82.js} +2 -2
  95. package/dist/{chunk-8wpccvbt.js.map → chunk-e1fkxt82.js.map} +1 -1
  96. package/dist/{chunk-xadk41cs.js → chunk-ex9ns7pf.js} +4 -4
  97. package/dist/{chunk-xadk41cs.js.map → chunk-ex9ns7pf.js.map} +1 -1
  98. package/dist/{chunk-95d8jj11.js → chunk-fd7wfcft.js} +2 -2
  99. package/dist/{chunk-95d8jj11.js.map → chunk-fd7wfcft.js.map} +1 -1
  100. package/dist/{chunk-kx7vgcjp.js → chunk-fmcq21hg.js} +3 -3
  101. package/dist/{chunk-kx7vgcjp.js.map → chunk-fmcq21hg.js.map} +1 -1
  102. package/dist/{chunk-k1wkvrj0.js → chunk-ftaxfq7p.js} +3 -3
  103. package/dist/{chunk-k1wkvrj0.js.map → chunk-ftaxfq7p.js.map} +1 -1
  104. package/dist/{chunk-zdj2wmbj.js → chunk-fxkh2rfd.js} +2 -2
  105. package/dist/{chunk-zdj2wmbj.js.map → chunk-fxkh2rfd.js.map} +1 -1
  106. package/dist/{chunk-9k5daets.js → chunk-g2ywq30n.js} +2 -2
  107. package/dist/{chunk-9k5daets.js.map → chunk-g2ywq30n.js.map} +1 -1
  108. package/dist/{chunk-fwnf3jc6.js → chunk-gyc91g26.js} +2 -2
  109. package/dist/{chunk-fwnf3jc6.js.map → chunk-gyc91g26.js.map} +1 -1
  110. package/dist/chunk-hq496pa4.js +5 -0
  111. package/dist/chunk-hq496pa4.js.map +10 -0
  112. package/dist/{chunk-4sv5zpb4.js → chunk-hrtkjv41.js} +2 -2
  113. package/dist/{chunk-4sv5zpb4.js.map → chunk-hrtkjv41.js.map} +1 -1
  114. package/dist/{chunk-dhe1hsyz.js → chunk-jkjt3e06.js} +2 -2
  115. package/dist/{chunk-dhe1hsyz.js.map → chunk-jkjt3e06.js.map} +1 -1
  116. package/dist/{chunk-5wzyx4ts.js → chunk-ks94h71z.js} +2 -2
  117. package/dist/{chunk-5wzyx4ts.js.map → chunk-ks94h71z.js.map} +1 -1
  118. package/dist/{chunk-rhr8qavq.js → chunk-m44ar4he.js} +2 -2
  119. package/dist/{chunk-rhr8qavq.js.map → chunk-m44ar4he.js.map} +1 -1
  120. package/dist/{chunk-mzpczes2.js → chunk-nxg51m0q.js} +2 -2
  121. package/dist/{chunk-mzpczes2.js.map → chunk-nxg51m0q.js.map} +1 -1
  122. package/dist/{chunk-qrfp7pg2.js → chunk-nxh5a3eb.js} +3 -3
  123. package/dist/{chunk-qrfp7pg2.js.map → chunk-nxh5a3eb.js.map} +1 -1
  124. package/dist/{chunk-qcbtr7hm.js → chunk-p0m3qgs5.js} +2 -2
  125. package/dist/{chunk-qcbtr7hm.js.map → chunk-p0m3qgs5.js.map} +1 -1
  126. package/dist/{chunk-jk8mn861.js → chunk-p5m0da00.js} +2 -2
  127. package/dist/{chunk-jk8mn861.js.map → chunk-p5m0da00.js.map} +1 -1
  128. package/dist/{chunk-fv223805.js → chunk-pb0m0ryf.js} +3 -3
  129. package/dist/{chunk-fv223805.js.map → chunk-pb0m0ryf.js.map} +1 -1
  130. package/dist/{chunk-7hbhbht2.js → chunk-pcxxnnad.js} +3 -3
  131. package/dist/{chunk-7hbhbht2.js.map → chunk-pcxxnnad.js.map} +1 -1
  132. package/dist/{chunk-2d92pev2.js → chunk-pxc51549.js} +2 -2
  133. package/dist/{chunk-2d92pev2.js.map → chunk-pxc51549.js.map} +1 -1
  134. package/dist/{chunk-454c7vn3.js → chunk-q1nq7n6y.js} +2 -2
  135. package/dist/{chunk-454c7vn3.js.map → chunk-q1nq7n6y.js.map} +1 -1
  136. package/dist/{chunk-48qybp63.js → chunk-qqchc40s.js} +2 -2
  137. package/dist/{chunk-48qybp63.js.map → chunk-qqchc40s.js.map} +1 -1
  138. package/dist/{chunk-3tmw1gy2.js → chunk-qttk7k60.js} +2 -2
  139. package/dist/{chunk-3tmw1gy2.js.map → chunk-qttk7k60.js.map} +1 -1
  140. package/dist/{chunk-feyr4851.js → chunk-r069158p.js} +2 -2
  141. package/dist/{chunk-feyr4851.js.map → chunk-r069158p.js.map} +1 -1
  142. package/dist/{chunk-ptjexzn1.js → chunk-r6v21jn6.js} +2 -2
  143. package/dist/{chunk-q4wdg0y3.js.map → chunk-r6v21jn6.js.map} +1 -1
  144. package/dist/{chunk-6j129573.js → chunk-r77f1482.js} +2 -2
  145. package/dist/{chunk-6j129573.js.map → chunk-r77f1482.js.map} +1 -1
  146. package/dist/{chunk-jmbdr550.js → chunk-rnjbja88.js} +2 -2
  147. package/dist/{chunk-jmbdr550.js.map → chunk-rnjbja88.js.map} +1 -1
  148. package/dist/{chunk-q8msf1gf.js → chunk-rq2k9frr.js} +2 -2
  149. package/dist/{chunk-q8msf1gf.js.map → chunk-rq2k9frr.js.map} +1 -1
  150. package/dist/{chunk-2nqxhy1f.js → chunk-se5ekvgb.js} +4 -4
  151. package/dist/{chunk-2nqxhy1f.js.map → chunk-se5ekvgb.js.map} +3 -3
  152. package/dist/{chunk-v6v03hy7.js → chunk-sqc6fkqt.js} +2 -2
  153. package/dist/{chunk-v6v03hy7.js.map → chunk-sqc6fkqt.js.map} +1 -1
  154. package/dist/{chunk-78cvy4je.js → chunk-tn71d46d.js} +2 -2
  155. package/dist/{chunk-78cvy4je.js.map → chunk-tn71d46d.js.map} +1 -1
  156. package/dist/{chunk-hkhxkeeb.js → chunk-v6q4990x.js} +3 -3
  157. package/dist/{chunk-hkhxkeeb.js.map → chunk-v6q4990x.js.map} +1 -1
  158. package/dist/{chunk-e41vdprh.js → chunk-w34j3cd3.js} +3 -3
  159. package/dist/{chunk-e41vdprh.js.map → chunk-w34j3cd3.js.map} +1 -1
  160. package/dist/{chunk-w8ncmp2z.js → chunk-w6fnt1xv.js} +2 -2
  161. package/dist/{chunk-w8ncmp2z.js.map → chunk-w6fnt1xv.js.map} +2 -2
  162. package/dist/{chunk-35fbxgjh.js → chunk-wzqxtrpt.js} +2 -2
  163. package/dist/{chunk-35fbxgjh.js.map → chunk-wzqxtrpt.js.map} +1 -1
  164. package/dist/{chunk-z2fnf49p.js → chunk-xzexftx1.js} +1 -1
  165. package/dist/{chunk-dfv5eqma.js → chunk-z4k18gnp.js} +2 -2
  166. package/dist/{chunk-dfv5eqma.js.map → chunk-z4k18gnp.js.map} +1 -1
  167. package/dist/{chunk-b6948dnh.js → chunk-z6gzasra.js} +2 -2
  168. package/dist/{chunk-b6948dnh.js.map → chunk-z6gzasra.js.map} +1 -1
  169. package/dist/{chunk-p57x55qd.js → chunk-zqpskwk9.js} +2 -2
  170. package/dist/{chunk-p57x55qd.js.map → chunk-zqpskwk9.js.map} +1 -1
  171. package/dist/chunks/ThemeProvider-Bz-y1g2i.js.map +1 -1
  172. package/dist/client/ClientRouter.d.ts.map +1 -1
  173. package/dist/client/ProgressManager.d.ts +1 -1
  174. package/dist/client/index.d.ts +1 -1
  175. package/dist/client/index.d.ts.map +1 -1
  176. package/dist/client/index.js +1 -1
  177. package/dist/client/index.js.map +1 -1
  178. package/dist/client/types.d.ts +72 -2
  179. package/dist/client/types.d.ts.map +1 -1
  180. package/dist/client/useNavigate.d.ts +29 -6
  181. package/dist/client/useNavigate.d.ts.map +1 -1
  182. package/dist/client/usePrefetch.d.ts +13 -3
  183. package/dist/client/usePrefetch.d.ts.map +1 -1
  184. package/dist/config/index.js +1 -1
  185. package/dist/console/run.js +2 -2
  186. package/dist/console/run.js.map +1 -1
  187. package/dist/container/index.js +2 -2
  188. package/dist/container/index.js.map +1 -1
  189. package/dist/database/Connection.d.ts.map +1 -1
  190. package/dist/database/index.d.ts +1 -0
  191. package/dist/database/index.d.ts.map +1 -1
  192. package/dist/database/index.js +2 -2
  193. package/dist/database/index.js.map +1 -1
  194. package/dist/database/sqlitePath.d.ts +46 -0
  195. package/dist/database/sqlitePath.d.ts.map +1 -0
  196. package/dist/email/index.js +2 -2
  197. package/dist/email/index.js.map +1 -1
  198. package/dist/facades/index.js +2 -2
  199. package/dist/facades/index.js.map +1 -1
  200. package/dist/foundation/index.js +2 -2
  201. package/dist/foundation/index.js.map +1 -1
  202. package/dist/http/ApiRouter.d.ts +1 -1
  203. package/dist/http/ApiRouter.d.ts.map +1 -1
  204. package/dist/http/index.js +2 -2
  205. package/dist/http/index.js.map +1 -1
  206. package/dist/i18n/dictionaryRuntime.js +2 -2
  207. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  208. package/dist/i18n/index.js +2 -2
  209. package/dist/i18n/index.js.map +1 -1
  210. package/dist/kernel/index.js +2 -2
  211. package/dist/kernel/index.js.map +1 -1
  212. package/dist/orm/index.js +2 -2
  213. package/dist/orm/index.js.map +1 -1
  214. package/dist/server/index.js +2 -2
  215. package/dist/server/index.js.map +1 -1
  216. package/dist/services/index.js +2 -2
  217. package/dist/services/index.js.map +1 -1
  218. package/dist/services/queue/work.js +2 -2
  219. package/dist/services/queue/work.js.map +1 -1
  220. package/dist/support/index.js +2 -2
  221. package/dist/support/index.js.map +1 -1
  222. package/package.json +1 -1
  223. package/dist/ai/Agent.test-d.d.ts +0 -2
  224. package/dist/ai/Agent.test-d.d.ts.map +0 -1
  225. package/dist/ai/Schema.test-d.d.ts +0 -2
  226. package/dist/ai/Schema.test-d.d.ts.map +0 -1
  227. package/dist/ai/client/reducer.test-d.d.ts +0 -2
  228. package/dist/ai/client/reducer.test-d.d.ts.map +0 -1
  229. package/dist/ai/example.d.ts +0 -129
  230. package/dist/ai/example.d.ts.map +0 -1
  231. package/dist/chunk-4728yrmt.js +0 -5
  232. package/dist/chunk-4728yrmt.js.map +0 -10
  233. package/dist/chunk-dq2hgzje.js +0 -5
  234. package/dist/chunk-f9ccncar.js +0 -5
  235. package/dist/chunk-f9ccncar.js.map +0 -13
  236. package/dist/client/useDictionary.test-d.d.ts +0 -2
  237. package/dist/client/useDictionary.test-d.d.ts.map +0 -1
  238. package/dist/console/builder.test-d.d.ts +0 -2
  239. package/dist/console/builder.test-d.d.ts.map +0 -1
  240. package/dist/http/ApiRouter.test-d.d.ts +0 -2
  241. package/dist/http/ApiRouter.test-d.d.ts.map +0 -1
  242. package/dist/http/McpRouter.test-d.d.ts +0 -2
  243. package/dist/http/McpRouter.test-d.d.ts.map +0 -1
  244. package/dist/services/events/FakeEventManager.test-d.d.ts +0 -2
  245. package/dist/services/events/FakeEventManager.test-d.d.ts.map +0 -1
  246. package/dist/services/events/Listener.test-d.d.ts +0 -2
  247. package/dist/services/events/Listener.test-d.d.ts.map +0 -1
  248. /package/dist/{chunk-rj3fnc4h.js.map → chunk-2ghpxrw1.js.map} +0 -0
  249. /package/dist/{chunk-pbx9p6g0.js.map → chunk-6waph5k8.js.map} +0 -0
  250. /package/dist/{chunk-z2fnf49p.js.map → chunk-xzexftx1.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  // @bun
2
2
  import{AsyncLocalStorage as E}from"async_hooks";class Q{content={title:"Gemi App",description:null,openGraph:null};touched=!1;render(){return{title:this.content.title,description:this.content.description,openGraph:this.content.openGraph}}title(j){this.touched=!0,this.content.title=j}description(j){this.touched=!0,this.content.description=j}openGraph({title:j,description:B,type:z,url:G,image:J,imageAlt:U,imageWidth:V,imageHeight:X,twitterImage:Y=J,twitterImageAlt:D=U,twitterImageWidth:K=V,twitterImageHeight:M=X}){this.touched=!0;let Z=J,$=Y;if(J&&!J.startsWith("http"))Z=`${process.env.HOST_NAME}${J}`,$=`${process.env.HOST_NAME}${Y}`;this.content.openGraph=Object.fromEntries(Object.entries({title:j,description:B,type:z,url:G,image:Z,imageAlt:U,imageWidth:V,imageHeight:X,twitterImage:$,twitterImageAlt:D,twitterImageWidth:K,twitterImageHeight:M}).filter(([O,N])=>N!==void 0))}}function b(j,B,z={}){return[`${j}=${B}`,z.maxAge?`Max-Age=${z.maxAge}`:"",z.httpOnly?"HttpOnly":"",z.secure?"Secure":"",z.sameSite?`SameSite=${z.sameSite}`:"SameSite=Strict",z.path?`Path=${z.path}`:"Path=/",z.domain?`Domain=${z.domain}`:"",z.expires?`Expires=${z.expires.toUTCString()}`:"",z.partitioned?"Partitioned":""].filter((G)=>G!=="").join("; ")}var P=new E;class F{req;cookies=new Set;headers=new Headers;serverQueries=null;user=null;csrfHmac=null;locale=null;metadata=new Q;rangeRequest=null;sessionId=null;featureEvaluations=null;featureContext=null;featureBuckets=null;pendingWork=new Set;ended=!1;constructor(j){this.req=j}waitUntil(j){if(this.ended)return;let B=Promise.resolve(j).then(()=>{},()=>{});this.pendingWork.add(B),B.then(()=>this.pendingWork.delete(B))}hasPendingWork(){return this.pendingWork.size>0}async whenIdle(){while(this.pendingWork.size>0)await Promise.all(Array.from(this.pendingWork))}setLocale(j){this.locale=j}renderMeta(){return this.metadata.render()}setCSRFHmac(j){this.csrfHmac=j}setCookie(j,B,z={}){this.cookies.add(b(j,B,z))}deleteCookie(j,B={}){this.cookies.add(b(j,"",{...B,maxAge:-1}))}setHeaders(j,B){this.headers.set(j,B)}setUser(j){this.user=j}setRequest(j){this.req=j}destroy(){this.ended=!0,delete this.cookies,delete this.headers,this.serverQueries=null,this.sessionId=null,this.featureEvaluations=null,this.featureContext=null,this.featureBuckets=null,delete this.user}}var L="session_id";function H(){let j=T.getStore();if(!j)return null;if(j.sessionId)return j.sessionId;let B=j.req?.cookies?.get(L);if(B)j.sessionId=B;return j.sessionId}function W(){let j=T.getStore();if(!j)return null;let B=H();if(B)return B;let z=Bun.randomUUIDv7();return j.sessionId=z,j.setCookie(L,z,{httpOnly:!0,secure:Bun.env.NODE_ENV==="production",sameSite:"Lax",expires:new Date(Date.now()+31536000000)}),z}class T{static getStore(){return P.getStore()}static setRequest(j){P.getStore().req=j}static run(j,B,z){let G=new F(j);if(z)G.user=z.user;return P.run(G,B)}static runWith(j,B){return P.run(j,B)}static exit(j){return P.exit(j)}}
3
- export{H as ef,W as ff,T as gf};
3
+ export{H as ff,W as gf,T as hf};
4
4
 
5
- //# debugId=214FC686155B1CA464756E2164756E21
5
+ //# debugId=C1DC28290B365BA264756E2164756E21
@@ -6,6 +6,6 @@
6
6
  "export type OpenGraphParams = {\n title: string;\n description?: string;\n type: string;\n url: string;\n image: string;\n imageAlt?: string;\n imageWidth?: number;\n imageHeight?: number;\n twitterImage?: string;\n twitterImageAlt?: string;\n twitterImageWidth?: number;\n twitterImageHeight?: number;\n};\nexport class Metadata {\n content: any = {\n title: \"Gemi App\",\n description: null,\n openGraph: null,\n };\n\n /**\n * Whether a handler set anything, as opposed to `content` still being the\n * defaults. A partially rendered response that touched no metadata sends\n * none, so the client keeps what the skipped segments put there.\n */\n touched = false;\n\n render() {\n return {\n title: this.content.title,\n description: this.content.description,\n openGraph: this.content.openGraph,\n };\n }\n\n title(title: string) {\n this.touched = true;\n this.content.title = title;\n }\n\n description(description: string) {\n this.touched = true;\n this.content.description = description;\n }\n\n openGraph({\n title,\n description,\n type,\n url,\n image,\n imageAlt,\n imageWidth,\n imageHeight,\n twitterImage = image,\n twitterImageAlt = imageAlt,\n twitterImageWidth = imageWidth,\n twitterImageHeight = imageHeight,\n }: OpenGraphParams) {\n this.touched = true;\n let _image = image;\n let _twitterImage = twitterImage;\n if (image && !image.startsWith(\"http\")) {\n _image = `${process.env.HOST_NAME}${image}`;\n _twitterImage = `${process.env.HOST_NAME}${twitterImage}`;\n }\n this.content.openGraph = Object.fromEntries(\n Object.entries({\n title,\n description,\n type,\n url,\n image: _image,\n imageAlt,\n imageWidth,\n imageHeight,\n twitterImage: _twitterImage,\n twitterImageAlt,\n twitterImageWidth,\n twitterImageHeight,\n }).filter(([_, value]) => value !== undefined),\n );\n }\n}\n"
7
7
  ],
8
8
  "mappings": ";AAAA,4BAAS,oBCcF,MAAM,CAAS,CACpB,QAAe,CACb,MAAO,WACP,YAAa,KACb,UAAW,IACb,EAOA,QAAU,GAEV,MAAM,EAAG,CACP,MAAO,CACL,MAAO,KAAK,QAAQ,MACpB,YAAa,KAAK,QAAQ,YAC1B,UAAW,KAAK,QAAQ,SAC1B,EAGF,KAAK,CAAC,EAAe,CACnB,KAAK,QAAU,GACf,KAAK,QAAQ,MAAQ,EAGvB,WAAW,CAAC,EAAqB,CAC/B,KAAK,QAAU,GACf,KAAK,QAAQ,YAAc,EAG7B,SAAS,EACP,QACA,cACA,OACA,MACA,QACA,WACA,aACA,cACA,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,GACH,CAClB,KAAK,QAAU,GACf,IAAI,EAAS,EACT,EAAgB,EACpB,GAAI,GAAS,CAAC,EAAM,WAAW,MAAM,EACnC,EAAS,GAAG,QAAQ,IAAI,YAAY,IACpC,EAAgB,GAAG,QAAQ,IAAI,YAAY,IAE7C,KAAK,QAAQ,UAAY,OAAO,YAC9B,OAAO,QAAQ,CACb,QACA,cACA,OACA,MACA,MAAO,EACP,WACA,aACA,cACA,aAAc,EACd,kBACA,oBACA,oBACF,CAAC,EAAE,OAAO,EAAE,EAAG,KAAW,IAAU,MAAS,CAC/C,EAEJ,CDjEO,SAAS,CAAY,CAC1B,EACA,EACA,EAA+B,CAAC,EAChC,CACA,MAAO,CACL,GAAG,KAAQ,IACX,EAAQ,OAAS,WAAW,EAAQ,SAAW,GAC/C,EAAQ,SAAW,WAAa,GAChC,EAAQ,OAAS,SAAW,GAC5B,EAAQ,SAAW,YAAY,EAAQ,WAAa,kBACpD,EAAQ,KAAO,QAAQ,EAAQ,OAAS,SACxC,EAAQ,OAAS,UAAU,EAAQ,SAAW,GAC9C,EAA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,EAEjC",
9
- "debugId": "214FC686155B1CA464756E2164756E21",
9
+ "debugId": "C1DC28290B365BA264756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{h as P,j as M}from"./chunk-w8ncmp2z.js";import{ia as D,ja as S}from"./chunk-0e5z1x9w.js";import"./chunk-zq5m4scz.js";import"./chunk-9a8qz3s7.js";import"./chunk-gvkydx8r.js";import"./chunk-8z37k28d.js";import"./chunk-35fbxgjh.js";import{pg as x}from"./chunk-9e5c5e15.js";import"./chunk-ptjexzn1.js";import{join as c}from"path";import{createServer as h}from"vite";import{join as w}from"path";import{IncomingMessage as R,ServerResponse as E}from"http";import{Socket as k}from"net";function g(J){return J.replace(/\x1b\[[0-9;]*m/g,"").replace(/\[[0-9;]*m/g,"").replace(/\n\s*\n/g,`
2
+ import{h as P,j as M}from"./chunk-w6fnt1xv.js";import{ia as D,ja as S}from"./chunk-0e5z1x9w.js";import"./chunk-zq5m4scz.js";import"./chunk-9a8qz3s7.js";import"./chunk-gvkydx8r.js";import"./chunk-8z37k28d.js";import"./chunk-wzqxtrpt.js";import{rg as x}from"./chunk-9ch1q7nd.js";import"./chunk-r6v21jn6.js";import{join as c}from"path";import{createServer as h}from"vite";import{join as w}from"path";import{IncomingMessage as R,ServerResponse as E}from"http";import{Socket as k}from"net";function g(J){return J.replace(/\x1b\[[0-9;]*m/g,"").replace(/\[[0-9;]*m/g,"").replace(/\n\s*\n/g,`
3
3
  `).split(`
4
4
  `).map((K)=>K.trim()).filter((K)=>K.length>0).join(`
5
5
  `).trim()}function I(J){return`
@@ -52,4 +52,4 @@ ${W} | ${Y}
52
52
  window.__vite_plugin_react_preamble_installed__ = true;
53
53
  `,{headers:{"Content-Type":"application/javascript"}});return null}function f(J,K,U){let O=w(process.cwd(),"app");return async(W)=>{let{pathname:Y}=new URL(W.url),$=(Q)=>{if(console.error(Q),U.ssrFixStacktrace?.(Q),L(Q),x(Y))return new Response(JSON.stringify({error:Q?.message??String(Q)}),{status:500,headers:{"Content-Type":"application/json"}});return globalThis.__gemiErrorPageServed=!0,new Response(I(A(Q)),{status:500,headers:{"Content-Type":"text/html"}})},z=async(Q)=>{let H=m(Q);if(H)return H;try{let B=J.fetch.bind(J),G=await q(U,Q)??await B(Q);if(G instanceof Response)return G;let C={},b={},y={},N=(Z,X)=>`"${Z}": () => import("${X}")`,F=[];for(let Z of["404",...J.getFlatComponentTree.call(J)]){if(Bun.env.NODE_ENV==="test")break;let X=`${process.env.APP_DIR}`,j=await _(U).import(`${X}/views/${Z}.tsx`);C[Z]=j.default,b[Z]=j?.OpenGraph,y[Z]=j,F.push(N(Z,`/app/views/${Z}.tsx`))}let T=`{${F.join(",")}}`;return await G({getStyles:async(Z)=>await P(O,U,Z),bootstrapModules:["/refresh.js","/app/client.tsx","/@vite/client"],viewImportMap:C,viewModules:y,ogMap:b,loaders:T,cssManifest:{}})}catch(B){return $(B)}};return await K(W,(Q)=>J.withGlobalMiddleware(Q,z,$))}}var V=process.cwd(),u=c(V,"app");if(!globalThis.__gemiErrorHooked)globalThis.__gemiErrorHooked=!0,process.on("unhandledRejection",(J)=>{console.error(J),L(J)}),process.on("uncaughtException",(J)=>{console.error(J),L(J)});async function QJ(J,K){let U=Boolean(globalThis.__gemiVite),O=globalThis.__gemiVite??=await h({configFile:!1,plugins:[S()],server:{middlewareMode:!0,allowedHosts:J.devAllowedHosts.call(J),watch:{ignored:(Y)=>{let $=Y.split(/[/\\]/).pop()??"";return $===".env"||$.startsWith(".env.")}}},appType:"custom",resolve:{dedupe:["react","react-dom"]},optimizeDeps:{include:["react","react-dom","react-dom/client"]},ssr:{external:[...D]}});process.env.ROOT_DIR=V,process.env.APP_DIR=u;let W=Bun.serve({port:process.env.PORT||5173,fetch:f(J,K,O)});if(U)_(O).clearCache();if(U)if(globalThis.__gemiErrorActive&&globalThis.__gemiErrorPageServed)globalThis.__gemiErrorActive=!1,globalThis.__gemiErrorPageServed=!1,O.ws.send({type:"full-reload"});else globalThis.__gemiErrorActive=!1,O.ws.send({type:"custom",event:"http-reload"});else M({port:W.port,rootDir:V});return W}export{A as viteErrorPayload,QJ as httpDev};
54
54
 
55
- //# debugId=24E29237A3311A5064756E2164756E21
55
+ //# debugId=E3E9BC7780D0ABC364756E2164756E21
@@ -7,6 +7,6 @@
7
7
  "function cleanupTerminalText(text) {\n return (\n text\n // Remove ANSI escape sequences (colors, formatting)\n .replace(/\\x1b\\[[0-9;]*m/g, \"\")\n // Remove ANSI escape sequences with different format\n .replace(/\\[[0-9;]*m/g, \"\")\n // Remove excessive whitespace and normalize line breaks\n .replace(/\\n\\s*\\n/g, \"\\n\")\n // Trim each line\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line.length > 0)\n .join(\"\\n\")\n .trim()\n );\n}\n\nexport function renderErrorPage(err: any) {\n return `\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta\n name=\"viewport\"\n content=\"width=device-width, initial-scale=1.0\"\n />\n\n <title>Error</title>\n <style>\n body {\n font-family: Arial, sans-serif;\n padding: 20px;\n }\n h1 {\n color: red;\n }\n </style>\n </head>\n <body>\n <div id=\"overlay\"></div>\n <script type=\"module\" src=\"/refresh.js\"></script>\n <script type=\"module\" src=\"/@vite/client\"></script>\n <script>\n ${cleanupTerminalText.toString()}\n const err = ${JSON.stringify(err, Object.getOwnPropertyNames(err), 2)}\n\n window.addEventListener('load', () => {\n const container = document.getElementById('overlay')\n const ErrorOverlay = customElements.get('vite-error-overlay')\n if (ErrorOverlay) {\n const overlay = new ErrorOverlay({ ...err, message: cleanupTerminalText(err.message) });\n container.appendChild(overlay)\n }\n })\n </script>\n </body>\n</html>\n`;\n}\n"
8
8
  ],
9
9
  "mappings": ";iWAAA,SAAS,OAET,iBAAS,OCFT,SAAS,OACT,oBAAS,cAAiB,aAC1B,iBAAS,YCFT,SAAS,CAAmB,CAAC,EAAM,CACjC,OACE,EAEG,QAAQ,kBAAmB,EAAE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,WAAW,aAAe,MAAM,EAAa,CAKzD,WAAY,GACZ,QAAS,CAAC,EAAS,CAAC,EACpB,OAAQ,CACN,eAAgB,GAIhB,aAAc,EAAI,gBAAgB,KAAK,CAAG,EAQ1C,MAAO,CACL,QAAS,CAAC,IAAiB,CACzB,IAAM,EAAO,EAAK,MAAM,OAAO,EAAE,IAAI,GAAK,GAC1C,OAAO,IAAS,QAAU,EAAK,WAAW,OAAO,EAErD,CACF,EACA,QAAS,SAKT,QAAS,CAAE,OAAQ,CAAC,QAAS,WAAW,CAAE,EAQ1C,aAAc,CAAE,QAAS,CAAC,QAAS,YAAa,kBAAkB,CAAE,EAUpE,IAAK,CACH,SAAU,CAAC,GAAG,CAAwB,CACxC,CACF,CAAC,EAED,QAAQ,IAAI,SAAW,EACvB,QAAQ,IAAI,QAAU,EAEtB,IAAM,EAAS,IAAI,MAAM,CAEvB,KAAM,QAAQ,IAAI,MAAQ,KAC1B,MAAO,EAAe,EAAK,EAAiB,CAAI,CAClD,CAAC,EA+BD,GAAI,EACF,EAAU,CAAI,EAAE,WAAW,EAQ7B,GAAI,EAMF,GAAI,WAAW,mBAAqB,WAAW,sBAC7C,WAAW,kBAAoB,GAC/B,WAAW,sBAAwB,GACnC,EAAK,GAAG,KAAK,CAAE,KAAM,aAAc,CAAC,EAEpC,gBAAW,kBAAoB,GAC/B,EAAK,GAAG,KAAK,CAAE,KAAM,SAAU,MAAO,aAAc,CAAC,EAIvD,OAAmB,CAAE,KAAM,EAAO,KAAM,SAAQ,CAAC,EAGnD,OAAO",
10
- "debugId": "24E29237A3311A5064756E2164756E21",
10
+ "debugId": "E3E9BC7780D0ABC364756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ var _=new WeakMap;function X(q){let z=_.get(q);if(!z)throw Error("gemi/ai: expected a schema built with `s`, got a foreign object");return z}function Q(q){let z=(q.optional||q.nullable)&&q.node.kind!=="json",A=E($(q.node),z);return q.description?{description:q.description,...A}:A}function $(q){switch(q.kind){case"string":return{type:"string"};case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"literal":return{type:typeof q.value,const:q.value};case"enum":return{type:"string",enum:q.values};case"array":return{type:"array",items:Q(q.item)};case"object":return{type:"object",properties:Object.fromEntries(Object.entries(q.shape).map(([z,A])=>[z,Q(A)])),required:Object.keys(q.shape),additionalProperties:!1};case"union":return{anyOf:q.members.map(Q)};case"json":return{}}}function E(q,z){if(!z)return q;if(q.anyOf)return{...q,anyOf:[...q.anyOf,{type:"null"}]};if(q.enum||q.const!==void 0)return{anyOf:[q,{type:"null"}]};if(typeof q.type==="string")return{...q,type:[q.type,"null"]};return{anyOf:[q,{type:"null"}]}}function T(q){if(q===null)return"null";if(Array.isArray(q))return"array";return typeof q}function g(q,z){if(typeof z==="number"&&!Number.isFinite(z))return String(z);if(q.kind==="literal"||q.kind==="enum"){if(typeof z==="string"||typeof z==="number"||typeof z==="boolean")return JSON.stringify(z)}return T(z)}function x(q){let z=q.node,A=(()=>{switch(z.kind){case"string":case"number":case"boolean":return z.kind;case"literal":return JSON.stringify(z.value);case"enum":return`one of ${z.values.map((B)=>JSON.stringify(B)).join(" | ")}`;case"array":return"array";case"object":return"object";case"union":return"one of the variants";case"json":return"a JSON value"}})();return q.optional||q.nullable?`${A} or null`:A}function Y(q){return q?`${q}: `:""}function Z(q,z){if(z===null||z===void 0)return q.optional||q.nullable?1:0;let A=q.node;switch(A.kind){case"string":return typeof z==="string"?1:0;case"number":return typeof z==="number"?1:0;case"boolean":return typeof z==="boolean"?1:0;case"literal":return z===A.value?10:0;case"enum":return typeof z==="string"&&A.values.includes(z)?10:0;case"array":return Array.isArray(z)?1:0;case"object":{if(typeof z!=="object"||Array.isArray(z))return 0;let B=z,C=1;for(let[F,G]of Object.entries(A.shape))C+=Z(G,B[F]);return C}case"union":return A.members.reduce((B,C)=>Math.max(B,Z(C,z)),0);case"json":return 1}}function P(q,z,A,B){if(q.optional&&(z===null||z===void 0))return{drop:!0,value:void 0};if(q.nullable&&z===null)return{drop:!1,value:null};return{drop:!1,value:w(q,z,A,B)}}function w(q,z,A,B){let C=q.node,F=()=>{B.push(`${Y(A)}expected ${x(q)}, got ${g(C,z)}`);return};switch(C.kind){case"string":return typeof z==="string"?z:F();case"number":return typeof z==="number"&&Number.isFinite(z)?z:F();case"boolean":return typeof z==="boolean"?z:F();case"literal":return z===C.value?z:F();case"enum":return typeof z==="string"&&C.values.includes(z)?z:F();case"array":{if(!Array.isArray(z))return F();return z.map((G,H)=>{let D=P(C.item,G,`${A}[${H}]`,B);return D.drop?void 0:D.value})}case"object":{if(typeof z!=="object"||z===null||Array.isArray(z))return F();let G=z,H={};for(let[D,L]of Object.entries(C.shape)){let M=P(L,G[D],A?`${A}.${D}`:D,B);if(!M.drop)H[D]=M.value}return H}case"union":{let G;for(let H of C.members){let D=[],L=P(H,z,A,D);if(D.length===0)return L.drop?void 0:L.value;let M=Z(H,z);if(!G||M>G.score)G={errors:D,score:M}}B.push(`${Y(A)}no matching variant; closest: ${G.errors.join("; ")}`);return}case"json":if(z===void 0)return F();return R(z,A,B,new Set),z}}function R(q,z,A,B,C=!0){let F=(H)=>{A.push(`${Y(z)}expected a JSON value, got ${H}`)};switch(typeof q){case"undefined":case"string":case"boolean":return;case"number":if(!Number.isFinite(q))F(String(q));return;case"bigint":return F("a bigint");case"function":return F("a function");case"symbol":return F("a symbol")}if(q===null)return;let G=q;if(B.has(G))return F("a circular reference");B.add(G);try{let H=C?G.toJSON:void 0;if(typeof H==="function"){let D;try{D=H.call(G)}catch{return F("a toJSON that threw")}if(D===void 0)return F("a toJSON that returns undefined");return R(D,z,A,B,!1)}if(Array.isArray(q))q.forEach((D,L)=>R(D,`${z}[${L}]`,A,B));else for(let[D,L]of Object.entries(G))R(L,z?`${z}.${D}`:D,A,B)}finally{B.delete(G)}}function I(q){return U(q)}function U(q){let z={toJSONSchema:()=>Q(q),parse(A){let B=[],C=P(q,A,"",B);if(B.length>0)throw Error(B.join("; "));return C.drop?void 0:C.value},safeParse(A){let B=[],C=P(q,A,"",B);if(B.length>0)return{ok:!1,errors:B};return{ok:!0,value:C.drop?void 0:C.value}},describe:(A)=>U({...q,description:A}),optional:()=>U({...q,optional:!0}),nullable:()=>U({...q,nullable:!0,optional:!1})};return _.set(z,q),z}function K(q){return{node:q,optional:!1,nullable:!1}}var O={string:()=>I(K({kind:"string"})),number:()=>I(K({kind:"number"})),boolean:()=>I(K({kind:"boolean"})),literal:(q)=>I(K({kind:"literal",value:q})),enum:(q)=>I(K({kind:"enum",values:q})),object:(q)=>I(K({kind:"object",shape:Object.fromEntries(Object.entries(q).map(([z,A])=>[z,X(A)]))})),array:(q)=>I(K({kind:"array",item:X(q)})),union:(q)=>I(K({kind:"union",members:q.map(X)})),json:()=>I(K({kind:"json"}))};function J(q){let z=_.get(q);if(z)return W(z.node);return V(q.toJSONSchema())}function V(q){if(!(q.type!==void 0||q.enum!==void 0||q.const!==void 0||q.anyOf!==void 0||q.properties!==void 0||q.items!==void 0))return!1;for(let A of Object.values(q.properties??{}))if(!V(A))return!1;if(q.items&&!V(q.items))return!1;for(let A of q.anyOf??[])if(!V(A))return!1;return!0}function W(q){switch(q.kind){case"string":case"number":case"boolean":case"literal":case"enum":return!0;case"object":return Object.values(q.shape).every((z)=>W(z.node));case"array":return W(q.item.node);case"union":return q.members.every((z)=>W(z.node));case"json":return!1}}
3
+ export{O as Ib,J as Jb};
4
+
5
+ //# debugId=9A9514471C26222C64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../ai/Schema.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * The schema layer for tool inputs, tool outputs and structured final answers.\n *\n * Two things have to come out of one declaration: a TypeScript type, so\n * `execute(input)` is typed at the call site and the result is typed in the\n * browser, and a JSON Schema, because that is what the model is actually shown.\n * A phantom `Schema<T>` gives the first and nothing of the second, and a\n * hand-written JSON Schema next to a hand-written type gives both and lets them\n * drift. So the builder below is the single source, and `Infer` reads the type\n * back off it.\n *\n * Everything here is deliberately narrower than JSON Schema. OpenAI's strict\n * structured output only accepts a subset — every property listed in\n * `required`, `additionalProperties: false` on every object, no patterns, no\n * `oneOf` at the root — and a builder that cannot express the rejected parts is\n * better than one that lets you write a schema the API refuses at runtime.\n *\n * `json()` is the one deliberate hole in that, for the formats strict mode\n * cannot describe at all: a record with arbitrary keys, a mixed-type tuple, a\n * recursive document. It does not widen the subset — it turns strict mode off\n * for the schema containing it, which `supportsStrict` reads back off the tree\n * so that no caller has to remember to.\n */\n\nexport type JSONSchema = {\n type?: string | string[];\n description?: string;\n enum?: readonly (string | number)[];\n const?: string | number | boolean;\n properties?: Record<string, JSONSchema>;\n required?: readonly string[];\n additionalProperties?: false;\n items?: JSONSchema;\n anyOf?: readonly JSONSchema[];\n};\n\n/**\n * Any value JSON can carry. The default output type of `json()`, and the\n * annotation an app reaches for when it hands one of those values on.\n */\nexport type JsonValue =\n | string\n | number\n | boolean\n | null\n | JsonValue[]\n | { [key: string]: JsonValue };\n\ndeclare const OUTPUT: unique symbol;\ndeclare const OPTIONAL: unique symbol;\n\n/**\n * `T` is carried in a phantom property rather than a real one: it exists only\n * for inference, and a real field would show up on the object the app writes.\n */\nexport interface Schema<T> {\n readonly [OUTPUT]: T;\n /** The JSON Schema handed to the provider. */\n toJSONSchema(): JSONSchema;\n /**\n * Parses a value coming back from the model. Tool arguments arrive as a JSON\n * string the model generated, so they are untrusted in exactly the way a\n * request body is: shape-checked before `execute` ever sees them.\n */\n parse(value: unknown): T;\n safeParse(value: unknown): { ok: true; value: T } | { ok: false; errors: string[] };\n}\n\n/**\n * A schema whose key may be left out of the object containing it.\n *\n * Marked with a property rather than detected from the output type, because\n * `undefined extends T` — the obvious test — is true of *everything* when\n * `strictNullChecks` is off, which is how this package and plenty of apps\n * compile. That version made every field of every tool optional, and did it\n * quietly: the JSON Schema was still right, so only the TypeScript types lied.\n */\nexport interface OptionalSchema<T> extends Schema<T | undefined> {\n readonly [OPTIONAL]: true;\n}\n\nexport type AnySchema = Schema<any>;\n\nexport type Infer<S> = S extends Schema<infer T> ? T : never;\n\n/**\n * Collapses a type into one flat object.\n *\n * `ShapeOutput` builds its result as an intersection of two mapped types, one\n * required and one optional, and that intersection is what every hover, every\n * error message and every type assertion would otherwise show. The difference\n * is between an app reading `{ command: string; cwd?: string }` and reading two\n * mapped types joined by an ampersand.\n *\n * It also drops `readonly`, which the mapped types copy from the shape literal\n * — `s.object({ ... })` infers that literal as `const` to keep the keys, and a\n * tool has no reason to receive an immutable input because of how its schema\n * was written down.\n */\ntype Flatten<T> = { -readonly [K in keyof T]: T[K] };\n\ntype ShapeOutput<S extends Record<string, AnySchema>> = Flatten<\n {\n [K in keyof S as S[K] extends OptionalSchema<any> ? never : K]: Infer<S[K]>;\n } & {\n [K in keyof S as S[K] extends OptionalSchema<any> ? K : never]?: Infer<S[K]>;\n }\n>;\n\ninterface SchemaBuilder<T> extends Schema<T> {\n /**\n * The description is not documentation — it is the only prose the model gets\n * about a field, and it is the difference between a tool that is called\n * correctly and one that is not.\n */\n describe(description: string): this;\n /**\n * Strict mode has no notion of an omitted key: every property must appear in\n * `required`. So `optional()` emits a nullable union and the model is told to\n * send `null`, while the TypeScript type says `| undefined` and the parsed\n * value drops the key. The asymmetry is the point — it is what lets an app\n * write ordinary optional fields against an API that forbids them.\n */\n optional(): OptionalSchemaBuilder<T>;\n nullable(): SchemaBuilder<T | null>;\n}\n\ninterface OptionalSchemaBuilder<T> extends SchemaBuilder<T | undefined>, OptionalSchema<T> {}\n\n// --- the runtime ---------------------------------------------------------\n\n/**\n * What a builder actually is. `optional` and `nullable` are flags rather than\n * wrapper nodes so that `.nullable().optional()` cannot nest into something\n * whose emitted shape depends on which order they were called in.\n */\ntype Definition = {\n node: SchemaNode;\n description?: string;\n optional: boolean;\n nullable: boolean;\n};\n\ntype SchemaNode =\n | { kind: \"string\" }\n | { kind: \"number\" }\n | { kind: \"boolean\" }\n | { kind: \"literal\"; value: string | number | boolean }\n | { kind: \"enum\"; values: readonly string[] }\n | { kind: \"object\"; shape: Record<string, Definition> }\n | { kind: \"array\"; item: Definition }\n | { kind: \"union\"; members: readonly Definition[] }\n /** Constrains nothing. The node strict mode has no spelling for. */\n | { kind: \"json\" };\n\ntype ParseResult = { ok: true; value: unknown } | { ok: false; errors: string[] };\n\n/** The public interface with the phantoms and the generic taken off. */\ninterface RuntimeSchema {\n toJSONSchema(): JSONSchema;\n parse(value: unknown): unknown;\n safeParse(value: unknown): ParseResult;\n describe(description: string): RuntimeSchema;\n optional(): RuntimeSchema;\n nullable(): RuntimeSchema;\n}\n\n/**\n * Definitions hang off the builders here rather than on the builders\n * themselves: a property, however obscurely named, is a property an app can\n * see, serialise or accidentally depend on, and `Schema<T>` promises exactly\n * three methods.\n */\nconst definitions = new WeakMap<object, Definition>();\n\nfunction definitionOf(schema: AnySchema): Definition {\n const definition = definitions.get(schema);\n if (!definition) {\n throw new Error(\"gemi/ai: expected a schema built with `s`, got a foreign object\");\n }\n return definition;\n}\n\n// --- emitting ------------------------------------------------------------\n\nfunction emit(definition: Definition): JSONSchema {\n // A `json` node already admits every value there is, null included, so\n // widening it would only add an `anyOf` for the model to read past — and one\n // whose second branch is a strictly narrower repeat of its first.\n const widen = (definition.optional || definition.nullable) && definition.node.kind !== \"json\";\n const body = allowNull(emitNode(definition.node), widen);\n return definition.description ? { description: definition.description, ...body } : body;\n}\n\nfunction emitNode(node: SchemaNode): JSONSchema {\n switch (node.kind) {\n case \"string\":\n return { type: \"string\" };\n case \"number\":\n return { type: \"number\" };\n case \"boolean\":\n return { type: \"boolean\" };\n // `const` rather than a one-member `enum`, because a boolean literal has no\n // `enum` form and one branch that works for all three beats two that\n // disagree about what a literal is.\n case \"literal\":\n return { type: typeof node.value, const: node.value };\n case \"enum\":\n return { type: \"string\", enum: node.values };\n case \"array\":\n return { type: \"array\", items: emit(node.item) };\n case \"object\":\n return {\n type: \"object\",\n properties: Object.fromEntries(\n Object.entries(node.shape).map(([key, child]) => [key, emit(child)]),\n ),\n // Every declared property, optional ones included. This is the whole of\n // strict mode's bargain: the model is never allowed to omit a key, so\n // \"may be absent\" has to be spelled as \"may be null\" instead.\n required: Object.keys(node.shape),\n additionalProperties: false,\n };\n case \"union\":\n return { anyOf: node.members.map(emit) };\n // The empty schema, which is JSON Schema's own way of saying \"any value\" —\n // no `type` listing all seven, which reads as a constraint the model then\n // has to check itself. What the field actually is gets said in\n // `description`, the one channel a model reads either way.\n case \"json\":\n return {};\n }\n}\n\n/**\n * Widens a schema to admit `null` — for a `nullable()` field, and for the null\n * an `optional()` field tells the model to send in place of omitting the key.\n */\nfunction allowNull(base: JSONSchema, on: boolean): JSONSchema {\n if (!on) return base;\n // A union is already a list of alternatives; appending to it is flatter than\n // nesting an `anyOf` inside an `anyOf`, and reads the same to the model.\n if (base.anyOf) return { ...base, anyOf: [...base.anyOf, { type: \"null\" }] };\n // `enum` and `const` cannot carry the null themselves — `enum` here is\n // strings and numbers by declaration — so those get wrapped rather than\n // widened.\n if (base.enum || base.const !== undefined) return { anyOf: [base, { type: \"null\" }] };\n if (typeof base.type === \"string\") return { ...base, type: [base.type, \"null\"] };\n return { anyOf: [base, { type: \"null\" }] };\n}\n\n// --- parsing -------------------------------------------------------------\n\nfunction typeName(value: unknown): string {\n if (value === null) return \"null\";\n if (Array.isArray(value)) return \"array\";\n return typeof value;\n}\n\n/**\n * What the value looked like. For a literal or an enum the *type* is usually\n * right and the value is wrong, and \"expected \\\"refund\\\", got string\" tells\n * whoever is reading the failed tool call nothing they did not know.\n */\nfunction saw(node: SchemaNode, value: unknown): string {\n if (typeof value === \"number\" && !Number.isFinite(value)) return String(value);\n if (node.kind === \"literal\" || node.kind === \"enum\") {\n const primitive =\n typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\";\n if (primitive) return JSON.stringify(value);\n }\n return typeName(value);\n}\n\nfunction wanted(definition: Definition): string {\n const node = definition.node;\n const base = (() => {\n switch (node.kind) {\n case \"string\":\n case \"number\":\n case \"boolean\":\n return node.kind;\n case \"literal\":\n return JSON.stringify(node.value);\n case \"enum\":\n return `one of ${node.values.map((v) => JSON.stringify(v)).join(\" | \")}`;\n case \"array\":\n return \"array\";\n case \"object\":\n return \"object\";\n case \"union\":\n return \"one of the variants\";\n case \"json\":\n return \"a JSON value\";\n }\n })();\n return definition.optional || definition.nullable ? `${base} or null` : base;\n}\n\n/** `orders[2].total: ` — empty at the root, where a prefix would be noise. */\nfunction at(path: string): string {\n return path ? `${path}: ` : \"\";\n}\n\n/**\n * How well a value matches, used only to pick which union variant to blame.\n * A literal or an enum hit counts for far more than an ordinary field, because\n * that is what a discriminated union turns on: the variant whose `kind` matched\n * is the one the model meant, whatever else it got wrong.\n */\nfunction score(definition: Definition, value: unknown): number {\n if (value === null || value === undefined) {\n return definition.optional || definition.nullable ? 1 : 0;\n }\n const node = definition.node;\n switch (node.kind) {\n case \"string\":\n return typeof value === \"string\" ? 1 : 0;\n case \"number\":\n return typeof value === \"number\" ? 1 : 0;\n case \"boolean\":\n return typeof value === \"boolean\" ? 1 : 0;\n case \"literal\":\n return value === node.value ? 10 : 0;\n case \"enum\":\n return typeof value === \"string\" && node.values.includes(value) ? 10 : 0;\n case \"array\":\n return Array.isArray(value) ? 1 : 0;\n case \"object\": {\n if (typeof value !== \"object\" || Array.isArray(value)) return 0;\n const source = value as Record<string, unknown>;\n let total = 1;\n for (const [key, child] of Object.entries(node.shape)) {\n total += score(child, source[key]);\n }\n return total;\n }\n case \"union\":\n return node.members.reduce((best, member) => Math.max(best, score(member, value)), 0);\n // Matches, because it matches everything — but at the score of a plain\n // scalar, so a sibling variant that pinned its discriminant still wins the\n // blame.\n //\n // Reached only when no member parsed, which for a `json` member means the\n // value is not JSON at all: a function, a bigint, a cycle. Then this is\n // what makes the report name the reason the value was refused rather than\n // the discriminant of a variant the model was never aiming at.\n case \"json\":\n return 1;\n }\n}\n\n/** `drop` is a key that should not appear in the parsed object at all. */\ntype Reading = { drop: boolean; value: unknown };\n\nfunction read(definition: Definition, value: unknown, path: string, errors: string[]): Reading {\n // `optional` is checked before `nullable`, so a schema that is both treats\n // null as \"absent\". They are not distinguishable on the wire: strict mode\n // gives the model one spelling for \"nothing\", and pretending otherwise would\n // mean `.nullable().optional()` silently kept a key the type says is\n // optional. What that trades away is the ability to say \"present and null\" on\n // a field that may also be absent — a distinction no model can express here.\n if (definition.optional && (value === null || value === undefined)) {\n return { drop: true, value: undefined };\n }\n if (definition.nullable && value === null) return { drop: false, value: null };\n return { drop: false, value: readNode(definition, value, path, errors) };\n}\n\nfunction readNode(definition: Definition, value: unknown, path: string, errors: string[]): unknown {\n const node = definition.node;\n const fail = () => {\n errors.push(`${at(path)}expected ${wanted(definition)}, got ${saw(node, value)}`);\n return undefined;\n };\n\n switch (node.kind) {\n case \"string\":\n return typeof value === \"string\" ? value : fail();\n case \"number\":\n // NaN and Infinity do not survive `JSON.stringify`, so a tool that\n // returns one produces a body the provider cannot be sent.\n return typeof value === \"number\" && Number.isFinite(value) ? value : fail();\n case \"boolean\":\n return typeof value === \"boolean\" ? value : fail();\n case \"literal\":\n return value === node.value ? value : fail();\n case \"enum\":\n return typeof value === \"string\" && node.values.includes(value) ? value : fail();\n case \"array\": {\n if (!Array.isArray(value)) return fail();\n return value.map((item, index) => {\n const element = read(node.item, item, `${path}[${index}]`, errors);\n return element.drop ? undefined : element.value;\n });\n }\n case \"object\": {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return fail();\n const source = value as Record<string, unknown>;\n const output: Record<string, unknown> = {};\n for (const [key, child] of Object.entries(node.shape)) {\n const element = read(child, source[key], path ? `${path}.${key}` : key, errors);\n if (!element.drop) output[key] = element.value;\n }\n // Unknown keys are DROPPED, not rejected. `additionalProperties: false`\n // has already told the model not to send them, so one arriving anyway is\n // a slip rather than an attack, and failing a whole tool call over a\n // stray field costs a turn to fix nothing. Dropping is also what keeps\n // `execute` from ever seeing a field its input type says cannot be there.\n return output;\n }\n case \"union\": {\n let best: { errors: string[]; score: number } | undefined;\n for (const member of node.members) {\n const attempt: string[] = [];\n const element = read(member, value, path, attempt);\n if (attempt.length === 0) return element.drop ? undefined : element.value;\n const points = score(member, value);\n if (!best || points > best.score) best = { errors: attempt, score: points };\n }\n // \"no match\" is useless when one field of a five-field variant was wrong.\n // Naming the closest variant and why it stopped is the difference between\n // a debuggable bad tool call and a shrug.\n errors.push(`${at(path)}no matching variant; closest: ${best.errors.join(\"; \")}`);\n return undefined;\n }\n // Passed through by reference, not rebuilt. Two reasons beyond the obvious\n // one: a rebuild would turn a `Date` into `{}` by copying own properties\n // that a `toJSON` was going to replace anyway, and the agent loop signs the\n // *parsed* input and later verifies the signature against it — a parse that\n // is exactly the identity cannot disagree with itself.\n case \"json\":\n if (value === undefined) return fail();\n checkJson(value, path, errors, new Set());\n return value;\n }\n}\n\n/**\n * Checks that a value is JSON, which is the only check a `json()` node makes.\n *\n * Tool arguments arrive through `JSON.parse`, so this never fires on model\n * input. It fires on a tool *output* or a structured answer an app built, where\n * a `bigint` or a cycle throws inside `JSON.stringify` and a function or a\n * `symbol` is dropped without a word — one turn later, with the provider's\n * request body to debug instead of the value.\n *\n * `undefined` and non-plain objects are deliberately allowed below the root:\n * `JSON.stringify` drops an `undefined` property, writes `null` for an\n * `undefined` element, and calls `toJSON` where there is one. Those are JSON's\n * own answers, and rejecting a `Date` to catch a `Map` is a bad trade.\n *\n * `toJSON` is honoured rather than assumed harmless: the walk checks what it\n * returns and never the object behind it, because that is all `JSON.stringify`\n * will look at.\n */\nfunction checkJson(\n value: unknown,\n path: string,\n errors: string[],\n seen: Set<object>,\n // False for the value a `toJSON` just returned: `JSON.stringify` applies\n // `toJSON` once per position, and re-applying it is how a pair of them\n // returning each other became an infinite loop.\n applyToJSON = true,\n): void {\n const reject = (what: string) => {\n errors.push(`${at(path)}expected a JSON value, got ${what}`);\n };\n\n switch (typeof value) {\n case \"undefined\":\n case \"string\":\n case \"boolean\":\n return;\n case \"number\":\n if (!Number.isFinite(value)) reject(String(value));\n return;\n case \"bigint\":\n return reject(\"a bigint\");\n case \"function\":\n return reject(\"a function\");\n case \"symbol\":\n return reject(\"a symbol\");\n }\n\n if (value === null) return;\n const object = value as object;\n\n // The cycle guard comes FIRST, above `toJSON`, and that ordering is the whole\n // of it: a `toJSON` is arbitrary code that can hand back another object with a\n // `toJSON` of its own, so two of them returning each other is a cycle that\n // `seen` catches and an identity test cannot. Below the guard, that pair hung\n // `safeParse` forever — and a `toJSON` returning a fresh object each time threw\n // `RangeError` out of a function documented to return `{ ok: false, errors }`.\n if (seen.has(object)) return reject(\"a circular reference\");\n seen.add(object);\n try {\n // `JSON.stringify` asks `toJSON` what to write and never looks at the object\n // itself, so that answer is what has to be checked. Without this the walk\n // descended into the wrapper's own fields and refused values `stringify`\n // serializes without complaint — a `toJSON` returning a string off a `bigint`\n // field being the archetype, since writing a `toJSON` is exactly what one\n // does about a field JSON cannot carry. `Date` passed only by having no own\n // enumerable properties to trip over.\n const toJSON = applyToJSON ? (object as { toJSON?: unknown }).toJSON : undefined;\n if (typeof toJSON === \"function\") {\n let replaced: unknown;\n try {\n replaced = (toJSON as (key?: string) => unknown).call(object);\n } catch {\n return reject(\"a toJSON that threw\");\n }\n // `JSON.stringify` applies `toJSON` once per value position, not until it\n // stops changing, so the replacement is checked with it switched off here\n // — its nested values get their own.\n if (replaced === undefined) return reject(\"a toJSON that returns undefined\");\n return checkJson(replaced, path, errors, seen, false);\n }\n if (Array.isArray(value)) {\n value.forEach((item, index) => checkJson(item, `${path}[${index}]`, errors, seen));\n } else {\n for (const [key, child] of Object.entries(object)) {\n checkJson(child, path ? `${path}.${key}` : key, errors, seen);\n }\n }\n } finally {\n // Removed rather than left in: `seen` is the path currently being walked, and\n // keeping it would call the same object appearing twice side by side — which\n // `JSON.stringify` writes out twice quite happily — a cycle. In a `finally`\n // so the `toJSON` returns above cannot leave it marked.\n seen.delete(object);\n }\n}\n\n/**\n * The one cast in this file, and the reason it has to exist: `OUTPUT` and\n * `OPTIONAL` are `declare const` unique symbols. They have no runtime\n * counterpart — they are inference channels — so no object that can actually be\n * constructed satisfies `Schema<T>` structurally. Funnelling every builder\n * through here means the lie is told once, in one place, and everything else in\n * the module is checked against the real declarations.\n */\nfunction make<T>(definition: Definition): SchemaBuilder<T> {\n return build(definition) as unknown as SchemaBuilder<T>;\n}\n\n/**\n * Builders are immutable: `describe`, `optional` and `nullable` each build a\n * fresh one from a copied definition. Mutating in place is the obvious\n * implementation and it is wrong — `const id = s.string()` reused in two\n * objects, described in one of them, would carry that description into the\n * other, and the only symptom is a model being told the wrong thing about a\n * field somewhere else.\n */\nfunction build(definition: Definition): RuntimeSchema {\n const runtime: RuntimeSchema = {\n toJSONSchema: () => emit(definition),\n parse(value) {\n const errors: string[] = [];\n const result = read(definition, value, \"\", errors);\n if (errors.length > 0) throw new Error(errors.join(\"; \"));\n return result.drop ? undefined : result.value;\n },\n safeParse(value) {\n const errors: string[] = [];\n const result = read(definition, value, \"\", errors);\n if (errors.length > 0) return { ok: false, errors };\n return { ok: true, value: result.drop ? undefined : result.value };\n },\n describe: (description) => build({ ...definition, description }),\n optional: () => build({ ...definition, optional: true }),\n // Clearing `optional` is not tidiness. `nullable()` returns a\n // `SchemaBuilder`, not an `OptionalSchemaBuilder`, so the key it describes\n // is required again in `ShapeOutput` — and a parse that still dropped it\n // would hand back an object missing a key its own type declares.\n nullable: () => build({ ...definition, nullable: true, optional: false }),\n };\n definitions.set(runtime, definition);\n return runtime;\n}\n\nfunction leaf(node: SchemaNode): Definition {\n return { node, optional: false, nullable: false };\n}\n\nexport const s: {\n string(): SchemaBuilder<string>;\n number(): SchemaBuilder<number>;\n boolean(): SchemaBuilder<boolean>;\n literal<const L extends string | number | boolean>(value: L): SchemaBuilder<L>;\n /** Modelled as a JSON Schema `enum`, which strict mode does support. */\n enum<const L extends readonly [string, ...string[]]>(values: L): SchemaBuilder<L[number]>;\n object<const S extends Record<string, AnySchema>>(shape: S): SchemaBuilder<ShapeOutput<S>>;\n array<const S extends AnySchema>(item: S): SchemaBuilder<Infer<S>[]>;\n /**\n * `anyOf` of object schemas, discriminated by a literal member. Left in\n * because tool outputs are frequently a success/failure pair, and modelling\n * that as one object with everything optional is worse for the model.\n */\n union<const S extends readonly [AnySchema, AnySchema, ...AnySchema[]]>(\n members: S,\n ): SchemaBuilder<Infer<S[number]>>;\n /**\n * Any JSON value, constrained by nothing — for a format the rest of this\n * builder cannot describe: a record with arbitrary keys, a mixed-type tuple,\n * a document that nests into itself.\n *\n * A schema containing one cannot be sent under strict mode, so a tool whose\n * input uses it is sent with `strict: false` automatically. That is not an\n * option to pass anywhere; it is read back off the schema by\n * `supportsStrict`. The rest of the tool is unaffected, and so is streaming:\n * partial arguments are parsed from the raw text, never through a schema.\n *\n * `T` is an assertion, not a guarantee. The emitted schema constrains\n * nothing, so nothing checks the model's output against `T` — only that it is\n * JSON. Validate it in `execute` and hand the model back an error it can fix,\n * the way it would any other bad argument. `describe()` is where you tell it\n * the format; with no constraints to read, that prose is all it gets.\n *\n * TWO CALL SIGNATURES, NOT A DEFAULT TYPE PARAMETER, and that is load-bearing.\n * Written `json<T = JsonValue>()`, the default lost to the surrounding\n * contextual type in the position this is actually used: `s.object`'s shape is\n * constrained to `Record<string, AnySchema>` — `Schema<any>` — which supplies\n * `any` as an inference candidate, and a candidate beats a default. So\n * `s.object({ definition: s.json() })` inferred `{ definition: any }`, which is\n * type checking switched off around exactly the field this exists for, and the\n * opposite of what the default was written to prevent. An overload with no type\n * parameter has nothing to infer, so `s.json()` is `JsonValue` wherever it is\n * written.\n *\n * `ai:generate-client` maps it to the native `JSONValue` and says nothing about\n * it. `JsonValue` is a union of every JSON shape, so it used to reach the\n * generator's \"a union that is not told apart by one string member\" warning —\n * true, and a misdescription of a field that is free-form on purpose. The\n * extractor recognises it now.\n */\n json(): SchemaBuilder<JsonValue>;\n json<T>(): SchemaBuilder<T>;\n} = {\n string: () => make<string>(leaf({ kind: \"string\" })),\n number: () => make<number>(leaf({ kind: \"number\" })),\n boolean: () => make<boolean>(leaf({ kind: \"boolean\" })),\n literal: (value) => make<typeof value>(leaf({ kind: \"literal\", value })),\n enum: (values) => make<(typeof values)[number]>(leaf({ kind: \"enum\", values })),\n object: (shape) =>\n make<ShapeOutput<typeof shape>>(\n leaf({\n kind: \"object\",\n shape: Object.fromEntries(\n Object.entries(shape).map(([key, child]) => [key, definitionOf(child)]),\n ),\n }),\n ),\n array: (item) => make<Infer<typeof item>[]>(leaf({ kind: \"array\", item: definitionOf(item) })),\n // A union is legal wherever a property is, but not as the root of a\n // structured output: the provider wants an object there. That is the\n // provider's check to make, not this one's.\n union: (members) =>\n make<Infer<(typeof members)[number]>>(\n leaf({ kind: \"union\", members: members.map(definitionOf) }),\n ),\n json: <T>() => make<T>(leaf({ kind: \"json\" })),\n};\n\n/**\n * Whether a schema can be sent under a provider's strict mode.\n *\n * False exactly when a `json()` node is somewhere inside it. Strict mode's\n * bargain is that every node constrains its value; an unconstrained one has no\n * spelling there, and sending it anyway is a 400 naming a path.\n *\n * Derived from the tree rather than declared alongside it, because the two\n * would drift: a field added to a tool's input a year from now would need\n * whoever adds it to know that a flag somewhere else describes it. Adding the\n * field is the whole of turning strict off.\n */\nexport function supportsStrict(schema: AnySchema): boolean {\n const definition = definitions.get(schema);\n if (definition) return strictNode(definition.node);\n // A schema built by hand rather than with `s`: `questionSchema` in\n // `ai/Agent.ts`, and the merged one `services/mcp` casts together.\n //\n // Answering `true` here was wrong, and not harmlessly. `McpRegistry`'s\n // `combineSchemas` spreads `meta.input.toJSONSchema()` into its own object,\n // so an `s.json()` field an app declared on an `mcp` route survives into the\n // emitted schema while the *tree* that would have reported it is discarded.\n // Every MCP-projected tool was therefore sent `strict: true` with an empty\n // subschema inside it — a 400 on every turn, from the one path this function\n // exists to get right.\n //\n // So the emitted schema is read instead. It is the same question asked of the\n // artifact rather than the source, which is the only thing a foreign schema\n // has to offer.\n return strictJSONSchema(schema.toJSONSchema());\n}\n\n/**\n * Whether an already-emitted JSON Schema constrains every value it describes.\n *\n * Only for schemas with no definition tree. It answers a narrower question than\n * `strictNode` — it cannot see optionality or a builder's intent, just whether\n * some node says nothing about its value — but that is exactly the property\n * strict mode rejects, and it is visible in the artifact.\n */\nfunction strictJSONSchema(schema: JSONSchema): boolean {\n // `description` is prose, not a constraint. A node carrying only that — which\n // is what `s.json().describe(...)` emits — says nothing about its value.\n const constrained =\n schema.type !== undefined ||\n schema.enum !== undefined ||\n schema.const !== undefined ||\n schema.anyOf !== undefined ||\n schema.properties !== undefined ||\n schema.items !== undefined;\n if (!constrained) return false;\n\n for (const child of Object.values(schema.properties ?? {})) {\n if (!strictJSONSchema(child)) return false;\n }\n if (schema.items && !strictJSONSchema(schema.items)) return false;\n for (const member of schema.anyOf ?? []) {\n if (!strictJSONSchema(member)) return false;\n }\n return true;\n}\n\n/**\n * Enumerated rather than defaulted, so that a node kind added later cannot\n * inherit \"strict\" by omission — which is the failure that shows up as a 400\n * from the provider rather than as a type error here.\n *\n * Needs no cycle guard: a definition tree is built bottom-up out of finished\n * builders, so nothing in it can refer to something still being constructed.\n */\nfunction strictNode(node: SchemaNode): boolean {\n switch (node.kind) {\n case \"string\":\n case \"number\":\n case \"boolean\":\n case \"literal\":\n case \"enum\":\n return true;\n case \"object\":\n return Object.values(node.shape).every((child) => strictNode(child.node));\n case \"array\":\n return strictNode(node.item.node);\n case \"union\":\n return node.members.every((member) => strictNode(member.node));\n case \"json\":\n return false;\n }\n}\n"
6
+ ],
7
+ "mappings": ";AA6KA,IAAM,EAAc,IAAI,QAExB,SAAS,CAAY,CAAC,EAA+B,CACnD,IAAM,EAAa,EAAY,IAAI,CAAM,EACzC,GAAI,CAAC,EACH,MAAU,MAAM,iEAAiE,EAEnF,OAAO,EAKT,SAAS,CAAI,CAAC,EAAoC,CAIhD,IAAM,GAAS,EAAW,UAAY,EAAW,WAAa,EAAW,KAAK,OAAS,OACjF,EAAO,EAAU,EAAS,EAAW,IAAI,EAAG,CAAK,EACvD,OAAO,EAAW,YAAc,CA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