thursday-agent 0.6.0 → 0.7.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 (193) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/app/_global-error.html +1 -1
  5. package/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  9. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  10. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/_not-found.html +1 -1
  12. package/.next/server/app/_not-found.rsc +2 -2
  13. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  14. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  15. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  16. package/.next/server/app/api/artifact/route.js +3 -3
  17. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  18. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
  19. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  20. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  21. package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
  22. package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
  23. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  24. package/.next/server/app/api/memory/edit/route.js +1 -1
  25. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  26. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  27. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  28. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  29. package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
  30. package/.next/server/app/api/thursday/tool-call/route.js +1 -1
  31. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  32. package/.next/server/app/api/workspace/missing/route.js +2 -2
  33. package/.next/server/app/api/workspace/missing/route.js.nft.json +1 -1
  34. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  35. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
  36. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  37. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  38. package/.next/server/app/page/server-reference-manifest.json +42 -42
  39. package/.next/server/app/page.js +5 -4
  40. package/.next/server/app/page.js.nft.json +1 -1
  41. package/.next/server/app/page_client-reference-manifest.js +1 -1
  42. package/.next/server/chunks/[root-of-the-server]__0-06t3f._.js +8 -0
  43. package/.next/server/chunks/{[root-of-the-server]__049f521._.js → [root-of-the-server]__06l05n_._.js} +1 -1
  44. package/.next/server/chunks/[root-of-the-server]__0_ue8oe._.js +1 -1
  45. package/.next/server/chunks/{[root-of-the-server]__0ye3da2._.js → [root-of-the-server]__0btqrct._.js} +1 -1
  46. package/.next/server/chunks/[root-of-the-server]__0c9fgca._.js +1 -1
  47. package/.next/server/chunks/[root-of-the-server]__0zp35ul._.js +1 -1
  48. package/.next/server/chunks/[root-of-the-server]__1kv8p3e._.js +1 -1
  49. package/.next/server/chunks/_02szwk8._.js +1 -1
  50. package/.next/server/chunks/_06c9kie._.js +24 -24
  51. package/.next/server/chunks/_0i55en5._.js +6 -6
  52. package/.next/server/chunks/_0p56fn0._.js +1 -1
  53. package/.next/server/chunks/_11ujpya._.js +1 -1
  54. package/.next/server/chunks/_1dbixxz._.js +1 -1
  55. package/.next/server/chunks/_1dc_d1q._.js +16 -16
  56. package/.next/server/chunks/_1gnjfli._.js +3 -0
  57. package/.next/server/chunks/_1klbcft._.js +1 -1
  58. package/.next/server/chunks/features_0-cnt0l._.js +1 -1
  59. package/.next/server/chunks/features_0hdaci0._.js +1 -1
  60. package/.next/server/chunks/ssr/[root-of-the-server]__0-e011f._.js +3 -0
  61. package/.next/server/chunks/ssr/[root-of-the-server]__0pd8yr7._.js +3 -0
  62. package/.next/server/chunks/ssr/[root-of-the-server]__1nygfik._.js +1 -1
  63. package/.next/server/chunks/ssr/[root-of-the-server]__1sdphb0._.js +1 -1
  64. package/.next/server/chunks/ssr/{[root-of-the-server]__1fll8dc._.js → [root-of-the-server]__1vdmfbe._.js} +2 -2
  65. package/.next/server/chunks/ssr/[root-of-the-server]__1waa3rc._.js +34 -49
  66. package/.next/server/chunks/ssr/{_1anqots._.js → _0-2qsxo._.js} +2 -2
  67. package/.next/server/chunks/ssr/_02oc_h5._.js +9 -9
  68. package/.next/server/chunks/ssr/_05yghx6._.js +1 -1
  69. package/.next/server/chunks/ssr/_07nbwap._.js +3 -0
  70. package/.next/server/chunks/ssr/_08c4z-9._.js +1 -1
  71. package/.next/server/chunks/ssr/_0_qfdlw._.js +1 -1
  72. package/.next/server/chunks/ssr/_0b6_jv-._.js +3 -0
  73. package/.next/server/chunks/ssr/_0hxt2ul._.js +1 -1
  74. package/.next/server/chunks/ssr/_0i_6q1w._.js +1 -1
  75. package/.next/server/chunks/ssr/{_18xqmny._.js → _0no7i1o._.js} +2 -2
  76. package/.next/server/chunks/ssr/_0tzg--b._.js +3 -0
  77. package/.next/server/chunks/ssr/{_1ztk7p6._.js → _114ylv7._.js} +3 -3
  78. package/.next/server/chunks/ssr/{_1k0spz7._.js → _12c-iwh._.js} +2 -2
  79. package/.next/server/chunks/ssr/_12w42gi._.js +1 -1
  80. package/.next/server/chunks/ssr/{_0eaog6_._.js → _167hchk._.js} +2 -2
  81. package/.next/server/chunks/ssr/{_1x9pskj._.js → _1_x5spz._.js} +3 -3
  82. package/.next/server/chunks/ssr/{_0dr-ddg._.js → _1a61fc9._.js} +2 -2
  83. package/.next/server/chunks/ssr/_1jmz33w._.js +1 -1
  84. package/.next/server/chunks/ssr/{_1y6b5mr._.js → _1w_t7h7._.js} +2 -2
  85. package/.next/server/chunks/ssr/{_0dh2e1j._.js → _1wyfaq_._.js} +7 -7
  86. package/.next/server/chunks/ssr/{[root-of-the-server]__0bxsfyn._.js → _200gt-m._.js} +4 -3
  87. package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +1 -1
  88. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  89. package/.next/server/chunks/ssr/{_0c9e5w6._.js → features_workspace_00jz2hu._.js} +3 -4
  90. package/.next/server/chunks/ssr/{node_modules_0746rzi._.js → node_modules_02ai7br._.js} +1 -1
  91. package/.next/server/chunks/ssr/{node_modules_0vsxbzp._.js → node_modules_02deexj._.js} +1 -1
  92. package/.next/server/chunks/ssr/{node_modules_1g1eihe._.js → node_modules_07za262._.js} +1 -1
  93. package/.next/server/chunks/ssr/{node_modules_0332gw4._.js → node_modules_0_s9get._.js} +1 -1
  94. package/.next/server/chunks/ssr/{node_modules_1gpednh._.js → node_modules_0n3c7h0._.js} +1 -1
  95. package/.next/server/chunks/ssr/{node_modules_0t-9nup._.js → node_modules_0od6jwr._.js} +1 -1
  96. package/.next/server/chunks/ssr/{node_modules_0mxvg8h._.js → node_modules_0rdt7pk._.js} +1 -1
  97. package/.next/server/chunks/ssr/{node_modules_0vv0-fg._.js → node_modules_0w1z7kz._.js} +1 -1
  98. package/.next/server/chunks/ssr/{node_modules_1d53yiq._.js → node_modules_0wdupfz._.js} +1 -1
  99. package/.next/server/chunks/ssr/{node_modules_1u6w1pb._.js → node_modules_1720w0a._.js} +1 -1
  100. package/.next/server/chunks/ssr/{node_modules_1gu1pph._.js → node_modules_18lsg7d._.js} +1 -1
  101. package/.next/server/chunks/ssr/{node_modules_1he1w8_._.js → node_modules_1b94fxf._.js} +1 -1
  102. package/.next/server/chunks/ssr/{node_modules_0qbfyjh._.js → node_modules_1ecdo1s._.js} +1 -1
  103. package/.next/server/chunks/ssr/{node_modules_0qapgjr._.js → node_modules_1fa9ag7._.js} +1 -1
  104. package/.next/server/chunks/ssr/{node_modules_0d5uzof._.js → node_modules_1fv-_si._.js} +1 -1
  105. package/.next/server/chunks/ssr/{node_modules_1lnjapm._.js → node_modules_1hf461g._.js} +1 -1
  106. package/.next/server/chunks/ssr/{node_modules_1-urho9._.js → node_modules_1m71ta-._.js} +1 -1
  107. package/.next/server/chunks/ssr/{node_modules_1lynj9m._.js → node_modules_1n93n-g._.js} +1 -1
  108. package/.next/server/chunks/ssr/{node_modules_0fr-ml8._.js → node_modules_1n9lqu9._.js} +1 -1
  109. package/.next/server/chunks/ssr/{node_modules_04vxchl._.js → node_modules_1npnsvd._.js} +1 -1
  110. package/.next/server/chunks/ssr/{node_modules_0exkwcm._.js → node_modules_1rn2r0n._.js} +1 -1
  111. package/.next/server/chunks/ssr/{node_modules_022sipm._.js → node_modules_1vq-mfk._.js} +1 -1
  112. package/.next/server/chunks/ssr/{node_modules_00_51_v._.js → node_modules_1vzyw1t._.js} +1 -1
  113. package/.next/server/chunks/ssr/{node_modules_0wsvp00._.js → node_modules_1w359w4._.js} +1 -1
  114. package/.next/server/chunks/ssr/{node_modules_1xn6saw._.js → node_modules_1yajbl6._.js} +1 -1
  115. package/.next/server/chunks/ssr/{node_modules_16pi_dd._.js → node_modules_20eqhy8._.js} +1 -1
  116. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_067_exa._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_019sbis._.js} +1 -1
  117. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0nrrdaq._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0s6piq3._.js} +1 -1
  118. package/.next/server/chunks/ssr/{node_modules_@vercel_oidc_dist_21a5haa._.js → node_modules_@vercel_oidc_dist_05itbb1._.js} +1 -1
  119. package/.next/server/middleware-build-manifest.js +3 -3
  120. package/.next/server/pages/404.html +1 -1
  121. package/.next/server/pages/500.html +1 -1
  122. package/.next/server/server-reference-manifest.js +1 -1
  123. package/.next/server/server-reference-manifest.json +43 -43
  124. package/.next/static/chunks/{0dr16v67vj4n7.js → 07vqbk_9t4em4.js} +2 -2
  125. package/.next/static/chunks/{2nvepds1fu2ux.js → 08krja1zx7nqg.js} +1 -1
  126. package/.next/static/chunks/{42wcg3wfg_m_p.js → 0qcuwdk132jjt.js} +1 -1
  127. package/.next/static/chunks/{2_pnccjp6j1ca.js → 0z69gvysmave7.js} +1 -1
  128. package/.next/static/chunks/12fvz1w5ows75.js +1 -0
  129. package/.next/static/chunks/14t03ned286iu.js +1 -0
  130. package/.next/static/chunks/{2jlz8zp4jax_m.js → 156xxbkrz5lzu.js} +1 -1
  131. package/.next/static/chunks/1fz14reod4lft.js +1 -0
  132. package/.next/static/chunks/{0joan-69kbspd.js → 1g23dbabl-vkr.js} +1 -1
  133. package/.next/static/chunks/{18mkhstgiqcbt.js → 1qy_rc3oxfxok.js} +1 -1
  134. package/.next/static/chunks/1zea7qdl-7365.js +1 -0
  135. package/.next/static/chunks/1zvqumkg7kmo0.css +1 -0
  136. package/.next/static/chunks/26hpqt3y6bogl.js +12 -0
  137. package/.next/static/chunks/{3zk6q3-3f9swq.js → 2_j5mqm6d-z18.js} +1 -1
  138. package/.next/static/chunks/{1vj_5bnbxx84e.js → 2dt6tu7a22svs.js} +1 -1
  139. package/.next/static/chunks/2h5ls3d86kya6.js +1 -0
  140. package/.next/static/chunks/2wc6y1ht6dfuy.js +1 -0
  141. package/.next/static/chunks/{1i-u2wzub_to1.js → 2xr0zpll7thyi.js} +6 -6
  142. package/.next/static/chunks/{26ql4y-43xwhp.js → 31jztc-yq30m7.js} +1 -1
  143. package/.next/static/chunks/391af0i8eljzk.js +1 -0
  144. package/.next/static/chunks/{1kp5nfp06nj9h.js → 3p2s2cjokx1aa.js} +2 -2
  145. package/.next/static/chunks/{1wlo979mx-y3w.js → 41s3fml5oivsa.js} +1 -1
  146. package/README.md +60 -19
  147. package/docs/how-it-works.md +2 -0
  148. package/docs/live-calls.md +38 -33
  149. package/features/ai/load-tools.ts +4 -2
  150. package/features/ai/prompts/bot.prompt.ts +5 -5
  151. package/features/ai/prompts/live.prompt.ts +36 -132
  152. package/features/ai/prompts/prompt-helper.ts +5 -4
  153. package/features/ai/prompts/thursday.prompt.ts +75 -54
  154. package/features/ai/tools/call.tool.ts +32 -4
  155. package/features/ai/tools/tool-name.ts +1 -0
  156. package/features/bot/bot.runner.ts +5 -5
  157. package/features/thursday/ascii.const.ts +74 -0
  158. package/features/thursday/components/ascii-orb.tsx +173 -30
  159. package/features/thursday/components/face.tsx +6 -1
  160. package/features/thursday/components/side-captions.tsx +273 -0
  161. package/features/thursday/components/tab-state.tsx +11 -3
  162. package/features/thursday/components/thursday-setting.tsx +6 -5
  163. package/features/thursday/components/thursday.tsx +227 -251
  164. package/features/thursday/face.store.ts +5 -0
  165. package/features/thursday/thursday.action.ts +4 -6
  166. package/features/thursday/thursday.schema.ts +10 -5
  167. package/features/thursday/thursday.store.ts +3 -0
  168. package/features/thursday/use-thursday.ts +461 -392
  169. package/features/workspace/file-kind.ts +9 -0
  170. package/hooks/use-hotkey.ts +3 -2
  171. package/lib/live/live.schema.ts +0 -21
  172. package/lib/live/live.server.ts +1 -3
  173. package/package.json +1 -1
  174. package/scripts/artifact-paths.test.mts +13 -0
  175. package/scripts/live-session.test.mts +56 -66
  176. package/.next/server/chunks/[root-of-the-server]__0g-ueei._.js +0 -8
  177. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1kipdeo._.js +0 -3
  178. package/.next/server/chunks/ssr/[root-of-the-server]__172cq4x._.js +0 -3
  179. package/.next/server/chunks/ssr/_03_928f._.js +0 -3
  180. package/.next/server/chunks/ssr/_0g_rlog._.js +0 -3
  181. package/.next/server/chunks/ssr/_123ttsf._.js +0 -3
  182. package/.next/static/chunks/10k2xvap03z20.css +0 -1
  183. package/.next/static/chunks/1t9qms5pwwa3n.js +0 -1
  184. package/.next/static/chunks/2a51-ywz9b2a3.js +0 -1
  185. package/.next/static/chunks/2fvdgxih7x7hr.js +0 -1
  186. package/.next/static/chunks/3addj3i4-izma.js +0 -1
  187. package/.next/static/chunks/3gfh7nxwusbt0.js +0 -1
  188. package/.next/static/chunks/3gwa44cvz4qoi.js +0 -1
  189. package/.next/static/chunks/3zkg5iup3v4a2.js +0 -12
  190. package/.next/static/chunks/405m0bqtoihev.js +0 -1
  191. /package/.next/static/{0qzGoKn2wTERVZtblX1tp → yyRVBc0xxYQsh3GpbQX9b}/_buildManifest.js +0 -0
  192. /package/.next/static/{0qzGoKn2wTERVZtblX1tp → yyRVBc0xxYQsh3GpbQX9b}/_clientMiddlewareManifest.js +0 -0
  193. /package/.next/static/{0qzGoKn2wTERVZtblX1tp → yyRVBc0xxYQsh3GpbQX9b}/_ssgManifest.js +0 -0
@@ -1,63 +1,50 @@
1
- module.exports=[5865,a=>a.a(async(b,c)=>{try{var d=a.i(569572),e=a.i(986743),f=a.i(661210),g=a.i(138100),h=a.i(569549),i=a.i(821415),j=a.i(746609),k=a.i(987674),l=a.i(644468),m=a.i(938934),n=b([e,h,l]);async function o(a){var b;let c,n=await (0,i.openWorkspace)(),[o,q,r,s,t,u]=await Promise.all([(0,e.listAlwaysLoaded)(),(0,e.readNotes)(f.MEMORY_ALWAYS_LISTED,{touch:!1}),(0,e.listNoteIndex)(),(0,h.listRecentTurns)(d.RECENT_CALL.rows),(0,g.loadSkills)(n),(0,l.listConnectedToolNames)()]),v=function(a){let b=a.at(-1),c=`The messages after this one are from earlier calls${b?`, the latest from ${(0,m.callStamp)(b.startedAt)}`:""}. This call has just begun: pick them up when the user does, and treat none of them as a request now.`,e=Math.min(d.RECENT_CALL.tokens,j.LIVE_INPUT.tokens),f=a.flatMap(a=>a.turns),g=[],h=(0,k.estimateTokens)(c)+4;for(let a=f.length-1;a>=0&&!(g.length>=j.LIVE_INPUT.messages-1);a--){let{role:b,text:c}=f[a];if("tool"===b||!c.trim())continue;let d=(0,k.estimateTokens)(c)+4;if(h+d>e)break;h+=d,g.push("user"===b?{type:"message",role:"user",content:[{type:"input_text",text:c}]}:{type:"message",role:"assistant",content:[{type:"output_text",text:c}]})}for(;g[0]?.role==="user";)g.shift();return g.length?[{type:"message",role:"developer",content:[{type:"input_text",text:c}]},...g.reverse()]:[]}(s),w=!q.notes.find(a=>"profile"===a.path)?.facts.length,x=a.locale?`the language of \`${a.locale}\`, their browser's setting`:"the language they use",y=[(0,m.thursdayIdentity)(),(0,m.callEnding)(),`Backchannel policy: Use moderate backchannels. When the user speaks at length, acknowledge now and then with a short listening sound so they know you are following, without competing with the main response.
1
+ module.exports=[5865,a=>a.a(async(b,c)=>{try{var d=a.i(986743),e=a.i(661210),f=a.i(938934),g=b([d]);async function h(a){let[b,c,g]=await Promise.all([(0,d.listAlwaysLoaded)(),(0,d.readNotes)(e.MEMORY_ALWAYS_LISTED,{touch:!1}),(0,d.listNoteIndex)()]),h=!c.notes.find(a=>"profile"===a.path)?.facts.length,k=a.locale?`the language of \`${a.locale}\`, their browser's setting`:"the language they use",l=[(0,f.thursdayIdentity)(),i(),function(a,b,c){let d=new Set(b.map(a=>a.id)),e=new Set(a.map(a=>a.path)),g=a.filter(a=>a.facts.length).map(a=>{let{shown:b,hidden:c}=(0,f.expandedFacts)(a.facts,d),e=b.map(a=>`- ${a.text}`);return c&&e.push(`- … ${c} more in this note`),`${a.path}:
2
+ ${e.join("\n")}`}),h=b.filter(a=>!e.has(a.path)),i=c.filter(a=>!e.has(a.path));if(!g.length&&!h.length&&!i.length)return"";let j=[...g,h.length?`Carried into every call:
3
+ ${(0,f.carriedLines)(h,{ids:!1})}`:"",i.length?`Everything else you have kept — path — what it is about (facts) "what they call it":
2
4
 
3
- Interruption policy: Stop speaking when the user interrupts. Listen to what they say.`,(b={reach:(0,m.reachNames)(t,u),webSearch:a.webSearch},c=["- Memory: recall, keep, correct and forget what the user tells you, across calls.","- This computer: run a quick command and look at files.",b.webSearch?"- Web: look things up.":"",`- Background work: bots with this computer, a real browser, the web and far more time than a call take on anything longer, so almost anything the user asks for can be done.${b.reach?` What bots can reach for: ${b.reach}.`:""} That work can be followed, answered, corrected or cancelled.`,"- End the call."].filter(Boolean),`Delegation policy:
4
- Backend tools:
5
- ${c.join("\n")}
5
+ ${(0,f.noteLines)(i,(0,f.tidying)(c).crowded)}
6
6
 
7
- Delegate to the backend when:
8
- - The user wants something done, found out, remembered, corrected or forgotten.
9
- - The user says something worth keeping — who they are, how they want things done and said, the people in their life, their plans. Hand it over as they say it, not at the end of the call.
10
- - The user asks about, answers, corrects or cancels background work.
11
- - The user asks about something they told you before that is not written out below.
12
- - The user wants to end the call. Only the backend can end the line.
7
+ What is in these notes, the backend recalls.`:""].filter(Boolean);return`## What you know about them
13
8
 
14
- Do not delegate to the backend when:
15
- - The user greets you, makes small talk, or asks you to repeat a result already given.
16
- - You need a brief clarification to understand the request.
9
+ ${j.join("\n\n")}
17
10
 
18
- Delegate before giving an answer that depends on backend work.
19
- Do not guess the result while waiting.
11
+ Preferences are how they want things done and said: follow them. A topic not listed is one you know nothing about yet.`}(c.notes,b,g),h?`## First call
20
12
 
21
- Background work you started is yours until it is done. Updates about it reach you once, when the line is quiet. Tell the user the part that answers what they asked; the whole of it is on their screen.`),function(a,b,c){let d=new Set(b.map(a=>a.id)),e=new Set(a.map(a=>a.path)),f=a.filter(a=>a.facts.length).map(a=>{let{shown:b,hidden:c}=(0,m.expandedFacts)(a.facts,d),e=b.map(a=>`- ${a.text}`);return c&&e.push(`- … ${c} more in this note`),`${a.path}:
22
- ${e.join("\n")}`}),g=b.filter(a=>!e.has(a.path)),h=c.filter(a=>!e.has(a.path));if(!f.length&&!g.length&&!h.length)return"";let i=[...f,g.length?`Carried into every call:
23
- ${(0,m.carriedLines)(g,{ids:!1})}`:"",h.length?`Everything else you have kept — path — what it is about (facts) "what they call it":
13
+ Nothing is known about this user yet. Across the call, one thing at a time and never as a list of questions, find out what to call them, their name, what they do, how old they are, where they live, and whatever else they offer. If they came with something they want done, that comes first.`:"",j(a.voicePrompt)].filter(Boolean).join("\n\n");return(0,f.logPromptSize)("live",l),{text:l,opening:a.calledBack?"You placed this call because background work has something for the user; it comes in next. Speak first: greet them in one line and say that is why you called.":h?`Open the call now, in ${k}: say who you are and what you are here to do for them, in a line or two, then ask what to call them. Then stop and listen.`:"The call has just started. Speak first: greet the user naturally, in one line."}}[d]=g.then?(await g)():g;let i=()=>`## Always
24
14
 
25
- ${(0,m.noteLines)(h,(0,m.tidying)(c).crowded)}`:""].filter(Boolean);return`## What you know about them
15
+ ${(0,f.callEnding)()}
26
16
 
27
- ${i.join("\n\n")}
17
+ Backchannel policy: Use moderate backchannels. When the user speaks at length, acknowledge now and then with a short listening sound so they know you are following, without competing with the main response.
28
18
 
29
- Preferences are how they want things done and said: follow them. A topic not listed is one you know nothing about yet.`}(q.notes,o,r),w?`## First call
19
+ Interruption policy: Stop speaking when the user interrupts. Listen to what they say.
30
20
 
31
- Nothing is known about this user yet, and this is the only call that opens that way: what you do not learn here you carry on without. Find out what to call them, their name, what they do, how old they are, where they live, and whatever else they offer about themselves. Ask across the whole call, one thing at a time, in the room a conversation leaves — never as a list of questions. Hand each over the moment they say it: nothing from this call is kept unless it goes to the backend. If they came with something they want done, that comes first.`:function(a){let{crowded:b,heavy:c}=(0,m.tidying)(a);if(!b&&!c.length)return"";let d=[...c].sort((a,b)=>b.factCount-a.factCount).slice(0,3).map(a=>a.path);return`## Memory needs tidying
32
-
33
- Saved memory has grown past what it holds well${d.length?` (${d.join(", ")})`:""}. Bring it up once, before anything of your own. Go through what looks out of date with the user, and forget only what they name.`}(r),p(a.voicePrompt)].filter(Boolean).join("\n\n");(0,m.logPromptSize)("live",y);let{crowded:z,heavy:A}=(0,m.tidying)(r);return{text:y,input:v,opening:a.calledBack?"You placed this call because background work has something for the user; it comes in next. Speak first: greet them in one line and say that is why you called.":w?`Open the call now, in ${x}: say who you are and what you are here to do for them, in a line or two, then ask what to call them. Then stop and listen.`:z||A.length?"Open the call now: greet the user in one line and mention that saved memory needs tidying. Then stop and listen; anything they came with comes first.":"The call has just started. Speak first: greet the user naturally, in one line."}}[e,h,l]=n.then?(await n)():n;let p=a=>a?.trim()?`## Additional instructions
21
+ Delegation policy:
22
+ Delegate to the backend everything the user asks for, tells you or asks about, except greetings, small talk and a brief clarification.
23
+ Whatever they tell you about themselves, the people in their life, their plans or how they want things done goes to the backend as they say it, however small — unless it is already written below.
24
+ Answer from what the backend returns, and do not guess the result while waiting.`,j=a=>a?.trim()?`## Additional instructions
34
25
 
35
26
  Written by the user. Follow them together with everything above; for tone, language and wording they take precedence.
36
27
 
37
- ${a.trim()}`:"";a.s(["loadLivePrompt",0,o]),c()}catch(a){c(a)}},!1),614747,a=>a.a(async(b,c)=>{try{var d=a.i(569572),e=a.i(762008),f=a.i(221214),g=a.i(344853),h=a.i(986743),i=a.i(661210),j=a.i(138100),k=a.i(569549),l=a.i(821415),m=a.i(176668),n=a.i(644468),o=a.i(938934),p=b([f,g,h,k,n]);async function q(a){var b,c,p,q,s,t;let u,v=await (0,l.openWorkspace)(),[w,x,y,z,A,B,C,D]=await Promise.all([(0,j.loadSkills)(v),(0,h.listNoteIndex)(),(0,h.listAlwaysLoaded)(),(0,h.readNotes)(i.MEMORY_ALWAYS_LISTED,{touch:!1}),(0,n.listConnectedToolNames)(),(0,f.listJobBots)(),(0,k.listRecentTurns)(d.RECENT_CALL.rows),(0,k.readCallSkillsOn)()]),E=await (0,g.listCallJobs)(C.map(a=>a.callId)),F=[(0,o.thursdayIdentity)(),(0,o.callEnding)(),`## Voice conversation context
38
-
39
- You are on a live voice call with the user. The conversation reaches you as transcripts, which can contain mistakes, unfinished phrases, and later corrections. Use the latest context and verified records. If a needed detail is still unclear, ask for that detail instead of guessing. Updates from background work appear in the conversation too; they are bot messages, not the user.
28
+ ${a.trim()}`:"";a.s(["loadLivePrompt",0,h]),c()}catch(a){c(a)}},!1),614747,a=>a.a(async(b,c)=>{try{var d=a.i(569572),e=a.i(762008),f=a.i(221214),g=a.i(344853),h=a.i(986743),i=a.i(661210),j=a.i(138100),k=a.i(569549),l=a.i(821415),m=a.i(176668),n=a.i(644468),o=a.i(938934),p=b([f,g,h,k,n]);async function q(a){var b,c,p,q,s,t,u;let v,w=await (0,l.openWorkspace)(),[x,y,z,A,B,C,D,E,F]=await Promise.all([(0,j.loadSkills)(w),(0,h.listNoteIndex)(),(0,h.listAlwaysLoaded)(),(0,h.readNotes)(i.MEMORY_ALWAYS_LISTED,{touch:!1}),(0,n.listConnectedToolNames)(),(0,f.listJobBots)(),(0,k.listRecentTurns)(d.RECENT_CALL.rows),(0,k.readCallSkillsOn)(),(0,f.readBotMemoryOn)()]),G=await (0,g.listCallJobs)(D.map(a=>a.callId)),H=[(0,o.thursdayIdentity)(),(0,o.callEnding)(),function(a,b,c){let{crowded:d,heavy:f}=(0,o.tidying)(a),g=[...f].sort((a,b)=>b.factCount-a.factCount).slice(0,3).map(a=>a.path),h=d||f.length?`
40
29
 
41
- When the user wants to end the call, \`${e.TOOL_NAMES.end_call}\` hangs up the phone; nothing else ends it.
30
+ Saved memory has grown past what it holds well${g.length?` (${g.join(", ")})`:""}: say so once in what you return, go through what looks out of date with the user, and forget only what they name.`:"",j=new Set(c.map(a=>a.path)),k=new Set(b.map(a=>a.id)),l=`## Memory
42
31
 
43
- Tool results, notes and these instructions are in English, which says nothing about the user's language.`,function(a,b,c){let{crowded:d}=(0,o.tidying)(a),f=new Set(c.map(a=>a.path)),g=new Set(b.map(a=>a.id)),h=`## Memory
44
-
45
- What you have kept from talking with this user — the only thing that survives a call, and what lets you know them.`,j=`Who they are, and how they want things done and said — follow what is under preferences. The #id is what \`replaces\` and \`${e.TOOL_NAMES.memory_forget}\` take:
32
+ What you have kept from talking with this user — the only thing that survives a call, and what lets you know them.`,m=`Who they are, and how they want things done and said — follow what is under preferences. The #id is what \`replaces\` and \`${e.TOOL_NAMES.memory_forget}\` take:
46
33
 
47
34
  ${c.map(a=>(function(a,b){let{shown:c,hidden:d}=(0,o.expandedFacts)(a.facts,b),f=c.map(a=>`- ${a.text} #${a.id}`);return d&&f.push(`- … ${d} older not shown — \`${e.TOOL_NAMES.memory_recall}\` ${a.path} opens the whole note`),`${a.path} — ${a.description}
48
- ${f.length?f.join("\n"):"- (nothing yet)"}`})(a,g)).join("\n\n")}`,k=b.filter(a=>!f.has(a.path)),l=k.length?`Already known — carried into every call:
35
+ ${f.length?f.join("\n"):"- (nothing yet)"}`})(a,k)).join("\n\n")}`,n=b.filter(a=>!j.has(a.path)),p=n.length?`Already known — carried into every call:
49
36
 
50
- ${(0,o.carriedLines)(k)}`:"",m=`Every other note — path — what is under it (facts) "what the user calls it":
37
+ ${(0,o.carriedLines)(n)}`:"",q=`Every other note — path — what is under it (facts) "what the user calls it":
51
38
 
52
- ${(0,o.noteLines)(a.filter(a=>!f.has(a.path)),d)}
39
+ ${(0,o.noteLines)(a.filter(a=>!j.has(a.path)),d)}${h}
53
40
 
54
41
  Open a note before answering out of it; a topic not listed is one you know nothing about. A fact marked \`said\` came from a call; \`${e.TOOL_NAMES.memory_conversation}\` opens that call when the line alone cannot answer.
55
42
 
56
- Keep what the user tells you as it comes up, with \`${e.TOOL_NAMES.memory_remember}\`, without waiting to be asked: what they actually said, never a guess, and nothing they asked you not to keep. From a bot's report, keep only what it confirmed about them, not the work.
43
+ Keep what the user tells you as it comes up, with \`${e.TOOL_NAMES.memory_remember}\`, without waiting to be asked: what they actually said, never a guess, nothing they asked you not to keep, and from a bot's report only what it confirmed about them.
57
44
 
58
- A later call finds a note only by what this listing shows — its path, its line and the names in quotes. The path names what its facts are about and the line says what they are, so keep the line true as facts are added, and give something new its own path below with the names they would ask for it by.
45
+ **Keep memory clean as you write.** A fact that repeats, narrows or changes one already in the note replaces it, merged into one line, rather than sitting beside it. A later call finds a note only by its path, its line and the names in quotes: keep the line true, and give something new its own path below.
59
46
 
60
- ${i.MEMORY_PATHS.map(a=>`- ${a.path} — ${a.of}`).join("\n")}`;return[h,j,l,m].filter(Boolean).join("\n\n")}(x,y,z.notes),(b=B,c=(0,o.reachNames)(D?[]:w,A),0===b.length?"":`## Background work
47
+ ${i.MEMORY_PATHS.map(a=>`- ${a.path} — ${a.of}`).join("\n")}`;return[l,m,p,q].filter(Boolean).join("\n\n")}(y,z,A.notes),(b=C,c=(0,o.reachNames)(E?[]:x,B),p=F,0===b.length?"":`## Background work
61
48
 
62
49
  Who you hand work to — the names \`${e.TOOL_NAMES.delegate}\` takes.
63
50
 
@@ -65,36 +52,34 @@ ${b.map(a=>`- **${a.name}** — ${a.description}`).join("\n")}${c?`
65
52
 
66
53
  What bots can reach for: ${c}.`:""}
67
54
 
68
- **A bot can take on almost anything.** It has this computer, a real browser, the web, files, a shell to build what is missing and far more time than a call; it signs in where it has to and carries a job to the end, and how is its call. So something you do not know how to do is a job, not a no. Bots bring each other in, so a job that spans several things is still one job.
69
-
70
- **Anything that takes more than a few seconds is a bot's**; a note, a look at a file or one command is yours. Write the request in the user's own words, with what it stands on — including how they told you they want work done — and nothing they did not say.
55
+ **A bot can take on almost anything, and anything that takes more than a few seconds is a bot's**; a note, a look at a file or one command is yours. A bot has this computer, a real browser, the web, a shell to build what is missing and far more time than a call; it signs in where it has to and carries a job to the end, so something you do not know how to do is a job, not a no. Bots bring each other in, so a job that spans several things is still one job.${p?" Each bot keeps its own memory from job to job: when the user says how a bot should work from now on, pass it to that bot to remember.":""}
71
56
 
72
57
  **A job is a thread.** Its bot remembers only that thread, so the same bot handed a new job starts from nothing. More about work already handed over — an answer, a correction, the next step once it finished — goes to that job with \`${e.TOOL_NAMES.thread}\`; a new request is a new job. Before answering about work, read it with \`${e.TOOL_NAMES.thread}\` \`status\`.
73
58
 
74
- Updates and questions from jobs reach the conversation by themselves, with their thread and question id. Pass the user's answer on with \`${e.TOOL_NAMES.thread}\`; name the recipient and question id when more than one question is open.
59
+ **Ask once before handing work over.** Return in one line what you would do — which bot, and whether it starts a new thread or carries on one already open — as a question to the user; when they have already said, or leave it to you, decide and send it. Write the request in the user's own words, with what it stands on — including how they told you they want work done — and nothing they did not say.
75
60
 
76
- When the user wants to see a job, open it on their screen with \`${e.TOOL_NAMES.thread}\` \`open\`. Once you have explained enough of how a job ended, mark it with \`${e.TOOL_NAMES.thread}\` \`seen\`, or leave it for the user to open; never mention seen to them.`),(p=v.cwd,q=D?w:[],u=`## This computer
61
+ Updates and questions from jobs reach the conversation by themselves, with their thread and question id; they come from bots, not the user. When the user wants to see a job, open it on their screen with \`${e.TOOL_NAMES.thread}\` \`open\`. Once you have explained enough of how a job ended, mark it with \`${e.TOOL_NAMES.thread}\` \`seen\`, or leave it for the user to open; never mention seen to them.`),(q=w.cwd,s=E?x:[],v=`## This computer
77
62
 
78
- Current Cwd: ${p}
63
+ Current Cwd: ${q}
79
64
  Platform: ${process.platform}
80
65
 
81
- Where \`${e.TOOL_NAMES.bash}\` runs, and what the paths you get back are relative to. Each command is cut off after ${Math.round(d.CALL_EXEC_TIMEOUT_MS/1e3)} seconds; anything longer is a bot's.`,0===q.length?u:`${u}
66
+ Where \`${e.TOOL_NAMES.bash}\` runs, and what the paths you get back are relative to. Each command is cut off after ${Math.round(d.CALL_EXEC_TIMEOUT_MS/1e3)} seconds; anything longer is a bot's.`,0===s.length?v:`${v}
82
67
 
83
68
  Skills are written-down ways of doing things here. \`${e.TOOL_NAMES.load_skill}\` opens one, and what it says goes for you too: read one when it covers what was asked and the doing is a glance. Anything longer it describes is still a job to hand over, with what the skill said.
84
69
 
85
- ${(0,o.skillLines)(q,{short:!0})}`),`## Return the result
70
+ ${(0,o.skillLines)(s,{short:!0})}`),`## Return the result
86
71
 
87
- Return the relevant facts, whether the task is complete, and what comes next — for a job you handed over, who has it. Use confirmed values from tool results and the notes above, and never invent a successful action. What you return is said aloud: keep it short and plain.`,(s=C,t=E,s.some(a=>a.turns.length>0)?`## Earlier calls
72
+ Return the relevant facts, whether the task is complete, and what comes next — for a job you handed over, who has it — or the one question the user has to answer first. Use confirmed values from tool results and the notes above, and never invent a successful action. What you return is said aloud: keep it short and plain.`,(t=D,u=G,t.some(a=>a.turns.length>0)?`## Earlier calls
88
73
 
89
74
  What was said on the last calls, verbatim, newest last. It is the past: pick it up when the user does, and never answer it as a new request.
90
75
 
91
76
  A \`${e.TOOL_NAMES.delegate}\` line carries the job's handle and how it ended; the handle is for \`${e.TOOL_NAMES.thread}\`, never said aloud. What they ask for now is often one of these carried further.
92
77
 
93
- ${(0,o.recentCallLines)(s.map(a=>({...a,jobs:t.filter(b=>b.callId===a.callId)})),d.RECENT_CALL.tokens)}`:""),r(a)].filter(Boolean).join("\n\n");return(0,o.logPromptSize)("thursday",F),m.logger.debug(`thursday prompt
94
- ${F}`),F}[f,g,h,k,n]=p.then?(await p)():p;let r=a=>a?.trim()?`## Additional instructions
78
+ ${(0,o.recentCallLines)(t.map(a=>({...a,jobs:u.filter(b=>b.callId===a.callId)})),d.RECENT_CALL.tokens)}`:""),r(a)].filter(Boolean).join("\n\n");return(0,o.logPromptSize)("thursday",H),m.logger.debug(`thursday prompt
79
+ ${H}`),H}[f,g,h,k,n]=p.then?(await p)():p;let r=a=>a?.trim()?`## Additional instructions
95
80
 
96
81
  Written by the user. Follow them together with everything above.
97
82
 
98
- ${a.trim()}`:"";a.s(["loadThursdayPrompt",0,q]),c()}catch(a){c(a)}},!1),69721,a=>{"use strict";var b=a.i(53112),c=a.i(569572),d=a.i(176668),e=a.i(293480),f=a.i(746609);let g=b.z.object({session:b.z.object({id:b.z.string().min(1)}),transport:b.z.object({type:b.z.literal("webrtc"),sdp:b.z.string().min(1)})}),h=new Map;async function i(a){let{apiKey:b,model:e,effort:f}=a,g=`${e} ${f??"auto"}`,i=h.get(g);if(void 0!==i)return i;let j="none"===f?{effort:f}:{...f?{effort:f}:{},summary:"auto"};for(;;){let a=await fetch("https://api.openai.com/v1/responses/input_tokens",{method:"POST",headers:{Authorization:`Bearer ${b}`,"Content-Type":"application/json"},signal:AbortSignal.timeout(c.LIVE_CALL.reasoningCheckMs),body:JSON.stringify({model:e,input:".",reasoning:j})}).catch(()=>null);if(!a)return j;let f=Object.keys(j).length?j:null;if(a.ok)return h.set(g,f),f;let i=await a.json().catch(()=>null),k=i?.error?.param?.replace(/^reasoning\./,"");if("effort"!==k&&"summary"!==k||!(k in j))return j;if(d.logger.warn(`${e} takes no reasoning ${k}; calls omit it`),delete j[k],!Object.keys(j).length)return h.set(g,null),null}}async function j(a){let b,h=await fetch("https://api.openai.com/v1/live/sessions",{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"},signal:AbortSignal.timeout(c.LIVE_CALL.startupMs),body:JSON.stringify({session:{model:f.LIVE_MODEL,instructions:a.instructions,input:a.input,audio:{output:{voice:a.voice}},store:!1,delegation:{type:"responses",responses:{model:a.backend.model,instructions:a.backend.instructions,tools:[...a.backend.tools.map(a=>({type:"function",...a})),...a.backend.webSearch?[{type:"web_search"}]:[]],tool_choice:"auto",parallel_tool_calls:!0,max_output_tokens:c.LIVE_CALL.backendOutputTokens,...a.backend.reasoning?{reasoning:a.backend.reasoning}:{}}}},transport:{type:"webrtc",sdp:a.sdp}})}).catch(a=>{d.logger.warn("OpenAI Live unreachable",a),(0,e.publicError)("Could not reach OpenAI Live.")}),i=await h.text();try{b=JSON.parse(i)}catch{b=null}if(!h.ok){let a=b;(0,e.publicError)(a?.error?.message||i||`OpenAI Live refused the call (${h.status}).`)}let j=g.safeParse(b);return j.success||(0,e.publicError)("OpenAI Live returned an invalid session connection."),j.data}a.s(["acceptedReasoning",0,i,"createLiveCall",0,j])},229666,a=>a.a(async(b,c)=>{try{var d=a.i(912714),e=a.i(750227);a.i(569572);var f=a.i(221214);a.i(684321);var g=a.i(821415),h=a.i(293480),i=b([f]);async function j(a){let b=await (0,g.insideWorkspace)(a);return b?.startsWith(g.ARTIFACTS+e.sep)||(0,h.publicError)("Not an artifact"),b}async function k(){let a=await (0,f.listBotNames)();return new Map(a.map(a=>[(0,g.botFolderName)(a).toLowerCase(),a]))}async function l(a){let b=await j(a),c=await (0,d.stat)(b).catch(()=>null);if(c||(0,h.publicError)("Not found"),c.isDirectory()){let a=(0,e.relative)(g.ARTIFACTS,b);!a.includes(e.sep)&&(await k()).has(a.toLowerCase())&&(0,h.publicError)("That is a bot's whole folder, not one artifact"),await (0,d.rm)(b,{recursive:!0});return}await (0,d.rm)(b)}[f]=i.then?(await i)():i,a.s(["deleteArtifact",0,l]),c()}catch(a){c(a)}},!1),260210,a=>a.a(async(b,c)=>{try{var d=a.i(137936),e=a.i(229666),f=a.i(225689),g=a.i(293480),h=a.i(713095),i=b([e]);[e]=i.then?(await i)():i;let j=(0,f.serverAction)(async a=>{let b=a.trim();b||(0,g.publicError)("Which artifact?"),await (0,e.deleteArtifact)(b)});(0,h.ensureServerEntryExports)([j]),(0,d.registerServerReference)(j,"7fdfde4d1a50997bdc8832f2b580bf9e327ea44394",null),a.s(["deleteArtifactAction",0,j]),c()}catch(a){c(a)}},!1),362562,(a,b,c)=>{b.exports=a.x("module",()=>require("module"))},910350,a=>a.a(async(b,c)=>{try{var d=a.i(137936),e=a.i(53112),f=a.i(689656),g=a.i(225689),h=a.i(293480),i=a.i(221214),j=a.i(674986),k=a.i(446957),l=a.i(636616),m=a.i(344853),n=a.i(713095),o=b([i,j,m]);[i,j,m]=o.then?(await o)():o;let p=(0,g.serverAction)(async a=>{let b=k.BotFormSchema.parse(a),c=await (0,i.createBot)(b);return c||(0,h.publicError)(`"${b.name}" already exists`),{name:c.name}}),q=(0,g.serverAction)(async(a,b)=>{let c=k.BotFormSchema.partial().parse(b);await (0,i.updateBot)(a,c)||(0,h.publicError)("Bot not found")}),r=e.z.object({name:e.z.string().trim().min(1).max(80),provider:f.textModelProviderSchema.nullish(),model:e.z.string().trim().min(1).max(80).nullish(),icon:k.botIconSchema.optional()}),s=(0,g.serverAction)(async a=>{let b=r.array().max(20).parse(a),c=(0,l.rollSeedIcons)(),d=[];for(let[a,e]of b.entries()){let b=(0,l.findBotSeed)(e.name);if(!b)continue;let f=await (0,i.createBot)({name:b.name,description:b.description,systemPrompt:b.systemPrompt,icon:e.icon??c[a%c.length],provider:e.provider,model:e.model,toolIds:[]});f&&d.push(f.name)}return{created:d}}),t=(0,g.serverAction)(async a=>{await (0,i.deleteBot)(a)||(0,h.publicError)("Bot not found")}),u=(0,g.serverAction)(async a=>{await (0,i.writeBotMemoryOn)(!0===a)}),v=(0,g.serverAction)(async(a,b)=>{let c,d,e=b.trim();e||(0,h.publicError)("Nothing to hand over.");let f=await (0,i.findJobBot)(a);(!f||f.disabled)&&(0,h.publicError)(`No enabled bot called "${a}".`);let g=(d=(c=e.replace(/\s+/g," ").trim().split(" ")).slice(0,4).join(" "),(c.length>4?`${d}…`:d).slice(0,60));return{id:await (0,j.startThread)({bot:f.name,request:e,label:g,from:"user"}),label:g,bot:f.name}}),w=(0,g.serverAction)(async(a,b,c,d)=>{let e=await (0,m.resolveThread)(a);return e||(0,h.publicError)(`No job called "${a}".`),b.trim()||(0,h.publicError)("Nothing to tell it."),await (0,j.answerThread)(e.id,b.trim(),"user",c,d),{id:e.id,label:e.label,status:"running"}}),x=(0,g.serverAction)(async a=>{let b=await (0,m.resolveThread)(a);return b||(0,h.publicError)(`No job called "${a}".`),await (0,j.cancelThread)(b.id),{id:b.id,label:b.label,status:"cancelled"}}),y=(0,g.serverAction)(async a=>{await (0,m.markSeen)(a.filter(a=>"string"==typeof a&&a))}),z=(0,g.serverAction)(async a=>{await (0,j.removeThread)(a)||(0,h.publicError)("Thread not found")}),A=(0,g.serverAction)(async()=>({removed:await (0,j.removeFinishedThreads)()})),B=(0,g.serverAction)(async b=>{let{acceptRoomRelays:c}=await a.A(951922);await c(e.z.number().int().positive().array().parse(b))});(0,n.ensureServerEntryExports)([p,q,s,t,u,v,w,x,y,z,A,B]),(0,d.registerServerReference)(p,"7f58aef9b1112c446a825eb91efeb31666d87818a9",null),(0,d.registerServerReference)(q,"7febfcf243b0d219242be2d3ed5d9ca8e02b529d3d",null),(0,d.registerServerReference)(s,"7f715086ad9fe6863a53cb04b7ff210ffdcd44d4da",null),(0,d.registerServerReference)(t,"7f58405429879fb5e976934f2419d2897ebc277c60",null),(0,d.registerServerReference)(u,"7f4ddb467fada0fcab742f28c2cd7a0a6b4195c009",null),(0,d.registerServerReference)(v,"7f647faa7f1919a4f08f73dcc78e04901429e8c75e",null),(0,d.registerServerReference)(w,"7f3520b407abd92fdf69d02d2f364032903f49fa11",null),(0,d.registerServerReference)(x,"7f503964271cf21576536fd7e051e10454f1c4e9bc",null),(0,d.registerServerReference)(y,"7ffe9230c748738877501065308042e15107c43db5",null),(0,d.registerServerReference)(z,"7f1f4eedad50097c78f50ee80637fedd36da6d9a4d",null),(0,d.registerServerReference)(A,"7f45bd8152273b835b8d00740e6ada4ffb33542287",null),(0,d.registerServerReference)(B,"7fd781d4a746f72383016595ed69160857b07e0be9",null),a.s(["acceptThreadRelaysAction",0,B,"answerThreadAction",0,w,"cancelThreadAction",0,x,"clearFinishedThreadsAction",0,A,"createBotAction",0,p,"createSeedBotsAction",0,s,"deleteBotAction",0,t,"deleteThreadAction",0,z,"markSeenAction",0,y,"setBotMemoryOnAction",0,u,"startThreadAction",0,v,"updateBotAction",0,q]),c()}catch(a){c(a)}},!1),937864,a=>a.a(async(b,c)=>{try{var d=a.i(137936),e=a.i(53112),f=a.i(652619),g=a.i(225689),h=a.i(293480),i=a.i(688034),j=a.i(725466),k=a.i(713095),l=b([f,j]);[f,j]=l.then?(await l)():l;let m=e.z.enum(i.CONFIG_KEYS),n=(0,g.serverAction)(async(a,b)=>{let c=e.z.object({key:m,value:e.z.string().trim().min(1)}).parse({key:a,value:b}),d=i.CONFIG_ENTRIES[c.key];d?.signIn&&(0,h.publicError)(`${d.label} takes a sign-in, not a key.`),d?.choices?(0,i.acceptsChoice)(d,c.value)||(0,h.publicError)("That is not one of the options."):c.value.length<8&&(0,h.publicError)("That does not look like a key"),await (0,j.writeConfig)(c.key,c.value)}),o=(0,g.serverAction)(async a=>{await (0,j.removeConfig)(m.parse(a))}),p=(0,g.serverAction)(async()=>(0,f.startChatGptSignIn)());(0,k.ensureServerEntryExports)([n,o,p]),(0,d.registerServerReference)(n,"7f0bf76a4aa995e0c29f10cf31783d7b3f36e9294a",null),(0,d.registerServerReference)(o,"7f008a27595d5d6e96e1685cb7afd843882426f54b",null),(0,d.registerServerReference)(p,"7f9063d6960a24f8e17b8914ee4f6630c7fca22456",null),a.s(["removeConfigAction",0,o,"setConfigAction",0,n,"startChatGptSignInAction",0,p]),c()}catch(a){c(a)}},!1),935930,a=>a.a(async(b,c)=>{try{var d=a.i(137936),e=a.i(569572),f=a.i(947950),g=a.i(899284),h=a.i(225689),i=a.i(293480),j=a.i(182248),k=a.i(317844),l=a.i(713095),m=b([f,k]);[f,k]=m.then?(await m)():m;let o=(0,h.serverAction)(async a=>{let b=g.MCPServerFormSchema.parse(a);b.name===e.STUDIO_SERVER&&(0,i.publicError)(`"${e.STUDIO_SERVER}" is the app's own — pick another name`);let c=!!await (0,f.findServerDetail)(b.name);await (0,f.upsertServer)(b);let d=await n(b.name);return"error"!==d.status||c||await (0,f.deleteServer)(b.name),d}),p=(0,h.serverAction)(async a=>(await k.mcpManager.disconnect(a),n(a))),q=(0,h.serverAction)(async a=>{await k.mcpManager.disconnect(a),await (0,f.deleteServer)(a)||(0,i.publicError)("Server not found")});async function n(a){try{let b=await k.mcpManager.connect(a);return"auth_required"===b.status?{name:a,status:"auth_required",authorizationUrl:b.authorizationUrl,toolCount:0}:{name:a,status:"connected",toolCount:b.tools.length}}catch(b){return{name:a,status:"error",toolCount:0,error:(0,j.errorToString)(b)}}}let r=(0,h.serverAction)(async(a,b,c)=>{try{return await k.mcpManager.callTool(a,b,c)}catch(a){a instanceof k.McpAuthRequiredError&&(0,i.publicError)("Authorization required — reconnect this server first"),(0,i.publicError)((0,j.errorToString)(a))}});(0,l.ensureServerEntryExports)([o,p,q,r]),(0,d.registerServerReference)(o,"7f163c4d9598d15a4906a7963afe8e78c6e974aae2",null),(0,d.registerServerReference)(p,"7f94c3fa4cf21252412cebf5bc09f3c41b683622af",null),(0,d.registerServerReference)(q,"7fa3265273969b2f06c444fae58fd0dff4146dd041",null),(0,d.registerServerReference)(r,"7fee33e06c7949c9115a2d9d6fe41af5ace83a4e06",null),a.s(["callToolAction",0,r,"deleteServerAction",0,q,"refreshServerAction",0,p,"registerServerAction",0,o]),c()}catch(a){c(a)}},!1),542715,a=>a.a(async(b,c)=>{try{var d=a.i(937864),e=a.i(910350);a.i(451208);var f=a.i(201300),g=a.i(439759),h=a.i(260210);a.i(432443);var i=a.i(935930),j=b([d,e,f,g,h,i]);[d,e,f,g,h,i]=j.then?(await j)():j,a.s([]),c()}catch(a){c(a)}},!1),873715,a=>a.a(async(b,c)=>{try{var d=a.i(542715),e=a.i(937864),f=a.i(910350),g=a.i(451208),h=a.i(201300),i=a.i(439759),j=a.i(260210),k=a.i(432443),l=a.i(935930),m=b([d,e,f,h,i,j,l]);[d,e,f,h,i,j,l]=m.then?(await m)():m,a.s(["7f008a27595d5d6e96e1685cb7afd843882426f54b",()=>e.removeConfigAction,"7f06c73f32c18b1c6787e1a4b23dc14b24ac95d0f1",()=>h.addFactsAction,"7f0bf76a4aa995e0c29f10cf31783d7b3f36e9294a",()=>e.setConfigAction,"7f14e59fbd131887159867d74584f5ba0dd8d28b9c",()=>h.updateNoteAction,"7f1531e9bfa2fb6a3893c63ba15bfa30d5265bac61",()=>i.resetHistoryAction,"7f163c4d9598d15a4906a7963afe8e78c6e974aae2",()=>l.registerServerAction,"7f16c32567d23cea9e7ab3cdd3b239ca935ab9596d",()=>i.deleteCallAction,"7f177493ddde834023f25b082b35f9ee730cc84ced",()=>i.saveTurnsAction,"7f1ae95e4d265a0a7b1f05c1b0e26fa69fce71f8ab",()=>h.setFactAlwaysLoadAction,"7f1f4eedad50097c78f50ee80637fedd36da6d9a4d",()=>f.deleteThreadAction,"7f2235ee325843a055425949538d38ef0c6b44c62c",()=>i.setCallSkillsAction,"7f3520b407abd92fdf69d02d2f364032903f49fa11",()=>f.answerThreadAction,"7f376ce11e02bd8623e15e8cff16afba68bbafc52f",()=>g.deleteWorkspaceFileAction,"7f45bd8152273b835b8d00740e6ada4ffb33542287",()=>f.clearFinishedThreadsAction,"7f4ddb467fada0fcab742f28c2cd7a0a6b4195c009",()=>f.setBotMemoryOnAction,"7f503964271cf21576536fd7e051e10454f1c4e9bc",()=>f.cancelThreadAction,"7f52bfec15b438c9480ce2a68692632c2afb3f006a",()=>k.setSkillDisabledAction,"7f58405429879fb5e976934f2419d2897ebc277c60",()=>f.deleteBotAction,"7f58aef9b1112c446a825eb91efeb31666d87818a9",()=>f.createBotAction,"7f647faa7f1919a4f08f73dcc78e04901429e8c75e",()=>f.startThreadAction,"7f6515ffe23e68549d43aa9311acadb0367741c247",()=>h.reviseFactAction,"7f715086ad9fe6863a53cb04b7ff210ffdcd44d4da",()=>f.createSeedBotsAction,"7f7a8dec2724ded35f3720cca3da5ae468b639a9f6",()=>i.deleteEndedCallsAction,"7f83cc86877f849a609fef9016c548e91581ca06ed",()=>h.forgetFactAction,"7f88021d061b659a138f8e06f02d551a7c99f93119",()=>h.deleteNoteAction,"7f9063d6960a24f8e17b8914ee4f6630c7fca22456",()=>e.startChatGptSignInAction,"7f94c3fa4cf21252412cebf5bc09f3c41b683622af",()=>l.refreshServerAction,"7f98b9d85dd58ad1d3e9b53a3a1799b27bffc75e94",()=>k.createSkillAction,"7fa3265273969b2f06c444fae58fd0dff4146dd041",()=>l.deleteServerAction,"7fb9cfbb14028d781e92ad2e49e648cafdc76b2ed6",()=>i.openCallAction,"7fbd6f0e49811eccb94c49c5cb9f649b9a03d6a678",()=>g.openFileAction,"7fd0af95aa0d5c125b481d7087557b6589f9598ae3",()=>i.endCallAction,"7fd1963e439c95cc5e3817118f0288b8e7f3b038e0",()=>i.saveThoughtAction,"7fd39b524aaead025e24a9b83ba354398abecf491b",()=>k.uploadSkillAction,"7fd781d4a746f72383016595ed69160857b07e0be9",()=>f.acceptThreadRelaysAction,"7fda426845399b41a1db8ce6fca24f747318adf2a4",()=>h.createNoteAction,"7fdfde4d1a50997bdc8832f2b580bf9e327ea44394",()=>j.deleteArtifactAction,"7febfcf243b0d219242be2d3ed5d9ca8e02b529d3d",()=>f.updateBotAction,"7fee33e06c7949c9115a2d9d6fe41af5ace83a4e06",()=>l.callToolAction,"7fefd295187e02f4444371c90821d90314c11d3fe1",()=>g.emptyScratchAction,"7ffe58353e8a289deea66dd070a79a480a2ef64a81",()=>k.deleteSkillAction,"7ffe9230c748738877501065308042e15107c43db5",()=>f.markSeenAction]),c()}catch(a){c(a)}},!1),201300,a=>a.a(async(b,c)=>{try{var d=a.i(137936),e=a.i(53112),f=a.i(569572),g=a.i(986743),h=a.i(661210),i=a.i(225689),j=a.i(293480),k=a.i(713095),l=b([g]);[g]=l.then?(await l)():l;let m=e.z.string().trim().refine(h.isMemoryPath,"Invalid note path"),n=(0,i.serverAction)(async(a,b,c=[])=>{let d=m.parse(a),f=e.z.string().min(1).parse(b),h=await (0,g.createNote)(d,f,{ownedByUser:!0});for(let a of(h||(0,j.publicError)("Note already exists"),c.map(a=>a.trim()).filter(Boolean)))await (0,g.addFact)(h.id,a);return{id:h.id}}),o=(0,i.serverAction)(async(a,b)=>{await (0,g.updateNote)(a,b)||(0,j.publicError)("Note not found")}),p=(0,i.serverAction)(async a=>{await (0,g.deleteNote)(a)||(0,j.publicError)("Note not found")}),q=(0,i.serverAction)(async(a,b)=>{let c=b.map(a=>a.trim()).filter(Boolean);for(let b of(0===c.length&&(0,j.publicError)("Fact text is required"),c))await (0,g.addFact)(a,b);return{added:c.length}}),r=(0,i.serverAction)(async(a,b,c)=>{c.trim()||(0,j.publicError)("Fact text is required"),await (0,g.reviseFact)(a,b,c.trim())||(0,j.publicError)("Fact not found")}),s=(0,i.serverAction)(async(a,b)=>{await (0,g.forgetFact)(a,b)||(0,j.publicError)("Fact not found")}),t=(0,i.serverAction)(async(a,b,c)=>{let d=await (0,g.setFactAlwaysLoad)(a,b,c);"full"===d&&(0,j.publicError)(`Only ${f.MEMORY_LIMITS.carried} facts can be carried into every call — drop one first`),"missing"===d&&(0,j.publicError)("Fact not found")});(0,k.ensureServerEntryExports)([n,o,p,q,r,s,t]),(0,d.registerServerReference)(n,"7fda426845399b41a1db8ce6fca24f747318adf2a4",null),(0,d.registerServerReference)(o,"7f14e59fbd131887159867d74584f5ba0dd8d28b9c",null),(0,d.registerServerReference)(p,"7f88021d061b659a138f8e06f02d551a7c99f93119",null),(0,d.registerServerReference)(q,"7f06c73f32c18b1c6787e1a4b23dc14b24ac95d0f1",null),(0,d.registerServerReference)(r,"7f6515ffe23e68549d43aa9311acadb0367741c247",null),(0,d.registerServerReference)(s,"7f83cc86877f849a609fef9016c548e91581ca06ed",null),(0,d.registerServerReference)(t,"7f1ae95e4d265a0a7b1f05c1b0e26fa69fce71f8ab",null),a.s(["addFactsAction",0,q,"createNoteAction",0,n,"deleteNoteAction",0,p,"forgetFactAction",0,s,"reviseFactAction",0,r,"setFactAlwaysLoadAction",0,t,"updateNoteAction",0,o]),c()}catch(a){c(a)}},!1),432443,a=>{"use strict";var b,c,d,e=a.i(137936),f=(0,a.i(362562).createRequire)("/");try{c=(b=f("worker_threads")).Worker,d=b.isMarkedAsUntransferable}catch(a){}var g=c?function(a,b,e,f,g){var h=!1,i=new c(a+";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global",{eval:!0}).on("error",function(a){return g(a,null)}).on("message",function(a){return g(null,a)}).on("exit",function(a){a&&!h&&g(Error("exited with code "+a),null)});return d&&(f=f.filter(function(a){return!d(a)})),i.postMessage(e,f),i.terminate=function(){return h=!0,c.prototype.terminate.call(i)},i}:function(a,b,c,d,e){setImmediate(function(){return e(Error("async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)"),null)});var f=function(){};return{terminate:f,postMessage:f}},h=Uint8Array,i=Uint16Array,j=Int32Array,k=new h([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),l=new h([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),m=new h([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),n=function(a,b){for(var c=new i(31),d=0;d<31;++d)c[d]=b+=1<<a[d-1];for(var e=new j(c[30]),d=1;d<30;++d)for(var f=c[d];f<c[d+1];++f)e[f]=f-c[d]<<5|d;return{b:c,r:e}},b=n(k,2),o=b.b,p=b.r;o[28]=258,p[258]=28;for(var q=n(l,0),r=q.b,s=q.r,t=new i(32768),u=0;u<32768;++u){var v=(43690&u)>>1|(21845&u)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,t[u]=((65280&v)>>8|(255&v)<<8)>>1}for(var w=function(a,b,c){for(var d,e=a.length,f=0,g=new i(b);f<e;++f)a[f]&&++g[a[f]-1];var h=new i(b);for(f=1;f<b;++f)h[f]=h[f-1]+g[f-1]<<1;if(c){d=new i(1<<b);var j=15-b;for(f=0;f<e;++f)if(a[f])for(var k=f<<4|a[f],l=b-a[f],m=h[a[f]-1]++<<l,n=m|(1<<l)-1;m<=n;++m)d[t[m]>>j]=k}else for(d=new i(e),f=0;f<e;++f)a[f]&&(d[f]=t[h[a[f]-1]++]>>15-a[f]);return d},x=new h(288),u=0;u<144;++u)x[u]=8;for(var u=144;u<256;++u)x[u]=9;for(var u=256;u<280;++u)x[u]=7;for(var u=280;u<288;++u)x[u]=8;for(var y=new h(32),u=0;u<32;++u)y[u]=5;var z=w(x,9,0),A=w(x,9,1),B=w(y,5,0),C=w(y,5,1),D=function(a){for(var b=a[0],c=1;c<a.length;++c)a[c]>b&&(b=a[c]);return b},E=function(a,b,c){var d=b/8|0;return(a[d]|a[d+1]<<8)>>(7&b)&c},F=function(a,b){var c=b/8|0;return(a[c]|a[c+1]<<8|a[c+2]<<16)>>(7&b)},G=function(a){return(a+7)/8|0},H=function(a,b,c){return(null==b||b<0)&&(b=0),(null==c||c>a.length)&&(c=a.length),new h(a.subarray(b,c))},I=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],J=function(a,b,c){var d=Error(b||I[a]);if(d.code=a,Error.captureStackTrace&&Error.captureStackTrace(d,J),!c)throw d;return d},K=function(a,b,c,d){var e=a.length,f=d?d.length:0;if(!e||b.f&&!b.l)return c||new h(0);var g=!c,i=g||2!=b.i,j=b.i;g&&(c=new h(3*e));var n=function(a){var b=c.length;if(a>b){var d=new h(Math.max(2*b,a));d.set(c),c=d}},p=b.f||0,q=b.p||0,s=b.b||0,t=b.l,u=b.d,v=b.m,x=b.n,y=8*e;do{if(!t){p=E(a,q,1);var z=E(a,q+1,3);if(q+=3,z)if(1==z)t=A,u=C,v=9,x=5;else if(2==z){var B=E(a,q,31)+257,I=E(a,q+10,15)+4,K=B+E(a,q+5,31)+1;q+=14;for(var L=new h(K),M=new h(19),N=0;N<I;++N)M[m[N]]=E(a,q+3*N,7);q+=3*I;for(var O=D(M),P=(1<<O)-1,Q=w(M,O,1),N=0;N<K;){var R=Q[E(a,q,P)];q+=15&R;var S=R>>4;if(S<16)L[N++]=S;else{var T=0,U=0;for(16==S?(U=3+E(a,q,3),q+=2,T=L[N-1]):17==S?(U=3+E(a,q,7),q+=3):18==S&&(U=11+E(a,q,127),q+=7);U--;)L[N++]=T}}var V=L.subarray(0,B),W=L.subarray(B);v=D(V),x=D(W),t=w(V,v,1),u=w(W,x,1)}else J(1);else{var S=G(q)+4,X=a[S-4]|a[S-3]<<8,Y=S+X;if(Y>e){j&&J(0);break}i&&n(s+X),c.set(a.subarray(S,Y),s),b.b=s+=X,b.p=q=8*Y,b.f=p;continue}if(q>y){j&&J(0);break}}i&&n(s+131072);for(var Z=(1<<v)-1,$=(1<<x)-1,_=q;;_=q){var T=t[F(a,q)&Z],aa=T>>4;if((q+=15&T)>y){j&&J(0);break}if(T||J(2),aa<256)c[s++]=aa;else if(256==aa){_=q,t=null;break}else{var ab=aa-254;if(aa>264){var N=aa-257,ac=k[N];ab=E(a,q,(1<<ac)-1)+o[N],q+=ac}var ad=u[F(a,q)&$],ae=ad>>4;ad||J(3),q+=15&ad;var W=r[ae];if(ae>3){var ac=l[ae];W+=F(a,q)&(1<<ac)-1,q+=ac}if(q>y){j&&J(0);break}i&&n(s+131072);var af=s+ab;if(s<W){var ag=f-W,ah=Math.min(W,af);for(ag+s<0&&J(3);s<ah;++s)c[s]=d[ag+s]}for(;s<af;++s)c[s]=c[s-W]}}b.l=t,b.p=_,b.b=s,b.f=p,t&&(p=1,b.m=v,b.d=u,b.n=x)}while(!p)return s!=c.length&&g?H(c,0,s):c.subarray(0,s)},L=function(a,b,c){c<<=7&b;var d=b/8|0;a[d]|=c,a[d+1]|=c>>8},M=function(a,b,c){c<<=7&b;var d=b/8|0;a[d]|=c,a[d+1]|=c>>8,a[d+2]|=c>>16},N=function(a,b){for(var c=[],d=0;d<a.length;++d)a[d]&&c.push({s:d,f:a[d]});var e=c.length,f=c.slice();if(!e)return{t:U,l:0};if(1==e){var g=new h(c[0].s+1);return g[c[0].s]=1,{t:g,l:1}}c.sort(function(a,b){return a.f-b.f}),c.push({s:-1,f:25001});var j=c[0],k=c[1],l=0,m=1,n=2;for(c[0]={s:-1,f:j.f+k.f,l:j,r:k};m!=e-1;)j=c[c[l].f<c[n].f?l++:n++],k=c[l!=m&&c[l].f<c[n].f?l++:n++],c[m++]={s:-1,f:j.f+k.f,l:j,r:k};for(var o=f[0].s,d=1;d<e;++d)f[d].s>o&&(o=f[d].s);var p=new i(o+1),q=O(c[m-1],p,0);if(q>b){var d=0,r=0,s=q-b,t=1<<s;for(f.sort(function(a,b){return p[b.s]-p[a.s]||a.f-b.f});d<e;++d){var u=f[d].s;if(p[u]>b)r+=t-(1<<q-p[u]),p[u]=b;else break}for(r>>=s;r>0;){var v=f[d].s;p[v]<b?r-=1<<b-p[v]++-1:++d}for(;d>=0&&r;--d){var w=f[d].s;p[w]==b&&(--p[w],++r)}q=b}return{t:new h(p),l:q}},O=function(a,b,c){return -1==a.s?Math.max(O(a.l,b,c+1),O(a.r,b,c+1)):b[a.s]=c},P=function(a){for(var b=a.length;b&&!a[--b];);for(var c=new i(++b),d=0,e=a[0],f=1,g=function(a){c[d++]=a},h=1;h<=b;++h)if(a[h]==e&&h!=b)++f;else{if(!e&&f>2){for(;f>138;f-=138)g(32754);f>2&&(g(f>10?f-11<<5|28690:f-3<<5|12305),f=0)}else if(f>3){for(g(e),--f;f>6;f-=6)g(8304);f>2&&(g(f-3<<5|8208),f=0)}for(;f--;)g(e);f=1,e=a[h]}return{c:c.subarray(0,d),n:b}},Q=function(a,b){for(var c=0,d=0;d<b.length;++d)c+=a[d]*b[d];return c},R=function(a,b,c){var d=c.length,e=G(b+2);a[e]=255&d,a[e+1]=d>>8,a[e+2]=255^a[e],a[e+3]=255^a[e+1];for(var f=0;f<d;++f)a[e+f+4]=c[f];return(e+4+d)*8},S=function(a,b,c,d,e,f,g,h,j,n,o){L(b,o++,c),++e[256];for(var p,q,r,s,t=N(e,15),u=t.t,v=t.l,A=N(f,15),C=A.t,D=A.l,E=P(u),F=E.c,G=E.n,H=P(C),I=H.c,J=H.n,K=new i(19),O=0;O<F.length;++O)++K[31&F[O]];for(var O=0;O<I.length;++O)++K[31&I[O]];for(var S=N(K,7),T=S.t,U=S.l,V=19;V>4&&!T[m[V-1]];--V);var W=n+5<<3,X=Q(e,x)+Q(f,y)+g,Y=Q(e,u)+Q(f,C)+g+14+3*V+Q(K,T)+2*K[16]+3*K[17]+7*K[18];if(j>=0&&W<=X&&W<=Y)return R(b,o,a.subarray(j,j+n));if(L(b,o,1+(Y<X)),o+=2,Y<X){p=w(u,v,0),q=u,r=w(C,D,0),s=C;var Z=w(T,U,0);L(b,o,G-257),L(b,o+5,J-1),L(b,o+10,V-4),o+=14;for(var O=0;O<V;++O)L(b,o+3*O,T[m[O]]);o+=3*V;for(var $=[F,I],_=0;_<2;++_)for(var aa=$[_],O=0;O<aa.length;++O){var ab=31&aa[O];L(b,o,Z[ab]),o+=T[ab],ab>15&&(L(b,o,aa[O]>>5&127),o+=aa[O]>>12)}}else p=z,q=x,r=B,s=y;for(var O=0;O<h;++O){var ac=d[O];if(ac>255){var ab=ac>>18&31;M(b,o,p[ab+257]),o+=q[ab+257],ab>7&&(L(b,o,ac>>23&31),o+=k[ab]);var ad=31&ac;M(b,o,r[ad]),o+=s[ad],ad>3&&(M(b,o,ac>>5&8191),o+=l[ad])}else M(b,o,p[ac]),o+=q[ac]}return M(b,o,p[256]),o+q[256]},T=new j([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),U=new h(0),V=function(a,b,c,d,e,f){var g=f.z||a.length,m=new h(d+g+5*(1+Math.ceil(g/7e3))+e),n=m.subarray(d,m.length-e),o=f.l,q=7&(f.r||0);if(b){q&&(n[0]=f.r>>3);for(var r=T[b-1],t=r>>13,u=8191&r,v=(1<<c)-1,w=f.p||new i(32768),x=f.h||new i(v+1),y=Math.ceil(c/3),z=2*y,A=function(b){return(a[b]^a[b+1]<<y^a[b+2]<<z)&v},B=new j(25e3),C=new i(288),D=new i(32),E=0,F=0,I=f.i||0,J=0,K=f.w||0,L=0;I+2<g;++I){var M=A(I),N=32767&I,O=x[M];if(w[N]=O,x[M]=N,K<=I){var P=g-I;if((E>7e3||J>24576)&&(P>423||!o)){q=S(a,n,0,B,C,D,F,J,L,I-L,q),J=E=F=0,L=I;for(var Q=0;Q<286;++Q)C[Q]=0;for(var Q=0;Q<30;++Q)D[Q]=0}var U=2,V=0,W=u,X=N-O&32767;if(P>2&&M==A(I-X))for(var Y=Math.min(t,P)-1,Z=Math.min(32767,I),$=Math.min(258,P);X<=Z&&--W&&N!=O;){if(a[I+U]==a[I+U-X]){for(var _=0;_<$&&a[I+_]==a[I+_-X];++_);if(_>U){if(U=_,V=X,_>Y)break;for(var aa=Math.min(X,_-2),ab=0,Q=0;Q<aa;++Q){var ac=I-X+Q&32767,ad=w[ac],ae=ac-ad&32767;ae>ab&&(ab=ae,O=ac)}}}O=w[N=O],X+=N-O&32767}if(V){B[J++]=0x10000000|p[U]<<18|s[V];var af=31&p[U],ag=31&s[V];F+=k[af]+l[ag],++C[257+af],++D[ag],K=I+U,++E}else B[J++]=a[I],++C[a[I]]}}for(I=Math.max(I,K);I<g;++I)B[J++]=a[I],++C[a[I]];q=S(a,n,o,B,C,D,F,J,L,I-L,q),o||(f.r=7&q|n[q/8|0]<<3,q-=7,f.h=x,f.p=w,f.i=I,f.w=K)}else{for(var I=f.w||0;I<g+o;I+=65535){var ah=I+65535;ah>=g&&(n[q/8|0]=o,ah=g),q=R(n,q+1,a.subarray(I,ah))}f.i=g}return H(m,0,d+G(q)+e)},W=function(){for(var a=new Int32Array(256),b=0;b<256;++b){for(var c=b,d=9;--d;)c=(1&c&&-0x12477ce0)^c>>>1;a[b]=c}return a}(),X=function(){var a=-1;return{p:function(b){for(var c=a,d=0;d<b.length;++d)c=W[255&c^b[d]]^c>>>8;a=c},d:function(){return~a}}},Y=function(){var a=1,b=0;return{p:function(c){for(var d=a,e=b,f=0|c.length,g=0;g!=f;){for(var h=Math.min(g+2655,f);g<h;++g)e+=d+=c[g];d=(65535&d)+15*(d>>16),e=(65535&e)+15*(e>>16)}a=d,b=e},d:function(){return a%=65521,b%=65521,(255&a)<<24|(65280&a)<<8|(255&b)<<8|b>>8}}},Z=function(a,b,c,d,e){if(!e&&(e={l:1},b.dictionary)){var f=b.dictionary.subarray(-32768),g=new h(f.length+a.length);g.set(f),g.set(a,f.length),a=g,e.w=f.length}return V(a,null==b.level?6:b.level,null==b.mem?e.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):20:12+b.mem,c,d,e)},$=function(a,b){var c={};for(var d in a)c[d]=a[d];for(var d in b)c[d]=b[d];return c},_=function(a,b,c){for(var d=a(),e=a.toString(),f=e.slice(e.indexOf("[")+1,e.lastIndexOf("]")).replace(/\s+/g,"").split(","),g=0;g<d.length;++g){var h=d[g],i=f[g];if("function"==typeof h){b+=";"+i+"=";var j=h.toString();if(h.prototype)if(-1!=j.indexOf("[native code]")){var k=j.indexOf(" ",8)+1;b+=j.slice(k,j.indexOf("(",k))}else for(var l in b+=j,h.prototype)b+=";"+i+".prototype."+l+"="+h.prototype[l].toString();else b+=j}else c[i]=h}return b},aa=[],ab=function(a){var b=[];for(var c in a)a[c].buffer&&b.push((a[c]=new a[c].constructor(a[c])).buffer);return b},ac=function(a,b,c,d){if(!aa[c]){for(var e="",f={},h=a.length-1,i=0;i<h;++i)e=_(a[i],e,f);aa[c]={c:_(a[h],e,f),e:f}}var j=$({},aa[c].e);return g(aa[c].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+b.toString()+"}",c,j,ab(j),d)},ad=function(){return[h,i,j,k,l,m,o,r,A,C,t,I,w,D,E,F,G,H,J,K,aB,ah,ai]},ae=function(){return[h,i,j,k,l,m,p,s,z,x,B,y,t,T,U,w,L,M,N,O,P,Q,R,S,G,H,V,Z,ay,ah]},af=function(){return[aq,ar]},ag=function(){return[au]},ah=function(a){return postMessage(a,[a.buffer])},ai=function(a){return a&&{out:a.size&&new h(a.size),dictionary:a.dictionary}},aj=function(a){return a.ondata=function(a,b){return postMessage([a,b],[a.buffer])},function(b){b.data[0]?(a.push(b.data[0],b.data[1]),postMessage([b.data[0].length])):a.flush(b.data[1])}},ak=function(a,b,c,d,e,f,g){var h,i=ac(a,d,e,function(a,c){a?(i.terminate(),b.ondata.call(b,a)):Array.isArray(c)?1==c.length?(b.queuedSize-=c[0],b.ondrain&&b.ondrain(c[0])):(c[1]&&i.terminate(),b.ondata.call(b,a,c[0],c[1])):g(c)});i.postMessage(c),b.queuedSize=0,b.push=function(a,c){b.ondata||J(5),h&&b.ondata(J(4,0,1),null,!!c),b.queuedSize+=a.length,i.postMessage([a,h=c],a.buffer instanceof ArrayBuffer?[a.buffer]:[])},b.terminate=function(){i.terminate()},f&&(b.flush=function(a){i.postMessage([0,a])})},al=function(a,b){return a[b]|a[b+1]<<8},am=function(a,b){return(a[b]|a[b+1]<<8|a[b+2]<<16|a[b+3]<<24)>>>0},an=function(a,b){return am(a,b)+0x100000000*am(a,b+4)},ao=function(a,b,c){for(;c;++b)a[b]=c,c>>>=8},ap=function(a,b){var c=b.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=b.level<2?4:2*(9==b.level),a[9]=3,0!=b.mtime&&ao(a,4,Math.floor(new Date(b.mtime||Date.now())/1e3)),c){a[3]=8;for(var d=0;d<=c.length;++d)a[d+10]=c.charCodeAt(d)}},aq=function(a){(31!=a[0]||139!=a[1]||8!=a[2])&&J(6,"invalid gzip data");var b=a[3],c=10;4&b&&(c+=(a[10]|a[11]<<8)+2);for(var d=(b>>3&1)+(b>>4&1);d>0;d-=!a[c++]);return c+(2&b)},ar=function(a){var b=a.length;return(a[b-4]|a[b-3]<<8|a[b-2]<<16|a[b-1]<<24)>>>0},as=function(a){return 10+(a.filename?a.filename.length+1:0)},at=function(a,b){var c=b.level;if(a[0]=120,a[1]=(0==c?0:c<6?1:9==c?3:2)<<6|(b.dictionary&&32),a[1]|=31-(a[0]<<8|a[1])%31,b.dictionary){var d=Y();d.p(b.dictionary),ao(a,2,d.d())}},au=function(a,b){return((15&a[0])!=8||a[0]>>4>7||(a[0]<<8|a[1])%31)&&J(6,"invalid zlib data"),(a[1]>>5&1)==+!b&&J(6,"invalid zlib data: "+(32&a[1]?"need":"unexpected")+" dictionary"),(a[1]>>3&4)+2};function av(a,b){return"function"==typeof a&&(b=a,a={}),this.ondata=b,a}var aw=function(){function a(a,b){if("function"==typeof a&&(b=a,a={}),this.ondata=b,this.o=a||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new h(98304),this.o.dictionary){var c=this.o.dictionary.subarray(-32768);this.b.set(c,32768-c.length),this.s.i=32768-c.length}}return a.prototype.p=function(a,b){this.ondata(Z(a,this.o,0,0,this.s),b)},a.prototype.push=function(a,b){this.ondata||J(5),this.s.l&&J(4);var c=a.length+this.s.z;if(c>this.b.length){if(c>2*this.b.length-32768){var d=new h(-32768&c);d.set(this.b.subarray(0,this.s.z)),this.b=d}var e=this.b.length-this.s.z;this.b.set(a.subarray(0,e),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(a.subarray(e),32768),this.s.z=a.length-e+32768,this.s.i=32766,this.s.w=32768}else this.b.set(a,this.s.z),this.s.z+=a.length;this.s.l=1&b,(this.s.z>this.s.w+8191||b)&&(this.p(this.b,b||!1),this.s.w=this.s.i,this.s.i-=2),b&&(this.s=this.o={},this.b=U)},a.prototype.flush=function(a){if(this.ondata||J(5),this.s.l&&J(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2,a){var b=new h(6);b[0]=this.s.r>>3;var c=R(b,this.s.r,U);this.s.r=0,this.ondata(b.subarray(0,c>>3),!1)}},a}(),ax=function(a,b){ak([ae,function(){return[aj,aw]}],this,av.call(this,a,b),function(a){onmessage=aj(new aw(a.data))},6,1)};function ay(a,b){return Z(a,b||{},0,0)}var az=function(){function a(a,b){"function"==typeof a&&(b=a,a={}),this.ondata=b;var c=a&&a.dictionary&&a.dictionary.subarray(-32768);this.s={i:0,b:c?c.length:0},this.o=new h(32768),this.p=new h(0),c&&this.o.set(c)}return a.prototype.e=function(a){if(this.ondata||J(5),this.d&&J(4),this.p.length){if(a.length){var b=new h(this.p.length+a.length);b.set(this.p),b.set(a,this.p.length),this.p=b}}else this.p=a},a.prototype.c=function(a){this.s.i=+(this.d=a||!1);var b=this.s.b,c=K(this.p,this.s,this.o);this.ondata(H(c,b,this.s.b),this.d),this.o=H(c,this.s.b-32768),this.s.b=this.o.length,this.p=H(this.p,this.s.p/8|0),this.s.p&=7},a.prototype.push=function(a,b){this.e(a),this.c(b)},a}(),aA=function(a,b){ak([ad,function(){return[aj,az]}],this,av.call(this,a,b),function(a){onmessage=aj(new az(a.data))},7,0)};function aB(a,b){return K(a,{i:2},b&&b.out,b&&b.dictionary)}(function(){function a(a,b){this.c=X(),this.l=0,this.v=1,aw.call(this,a,b)}a.prototype.push=function(a,b){this.c.p(a),this.l+=a.length,aw.prototype.push.call(this,a,b)},a.prototype.p=function(a,b){var c=Z(a,this.o,this.v&&as(this.o),b&&8,this.s);this.v&&(ap(c,this.o),this.v=0),b&&(ao(c,c.length-8,this.c.d()),ao(c,c.length-4,this.l)),this.ondata(c,b)},a.prototype.flush=function(a){aw.prototype.flush.call(this,a)}})();var aC=function(){function a(a,b){this.v=1,this.r=0,az.call(this,a,b)}return a.prototype.push=function(a,b){if(az.prototype.e.call(this,a),this.r+=a.length,this.v){var c=this.p.subarray(this.v-1),d=c.length>3?aq(c):4;if(d>c.length){if(!b)return}else this.v>1&&this.onmember&&this.onmember(this.r-c.length);this.p=c.subarray(d),this.v=0}az.prototype.c.call(this,0),this.s.f&&!this.s.l?(this.v=G(this.s.p)+9,this.s={i:0},this.o=new h(0),this.push(new h(0),b)):b&&az.prototype.c.call(this,b)},a}(),aD=function(a,b){var c=this;ak([ad,af,function(){return[aj,az,aC]}],this,av.call(this,a,b),function(a){var b=new aC(a.data);b.onmember=function(a){return postMessage(a)},onmessage=aj(b)},9,0,function(a){return c.onmember&&c.onmember(a)})},aE=(function(){function a(a,b){this.c=Y(),this.v=1,aw.call(this,a,b)}a.prototype.push=function(a,b){this.c.p(a),aw.prototype.push.call(this,a,b)},a.prototype.p=function(a,b){var c=Z(a,this.o,this.v&&(this.o.dictionary?6:2),b&&4,this.s);this.v&&(at(c,this.o),this.v=0),b&&ao(c,c.length-4,this.c.d()),this.ondata(c,b)},a.prototype.flush=function(a){aw.prototype.flush.call(this,a)}}(),function(){function a(a,b){az.call(this,a,b),this.v=a&&a.dictionary?2:1}return a.prototype.push=function(a,b){if(az.prototype.e.call(this,a),this.v){if(this.p.length<6&&!b)return;this.p=this.p.subarray(au(this.p,this.v-1)),this.v=0}b&&(this.p.length<4&&J(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),az.prototype.c.call(this,b)},a}()),aF=function(a,b){ak([ad,ag,function(){return[aj,az,aE]}],this,av.call(this,a,b),function(a){onmessage=aj(new aE(a.data))},11,0)},aG=function(){function a(a,b){this.o=av.call(this,a,b)||{},this.G=aC,this.I=az,this.Z=aE}return a.prototype.i=function(){var a=this;this.s.ondata=function(b,c){a.ondata(b,c)}},a.prototype.push=function(a,b){if(this.ondata||J(5),this.s)this.s.push(a,b);else{if(this.p&&this.p.length){var c=new h(this.p.length+a.length);c.set(this.p),c.set(a,this.p.length)}else this.p=a;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):(15&this.p[0])!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,b),this.p=null)}},a}();function aH(a,b){aG.call(this,a,b),this.queuedSize=0,this.G=aD,this.I=aA,this.Z=aF}aH.prototype.i=function(){var a=this;this.s.ondata=function(b,c,d){a.ondata(b,c,d)},this.s.ondrain=function(b){a.queuedSize-=b,a.ondrain&&a.ondrain(b)}},aH.prototype.push=function(a,b){this.queuedSize+=a.length,aG.prototype.push.call(this,a,b)};var aI="u">typeof TextEncoder&&new TextEncoder,aJ="u">typeof TextDecoder&&new TextDecoder,aK=0;try{aJ.decode(U,{stream:!0}),aK=1}catch(a){}var aL=function(a){for(var b="",c=0;;){var d=a[c++],e=(d>127)+(d>223)+(d>239);if(c+e>a.length)return{s:b,r:H(a,c-1)};e?3==e?b+=String.fromCharCode(55296|(d=((15&d)<<18|(63&a[c++])<<12|(63&a[c++])<<6|63&a[c++])-65536)>>10,56320|1023&d):1&e?b+=String.fromCharCode((31&d)<<6|63&a[c++]):b+=String.fromCharCode((15&d)<<12|(63&a[c++])<<6|63&a[c++]):b+=String.fromCharCode(d)}};function aM(a,b){if(b){for(var c=new h(a.length),d=0;d<a.length;++d)c[d]=a.charCodeAt(d);return c}if(aI)return aI.encode(a);for(var e=a.length,f=new h(a.length+(a.length>>1)),g=0,i=function(a){f[g++]=a},d=0;d<e;++d){if(g+5>f.length){var j=new h(g+8+(e-d<<1));j.set(f),f=j}var k=a.charCodeAt(d);k<128||b?i(k):(k<2048?i(192|k>>6):(k>55295&&k<57344?(i(240|(k=65536+(1047552&k)|1023&a.charCodeAt(++d))>>18),i(128|k>>12&63)):i(224|k>>12),i(128|k>>6&63)),i(128|63&k))}return H(f,0,g)}function aN(a,b){if(b){for(var c="",d=0;d<a.length;d+=16384)c+=String.fromCharCode.apply(null,a.subarray(d,d+16384));return c}if(aJ)return aJ.decode(a);var e=aL(a),f=e.s,c=e.r;return c.length&&J(8),f}(function(a){this.ondata=a,aK?this.t=new TextDecoder:this.p=U}).prototype.push=function(a,b){if(this.ondata||J(5),b=!!b,this.t){this.ondata(this.t.decode(a,{stream:!0}),b),b&&(this.t.decode().length&&J(8),this.t=null);return}this.p||J(4);var c=new h(this.p.length+a.length);c.set(this.p),c.set(a,this.p.length);var d=aL(c),e=d.s,f=d.r;b?(f.length&&J(8),this.p=null):this.p=f,this.ondata(e,b)},(function(a){this.ondata=a}).prototype.push=function(a,b){this.ondata||J(5),this.d&&J(4),this.ondata(aM(a),this.d=b||!1)};var aO=function(a){return 1==a?3:a<6?2:+(9==a)},aP=function(a,b,c){var d=al(a,b+28),e=al(a,b+30),f=aN(a.subarray(b+46,b+46+d),!(2048&al(a,b+8))),g=b+46+d,h=aQ(a,g,e,c,am(a,b+20),am(a,b+24),am(a,b+42)),i=h[0],j=h[1],k=h[2];return[al(a,b+10),i,j,f,g+e+al(a,b+32),k]},aQ=function(a,b,c,d,e,f,g){var h=0xffffffff==e,i=0xffffffff==f,j=0xffffffff==g,k=b+c;if(d&&h+i+j){for(;b+4<k;b+=4+al(a,b+2))if(1==al(a,b))return[h?an(a,b+4+8*i):e,i?an(a,b+4):f,j?an(a,b+4+8*(i+h)):g,1];d<2&&J(13)}return[e,f,g,0]},aR=function(a){var b=0;if(a)for(var c in a){var d=a[c].length;d>65535&&J(9),b+=d+4}return b},aS=function(a,b,c,d,e,f,g,h){var i=d.length,j=c.extra,k=h&&h.length,l=aR(j);ao(a,b,null!=g?0x2014b50:0x4034b50),b+=4,null!=g&&(a[b++]=20,a[b++]=c.os),a[b]=20,b+=2,a[b++]=c.flag<<1|(f<0&&8),a[b++]=e&&8,a[b++]=255&c.compression,a[b++]=c.compression>>8;var m=new Date(null==c.mtime?Date.now():c.mtime),n=m.getFullYear()-1980;if((n<0||n>119)&&J(10),ao(a,b,n<<25|m.getMonth()+1<<21|m.getDate()<<16|m.getHours()<<11|m.getMinutes()<<5|m.getSeconds()>>1),b+=4,-1!=f&&(ao(a,b,c.crc),ao(a,b+4,f<0?-f-2:f),ao(a,b+8,c.size)),ao(a,b+12,i),ao(a,b+14,l),b+=16,null!=g&&(ao(a,b,k),ao(a,b+6,c.attrs),ao(a,b+10,g),b+=14),a.set(d,b),b+=i,l)for(var o in j){var p=j[o],q=p.length;ao(a,b,+o),ao(a,b+2,q),a.set(p,b+4),b+=4+q}return k&&(a.set(h,b),b+=k),b},aT=function(a,b,c,d,e){ao(a,b,0x6054b50),ao(a,b+8,c),ao(a,b+10,c),ao(a,b+12,d),ao(a,b+16,e)},aU=function(){function a(a){this.filename=a,this.c=X(),this.size=0,this.compression=0}return a.prototype.process=function(a,b){this.ondata(null,a,b)},a.prototype.push=function(a,b){this.ondata||J(5),this.c.p(a),this.size+=a.length,b&&(this.crc=this.c.d()),this.process(a,b||!1)},a}();function aV(a,b){var c=this;b||(b={}),aU.call(this,a),this.d=new aw(b,function(a,b){c.ondata(null,a,b)}),this.compression=8,this.flag=aO(b.level)}function aW(a,b){var c=this;b||(b={}),aU.call(this,a),this.d=new ax(b,function(a,b,d){c.ondata(a,b,d)}),this.compression=8,this.flag=aO(b.level),this.terminate=this.d.terminate}function aX(a){this.ondata=a,this.u=[],this.d=1}aV.prototype.process=function(a,b){try{this.d.push(a,b)}catch(a){this.ondata(a,null,b)}},aV.prototype.push=function(a,b){aU.prototype.push.call(this,a,b)},aW.prototype.process=function(a,b){this.d.push(a,b)},aW.prototype.push=function(a,b){aU.prototype.push.call(this,a,b)},aX.prototype.add=function(a){var b=this;if(this.ondata||J(5),2&this.d)this.ondata(J(4+(1&this.d)*8,0,1),null,!1);else{var c=aM(a.filename),d=c.length,e=a.comment,f=e&&aM(e),g=d!=a.filename.length||f&&e.length!=f.length,i=d+aR(a.extra)+30;d>65535&&this.ondata(J(11,0,1),null,!1);var j=new h(i);aS(j,0,a,c,g,-1);var k=[j],l=function(){for(var a=0,c=k;a<c.length;a++){var d=c[a];b.ondata(null,d,!1)}k=[]},m=this.d;this.d=0;var n=this.u.length,o=$(a,{f:c,u:g,o:f,t:function(){a.terminate&&a.terminate()},r:function(){if(l(),m){var a=b.u[n+1];a?a.r():b.d=1}m=1}}),p=0;a.ondata=function(c,d,e){if(c)b.ondata(c,d,e),b.terminate();else if(p+=d.length,k.push(d),e){var f=new h(16);ao(f,0,0x8074b50),ao(f,4,a.crc),ao(f,8,p),ao(f,12,a.size),k.push(f),o.c=p,o.b=i+p+16,o.crc=a.crc,o.size=a.size,m&&o.r(),m=1}else m&&l()},this.u.push(o)}},aX.prototype.end=function(){var a=this;2&this.d?this.ondata(J(4+(1&this.d)*8,0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&a.d&&(a.u.splice(-1,1),a.e())},t:function(){}}),this.d=3)},aX.prototype.e=function(){for(var a=0,b=0,c=0,d=0,e=this.u;d<e.length;d++){var f=e[d];c+=46+f.f.length+aR(f.extra)+(f.o?f.o.length:0)}for(var g=new h(c+22),i=0,j=this.u;i<j.length;i++){var f=j[i];aS(g,a,f,f.f,f.u,-f.c-2,b,f.o),a+=46+f.f.length+aR(f.extra)+(f.o?f.o.length:0),b+=f.b}aT(g,a,this.u.length,c,b),this.ondata(null,g,!0),this.d=2},aX.prototype.terminate=function(){for(var a=0,b=this.u;a<b.length;a++)b[a].t();this.d=2};var aY=function(){function a(){}return a.prototype.push=function(a,b){this.ondata(null,a,b)},a.compression=0,a}();function aZ(){var a=this;this.i=new az(function(b,c){a.ondata(null,b,c)})}function a$(a,b){var c=this;b<32e4?this.i=new az(function(a,b){c.ondata(null,a,b)}):(this.i=new aA(function(a,b,d){c.ondata(a,b,d)}),this.terminate=this.i.terminate)}function a_(a){this.onfile=a,this.k=[],this.o={0:aY},this.p=U}aZ.prototype.push=function(a,b){try{this.i.push(a,b)}catch(a){this.ondata(a,null,b)}},aZ.compression=8,a$.prototype.push=function(a,b){this.i.terminate&&(a=H(a,0)),this.i.push(a,b)},a$.compression=8,a_.prototype.push=function(a,b){var c=this;if(this.onfile||J(5),this.p||J(4),this.c>0){var d=Math.min(this.c,a.length),e=a.subarray(0,d);if(this.c-=d,this.d?this.d.push(e,!this.c):this.k[0].push(e),(a=a.subarray(d)).length)return this.push(a,b)}else{var f=0,g=0,i=void 0,j=void 0;this.p.length?a.length?((j=new h(this.p.length+a.length)).set(this.p),j.set(a,this.p.length)):j=this.p:j=a;for(var k=j.length,l=this.c,m=l&&this.d,n=this;g<k-4&&"break"!==function(){var a=am(j,g);if(0x4034b50==a){f=1,i=g,n.d=null,n.c=0;var b=al(j,g+6),d=al(j,g+8),e=al(j,g+26),h=al(j,g+28);if(k>g+30+e+h){var m,o=[];n.k.unshift(o),f=2;var p=am(j,g+18),q=am(j,g+22),r=aN(j.subarray(g+30,g+=30+e),!(2048&b)),s=aQ(j,g,h,2,p,q,0),t=s[0],u=s[1],v=s[3];8&b&&(t=-1-v),g+=h,n.c=t;var w={name:r,compression:d,start:function(){if(w.ondata||J(5),t){var a=c.o[d];a||w.ondata(J(14,"unknown compression type "+d,1),null,!1),(m=t<0?new a(r):new a(r,t,u)).ondata=function(a,b,c){w.ondata(a,b,c)};for(var b=0;b<o.length;b++){var e=o[b];m.push(e,!1)}c.k[0]==o&&c.c?c.d=m:m.push(U,!0)}else w.ondata(null,U,!0)},terminate:function(){m&&m.terminate&&m.terminate()}};t>=0&&(w.size=t,w.originalSize=u),n.onfile(w)}return"break"}if(l){if(0x8074b50==a)return i=g+=12+(-2==l&&8),f=3,n.c=0,"break";else if(0x2014b50==a)return i=g-=4,f=3,n.c=0,"break"}}();++g);if(this.p=U,l<0){var o=f?j.subarray(0,i-12-(-2==l&&8)-(0x8074b50==am(j,i-16)&&4)):j.subarray(0,g);m?m.push(o,!!f):this.k[+(2==f)].push(o)}if(2&f)return this.push(j.subarray(g),b);this.p=j.subarray(g)}b&&(this.c&&J(13),this.p=null)},a_.prototype.register=function(a){this.o[a.compression]=a},"function"==typeof queueMicrotask&&queueMicrotask;var a0=a.i(53112),a1=a.i(762805),a2=a.i(951941),a3=a.i(225689),a4=a.i(293480),a5=a.i(713095);let a6=(0,a3.serverAction)(async a=>{let{name:b,description:c,content:d}=a2.SkillDraftSchema.parse(a);return await (0,a1.writeCustomSkill)(b,new Map([["SKILL.md",(0,a1.renderSkillMarkdown)({name:b,description:c},d)]]))}),a7=(0,a3.serverAction)(async a=>{let{fileName:b,base64:c}=a2.SkillUploadSchema.parse(a),d=Buffer.from(c,"base64");d.byteLength>0x1400000&&(0,a4.publicError)("File is larger than 20 MB");let e=b.toLowerCase(),f=new Map;if(e.endsWith(".md"))f.set("SKILL.md",d);else if(e.endsWith(".zip")||e.endsWith(".skill")){let a;try{a=function(a){for(var b={},c=a.length-22;0x6054b50!=am(a,c);--c)(!c||a.length-c>65558)&&J(13);var d=al(a,c+8);if(!d)return{};var e=am(a,c+16),f=0x7064b50==am(a,c-20);if(f){var g=am(a,c-12);(f=0x6064b50==am(a,g))&&(d=am(a,g+32),e=am(a,g+48))}for(var i=void 0,j=0;j<d;++j){var k=aP(a,e,f),l=k[0],m=k[1],n=k[2],o=k[3],p=k[4],q=k[5],r=q+30+al(a,q+26)+al(a,q+28);e=p,(!i||i({name:o,size:m,originalSize:n,compression:l}))&&(l?8==l?b[o]=aB(a.subarray(r,r+m),{out:new h(n)}):J(14,"unknown compression type "+l):b[o]=H(a,r,r+m))}return b}(new Uint8Array(d))}catch{(0,a4.publicError)("The archive could not be opened")}let b=Object.keys(a).filter(a=>!a.startsWith("__MACOSX/")).filter(a=>"SKILL.md"===a.split("/").pop()).sort((a,b)=>a.split("/").length-b.split("/").length)[0];b||(0,a4.publicError)("The archive has no SKILL.md");let c=b.slice(0,-8);for(let[b,d]of Object.entries(a)){if(!b.startsWith(c)||b.endsWith("/")||b.startsWith("__MACOSX/"))continue;let a=b.slice(c.length);a.split("/").some(a=>".."===a||""===a)||f.set(a,d)}}else(0,a4.publicError)("Upload a .md, .zip or .skill file");let g=f.get("SKILL.md"),i="string"==typeof g?g:Buffer.from(g).toString("utf-8"),j=(0,a1.parseFrontmatter)(i);return(0,a1.writeCustomSkill)(j.name,f)}),a8=(0,a3.serverAction)(async a=>{await (0,a1.deleteCustomSkill)(a2.SkillNameSchema.parse(a))}),a9=(0,a3.serverAction)(async(a,b,c)=>{await (0,a1.setSkillDisabled)(a2.SkillSourceSchema.parse(a),a2.SkillNameSchema.parse(b),a0.z.boolean().parse(c))});(0,a5.ensureServerEntryExports)([a6,a7,a8,a9]),(0,e.registerServerReference)(a6,"7f98b9d85dd58ad1d3e9b53a3a1799b27bffc75e94",null),(0,e.registerServerReference)(a7,"7fd39b524aaead025e24a9b83ba354398abecf491b",null),(0,e.registerServerReference)(a8,"7ffe58353e8a289deea66dd070a79a480a2ef64a81",null),(0,e.registerServerReference)(a9,"7f52bfec15b438c9480ce2a68692632c2afb3f006a",null),a.s(["createSkillAction",0,a6,"deleteSkillAction",0,a8,"setSkillDisabledAction",0,a9,"uploadSkillAction",0,a7],432443)},439759,a=>a.a(async(b,c)=>{try{var d=a.i(137936),e=a.i(527990),f=a.i(723885),g=a.i(552556),h=a.i(738131),i=a.i(5865),j=a.i(614747),k=a.i(674986),l=a.i(344853),m=a.i(725466),n=a.i(986743),o=a.i(746609),p=a.i(69721),q=a.i(225689),r=a.i(293480),s=a.i(569549),t=a.i(3894),u=a.i(713095),v=b([h,i,j,k,l,m,n,s]);async function w(){let a=await (0,h.loadTools)({target:"thursday"});return Object.entries(a).map(([a,b])=>{let{$schema:c,...d}=(0,e.asSchema)(b.inputSchema).jsonSchema;return{name:a,description:"string"==typeof b.description?b.description:"",parameters:d}})}[h,i,j,k,l,m,n,s]=v.then?(await v)():v;let x=(0,q.serverAction)(async(a,b,c)=>{let d=t.ThursdaySettingsSchema.parse(a),e=f.default.string().min(1).max(65536).parse(b),h=await (0,m.readConfig)(g.LIVE_PROVIDER.apiKeyName);h||(0,r.publicError)(`No ${g.LIVE_PROVIDER.label} key — add one in Config.`);let[k,l,n,q]=await Promise.all([(0,i.loadLivePrompt)({voicePrompt:d.voicePrompt,webSearch:d.webSearch,locale:d.locale,calledBack:f.default.boolean().default(!1).parse(c)}),(0,j.loadThursdayPrompt)(d.backendPrompt),w(),(0,p.acceptedReasoning)({apiKey:h,model:d.backendModel,effort:d.reasoningEffort})]),u=await (0,p.createLiveCall)({apiKey:h,sdp:e,voice:d.voice,instructions:k.text,input:k.input,backend:{model:d.backendModel,instructions:l,tools:n,reasoning:q,webSearch:d.webSearch}});return{callId:await (0,s.insertCall)({provider:g.LIVE_PROVIDER.id,model:o.LIVE_MODEL,backendModel:d.backendModel}),sdp:u.transport.sdp,opening:k.opening}}),y=(0,q.serverAction)(async a=>{await (0,s.writeCallSkillsOn)(f.default.boolean().parse(a))}),z=(0,q.serverAction)(async(a,b)=>{await (0,s.saveTurns)(f.default.string().min(1).parse(a),t.CallTurnSchema.array().min(1).parse(b))}),A=(0,q.serverAction)(async(a,b)=>{await (0,s.saveThought)(f.default.string().min(1).parse(a),t.CallThoughtSchema.parse(b))}),B=(0,q.serverAction)(async(a,b)=>{await (0,s.endCall)(f.default.string().min(1).parse(a),o.LiveCloseSchema.nullish().parse(b))}),C=(0,q.serverAction)(async a=>{await (0,s.deleteCall)(a)||(0,r.publicError)("That call is still on the line — hang up first.")}),D=(0,q.serverAction)(async()=>(0,s.deleteEndedCalls)()),E=(0,q.serverAction)(async()=>{let a=await (0,l.listAllThreadIds)();for(let b of a)await (0,k.removeThread)(b);let b=await (0,s.deleteEndedCalls)(),c=await (0,n.deleteAllNotes)();return{calls:b,threads:a.length,notes:c}});(0,u.ensureServerEntryExports)([x,y,z,A,B,C,D,E]),(0,d.registerServerReference)(x,"7fb9cfbb14028d781e92ad2e49e648cafdc76b2ed6",null),(0,d.registerServerReference)(y,"7f2235ee325843a055425949538d38ef0c6b44c62c",null),(0,d.registerServerReference)(z,"7f177493ddde834023f25b082b35f9ee730cc84ced",null),(0,d.registerServerReference)(A,"7fd1963e439c95cc5e3817118f0288b8e7f3b038e0",null),(0,d.registerServerReference)(B,"7fd0af95aa0d5c125b481d7087557b6589f9598ae3",null),(0,d.registerServerReference)(C,"7f16c32567d23cea9e7ab3cdd3b239ca935ab9596d",null),(0,d.registerServerReference)(D,"7f7a8dec2724ded35f3720cca3da5ae468b639a9f6",null),(0,d.registerServerReference)(E,"7f1531e9bfa2fb6a3893c63ba15bfa30d5265bac61",null),a.s(["deleteCallAction",0,C,"deleteEndedCallsAction",0,D,"endCallAction",0,B,"openCallAction",0,x,"resetHistoryAction",0,E,"saveThoughtAction",0,A,"saveTurnsAction",0,z,"setCallSkillsAction",0,y]),c()}catch(a){c(a)}},!1)];
83
+ ${a.trim()}`:"";a.s(["loadThursdayPrompt",0,q]),c()}catch(a){c(a)}},!1),229666,a=>a.a(async(b,c)=>{try{var d=a.i(912714),e=a.i(750227);a.i(569572);var f=a.i(221214);a.i(684321);var g=a.i(821415),h=a.i(293480),i=b([f]);async function j(a){let b=await (0,g.insideWorkspace)(a);return b?.startsWith(g.ARTIFACTS+e.sep)||(0,h.publicError)("Not an artifact"),b}async function k(){let a=await (0,f.listBotNames)();return new Map(a.map(a=>[(0,g.botFolderName)(a).toLowerCase(),a]))}async function l(a){let b=await j(a),c=await (0,d.stat)(b).catch(()=>null);if(c||(0,h.publicError)("Not found"),c.isDirectory()){let a=(0,e.relative)(g.ARTIFACTS,b);!a.includes(e.sep)&&(await k()).has(a.toLowerCase())&&(0,h.publicError)("That is a bot's whole folder, not one artifact"),await (0,d.rm)(b,{recursive:!0});return}await (0,d.rm)(b)}[f]=i.then?(await i)():i,a.s(["deleteArtifact",0,l]),c()}catch(a){c(a)}},!1),260210,a=>a.a(async(b,c)=>{try{var d=a.i(137936),e=a.i(229666),f=a.i(225689),g=a.i(293480),h=a.i(713095),i=b([e]);[e]=i.then?(await i)():i;let j=(0,f.serverAction)(async a=>{let b=a.trim();b||(0,g.publicError)("Which artifact?"),await (0,e.deleteArtifact)(b)});(0,h.ensureServerEntryExports)([j]),(0,d.registerServerReference)(j,"7f640a65cdf70f68212f5c7a86a2ddfa448136ce91",null),a.s(["deleteArtifactAction",0,j]),c()}catch(a){c(a)}},!1),362562,(a,b,c)=>{b.exports=a.x("module",()=>require("module"))},910350,a=>a.a(async(b,c)=>{try{var d=a.i(137936),e=a.i(53112),f=a.i(689656),g=a.i(225689),h=a.i(293480),i=a.i(221214),j=a.i(674986),k=a.i(446957),l=a.i(636616),m=a.i(344853),n=a.i(713095),o=b([i,j,m]);[i,j,m]=o.then?(await o)():o;let p=(0,g.serverAction)(async a=>{let b=k.BotFormSchema.parse(a),c=await (0,i.createBot)(b);return c||(0,h.publicError)(`"${b.name}" already exists`),{name:c.name}}),q=(0,g.serverAction)(async(a,b)=>{let c=k.BotFormSchema.partial().parse(b);await (0,i.updateBot)(a,c)||(0,h.publicError)("Bot not found")}),r=e.z.object({name:e.z.string().trim().min(1).max(80),provider:f.textModelProviderSchema.nullish(),model:e.z.string().trim().min(1).max(80).nullish(),icon:k.botIconSchema.optional()}),s=(0,g.serverAction)(async a=>{let b=r.array().max(20).parse(a),c=(0,l.rollSeedIcons)(),d=[];for(let[a,e]of b.entries()){let b=(0,l.findBotSeed)(e.name);if(!b)continue;let f=await (0,i.createBot)({name:b.name,description:b.description,systemPrompt:b.systemPrompt,icon:e.icon??c[a%c.length],provider:e.provider,model:e.model,toolIds:[]});f&&d.push(f.name)}return{created:d}}),t=(0,g.serverAction)(async a=>{await (0,i.deleteBot)(a)||(0,h.publicError)("Bot not found")}),u=(0,g.serverAction)(async a=>{await (0,i.writeBotMemoryOn)(!0===a)}),v=(0,g.serverAction)(async(a,b)=>{let c,d,e=b.trim();e||(0,h.publicError)("Nothing to hand over.");let f=await (0,i.findJobBot)(a);(!f||f.disabled)&&(0,h.publicError)(`No enabled bot called "${a}".`);let g=(d=(c=e.replace(/\s+/g," ").trim().split(" ")).slice(0,4).join(" "),(c.length>4?`${d}…`:d).slice(0,60));return{id:await (0,j.startThread)({bot:f.name,request:e,label:g,from:"user"}),label:g,bot:f.name}}),w=(0,g.serverAction)(async(a,b,c,d)=>{let e=await (0,m.resolveThread)(a);return e||(0,h.publicError)(`No job called "${a}".`),b.trim()||(0,h.publicError)("Nothing to tell it."),await (0,j.answerThread)(e.id,b.trim(),"user",c,d),{id:e.id,label:e.label,status:"running"}}),x=(0,g.serverAction)(async a=>{let b=await (0,m.resolveThread)(a);return b||(0,h.publicError)(`No job called "${a}".`),await (0,j.cancelThread)(b.id),{id:b.id,label:b.label,status:"cancelled"}}),y=(0,g.serverAction)(async a=>{await (0,m.markSeen)(a.filter(a=>"string"==typeof a&&a))}),z=(0,g.serverAction)(async a=>{await (0,j.removeThread)(a)||(0,h.publicError)("Thread not found")}),A=(0,g.serverAction)(async()=>({removed:await (0,j.removeFinishedThreads)()})),B=(0,g.serverAction)(async b=>{let{acceptRoomRelays:c}=await a.A(951922);await c(e.z.number().int().positive().array().parse(b))});(0,n.ensureServerEntryExports)([p,q,s,t,u,v,w,x,y,z,A,B]),(0,d.registerServerReference)(p,"7fbf10b8968a8a3afc86561cd86f760880b2abddd7",null),(0,d.registerServerReference)(q,"7fae398b92f1138324cc5222fa49e72a4378f03741",null),(0,d.registerServerReference)(s,"7f37f5a1a9230f7fde616aea41c384ce3d489abd23",null),(0,d.registerServerReference)(t,"7f292058de693e9bedb3ba203fee00974077f9e0b6",null),(0,d.registerServerReference)(u,"7f230c90e0b3a595af75ed6c9b3b9346d45b28a0e6",null),(0,d.registerServerReference)(v,"7ff917f5236e9de4a7137d6d5003d5dafeb295990e",null),(0,d.registerServerReference)(w,"7f4df059775807466d6f59f19acbde15dbef4cbdd9",null),(0,d.registerServerReference)(x,"7f9a5f6dfac94ea98a45074e6bdc01793589f97196",null),(0,d.registerServerReference)(y,"7feb38361657ff2d01858e3fd2d867d37a52aac4ba",null),(0,d.registerServerReference)(z,"7f14aebbf0de8891159190362b1eb52f77adcf6be2",null),(0,d.registerServerReference)(A,"7f5504510b2b5ac64fb7845bf8f1c26f2a161ae4de",null),(0,d.registerServerReference)(B,"7f2e230011e2b0897834197576c18ef572d408b4d3",null),a.s(["acceptThreadRelaysAction",0,B,"answerThreadAction",0,w,"cancelThreadAction",0,x,"clearFinishedThreadsAction",0,A,"createBotAction",0,p,"createSeedBotsAction",0,s,"deleteBotAction",0,t,"deleteThreadAction",0,z,"markSeenAction",0,y,"setBotMemoryOnAction",0,u,"startThreadAction",0,v,"updateBotAction",0,q]),c()}catch(a){c(a)}},!1),937864,a=>a.a(async(b,c)=>{try{var d=a.i(137936),e=a.i(53112),f=a.i(652619),g=a.i(225689),h=a.i(293480),i=a.i(688034),j=a.i(725466),k=a.i(713095),l=b([f,j]);[f,j]=l.then?(await l)():l;let m=e.z.enum(i.CONFIG_KEYS),n=(0,g.serverAction)(async(a,b)=>{let c=e.z.object({key:m,value:e.z.string().trim().min(1)}).parse({key:a,value:b}),d=i.CONFIG_ENTRIES[c.key];d?.signIn&&(0,h.publicError)(`${d.label} takes a sign-in, not a key.`),d?.choices?(0,i.acceptsChoice)(d,c.value)||(0,h.publicError)("That is not one of the options."):c.value.length<8&&(0,h.publicError)("That does not look like a key"),await (0,j.writeConfig)(c.key,c.value)}),o=(0,g.serverAction)(async a=>{await (0,j.removeConfig)(m.parse(a))}),p=(0,g.serverAction)(async()=>(0,f.startChatGptSignIn)());(0,k.ensureServerEntryExports)([n,o,p]),(0,d.registerServerReference)(n,"7f69248d6d9d1f0b3656881c7801b29d42b68bb667",null),(0,d.registerServerReference)(o,"7ff28dc5f254ed7fecc4fc2197f95a4732ea0d8ad1",null),(0,d.registerServerReference)(p,"7f01514ec9c15f2e0d83fce157779d74a52b9c739f",null),a.s(["removeConfigAction",0,o,"setConfigAction",0,n,"startChatGptSignInAction",0,p]),c()}catch(a){c(a)}},!1),935930,a=>a.a(async(b,c)=>{try{var d=a.i(137936),e=a.i(569572),f=a.i(947950),g=a.i(899284),h=a.i(225689),i=a.i(293480),j=a.i(182248),k=a.i(317844),l=a.i(713095),m=b([f,k]);[f,k]=m.then?(await m)():m;let o=(0,h.serverAction)(async a=>{let b=g.MCPServerFormSchema.parse(a);b.name===e.STUDIO_SERVER&&(0,i.publicError)(`"${e.STUDIO_SERVER}" is the app's own — pick another name`);let c=!!await (0,f.findServerDetail)(b.name);await (0,f.upsertServer)(b);let d=await n(b.name);return"error"!==d.status||c||await (0,f.deleteServer)(b.name),d}),p=(0,h.serverAction)(async a=>(await k.mcpManager.disconnect(a),n(a))),q=(0,h.serverAction)(async a=>{await k.mcpManager.disconnect(a),await (0,f.deleteServer)(a)||(0,i.publicError)("Server not found")});async function n(a){try{let b=await k.mcpManager.connect(a);return"auth_required"===b.status?{name:a,status:"auth_required",authorizationUrl:b.authorizationUrl,toolCount:0}:{name:a,status:"connected",toolCount:b.tools.length}}catch(b){return{name:a,status:"error",toolCount:0,error:(0,j.errorToString)(b)}}}let r=(0,h.serverAction)(async(a,b,c)=>{try{return await k.mcpManager.callTool(a,b,c)}catch(a){a instanceof k.McpAuthRequiredError&&(0,i.publicError)("Authorization required — reconnect this server first"),(0,i.publicError)((0,j.errorToString)(a))}});(0,l.ensureServerEntryExports)([o,p,q,r]),(0,d.registerServerReference)(o,"7ff8f4ddc456f01900d893c142d580a2682ece8ee9",null),(0,d.registerServerReference)(p,"7f4929468bc6ea5d691dec0a59d7667a1f1c6f1f0d",null),(0,d.registerServerReference)(q,"7f871a6c3cd8661c02c3d9bef4be2c4792dd86711a",null),(0,d.registerServerReference)(r,"7f4445663d57fd7f02ff93357e6fd107c529294652",null),a.s(["callToolAction",0,r,"deleteServerAction",0,q,"refreshServerAction",0,p,"registerServerAction",0,o]),c()}catch(a){c(a)}},!1),542715,a=>a.a(async(b,c)=>{try{var d=a.i(937864),e=a.i(910350);a.i(451208);var f=a.i(201300),g=a.i(439759),h=a.i(260210);a.i(432443);var i=a.i(935930),j=b([d,e,f,g,h,i]);[d,e,f,g,h,i]=j.then?(await j)():j,a.s([]),c()}catch(a){c(a)}},!1),873715,a=>a.a(async(b,c)=>{try{var d=a.i(542715),e=a.i(937864),f=a.i(910350),g=a.i(451208),h=a.i(201300),i=a.i(439759),j=a.i(260210),k=a.i(432443),l=a.i(935930),m=b([d,e,f,h,i,j,l]);[d,e,f,h,i,j,l]=m.then?(await m)():m,a.s(["7f01514ec9c15f2e0d83fce157779d74a52b9c739f",()=>e.startChatGptSignInAction,"7f14aebbf0de8891159190362b1eb52f77adcf6be2",()=>f.deleteThreadAction,"7f1a2f4e2d202c7fa438a862ef14ddf55caf1c45f8",()=>k.setSkillDisabledAction,"7f230c90e0b3a595af75ed6c9b3b9346d45b28a0e6",()=>f.setBotMemoryOnAction,"7f28f3317c0c0448fc076eb8b2fdc351377167d434",()=>h.reviseFactAction,"7f292058de693e9bedb3ba203fee00974077f9e0b6",()=>f.deleteBotAction,"7f2e230011e2b0897834197576c18ef572d408b4d3",()=>f.acceptThreadRelaysAction,"7f3461bfc35f0adabbb77f2723f190e13a3db002f2",()=>h.forgetFactAction,"7f37f5a1a9230f7fde616aea41c384ce3d489abd23",()=>f.createSeedBotsAction,"7f4445663d57fd7f02ff93357e6fd107c529294652",()=>l.callToolAction,"7f4929468bc6ea5d691dec0a59d7667a1f1c6f1f0d",()=>l.refreshServerAction,"7f4df059775807466d6f59f19acbde15dbef4cbdd9",()=>f.answerThreadAction,"7f510287bfbf77f7ba17ebc5a170ef1f0732f37260",()=>i.deleteCallAction,"7f5504510b2b5ac64fb7845bf8f1c26f2a161ae4de",()=>f.clearFinishedThreadsAction,"7f5985bbde6a386e3586444eed4f54c0183ee80fff",()=>k.uploadSkillAction,"7f5cb090bc50765e05bcbe51a3e9787de458d2c2d7",()=>g.deleteWorkspaceFileAction,"7f640a65cdf70f68212f5c7a86a2ddfa448136ce91",()=>j.deleteArtifactAction,"7f69248d6d9d1f0b3656881c7801b29d42b68bb667",()=>e.setConfigAction,"7f7112d380ff9e36ae4dfed13f9065355cb3f57463",()=>h.updateNoteAction,"7f762c6aa3b61bb8959005004173b58b3a00a33bc1",()=>k.createSkillAction,"7f802b56ac4b475092ccbfa7c0a4768c871dfc7087",()=>k.deleteSkillAction,"7f82c7e8d420b33957d9cd9585a395848aea8e24e9",()=>g.openFileAction,"7f871a6c3cd8661c02c3d9bef4be2c4792dd86711a",()=>l.deleteServerAction,"7f87c27fcd09f4119cec51d41fd65efb30f60d923d",()=>i.openCallAction,"7f8db82887d2a33a18b332b17db2571cdf69ee6c88",()=>h.setFactAlwaysLoadAction,"7f8dc37f7fb6c666c22cda159cfa1bf905135becfd",()=>h.deleteNoteAction,"7f917e19054bae2fc21123b4e6d62e2e9d7e60ca5d",()=>i.saveTurnsAction,"7f9a5f6dfac94ea98a45074e6bdc01793589f97196",()=>f.cancelThreadAction,"7f9c1e49c706caa152ff08631b3d9e546f03fbe3c4",()=>i.resetHistoryAction,"7fab13470bc62e14372a3f42bc27a46f6ca1888c81",()=>i.deleteEndedCallsAction,"7fac77b7a41807074b5a6418803a72c02393d83715",()=>i.saveThoughtAction,"7fae398b92f1138324cc5222fa49e72a4378f03741",()=>f.updateBotAction,"7fb96f48bef84701a5e44a724894c890b01403e19e",()=>h.addFactsAction,"7fbdaeff8927c534c7cd410a6ca9b4fdd8af2e7402",()=>i.endCallAction,"7fbf10b8968a8a3afc86561cd86f760880b2abddd7",()=>f.createBotAction,"7fc7d0deb4c2007c1476881a012b11964f41b6b577",()=>i.setCallSkillsAction,"7fdb0e583cb0c8a4cbf774bb658d5815c8148fe93b",()=>g.emptyScratchAction,"7fe353f166d162dd746150e216083bc3d978c525d9",()=>h.createNoteAction,"7feb38361657ff2d01858e3fd2d867d37a52aac4ba",()=>f.markSeenAction,"7ff28dc5f254ed7fecc4fc2197f95a4732ea0d8ad1",()=>e.removeConfigAction,"7ff8f4ddc456f01900d893c142d580a2682ece8ee9",()=>l.registerServerAction,"7ff917f5236e9de4a7137d6d5003d5dafeb295990e",()=>f.startThreadAction]),c()}catch(a){c(a)}},!1),201300,a=>a.a(async(b,c)=>{try{var d=a.i(137936),e=a.i(53112),f=a.i(569572),g=a.i(986743),h=a.i(661210),i=a.i(225689),j=a.i(293480),k=a.i(713095),l=b([g]);[g]=l.then?(await l)():l;let m=e.z.string().trim().refine(h.isMemoryPath,"Invalid note path"),n=(0,i.serverAction)(async(a,b,c=[])=>{let d=m.parse(a),f=e.z.string().min(1).parse(b),h=await (0,g.createNote)(d,f,{ownedByUser:!0});for(let a of(h||(0,j.publicError)("Note already exists"),c.map(a=>a.trim()).filter(Boolean)))await (0,g.addFact)(h.id,a);return{id:h.id}}),o=(0,i.serverAction)(async(a,b)=>{await (0,g.updateNote)(a,b)||(0,j.publicError)("Note not found")}),p=(0,i.serverAction)(async a=>{await (0,g.deleteNote)(a)||(0,j.publicError)("Note not found")}),q=(0,i.serverAction)(async(a,b)=>{let c=b.map(a=>a.trim()).filter(Boolean);for(let b of(0===c.length&&(0,j.publicError)("Fact text is required"),c))await (0,g.addFact)(a,b);return{added:c.length}}),r=(0,i.serverAction)(async(a,b,c)=>{c.trim()||(0,j.publicError)("Fact text is required"),await (0,g.reviseFact)(a,b,c.trim())||(0,j.publicError)("Fact not found")}),s=(0,i.serverAction)(async(a,b)=>{await (0,g.forgetFact)(a,b)||(0,j.publicError)("Fact not found")}),t=(0,i.serverAction)(async(a,b,c)=>{let d=await (0,g.setFactAlwaysLoad)(a,b,c);"full"===d&&(0,j.publicError)(`Only ${f.MEMORY_LIMITS.carried} facts can be carried into every call — drop one first`),"missing"===d&&(0,j.publicError)("Fact not found")});(0,k.ensureServerEntryExports)([n,o,p,q,r,s,t]),(0,d.registerServerReference)(n,"7fe353f166d162dd746150e216083bc3d978c525d9",null),(0,d.registerServerReference)(o,"7f7112d380ff9e36ae4dfed13f9065355cb3f57463",null),(0,d.registerServerReference)(p,"7f8dc37f7fb6c666c22cda159cfa1bf905135becfd",null),(0,d.registerServerReference)(q,"7fb96f48bef84701a5e44a724894c890b01403e19e",null),(0,d.registerServerReference)(r,"7f28f3317c0c0448fc076eb8b2fdc351377167d434",null),(0,d.registerServerReference)(s,"7f3461bfc35f0adabbb77f2723f190e13a3db002f2",null),(0,d.registerServerReference)(t,"7f8db82887d2a33a18b332b17db2571cdf69ee6c88",null),a.s(["addFactsAction",0,q,"createNoteAction",0,n,"deleteNoteAction",0,p,"forgetFactAction",0,s,"reviseFactAction",0,r,"setFactAlwaysLoadAction",0,t,"updateNoteAction",0,o]),c()}catch(a){c(a)}},!1),432443,a=>{"use strict";var b,c,d,e=a.i(137936),f=(0,a.i(362562).createRequire)("/");try{c=(b=f("worker_threads")).Worker,d=b.isMarkedAsUntransferable}catch(a){}var g=c?function(a,b,e,f,g){var h=!1,i=new c(a+";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global",{eval:!0}).on("error",function(a){return g(a,null)}).on("message",function(a){return g(null,a)}).on("exit",function(a){a&&!h&&g(Error("exited with code "+a),null)});return d&&(f=f.filter(function(a){return!d(a)})),i.postMessage(e,f),i.terminate=function(){return h=!0,c.prototype.terminate.call(i)},i}:function(a,b,c,d,e){setImmediate(function(){return e(Error("async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)"),null)});var f=function(){};return{terminate:f,postMessage:f}},h=Uint8Array,i=Uint16Array,j=Int32Array,k=new h([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),l=new h([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),m=new h([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),n=function(a,b){for(var c=new i(31),d=0;d<31;++d)c[d]=b+=1<<a[d-1];for(var e=new j(c[30]),d=1;d<30;++d)for(var f=c[d];f<c[d+1];++f)e[f]=f-c[d]<<5|d;return{b:c,r:e}},b=n(k,2),o=b.b,p=b.r;o[28]=258,p[258]=28;for(var q=n(l,0),r=q.b,s=q.r,t=new i(32768),u=0;u<32768;++u){var v=(43690&u)>>1|(21845&u)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,t[u]=((65280&v)>>8|(255&v)<<8)>>1}for(var w=function(a,b,c){for(var d,e=a.length,f=0,g=new i(b);f<e;++f)a[f]&&++g[a[f]-1];var h=new i(b);for(f=1;f<b;++f)h[f]=h[f-1]+g[f-1]<<1;if(c){d=new i(1<<b);var j=15-b;for(f=0;f<e;++f)if(a[f])for(var k=f<<4|a[f],l=b-a[f],m=h[a[f]-1]++<<l,n=m|(1<<l)-1;m<=n;++m)d[t[m]>>j]=k}else for(d=new i(e),f=0;f<e;++f)a[f]&&(d[f]=t[h[a[f]-1]++]>>15-a[f]);return d},x=new h(288),u=0;u<144;++u)x[u]=8;for(var u=144;u<256;++u)x[u]=9;for(var u=256;u<280;++u)x[u]=7;for(var u=280;u<288;++u)x[u]=8;for(var y=new h(32),u=0;u<32;++u)y[u]=5;var z=w(x,9,0),A=w(x,9,1),B=w(y,5,0),C=w(y,5,1),D=function(a){for(var b=a[0],c=1;c<a.length;++c)a[c]>b&&(b=a[c]);return b},E=function(a,b,c){var d=b/8|0;return(a[d]|a[d+1]<<8)>>(7&b)&c},F=function(a,b){var c=b/8|0;return(a[c]|a[c+1]<<8|a[c+2]<<16)>>(7&b)},G=function(a){return(a+7)/8|0},H=function(a,b,c){return(null==b||b<0)&&(b=0),(null==c||c>a.length)&&(c=a.length),new h(a.subarray(b,c))},I=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],J=function(a,b,c){var d=Error(b||I[a]);if(d.code=a,Error.captureStackTrace&&Error.captureStackTrace(d,J),!c)throw d;return d},K=function(a,b,c,d){var e=a.length,f=d?d.length:0;if(!e||b.f&&!b.l)return c||new h(0);var g=!c,i=g||2!=b.i,j=b.i;g&&(c=new h(3*e));var n=function(a){var b=c.length;if(a>b){var d=new h(Math.max(2*b,a));d.set(c),c=d}},p=b.f||0,q=b.p||0,s=b.b||0,t=b.l,u=b.d,v=b.m,x=b.n,y=8*e;do{if(!t){p=E(a,q,1);var z=E(a,q+1,3);if(q+=3,z)if(1==z)t=A,u=C,v=9,x=5;else if(2==z){var B=E(a,q,31)+257,I=E(a,q+10,15)+4,K=B+E(a,q+5,31)+1;q+=14;for(var L=new h(K),M=new h(19),N=0;N<I;++N)M[m[N]]=E(a,q+3*N,7);q+=3*I;for(var O=D(M),P=(1<<O)-1,Q=w(M,O,1),N=0;N<K;){var R=Q[E(a,q,P)];q+=15&R;var S=R>>4;if(S<16)L[N++]=S;else{var T=0,U=0;for(16==S?(U=3+E(a,q,3),q+=2,T=L[N-1]):17==S?(U=3+E(a,q,7),q+=3):18==S&&(U=11+E(a,q,127),q+=7);U--;)L[N++]=T}}var V=L.subarray(0,B),W=L.subarray(B);v=D(V),x=D(W),t=w(V,v,1),u=w(W,x,1)}else J(1);else{var S=G(q)+4,X=a[S-4]|a[S-3]<<8,Y=S+X;if(Y>e){j&&J(0);break}i&&n(s+X),c.set(a.subarray(S,Y),s),b.b=s+=X,b.p=q=8*Y,b.f=p;continue}if(q>y){j&&J(0);break}}i&&n(s+131072);for(var Z=(1<<v)-1,$=(1<<x)-1,_=q;;_=q){var T=t[F(a,q)&Z],aa=T>>4;if((q+=15&T)>y){j&&J(0);break}if(T||J(2),aa<256)c[s++]=aa;else if(256==aa){_=q,t=null;break}else{var ab=aa-254;if(aa>264){var N=aa-257,ac=k[N];ab=E(a,q,(1<<ac)-1)+o[N],q+=ac}var ad=u[F(a,q)&$],ae=ad>>4;ad||J(3),q+=15&ad;var W=r[ae];if(ae>3){var ac=l[ae];W+=F(a,q)&(1<<ac)-1,q+=ac}if(q>y){j&&J(0);break}i&&n(s+131072);var af=s+ab;if(s<W){var ag=f-W,ah=Math.min(W,af);for(ag+s<0&&J(3);s<ah;++s)c[s]=d[ag+s]}for(;s<af;++s)c[s]=c[s-W]}}b.l=t,b.p=_,b.b=s,b.f=p,t&&(p=1,b.m=v,b.d=u,b.n=x)}while(!p)return s!=c.length&&g?H(c,0,s):c.subarray(0,s)},L=function(a,b,c){c<<=7&b;var d=b/8|0;a[d]|=c,a[d+1]|=c>>8},M=function(a,b,c){c<<=7&b;var d=b/8|0;a[d]|=c,a[d+1]|=c>>8,a[d+2]|=c>>16},N=function(a,b){for(var c=[],d=0;d<a.length;++d)a[d]&&c.push({s:d,f:a[d]});var e=c.length,f=c.slice();if(!e)return{t:U,l:0};if(1==e){var g=new h(c[0].s+1);return g[c[0].s]=1,{t:g,l:1}}c.sort(function(a,b){return a.f-b.f}),c.push({s:-1,f:25001});var j=c[0],k=c[1],l=0,m=1,n=2;for(c[0]={s:-1,f:j.f+k.f,l:j,r:k};m!=e-1;)j=c[c[l].f<c[n].f?l++:n++],k=c[l!=m&&c[l].f<c[n].f?l++:n++],c[m++]={s:-1,f:j.f+k.f,l:j,r:k};for(var o=f[0].s,d=1;d<e;++d)f[d].s>o&&(o=f[d].s);var p=new i(o+1),q=O(c[m-1],p,0);if(q>b){var d=0,r=0,s=q-b,t=1<<s;for(f.sort(function(a,b){return p[b.s]-p[a.s]||a.f-b.f});d<e;++d){var u=f[d].s;if(p[u]>b)r+=t-(1<<q-p[u]),p[u]=b;else break}for(r>>=s;r>0;){var v=f[d].s;p[v]<b?r-=1<<b-p[v]++-1:++d}for(;d>=0&&r;--d){var w=f[d].s;p[w]==b&&(--p[w],++r)}q=b}return{t:new h(p),l:q}},O=function(a,b,c){return -1==a.s?Math.max(O(a.l,b,c+1),O(a.r,b,c+1)):b[a.s]=c},P=function(a){for(var b=a.length;b&&!a[--b];);for(var c=new i(++b),d=0,e=a[0],f=1,g=function(a){c[d++]=a},h=1;h<=b;++h)if(a[h]==e&&h!=b)++f;else{if(!e&&f>2){for(;f>138;f-=138)g(32754);f>2&&(g(f>10?f-11<<5|28690:f-3<<5|12305),f=0)}else if(f>3){for(g(e),--f;f>6;f-=6)g(8304);f>2&&(g(f-3<<5|8208),f=0)}for(;f--;)g(e);f=1,e=a[h]}return{c:c.subarray(0,d),n:b}},Q=function(a,b){for(var c=0,d=0;d<b.length;++d)c+=a[d]*b[d];return c},R=function(a,b,c){var d=c.length,e=G(b+2);a[e]=255&d,a[e+1]=d>>8,a[e+2]=255^a[e],a[e+3]=255^a[e+1];for(var f=0;f<d;++f)a[e+f+4]=c[f];return(e+4+d)*8},S=function(a,b,c,d,e,f,g,h,j,n,o){L(b,o++,c),++e[256];for(var p,q,r,s,t=N(e,15),u=t.t,v=t.l,A=N(f,15),C=A.t,D=A.l,E=P(u),F=E.c,G=E.n,H=P(C),I=H.c,J=H.n,K=new i(19),O=0;O<F.length;++O)++K[31&F[O]];for(var O=0;O<I.length;++O)++K[31&I[O]];for(var S=N(K,7),T=S.t,U=S.l,V=19;V>4&&!T[m[V-1]];--V);var W=n+5<<3,X=Q(e,x)+Q(f,y)+g,Y=Q(e,u)+Q(f,C)+g+14+3*V+Q(K,T)+2*K[16]+3*K[17]+7*K[18];if(j>=0&&W<=X&&W<=Y)return R(b,o,a.subarray(j,j+n));if(L(b,o,1+(Y<X)),o+=2,Y<X){p=w(u,v,0),q=u,r=w(C,D,0),s=C;var Z=w(T,U,0);L(b,o,G-257),L(b,o+5,J-1),L(b,o+10,V-4),o+=14;for(var O=0;O<V;++O)L(b,o+3*O,T[m[O]]);o+=3*V;for(var $=[F,I],_=0;_<2;++_)for(var aa=$[_],O=0;O<aa.length;++O){var ab=31&aa[O];L(b,o,Z[ab]),o+=T[ab],ab>15&&(L(b,o,aa[O]>>5&127),o+=aa[O]>>12)}}else p=z,q=x,r=B,s=y;for(var O=0;O<h;++O){var ac=d[O];if(ac>255){var ab=ac>>18&31;M(b,o,p[ab+257]),o+=q[ab+257],ab>7&&(L(b,o,ac>>23&31),o+=k[ab]);var ad=31&ac;M(b,o,r[ad]),o+=s[ad],ad>3&&(M(b,o,ac>>5&8191),o+=l[ad])}else M(b,o,p[ac]),o+=q[ac]}return M(b,o,p[256]),o+q[256]},T=new j([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),U=new h(0),V=function(a,b,c,d,e,f){var g=f.z||a.length,m=new h(d+g+5*(1+Math.ceil(g/7e3))+e),n=m.subarray(d,m.length-e),o=f.l,q=7&(f.r||0);if(b){q&&(n[0]=f.r>>3);for(var r=T[b-1],t=r>>13,u=8191&r,v=(1<<c)-1,w=f.p||new i(32768),x=f.h||new i(v+1),y=Math.ceil(c/3),z=2*y,A=function(b){return(a[b]^a[b+1]<<y^a[b+2]<<z)&v},B=new j(25e3),C=new i(288),D=new i(32),E=0,F=0,I=f.i||0,J=0,K=f.w||0,L=0;I+2<g;++I){var M=A(I),N=32767&I,O=x[M];if(w[N]=O,x[M]=N,K<=I){var P=g-I;if((E>7e3||J>24576)&&(P>423||!o)){q=S(a,n,0,B,C,D,F,J,L,I-L,q),J=E=F=0,L=I;for(var Q=0;Q<286;++Q)C[Q]=0;for(var Q=0;Q<30;++Q)D[Q]=0}var U=2,V=0,W=u,X=N-O&32767;if(P>2&&M==A(I-X))for(var Y=Math.min(t,P)-1,Z=Math.min(32767,I),$=Math.min(258,P);X<=Z&&--W&&N!=O;){if(a[I+U]==a[I+U-X]){for(var _=0;_<$&&a[I+_]==a[I+_-X];++_);if(_>U){if(U=_,V=X,_>Y)break;for(var aa=Math.min(X,_-2),ab=0,Q=0;Q<aa;++Q){var ac=I-X+Q&32767,ad=w[ac],ae=ac-ad&32767;ae>ab&&(ab=ae,O=ac)}}}O=w[N=O],X+=N-O&32767}if(V){B[J++]=0x10000000|p[U]<<18|s[V];var af=31&p[U],ag=31&s[V];F+=k[af]+l[ag],++C[257+af],++D[ag],K=I+U,++E}else B[J++]=a[I],++C[a[I]]}}for(I=Math.max(I,K);I<g;++I)B[J++]=a[I],++C[a[I]];q=S(a,n,o,B,C,D,F,J,L,I-L,q),o||(f.r=7&q|n[q/8|0]<<3,q-=7,f.h=x,f.p=w,f.i=I,f.w=K)}else{for(var I=f.w||0;I<g+o;I+=65535){var ah=I+65535;ah>=g&&(n[q/8|0]=o,ah=g),q=R(n,q+1,a.subarray(I,ah))}f.i=g}return H(m,0,d+G(q)+e)},W=function(){for(var a=new Int32Array(256),b=0;b<256;++b){for(var c=b,d=9;--d;)c=(1&c&&-0x12477ce0)^c>>>1;a[b]=c}return a}(),X=function(){var a=-1;return{p:function(b){for(var c=a,d=0;d<b.length;++d)c=W[255&c^b[d]]^c>>>8;a=c},d:function(){return~a}}},Y=function(){var a=1,b=0;return{p:function(c){for(var d=a,e=b,f=0|c.length,g=0;g!=f;){for(var h=Math.min(g+2655,f);g<h;++g)e+=d+=c[g];d=(65535&d)+15*(d>>16),e=(65535&e)+15*(e>>16)}a=d,b=e},d:function(){return a%=65521,b%=65521,(255&a)<<24|(65280&a)<<8|(255&b)<<8|b>>8}}},Z=function(a,b,c,d,e){if(!e&&(e={l:1},b.dictionary)){var f=b.dictionary.subarray(-32768),g=new h(f.length+a.length);g.set(f),g.set(a,f.length),a=g,e.w=f.length}return V(a,null==b.level?6:b.level,null==b.mem?e.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):20:12+b.mem,c,d,e)},$=function(a,b){var c={};for(var d in a)c[d]=a[d];for(var d in b)c[d]=b[d];return c},_=function(a,b,c){for(var d=a(),e=a.toString(),f=e.slice(e.indexOf("[")+1,e.lastIndexOf("]")).replace(/\s+/g,"").split(","),g=0;g<d.length;++g){var h=d[g],i=f[g];if("function"==typeof h){b+=";"+i+"=";var j=h.toString();if(h.prototype)if(-1!=j.indexOf("[native code]")){var k=j.indexOf(" ",8)+1;b+=j.slice(k,j.indexOf("(",k))}else for(var l in b+=j,h.prototype)b+=";"+i+".prototype."+l+"="+h.prototype[l].toString();else b+=j}else c[i]=h}return b},aa=[],ab=function(a){var b=[];for(var c in a)a[c].buffer&&b.push((a[c]=new a[c].constructor(a[c])).buffer);return b},ac=function(a,b,c,d){if(!aa[c]){for(var e="",f={},h=a.length-1,i=0;i<h;++i)e=_(a[i],e,f);aa[c]={c:_(a[h],e,f),e:f}}var j=$({},aa[c].e);return g(aa[c].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+b.toString()+"}",c,j,ab(j),d)},ad=function(){return[h,i,j,k,l,m,o,r,A,C,t,I,w,D,E,F,G,H,J,K,aB,ah,ai]},ae=function(){return[h,i,j,k,l,m,p,s,z,x,B,y,t,T,U,w,L,M,N,O,P,Q,R,S,G,H,V,Z,ay,ah]},af=function(){return[aq,ar]},ag=function(){return[au]},ah=function(a){return postMessage(a,[a.buffer])},ai=function(a){return a&&{out:a.size&&new h(a.size),dictionary:a.dictionary}},aj=function(a){return a.ondata=function(a,b){return postMessage([a,b],[a.buffer])},function(b){b.data[0]?(a.push(b.data[0],b.data[1]),postMessage([b.data[0].length])):a.flush(b.data[1])}},ak=function(a,b,c,d,e,f,g){var h,i=ac(a,d,e,function(a,c){a?(i.terminate(),b.ondata.call(b,a)):Array.isArray(c)?1==c.length?(b.queuedSize-=c[0],b.ondrain&&b.ondrain(c[0])):(c[1]&&i.terminate(),b.ondata.call(b,a,c[0],c[1])):g(c)});i.postMessage(c),b.queuedSize=0,b.push=function(a,c){b.ondata||J(5),h&&b.ondata(J(4,0,1),null,!!c),b.queuedSize+=a.length,i.postMessage([a,h=c],a.buffer instanceof ArrayBuffer?[a.buffer]:[])},b.terminate=function(){i.terminate()},f&&(b.flush=function(a){i.postMessage([0,a])})},al=function(a,b){return a[b]|a[b+1]<<8},am=function(a,b){return(a[b]|a[b+1]<<8|a[b+2]<<16|a[b+3]<<24)>>>0},an=function(a,b){return am(a,b)+0x100000000*am(a,b+4)},ao=function(a,b,c){for(;c;++b)a[b]=c,c>>>=8},ap=function(a,b){var c=b.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=b.level<2?4:2*(9==b.level),a[9]=3,0!=b.mtime&&ao(a,4,Math.floor(new Date(b.mtime||Date.now())/1e3)),c){a[3]=8;for(var d=0;d<=c.length;++d)a[d+10]=c.charCodeAt(d)}},aq=function(a){(31!=a[0]||139!=a[1]||8!=a[2])&&J(6,"invalid gzip data");var b=a[3],c=10;4&b&&(c+=(a[10]|a[11]<<8)+2);for(var d=(b>>3&1)+(b>>4&1);d>0;d-=!a[c++]);return c+(2&b)},ar=function(a){var b=a.length;return(a[b-4]|a[b-3]<<8|a[b-2]<<16|a[b-1]<<24)>>>0},as=function(a){return 10+(a.filename?a.filename.length+1:0)},at=function(a,b){var c=b.level;if(a[0]=120,a[1]=(0==c?0:c<6?1:9==c?3:2)<<6|(b.dictionary&&32),a[1]|=31-(a[0]<<8|a[1])%31,b.dictionary){var d=Y();d.p(b.dictionary),ao(a,2,d.d())}},au=function(a,b){return((15&a[0])!=8||a[0]>>4>7||(a[0]<<8|a[1])%31)&&J(6,"invalid zlib data"),(a[1]>>5&1)==+!b&&J(6,"invalid zlib data: "+(32&a[1]?"need":"unexpected")+" dictionary"),(a[1]>>3&4)+2};function av(a,b){return"function"==typeof a&&(b=a,a={}),this.ondata=b,a}var aw=function(){function a(a,b){if("function"==typeof a&&(b=a,a={}),this.ondata=b,this.o=a||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new h(98304),this.o.dictionary){var c=this.o.dictionary.subarray(-32768);this.b.set(c,32768-c.length),this.s.i=32768-c.length}}return a.prototype.p=function(a,b){this.ondata(Z(a,this.o,0,0,this.s),b)},a.prototype.push=function(a,b){this.ondata||J(5),this.s.l&&J(4);var c=a.length+this.s.z;if(c>this.b.length){if(c>2*this.b.length-32768){var d=new h(-32768&c);d.set(this.b.subarray(0,this.s.z)),this.b=d}var e=this.b.length-this.s.z;this.b.set(a.subarray(0,e),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(a.subarray(e),32768),this.s.z=a.length-e+32768,this.s.i=32766,this.s.w=32768}else this.b.set(a,this.s.z),this.s.z+=a.length;this.s.l=1&b,(this.s.z>this.s.w+8191||b)&&(this.p(this.b,b||!1),this.s.w=this.s.i,this.s.i-=2),b&&(this.s=this.o={},this.b=U)},a.prototype.flush=function(a){if(this.ondata||J(5),this.s.l&&J(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2,a){var b=new h(6);b[0]=this.s.r>>3;var c=R(b,this.s.r,U);this.s.r=0,this.ondata(b.subarray(0,c>>3),!1)}},a}(),ax=function(a,b){ak([ae,function(){return[aj,aw]}],this,av.call(this,a,b),function(a){onmessage=aj(new aw(a.data))},6,1)};function ay(a,b){return Z(a,b||{},0,0)}var az=function(){function a(a,b){"function"==typeof a&&(b=a,a={}),this.ondata=b;var c=a&&a.dictionary&&a.dictionary.subarray(-32768);this.s={i:0,b:c?c.length:0},this.o=new h(32768),this.p=new h(0),c&&this.o.set(c)}return a.prototype.e=function(a){if(this.ondata||J(5),this.d&&J(4),this.p.length){if(a.length){var b=new h(this.p.length+a.length);b.set(this.p),b.set(a,this.p.length),this.p=b}}else this.p=a},a.prototype.c=function(a){this.s.i=+(this.d=a||!1);var b=this.s.b,c=K(this.p,this.s,this.o);this.ondata(H(c,b,this.s.b),this.d),this.o=H(c,this.s.b-32768),this.s.b=this.o.length,this.p=H(this.p,this.s.p/8|0),this.s.p&=7},a.prototype.push=function(a,b){this.e(a),this.c(b)},a}(),aA=function(a,b){ak([ad,function(){return[aj,az]}],this,av.call(this,a,b),function(a){onmessage=aj(new az(a.data))},7,0)};function aB(a,b){return K(a,{i:2},b&&b.out,b&&b.dictionary)}(function(){function a(a,b){this.c=X(),this.l=0,this.v=1,aw.call(this,a,b)}a.prototype.push=function(a,b){this.c.p(a),this.l+=a.length,aw.prototype.push.call(this,a,b)},a.prototype.p=function(a,b){var c=Z(a,this.o,this.v&&as(this.o),b&&8,this.s);this.v&&(ap(c,this.o),this.v=0),b&&(ao(c,c.length-8,this.c.d()),ao(c,c.length-4,this.l)),this.ondata(c,b)},a.prototype.flush=function(a){aw.prototype.flush.call(this,a)}})();var aC=function(){function a(a,b){this.v=1,this.r=0,az.call(this,a,b)}return a.prototype.push=function(a,b){if(az.prototype.e.call(this,a),this.r+=a.length,this.v){var c=this.p.subarray(this.v-1),d=c.length>3?aq(c):4;if(d>c.length){if(!b)return}else this.v>1&&this.onmember&&this.onmember(this.r-c.length);this.p=c.subarray(d),this.v=0}az.prototype.c.call(this,0),this.s.f&&!this.s.l?(this.v=G(this.s.p)+9,this.s={i:0},this.o=new h(0),this.push(new h(0),b)):b&&az.prototype.c.call(this,b)},a}(),aD=function(a,b){var c=this;ak([ad,af,function(){return[aj,az,aC]}],this,av.call(this,a,b),function(a){var b=new aC(a.data);b.onmember=function(a){return postMessage(a)},onmessage=aj(b)},9,0,function(a){return c.onmember&&c.onmember(a)})},aE=(function(){function a(a,b){this.c=Y(),this.v=1,aw.call(this,a,b)}a.prototype.push=function(a,b){this.c.p(a),aw.prototype.push.call(this,a,b)},a.prototype.p=function(a,b){var c=Z(a,this.o,this.v&&(this.o.dictionary?6:2),b&&4,this.s);this.v&&(at(c,this.o),this.v=0),b&&ao(c,c.length-4,this.c.d()),this.ondata(c,b)},a.prototype.flush=function(a){aw.prototype.flush.call(this,a)}}(),function(){function a(a,b){az.call(this,a,b),this.v=a&&a.dictionary?2:1}return a.prototype.push=function(a,b){if(az.prototype.e.call(this,a),this.v){if(this.p.length<6&&!b)return;this.p=this.p.subarray(au(this.p,this.v-1)),this.v=0}b&&(this.p.length<4&&J(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),az.prototype.c.call(this,b)},a}()),aF=function(a,b){ak([ad,ag,function(){return[aj,az,aE]}],this,av.call(this,a,b),function(a){onmessage=aj(new aE(a.data))},11,0)},aG=function(){function a(a,b){this.o=av.call(this,a,b)||{},this.G=aC,this.I=az,this.Z=aE}return a.prototype.i=function(){var a=this;this.s.ondata=function(b,c){a.ondata(b,c)}},a.prototype.push=function(a,b){if(this.ondata||J(5),this.s)this.s.push(a,b);else{if(this.p&&this.p.length){var c=new h(this.p.length+a.length);c.set(this.p),c.set(a,this.p.length)}else this.p=a;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):(15&this.p[0])!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,b),this.p=null)}},a}();function aH(a,b){aG.call(this,a,b),this.queuedSize=0,this.G=aD,this.I=aA,this.Z=aF}aH.prototype.i=function(){var a=this;this.s.ondata=function(b,c,d){a.ondata(b,c,d)},this.s.ondrain=function(b){a.queuedSize-=b,a.ondrain&&a.ondrain(b)}},aH.prototype.push=function(a,b){this.queuedSize+=a.length,aG.prototype.push.call(this,a,b)};var aI="u">typeof TextEncoder&&new TextEncoder,aJ="u">typeof TextDecoder&&new TextDecoder,aK=0;try{aJ.decode(U,{stream:!0}),aK=1}catch(a){}var aL=function(a){for(var b="",c=0;;){var d=a[c++],e=(d>127)+(d>223)+(d>239);if(c+e>a.length)return{s:b,r:H(a,c-1)};e?3==e?b+=String.fromCharCode(55296|(d=((15&d)<<18|(63&a[c++])<<12|(63&a[c++])<<6|63&a[c++])-65536)>>10,56320|1023&d):1&e?b+=String.fromCharCode((31&d)<<6|63&a[c++]):b+=String.fromCharCode((15&d)<<12|(63&a[c++])<<6|63&a[c++]):b+=String.fromCharCode(d)}};function aM(a,b){if(b){for(var c=new h(a.length),d=0;d<a.length;++d)c[d]=a.charCodeAt(d);return c}if(aI)return aI.encode(a);for(var e=a.length,f=new h(a.length+(a.length>>1)),g=0,i=function(a){f[g++]=a},d=0;d<e;++d){if(g+5>f.length){var j=new h(g+8+(e-d<<1));j.set(f),f=j}var k=a.charCodeAt(d);k<128||b?i(k):(k<2048?i(192|k>>6):(k>55295&&k<57344?(i(240|(k=65536+(1047552&k)|1023&a.charCodeAt(++d))>>18),i(128|k>>12&63)):i(224|k>>12),i(128|k>>6&63)),i(128|63&k))}return H(f,0,g)}function aN(a,b){if(b){for(var c="",d=0;d<a.length;d+=16384)c+=String.fromCharCode.apply(null,a.subarray(d,d+16384));return c}if(aJ)return aJ.decode(a);var e=aL(a),f=e.s,c=e.r;return c.length&&J(8),f}(function(a){this.ondata=a,aK?this.t=new TextDecoder:this.p=U}).prototype.push=function(a,b){if(this.ondata||J(5),b=!!b,this.t){this.ondata(this.t.decode(a,{stream:!0}),b),b&&(this.t.decode().length&&J(8),this.t=null);return}this.p||J(4);var c=new h(this.p.length+a.length);c.set(this.p),c.set(a,this.p.length);var d=aL(c),e=d.s,f=d.r;b?(f.length&&J(8),this.p=null):this.p=f,this.ondata(e,b)},(function(a){this.ondata=a}).prototype.push=function(a,b){this.ondata||J(5),this.d&&J(4),this.ondata(aM(a),this.d=b||!1)};var aO=function(a){return 1==a?3:a<6?2:+(9==a)},aP=function(a,b,c){var d=al(a,b+28),e=al(a,b+30),f=aN(a.subarray(b+46,b+46+d),!(2048&al(a,b+8))),g=b+46+d,h=aQ(a,g,e,c,am(a,b+20),am(a,b+24),am(a,b+42)),i=h[0],j=h[1],k=h[2];return[al(a,b+10),i,j,f,g+e+al(a,b+32),k]},aQ=function(a,b,c,d,e,f,g){var h=0xffffffff==e,i=0xffffffff==f,j=0xffffffff==g,k=b+c;if(d&&h+i+j){for(;b+4<k;b+=4+al(a,b+2))if(1==al(a,b))return[h?an(a,b+4+8*i):e,i?an(a,b+4):f,j?an(a,b+4+8*(i+h)):g,1];d<2&&J(13)}return[e,f,g,0]},aR=function(a){var b=0;if(a)for(var c in a){var d=a[c].length;d>65535&&J(9),b+=d+4}return b},aS=function(a,b,c,d,e,f,g,h){var i=d.length,j=c.extra,k=h&&h.length,l=aR(j);ao(a,b,null!=g?0x2014b50:0x4034b50),b+=4,null!=g&&(a[b++]=20,a[b++]=c.os),a[b]=20,b+=2,a[b++]=c.flag<<1|(f<0&&8),a[b++]=e&&8,a[b++]=255&c.compression,a[b++]=c.compression>>8;var m=new Date(null==c.mtime?Date.now():c.mtime),n=m.getFullYear()-1980;if((n<0||n>119)&&J(10),ao(a,b,n<<25|m.getMonth()+1<<21|m.getDate()<<16|m.getHours()<<11|m.getMinutes()<<5|m.getSeconds()>>1),b+=4,-1!=f&&(ao(a,b,c.crc),ao(a,b+4,f<0?-f-2:f),ao(a,b+8,c.size)),ao(a,b+12,i),ao(a,b+14,l),b+=16,null!=g&&(ao(a,b,k),ao(a,b+6,c.attrs),ao(a,b+10,g),b+=14),a.set(d,b),b+=i,l)for(var o in j){var p=j[o],q=p.length;ao(a,b,+o),ao(a,b+2,q),a.set(p,b+4),b+=4+q}return k&&(a.set(h,b),b+=k),b},aT=function(a,b,c,d,e){ao(a,b,0x6054b50),ao(a,b+8,c),ao(a,b+10,c),ao(a,b+12,d),ao(a,b+16,e)},aU=function(){function a(a){this.filename=a,this.c=X(),this.size=0,this.compression=0}return a.prototype.process=function(a,b){this.ondata(null,a,b)},a.prototype.push=function(a,b){this.ondata||J(5),this.c.p(a),this.size+=a.length,b&&(this.crc=this.c.d()),this.process(a,b||!1)},a}();function aV(a,b){var c=this;b||(b={}),aU.call(this,a),this.d=new aw(b,function(a,b){c.ondata(null,a,b)}),this.compression=8,this.flag=aO(b.level)}function aW(a,b){var c=this;b||(b={}),aU.call(this,a),this.d=new ax(b,function(a,b,d){c.ondata(a,b,d)}),this.compression=8,this.flag=aO(b.level),this.terminate=this.d.terminate}function aX(a){this.ondata=a,this.u=[],this.d=1}aV.prototype.process=function(a,b){try{this.d.push(a,b)}catch(a){this.ondata(a,null,b)}},aV.prototype.push=function(a,b){aU.prototype.push.call(this,a,b)},aW.prototype.process=function(a,b){this.d.push(a,b)},aW.prototype.push=function(a,b){aU.prototype.push.call(this,a,b)},aX.prototype.add=function(a){var b=this;if(this.ondata||J(5),2&this.d)this.ondata(J(4+(1&this.d)*8,0,1),null,!1);else{var c=aM(a.filename),d=c.length,e=a.comment,f=e&&aM(e),g=d!=a.filename.length||f&&e.length!=f.length,i=d+aR(a.extra)+30;d>65535&&this.ondata(J(11,0,1),null,!1);var j=new h(i);aS(j,0,a,c,g,-1);var k=[j],l=function(){for(var a=0,c=k;a<c.length;a++){var d=c[a];b.ondata(null,d,!1)}k=[]},m=this.d;this.d=0;var n=this.u.length,o=$(a,{f:c,u:g,o:f,t:function(){a.terminate&&a.terminate()},r:function(){if(l(),m){var a=b.u[n+1];a?a.r():b.d=1}m=1}}),p=0;a.ondata=function(c,d,e){if(c)b.ondata(c,d,e),b.terminate();else if(p+=d.length,k.push(d),e){var f=new h(16);ao(f,0,0x8074b50),ao(f,4,a.crc),ao(f,8,p),ao(f,12,a.size),k.push(f),o.c=p,o.b=i+p+16,o.crc=a.crc,o.size=a.size,m&&o.r(),m=1}else m&&l()},this.u.push(o)}},aX.prototype.end=function(){var a=this;2&this.d?this.ondata(J(4+(1&this.d)*8,0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&a.d&&(a.u.splice(-1,1),a.e())},t:function(){}}),this.d=3)},aX.prototype.e=function(){for(var a=0,b=0,c=0,d=0,e=this.u;d<e.length;d++){var f=e[d];c+=46+f.f.length+aR(f.extra)+(f.o?f.o.length:0)}for(var g=new h(c+22),i=0,j=this.u;i<j.length;i++){var f=j[i];aS(g,a,f,f.f,f.u,-f.c-2,b,f.o),a+=46+f.f.length+aR(f.extra)+(f.o?f.o.length:0),b+=f.b}aT(g,a,this.u.length,c,b),this.ondata(null,g,!0),this.d=2},aX.prototype.terminate=function(){for(var a=0,b=this.u;a<b.length;a++)b[a].t();this.d=2};var aY=function(){function a(){}return a.prototype.push=function(a,b){this.ondata(null,a,b)},a.compression=0,a}();function aZ(){var a=this;this.i=new az(function(b,c){a.ondata(null,b,c)})}function a$(a,b){var c=this;b<32e4?this.i=new az(function(a,b){c.ondata(null,a,b)}):(this.i=new aA(function(a,b,d){c.ondata(a,b,d)}),this.terminate=this.i.terminate)}function a_(a){this.onfile=a,this.k=[],this.o={0:aY},this.p=U}aZ.prototype.push=function(a,b){try{this.i.push(a,b)}catch(a){this.ondata(a,null,b)}},aZ.compression=8,a$.prototype.push=function(a,b){this.i.terminate&&(a=H(a,0)),this.i.push(a,b)},a$.compression=8,a_.prototype.push=function(a,b){var c=this;if(this.onfile||J(5),this.p||J(4),this.c>0){var d=Math.min(this.c,a.length),e=a.subarray(0,d);if(this.c-=d,this.d?this.d.push(e,!this.c):this.k[0].push(e),(a=a.subarray(d)).length)return this.push(a,b)}else{var f=0,g=0,i=void 0,j=void 0;this.p.length?a.length?((j=new h(this.p.length+a.length)).set(this.p),j.set(a,this.p.length)):j=this.p:j=a;for(var k=j.length,l=this.c,m=l&&this.d,n=this;g<k-4&&"break"!==function(){var a=am(j,g);if(0x4034b50==a){f=1,i=g,n.d=null,n.c=0;var b=al(j,g+6),d=al(j,g+8),e=al(j,g+26),h=al(j,g+28);if(k>g+30+e+h){var m,o=[];n.k.unshift(o),f=2;var p=am(j,g+18),q=am(j,g+22),r=aN(j.subarray(g+30,g+=30+e),!(2048&b)),s=aQ(j,g,h,2,p,q,0),t=s[0],u=s[1],v=s[3];8&b&&(t=-1-v),g+=h,n.c=t;var w={name:r,compression:d,start:function(){if(w.ondata||J(5),t){var a=c.o[d];a||w.ondata(J(14,"unknown compression type "+d,1),null,!1),(m=t<0?new a(r):new a(r,t,u)).ondata=function(a,b,c){w.ondata(a,b,c)};for(var b=0;b<o.length;b++){var e=o[b];m.push(e,!1)}c.k[0]==o&&c.c?c.d=m:m.push(U,!0)}else w.ondata(null,U,!0)},terminate:function(){m&&m.terminate&&m.terminate()}};t>=0&&(w.size=t,w.originalSize=u),n.onfile(w)}return"break"}if(l){if(0x8074b50==a)return i=g+=12+(-2==l&&8),f=3,n.c=0,"break";else if(0x2014b50==a)return i=g-=4,f=3,n.c=0,"break"}}();++g);if(this.p=U,l<0){var o=f?j.subarray(0,i-12-(-2==l&&8)-(0x8074b50==am(j,i-16)&&4)):j.subarray(0,g);m?m.push(o,!!f):this.k[+(2==f)].push(o)}if(2&f)return this.push(j.subarray(g),b);this.p=j.subarray(g)}b&&(this.c&&J(13),this.p=null)},a_.prototype.register=function(a){this.o[a.compression]=a},"function"==typeof queueMicrotask&&queueMicrotask;var a0=a.i(53112),a1=a.i(762805),a2=a.i(951941),a3=a.i(225689),a4=a.i(293480),a5=a.i(713095);let a6=(0,a3.serverAction)(async a=>{let{name:b,description:c,content:d}=a2.SkillDraftSchema.parse(a);return await (0,a1.writeCustomSkill)(b,new Map([["SKILL.md",(0,a1.renderSkillMarkdown)({name:b,description:c},d)]]))}),a7=(0,a3.serverAction)(async a=>{let{fileName:b,base64:c}=a2.SkillUploadSchema.parse(a),d=Buffer.from(c,"base64");d.byteLength>0x1400000&&(0,a4.publicError)("File is larger than 20 MB");let e=b.toLowerCase(),f=new Map;if(e.endsWith(".md"))f.set("SKILL.md",d);else if(e.endsWith(".zip")||e.endsWith(".skill")){let a;try{a=function(a){for(var b={},c=a.length-22;0x6054b50!=am(a,c);--c)(!c||a.length-c>65558)&&J(13);var d=al(a,c+8);if(!d)return{};var e=am(a,c+16),f=0x7064b50==am(a,c-20);if(f){var g=am(a,c-12);(f=0x6064b50==am(a,g))&&(d=am(a,g+32),e=am(a,g+48))}for(var i=void 0,j=0;j<d;++j){var k=aP(a,e,f),l=k[0],m=k[1],n=k[2],o=k[3],p=k[4],q=k[5],r=q+30+al(a,q+26)+al(a,q+28);e=p,(!i||i({name:o,size:m,originalSize:n,compression:l}))&&(l?8==l?b[o]=aB(a.subarray(r,r+m),{out:new h(n)}):J(14,"unknown compression type "+l):b[o]=H(a,r,r+m))}return b}(new Uint8Array(d))}catch{(0,a4.publicError)("The archive could not be opened")}let b=Object.keys(a).filter(a=>!a.startsWith("__MACOSX/")).filter(a=>"SKILL.md"===a.split("/").pop()).sort((a,b)=>a.split("/").length-b.split("/").length)[0];b||(0,a4.publicError)("The archive has no SKILL.md");let c=b.slice(0,-8);for(let[b,d]of Object.entries(a)){if(!b.startsWith(c)||b.endsWith("/")||b.startsWith("__MACOSX/"))continue;let a=b.slice(c.length);a.split("/").some(a=>".."===a||""===a)||f.set(a,d)}}else(0,a4.publicError)("Upload a .md, .zip or .skill file");let g=f.get("SKILL.md"),i="string"==typeof g?g:Buffer.from(g).toString("utf-8"),j=(0,a1.parseFrontmatter)(i);return(0,a1.writeCustomSkill)(j.name,f)}),a8=(0,a3.serverAction)(async a=>{await (0,a1.deleteCustomSkill)(a2.SkillNameSchema.parse(a))}),a9=(0,a3.serverAction)(async(a,b,c)=>{await (0,a1.setSkillDisabled)(a2.SkillSourceSchema.parse(a),a2.SkillNameSchema.parse(b),a0.z.boolean().parse(c))});(0,a5.ensureServerEntryExports)([a6,a7,a8,a9]),(0,e.registerServerReference)(a6,"7f762c6aa3b61bb8959005004173b58b3a00a33bc1",null),(0,e.registerServerReference)(a7,"7f5985bbde6a386e3586444eed4f54c0183ee80fff",null),(0,e.registerServerReference)(a8,"7f802b56ac4b475092ccbfa7c0a4768c871dfc7087",null),(0,e.registerServerReference)(a9,"7f1a2f4e2d202c7fa438a862ef14ddf55caf1c45f8",null),a.s(["createSkillAction",0,a6,"deleteSkillAction",0,a8,"setSkillDisabledAction",0,a9,"uploadSkillAction",0,a7],432443)},439759,a=>a.a(async(b,c)=>{try{var d=a.i(137936),e=a.i(527990),f=a.i(723885),g=a.i(552556),h=a.i(738131),i=a.i(5865),j=a.i(614747),k=a.i(674986),l=a.i(344853),m=a.i(725466),n=a.i(986743),o=a.i(746609),p=a.i(69721),q=a.i(225689),r=a.i(293480),s=a.i(569549),t=a.i(3894),u=a.i(713095),v=b([h,i,j,k,l,m,n,s]);async function w(a){let b=await (0,h.loadTools)({target:"thursday",faceWords:a});return Object.entries(b).map(([a,b])=>{let{$schema:c,...d}=(0,e.asSchema)(b.inputSchema).jsonSchema;return{name:a,description:"string"==typeof b.description?b.description:"",parameters:d}})}[h,i,j,k,l,m,n,s]=v.then?(await v)():v;let x=(0,q.serverAction)(async(a,b,c)=>{let d=t.ThursdaySettingsSchema.parse(a),e=f.default.string().min(1).max(65536).parse(b),h=await (0,m.readConfig)(g.LIVE_PROVIDER.apiKeyName);h||(0,r.publicError)(`No ${g.LIVE_PROVIDER.label} key — add one in Config.`);let[k,l,n,q]=await Promise.all([(0,i.loadLivePrompt)({voicePrompt:d.voicePrompt,locale:d.locale,calledBack:f.default.boolean().default(!1).parse(c)}),(0,j.loadThursdayPrompt)(d.backendPrompt),w(d.faceWords??!1),(0,p.acceptedReasoning)({apiKey:h,model:d.backendModel,effort:d.reasoningEffort})]),u=await (0,p.createLiveCall)({apiKey:h,sdp:e,voice:d.voice,instructions:k.text,backend:{model:d.backendModel,instructions:l,tools:n,reasoning:q,webSearch:d.webSearch}});return{callId:await (0,s.insertCall)({provider:g.LIVE_PROVIDER.id,model:o.LIVE_MODEL,backendModel:d.backendModel}),sdp:u.transport.sdp,opening:k.opening}}),y=(0,q.serverAction)(async a=>{await (0,s.writeCallSkillsOn)(f.default.boolean().parse(a))}),z=(0,q.serverAction)(async(a,b)=>{await (0,s.saveTurns)(f.default.string().min(1).parse(a),t.CallTurnSchema.array().min(1).parse(b))}),A=(0,q.serverAction)(async(a,b)=>{await (0,s.saveThought)(f.default.string().min(1).parse(a),t.CallThoughtSchema.parse(b))}),B=(0,q.serverAction)(async(a,b)=>{await (0,s.endCall)(f.default.string().min(1).parse(a),o.LiveCloseSchema.nullish().parse(b))}),C=(0,q.serverAction)(async a=>{await (0,s.deleteCall)(a)||(0,r.publicError)("That call is still on the line — hang up first.")}),D=(0,q.serverAction)(async()=>(0,s.deleteEndedCalls)()),E=(0,q.serverAction)(async()=>{let a=await (0,l.listAllThreadIds)();for(let b of a)await (0,k.removeThread)(b);let b=await (0,s.deleteEndedCalls)(),c=await (0,n.deleteAllNotes)();return{calls:b,threads:a.length,notes:c}});(0,u.ensureServerEntryExports)([x,y,z,A,B,C,D,E]),(0,d.registerServerReference)(x,"7f87c27fcd09f4119cec51d41fd65efb30f60d923d",null),(0,d.registerServerReference)(y,"7fc7d0deb4c2007c1476881a012b11964f41b6b577",null),(0,d.registerServerReference)(z,"7f917e19054bae2fc21123b4e6d62e2e9d7e60ca5d",null),(0,d.registerServerReference)(A,"7fac77b7a41807074b5a6418803a72c02393d83715",null),(0,d.registerServerReference)(B,"7fbdaeff8927c534c7cd410a6ca9b4fdd8af2e7402",null),(0,d.registerServerReference)(C,"7f510287bfbf77f7ba17ebc5a170ef1f0732f37260",null),(0,d.registerServerReference)(D,"7fab13470bc62e14372a3f42bc27a46f6ca1888c81",null),(0,d.registerServerReference)(E,"7f9c1e49c706caa152ff08631b3d9e546f03fbe3c4",null),a.s(["deleteCallAction",0,C,"deleteEndedCallsAction",0,D,"endCallAction",0,B,"openCallAction",0,x,"resetHistoryAction",0,E,"saveThoughtAction",0,A,"saveTurnsAction",0,z,"setCallSkillsAction",0,y]),c()}catch(a){c(a)}},!1),69721,a=>{"use strict";var b=a.i(53112),c=a.i(569572),d=a.i(176668),e=a.i(293480),f=a.i(746609);let g=b.z.object({session:b.z.object({id:b.z.string().min(1)}),transport:b.z.object({type:b.z.literal("webrtc"),sdp:b.z.string().min(1)})}),h=new Map;async function i(a){let{apiKey:b,model:e,effort:f}=a,g=`${e} ${f??"auto"}`,i=h.get(g);if(void 0!==i)return i;let j="none"===f?{effort:f}:{...f?{effort:f}:{},summary:"auto"};for(;;){let a=await fetch("https://api.openai.com/v1/responses/input_tokens",{method:"POST",headers:{Authorization:`Bearer ${b}`,"Content-Type":"application/json"},signal:AbortSignal.timeout(c.LIVE_CALL.reasoningCheckMs),body:JSON.stringify({model:e,input:".",reasoning:j})}).catch(()=>null);if(!a)return j;let f=Object.keys(j).length?j:null;if(a.ok)return h.set(g,f),f;let i=await a.json().catch(()=>null),k=i?.error?.param?.replace(/^reasoning\./,"");if("effort"!==k&&"summary"!==k||!(k in j))return j;if(d.logger.warn(`${e} takes no reasoning ${k}; calls omit it`),delete j[k],!Object.keys(j).length)return h.set(g,null),null}}async function j(a){let b,h=await fetch("https://api.openai.com/v1/live/sessions",{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"},signal:AbortSignal.timeout(c.LIVE_CALL.startupMs),body:JSON.stringify({session:{model:f.LIVE_MODEL,instructions:a.instructions,audio:{output:{voice:a.voice}},store:!1,delegation:{type:"responses",responses:{model:a.backend.model,instructions:a.backend.instructions,tools:[...a.backend.tools.map(a=>({type:"function",...a})),...a.backend.webSearch?[{type:"web_search"}]:[]],tool_choice:"auto",parallel_tool_calls:!0,max_output_tokens:c.LIVE_CALL.backendOutputTokens,...a.backend.reasoning?{reasoning:a.backend.reasoning}:{}}}},transport:{type:"webrtc",sdp:a.sdp}})}).catch(a=>{d.logger.warn("OpenAI Live unreachable",a),(0,e.publicError)("Could not reach OpenAI Live.")}),i=await h.text();try{b=JSON.parse(i)}catch{b=null}if(!h.ok){let a=b;(0,e.publicError)(a?.error?.message||i||`OpenAI Live refused the call (${h.status}).`)}let j=g.safeParse(b);return j.success||(0,e.publicError)("OpenAI Live returned an invalid session connection."),j.data}a.s(["acceptedReasoning",0,i,"createLiveCall",0,j])}];
99
84
 
100
85
  //# sourceMappingURL=%5Broot-of-the-server%5D__1waa3rc._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[901729,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(707963),f=a.i(141146),g=a.i(168370),h=a.i(998697),i=a.i(572327),j=a.i(707938),k=a.i(483138),l=a.i(69095),m=a.i(844561),n=a.i(71215),o=a.i(649268),p=a.i(239025),q=a.i(951675),r=a.i(586446),s=a.i(572131),t=a.i(767561),u=a.i(340695),v=a.i(446181),w=a.i(287702),x=a.i(619477),y=a.i(369768),z=a.i(175170),A=a.i(401798),B=a.i(685941),C=a.i(199169),D=a.i(313237),E=a.i(759497),F=a.i(497895),G=b([y]);[y]=G.then?(await G)():G;let M={markdown:k.FileText,csv:p.Sheet,json:j.FileJson,text:k.FileText,frame:i.FileCode2,image:n.Image,audio:o.Music,video:r.Video,none:h.File};function H({label:a,rows:b,children:c}){return 0===b.length?null:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"px-3 pt-3 pb-1 font-mono text-[10px] text-muted-foreground/60",children:a}),c]})}function I({entry:a,active:b,onPick:c}){let e="dir"===a.kind?l.Folder:M[a.view];return(0,d.jsxs)("button",{type:"button",onClick:c,title:"file"===a.kind?`${a.name} \xb7 ${(0,C.shortAgo)(a.at)}`:a.name,className:(0,F.cn)("mx-2 flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",b?"bg-secondary font-medium text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[(0,d.jsx)(e,{className:"size-3.5 shrink-0 opacity-70"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.name}),"file"===a.kind?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/75",children:(0,F.formatBytes)(a.bytes)}),(0,d.jsx)("span",{className:"w-3.5 shrink-0"})]}):(0,d.jsx)(f.ChevronRight,{className:"size-3.5 shrink-0 text-muted-foreground/50"})]})}function J({empty:a,onReveal:b}){return(0,d.jsxs)("div",{className:"space-y-4 p-8",children:[a?(0,d.jsxs)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:["Nothing here yet. What a bot writes during a call lands in"," ",(0,d.jsx)("span",{className:"font-mono text-[13px] text-foreground",children:"artifacts/"})," ","— a page, a table, a picture — and shows up here to open."]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"Pick a file on the left."}),(0,d.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:"Only what the app can open is listed — a page, a table, a picture, a note. Installed packages and tool leftovers are left out, and no folder is measured, so a folder opens as fast as it lists. Reveal folder for everything else."})]}),(0,d.jsxs)(u.Button,{variant:"outline",onClick:b,children:[(0,d.jsx)(m.FolderOpen,{}),"Reveal folder"]})]})}function K({file:a,onGone:b}){let c=a.path,[e]=(0,D.useServerAction)(B.openFileAction),[f,h]=(0,D.useServerAction)(z.deleteWorkspaceFileAction,{okMessage:"File deleted",onOk:()=>{(0,E.revalidate)(t.queryKey.workspace),b()}}),i=async()=>{await v.notify.confirm({title:`Delete ${c.split("/").pop()}?`,description:"It is deleted from disk for good.",okText:"Delete",destructive:!0})&&f(c)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-b border-border/60 px-6 py-2",children:[(0,d.jsx)(L,{path:c}),(0,d.jsxs)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/70",children:[(0,F.formatBytes)(a.bytes)," · ",(0,C.shortAgo)(a.at)]}),(0,d.jsx)("a",{href:t.queryKey.fileView(c),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:"grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(g.ExternalLink,{className:"size-4"})}),(0,d.jsx)(u.Button,{size:"icon-sm",variant:"ghost","aria-label":"Reveal in the file manager",className:"text-muted-foreground",onClick:()=>e(c),children:(0,d.jsx)(m.FolderOpen,{})}),(0,d.jsx)(u.Button,{size:"icon-sm",variant:"ghost","aria-label":"Delete",loading:h,className:"text-muted-foreground",onClick:i,children:(0,d.jsx)(q.Trash2,{})})]}),(0,d.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:(0,d.jsx)(y.FilePreview,{path:c,bytes:a.bytes})})]})}function L({path:a}){let b=["workspace",...a.split("/").filter(Boolean)];return(0,d.jsx)("span",{className:"flex min-w-0 flex-1 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:b.map((a,c)=>(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[c>0&&(0,d.jsx)(f.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,d.jsx)("span",{className:(0,F.cn)("truncate",c===b.length-1&&"text-foreground"),children:a})]},`${c}-${a}`))})}a.s(["WorkspaceSetting",0,function(){let[a,b]=(0,s.useState)(""),[c,f]=(0,s.useState)(w.WORKSPACE_VIEW.rows),[g,h]=(0,s.useState)(null),[i,j]=(0,s.useState)(""),{data:k,isLoading:l,error:n}=(0,E.useServerRoute)(t.queryKey.workspaceFolder(a,c),{keepPreviousData:!0}),o=a=>{b(a),f(w.WORKSPACE_VIEW.rows)},[p,q]=(0,D.useServerAction)(A.emptyScratchAction,{okMessage:"Scratch emptied",onOk:()=>(0,E.revalidate)(t.queryKey.workspace)}),[r]=(0,D.useServerAction)(B.openFileAction),y=async()=>{await v.notify.confirm({title:"Empty scratch?",description:"Everything under scratch/ is deleted for good. artifacts/ and projects/ are untouched.",okText:"Empty",destructive:!0})&&p()};if(l)return(0,d.jsx)(x.SettingPanesSkeleton,{});if(n)return(0,d.jsx)(x.SettingError,{message:n.message});let z=k?.entries??[],C=k?.total??0,F=i.trim().toLowerCase(),G=F?z.filter(a=>a.name.toLowerCase().includes(F)):z,L=G.filter(a=>"dir"===a.kind),M=G.filter(a=>"file"===a.kind),N=z.find(a=>"file"===a.kind&&a.path===g?.path)??g;return(0,d.jsx)(x.SettingPanes,{footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(x.SettingRailNote,{children:(0,d.jsxs)("span",{className:"font-mono",children:[(0,d.jsx)("span",{className:"font-medium text-foreground",children:`.ai-workspace${a?`/${a}`:""}`}),` \xb7 ${function(a,b){let c=a.filter(a=>"dir"===a.kind).length,d=a.length-c,e=[c&&`${c} ${1===c?"folder":"folders"}`,d&&`${d} ${1===d?"file":"files"}`].filter(Boolean);if(!e.length)return"empty";let f=e.join(" · ");return b>a.length?`${f} of ${b.toLocaleString("en")}`:f}(z,C)}`]})}),(0,d.jsxs)(u.Button,{variant:"outline",size:"sm",onClick:()=>r(a||"."),children:[(0,d.jsx)(m.FolderOpen,{}),"Reveal folder"]}),(0,d.jsx)(u.Button,{variant:"outline",size:"sm",loading:q,onClick:y,className:"text-destructive hover:text-destructive",children:"Empty scratch"})]}),left:(0,d.jsxs)("div",{className:"flex flex-col py-2",children:[(0,d.jsx)(x.SettingFilter,{value:i,onChange:j,placeholder:"Filter this folder",className:"mx-2 mb-1.5 w-auto"}),a&&(0,d.jsxs)("button",{type:"button",onClick:()=>o(a.split("/").slice(0,-1).join("/")),className:"mx-2 mb-1 flex items-center gap-1 rounded-md px-2 py-1 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,d.jsx)(e.ChevronLeft,{className:"size-3 shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.split("/").slice(0,-1).pop()??"workspace"})]}),0===G.length?(0,d.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground/60",children:F?"Nothing matches":"Empty folder"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(H,{label:"folders",rows:L,children:L.map(a=>(0,d.jsx)(I,{entry:a,onPick:()=>o(a.path)},a.path))}),(0,d.jsx)(H,{label:"files",rows:M,children:M.map(a=>(0,d.jsx)(I,{entry:a,active:a.path===g?.path,onPick:()=>"file"===a.kind&&h(a)},a.path))})]}),C>z.length&&(0,d.jsx)("button",{type:"button",onClick:()=>f(c+w.WORKSPACE_VIEW.rows),className:"mx-2 mt-2 rounded-md px-2 py-1.5 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:`Show ${Math.min(w.WORKSPACE_VIEW.rows,C-z.length)} more of ${C.toLocaleString("en")}`})]}),right:N?.kind==="file"?(0,d.jsx)(K,{file:N,onGone:()=>h(null)},N.path):(0,d.jsx)(J,{empty:!a&&0===z.length,onReveal:()=>r(".")})})}]),c()}catch(a){c(a)}},!1),175170,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f376ce11e02bd8623e15e8cff16afba68bbafc52f",b.callServer,void 0,b.findSourceMapURL,"deleteWorkspaceFileAction");a.s(["deleteWorkspaceFileAction",0,c])},401798,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fefd295187e02f4444371c90821d90314c11d3fe1",b.callServer,void 0,b.findSourceMapURL,"emptyScratchAction");a.s(["emptyScratchAction",0,c])},572327,a=>{"use strict";var b=a.i(164831);let c={name:"file-code-corner",size:24,node:[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],aliases:["file-code-2"]};c.node;let d=(0,b.default)(c);a.s(["FileCode2",0,d],572327)},69095,a=>{"use strict";var b=a.i(164831);let c={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};c.node;let d=(0,b.default)(c);a.s(["Folder",0,d],69095)},71215,a=>{"use strict";var b=a.i(164831);let c={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};c.node;let d=(0,b.default)(c);a.s(["Image",0,d],71215)},649268,a=>{"use strict";var b=a.i(164831);let c={name:"music",size:24,node:[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]};c.node;let d=(0,b.default)(c);a.s(["Music",0,d],649268)},239025,a=>{"use strict";var b=a.i(164831);let c={name:"sheet",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]};c.node;let d=(0,b.default)(c);a.s(["Sheet",0,d],239025)},951675,a=>{"use strict";var b=a.i(164831);let c={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};c.node;let d=(0,b.default)(c);a.s(["Trash2",0,d],951675)},586446,a=>{"use strict";var b=a.i(164831);let c={name:"video",size:24,node:[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]};c.node;let d=(0,b.default)(c);a.s(["Video",0,d],586446)}];
1
+ module.exports=[901729,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(707963),f=a.i(141146),g=a.i(168370),h=a.i(998697),i=a.i(572327),j=a.i(707938),k=a.i(483138),l=a.i(69095),m=a.i(844561),n=a.i(71215),o=a.i(649268),p=a.i(239025),q=a.i(951675),r=a.i(586446),s=a.i(572131),t=a.i(767561),u=a.i(340695),v=a.i(446181),w=a.i(287702),x=a.i(619477),y=a.i(369768),z=a.i(704207),A=a.i(755410),B=a.i(332606),C=a.i(199169),D=a.i(313237),E=a.i(759497),F=a.i(497895),G=b([y]);[y]=G.then?(await G)():G;let M={markdown:k.FileText,csv:p.Sheet,json:j.FileJson,text:k.FileText,frame:i.FileCode2,image:n.Image,audio:o.Music,video:r.Video,none:h.File};function H({label:a,rows:b,children:c}){return 0===b.length?null:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"px-3 pt-3 pb-1 font-mono text-[10px] text-muted-foreground/60",children:a}),c]})}function I({entry:a,active:b,onPick:c}){let e="dir"===a.kind?l.Folder:M[a.view];return(0,d.jsxs)("button",{type:"button",onClick:c,title:"file"===a.kind?`${a.name} \xb7 ${(0,C.shortAgo)(a.at)}`:a.name,className:(0,F.cn)("mx-2 flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",b?"bg-secondary font-medium text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[(0,d.jsx)(e,{className:"size-3.5 shrink-0 opacity-70"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.name}),"file"===a.kind?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/75",children:(0,F.formatBytes)(a.bytes)}),(0,d.jsx)("span",{className:"w-3.5 shrink-0"})]}):(0,d.jsx)(f.ChevronRight,{className:"size-3.5 shrink-0 text-muted-foreground/50"})]})}function J({empty:a,onReveal:b}){return(0,d.jsxs)("div",{className:"space-y-4 p-8",children:[a?(0,d.jsxs)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:["Nothing here yet. What a bot writes during a call lands in"," ",(0,d.jsx)("span",{className:"font-mono text-[13px] text-foreground",children:"artifacts/"})," ","— a page, a table, a picture — and shows up here to open."]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"Pick a file on the left."}),(0,d.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:"Only what the app can open is listed — a page, a table, a picture, a note. Installed packages and tool leftovers are left out, and no folder is measured, so a folder opens as fast as it lists. Reveal folder for everything else."})]}),(0,d.jsxs)(u.Button,{variant:"outline",onClick:b,children:[(0,d.jsx)(m.FolderOpen,{}),"Reveal folder"]})]})}function K({file:a,onGone:b}){let c=a.path,[e]=(0,D.useServerAction)(B.openFileAction),[f,h]=(0,D.useServerAction)(z.deleteWorkspaceFileAction,{okMessage:"File deleted",onOk:()=>{(0,E.revalidate)(t.queryKey.workspace),b()}}),i=async()=>{await v.notify.confirm({title:`Delete ${c.split("/").pop()}?`,description:"It is deleted from disk for good.",okText:"Delete",destructive:!0})&&f(c)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-b border-border/60 px-6 py-2",children:[(0,d.jsx)(L,{path:c}),(0,d.jsxs)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground/70",children:[(0,F.formatBytes)(a.bytes)," · ",(0,C.shortAgo)(a.at)]}),(0,d.jsx)("a",{href:t.queryKey.fileView(c),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:"grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(g.ExternalLink,{className:"size-4"})}),(0,d.jsx)(u.Button,{size:"icon-sm",variant:"ghost","aria-label":"Reveal in the file manager",className:"text-muted-foreground",onClick:()=>e(c),children:(0,d.jsx)(m.FolderOpen,{})}),(0,d.jsx)(u.Button,{size:"icon-sm",variant:"ghost","aria-label":"Delete",loading:h,className:"text-muted-foreground",onClick:i,children:(0,d.jsx)(q.Trash2,{})})]}),(0,d.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:(0,d.jsx)(y.FilePreview,{path:c,bytes:a.bytes})})]})}function L({path:a}){let b=["workspace",...a.split("/").filter(Boolean)];return(0,d.jsx)("span",{className:"flex min-w-0 flex-1 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:b.map((a,c)=>(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[c>0&&(0,d.jsx)(f.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,d.jsx)("span",{className:(0,F.cn)("truncate",c===b.length-1&&"text-foreground"),children:a})]},`${c}-${a}`))})}a.s(["WorkspaceSetting",0,function(){let[a,b]=(0,s.useState)(""),[c,f]=(0,s.useState)(w.WORKSPACE_VIEW.rows),[g,h]=(0,s.useState)(null),[i,j]=(0,s.useState)(""),{data:k,isLoading:l,error:n}=(0,E.useServerRoute)(t.queryKey.workspaceFolder(a,c),{keepPreviousData:!0}),o=a=>{b(a),f(w.WORKSPACE_VIEW.rows)},[p,q]=(0,D.useServerAction)(A.emptyScratchAction,{okMessage:"Scratch emptied",onOk:()=>(0,E.revalidate)(t.queryKey.workspace)}),[r]=(0,D.useServerAction)(B.openFileAction),y=async()=>{await v.notify.confirm({title:"Empty scratch?",description:"Everything under scratch/ is deleted for good. artifacts/ and projects/ are untouched.",okText:"Empty",destructive:!0})&&p()};if(l)return(0,d.jsx)(x.SettingPanesSkeleton,{});if(n)return(0,d.jsx)(x.SettingError,{message:n.message});let z=k?.entries??[],C=k?.total??0,F=i.trim().toLowerCase(),G=F?z.filter(a=>a.name.toLowerCase().includes(F)):z,L=G.filter(a=>"dir"===a.kind),M=G.filter(a=>"file"===a.kind),N=z.find(a=>"file"===a.kind&&a.path===g?.path)??g;return(0,d.jsx)(x.SettingPanes,{footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(x.SettingRailNote,{children:(0,d.jsxs)("span",{className:"font-mono",children:[(0,d.jsx)("span",{className:"font-medium text-foreground",children:`.ai-workspace${a?`/${a}`:""}`}),` \xb7 ${function(a,b){let c=a.filter(a=>"dir"===a.kind).length,d=a.length-c,e=[c&&`${c} ${1===c?"folder":"folders"}`,d&&`${d} ${1===d?"file":"files"}`].filter(Boolean);if(!e.length)return"empty";let f=e.join(" · ");return b>a.length?`${f} of ${b.toLocaleString("en")}`:f}(z,C)}`]})}),(0,d.jsxs)(u.Button,{variant:"outline",size:"sm",onClick:()=>r(a||"."),children:[(0,d.jsx)(m.FolderOpen,{}),"Reveal folder"]}),(0,d.jsx)(u.Button,{variant:"outline",size:"sm",loading:q,onClick:y,className:"text-destructive hover:text-destructive",children:"Empty scratch"})]}),left:(0,d.jsxs)("div",{className:"flex flex-col py-2",children:[(0,d.jsx)(x.SettingFilter,{value:i,onChange:j,placeholder:"Filter this folder",className:"mx-2 mb-1.5 w-auto"}),a&&(0,d.jsxs)("button",{type:"button",onClick:()=>o(a.split("/").slice(0,-1).join("/")),className:"mx-2 mb-1 flex items-center gap-1 rounded-md px-2 py-1 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,d.jsx)(e.ChevronLeft,{className:"size-3 shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.split("/").slice(0,-1).pop()??"workspace"})]}),0===G.length?(0,d.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground/60",children:F?"Nothing matches":"Empty folder"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(H,{label:"folders",rows:L,children:L.map(a=>(0,d.jsx)(I,{entry:a,onPick:()=>o(a.path)},a.path))}),(0,d.jsx)(H,{label:"files",rows:M,children:M.map(a=>(0,d.jsx)(I,{entry:a,active:a.path===g?.path,onPick:()=>"file"===a.kind&&h(a)},a.path))})]}),C>z.length&&(0,d.jsx)("button",{type:"button",onClick:()=>f(c+w.WORKSPACE_VIEW.rows),className:"mx-2 mt-2 rounded-md px-2 py-1.5 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:`Show ${Math.min(w.WORKSPACE_VIEW.rows,C-z.length)} more of ${C.toLocaleString("en")}`})]}),right:N?.kind==="file"?(0,d.jsx)(K,{file:N,onGone:()=>h(null)},N.path):(0,d.jsx)(J,{empty:!a&&0===z.length,onReveal:()=>r(".")})})}]),c()}catch(a){c(a)}},!1),755410,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fdb0e583cb0c8a4cbf774bb658d5815c8148fe93b",b.callServer,void 0,b.findSourceMapURL,"emptyScratchAction");a.s(["emptyScratchAction",0,c])},704207,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f5cb090bc50765e05bcbe51a3e9787de458d2c2d7",b.callServer,void 0,b.findSourceMapURL,"deleteWorkspaceFileAction");a.s(["deleteWorkspaceFileAction",0,c])},572327,a=>{"use strict";var b=a.i(164831);let c={name:"file-code-corner",size:24,node:[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],aliases:["file-code-2"]};c.node;let d=(0,b.default)(c);a.s(["FileCode2",0,d],572327)},69095,a=>{"use strict";var b=a.i(164831);let c={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};c.node;let d=(0,b.default)(c);a.s(["Folder",0,d],69095)},71215,a=>{"use strict";var b=a.i(164831);let c={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};c.node;let d=(0,b.default)(c);a.s(["Image",0,d],71215)},649268,a=>{"use strict";var b=a.i(164831);let c={name:"music",size:24,node:[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]};c.node;let d=(0,b.default)(c);a.s(["Music",0,d],649268)},239025,a=>{"use strict";var b=a.i(164831);let c={name:"sheet",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]]};c.node;let d=(0,b.default)(c);a.s(["Sheet",0,d],239025)},951675,a=>{"use strict";var b=a.i(164831);let c={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};c.node;let d=(0,b.default)(c);a.s(["Trash2",0,d],951675)},586446,a=>{"use strict";var b=a.i(164831);let c={name:"video",size:24,node:[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]};c.node;let d=(0,b.default)(c);a.s(["Video",0,d],586446)}];
2
2
 
3
- //# sourceMappingURL=_1anqots._.js.map
3
+ //# sourceMappingURL=_0-2qsxo._.js.map