thursday-agent 0.4.0 → 0.6.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 +3 -2
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +8 -1
- package/.next/routes-manifest.json +18 -6
- package/.next/server/app/_global-error/page.js.nft.json +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 +10 -6
- package/.next/server/app/api/artifact/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/files/route.js +6 -5
- package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/route.js +8 -8
- package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/route.js +8 -8
- package/.next/server/app/api/bot/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/thread/[id]/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/bot/thread/[id]/route.js +15 -0
- package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/bot/thread/[id]/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/bot/thread/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/bot/thread/route.js +15 -0
- package/.next/server/app/api/bot/thread/route.js.nft.json +1 -0
- package/.next/server/app/api/bot/thread/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/config/route.js +7 -7
- package/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/server/app/api/events/route.js +3 -3
- package/.next/server/app/api/events/route.js.nft.json +1 -1
- package/.next/server/app/api/file/[...path]/route.js +5 -5
- package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/catalog/route.js +8 -8
- package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/credits/route.js +8 -8
- package/.next/server/app/api/llm-model/credits/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/route.js +8 -8
- package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/subscription/route.js +8 -8
- package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/[name]/route.js +6 -6
- package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/oauth/callback/route.js +4 -4
- package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/route.js +6 -6
- package/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/tools/route.js +6 -6
- package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/edit/route.js +13 -13
- package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/route.js +7 -6
- package/.next/server/app/api/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/[source]/[name]/route.js +6 -6
- package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/route.js +6 -6
- package/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/call/route.js +10 -11
- package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/skills/route.js +10 -11
- package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/tool-call/route.js +15 -15
- package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/missing/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/workspace/missing/route/build-manifest.json +12 -0
- package/.next/server/app/api/workspace/missing/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/workspace/missing/route.js +12 -0
- package/.next/server/app/api/workspace/missing/route.js.map +5 -0
- package/.next/server/app/api/workspace/missing/route.js.nft.json +1 -0
- package/.next/server/app/api/workspace/missing/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/workspace/route.js +5 -4
- 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 +4 -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 +67 -45
- package/.next/server/app/page.js +10 -9
- 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 +3 -2
- package/.next/server/chunks/[root-of-the-server]__02846fb._.js +8 -0
- package/.next/server/chunks/[root-of-the-server]__049f521._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__05luceg._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__06--3q3._.js +8 -0
- package/.next/server/chunks/[root-of-the-server]__07bnah_._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__08eae20._.js +8 -0
- package/.next/server/chunks/[root-of-the-server]__0_ue8oe._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0c9fgca._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__0g-ueei._.js +8 -0
- package/.next/server/chunks/[root-of-the-server]__0h_x6q6._.js +5 -0
- package/.next/server/chunks/{[root-of-the-server]__0pa2n68._.js → [root-of-the-server]__0kxrvxf._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0q0vvt2._.js → [root-of-the-server]__0ov3iir._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0qwtlmx._.js +8 -0
- package/.next/server/chunks/[root-of-the-server]__0sm5xvm._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ye3da2._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0zp35ul._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__144u9d_._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__18-2tsq._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__1e-ci13._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1e2365e._.js +8 -0
- package/.next/server/chunks/[root-of-the-server]__1fix932._.js +8 -0
- package/.next/server/chunks/{[root-of-the-server]__0ce8nf8._.js → [root-of-the-server]__1g3t7vn._.js} +3 -3
- package/.next/server/chunks/[root-of-the-server]__1kp-83u._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__1kv8p3e._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__1orn-5b._.js +2 -3
- package/.next/server/chunks/_02szwk8._.js +5 -0
- package/.next/server/chunks/_05h2cii._.js +1 -1
- package/.next/server/chunks/_06c9kie._.js +216 -0
- package/.next/server/chunks/{_1x6kd1r._.js → _07y2gj-._.js} +1 -1
- package/.next/server/chunks/_0a43a-0._.js +3 -0
- package/.next/server/chunks/_0bujjey._.js +5 -0
- package/.next/server/chunks/_0c9j6rb._.js +1 -1
- package/.next/server/chunks/_0dkd549._.js +3 -0
- package/.next/server/chunks/_0ej1kvv._.js +3 -0
- package/.next/server/chunks/_0f6ts7z._.js +3 -0
- package/.next/server/chunks/_0gm9hyv._.js +55 -0
- package/.next/server/chunks/_0i55en5._.js +25 -0
- package/.next/server/chunks/_0k50n27._.js +18 -0
- package/.next/server/chunks/_0khihjk._.js +3 -3
- package/.next/server/chunks/_0n74zsf._.js +5 -5
- package/.next/server/chunks/_0nvm9ef._.js +3 -0
- package/.next/server/chunks/_0p56fn0._.js +3 -0
- package/.next/server/chunks/_0recufk._.js +1 -1
- package/.next/server/chunks/_0xbkz10._.js +3 -0
- package/.next/server/chunks/_10tkr26._.js +3 -0
- package/.next/server/chunks/{_0ioz3nd._.js → _11u2kp7._.js} +1 -1
- package/.next/server/chunks/_11ujpya._.js +3 -0
- package/.next/server/chunks/_127nx_p._.js +5 -0
- package/.next/server/chunks/_17l5ygt._.js +1 -1
- package/.next/server/chunks/_19uauj6._.js +3 -0
- package/.next/server/chunks/_1_5mnq4._.js +5 -5
- package/.next/server/chunks/_1abl6t9._.js +55 -0
- package/.next/server/chunks/_1d0j961._.js +3 -3
- package/.next/server/chunks/_1dbixxz._.js +3 -0
- package/.next/server/chunks/_1dc_d1q._.js +98 -0
- package/.next/server/chunks/_1drgfx4._.js +5 -5
- package/.next/server/chunks/_1e48czp._.js +3 -3
- package/.next/server/chunks/_1f31u5x._.js +5 -0
- package/.next/server/chunks/_1kg70wc._.js +3 -3
- package/.next/server/chunks/_1klbcft._.js +5 -0
- package/.next/server/chunks/_1krd9rf._.js +4 -1
- package/.next/server/chunks/_1kwmzab._.js +3 -0
- package/.next/server/chunks/{_1pf4qe-._.js → _1oxj9fa._.js} +1 -1
- package/.next/server/chunks/{_1f46eie._.js → _1pcmdbb._.js} +1 -1
- package/.next/server/chunks/_1qgix-j._.js +3 -0
- package/.next/server/chunks/{lib_logger_ts_1exwjut._.js → _1rpchta._.js} +5 -5
- package/.next/server/chunks/_1vsej-s._.js +5 -0
- package/.next/server/chunks/_1yx0p_s._.js +5 -0
- package/.next/server/chunks/{_0rnf-6n._.js → _20fsr_z._.js} +6 -6
- package/.next/server/chunks/_2128hkj._.js +5 -0
- package/.next/server/chunks/_next-internal_server_app_api_bot_thread_[id]_route_actions_1fstjn2.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_bot_thread_route_actions_003ccso.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_workspace_missing_route_actions_1fidi6p.js +3 -0
- package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
- package/.next/server/chunks/features_0-cnt0l._.js +4 -0
- package/.next/server/chunks/features_0hdaci0._.js +4 -0
- package/.next/server/chunks/features_1e39j7-._.js +8 -0
- package/.next/server/chunks/features_bot_bot_query_ts_12mgkl2._.js +1 -1
- package/.next/server/chunks/features_memory_1uqvksn._.js +1 -1
- package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0r28-sm._.js → node_modules_consola_dist_chunks_prompt_mjs_0a7-pbw._.js} +1 -1
- package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0v_7drq._.js → node_modules_consola_dist_chunks_prompt_mjs_0gzvgfv._.js} +1 -1
- package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0i7cvml._.js → node_modules_consola_dist_chunks_prompt_mjs_107pxfn._.js} +1 -1
- package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0icqaqw._.js → node_modules_consola_dist_chunks_prompt_mjs_15hbel8._.js} +1 -1
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_18i-23e._.js +3 -0
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1bewgf3._.js +3 -0
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1kipdeo._.js +3 -0
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1nlww1m._.js +3 -0
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1q77nfx._.js +3 -0
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1xqdzx_._.js +3 -0
- package/.next/server/chunks/{node_modules_zod_v4_1801ax7._.js → node_modules_zod_v4_0lkux5-._.js} +2 -2
- package/.next/server/chunks/{node_modules_zod_v4_1cha_bw._.js → node_modules_zod_v4_1jmr9cq._.js} +2 -2
- package/.next/server/chunks/{node_modules_zod_v4_0ubdflj._.js → node_modules_zod_v4_1yrxmek._.js} +2 -2
- package/.next/server/chunks/node_modules_zod_v4_classic_errors_0tp0y-q.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__09q9med._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0bxsfyn._.js +101 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0lyi8i2._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__16jc196._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__172cq4x._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__18dthbp._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__18e68w8._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1fll8dc._.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]__1nygfik._.js +5 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1sdphb0._.js +8 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1waa3rc._.js +100 -0
- package/.next/server/chunks/ssr/_00rehl_._.js +3 -0
- package/.next/server/chunks/ssr/{_1lz_cq2._.js → _02oc_h5._.js} +76 -89
- package/.next/server/chunks/ssr/_03_928f._.js +3 -0
- package/.next/server/chunks/ssr/_05yghx6._.js +3 -0
- package/.next/server/chunks/ssr/_08c4z-9._.js +3 -0
- package/.next/server/chunks/ssr/_0_qfdlw._.js +4 -0
- package/.next/server/chunks/ssr/_0c9e5w6._.js +9 -0
- package/.next/server/chunks/ssr/{_0s99bgb._.js → _0dh2e1j._.js} +9 -3
- package/.next/server/chunks/ssr/_0dr-ddg._.js +3 -0
- package/.next/server/chunks/ssr/_0eaog6_._.js +3 -0
- package/.next/server/chunks/ssr/_0evkpto._.js +3 -0
- package/.next/server/chunks/ssr/_0g_rlog._.js +3 -0
- package/.next/server/chunks/ssr/_0geg212._.js +3 -0
- package/.next/server/chunks/ssr/{_1gd8q8l._.js → _0hxt2ul._.js} +2 -2
- package/.next/server/chunks/ssr/_0i_6q1w._.js +2 -2
- package/.next/server/chunks/ssr/_0lu1n_x._.js +1 -1
- package/.next/server/chunks/ssr/{_15j2_8f._.js → _0wzaht-._.js} +2 -2
- package/.next/server/chunks/ssr/_0z-g0uy._.js +3 -0
- package/.next/server/chunks/ssr/_123ttsf._.js +3 -0
- package/.next/server/chunks/ssr/_123y-ah._.js +3 -0
- package/.next/server/chunks/ssr/_12w42gi._.js +3 -0
- package/.next/server/chunks/ssr/_161kqav._.js +3 -0
- package/.next/server/chunks/ssr/{_0ap2fzn._.js → _16c6_xm._.js} +2 -2
- package/.next/server/chunks/ssr/_18opah7._.js +3 -0
- package/.next/server/chunks/ssr/_18xqmny._.js +3 -0
- package/.next/server/chunks/ssr/_1_krfph._.js +3 -0
- package/.next/server/chunks/ssr/{_1-_etts._.js → _1anqots._.js} +2 -2
- package/.next/server/chunks/ssr/_1ey7qn-._.js +70 -0
- package/.next/server/chunks/ssr/_1g9vs7q._.js +3 -0
- package/.next/server/chunks/ssr/_1jmz33w._.js +3 -0
- package/.next/server/chunks/ssr/{_0n3toaw._.js → _1k0spz7._.js} +2 -2
- package/.next/server/chunks/ssr/_1rgtxhr._.js +5 -0
- package/.next/server/chunks/ssr/_1slp25y._.js +3 -0
- package/.next/server/chunks/ssr/{_1fojd41._.js → _1x9pskj._.js} +3 -3
- package/.next/server/chunks/ssr/_1y6b5mr._.js +101 -0
- package/.next/server/chunks/ssr/_1ztk7p6._.js +7 -0
- package/.next/server/chunks/ssr/components_ui_tabs_tsx_0ej40b4._.js +3 -0
- package/.next/server/chunks/ssr/features_bot_thread_query_ts_023eklt._.js +4 -0
- 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/{_1-teee5._.js → lib_logger_ts_0-olsze._.js} +2 -7
- package/.next/server/chunks/ssr/{node_modules_0cxaxk9._.js → node_modules_00_51_v._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_04jf_m8._.js → node_modules_022sipm._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0g7fzk3._.js → node_modules_0332gw4._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1cx_ql6._.js → node_modules_04vxchl._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1vh5ntv._.js → node_modules_0746rzi._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0yugy6m._.js → node_modules_0d5uzof._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_09q35v_._.js → node_modules_0exkwcm._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_08dhkiq._.js → node_modules_0fr-ml8._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_14q6g4n._.js → node_modules_0mxvg8h._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0arus10._.js → node_modules_0qapgjr._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1eg7m6c._.js → node_modules_0qbfyjh._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1cz2hle._.js → node_modules_0t-9nup._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_17bwo43._.js → node_modules_0tusx4d._.js} +3 -3
- package/.next/server/chunks/ssr/{node_modules_1efrqxi._.js → node_modules_0vsxbzp._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0_-_a--._.js → node_modules_0vv0-fg._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1gdh31p._.js → node_modules_0wsvp00._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1hpopmo._.js → node_modules_1-urho9._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1_pc9kq._.js → node_modules_16pi_dd._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_00etblx._.js → node_modules_1d53yiq._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1aaxuef._.js → node_modules_1g1eihe._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_198nmll._.js → node_modules_1gpednh._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0pvd7q-._.js → node_modules_1gu1pph._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0b__sgl._.js → node_modules_1he1w8_._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1qpjvy5._.js → node_modules_1lnjapm._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0940ns5._.js → node_modules_1lynj9m._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0x3-ply._.js → node_modules_1seuurl._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_14om4ar._.js → node_modules_1u6w1pb._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0had7xd._.js → node_modules_1xn6saw._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1b748ic._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_067_exa._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1z4hm5e._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0nrrdaq._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@vercel_oidc_dist_06mk8id._.js → node_modules_@vercel_oidc_dist_21a5haa._.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_trash_mjs_0px2gzr._.js +3 -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 +68 -46
- package/.next/static/chunks/0dr16v67vj4n7.js +2 -0
- package/.next/static/chunks/0g4b348l0pve7.js +1 -0
- package/.next/static/chunks/0joan-69kbspd.js +1 -0
- package/.next/static/chunks/0vlgzqo9ka90v.js +1 -0
- package/.next/static/chunks/0zrupxgci5gqc.js +1 -0
- package/.next/static/chunks/10k2xvap03z20.css +1 -0
- package/.next/static/chunks/18mkhstgiqcbt.js +1 -0
- package/.next/static/chunks/{15m575979un5f.js → 1i-u2wzub_to1.js} +2 -2
- package/.next/static/chunks/1kp5nfp06nj9h.js +5 -0
- package/.next/static/chunks/1ohslk4568tm3.js +1 -0
- package/.next/static/chunks/1sbmwswc9k2-1.js +1 -0
- package/.next/static/chunks/1t9qms5pwwa3n.js +1 -0
- package/.next/static/chunks/1vj_5bnbxx84e.js +1 -0
- package/.next/static/chunks/1vqezbhjm3goq.js +1 -0
- package/.next/static/chunks/{3akmqm77muj4-.js → 1wlo979mx-y3w.js} +1 -1
- package/.next/static/chunks/26ql4y-43xwhp.js +1 -0
- package/.next/static/chunks/{0fl3gwe4-l6tz.js → 2_pnccjp6j1ca.js} +1 -1
- package/.next/static/chunks/2a51-ywz9b2a3.js +1 -0
- package/.next/static/chunks/2fvdgxih7x7hr.js +1 -0
- package/.next/static/chunks/2jlz8zp4jax_m.js +18 -0
- package/.next/static/chunks/2nvepds1fu2ux.js +1 -0
- package/.next/static/chunks/3addj3i4-izma.js +1 -0
- package/.next/static/chunks/3bfwpww3m3x4u.js +1 -0
- package/.next/static/chunks/3gfh7nxwusbt0.js +1 -0
- package/.next/static/chunks/3gwa44cvz4qoi.js +1 -0
- package/.next/static/chunks/{38gweqdo4jpfj.js → 3izg0a3k87q1-.js} +5 -5
- package/.next/static/chunks/3zk6q3-3f9swq.js +99 -0
- package/.next/static/chunks/3zkg5iup3v4a2.js +12 -0
- package/.next/static/chunks/405m0bqtoihev.js +1 -0
- package/.next/static/chunks/42wcg3wfg_m_p.js +1 -0
- package/README.md +27 -216
- package/app/api/events/app-event.ts +6 -4
- package/app/api/query-key.ts +25 -16
- package/bin/database.mjs +37 -0
- package/bin/thursday.mjs +44 -28
- package/components/ui/custom-icon.tsx +0 -60
- package/components/ui/radio-group.tsx +37 -0
- package/components/ui/shiny-text.tsx +33 -6
- package/database/migrations/{20260910173049_numerous_spirit → 20260916145701_clever_multiple_man}/migration.sql +80 -24
- package/database/migrations/{20260910173049_numerous_spirit → 20260916145701_clever_multiple_man}/snapshot.json +689 -110
- package/database/migrations/20260916160713_thread_cancelled/migration.sql +2 -0
- package/database/migrations/{20260911030320_opposite_jack_power → 20260916160713_thread_cancelled}/snapshot.json +706 -84
- package/docs/how-it-works.md +39 -36
- package/docs/images/keeps-going.png +0 -0
- package/docs/images/two-minds.png +0 -0
- package/docs/live-calls.md +231 -0
- package/docs/thread-rooms.md +71 -0
- package/features/ai/chatgpt.ts +1 -2
- package/features/ai/live.schema.ts +128 -0
- package/features/ai/load-tools.ts +148 -77
- package/features/ai/model.schema.ts +2 -120
- package/features/ai/model.ts +52 -88
- package/features/ai/prompts/bot.prompt.ts +91 -214
- package/features/ai/prompts/live.prompt.ts +265 -0
- package/features/ai/prompts/prompt-helper.ts +91 -32
- package/features/ai/prompts/thursday.prompt.ts +125 -172
- package/features/ai/tools/bot.tool.ts +38 -145
- package/features/ai/tools/call.tool.ts +1 -1
- package/features/ai/tools/connected.ts +5 -3
- package/features/ai/tools/mcp.tool.ts +7 -4
- package/features/ai/tools/memory.tool.ts +35 -31
- package/features/ai/tools/skills.tool.ts +36 -14
- package/features/ai/tools/studio.tool.ts +26 -21
- package/features/ai/tools/tool-name.ts +2 -5
- package/features/ai/tools/workspace.tool.ts +33 -10
- package/features/artifact/artifact.action.ts +2 -2
- package/features/artifact/artifact.query.ts +112 -61
- package/features/artifact/artifact.schema.ts +8 -6
- package/features/artifact/components/artifact-setting.tsx +83 -33
- package/features/bot/bot.action.ts +43 -36
- package/features/bot/bot.memory.ts +137 -20
- package/features/bot/bot.query.ts +28 -11
- package/features/bot/bot.run.ts +299 -636
- package/features/bot/bot.runner.ts +468 -844
- package/features/bot/bot.schema.ts +93 -82
- package/features/bot/bot.seed.ts +141 -64
- package/features/bot/components/bot-mark.tsx +324 -232
- package/features/bot/components/bot-room.tsx +1613 -697
- package/features/bot/components/bot-roster.tsx +8 -13
- package/features/bot/components/bot-setting.tsx +58 -42
- package/features/bot/components/bot-tool.tsx +55 -87
- package/features/bot/components/mark-palette.tsx +35 -32
- package/features/bot/components/path-chips.tsx +33 -3
- package/features/bot/components/thread-badge.tsx +34 -0
- package/features/bot/components/thread-reply.tsx +639 -0
- package/features/bot/components/thread-setting.tsx +674 -0
- package/features/bot/mark.const.ts +79 -31
- package/features/bot/room.query.ts +889 -0
- package/features/bot/room.schema.ts +64 -0
- package/features/bot/seed-bots.ts +2 -1
- package/features/bot/thread.query.ts +971 -0
- package/features/bot/thread.store.ts +587 -0
- package/features/config/components/voice-key.tsx +113 -88
- package/features/config/config.const.ts +5 -9
- package/features/connectors/mcp.schema.ts +0 -2
- package/features/intro/components/intro.tsx +169 -139
- package/features/memory/components/memory-setting.tsx +2 -7
- package/features/memory/memory.schema.ts +14 -23
- package/features/settings/components/setting-ui.tsx +0 -44
- package/features/settings/components/settings.tsx +12 -12
- package/features/settings/settings.alert.ts +3 -3
- package/features/settings/settings.store.ts +1 -1
- package/features/skills/skills.schema.ts +0 -2
- package/features/thursday/components/ascii-field.tsx +24 -44
- package/features/thursday/components/ascii-orb.tsx +359 -358
- package/features/thursday/components/call-log.tsx +46 -44
- package/features/thursday/components/face.tsx +35 -10
- package/features/thursday/components/tab-state.tsx +3 -3
- package/features/thursday/components/thursday-mark.tsx +1 -0
- package/features/thursday/components/thursday-setting.tsx +631 -332
- package/features/thursday/components/thursday.tsx +106 -41
- package/features/thursday/components/voice-picker.tsx +255 -0
- package/features/thursday/thursday.action.ts +94 -68
- package/features/thursday/thursday.query.ts +49 -30
- package/features/thursday/thursday.schema.ts +27 -30
- package/features/thursday/thursday.store.ts +11 -7
- package/features/thursday/tool-call.ts +3 -3
- package/features/thursday/tool-line.ts +5 -3
- package/features/thursday/use-thursday.ts +725 -450
- package/features/workspace/workspace.query.ts +17 -0
- package/features/workspace/workspace.ts +103 -50
- package/lib/live/live.schema.ts +47 -0
- package/lib/live/live.server.ts +155 -0
- package/lib/live/live.session.ts +574 -0
- package/lib/{realtime/realtime.tap.ts → live/live.tap.ts} +41 -12
- package/lib/live/live.transport.ts +152 -0
- package/lib/protocol/use-server-pages.ts +9 -5
- package/lib/utils.ts +21 -20
- package/package.json +2 -2
- package/public/voices/alloy.ogg +0 -0
- package/public/voices/ash.ogg +0 -0
- package/public/voices/ballad.ogg +0 -0
- package/public/voices/beacon.ogg +0 -0
- package/public/voices/bossa.ogg +0 -0
- package/public/voices/cedar.ogg +0 -0
- package/public/voices/cinder.ogg +0 -0
- package/public/voices/coral.ogg +0 -0
- package/public/voices/delta.ogg +0 -0
- package/public/voices/echo.ogg +0 -0
- package/public/voices/gleam.ogg +0 -0
- package/public/voices/marin.ogg +0 -0
- package/public/voices/meridian.ogg +0 -0
- package/public/voices/quartz.ogg +0 -0
- package/public/voices/ripple.ogg +0 -0
- package/public/voices/sage.ogg +0 -0
- package/public/voices/shimmer.ogg +0 -0
- package/public/voices/stone.ogg +0 -0
- package/public/voices/tempo.ogg +0 -0
- package/public/voices/verse.ogg +0 -0
- package/public/voices/vesper.ogg +0 -0
- package/public/voices/willow.ogg +0 -0
- package/scripts/artifact-paths.test.mts +25 -0
- package/scripts/bot-context.test.mts +1408 -0
- package/scripts/live-history.test.mts +115 -0
- package/scripts/live-session.test.mts +948 -0
- package/server.js +1 -1
- package/skills/browser/SKILL.md +17 -6
- package/skills/computer/SKILL.md +1 -1
- package/skills/find-skills/SKILL.md +3 -8
- package/skills/interactive-page/SKILL.md +12 -7
- package/skills/interactive-page/references/diagram.md +89 -0
- package/skills/interactive-page/scripts/archify/LICENSE +22 -0
- package/skills/interactive-page/scripts/archify/README.md +25 -0
- package/skills/interactive-page/scripts/archify/assets/JetBrainsMono-OFL.txt +93 -0
- package/skills/interactive-page/scripts/archify/assets/template.html +14934 -0
- package/skills/interactive-page/scripts/archify/bin/archify.mjs +2126 -0
- package/skills/interactive-page/scripts/archify/bin/open-artifact.mjs +86 -0
- package/skills/interactive-page/scripts/archify/bin/preview.mjs +653 -0
- package/skills/interactive-page/scripts/archify/bin/visual-check.mjs +829 -0
- package/skills/interactive-page/scripts/archify/delta/architecture-delta.mjs +1223 -0
- package/skills/interactive-page/scripts/archify/examples/agent-run.lifecycle.json +60 -0
- package/skills/interactive-page/scripts/archify/examples/agent-tool-call.workflow.json +94 -0
- package/skills/interactive-page/scripts/archify/examples/async-job-roundtrip.sequence.json +61 -0
- package/skills/interactive-page/scripts/archify/examples/cache-miss-request.sequence.json +82 -0
- package/skills/interactive-page/scripts/archify/examples/checkout-platform.base.architecture.json +31 -0
- package/skills/interactive-page/scripts/archify/examples/checkout-platform.head.architecture.json +31 -0
- package/skills/interactive-page/scripts/archify/examples/deployment-release.lifecycle.json +49 -0
- package/skills/interactive-page/scripts/archify/examples/event-stream.dataflow.json +57 -0
- package/skills/interactive-page/scripts/archify/examples/incident-response.workflow.json +64 -0
- package/skills/interactive-page/scripts/archify/examples/product-analytics.dataflow.json +76 -0
- package/skills/interactive-page/scripts/archify/examples/production-deployment.architecture.json +71 -0
- package/skills/interactive-page/scripts/archify/examples/release-delivery.workflow.json +62 -0
- package/skills/interactive-page/scripts/archify/examples/web-app.architecture.json +46 -0
- package/skills/interactive-page/scripts/archify/migrations/workflow-v2.mjs +279 -0
- package/skills/interactive-page/scripts/archify/recipes/scenarios.mjs +284 -0
- package/skills/interactive-page/scripts/archify/references/authoring-contract.md +243 -0
- package/skills/interactive-page/scripts/archify/references/delivery-contract.md +120 -0
- package/skills/interactive-page/scripts/archify/references/viewer-runtime.md +45 -0
- package/skills/interactive-page/scripts/archify/renderers/architecture/grid.mjs +62 -0
- package/skills/interactive-page/scripts/archify/renderers/architecture/render-architecture.mjs +1078 -0
- package/skills/interactive-page/scripts/archify/renderers/dataflow/README.md +104 -0
- package/skills/interactive-page/scripts/archify/renderers/dataflow/render-dataflow.mjs +483 -0
- package/skills/interactive-page/scripts/archify/renderers/lifecycle/README.md +115 -0
- package/skills/interactive-page/scripts/archify/renderers/lifecycle/render-lifecycle.mjs +561 -0
- package/skills/interactive-page/scripts/archify/renderers/sequence/README.md +114 -0
- package/skills/interactive-page/scripts/archify/renderers/sequence/render-sequence.mjs +464 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/brand-marks.mjs +563 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/cli.mjs +218 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/desktop-readability.mjs +26 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/diagnostics.mjs +127 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/engineering-profiles.mjs +157 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/generated-brand-marks.mjs +3 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/generated-validators.mjs +13 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/geometry.mjs +1423 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/i18n.mjs +595 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/layout-report.mjs +40 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/legend.mjs +217 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/output-path.mjs +340 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/repository-evidence.mjs +238 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/repository-location.mjs +58 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/text-fit.mjs +49 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/utils.mjs +232 -0
- package/skills/interactive-page/scripts/archify/renderers/shared/validator.mjs +86 -0
- package/skills/interactive-page/scripts/archify/renderers/workflow/README.md +223 -0
- package/skills/interactive-page/scripts/archify/renderers/workflow/render-workflow.mjs +35 -0
- package/skills/interactive-page/scripts/archify/renderers/workflow/workflow-compiler.mjs +4400 -0
- package/skills/interactive-page/scripts/archify/renderers/workflow/workflow-migration-geometry.mjs +144 -0
- package/skills/interactive-page/scripts/archify/schemas/README.md +211 -0
- package/skills/interactive-page/scripts/archify/schemas/architecture.schema.json +178 -0
- package/skills/interactive-page/scripts/archify/schemas/common.schema.json +115 -0
- package/skills/interactive-page/scripts/archify/schemas/dataflow.schema.json +243 -0
- package/skills/interactive-page/scripts/archify/schemas/lifecycle.schema.json +266 -0
- package/skills/interactive-page/scripts/archify/schemas/sequence.schema.json +223 -0
- package/skills/interactive-page/scripts/archify/schemas/workflow.schema.json +428 -0
- package/skills/interactive-page/scripts/archify/scripts/check-render-output.mjs +916 -0
- package/skills/interactive-page/scripts/archify/scripts/render-examples.mjs +26 -0
- package/skills/interactive-page/scripts/bundle-artifact.sh +9 -8
- package/skills/skill-creator/SKILL.md +4 -5
- package/.next/server/app/api/bot/task/[id]/route/app-paths-manifest.json +0 -3
- package/.next/server/app/api/bot/task/[id]/route.js +0 -16
- package/.next/server/app/api/bot/task/[id]/route.js.nft.json +0 -1
- package/.next/server/app/api/bot/task/[id]/route_client-reference-manifest.js +0 -3
- package/.next/server/app/api/bot/task/route/app-paths-manifest.json +0 -3
- package/.next/server/app/api/bot/task/route.js +0 -16
- package/.next/server/app/api/bot/task/route.js.nft.json +0 -1
- package/.next/server/app/api/bot/task/route_client-reference-manifest.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__01dkp4a._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__02va5wz._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__02xjoto._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__04q--0f._.js +0 -8
- package/.next/server/chunks/[root-of-the-server]__0bl-e63._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ffbg85._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0jq4ohy._.js +0 -8
- package/.next/server/chunks/[root-of-the-server]__0ls6_8y._.js +0 -8
- package/.next/server/chunks/[root-of-the-server]__0ncs9uu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1-ga0kh._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__11n256_._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__12cabg9._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1339jnv._.js +0 -8
- package/.next/server/chunks/[root-of-the-server]__18_teo8._.js +0 -8
- package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__1anc1p9._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ccon1w._.js +0 -10
- package/.next/server/chunks/[root-of-the-server]__1fizn31._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1llj3-b._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1p8m3f4._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1wa1k7r._.js +0 -8
- package/.next/server/chunks/_0-73of8._.js +0 -55
- package/.next/server/chunks/_0-fjql4._.js +0 -26
- package/.next/server/chunks/_00xh_q0._.js +0 -25
- package/.next/server/chunks/_03a0897._.js +0 -3
- package/.next/server/chunks/_051qh8u._.js +0 -3
- package/.next/server/chunks/_05sovvj._.js +0 -3
- package/.next/server/chunks/_0fzqt2y._.js +0 -134
- package/.next/server/chunks/_0mecv0f._.js +0 -26
- package/.next/server/chunks/_0mh8j4m._.js +0 -3
- package/.next/server/chunks/_0obojvv._.js +0 -3
- package/.next/server/chunks/_0sb7tlz._.js +0 -3
- package/.next/server/chunks/_0sbynis._.js +0 -3
- package/.next/server/chunks/_0u10wmw._.js +0 -55
- package/.next/server/chunks/_0u4aiy2._.js +0 -3
- package/.next/server/chunks/_0wp4le3._.js +0 -3
- package/.next/server/chunks/_0y5fg-x._.js +0 -3
- package/.next/server/chunks/_1230wbx._.js +0 -10
- package/.next/server/chunks/_12nheja._.js +0 -3
- package/.next/server/chunks/_13510xh._.js +0 -3
- package/.next/server/chunks/_15hq89o._.js +0 -3
- package/.next/server/chunks/_18-1wcc._.js +0 -55
- package/.next/server/chunks/_1_9mjx-._.js +0 -3
- package/.next/server/chunks/_1c78vw5._.js +0 -229
- package/.next/server/chunks/_1h5_8sk._.js +0 -3
- package/.next/server/chunks/_1hdnxb7._.js +0 -3
- package/.next/server/chunks/_1j8k_j5._.js +0 -3
- package/.next/server/chunks/_1nula3v._.js +0 -3
- package/.next/server/chunks/_1php4eq._.js +0 -3
- package/.next/server/chunks/_1yuv4vp._.js +0 -3
- package/.next/server/chunks/_1zjrdag._.js +0 -3
- package/.next/server/chunks/_next-internal_server_app_api_bot_task_[id]_route_actions_1_k_8u3.js +0 -3
- package/.next/server/chunks/_next-internal_server_app_api_bot_task_route_actions_0xln6ra.js +0 -3
- package/.next/server/chunks/features_0rpfxbk._.js +0 -3
- package/.next/server/chunks/features_1qf3cei._.js +0 -3
- package/.next/server/chunks/features_bot_0zt92oh._.js +0 -3
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1xoq2rl._.js +0 -3
- package/.next/server/chunks/ssr/[externals]__0dizgek._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__092knlj._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0mz33a7._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0s9dq5u._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0s9l2sv._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0vnmv-s._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0xsog8n._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__10-dz5o._.js +0 -61
- package/.next/server/chunks/ssr/[root-of-the-server]__1gtlw6v._.js +0 -43
- package/.next/server/chunks/ssr/[root-of-the-server]__1ox7hbk._.js +0 -4
- package/.next/server/chunks/ssr/[root-of-the-server]__202p40z._.js +0 -3
- package/.next/server/chunks/ssr/_001_ms1._.js +0 -28
- package/.next/server/chunks/ssr/_01n3o0m._.js +0 -3
- package/.next/server/chunks/ssr/_0fz4mf_._.js +0 -3
- package/.next/server/chunks/ssr/_0gb4gmf._.js +0 -3
- package/.next/server/chunks/ssr/_0h42fze._.js +0 -3
- package/.next/server/chunks/ssr/_0h7zdni._.js +0 -3
- package/.next/server/chunks/ssr/_0ilna52._.js +0 -42
- package/.next/server/chunks/ssr/_0q0zan6._.js +0 -70
- package/.next/server/chunks/ssr/_0zcjrbg._.js +0 -3
- package/.next/server/chunks/ssr/_0zhoc3r._.js +0 -3
- package/.next/server/chunks/ssr/_13fke0x._.js +0 -3
- package/.next/server/chunks/ssr/_18cymkq._.js +0 -3
- package/.next/server/chunks/ssr/_1b2mjwr._.js +0 -3
- package/.next/server/chunks/ssr/_1f-dg-6._.js +0 -3
- package/.next/server/chunks/ssr/_1h0rw11._.js +0 -3
- package/.next/server/chunks/ssr/_1jhd09t._.js +0 -3
- package/.next/server/chunks/ssr/_1nnsk7z._.js +0 -3
- package/.next/server/chunks/ssr/_1ov37if._.js +0 -3
- package/.next/server/chunks/ssr/_1sji22n._.js +0 -3
- package/.next/server/chunks/ssr/_1vi_uo7._.js +0 -3
- package/.next/server/chunks/ssr/_1vyd1ji._.js +0 -3
- package/.next/server/chunks/ssr/_1xx4zlb._.js +0 -3
- package/.next/server/chunks/ssr/components_ui_1y1l7yj._.js +0 -3
- package/.next/server/chunks/ssr/features_bot_1s_-2vj._.js +0 -3
- package/.next/server/chunks/ssr/lib_realtime_12wg_dd._.js +0 -27
- package/.next/server/chunks/ssr/lib_realtime_15h_v1v._.js +0 -27
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0npjf8-._.js +0 -3
- package/.next/static/chunks/00rd4-v8r7axp.js +0 -1
- package/.next/static/chunks/08qe4as2q428z.js +0 -3
- package/.next/static/chunks/0gnqdjn2lvdad.js +0 -2
- package/.next/static/chunks/0hwap1-p0m5sa.js +0 -1
- package/.next/static/chunks/0r5qcctujhxli.js +0 -1
- package/.next/static/chunks/0w52rrrmuj9r9.js +0 -1
- package/.next/static/chunks/0wcprt5ot5she.js +0 -1
- package/.next/static/chunks/10teww7wt-f6h.js +0 -1
- package/.next/static/chunks/17p6tk6k88dq6.js +0 -1
- package/.next/static/chunks/18a96rkhi4_yd.js +0 -1
- package/.next/static/chunks/1dkjg87pxk0n9.js +0 -28
- package/.next/static/chunks/1jd09sxcjddu1.js +0 -1
- package/.next/static/chunks/1w73ece_6bheu.js +0 -18
- package/.next/static/chunks/214ya3n5gxeih.js +0 -1
- package/.next/static/chunks/22_zkas21rpna.js +0 -1
- package/.next/static/chunks/2fh4-3z_q8b_w.js +0 -1
- package/.next/static/chunks/2h0sd2vumhb15.js +0 -1
- package/.next/static/chunks/2t4vhi3m8ahya.js +0 -1
- package/.next/static/chunks/2tigdtz3dpcy8.js +0 -1
- package/.next/static/chunks/2u7xt6mxg44lf.js +0 -1
- package/.next/static/chunks/3786h5vayt80-.js +0 -28
- package/.next/static/chunks/39j0fvpybzabl.js +0 -40
- package/.next/static/chunks/3cq5g494yuke8.css +0 -1
- package/.next/static/chunks/3hibbjnt85-k6.js +0 -1
- package/.next/static/chunks/3woj-xd7ki5_i.js +0 -1
- package/.next/static/chunks/3xk7yqgomx7yq.js +0 -1
- package/.next/static/chunks/3zmcsnuo25zvq.js +0 -1
- package/database/migrations/20260911030320_opposite_jack_power/migration.sql +0 -1
- package/docs/images/task-thread.png +0 -0
- package/features/bot/components/task-badge.tsx +0 -42
- package/features/bot/components/task-reply.tsx +0 -328
- package/features/bot/components/task-setting.tsx +0 -524
- package/features/bot/task.query.ts +0 -976
- package/features/bot/task.store.ts +0 -489
- package/lib/realtime/client-secret.ts +0 -86
- package/lib/realtime/open-session.ts +0 -31
- package/lib/realtime/openai.ts +0 -35
- package/lib/realtime/realtime.audio.ts +0 -196
- package/lib/realtime/realtime.driver.ts +0 -489
- package/lib/realtime/realtime.protocol.ts +0 -393
- package/lib/realtime/realtime.schema.ts +0 -37
- package/lib/realtime/realtime.session.ts +0 -106
- package/lib/realtime/realtime.transport.ts +0 -384
- package/lib/realtime/xai.ts +0 -39
- /package/.next/server/app/api/bot/{task → thread}/[id]/route/build-manifest.json +0 -0
- /package/.next/server/app/api/bot/{task → thread}/[id]/route/server-reference-manifest.json +0 -0
- /package/.next/server/app/api/bot/{task → thread}/[id]/route.js.map +0 -0
- /package/.next/server/app/api/bot/{task → thread}/route/build-manifest.json +0 -0
- /package/.next/server/app/api/bot/{task → thread}/route/server-reference-manifest.json +0 -0
- /package/.next/server/app/api/bot/{task → thread}/route.js.map +0 -0
- /package/.next/static/{kaTO0UHqF1bMnWgCDik2f → 0qzGoKn2wTERVZtblX1tp}/_buildManifest.js +0 -0
- /package/.next/static/{kaTO0UHqF1bMnWgCDik2f → 0qzGoKn2wTERVZtblX1tp}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{kaTO0UHqF1bMnWgCDik2f → 0qzGoKn2wTERVZtblX1tp}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[629668,e=>{"use strict";var i=e.i(687388);let m=e=>`text/${e}; charset=utf-8`,n={md:{kind:"markdown",mime:m("markdown")},markdown:{kind:"markdown",mime:m("markdown")},csv:{kind:"csv",mime:m("csv")},json:{kind:"json",mime:"application/json; charset=utf-8"},txt:{kind:"text",mime:m("plain")},log:{kind:"text",mime:m("plain")},html:{kind:"frame",mime:m("html")},htm:{kind:"frame",mime:m("html")},pdf:{kind:"frame",mime:"application/pdf"},png:{kind:"image",mime:"image/png"},jpg:{kind:"image",mime:"image/jpeg"},jpeg:{kind:"image",mime:"image/jpeg"},gif:{kind:"image",mime:"image/gif"},webp:{kind:"image",mime:"image/webp"},svg:{kind:"image",mime:"image/svg+xml"},mp3:{kind:"audio",mime:"audio/mpeg"},wav:{kind:"audio",mime:"audio/wav"},mp4:{kind:"video",mime:"video/mp4"},webm:{kind:"video",mime:"video/webm"},css:{kind:"none",mime:m("css")},js:{kind:"none",mime:m("javascript")},woff2:{kind:"none",mime:"font/woff2"}},t=e=>e.split(".").pop()?.toLowerCase()??"",a=new Set(["node_modules","__pycache__"]),d=Object.entries(n).filter(([,e])=>"none"!==e.kind).map(([e])=>e),s=RegExp(String.raw`(?<![\p{L}\p{N}_/:@%-])(?:[\p{L}\p{N}_.@%-]+/)*[\p{L}\p{N}_@%-]+(?:\.[\p{L}\p{N}_-]+)*\.(?:${d.join("|")})\b`,"giu"),o=`${i.PATHS.workspace}/`;e.s(["isListedFolder",0,e=>!e.startsWith(".")&&!a.has(e),"mimeOf",0,e=>n[t(e)]?.mime??"application/octet-stream","pathsIn",0,function(e){let i=e.replace(/\b[a-z][\w+.-]*:\/\/\S+/gi," "),m=new Set;for(let e of i.match(s)??[]){let i=function(e){let i,m,n=(m=(i=e.trim()).indexOf(o))>=0?i.slice(m+o.length)||null:i.startsWith("/")||/^[A-Za-z]:/.test(i)||i.split("/").includes("..")?null:i||null;if(!n)return null;let[t,...a]=n.split("/");return a.length&&t.includes(".")?null:n}(e);i&&m.add(i)}return[...m].slice(0,6)},"viewKindOf",0,e=>n[t(e)]?.kind??"none"])},329280,e=>{e.v(i=>Promise.all(["server/chunks/[externals]_node_readline_1u65a-m._.js","server/chunks/node_modules_consola_dist_chunks_prompt_mjs_02axwqv._.js"].map(i=>e.l(i))).then(()=>i(781937)))}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=_1dbixxz._.js.map
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
module.exports=[851372,e=>e.a(async(t,a)=>{try{var r=e.i(343747),o=e.i(687388),n=e.i(353885),i=e.i(393189),s=e.i(265143),l=e.i(148831),d=e.i(619898),h=e.i(636882),u=e.i(786025),c=e.i(704161),w=e.i(640911),p=e.i(41444),b=e.i(660948),m=e.i(54282),y=t([s,l,d,b]);async function f(e,t,a,y){var f,k,I,v,W,$,q,x,R;let O,M,A,N,S,E,C=await (0,u.openWorkspace)(),D=e.trim(),[_,B,U,P,j,L,H,Y]=await Promise.all([(0,h.loadSkills)(C),(0,d.listNoteIndex)(),(0,b.listConnectedToolNames)(),(0,l.findPinnedTools)(D),(0,s.listJobBots)(),(0,i.listBotMemory)(D),(0,s.readBotMemoryOn)(),(0,u.readMachineTools)(C)]),J=j.filter(e=>e.name!==D),F=[(f=D,k=a,M=(O=k?.owner??f)===f?"**You** coordinate this thread: its result goes from you to Thursday.":`**${O}** coordinates this thread and brings its result to Thursday.`,A=k?`
|
|
2
|
+
|
|
3
|
+
Current conversation: ${k.caller} → ${f}. Your final text goes back to ${k.caller}. Message ID: ${k.messageId??"initial request"}.`:"",`You are ${f}, one of the bots in this thread. ${(0,m.nowLine)()}
|
|
4
|
+
|
|
5
|
+
- **The user** — the one person all of this is for. They talk with Thursday by voice and follow this thread on their screen.
|
|
6
|
+
- **Thursday** — their personal assistant. She talks with them, hands bots the work that takes time, and tells them what comes back.
|
|
7
|
+
- ${M}
|
|
8
|
+
- **Everyone on it** keeps their own work and conversation; the others see only the messages sent to them.${A}
|
|
9
|
+
|
|
10
|
+
**The job is done, not described.** You are on the user's own computer, with a shell, files and the web, and how you get there is yours: when one way fails, try another; where no tool exists, write one — \`node\` is always here. Before deciding something cannot be done, look at what you have — your tools, the other bots, this machine. Bring back the thing itself — their account, their file, the real result — not a smaller, safer stand-in, and not a note on why not.
|
|
11
|
+
|
|
12
|
+
**Never present a guess as a result.** Thursday says what you return out loud, as fact: say which part is unverified and why.`),(I=B,`## Thursday's memory of the user
|
|
13
|
+
|
|
14
|
+
What Thursday keeps from talking with them. When the job needs something about them, open the note with \`${n.TOOL_NAMES.memory_recall}\`; a fact marked \`said\` came from a call, and \`${n.TOOL_NAMES.memory_conversation}\` opens that call. What you learn about them goes in your answer — Thursday decides what to keep.
|
|
15
|
+
|
|
16
|
+
path — what is under it (facts) "what the user calls it"
|
|
17
|
+
|
|
18
|
+
${(0,m.noteLines)(I)}`),function(e,t){let a=new Set(t.map(e=>`${e.server}/${e.name}`)),r=e.filter(e=>!a.has(`${e.server}/${e.name}`));if(0===r.length)return"";let o=a.size?" The ones you already hold are in your tools instead.":"";return`## Connected tools
|
|
19
|
+
|
|
20
|
+
${(0,m.mcpToolLines)(r)}
|
|
21
|
+
|
|
22
|
+
Names only: \`${n.TOOL_NAMES.tool_search}\` returns what each one takes, \`${n.TOOL_NAMES.tool_call}\` runs one.${o}`}(U,P),(v=_,0===v.length?"":`## Skills
|
|
23
|
+
|
|
24
|
+
Written-down ways of doing things. Open one with \`${n.TOOL_NAMES.load_skill}\` before a job it covers, unless its instructions are already in your conversation.
|
|
25
|
+
|
|
26
|
+
${(0,m.skillLines)(v)}`),T(C.cwd,Y,y),H?(W=(0,i.botMemoryFolder)(D),N=($=L).entries.length?$.entries.map(({file:e,line:t,at:a})=>{let n=t?` — ${(0,p.clip)(t,o.PROMPT_LINE.botMemory)}`:"";return`- ${e}${n} \xb7 ${(0,r.format)((0,c.toDate)(a),"yyyy-MM-dd")}`}).join("\n"):"Empty.",S=$.total>$.entries.length?`
|
|
27
|
+
|
|
28
|
+
The newest ${$.entries.length} of ${$.total}; \`ls ${W}\` for the rest.`:"",`## Your memory
|
|
29
|
+
|
|
30
|
+
What you learned on your own earlier jobs, in \`${W}/\`: one topic per file, its first line saying what it holds, read by no other bot, up to ${o.BOT_MEMORY_LIMITS.files} files of ${o.BOT_MEMORY_LIMITS.chars.toLocaleString("en-US")} characters each. It is how you get better at this work. When a job teaches you something a later one would otherwise find out again — how a site signs in, the way through its screens, a command that turned out right — keep it with the date it was true, and fix or delete what proved wrong. No passwords, keys or codes.
|
|
31
|
+
|
|
32
|
+
${N}${S}`):"",(q=J,0===q.length?"":`## Bots
|
|
33
|
+
|
|
34
|
+
${q.map(e=>`- **${e.name}** — ${e.description}`).join("\n")}
|
|
35
|
+
|
|
36
|
+
These lines were written for the user: where one says "you", it means them. When part of the job is another bot's strength, bring it in with \`${n.TOOL_NAMES.send_message}\` rather than rebuilding it yourself.`),(x=D,R=a,E=(R?.owner??x)===x?"Bring what you received together into one result for Thursday: what was done, where it is, what you decided that the request did not say, and what is still open, at the detail the user asked for.":`Your final text goes back to ${R?.caller??"whoever asked"}: give them everything they need to carry on.`,`## Working together
|
|
37
|
+
|
|
38
|
+
Nobody sees your work but you, and you see only what others send you, so whatever crosses between you has to stand on its own. A request says what is wanted, what is already known or done, and where the files are; an answer gives exact values, file paths and what is still unverified. Tell whoever is waiting when something they depend on changes. End your turn when you have nothing more to do now: replies arrive as new messages and wake you.
|
|
39
|
+
|
|
40
|
+
Ask Thursday with kind \`question\` only for a decision, permission or something only the user knows: clearly, with the context to answer, and short options when they help. Use kind \`message\` for news that needs no answer, and your final text for the result.
|
|
41
|
+
|
|
42
|
+
${E}
|
|
43
|
+
|
|
44
|
+
Write in the user's language. Put finished work in \`${(0,u.botArtifacts)(x)}/\` and name the paths. The app opens Markdown with its tables and mermaid blocks drawn, CSV as a table, HTML and PDF as pages, and images, audio and video; in Markdown, reference images by absolute route (\`/api/file/${o.PATHS.artifacts}/…\`).`),g(t)].filter(Boolean).join("\n\n");return(0,m.logPromptSize)("bot",F),w.logger.debug(`bot prompt
|
|
45
|
+
${F}`),{text:F}}[s,l,d,b]=y.then?(await y)():y;let g=e=>e?.trim()?`## Owner's instructions
|
|
46
|
+
|
|
47
|
+
Written by the person this bot works for. Where these and anything above disagree, these win.
|
|
48
|
+
|
|
49
|
+
${e.trim()}`:"",T=(e,t,a)=>{var r;let i,s;return`## Environment
|
|
50
|
+
|
|
51
|
+
Current Cwd: ${e}
|
|
52
|
+
Platform: ${process.platform}
|
|
53
|
+
${r=t,i=(e,t)=>`${e}: ${t.found.length?t.found.join(", "):"none"}.${t.missing.length?` Not here: ${t.missing.join(", ")}.`:""}`,s=r.managers.found.includes("pnpm")?" Use pnpm, not npm — this workspace is fenced for it (`pnpm-workspace.yaml`, `.npmrc`).":"",[i("Runtimes",r.runtimes),`${i("Package managers",r.managers)}${s}`,null===r.browser?"":`Browser: ${r.browser?"installed":"not installed"}.`].filter(Boolean).join("\n")}
|
|
54
|
+
|
|
55
|
+
Read off this machine as the job opened: what is already here, not the limit of what you can use.
|
|
56
|
+
|
|
57
|
+
Your workspace, where \`${n.TOOL_NAMES.bash}\` runs. Everything you write goes in one of these folders, kept apart because what is in them lives for different lengths of time:
|
|
58
|
+
|
|
59
|
+
- \`${a?.artifacts??o.PATHS.artifacts}/\` — finished work the user opens, one entry per result. Theirs, and it stays.
|
|
60
|
+
- \`${o.PATHS.projects}/\` — code you build, one folder each; it outlives this job, and its dependencies install inside it, never at the workspace root.
|
|
61
|
+
- \`${a?.scratch??o.PATHS.scratch}/\` — this job's working material, shared by every bot on it; cleared ${Math.round(o.WORKSPACE_KEEP.forMs/864e5)} days after the job ends.
|
|
62
|
+
- \`${a?.own??o.PATHS.bots}/\` — yours across every job you run here: what you keep for next time.
|
|
63
|
+
|
|
64
|
+
Inside the workspace, set up whatever the job needs yourself; installing anything machine-wide waits for the user's yes. Never the directory above the workspace — it is the app's, not the user's; outside the workspace, only where the user pointed you.`};e.s(["buildThreadOpening",0,function(e){let t="user"===e.from?"The user":"Thursday";return[{type:"text",text:`You are ${e.bot}. ${t} hands you this thread${"user"===e.from?" on screen":" during a call"}.`},{type:"text",text:`## ${t} → ${e.bot}: the job
|
|
65
|
+
|
|
66
|
+
${e.request.trim()}`}]},"loadBotPrompt",0,f]),a()}catch(e){a(e)}},!1),585099,e=>e.a(async(t,a)=>{try{var r=e.i(68356),o=e.i(847841),n=e.i(687388),i=e.i(159479),s=e.i(386075),l=e.i(851372),d=e.i(316172),h=e.i(353885),u=e.i(944971),c=e.i(786025),w=e.i(640911),p=e.i(388439),b=e.i(265143),m=e.i(378884),y=t([i,s,l,b,m]);[i,s,l,b,m]=y.then?(await y)():y;let I=n.BOT_RUN.steps;async function f(e,t){var a,y;let f,k,W,$,q,x,R,O,M,A=t.parent??null,N=await (0,b.findJobBot)(e.bot.trim()),S=N?.name??e.bot.trim(),E=e=>t.emit({...e,bot:S,parent:A});if(!N)return void await E({type:"error",message:`No bot named "${e.bot}". Use a name from the list.`,retry:!1});let C=e.messages,D=await ((a=N).provider&&a.model?(0,s.getTextModel)({provider:a.provider,model:a.model}):(0,s.resolveDefaultModel)().then(s.getTextModel)),_=t.threadId?await (0,m.findThread)(t.threadId):null,[B,{own:U,artifacts:P}]=await Promise.all([t.threadId?(0,c.openJobScratch)(t.threadId,_?.label??"job"):null,(0,c.openBotFolders)(S)]),[j,L]=await Promise.all([(0,l.loadBotPrompt)(S,N.systemPrompt,{owner:t.owner,caller:t.caller,messageId:A},{scratch:B,own:U,artifacts:P}),(0,i.loadTools)({target:"bot",bot:S,session:t.session??(t.threadId?(0,c.botBrowserSession)(t.threadId,S):null),model:D})]),H=Math.min(await (0,s.compactBudget)(D.ref,N.compactAt),t.contextBudget||1/0),Y=!1,J={...L,[h.TOOL_NAMES.send_message]:(0,o.tool)({description:d.sendMessageSpec.description,inputSchema:d.sendMessageSpec.parameters,execute:async(e,a)=>{let r=await t.send({...e,id:a.toolCallId});return"question"===e.kind&&(Y=!0),r}})},F=new Set,K=(y=n.BOT_RUN.silenceMs,k=new AbortController,W=0,$=!1,q=()=>{clearTimeout(f),f=void 0,$||W>0||(f=setTimeout(()=>{k.abort(new DOMException(`The model sent nothing for ${Math.round(y/6e4)} minutes.`,"TimeoutError"))},y))},{signal:k.signal,touch:q,hold:()=>{W+=1,q()},release:()=>{W=Math.max(0,W-1),q()},end:()=>{$=!0,q()}});for(let[e,a]of Object.entries(J)){let r=a.execute;r&&(a.execute=(a,o)=>{let n=(async()=>{t.signal?.throwIfAborted(),await E({type:"tool",id:o.toolCallId,name:e,input:a}),K.hold();try{t.signal?.throwIfAborted();let n=await r(a,o);if(n&&"object"==typeof n&&Symbol.asyncIterator in n){let e;for await(let t of n)e=t;n=e}return await E({type:"tool-result",id:o.toolCallId,name:e,output:n}),n}catch(t){throw await E({type:"tool-result",id:o.toolCallId,name:e,output:(0,s.modelErrorToString)(t),error:!0}),t}finally{K.release()}})();return F.add(n),n.finally(()=>F.delete(n)).catch(()=>{}),n})}let z=Promise.resolve(),G=()=>{},V=0,Q=new r.ToolLoopAgent({model:D.model,instructions:j.text,tools:J,stopWhen:[(0,r.stepCountIs)(I),()=>Y],prepareStep:async({stepNumber:e,steps:a,messages:r})=>{await z,t.signal?.throwIfAborted();let o={},n=a.at(-1)?.usage.inputTokens??0,i=Math.max(n,r.reduce((e,t)=>e+(0,p.estimateTokens)("string"==typeof t.content?t.content:JSON.stringify(t.content))+4,0));V=i;let s=r;if(i>H&&r.length>2){K.hold();let e=await T(D.model,J,r,{signal:t.signal,budget:H,instructions:j.text}).finally(K.release);w.logger.debug(`compacted ${r.length} messages at ${i} tokens (budget ${H})`);let a=`${e.text}${await g(_?.id??null,r,B)}`;await E({type:"compact",text:a,usage:e.usage,messages:r.length,tokens:i}),s=[r[0],{role:"user",content:a}]}let l=e>0?await t.notes?.()??[]:[];return(l.length&&(s=[...s,...l.map(e=>({role:"user",content:e}))]),s===r)?o:{...o,messages:s}}}),X=(x=[],R=[],O=!1,{push(e){let t=R.shift();t?t(e):x.push(e)},take(){let e=x.shift();return e?Promise.resolve(e):O?Promise.resolve(null):new Promise(e=>R.push(e))},end(){for(let e of(O=!0,R.splice(0)))e(null)}}),Z=t.signal?AbortSignal.any([t.signal,K.signal]):K.signal;K.touch();let ee=new AbortController,et=AbortSignal.any([Z,ee.signal]);try{M=await Q.stream({messages:C,abortSignal:et,onStepEnd:e=>{z=new Promise(e=>{G=e}),X.push({messages:e.response.messages,usage:v(e.usage)})}})}catch(e){throw K.end(),ee.abort(),await Promise.allSettled([...F]),e}let ea="",er="",eo=null,en=e=>{w.logger.error(`${S}: the model run broke`,e);let t=(0,s.modelErrorToString)(e),a=!(0,s.isProviderRefusal)(e);if(!(0,s.isContextOverflow)(e))return{type:"error",message:t,retry:a};let r=Math.floor(Math.min(H,V||H)*n.BOT_RUN.overflowShrink);return{type:"error",message:t,budget:Math.max(u.COMPACT_AT_MIN,r),retry:a}};Z.addEventListener("abort",()=>{X.end(),G()},{once:!0});try{for await(let e of M.fullStream)switch(K.touch(),e.type){case"start-step":er="",ea="";break;case"text-delta":ea+=e.text;break;case"text-end":{let e=ea.trim();if(ea="",!e)break;er=[er,e].filter(Boolean).join("\n\n"),await E({type:"text",text:e});break}case"tool-call":await E({type:"tool",id:e.toolCallId,name:e.toolName,input:e.input,providerExecuted:e.providerExecuted,providerOptions:e.providerMetadata});break;case"tool-result":await E({type:"tool-result",id:e.toolCallId,name:e.toolName,output:e.output});break;case"tool-error":await E({type:"tool-result",id:e.toolCallId,name:e.toolName,output:(0,s.modelErrorToString)(e.error),error:!0});break;case"finish-step":{eo=e.finishReason;let t=await X.take();t&&await E({type:"step",...t,budget:H}),G();break}case"abort":if(t.signal?.aborted)return;await E(en(e.reason??"The model stopped sending."));return;case"error":await E(en(e.error));return}}finally{ee.abort(),X.end(),K.end(),G(),await Promise.allSettled([...F])}try{await M.response}catch(e){if(t.signal?.aborted)return;await E(en(e));return}"content-filter"===eo?await E({type:"error",message:"The provider's content filter stopped the response.",retry:!1}):await E({type:"turn-end",text:er,stopped:!Y&&("length"===eo||"error"===eo||"tool-calls"===eo)})}async function g(e,t,a){try{let r=e?await (0,m.listWrittenPaths)(e):(0,m.writtenPathsIn)(t.map(e=>e.content)),o=await (0,c.filesOnDisk)(r,a);if(!o.length)return"";let i=o.slice(-n.BOT_RUN.compactFiles),s=o.length-i.length,l=i.map(e=>`- ${e}`);return s&&l.unshift(`- …and ${s} older ones`),`
|
|
67
|
+
|
|
68
|
+
Files this job has on disk now — open one rather than fetching again what is in it:
|
|
69
|
+
${l.join("\n")}`}catch(e){return w.logger.warn("files under the summary could not be listed",e),""}}async function T(e,t,a,o){let n;try{return await k(e,t,a,o)}catch(e){if(o.signal?.aborted)throw e;n=e}if((0,s.isContextOverflow)(n)){let i=(0,r.pruneMessages)({messages:a,toolCalls:"before-last-4-messages",emptyMessages:"remove"});try{return await k(e,t,i,o)}catch(e){if(o.signal?.aborted)throw e;n=e}}throw Error(`Could not compact the context (${(0,s.modelErrorToString)(n)}).`,{cause:n})}async function k(e,t,a,o){let i,{text:s,usage:l}=await (0,r.generateText)({model:e,system:o.instructions,tools:t,toolChoice:"none",messages:[...a,{role:"user",content:(i=(e=>{let{min:t,max:a,perTokens:r}=n.BOT_RUN.summaryWords;return Math.min(a,Math.max(t,Math.round(e/r)))})(o.budget),`Compact your context. The first message above — who handed you the job, and the job — stays exactly as it is. Everything after it is replaced by what you write now, and you carry on from that first message and this alone; nothing else above can be read again. Write it for a fresh copy of you that has your tools, your instructions and that first message, but has seen none of the rest.
|
|
70
|
+
|
|
71
|
+
Cover all of it, and prefer a fact over a description of a fact:
|
|
72
|
+
|
|
73
|
+
- **Where the job stands against that first message.** Do not restate the job; say what has changed since — a choice made, a detail settled, an answer that came back, a correction, anything you are still waiting on.
|
|
74
|
+
- **What is already true.** Every value you have — numbers, names, dates, ids, urls, prices, times — written out, not referred to. A value you leave out is one the next steps go and fetch again.
|
|
75
|
+
- **Where you are.** Which page the browser is on by url, whether you are signed in and to what, what is running, what you were in the middle of. Element refs do not survive this: name what to look for, never a ref.
|
|
76
|
+
- **Files.** Every path you wrote or read, and one line on what each holds.
|
|
77
|
+
- **What did not work**, and why: the url that 404s, the endpoint that needs POST not GET, the selector that is not there, the site that refuses a headless browser, the argument a tool rejected. This is the part that stops the next steps repeating an hour of yours.
|
|
78
|
+
- **What is left**, in the order you would do it.
|
|
79
|
+
|
|
80
|
+
Plain text, under ${i} words. No preamble, no headings about the summary itself, no account of how you have been going.`)}],abortSignal:o.signal,timeout:n.BOT_RUN.silenceMs}),d=s.trim();if(!d)throw Object.assign(Error("The summary of the context came back empty, so there is nothing to carry on from."),{isRetryable:!0});return{text:`Everything between the first message and here was compacted. Below is your own summary of it; carry on from the first message and this.
|
|
81
|
+
|
|
82
|
+
${d}`,usage:v(l)}}let v=e=>({input:e.inputTokens??0,output:e.outputTokens??0});e.s(["resumeTranscript",0,function(e,t=new Map){let a=new Map,r=new Set;for(let t of e)if(("tool"===t.role||"assistant"===t.role)&&Array.isArray(t.content))for(let e of t.content)"tool-result"===e.type&&(a.has(e.toolCallId)||a.set(e.toolCallId,e),"assistant"===t.role&&r.add(e.toolCallId));let o=[],n=new Set;for(let i of e){if("tool"===i.role){let e=i.content.filter(e=>"tool-result"!==e.type);e.length&&o.push({...i,content:e});continue}if("assistant"!==i.role||"string"==typeof i.content){o.push(i);continue}let e=[],s=[];for(let o of i.content){if("tool-call"!==o.type){s.push(o);continue}if(n.has(o.toolCallId))continue;let i=o.input;if("string"==typeof i)try{i=JSON.parse(i)}catch{i=void 0}if(!o.toolCallId||void 0===i){s.push({type:"text",text:"A tool argument stream was interrupted before a complete call was recorded. Inspect the saved work before continuing."});continue}let l=o.toolName===h.TOOL_NAMES.send_message?t.get(o.toolCallId):void 0,d=a.get(o.toolCallId)??(l?{type:"tool-result",toolCallId:o.toolCallId,toolName:o.toolName,output:{type:"json",value:l}}:void 0);if(o.providerExecuted&&(!d||!r.has(o.toolCallId))){s.push({type:"text",text:d?`The provider operation ${o.toolName} returned this data before its native continuation was interrupted: ${JSON.stringify(d.output)}`:`The provider operation ${o.toolName} was interrupted without a recorded result. Its remote execution state is unknown.`});continue}n.add(o.toolCallId),s.push({...o,input:i}),r.has(o.toolCallId)||e.push(d??{type:"tool-result",toolCallId:o.toolCallId,toolName:o.toolName,output:{type:"text",value:"No result: execution was interrupted before a result was recorded. The outcome is unknown. Inspect the current state before repeating the action."}})}s.length&&o.push({...i,content:s}),e.length&&o.push({role:"tool",content:e})}return o},"runBot",0,f]),a()}catch(e){a(e)}},!1),742712,e=>e.a(async(t,a)=>{try{var r=e.i(666680),o=e.i(875225),n=e.i(260338),i=e.i(518899),s=e.i(380690),l=e.i(687388),d=e.i(528790),h=e.i(613240),u=e.i(353885),c=e.i(53748),w=e.i(944971),p=e.i(889034),b=t([d]);[d]=b.then?(await b)():b;let B=()=>s.appEvents.emit({type:"threads"}),U=e=>"done"===e||"cancelled"===e,P=(e,t,a)=>`message:${(0,r.createHash)("sha256").update(JSON.stringify([e,t,a])).digest("hex")}`;async function m(e,t,a){let[r]=await e.select({id:h.threadWorkTable.id}).from(h.threadWorkTable).where((0,o.and)((0,o.eq)(h.threadWorkTable.threadId,t),(0,o.eq)(h.threadWorkTable.state,"external"),(0,o.eq)(h.threadWorkTable.caller,a))).limit(1);return!!r}async function y(e,t,a){let r=a.flatMap(e=>"assistant"===e.role&&Array.isArray(e.content)?e.content.flatMap(e=>"tool-call"===e.type&&e.toolName===u.TOOL_NAMES.send_message?[e.toolCallId]:[]):[]),n=r.map(a=>P(e,t,a)),i=new Map;if(!n.length)return i;let[s,l]=await Promise.all([d.database.select({key:h.threadWorkTable.id,to:h.threadWorkTable.bot}).from(h.threadWorkTable).where((0,o.and)((0,o.eq)(h.threadWorkTable.threadId,e),(0,o.inArray)(h.threadWorkTable.id,n))),d.database.select({key:h.threadDeliveryTable.key,to:h.threadWorkTable.bot}).from(h.threadDeliveryTable).innerJoin(h.threadWorkTable,(0,o.eq)(h.threadWorkTable.id,h.threadDeliveryTable.workId)).where((0,o.and)((0,o.eq)(h.threadDeliveryTable.threadId,e),(0,o.inArray)(h.threadDeliveryTable.key,n)))]),c=new Map([...s,...l].map(e=>[e.key,e.to]));for(let[e,t]of r.entries()){let a=c.get(n[e]);a&&i.set(t,{messageId:n[e],to:a})}return i}async function f(e,t,a){let[r]=await e.select({seq:(0,n.max)(h.threadMessageTable.seq)}).from(h.threadMessageTable).where((0,o.eq)(h.threadMessageTable.threadId,t)),i=(r?.seq??-1)+1;return await e.insert(h.threadMessageTable).values({threadId:t,seq:i,...a}),i}let j=(e,t)=>({bot:e.bot,parent:e.id,role:"user",content:`${t} ${p.RESUME_CHECK}`,note:!0});async function g(e,t){await T(e.threadId,j(e,t))}async function T(e,t){let a=await d.database.transaction(a=>f(a,e,t));return B(),a}async function k(e){return d.database.select().from(h.threadWorkTable).where((0,o.eq)(h.threadWorkTable.threadId,e)).orderBy(h.threadWorkTable.createdAt,h.threadWorkTable.id)}async function I(e,t){let[a]=await d.database.select({budget:i.sql`min(nullif(${h.threadWorkTable.contextBudget}, 0))`}).from(h.threadWorkTable).where((0,o.and)((0,o.eq)(h.threadWorkTable.threadId,e),(0,o.eq)(h.threadWorkTable.bot,t)));return a?.budget??void 0}async function v(e,t){await d.database.transaction(async a=>{await W(a,e),await a.update(h.threadWorkTable).set({contextBudget:t}).where((0,o.eq)(h.threadWorkTable.id,e.id))}),B()}async function W(e,t){let[a]=await e.select().from(h.threadWorkTable).where((0,o.and)((0,o.eq)(h.threadWorkTable.id,t.id),(0,o.eq)(h.threadWorkTable.generation,t.generation),(0,o.eq)(h.threadWorkTable.state,"running")));return a||(0,c.publicError)("This turn is no longer running."),a}async function $(e,t){await e.insert(h.threadDeliveryTable).values(t).onConflictDoNothing();let[a]=await e.select({bot:h.threadWorkTable.bot}).from(h.threadWorkTable).where((0,o.eq)(h.threadWorkTable.id,t.workId));a&&await m(e,t.threadId,a.bot)||await e.update(h.threadWorkTable).set({state:"queued"}).where((0,o.and)((0,o.eq)(h.threadWorkTable.id,t.workId),(0,o.inArray)(h.threadWorkTable.state,["waiting","done"])))}async function q(e,t){let a={...p.RoomMessageSchema.parse(t),id:t.id};"question"===a.kind&&a.to!==p.ROOM_THURSDAY&&(0,c.publicError)("Address user questions to Thursday; use a message to contact another bot."),a.options?.length&&"question"!==a.kind&&(0,c.publicError)("Offer answer choices only with a user question.");let r=await d.database.transaction(async t=>{await W(t,e);let r=P(e.threadId,e.bot,a.id),[n]=await t.select().from(h.threadWorkTable).where((0,o.eq)(h.threadWorkTable.id,r));if(n)return{messageId:r,to:n.bot};let[i]=await t.select({to:h.threadWorkTable.bot}).from(h.threadDeliveryTable).innerJoin(h.threadWorkTable,(0,o.eq)(h.threadWorkTable.id,h.threadDeliveryTable.workId)).where((0,o.eq)(h.threadDeliveryTable.key,r));if(i)return{messageId:r,to:i.to};if(a.to===e.bot&&(0,c.publicError)("Continue your own work directly; choose another recipient."),a.replyTo){let[n]=await t.select().from(h.threadWorkTable).where((0,o.and)((0,o.eq)(h.threadWorkTable.id,a.replyTo),(0,o.eq)(h.threadWorkTable.threadId,e.threadId)));if((!n||n.bot!==e.bot||n.caller!==a.to||U(n.state))&&(0,c.publicError)("Reply to an open message addressed to you from that recipient."),n.parentId)return await $(t,{key:r,threadId:e.threadId,workId:n.parentId,speaker:e.bot,text:a.text}),{messageId:r,to:a.to}}let s=await t.select().from(h.threadWorkTable).where((0,o.eq)(h.threadWorkTable.threadId,e.threadId)),d=new Set(s.map(e=>e.bot).filter(e=>e!==p.ROOM_THURSDAY));a.to!==p.ROOM_THURSDAY&&!d.has(a.to)&&d.size>=l.BOT_RUN.participants&&(0,c.publicError)("This thread has reached its participant limit."),s.filter(e=>!U(e.state)).length>=l.BOT_RUN.queuedMessages&&(0,c.publicError)("This thread has reached its pending message limit.");let u=a.to!==p.ROOM_THURSDAY&&await m(t,e.threadId,a.to);return await t.insert(h.threadWorkTable).values({id:r,threadId:e.threadId,bot:a.to,caller:e.bot,parentId:e.id,state:a.to===p.ROOM_THURSDAY?"question"===a.kind?"external":"done":u?"waiting":"queued",result:a.to===p.ROOM_THURSDAY?a.text:null,options:[...new Set(a.options??[])]}),a.to===p.ROOM_THURSDAY?await t.insert(h.threadRelayTable).values({key:r,threadId:e.threadId,bot:e.bot,text:a.text,kind:a.kind,messageId:"question"===a.kind?r:null}):await $(t,{key:r,threadId:e.threadId,workId:r,speaker:e.bot,text:a.text}),await t.update(h.threadTable).set({wrapped:!1,updatedAt:new Date}).where((0,o.eq)(h.threadTable.id,e.threadId)),{messageId:r,to:a.to,...u?{note:`${a.to} is waiting for the user's answer and reads this after it.`}:{}}});return B(),r}async function x(e){let t=!1,a=await d.database.transaction(async a=>{let[r]=await a.select().from(h.threadTable).where((0,o.eq)(h.threadTable.id,e));if(!r||"running"!==r.status)return null;let n=await a.select().from(h.threadWorkTable).where((0,o.eq)(h.threadWorkTable.threadId,e)).orderBy(i.sql`${h.threadWorkTable}.rowid`),s=new Set(n.filter(e=>"external"===e.state).map(e=>e.caller));for(let e of n)"queued"===e.state&&s.has(e.bot)&&(await a.update(h.threadWorkTable).set({state:"waiting"}).where((0,o.eq)(h.threadWorkTable.id,e.id)),e.state="waiting",t=!0);let d=n.filter(e=>"running"===e.state);if(d.length>=l.BOT_RUN.concurrent)return null;let u=n.find(e=>"queued"===e.state&&!d.some(t=>t.bot===e.bot));if(!u)return null;if(r.turns>=l.BOT_RUN.turns)return await a.update(h.threadWorkTable).set({state:"paused"}).where((0,o.and)((0,o.eq)(h.threadWorkTable.threadId,e),(0,o.eq)(h.threadWorkTable.state,"queued"))),null;let[c]=await a.update(h.threadWorkTable).set({state:"running",generation:u.generation+1}).where((0,o.eq)(h.threadWorkTable.id,u.id)).returning();return await a.update(h.threadTable).set({turns:r.turns+1}).where((0,o.eq)(h.threadTable.id,e)),c});return(a||t)&&B(),a}async function R(e){let t=await d.database.transaction(async t=>{await W(t,e);let a=await t.select().from(h.threadDeliveryTable).where((0,o.and)((0,o.eq)(h.threadDeliveryTable.workId,e.id),(0,o.eq)(h.threadDeliveryTable.consumed,!1))).orderBy(h.threadDeliveryTable.id);for(let r of a){let a=O(r);await f(t,e.threadId,{bot:e.bot,parent:e.id,role:"user",content:a,hidden:!r.visible}),await t.update(h.threadDeliveryTable).set({consumed:!0}).where((0,o.eq)(h.threadDeliveryTable.id,r.id))}return a.map(O)});return t.length&&B(),t}function O(e){return e.visible?(0,w.tagSpeaker)("The user"===e.speaker?"user":"thursday",e.text):`${e.speaker}:
|
|
83
|
+
|
|
84
|
+
${e.text}`}async function M(e,t){await d.database.transaction(async a=>{await W(a,e);let r=await a.select().from(h.threadWorkTable).where((0,o.eq)(h.threadWorkTable.parentId,e.id)),n=await a.select({id:h.threadDeliveryTable.id}).from(h.threadDeliveryTable).where((0,o.and)((0,o.eq)(h.threadDeliveryTable.workId,e.id),(0,o.eq)(h.threadDeliveryTable.consumed,!1))).limit(1),i=await m(a,e.threadId,e.bot),s=n.length&&!i?"queued":n.length||r.some(e=>!U(e.state))?"waiting":"done";if(await a.update(h.threadWorkTable).set({state:s,result:t}).where((0,o.eq)(h.threadWorkTable.id,e.id)),"done"!==s)return;if(e.parentId){let[r]=await a.select().from(h.threadWorkTable).where((0,o.eq)(h.threadWorkTable.id,e.parentId)),[n]=t?[]:await a.select({id:h.threadDeliveryTable.id}).from(h.threadDeliveryTable).where((0,o.and)((0,o.eq)(h.threadDeliveryTable.workId,e.parentId),(0,o.eq)(h.threadDeliveryTable.speaker,e.bot),(0,o.eq)(h.threadDeliveryTable.consumed,!1))).limit(1);r&&"cancelled"!==r.state&&!n&&await $(a,{key:`return:${e.id}:${e.generation}`,threadId:e.threadId,workId:r.id,speaker:e.bot,text:t||"This turn ended without a message."})}let[l]=await a.select().from(h.threadTable).where((0,o.eq)(h.threadTable.id,e.threadId)),d=await a.select().from(h.threadWorkTable).where((0,o.eq)(h.threadWorkTable.threadId,e.threadId));l&&e.bot===l.bot&&!e.parentId&&d.every(e=>U(e.state))&&(await a.update(h.threadTable).set({status:t?"done":"waiting",outcome:t||"The room is idle. Send a message to continue.",pending:t?null:{options:[w.THREAD_CONTINUE]},wrapped:!0,endedAt:t?new Date:null,seen:!1,updatedAt:new Date}).where((0,o.eq)(h.threadTable.id,e.threadId)),t&&await a.insert(h.threadRelayTable).values({key:`report:${e.threadId}:${l.generation}`,threadId:e.threadId,bot:e.bot,text:t,kind:"report"}).onConflictDoNothing())}),B()}async function A(e){await d.database.transaction(async t=>{let[a]=await t.select().from(h.threadTable).where((0,o.eq)(h.threadTable.id,e));if(!a||"running"!==a.status)return;let r=await t.select().from(h.threadWorkTable).where((0,o.eq)(h.threadWorkTable.threadId,e));if(r.some(e=>"queued"===e.state||"running"===e.state))return;let n=r.find(e=>"external"===e.state);if(n)return void await t.update(h.threadTable).set({status:"waiting",outcome:n.result,pending:{options:n.options,messageId:n.id,bot:n.caller},updatedAt:new Date}).where((0,o.eq)(h.threadTable.id,e));if(r.some(e=>!U(e.state))||a.wrapped)return void await t.update(h.threadTable).set({status:"waiting",outcome:a.turns>=l.BOT_RUN.turns?"The room reached its automatic turn limit. Continue from the saved conversation.":"Work is paused. Continue from the saved conversation.",pending:{options:[w.THREAD_CONTINUE]},updatedAt:new Date}).where((0,o.eq)(h.threadTable.id,e));let i=crypto.randomUUID();await t.insert(h.threadWorkTable).values({id:i,threadId:e,bot:a.bot,caller:p.ROOM_THURSDAY,state:"queued"}),await $(t,{key:i,threadId:e,workId:i,speaker:"Thread activity",text:"The participants have finished their current turns. Bring together the results you received for Thursday, including anything still unresolved."}),await t.update(h.threadTable).set({wrapped:!0}).where((0,o.eq)(h.threadTable.id,e))}),B()}async function N(e,t,a=!1){await d.database.transaction(async r=>{let n=await r.select().from(h.threadWorkTable).where((0,o.eq)(h.threadWorkTable.threadId,e));for(let a of n.filter(e=>"running"===e.state||"queued"===e.state))await r.update(h.threadWorkTable).set({state:"paused",generation:a.generation+1}).where((0,o.eq)(h.threadWorkTable.id,a.id)),await f(r,e,j(a,t));await r.update(h.threadTable).set({status:"waiting",outcome:t,pending:{options:[w.THREAD_CONTINUE],...a?{auto:!0}:{}},seen:!1,endedAt:null,updatedAt:new Date}).where((0,o.eq)(h.threadTable.id,e)),await r.insert(h.threadRelayTable).values({key:crypto.randomUUID(),threadId:e,bot:n.find(e=>!e.parentId)?.bot??"Bot",text:t,kind:"interrupted",accepted:a})}),B()}async function S(e,t=!0){await d.database.transaction(async a=>{await a.update(h.threadWorkTable).set({state:"queued"}).where((0,o.and)((0,o.eq)(h.threadWorkTable.threadId,e),(0,o.eq)(h.threadWorkTable.state,"paused"))),await a.update(h.threadTable).set({status:"running",...t?{generation:i.sql`${h.threadTable.generation} + 1`,turns:0}:{},pending:null,outcome:null,endedAt:null,updatedAt:new Date}).where((0,o.eq)(h.threadTable.id,e)),await a.update(h.threadRelayTable).set({accepted:!0}).where((0,o.and)((0,o.eq)(h.threadRelayTable.threadId,e),(0,o.eq)(h.threadRelayTable.kind,"interrupted")))}),B()}async function E(e,t,a){let r=e.select({workId:h.threadDeliveryTable.workId}).from(h.threadDeliveryTable).where((0,o.and)((0,o.eq)(h.threadDeliveryTable.threadId,t),(0,o.eq)(h.threadDeliveryTable.consumed,!1)));await e.update(h.threadWorkTable).set({state:"queued"}).where((0,o.and)((0,o.eq)(h.threadWorkTable.threadId,t),(0,o.eq)(h.threadWorkTable.bot,a),(0,o.inArray)(h.threadWorkTable.state,["waiting","done"]),(0,o.inArray)(h.threadWorkTable.id,r)))}async function C(e,t,a,r,n,s=!0){let l=await d.database.transaction(async l=>{let[d]=await l.select().from(h.threadTable).where((0,o.eq)(h.threadTable.id,e));d||(0,c.publicError)("No such thread.");let u=await l.select().from(h.threadWorkTable).where((0,o.eq)(h.threadWorkTable.threadId,e)).orderBy(h.threadWorkTable.createdAt),w=u.filter(e=>"external"===e.state),b=n?w.find(e=>e.id===n)??(0,c.publicError)("That question is no longer waiting for an answer."):s?function(e,t){let a=t?e.filter(e=>e.caller===t):e;if(a.length<=1)return a[0];(0,c.publicError)(`Several questions are waiting for an answer: ${a.map(e=>`${e.caller} (replyTo ${e.id}): “${(e.result??"").slice(0,160)}”`).join("; ")}. Answer one of them by its replyTo.`)}(w,r):void 0,y=b?.caller??r??d.bot,f=b?u.find(e=>e.id===b.parentId):u.find(e=>e.bot===y&&"running"===e.state)??u.find(e=>e.bot===y&&!U(e.state)&&"external"!==e.state);if(b&&(await l.update(h.threadWorkTable).set({state:"done",result:t}).where((0,o.eq)(h.threadWorkTable.id,b.id)),await l.update(h.threadRelayTable).set({accepted:!0}).where((0,o.eq)(h.threadRelayTable.messageId,b.id))),!f){let t=null;if(y!==d.bot){let a=u.findLast(e=>e.bot===d.bot&&!e.parentId&&"cancelled"!==e.state);a?"done"===a.state&&await l.update(h.threadWorkTable).set({state:"waiting"}).where((0,o.eq)(h.threadWorkTable.id,a.id)):a=(await l.insert(h.threadWorkTable).values({id:crypto.randomUUID(),threadId:e,bot:d.bot,caller:p.ROOM_THURSDAY,state:"waiting"}).returning())[0],t=a.id}f=(await l.insert(h.threadWorkTable).values({id:crypto.randomUUID(),threadId:e,bot:y,caller:t?d.bot:p.ROOM_THURSDAY,parentId:t,state:"queued"}).returning())[0]}b&&await $(l,{key:`answer:${b.id}`,threadId:e,workId:f.id,speaker:"Thread activity",text:`The next message answers your question to the user: “${b.result??""}”`});let g=crypto.randomUUID();return await $(l,{key:g,threadId:e,workId:f.id,speaker:a,text:t,visible:!0}),b&&!await m(l,e,y)&&await E(l,e,y),await l.update(h.threadWorkTable).set({state:"queued"}).where((0,o.and)((0,o.eq)(h.threadWorkTable.threadId,e),(0,o.eq)(h.threadWorkTable.state,"paused"))),await l.update(h.threadTable).set({status:"running",generation:i.sql`${h.threadTable.generation} + 1`,turns:0,wrapped:!1,pending:null,outcome:null,endedAt:null,seen:!1,updatedAt:new Date}).where((0,o.eq)(h.threadTable.id,e)),await l.update(h.threadRelayTable).set({accepted:!0}).where((0,o.and)((0,o.eq)(h.threadRelayTable.threadId,e),(0,o.inArray)(h.threadRelayTable.kind,["interrupted","report"]))),{key:g,to:y,answered:b?{bot:b.caller,question:b.result??""}:null}});return B(),l}async function D(e){await d.database.transaction(async t=>{await t.update(h.threadWorkTable).set({state:"cancelled",generation:i.sql`${h.threadWorkTable.generation} + 1`}).where((0,o.and)((0,o.eq)(h.threadWorkTable.threadId,e),(0,o.inArray)(h.threadWorkTable.state,["queued","running","waiting","external","paused"]))),await t.update(h.threadRelayTable).set({accepted:!0}).where((0,o.eq)(h.threadRelayTable.threadId,e))}),B()}async function _(e,t){let[a]=await d.database.select({bot:h.threadTable.bot}).from(h.threadTable).where((0,o.eq)(h.threadTable.id,e)),r=await d.database.select().from(h.threadMessageTable).where((0,o.and)((0,o.eq)(h.threadMessageTable.threadId,e),(0,o.or)((0,o.eq)(h.threadMessageTable.bot,t),a?.bot===t?i.sql`${h.threadMessageTable.bot} is null AND ${h.threadMessageTable.parent} is null`:void 0))).orderBy(h.threadMessageTable.seq),n=r.findLastIndex(e=>e.compact);return(n>0?[r[0],...r.slice(n)]:r).map(e=>({role:e.role,content:e.content}))}e.s(["appendRoomMessage",0,T,"cancelRoom",0,D,"claimRoomWork",0,x,"consumeRoomInbox",0,R,"finishRoomWork",0,M,"listParticipantTranscript",0,_,"listRoomReceipts",0,y,"listRoomWork",0,k,"lowerRoomContextBudget",0,v,"noteRoomBreak",0,g,"pauseRoom",0,N,"resumeRoom",0,S,"roomContextBudget",0,I,"sendRoomMessage",0,q,"settleRoom",0,A,"tellRoom",0,C]),a()}catch(e){a(e)}},!1),39803,e=>e.a(async(t,a)=>{try{var r=e.i(136340),o=e.i(380690),n=e.i(687388),i=e.i(386075),s=e.i(851372),l=e.i(22676),d=e.i(629668),h=e.i(786025),u=e.i(167004),c=e.i(640911),w=e.i(53748),p=e.i(268486),b=e.i(41444),m=e.i(265143),y=e.i(585099),f=e.i(944971),g=e.i(742712),T=e.i(889034),k=e.i(378884),I=t([i,s,l,m,y,g,k]);[i,s,l,m,y,g,k]=I.then?(await I)():I;let M=globalThis.__roomRuns??=new Map,A=globalThis.__roomThreadLock??=(0,p.createKeyedLock)();async function v(e){let t=await (0,m.findJobBot)(e.bot);(!t||t.disabled)&&(0,w.publicError)("Choose an enabled bot.");let{from:a,...r}={...e,bot:t.name},o=(0,s.buildThreadOpening)({bot:r.bot,request:r.request,from:a}),n=await (0,k.insertThread)({...r,opening:o});return await $(n.id),n.id}async function W(e,t,a="user",r,o){let n=null;return await A(e,async()=>{let i=await (0,k.findThread)(e);if(i||(0,w.publicError)("No such thread."),r){let t=(await (0,g.listRoomWork)(e)).find(e=>e.bot.toLowerCase()===r.trim().toLowerCase());t&&t.bot!==T.ROOM_THURSDAY||(0,w.publicError)("Choose a participant in this thread."),r=t.bot}t.trim()===f.THREAD_CONTINUE&&(0,f.isAppStop)(i.pending)?(await (0,g.resumeRoom)(e),(await (0,g.listRoomWork)(e)).some(e=>"queued"===e.state)||(n=await (0,g.tellRoom)(e,"Continue from the saved conversation.","user"===a?"The user":T.ROOM_THURSDAY,r,void 0,!1))):n=await (0,g.tellRoom)(e,t,"user"===a?"The user":T.ROOM_THURSDAY,r,o)}),await $(e),n}async function $(e){await A(e,async()=>{if(!o.presence.watching){let t=await (0,k.findThread)(e);t?.status!=="running"||[...M.values()].some(t=>t.threadId===e)||await (0,g.pauseRoom)(e,"The app is not open. Work resumes when it returns.",!0);return}for(let t=0;t<2;t++){let t;for(;t=await (0,g.claimRoomWork)(e);)!function(e){let t,a=new AbortController,r=new Promise(e=>{t=e});M.set(e.id,{threadId:e.threadId,stop:a,done:r}),q(e,a.signal).catch(t=>c.logger.error(`thread ${e.threadId}: participant`,t)).finally(()=>{M.delete(e.id),t(),$(e.threadId).catch(t=>c.logger.error(`thread ${e.threadId}: scheduling`,t))})}(t);await (0,g.settleRoom)(e)}})}async function q(e,t){let a=await x(e,t);if(a?.failure?.retry&&!t.aborted&&(await (0,g.noteRoomBreak)(e,a.failure.message),await (0,r.setTimeout)(n.BOT_RUN.retryMs,void 0,{signal:t}).catch(()=>{}),t.aborted||(a=await x(e,t))),!a||t.aborted)return;let i=a.failure?.message,s=a.ending;if(i||!s||s.stopped){let t=i??"The turn was interrupted. Continue from the saved conversation.";A(e.threadId,async()=>{let a=(await (0,g.listRoomWork)(e.threadId)).find(t=>t.id===e.id);if(a?.state!=="running"||a.generation!==e.generation)return;let r=R(e.threadId);await (0,g.pauseRoom)(e.threadId,t),await r}).catch(t=>c.logger.error(`thread ${e.threadId}: pausing`,t));return}await (0,g.finishRoomWork)(e,s.text);let w=await (0,k.findThread)(e.threadId);if(w?.status==="done"){await (0,l.isAnyCallLive)()||(0,u.desktopNotify)(w.label,w.outcome??"");let e=await (0,h.filesOnDisk)((0,d.pathsIn)(w.outcome??""),null),t=e.find(e=>e.startsWith(`${n.PATHS.artifacts}/`))??e[0];t&&o.appEvents.emit({type:"artifact",threadId:w.id,label:w.label,path:t})}}async function x(e,t){let a=new N(e,t),r=null,o=null;try{let n=await (0,k.findThread)(e.threadId);if(!n)return null;(await (0,g.listParticipantTranscript)(e.threadId,e.bot)).length||await (0,g.appendRoomMessage)(e.threadId,{bot:e.bot,parent:e.id,role:"user",content:`Request: ${n.request}
|
|
85
|
+
Coordinator: ${n.bot}. Continue as ${e.bot} in this thread.`,hidden:!0}),await (0,g.consumeRoomInbox)(e);let i=await (0,g.listParticipantTranscript)(e.threadId,e.bot);await (0,y.runBot)({bot:e.bot,messages:(0,y.resumeTranscript)(i,await (0,g.listRoomReceipts)(e.threadId,e.bot,i))},{signal:t,threadId:e.threadId,parent:e.id,caller:e.caller,owner:n.bot,contextBudget:await (0,g.roomContextBudget)(e.threadId,e.bot),session:(0,h.botBrowserSession)(e.threadId,e.bot),notes:()=>(0,g.consumeRoomInbox)(e),send:async a=>{t.throwIfAborted();let r=a.to.trim();if(r.toLowerCase()===T.ROOM_THURSDAY.toLowerCase())r=T.ROOM_THURSDAY;else{let e=await (0,m.findJobBot)(r);(!e||e.disabled)&&(0,w.publicError)(`No enabled bot named "${r}".`),r=e.name}let o=await (0,g.sendRoomMessage)(e,{...a,to:r});return $(e.threadId).catch(e=>c.logger.error("room message scheduling",e)),o},emit:async i=>{(!t.aborted||"tool-result"===i.type)&&(await a.on(i),"step"===i.type&&await (0,k.addThreadUsage)(e.threadId,i.usage,e.bot===n.bot?{tokens:i.usage.input,budget:i.budget}:null),"compact"===i.type&&await (0,k.addThreadUsage)(e.threadId,i.usage),"turn-end"===i.type&&(r=i),"error"===i.type&&(o={message:i.message,retry:i.retry},i.budget&&await (0,g.lowerRoomContextBudget)(e,i.budget)))}})}catch(a){t.aborted||(c.logger.error(`thread ${e.threadId}: ${e.bot} broke`,a),o={message:(0,i.modelErrorToString)(a),retry:!(0,w.isPublicError)(a)&&!(0,i.isProviderRefusal)(a)})}return{ending:r,failure:o}}globalThis.__roomPausing??={current:Promise.resolve()};class N{work;signal;lane;assistant;tool;parts;calls;results;constructor(e,t){this.work=e,this.signal=t,this.lane=(0,b.PromiseChain)(),this.assistant=null,this.tool=null,this.parts={assistant:[],tool:[]},this.calls=new Set,this.results=new Set}async write(e,t,a=!1){let r={bot:this.work.bot,parent:this.work.id,role:t.role,content:t.content,compact:a,note:a};return null===e?(0,g.appendRoomMessage)(this.work.threadId,r):(await (0,k.upsertMessage)(this.work.threadId,e,r),e)}on(e){return this.lane(async()=>{if(!this.signal.aborted||"tool-result"===e.type)if("text"===e.type)this.parts.assistant.push({type:"text",text:e.text}),this.assistant=await this.write(this.assistant,{role:"assistant",content:this.parts.assistant});else if("tool"===e.type){if(this.calls.has(e.id)){let t=this.parts.assistant.find(t=>"tool-call"===t.type&&t.toolCallId===e.id);t&&"tool-call"===t.type&&e.providerOptions&&(t.providerOptions=e.providerOptions,this.assistant=await this.write(this.assistant,{role:"assistant",content:this.parts.assistant}));return}this.calls.add(e.id),this.parts.assistant.push({type:"tool-call",toolCallId:e.id,toolName:e.name,input:e.input,...e.providerExecuted?{providerExecuted:!0}:{},...e.providerOptions?{providerOptions:e.providerOptions}:{}}),this.assistant=await this.write(this.assistant,{role:"assistant",content:this.parts.assistant})}else if("tool-result"===e.type){if(this.results.has(e.id))return;this.results.add(e.id),this.parts.tool.push({type:"tool-result",toolCallId:e.id,toolName:e.name,output:e.error?{type:"error-text",value:String(e.output)}:"string"==typeof e.output?{type:"text",value:e.output}:{type:"json",value:e.output}}),this.tool=await this.write(this.tool,{role:"tool",content:this.parts.tool})}else if("step"===e.type){let t=[this.assistant,this.tool];for(let[a,r]of e.messages.entries())await this.write(t[a]??null,r);let a=t.slice(e.messages.length).filter(e=>null!==e);a.length&&await (0,k.deleteMessages)(this.work.threadId,a),this.assistant=this.tool=null,this.parts={assistant:[],tool:[]}}else"compact"===e.type&&await this.write(null,{role:"user",content:e.text},!0)})}}async function R(e){let t=[...M.values()].filter(t=>t.threadId===e);for(let e of t)e.stop.abort();await Promise.all(t.map(e=>e.done))}async function O(e){await A(e,async()=>{let t=await (0,k.findThread)(e);t||(0,w.publicError)("No such thread."),t.endedAt&&(0,w.publicError)("That thread has already ended."),await (0,g.cancelRoom)(e),await (0,k.updateThread)(e,{status:"cancelled",outcome:null,pending:null,seen:!0,endedAt:new Date}),await R(e),await (0,h.closeJobShell)(e)})}e.s(["answerThread",0,W,"cancelThread",0,O,"startThread",0,v]),a()}catch(e){a(e)}},!1),167004,e=>{"use strict";var t=e.i(874533),a=e.i(687388);let r=`on run argv
|
|
86
|
+
display notification (item 2 of argv) with title (item 1 of argv)
|
|
87
|
+
end run`,o=`
|
|
88
|
+
$ErrorActionPreference = 'Stop'
|
|
89
|
+
[void][Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime]
|
|
90
|
+
$xml = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText02)
|
|
91
|
+
$text = $xml.GetElementsByTagName('text')
|
|
92
|
+
[void]$text.Item(0).AppendChild($xml.CreateTextNode($env:NOTIFY_TITLE))
|
|
93
|
+
[void]$text.Item(1).AppendChild($xml.CreateTextNode($env:NOTIFY_BODY))
|
|
94
|
+
$id = '{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\WindowsPowerShell\\v1.0\\powershell.exe'
|
|
95
|
+
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($id).Show([Windows.UI.Notifications.ToastNotification]::new($xml))
|
|
96
|
+
`,n={darwin:(e,t)=>["osascript",["-e",r,"--",e,t]],win32:()=>["powershell.exe",["-NoProfile","-NonInteractive","-Command",o]],linux:(e,t)=>["notify-send",["--app-name",a.APP_NAME,"--",e,t]]};e.s(["desktopNotify",0,function(e,a){let r=e.slice(0,80),o=a.slice(0,200),i=n[process.platform]?.(r,o);if(!i)return;let[s,l]=i;(0,t.execFile)(s,l,{env:{...process.env,NOTIFY_TITLE:r,NOTIFY_BODY:o},timeout:1e4,windowsHide:!0},()=>{})}])}];
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=_1dc_d1q._.js.map
|