thursday-agent 0.1.2 → 0.2.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.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +1 -0
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +6 -0
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +13 -13
- package/.next/server/app/_not-found.segments/_full.segment.rsc +13 -13
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +12 -12
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/artifact/route.js +1 -1
- package/.next/server/app/api/artifact/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/notes/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/bot/notes/route/build-manifest.json +12 -0
- package/.next/server/app/api/bot/notes/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/bot/notes/route.js +14 -0
- package/.next/server/app/api/bot/notes/route.js.map +5 -0
- package/.next/server/app/api/bot/notes/route.js.nft.json +1 -0
- package/.next/server/app/api/bot/notes/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/bot/route.js +4 -4
- package/.next/server/app/api/bot/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/task/[id]/route.js +6 -6
- package/.next/server/app/api/bot/task/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/task/route.js +6 -6
- package/.next/server/app/api/bot/task/route.js.nft.json +1 -1
- package/.next/server/app/api/config/route.js +3 -3
- package/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/server/app/api/events/route.js +1 -1
- package/.next/server/app/api/events/route.js.nft.json +1 -1
- package/.next/server/app/api/file/[...path]/route.js +1 -1
- package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/catalog/route.js +6 -6
- package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/route.js +3 -3
- package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/[name]/route.js +3 -3
- package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/oauth/callback/route.js +5 -5
- package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/route.js +3 -3
- package/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/tools/route.js +3 -3
- package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/route.js +7 -7
- package/.next/server/app/api/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/tidy/route.js +10 -11
- package/.next/server/app/api/memory/tidy/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/[source]/[name]/route.js +1 -1
- package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/route.js +1 -1
- package/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/call/route.js +8 -8
- package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/skills/route.js +8 -8
- package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/tool-call/route.js +11 -12
- package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/route.js +1 -1
- package/.next/server/app/api/workspace/route.js.nft.json +1 -1
- package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
- package/.next/server/app/artifact/[...path]/page.js +3 -3
- package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
- package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next/server/app/page/server-reference-manifest.json +63 -41
- package/.next/server/app/page.js +7 -7
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +1 -0
- package/.next/server/chunks/0d-b_next_dist_server_app-render_after-task-async-storage_external_0-exn7p.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0t_dqaj._.js → [root-of-the-server]__0-npkh_._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__005var5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__019dx9f._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__02va5wz._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1mzp_el._.js → [root-of-the-server]__04_8spk._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__06t77t4._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0bed6hu._.js +4 -4
- package/.next/server/chunks/[root-of-the-server]__0cro2dz._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__0emr6go._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0le4d-p._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0m8ywyo._.js +5 -5
- package/.next/server/chunks/{[root-of-the-server]__113fqg5._.js → [root-of-the-server]__0p32jfz._.js} +3 -3
- package/.next/server/chunks/[root-of-the-server]__0phdgco._.js +4 -4
- package/.next/server/chunks/[root-of-the-server]__0wvgrsl._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__11j52t0._.js +5 -0
- package/.next/server/chunks/{[root-of-the-server]__0j_n5l3._.js → [root-of-the-server]__1692zrv._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__16thabu._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__173nhwf._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__1bn73ih._.js +10 -0
- package/.next/server/chunks/[root-of-the-server]__1bqhuh9._.js +4 -4
- package/.next/server/chunks/[root-of-the-server]__1ccon1w._.js +10 -0
- package/.next/server/chunks/[root-of-the-server]__1cqizfq._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1u_qvc7._.js → [root-of-the-server]__1fboj2j._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1dow0bz._.js → [root-of-the-server]__1oli73c._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1txedx6._.js +4 -4
- package/.next/server/chunks/[root-of-the-server]__1untqv8._.js +5 -0
- package/.next/server/chunks/_0-73of8._.js +55 -0
- package/.next/server/chunks/{_2050gwn._.js → _00_584r._.js} +66 -28
- package/.next/server/chunks/{_0y8is-s._.js → _03a0897._.js} +1 -1
- package/.next/server/chunks/_05h2cii._.js +1 -1
- package/.next/server/chunks/_06mxlgn._.js +1 -1
- package/.next/server/chunks/_0a351g7._.js +1 -1
- package/.next/server/chunks/{_0hin38_._.js → _0khihjk._.js} +5 -5
- package/.next/server/chunks/_0kjjmag._.js +1 -1
- package/.next/server/chunks/{_1t8fv7b._.js → _0n74zsf._.js} +5 -5
- package/.next/server/chunks/_0nn99o2._.js +3 -0
- package/.next/server/chunks/_0pppbb5._.js +10 -6
- package/.next/server/chunks/{_1icgbi8._.js → _0rnf-6n._.js} +5 -5
- package/.next/server/chunks/_0u10wmw._.js +55 -0
- package/.next/server/chunks/{_0kl37zl._.js → _0vnutv9._.js} +1 -1
- package/.next/server/chunks/_0wp4le3._.js +1 -1
- package/.next/server/chunks/_0y5fg-x._.js +1 -1
- package/.next/server/chunks/_106co2o._.js +3 -0
- package/.next/server/chunks/_12bbv5i._.js +10 -6
- package/.next/server/chunks/_15hq89o._.js +1 -1
- package/.next/server/chunks/_15q1pig._.js +1 -1
- package/.next/server/chunks/_18-1wcc._.js +55 -0
- package/.next/server/chunks/_19wg5yn._.js +138 -0
- package/.next/server/chunks/_1_5mnq4._.js +18 -0
- package/.next/server/chunks/_1bt95p9._.js +55 -0
- package/.next/server/chunks/_1cbk7ms._.js +9 -9
- package/.next/server/chunks/_1drgfx4._.js +18 -0
- package/.next/server/chunks/_1drv2et._.js +10 -6
- package/.next/server/chunks/{_10qam6o._.js → _1e48czp._.js} +5 -5
- package/.next/server/chunks/{_1skgy7b._.js → _1kg70wc._.js} +5 -5
- package/.next/server/chunks/_1php4eq._.js +1 -1
- package/.next/server/chunks/_1rysr-r._.js +10 -0
- package/.next/server/chunks/_1u3rwbr._.js +3 -0
- package/.next/server/chunks/_1x7p319._.js +1 -1
- package/.next/server/chunks/_1yuv4vp._.js +1 -1
- package/.next/server/chunks/_next-internal_server_app_api_bot_notes_route_actions_0qcsyu7.js +3 -0
- package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
- package/.next/server/chunks/features_bot_task_query_ts_11xuzl3._.js +1 -1
- package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0228f43._.js → node_modules_consola_dist_chunks_prompt_mjs_02s3hjt._.js} +1 -1
- package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0ir-vo2._.js → node_modules_consola_dist_chunks_prompt_mjs_06067w6._.js} +1 -1
- package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0otw8ef._.js → node_modules_consola_dist_chunks_prompt_mjs_096ais_._.js} +1 -1
- package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0tf290y._.js → node_modules_consola_dist_chunks_prompt_mjs_0a1rd09._.js} +1 -1
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0gzvgfv._.js +3 -0
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0j61-ma._.js +3 -0
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0tvkfgh._.js +3 -0
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_11zjo-1._.js +3 -0
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1pycqsq._.js +3 -0
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1tpvamf._.js +3 -0
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1y9-wcr._.js +3 -0
- package/.next/server/chunks/ssr/[externals]__0dizgek._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0f6s48x._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0m1b5ky._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__0dfwvr4._.js → [root-of-the-server]__0un-erv._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__1-mnhyd._.js +5 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1bww500._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1mzi-ju._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1qfqvmg._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1vcdast._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1xwnu-h._.js +3 -0
- package/.next/server/chunks/ssr/_03webdr._.js +3 -0
- package/.next/server/chunks/ssr/{_0gd4vaa._.js → _040sk32._.js} +71 -29
- package/.next/server/chunks/ssr/_077-g6s._.js +1 -1
- package/.next/server/chunks/ssr/{_0lc_7c8._.js → _09ja_w1._.js} +2 -2
- package/.next/server/chunks/ssr/{_1dcxzqe._.js → _0f_b_9s._.js} +2 -2
- package/.next/server/chunks/ssr/_0h7zdni._.js +1 -1
- package/.next/server/chunks/ssr/_0lu1n_x._.js +3 -0
- package/.next/server/chunks/ssr/_0sf1isi._.js +1 -1
- package/.next/server/chunks/ssr/_0su6_08._.js +3 -0
- package/.next/server/chunks/ssr/{_0nso8tp._.js → _0w5bgak._.js} +2 -2
- package/.next/server/chunks/ssr/{_19_o9d-._.js → _0x_nu5e._.js} +2 -2
- package/.next/server/chunks/ssr/_1-teee5._.js +3 -3
- package/.next/server/chunks/ssr/_13punpm._.js +1 -1
- package/.next/server/chunks/ssr/{_0ay6b01._.js → _1ciyoo3._.js} +2 -2
- package/.next/server/chunks/ssr/_1e-dgz0._.js +1 -1
- package/.next/server/chunks/ssr/_1fq7zgb._.js +1 -1
- package/.next/server/chunks/ssr/{_0cvjbuz._.js → _1g6l4uj._.js} +2 -2
- package/.next/server/chunks/ssr/{_0q_2f2x._.js → _1lip4th._.js} +2 -2
- package/.next/server/chunks/ssr/_1m3bsfr._.js +3 -0
- package/.next/server/chunks/ssr/_1mznrxk._.js +1 -1
- package/.next/server/chunks/ssr/_1ruzehw._.js +3 -0
- package/.next/server/chunks/ssr/_1vyd1ji._.js +3 -0
- package/.next/server/chunks/ssr/features_bot_components_bot-setting_tsx_01ajft6._.js +2 -2
- package/.next/server/chunks/ssr/features_config_components_14jqgy4._.js +1 -1
- package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +1 -1
- package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
- package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
- package/.next/server/chunks/ssr/lib_realtime_12wg_dd._.js +27 -0
- package/.next/server/chunks/ssr/lib_realtime_15h_v1v._.js +27 -0
- package/.next/server/chunks/ssr/{node_modules_108wd2o._.js → node_modules_004qlr4._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1ub40gk._.js → node_modules_01qnv-a._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1y8_3vg._.js → node_modules_04n7mjs._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0_j7-g4._.js → node_modules_08d8bke._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0y2-av4._.js → node_modules_09xhur7._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_043-236._.js → node_modules_0_n241r._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0ls96je._.js → node_modules_0iz1rzd._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0xwx4u-._.js → node_modules_0kl7-tn._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1jatz7w._.js → node_modules_0kxz4gt._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1t0y5jt._.js → node_modules_0lrjk5t._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_13f2md6._.js → node_modules_0m93zeg._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1nhw9qg._.js → node_modules_0n1kj4p._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1k29j1j._.js → node_modules_0ndvxub._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_16i4o_3._.js → node_modules_13r44jq._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0fbw5-u._.js → node_modules_17lrt3y._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1d-is1o._.js → node_modules_18_dk7_._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1hn_sd5._.js → node_modules_19dp7ko._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_20ynonm._.js → node_modules_1dwguw_._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_00d6675._.js → node_modules_1hd-5tv._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1ee8gav._.js → node_modules_1hn8z1f._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0bue6gy._.js → node_modules_1n5ygqe._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1_588_4._.js → node_modules_1q0p85z._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0ipn1ho._.js → node_modules_1toafc-._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0_fvxnt._.js → node_modules_1xyd7ov._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1v0077l._.js → node_modules_1zu988w._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_06kvvuo._.js → node_modules_20yebtj._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_092s8nx._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0m9a4y0._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1nvexgu._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_13w_wy9._.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_consola_dist_chunks_prompt_mjs_05cwqv2._.js +47 -0
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +64 -42
- package/.next/static/chunks/05b6nx_o3_f_n.js +1 -0
- package/.next/static/chunks/{3aquirz5h71da.js → 07kl352c-lvcz.js} +1 -1
- package/.next/static/chunks/0dmns-gi0raa4.js +1 -0
- package/.next/static/chunks/0oc4_xoia77dg.css +1 -0
- package/.next/static/chunks/0pheo8m3a-rzi.js +1 -0
- package/.next/static/chunks/{2ihkf6l2jowo9.js → 18vhba44l1fc9.js} +3 -3
- package/.next/static/chunks/19i8h2t-5evjx.js +1 -0
- package/.next/static/chunks/{1gy3bbv7usnjo.js → 1c5fcj473025q.js} +1 -1
- package/.next/static/chunks/1pi_hbmjw-f-z.js +1 -0
- package/.next/static/chunks/{0tydnn2kybibk.js → 1twt6k09vg4np.js} +1 -1
- package/.next/static/chunks/{21rk8w7bda-su.js → 28gotuisldmom.js} +1 -1
- package/.next/static/chunks/{3xxa2j56-f3nm.js → 2998p0y7k1c8z.js} +1 -1
- package/.next/static/chunks/2l233xfycjpd8.js +1 -0
- package/.next/static/chunks/2p5n7pa3c40t-.js +2 -0
- package/.next/static/chunks/2ru1q132af7h7.js +1 -0
- package/.next/static/chunks/{2fq_86jvq9ymq.js → 2t8wqycwg3y04.js} +2 -2
- package/.next/static/chunks/32z_ypgtchw48.js +1 -0
- package/.next/static/chunks/{247d-r95j8xs0.js → 33pyjb3xd1iez.js} +1 -1
- package/.next/static/chunks/3786h5vayt80-.js +28 -0
- package/.next/static/chunks/3_h9txt3tq8t8.js +28 -0
- package/.next/static/chunks/{1khakdu_iuedc.js → 3ard_noqapnw1.js} +1 -1
- package/.next/static/chunks/{1fr5m75pwtyic.js → 3omud5xunrk1f.js} +1 -1
- package/.next/static/chunks/42dnrkbph9e-1.js +1 -0
- package/app/api/events/app-event.client.ts +24 -0
- package/app/api/events/app-event.server.ts +45 -0
- package/app/api/events/app-event.ts +44 -0
- package/app/api/llm-model/catalog/route.ts +12 -0
- package/app/api/llm-model/route.ts +21 -0
- package/app/api/query-key.ts +144 -0
- package/app/api/thursday/tool-call/route.ts +67 -0
- package/components/ui/button-group.tsx +45 -0
- package/components/ui/custom-icon.tsx +259 -0
- package/components/ui/dropdown-menu.tsx +271 -0
- package/components/ui/folded-text.tsx +68 -0
- package/components/ui/input-group.tsx +157 -0
- package/components/ui/json-view.tsx +240 -0
- package/components/ui/shiny-text.tsx +141 -0
- package/components/ui/text-type.tsx +213 -0
- package/components/ui/theme-sync.tsx +9 -0
- package/database/migrations/{20260908030742_rainy_marvel_zombies → 20260909060813_optimal_sabretooth}/migration.sql +7 -0
- package/database/migrations/{20260908030742_rainy_marvel_zombies → 20260909060813_optimal_sabretooth}/snapshot.json +54 -1
- package/database/migrations/20260909063821_bitter_tenebrous/migration.sql +1 -0
- package/database/migrations/20260909063821_bitter_tenebrous/snapshot.json +1285 -0
- package/docs/how-it-works.md +59 -0
- package/docs/images/keeps-going.png +0 -0
- package/docs/images/task-thread.png +0 -0
- package/docs/images/two-minds.png +0 -0
- package/features/ai/load-tools.ts +55 -5
- package/features/ai/prompts/bot.prompt.ts +121 -26
- package/features/ai/prompts/memory-tidy.prompt.ts +7 -1
- package/features/ai/prompts/prompt-helper.ts +31 -5
- package/features/ai/prompts/thursday.prompt.ts +2 -0
- package/features/ai/tools/bot.tool.ts +37 -18
- package/features/ai/tools/mcp.tool.ts +5 -5
- package/features/ai/tools/memory.tool.ts +17 -10
- package/features/ai/tools/studio.tool.ts +5 -5
- package/features/ai/tools/tool-name.ts +2 -0
- package/features/ai/tools/workspace.tool.ts +33 -5
- package/features/bot/bot.action.ts +31 -4
- package/features/bot/bot.notes.ts +120 -0
- package/features/bot/bot.query.ts +56 -1
- package/features/bot/bot.run.ts +43 -3
- package/features/bot/bot.runner.ts +94 -20
- package/features/bot/bot.schema.ts +17 -0
- package/features/bot/components/bot-room.tsx +405 -306
- package/features/bot/components/bot-setting.tsx +123 -20
- package/features/bot/task.query.ts +18 -5
- package/features/memory/components/memory-setting.tsx +11 -2
- package/features/memory/memory.query.ts +9 -2
- package/features/memory/memory.schema.ts +30 -0
- package/features/skills/components/skills-setting.tsx +9 -1
- package/features/workspace/workspace.ts +136 -3
- package/hooks/use-draft.ts +37 -0
- package/hooks/use-hotkey.ts +105 -0
- package/hooks/use-object-state.ts +51 -0
- package/hooks/use-on-visible.ts +72 -0
- package/hooks/use-theme.ts +106 -0
- package/hooks/use-wake-word.ts +262 -0
- package/lib/realtime/realtime.driver.ts +34 -1
- package/lib/realtime/realtime.protocol.ts +6 -0
- package/lib/sandbox.ts +9 -1
- package/lib/tokens.ts +19 -0
- package/package.json +1 -1
- package/.next/server/chunks/[root-of-the-server]__02kt8yn._.js +0 -10
- package/.next/server/chunks/[root-of-the-server]__0h59di-._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__0qjqtwo._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__0yk6s3w._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__0z3gelv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__11w_7_3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1_0q_9w._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1gmn1cs._.js +0 -10
- package/.next/server/chunks/_0fzqt2y._.js +0 -100
- package/.next/server/chunks/_0jgm3b8._.js +0 -55
- package/.next/server/chunks/_0ks6_sg._.js +0 -55
- package/.next/server/chunks/_0tzfesa._.js +0 -3
- package/.next/server/chunks/_0zmestz._.js +0 -55
- package/.next/server/chunks/_12nr4xc._.js +0 -3
- package/.next/server/chunks/_1hzrsvg._.js +0 -55
- package/.next/server/chunks/_1uj4_io._.js +0 -10
- package/.next/server/chunks/_1yldgo4._.js +0 -55
- package/.next/server/chunks/features_0scmr4i._.js +0 -3
- package/.next/server/chunks/features_bot_bot_query_ts_12mgkl2._.js +0 -3
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0ykklj0._.js +0 -3
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1ryg3wh._.js +0 -3
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1vwbnq_._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__01id-v3._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0b-0i32._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__185grso._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1minz8_._.js +0 -3
- package/.next/server/chunks/ssr/_0j4v8of._.js +0 -3
- package/.next/server/chunks/ssr/_0l81bzy._.js +0 -3
- package/.next/server/chunks/ssr/_10uvw3l._.js +0 -3
- package/.next/server/chunks/ssr/_1jbv7m1._.js +0 -3
- package/.next/server/chunks/ssr/lib_realtime_0aetuyp._.js +0 -24
- package/.next/server/chunks/ssr/lib_realtime_18k_aj-._.js +0 -24
- package/.next/server/chunks/ssr/node_modules_zod_v4_classic_errors_05xv7vp.js +0 -3
- package/.next/static/chunks/0yysv1gzin17t.js +0 -1
- package/.next/static/chunks/1keib_gt066gc.js +0 -1
- package/.next/static/chunks/28g42tw8tsvhd.js +0 -1
- package/.next/static/chunks/2cwjgkt_hoyhj.js +0 -22
- package/.next/static/chunks/2rbf1fpd8n80-.js +0 -22
- package/.next/static/chunks/2ukj8k69y89um.js +0 -1
- package/.next/static/chunks/2wngeetfnzxkp.js +0 -2
- package/.next/static/chunks/388-t2v72jh39.css +0 -1
- package/.next/static/chunks/3fqvc0cg-atq_.js +0 -1
- package/.next/static/chunks/3p4egvfjxpatb.js +0 -1
- package/.next/static/chunks/3qe1w1ei-huhl.js +0 -1
- package/.next/static/chunks/3y40riycdip-i.js +0 -1
- package/.next/static/chunks/45a6zbtkelph9.js +0 -1
- /package/.next/static/{X34BUd9bfdH27ripuwwBm → YR4NWcDDuzwLbTTU7U7Vr}/_buildManifest.js +0 -0
- /package/.next/static/{X34BUd9bfdH27ripuwwBm → YR4NWcDDuzwLbTTU7U7Vr}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{X34BUd9bfdH27ripuwwBm → YR4NWcDDuzwLbTTU7U7Vr}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[8468,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(752562),f=a.i(589027),g=a.i(168370),h=a.i(847799),i=a.i(925039),j=a.i(696732),k=a.i(71215),l=a.i(62140),m=a.i(875160),n=a.i(328423),o=a.i(233540),p=a.i(674746),q=a.i(357307),r=a.i(924613),s=a.i(572131),t=a.i(767561),u=a.i(545097),v=a.i(950463),w=a.i(107340),x=a.i(86922),y=a.i(600154),z=a.i(369768),A=a.i(759497),B=a.i(497895),C=b([z]);[z]=C.then?(await C)():C;let K={web_search:function({tool:a,taskId:b,collapsed:c}){let e=O(a.results);return(0,d.jsxs)(G,{tool:a,taskId:b,icon:o.Search,collapsed:c,children:[(0,d.jsxs)("p",{className:"px-3 pt-1 pb-1.5 text-[13px] leading-snug break-keep",children:["“",a.input,"”"]}),e.length>0&&(0,d.jsx)("ol",{className:"space-y-0.5 px-3 pb-2",children:e.map((a,b)=>(0,d.jsxs)("li",{className:"flex gap-2 text-[11.5px] leading-snug text-muted-foreground",children:[(0,d.jsx)("span",{className:"mt-1.25 size-1 shrink-0 rounded-full bg-muted-foreground/50"}),(0,d.jsx)("span",{className:"truncate",children:a})]},`${b}-${a}`))})]})},bash:function({tool:a,taskId:b,collapsed:c}){let e=O(a.results);return(0,d.jsx)(G,{tool:a,taskId:b,icon:q.Terminal,collapsed:c,children:(0,d.jsxs)("pre",{className:"mx-3 overflow-x-auto rounded-lg bg-foreground/5 px-2.5 py-1.5 font-mono text-[11px] leading-relaxed scrollbar-none dark:bg-black/25",children:[(0,d.jsx)("span",{className:"text-muted-foreground/60",children:"$ "}),a.input,e.length>0&&(0,d.jsx)("span",{className:"block text-muted-foreground",children:e.join("\n")})]})})},fetch:a=>(0,d.jsx)(D,{icon:j.Globe,...a}),write_file:a=>(0,d.jsx)(E,{icon:h.FilePen,...a}),generate_image:function({tool:a,taskId:b,collapsed:c}){let[e]=O(a.results);return(0,d.jsxs)(G,{tool:a,taskId:b,icon:k.Image,collapsed:c,children:[(0,d.jsx)("p",{className:"px-3 pt-1 text-[12px] leading-snug break-keep",children:a.input}),e&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-1 pb-1.5",children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",children:e}),(0,d.jsxs)(z.FileLink,{path:e,label:`Open ${e}`,className:N,children:[(0,d.jsx)(g.ExternalLink,{className:"size-3"}),"Open"]})]})]})}},L={web_search:o.Search,bash:q.Terminal,fetch:j.Globe,write_file:h.FilePen,generate_image:k.Image,memory_recall:x.MemoryMark,memory_remember:x.MemoryMark,memory_forget:x.MemoryMark,memory_show:x.MemoryMark,load_skill:y.SkillsMark,tool_search:w.McpMark,tool_call:w.McpMark,delegate:p.Send,task:l.ListChecks,ask_bot:n.MessageSquare,ask_back:n.MessageSquare,ask_thursday:n.MessageSquare,report:i.Flag},M=a=>L[a]??r.Wrench;function D({icon:a,tool:b,taskId:c,collapsed:e}){return(0,d.jsxs)(G,{tool:b,taskId:c,icon:a,collapsed:e,children:[(0,d.jsx)("p",{className:"truncate px-3 pt-1 pb-1.5 font-mono text-[11px]",children:b.input}),(0,d.jsx)(J,{lines:O(b.results),mono:!0})]})}let N="flex shrink-0 items-center gap-1 rounded-md px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground outline-none transition-colors hover:bg-background hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50";function E({icon:a,tool:b,taskId:c,collapsed:e}){let f=b.path??b.input;return(0,d.jsxs)(G,{tool:b,taskId:c,icon:a,collapsed:e,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-1 pb-1.5",children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px]",children:b.input}),(0,d.jsxs)(z.FileLink,{path:f,label:`Open ${f}`,className:N,children:[(0,d.jsx)(g.ExternalLink,{className:"size-3"}),"Open"]})]}),(0,d.jsx)(J,{lines:O(b.results),mono:!0})]})}function F({tool:a,taskId:b,collapsed:c}){return(0,d.jsxs)(G,{tool:a,taskId:b,icon:M(a.name),collapsed:c,children:[(0,d.jsx)("p",{className:"px-3 pt-1 pb-1.5 text-[12px] leading-snug break-keep",children:a.input}),(0,d.jsx)(J,{lines:O(a.results)})]})}function G({tool:a,taskId:b,icon:c,collapsed:g=!1,children:h}){let i=void 0===a.results,[j,k]=(0,s.useState)(!g),l=j||i,n=a.more&&b&&a.callId;return(0,d.jsxs)("div",{className:(0,B.cn)("@container w-full overflow-hidden rounded-xl transition-colors",l?"bg-background/80 dark:bg-white/4":"hover:bg-foreground/4"),children:[(0,d.jsxs)("button",{type:"button",onClick:()=>k(a=>!a),"aria-expanded":l,className:"flex w-full items-center gap-2 rounded-xl px-2.5 py-1.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)("span",{className:"grid size-5 shrink-0 place-items-center rounded-[7px] bg-foreground/8 text-muted-foreground",children:i?(0,d.jsx)(m.Loader2,{className:"size-3 animate-spin"}):(0,d.jsx)(c,{className:"size-3"})}),a.note?(0,d.jsxs)(d.Fragment,{children:[i?(0,d.jsx)(u.default,{text:a.note,speed:2.4,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 flex-1 truncate text-[12px] leading-4 break-keep"}):(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate text-[12px] leading-4 break-keep",children:a.note}),(0,d.jsx)("span",{className:"hidden min-w-0 flex-1 truncate font-mono text-[11px] leading-4 text-muted-foreground/85 @lg:block",children:a.input})]}):i?(0,d.jsx)(u.default,{text:a.input,speed:2.4,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 flex-1 truncate font-mono text-[11px] leading-4"}):(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] leading-4 text-foreground/80",children:a.input}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:a.name}),!i&&(0,d.jsx)(e.Check,{className:"size-3 shrink-0 text-muted-foreground/50"}),(0,d.jsx)(f.ChevronDown,{className:(0,B.cn)("size-3 shrink-0 text-muted-foreground/50 transition-transform",l&&"rotate-180")})]}),l&&(0,d.jsxs)("div",{className:"pb-1.5 pl-[1.625rem]",children:[h,n&&(0,d.jsx)(H,{taskId:b,callId:a.callId})]})]})}function H({taskId:a,callId:b}){let[c,e]=(0,s.useState)(!1),{data:g,isLoading:h}=(0,A.useServerRoute)(c?t.queryKey.toolResult(a,b):null);return(0,d.jsxs)("div",{className:"px-3 pb-1",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>e(a=>!a),className:"flex items-center gap-1 rounded-md py-0.5 font-mono text-[10px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(f.ChevronDown,{className:(0,B.cn)("size-3",c&&"rotate-180")}),c?"Less":"Everything"]}),c&&(h||!g?(0,d.jsx)(v.Skeleton,{className:"mt-1.5 h-12 w-full rounded-lg"}):(0,d.jsxs)("div",{className:"mt-1.5 space-y-1.5",children:[P(g).map((a,b)=>(0,d.jsx)(I,{src:a},`${b}-${a.length}`)),O(g).length>0&&(0,d.jsx)("pre",{className:"max-h-72 overflow-auto rounded-lg bg-foreground/5 px-2.5 py-2 font-mono text-[11px] leading-relaxed break-all whitespace-pre-wrap dark:bg-black/25",children:O(g).join("\n")})]}))]})}function I({src:a}){return(0,d.jsx)("img",{src:a,alt:"",className:"block w-full rounded-lg bg-muted object-contain"})}function J({lines:a,mono:b}){return 0===a.length?null:(0,d.jsx)("ul",{className:"px-3 pb-1.5",children:a.map((a,c)=>(0,d.jsx)("li",{className:(0,B.cn)("truncate text-[11px] leading-relaxed text-muted-foreground",b&&"font-mono"),children:a},`${c}-${a}`))})}let O=a=>a?.flatMap(a=>"text"===a.type?[a.text]:[])??[],P=a=>a?.flatMap(a=>"image"===a.type?[a.src]:[])??[];a.s(["BotTool",0,function(a){let b=K[a.tool.name]??F;return(0,d.jsx)(b,{...a})},"toolIcon",0,M]),c()}catch(a){c(a)}},!1),107340,a=>{"use strict";var b=a.i(164831);let c={name:"cable",size:24,node:[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]]};c.node;let d=(0,b.default)(c);a.s(["McpMark",0,d],107340)},86922,a=>{"use strict";var b=a.i(164831);let c={name:"cpu",size:24,node:[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]};c.node;let d=(0,b.default)(c);a.s(["MemoryMark",0,d],86922)},600154,a=>{"use strict";let b=a.i(689594).BookMarked;a.s(["SkillsMark",0,b])},847799,a=>{"use strict";var b=a.i(164831);let c={name:"file-pen",size:24,node:[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],aliases:["file-edit"]};c.node;let d=(0,b.default)(c);a.s(["FilePen",0,d],847799)},925039,a=>{"use strict";var b=a.i(164831);let c={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};c.node;let d=(0,b.default)(c);a.s(["Flag",0,d],925039)},62140,a=>{"use strict";var b=a.i(164831);let c={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};c.node;let d=(0,b.default)(c);a.s(["ListChecks",0,d],62140)},875160,a=>{"use strict";var b=a.i(702918);a.s(["Loader2",()=>b.default])},328423,a=>{"use strict";var b=a.i(164831);let c={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};c.node;let d=(0,b.default)(c);a.s(["MessageSquare",0,d],328423)},674746,a=>{"use strict";var b=a.i(164831);let c={name:"send",size:24,node:[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]};c.node;let d=(0,b.default)(c);a.s(["Send",0,d],674746)},357307,a=>{"use strict";var b=a.i(164831);let c={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};c.node;let d=(0,b.default)(c);a.s(["Terminal",0,d],357307)}];
|
|
1
|
+
module.exports=[8468,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(752562),f=a.i(589027),g=a.i(168370),h=a.i(847799),i=a.i(925039),j=a.i(696732),k=a.i(71215),l=a.i(62140),m=a.i(875160),n=a.i(328423),o=a.i(233540),p=a.i(674746),q=a.i(357307),r=a.i(924613),s=a.i(572131),t=a.i(767561),u=a.i(545097),v=a.i(950463),w=a.i(107340),x=a.i(86922),y=a.i(600154),z=a.i(369768),A=a.i(759497),B=a.i(497895),C=b([z]);[z]=C.then?(await C)():C;let K={web_search:function({tool:a,taskId:b,collapsed:c}){let e=O(a.results);return(0,d.jsxs)(G,{tool:a,taskId:b,icon:o.Search,collapsed:c,children:[(0,d.jsxs)("p",{className:"px-3 pt-1 pb-1.5 text-[13px] leading-snug break-keep",children:["“",a.input,"”"]}),e.length>0&&(0,d.jsx)("ol",{className:"space-y-0.5 px-3 pb-2",children:e.map((a,b)=>(0,d.jsxs)("li",{className:"flex gap-2 text-[11.5px] leading-snug text-muted-foreground",children:[(0,d.jsx)("span",{className:"mt-1.25 size-1 shrink-0 rounded-full bg-muted-foreground/50"}),(0,d.jsx)("span",{className:"truncate",children:a})]},`${b}-${a}`))})]})},bash:function({tool:a,taskId:b,collapsed:c}){let e=O(a.results);return(0,d.jsx)(G,{tool:a,taskId:b,icon:q.Terminal,collapsed:c,children:(0,d.jsxs)("pre",{className:"mx-3 overflow-x-auto rounded-lg bg-foreground/5 px-2.5 py-1.5 font-mono text-[11px] leading-relaxed scrollbar-none dark:bg-black/25",children:[(0,d.jsx)("span",{className:"text-muted-foreground/60",children:"$ "}),a.input,e.length>0&&(0,d.jsx)("span",{className:"block text-muted-foreground",children:e.join("\n")})]})})},fetch:a=>(0,d.jsx)(D,{icon:j.Globe,...a}),write_file:a=>(0,d.jsx)(E,{icon:h.FilePen,...a}),generate_image:function({tool:a,taskId:b,collapsed:c}){let[e]=O(a.results);return(0,d.jsxs)(G,{tool:a,taskId:b,icon:k.Image,collapsed:c,children:[(0,d.jsx)("p",{className:"px-3 pt-1 text-[12px] leading-snug break-keep",children:a.input}),e&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-1 pb-1.5",children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",children:e}),(0,d.jsxs)(z.FileLink,{path:e,label:`Open ${e}`,className:N,children:[(0,d.jsx)(g.ExternalLink,{className:"size-3"}),"Open"]})]})]})}},L={web_search:o.Search,bash:q.Terminal,fetch:j.Globe,write_file:h.FilePen,generate_image:k.Image,memory_recall:x.MemoryMark,memory_remember:x.MemoryMark,memory_forget:x.MemoryMark,memory_show:x.MemoryMark,load_skill:y.SkillsMark,tool_search:w.McpMark,tool_call:w.McpMark,delegate:p.Send,task:l.ListChecks,ask_bot:n.MessageSquare,ask_back:n.MessageSquare,ask_thursday:n.MessageSquare,report:i.Flag},M=a=>L[a]??r.Wrench;function D({icon:a,tool:b,taskId:c,collapsed:e}){return(0,d.jsxs)(G,{tool:b,taskId:c,icon:a,collapsed:e,children:[(0,d.jsx)("p",{className:"truncate px-3 pt-1 pb-1.5 font-mono text-[11px]",children:b.input}),(0,d.jsx)(J,{lines:O(b.results),mono:!0})]})}let N="flex shrink-0 items-center gap-1 rounded-md px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground outline-none transition-colors hover:bg-background hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50";function E({icon:a,tool:b,taskId:c,collapsed:e}){let f=b.path??b.input;return(0,d.jsxs)(G,{tool:b,taskId:c,icon:a,collapsed:e,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-1 pb-1.5",children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px]",children:b.input}),(0,d.jsxs)(z.FileLink,{path:f,label:`Open ${f}`,className:N,children:[(0,d.jsx)(g.ExternalLink,{className:"size-3"}),"Open"]})]}),(0,d.jsx)(J,{lines:O(b.results),mono:!0})]})}function F({tool:a,taskId:b,collapsed:c}){return(0,d.jsxs)(G,{tool:a,taskId:b,icon:M(a.name),collapsed:c,children:[(0,d.jsx)("p",{className:"px-3 pt-1 pb-1.5 text-[12px] leading-snug break-keep",children:a.input}),(0,d.jsx)(J,{lines:O(a.results)})]})}function G({tool:a,taskId:b,icon:c,collapsed:g=!1,children:h}){let i=void 0===a.results,[j,k]=(0,s.useState)(!g),l=j||i,n=a.more&&b&&a.callId;return(0,d.jsxs)("div",{className:(0,B.cn)("@container w-full overflow-hidden rounded-xl transition-colors",l?"bg-background/80 dark:bg-white/4":"hover:bg-foreground/4"),children:[(0,d.jsxs)("button",{type:"button",onClick:()=>k(a=>!a),"aria-expanded":l,className:"flex w-full items-center gap-2 rounded-xl px-2.5 py-1.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)("span",{className:"grid size-5 shrink-0 place-items-center rounded-[7px] bg-foreground/8 text-muted-foreground",children:i?(0,d.jsx)(m.Loader2,{className:"size-3 animate-spin"}):(0,d.jsx)(c,{className:"size-3"})}),a.note?(0,d.jsxs)(d.Fragment,{children:[i?(0,d.jsx)(u.default,{text:a.note,speed:2.4,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 flex-1 truncate text-[12px] leading-4 break-keep"}):(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate text-[12px] leading-4 break-keep",children:a.note}),(0,d.jsx)("span",{className:"hidden min-w-0 flex-1 truncate font-mono text-[11px] leading-4 text-muted-foreground/85 @lg:block",children:a.input})]}):i?(0,d.jsx)(u.default,{text:a.input,speed:2.4,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 flex-1 truncate font-mono text-[11px] leading-4"}):(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] leading-4 text-foreground/80",children:a.input}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:a.name}),!i&&(0,d.jsx)(e.Check,{className:"size-3 shrink-0 text-muted-foreground/50"}),(0,d.jsx)(f.ChevronDown,{className:(0,B.cn)("size-3 shrink-0 text-muted-foreground/50 transition-transform",l&&"rotate-180")})]}),l&&(0,d.jsxs)("div",{className:"pb-1.5 pl-[1.625rem]",children:[h,n&&(0,d.jsx)(H,{taskId:b,callId:a.callId})]})]})}function H({taskId:a,callId:b}){let[c,e]=(0,s.useState)(!1),{data:g,isLoading:h}=(0,A.useServerRoute)(c?t.queryKey.toolResult(a,b):null);return(0,d.jsxs)("div",{className:"px-3 pb-1",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>e(a=>!a),className:"flex items-center gap-1 rounded-md py-0.5 font-mono text-[10px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(f.ChevronDown,{className:(0,B.cn)("size-3",c&&"rotate-180")}),c?"Less":"Everything"]}),c&&(h||!g?(0,d.jsx)(v.Skeleton,{className:"mt-1.5 h-12 w-full rounded-lg"}):(0,d.jsxs)("div",{className:"mt-1.5 space-y-1.5",children:[P(g).map((a,b)=>(0,d.jsx)(I,{src:a},`${b}-${a.length}`)),O(g).length>0&&(0,d.jsx)("pre",{className:"max-h-72 overflow-auto rounded-lg bg-foreground/5 px-2.5 py-2 font-mono text-[11px] leading-relaxed break-all whitespace-pre-wrap dark:bg-black/25",children:O(g).join("\n")})]}))]})}function I({src:a}){return(0,d.jsx)("img",{src:a,alt:"",className:"block w-full rounded-lg bg-muted object-contain"})}function J({lines:a,mono:b}){return 0===a.length?null:(0,d.jsx)("ul",{className:"px-3 pb-1.5",children:a.map((a,c)=>(0,d.jsx)("li",{className:(0,B.cn)("truncate text-[11px] leading-relaxed text-muted-foreground",b&&"font-mono"),children:a},`${c}-${a}`))})}let O=a=>a?.flatMap(a=>"text"===a.type?[a.text]:[])??[],P=a=>a?.flatMap(a=>"image"===a.type?[a.src]:[])??[];a.s(["BotTool",0,function(a){let b=K[a.tool.name]??F;return(0,d.jsx)(b,{...a})},"toolIcon",0,M]),c()}catch(a){c(a)}},!1),107340,a=>{"use strict";var b=a.i(164831);let c={name:"cable",size:24,node:[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]]};c.node;let d=(0,b.default)(c);a.s(["McpMark",0,d],107340)},86922,a=>{"use strict";var b=a.i(164831);let c={name:"cpu",size:24,node:[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]};c.node;let d=(0,b.default)(c);a.s(["MemoryMark",0,d],86922)},600154,a=>{"use strict";let b=a.i(689594).BookMarked;a.s(["SkillsMark",0,b])},346075,a=>{"use strict";var b=a.i(187924),c=a.i(913834),d=a.i(759399);a.s(["ThursdayMark",0,function({size:a=16,className:e}){let f=(0,d.useThursdayFace)();return(0,b.jsx)(c.BotMark,{size:a,seed:"thursday",color:f.color,shape:f.shape,outline:f.outline,notify:!1,className:e})}])},334392,a=>{"use strict";a.s(["ASCII_CHARSETS",0,["ascii","emoji","emojiOnly"],"FACE_KINDS",0,["mark","ascii"]])},759399,a=>{"use strict";var b=a.i(572131),c=a.i(461512);let d="thursday.icon";function e(){return c.FACE_DEFAULT}let f=e(),g=new Set;function h(){for(let a of g)a()}a.s(["setThursdayFace",0,function(a){f=a;try{window.localStorage.setItem(d,JSON.stringify(a))}catch{}h()},"useThursdayFace",0,function(){return(0,b.useSyncExternalStore)(a=>{g.add(a);let b=a=>{a.key===d&&(f=e(),h())};return window.addEventListener("storage",b),()=>{g.delete(a),window.removeEventListener("storage",b)}},()=>f,()=>c.FACE_DEFAULT)}])},461512,a=>{"use strict";var b=a.i(702080),c=a.i(61876),d=a.i(411509),e=a.i(334392),f=a.i(616682);let g=b.default.object({systemPrompt:b.default.string().max(f.COMMON_VALIDATE.prompt.max).nullish(),model:c.speachModelRefSchema.nullish(),locale:b.default.string().max(35).nullish()}),h=d.botIconSchema.extend({kind:b.default.enum(e.FACE_KINDS).default("ascii"),charset:b.default.enum(e.ASCII_CHARSETS).default("ascii"),fontSize:b.default.number().min(4).max(16).default(8),density:b.default.number().min(.6).max(2).default(1.4)}).parse({}),i={min:3,max:32},j=b.default.object({enabled:b.default.boolean(),phrase:b.default.string().trim().min(i.min).max(i.max)}),k=b.default.object({enabled:b.default.boolean(),combo:b.default.string().trim().min(1).max(64)}),l=["off","waiting","any"],m=b.default.enum(l),n=["center","sides"],o=b.default.enum(n);b.default.object({id:b.default.string().min(1),role:b.default.enum(["user","assistant","tool"]),tool:b.default.string().nullish(),text:b.default.string(),seq:b.default.number().int().min(0)}),a.s(["CALL_BACK_DEFAULT",0,"off","CALL_BACK_LABEL",0,{off:"Never",waiting:"When a job needs me",any:"Whenever a job ends"},"CALL_BACK_MODES",0,l,"CALL_HISTORY_PAGE",0,10,"CAPTION_VIEWS",0,n,"CallBackSchema",0,m,"CaptionViewSchema",0,o,"FACE_DEFAULT",0,h,"HOTKEY_DEFAULT",0,{enabled:!0,combo:"alt+shift+KeyT"},"HotkeySchema",0,k,"ThursdaySettingsSchema",0,g,"WAKE_DEFAULT",0,{enabled:!0,phrase:"hey thursday"},"WAKE_PHRASE",0,i,"WakeSchema",0,j])},847799,a=>{"use strict";var b=a.i(164831);let c={name:"file-pen",size:24,node:[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],aliases:["file-edit"]};c.node;let d=(0,b.default)(c);a.s(["FilePen",0,d],847799)},925039,a=>{"use strict";var b=a.i(164831);let c={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};c.node;let d=(0,b.default)(c);a.s(["Flag",0,d],925039)},62140,a=>{"use strict";var b=a.i(164831);let c={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};c.node;let d=(0,b.default)(c);a.s(["ListChecks",0,d],62140)},875160,a=>{"use strict";var b=a.i(702918);a.s(["Loader2",()=>b.default])},328423,a=>{"use strict";var b=a.i(164831);let c={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};c.node;let d=(0,b.default)(c);a.s(["MessageSquare",0,d],328423)},674746,a=>{"use strict";var b=a.i(164831);let c={name:"send",size:24,node:[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]};c.node;let d=(0,b.default)(c);a.s(["Send",0,d],674746)},357307,a=>{"use strict";var b=a.i(164831);let c={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};c.node;let d=(0,b.default)(c);a.s(["Terminal",0,d],357307)}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=_1g6l4uj._.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(749042),A=a.i(938118),B=a.i(749238),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),749042,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f7c22d7e94d60cac9d3b60c6e88cd4e37b80e236d",b.callServer,void 0,b.findSourceMapURL,"deleteWorkspaceFileAction");a.s(["deleteWorkspaceFileAction",0,c])},938118,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f03d6d6299fa4eec98c5b016c1419caaa76ac5aa6",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)},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(998901),A=a.i(486882),B=a.i(664510),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),998901,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f67bf2655ca9992c673791a8cd1981c03a8eb483d",b.callServer,void 0,b.findSourceMapURL,"deleteWorkspaceFileAction");a.s(["deleteWorkspaceFileAction",0,c])},486882,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f046a26fa081e136ed5a5bfd782c220d050b373f0",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)},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=
|
|
3
|
+
//# sourceMappingURL=_1lip4th._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[703228,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(263359),f=a.i(689594),g=a.i(707963),h=a.i(141146),i=a.i(998697),j=a.i(483138),k=a.i(69095),l=a.i(696732),m=a.i(567826),n=a.i(403512),o=a.i(233540),p=a.i(917256),q=a.i(951675),r=a.i(201661),s=a.i(572131),t=a.i(767561),u=a.i(340695),v=a.i(316474),w=a.i(205522),x=a.i(846991),y=a.i(446181),z=a.i(950463),A=a.i(280281),B=a.i(621958),C=a.i(546893),D=a.i(287702),E=a.i(619477),F=a.i(838682),G=a.i(601219),H=a.i(359633),I=a.i(777525),J=a.i(313237),K=a.i(759497),L=a.i(497895),M=b([x]);[x]=M.then?(await M)():M;let W={browser:l.Globe,computer:e.AppWindow,"find-skills":o.Search,"interactive-page":m.MousePointer2,"skill-creator":p.SquarePen};function N({skill:a}){let[b,c]=(0,J.useServerAction)(G.deleteSkillAction,{onOk:()=>(0,K.revalidate)(t.queryKey.skills)}),[e]=(0,J.useServerAction)(H.setSkillDisabledAction,{onOk:()=>(0,K.revalidate)(t.queryKey.skills)}),g=async()=>{await y.notify.confirm({title:`Delete ${a.name}?`,description:"Every file in this skill is deleted for good.",okText:"Delete",destructive:!0})&&b(a.dir)},i="default"===a.source&&W[a.dir]||f.BookMarked;return(0,d.jsxs)("div",{className:"group flex items-center transition-colors hover:bg-muted/50",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>{var b;return b=a,y.notify.component({className:"sm:max-w-4xl",renderer:()=>(0,d.jsx)(O,{skill:b})})},className:"flex min-w-0 flex-1 items-center gap-3 py-4 pl-4 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,d.jsx)("span",{className:(0,L.cn)("grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",a.disabled&&"opacity-45"),children:(0,d.jsx)(i,{className:"size-4"})}),(0,d.jsxs)("span",{className:(0,L.cn)("min-w-0 flex-1 space-y-0.5",a.disabled&&"opacity-45"),children:[(0,d.jsx)("span",{className:"block truncate text-sm font-medium",children:a.name}),(0,d.jsx)("span",{className:"line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:a.description})]}),(0,d.jsx)(h.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 group-hover:text-foreground"})]}),(0,d.jsxs)("div",{className:"mr-4 ml-5 flex w-18 shrink-0 items-center justify-end gap-3",children:[(0,d.jsx)(A.Switch,{checked:!a.disabled,onCheckedChange:b=>e(a.source,a.dir,!b),"aria-label":`${a.name} on or off`,className:"shrink-0"}),"custom"===a.source?(0,d.jsx)(u.Button,{size:"icon-sm",variant:"ghost",loading:c,onClick:g,className:"shrink-0 text-muted-foreground",children:(0,d.jsx)(q.Trash2,{})}):(0,d.jsx)("span",{className:"size-7 shrink-0"})]})]})}function O({skill:a}){let[b,c]=(0,s.useState)(""),[e,f]=(0,s.useState)("SKILL.md");return(0,d.jsx)(E.SettingDialogContent,{title:a.name,description:(0,d.jsx)(P,{skill:a,path:e??b}),children:(0,d.jsxs)("div",{className:"flex h-[36rem] divide-x divide-border/60 overflow-hidden rounded-xl border border-border/60 bg-background",children:[(0,d.jsxs)("div",{className:"flex w-44 shrink-0 flex-col overflow-y-auto bg-muted/20 py-1",children:[b&&(0,d.jsxs)("button",{type:"button",onClick:()=>c(b.split("/").slice(0,-1).join("/")),className:"mx-1 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/50 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,d.jsx)(g.ChevronLeft,{className:"size-3 shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:b.split("/").pop()})]}),(0,d.jsx)(R,{source:a.source,dir:a.dir,path:b,current:e,onPick:a=>{let d=b?`${b}/${a.name}`:a.name;"dir"===a.kind?c(d):f(d)}})]}),(0,d.jsx)("div",{className:"min-w-0 flex-1 overflow-y-auto",children:e?(0,d.jsx)(T,{source:a.source,dir:a.dir,path:e}):(0,d.jsx)("p",{className:"p-6 text-sm text-muted-foreground/60",children:"Pick a file"})})]})})}function P({skill:a,path:b}){if(!a)return(0,d.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground/60",children:"Pick a skill"});let c=[a.name,...b.split("/").filter(Boolean)];return(0,d.jsx)("span",{className:"flex min-w-0 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:c.map((a,b)=>(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[b>0&&(0,d.jsx)(h.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,d.jsx)("span",{className:(0,L.cn)("truncate",b===c.length-1&&"text-foreground"),children:a})]},`${b}-${a}`))})}function Q({icon:a,label:b,active:c,hasChildren:e,onClick:f}){return(0,d.jsxs)("button",{type:"button",onClick:f,className:(0,L.cn)("mx-1 flex items-center gap-1.5 rounded-md px-2 py-1 text-left text-xs outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",c?"bg-secondary text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground/70 [&>svg]:size-3",children:a}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:b}),e&&(0,d.jsx)(h.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground/50"})]})}function R({source:a,dir:b,path:c,current:e,onPick:f}){let{data:g,isLoading:h,error:l}=(0,K.useServerRoute)(t.queryKey.skillNode(a,b,c));return l?(0,d.jsx)("p",{className:"p-3 font-mono text-xs text-destructive",children:l.message}):h||!g?(0,d.jsxs)("div",{className:"space-y-2 p-2",children:[(0,d.jsx)(z.Skeleton,{className:"h-5 w-full"}),(0,d.jsx)(z.Skeleton,{className:"h-5 w-4/5"})]}):"dir"!==g.kind?null:(0,d.jsxs)(d.Fragment,{children:[g.entries.map(a=>(0,d.jsx)(Q,{icon:"dir"===a.kind?(0,d.jsx)(k.Folder,{}):a.name.endsWith(".md")?(0,d.jsx)(j.FileText,{}):(0,d.jsx)(i.File,{}),label:a.name,hasChildren:"dir"===a.kind,active:(c?`${c}/${a.name}`:a.name)===e,onClick:()=>f(a)},a.name)),0===g.entries.length&&(0,d.jsx)("p",{className:"p-3 text-xs text-muted-foreground/60",children:"Empty folder"})]})}function S({content:a}){let b=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(a),c=b?.[1].trim(),e=b?a.slice(b[0].length):a;return(0,d.jsxs)("div",{className:"min-w-0",children:[c&&(0,d.jsx)("pre",{className:"border-b border-border/60 bg-muted/20 px-5 py-3 font-mono text-[11px] leading-relaxed whitespace-pre-wrap text-muted-foreground",children:c}),(0,d.jsx)("div",{className:"px-5 py-4 text-sm leading-relaxed",children:(0,d.jsx)(x.Markdown,{children:e})})]})}function T({source:a,dir:b,path:c}){let{data:e,isLoading:f,error:g}=(0,K.useServerRoute)(t.queryKey.skillNode(a,b,c));if(g)return(0,d.jsx)("p",{className:"p-4 font-mono text-xs text-destructive",children:g.message});if(f||!e)return(0,d.jsxs)("div",{className:"space-y-3 p-5",children:[(0,d.jsx)(z.Skeleton,{className:"h-5 w-2/3"}),(0,d.jsx)(z.Skeleton,{className:"h-4 w-full"}),(0,d.jsx)(z.Skeleton,{className:"h-4 w-5/6"})]});if("file"!==e.kind)return null;let h=c.split("/").pop()??"";return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"sticky top-0 z-20 flex items-center justify-between gap-2 border-b border-border/60 bg-background/90 px-5 py-2 font-mono text-[11px] text-muted-foreground backdrop-blur",children:[(0,d.jsx)("span",{className:"truncate",children:h}),(0,d.jsx)("span",{className:"shrink-0",children:(0,L.formatBytes)(e.size)})]}),null===e.content?(0,d.jsx)("p",{className:"px-5 py-4 text-sm text-muted-foreground/60",children:"Not a text file — the agent can still read it from disk."}):h.toLowerCase().endsWith(".md")?(0,d.jsx)(S,{content:e.content}):(0,d.jsx)("pre",{className:"overflow-x-auto px-5 py-4 font-mono text-[13px] leading-relaxed whitespace-pre text-foreground/90",children:e.content})]})}function U(){return y.notify.component({className:"sm:max-w-lg",renderer:({close:a})=>(0,d.jsx)(V,{onDone:a})})}function V({onDone:a}){let[b,c]=(0,s.useState)("write"),[e,f]=(0,s.useState)(""),[g,h]=(0,s.useState)(""),[i,j]=(0,s.useState)(""),[k,l]=(0,s.useState)(null),[m,o]=(0,s.useState)(!1),p=(0,s.useRef)(null),q={errorMessage:!1,onOk:()=>{(0,K.revalidate)(t.queryKey.skills),a()}},[x,y,,z]=(0,J.useServerAction)(F.createSkillAction,q),[A,G,,H]=(0,J.useServerAction)(I.uploadSkillAction,q),M=y||G,N="write"===b?z:H,O=!M&&("write"===b?e.trim()&&g.trim()&&i.trim():null!==k),P=async()=>{var a;!O||("write"===b?x({name:e.trim(),description:g.trim(),content:i}):k&&A({fileName:k.name,base64:await (a=k,new Promise((b,c)=>{let d=new FileReader;d.onload=()=>{let a=d.result;b(a.slice(a.indexOf(",")+1))},d.onerror=()=>c(d.error),d.readAsDataURL(a)}))}))},Q=a=>{let b=a?.[0]??null;b&&l(b)};return(0,d.jsxs)(E.SettingDialogContent,{title:"New skill",description:"Instructions the agent loads by name when a task calls for them.",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u.Button,{variant:"ghost",onClick:a,children:"Cancel"}),(0,d.jsxs)(u.Button,{disabled:!O,loading:M,onClick:P,children:[!M&&("write"===b?(0,d.jsx)(n.Plus,{}):(0,d.jsx)(r.Upload,{})),"write"===b?"Create":"Upload"]})]}),children:[(0,d.jsxs)(B.Tabs,{value:b,onValueChange:a=>c(a),children:[(0,d.jsxs)(B.TabsList,{className:"w-full",children:[(0,d.jsx)(B.TabsTrigger,{value:"write",children:"Write"}),(0,d.jsx)(B.TabsTrigger,{value:"upload",children:"Upload"})]}),(0,d.jsxs)(B.TabsContent,{value:"write",className:"space-y-5 pt-4",children:[(0,d.jsxs)(v.Field,{children:[(0,d.jsx)(v.FieldLabel,{htmlFor:"skill-name",children:"Name"}),(0,d.jsxs)(v.FieldContent,{children:[(0,d.jsx)(w.Input,{id:"skill-name",value:e,onChange:a=>f(a.target.value),placeholder:"deploy-checklist",spellCheck:!1,autoFocus:!0}),(0,d.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[D.PATHS.skills.custom,"/",e.trim()||"…","/SKILL.md"]})]})]}),(0,d.jsxs)(v.Field,{children:[(0,d.jsx)(v.FieldLabel,{htmlFor:"skill-description",children:"Description"}),(0,d.jsx)(v.FieldContent,{children:(0,d.jsx)(w.Input,{id:"skill-description",value:g,onChange:a=>h(a.target.value),placeholder:"When to use it — this is how the agent decides to load it"})})]}),(0,d.jsxs)(v.Field,{children:[(0,d.jsx)(v.FieldLabel,{htmlFor:"skill-content",children:"Content"}),(0,d.jsx)(C.Textarea,{id:"skill-content",value:i,onChange:a=>j(a.target.value),placeholder:"Markdown. The steps, the rules, the examples.",className:"min-h-40 resize-none font-mono text-xs"})]})]}),(0,d.jsxs)(B.TabsContent,{value:"upload",className:"space-y-4 pt-4",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>p.current?.click(),onDragOver:a=>{a.preventDefault(),o(!0)},onDragLeave:()=>o(!1),onDrop:a=>{a.preventDefault(),o(!1),Q(a.dataTransfer.files)},className:(0,L.cn)("flex w-full flex-col items-center gap-2 rounded-xl border border-dashed px-6 py-10 text-center outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",m?"border-foreground/60 bg-muted/60":"border-border hover:bg-muted/40"),children:[(0,d.jsx)(r.Upload,{className:"size-5 text-muted-foreground"}),k?(0,d.jsxs)("span",{className:"text-sm",children:[k.name,(0,d.jsx)("span",{className:"ml-2 font-mono text-[11px] text-muted-foreground",children:(0,L.formatBytes)(k.size)})]}):(0,d.jsx)("span",{className:"text-sm text-muted-foreground",children:"Drop a file here, or click to choose"})]}),(0,d.jsx)("input",{ref:p,type:"file",accept:".md,.zip,.skill",className:"hidden",onChange:a=>Q(a.target.files)}),(0,d.jsxs)("div",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,d.jsx)("p",{className:"font-medium text-foreground/80",children:"File requirements"}),(0,d.jsxs)("p",{children:["A ",(0,d.jsx)("span",{className:"font-mono",children:".md"})," file needs a YAML block with the skill's name and description."]}),(0,d.jsxs)("p",{children:["A ",(0,d.jsx)("span",{className:"font-mono",children:".zip"})," or"," ",(0,d.jsx)("span",{className:"font-mono",children:".skill"})," archive needs a SKILL.md inside — the rest of its folder comes along."]})]})]})]}),N&&(0,d.jsx)("p",{className:"font-mono text-xs text-destructive",children:N})]})}a.s(["SkillsSetting",0,function(){let[a,b]=(0,s.useState)(""),{data:c,isLoading:e,error:f}=(0,K.useServerRoute)(t.queryKey.skills),g=c??[];if(e)return(0,d.jsx)(E.SettingSkeleton,{rows:4});if(f)return(0,d.jsx)(E.SettingError,{message:f.message});let h=a.trim().toLowerCase(),i=g.filter(a=>!h||`${a.name} ${a.description}`.toLowerCase().includes(h)),j=g.filter(a=>!a.disabled).length;return(0,d.jsxs)(E.SettingScreen,{footer:(0,d.jsxs)(E.SettingRailNote,{children:[g.filter(a=>"default"===a.source).length," shipped · ",g.filter(a=>"custom"===a.source).length," ","installed"]}),children:[(0,d.jsx)(E.SettingToolbar,{count:`${j} on \xb7 ${g.length-j} off`,children:(0,d.jsx)(E.SettingFilter,{value:a,onChange:b,placeholder:"Filter skills"})}),(0,d.jsx)(E.SettingGroup,{label:"Custom",hint:"yours — added here · wins a name clash",children:(0,d.jsx)(E.SettingItems,{addRow:{label:"Add skill",onClick:U},children:i.filter(a=>"custom"===a.source).map(a=>(0,d.jsx)(N,{skill:a},`custom/${a.dir}`))})}),(0,d.jsx)(E.SettingGroup,{label:"Default",hint:"ships with the app · switch off, can't edit or delete",children:(0,d.jsx)(E.SettingItems,{children:i.filter(a=>"default"===a.source).map(a=>(0,d.jsx)(N,{skill:a},`default/${a.dir}`))})}),j>D.PROMPT_CROWDED.skills&&(0,d.jsxs)(E.SettingNote,{children:[j," skills are on. Each is a line in every prompt a bot reads, and one more to look past when it picks."]})]})},"openSkillCreate",0,U]),c()}catch(a){c(a)}},!1),838682,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f4c8e0df06465e086f180ebe8fbf4a998603ad4a9",b.callServer,void 0,b.findSourceMapURL,"createSkillAction");a.s(["createSkillAction",0,c])},601219,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f354f08dd6a308f78069ff1a519a6718a4b47f2c2",b.callServer,void 0,b.findSourceMapURL,"deleteSkillAction");a.s(["deleteSkillAction",0,c])},359633,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f74e6d1aa460ff57d58d6f80d820fb3e3ce696d9c",b.callServer,void 0,b.findSourceMapURL,"setSkillDisabledAction");a.s(["setSkillDisabledAction",0,c])},777525,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f909a59045a8bbce06ccfddff2f1d96dedb7eb96f",b.callServer,void 0,b.findSourceMapURL,"uploadSkillAction");a.s(["uploadSkillAction",0,c])},263359,a=>{"use strict";var b=a.i(164831);let c={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};c.node;let d=(0,b.default)(c);a.s(["AppWindow",0,d],263359)},567826,a=>{"use strict";var b=a.i(164831);let c={name:"mouse-pointer-2",size:24,node:[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]};c.node;let d=(0,b.default)(c);a.s(["MousePointer2",0,d],567826)},917256,a=>{"use strict";var b=a.i(164831);let c={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};c.node;let d=(0,b.default)(c);a.s(["SquarePen",0,d],917256)},201661,a=>{"use strict";var b=a.i(164831);let c={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};c.node;let d=(0,b.default)(c);a.s(["Upload",0,d],201661)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=_1m3bsfr._.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module.exports=[203469,a=>{"use strict";let b,c,d,e,f,g;var h,i=a.i(569572),j=a.i(176668);let k={tasks:!0,memory:!0,mcp:!0,"memory-tidy":!0},l=globalThis,m=l.__appEvents??=(b=new Set,{emit(a){for(let c of[...b])try{c(a)}catch(a){console.error("event listener failed",a)}},subscribe:a=>(b.add(a),()=>{b.delete(a)})}),n=l.__presence??=(h=i.BROWSER_GONE_MS,c=!1,d=null,e=new Set,f=new Set,g=a=>{for(let b of[...a])try{b()}catch(a){console.error("presence listener failed",a)}},{get watching(){return c},track(a){if(a>0){d&&clearTimeout(d),d=null,c||(c=!0,g(f));return}!d&&c&&(d=setTimeout(()=>{d=null,c=!1,g(e)},h))},onGone:a=>(e.add(a),()=>e.delete(a)),onBack:a=>(f.add(a),()=>f.delete(a))}),o=l.__appEventStream??=function(a,b={}){let c=new TextEncoder,d=b.heartbeatMs??2e4,e=0;return{respond:(f,g)=>{let h=()=>{};return new Response(new ReadableStream({async start(i){let k=!1,l=new Map,m=[],n=a=>{if(!k)try{i.enqueue(c.encode(a))}catch{h()}},o=a=>n(`data: ${JSON.stringify(a)}
|
|
2
2
|
|
|
3
|
-
`),p=a=>{let c=b.coalesce?.keyOf(a)??null;if(null===c)return o(a);let d=l.get(c);d&&clearTimeout(d),l.set(c,setTimeout(()=>{l.delete(c),o(a)},b.coalesce?.ms))},q=a.subscribe(a=>m?m.push(a):p(a)),r=setInterval(()=>n(": ping\n\n"),d);e+=1,b.onWatchers?.(e),h=()=>{if(!k){for(let a of(k=!0,e-=1,b.onWatchers?.(e),q(),clearInterval(r),l.values()))clearTimeout(a);try{i.close()}catch{}}},f.addEventListener("abort",h);try{for(let a of await g?.()??[])o(a)}catch(a){j.logger.error("event stream opening failed",a),h();return}let s=m;for(let a of(m=null,s))p(a)},cancel(){h()}}),{headers:{"Content-Type":"text/event-stream; charset=utf-8","Cache-Control":"no-store","X-Accel-Buffering":"no"}})},get watchers(){return e}}}(m,{coalesce:{ms:150,keyOf:a=>a.type in k?a.type:null},onWatchers:n.track});l.__bootId??=crypto.randomUUID(),a.s(["appEventStream",0,o,"appEvents",0,m],203469)},978876,a=>{"use strict";var b=a.i(912714),c=a.i(527990),d=a.i(794219),e=a.i(762008),f=a.i(684321),g=a.i(821415);let h={name:e.TOOL_NAMES.delegate,description:"Hand a job to a bot. Returns immediately; the job runs in the background and its result is put in front of you later.",parameters:d.object({bot:d.string().describe("A name from the bot list."),request:d.string().describe("The whole job. The bot cannot hear the call, so everything it needs goes here — names, paths, what the user actually asked for — in their own language and their own words: it is the only language the bot has, and whatever it writes comes back to them. **Their request, never your reading of it**: a condition, a caution or a smaller goal they did not say is how a job comes back as the wrong thing. When their words leave a real choice open, ask them on the call and put the answer here."),label:d.string().describe("Two or three words naming the job, in the user's language. Used on screen and said out loud.")})},i={name:e.TOOL_NAMES.ask_bot,description:"Hand one part of the job you are holding to another bot and wait for what they bring back. The job stays yours.",parameters:d.object({bot:d.string().describe("A name from the bot list."),request:d.string().describe("The part they take, as a brief: the outcome you want, the shape to hand it back in (a path, a number, a list), and every name, path, number and limit that bears on it. They see nothing but this and `context` — not the call, not your thread — so write it long rather than short; a brief that leaves them guessing costs a whole run."),context:d.string().describe("The job you were given, quoted, and whatever you have found that bears on this part — exact values, and the paths of files you wrote for them to read. They cannot see your work, your tool output, or the call.")})},j={name:e.TOOL_NAMES.ask_back,description:"Ask the bot that handed you this part. They answer from what they have — the original request, the call it came from, what they found before asking you.",parameters:d.object({question:d.string().describe("One whole question — what you need and why. They cannot take it to the user for you, so ask what they would know.")})},k={name:e.TOOL_NAMES.ask_thursday,description:"Ask Thursday, who handed you this job. The job stops until an answer comes back.",parameters:d.object({question:d.string().describe("One whole question — what you need and why. One or two sentences, in the user's language: she may read it to them out loud, options and all."),options:d.union([d.string().array(),d.string()]).nullable().describe('Only when there really are choices — two or three, each short, as an array: ["Signed in", "Not yet"]. Null for an open question.')})},l={name:e.TOOL_NAMES.report,description:"Hand back what the job produced. Calling this ends the job — nothing after it runs.",parameters:d.object({result:d.string().describe("The result itself, in a few lines — what you found or did, not a replay of how. Thursday reads this out loud, so write what a person needs to hear. If you could not do it, say what stopped you."),complete:d.boolean().describe("True when the whole request is done. False when work is left over — the user is then asked whether to keep going, and `result` is what they decide on.")})},m={name:e.TOOL_NAMES.task,description:"Check a job you handed over, answer what it is asking, or cancel it.",parameters:d.object({action:d.enum(["status","answer","cancel"]),task:d.string().nullable().describe("The job, by its label or by the handle a past call's transcript carries. With `status`: null for every job in one line each — that is the list — or name one to get its report in full."),answer:d.string().nullable().describe("With `answer`: what to tell the bot — the answer to its question, a course correction for a job still running, or what to do next on one that finished.")})},n=(0,c.tool)({description:k.description,inputSchema:k.parameters}),o=(0,c.tool)({description:l.description,inputSchema:l.parameters,execute:async({result:a,complete:b})=>{let c=await q(a);return c.length?`${p} these files do not exist — ${c.join(", ")}. Write them first, or take the paths out of the result.`:b?"Handed back. The job is closed; nothing further runs.":"Handed back as unfinished. The user decides whether to continue."}}),p="Not handed back:";async function q(a){let c=[];for(let d of(0,f.pathsIn)(a)){let a=await (0,g.insideWorkspace)(d);a&&(await (0,b.stat)(a).then(a=>a.isFile(),()=>!1)||c.push(d))}return c}a.s(["askBackSpec",0,j,"askBotSpec",0,i,"askThursdayTool",0,n,"delegateSpec",0,h,"reportAccepted",0,a=>"string"!=typeof a||!a.startsWith(p),"reportTool",0,o,"taskSpec",0,m])},762008,a=>{"use strict";a.s(["STUDIO_TOOLS",0,{generate_image:"generate_image",generate_speech:"generate_speech",transcribe:"transcribe",generate_video:"generate_video"},"TOOL_NAMES",0,{memory_recall:"memory_recall",memory_remember:"memory_remember",memory_forget:"memory_forget",memory_show:"memory_show",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",delegate:"delegate",task:"task",ask_bot:"ask_bot",ask_thursday:"ask_thursday",ask_back:"ask_back",report:"report",end_call:"end_call",tidy_done:"tidy_done"}])},84929,a=>a.a(async(b,c)=>{try{var d=a.i(93321),e=a.i(530385),f=a.i(258261),g=a.i(351674),h=a.i(203469),i=a.i(184838),j=a.i(714428),k=a.i(978876),l=a.i(762008),m=a.i(182248),n=a.i(446957),o=b([i]);[i]=o.then?(await o)():o;let L=()=>h.appEvents.emit({type:"tasks"}),M={id:j.taskTable.id,bot:j.taskTable.bot,label:j.taskTable.label,request:j.taskTable.request,status:j.taskTable.status,outcome:j.taskTable.outcome,pending:j.taskTable.pending,reported:j.taskTable.reported,inputTokens:j.taskTable.inputTokens,outputTokens:j.taskTable.outputTokens,contextTokens:j.taskTable.contextTokens,contextBudget:j.taskTable.contextBudget,createdAt:j.taskTable.createdAt,updatedAt:j.taskTable.updatedAt};async function p(a){let{opening:b,...c}=a,[d]=await i.database.insert(j.taskTable).values({id:crypto.randomUUID(),status:"running",...c}).returning();return await A(d.id,0,{bot:null,parent:null,role:"user",content:b}),L(),d}async function q(a,b){await i.database.update(j.taskTable).set({...b,updatedAt:new Date}).where((0,d.eq)(j.taskTable.id,a)),L()}async function r(a){0!==a.length&&(await i.database.update(j.taskTable).set({reported:!0}).where((0,d.inArray)(j.taskTable.id,a)),L())}async function s(a,b,c=null){(b.input||b.output||null!==c)&&(await i.database.update(j.taskTable).set({inputTokens:g.sql`${j.taskTable.inputTokens} + ${b.input}`,outputTokens:g.sql`${j.taskTable.outputTokens} + ${b.output}`,...null===c?{}:{contextTokens:c.tokens,contextBudget:c.budget}}).where((0,d.eq)(j.taskTable.id,a)),L())}async function t(a){let[b]=await i.database.select().from(j.taskTable).where((0,d.eq)(j.taskTable.id,a));return b??null}async function u(a={}){let b=await i.database.select(M).from(j.taskTable).where(a.before?(0,d.lt)(j.taskTable.updatedAt,a.before):void 0).orderBy((0,e.desc)(j.taskTable.updatedAt)).limit(a.limit??n.TASK_HISTORY_PAGE);return E(b)}async function v(a){return a.length?await i.database.select({id:j.taskTable.id,callId:j.taskTable.callId,label:j.taskTable.label,status:j.taskTable.status,outcome:j.taskTable.outcome}).from(j.taskTable).where((0,d.inArray)(j.taskTable.callId,a)).orderBy(j.taskTable.createdAt):[]}async function w(a){let b=await i.database.delete(j.taskTable).where((0,d.eq)(j.taskTable.id,a)).returning({id:j.taskTable.id});return b.length&&L(),b.length>0}async function x(){let a=await i.database.delete(j.taskTable).where((0,d.inArray)(j.taskTable.status,["done","failed"])).returning({id:j.taskTable.id});return a.length&&L(),a.length}async function y(){return(await i.database.select({id:j.taskTable.id}).from(j.taskTable).orderBy((0,e.desc)(j.taskTable.createdAt))).map(a=>a.id)}async function z(a){let b=a.trim();if(!b)return null;let c=await t(b);if(c)return c;let d=b.toLowerCase();return(await i.database.select().from(j.taskTable).orderBy((0,e.desc)(j.taskTable.updatedAt)).limit(20)).find(a=>a.label.toLowerCase()===d)??null}async function A(a,b,c){await i.database.insert(j.taskMessageTable).values({taskId:a,seq:b,...c,compact:c.compact??!1}).onConflictDoUpdate({target:[j.taskMessageTable.taskId,j.taskMessageTable.seq],set:{role:c.role,content:c.content,compact:c.compact??!1}}),L()}async function B(a,b){b.length&&(await i.database.delete(j.taskMessageTable).where((0,d.and)((0,d.eq)(j.taskMessageTable.taskId,a),(0,d.inArray)(j.taskMessageTable.seq,b))),L())}async function C(a){let[b]=await i.database.select({seq:(0,f.max)(j.taskMessageTable.seq)}).from(j.taskMessageTable).where((0,d.eq)(j.taskMessageTable.taskId,a));return b?.seq??-1}async function D(a){let b=await i.database.select({role:j.taskMessageTable.role,content:j.taskMessageTable.content,compact:j.taskMessageTable.compact}).from(j.taskMessageTable).where((0,d.and)((0,d.eq)(j.taskMessageTable.taskId,a),(0,d.isNull)(j.taskMessageTable.parent))).orderBy(j.taskMessageTable.seq),c=b.findLastIndex(a=>a.compact);return b.slice(Math.max(c,0)).map(a=>({role:a.role,content:a.content}))}async function E(a){if(0===a.length)return[];let b=await i.database.select().from(j.taskMessageTable).where((0,d.inArray)(j.taskMessageTable.taskId,a.map(a=>a.id))).orderBy(j.taskMessageTable.seq),c=new Map(a.map(a=>[a.id,a.bot])),e=new Map;for(let a of b){let b=e.get(a.taskId)??[];b.push(...function(a,b){let c={seq:a.seq,bot:a.bot,parent:a.parent,at:a.createdAt},d=b=>`${a.id}-${b}`,e=a.content;if("user"===a.role){if(0===a.seq)return[];let b="string"==typeof e?e:e.flatMap(a=>"text"===a.type&&a.text?[a.text]:[]).join("\n").trim();return b?a.compact?[{...c,id:d(0),kind:"note",text:b}]:[{...c,id:d(0),kind:"user",text:b}]:[]}if("assistant"===a.role){let e=a.content;if("string"==typeof e)return e.trim()?[{...c,id:d(0),kind:"text",text:e.trim()}]:[];let f=[];return e.forEach((a,e)=>{if("text"===a.type){let b=a.text.trim();b&&f.push({...c,id:d(e),kind:"text",text:b});return}if("tool-result"===a.type)return void f.push(H(c,d(e),a));if("tool-call"!==a.type)return;let g=a.input??{};if(a.toolName===l.TOOL_NAMES.ask_thursday)f.push({...c,id:d(e),kind:"waiting",callId:a.toolCallId,question:String(g.question??""),options:I(g.options)});else if(a.toolName===l.TOOL_NAMES.report){let a=String(g.result??"").trim();a&&f.push({...c,id:d(e),kind:"text",text:a})}else a.toolName===l.TOOL_NAMES.ask_bot?f.push({...c,id:d(e),kind:"ask",callId:a.toolCallId,to:String(g.bot??""),text:String(g.request??"")}):a.toolName===l.TOOL_NAMES.ask_back?f.push({...c,id:d(e),kind:"ask",callId:a.toolCallId,to:b,text:String(g.question??"")}):a.toolName===l.TOOL_NAMES.bash?f.push({...c,id:d(e),kind:"tool",callId:a.toolCallId,name:a.toolName,input:(0,m.clip)(String(g.command??""),120),note:F(g)}):f.push({...c,id:d(e),kind:"tool",callId:a.toolCallId,name:a.toolName,input:G(a.toolName,g),note:F(g),path:a.toolName===l.TOOL_NAMES.write_file?O(g,"path")??null:null})}),f}if("tool"===a.role){let b=[];return a.content.forEach((a,e)=>{if("tool-result"===a.type&&!(a.toolName===l.TOOL_NAMES.report&&(0,k.reportAccepted)(a.output)))if(a.toolName===l.TOOL_NAMES.ask_thursday){let f=J(a.output,4).flatMap(a=>"text"===a.type?[a.text]:[]).join("\n");b.push({...c,id:d(e),kind:"user",text:f})}else if(a.toolName===l.TOOL_NAMES.ask_bot||a.toolName===l.TOOL_NAMES.ask_back){let f=J(a.output,4).flatMap(a=>"text"===a.type?[a.text]:[]).join("\n");b.push({...c,id:d(e),kind:"ask-result",callId:a.toolCallId,text:f})}else b.push(H(c,d(e),a))}),b}return[]}(a,c.get(a.taskId)??"")),e.set(a.taskId,b)}return a.map(a=>(function(a,b){let{pending:c,inputTokens:d,outputTokens:e,...f}=a;return{...f,ask:"waiting"===a.status?{question:a.outcome??"",options:c?.options??[]}:null,tokens:{input:d,output:e},lines:b}})(a,e.get(a.id)??[]))}let N=["query","command","prompt","url","path","pattern","request","question","title","name","task","text"],O=(a,b)=>{let c=a[b];return"string"==typeof c&&c.trim()?c:null};function F(a){let b=O(a,"description");return b?(0,m.clip)(b,120):null}function G(a,b){let c=b??{};if("object"!=typeof c||Array.isArray(c))return(0,m.clip)(String(b??""),120);if(a===l.TOOL_NAMES.bash)return F(c)??(0,m.clip)(String(c.command??""),120);if(a===l.TOOL_NAMES.tool_call||a===l.TOOL_NAMES.tool_search){let a=Array.isArray(c.tools)?c.tools.map(String).join(", "):String(c.tool??""),b=c.args&&"object"==typeof c.args?JSON.stringify(c.args):"";return(0,m.clip)([String(c.server??""),a,b].filter(Boolean).join(" "),120)}for(let a of N){let b=O(c,a);if(b)return(0,m.clip)(b,120)}for(let a of Object.keys(c)){let b=O(c,a);if(b)return(0,m.clip)(b,120)}return Object.keys(c).length?(0,m.clip)(JSON.stringify(c),120):""}function H(a,b,c){let d=J(c.output,5);return{...a,id:b,kind:"tool-result",callId:c.toolCallId,name:c.toolName,results:d.slice(0,4),more:d.length>4}}function I(a){return Array.isArray(a)?a.map(a=>String(a).trim()).filter(Boolean):[]}function J(a,b){if(null==a)return[];if("string"==typeof a)return K(a,b);if("object"!=typeof a)return K(String(a),b);switch(a.type){case"text":case"error-text":return K(String(a.value??""),b);case"json":case"error-json":return J(a.value,b);case"execution-denied":return K("Denied.",b);case"content":{if(!Array.isArray(a.value))return[];let c=[];for(let d of a.value){if("text"===d.type&&"string"==typeof d.text){c.push(...K(d.text,b));continue}let a=function(a){let b=String(a.mediaType??"");if(!b.startsWith("image/"))return null;let c=a.data;return"string"==typeof c?`data:${b};base64,${c}`:c?.type==="url"&&c.url?c.url:c?.type==="data"&&"string"==typeof c.data?`data:${b};base64,${c.data}`:null}(d);a&&c.push({type:"image",src:a})}return c}}return Array.isArray(a.sources)?a.sources.map(a=>String(a?.title??"")).filter(Boolean).slice(0,b).map(a=>({type:"text",text:a})):"string"==typeof a.stdout?K(a.stdout||String(a.stderr??""),b):"string"==typeof a.answer?K(a.answer,b):K(JSON.stringify(a),b)}function K(a,b){return a.split("\n").map(a=>a.trim()).filter(Boolean).slice(0,b).map(a=>({type:"text",text:a}))}a.s(["addTaskUsage",0,s,"deleteFinishedTasks",0,x,"deleteMessages",0,B,"deleteTask",0,w,"findTask",0,t,"insertTask",0,p,"lastSeq",0,C,"listAllTaskIds",0,y,"listCallJobs",0,v,"listTaskHistory",0,u,"listThread",0,D,"markReported",0,r,"optionsOf",0,I,"resolveTask",0,z,"toolLine",0,G,"updateTask",0,q,"upsertMessage",0,A]),c()}catch(a){c(a)}},!1),527990,925034,912735,a=>{"use strict";var b,c,d,e,f,g=a.i(652685),h=a.i(634531),i=a.i(22372);class j extends Error{constructor(a,b){super(a),this.name="ParseError",this.type=b.type,this.field=b.field,this.value=b.value,this.line=b.line}}function k(a){}function l(a,b,c){return 100===c&&97===a.charCodeAt(b+1)&&116===a.charCodeAt(b+2)&&97===a.charCodeAt(b+3)&&58===a.charCodeAt(b+4)}function m(a,b,c){return 101===c&&118===a.charCodeAt(b+1)&&101===a.charCodeAt(b+2)&&110===a.charCodeAt(b+3)&&116===a.charCodeAt(b+4)&&58===a.charCodeAt(b+5)}class n extends TransformStream{constructor({onError:a,onRetry:b,onComment:c,maxBufferSize:d}={}){let e;super({start(f){e=function(a){if("function"==typeof a)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:b=k,onError:c=k,onRetry:d=k,onComment:e,maxBufferSize:f}=a,g=[],h=0,i=!0,n,o="",p=0,q,r=!1;function s(){void 0!==f&&(h+o.length<=f||(r=!0,g.length=0,h=0,n=void 0,o="",p=0,q=void 0,c(new j(`Buffered data exceeded max buffer size of ${f} characters`,{type:"max-buffer-size-exceeded"}))))}function t(a){let c=0;if(-1===a.indexOf("\r")){let d=a.indexOf(`
|
|
3
|
+
`),p=a=>{let c=b.coalesce?.keyOf(a)??null;if(null===c)return o(a);let d=l.get(c);d&&clearTimeout(d),l.set(c,setTimeout(()=>{l.delete(c),o(a)},b.coalesce?.ms))},q=a.subscribe(a=>m?m.push(a):p(a)),r=setInterval(()=>n(": ping\n\n"),d);e+=1,b.onWatchers?.(e),h=()=>{if(!k){for(let a of(k=!0,e-=1,b.onWatchers?.(e),q(),clearInterval(r),l.values()))clearTimeout(a);try{i.close()}catch{}}},f.addEventListener("abort",h);try{for(let a of await g?.()??[])o(a)}catch(a){j.logger.error("event stream opening failed",a),h();return}let s=m;for(let a of(m=null,s))p(a)},cancel(){h()}}),{headers:{"Content-Type":"text/event-stream; charset=utf-8","Cache-Control":"no-store","X-Accel-Buffering":"no"}})},get watchers(){return e}}}(m,{coalesce:{ms:150,keyOf:a=>a.type in k?a.type:null},onWatchers:n.track});l.__bootId??=crypto.randomUUID(),a.s(["appEventStream",0,o,"appEvents",0,m],203469)},978876,a=>{"use strict";var b=a.i(912714),c=a.i(527990),d=a.i(794219),e=a.i(762008),f=a.i(684321),g=a.i(821415);let h={name:e.TOOL_NAMES.delegate,description:"Hand a job to a bot. Returns immediately; the job runs in the background and its result is put in front of you later.",parameters:d.object({bot:d.string().describe("A name from the bot list."),request:d.string().describe("The whole job. The bot cannot hear the call, so everything it needs goes here — names, paths, what the user actually asked for — in their own language and their own words: it is the only language the bot has, and whatever it writes comes back to them. **Their request, never your reading of it**: a condition, a caution or a smaller goal they did not say is how a job comes back as the wrong thing. When their words leave a real choice open, ask them on the call and put the answer here."),label:d.string().describe("Two or three words naming the job, in the user's language. Used on screen and said out loud.")})},i={name:e.TOOL_NAMES.ask_bot,description:"Hand one part of the job you are holding to another bot and wait for what they bring back. The job stays yours.",parameters:d.object({bot:d.string().describe("A name from the bot list."),request:d.string().describe("The part they take, as a brief: the outcome you want, the shape to hand it back in (a path, a number, a list), and every name, path, number and limit that bears on it. They see nothing but this and `context` — not the call, not your thread — so write it long rather than short; a brief that leaves them guessing costs a whole run."),context:d.string().describe("The job you were given, quoted, and whatever you have found that bears on this part — exact values, and the paths of files you wrote for them to read. They cannot see your work, your tool output, or the call.")})},j={name:e.TOOL_NAMES.ask_back,description:"Ask the bot that handed you this part. They answer from what they have — the original request, the call it came from, what they found before asking you.",parameters:d.object({question:d.string().describe("One whole question — what you need and why. They cannot take it to the user for you, so ask what they would know.")})},k={name:e.TOOL_NAMES.ask_thursday,description:"Ask Thursday, who handed you this job. The job stops until an answer comes back.",parameters:d.object({question:d.string().describe("One whole question — what you need and why. One or two sentences, in the user's language: she may read it to them out loud, options and all."),options:d.union([d.string().array(),d.string()]).nullish().describe('Only when there really are choices — two or three, each short, as an array: ["Signed in", "Not yet"]. Null for an open question.')})},l=d.string().nullish().describe("What should change in your own instructions before your next job here — something to add, something wrong to correct, something to drop. Your own words, any length; someone else writes it in. Nothing to say is the usual answer, and leaving it out costs nothing: they already say what they say."),m={name:e.TOOL_NAMES.task,description:"Check a job you handed over, answer what it is asking, or cancel it.",parameters:d.object({action:d.enum(["status","answer","cancel"]),task:d.string().nullish().describe("The job, by its label or by the handle a past call's transcript carries. With `status`: null for every job in one line each — that is the list — or name one to get its report in full."),answer:d.string().nullish().describe("With `answer`: what to tell the bot — the answer to its question, a course correction for a job still running, or what to do next on one that finished.")})},n=(0,c.tool)({description:k.description,inputSchema:k.parameters}),o="Not handed back:";async function p(a){let c=[];for(let d of(0,f.pathsIn)(a)){let a=await (0,g.insideWorkspace)(d);a&&(await (0,b.stat)(a).then(a=>a.isFile(),()=>!1)||c.push(d))}return c}a.s(["askBackSpec",0,j,"askBotSpec",0,i,"askThursdayTool",0,n,"createReportTool",0,a=>{let b={name:e.TOOL_NAMES.report,description:"Hand back what the job produced. Calling this ends the job — nothing after it runs.",parameters:d.object({result:d.string().describe("The result itself, in a few lines — what you found or did, not a replay of how. Thursday reads this out loud, so write what a person needs to hear. If you could not do it, say what stopped you."),complete:d.boolean().describe("True when the whole request is done. False when work is left over — the user is then asked whether to keep going, and `result` is what they decide on."),...a?{notes:l}:{}})};return(0,c.tool)({description:b.description,inputSchema:b.parameters,execute:async({result:a,complete:b})=>{let c=await p(a);return c.length?`${o} these files do not exist — ${c.join(", ")}. Write them first, or take the paths out of the result.`:b?"Handed back. The job is closed; nothing further runs.":"Handed back as unfinished. The user decides whether to continue."}})},"delegateSpec",0,h,"reportAccepted",0,a=>"string"!=typeof a||!a.startsWith(o),"taskSpec",0,m])},762008,a=>{"use strict";a.s(["STUDIO_TOOLS",0,{generate_image:"generate_image",generate_speech:"generate_speech",transcribe:"transcribe",generate_video:"generate_video"},"TOOL_NAMES",0,{memory_recall:"memory_recall",memory_remember:"memory_remember",memory_forget:"memory_forget",memory_show:"memory_show",bash:"bash",write_file:"write_file",tool_search:"tool_search",tool_call:"tool_call",load_skill:"load_skill",web_search:"web_search",delegate:"delegate",task:"task",ask_bot:"ask_bot",ask_thursday:"ask_thursday",ask_back:"ask_back",report:"report",end_call:"end_call",tidy_done:"tidy_done",update_notes:"update_notes"}])},84929,a=>a.a(async(b,c)=>{try{var d=a.i(93321),e=a.i(530385),f=a.i(258261),g=a.i(351674),h=a.i(203469),i=a.i(184838),j=a.i(714428),k=a.i(978876),l=a.i(762008),m=a.i(182248),n=a.i(446957),o=b([i]);[i]=o.then?(await o)():o;let L=()=>h.appEvents.emit({type:"tasks"}),M={id:j.taskTable.id,bot:j.taskTable.bot,label:j.taskTable.label,request:j.taskTable.request,status:j.taskTable.status,outcome:j.taskTable.outcome,pending:j.taskTable.pending,reported:j.taskTable.reported,inputTokens:j.taskTable.inputTokens,outputTokens:j.taskTable.outputTokens,contextTokens:j.taskTable.contextTokens,contextBudget:j.taskTable.contextBudget,createdAt:j.taskTable.createdAt,updatedAt:j.taskTable.updatedAt};async function p(a){let{opening:b,...c}=a,[d]=await i.database.insert(j.taskTable).values({id:crypto.randomUUID(),status:"running",...c}).returning();return await A(d.id,0,{bot:null,parent:null,role:"user",content:b}),L(),d}async function q(a,b){await i.database.update(j.taskTable).set({...b,updatedAt:new Date}).where((0,d.eq)(j.taskTable.id,a)),L()}async function r(a){0!==a.length&&(await i.database.update(j.taskTable).set({reported:!0}).where((0,d.inArray)(j.taskTable.id,a)),L())}async function s(a,b,c=null){(b.input||b.output||null!==c)&&(await i.database.update(j.taskTable).set({inputTokens:g.sql`${j.taskTable.inputTokens} + ${b.input}`,outputTokens:g.sql`${j.taskTable.outputTokens} + ${b.output}`,...null===c?{}:{contextTokens:c.tokens,contextBudget:c.budget}}).where((0,d.eq)(j.taskTable.id,a)),L())}async function t(a){let[b]=await i.database.select().from(j.taskTable).where((0,d.eq)(j.taskTable.id,a));return b??null}async function u(a={}){let b=await i.database.select(M).from(j.taskTable).where(a.before?(0,d.lt)(j.taskTable.updatedAt,a.before):void 0).orderBy((0,e.desc)(j.taskTable.updatedAt)).limit(a.limit??n.TASK_HISTORY_PAGE);return E(b)}async function v(a){return a.length?await i.database.select({id:j.taskTable.id,callId:j.taskTable.callId,label:j.taskTable.label,status:j.taskTable.status,outcome:j.taskTable.outcome}).from(j.taskTable).where((0,d.inArray)(j.taskTable.callId,a)).orderBy(j.taskTable.createdAt):[]}async function w(a){let b=await i.database.delete(j.taskTable).where((0,d.eq)(j.taskTable.id,a)).returning({id:j.taskTable.id});return b.length&&L(),b.length>0}async function x(){let a=await i.database.delete(j.taskTable).where((0,d.inArray)(j.taskTable.status,["done","failed"])).returning({id:j.taskTable.id,label:j.taskTable.label});return a.length&&L(),a}async function y(){return(await i.database.select({id:j.taskTable.id}).from(j.taskTable).orderBy((0,e.desc)(j.taskTable.createdAt))).map(a=>a.id)}async function z(a){let b=a.trim();if(!b)return null;let c=await t(b);if(c)return c;let d=b.toLowerCase();return(await i.database.select().from(j.taskTable).orderBy((0,e.desc)(j.taskTable.updatedAt)).limit(20)).find(a=>a.label.toLowerCase()===d)??null}async function A(a,b,c){await i.database.insert(j.taskMessageTable).values({taskId:a,seq:b,...c,compact:c.compact??!1,note:c.note??!1}).onConflictDoUpdate({target:[j.taskMessageTable.taskId,j.taskMessageTable.seq],set:{role:c.role,content:c.content,compact:c.compact??!1,note:c.note??!1}}),L()}async function B(a,b){b.length&&(await i.database.delete(j.taskMessageTable).where((0,d.and)((0,d.eq)(j.taskMessageTable.taskId,a),(0,d.inArray)(j.taskMessageTable.seq,b))),L())}async function C(a){let[b]=await i.database.select({seq:(0,f.max)(j.taskMessageTable.seq)}).from(j.taskMessageTable).where((0,d.eq)(j.taskMessageTable.taskId,a));return b?.seq??-1}async function D(a){let b=await i.database.select({role:j.taskMessageTable.role,content:j.taskMessageTable.content,compact:j.taskMessageTable.compact}).from(j.taskMessageTable).where((0,d.and)((0,d.eq)(j.taskMessageTable.taskId,a),(0,d.isNull)(j.taskMessageTable.parent))).orderBy(j.taskMessageTable.seq),c=b.findLastIndex(a=>a.compact);return b.slice(Math.max(c,0)).map(a=>({role:a.role,content:a.content}))}async function E(a){if(0===a.length)return[];let b=await i.database.select().from(j.taskMessageTable).where((0,d.inArray)(j.taskMessageTable.taskId,a.map(a=>a.id))).orderBy(j.taskMessageTable.seq),c=new Map(a.map(a=>[a.id,a.bot])),e=new Map;for(let a of b){let b=e.get(a.taskId)??[];b.push(...function(a,b){let c={seq:a.seq,bot:a.bot,parent:a.parent,at:a.createdAt},d=b=>`${a.id}-${b}`,e=a.content;if("user"===a.role){if(0===a.seq)return[];let b="string"==typeof e?e:e.flatMap(a=>"text"===a.type&&a.text?[a.text]:[]).join("\n").trim();return b?a.note||a.compact?[{...c,id:d(0),kind:"note",text:b}]:[{...c,id:d(0),kind:"user",text:b}]:[]}if("assistant"===a.role){let e=a.content;if("string"==typeof e)return e.trim()?[{...c,id:d(0),kind:"text",text:e.trim()}]:[];let f=[];return e.forEach((a,e)=>{if("text"===a.type){let b=a.text.trim();b&&f.push({...c,id:d(e),kind:"text",text:b});return}if("tool-result"===a.type)return void f.push(H(c,d(e),a));if("tool-call"!==a.type)return;let g=a.input??{};if(a.toolName===l.TOOL_NAMES.ask_thursday)f.push({...c,id:d(e),kind:"waiting",callId:a.toolCallId,question:String(g.question??""),options:I(g.options)});else if(a.toolName===l.TOOL_NAMES.report){let a=String(g.result??"").trim();a&&f.push({...c,id:d(e),kind:"text",text:a})}else a.toolName===l.TOOL_NAMES.ask_bot?f.push({...c,id:d(e),kind:"ask",callId:a.toolCallId,to:String(g.bot??""),text:String(g.request??"")}):a.toolName===l.TOOL_NAMES.ask_back?f.push({...c,id:d(e),kind:"ask",callId:a.toolCallId,to:b,text:String(g.question??"")}):a.toolName===l.TOOL_NAMES.bash?f.push({...c,id:d(e),kind:"tool",callId:a.toolCallId,name:a.toolName,input:(0,m.clip)(String(g.command??""),120),note:F(g)}):f.push({...c,id:d(e),kind:"tool",callId:a.toolCallId,name:a.toolName,input:G(a.toolName,g),note:F(g),path:a.toolName===l.TOOL_NAMES.write_file?O(g,"path")??null:null})}),f}if("tool"===a.role){let b=[];return a.content.forEach((a,e)=>{if("tool-result"===a.type&&!(a.toolName===l.TOOL_NAMES.report&&(0,k.reportAccepted)(a.output)))if(a.toolName===l.TOOL_NAMES.ask_thursday){let f=J(a.output,4).flatMap(a=>"text"===a.type?[a.text]:[]).join("\n");b.push({...c,id:d(e),kind:"user",text:f})}else if(a.toolName===l.TOOL_NAMES.ask_bot||a.toolName===l.TOOL_NAMES.ask_back){let f=J(a.output,4).flatMap(a=>"text"===a.type?[a.text]:[]).join("\n");b.push({...c,id:d(e),kind:"ask-result",callId:a.toolCallId,text:f})}else b.push(H(c,d(e),a))}),b}return[]}(a,c.get(a.taskId)??"")),e.set(a.taskId,b)}return a.map(a=>(function(a,b){let{pending:c,inputTokens:d,outputTokens:e,...f}=a;return{...f,ask:"waiting"===a.status?{question:a.outcome??"",options:c?.options??[]}:null,tokens:{input:d,output:e},lines:b}})(a,e.get(a.id)??[]))}let N=["query","command","prompt","url","path","pattern","request","question","title","name","task","text"],O=(a,b)=>{let c=a[b];return"string"==typeof c&&c.trim()?c:null};function F(a){let b=O(a,"description");return b?(0,m.clip)(b,120):null}function G(a,b){let c=b??{};if("object"!=typeof c||Array.isArray(c))return(0,m.clip)(String(b??""),120);if(a===l.TOOL_NAMES.bash)return F(c)??(0,m.clip)(String(c.command??""),120);if(a===l.TOOL_NAMES.tool_call||a===l.TOOL_NAMES.tool_search){let a=Array.isArray(c.tools)?c.tools.map(String).join(", "):String(c.tool??""),b=c.args&&"object"==typeof c.args?JSON.stringify(c.args):"";return(0,m.clip)([String(c.server??""),a,b].filter(Boolean).join(" "),120)}for(let a of N){let b=O(c,a);if(b)return(0,m.clip)(b,120)}for(let a of Object.keys(c)){let b=O(c,a);if(b)return(0,m.clip)(b,120)}return Object.keys(c).length?(0,m.clip)(JSON.stringify(c),120):""}function H(a,b,c){let d=J(c.output,5);return{...a,id:b,kind:"tool-result",callId:c.toolCallId,name:c.toolName,results:d.slice(0,4),more:d.length>4}}function I(a){return Array.isArray(a)?a.map(a=>String(a).trim()).filter(Boolean):[]}function J(a,b){if(null==a)return[];if("string"==typeof a)return K(a,b);if("object"!=typeof a)return K(String(a),b);switch(a.type){case"text":case"error-text":return K(String(a.value??""),b);case"json":case"error-json":return J(a.value,b);case"execution-denied":return K("Denied.",b);case"content":{if(!Array.isArray(a.value))return[];let c=[];for(let d of a.value){if("text"===d.type&&"string"==typeof d.text){c.push(...K(d.text,b));continue}let a=function(a){let b=String(a.mediaType??"");if(!b.startsWith("image/"))return null;let c=a.data;return"string"==typeof c?`data:${b};base64,${c}`:c?.type==="url"&&c.url?c.url:c?.type==="data"&&"string"==typeof c.data?`data:${b};base64,${c.data}`:null}(d);a&&c.push({type:"image",src:a})}return c}}return Array.isArray(a.sources)?a.sources.map(a=>String(a?.title??"")).filter(Boolean).slice(0,b).map(a=>({type:"text",text:a})):"string"==typeof a.stdout?K(a.stdout||String(a.stderr??""),b):"string"==typeof a.answer?K(a.answer,b):K(JSON.stringify(a),b)}function K(a,b){return a.split("\n").map(a=>a.trim()).filter(Boolean).slice(0,b).map(a=>({type:"text",text:a}))}a.s(["addTaskUsage",0,s,"deleteFinishedTasks",0,x,"deleteMessages",0,B,"deleteTask",0,w,"findTask",0,t,"insertTask",0,p,"lastSeq",0,C,"listAllTaskIds",0,y,"listCallJobs",0,v,"listTaskHistory",0,u,"listThread",0,D,"markReported",0,r,"optionsOf",0,I,"resolveTask",0,z,"toolLine",0,G,"updateTask",0,q,"upsertMessage",0,A]),c()}catch(a){c(a)}},!1),527990,925034,912735,a=>{"use strict";var b,c,d,e,f,g=a.i(652685),h=a.i(634531),i=a.i(22372);class j extends Error{constructor(a,b){super(a),this.name="ParseError",this.type=b.type,this.field=b.field,this.value=b.value,this.line=b.line}}function k(a){}function l(a,b,c){return 100===c&&97===a.charCodeAt(b+1)&&116===a.charCodeAt(b+2)&&97===a.charCodeAt(b+3)&&58===a.charCodeAt(b+4)}function m(a,b,c){return 101===c&&118===a.charCodeAt(b+1)&&101===a.charCodeAt(b+2)&&110===a.charCodeAt(b+3)&&116===a.charCodeAt(b+4)&&58===a.charCodeAt(b+5)}class n extends TransformStream{constructor({onError:a,onRetry:b,onComment:c,maxBufferSize:d}={}){let e;super({start(f){e=function(a){if("function"==typeof a)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:b=k,onError:c=k,onRetry:d=k,onComment:e,maxBufferSize:f}=a,g=[],h=0,i=!0,n,o="",p=0,q,r=!1;function s(){void 0!==f&&(h+o.length<=f||(r=!0,g.length=0,h=0,n=void 0,o="",p=0,q=void 0,c(new j(`Buffered data exceeded max buffer size of ${f} characters`,{type:"max-buffer-size-exceeded"}))))}function t(a){let c=0;if(-1===a.indexOf("\r")){let d=a.indexOf(`
|
|
4
4
|
`,c);for(;-1!==d;){if(c===d){p>0&&b({id:n,event:q,data:o}),n=void 0,o="",p=0,q=void 0,c=d+1,d=a.indexOf(`
|
|
5
5
|
`,c);continue}let e=a.charCodeAt(c);if(l(a,c,e)){let e=32===a.charCodeAt(c+5)?c+6:c+5,f=a.slice(e,d);if(0===p&&10===a.charCodeAt(d+1)){b({id:n,event:q,data:f}),n=void 0,o="",q=void 0,c=d+2,d=a.indexOf(`
|
|
6
6
|
`,c);continue}o=0===p?f:`${o}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[673701,a=>{"use strict";var b=a.i(187924),c=a.i(676459),d=a.i(926184),e=a.i(400187),f=a.i(497895);let g=(0,e.cva)("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});(0,e.cva)("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}}),a.s(["Bubble",0,function({variant:a="default",align:c="start",className:d,...e}){return(0,b.jsx)("div",{"data-slot":"bubble","data-variant":a,"data-align":c,className:(0,f.cn)(g({variant:a}),d),...e})},"BubbleContent",0,function({className:a,render:b,...e}){var g;return g={defaultTagName:"div",props:(0,c.mergeProps)({className:(0,f.cn)("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",a)},e),render:b,state:{slot:"bubble-content"}},(0,d.useRenderElement)(g.defaultTagName??"div",g,g)}],673701)},613350,a=>{"use strict";var b=a.i(187924),c=a.i(589027),d=a.i(572131),e=a.i(497895);a.s(["FoldedText",0,function({text:a,subject:f,clamp:g="line-clamp-3",tall:h="max-h-40",className:i}){let[j,k]=(0,d.useState)(!1),[l,m]=(0,d.useState)(!1),n=(0,d.useRef)(null);return(0,d.useEffect)(()=>k(!1),[a]),(0,d.useEffect)(()=>{let a=n.current;a&&!j&&m(a.scrollHeight>a.clientHeight+1)},[j,a]),(0,b.jsxs)("div",{className:(0,e.cn)("flex items-start gap-1",i),children:[(0,b.jsx)("p",{ref:n,className:(0,e.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep",j?(0,e.cn)(h,"overflow-y-auto scrollbar-none"):g),children:a}),(l||j)&&(0,b.jsx)("button",{type:"button",onClick:()=>k(a=>!a),"aria-label":j?`Fold the ${f}`:`Read the whole ${f}`,className:"shrink-0 rounded-md p-0.5 opacity-60 outline-none transition-opacity hover:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,b.jsx)(c.ChevronDown,{className:(0,e.cn)("size-3.5",j&&"rotate-180")})})]})}])},467268,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(327598),f=a.i(752562),g=a.i(707963),h=a.i(141146),i=a.i(231500),j=a.i(585650),k=a.i(425256),l=a.i(875160),m=a.i(403512),n=a.i(474215),o=a.i(572131),p=a.i(767561),q=a.i(673701),r=a.i(340695),s=a.i(613350),t=a.i(846991),u=a.i(545097),v=a.i(546893),w=a.i(864037),x=a.i(287702),y=a.i(366250),z=a.i(701073),A=a.i(411509),B=a.i(913834),C=a.i(42380),D=a.i(16716),E=a.i(394440),F=a.i(28996),G=a.i(346075),H=a.i(369768),I=a.i(199169),J=a.i(576271),K=a.i(313237),L=a.i(759497),M=a.i(497895),N=a.i(324835),O=a.i(777279),P=a.i(8468),Q=b([t,D,H,P]);[t,D,H,P]=Q.then?(await Q)():Q;let aq=(0,o.memo)(function(){let a=(0,O.useBotTasks)(),{data:b}=(0,L.useServerRoute)(p.queryKey.bot),[c,e]=(0,o.useState)(!1),[f,g]=(0,o.useState)(null),[h,i]=(0,o.useState)(!1),j=[...a].reverse(),k=f?j.find(a=>a.id===f)??null:null,[l,m]=function(){let[a,b]=(0,o.useState)(new Map),c=(0,o.useRef)(new Map);(0,o.useEffect)(()=>()=>{for(let a of c.current.values())clearTimeout(a)},[]);let d=(0,o.useCallback)(a=>{b(b=>new Map(b).set(a.at,a));let d=c.current.get(a.at);d&&clearTimeout(d),c.current.set(a.at,setTimeout(()=>{c.current.delete(a.at),b(b=>{let c=new Map(b);return c.delete(a.at),c})},3400))},[]);return[a,d]}(),{crew:n,more:q}=(0,o.useMemo)(()=>R(b,a),[b,a]),r=(0,o.useRef)(null),s=(0,o.useRef)(new Set);(0,o.useEffect)(()=>{if(!O.botTasks.primed())return;let b=new Map(j.map(a=>[a.id,a.status])),c=r.current;r.current=b;let d=new Set;for(let b of a)for(let a of b.lines)"ask"===a.kind&&a.to&&d.add(a.id);let e=s.current;if(s.current=d,!c)return;let f=new Map;for(let b of a)for(let a of b.lines){if("ask"!==a.kind||!a.to||e.has(a.id))continue;let b=f.get(a.bot.name)??[];b.push({from:a.bot,to:a.to,text:a.text}),f.set(a.bot.name,b)}for(let[a,b]of f){if(1===b.length){m({at:b[0].to.name,from:b[0].from,text:as(b[0].text)});continue}m({at:a,from:b[0].from,text:`sent ${b.length} parts out`})}for(let a of j)c.get(a.id)!==a.status&&"working"===a.status&&m(c.has(a.id)?{at:a.bot.name,from:null,text:"picked it back up"}:{at:a.bot.name,from:ay,text:`took on \u201c${as(a.label)}\u201d`})},[a,m]);let t=(0,o.useRef)(new Set);(0,o.useEffect)(()=>{if(!k||k.relayed||"done"!==k.status&&"failed"!==k.status)return;let a=`${k.id}@${(0,I.toDate)(k.updatedAt).getTime()}`;t.current.has(a)||(t.current.add(a),(0,y.markReportedAction)([k.id]).then(J.unwrapResult).then(()=>(0,L.revalidate)(p.queryKey.tasks)).catch(b=>{t.current.delete(a),w.toast.add({type:"error",title:"Could not mark the task as read",description:(0,M.errorToString)(b)})}))},[k]);let u=a.filter(a=>"working"===a.status).length,v=j.filter(at),x=v.length,z=(0,o.useCallback)(()=>i(!1),[]);return(0,d.jsx)("div",{className:"pointer-events-none absolute right-5 bottom-5 z-10 flex w-132 max-w-[calc(100vw-2.5rem)] flex-col items-end gap-2",children:c?(0,d.jsx)("div",{className:"pointer-events-auto flex max-h-[min(44rem,78vh)] w-full animate-in flex-col overflow-hidden rounded-3xl bg-background/75 shadow-2xl shadow-black/6 ring-1 ring-border/50 backdrop-blur-xl fade-in slide-in-from-bottom-1 duration-200",children:k?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)($,{task:k,onBack:()=>g(null),onClose:()=>e(!1)}),(0,d.jsx)(ag,{task:k,className:"min-h-0 flex-1"}),(0,d.jsx)(E.TaskReply,{task:{id:k.id,label:k.label,bot:k.bot.name,ask:function(a){if(!a.ask?.question)return a.ask;let b=a.lines.at(-1);return b&&(0,O.isOutcome)(b)&&b.text===a.ask.question?{...a.ask,question:""}:a.ask}(k)},status:"working"===k.status?"running":k.status,lines:k.lines,className:"mx-3 mb-2 shrink-0"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Z,{count:a.length,pending:x,composing:h,onCompose:()=>i(!0),onClose:()=>h?i(!1):e(!1)}),h?(0,d.jsx)(V,{bots:b,onDone:z}):j.length?(0,d.jsx)(ae,{tasks:j,onPick:g}):(0,d.jsx)(ac,{bots:b}),!h&&(0,d.jsx)(ad,{})]})}):(0,d.jsx)(S,{crew:n,more:q,bubbles:l,bots:b,rows:v,count:a.length,busy:u,pending:x,composing:h,onCompose:()=>i(!0),onCloseCompose:z,onPick:a=>{g(a),e(!0)},onOpen:()=>{f||1!==v.length||g(v[0].id),e(!0)}})})}),ar=new Map,as=a=>{let b=(0,M.plainText)(a).replace(/\s+/g," ").trim();return b.length>28?`${b.slice(0,27)}…`:b};function R(a,b){let c=new Map;for(let a of(0,O.latestPerBot)(b)){let{task:b,bot:d,line:e}=a;if("waiting"===b.status&&b.bot.name===d.name){c.set(d.name,{waiting:!0,word:null});continue}!("working"!==b.status||c.get(d.name)?.waiting)&&c.set(d.name,{waiting:!1,word:e?"tool"===e.kind&&e.tool?as(e.tool.note??`${e.tool.name} \xb7 ${e.tool.input}`):"say"===e.kind?as(e.text):null:null})}let d=new Map;for(let b of a??[])d.set(b.name,{name:b.name,icon:b.icon,awake:c.has(b.name),waiting:c.get(b.name)?.waiting??!1,word:c.get(b.name)?.word??null});for(let[a,b]of c)d.has(a)||d.set(a,{name:a,icon:null,awake:!0,waiting:b.waiting,word:b.word});let e=[...d.values()];if(!e.length)return{crew:au.slice(0,av),more:0};for(let a of au){if(e.length>=av)break;d.has(a.name)||e.push(a)}let f=a=>a.waiting?0:a.awake?1:a.standIn?3:2,g=e.map((a,b)=>({face:a,at:b})).sort((a,b)=>f(a.face)-f(b.face)||a.at-b.at).map(a=>a.face);return{crew:g.slice(0,10),more:Math.max(0,g.length-10)}}let at=a=>"waiting"===a.status;function S({crew:a,more:b,bubbles:c,bots:e,rows:g,count:h,busy:i,pending:j,composing:k,onCompose:m,onCloseCompose:o,onPick:p,onOpen:q}){let r=function({count:a,busy:b,pending:c}){return c>0?{text:1===c?"waiting on you":`${c} waiting on you`,tone:M.WAITING_INK,shine:!0}:b>0?{text:1===b?"working":`${b} running`,tone:"text-muted-foreground",shine:!1}:a>0?{text:"all done",tone:"text-muted-foreground",shine:!1}:{text:"no jobs yet",tone:"text-muted-foreground",shine:!1}}({count:h,busy:i,pending:j}),s=k||j>0;return(0,d.jsxs)("div",{className:(0,M.cn)("pointer-events-auto w-fit max-w-full bg-background/78 ring-1 ring-border/50 backdrop-blur-md transition-shadow duration-300",s?"min-w-96 rounded-3xl shadow-lg shadow-black/8":"rounded-full shadow-sm shadow-black/3"),children:[(0,d.jsx)("div",{className:(0,M.cn)("grid overflow-hidden transition-[grid-template-rows] duration-300 ease-out",s?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:(0,d.jsx)("div",{className:"min-h-0 overflow-hidden",inert:!s,children:k?(0,d.jsx)(V,{bots:e,onDone:o}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"flex items-center gap-2 px-3 py-2 font-mono text-[10px] tracking-wide text-muted-foreground",children:[(0,d.jsxs)("span",{className:"flex-1",children:["needs you · ",j]}),(0,d.jsx)(T,{onClick:m})]}),(0,d.jsx)("div",{className:"px-1.5 pb-2",children:g.map(a=>(0,d.jsx)(af,{task:a,onPick:()=>p(a.id)},a.id))}),(0,d.jsx)("span",{className:"block h-1.5"})]})})}),(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5",children:[(0,d.jsxs)("button",{type:"button",onClick:q,"aria-label":h?`Tasks (${h})`:"Bots",className:"flex min-w-0 flex-1 items-center gap-2 rounded-full text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(W,{crew:a,more:b,bubbles:c}),(0,d.jsxs)("span",{className:"ml-auto flex h-7 shrink-0 items-center gap-1.5",children:[r.shine?(0,d.jsx)("span",{className:"block [--rest:var(--color-amber-700)] [--shine:var(--color-amber-400)] dark:[--rest:var(--color-amber-400)] dark:[--shine:var(--color-amber-100)]",children:(0,d.jsx)(u.default,{text:r.text,speed:2.6,color:"var(--rest)",shineColor:"var(--shine)",className:"truncate text-[14px] leading-5 tracking-[-0.15px]"})}):(0,d.jsx)("span",{className:(0,M.cn)("block animate-in truncate text-[14px] leading-5 tracking-[-0.15px] fade-in duration-300",r.tone),children:r.text},r.text),(0,d.jsxs)("span",{className:"grid size-4 shrink-0 place-items-center",children:[0===j&&i>0&&(0,d.jsx)(l.Loader2,{className:"size-4 animate-spin text-muted-foreground/70"}),0===j&&0===i&&h>0&&(0,d.jsx)(f.Check,{className:"size-4 text-muted-foreground/60"})]})]})]}),k&&(0,d.jsx)(U,{onClick:o,label:"Cancel the message",children:(0,d.jsx)(n.X,{className:"size-3.5"})})]})]})}function T({onClick:a}){return(0,d.jsx)(U,{onClick:a,label:"Message a bot",children:(0,d.jsx)(m.Plus,{className:"size-4"})})}function U({onClick:a,label:b,children:c}){return(0,d.jsx)("button",{type:"button",onClick:a,"aria-label":b,className:"grid size-7 shrink-0 place-items-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:c})}function V({bots:a,onDone:b}){let[c,f]=(0,o.useState)(null),[i,j]=(0,o.useState)(""),[k,m]=(0,K.useServerAction)(z.startTaskAction,{onOk:()=>{(0,L.revalidate)(p.queryKey.tasks),b()}}),n=a?.length?a.map(a=>({name:a.name,icon:a.icon})):[{name:A.DEFAULT_BOT.name,icon:A.DEFAULT_BOT.icon}],q=()=>{c&&i.trim()&&!m&&k(c.name,i.trim())};return c?(0,d.jsxs)("div",{className:"flex min-h-32 flex-col pb-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-2",children:[(0,d.jsx)("button",{type:"button",onClick:()=>f(null),"aria-label":"Choose a different bot",className:"grid size-6 shrink-0 place-items-center rounded-lg text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(g.ChevronLeft,{className:"size-3.5"})}),(0,d.jsx)(B.BotMark,{size:22,seed:c.name,vary:c.name,color:c.icon?.color,shape:c.icon?.shape,outline:c.icon?.outline,className:"shrink-0"}),(0,d.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[12.5px] font-medium",children:["To ",c.name]})]}),(0,d.jsxs)("form",{onSubmit:a=>{a.preventDefault(),q()},className:"mx-3 mt-auto flex items-end gap-1 rounded-2xl bg-background py-2 pr-2 pl-3 ring-1 ring-border/80 transition-shadow focus-within:ring-ring/60",children:[(0,d.jsx)(v.Textarea,{value:i,rows:1,autoFocus:!0,disabled:m,onChange:a=>j(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||229===a.keyCode||(a.preventDefault(),q())},placeholder:`What should ${c.name} do? It cannot hear the call, so say the whole job.`,"aria-label":`Message for ${c.name}`,className:"max-h-32 min-h-15 flex-1 resize-none border-0 bg-transparent px-0 py-0 text-[13px] leading-5 shadow-none focus-visible:ring-0 dark:bg-transparent"}),(0,d.jsx)(r.Button,{type:"submit",size:"icon-sm",variant:i.trim()?"default":"ghost",disabled:!i.trim()||m,"aria-label":"Send",className:"rounded-full",children:m?(0,d.jsx)(l.Loader2,{className:"animate-spin"}):(0,d.jsx)(e.ArrowUp,{})})]})]}):(0,d.jsxs)("div",{className:"min-h-32 pb-3",children:[(0,d.jsx)("p",{className:"px-3 pt-3 pb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground",children:"message a bot"}),(0,d.jsx)("div",{className:"px-1",children:n.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>f(a),className:"flex w-full items-center gap-2.5 rounded-xl px-2 py-1.5 text-left outline-none transition-colors hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(B.BotMark,{size:22,seed:a.name,vary:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,className:"shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px]",children:a.name}),(0,d.jsx)(h.ChevronRight,{className:"size-3.5 shrink-0 text-muted-foreground/50"})]},a.name))})]})}let au=["alto","brio","cinder","delta"].map((a,b)=>({name:a,icon:{color:N.MARK_PALETTE[Math.floor(b*N.MARK_PALETTE.length/4)],shape:N.MARK_SHAPES[b%N.MARK_SHAPES.length]},awake:!1,waiting:!1,word:null,standIn:!0})),av=3;function W({crew:a,more:b,bubbles:c}){return(0,d.jsxs)("span",{className:"flex min-w-0 shrink items-center",children:[a.map((b,e)=>{let f=c.get(b.name)??null;return(0,d.jsxs)(o.Fragment,{children:[(0,d.jsxs)("span",{className:(0,M.cn)("relative shrink-0 transition-[margin,transform] duration-500 ease-out",e>0&&!a[e-1].word&&"-ml-2",b.standIn&&"opacity-35",b.awake&&"-translate-y-0.5 scale-110"),style:{zIndex:a.length-e,color:b.icon?.color??void 0,filter:b.awake?"drop-shadow(0 0 5px color-mix(in srgb, currentColor 55%, transparent))":void 0},children:[(0,d.jsx)(B.BotMark,{size:28,seed:b.name,vary:b.name,color:b.icon?.color,shape:b.icon?.shape,outline:b.icon?.outline,notify:b.waiting}),f&&(0,d.jsx)(X,{handoff:f})]}),b.word&&(0,d.jsx)("span",{className:"mx-2.5 min-w-0 shrink truncate",children:(0,d.jsx)(u.default,{text:b.word,speed:2.6,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"truncate text-[13px] leading-5 tracking-[-0.1px]"})})]},b.name)}),b>0&&(0,d.jsxs)("span",{className:(0,M.cn)("grid size-7 shrink-0 place-items-center rounded-[9px] bg-muted font-mono text-[10px] text-muted-foreground ring-1 ring-border/50",!a.at(-1)?.word&&"-ml-2"),title:`${b} more`,children:["+",b]})]})}function X({handoff:a}){return(0,d.jsxs)("span",{className:"pointer-events-none absolute bottom-[calc(100%+9px)] left-1/2 flex -translate-x-1/2 animate-in flex-col items-center whitespace-nowrap fade-in zoom-in-95 duration-200",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1.5 rounded-full bg-background px-2.5 py-1 text-[12.5px] leading-4 tracking-[-0.1px] shadow-lg shadow-black/10 ring-1 ring-border",children:[a.from?.name===ay.name?(0,d.jsx)(G.ThursdayMark,{size:14,className:"shrink-0 opacity-75"}):a.from&&(0,d.jsx)(B.BotMark,{size:14,seed:a.from.name,vary:a.from.name,color:a.from.icon?.color,shape:a.from.icon?.shape,outline:a.from.icon?.outline,className:"shrink-0 opacity-75"}),a.text]}),(0,d.jsx)("span",{className:"-mt-px size-0 border-x-[5px] border-t-[6px] border-x-transparent border-t-border"}),(0,d.jsx)("span",{className:"-mt-[6.5px] size-0 border-x-[5px] border-t-[6px] border-x-transparent border-t-background"})]})}function Y({onClick:a}){return(0,d.jsx)("button",{type:"button",onClick:a,"aria-label":"Fold the room away",className:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-foreground outline-none transition-colors hover:bg-muted-foreground/20 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(n.X,{className:"size-3.5"})})}function Z({count:a,pending:b,composing:c,onCompose:e,onClose:f}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3.5 pt-3 pb-1.5",children:[(0,d.jsx)("span",{className:"text-[13px] font-medium",children:"Tasks"}),a>0&&!c&&(0,d.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums",children:b>0?`${b} for you \xb7 ${a}`:a}),(0,d.jsx)("span",{className:"flex-1"}),!c&&(0,d.jsx)(T,{onClick:e}),(0,d.jsx)(Y,{onClick:f})]})}function $({task:a,onBack:b,onClose:c}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,d.jsx)("button",{type:"button",onClick:b,"aria-label":"Back to the list",className:"shrink-0 rounded-md p-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(g.ChevronLeft,{className:"size-4"})}),(0,d.jsx)(B.BotMark,{size:22,seed:a.bot.name,vary:a.id,color:a.bot.icon?.color,shape:a.bot.icon?.shape,outline:a.bot.icon?.outline,notify:!1}),(0,d.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:[a.label,(0,d.jsx)("span",{title:a.id,className:"ml-1.5 font-mono text-[10px] font-normal text-muted-foreground/60",children:a.id.slice(0,8)})]}),(0,d.jsx)(_,{usage:a.tokens}),(0,d.jsx)(aa,{task:a}),(0,d.jsx)(ab,{task:a}),(0,d.jsx)(Y,{onClick:c})]})}function _({usage:a}){let b=a.input+a.output;return b?(0,d.jsx)("span",{title:`in ${(0,M.formatCount)(a.input)} \xb7 out ${(0,M.formatCount)(a.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,M.formatCount)(b)}):null}function aa({task:a}){let{contextTokens:b,contextBudget:c}=a;if(!b||!c)return null;let e=Math.min(1,b/c);return(0,d.jsx)("span",{title:`Context ${(0,M.formatCount)(b)} of ${(0,M.formatCount)(c)} — it summarizes itself here`,className:"block h-[3px] w-9 shrink-0 overflow-hidden rounded-full bg-muted",children:(0,d.jsx)("span",{className:(0,M.cn)("block h-full rounded-full",e>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*e))}%`}})})}let aw={working:"text-muted-foreground",waiting:M.WAITING_INK,done:"text-foreground",failed:"text-destructive"};function ab({task:a}){let b="done"===a.status&&a.relayed?"text-muted-foreground":aw[a.status];return"working"===a.status?(0,d.jsx)(u.default,{text:"working",speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"shrink-0 font-mono text-[10px]"}):(0,d.jsx)("span",{className:(0,M.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",b),children:a.status})}function ac({bots:a}){let{crew:b,more:c}=R(a,[]);return(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3 px-6 pt-3 pb-4 text-center",children:[(0,d.jsx)(W,{crew:b,more:c,bubbles:ar}),a?.length?(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:"Nothing handed over yet — ask for something that takes a while."}):(0,d.jsxs)("p",{className:"text-[12px] text-muted-foreground",children:["Thursday hands work to ",A.DEFAULT_BOT.name," until you make bots of your own in Settings › Bots."]})]})}function ad(){return(0,d.jsx)("div",{className:"flex shrink-0 justify-end px-3 pb-2.5",children:(0,d.jsxs)("button",{type:"button",onClick:()=>(0,F.openSettings)("tasks"),className:"flex items-center gap-1 rounded-md px-1.5 py-1 font-mono text-[10px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(k.History,{className:"size-3"}),"History"]})})}let ax=[{id:"you",label:"needs you",holds:at},{id:"working",label:"working",holds:a=>"working"===a.status},{id:"done",label:"done",holds:()=>!0}];function ae({tasks:a,onPick:b}){let c=new Map;for(let b of a){let a=ax.find(a=>a.holds(b))??ax[2],d=c.get(a.id);d?d.push(b):c.set(a.id,[b])}return(0,d.jsx)("div",{className:"flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 pt-1 pb-1 scrollbar-none",children:ax.map((a,e)=>{let f=c.get(a.id)??[];return f.length?(0,d.jsxs)(o.Fragment,{children:[(0,d.jsxs)("p",{className:(0,M.cn)("px-2.5 pb-1 font-mono text-[10px] text-muted-foreground",0===e?"pt-1":"pt-3"),children:[a.label," · ",f.length]}),f.map(a=>(0,d.jsx)(af,{task:a,onPick:()=>b(a.id)},a.id))]},a.id):null})})}function af({task:a,onPick:b}){let c=at(a),e=a.lines.at(-1),f=(0,o.useMemo)(()=>(function(a){if("waiting"===a.status&&a.ask)return(0,A.isBudgetAsk)(a.ask)?{text:(0,M.plainText)(a.outcome??a.ask.question),tone:"text-muted-foreground"}:{text:a.ask.question,tone:M.WAITING_INK};if("failed"===a.status)return{text:(0,M.plainText)(a.outcome??"Failed"),tone:"text-destructive"};if("done"===a.status)return{text:(0,M.plainText)(a.outcome??"Done"),tone:a.relayed?"text-muted-foreground":"text-foreground"};let b=(0,O.lastSaid)(a);return b?{text:"tool"===b.kind&&b.tool?b.tool.note??`${b.tool.name} \xb7 ${b.tool.input}`:b.text,tone:"text-muted-foreground"}:{text:`${a.bot.name} is taking it on…`,tone:"text-muted-foreground italic"}})(a),[a.status,a.outcome,a.relayed,a.ask,e?.id]),[g,h]=(0,E.useAnswerTask)(),[j,k]=(0,o.useState)(null),m="waiting"===a.status?a.ask?.options??[]:[],n=(0,A.isBudgetAsk)(a.ask);return(0,d.jsxs)("div",{className:"rounded-xl transition-colors hover:bg-muted/60",children:[(0,d.jsxs)("button",{type:"button",onClick:b,className:"flex w-full items-center gap-2.5 rounded-xl px-2 py-1.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)("span",{className:"relative flex size-8 shrink-0 items-center justify-center overflow-visible",title:a.bot.name,children:(0,d.jsx)(B.BotMark,{size:32,seed:a.bot.name,vary:a.id,color:a.bot.icon?.color,shape:a.bot.icon?.shape,outline:a.bot.icon?.outline,state:"working"===a.status?"thinking":"idle",notify:c})}),(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("span",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:(0,M.cn)("min-w-0 truncate text-[14px] leading-5 tracking-[-0.15px]",c?"text-foreground":"text-foreground/80"),children:a.label}),(0,d.jsx)(C.BotRoster,{bots:(0,O.rosterOf)(a),taskId:a.id}),(0,d.jsx)("span",{className:"flex-1"}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[11px] leading-4 text-muted-foreground/70 tabular-nums",children:(0,I.shortAgo)(a.updatedAt)})]}),(0,d.jsxs)("span",{className:"mt-px flex h-4 items-center gap-1.5",children:["working"===a.status&&(0,d.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/70"}),"working"===a.status?(0,d.jsx)(u.default,{text:f.text,speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:(0,M.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",f.tone)}):(0,d.jsx)("span",{className:(0,M.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",f.tone),children:f.text})]})]})]}),m.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-0.5 pr-2 pb-2 pl-12.5",children:m.map(b=>(0,d.jsxs)(r.Button,{size:"sm",variant:"outline",loading:j===b,disabled:h,onClick:async()=>{k(b),await g(a,b),k(null)},className:(0,M.cn)("h-7 gap-1.5 rounded-full bg-background px-3 text-[12px]",!n&&"border-amber-500/35"),children:[n&&b===A.TASK_CONTINUE&&(0,d.jsx)(i.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),b,n&&b===A.TASK_CONTINUE&&(0,d.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:["+",x.BOT_RUN.steps," steps"]})]},b))})]})}function ag({task:a,className:b}){let c=(0,o.useRef)(null),e=(0,o.useRef)(!0);return(0,o.useEffect)(()=>{e.current=!0},[a.id]),(0,o.useEffect)(()=>{let a=c.current;a&&e.current&&(a.scrollTop=a.scrollHeight)},[a.lines,a.status]),(0,d.jsx)(H.FileViewer,{children:(0,d.jsxs)("div",{ref:c,onScroll:a=>{let b=a.currentTarget;e.current=b.scrollHeight-b.scrollTop-b.clientHeight<24},className:(0,M.cn)("max-h-[64vh] space-y-3 overflow-y-auto px-4 pt-6 pb-4 mask-[linear-gradient(to_bottom,transparent,black_2rem)] scrollbar-none",b),children:[(0,d.jsx)(ah,{task:a}),(0,O.threadItems)(a).map(b=>"invite"===b.kind?(0,d.jsx)(ai,{from:b.from,to:b.to},b.key):(0,d.jsx)(am,{group:b.group,task:a},b.key)),"working"===a.status&&0===a.lines.length&&(0,d.jsx)(u.default,{text:`${a.bot.name} is taking it on…`,speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"block px-1 font-mono text-[10px]"})]})})}function ah({task:a}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ai,{from:ay,to:a.bot}),(0,d.jsx)(ak,{children:(0,d.jsx)(q.Bubble,{align:"end",className:"max-w-full",children:(0,d.jsx)(q.BubbleContent,{className:"rounded-tr-md py-2 pr-2 pl-3.5",children:(0,d.jsx)(s.FoldedText,{text:a.request,subject:"request"})})})})]})}let ay={name:"Thursday"};function ai({from:a,to:b}){return(0,d.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,d.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 font-mono text-[10px] text-muted-foreground",children:[(0,d.jsx)(aj,{bot:a}),(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,d.jsx)(aj,{bot:b})]})})}function aj({bot:a}){return(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)(B.BotMark,{size:15,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,notify:!1,className:"shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.name})]})}function ak({children:a}){return(0,d.jsx)(al,{side:"end",name:"Thursday",mark:(0,d.jsx)(B.BotMark,{size:26,seed:"thursday",notify:!1,className:"mt-1 shrink-0"}),children:a})}function al({side:a,mark:b,name:c,children:e}){return(0,d.jsxs)("div",{className:(0,M.cn)("flex gap-2.5","end"===a&&"flex-row-reverse"),children:[b,(0,d.jsxs)("div",{className:(0,M.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===a&&"items-end"),children:[(0,d.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:c}),e]})]})}function am({group:a,task:b}){return a.lines[0]?.kind==="user"?(0,d.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,d.jsx)(ak,{children:a.lines.map(a=>(0,d.jsx)(q.Bubble,{align:"end",className:"max-w-full",children:(0,d.jsx)(q.BubbleContent,{className:"rounded-tr-md px-3.5 text-[13px] leading-snug break-keep",children:a.text})},a.id))})}):(0,d.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,d.jsx)(al,{side:a.bot.name===b.bot.name?"start":"end",name:a.bot.name,mark:(0,d.jsx)(B.BotMark,{size:26,seed:a.bot.name,vary:b.id,color:a.bot.icon?.color,shape:a.bot.icon?.shape,outline:a.bot.icon?.outline,notify:!1,className:"mt-1 shrink-0"}),children:(function(a){let b=[];for(let c of a){let a="tool"===c.kind&&c.tool?"tools":"said",d=b.at(-1);d&&d.kind===a?d.lines.push(c):b.push({kind:a,key:c.id,lines:[c]})}return b})(a.lines).map(a=>"tools"===a.kind?(0,d.jsx)(ap,{lines:a.lines,taskId:b.id},a.key):a.lines.map(a=>(0,d.jsx)(an,{line:a,taskId:b.id},a.id)))})})}function an({line:a,taskId:b}){if("tool"===a.kind&&a.tool)return(0,d.jsx)(P.BotTool,{tool:a.tool,taskId:b});if("note"===a.kind)return(0,d.jsxs)("details",{className:"w-full py-1 text-muted-foreground",children:[(0,d.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,d.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,d.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,d.jsx)("p",{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px] leading-relaxed whitespace-pre-wrap break-keep",children:a.text})]});if(!(0,O.isOutcome)(a))return(0,d.jsx)("p",{className:"px-1 text-[12.5px] leading-relaxed break-keep text-muted-foreground",children:a.text});if(a.options)return(0,d.jsxs)("div",{className:"w-fit max-w-full space-y-1.5 rounded-2xl bg-amber-500/8 px-3 py-2 ring-1 ring-amber-500/25",children:[(0,d.jsx)("p",{className:"text-[13px] leading-snug break-keep",children:a.text}),a.options.length>0&&(0,d.jsx)("p",{className:"flex flex-wrap gap-1",children:a.options.map(a=>(0,d.jsx)("span",{className:"rounded-full bg-background/70 px-2 py-0.5 font-mono text-[10px] text-muted-foreground",children:a},a))})]});let c="error"===a.kind;return(0,d.jsxs)("div",{className:"min-w-0 px-1",children:[c&&(0,d.jsxs)("p",{className:"mb-1.5 flex items-center gap-1.5 font-mono text-[10px] text-destructive",children:[(0,d.jsx)(n.X,{className:"size-3 shrink-0"}),"Could not finish"]}),(0,d.jsx)(t.Markdown,{className:(0,M.cn)("overflow-x-auto text-[13px] leading-relaxed break-keep [&_h1]:text-[15px] [&_h2]:text-[14px] [&_h3]:text-[13px] [&_h3]:font-semibold [&_li]:my-0.5 [&_table]:text-[12px] [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",c&&"text-destructive"),children:a.text}),(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,d.jsx)(D.PathChips,{text:a.text,className:"min-w-0"}),!c&&(0,d.jsx)("span",{className:"ml-auto shrink-0",children:(0,d.jsx)(ao,{text:a.text})})]})]})}function ao({text:a}){let[b,c]=(0,o.useState)(!1),e=(0,o.useRef)(null);return(0,o.useEffect)(()=>()=>{e.current&&clearTimeout(e.current)},[]),(0,d.jsx)("button",{type:"button","aria-label":"Copy the report",onClick:async()=>{try{await navigator.clipboard.writeText(a),c(!0),e.current&&clearTimeout(e.current),e.current=setTimeout(()=>c(!1),1400)}catch(a){w.toast.add({type:"error",title:"Could not copy the report",description:(0,M.errorToString)(a)})}},className:"grid size-5 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:b?(0,d.jsx)(f.Check,{className:"size-3"}):(0,d.jsx)(j.Copy,{className:"size-3"})})}function ap({lines:a,taskId:b}){return(0,d.jsxs)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:[a.length>1&&(0,d.jsxs)("p",{className:"px-2 py-1 font-mono text-[10px] text-muted-foreground",children:[a.length," steps"]}),a.map(a=>a.tool?(0,d.jsx)(P.BotTool,{tool:a.tool,taskId:b,collapsed:!0},a.id):null)]})}a.s(["BotRoom",0,aq,"Conversation",0,ag]),c()}catch(a){c(a)}},!1),42380,a=>{"use strict";var b=a.i(187924),c=a.i(913834);a.s(["BotRoster",0,function({bots:a,taskId:d}){return a.length<2?null:(0,b.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:a.map(a=>a.name).join(", "),children:[(0,b.jsx)("span",{className:"flex items-center",children:a.slice(0,3).map(a=>(0,b.jsx)(c.BotMark,{size:18,seed:a.name,vary:d,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,notify:!1,className:"-ml-[3px] rounded-[7px] ring-2 ring-background first:ml-0"},a.name))}),(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[a.length," bots"]})]})}])},16716,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(998697),f=a.i(840260),g=a.i(930345),h=a.i(707938),i=a.i(576509),j=a.i(483138),k=a.i(904340),l=a.i(572131),m=a.i(369768),n=a.i(559553),o=a.i(497895),p=b([m]);[m]=p.then?(await p)():p;let q={markdown:j.FileText,csv:i.FileSpreadsheet,json:h.FileJson,text:k.FileType,image:g.FileImage};a.s(["PathChips",0,function({text:a,className:b}){let c=(0,l.useMemo)(()=>(0,n.pathsIn)(a),[a]);return c.length?(0,d.jsx)("div",{className:(0,o.cn)("flex flex-wrap gap-1.5",b),children:c.map(a=>{let b,c=a.split("/").pop()??a,g=(b=(0,n.viewKindOf)(a),"frame"===b?a.toLowerCase().endsWith(".pdf")?j.FileText:f.FileCode:q[b]??e.File);return(0,d.jsxs)(m.FileLink,{path:a,className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted/70 py-1 pr-2.5 pl-2 font-mono text-[11px] text-foreground/80 outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(g,{className:"size-3 shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"truncate",children:c})]},a)})}):null}]),c()}catch(a){c(a)}},!1),394440,a=>{"use strict";var b=a.i(187924),c=a.i(327598),d=a.i(231500),e=a.i(164831);let f={name:"corner-down-left",size:24,node:[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]};f.node;let g=(0,e.default)(f);var h=a.i(875160),i=a.i(19895),j=a.i(474215),k=a.i(572131),l=a.i(767561),m=a.i(340695),n=a.i(613350),o=a.i(545097),p=a.i(546893),q=a.i(287702),r=a.i(405050);let s=(0,r.createServerReference)("7f130e379b411cea54d564cd7c8822f5cc7cce3042",r.callServer,void 0,r.findSourceMapURL,"answerTaskAction");var t=a.i(240827),u=a.i(411509),v=a.i(777279),w=a.i(313237),x=a.i(759497),y=a.i(497895);function z(){let[a,b]=(0,w.useServerAction)(s,{onOk:()=>(0,x.revalidate)(l.queryKey.tasks)});return[async(b,c)=>{let d=c.trim();if(!d)return!1;try{let c=await a(b.id,d);return v.screenActs.announce({kind:"answered",id:c.id,label:c.label,answer:d}),!0}catch{return!1}},b]}a.s(["TaskReply",0,function({task:a,status:e,lines:f=[],className:r}){let[s,A]=(0,k.useState)(()=>v.taskDrafts.get(a.id));(0,k.useEffect)(()=>A(v.taskDrafts.get(a.id)),[a.id]);let B=b=>{A(b),v.taskDrafts.set(a.id,b)},[C,D]=z(),[E,F]=(0,w.useServerAction)(t.cancelTaskAction,{onOk:a=>{(0,x.revalidate)(l.queryKey.tasks),v.screenActs.announce({kind:"stopped",id:a.id,label:a.label})}}),G=D||F,[H,I]=(0,k.useState)(!1),[J,K]=(0,k.useState)(null);(0,k.useEffect)(()=>{I(!1),K(null)},[a.id]),(0,k.useEffect)(()=>{"running"!==e&&K(null)},[e]),(0,k.useEffect)(()=>{J&&f.some(a=>"user"===a.kind&&a.text===J)&&K(null)},[f,J]);let L=async b=>{!G&&await C(a,b)&&(B(""),"running"===e&&(K(b.trim()),I(!1)))},M="waiting"===e?a.ask:null,N=(0,u.isBudgetAsk)(M),O=M?M.options.length?"Or put it another way…":"Your answer":"running"===e?`What's off? ${a.bot} reads this before its next step`:"Anything more? It picks up where it left off",P=(0,b.jsxs)("form",{onSubmit:a=>{a.preventDefault(),L(s)},className:"flex items-end gap-1 rounded-2xl bg-background py-1.5 pr-1.5 pl-3.5 ring-1 ring-border/80 transition-shadow focus-within:ring-ring/60",children:[(0,b.jsx)(p.Textarea,{value:s,rows:1,disabled:G,autoFocus:"running"===e,onChange:a=>B(a.target.value),onKeyDown:a=>{"Escape"===a.key&&"running"===e?I(!1):"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||229===a.keyCode||(a.preventDefault(),L(s))},placeholder:O,"aria-label":`Message for ${a.label}`,className:"max-h-32 min-h-0 flex-1 resize-none border-0 bg-transparent px-0 py-1 text-[13px] leading-5 shadow-none focus-visible:ring-0 dark:bg-transparent"}),"running"===e&&(0,b.jsx)(m.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:G,onClick:()=>I(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,b.jsx)(j.X,{})}),(0,b.jsx)(m.Button,{type:"submit",size:"icon-sm",variant:s.trim()?"default":"ghost",disabled:!s.trim()||G,"aria-label":"Send",className:"rounded-full",children:D?(0,b.jsx)(h.Loader2,{className:"animate-spin"}):(0,b.jsx)(c.ArrowUp,{})})]});return"running"!==e||H?M?(0,b.jsxs)("div",{className:(0,y.cn)("space-y-2.5 rounded-2xl px-3.5 py-3 ring-1",N?"bg-muted/40 ring-border/50":"bg-amber-500/8 ring-amber-500/25",r),children:[(0,b.jsxs)("p",{className:"flex items-center gap-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,b.jsx)("span",{className:"shrink-0",children:"To"}),(0,b.jsx)("span",{className:"truncate text-foreground",children:a.bot}),(0,b.jsx)("span",{className:"shrink-0 text-muted-foreground/50",children:"·"}),(0,b.jsx)("span",{className:"truncate",children:a.label})]}),M.question&&(0,b.jsx)(n.FoldedText,{text:M.question,subject:"message",clamp:"line-clamp-6",tall:"max-h-56"}),M.options.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:M.options.map(a=>(0,b.jsxs)(m.Button,{size:"sm",variant:"outline",disabled:G,onClick:()=>L(a),className:"h-7 gap-1.5 rounded-full bg-background px-3 text-[12px]",children:[N&&a===u.TASK_CONTINUE&&(0,b.jsx)(d.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),a,N&&a===u.TASK_CONTINUE&&(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:["+",q.BOT_RUN.steps," steps"]})]},a))}),P,(0,b.jsx)("button",{type:"button",disabled:G,onClick:()=>E(a.id),className:"font-mono text-[10px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50",children:"Stop this task instead"})]}):(0,b.jsx)("div",{className:r,children:P}):(0,b.jsxs)("div",{className:(0,y.cn)("flex items-center gap-2 rounded-2xl bg-muted/40 py-1.5 pr-1.5 pl-3.5 ring-1 ring-border/50",r),children:[J?(0,b.jsxs)("p",{className:"flex min-w-0 flex-1 items-center gap-2 text-[12.5px] leading-5 text-muted-foreground",children:[(0,b.jsx)(h.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,b.jsx)("span",{className:"shrink-0",children:"Before its next step:"}),(0,b.jsx)(o.default,{text:J,speed:2.2,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 truncate"})]}):(0,b.jsx)(o.default,{text:`${a.bot} is on it — Thursday steers it by voice.`,speed:2.4,color:"var(--muted-foreground)",shineColor:"var(--foreground)",className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,b.jsxs)(m.Button,{type:"button",size:"sm",variant:"ghost",disabled:G,onClick:()=>I(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,b.jsx)(g,{className:"size-3.5"}),"Step in"]}),(0,b.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),(0,b.jsx)(m.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:G,onClick:()=>E(a.id),"aria-label":"Stop this task",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:F?(0,b.jsx)(h.Loader2,{className:"animate-spin"}):(0,b.jsx)(i.Square,{className:"size-3"})})]})},"useAnswerTask",0,z],394440)},701073,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f1853e08ff28db8b3a58db60a0fab8d0b74abe935",b.callServer,void 0,b.findSourceMapURL,"startTaskAction");a.s(["startTaskAction",0,c])},366250,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7ff85aa737cda325a8b80f964721a420dbfa665547",b.callServer,void 0,b.findSourceMapURL,"markReportedAction");a.s(["markReportedAction",0,c])},240827,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f106cc55d238f82d75c85a8916cb1d3c2c3a9401c",b.callServer,void 0,b.findSourceMapURL,"cancelTaskAction");a.s(["cancelTaskAction",0,c])},777279,a=>{"use strict";var b=a.i(572131);let c=[],d=!1,e=new Set;function f(a,b){let c=a=>({name:a,icon:b?.find(b=>b.name===a)?.icon??null}),d=c(a.bot),e=[],f=new Map,g=new Map;for(let b of a.lines){let a=b.bot?c(b.bot):d,h=b.parent&&g.get(b.parent)?.name?d:null;switch(b.kind){case"user":e.push({id:b.id,bot:d,to:null,text:b.text,kind:"user"});break;case"text":e.push({id:b.id,bot:a,to:h,text:b.text,kind:"say"});break;case"note":e.push({id:b.id,bot:a,to:h,text:b.text,kind:"note"});break;case"tool":f.set(b.callId,e.length),e.push({id:b.id,bot:a,to:h,text:b.note??b.input,kind:"tool",tool:{name:b.name,input:b.input,note:b.note,path:b.path,callId:b.callId}});break;case"tool-result":{let a=f.get(b.callId),c=void 0===a?void 0:e[a];c?.tool&&void 0!==a&&(e[a]={...c,tool:{...c.tool,results:b.results,more:b.more}});break}case"ask":{let d=c(b.to);g.set(b.callId,d),e.push({id:b.id,bot:a,to:d,text:b.text,kind:"ask"});break}case"ask-result":{let c=g.get(b.callId);c&&b.text&&e.push({id:b.id,bot:c,to:a,text:b.text,kind:"ask"});break}case"waiting":e.push({id:b.id,bot:a,to:null,text:b.question,kind:"result",options:b.options})}}if("failed"===a.status&&a.outcome)e.push({id:`${a.id}-end`,bot:d,to:null,text:a.outcome,kind:"error"});else if("done"===a.status||"waiting"===a.status){let b=e.at(-1);b&&"say"===b.kind&&b.text===a.outcome&&(e[e.length-1]={...b,kind:"result"})}return{id:a.id,request:a.request,label:a.label,bot:d,lines:e,status:"running"===a.status?"working":a.status,outcome:a.outcome,ask:a.ask,relayed:a.reported,tokens:a.tokens,contextTokens:a.contextTokens,contextBudget:a.contextBudget,updatedAt:a.updatedAt}}let g=new Map,h=new Set,i=[];a.s(["botTasks",0,{sync(a,b){for(let g of(d=!0,c=[...a].reverse().map(a=>f(a,b)).slice(-30),e))g()},primed:()=>d},"isOutcome",0,a=>"result"===a.kind||"error"===a.kind,"lastSaid",0,function(a){for(let b=a.lines.length-1;b>=0;b--){let c=a.lines[b];if("user"!==c.kind&&"note"!==c.kind)return c}return null},"latestPerBot",0,function(a){let b=new Map;for(let c of a)for(let a of(b.has(c.bot.name)||b.set(c.bot.name,{bot:c.bot,task:c,line:null,open:0}),c.lines))"user"!==a.kind&&"note"!==a.kind&&b.set(a.bot.name,{bot:a.bot,task:c,line:a,open:b.get(a.bot.name)?.open??0});for(let c of a){if("working"!==c.status)continue;let a=b.get(c.bot.name);a&&(a.open+=1)}return[...b.values()]},"rosterOf",0,function(a){let b=[a.bot];for(let c of a.lines)b.some(a=>a.name===c.bot.name)||b.push(c.bot);return b},"screenActs",0,{announce(a){for(let b of h)b(a)},subscribe:a=>(h.add(a),()=>{h.delete(a)})},"taskDrafts",0,{get:a=>g.get(a)??"",set(a,b){b?g.set(a,b):g.delete(a)},typing:a=>(g.get(a)?.trim().length??0)>0},"taskFromRow",0,f,"threadItems",0,function(a){let b=new Set([a.bot.name]),c=[];for(let d of function(a){let b=[];for(let c of a){let a=b.at(-1);if(a&&a.bot.name===c.bot.name&&a.to?.name===c.to?.name&&"user"===a.lines[0].kind==("user"===c.kind)){a.lines.push(c);continue}b.push({key:c.id,bot:c.bot,to:c.to,lines:[c]})}return b}(a.lines))d.to&&!b.has(d.to.name)&&(b.add(d.to.name),c.push({kind:"invite",key:`${d.key}-joins`,from:d.bot,to:d.to})),b.add(d.bot.name),c.push({kind:"group",key:d.key,group:d});return c},"useBotTasks",0,function(){return(0,b.useSyncExternalStore)(a=>(e.add(a),()=>e.delete(a)),()=>c,()=>i)}])},327598,a=>{"use strict";var b=a.i(164831);let c={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};c.node;let d=(0,b.default)(c);a.s(["ArrowUp",0,d],327598)},231500,a=>{"use strict";var b=a.i(164831);let c={name:"chevrons-right",size:24,node:[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]};c.node;let d=(0,b.default)(c);a.s(["ChevronsRight",0,d],231500)},585650,a=>{"use strict";var b=a.i(164831);let c={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};c.node;let d=(0,b.default)(c);a.s(["Copy",0,d],585650)},840260,a=>{"use strict";var b=a.i(164831);let c={name:"file-code",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]};c.node;let d=(0,b.default)(c);a.s(["FileCode",0,d],840260)},930345,a=>{"use strict";var b=a.i(164831);let c={name:"file-image",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]};c.node;let d=(0,b.default)(c);a.s(["FileImage",0,d],930345)},576509,a=>{"use strict";var b=a.i(164831);let c={name:"file-spreadsheet",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]};c.node;let d=(0,b.default)(c);a.s(["FileSpreadsheet",0,d],576509)},904340,a=>{"use strict";var b=a.i(164831);let c={name:"file-type",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]]};c.node;let d=(0,b.default)(c);a.s(["FileType",0,d],904340)},19895,a=>{"use strict";var b=a.i(164831);let c={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};c.node;let d=(0,b.default)(c);a.s(["Square",0,d],19895)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=_1ruzehw._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[221214,a=>a.a(async(b,c)=>{try{var d=a.i(93321),e=a.i(569572),f=a.i(184838),g=a.i(714428),h=a.i(725466),i=a.i(446957),j=b([f,h]);[f,h]=j.then?(await j)():j;let w=a=>({name:a.name,description:a.description,systemPrompt:a.systemPrompt,icon:a.icon,provider:a.provider,model:a.model});async function k(){let a=await f.database.select().from(g.botTable).orderBy(g.botTable.createdAt);return a.length?a.map(w):[i.DEFAULT_BOT]}async function l(a){let b=await r(a);if(b)return w(b);let c=a.trim().toLowerCase();return(await k()).find(a=>a.name.toLowerCase()===c)??null}async function m(a){let[b]=await f.database.select({text:g.botNoteTable.text}).from(g.botNoteTable).where((0,d.eq)(g.botNoteTable.bot,a));return b?.text??null}async function n(a,b){let c=b.trim().slice(0,e.BOT_NOTES.chars).trim();if(!c)return q(a);let d=new Date;await f.database.insert(g.botNoteTable).values({bot:a,text:c,updatedAt:d}).onConflictDoUpdate({target:g.botNoteTable.bot,set:{text:c,updatedAt:d}})}async function o(){return(0,i.isBotNotesOn)(await (0,h.readConfig)(i.BOT_NOTES_KEY))}async function p(a){await (0,h.writeConfig)(i.BOT_NOTES_KEY,a?"on":"off")}async function q(a){await f.database.delete(g.botNoteTable).where((0,d.eq)(g.botNoteTable.bot,a))}async function r(a){let[b]=await f.database.select().from(g.botTable).where((0,d.eq)(g.botTable.name,a));return b??null}async function s(a){if(await r(a.name))return null;let{toolIds:b,...c}=(0,i.pickedModel)(a),[d]=await f.database.insert(g.botTable).values(c).returning();return await u(d.name,b),d}async function t(a,b){let{toolIds:c,...e}="provider"in b||"model"in b?(0,i.pickedModel)(b):b;delete e.name;let[h]=Object.keys(e).length?await f.database.update(g.botTable).set(e).where((0,d.eq)(g.botTable.name,a)).returning():await f.database.select().from(g.botTable).where((0,d.eq)(g.botTable.name,a));return h?(c&&await u(a,c),h):null}async function u(a,b){if(await f.database.delete(g.botMcpToolTable).where((0,d.eq)(g.botMcpToolTable.botName,a)),0===b.length)return;let c=await f.database.select({id:g.mcpToolTable.id}).from(g.mcpToolTable).where((0,d.inArray)(g.mcpToolTable.id,b));0!==c.length&&await f.database.insert(g.botMcpToolTable).values(c.map(({id:b})=>({botName:a,toolId:b})))}async function v(a){let b=await f.database.delete(g.botTable).where((0,d.eq)(g.botTable.name,a)).returning({name:g.botTable.name});return await q(a),b.length>0}a.s(["clearBotNote",0,q,"createBot",0,s,"deleteBot",0,v,"findBot",0,r,"findJobBot",0,l,"listJobBots",0,k,"readBotNote",0,m,"readBotNotesOn",0,o,"updateBot",0,t,"writeBotNote",0,n,"writeBotNotesOn",0,p]),c()}catch(a){c(a)}},!1),446957,60756,a=>{"use strict";var b=a.i(723885),c=a.i(569572),d=a.i(689656),e=a.i(706210);let f={name:{max:16},shortDescription:{max:60},description:{max:100},prompt:{max:2e3}};a.s(["COMMON_VALIDATE",0,f],60756);var g=a.i(182248),h=a.i(62721);let i=b.default.object({color:b.default.string().regex(/^(#[0-9a-fA-F]{6}|currentColor)$/,"Hex color").optional(),shape:b.default.enum(h.MARK_SHAPES).optional(),outline:b.default.boolean().optional()}),j=b.default.string().max(f.prompt.max),k=b.default.object({id:b.default.number(),name:b.default.string(),serverName:b.default.string()}),l=b.default.string().trim().transform(a=>a.replace(/\s+/g," ")).pipe(b.default.string().min(1,"A name is required").max(f.name.max)),m=b.default.object({input:b.default.number(),output:b.default.number()});b.default.object({name:b.default.string(),description:b.default.string(),systemPrompt:b.default.string().nullish(),icon:i.nullish(),provider:d.textModelProviderSchema.nullish(),model:b.default.string().nullish(),createdAt:e.DateLikeSchema,tools:k.array().default([]),tokens:m,lastJobAt:e.DateLikeSchema.nullish(),note:b.default.string().nullish(),noteAt:e.DateLikeSchema.nullish()});let n=b.default.object({name:l,description:b.default.string().trim().min(1,"Say what this bot is for").max(f.description.max),systemPrompt:j.optional(),icon:i.optional(),provider:d.textModelProviderSchema.nullish(),model:b.default.string().trim().max(80).nullish(),toolIds:b.default.number().int().array().max(10).default([])}),o=c.PAGE_SIZE,p=b.default.discriminatedUnion("type",[b.default.object({type:b.default.literal("text"),text:b.default.string()}),b.default.object({type:b.default.literal("image"),src:b.default.string()})]),q=b.default.object({id:b.default.string(),seq:b.default.number(),bot:b.default.string().nullable(),parent:b.default.string().nullable(),at:e.DateLikeSchema}),r=b.default.discriminatedUnion("kind",[q.extend({kind:b.default.literal("user"),text:b.default.string()}),q.extend({kind:b.default.literal("text"),text:b.default.string()}),q.extend({kind:b.default.literal("note"),text:b.default.string()}),q.extend({kind:b.default.literal("tool"),callId:b.default.string(),name:b.default.string(),input:b.default.string(),note:b.default.string().nullish(),path:b.default.string().nullish()}),q.extend({kind:b.default.literal("tool-result"),callId:b.default.string(),name:b.default.string(),results:p.array(),more:b.default.boolean()}),q.extend({kind:b.default.literal("ask"),callId:b.default.string(),to:b.default.string(),text:b.default.string()}),q.extend({kind:b.default.literal("ask-result"),callId:b.default.string(),text:b.default.string()}),q.extend({kind:b.default.literal("waiting"),callId:b.default.string(),question:b.default.string(),options:b.default.string().array()})]),s=b.default.object({question:b.default.string(),options:b.default.string().array()});b.default.object({id:b.default.string(),bot:b.default.string(),label:b.default.string(),request:b.default.string(),status:b.default.enum(["running","waiting","done","failed"]),outcome:b.default.string().nullable(),ask:s.nullable(),reported:b.default.boolean(),tokens:m,contextTokens:b.default.number(),contextBudget:b.default.number(),createdAt:e.DateLikeSchema,updatedAt:e.DateLikeSchema,lines:r.array()}),a.s(["BOT_NOTES_KEY",0,"BOT_NOTES","BotFormSchema",0,n,"DEFAULT_BOT",0,{name:"Jarvis",description:"Anything — this computer, a browser, the web, files, services",systemPrompt:null,icon:{color:"#14B8A6",shape:"squircle"},provider:null,model:null},"NO_TOKENS",0,{input:0,output:0},"TASK_CONTINUE",0,"Continue","TASK_HISTORY_PAGE",0,o,"botIconSchema",0,i,"isBotNotesOn",0,a=>a?.trim()!=="off","pickedModel",0,a=>{let b=a.provider??null,c="string"==typeof a.model?a.model.trim():null;return b&&c?{...a,provider:b,model:c}:{...a,provider:null,model:null}},"taskActivity",0,function(a,b=120){let c=null;for(let d=a.length-1;d>=0;d--){let e=a[d];if("tool"===e.kind)c??=`${e.name} ${e.note??e.input}`;else if("text"===e.kind)return(0,g.clip)(c?`${e.text} → ${c}`:e.text,b);else if("ask"===e.kind)return(0,g.clip)(e.parent?`asked ${e.to}: ${e.text}`:`asked ${e.to} for: ${e.text}`,b);else if("user"===e.kind||"waiting"===e.kind)break}return c?(0,g.clip)(c,b):null}],446957)},688034,a=>{"use strict";var b=a.i(689656);let c=[...new Set(Object.values(b.SPEACH_MODEL_PROVIDERS).map(a=>a.apiKeyName))],d={image:"IMAGE_MODEL",video:"VIDEO_MODEL",speech:"SPEECH_MODEL",transcription:"TRANSCRIPTION_MODEL"},e={image:{label:"Image model",hint:"What bots draw with"},video:{label:"Video model",hint:"What bots film with — minutes a clip"},speech:{label:"Speech model",hint:"What reads text aloud into a file"},transcription:{label:"Transcription model",hint:"What turns a recording into text"}},f="DEFAULT_MODEL",g={key:f,label:"Default model",hint:"What a bot thinks with until it picks its own",text:!0,choices:b.TEXT_MODEL_PROVIDER_LIST.flatMap(a=>a.suggestModels.map(b=>({value:`${a.id}/${b.id}`,label:`${a.label} \xb7 ${b.label}`,needs:a.apiKeyName})))},h=a=>c.includes(a.apiKeyName),i=a=>({key:a.apiKeyName,label:a.label,provider:a.id}),j=[{id:"voice",title:"voice",hint:"calls run on one of these",section:"keys",require:"any",note:"one is required",entries:b.TEXT_MODEL_PROVIDER_LIST.filter(h).map(i)},{id:"text",title:"models",hint:"what bots think with — add any, or none",section:"keys",require:"none",entries:b.TEXT_MODEL_PROVIDER_LIST.filter(a=>!h(a)).map(i)},{id:"bots",title:"Bots",hint:"what a bot runs on when it has not picked its own",section:"models",require:"none",entries:[g]},{id:"studio",title:"Studio",hint:"what a bot draws, films and speaks with — off until you pick one",section:"models",require:"none",entries:Object.keys(d).map(a=>({key:d[a],...e[a],kind:a,choices:b.MEDIA_MODEL_PROVIDER_LIST.flatMap(b=>b.models[a].map(a=>({value:`${b.id}/${a.id}`,label:`${b.label} \xb7 ${a.label}`,needs:b.apiKeyName})))}))}],k=Object.fromEntries(j.flatMap(a=>a.entries).map(a=>[a.key,a])),l=j.flatMap(a=>a.entries.map(a=>a.key));Object.fromEntries(j.flatMap(a=>a.entries).filter(a=>a.choices?.length).map(a=>[a.key,a.choices])),a.s(["CONFIG_ENTRIES",0,k,"CONFIG_GROUPS",0,j,"CONFIG_KEYS",0,l,"DEFAULT_MODEL_KEY",0,f,"MEDIA_MODEL_KEYS",0,d,"VOICE_GROUP_ID",0,"voice","acceptsChoice",0,function(a,c){if(a.kind){let d=(0,b.parseMediaModel)(c);return null!==d&&(0,b.canMakeKind)(d.provider,a.kind)}return a.text?null!==(0,b.parseTextModel)(c):!!a.choices?.some(a=>a.value===c)},"groupSatisfied",0,function(a,b){return"none"===a.require||(a.requireKeys??a.entries.map(a=>a.key)).some(b)}])},725466,a=>a.a(async(b,c)=>{try{var d=a.i(93321),e=a.i(184838),f=a.i(714428),g=a.i(688034),h=b([e]);async function i(a){let b=process.env[a]?.trim();if(b)return b;let[c]=await e.database.select({value:f.configTable.value}).from(f.configTable).where((0,d.eq)(f.configTable.key,a));return c?.value.trim()||void 0}async function j(a,b){await e.database.insert(f.configTable).values({key:a,value:b}).onConflictDoUpdate({target:f.configTable.key,set:{value:b}})}async function k(a){await e.database.delete(f.configTable).where((0,d.eq)(f.configTable.key,a))}async function l(){let a=g.CONFIG_GROUPS.find(a=>a.id===g.VOICE_GROUP_ID);if(!a)return!0;let b=await Promise.all(a.entries.map(async a=>[a.key,!!await i(a.key)])),c=new Map(b);return(0,g.groupSatisfied)(a,a=>c.get(a)??!1)}[e]=h.then?(await h)():h,a.s(["isCallable",0,l,"readConfig",0,i,"removeConfig",0,k,"writeConfig",0,j]),c()}catch(a){c(a)}},!1),706210,a=>{"use strict";var b=a.i(53112);let c=b.z.union([b.z.date(),b.z.iso.datetime()]);a.s(["DateLikeSchema",0,c,"toDate",0,a=>new Date(a)])},723885,a=>{"use strict";var b=a.i(954757);a.s(["default",0,b])}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=_1vyd1ji._.js.map
|