@runlith/tagma 0.0.0-stage → 0.1.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 (342) hide show
  1. package/adapter/claudeHooks.d.ts +10 -0
  2. package/adapter/claudeHooks.js +4 -0
  3. package/adapter/declaration.d.ts +14 -0
  4. package/adapter/declaration.js +2 -0
  5. package/adapter/harness.d.ts +454 -0
  6. package/adapter/harness.js +2 -0
  7. package/adapter/hook.d.ts +43 -0
  8. package/adapter/hook.js +2 -0
  9. package/adapter/hostModules.d.ts +19 -0
  10. package/adapter/hostModules.js +2 -0
  11. package/adapter/loader.d.ts +10 -0
  12. package/adapter/loader.js +2 -0
  13. package/adapter/metadata.d.ts +179 -0
  14. package/adapter/metadata.js +4 -0
  15. package/adapter/payload.d.ts +19 -0
  16. package/adapter/payload.js +3 -0
  17. package/adapter/provider.d.ts +209 -0
  18. package/adapter/provider.js +2 -0
  19. package/adapter/settings.d.ts +182 -0
  20. package/adapter/settings.js +2 -0
  21. package/adapter/speech.d.ts +4 -0
  22. package/adapter/speech.js +2 -0
  23. package/host.d.ts +61223 -0
  24. package/package.json +129 -3
  25. package/plugin/Held-6krt6ncs.js +6 -0
  26. package/plugin/accountKey-tdjj67f5.js +2 -0
  27. package/plugin/adapter-qdnpxs6n.js +1 -0
  28. package/plugin/anthropic-a4pdzrv2.js +2 -0
  29. package/plugin/anthropic-messages-7gtja121.js +2 -0
  30. package/plugin/anthropic-z9xqmm3q.js +2 -0
  31. package/plugin/auth-0w6kk39v.js +2 -0
  32. package/plugin/authStatus-a1g3eb9p.js +2 -0
  33. package/plugin/bundling.d.ts +30 -0
  34. package/plugin/bundling.js +2 -0
  35. package/plugin/cacheLifetime-c5mpw676.js +2 -0
  36. package/plugin/callback-server-0wrzmjfx.js +16 -0
  37. package/plugin/capabilities-n3vfpy41.js +2 -0
  38. package/plugin/claudeHooks-edpg1e46.js +3 -0
  39. package/plugin/cli.js +21 -0
  40. package/plugin/cliStore-9rhjxtht.js +2 -0
  41. package/plugin/clientSession-tmmxm39z.js +2 -0
  42. package/plugin/codec-aa8mxqyr.js +1 -0
  43. package/plugin/connect-vrdsw05j.js +2 -0
  44. package/plugin/contract-qn0z7r9c.js +1 -0
  45. package/plugin/credential-5sgapkh0.js +2 -0
  46. package/plugin/deepseek-fvdrmjr9.js +2 -0
  47. package/plugin/deepseek-v388d1wv.js +2 -0
  48. package/plugin/definition-s3xx207f.js +2 -0
  49. package/plugin/description-8xhxryaq.js +2 -0
  50. package/plugin/deviceGrant-vgbscpr4.js +2 -0
  51. package/plugin/devin-hy98d305.js +2 -0
  52. package/plugin/duplex-kpmftvf7.js +2 -0
  53. package/plugin/endpoint-kvf97tz7.js +2 -0
  54. package/plugin/errors-5t42p4q1.js +2 -0
  55. package/plugin/events-e8vv9hda.js +2 -0
  56. package/plugin/events-s95ybm4g.js +2 -0
  57. package/plugin/executor-q8kp5q8h.js +2 -0
  58. package/plugin/failure-vr32debc.js +2 -0
  59. package/plugin/framing-nktw5sts.js +2 -0
  60. package/plugin/grant-67b10nhx.js +2 -0
  61. package/plugin/harness-nrh78w4d.js +2 -0
  62. package/plugin/headers-ss3dzznj.js +2 -0
  63. package/plugin/hook-hjrk83m8.js +2 -0
  64. package/plugin/icon-044pa3y8.js +6 -0
  65. package/plugin/icon-j22svmgp.js +4 -0
  66. package/plugin/icon-ny6qbjvc.js +4 -0
  67. package/plugin/icon-pz54e8n3.js +4 -0
  68. package/plugin/icon-qy92jx2b.js +4 -0
  69. package/plugin/ids-n269hc5k.js +2 -0
  70. package/plugin/images-q80x3bt1.js +2 -0
  71. package/plugin/index-cyd7v366.js +2 -0
  72. package/plugin/index-jpmjpmkn.js +2 -0
  73. package/plugin/lifecycle-qf4fh5m8.js +2 -0
  74. package/plugin/manual-2mdscj84.js +2 -0
  75. package/plugin/messages-1szh3p3k.js +2 -0
  76. package/plugin/metadata-zm1v3ptf.js +4 -0
  77. package/plugin/muse-r16jp51z.js +2 -0
  78. package/plugin/muse-tfe6sph7.js +2 -0
  79. package/plugin/museToolSchema-tbe0f3wa.js +2 -0
  80. package/plugin/notes-6amdhm6h.js +2 -0
  81. package/plugin/object-9pjtdam7.js +2 -0
  82. package/plugin/open-browser-vqb7ckt1.js +2 -0
  83. package/plugin/openai-0z6fy497.js +2 -0
  84. package/plugin/openai-37dne8v0.js +2 -0
  85. package/plugin/openai-compatible-chat-tq9w69h4.js +2 -0
  86. package/plugin/openai-images-x1sj79qh.js +2 -0
  87. package/plugin/openai-responses-dka6k753.js +2 -0
  88. package/plugin/opencodeGo-173fz5c5.js +3 -0
  89. package/plugin/opencodeGo-qgw3pfg6.js +2 -0
  90. package/plugin/options-pxwjpfdk.js +2 -0
  91. package/plugin/payload-2gr4q9g8.js +2 -0
  92. package/plugin/pkce-nrpept7w.js +2 -0
  93. package/plugin/plugin-1n46me5n.js +6 -0
  94. package/plugin/plugin-1vpp5mqk.js +4 -0
  95. package/plugin/plugin-1x94cj6e.js +3 -0
  96. package/plugin/plugin-1xze8f5y.js +3 -0
  97. package/plugin/plugin-285exjxd.js +3 -0
  98. package/plugin/plugin-3b8x73y6.js +3 -0
  99. package/plugin/plugin-3pfrkxg1.js +3 -0
  100. package/plugin/plugin-3whwpedj.js +3 -0
  101. package/plugin/plugin-521srf94.js +3 -0
  102. package/plugin/plugin-55fbx586.js +3 -0
  103. package/plugin/plugin-5zq084fb.js +3 -0
  104. package/plugin/plugin-60bdzk1r.js +4 -0
  105. package/plugin/plugin-6a56xsx3.js +3 -0
  106. package/plugin/plugin-6xpcmvm3.js +36 -0
  107. package/plugin/plugin-72xxqm1t.js +3 -0
  108. package/plugin/plugin-7y7ndrk9.js +3 -0
  109. package/plugin/plugin-80gqwmjy.js +3 -0
  110. package/plugin/plugin-8230g28p.js +3 -0
  111. package/plugin/plugin-8jf7f360.js +3 -0
  112. package/plugin/plugin-92redty0.js +3 -0
  113. package/plugin/plugin-9gha9fx3.js +3 -0
  114. package/plugin/plugin-a4ng6krf.js +3 -0
  115. package/plugin/plugin-ak62rhwz.js +3 -0
  116. package/plugin/plugin-ay29ch70.js +3 -0
  117. package/plugin/plugin-ba1sv0th.js +3 -0
  118. package/plugin/plugin-ca4vf4j5.js +3 -0
  119. package/plugin/plugin-cydz2zhy.js +3 -0
  120. package/plugin/plugin-d6hbav22.js +3 -0
  121. package/plugin/plugin-e2y95zm5.js +3 -0
  122. package/plugin/plugin-ff38dxy1.js +3 -0
  123. package/plugin/plugin-ff9hx5a4.js +3 -0
  124. package/plugin/plugin-fhc5q7r3.js +3 -0
  125. package/plugin/plugin-frrvs5yc.js +3 -0
  126. package/plugin/plugin-g65b14k1.js +3 -0
  127. package/plugin/plugin-gh857xdd.js +3 -0
  128. package/plugin/plugin-gkgs7vfv.js +3 -0
  129. package/plugin/plugin-h66k1zhn.js +14 -0
  130. package/plugin/plugin-je5cfnqn.js +3 -0
  131. package/plugin/plugin-jjm52353.js +3 -0
  132. package/plugin/plugin-jxvmq18y.js +3 -0
  133. package/plugin/plugin-kc4z9msd.js +3 -0
  134. package/plugin/plugin-kjtzm2q6.js +3 -0
  135. package/plugin/plugin-krbbb4ts.js +3 -0
  136. package/plugin/plugin-me00x60n.js +3 -0
  137. package/plugin/plugin-mqr325kz.js +3 -0
  138. package/plugin/plugin-njh1f7b2.js +5 -0
  139. package/plugin/plugin-nkb5bb2q.js +3 -0
  140. package/plugin/plugin-nqmb78ez.js +4 -0
  141. package/plugin/plugin-nzacjxf9.js +3 -0
  142. package/plugin/plugin-p59gy5xd.js +3 -0
  143. package/plugin/plugin-pfj9nc2e.js +3 -0
  144. package/plugin/plugin-pkxw1pfs.js +3 -0
  145. package/plugin/plugin-q1n5kwx0.js +3 -0
  146. package/plugin/plugin-q1sqj2tc.js +3 -0
  147. package/plugin/plugin-q7rk75bs.js +3 -0
  148. package/plugin/plugin-qpda63gv.js +3 -0
  149. package/plugin/plugin-rrgyjesv.js +3 -0
  150. package/plugin/plugin-sfdxgkds.js +3 -0
  151. package/plugin/plugin-v7k9fx92.js +3 -0
  152. package/plugin/plugin-vfjhxng8.js +3 -0
  153. package/plugin/plugin-vv72e4ah.js +3 -0
  154. package/plugin/plugin-w8f977my.js +3 -0
  155. package/plugin/plugin-xbnw80pk.js +3 -0
  156. package/plugin/plugin-yxgg03s0.js +5 -0
  157. package/plugin/plugin-z6hkd9rw.js +3 -0
  158. package/plugin/plugin-zew2m18x.js +3 -0
  159. package/plugin/plugin-zphe2a5v.js +9 -0
  160. package/plugin/plugin-zvyk8bnr.js +3 -0
  161. package/plugin/plugin-zw3ywa4b.js +3 -0
  162. package/plugin/plugin-zxe49p72.js +3 -0
  163. package/plugin/plugin-zz7yc97m.js +3 -0
  164. package/plugin/plugin.d.ts +175 -0
  165. package/plugin/plugin.js +2 -0
  166. package/plugin/points.generated.d.ts +341 -0
  167. package/plugin/points.generated.js +2 -0
  168. package/plugin/process.d.ts +4 -0
  169. package/plugin/process.js +85 -0
  170. package/plugin/protocol-hwnfh4h1.js +2 -0
  171. package/plugin/protocol.d.ts +115 -0
  172. package/plugin/protocol.js +2 -0
  173. package/plugin/provider-0b7xxyhn.js +2 -0
  174. package/plugin/quota-vrrmfag6.js +2 -0
  175. package/plugin/quotaRead-vj6e90xc.js +2 -0
  176. package/plugin/reasoning-5nanktp2.js +2 -0
  177. package/plugin/record-1m3vvy60.js +2 -0
  178. package/plugin/requests-2zyr1g8e.js +1 -0
  179. package/plugin/responseFold-w4526gvb.js +2 -0
  180. package/plugin/settings-vdypzert.js +2 -0
  181. package/plugin/shared-a2yyy8ry.js +2 -0
  182. package/plugin/speech-067caz1a.js +2 -0
  183. package/plugin/stepfun-3en5g41d.js +2 -0
  184. package/plugin/stepfun-bwsz4nrd.js +2 -0
  185. package/plugin/stream-bt8etfpc.js +2 -0
  186. package/plugin/svelteProgram-73v9yajk.js +2 -0
  187. package/plugin/synthesisDuplex-m2j6pmyv.js +2 -0
  188. package/plugin/template.d.ts +14 -0
  189. package/plugin/template.js +2 -0
  190. package/plugin/testing.d.ts +85 -0
  191. package/plugin/testing.js +4 -0
  192. package/plugin/tool-content-b9jtprr7.js +2 -0
  193. package/plugin/tool-stream-gdajdxn0.js +2 -0
  194. package/plugin/transport-7hfp9sn4.js +2 -0
  195. package/plugin/ui.generated.d.ts +1044 -0
  196. package/plugin/value.d.ts +8 -0
  197. package/plugin/value.js +2 -0
  198. package/plugin/vendor-pn6b5a8f.js +2 -0
  199. package/plugin/vendorCall-6n5chrn0.js +2 -0
  200. package/plugin/vendorCall-hv01nwsp.js +2 -0
  201. package/plugin/vendorPayload-awxqr7t8.js +2 -0
  202. package/plugin/vendorWeb-vnf344r1.js +2 -0
  203. package/plugin/verbatim-mqt9x4aa.js +2 -0
  204. package/plugin/xai-e8sbtk6a.js +2 -0
  205. package/plugin/xai-z1ysta23.js +2 -0
  206. package/rules/effect.d.ts +55 -0
  207. package/rules/effect.js +11 -0
  208. package/rules/rules.d.ts +342 -0
  209. package/rules/rules.js +50 -0
  210. package/types/node/assert/strict.d.ts +12 -0
  211. package/types/node/assert.d.ts +76 -0
  212. package/types/node/async_hooks.d.ts +113 -0
  213. package/types/node/buffer.buffer.d.ts +29 -0
  214. package/types/node/buffer.d.ts +162 -0
  215. package/types/node/child_process.d.ts +337 -0
  216. package/types/node/cluster.d.ts +118 -0
  217. package/types/node/compatibility/iterators.d.ts +11 -0
  218. package/types/node/console.d.ts +48 -0
  219. package/types/node/constants.d.ts +8 -0
  220. package/types/node/crypto.d.ts +847 -0
  221. package/types/node/dgram.d.ts +88 -0
  222. package/types/node/diagnostics_channel.d.ts +61 -0
  223. package/types/node/dns/promises.d.ts +94 -0
  224. package/types/node/dns.d.ts +276 -0
  225. package/types/node/domain.d.ts +17 -0
  226. package/types/node/events.d.ts +138 -0
  227. package/types/node/fs/promises.d.ts +253 -0
  228. package/types/node/fs.d.ts +1038 -0
  229. package/types/node/globals.d.ts +73 -0
  230. package/types/node/globals.typedarray.d.ts +22 -0
  231. package/types/node/http.d.ts +530 -0
  232. package/types/node/http2.d.ts +794 -0
  233. package/types/node/https.d.ts +66 -0
  234. package/types/node/index.d.ts +84 -0
  235. package/types/node/inspector/promises.d.ts +13 -0
  236. package/types/node/inspector.d.ts +61 -0
  237. package/types/node/inspector.generated.d.ts +1624 -0
  238. package/types/node/module.d.ts +187 -0
  239. package/types/node/net.d.ts +266 -0
  240. package/types/node/os.d.ts +236 -0
  241. package/types/node/path/posix.d.ts +8 -0
  242. package/types/node/path/win32.d.ts +8 -0
  243. package/types/node/path.d.ts +40 -0
  244. package/types/node/perf_hooks.d.ts +236 -0
  245. package/types/node/process.d.ts +436 -0
  246. package/types/node/punycode.d.ts +15 -0
  247. package/types/node/querystring.d.ts +22 -0
  248. package/types/node/quic.d.ts +203 -0
  249. package/types/node/readline/promises.d.ts +28 -0
  250. package/types/node/readline.d.ts +94 -0
  251. package/types/node/repl.d.ts +104 -0
  252. package/types/node/sea.d.ts +11 -0
  253. package/types/node/sqlite.d.ts +183 -0
  254. package/types/node/stream/consumers.d.ts +13 -0
  255. package/types/node/stream/iter.d.ts +240 -0
  256. package/types/node/stream/promises.d.ts +37 -0
  257. package/types/node/stream/web.d.ts +297 -0
  258. package/types/node/stream.d.ts +378 -0
  259. package/types/node/string_decoder.d.ts +10 -0
  260. package/types/node/test/reporters.d.ts +66 -0
  261. package/types/node/test.d.ts +462 -0
  262. package/types/node/timers/promises.d.ts +16 -0
  263. package/types/node/timers.d.ts +43 -0
  264. package/types/node/tls.d.ts +279 -0
  265. package/types/node/trace_events.d.ts +16 -0
  266. package/types/node/ts5.6/buffer.buffer.d.ts +26 -0
  267. package/types/node/ts5.6/compatibility/float16array.d.ts +43 -0
  268. package/types/node/ts5.6/globals.typedarray.d.ts +22 -0
  269. package/types/node/ts5.6/index.d.ts +84 -0
  270. package/types/node/ts5.7/compatibility/float16array.d.ts +50 -0
  271. package/types/node/ts5.7/index.d.ts +84 -0
  272. package/types/node/tty.d.ts +61 -0
  273. package/types/node/url.d.ts +165 -0
  274. package/types/node/util/types.d.ts +49 -0
  275. package/types/node/util.d.ts +320 -0
  276. package/types/node/v8.d.ts +178 -0
  277. package/types/node/vm.d.ts +130 -0
  278. package/types/node/wasi.d.ts +26 -0
  279. package/types/node/web-globals/abortcontroller.d.ts +47 -0
  280. package/types/node/web-globals/blob.d.ts +34 -0
  281. package/types/node/web-globals/console.d.ts +7 -0
  282. package/types/node/web-globals/crypto.d.ts +46 -0
  283. package/types/node/web-globals/domexception.d.ts +74 -0
  284. package/types/node/web-globals/encoding.d.ts +16 -0
  285. package/types/node/web-globals/events.d.ts +111 -0
  286. package/types/node/web-globals/fetch.d.ts +121 -0
  287. package/types/node/web-globals/importmeta.d.ts +11 -0
  288. package/types/node/web-globals/messaging.d.ts +32 -0
  289. package/types/node/web-globals/navigator.d.ts +28 -0
  290. package/types/node/web-globals/performance.d.ts +71 -0
  291. package/types/node/web-globals/storage.d.ts +26 -0
  292. package/types/node/web-globals/streams.d.ts +162 -0
  293. package/types/node/web-globals/timers.d.ts +22 -0
  294. package/types/node/web-globals/url.d.ts +27 -0
  295. package/types/node/worker_threads.d.ts +199 -0
  296. package/types/node/zlib/iter.d.ts +49 -0
  297. package/types/node/zlib.d.ts +360 -0
  298. package/types/undici/agent.d.ts +24 -0
  299. package/types/undici/api.d.ts +19 -0
  300. package/types/undici/balanced-pool.d.ts +16 -0
  301. package/types/undici/cache-interceptor.d.ts +98 -0
  302. package/types/undici/cache.d.ts +30 -0
  303. package/types/undici/client-stats.d.ts +9 -0
  304. package/types/undici/client.d.ts +61 -0
  305. package/types/undici/connector.d.ts +37 -0
  306. package/types/undici/content-type.d.ts +9 -0
  307. package/types/undici/cookies.d.ts +22 -0
  308. package/types/undici/diagnostics-channel.d.ts +72 -0
  309. package/types/undici/dispatcher.d.ts +207 -0
  310. package/types/undici/env-http-proxy-agent.d.ts +15 -0
  311. package/types/undici/errors.d.ts +117 -0
  312. package/types/undici/eventsource.d.ts +39 -0
  313. package/types/undici/fetch.d.ts +122 -0
  314. package/types/undici/formdata.d.ts +24 -0
  315. package/types/undici/global-dispatcher.d.ts +4 -0
  316. package/types/undici/global-origin.d.ts +3 -0
  317. package/types/undici/h2c-client.d.ts +35 -0
  318. package/types/undici/handlers.d.ts +7 -0
  319. package/types/undici/header.d.ts +10 -0
  320. package/types/undici/index.d.ts +85 -0
  321. package/types/undici/interceptors.d.ts +70 -0
  322. package/types/undici/mock-agent.d.ts +43 -0
  323. package/types/undici/mock-call-history.d.ts +57 -0
  324. package/types/undici/mock-client.d.ts +17 -0
  325. package/types/undici/mock-errors.d.ts +9 -0
  326. package/types/undici/mock-interceptor.d.ts +60 -0
  327. package/types/undici/mock-pool.d.ts +17 -0
  328. package/types/undici/patch.d.ts +21 -0
  329. package/types/undici/pool-stats.d.ts +11 -0
  330. package/types/undici/pool.d.ts +25 -0
  331. package/types/undici/proxy-agent.d.ts +22 -0
  332. package/types/undici/readable.d.ts +24 -0
  333. package/types/undici/retry-agent.d.ts +6 -0
  334. package/types/undici/retry-handler.d.ts +41 -0
  335. package/types/undici/round-robin-pool.d.ts +25 -0
  336. package/types/undici/snapshot-agent.d.ts +98 -0
  337. package/types/undici/socks5-proxy-agent.d.ts +17 -0
  338. package/types/undici/util.d.ts +4 -0
  339. package/types/undici/utility.d.ts +2 -0
  340. package/types/undici/webidl.d.ts +121 -0
  341. package/types/undici/websocket.d.ts +130 -0
  342. package/README.md +0 -3
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Tg}from"./plugin-6a56xsx3.js";import{kg,Ft}from"./plugin-cydz2zhy.js";var My="dist/process.js",jf=(t)=>({id:t.id,title:t.title,description:t.description,process:t.process===null?void 0:{entry:My,resident:t.process.resident||void 0},options:t.options,mcpServers:t.mcpServers,contributes:t.contributes});class $a extends Error{constructor(t){super(t);this.name="PluginInvalid"}}var N=/^[a-zA-Z0-9_-]+$/u,A=/^(\d+(?:\.\d+)?)(s|m|h|d)$/u,x={s:1000,m:60000,h:3600000,d:86400000},H={type:"object"},a=(t,e)=>{if(!N.test(e))throw new $a(`the ${t} ${JSON.stringify(e)} is named with letters, digits, _ and - only`);return e},B=(t,e)=>{if(typeof e==="number")return e;let o=A.exec(e);if(o===null)throw new $a(`the schedule ${t} runs every ${JSON.stringify(e)}: give milliseconds or a number with s, m, h or d`);return Math.round(Number(o[1])*x[o[2]])},C=(t,e)=>{if(e===void 0)return{type:"object",properties:{},additionalProperties:!1};let{$schema:o,...s}=e["~standard"].jsonSchema.input({target:"draft-2020-12"});if(s.type!=="object")throw new $a(`the input of the tool ${t} is not an object schema`);return{...s,type:"object"}},F=(t,e)=>{if(a("tool",t).startsWith(kg))throw new $a(`the tool ${t} starts with ${kg}, which names the SDK's own tools`);let o={title:e.title,readOnlyHint:e.readOnly,destructiveHint:e.destructive,idempotentHint:e.idempotent,openWorldHint:e.openWorld};return{name:t,audience:e.audience,description:e.description,inputSchema:C(t,e.input),annotations:Object.values(o).some((s)=>s!==void 0)?o:void 0}},u=(t,e)=>({name:t,audience:"tagma",description:e,inputSchema:H}),g={tools:"tools",schedule:"schedules",beforeBuild:"beforeBuild",on:"onThreadEnded",notify:"onNotification",actions:"actions",hooks:"hooks",views:"views"},k=new Set(Object.keys(g)),L={id:!0,title:!0,description:!0,resident:!0,options:!0,mcpServers:!0,providers:!0,tools:!0,resources:!0,views:!0,schedules:!0,beforeBuild:!0,actions:!0,hooks:!0,onThreadEnded:!0,onThreadAsked:!0,onNotification:!0},m=[...Object.keys(L),...Tg.filter((t)=>!k.has(t))],W=(t,e)=>{let o=Array.from({length:e.length+1},(s,r)=>r);for(let s=1;s<=t.length;s+=1){let r=[s];for(let l=1;l<=e.length;l+=1)r.push(Math.min(o[l]+1,r[l-1]+1,o[l-1]+(t[s-1]===e[l-1]?0:1)));o=r}return o[e.length]},U=(t)=>{if(Object.hasOwn(g,t))return g[t];let[e]=m.map((o)=>({known:o,apart:W(t.toLowerCase(),o.toLowerCase())})).filter(({apart:o})=>o<=2).sort((o,s)=>o.apart-s.apart);return e?.known},Y=(t)=>{let e=Object.keys(t).filter((s)=>!m.includes(s));if(e.length===0)return;let o=e.map((s)=>{let r=U(s);return r===void 0?s:`${s} (write ${r})`});throw new $a(`definePlugin takes no field ${o.join(", ")}; its fields are ${m.join(", ")}`)},I=(t)=>Object.fromEntries(Tg.flatMap((e)=>{let o=t[e];return k.has(e)||o===void 0?[]:[[e,o]]})),qf=(t)=>{Y(t);let{id:e,title:o,description:s,options:r,mcpServers:l,resident:v,resources:j,views:O,schedules:S,beforeBuild:T,actions:D,hooks:R,onThreadEnded:y,onThreadAsked:P,onNotification:b}=t,w={...y===void 0?{}:{ended:Ft.ended},...P===void 0?{}:{asked:Ft.asked}},d=Object.entries(S??{}).map(([n,i])=>({name:a("schedule",n),everyMs:B(n,i.every),tool:Ft.schedule(n)})),p=Object.entries(T??{}).map(([n,i])=>({tool:Ft.build(a("build step",n)),title:i.title})),h=Object.entries(D??{}).map(([n,i])=>({id:a("action",n),title:i.title,tool:Ft.action(n)})),f=Object.entries(R??{}).map(([n,i])=>({at:i.at,match:i.match,tool:Ft.hook(a("hook",n)),onFailure:i.onFailure,timeoutMs:i.timeoutMs})),c=[...Object.entries(t.tools??{}).map(([n,i])=>F(n,i)),...d.map((n)=>u(n.tool,`Runs the schedule ${n.name}.`)),...p.map((n)=>u(n.tool,`Runs the build step ${n.title}.`)),...h.map((n)=>u(n.tool,`Runs the action ${n.title}.`)),...f.map((n)=>u(n.tool,`Checks Tagma\u2019s agent at ${n.at}.`)),...y===void 0?[]:[u(Ft.ended,"Receives the end of a turn of a thread bound to this plugin.")],...P===void 0?[]:[u(Ft.asked,"Takes a question of a thread bound to this plugin.")],...b===void 0?[]:[u(Ft.notification,"Receives the answer to a notification this plugin sent.")]];for(let n of Object.keys(l??{}))if(a("MCP server",n)==="in")throw new $a("the MCP server in is named as servers.in, which reaches another project");let E=Object.entries(O??{}).map(([n,i])=>({id:n,entry:i.entry,live:i.live})),_=c.length>0||Object.keys(j??{}).length>0,M={...I(t),...c.length===0?{}:{tools:c},...E.length===0?{}:{views:E},...d.length===0?{}:{schedule:d},...p.length===0?{}:{beforeBuild:p},...h.length===0?{}:{actions:h},...f.length===0?{}:{hooks:f},...Object.keys(w).length===0?{}:{on:w},...b===void 0?{}:{notify:{tool:Ft.notification}}};return{id:e,title:o,description:s,options:r,mcpServers:l,process:_?{resident:v??!1}:null,tools:c,contributes:M}};
3
+ export{My,jf,$a,qf};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{od,Vi}from"./plugin-72xxqm1t.js";import{mc,de}from"./plugin-7y7ndrk9.js";import{Su,Et,xt}from"./plugin-1n46me5n.js";import{ny}from"./plugin-1x94cj6e.js";import{oe,Dc,Mt,d,y,pr,f,c,Ze,s,Te,dt,v,ee,bl,El,ks,rc,vo,Qn,Fi,Ot,un}from"./plugin-6xpcmvm3.js";class xf extends oe()("@runlith/llm/WebSocketTransport"){}var g=(e,r,o)=>new de({module:"WebSocketExecutor",method:e,reason:new mc({message:r,kind:o.kind,host:o.url!==void 0&&URL.canParse(o.url)?new URL(o.url).host:void 0,cause:Su(o.cause)})}),S=(e)=>{if("message"in e&&typeof e.message==="string")return e.message;return e.type},m=(e)=>{if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return},h=(e,r)=>{if(e.readyState===globalThis.WebSocket.OPEN)return y;if(e.readyState===globalThis.WebSocket.CLOSING||e.readyState===globalThis.WebSocket.CLOSED)return c(g("open",`WebSocket closed before opening (state ${e.readyState})`,{url:r.url,kind:"reset"}));return pr((o,i)=>{let a=()=>{e.removeEventListener("open",u),e.removeEventListener("error",t),e.removeEventListener("close",n),i.removeEventListener("abort",l)},l=()=>{if(a(),e.readyState!==globalThis.WebSocket.CLOSED&&e.readyState!==globalThis.WebSocket.CLOSING)e.close(1000)},u=()=>{a(),o(y)},t=(p)=>{a(),o(c(g("open",`Failed to open WebSocket: ${S(p)}`,{url:r.url,kind:"unknown"})))},n=(p)=>{a(),o(c(g("open",`WebSocket closed before opening with code ${p.code}`,{url:r.url,kind:"reset"})))};e.addEventListener("open",u,{once:!0}),e.addEventListener("error",t,{once:!0}),e.addEventListener("close",n,{once:!0}),i.addEventListener("abort",l,{once:!0})})},k=(e)=>Ze({try:()=>{let r=new URL(e);if(r.protocol==="https:")return r.protocol="wss:",r.toString();if(r.protocol==="http:")return r.protocol="ws:",r.toString();throw Error(`Unsupported WebSocket URL protocol ${r.protocol}`)},catch:(r)=>xt(r instanceof Error?r.message:`A WebSocket deployment cannot be reached at ${e}`)}),E=(e)=>Ze({try:()=>new globalThis.WebSocket(e.url,{headers:e.headers}),catch:(r)=>g("open",r instanceof Error?r.message:"Failed to construct WebSocket",{url:e.url,kind:"unknown",cause:r})}).pipe(s((r)=>L(r,e))),A=Mt(xf,xf.of({open:E})),L=ee("WebSocket.connect")(function*(e,r){yield*h(e,r);let o=yield*bl(128),i=(t)=>{if(typeof t.data==="string")return El(o,t.data);let n=m(t.data);if(n)return El(o,n);ks(o,Dc(Et(void 0,{module:"WebSocketExecutor",method:"message",route:r.url,message:"The peer sent a message payload this transport cannot read",family:"invalid-output"})))},a=(t)=>{ks(o,Dc(Et(void 0,{module:"WebSocketExecutor",method:"message",route:r.url,message:`The socket errored: ${S(t)}`,family:"socket-closed"})))},l=(t)=>{if(t.code===1000||t.code===1005)return rc(o);ks(o,Dc(Et(void 0,{module:"WebSocketExecutor",method:"message",route:r.url,message:`The peer closed the socket with code ${t.code}`,family:"socket-closed",excerpt:t.reason===""?void 0:t.reason})))},u=d(()=>{e.removeEventListener("message",i),e.removeEventListener("error",a),e.removeEventListener("close",l)}).pipe(Te(vo(o)));return e.addEventListener("message",i),e.addEventListener("error",a),e.addEventListener("close",l),{sendText:(t)=>Ze({try:()=>e.send(t),catch:(n)=>g("sendText",n instanceof Error?n.message:"Failed to send WebSocket message",{url:r.url,kind:"reset",cause:n})}),messages:Fi(o),close:u.pipe(Te(d(()=>{if(e.readyState===globalThis.WebSocket.CLOSED||e.readyState===globalThis.WebSocket.CLOSING)return;e.close(1000)})))}}),W=(e,r)=>typeof e==="string"?e:r.decode(e),b=(e)=>({id:"websocket-json",with:(r)=>b({...e,...r}),prepare:v(function*(r){let o=yield*ny({...r});return{url:yield*k(o.url),headers:o.headers,message:e.encodeMessage(yield*e.toMessage(o.jsonBody))}}),frames:(r,o,i,a,l)=>{let u=i.webSocket;if(!u)return Qn(xt("A WebSocket JSON transport requires the WebSocketTransport service"));let t=new TextDecoder;return Ot(f(function*(){l.secrets=new Set([...Vi(Object.entries(r.headers)),...Vi(new URL(r.url).searchParams,od)]);let n=yield*dt(u.open({url:r.url,headers:r.headers}),(p)=>p.close);return yield*n.sendText(r.message),n.messages.pipe(un((p)=>W(p,t)))}))}}),XE={id:"websocket-json",with:b};
3
+ export{xf,XE};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{F}from"./plugin-6xpcmvm3.js";class ur extends F("SpeechFailure"){static auth(e){return new ur({reason:"auth",message:e,retryable:!1})}static rate(e,r){return new ur({reason:"rate",message:e,retryable:!0,retryAfterMs:r})}static invalidRequest(e){return new ur({reason:"invalid-request",message:e,retryable:!1})}static transport(e){return new ur({reason:"transport",message:e,retryable:!0})}static provider(e,r){return new ur({reason:"provider",message:e,retryable:r})}static unsupported(e){return new ur({reason:"unsupported",message:e,retryable:!1})}static unconfirmedTail(e){return new ur({reason:"unconfirmed-tail",message:e,retryable:!1})}}class Xd extends F("Overflow"){}
3
+ export{ur,Xd};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{di}from"./plugin-9gha9fx3.js";var uf="anthropic",Qw="claude-code",UE="claude-opus-5-5",zE={model:"claude-haiku-5-5",rung:"low"},o=300,Yw={bytes:33554432,media:100},jg={[UE]:{label:"Opus 5.5",short:"Opus",toolChoice:["auto","none"],capacity:{context:1e6,output:128000},capabilities:["text","vision"],reasoning:["low","medium","high","xhigh","max"],defaultReasoning:"medium",supportsAdaptiveThinking:!0},"claude-fable-5-1":{label:"Fable 5.1",short:"Fable",toolChoice:["auto","none"],capacity:{context:1e6,output:128000},capabilities:["text","vision"],reasoning:["low","medium","high","xhigh","max"],defaultReasoning:"xhigh",supportsAdaptiveThinking:!0,operatorOnly:!0},"claude-sonnet-5-5":{label:"Sonnet 5.5",short:"Sonnet",toolChoice:["auto","none"],capacity:{context:1e6,output:128000},capabilities:["text","vision"],reasoning:["low","medium","high","xhigh","max"],defaultReasoning:"high",supportsAdaptiveThinking:!0},"claude-haiku-5-5":{label:"Haiku 5.5",short:"Haiku",capacity:{context:1e6,output:128000,premiumAbove:1e5},capabilities:["text","vision"],reasoning:["low","medium","high","xhigh","max"],defaultReasoning:"medium",supportsAdaptiveThinking:!0},"claude-opus-5":{label:"Opus 5",short:"Opus",capacity:{context:1e6,output:128000},capabilities:["text","vision"],reasoning:["low","medium","high","xhigh","max"],defaultReasoning:"high",supportsAdaptiveThinking:!0},"claude-sonnet-5":{label:"Sonnet 5",short:"Sonnet",capacity:{context:1e6,output:128000},capabilities:["text","vision"],reasoning:["low","medium","high","xhigh","max"],defaultReasoning:"high",supportsAdaptiveThinking:!0},"claude-opus-4-8":{label:"Opus 4.8",short:"Opus",capacity:{context:1e6,output:128000},capabilities:["text","vision"],reasoning:["low","medium","high","xhigh","max"],defaultReasoning:"high",supportsAdaptiveThinking:!0},"claude-fable-5":{label:"Fable 5",short:"Fable",capacity:{context:1e6,output:128000},capabilities:["text","vision"],reasoning:["low","medium","high","xhigh","max"],defaultReasoning:"high",supportsAdaptiveThinking:!0,operatorOnly:!0},"claude-opus-4-7":{label:"Opus 4.7",short:"Opus",capacity:{context:1e6,output:128000},capabilities:["text","vision"],reasoning:["low","medium","high","xhigh","max"],defaultReasoning:"high",supportsAdaptiveThinking:!0},"claude-sonnet-4-6":{label:"Sonnet 4.6",short:"Sonnet",capacity:{context:1e6,output:64000},capabilities:["text","vision"],reasoning:["low","medium","high","max"],defaultReasoning:"high",supportsAdaptiveThinking:!0},"claude-opus-4-6":{label:"Opus 4.6",short:"Opus",capacity:{context:1e6,output:128000},capabilities:["text","vision"],reasoning:["low","medium","high","max"],defaultReasoning:"high",supportsAdaptiveThinking:!0},"claude-opus-4-5":{label:"Opus 4.5",short:"Opus",capacity:{context:200000,output:64000},capabilities:["text","vision"],reasoning:["low","medium","high"],defaultReasoning:"high"},"claude-haiku-4-5":{label:"Haiku 4.5",short:"Haiku",capacity:{context:200000,output:64000},capabilities:["text","vision"],reasoning:[],defaultReasoning:null}},t="facts, file reading, mechanical edits, research",HE=[{model:"claude-opus-5-5",reasoning:"medium",open:7,depth:6,taste:8,ui:8,spend:5},{model:"claude-opus-5-5",reasoning:"high",open:8,depth:8,taste:9,ui:9,spend:7},{model:"claude-opus-5-5",reasoning:"xhigh",open:9,depth:9,taste:10,ui:10,spend:10},{model:"claude-sonnet-5-5",reasoning:"high",open:6,depth:7,taste:8,ui:7,spend:4},{model:"claude-haiku-5-5",reasoning:"xhigh",open:4,depth:5,taste:6,ui:6,spend:2,note:t},{model:"claude-haiku-5-5",reasoning:"max",open:4,depth:6,taste:6,ui:6,spend:3,note:t},{model:"claude-fable-5-1",reasoning:"high",open:10,depth:10,taste:10,ui:10,spend:10,operatorOnly:!0}],fm={id:uf,label:"Anthropic",auth:"api-key",models:jg,cacheLifetime:{promisedSeconds:o,prior:null,reasoningKeyed:!0},requestLimits:Yw,defaultTextModel:UE,spawnTextModel:"claude-opus-5-5",lightTextModel:zE,team:HE},Xw=[{id:"reasoningDisplay",label:"Thinking summary",description:"Return a summary of the model\u2019s reasoning alongside its answer",values:[{id:"omitted",label:"Summary hidden"},{id:"summarized",label:"Summary shown"}],default:"summarized"}],qg="claude-opus-5-5",i=[qg,"claude-opus-5","claude-fable-5-1","claude-sonnet-5-5","claude-sonnet-5","claude-haiku-5-5","claude-haiku-4-5"],ek={id:Qw,label:"Claude",auth:"cli",models:di(jg,{ids:i,overrides:Object.fromEntries(i.filter((e)=>jg[e]?.supportsAdaptiveThinking===!0).map((e)=>[e,{switches:Xw}]))}),cacheLifetime:{promisedSeconds:null,prior:null},defaultTextModel:qg,spawnTextModel:qg,lightTextModel:zE,team:HE},V_={providers:[fm,ek]};
3
+ export{uf,Qw,UE,zE,Yw,jg,HE,fm,Xw,qg,ek,V_};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Xn,Jg,ka,uc,gf,yf,Kg}from"./plugin-zew2m18x.js";import{Gg,Fl}from"./plugin-qpda63gv.js";import{Ne,ze,d,pr,f,c,Ze,en,Wa,v,ee,n,t,o}from"./plugin-6xpcmvm3.js";function aT(e,r){return{accessToken:e.accessToken,refreshToken:e.refreshToken,expiresAt:e.expiresAt,scope:e.scope||r?.scope||""}}var ik="urn:ietf:params:oauth:grant-type:device_code",m=5000,g=1000,ak=5000,k=300000,G=3000,D=o({access_token:n(t),refresh_token:n(t),id_token:n(t),expires_in:gf,scope:n(t)}),x=o({device_code:n(t),user_code:n(t),verification_uri:n(t),verification_uri_complete:n(t),expires_in:gf,interval:gf}),_=ee("DeviceGrant.postForm")(function*(e,r,i){return yield*Jg(f(function*(){let s=yield*Gg(r,e.headers(),new URLSearchParams(i).toString());return{response:s,text:s.text}}),`${e.label} token exchange`)}),km=ee("DeviceGrant.begin")(function*(e){let r={client_id:e.clientId,...e.scope?{scope:e.scope}:{}},{response:i,text:s}=yield*_(e,e.deviceAuthorizationUrl,r);if(!i.ok)return yield*new Xn({reason:`${e.label} device code request failed (${i.status}): ${ka(s.trim(),r)||i.statusText}`});let a=yield*Ze({try:()=>yf(x,s,`${e.label} device code response`,r),catch:uc});if(!a.device_code||!a.user_code||!a.verification_uri)return yield*new Xn({reason:`${e.label} device code response is missing device_code / user_code / verification_uri`});return{deviceCode:a.device_code,userCode:a.user_code,verificationUri:a.verification_uri,verificationUriComplete:a.verification_uri_complete,expiresAt:(yield*ze)+y(a.expires_in,k),intervalMs:Math.max(y(a.interval,m),g)}});function cT(e){return Fl(km(e))}var YE=ee("DeviceGrant.poll")(function*(e,r){let i={grant_type:ik,client_id:e.clientId,device_code:r.deviceCode},{response:s,text:a}=yield*_(e,e.tokenUrl,i);if(s.ok){let u=yield*Ze({try:()=>yf(D,a,`${e.label} token response`,i),catch:uc});return{status:"ready",tokens:yield*h(e,u)}}let l=Kg(a,i);if(l.error==="authorization_pending")return{status:"pending",slowDown:!1};if(l.error==="slow_down")return{status:"pending",slowDown:!0};if(l.error==="access_denied"||l.error==="authorization_denied")return yield*new Xn({reason:`${e.label} device authorization was denied`});if(l.error==="expired_token")return yield*new Xn({reason:`${e.label} device code expired \u2014 start the sign-in again`});let p=l.error_description??l.error??"";return yield*new Xn({reason:`${e.label} device token exchange failed (${s.status})${p?`: ${p}`:""}`})});function uT(e,r){return Fl(YE(e,r))}var _m=ee("DeviceGrant.approval")(function*(e,r,i={}){let s=f(function*(){let l=r.intervalMs;while((yield*ze)<r.expiresAt){let p=yield*YE(e,r);if(p.status==="ready")return p.tokens;if(p.slowDown)l+=ak;let u=Math.max(0,r.expiresAt-(yield*ze));yield*en(Ne(Math.min(l+G,u)))}return yield*new Xn({reason:`${e.label} device authorization timed out`})}),a=i.signal;if(!a)return yield*s;return yield*Wa(s,T(e,a))});function T(e,r){return pr((i)=>{let s=()=>i(c(new Xn({reason:`${e.label} device authorization cancelled`})));if(r.aborted)return s();return r.addEventListener("abort",s,{once:!0}),d(()=>r.removeEventListener("abort",s))})}function lT(e,r,i={}){return Fl(_m(e,r,i))}var ck=ee("DeviceGrant.refresh")(function*(e,r){if(!r.trim())return yield*new Xn({reason:`${e.label} refresh token is empty`});let i={grant_type:"refresh_token",refresh_token:r,client_id:e.clientId},{response:s,text:a}=yield*_(e,e.tokenUrl,i);if(!s.ok)return yield*new Xn({reason:`${e.label} token refresh failed (${s.status}): ${ka(a.trim(),i)||s.statusText}`});let l=yield*Ze({try:()=>yf(D,a,`${e.label} token response`,i),catch:uc});return yield*h(e,l,r)});function dT(e,r){return Fl(ck(e,r))}var h=v(function*(e,r,i){let s=(r.access_token??"").trim();if(!s)return yield*new Xn({reason:`${e.label} token response missing access_token`});let a=(r.refresh_token??i??(e.refreshOptional?s:"")).trim();if(!a)return yield*new Xn({reason:`${e.label} token response missing refresh_token`});let l=typeof r.expires_in==="number"&&r.expires_in>0?r.expires_in:3600;return{accessToken:s,refreshToken:a,expiresAt:(yield*ze)+l*1000,scope:(r.scope??"").trim(),idToken:(r.id_token??"").trim()||void 0}});function y(e,r){let i=Number(e);return Number.isFinite(i)&&i>0?i*1000:r}
3
+ export{aT,ik,ak,km,cT,YE,uT,_m,lT,ck,dT};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ var _g=(n)=>{if(n===void 0)return{text:"",structuredContent:{}};if(typeof n==="string")return{text:n};return{text:JSON.stringify(n)??String(n),structuredContent:{value:n}}},fR=(n,t)=>typeof t==="object"&&t!==null&&!Array.isArray(t)?t.value:n;
3
+ export{_g,fR};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{realpathSync as y}from"fs";import{join as f,relative as h,sep as v}from"path";var w=/\.svelte$/u,O=/\.svelte\.(?:ts|js)$/u,C=/\.ts$/u,xm=(e)=>{let{message:t,start:n}=e;if(typeof t!=="string")return String(e);return n===void 0||n===null?t:`${t} (${n.line}:${n.column+1})`},x=(...e)=>{let t=new Bun.CryptoHasher("sha256");for(let n of e)t.update(`${n.length}\x00${n}`);return t.digest("hex")},Sm=({compiler:e,graphPath:t,component:n,module:c,cache:u,failed:o})=>{let l=new Bun.Transpiler({loader:"ts"}),p=async(s,r)=>{let i=t(s),a=await Bun.file(s).text(),g=x(i,a,e.VERSION),m=u?.get(g);if(m!==void 0)return{contents:m,loader:"js"};try{let d=r(a,i);return u?.set(g,d),{contents:d,loader:"js"}}catch(d){throw o({file:i,message:xm(d)}),d}};return{name:"tagma-svelte",setup:(s)=>{s.onLoad({filter:w},({path:r})=>p(r,(i,a)=>e.compile(i,n(a)).js.code)),s.onLoad({filter:O},({path:r})=>p(r,(i,a)=>e.compileModule(C.test(r)?l.transformSync(i):i,c(a)).js.code))}}},Vg=({root:e,graph:t,hosts:n})=>({name:"tagma-graph",setup:(c)=>{let u=y(e);c.onResolve({filter:/.*/u},({path:o,importer:l})=>{if(l===void 0||l==="")return;if(n.has(o))return{path:o,external:!0};let p=h(l.startsWith(`${e}${v}`)?e:u,l).replaceAll("\\","/"),s=Object.hasOwn(t.files,p)?t.files[p].imports:{},r=Object.hasOwn(s,o)?s[o]:void 0;if(r===void 0)throw Error(`${l} imports ${o}, which graph.json does not resolve`);return r==="host"?{path:o,external:!0}:{path:f(e,r)}})}});
3
+ export{xm,Sm,Vg};
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import{N}from"./plugin-me00x60n.js";import{xr,Dr,jn,Ie,ds,Ta,mi,Ds,Fs,fs,ps,Us,Xr,lr}from"./plugin-1n46me5n.js";import{ln}from"./plugin-a4ng6krf.js";import{Fr}from"./plugin-ay29ch70.js";import{Lr}from"./plugin-q1n5kwx0.js";import{Zo,Ns}from"./plugin-pfj9nc2e.js";import{Ms}from"./plugin-60bdzk1r.js";import{kf}from"./plugin-1x94cj6e.js";import{To}from"./plugin-ba1sv0th.js";import{Cs,nn,Vo,cs,yr,As}from"./plugin-1xze8f5y.js";import{lf,df,cc,ff,pf,KE,mf}from"./plugin-fhc5q7r3.js";import{Hi,wa,Bg,Ll}from"./plugin-pkxw1pfs.js";import{Ro}from"./plugin-kc4z9msd.js";import{qt,i,v,ee,n,w,t,S,z,o,x,O,W,gt,P,Kr}from"./plugin-6xpcmvm3.js";var I=df,g="openai-chat",b=new Set(Fs),U="https://api.openai.com/v1",D="/chat/completions",F=o({name:t,description:t,parameters:Dr}),j=o({type:P("function"),function:F}),B=o({id:t,type:P("function"),function:o({name:t,arguments:t})}),q=O([o({type:w("text"),text:t}),o({type:w("image_url"),image_url:o({url:t})})]),J=O([o({role:w("system"),content:t}),o({role:w("user"),content:O([t,x(q)])}),o({role:w("assistant"),content:gt(t),tool_calls:jn(B),reasoning_content:n(t)}),o({role:w("tool"),tool_call_id:t,content:t})]).pipe(Kr("role")),H=O([W(["auto","none","required"]),o({type:P("function"),function:o({name:t})})]),C={model:t,messages:x(J),tools:jn(j),tool_choice:n(H),parallel_tool_calls:n(z),stream:w(!0),stream_options:n(o({include_usage:z})),store:n(z),reasoning_effort:n(lf),max_tokens:n(S),temperature:n(S),top_p:n(S),frequency_penalty:n(S),presence_penalty:n(S),seed:n(S),stop:jn(t)},G=o(C),K=o({prompt_tokens:n(S),completion_tokens:n(S),total_tokens:n(S),prompt_tokens_details:Ie(o({cached_tokens:n(S)})),completion_tokens_details:Ie(o({reasoning_tokens:n(S)}))}),Q=o({name:Ie(t),arguments:Ie(t)}),V=o({index:S,id:Ie(t),function:Ie(Q)}),X=o({content:Ie(t),reasoning_content:Ie(t),tool_calls:Ie(x(V))}),Y=o({delta:Ie(X),finish_reason:Ie(t)}),Z=o({choices:x(Y),usage:Ie(K)});var te=(e,s)=>({type:"function",function:{name:e.name,description:e.description,parameters:s}}),oe=(e)=>Us("OpenAI Chat",e,{auto:()=>"auto",none:()=>"none",required:()=>"required",tool:(s)=>({type:"function",function:{name:s}})}),ne=(e)=>({id:e.id,type:"function",function:{name:e.name,arguments:xr(e.input)}}),_=ee("OpenAIChat.lowerMedia")(function*(e){return{type:"image_url",image_url:{url:(yield*fs("OpenAI Chat",e,b)).dataUrl}}}),se=(e)=>N(e)&&typeof e.reasoning_content==="string"?e.reasoning_content:void 0,ae=(e,s,a)=>{if(e.length>0)return e.map((r)=>r.text).join("");return se(s.native?.openaiCompatible)??(a==="required"?"":void 0)},re=ee("OpenAIChat.lowerUserMessage")(function*(e){let s=[];for(let a of e.content){if(a.type==="text"){s.push({type:"text",text:a.text});continue}if(a.type==="media"){s.push(yield*_(a));continue}return yield*lr("OpenAI Chat","user",["text","media"])}if(s.every((a)=>a.type==="text"))return{role:"user",content:s.map((a)=>a.text).join("")};return{role:"user",content:s}}),ie=ee("OpenAIChat.lowerAssistantMessage")(function*(e,s){let a=[],r=[],p=[];for(let l of e.content){if(!Xr(l,["text","reasoning","tool-call"]))return yield*lr("OpenAI Chat","assistant",["text","reasoning","tool-call"]);if(l.type==="text"){a.push(l);continue}if(l.type==="reasoning"){r.push(l);continue}if(l.type==="tool-call")p.push(ne(l))}let m=a.length===0?null:mi(a);if(p.length===0&&(m===null||m.length===0))return null;return{role:"assistant",content:m,tool_calls:p.length===0?void 0:p,reasoning_content:ae(r,e,s)}}),T=ee("OpenAIChat.lowerToolMessages")(function*(e){let s=[],a=[];for(let r of e.content){if(!Xr(r,["tool-result"]))return yield*lr("OpenAI Chat","tool",["tool-result"]);if(r.result.type!=="content"){s.push({role:"tool",tool_call_id:r.id,content:ps(r)});continue}let p=r.result.value,m=p.filter((c)=>c.type==="text").map((c)=>c.text);s.push({role:"tool",tool_call_id:r.id,content:m.join(`
3
+ `)});let l=p.filter((c)=>c.type==="file");a.push(...yield*qt(l,(c)=>_({type:"media",mediaType:c.mime,data:c.uri,filename:c.name})))}return{messages:s,images:a}}),le=ee("OpenAIChat.lowerMessage")(function*(e,s){if(e.role==="user")return[yield*re(e)];if(e.role==="assistant"){let a=yield*ie(e,s);return a===null?[]:[a]}return(yield*T(e)).messages}),ce=ee("OpenAIChat.lowerMessages")(function*(e){let s=e.model.compatibility?.reasoningEcho,r=[...e.system.length===0?[]:[{role:"system",content:mi(e.system)}]],p=[],m=()=>{if(p.length===0)return;r.push({role:"user",content:p.splice(0)})};for(let l of e.messages){if(l.role==="system"){let c=yield*Ds("OpenAI Chat",l);if(p.length>0){r.push({role:"user",content:[...p.splice(0),{type:"text",text:c.text}]});continue}let u=r.at(-1);if(u?.role==="user"&&typeof u.content==="string")r[r.length-1]={role:"user",content:`${u.content}
4
+ ${c.text}`};else if(u?.role==="user"&&Array.isArray(u.content))r[r.length-1]={role:"user",content:[...u.content,{type:"text",text:c.text}]};else r.push({role:"user",content:c.text});continue}if(l.role==="tool"){let c=yield*T(l);r.push(...c.messages),p.push(...c.images);continue}m(),r.push(...yield*le(l,s))}return m(),r}),pe=ee("OpenAIChat.lowerOptions")(function*(e){let s=cc(e),a=ff(e),r=pf(e);return{store:s,reasoning_effort:a,parallel_tool_calls:r}}),ue=ee("OpenAIChat.fromRequest")(function*(e){let s=e.generation,a=e.model.compatibility?.toolSchema;return{model:e.model.id,messages:yield*ce(e),tools:e.tools.length===0?void 0:e.tools.map((r)=>te(r,Ro.modelCompatibility(r.inputSchema,a))),tool_choice:e.toolChoice?yield*oe(e.toolChoice):void 0,stream:!0,stream_options:{include_usage:!0},max_tokens:s?.maxTokens,temperature:s?.temperature,top_p:s?.topP,frequency_penalty:s?.frequencyPenalty,presence_penalty:s?.presencePenalty,seed:s?.seed,stop:s?.stop,...yield*pe(e)}}),me=(e)=>{if(e==="stop")return"stop";if(e==="length")return"length";if(e==="content_filter")return"content-filter";if(e==="function_call"||e==="tool_calls")return"tool-calls";return"unknown"},he=(e)=>{if(!e)return;let s=e.prompt_tokens_details?.cached_tokens,a=e.completion_tokens_details?.reasoning_tokens,r=Ta(e.prompt_tokens,s);return new ln({inputTokens:e.prompt_tokens,outputTokens:e.completion_tokens,nonCachedInputTokens:r,cacheReadInputTokens:s,reasoningTokens:a,totalTokens:ds(e.prompt_tokens,e.completion_tokens,e.total_tokens),providerMetadata:{openai:e}})},de=v(function*(e,s){let a=[],r=he(s.usage)??e.usage,p=s.choices[0],m=p?.finish_reason?me(p.finish_reason):e.finishReason,l=p?.delta,c=l?.tool_calls??[],{tools:u,lifecycle:h}=e;if(l?.reasoning_content)h=cs(h,a,"reasoning-0",l.reasoning_content);if(l?.content)h=yr(h,a,"reasoning-0"),h=Vo(h,a,"text-0",l.content);if(c.length)h=yr(h,a,"reasoning-0");for(let f of c){let d=Bg(g,u,f.index,{id:f.id||void 0,name:f.function?.name||void 0,text:f.function?.arguments??""},"OpenAI Chat tool call delta is missing id or name");if(wa(d))return yield*d;if(u=d.tools,d.events.length)h=nn(h,a);a.push(...d.events)}let A=m!==void 0&&e.finishReason===void 0&&Object.keys(u).length>0?Ll(u):void 0;return[{tools:A?.tools??u,toolCallEvents:A?.events??e.toolCallEvents,usage:r,finishReason:m,lifecycle:h},a]}),fe=(e)=>{let s=[],a=e.toolCallEvents.length>0,r=e.finishReason==="stop"&&a?"tool-calls":e.finishReason,p=e.toolCallEvents.length?nn(e.lifecycle,s):e.lifecycle;if(s.push(...e.toolCallEvents),r)As(p,s,{reason:r,usage:e.usage});return s},y=Zo({id:g,body:{schema:G,from:ue},stream:{event:Ns(Z),initial:()=>({tools:Hi(),toolCallEvents:[],lifecycle:Cs()}),step:de,onHalt:fe},rateLimits:mf}),ye=kf.with(),we=To.make({id:g,protocol:y,endpoint:Lr.path(D,{baseURL:U}),auth:Fr,transport:ye});var M="openai-compatible-chat",Ea=I,Ce=o({...C,thinking:n(o({type:W(["enabled","disabled"])}))}),tk=Zo({...y,id:M,body:{schema:Ce,from:(e)=>y.body.from(e).pipe(i((s)=>{let a=KE(e);return a===void 0?s:{...s,thinking:a}}))}}),va=To.make({id:M,protocol:tk,endpoint:Lr.path("/chat/completions"),framing:Ms});
5
+ export{Ea,tk,va};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{n,w,t,S,z,o,x,O,W,An,au,ct}from"./plugin-6xpcmvm3.js";var nv=W(["provider","client","none"]),hk=W(["word","segment","none"]),gk=o({codes:x(t),hints:S,detect:z}),yk=o({targets:x(t),twoWay:z}),xk=o({prompt:z,terms:z}),i=ct.check(au(0)),e=An.check(au(0)),Sk=o({sessionMs:n(e),clipMs:n(e),clipBytes:n(i)}),bk=o({id:t,label:t,min:S,max:S,initial:S,modes:x(nv)}),r={timestamps:hk,speakers:z,confidence:z,languages:gk,translation:n(yk),prompting:xk},a={...r,rates:x(S),limits:Sk,tuning:x(bk)},Ek=o({...a,kind:w("stream"),partials:z,turns:x(nv),finalize:z}),vk=o({...a,kind:w("batch")}),wk=o({fileMs:n(e)}),kk=o({...r,kind:w("file"),containers:x(t),limits:wk}),_k=O([Ek,vk,kk]),AT=["stream","batch"],MT=["file","batch"],Tk=o({id:t,label:t,languages:x(t)}),Rk=o({characters:n(i),audioMs:n(e),streams:n(i)}),Ik=o({text:W(["stream","whole"]),rates:x(S),voices:x(Tk),languages:x(t),needsLanguage:z,timestamps:z,limits:Rk}),Xg=o({id:t,label:t,recognition:_k}),ey=o({id:t,label:t,synthesis:Ik});
3
+ export{nv,hk,gk,yk,xk,Sk,bk,Ek,vk,wk,kk,_k,AT,MT,Tk,Rk,Ik,Xg,ey};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Iu,Vi,Go}from"./plugin-72xxqm1t.js";import{js}from"./plugin-krbbb4ts.js";import{F,c,_h,$r,n,t,o,O,An,tw}from"./plugin-6xpcmvm3.js";class Xn extends F("OAuthFlowFailed"){get message(){return this.reason}}function Jg(e,r){return e.pipe(_h({duration:js,orElse:()=>c(new Xn({reason:`${r} timed out after ${js}ms`}))}))}var f=/^(code|code_verifier|device_code|client_secret|assertion)$/i;function ka(e,r={}){return Go(e,Vi(Object.entries(r),(s)=>Iu(s)||f.test(s)))}function uc(e){if(e instanceof Xn)return e;return new Xn({reason:e instanceof Error?e.message:String(e),cause:e})}var dk=o({error:n(t),error_description:n(t)}),l=$r(dk),gf=n(O([An,tw])),d=200;function yf(e,r,s,i={}){let u;try{u=JSON.parse(r)}catch{let p=ka(r.trim(),i).slice(0,d);throw Error(`${s} is not JSON: ${p||"(empty body)"}`)}let a=$r(e)(u);if(a._tag!=="Success")throw Error(`${s} does not match the shape the endpoint documents \u2014 ${ka(a.failure.message,i)}`);return a.success}function Kg(e,r={}){try{let s=l(JSON.parse(e));if(s._tag!=="Success")return{error_description:`The OAuth error answer has an invalid shape: ${ka(s.failure.message,r).slice(0,d)}`};let i=s.success.error_description;return{...s.success,error_description:i===void 0?void 0:ka(i,r)}}catch{return{error_description:`The OAuth error answer is not JSON: ${ka(e.trim(),r).slice(0,d)||"(empty body)"}`}}}
3
+ export{Xn,Jg,ka,uc,dk,gf,yf,Kg};
@@ -0,0 +1,9 @@
1
+ // @bun
2
+ var e={name:"@runlith/tagma",version:"0.1.0",private:!0,description:"The public contract of Tagma: rules a repository declares in tagma.config.ts and the adapter a model provider is written against.",bin:{"tagma-plugin":"./src/plugin/cli.ts"},type:"module",exports:{"./rules":{types:"./src/rules/rules.ts",default:"./src/rules/rules.ts"},"./rules/effect":{types:"./src/rules/effect.ts",default:"./src/rules/effect.ts"},"./sources":{types:"./src/rules/sources.ts",bun:"./src/rules/sources.ts",default:null},"./adapter/provider":{types:"./src/adapter/provider.ts",browser:"./src/adapter/provider.ts",bun:"./src/adapter/provider.ts",default:"./src/adapter/provider.ts"},"./adapter/harness":{types:"./src/adapter/harness.ts",browser:"./src/adapter/harness.ts",node:"./src/adapter/harness.ts",bun:"./src/adapter/harness.ts",default:"./src/adapter/harness.ts"},"./adapter/metadata":{types:"./src/adapter/metadata.ts",bun:"./src/adapter/metadata.ts",default:"./src/adapter/metadata.ts"},"./adapter/hook":{types:"./src/adapter/hook.ts",browser:"./src/adapter/hook.ts",bun:"./src/adapter/hook.ts",default:"./src/adapter/hook.ts"},"./adapter/payload":{types:"./src/adapter/payload.ts",browser:"./src/adapter/payload.ts",bun:"./src/adapter/payload.ts",default:"./src/adapter/payload.ts"},"./adapter/claude-hooks":{types:"./src/adapter/claudeHooks.ts",browser:"./src/adapter/claudeHooks.ts",bun:"./src/adapter/claudeHooks.ts",default:"./src/adapter/claudeHooks.ts"},"./adapter/settings":{types:"./src/adapter/settings.ts",browser:"./src/adapter/settings.ts",bun:"./src/adapter/settings.ts",default:"./src/adapter/settings.ts"},"./adapter/speech":{types:"./src/adapter/speech.ts",bun:"./src/adapter/speech.ts",default:"./src/adapter/speech.ts"},"./adapter/loader":{types:"./src/adapter/loader.ts",bun:"./src/adapter/loader.ts",default:null},"./adapter/declaration":{types:"./src/adapter/declaration.ts",default:"./src/adapter/declaration.ts"},"./adapter/host-modules":{types:"./src/adapter/hostModules.ts",bun:"./src/adapter/hostModules.ts",default:null},"./plugin":{types:"./src/plugin/plugin.ts",browser:"./src/plugin/plugin.ts",default:"./src/plugin/plugin.ts"},"./plugin/bundling":{types:"./src/plugin/bundling.ts",bun:"./src/plugin/bundling.ts",default:null},"./plugin/process":{types:"./src/plugin/process.ts",bun:"./src/plugin/process.ts",default:null},"./plugin/protocol":{types:"./src/plugin/protocol.ts",default:"./src/plugin/protocol.ts"},"./plugin/value":{types:"./src/plugin/value.ts",browser:"./src/plugin/value.ts",default:"./src/plugin/value.ts"},"./plugin/points":{types:"./src/plugin/points.generated.ts",default:"./src/plugin/points.generated.ts"},"./plugin/template":{types:"./src/plugin/template.ts",default:"./src/plugin/template.ts"},"./ui":{types:"./src/plugin/ui.generated.d.ts",default:"./src/plugin/ui.generated.d.ts"},"./testing":{types:"./src/plugin/testing.ts",bun:"./src/plugin/testing.ts",default:null}},scripts:{build:"bun kit/build.ts",test:"testbed bun test --no-isolate --pass-with-no-tests src","test:integration":"testbed itest --no-isolate",typecheck:"runlith-typecheck"},dependencies:{"@modelcontextprotocol/sdk":"catalog:","@runlith/adapter-anthropic":"workspace:*","@runlith/adapter-deepseek":"workspace:*","@runlith/adapter-devin":"workspace:*","@runlith/adapter-google":"workspace:*","@runlith/adapter-muse":"workspace:*","@runlith/adapter-openai":"workspace:*","@runlith/adapter-opencode-go":"workspace:*","@runlith/adapter-stepfun":"workspace:*","@runlith/adapter-xai":"workspace:*","@runlith/agent":"workspace:*","@runlith/held":"workspace:*","@runlith/llm":"workspace:*","@runlith/mcp":"workspace:*","@runlith/speech":"workspace:*","@runlith/utils":"workspace:*","@standard-schema/spec":"^1.1.0","@tailwindcss/oxide":"catalog:",svelte:"catalog:",svelte2tsx:"catalog:",typescript:"catalog:"},devDependencies:{"@runlith/tsconfig":"workspace:*","@tagma/inspection":"workspace:*","@types/bun":"catalog:",effect:"catalog:",zod:"catalog:"},peerDependencies:{effect:"^4.0.1"},changeCheck:{loads:{"src/adapter/loader.ts":[]}},tagma:{host:["./adapter/claude-hooks","./adapter/harness","./adapter/hook","./adapter/metadata","./adapter/payload","./adapter/provider","./adapter/settings","./adapter/speech","effect","effect/http"]}};var oT="BUILT_SDK",a="0.1.0",bm=a??e.version,sk=a??"link:@runlith/tagma",s=(t)=>`${JSON.stringify(t,null,2)}
3
+ `,Zg=({id:t,title:r})=>[{path:"package.json",text:s({name:t,version:"0.1.0",private:!0,type:"module",scripts:{build:"tagma-plugin build",dev:"tagma-plugin dev",test:"bun test"},devDependencies:{"@runlith/tagma":sk,"@types/bun":"^1.3.0",zod:"^4.2.0"}})},{path:"tsconfig.json",text:s({compilerOptions:{target:"ESNext",module:"Preserve",moduleResolution:"bundler",strict:!0,noEmit:!0,skipLibCheck:!0,verbatimModuleSyntax:!0,allowImportingTsExtensions:!0,types:["bun"]},include:["**/*.ts"],exclude:["node_modules","dist"]})},{path:"plugin.ts",text:["import { definePlugin, tool } from '@runlith/tagma/plugin';","import { z } from 'zod';","","export default definePlugin({",` id: ${JSON.stringify(t)},`,` title: ${JSON.stringify(r)},`," tools: {"," hello: tool({"," description: 'Greet someone by name.',"," audience: 'agents',"," readOnly: true,"," input: z.object({ name: z.string().describe('Who to greet') }),"," run: async ({ name }) => `Hello, ${name}!`,"," }),"," },","});",""].join(`
4
+ `)},{path:"plugin.test.ts",text:["import { expect, test } from 'bun:test';","import { testPlugin } from '@runlith/tagma/testing';","import plugin from './plugin';","","test('hello greets by name', async () => {"," expect(await testPlugin(plugin).call('hello', { name: 'Ada' })).toEqual({ text: 'Hello, Ada!', isError: false });","});",""].join(`
5
+ `)},{path:".gitattributes",text:["dist/** linguist-generated=true merge=binary","tagma-plugin.json linguist-generated=true merge=binary",""].join(`
6
+ `)},{path:".gitignore",text:`node_modules/
7
+ !dist/
8
+ `}];
9
+ export{oT,bm,sk,Zg};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{kr,de}from"./plugin-7y7ndrk9.js";import{Ca,ly}from"./plugin-ay29ch70.js";import{it,i,Ri}from"./plugin-6xpcmvm3.js";function Hn(r,e,t,n){return o(`${t} API key`,()=>r.apiKey(e,t,n))}function mm(r,e,t,n){return o(`${t} access token`,()=>r.accessToken(e,t,n))}function o(r,e){return ly(it({try:e,catch:(t)=>t instanceof de?t:new Ca(t instanceof Error?t.message:r)}).pipe(i(Ri)))}function hf(r,e){return it({try:e,catch:(t)=>t instanceof de?t:new de({module:"Auth",method:"apply",reason:new kr({message:`The stored ${r} could not be read: ${t instanceof Error?t.message:String(t)}`,kind:"missing"})})})}
3
+ export{Hn,mm,hf};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{F,n,w,t,S,o,x,O,W,Kr,xo,Ke}from"./plugin-6xpcmvm3.js";var qk=W(["session","weekly","monthly","model","bucket"]);class pc extends Ke("LLM.QuotaWindow")({kind:qk,label:n(t),model:n(t),usedPercent:S,windowMinutes:n(S),resetsAt:n(S)}){}var Bk=W(["reply","usage"]);class Ps extends Ke("LLM.QuotaObservation")({observedAt:xo,source:Bk,windows:x(pc),resetCredits:n(S),plan:n(t)}){}class Nm extends F("rate-limited"){get message(){return"The provider rate-limited quota reading."}}class Ul extends F("stale-token"){get message(){return"The provider refused the quota credential."}}class Lm extends F("missing-scope"){get message(){return`The quota credential lacks ${this.scope}.`}}class Dm extends F("server"){get message(){return`The quota endpoint answered ${this.status}.`}}class Tf extends F("transport"){}class ls extends F("invalid-response"){}class Wk extends F("unavailable"){get message(){return this.reason}}class ji extends F("unsupported"){get message(){return"The provider does not expose quota readings."}}var NT=O([o({_tag:w("rate-limited"),retryAfterMs:n(S)}),o({_tag:w("stale-token")}),o({_tag:w("missing-scope"),scope:t}),o({_tag:w("server"),status:S}),o({_tag:w("transport"),message:t}),o({_tag:w("invalid-response"),message:t}),o({_tag:w("unsupported")}),o({_tag:w("unavailable"),reason:t})]).pipe(Kr("_tag"));
3
+ export{qk,pc,Bk,Ps,Nm,Ul,Lm,Dm,Tf,ls,Wk,ji,NT};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Pt}from"./plugin-je5cfnqn.js";import{Aa,de}from"./plugin-7y7ndrk9.js";import{Co}from"./plugin-ay29ch70.js";import{Ia}from"./plugin-1n46me5n.js";import{Io,_a}from"./plugin-3pfrkxg1.js";import{rl,wh,aa,r,y,f,c,s,at,Wc,Vc,ee,ht,pt,n,t,o,x,Kn}from"./plugin-6xpcmvm3.js";var yw="/images/generations",xw="/images/edits",I=o({data:x(o({b64_json:n(t)})),output_format:n(t)}),b=pt(Kn(I)),R={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpeg",webp:"image/webp"},u=(e)=>new de({module:"OpenAIImages",method:"generate",reason:new Aa({message:e})}),E=(e)=>`data:${e.mediaType};base64,${Buffer.from(e.bytes.buffer,e.bytes.byteOffset,e.bytes.byteLength).toString("base64")}`,Sw=(e,a)=>JSON.stringify({...a.images.length===0?{}:{images:a.images.map((d)=>({image_url:E(d)}))},prompt:a.prompt,background:a.transparent?"transparent":"opaque",model:a.model,...e}),S=(e)=>e.text.pipe(s(b),at((a)=>u(`The images answer could not be read: ${a.message}`)),s((a)=>{let d=R[a.output_format??"png"];if(d===void 0)return c(u(`The images answer names an unknown format ${a.output_format}.`));let m=a.data.flatMap((p)=>p.b64_json===void 0?[]:[{bytes:new Uint8Array(Buffer.from(p.b64_json,"base64")),mediaType:d}]);if(m.length===0)return c(u("The images answer carried no picture."));let i=_a(e.headers);return r({images:m,requestId:i["x-request-id"]??i["x-oai-request-id"],headers:ht(i)})})),Dg=ee("OpenAIImages.generate")(function*(e,a){let d=yield*Io,m=`${e.baseURL}${a.images.length===0?yw:xw}`,i=Sw(e.fields,a),p=f(function*(){let g=yield*Co(e.auth)({method:"POST",url:m,body:i,headers:Pt({"Content-Type":"application/json",Accept:"application/json"})});return yield*Vc((h)=>s(d.execute(Ia({url:m,body:i,headers:g}),h),S))}),l=rl(1).pipe(aa(({input:g})=>r(g.status===401&&e.recover!==void 0)),wh(()=>e.recover??y));return yield*Wc(p,l)});
3
+ export{yw,xw,Sw,Dg};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{N}from"./plugin-me00x60n.js";import{Au,qs,Ou}from"./plugin-frrvs5yc.js";import{Je,n,w,ce,t,S,z,o,ge,x,O,W,Ke}from"./plugin-6xpcmvm3.js";var Ql=(...e)=>{let i=e.filter((d)=>d!==void 0),r=i.length===1?i[0]:void 0;if(i.length===0)return;if(r&&Object.values(r).every((d)=>d!==void 0))return r;let a={};for(let d of i)for(let[s,l]of Object.entries(d)){if(l===void 0)continue;a[s]=N(a[s])&&N(l)?Ql(a[s],l):l}return Object.keys(a).length===0?void 0:a},c=(...e)=>{let i=e.filter((a)=>a!==void 0);if(i.length===0)return;if(i.length===1)return i[0];let r=Object.fromEntries(i.flatMap((a)=>Object.entries(a).filter((d)=>d[1]!==void 0)));return Object.keys(r).length===0?void 0:r},Xm=ge(t,ge(t,ce)),Yl=(...e)=>{let i={};for(let r of e){if(!r)continue;for(let[a,d]of Object.entries(r)){let s=Ql(i[a],d);if(s)i[a]=s}}return Object.keys(i).length===0?void 0:i};class Oo extends Ke("LLM.HttpOptions")({body:n(Ou),headers:n(ge(t,t)),headerOrder:n(x(t)),query:n(ge(t,t))}){}var Uf=(e,i)=>{let r=new Map(Object.entries(e).map(([d,s])=>[d.toLowerCase(),{name:d,value:s}])),a={};for(let d of i??[]){let s=d.toLowerCase(),l=r.get(s);if(l===void 0)continue;a[d]=l.value,r.delete(s)}for(let{name:d,value:s}of r.values())a[d]=s;return a};((i)=>i.make=(r)=>r instanceof Oo?r:new Oo(r))(Oo||={});var Xl=(...e)=>{let i=Ql(...e.map((s)=>s?.body)),r=c(...e.map((s)=>s?.headers)),a=c(...e.map((s)=>s?.query)),d=e.findLast((s)=>s?.headerOrder!==void 0)?.headerOrder;if(!i&&!r&&!a&&d===void 0)return;return new Oo({body:i,headers:r,query:a,headerOrder:d})};class Ur extends Ke("LLM.GenerationOptions")({maxTokens:n(S),temperature:n(S),topP:n(S),topK:n(S),frequencyPenalty:n(S),presencePenalty:n(S),seed:n(S),stop:n(x(t))}){}((i)=>i.make=(r={})=>r instanceof Ur?r:new Ur(r))(Ur||={});var p=(e,i)=>e.findLast((r)=>r?.[i]!==void 0)?.[i],ed=(...e)=>{let i=new Ur({maxTokens:p(e,"maxTokens"),temperature:p(e,"temperature"),topP:p(e,"topP"),topK:p(e,"topK"),frequencyPenalty:p(e,"frequencyPenalty"),presencePenalty:p(e,"presencePenalty"),seed:p(e,"seed"),stop:p(e,"stop")});return Object.values(i).some((r)=>r!==void 0)?i:void 0};class Wi extends Ke("LLM.ModelLimits")({context:n(S),output:n(S)}){}((i)=>i.make=(r)=>r instanceof Wi?r:new Wi(r??{}))(Wi||={});class td extends Ke("LLM.ModelDefaults")({limits:n(Wi),generation:n(Ur),providerOptions:n(Xm),http:n(Oo)}){}((i)=>i.make=(r)=>{if(r instanceof td)return r;return new td({limits:r.limits===void 0?void 0:Wi.make(r.limits),generation:r.generation===void 0?void 0:Ur.make(r.generation),providerOptions:r.providerOptions,http:r.http===void 0?void 0:Oo.make(r.http)})})(td||={});var eh=W(["auto","none","required","tool"]),r_=Je((e)=>typeof e==="function",{expected:"LLM.ToolSchemaDialect"}),o_=W(["required"]);class nd extends Ke("LLM.ModelCompatibility")({toolSchema:n(r_),toolChoice:n(x(eh)),reasoningEcho:n(o_)}){}((i)=>i.make=(r)=>r instanceof nd?r:new nd(r))(nd||={});class Sc{id;provider;route;defaults;compatibility;constructor(e){this.id=e.id,this.provider=e.provider,this.route=e.route,this.defaults=e.defaults,this.compatibility=e.compatibility}static make(e){return new Sc({id:Au.make(e.id),provider:qs.make(e.provider),route:e.route,defaults:e.defaults===void 0?void 0:td.make(e.defaults),compatibility:e.compatibility===void 0?void 0:nd.make(e.compatibility)})}static input(e){return{id:e.id,provider:e.provider,route:e.route,defaults:e.defaults,compatibility:e.compatibility}}static update(e,i){if(Object.keys(i).length===0)return e;return Sc.make({...Sc.input(e),...i})}}var rd=Je((e)=>e instanceof Sc,{expected:"LLM.Model"});class Ut extends Ke("LLM.ModelIdentity")({provider:qs,model:Au}){}((r)=>(r.of=(a)=>new Ut({provider:a.provider,model:a.id}),r.same=(a,d)=>a!==void 0&&d!==void 0&&a.provider===d.provider&&a.model===d.model))(Ut||={});class gs extends Ke("LLM.CacheHint")({type:W(["ephemeral","persistent"]),ttlSeconds:n(S)}){}var s_=o({tools:n(z),system:n(z),messages:n(O([w("latest-message"),w("latest-assistant"),o({tail:S})])),ttlSeconds:n(S)}),_y=O([w("auto"),w("none"),s_]);
3
+ export{Ql,Xm,Yl,Oo,Uf,Xl,Ur,ed,Wi,td,eh,r_,o_,nd,Sc,rd,Ut,gs,s_,_y};
@@ -0,0 +1,175 @@
1
+ /// <reference path="../types/node/index.d.ts" />
2
+ /// <reference path="../host.d.ts" />
3
+ import type { McpCaller } from "@runlith/tagma/internal/packages/mcp/src/mcpCallerMeta";
4
+ import type { AnyProvider, SpeechHost } from "@runlith/speech/protocol/adapter";
5
+ import type { StandardJSONSchemaV1, StandardSchemaV1 } from "@runlith/tagma/internal/node_modules/.bun/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index";
6
+ import type { Adapter } from "@runlith/tagma/adapter/provider";
7
+ import type { ModelsClient } from "@runlith/tagma/internal/packages/tagma/src/plugin/models";
8
+ import type { PluginServers, ServerClient } from "@runlith/tagma/internal/packages/tagma/src/plugin/servers";
9
+ import type { ExternalOperations } from "@runlith/tagma/internal/packages/tagma/src/plugin/operations.generated";
10
+ import type { BuildVerdict, HookVerdicts, PluginEnvelope, PluginPoints, ToolFaceState } from "@runlith/tagma/plugin/points";
11
+ import { type ActionInput, type AskedInput, type AskedLeft, type BuildStepInput, type EndingInput, type HookInput, type HookPoint, type NotificationInput, type TickInput } from "@runlith/tagma/plugin/protocol";
12
+ export type InputSchema<Input = unknown, Output = Input> = StandardSchemaV1<Input, Output> & StandardJSONSchemaV1<Input, Output>;
13
+ export type OperationId = keyof ExternalOperations & string;
14
+ export type TagmaClient = {
15
+ readonly op: <Id extends OperationId>(id: Id, input: ExternalOperations[Id]['input']) => Promise<ExternalOperations[Id]['answer']>;
16
+ readonly in: (project: number) => TagmaClient;
17
+ };
18
+ export type PluginContext = {
19
+ readonly caller: McpCaller;
20
+ readonly project: number | null;
21
+ readonly projects: readonly number[];
22
+ readonly tagma: TagmaClient;
23
+ readonly models: ModelsClient;
24
+ readonly servers: PluginServers;
25
+ readonly data: string;
26
+ readonly dataOf: (project: number | null) => string;
27
+ readonly options: Readonly<Record<string, string | undefined>>;
28
+ readonly log: (...parts: readonly unknown[]) => void;
29
+ readonly signal: AbortSignal;
30
+ readonly changed: (uri: string) => void;
31
+ };
32
+ type ToolEntry = PluginPoints['tools'][number];
33
+ export type ToolAudience = Exclude<ToolEntry['audience'], 'tagma'>;
34
+ type Parsed<S> = S extends StandardSchemaV1<any, infer Output> ? Output : Readonly<Record<never, never>>;
35
+ export type Tool<S extends InputSchema | undefined = InputSchema | undefined, A extends ToolAudience = ToolAudience, R = unknown> = {
36
+ readonly description: ToolEntry['description'];
37
+ readonly audience: A;
38
+ readonly input?: S;
39
+ readonly title?: string;
40
+ readonly readOnly?: boolean;
41
+ readonly destructive?: boolean;
42
+ readonly idempotent?: boolean;
43
+ readonly openWorld?: boolean;
44
+ readonly run: (input: Parsed<S>, ctx: PluginContext) => Promise<R>;
45
+ };
46
+ type Encoded<S> = S extends StandardSchemaV1<infer Input, any> ? Input : Readonly<Record<never, never>>;
47
+ type ToolsOf<Plugin> = Plugin extends {
48
+ readonly tools: infer Tools;
49
+ } ? Tools : Readonly<Record<never, never>>;
50
+ type ViewToolNames<Plugin> = {
51
+ readonly [Name in keyof ToolsOf<Plugin>]: ToolsOf<Plugin>[Name] extends {
52
+ readonly audience: 'view';
53
+ } ? Name : never;
54
+ }[keyof ToolsOf<Plugin>];
55
+ type ToolIO<Handler> = Handler extends Tool<infer S, any, infer Output> ? {
56
+ readonly input: Encoded<S>;
57
+ readonly output: Output;
58
+ } : never;
59
+ export type ViewTools<Plugin> = {
60
+ readonly [Name in ViewToolNames<Plugin>]: ToolIO<ToolsOf<Plugin>[Name]> extends {
61
+ readonly input: infer Input;
62
+ readonly output: infer Output;
63
+ } ? keyof Input extends never ? (input?: Input) => Promise<Output> : (input: Input) => Promise<Output> : never;
64
+ };
65
+ type ServersOf<Plugin> = Plugin extends {
66
+ readonly mcpServers: infer Servers;
67
+ } ? Servers : Readonly<Record<never, never>>;
68
+ export type ViewServers<Plugin> = {
69
+ readonly [Name in keyof ServersOf<Plugin>]: ServerClient;
70
+ };
71
+ export type ToolFace<Plugin, Name extends keyof ToolsOf<Plugin> & string> = {
72
+ readonly name: Name;
73
+ readonly input: ToolIO<ToolsOf<Plugin>[Name]>['input'];
74
+ readonly output: ToolIO<ToolsOf<Plugin>[Name]>['output'] | undefined;
75
+ readonly state: ToolFaceState;
76
+ readonly threadId: string;
77
+ };
78
+ export type Resource = {
79
+ readonly uri: string;
80
+ readonly description?: string;
81
+ readonly mimeType?: string;
82
+ readonly read: (params: Readonly<Record<string, string>>, ctx: PluginContext) => Promise<unknown>;
83
+ };
84
+ export type Every = number | `${number}${'s' | 'm' | 'h' | 'd'}`;
85
+ export type Schedule = {
86
+ readonly every: Every;
87
+ readonly run: (tick: TickInput, ctx: PluginContext) => Promise<void>;
88
+ };
89
+ export type BuildStep = {
90
+ readonly title: PluginPoints['beforeBuild'][number]['title'];
91
+ readonly run: (step: BuildStepInput, ctx: PluginContext) => Promise<BuildVerdict>;
92
+ };
93
+ export type Action = {
94
+ readonly title: PluginPoints['actions'][number]['title'];
95
+ readonly run: (input: ActionInput, ctx: PluginContext) => Promise<string | void>;
96
+ };
97
+ type HookEntry = PluginPoints['hooks'][number];
98
+ export type HookEvent<At extends HookPoint = HookPoint> = Extract<HookInput, {
99
+ readonly at: At;
100
+ }>;
101
+ export type Hook<At extends HookPoint = HookPoint> = {
102
+ readonly at: At;
103
+ readonly match?: HookEntry['match'];
104
+ readonly onFailure?: HookEntry['onFailure'];
105
+ readonly timeoutMs?: HookEntry['timeoutMs'];
106
+ readonly run: (event: HookEvent<At>, ctx: PluginContext) => Promise<HookVerdicts[At] | void>;
107
+ };
108
+ type AnyHook = {
109
+ readonly [At in HookPoint]: Hook<At>;
110
+ }[HookPoint];
111
+ export type EndingHandler = (ending: EndingInput, ctx: PluginContext) => Promise<void>;
112
+ export type AskedHandler = (asked: AskedInput, ctx: PluginContext) => Promise<void | AskedLeft>;
113
+ export type NotificationHandler = (answer: NotificationInput, ctx: PluginContext) => Promise<void>;
114
+ type ViewPoint = PluginPoints['views'][number];
115
+ export type View = {
116
+ readonly entry: ViewPoint['entry'];
117
+ readonly live?: ViewPoint['live'];
118
+ };
119
+ export type HandledPoint = 'tools' | 'schedule' | 'beforeBuild' | 'on' | 'notify' | 'actions' | 'hooks' | 'views';
120
+ export type PluginData = {
121
+ readonly [Point in Exclude<keyof PluginPoints, HandledPoint>]?: PluginPoints[Point];
122
+ };
123
+ export type PluginDefinition = PluginData & {
124
+ readonly id: PluginEnvelope['id'];
125
+ readonly title: PluginEnvelope['title'];
126
+ readonly description?: PluginEnvelope['description'];
127
+ readonly resident?: NonNullable<PluginEnvelope['process']>['resident'];
128
+ readonly options?: PluginEnvelope['options'];
129
+ readonly mcpServers?: PluginEnvelope['mcpServers'];
130
+ readonly providers?: string;
131
+ readonly tools?: Readonly<Record<string, Tool<any>>>;
132
+ readonly resources?: Readonly<Record<string, Resource>>;
133
+ readonly views?: Readonly<Record<string, View>>;
134
+ readonly schedules?: Readonly<Record<string, Schedule>>;
135
+ readonly beforeBuild?: Readonly<Record<string, BuildStep>>;
136
+ readonly actions?: Readonly<Record<string, Action>>;
137
+ readonly hooks?: Readonly<Record<string, AnyHook>>;
138
+ readonly onThreadEnded?: EndingHandler;
139
+ readonly onThreadAsked?: AskedHandler;
140
+ readonly onNotification?: NotificationHandler;
141
+ };
142
+ type Unknown<Definition> = {
143
+ readonly [Field in Exclude<keyof Definition, keyof PluginDefinition>]: never;
144
+ };
145
+ export declare const definePlugin: <const Definition extends PluginDefinition>(definition: Definition & Unknown<Definition>) => Definition;
146
+ export type ProvidersDefinition = {
147
+ readonly models?: Adapter;
148
+ readonly speech?: readonly AnyProvider<SpeechHost>[];
149
+ };
150
+ export declare const defineProviders: (definition: ProvidersDefinition) => ProvidersDefinition;
151
+ export declare const tool: <S extends InputSchema | undefined = undefined, A extends ToolAudience = ToolAudience, R = unknown>(declared: Tool<S, A, R>) => NoInfer<Tool<S, A, R>>;
152
+ export declare const resource: (declared: Resource) => Resource;
153
+ export declare const view: (entry: string, options?: {
154
+ readonly live?: true;
155
+ }) => View;
156
+ export declare const schedule: (declared: Schedule) => Schedule;
157
+ export declare const beforeBuild: (declared: BuildStep) => BuildStep;
158
+ export declare const action: (declared: Action) => Action;
159
+ export declare const hook: <const At extends HookPoint>(declared: Hook<At>) => Hook<At>;
160
+ export declare const onThreadEnded: (handler: EndingHandler) => EndingHandler;
161
+ export declare const onThreadAsked: (handler: AskedHandler) => AskedHandler;
162
+ export declare const leave: () => AskedLeft;
163
+ export declare const onNotification: (handler: NotificationHandler) => NotificationHandler;
164
+ export declare class Refusal extends Error {
165
+ readonly reason: string;
166
+ constructor(reason: string);
167
+ }
168
+ export declare class TagmaRefused extends Error {
169
+ readonly operation: string;
170
+ readonly code: string;
171
+ readonly reason: string;
172
+ readonly unblock: readonly string[];
173
+ constructor(operation: string, code: string, reason: string, unblock: readonly string[]);
174
+ }
175
+ export {};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{YT,XT,eR,tR,nR,rR,oR,sR,iR,aR,cR,uR,lR,vg,wg}from"./plugin-3b8x73y6.js";import"./plugin-cydz2zhy.js";export{vg as Refusal,wg as TagmaRefused,sR as action,oR as beforeBuild,YT as definePlugin,XT as defineProviders,iR as hook,uR as leave,lR as onNotification,cR as onThreadAsked,aR as onThreadEnded,tR as resource,rR as schedule,eR as tool,nR as view};