thursday-agent 0.26.0 → 0.27.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/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +5 -5
- package/.next/server/app/_global-error/page/build-manifest.json +2 -2
- 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/build-manifest.json +2 -2
- 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 +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/artifact/route.js +10 -10
- package/.next/server/app/api/artifact/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/files/route.js +1 -1
- 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/file/route.js +15 -15
- package/.next/server/app/api/bot/thread/file/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/thread/route.js +5 -5
- package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/tool-result/[id]/route.js +6 -6
- package/.next/server/app/api/bot/tool-result/[id]/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/favicon/[host]/route.js +4 -4
- package/.next/server/app/api/favicon/[host]/route.js.nft.json +1 -1
- package/.next/server/app/api/file/[...path]/route.js +4 -4
- package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/automatic/route.js +5 -5
- package/.next/server/app/api/llm-model/automatic/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/catalog/[provider]/route.js +5 -5
- package/.next/server/app/api/llm-model/catalog/[provider]/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/credits/[provider]/route.js +5 -5
- package/.next/server/app/api/llm-model/credits/[provider]/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/route.js +6 -6
- package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/subscription/route.js +6 -6
- package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/[name]/route.js +5 -5
- package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/oauth/callback/route.js +6 -6
- package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/route.js +5 -5
- package/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/tools/route.js +5 -5
- package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/edit/route.js +15 -15
- package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/route.js +4 -4
- package/.next/server/app/api/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/reach/route.js +18 -18
- package/.next/server/app/api/reach/route.js.nft.json +1 -1
- package/.next/server/app/api/routine/route.js +8 -8
- package/.next/server/app/api/routine/route.js.nft.json +1 -1
- package/.next/server/app/api/running/route.js +2 -2
- package/.next/server/app/api/running/route.js.nft.json +1 -1
- package/.next/server/app/api/signins/route.js +3 -3
- package/.next/server/app/api/signins/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/end/route.js +5 -5
- package/.next/server/app/api/thursday/call/end/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/call/plan/route.js +14 -14
- package/.next/server/app/api/thursday/call/plan/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/call/route.js +6 -6
- package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/settings/route.js +5 -5
- package/.next/server/app/api/thursday/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/text/route.js +14 -14
- package/.next/server/app/api/thursday/text/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/update/route.js +7 -7
- package/.next/server/app/api/update/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/files/route.js +6 -6
- package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/route.js +6 -6
- package/.next/server/app/api/workspace/route.js.nft.json +1 -1
- package/.next/server/app/artifact/[...path]/page/build-manifest.json +2 -2
- package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +11 -11
- 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 +2 -2
- package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next/server/app/manifest.webmanifest/route.js +2 -2
- package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/.next/server/app/page/build-manifest.json +2 -2
- package/.next/server/app/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/page/server-reference-manifest.json +184 -184
- package/.next/server/app/page.js +10 -10
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__01jpmcj._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__03bjojd._.js +3 -3
- package/.next/server/chunks/{[root-of-the-server]__0wosonh._.js → [root-of-the-server]__05u-9a3._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1dyse-1._.js → [root-of-the-server]__0_qe8iq._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0d-dfqm._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0jqidnu._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0mmynvy._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0ncs9uu._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0qhf60h._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0sea36s._.js +4 -4
- package/.next/server/chunks/[root-of-the-server]__0zezbds._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__12hkdpz._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__13hng6h._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__14inehv._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__17kdjf6._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__17yv6lg._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0b3_rzi._.js → [root-of-the-server]__1hjb8wf._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1jcu_e9._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__1jmr2ed._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__1ndi14y._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1o7z93z._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__1onvx8x._.js +2 -2
- package/.next/server/chunks/_0-mqt2w._.js +1 -1
- package/.next/server/chunks/_04s1gb9._.js +30 -27
- package/.next/server/chunks/_06u9yo-._.js +1 -1
- package/.next/server/chunks/_08354bn._.js +33 -30
- package/.next/server/chunks/_083t_nr._.js +1 -1
- package/.next/server/chunks/_0c-s0ei._.js +1 -1
- package/.next/server/chunks/_0gifi_2._.js +2 -2
- package/.next/server/chunks/_0m3sdq8._.js +1 -1
- package/.next/server/chunks/_0pljp-1._.js +1 -1
- package/.next/server/chunks/_0wjia9n._.js +1 -1
- package/.next/server/chunks/_0wyh244._.js +33 -30
- package/.next/server/chunks/_0x2mdif._.js +1 -1
- package/.next/server/chunks/_1-sk_q4._.js +1 -1
- package/.next/server/chunks/_12a_gfz._.js +1 -1
- package/.next/server/chunks/_14-kmob._.js +1 -1
- package/.next/server/chunks/_16zct7w._.js +30 -27
- package/.next/server/chunks/_1823_7a._.js +4 -4
- package/.next/server/chunks/_1f_x75d._.js +1 -1
- package/.next/server/chunks/_1o2r4ja._.js +1 -1
- package/.next/server/chunks/_1q42187._.js +3 -3
- package/.next/server/chunks/_1ufbxe1._.js +1 -1
- package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
- package/.next/server/chunks/features_14kex_m._.js +11 -11
- package/.next/server/chunks/features_bot_08z387_._.js +4 -4
- package/.next/server/chunks/features_memory_0__61kl._.js +1 -1
- package/.next/server/chunks/features_memory_1uqvksn._.js +1 -1
- package/.next/server/chunks/features_workspace_workspace_ts_13h82gv._.js +1 -1
- package/.next/server/chunks/features_workspace_workspace_ts_1iyjroj._.js +3 -3
- package/.next/server/chunks/ssr/{[root-of-the-server]__0x297x3._.js → [root-of-the-server]__03_9u5q._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__0653diy._.js → [root-of-the-server]__04ky8w1._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__1zlzs9j._.js → [root-of-the-server]__0crm8gr._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__02936mh._.js → [root-of-the-server]__0d3n8i_._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__0s8q44q._.js → [root-of-the-server]__0d4o9hs._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0id2dqb._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__1s0etwd._.js → [root-of-the-server]__0q2c15o._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0t_oz3-._.js +6 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__16x99f1._.js → [root-of-the-server]__12r70jm._.js} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1867koj._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__0glkz9k._.js → [root-of-the-server]__1fvh0zn._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__1t38-p_._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__1c1xyyb._.js → [root-of-the-server]__1uy0zqr._.js} +2 -2
- package/.next/server/chunks/ssr/_02uubus._.js +3 -0
- package/.next/server/chunks/ssr/_0692i-a._.js +3 -0
- package/.next/server/chunks/ssr/_079xt7h._.js +32 -29
- package/.next/server/chunks/ssr/_07g7ojr._.js +3 -0
- package/.next/server/chunks/ssr/_0ewhz_x._.js +3 -0
- package/.next/server/chunks/ssr/_0f3t9pm._.js +2 -2
- package/.next/server/chunks/ssr/_0gx6qzr._.js +57 -0
- package/.next/server/chunks/ssr/_0pjwmak._.js +6 -0
- package/.next/server/chunks/ssr/_0pnzfq1._.js +1 -1
- package/.next/server/chunks/ssr/_0px9eat._.js +3 -0
- package/.next/server/chunks/ssr/_0r2_l__._.js +3 -0
- package/.next/server/chunks/ssr/{_20_wc-g._.js → _0rcuovx._.js} +2 -2
- package/.next/server/chunks/ssr/_0uwhhcs._.js +3 -0
- package/.next/server/chunks/ssr/{_1wct0tm._.js → _128r03g._.js} +1 -1
- package/.next/server/chunks/ssr/_12c2n7f._.js +3 -0
- package/.next/server/chunks/ssr/{_12_ail7._.js → _14f64h2._.js} +1 -1
- package/.next/server/chunks/ssr/_17fa2ns._.js +162 -0
- package/.next/server/chunks/ssr/_1_px1o-._.js +3 -0
- package/.next/server/chunks/ssr/_1a_w_du._.js +1 -1
- package/.next/server/chunks/ssr/_1e_9qjr._.js +1 -1
- package/.next/server/chunks/ssr/_1f59vze._.js +57 -0
- package/.next/server/chunks/ssr/_1j5ohq5._.js +3 -0
- package/.next/server/chunks/ssr/{_0ingto_._.js → _1kj3d2q._.js} +2 -2
- package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
- package/.next/server/chunks/ssr/_1ocl7u0._.js +3 -0
- package/.next/server/chunks/ssr/_1q9r6u6._.js +3 -0
- package/.next/server/chunks/ssr/{_0fvctar._.js → _1qqusa-._.js} +2 -2
- package/.next/server/chunks/ssr/_1soynbw._.js +2 -2
- package/.next/server/chunks/ssr/_1uok0wt._.js +3 -0
- package/.next/server/chunks/ssr/_1v1pcoh._.js +1 -1
- package/.next/server/chunks/ssr/_1xw9imq._.js +3 -0
- package/.next/server/chunks/ssr/{components_ui_markdown-body_tsx_0h7bkrz._.js → components_ui_markdown-body_tsx_08i96c6._.js} +2 -2
- package/.next/server/chunks/ssr/features_0rrgq_t._.js +1 -1
- package/.next/server/chunks/ssr/features_ai_components_model-picker_tsx_0ucb1y9._.js +1 -1
- package/.next/server/chunks/ssr/features_bot_0tb4ui-._.js +2 -2
- package/.next/server/chunks/ssr/features_bot_components_01ye2wp._.js +1 -1
- package/.next/server/chunks/ssr/features_bot_components_bot-setting_tsx_01ajft6._.js +2 -2
- package/.next/server/chunks/ssr/features_bot_components_thread-setting_tsx_0yae7zy._.js +1 -1
- package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +2 -2
- 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 +2 -2
- package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
- package/.next/server/chunks/ssr/features_skills_components_skills-setting_tsx_1wtuuip._.js +1 -1
- package/.next/server/chunks/ssr/features_thursday_components_thursday-setting_tsx_1_6ydrc._.js +1 -1
- package/.next/server/chunks/ssr/{node_modules_193w7l8._.js → node_modules_02djdfa._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_1bwlhwa._.js → node_modules_03ybg-h._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_01xoz64._.js → node_modules_066eqdg._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_20ifwl6._.js → node_modules_09605b3._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1yilsx4._.js → node_modules_0_c17cv._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_080f5gu._.js → node_modules_0a1-9-h._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_17c047f._.js → node_modules_0bfpl_c._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1pav8g4._.js → node_modules_0brchjo._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0gwiuga._.js → node_modules_0c0pgdi._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_02-zrtu._.js → node_modules_0ep265x._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0kqej10._.js → node_modules_0gzvt6a._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_0i18max._.js → node_modules_0h4gjw5._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1m2_gxv._.js → node_modules_0iso-he._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0cda8i6._.js → node_modules_0jvqmb4._.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_0kzgugm._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_0uvoegq._.js → node_modules_0l8gpkg._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_12ajdg8._.js → node_modules_0mlrvds._.js} +2 -2
- package/.next/server/chunks/ssr/node_modules_0nvqvnw._.js +7 -7
- package/.next/server/chunks/ssr/{node_modules_1s3j8gb._.js → node_modules_0ogtyfm._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_1_xiwxs._.js → node_modules_0os_-0h._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1abjhxx._.js → node_modules_0p05zru._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1o-m6_3._.js → node_modules_0pf8124._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_0eqvt2l._.js → node_modules_0pp3v4f._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_0rzz90e._.js → node_modules_0r1vv13._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1kum1yu._.js → node_modules_0r9yw6x._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1yw5fq4._.js → node_modules_0rk1a3e._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1es3wjv._.js → node_modules_0sq1pa3._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_1-cv1_p._.js → node_modules_0w-pjyz._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_0g_yuwn._.js → node_modules_0yoh66_._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1s9agqr._.js → node_modules_10kn3ni._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_1yajzrd._.js → node_modules_124ipg-._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0svoyrb._.js → node_modules_12_p7d0._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_203yqqb._.js → node_modules_12w12wr._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_17ks351._.js → node_modules_16kmp_v._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_05qs8r_._.js → node_modules_16m_yhd._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_07dc1cr._.js → node_modules_171uvar._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0qsi9t2._.js → node_modules_19pn2ti._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0k9_jdk._.js → node_modules_1_ly5yy._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0o_gq58._.js → node_modules_1_wsn9q._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1u7wlaq._.js → node_modules_1djak6n._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_08cq8i-._.js → node_modules_1e-oxmh._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_15x7int._.js → node_modules_1ed4zep._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_1pkpq6d._.js → node_modules_1f2qlxm._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_1aw7c9f._.js → node_modules_1fn72fs._.js} +2 -2
- package/.next/server/chunks/ssr/node_modules_1h9p77x._.js +7 -7
- package/.next/server/chunks/ssr/{node_modules_1ucf2fi._.js → node_modules_1hj0rvo._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_12pvysk._.js → node_modules_1jvkoqj._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0tq4-57._.js → node_modules_1jzofr8._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_08hfp3a._.js → node_modules_1maqy-g._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_071fb26._.js → node_modules_1oox5h1._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0_jxnnn._.js → node_modules_1p56fwh._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_01yukzc._.js → node_modules_1prbr1-._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1hrbceb._.js → node_modules_1qfou69._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_11f1w-3._.js → node_modules_1qnosqe._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_1kd_hpx._.js → node_modules_1rdpn6v._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_079iwnx._.js → node_modules_1v6m9sp._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1iapzqf._.js → node_modules_1z8ywx9._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1dim95c._.js → node_modules_1zzudo-._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1_71wv3._.js → node_modules_2157u1j._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_katex_dist_katex_mjs_1c5gb92._.js → node_modules_katex_dist_katex_mjs_12lynt6._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_katex_dist_katex_mjs_1ocxq2z._.js → node_modules_katex_dist_katex_mjs_1vjoadq._.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1v93o68._.js +1 -1
- package/.next/server/middleware-build-manifest.js +5 -5
- 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 +185 -185
- package/.next/static/chunks/051z85h3ofmif.js +1 -0
- package/.next/static/chunks/05722zc-sohb_.js +4 -0
- package/.next/static/chunks/07jo959manleh.js +1 -0
- package/.next/static/chunks/0_5a18_y41-_4.js +1 -0
- package/.next/static/chunks/0be7dgti95u_2.js +1 -0
- package/.next/static/chunks/0c28x0q2aqsbj.js +1 -0
- package/.next/static/chunks/0o_rabv5are-o.js +2 -0
- package/.next/static/chunks/{0776-hu4_eek7.js → 0wwq57j09skhy.js} +2 -2
- package/.next/static/chunks/0zm3urd75-zw5.js +1 -0
- package/.next/static/chunks/16hfi69t-6a4t.js +2 -0
- package/.next/static/chunks/1g58g8-daiwu5.js +3 -0
- package/.next/static/chunks/1i1u85j-_yb1n.js +15 -0
- package/.next/static/chunks/1kd2sxkkrae8e.js +1 -0
- package/.next/static/chunks/{3xloayc4c096r.js → 1n3a07w81jbc-.js} +1 -1
- package/.next/static/chunks/1nncyxatu7une.js +1 -0
- package/.next/static/chunks/1s5t41jiomssd.css +1 -0
- package/.next/static/chunks/1yl4mlpsw8e7h.js +1 -0
- package/.next/static/chunks/{33qtnlc00c9gq.js → 2gl-fo_rmmmq0.js} +1 -1
- package/.next/static/chunks/2h_sak2oi70qs.js +1 -0
- package/.next/static/chunks/2isg5redeg2bc.js +1 -0
- package/.next/static/chunks/{2fxn-xltgy2un.js → 2of2-kggzp-fk.js} +1 -1
- package/.next/static/chunks/2vmran3sacktz.js +1 -0
- package/.next/static/chunks/2w02v9g8o9-rz.js +1 -0
- package/.next/static/chunks/2wi2pcbjrqm86.js +1 -0
- package/.next/static/chunks/2xk8otp3gnzml.js +1 -0
- package/.next/static/chunks/2ym1hrikoit8p.js +1 -0
- package/.next/static/chunks/34d1f980dv5c6.js +18 -0
- package/.next/static/chunks/34zhr71217o1-.js +2 -0
- package/.next/static/chunks/{0o1r15rfncytn.js → 37r4l2878vybp.js} +1 -1
- package/.next/static/chunks/{2cz5734j90h5b.js → 3a-2z23puvz2z.js} +1 -1
- package/.next/static/chunks/3d55-y263hup9.js +1 -0
- package/.next/static/chunks/3dzrveotr82eu.js +39 -0
- package/.next/static/chunks/3fensfht8pxhl.js +55 -0
- package/.next/static/chunks/3k7fum0yljmyr.js +1 -0
- package/.next/static/chunks/3sawwm4vucnzn.js +1 -0
- package/.next/static/chunks/{0z0-g4k1hnpw2.js → 3u208m--8u1iq.js} +1 -1
- package/.next/static/chunks/{turbopack-1kym6rf88i5i0.js → turbopack-0ekrsq98buh0j.js} +1 -1
- package/README.md +18 -18
- package/bin/background.mjs +60 -32
- package/bin/print.mjs +82 -0
- package/bin/thursday.mjs +44 -13
- package/guide/bots.md +19 -3
- package/guide/calls.md +5 -2
- package/guide/memory.md +2 -1
- package/guide/setup.md +8 -6
- package/guide/trouble.md +4 -0
- package/package.json +11 -5
- package/public/voices/intro/awake-f4e02fad.ogg +0 -0
- package/seed-skills/concierge/travel/scripts/itinerary.mjs +2 -1
- package/server.js +1 -1
- package/skills/artifact/references/document.md +5 -2
- package/skills/artifact/runtime/document/markdown.mjs +14 -1
- package/skills/artifact/runtime/shell/head.html +1 -1
- package/skills/artifact/scripts/document.mjs +9 -3
- package/skills/browser/SKILL.md +17 -13
- package/.next/server/chunks/[root-of-the-server]__0ald4vb._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0srfj96._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1kos36s._.js +0 -6
- package/.next/server/chunks/ssr/_024j8bs._.js +0 -3
- package/.next/server/chunks/ssr/_04jb10a._.js +0 -3
- package/.next/server/chunks/ssr/_059oyhd._.js +0 -3
- package/.next/server/chunks/ssr/_0d0uyl3._.js +0 -3
- package/.next/server/chunks/ssr/_0fk7dbp._.js +0 -88
- package/.next/server/chunks/ssr/_0gfa_rb._.js +0 -3
- package/.next/server/chunks/ssr/_0i7zd74._.js +0 -3
- package/.next/server/chunks/ssr/_0sp2z94._.js +0 -3
- package/.next/server/chunks/ssr/_1avnw03._.js +0 -57
- package/.next/server/chunks/ssr/_1bfrntd._.js +0 -6
- package/.next/server/chunks/ssr/_1cpvfkg._.js +0 -3
- package/.next/server/chunks/ssr/_1cqjpyq._.js +0 -3
- package/.next/server/chunks/ssr/_1khngyc._.js +0 -72
- package/.next/server/chunks/ssr/_1kyjimg._.js +0 -162
- package/.next/server/chunks/ssr/_1sw4r4m._.js +0 -6
- package/.next/server/chunks/ssr/_20004tu._.js +0 -57
- package/.next/server/chunks/ssr/node_modules_01alue6._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_02n9-pb._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0zxr5sz._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_trash_mjs_0px2gzr._.js +0 -3
- package/.next/static/chunks/02d9vhnz5mwvu.js +0 -1
- package/.next/static/chunks/06ff4fq0z4das.js +0 -1
- package/.next/static/chunks/09q9n7jrkm4c9.js +0 -39
- package/.next/static/chunks/0b3wt5kqs-mk2.js +0 -2
- package/.next/static/chunks/0blrj_tg1yur0.js +0 -1
- package/.next/static/chunks/0dn1ptom1ahgg.js +0 -18
- package/.next/static/chunks/0dq7uppta9s--.js +0 -1
- package/.next/static/chunks/0hoz2b--nhn4y.js +0 -1
- package/.next/static/chunks/0kfjtkez2xze2.js +0 -1
- package/.next/static/chunks/0mv2zywfzt83k.js +0 -4
- package/.next/static/chunks/0txtrhykehsd_.js +0 -55
- package/.next/static/chunks/17vs1vz7_4l4p.css +0 -1
- package/.next/static/chunks/1dnvf_117h4k3.js +0 -2
- package/.next/static/chunks/1irynso77np9t.js +0 -1
- package/.next/static/chunks/1sh_-w_keseat.js +0 -1
- package/.next/static/chunks/1z2_9pl3nezly.js +0 -3
- package/.next/static/chunks/23ty4edkuxirx.js +0 -1
- package/.next/static/chunks/2f1cnfz4h1e2x.js +0 -1
- package/.next/static/chunks/2jepcbdewlwlg.js +0 -1
- package/.next/static/chunks/2r_zq_knm0hph.js +0 -15
- package/.next/static/chunks/2yfmmo4qr_f-m.js +0 -1
- package/.next/static/chunks/3-xnkknav7azp.js +0 -1
- package/.next/static/chunks/38q31td1ecuay.js +0 -1
- package/.next/static/chunks/3n75-7grldc6f.js +0 -1
- package/.next/static/chunks/3ofr4htw4wpj3.js +0 -1
- package/.next/static/chunks/40bkw3zfenss4.js +0 -2
- package/public/voices/intro/awake-17dbafbf.ogg +0 -0
- package/public/voices/intro/models-d09ddc74.ogg +0 -0
- /package/.next/static/{YIQV0_9FZPTFUe9TCiVSF → 3_9hbwcAuWTSWCJSufp3d}/_buildManifest.js +0 -0
- /package/.next/static/{YIQV0_9FZPTFUe9TCiVSF → 3_9hbwcAuWTSWCJSufp3d}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{YIQV0_9FZPTFUe9TCiVSF → 3_9hbwcAuWTSWCJSufp3d}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[82951,a=>{"use strict";var b=a.i(187924),c=a.i(141146),d=a.i(875160),e=a.i(272944),f=a.i(19895),g=a.i(951675),h=a.i(474215),i=a.i(572131),j=a.i(767561),k=a.i(340695),l=a.i(965733),m=a.i(676504),n=a.i(446181),o=a.i(545097),p=a.i(950463),q=a.i(287702),r=a.i(508348),s=a.i(405050);let t=(0,s.createServerReference)("7fd40f26d76af291251c491e93946f87b8d3b43830",s.callServer,void 0,s.findSourceMapURL,"clearFinishedThreadsAction"),u=(0,s.createServerReference)("7f44b91871e54f81255b63099bd09ff84c6acec284",s.callServer,void 0,s.findSourceMapURL,"deleteThreadAction");var v=a.i(411509),w=a.i(913834),x=a.i(42380),y=a.i(8468),z=a.i(181809),A=a.i(135432),B=a.i(156819),C=a.i(619477),D=a.i(199169),E=a.i(313237),F=a.i(862966),G=a.i(759497),H=a.i(497895),I=a.i(988422);let J="w-36";function K({thread:a,bots:e,open:f,onOpen:g,onStop:h,onDelete:j}){let k="running"===a.status,l=(0,i.useMemo)(()=>(0,A.threadFromRow)(a,e),[a,e]),m=function(a){let b=a.room.questions[0];if(b)return{text:(0,H.plainText)(b.text),tone:H.WAITING_INK};if("waiting"===a.status&&a.ask)return{text:(0,v.isAppStop)(a.ask)?(0,H.plainText)(a.outcome??a.ask.question):a.ask.question,tone:H.WAITING_INK};let c=a.seen;if("cancelled"===a.status)return{text:"Stopped",tone:"text-muted-foreground"};if("done"===a.status)return{text:(0,H.plainText)(a.outcome??"Done"),tone:c?"text-muted-foreground":"text-foreground/80"};for(let b=a.lines.length-1;b>=0;b--){let c=a.lines[b];if("tool"===c.kind)return{text:c.note??c.input,tone:"text-muted-foreground",tool:c.name,shine:!0};if("text"===c.kind)return{text:c.text,tone:"text-muted-foreground",shine:!0};if("user"===c.kind)break}return{text:`${a.bot} is taking it on…`,tone:"text-muted-foreground italic",shine:!0}}(a),n=a.tokens.input+a.tokens.output;return(0,b.jsxs)("div",{className:(0,H.cn)("group/row relative transition-colors",f?"bg-muted/80":"hover:bg-muted/50"),children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,b.jsxs)("button",{type:"button",onClick:g,className:"flex min-w-0 flex-1 items-center gap-3 rounded-md text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,b.jsx)(w.BotMark,{size:40,seed:a.bot,...(0,w.markOf)(a.bot,e),state:k?"thinking":"idle",notify:(0,v.needsThreadReply)(a)||(0,v.isUnread)(a),crossed:"cancelled"===a.status,className:"shrink-0"}),(0,b.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,b.jsxs)("span",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"truncate text-sm font-medium",children:a.label}),a.routineId&&(0,b.jsx)("span",{title:"Started by a routine",className:"shrink-0",children:(0,b.jsx)(B.RoutineMark,{className:"size-3 text-muted-foreground/80"})}),(0,b.jsx)(x.BotRoster,{bots:l.roster}),k&&(0,b.jsx)(d.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"})]}),m&&(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-[13px] leading-snug",children:[m.tool&&(0,b.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:m.tool}),m.shine?(0,b.jsx)(o.ShinyText,{text:m.text,speed:2.2,className:"min-w-0 truncate"}):(0,b.jsx)("span",{className:(0,H.cn)("min-w-0 truncate",m.tone),children:m.text})]})]}),(0,b.jsxs)("span",{className:(0,H.cn)("flex shrink-0 flex-col items-end gap-0.5 font-mono text-[11px] leading-4 text-muted-foreground tabular-nums",J),children:[(0,b.jsx)("span",{children:(0,D.whenOf)(a.updatedAt)}),(0,b.jsxs)("span",{className:"max-w-full truncate text-muted-foreground/70",title:n>0?`${a.id} \xb7 in ${(0,H.formatCount)(a.tokens.input)} \xb7 out ${(0,H.formatCount)(a.tokens.output)}`:a.id,children:[a.bot,n>0&&` \xb7 ${(0,H.formatCount)(n)}`]})]}),(0,b.jsx)(c.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground"})]}),(0,b.jsx)(L,{thread:a,onStop:h,onDelete:j})]}),k&&(0,b.jsx)(N,{thread:a})]})}function L({thread:a,onStop:c,onDelete:d,className:h}){let i="running"===a.status||"waiting"===a.status;return(0,b.jsxs)(m.DropdownMenu,{children:[(0,b.jsx)(m.DropdownMenuTrigger,{render:(0,b.jsx)(k.Button,{size:"icon-sm",variant:"ghost","aria-label":"More",className:h}),children:(0,b.jsx)(e.MoreHorizontal,{})}),(0,b.jsxs)(m.DropdownMenuContent,{align:"end",children:[i&&(0,b.jsxs)(m.DropdownMenuItem,{onClick:c,children:[(0,b.jsx)(f.Square,{}),"Stop"]}),(0,b.jsxs)(m.DropdownMenuItem,{variant:"destructive",onClick:d,children:[(0,b.jsx)(g.Trash2,{}),"Delete"]})]})]})}function M({thread:a,whole:c,bots:d,onClose:e,onStop:f,onDelete:g}){let[j,m]=(0,i.useState)(null),n=(0,i.useCallback)(a=>{m(a?.closest("[data-slot=dialog-content]")??null)},[]),[o,q]=(0,i.useState)({}),r=(0,i.useMemo)(()=>a?(0,A.threadFromRow)(a,d):null,[a,d]),s=(0,i.useMemo)(()=>c?(0,A.threadFromRow)(c,d):r?.lines.length?r:null,[c,r,d]),t=a?o[a.id]??null:null;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{ref:n,hidden:!0}),(0,b.jsx)(l.Dialog,{open:!!(a&&j),onOpenChange:a=>!a&&e(),modal:!1,disablePointerDismissal:!0,children:(0,b.jsx)(l.DialogPortal,{container:j,children:(0,b.jsx)(l.DialogPopup,{className:"absolute inset-y-0 right-0 z-10 flex w-[min(35rem,calc(100%-13rem))] flex-col border-l border-border/60 bg-popover text-popover-foreground shadow-2xl shadow-black/10 duration-150 data-open:animate-in data-open:fade-in-0 data-open:slide-in-from-right-4 data-closed:animate-out data-closed:fade-out-0 data-closed:slide-out-to-right-4",children:a&&r&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-2.5 pt-3.5 pr-3 pb-1.5 pl-5",children:[(0,b.jsx)(w.BotMark,{size:28,seed:a.bot,...(0,w.markOf)(a.bot,d),state:"running"===a.status?"thinking":"idle",notify:(0,v.needsThreadReply)(a),crossed:"cancelled"===a.status,className:"shrink-0"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)(l.DialogTitle,{className:"sr-only",children:a.label}),(0,b.jsx)("p",{className:"truncate text-[15px] leading-5 font-semibold",children:a.label}),(0,b.jsxs)("div",{className:"mt-0.5 flex min-w-0 items-center gap-2 font-mono text-[11px] text-muted-foreground",children:[(0,b.jsxs)("span",{title:a.id,className:"min-w-0 truncate",children:[a.bot," · ",(0,D.whenOf)(a.updatedAt)]}),(0,b.jsx)(z.ThreadFacts,{thread:r})]})]}),(0,b.jsx)(L,{thread:a,onStop:()=>f(a),onDelete:()=>g(a),className:"text-muted-foreground"}),(0,b.jsx)(l.DialogClose,{render:(0,b.jsx)(k.Button,{size:"icon-sm",variant:"ghost","aria-label":"Close the thread"}),children:(0,b.jsx)(h.X,{})})]}),s?(0,b.jsx)(z.Conversation,{thread:s,tab:t,onTab:b=>q(c=>({...c,[a.id]:b})),className:"max-h-none min-h-0 flex-1 px-5",tabsClassName:"px-5"}):(0,b.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-2 px-5 py-4",children:[(0,b.jsx)(p.Skeleton,{className:"h-3 w-4/5"}),(0,b.jsx)(p.Skeleton,{className:"h-3 w-3/5"}),(0,b.jsx)(p.Skeleton,{className:"h-3 w-2/3"})]}),(0,b.jsx)("div",{className:"shrink-0 px-5 pt-2 pb-4",children:(0,b.jsx)(I.ThreadReply,{thread:{id:a.id,label:a.label,bot:a.bot,ask:a.ask,room:a.room},status:a.status,faces:r.roster,to:t??a.bot,claimsDrops:!1})})]})})})})]})}function N({thread:a}){let c=[];if(a.lines.forEach((b,d)=>{if("tool"!==b.kind)return;let e=a.lines[d+1];c.push({step:b,took:e?(0,D.toDate)(e.at).getTime()-(0,D.toDate)(b.at).getTime():null})}),0===c.length)return null;let e=(0,D.toDate)(a.updatedAt).getTime()-(0,D.toDate)(a.createdAt).getTime();return(0,b.jsxs)("div",{className:"pointer-events-none absolute top-[calc(100%-0.75rem)] left-17 z-20 hidden w-96 max-w-[calc(100%-5rem)] rounded-xl bg-background p-3 pb-2 shadow-xl shadow-black/10 ring-1 ring-border/60 group-hover/row:block",children:[(0,b.jsxs)("div",{className:"mb-1.5 flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[(0,b.jsx)("span",{children:a.bot}),(0,b.jsx)("span",{className:"opacity-50",children:"·"}),(0,b.jsxs)("span",{children:[c.length," ",1===c.length?"step":"steps"]}),(0,b.jsx)("span",{className:"opacity-50",children:"·"}),(0,b.jsx)("span",{children:O(e)})]}),c.slice(-6).map(({step:a,took:c})=>{let e=(0,y.toolIcon)(a.name);return(0,b.jsxs)("div",{className:"flex h-5.5 items-center gap-2 font-mono text-[11px]",children:[null===c?(0,b.jsx)(d.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}):(0,b.jsx)(e,{className:"size-3 shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",children:a.name}),null===c?(0,b.jsx)(o.ShinyText,{text:a.note??a.input,speed:2.2,className:"min-w-0 flex-1 truncate"}):(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:a.note??a.input}),(0,b.jsx)("span",{className:"w-10 shrink-0 text-right text-muted-foreground/70 tabular-nums",children:null===c?"":O(c)})]},a.id)})]})}function O(a){let b=Math.max(0,a)/1e3;if(b<10)return`${b.toFixed(1)}s`;if(b<60)return`${Math.round(b)}s`;let c=Math.floor(b/60);return`${c}m ${Math.round(b-60*c)}s`}function P(){return(0,b.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,b.jsx)(p.Skeleton,{className:"size-10 shrink-0 rounded-full"}),(0,b.jsxs)("span",{className:"min-w-0 flex-1 space-y-2",children:[(0,b.jsx)(p.Skeleton,{className:"h-3 w-40 max-w-full"}),(0,b.jsx)(p.Skeleton,{className:"h-2.5 w-80 max-w-full"})]}),(0,b.jsxs)("span",{className:(0,H.cn)("flex shrink-0 flex-col items-end gap-1.5",J),children:[(0,b.jsx)(p.Skeleton,{className:"h-2.5 w-12"}),(0,b.jsx)(p.Skeleton,{className:"h-2.5 w-24"})]}),(0,b.jsx)("span",{className:"size-4 shrink-0"}),(0,b.jsx)("span",{className:"size-7 shrink-0"})]})}a.s(["ThreadSetting",0,function(){let[a,c]=(0,i.useState)(null),[d,e]=(0,i.useState)(""),{data:f}=(0,G.useServerRoute)(j.queryKey.bot),{items:g,isLoading:h,isLoadingMore:l,error:m,hasMore:o,sentinelRef:p}=(0,F.useServerPages)({key:(a,b)=>{if(0===a)return j.queryKey.threadHistory(null);let c=b?.at(-1);return c?j.queryKey.threadHistory((0,D.toDate)(c.updatedAt).toISOString()):null},size:q.PAGE_SIZE}),s=g.find(b=>b.id===a),{data:w}=(0,G.useServerRoute)(a?j.queryKey.thread(a):null),x=w?.id===a?w:void 0;(0,A.useSeenOnDetail)(s);let[y]=(0,E.useServerAction)(r.cancelThreadAction,{onOk:a=>{(0,G.revalidate)(j.queryKey.threads),A.screenActs.announce({kind:"stopped",id:a.id,label:a.label})}}),[z]=(0,E.useServerAction)(u,{onOk:()=>(0,G.revalidate)(j.queryKey.threads)}),[B]=(0,E.useServerAction)(t,{onOk:()=>(0,G.revalidate)(j.queryKey.threads)}),H=d.trim().toLowerCase(),I=H?g.filter(a=>[a.label,a.outcome,a.bot].join(" ").toLowerCase().includes(H)):g,J=async()=>{await n.notify.confirm({title:"Clear finished jobs?",description:"Everything done or stopped goes, messages included. Running and waiting jobs stay.",okText:"Clear",destructive:!0})&&B()},L=async b=>{if(!await n.notify.confirm({title:`Delete "${b.label}"?`,description:"Its messages go with it — nothing can be picked back up.",okText:"Delete",destructive:!0}))return;let d=I.findIndex(a=>a.id===b.id),e=I[d+1]??I[d-1];try{await z(b.id)}catch{return}b.id===a&&c(e?.id??null)};if(h)return(0,b.jsx)(C.SettingSkeleton,{rows:3});if(m)return(0,b.jsx)(C.SettingError,{message:m.message});let N=g.filter(a=>"waiting"===a.status).length,O=g.filter(v.isUnread).length;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C.SettingScreen,{footer:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(C.SettingRailNote,{children:[g.length," shown",N>0&&` \xb7 ${N} waiting on you`,O>0&&` \xb7 ${O} new result${1===O?"":"s"}`]}),(o||g.some(a=>"done"===a.status||"cancelled"===a.status))&&(0,b.jsx)(k.Button,{variant:"outline",size:"sm",onClick:J,children:"Clear finished"})]}),children:(0,b.jsx)(C.SettingGroup,{filter:(0,b.jsx)(C.SettingFilter,{value:d,onChange:e,placeholder:"Filter by label, bot or word"}),right:H?`${I.length} of ${g.length}`:void 0,children:(0,b.jsxs)(C.SettingItems,{children:[0===I.length?(0,b.jsx)("p",{className:"p-4 text-sm leading-relaxed text-muted-foreground",children:H?"Nothing here matches. Keep scrolling to search further back.":"Nothing yet. When Thursday hands a job to a bot mid-call, it shows up here — while it runs, and after."}):I.map(a=>(0,b.jsx)(K,{thread:a,bots:f,open:a.id===s?.id,onOpen:()=>c(a.id),onStop:()=>y(a.id),onDelete:()=>L(a)},a.id)),(0,b.jsx)(C.SettingMore,{hasMore:o,loading:l,sentinelRef:p,ghost:(0,b.jsx)(P,{}),className:"divide-y divide-border/60"})]})})}),(0,b.jsx)(M,{thread:s,whole:x,bots:f,onClose:()=>c(null),onStop:a=>y(a.id),onDelete:L})]})}],82951)}];
|
|
1
|
+
module.exports=[82951,a=>{"use strict";var b=a.i(187924),c=a.i(141146),d=a.i(875160),e=a.i(272944),f=a.i(19895),g=a.i(951675),h=a.i(474215),i=a.i(572131),j=a.i(767561),k=a.i(340695),l=a.i(965733),m=a.i(676504),n=a.i(446181),o=a.i(545097),p=a.i(950463),q=a.i(287702),r=a.i(911640),s=a.i(405050);let t=(0,s.createServerReference)("7f2560d4b1b1c84196804520b3ce0265c5e51a1037",s.callServer,void 0,s.findSourceMapURL,"clearFinishedThreadsAction"),u=(0,s.createServerReference)("7fd1ec1fba6c8a90fb823e19f9190ed8b87a503a22",s.callServer,void 0,s.findSourceMapURL,"deleteThreadAction");var v=a.i(411509),w=a.i(913834),x=a.i(42380),y=a.i(8468),z=a.i(181809),A=a.i(135432),B=a.i(156819),C=a.i(619477),D=a.i(199169),E=a.i(313237),F=a.i(862966),G=a.i(759497),H=a.i(497895),I=a.i(988422);let J="w-36";function K({thread:a,bots:e,open:f,onOpen:g,onStop:h,onDelete:j}){let k="running"===a.status,l=(0,i.useMemo)(()=>(0,A.threadFromRow)(a,e),[a,e]),m=function(a){let b=a.room.questions[0];if(b)return{text:(0,H.plainText)(b.text),tone:H.WAITING_INK};if("waiting"===a.status&&a.ask)return{text:(0,v.isAppStop)(a.ask)?(0,H.plainText)(a.outcome??a.ask.question):a.ask.question,tone:H.WAITING_INK};let c=a.seen;if("cancelled"===a.status)return{text:"Stopped",tone:"text-muted-foreground"};if("done"===a.status)return{text:(0,H.plainText)(a.outcome??"Done"),tone:c?"text-muted-foreground":"text-foreground/80"};for(let b=a.lines.length-1;b>=0;b--){let c=a.lines[b];if("tool"===c.kind)return{text:c.note??c.input,tone:"text-muted-foreground",tool:c.name,shine:!0};if("text"===c.kind)return{text:c.text,tone:"text-muted-foreground",shine:!0};if("user"===c.kind)break}return{text:`${a.bot} is taking it on…`,tone:"text-muted-foreground italic",shine:!0}}(a),n=a.tokens.input+a.tokens.output;return(0,b.jsxs)("div",{className:(0,H.cn)("group/row relative transition-colors",f?"bg-muted/80":"hover:bg-muted/50"),children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,b.jsxs)("button",{type:"button",onClick:g,className:"flex min-w-0 flex-1 items-center gap-3 rounded-md text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,b.jsx)(w.BotMark,{size:40,seed:a.bot,...(0,w.markOf)(a.bot,e),state:k?"thinking":"idle",notify:(0,v.needsThreadReply)(a)||(0,v.isUnread)(a),crossed:"cancelled"===a.status,className:"shrink-0"}),(0,b.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,b.jsxs)("span",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"truncate text-sm font-medium",children:a.label}),a.routineId&&(0,b.jsx)("span",{title:"Started by a routine",className:"shrink-0",children:(0,b.jsx)(B.RoutineMark,{className:"size-3 text-muted-foreground/80"})}),(0,b.jsx)(x.BotRoster,{bots:l.roster}),k&&(0,b.jsx)(d.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"})]}),m&&(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-[13px] leading-snug",children:[m.tool&&(0,b.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:m.tool}),m.shine?(0,b.jsx)(o.ShinyText,{text:m.text,speed:2.2,className:"min-w-0 truncate"}):(0,b.jsx)("span",{className:(0,H.cn)("min-w-0 truncate",m.tone),children:m.text})]})]}),(0,b.jsxs)("span",{className:(0,H.cn)("flex shrink-0 flex-col items-end gap-0.5 font-mono text-[11px] leading-4 text-muted-foreground tabular-nums",J),children:[(0,b.jsx)("span",{children:(0,D.whenOf)(a.updatedAt)}),(0,b.jsxs)("span",{className:"max-w-full truncate text-muted-foreground",title:n>0?`${a.id} \xb7 in ${(0,H.formatCount)(a.tokens.input)} \xb7 out ${(0,H.formatCount)(a.tokens.output)}`:a.id,children:[a.bot,n>0&&` \xb7 ${(0,H.formatCount)(n)}`]})]}),(0,b.jsx)(c.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground"})]}),(0,b.jsx)(L,{thread:a,onStop:h,onDelete:j})]}),k&&(0,b.jsx)(N,{thread:a})]})}function L({thread:a,onStop:c,onDelete:d,className:h}){let i="running"===a.status||"waiting"===a.status;return(0,b.jsxs)(m.DropdownMenu,{children:[(0,b.jsx)(m.DropdownMenuTrigger,{render:(0,b.jsx)(k.Button,{size:"icon-sm",variant:"ghost","aria-label":"More",className:h}),children:(0,b.jsx)(e.MoreHorizontal,{})}),(0,b.jsxs)(m.DropdownMenuContent,{align:"end",children:[i&&(0,b.jsxs)(m.DropdownMenuItem,{onClick:c,children:[(0,b.jsx)(f.Square,{}),"Stop"]}),(0,b.jsxs)(m.DropdownMenuItem,{variant:"destructive",onClick:d,children:[(0,b.jsx)(g.Trash2,{}),"Delete"]})]})]})}function M({thread:a,whole:c,bots:d,onClose:e,onStop:f,onDelete:g}){let[j,m]=(0,i.useState)(null),n=(0,i.useCallback)(a=>{m(a?.closest("[data-slot=dialog-content]")??null)},[]),[o,q]=(0,i.useState)({}),r=(0,i.useMemo)(()=>a?(0,A.threadFromRow)(a,d):null,[a,d]),s=(0,i.useMemo)(()=>c?(0,A.threadFromRow)(c,d):r?.lines.length?r:null,[c,r,d]),t=a?o[a.id]??null:null;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{ref:n,hidden:!0}),(0,b.jsx)(l.Dialog,{open:!!(a&&j),onOpenChange:a=>!a&&e(),modal:!1,disablePointerDismissal:!0,children:(0,b.jsx)(l.DialogPortal,{container:j,children:(0,b.jsx)(l.DialogPopup,{className:"absolute inset-y-0 right-0 z-10 flex w-[min(35rem,calc(100%-13rem))] flex-col border-l border-border/60 bg-popover text-popover-foreground shadow-2xl shadow-black/10 duration-150 data-open:animate-in data-open:fade-in-0 data-open:slide-in-from-right-4 data-closed:animate-out data-closed:fade-out-0 data-closed:slide-out-to-right-4",children:a&&r&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-2.5 pt-3.5 pr-3 pb-1.5 pl-5",children:[(0,b.jsx)(w.BotMark,{size:28,seed:a.bot,...(0,w.markOf)(a.bot,d),state:"running"===a.status?"thinking":"idle",notify:(0,v.needsThreadReply)(a),crossed:"cancelled"===a.status,className:"shrink-0"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)(l.DialogTitle,{className:"sr-only",children:a.label}),(0,b.jsx)("p",{className:"truncate text-[15px] leading-5 font-semibold",children:a.label}),(0,b.jsxs)("div",{className:"mt-0.5 flex min-w-0 items-center gap-2 font-mono text-[11px] text-muted-foreground",children:[(0,b.jsxs)("span",{title:a.id,className:"min-w-0 truncate",children:[a.bot," · ",(0,D.whenOf)(a.updatedAt)]}),(0,b.jsx)(z.ThreadFacts,{thread:r})]})]}),(0,b.jsx)(L,{thread:a,onStop:()=>f(a),onDelete:()=>g(a),className:"text-muted-foreground"}),(0,b.jsx)(l.DialogClose,{render:(0,b.jsx)(k.Button,{size:"icon-sm",variant:"ghost","aria-label":"Close the thread"}),children:(0,b.jsx)(h.X,{})})]}),s?(0,b.jsx)(z.Conversation,{thread:s,tab:t,onTab:b=>q(c=>({...c,[a.id]:b})),className:"max-h-none min-h-0 flex-1 px-5",tabsClassName:"px-5"}):(0,b.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-2 px-5 py-4",children:[(0,b.jsx)(p.Skeleton,{className:"h-3 w-4/5"}),(0,b.jsx)(p.Skeleton,{className:"h-3 w-3/5"}),(0,b.jsx)(p.Skeleton,{className:"h-3 w-2/3"})]}),(0,b.jsx)("div",{className:"shrink-0 px-5 pt-2 pb-4",children:(0,b.jsx)(I.ThreadReply,{thread:{id:a.id,label:a.label,bot:a.bot,ask:a.ask,room:a.room},status:a.status,faces:r.roster,to:t??a.bot,claimsDrops:!1})})]})})})})]})}function N({thread:a}){let c=[];if(a.lines.forEach((b,d)=>{if("tool"!==b.kind)return;let e=a.lines[d+1];c.push({step:b,took:e?(0,D.toDate)(e.at).getTime()-(0,D.toDate)(b.at).getTime():null})}),0===c.length)return null;let e=(0,D.toDate)(a.updatedAt).getTime()-(0,D.toDate)(a.createdAt).getTime();return(0,b.jsxs)("div",{className:"pointer-events-none absolute top-[calc(100%-0.75rem)] left-17 z-20 hidden w-96 max-w-[calc(100%-5rem)] rounded-xl bg-background p-3 pb-2 shadow-xl shadow-black/10 ring-1 ring-border/60 group-hover/row:block",children:[(0,b.jsxs)("div",{className:"mb-1.5 flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[(0,b.jsx)("span",{children:a.bot}),(0,b.jsx)("span",{className:"opacity-50",children:"·"}),(0,b.jsxs)("span",{children:[c.length," ",1===c.length?"step":"steps"]}),(0,b.jsx)("span",{className:"opacity-50",children:"·"}),(0,b.jsx)("span",{children:O(e)})]}),c.slice(-6).map(({step:a,took:c})=>{let e=(0,y.toolIcon)(a.name);return(0,b.jsxs)("div",{className:"flex h-5.5 items-center gap-2 font-mono text-[11px]",children:[null===c?(0,b.jsx)(d.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}):(0,b.jsx)(e,{className:"size-3 shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",children:a.name}),null===c?(0,b.jsx)(o.ShinyText,{text:a.note??a.input,speed:2.2,className:"min-w-0 flex-1 truncate"}):(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:a.note??a.input}),(0,b.jsx)("span",{className:"w-10 shrink-0 text-right text-muted-foreground tabular-nums",children:null===c?"":O(c)})]},a.id)})]})}function O(a){let b=Math.max(0,a)/1e3;if(b<10)return`${b.toFixed(1)}s`;if(b<60)return`${Math.round(b)}s`;let c=Math.floor(b/60);return`${c}m ${Math.round(b-60*c)}s`}function P(){return(0,b.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,b.jsx)(p.Skeleton,{className:"size-10 shrink-0 rounded-full"}),(0,b.jsxs)("span",{className:"min-w-0 flex-1 space-y-2",children:[(0,b.jsx)(p.Skeleton,{className:"h-3 w-40 max-w-full"}),(0,b.jsx)(p.Skeleton,{className:"h-2.5 w-80 max-w-full"})]}),(0,b.jsxs)("span",{className:(0,H.cn)("flex shrink-0 flex-col items-end gap-1.5",J),children:[(0,b.jsx)(p.Skeleton,{className:"h-2.5 w-12"}),(0,b.jsx)(p.Skeleton,{className:"h-2.5 w-24"})]}),(0,b.jsx)("span",{className:"size-4 shrink-0"}),(0,b.jsx)("span",{className:"size-7 shrink-0"})]})}a.s(["ThreadSetting",0,function(){let[a,c]=(0,i.useState)(null),[d,e]=(0,i.useState)(""),f=d.trim(),[g,h]=(0,i.useState)("");(0,i.useEffect)(()=>{let a=setTimeout(()=>h(f),q.SEARCH_WAIT_MS);return()=>clearTimeout(a)},[f]);let{data:l}=(0,G.useServerRoute)(j.queryKey.bot),{items:m,isLoading:o,isLoadingMore:p,error:s,hasMore:w,sentinelRef:x}=(0,F.useServerPages)({key:(a,b)=>{if(0===a)return j.queryKey.threadHistory(null,g);let c=b?.at(-1);return c?j.queryKey.threadHistory((0,D.toDate)(c.updatedAt).toISOString(),g):null},size:q.PAGE_SIZE}),y=m.find(b=>b.id===a),{data:z}=(0,G.useServerRoute)(a?j.queryKey.thread(a):null),B=z?.id===a?z:void 0;(0,A.useSeenOnDetail)(y);let[H]=(0,E.useServerAction)(r.cancelThreadAction,{onOk:a=>{(0,G.revalidate)(j.queryKey.threads),A.screenActs.announce({kind:"stopped",id:a.id,label:a.label})}}),[I]=(0,E.useServerAction)(u,{onOk:()=>(0,G.revalidate)(j.queryKey.threads)}),[J]=(0,E.useServerAction)(t,{onOk:()=>(0,G.revalidate)(j.queryKey.threads)}),L=async()=>{await n.notify.confirm({title:"Clear finished jobs?",description:"Everything done or stopped goes, messages included. Running and waiting jobs stay.",okText:"Clear",destructive:!0})&&J()},N=async b=>{if(!await n.notify.confirm({title:`Delete "${b.label}"?`,description:"Its messages go with it — nothing can be picked back up.",okText:"Delete",destructive:!0}))return;let d=m.findIndex(a=>a.id===b.id),e=m[d+1]??m[d-1];try{await I(b.id)}catch{return}b.id===a&&c(e?.id??null)};if(o)return(0,b.jsx)(C.SettingSkeleton,{rows:3});if(s)return(0,b.jsx)(C.SettingError,{message:s.message});let O=m.filter(a=>"waiting"===a.status).length,Q=m.filter(v.isUnread).length;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C.SettingScreen,{footer:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(C.SettingRailNote,{children:[m.length," shown",O>0&&` \xb7 ${O} waiting on you`,Q>0&&` \xb7 ${Q} new result${1===Q?"":"s"}`]}),(w||m.some(a=>"done"===a.status||"cancelled"===a.status))&&(0,b.jsx)(k.Button,{variant:"outline",size:"sm",onClick:L,children:"Clear finished"})]}),children:(0,b.jsx)(C.SettingGroup,{filter:(0,b.jsx)(C.SettingFilter,{value:d,onChange:e,placeholder:"Filter by label, bot or word"}),right:g?`${m.length}${w?"+":""} found`:void 0,children:(0,b.jsxs)(C.SettingItems,{children:[0===m.length?(0,b.jsx)("p",{className:"p-4 text-sm leading-relaxed text-muted-foreground",children:g?"No job matches that.":"Nothing yet. When Thursday hands a job to a bot mid-call, it shows up here — while it runs, and after."}):m.map(a=>(0,b.jsx)(K,{thread:a,bots:l,open:a.id===y?.id,onOpen:()=>c(a.id),onStop:()=>H(a.id),onDelete:()=>N(a)},a.id)),(0,b.jsx)(C.SettingMore,{hasMore:w,loading:p,sentinelRef:x,ghost:(0,b.jsx)(P,{}),className:"divide-y divide-border/60"})]})})}),(0,b.jsx)(M,{thread:y,whole:B,bots:l,onClose:()=>c(null),onStop:a=>H(a.id),onDelete:N})]})}],82951)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=features_bot_components_thread-setting_tsx_0yae7zy._.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[405593,
|
|
1
|
+
module.exports=[405593,a=>{"use strict";var b,c=a.i(187924),d=a.i(987234),e=a.i(823319),f=a.i(692867),g=a.i(626335),h=a.i(752562),i=a.i(141146),j=a.i(164831);let k={name:"clapperboard",size:24,node:[["path",{d:"m12.296 3.464 3.02 3.956",key:"qash78"}],["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z",key:"1h7j8b"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"4lm6w1"}],["path",{d:"m6.18 5.276 3.1 3.899",key:"zjj9t3"}]]};k.node;let l=(0,j.default)(k);var m=a.i(71215),n=a.i(126766),o=a.i(233540),p=a.i(26268),q=a.i(572131),r=a.i(767561),s=a.i(340695),t=a.i(205522),u=a.i(446181),v=a.i(341889),w=a.i(950463),x=a.i(287702),y=a.i(852307),z=a.i(908531),A=a.i(608902),B=a.i(379630),C=a.i(61876),D=a.i(913834),E=a.i(249049),F=a.i(405050);let G=(0,F.createServerReference)("7f4116c7b3607964bdd71a55470347fc0877efc6fa",F.callServer,void 0,F.findSourceMapURL,"removeConfigAction");var H=a.i(370403),I=a.i(478978),J=a.i(585650),K=a.i(168370),L=a.i(162591),M=((b=M||{})[b.Border=-1]="Border",b[b.Data=0]="Data",b[b.Function=1]="Function",b[b.Position=2]="Position",b[b.Timing=3]="Timing",b[b.Alignment=4]="Alignment",b);let N=[1,0],O=[2,3],P=[3,2],Q={L:[0,1],M:N,Q:O,H:P},R=/^\d*$/,S=/^[A-Z0-9 $%*+./:-]*$/,T="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",U=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],V=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class W{constructor(a,b,c,d){if(this.version=a,this.ecc=b,a<1||a>40)throw RangeError("Version value out of range");if(d<-1||d>7)throw RangeError("Mask value out of range");this.size=4*a+17;const e=Array.from({length:this.size}).fill(!1);for(let a=0;a<this.size;a++)this.modules.push(e.slice()),this.types.push(e.map(()=>0));this.drawFunctionPatterns();const f=this.addEccAndInterleave(c);if(this.drawCodewords(f),-1===d){let a=1e9;for(let b=0;b<8;b++){this.applyMask(b),this.drawFormatBits(b);const c=this.getPenaltyScore();c<a&&(d=b,a=c),this.applyMask(b)}}this.mask=d,this.applyMask(d),this.drawFormatBits(d)}size;mask;modules=[];types=[];getModule(a,b){return a>=0&&a<this.size&&b>=0&&b<this.size&&this.modules[b][a]}drawFunctionPatterns(){for(let a=0;a<this.size;a++)this.setFunctionModule(6,a,a%2==0,M.Timing),this.setFunctionModule(a,6,a%2==0,M.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let a=this.getAlignmentPatternPositions(),b=a.length;for(let c=0;c<b;c++)for(let d=0;d<b;d++)(0!==c||0!==d)&&(0!==c||d!==b-1)&&(c!==b-1||0!==d)&&this.drawAlignmentPattern(a[c],a[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(a){let b=this.ecc[1]<<3|a,c=b;for(let a=0;a<10;a++)c=c<<1^(c>>>9)*1335;let d=(b<<10|c)^21522;for(let a=0;a<=5;a++)this.setFunctionModule(8,a,Y(d,a));this.setFunctionModule(8,7,Y(d,6)),this.setFunctionModule(8,8,Y(d,7)),this.setFunctionModule(7,8,Y(d,8));for(let a=9;a<15;a++)this.setFunctionModule(14-a,8,Y(d,a));for(let a=0;a<8;a++)this.setFunctionModule(this.size-1-a,8,Y(d,a));for(let a=8;a<15;a++)this.setFunctionModule(8,this.size-15+a,Y(d,a));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let a=this.version;for(let b=0;b<12;b++)a=a<<1^(a>>>11)*7973;let b=this.version<<12|a;for(let a=0;a<18;a++){let c=Y(b,a),d=this.size-11+a%3,e=Math.floor(a/3);this.setFunctionModule(d,e,c),this.setFunctionModule(e,d,c)}}drawFinderPattern(a,b){for(let c=-4;c<=4;c++)for(let d=-4;d<=4;d++){let e=Math.max(Math.abs(d),Math.abs(c)),f=a+d,g=b+c;f>=0&&f<this.size&&g>=0&&g<this.size&&this.setFunctionModule(f,g,2!==e&&4!==e,M.Position)}}drawAlignmentPattern(a,b){for(let c=-2;c<=2;c++)for(let d=-2;d<=2;d++)this.setFunctionModule(a+d,b+c,1!==Math.max(Math.abs(d),Math.abs(c)),M.Alignment)}setFunctionModule(a,b,c,d=M.Function){this.modules[b][a]=c,this.types[b][a]=d}addEccAndInterleave(a){let b=this.version,c=this.ecc;if(a.length!==ae(b,c))throw RangeError("Invalid argument");let d=V[c[0]][b],e=U[c[0]][b],f=Math.floor(ad(b)/8),g=d-f%d,h=Math.floor(f/d),i=[],j=function(a){if(a<1||a>255)throw RangeError("Degree out of range");let b=[];for(let c=0;c<a-1;c++)b.push(0);b.push(1);let c=1;for(let d=0;d<a;d++){for(let a=0;a<b.length;a++)b[a]=af(b[a],c),a+1<b.length&&(b[a]^=b[a+1]);c=af(c,2)}return b}(e);for(let b=0,c=0;b<d;b++){let d=a.slice(c,c+h-e+(b<g?0:1));c+=d.length;let f=function(a,b){let c=b.map(a=>0);for(let d of a){let a=d^c.shift();c.push(0),b.forEach((b,d)=>c[d]^=af(b,a))}return c}(d,j);b<g&&d.push(0),i.push(d.concat(f))}let k=[];for(let a=0;a<i[0].length;a++)i.forEach((b,c)=>{(a!==h-e||c>=g)&&k.push(b[a])});return k}drawCodewords(a){if(a.length!==Math.floor(ad(this.version)/8))throw RangeError("Invalid argument");let b=0;for(let c=this.size-1;c>=1;c-=2){6===c&&(c=5);for(let d=0;d<this.size;d++)for(let e=0;e<2;e++){let f=c-e,g=(c+1&2)==0?this.size-1-d:d;!this.types[g][f]&&b<8*a.length&&(this.modules[g][f]=Y(a[b>>>3],7-(7&b)),b++)}}}applyMask(a){if(a<0||a>7)throw RangeError("Mask value out of range");for(let b=0;b<this.size;b++)for(let c=0;c<this.size;c++){let d;switch(a){case 0:d=(c+b)%2==0;break;case 1:d=b%2==0;break;case 2:d=c%3==0;break;case 3:d=(c+b)%3==0;break;case 4:d=(Math.floor(c/3)+Math.floor(b/2))%2==0;break;case 5:d=c*b%2+c*b%3==0;break;case 6:d=(c*b%2+c*b%3)%2==0;break;case 7:d=((c+b)%2+c*b%3)%2==0;break;default:throw Error("Unreachable")}!this.types[b][c]&&d&&(this.modules[b][c]=!this.modules[b][c])}}getPenaltyScore(){let a=0;for(let b=0;b<this.size;b++){let c=!1,d=0,e=[0,0,0,0,0,0,0];for(let f=0;f<this.size;f++)this.modules[b][f]===c?5==++d?a+=3:d>5&&a++:(this.finderPenaltyAddHistory(d,e),c||(a+=40*this.finderPenaltyCountPatterns(e)),c=this.modules[b][f],d=1);a+=40*this.finderPenaltyTerminateAndCount(c,d,e)}for(let b=0;b<this.size;b++){let c=!1,d=0,e=[0,0,0,0,0,0,0];for(let f=0;f<this.size;f++)this.modules[f][b]===c?5==++d?a+=3:d>5&&a++:(this.finderPenaltyAddHistory(d,e),c||(a+=40*this.finderPenaltyCountPatterns(e)),c=this.modules[f][b],d=1);a+=40*this.finderPenaltyTerminateAndCount(c,d,e)}for(let b=0;b<this.size-1;b++)for(let c=0;c<this.size-1;c++){let d=this.modules[b][c];d===this.modules[b][c+1]&&d===this.modules[b+1][c]&&d===this.modules[b+1][c+1]&&(a+=3)}let b=0;for(let a of this.modules)b=a.reduce((a,b)=>a+ +!!b,b);let c=this.size*this.size;return a+(Math.ceil(Math.abs(20*b-10*c)/c)-1)*10}getAlignmentPatternPositions(){if(1===this.version)return[];{let a=Math.floor(this.version/7)+2,b=32===this.version?26:2*Math.ceil((4*this.version+4)/(2*a-2)),c=[6];for(let d=this.size-7;c.length<a;d-=b)c.splice(1,0,d);return c}}finderPenaltyCountPatterns(a){let b=a[1],c=b>0&&a[2]===b&&a[3]===3*b&&a[4]===b&&a[5]===b;return(c&&a[0]>=4*b&&a[6]>=b?1:0)+(c&&a[6]>=4*b&&a[0]>=b?1:0)}finderPenaltyTerminateAndCount(a,b,c){return a&&(this.finderPenaltyAddHistory(b,c),b=0),b+=this.size,this.finderPenaltyAddHistory(b,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(a,b){0===b[0]&&(a+=this.size),b.pop(),b.unshift(a)}}function X(a,b,c){if(b<0||b>31||a>>>b!=0)throw RangeError("Value out of range");for(let d=b-1;d>=0;d--)c.push(a>>>d&1)}function Y(a,b){return(a>>>b&1)!=0}class Z{constructor(a,b,c){if(this.mode=a,this.numChars=b,this.bitData=c,b<0)throw RangeError("Invalid argument");this.bitData=c.slice()}getData(){return this.bitData.slice()}}let $=[1,10,12,14],_=[2,9,11,13],aa=[4,8,16,16];function ab(a,b){return a[Math.floor((b+7)/17)+1]}function ac(a){let b=[];for(let c of a)X(c,8,b);return new Z(aa,a.length,b)}function ad(a){if(a<1||a>40)throw RangeError("Version number out of range");let b=(16*a+128)*a+64;if(a>=2){let c=Math.floor(a/7)+2;b-=(25*c-10)*c-55,a>=7&&(b-=36)}return b}function ae(a,b){return Math.floor(ad(a)/8)-U[b[0]][a]*V[b[0]][a]}function af(a,b){if(a>>>8!=0||b>>>8!=0)throw RangeError("Byte out of range");let c=0;for(let d=7;d>=0;d--)c=c<<1^(c>>>7)*285^(b>>>d&1)*a;return c}var ag=a.i(986368),ah=a.i(545097),ai=a.i(619477),aj=a.i(313237),ak=a.i(759497),al=a.i(497895);let am=(0,F.createServerReference)("7f1d75227495e696b278e4e6358ad09539799d59ce",F.callServer,void 0,F.findSourceMapURL,"forgetReachAction"),an=(0,F.createServerReference)("7f03ce39fdb630d0325aceae9cf4c80869d5aec0d9",F.callServer,void 0,F.findSourceMapURL,"nameReachAction"),ao=(0,F.createServerReference)("7f85d80dd09c5632f96abe5d974bc838b31b95e6ea",F.callServer,void 0,F.findSourceMapURL,"removeMailboxAction"),ap=(0,F.createServerReference)("7f861c86763d0d4d1ee2ad4edf6c7e932f03380eb2",F.callServer,void 0,F.findSourceMapURL,"saveMailboxAction");var aq=a.i(907602);let ar={telegram:"telegram.org",discord:"discord.com",slack:"slack.com"},as=`display_information:
|
|
2
2
|
name: Thursday
|
|
3
3
|
features:
|
|
4
4
|
app_home:
|
|
@@ -15,6 +15,6 @@ settings:
|
|
|
15
15
|
interactivity:
|
|
16
16
|
is_enabled: true
|
|
17
17
|
socket_mode_enabled: true
|
|
18
|
-
`,av=({href:a,children:b})=>(0,c.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"font-medium text-foreground underline underline-offset-4 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:b}),aw=({children:a})=>(0,c.jsx)("span",{className:"font-medium text-foreground",children:a}),ax={telegram:[{body:(0,c.jsxs)(c.Fragment,{children:["In Telegram, write to ",(0,c.jsx)(aw,{children:"@BotFather"}),", send ",(0,c.jsx)(aw,{children:"/newbot"})," and pick a name. It answers with a ",(0,c.jsx)(aw,{children:"token"}),"."]}),slot:{open:"https://t.me/BotFather",label:"Open @BotFather"}},{body:(0,c.jsx)(c.Fragment,{children:"Paste the token here."}),slot:{key:as.TELEGRAM_TOKEN_KEY,looks:"123456789:AAE…"}},{body:(0,c.jsx)(c.Fragment,{children:"From your phone, write anything to your bot."}),slot:{says:"Point your phone's camera at it to open the chat."}},{body:(0,c.jsxs)(c.Fragment,{children:["A question with a code appears on this computer. Press ",(0,c.jsx)(aw,{children:"Allow"})," if your phone shows the same code."]})}],discord:[{body:(0,c.jsxs)(c.Fragment,{children:["At ",(0,c.jsx)(aw,{children:"discord.com/developers"}),", make a ",(0,c.jsx)(aw,{children:"New Application"}),". So nobody else can add it to a server, set ",(0,c.jsx)(aw,{children:"Install Link"})," to"," ",(0,c.jsx)(aw,{children:"None"})," on its ",(0,c.jsx)(aw,{children:"Installation"})," page and turn off"," ",(0,c.jsx)(aw,{children:"Public Bot"})," on its ",(0,c.jsx)(aw,{children:"Bot"})," page. There, press"," ",(0,c.jsx)(aw,{children:"Reset Token"})," and copy it."]}),slot:{open:"https://discord.com/developers/applications",label:"Open discord.com/developers"}},{body:(0,c.jsx)(c.Fragment,{children:"Paste the token here."}),slot:{key:as.DISCORD_TOKEN_KEY,looks:"MTE…"}},{body:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(aw,{children:"Add the bot to a server of your own"})," — Discord only delivers a message to a bot you share a server with. A private server made for this is fine."]}),slot:{says:"Point your phone's camera at it, or open it here. It asks which server, and adds the bot with no permissions in it.",does:"Add the bot to a server"}},{body:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(aw,{children:"Send the bot a direct message"}),", not in the server: on a phone, tap the bot in the server's member list, then ",(0,c.jsx)(aw,{children:"Message"}),". A question with a code appears here: press ",(0,c.jsx)(aw,{children:"Allow"})," if your phone shows the same code."]})}],slack:[{body:(0,c.jsxs)(c.Fragment,{children:["At ",(0,c.jsx)(av,{href:"https://api.slack.com/apps",children:"api.slack.com/apps"}),","," ",(0,c.jsx)(aw,{children:"Create New App › From a manifest"}),", and paste the manifest."]}),slot:{manifest:!0}},{body:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(aw,{children:"Basic Information › App-Level Tokens"}),": generate one with"," ",(0,c.jsx)(aw,{children:"connections:write"}),". It starts with xapp-."]}),slot:{key:as.SLACK_APP_TOKEN_KEY,looks:"xapp-…"}},{body:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(aw,{children:"Install App"})," to your workspace. The Bot User OAuth Token starts with xoxb-."]}),slot:{key:as.SLACK_BOT_TOKEN_KEY,looks:"xoxb-…"}},{body:(0,c.jsxs)(c.Fragment,{children:["In Slack, open the app under ",(0,c.jsx)(aw,{children:"Apps"})," and write in its"," ",(0,c.jsx)(aw,{children:"Messages"})," tab. A question with a code appears here: press"," ",(0,c.jsx)(aw,{children:"Allow"})," if Slack shows the same code."]})}],email:[{body:(0,c.jsxs)(c.Fragment,{children:["Make a ",(0,c.jsx)(aw,{children:"mailbox of her own"})," — a new account at a mail service that gives app passwords (Outlook no longer does). Turn on"," ",(0,c.jsx)(aw,{children:"two-step sign-in"})," there and create an ",(0,c.jsx)(aw,{children:"app password"})," for Thursday: how on"," ",(0,c.jsx)(av,{href:"https://support.google.com/accounts/answer/185833",children:"Gmail"}),", ",(0,c.jsx)(av,{href:"https://support.apple.com/en-us/102654",children:"iCloud"}),","," ",(0,c.jsx)(av,{href:"https://www.fastmail.help/hc/en-us/articles/360058752854-App-passwords",children:"Fastmail"}),". Your own inbox stays out of it."]})},{body:(0,c.jsx)(c.Fragment,{children:"Her address and the app password."}),slot:{mailbox:!0}},{body:(0,c.jsx)(c.Fragment,{children:"Your own address. Only mail from it reaches her, and only once its mail service vouches it was sent from there."}),slot:{person:!0}},{body:(0,c.jsx)(c.Fragment,{children:"From your address, write anything to hers. She answers in the same thread."}),slot:{write:!0}}]};function ay(){let a=(0,am.useServerRoute)(s.queryKey.config),b=(0,am.useServerRoute)(s.queryKey.reach);(0,ai.useAppEvent)({reach:()=>void(0,am.revalidate)(s.queryKey.reach)});let d=b=>(0,K.isConfigSet)(a.data,b),e=b=>(0,K.isConfigUnreadable)(a.data,b),f=a=>b.data?.channels.find(b=>b.name===a)??null,g=a=>!!f(a)?.allowed,h=as.REACH_CHANNELS.find(a=>f(a)?.refused||as.REACH_KEYS[a].some(e)),i=as.REACH_CHANNELS.find(a=>("email"===a?!!f(a)?.mailbox:as.REACH_KEYS[a].every(d))&&!g(a)),j=!as.REACH_CHANNELS.some(g),[k,l]=(0,r.useState)(h??i??(j?as.REACH_CHANNELS[0]:null));return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)(ak.SettingItems,{children:as.REACH_CHANNELS.map(a=>(0,c.jsx)(az,{name:a,status:f(a),tokensIn:as.REACH_KEYS[a].filter(d).length,isSet:d,isLost:e,open:k===a,onOpen:()=>l(k===a?null:a)},a))}),(0,c.jsx)(ak.SettingNote,{children:"Only the one person you allow can write: direct messages in a chat app, and by email only mail from the address you name. Nobody else is ever written back to. Work started here runs whether or not a tab is open, while Thursday is running on this computer."})]})}function az({name:a,status:b,tokensIn:d,isSet:e,isLost:f,open:g,onOpen:h}){var j,k;let l,m,n,p,q,r=ax[a],s=b?.refused??null,t="email"===a,u=t?[(l=(j={mailbox:!!b?.mailbox,stopped:!!s||f(as.EMAIL_PASSWORD_KEY),named:!!b?.allowed,connected:!!b?.bot}).mailbox&&!j.stopped)?"done":"flat",l?"done":"now",l?j.named?"done":"now":"later",l&&j.named&&j.connected?"flat":"later"]:(k={connected:!!b?.bot,allowed:!!b?.allowed,refused:s},m=r.map(a=>a.slot&&"key"in a.slot?a.slot.key:null),n=a=>!e(a)||a===k.refused,p=m.findIndex(a=>a&&n(a)),q=m.reduce((a,b,c)=>b?c:a,-1),r.map((a,b)=>{let c=m[b];return c?n(c)?b===p?"now":"later":"done":p>=0?b<p?k.refused?"done":"flat":"later":k.allowed||b<q?"done":k.connected?"now":"flat"})),v=!t&&!!b?.bot&&!b?.allowed&&!s;return(0,c.jsxs)("div",{children:[(0,c.jsxs)("button",{type:"button",onClick:h,"aria-expanded":g,className:"flex w-full items-center gap-3 px-4 py-3 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[t?(0,c.jsx)(N.Mail,{className:"size-4 text-muted-foreground"}):(0,c.jsx)(x.SiteIcon,{host:at[a],className:"size-4 rounded-[4px]",fallback:(0,c.jsx)(o.KeyRound,{className:"size-4 text-muted-foreground"})}),(0,c.jsx)("span",{className:"text-sm font-medium",children:as.REACH_LABEL[a]}),(0,c.jsx)("span",{className:"min-w-0 flex-1 truncate",children:t?(0,c.jsx)(aB,{status:b,lost:f(as.EMAIL_PASSWORD_KEY)}):(0,c.jsx)(aA,{status:b,tokensIn:d,tokens:as.REACH_KEYS[a].length,lost:as.REACH_KEYS[a].some(f)})}),(0,c.jsx)(i.ChevronRight,{className:(0,an.cn)("size-4 shrink-0 text-muted-foreground transition-transform",g&&"rotate-90")})]}),g&&(0,c.jsxs)("div",{className:"px-4 pt-1 pb-4",children:[(0,c.jsx)("ol",{className:"space-y-3",children:r.map((a,d)=>(0,c.jsx)(aC,{n:d+1,step:a,state:u[d],set:!!a.slot&&"key"in a.slot&&e(a.slot.key),lost:!!a.slot&&"key"in a.slot&&f(a.slot.key),refused:a.slot&&"key"in a.slot&&a.slot.key===s?b?.problem??"":a.slot&&"key"in a.slot&&f(a.slot.key)?(0,K.lostWords)("The token saved here","Paste it again."):null,link:b?.link??null,waiting:v&&d===r.length-1,status:b,lostPassword:t&&f(as.EMAIL_PASSWORD_KEY)},d))}),b?.allowed&&!t&&(0,c.jsx)(aK,{name:a,who:b.allowed.name,stopped:!!s})]})]})}function aA({status:a,tokensIn:b,tokens:d,lost:e}){let f="text-xs";return e?(0,c.jsx)("span",{className:(0,an.cn)(f,"text-destructive"),children:"Stopped — the saved token can't be unlocked any more"}):b<d?(0,c.jsx)("span",{className:(0,an.cn)(f,"text-muted-foreground"),children:b?`${b} of ${d} tokens in`:"Not set"}):a?.refused?(0,c.jsxs)("span",{className:(0,an.cn)(f,"text-destructive"),children:["Stopped — ",as.REACH_LABEL[a.name]," turned the token away"]}):a?.problem?(0,c.jsx)(aj.ShinyText,{text:`${a.bot?"Reconnecting":"Connecting"} ${a.problem}`,className:(0,an.cn)(f,"align-middle")}):a?.allowed?(0,c.jsxs)("span",{className:(0,an.cn)(f,"text-muted-foreground"),children:["Listening as ",a.bot,". ",a.allowed.name," is let in."]}):a?.bot?(0,c.jsx)(aj.ShinyText,{text:`Listening as ${a.bot} — waiting for your first message`,tone:"waiting",className:(0,an.cn)(f,"align-middle")}):(0,c.jsx)(aj.ShinyText,{text:"Connecting…",className:(0,an.cn)(f,"align-middle")})}function aB({status:a,lost:b}){let d="text-xs";return b?(0,c.jsx)("span",{className:(0,an.cn)(d,"text-destructive"),children:"Stopped — the saved app password can't be unlocked any more"}):a?.mailbox?a.refused?(0,c.jsx)("span",{className:(0,an.cn)(d,"text-destructive"),children:"Stopped — the mail service turned her mailbox's sign-in away"}):a.problem?(0,c.jsx)(aj.ShinyText,{text:`${a.bot?"Reconnecting":"Connecting"} ${a.problem}`,className:(0,an.cn)(d,"align-middle")}):a.bot?a.holding?(0,c.jsx)(aj.ShinyText,{text:`Listening as ${a.bot} — a mail is held: ${a.holding}`,className:(0,an.cn)(d,"align-middle")}):a.allowed?(0,c.jsxs)("span",{className:(0,an.cn)(d,"text-muted-foreground"),children:["Listening as ",a.bot,". ",a.allowed.name," can write."]}):(0,c.jsx)(aj.ShinyText,{text:`Listening as ${a.bot} — name your own address`,tone:"waiting",className:(0,an.cn)(d,"align-middle")}):(0,c.jsx)(aj.ShinyText,{text:"Connecting…",className:(0,an.cn)(d,"align-middle")}):(0,c.jsx)("span",{className:(0,an.cn)(d,"text-muted-foreground"),children:"Not set"})}function aC({n:a,step:b,state:d,set:e,lost:f,refused:g,link:h,waiting:i,status:j,lostPassword:k}){return(0,c.jsxs)("li",{className:"flex gap-3 text-[13px] leading-relaxed",children:[(0,c.jsx)(aD,{n:a,state:d}),(0,c.jsxs)("div",{className:"min-w-0 flex-1 space-y-2.5",children:[(0,c.jsx)("p",{className:(0,an.cn)("done"===d||"later"===d?"text-muted-foreground/60 **:text-inherit":"text-muted-foreground"),children:b.body}),(0,c.jsx)(aE,{slot:b.slot,state:d,set:e,lost:f,refused:g,link:h,waiting:i,status:j,lostPassword:k})]})]})}function aD({n:a,state:b}){return"done"===b?(0,c.jsx)("span",{className:"mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-foreground text-background",children:(0,c.jsx)(h.Check,{className:"size-3"})}):(0,c.jsx)("span",{className:(0,an.cn)("mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-background font-mono text-[10.5px] ring-1","now"===b?(0,an.cn)(an.WAITING_INK,"ring-waiting/40"):"text-muted-foreground ring-border/60","later"===b&&"opacity-60"),children:a})}function aE({slot:a,state:b,set:d,lost:e,refused:f,link:g,waiting:h,status:i,lostPassword:j}){let k=h&&(0,c.jsx)(aj.ShinyText,{text:"Waiting for your first message…",tone:"waiting"});return"later"===b?null:a&&"mailbox"in a?(0,c.jsx)(aM,{mailbox:i?.mailbox??null,refused:i?.refused?i.problem??"":j?(0,K.lostWords)("The app password saved here","Save her mailbox again."):null}):a&&"person"in a?(0,c.jsx)(aO,{who:i?.allowed?.chat??null}):a&&"write"in a?i?.mailbox?(0,c.jsx)(aP,{address:i.mailbox.address}):null:a&&"key"in a?(0,c.jsx)(aI,{configKey:a.key,looks:a.looks,set:d,lost:e,refused:f}):"done"===b?a&&"says"in a&&g?(0,c.jsx)(aH,{href:g,children:a.does??aG(g)}):null:a?"open"in a?(0,c.jsx)(aH,{href:a.open,children:a.label}):"manifest"in a?(0,c.jsx)(aJ,{}):g?(0,c.jsxs)("div",{className:"space-y-2.5",children:[(0,c.jsx)(aF,{link:g,says:a.says,does:a.does}),k]}):k||null:k||null}function aF({link:a,says:b,does:d}){let{size:e,data:f}=function(a){let{ecc:b="L",boostEcc:c=!1,minVersion:d=1,maxVersion:e=40,maskPattern:f=-1,border:g=1}={},h="string"==typeof a?function(a){var b,c;if(""===a)return[];if(b=a,T.test(b))return[function(a){var b;if(b=a,!T.test(b))throw RangeError("String contains non-numeric characters");let c=[];for(let b=0;b<a.length;){let d=Math.min(a.length-b,3);Z(Number.parseInt(a.substring(b,b+d),10),3*d+1,c),b+=d}return new _(aa,a.length,c)}(a)];return(c=a,U.test(c))?[function(a){var b;let c;if(b=a,!U.test(b))throw RangeError("String contains unencodable characters in alphanumeric mode");let d=[];for(c=0;c+2<=a.length;c+=2){let b=45*V.indexOf(a.charAt(c));Z(b+=V.indexOf(a.charAt(c+1)),11,d)}return c<a.length&&Z(V.indexOf(a.charAt(c)),6,d),new _(ab,a.length,d)}(a)]:[ae(function(a){a=encodeURI(a);let b=[];for(let c=0;c<a.length;c++)"%"!==a.charAt(c)?b.push(a.charCodeAt(c)):(b.push(Number.parseInt(a.substring(c+1,c+3),16)),c+=2);return b}(a))]}(a):Array.isArray(a)?[ae(a)]:void 0;if(!h)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof a}`);let i=function(a,b,c=1,d=40,e=-1,f=!0){let g,h;if(!(1<=c&&c<=d&&d<=40)||e<-1||e>7)throw RangeError("Invalid value");for(g=c;;g++){let c=8*ag(g,b),e=function(a,b){let c=0;for(let d of a){let a=ad(d.mode,b);if(d.numChars>=1<<a)return 1/0;c+=4+a+d.bitData.length}return c}(a,g);if(e<=c){h=e;break}if(g>=d)throw RangeError("Data too long")}for(let a of[P,Q,R])f&&h<=8*ag(g,a)&&(b=a);let i=[];for(let b of a)for(let a of(Z(b.mode[0],4,i),Z(b.numChars,ad(b.mode,g),i),b.getData()))i.push(a);let j=8*ag(g,b);Z(0,Math.min(4,j-i.length),i),Z(0,(8-i.length%8)%8,i);for(let a=236;i.length<j;a^=253)Z(a,8,i);let k=Array.from({length:Math.ceil(i.length/8)},()=>0);return i.forEach((a,b)=>k[b>>>3]|=a<<7-(7&b)),new Y(g,b,k,e)}(h,S[b],d,e,f,c);return function(a,b=1){if(!b)return a;let{size:c}=a,d=c+2*b;a.size=d,a.data.forEach(a=>{for(let c=0;c<b;c++)a.unshift(!1),a.push(!1)});for(let c=0;c<b;c++)a.data.unshift(Array.from({length:d},a=>!1)),a.data.push(Array.from({length:d},a=>!1));let e=O.Border;a.types.forEach(a=>{for(let c=0;c<b;c++)a.unshift(e),a.push(e)});for(let c=0;c<b;c++)a.types.unshift(Array.from({length:d},a=>e)),a.types.push(Array.from({length:d},a=>e));return a}({version:i.version,maskPattern:i.mask,size:i.size,data:i.modules,types:i.types},g)}(a),g=aG(a);return(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,c.jsx)("div",{className:"rounded-lg bg-white p-2.5",children:(0,c.jsx)("svg",{viewBox:`0 0 ${e} ${e}`,className:"block size-31 text-black",role:"img","aria-label":`A picture of ${g} for a phone camera`,children:f.flatMap((a,b)=>a.map((a,d)=>a?(0,c.jsx)("rect",{x:d,y:b,width:1,height:1,fill:"currentColor"},`${d}-${b}`):null))})}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("p",{className:"text-muted-foreground",children:b}),(0,c.jsx)(aH,{href:a,children:d??g})]})]})}let aG=a=>a.replace(/^https:\/\//,"");function aH({href:a,children:b}){return(0,c.jsxs)("a",{href:a,target:"_blank",rel:"noreferrer",className:(0,an.cn)((0,t.buttonVariants)({variant:"outline",size:"sm"})),children:[(0,c.jsx)(M.ExternalLink,{}),b]})}function aI({configKey:a,looks:b,set:d,lost:e,refused:f}){let[g,h]=(0,r.useState)(""),[i,j]=(0,r.useState)(!1),{data:k}=(0,am.useServerRoute)(s.queryKey.config),l=(0,K.isConfigFromEnv)(k,a),m=()=>{h(""),j(!1),(0,am.revalidate)(s.queryKey.config),(0,am.revalidate)(s.queryKey.reach)},[n,o]=(0,al.useServerAction)(J.setConfigAction,{onOk:m}),[p,q]=(0,al.useServerAction)(I,{onOk:m}),w=async()=>{await v.notify.confirm({title:"Remove this token?",description:"That service stops, and whoever is let in is let go.",okText:"Remove",destructive:!0})&&p(a)};return l?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{className:"max-w-xl text-muted-foreground",children:(0,K.envWords)(K.CONFIG_ENTRIES[a]?.label??a)}),f&&(0,c.jsx)("p",{className:"max-w-xl text-destructive",children:f})]}):d&&!i&&null===f?(0,c.jsx)(t.Button,{size:"xs",variant:"ghost",onClick:()=>j(!0),className:"-ml-2 text-muted-foreground",children:"Change the token"}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("form",{className:"flex flex-wrap items-center gap-2",onSubmit:b=>{b.preventDefault(),n(a,g)},children:[(0,c.jsx)(u.Input,{value:g,onChange:a=>h(a.target.value),placeholder:b,"aria-label":"Token",type:"password",autoComplete:"off",spellCheck:!1,className:"w-72 font-mono"}),(0,c.jsx)(t.Button,{type:"submit",size:"sm",loading:o,disabled:g.trim().length<z.KEY_MIN,children:d?"Replace":"Save"}),(d||e)&&(0,c.jsxs)(c.Fragment,{children:[null===f&&(0,c.jsx)(t.Button,{size:"sm",variant:"ghost",onClick:()=>j(!1),children:"Cancel"}),(0,c.jsx)(t.Button,{size:"sm",variant:"ghost",loading:q,onClick:()=>void w(),className:"ml-auto text-destructive hover:text-destructive",children:"Remove"})]})]}),f&&(0,c.jsx)("p",{className:"max-w-xl text-destructive",children:f})]})}function aJ(){let[a,b]=(0,r.useState)(!1);return(0,c.jsxs)(t.Button,{size:"sm",variant:"outline",onClick:()=>void navigator.clipboard.writeText(au).then(()=>{b(!0),setTimeout(()=>b(!1),2e3)}),children:[a?(0,c.jsx)(h.Check,{}):(0,c.jsx)(L.Copy,{}),a?"Copied":"Copy the manifest"]})}function aK({name:a,who:b,stopped:d}){let[e,f]=(0,al.useServerAction)(ao,{onOk:()=>(0,am.revalidate)(s.queryKey.reach)});return(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pt-3 pl-8 text-[13px] text-muted-foreground",children:[(0,c.jsx)("span",{children:d?`${b} is let in.`:`${b} can write from a phone.`}),(0,c.jsx)(t.Button,{size:"sm",variant:"outline",loading:f,onClick:async()=>{await v.notify.confirm({title:`Let ${b} go?`,description:"Nobody can write to Thursday through this service until someone is let in again.",okText:"Let them go",destructive:!0})&&e(a)},children:"Let them go"})]})}let aL=(a,b)=>{let c=a?.lastIndexOf(":")??-1;return c>0&&a?{host:a.slice(0,c),port:a.slice(c+1)}:{host:"",port:String(b)}};function aM({mailbox:a,refused:b}){let[d,e]=(0,r.useState)(!1),[f,g]=(0,r.useState)(a?.address??""),[h,i]=(0,r.useState)(""),[j,k]=(0,r.useState)(!1),[l,m]=(0,r.useState)(()=>aL(void 0,993)),[n,o]=(0,r.useState)(()=>aL(void 0,465)),{data:p}=(0,am.useServerRoute)(s.queryKey.config),q=()=>{i(""),e(!1),k(!1),(0,am.revalidate)(s.queryKey.config),(0,am.revalidate)(s.queryKey.reach)},[w,x]=(0,al.useServerAction)(ar,{onOk:a=>{if(a?.found)return q();k(!0)}}),[y,z]=(0,al.useServerAction)(aq,{onOk:q}),A=async()=>{await v.notify.confirm({title:"Remove her mailbox?",description:"Email stops, and the address that could write is let go. The mailbox itself is not touched.",okText:"Remove",destructive:!0})&&y()};if((0,K.isConfigFromEnv)(p,as.EMAIL_PASSWORD_KEY))return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{className:"max-w-xl text-muted-foreground",children:(0,K.envWords)("Her mailbox's app password")}),b&&(0,c.jsx)("p",{className:"max-w-xl text-destructive",children:b})]});if(a&&!d&&null===b)return(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[a.address," · ",a.imap," · ",a.smtp]}),(0,c.jsx)(t.Button,{size:"xs",variant:"ghost",onClick:()=>{g(a.address),e(!0)},className:"-ml-2 text-muted-foreground",children:"Change"})]});let B=f.includes("@")?f.slice(f.lastIndexOf("@")+1):"Its domain",C="grid gap-1 font-mono text-[11px] text-muted-foreground";return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("form",{className:"space-y-2.5",onSubmit:b=>{b.preventDefault();let c=!j&&a?.address.toLowerCase()===f.trim().toLowerCase();w({address:f.trim(),password:h,...j?{imap:`${l.host.trim()}:${l.port.trim()}`,smtp:`${n.host.trim()}:${n.port.trim()}`}:c?{imap:a.imap,smtp:a.smtp}:{}})},children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,c.jsxs)("label",{className:C,children:["Address",(0,c.jsx)(u.Input,{value:f,onChange:a=>{g(a.target.value),k(!1)},placeholder:"thursday@example.com",type:"email",autoComplete:"off",spellCheck:!1,className:"w-64 font-sans"})]}),(0,c.jsxs)("label",{className:C,children:["App password",(0,c.jsx)(u.Input,{value:h,onChange:a=>i(a.target.value),placeholder:"paste it here",type:"password",autoComplete:"off",spellCheck:!1,className:"w-52 placeholder:font-sans"})]})]}),j&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("p",{className:"max-w-xl text-muted-foreground",children:[B," doesn't say where its mail servers are. Its help pages name them — one for reading mail (IMAP) and one for sending it (SMTP)."]}),(0,c.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,c.jsx)(aN,{label:"Reading server",looks:`imap.${B}`,value:l,onChange:m}),(0,c.jsx)(aN,{label:"Sending server",looks:`smtp.${B}`,value:n,onChange:o})]})]}),(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,c.jsx)(t.Button,{type:"submit",size:"sm",loading:x,disabled:!f.includes("@")||h.trim().length<8||j&&!(l.host.trim()&&n.host.trim()),children:a?"Replace":"Save"}),a&&(0,c.jsxs)(c.Fragment,{children:[null===b&&(0,c.jsx)(t.Button,{size:"sm",variant:"ghost",onClick:()=>e(!1),children:"Cancel"}),(0,c.jsx)(t.Button,{size:"sm",variant:"ghost",loading:z,onClick:()=>void A(),className:"ml-auto text-destructive hover:text-destructive",children:"Remove"})]})]})]}),b&&(0,c.jsx)("p",{className:"max-w-xl text-destructive",children:b})]})}function aN({label:a,looks:b,value:d,onChange:e}){let f="grid gap-1 font-mono text-[11px] text-muted-foreground";return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("label",{className:f,children:[a,(0,c.jsx)(u.Input,{value:d.host,onChange:a=>e({...d,host:a.target.value}),placeholder:b,autoComplete:"off",spellCheck:!1,className:"w-52 font-mono"})]}),(0,c.jsxs)("label",{className:f,children:["Port",(0,c.jsx)(u.Input,{value:d.port,onChange:a=>e({...d,port:a.target.value}),inputMode:"numeric",autoComplete:"off",className:"w-18 font-mono"})]})]})}function aO({who:a}){let[b,d]=(0,r.useState)(!1),[e,f]=(0,r.useState)(""),g=()=>{f(""),d(!1),(0,am.revalidate)(s.queryKey.reach)},[h,i]=(0,al.useServerAction)(ap,{onOk:g}),[j,k]=(0,al.useServerAction)(ao,{onOk:g});return a&&!b?(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground",children:a}),(0,c.jsx)(t.Button,{size:"xs",variant:"ghost",onClick:()=>d(!0),className:"-ml-2 text-muted-foreground",children:"Change"})]}):(0,c.jsxs)("form",{className:"flex flex-wrap items-center gap-2",onSubmit:a=>{a.preventDefault(),h("email",e.trim())},children:[(0,c.jsx)(u.Input,{value:e,onChange:a=>f(a.target.value),placeholder:"you@example.org","aria-label":"Your own address",type:"email",autoComplete:"email",spellCheck:!1,className:"w-64"}),(0,c.jsx)(t.Button,{type:"submit",size:"sm",loading:i,disabled:!e.includes("@"),children:a?"Replace":"Save"}),a&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t.Button,{size:"sm",variant:"ghost",onClick:()=>d(!1),children:"Cancel"}),(0,c.jsx)(t.Button,{size:"sm",variant:"ghost",loading:k,onClick:async()=>{await v.notify.confirm({title:`Stop reading mail from ${a}?`,description:"Nobody can write to Thursday by email until an address is named again.",okText:"Stop",destructive:!0})&&j("email")},className:"ml-auto text-destructive hover:text-destructive",children:"Remove"})]})]})}function aP({address:a}){let[b,d]=(0,r.useState)(!1);return(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,c.jsxs)(aH,{href:`mailto:${a}`,children:["Write to ",a]}),(0,c.jsxs)(t.Button,{size:"sm",variant:"outline",onClick:()=>void navigator.clipboard.writeText(a).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)}),children:[b?(0,c.jsx)(h.Check,{}):(0,c.jsx)(L.Copy,{}),b?"Copied":"Copy her address"]})]})}let aQ={[K.EXA_API_KEY]:p.Search},aR={image:n.Image,video:l,speech:f.AudioLines,transcription:g.Captions},aS={keys:["voice","easy","text","search"],models:["bots","studio"]};function aT({screen:a}){let{data:b,isLoading:d,error:e}=(0,am.useServerRoute)(s.queryKey.config),f=(0,G.useVoiceLine)();if(d)return(0,c.jsx)(ak.SettingSkeleton,{rows:4});if(e)return(0,c.jsx)(ak.SettingError,{message:e.message});let g=a=>(0,K.isConfigSet)(b,a),h=a=>(0,K.isConfigUnreadable)(b,a),i=a=>(0,K.isConfigFromEnv)(b,a),j=a=>(0,K.groupSatisfied)(a,a.id===K.VOICE_GROUP_ID?f.countsForCall:g),k=a=>b?.find(b=>b.key===a)?.value,l=aS[a].flatMap(a=>K.CONFIG_GROUPS.find(b=>b.id===a)??[]),m=l.filter(a=>"keys"===a.section).flatMap(a=>a.entries),n=m.filter(a=>h(a.key)).length;return(0,c.jsx)(ak.SettingScreen,{footer:(0,c.jsx)(ak.SettingRailNote,{children:"models"===a?"Her own voice and backend models are in Thursday. A bot can pick its own on its page.":`${m.filter(a=>g(a.key)).length} of ${m.length} set${n?` \xb7 ${n} to enter again`:""}${l.some(a=>!j(a))?" · a call needs the GPT Subscription or an OpenAI key":" · your keys stay on this machine"}`}),children:l.map(a=>(0,c.jsx)(ak.SettingGroup,{label:a.title,hint:a.hint,right:(0,c.jsx)(aV,{group:a,met:j(a)}),children:"easy"===a.id?(0,c.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:a.entries.map(a=>(0,c.jsx)(aW,{card:!0,entry:a,set:g(a.key),lost:h(a.key),env:i(a.key)},a.key))}):"text"===a.id?(0,c.jsx)("div",{className:"flex flex-wrap gap-x-1.5 gap-y-3.5",children:a.entries.map(a=>(0,c.jsx)(aU,{entry:a,set:g(a.key),lost:h(a.key),env:i(a.key)},a.key))}):(0,c.jsx)(ak.SettingItems,{children:a.entries.map(b=>b.effortOf?null:b.choices?(0,c.jsx)(a5,{entry:b,choices:b.choices,value:k(b.key),effort:a6(a,b.key),effortValue:k(K.DEFAULT_EFFORT_KEY)},b.key):(0,c.jsx)(aW,{entry:b,set:g(b.key),lost:h(b.key),env:i(b.key)},b.key))})},a.id))})}function aU({entry:a,set:b,lost:d,env:e}){return(0,c.jsxs)("button",{type:"button",onClick:()=>a8(a,b),"aria-label":`${a.label}: ${e?"set in env":b?"set":d?"enter it again":"not set"}`,className:"group flex w-17 flex-col items-center gap-1.5 rounded-xl py-1 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,c.jsxs)("span",{className:"relative grid size-10.5 place-items-center rounded-[13px] bg-muted/60 transition-colors group-hover:bg-muted",children:[(0,c.jsx)(a4,{entry:a}),b?(0,c.jsx)("span",{className:"absolute -top-1 -right-1 grid size-4 place-items-center rounded-full bg-primary text-primary-foreground ring-2 ring-background",children:(0,c.jsx)(h.Check,{className:"size-2.5"})}):d&&(0,c.jsx)("span",{className:"absolute -top-1 -right-1 grid size-4 place-items-center rounded-full bg-waiting text-background ring-2 ring-background",children:(0,c.jsx)(q.TriangleAlert,{className:"size-2.5"})})]}),(0,c.jsx)("span",{className:(0,an.cn)("max-w-full truncate text-[11px]",b?"text-foreground":"text-muted-foreground"),children:a.label}),e&&(0,c.jsx)("span",{className:"-mt-1.5 font-mono text-[10px] text-muted-foreground",children:"env"})]})}function aV({group:a,met:b}){return"none"===a.require?null:b?(0,c.jsxs)("span",{className:"flex items-center gap-1 font-mono text-[11px] text-muted-foreground",children:[(0,c.jsx)(h.Check,{className:"size-3"}),"ready"]}):(0,c.jsxs)("span",{className:(0,an.cn)("flex items-center gap-1 font-mono text-[11px]",an.WAITING_INK),children:[(0,c.jsx)(q.TriangleAlert,{className:"size-3"}),a.note??"Required"]})}function aW({entry:a,set:b,lost:d,env:e,card:f=!1,narrow:g=!1}){let j=aZ(a,b),k=a_(a,b),l=a$(a,b),m=k.data?a0(k.data):aY(b,j.data,a.signIn,d,e),n=j.isLoading||k.isLoading,o=(0,c.jsxs)("span",{className:(0,an.cn)("flex shrink-0 items-center gap-1.5 font-mono text-xs",m.ink),children:[m.warn?(0,c.jsx)(q.TriangleAlert,{className:"size-3"}):b&&(0,c.jsx)(h.Check,{className:"size-3"}),m.text]});return(0,c.jsxs)("button",{type:"button",onClick:()=>{var d;return a.signIn?(d=a,v.notify.component({className:"sm:max-w-md",renderer:({close:a})=>(0,c.jsx)(a7,{entry:d,onDone:a})})):a8(a,b)},className:(0,an.cn)("group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",f&&"rounded-xl border border-border/60"),children:[(0,c.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,c.jsx)(a4,{entry:a})}),(0,c.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,c.jsxs)("span",{className:"flex items-center gap-2 truncate text-sm font-medium",children:[a.label,a.signIn&&b&&(0,c.jsx)(a2,{usage:k.data,plan:l})]}),g?n?(0,c.jsx)(y.Skeleton,{className:"h-3 w-20"}):o:(0,c.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:a.signIn?b?a1(k.data)??"signed in":"sign in with your account":a.key}),a.signIn&&b&&k.data&&(0,c.jsx)(a3,{usage:k.data})]}),g?null:n?(0,c.jsx)(y.Skeleton,{className:"h-3 w-20 shrink-0"}):o,(0,c.jsx)(i.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}let aX=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});function aY(a,b,c,d=!1,e=!1){var f,g,h;let i=function(a,b,c,d=!1){return!a&&d?{text:c?"Sign in again":"Enter again",ink:an.WAITING_INK,warn:!0}:a?b?"refused"in b?{text:"Key refused",ink:"text-destructive",warn:!0}:{text:`${aX.format(b.balance)} left`,ink:b.low?an.WAITING_INK:"text-muted-foreground",warn:b.low}:{text:c?"Signed in":"Set",ink:"text-muted-foreground",warn:!1}:{text:c?"Signed out":"Not set",ink:"text-muted-foreground/60",warn:!1}}(a,b,c,d);return a?(f=i,g=e,h=!!b,g?h?{...f,text:`${f.text} \xb7 env`}:{...f,text:"Set in env"}:f):i}function aZ(a,b){return(0,am.useServerRoute)(b&&(0,E.isCatalogProvider)(a.provider)?s.queryKey.keyCredits(a.provider):null)}function a$(a,b){let{data:c}=(0,am.useServerRoute)(b&&a.signIn?s.queryKey.llmModel:null);return c?.find(b=>b.id===a.provider)?.plan??null}function a_(a,b){return(0,am.useServerRoute)(b&&a.signIn?s.queryKey.subscriptionUsage:null)}function a0(a){return"refused"in a?{text:"Sign-in refused",ink:"text-destructive",warn:!0}:{text:a.spent?"Limit reached":`${a.usedPercent}% used`,ink:a.high?an.WAITING_INK:"text-muted-foreground",warn:a.high}}function a1(a){let b=!a||"refused"in a?null:a;return b?.resetsAt?`resets in ${(0,d.formatDistanceToNowStrict)(new Date(b.resetsAt))}`:null}function a2({usage:a,plan:b}){let d=(0,E.planName)((!a||"refused"in a?null:a.plan)??b);return d?(0,c.jsx)("span",{className:"rounded-full px-1.5 font-mono text-[9.5px] leading-4 font-normal text-foreground ring-1 ring-border ring-inset",children:d}):null}function a3({usage:a}){return"refused"in a?null:(0,c.jsx)("span",{role:"meter","aria-label":"Plan used","aria-valuenow":a.usedPercent,"aria-valuemin":0,"aria-valuemax":100,className:"mt-1.5 block h-1 w-full max-w-48 overflow-hidden rounded-full bg-muted",children:(0,c.jsx)("span",{className:(0,an.cn)("block h-full rounded-full transition-[width] duration-500",a.high?"bg-waiting":"bg-foreground/45"),style:{width:`${Math.min(100,Math.max(2,a.usedPercent))}%`}})})}function a4({entry:a}){if(a.provider)return(0,c.jsx)(D.ProviderIcon,{provider:a.provider,className:"size-4"});let b=aQ[a.key]??o.KeyRound,d=(0,c.jsx)(b,{className:"size-4 text-muted-foreground"});return a.site?(0,c.jsx)(x.SiteIcon,{host:a.site,className:"size-4 rounded-[4px]",fallback:d}):d}function a5({entry:a,choices:b,value:d,effort:e,effortValue:f}){let g=a.text?(0,E.parseTextModel)(d):(0,E.parseMediaModel)(d),{data:h}=(0,am.useServerRoute)(a.text&&!d&&s.queryKey.automaticModel),{data:i}=(0,am.useServerRoute)(a.kind&&!d&&s.queryKey.llmModel),j=i?.find(a=>a.signIn),k=a.kind&&!d?(0,E.planMediaOf)(a.kind,j?.hasKey?{plan:j.plan??null}:null):null,l=a.kind?aR[a.kind]:F.BotsMark,[m]=(0,al.useServerAction)(J.setConfigAction,{onOk:()=>{(0,am.revalidate)(s.queryKey.config),(0,am.revalidate)(s.queryKey.automaticModel)}}),[n]=(0,al.useServerAction)(I,{onOk:()=>{(0,am.revalidate)(s.queryKey.config),(0,am.revalidate)(s.queryKey.automaticModel)}});return(0,c.jsxs)("div",{className:"flex w-full items-start gap-3 p-4",children:[(0,c.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,c.jsx)(l,{className:"size-4 text-muted-foreground"})}),(0,c.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,c.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 pt-1.5",children:[(0,c.jsx)("span",{className:"truncate text-sm font-medium",children:a.label}),!d&&(0,c.jsx)("span",{className:(0,an.cn)("shrink-0 rounded-[5px] border border-border/60 px-1 font-mono text-[10px]",a.kind&&!k?an.WAITING_INK:"text-muted-foreground"),children:a.kind&&!k?"off":"auto"})]}),(0,c.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,c.jsx)("div",{className:"min-w-0",children:(0,c.jsx)(C.ModelPicker,{kind:a.kind,provider:g?.provider??null,model:g?.model??"",unset:a.kind?k?`Automatic \xb7 ${b.find(a=>a.value===`${k.provider}/${k.model}`)?.label??k.model}`:"Not offered to bots until you pick one":function(a,b){if(!a)return"Automatic";if(!a.ref)return a.problem;let{provider:c,model:d}=a.ref,e=b.find(a=>a.value===`${c}/${d}`);return`Automatic \xb7 ${e?.label??d}`}(h,b),onChange:b=>m(a.key,`${b.provider}/${b.model.trim()}`),onUnset:d?()=>{n(a.key),e&&f&&n(e.key)}:void 0})}),e&&g&&(0,c.jsxs)("div",{className:"flex items-start gap-3 pt-0.5",children:[(0,c.jsx)("span",{className:"w-12 shrink-0 pt-1.5 font-mono text-[11px] text-muted-foreground",children:"effort"}),(0,c.jsx)(B.EffortSwitch,{provider:g.provider,model:g.model,value:E.effortSchema.safeParse(f).data??null,onChange:a=>a?m(e.key,a):n(e.key)})]})]})]})]})}let a6=(a,b)=>a.entries.find(a=>a.effortOf===b);function a7({entry:a,onDone:b}){let{data:d}=(0,am.useServerRoute)(s.queryKey.config),e=(0,K.isConfigSet)(d,a.key),f=(0,K.isConfigUnreadable)(d,a.key),g=(0,K.isConfigFromEnv)(d,a.key),h=a$(a,e),i=a_(a,e),j=i.data?a0(i.data):null,[k,l]=(0,al.useServerAction)(I,{okMessage:`Signed out of ${a.label}`,onOk:()=>{(0,am.revalidate)(s.queryKey.config),(0,am.revalidate)(s.queryKey.llmModel),b()}});return(0,c.jsx)(ak.SettingDialogContent,{title:a.label,description:e?(0,c.jsxs)(c.Fragment,{children:["Signed in ",(0,c.jsx)(a2,{usage:i.data,plan:h}),a1(i.data)&&(0,c.jsxs)(c.Fragment,{children:[" · ",(0,c.jsx)("span",{className:"font-mono",children:a1(i.data)})]}),j&&(0,c.jsxs)(c.Fragment,{children:[" · ",(0,c.jsx)("span",{className:(0,an.cn)("font-mono",j.ink),children:j.text})]})]}):"Sign in with your ChatGPT account instead of a key",footer:(0,c.jsxs)(c.Fragment,{children:[(e||f)&&!g&&(0,c.jsx)(t.Button,{variant:"ghost",loading:l,onClick:async()=>{await v.notify.confirm({title:`Sign out of ${a.label}?`,description:"Nothing runs on your plan until you sign in again.",okText:"Sign out",destructive:!0})&&k(a.key)},children:"Sign out"}),(0,c.jsx)(t.Button,{variant:"ghost",onClick:b,children:e?"Close":"Cancel"}),!e&&(0,c.jsx)(A.ChatGptSignIn,{})]}),children:(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)(ak.SettingNote,{children:e?"Bots on this subscription spend your plan's usage, not a key. When it runs out, the job stops and says when it resets.":"The sign-in opens in its own window. Approve it there, and this turns to signed in by itself."}),i.data&&"refused"in i.data&&(0,c.jsx)(ak.SettingNote,{className:"wrap-break-word text-destructive",children:i.data.refused}),f&&(0,c.jsx)(ak.SettingNote,{className:(0,an.cn)("wrap-break-word",an.WAITING_INK),children:(0,K.lostWords)("The sign-in saved here","Sign in again.")}),g&&(0,c.jsx)(ak.SettingNote,{className:"wrap-break-word",children:(0,K.envWords)(a.label)})]})})}function a8(a,b){return v.notify.component({className:"sm:max-w-md",renderer:({close:d})=>(0,c.jsx)(a9,{entry:a,set:b,onDone:d})})}function a9({entry:a,set:b,onDone:d}){let[f,g]=(0,r.useState)(""),{data:h}=(0,am.useServerRoute)(s.queryKey.config),i=h?(0,K.isConfigSet)(h,a.key):b,j=(0,K.isConfigUnreadable)(h,a.key),k=(0,K.isConfigFromEnv)(h,a.key),{data:l}=aZ(a,i),m=l?aY(i,l):null,n=()=>{(0,am.revalidate)(s.queryKey.config),(0,am.revalidate)(s.queryKey.llmModel)},[o,p]=(0,al.useServerAction)(J.setConfigAction,{okMessage:`${a.label} key saved`,onOk:()=>{n(),d()}}),[q,w]=(0,al.useServerAction)(I,{okMessage:`${a.label} key removed`,onOk:()=>{n(),d()}}),x=async()=>{await v.notify.confirm({title:`Remove the ${a.label} key?`,description:"It is deleted from this computer, and nothing runs on it until a key is pasted again.",okText:"Remove",destructive:!0})&&q(a.key)};return(0,c.jsx)(ak.SettingDialogContent,{title:a.label,description:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"font-mono",children:a.key}),k?(0,c.jsx)(c.Fragment,{children:" · set in env"}):a.hint&&(0,c.jsxs)(c.Fragment,{children:[" · ",a.hint]}),m&&(0,c.jsxs)(c.Fragment,{children:[" · ",(0,c.jsx)("span",{className:(0,an.cn)("font-mono",m.ink),children:m.text})]})]}),footer:k?(0,c.jsx)(t.Button,{onClick:d,children:"Close"}):(0,c.jsxs)(c.Fragment,{children:[(i||j)&&(0,c.jsx)(t.Button,{variant:"ghost",loading:w,onClick:()=>void x(),className:"mr-auto text-destructive hover:text-destructive",children:"Remove"}),(0,c.jsx)(t.Button,{variant:"ghost",onClick:d,children:"Cancel"}),(0,c.jsx)(t.Button,{loading:p,disabled:f.trim().length<z.KEY_MIN,onClick:()=>o(a.key,f),children:i?"Replace":"Save"})]}),children:(0,c.jsxs)("div",{className:"space-y-2",children:[k?(0,c.jsx)(ak.SettingNote,{className:"wrap-break-word",children:(0,K.envWords)(a.label)}):(0,c.jsx)(u.Input,{value:f,onChange:a=>g(a.target.value),onKeyDown:b=>{"Enter"===b.key&&f.trim().length>=z.KEY_MIN&&o(a.key,f)},placeholder:i?"New value — replaces the current key":j?"Paste the key again":a.keyLooks??"Paste the key",spellCheck:!1,type:"password",autoFocus:!0}),!i&&a.keysAt&&(0,c.jsxs)("a",{href:a.keysAt,target:"_blank",rel:"noreferrer",className:"flex w-fit items-center gap-1 px-0.5 text-[13px] text-foreground underline underline-offset-3 hover:text-foreground/80",children:["Get a key at ",new URL(a.keysAt).host,(0,c.jsx)(e.ArrowUpRight,{className:"size-3.5"})]}),l&&"refused"in l&&(0,c.jsx)(ak.SettingNote,{className:"wrap-break-word text-destructive",children:l.refused}),j&&(0,c.jsx)(ak.SettingNote,{className:(0,an.cn)("wrap-break-word",an.WAITING_INK),children:(0,K.lostWords)("The key saved here","Paste it again.")})]})})}a.s(["AccountsSetup",0,function({withoutVoice:a=!1}){let{data:b}=(0,am.useServerRoute)(s.queryKey.config),d=a=>(0,K.isConfigSet)(b,a),e=a=>(0,K.isConfigUnreadable)(b,a),f=a=>(0,K.isConfigFromEnv)(b,a),g=a=>K.CONFIG_GROUPS.find(b=>b.id===a)?.entries??[],[h,i]=(0,r.useState)(!1),j=g("voice"),k=[...j,...g("text")],l=k.filter((b,c)=>(c<4||d(b.key))&&!(a&&j.includes(b))),n=k.filter(b=>!l.includes(b)&&!(a&&j.includes(b)));return(0,c.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,c.jsx)("div",{className:"flex flex-col gap-2",children:g("easy").map(a=>(0,c.jsx)(aW,{card:!0,narrow:!0,entry:a,set:d(a.key),lost:e(a.key),env:f(a.key)},a.key))}),(0,c.jsxs)("div",{className:"flex flex-wrap gap-y-2.5",children:[l.map(a=>(0,c.jsx)(aU,{entry:a,set:d(a.key),lost:e(a.key),env:f(a.key)},a.key)),n.length>0&&(0,c.jsxs)(w.Popover,{open:h,onOpenChange:i,children:[(0,c.jsxs)(w.PopoverTrigger,{"aria-label":`${n.length} more providers`,className:"group flex w-17 flex-col items-center gap-1.5 rounded-xl py-1 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,c.jsx)("span",{className:"grid size-10.5 place-items-center rounded-[13px] bg-muted/60 text-muted-foreground transition-colors group-hover:bg-muted",children:(0,c.jsx)(m.default,{className:"size-4"})}),(0,c.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"More"})]}),(0,c.jsx)(w.PopoverContent,{align:"end",className:"w-78 flex-row flex-wrap gap-0 gap-y-2.5 rounded-2xl p-2.5",onClick:()=>i(!1),children:n.map(a=>(0,c.jsx)(aU,{entry:a,set:d(a.key),lost:e(a.key),env:f(a.key)},a.key))})]})]}),(0,c.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,c.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground/70",children:"Web search, if you want it: without a key, a bot searches only when its own model can."}),g("search").map(a=>(0,c.jsx)(aW,{card:!0,narrow:!0,entry:a,set:d(a.key),lost:e(a.key),env:f(a.key)},a.key))]})]})},"KeysSetting",0,()=>(0,c.jsx)(aT,{screen:"keys"}),"ModelsSetting",0,()=>(0,c.jsx)(aT,{screen:"models"}),"PhoneSetting",0,()=>(0,c.jsx)(ak.SettingScreen,{footer:(0,c.jsx)(ak.SettingRailNote,{children:"Nothing on this computer is opened to the internet: the app asks the chat service, or her mailbox, what was written."}),children:(0,c.jsx)(ay,{})}),"PlanBadge",0,a2],405593)}];
|
|
18
|
+
`,at=({href:a,children:b})=>(0,c.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"font-medium text-foreground underline underline-offset-4 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:b}),au=({children:a})=>(0,c.jsx)("span",{className:"font-medium text-foreground",children:a}),av={telegram:[{body:(0,c.jsxs)(c.Fragment,{children:["In Telegram, write to ",(0,c.jsx)(au,{children:"@BotFather"}),", send ",(0,c.jsx)(au,{children:"/newbot"})," and pick a name. It answers with a ",(0,c.jsx)(au,{children:"token"}),"."]}),slot:{open:"https://t.me/BotFather",label:"Open @BotFather"}},{body:(0,c.jsx)(c.Fragment,{children:"Paste the token here."}),slot:{key:aq.TELEGRAM_TOKEN_KEY,looks:"123456789:AAE…"}},{body:(0,c.jsx)(c.Fragment,{children:"From your phone, write anything to your bot."}),slot:{says:"Point your phone's camera at it to open the chat."}},{body:(0,c.jsxs)(c.Fragment,{children:["A question with a code appears on this computer. Press ",(0,c.jsx)(au,{children:"Allow"})," if your phone shows the same code."]})}],discord:[{body:(0,c.jsxs)(c.Fragment,{children:["At ",(0,c.jsx)(au,{children:"discord.com/developers"}),", make a ",(0,c.jsx)(au,{children:"New Application"}),". So nobody else can add it to a server, set ",(0,c.jsx)(au,{children:"Install Link"})," to"," ",(0,c.jsx)(au,{children:"None"})," on its ",(0,c.jsx)(au,{children:"Installation"})," page and turn off"," ",(0,c.jsx)(au,{children:"Public Bot"})," on its ",(0,c.jsx)(au,{children:"Bot"})," page. There, press"," ",(0,c.jsx)(au,{children:"Reset Token"})," and copy it."]}),slot:{open:"https://discord.com/developers/applications",label:"Open discord.com/developers"}},{body:(0,c.jsx)(c.Fragment,{children:"Paste the token here."}),slot:{key:aq.DISCORD_TOKEN_KEY,looks:"MTE…"}},{body:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(au,{children:"Add the bot to a server of your own"})," — Discord only delivers a message to a bot you share a server with. A private server made for this is fine."]}),slot:{says:"Point your phone's camera at it, or open it here. It asks which server, and adds the bot with no permissions in it.",does:"Add the bot to a server"}},{body:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(au,{children:"Send the bot a direct message"}),", not in the server: on a phone, tap the bot in the server's member list, then ",(0,c.jsx)(au,{children:"Message"}),". A question with a code appears here: press ",(0,c.jsx)(au,{children:"Allow"})," if your phone shows the same code."]})}],slack:[{body:(0,c.jsxs)(c.Fragment,{children:["At ",(0,c.jsx)(at,{href:"https://api.slack.com/apps",children:"api.slack.com/apps"}),","," ",(0,c.jsx)(au,{children:"Create New App › From a manifest"}),", and paste the manifest."]}),slot:{manifest:!0}},{body:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(au,{children:"Basic Information › App-Level Tokens"}),": generate one with"," ",(0,c.jsx)(au,{children:"connections:write"}),". It starts with xapp-."]}),slot:{key:aq.SLACK_APP_TOKEN_KEY,looks:"xapp-…"}},{body:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(au,{children:"Install App"})," to your workspace. The Bot User OAuth Token starts with xoxb-."]}),slot:{key:aq.SLACK_BOT_TOKEN_KEY,looks:"xoxb-…"}},{body:(0,c.jsxs)(c.Fragment,{children:["In Slack, open the app under ",(0,c.jsx)(au,{children:"Apps"})," and write in its"," ",(0,c.jsx)(au,{children:"Messages"})," tab. A question with a code appears here: press"," ",(0,c.jsx)(au,{children:"Allow"})," if Slack shows the same code."]})}],email:[{body:(0,c.jsxs)(c.Fragment,{children:["Make a ",(0,c.jsx)(au,{children:"mailbox of her own"})," — a new account at a mail service that gives app passwords (Outlook no longer does). Turn on"," ",(0,c.jsx)(au,{children:"two-step sign-in"})," there and create an ",(0,c.jsx)(au,{children:"app password"})," for Thursday: how on"," ",(0,c.jsx)(at,{href:"https://support.google.com/accounts/answer/185833",children:"Gmail"}),", ",(0,c.jsx)(at,{href:"https://support.apple.com/en-us/102654",children:"iCloud"}),","," ",(0,c.jsx)(at,{href:"https://www.fastmail.help/hc/en-us/articles/360058752854-App-passwords",children:"Fastmail"}),". Your own inbox stays out of it."]})},{body:(0,c.jsx)(c.Fragment,{children:"Her address and the app password."}),slot:{mailbox:!0}},{body:(0,c.jsx)(c.Fragment,{children:"Your own address. Only mail from it reaches her, and only once its mail service vouches it was sent from there."}),slot:{person:!0}},{body:(0,c.jsx)(c.Fragment,{children:"From your address, write anything to hers. She answers in the same thread."}),slot:{write:!0}}]};function aw(){let a=(0,ak.useServerRoute)(r.queryKey.config),b=(0,ak.useServerRoute)(r.queryKey.reach);(0,ag.useAppEvent)({reach:()=>void(0,ak.revalidate)(r.queryKey.reach)});let d=b=>(0,I.isConfigSet)(a.data,b),e=b=>(0,I.isConfigUnreadable)(a.data,b),f=a=>b.data?.channels.find(b=>b.name===a)??null,g=a=>!!f(a)?.allowed,h=aq.REACH_CHANNELS.find(a=>f(a)?.refused||aq.REACH_KEYS[a].some(e)),i=aq.REACH_CHANNELS.find(a=>("email"===a?!!f(a)?.mailbox:aq.REACH_KEYS[a].every(d))&&!g(a)),j=!aq.REACH_CHANNELS.some(g),[k,l]=(0,q.useState)(h??i??(j?aq.REACH_CHANNELS[0]:null));return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)(ai.SettingItems,{children:aq.REACH_CHANNELS.map(a=>(0,c.jsx)(ax,{name:a,status:f(a),tokensIn:aq.REACH_KEYS[a].filter(d).length,isSet:d,isLost:e,open:k===a,onOpen:()=>l(k===a?null:a)},a))}),(0,c.jsx)(ai.SettingNote,{children:"Only the one person you allow can write: direct messages in a chat app, and by email only mail from the address you name. Nobody else is ever written back to. Work started here runs whether or not a tab is open, while Thursday is running on this computer."})]})}function ax({name:a,status:b,tokensIn:d,isSet:e,isLost:f,open:g,onOpen:h}){var j,k;let l,m,o,p,q,r=av[a],s=b?.refused??null,t="email"===a,u=t?[(l=(j={mailbox:!!b?.mailbox,stopped:!!s||f(aq.EMAIL_PASSWORD_KEY),named:!!b?.allowed,connected:!!b?.bot}).mailbox&&!j.stopped)?"done":"flat",l?"done":"now",l?j.named?"done":"now":"later",l&&j.named&&j.connected?"flat":"later"]:(k={connected:!!b?.bot,allowed:!!b?.allowed,refused:s},m=r.map(a=>a.slot&&"key"in a.slot?a.slot.key:null),o=a=>!e(a)||a===k.refused,p=m.findIndex(a=>a&&o(a)),q=m.reduce((a,b,c)=>b?c:a,-1),r.map((a,b)=>{let c=m[b];return c?o(c)?b===p?"now":"later":"done":p>=0?b<p?k.refused?"done":"flat":"later":k.allowed||b<q?"done":k.connected?"now":"flat"})),w=!t&&!!b?.bot&&!b?.allowed&&!s;return(0,c.jsxs)("div",{children:[(0,c.jsxs)("button",{type:"button",onClick:h,"aria-expanded":g,className:"flex w-full items-center gap-3 px-4 py-3 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[t?(0,c.jsx)(L.Mail,{className:"size-4 text-muted-foreground"}):(0,c.jsx)(v.SiteIcon,{host:ar[a],className:"size-4 rounded-[4px]",fallback:(0,c.jsx)(n.KeyRound,{className:"size-4 text-muted-foreground"})}),(0,c.jsx)("span",{className:"text-sm font-medium",children:aq.REACH_LABEL[a]}),(0,c.jsx)("span",{className:"min-w-0 flex-1 truncate",children:t?(0,c.jsx)(az,{status:b,lost:f(aq.EMAIL_PASSWORD_KEY)}):(0,c.jsx)(ay,{status:b,tokensIn:d,tokens:aq.REACH_KEYS[a].length,lost:aq.REACH_KEYS[a].some(f)})}),(0,c.jsx)(i.ChevronRight,{className:(0,al.cn)("size-4 shrink-0 text-muted-foreground transition-transform",g&&"rotate-90")})]}),g&&(0,c.jsxs)("div",{className:"px-4 pt-1 pb-4",children:[(0,c.jsx)("ol",{className:"space-y-3",children:r.map((a,d)=>(0,c.jsx)(aA,{n:d+1,step:a,state:u[d],set:!!a.slot&&"key"in a.slot&&e(a.slot.key),lost:!!a.slot&&"key"in a.slot&&f(a.slot.key),refused:a.slot&&"key"in a.slot&&a.slot.key===s?b?.problem??"":a.slot&&"key"in a.slot&&f(a.slot.key)?(0,I.lostWords)("The token saved here","Paste it again."):null,link:b?.link??null,waiting:w&&d===r.length-1,status:b,lostPassword:t&&f(aq.EMAIL_PASSWORD_KEY)},d))}),b?.allowed&&!t&&(0,c.jsx)(aI,{name:a,who:b.allowed.name,stopped:!!s})]})]})}function ay({status:a,tokensIn:b,tokens:d,lost:e}){let f="text-xs";return e?(0,c.jsx)("span",{className:(0,al.cn)(f,"text-destructive"),children:"Stopped — the saved token can't be unlocked any more"}):b<d?(0,c.jsx)("span",{className:(0,al.cn)(f,"text-muted-foreground"),children:b?`${b} of ${d} tokens in`:"Not set"}):a?.refused?(0,c.jsxs)("span",{className:(0,al.cn)(f,"text-destructive"),children:["Stopped — ",aq.REACH_LABEL[a.name]," turned the token away"]}):a?.problem?(0,c.jsx)(ah.ShinyText,{text:`${a.bot?"Reconnecting":"Connecting"} ${a.problem}`,className:(0,al.cn)(f,"align-middle")}):a?.allowed?(0,c.jsxs)("span",{className:(0,al.cn)(f,"text-muted-foreground"),children:["Listening as ",a.bot,". ",a.allowed.name," is let in."]}):a?.bot?(0,c.jsx)(ah.ShinyText,{text:`Listening as ${a.bot} — waiting for your first message`,tone:"waiting",className:(0,al.cn)(f,"align-middle")}):(0,c.jsx)(ah.ShinyText,{text:"Connecting…",className:(0,al.cn)(f,"align-middle")})}function az({status:a,lost:b}){let d="text-xs";return b?(0,c.jsx)("span",{className:(0,al.cn)(d,"text-destructive"),children:"Stopped — the saved app password can't be unlocked any more"}):a?.mailbox?a.refused?(0,c.jsx)("span",{className:(0,al.cn)(d,"text-destructive"),children:"Stopped — the mail service turned her mailbox's sign-in away"}):a.problem?(0,c.jsx)(ah.ShinyText,{text:`${a.bot?"Reconnecting":"Connecting"} ${a.problem}`,className:(0,al.cn)(d,"align-middle")}):a.bot?a.holding?(0,c.jsx)(ah.ShinyText,{text:`Listening as ${a.bot} — a mail is held: ${a.holding}`,className:(0,al.cn)(d,"align-middle")}):a.allowed?(0,c.jsxs)("span",{className:(0,al.cn)(d,"text-muted-foreground"),children:["Listening as ",a.bot,". ",a.allowed.name," can write."]}):(0,c.jsx)(ah.ShinyText,{text:`Listening as ${a.bot} — name your own address`,tone:"waiting",className:(0,al.cn)(d,"align-middle")}):(0,c.jsx)(ah.ShinyText,{text:"Connecting…",className:(0,al.cn)(d,"align-middle")}):(0,c.jsx)("span",{className:(0,al.cn)(d,"text-muted-foreground"),children:"Not set"})}function aA({n:a,step:b,state:d,set:e,lost:f,refused:g,link:h,waiting:i,status:j,lostPassword:k}){return(0,c.jsxs)("li",{className:"flex gap-3 text-[13px] leading-relaxed",children:[(0,c.jsx)(aB,{n:a,state:d}),(0,c.jsxs)("div",{className:"min-w-0 flex-1 space-y-2.5",children:[(0,c.jsx)("p",{className:(0,al.cn)("done"===d||"later"===d?"text-muted-foreground/60 **:text-inherit":"text-muted-foreground"),children:b.body}),(0,c.jsx)(aC,{slot:b.slot,state:d,set:e,lost:f,refused:g,link:h,waiting:i,status:j,lostPassword:k})]})]})}function aB({n:a,state:b}){return"done"===b?(0,c.jsx)("span",{className:"mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-foreground text-background",children:(0,c.jsx)(h.Check,{className:"size-3"})}):(0,c.jsx)("span",{className:(0,al.cn)("mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-background font-mono text-[10.5px] ring-1","now"===b?(0,al.cn)(al.WAITING_INK,"ring-waiting/40"):"text-muted-foreground ring-border/60","later"===b&&"opacity-60"),children:a})}function aC({slot:a,state:b,set:d,lost:e,refused:f,link:g,waiting:h,status:i,lostPassword:j}){let k=h&&(0,c.jsx)(ah.ShinyText,{text:"Waiting for your first message…",tone:"waiting"});return"later"===b?null:a&&"mailbox"in a?(0,c.jsx)(aK,{mailbox:i?.mailbox??null,refused:i?.refused?i.problem??"":j?(0,I.lostWords)("The app password saved here","Save her mailbox again."):null}):a&&"person"in a?(0,c.jsx)(aM,{who:i?.allowed?.chat??null}):a&&"write"in a?i?.mailbox?(0,c.jsx)(aN,{address:i.mailbox.address}):null:a&&"key"in a?(0,c.jsx)(aG,{configKey:a.key,looks:a.looks,set:d,lost:e,refused:f}):"done"===b?a&&"says"in a&&g?(0,c.jsx)(aF,{href:g,children:a.does??aE(g)}):null:a?"open"in a?(0,c.jsx)(aF,{href:a.open,children:a.label}):"manifest"in a?(0,c.jsx)(aH,{}):g?(0,c.jsxs)("div",{className:"space-y-2.5",children:[(0,c.jsx)(aD,{link:g,says:a.says,does:a.does}),k]}):k||null:k||null}function aD({link:a,says:b,does:d}){let{size:e,data:f}=function(a){let{ecc:b="L",boostEcc:c=!1,minVersion:d=1,maxVersion:e=40,maskPattern:f=-1,border:g=1}={},h="string"==typeof a?function(a){var b,c;if(""===a)return[];if(b=a,R.test(b))return[function(a){var b;if(b=a,!R.test(b))throw RangeError("String contains non-numeric characters");let c=[];for(let b=0;b<a.length;){let d=Math.min(a.length-b,3);X(Number.parseInt(a.substring(b,b+d),10),3*d+1,c),b+=d}return new Z($,a.length,c)}(a)];return(c=a,S.test(c))?[function(a){var b;let c;if(b=a,!S.test(b))throw RangeError("String contains unencodable characters in alphanumeric mode");let d=[];for(c=0;c+2<=a.length;c+=2){let b=45*T.indexOf(a.charAt(c));X(b+=T.indexOf(a.charAt(c+1)),11,d)}return c<a.length&&X(T.indexOf(a.charAt(c)),6,d),new Z(_,a.length,d)}(a)]:[ac(function(a){a=encodeURI(a);let b=[];for(let c=0;c<a.length;c++)"%"!==a.charAt(c)?b.push(a.charCodeAt(c)):(b.push(Number.parseInt(a.substring(c+1,c+3),16)),c+=2);return b}(a))]}(a):Array.isArray(a)?[ac(a)]:void 0;if(!h)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof a}`);let i=function(a,b,c=1,d=40,e=-1,f=!0){let g,h;if(!(1<=c&&c<=d&&d<=40)||e<-1||e>7)throw RangeError("Invalid value");for(g=c;;g++){let c=8*ae(g,b),e=function(a,b){let c=0;for(let d of a){let a=ab(d.mode,b);if(d.numChars>=1<<a)return 1/0;c+=4+a+d.bitData.length}return c}(a,g);if(e<=c){h=e;break}if(g>=d)throw RangeError("Data too long")}for(let a of[N,O,P])f&&h<=8*ae(g,a)&&(b=a);let i=[];for(let b of a)for(let a of(X(b.mode[0],4,i),X(b.numChars,ab(b.mode,g),i),b.getData()))i.push(a);let j=8*ae(g,b);X(0,Math.min(4,j-i.length),i),X(0,(8-i.length%8)%8,i);for(let a=236;i.length<j;a^=253)X(a,8,i);let k=Array.from({length:Math.ceil(i.length/8)},()=>0);return i.forEach((a,b)=>k[b>>>3]|=a<<7-(7&b)),new W(g,b,k,e)}(h,Q[b],d,e,f,c);return function(a,b=1){if(!b)return a;let{size:c}=a,d=c+2*b;a.size=d,a.data.forEach(a=>{for(let c=0;c<b;c++)a.unshift(!1),a.push(!1)});for(let c=0;c<b;c++)a.data.unshift(Array.from({length:d},a=>!1)),a.data.push(Array.from({length:d},a=>!1));let e=M.Border;a.types.forEach(a=>{for(let c=0;c<b;c++)a.unshift(e),a.push(e)});for(let c=0;c<b;c++)a.types.unshift(Array.from({length:d},a=>e)),a.types.push(Array.from({length:d},a=>e));return a}({version:i.version,maskPattern:i.mask,size:i.size,data:i.modules,types:i.types},g)}(a),g=aE(a);return(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,c.jsx)("div",{className:"rounded-lg bg-white p-2.5",children:(0,c.jsx)("svg",{viewBox:`0 0 ${e} ${e}`,className:"block size-31 text-black",role:"img","aria-label":`A picture of ${g} for a phone camera`,children:f.flatMap((a,b)=>a.map((a,d)=>a?(0,c.jsx)("rect",{x:d,y:b,width:1,height:1,fill:"currentColor"},`${d}-${b}`):null))})}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("p",{className:"text-muted-foreground",children:b}),(0,c.jsx)(aF,{href:a,children:d??g})]})]})}let aE=a=>a.replace(/^https:\/\//,"");function aF({href:a,children:b}){return(0,c.jsxs)("a",{href:a,target:"_blank",rel:"noreferrer",className:(0,al.cn)((0,s.buttonVariants)({variant:"outline",size:"sm"})),children:[(0,c.jsx)(K.ExternalLink,{}),b]})}function aG({configKey:a,looks:b,set:d,lost:e,refused:f}){let[g,h]=(0,q.useState)(""),[i,j]=(0,q.useState)(!1),{data:k}=(0,ak.useServerRoute)(r.queryKey.config),l=(0,I.isConfigFromEnv)(k,a),m=()=>{h(""),j(!1),(0,ak.revalidate)(r.queryKey.config),(0,ak.revalidate)(r.queryKey.reach)},[n,o]=(0,aj.useServerAction)(H.setConfigAction,{onOk:m}),[p,v]=(0,aj.useServerAction)(G,{onOk:m}),w=async()=>{await u.notify.confirm({title:"Remove this token?",description:"That service stops, and whoever is let in is let go.",okText:"Remove",destructive:!0})&&p(a)};return l?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{className:"max-w-xl text-muted-foreground",children:(0,I.envWords)(I.CONFIG_ENTRIES[a]?.label??a)}),f&&(0,c.jsx)("p",{className:"max-w-xl text-destructive",children:f})]}):d&&!i&&null===f?(0,c.jsx)(s.Button,{size:"xs",variant:"ghost",onClick:()=>j(!0),className:"-ml-2 text-muted-foreground",children:"Change the token"}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("form",{className:"flex flex-wrap items-center gap-2",onSubmit:b=>{b.preventDefault(),n(a,g)},children:[(0,c.jsx)(t.Input,{value:g,onChange:a=>h(a.target.value),placeholder:b,"aria-label":"Token",type:"password",autoComplete:"off",spellCheck:!1,className:"w-72 font-mono"}),(0,c.jsx)(s.Button,{type:"submit",size:"sm",loading:o,disabled:g.trim().length<x.KEY_MIN,children:d?"Replace":"Save"}),(d||e)&&(0,c.jsxs)(c.Fragment,{children:[null===f&&(0,c.jsx)(s.Button,{size:"sm",variant:"ghost",onClick:()=>j(!1),children:"Cancel"}),(0,c.jsx)(s.Button,{size:"sm",variant:"ghost",loading:v,onClick:()=>void w(),className:"ml-auto text-destructive hover:text-destructive",children:"Remove"})]})]}),f&&(0,c.jsx)("p",{className:"max-w-xl text-destructive",children:f})]})}function aH(){let[a,b]=(0,q.useState)(!1);return(0,c.jsxs)(s.Button,{size:"sm",variant:"outline",onClick:()=>void navigator.clipboard.writeText(as).then(()=>{b(!0),setTimeout(()=>b(!1),2e3)}),children:[a?(0,c.jsx)(h.Check,{}):(0,c.jsx)(J.Copy,{}),a?"Copied":"Copy the manifest"]})}function aI({name:a,who:b,stopped:d}){let[e,f]=(0,aj.useServerAction)(am,{onOk:()=>(0,ak.revalidate)(r.queryKey.reach)});return(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pt-3 pl-8 text-[13px] text-muted-foreground",children:[(0,c.jsx)("span",{children:d?`${b} is let in.`:`${b} can write from a phone.`}),(0,c.jsx)(s.Button,{size:"sm",variant:"outline",loading:f,onClick:async()=>{await u.notify.confirm({title:`Let ${b} go?`,description:"Nobody can write to Thursday through this service until someone is let in again.",okText:"Let them go",destructive:!0})&&e(a)},children:"Let them go"})]})}let aJ=(a,b)=>{let c=a?.lastIndexOf(":")??-1;return c>0&&a?{host:a.slice(0,c),port:a.slice(c+1)}:{host:"",port:String(b)}};function aK({mailbox:a,refused:b}){let[d,e]=(0,q.useState)(!1),[f,g]=(0,q.useState)(a?.address??""),[h,i]=(0,q.useState)(""),[j,k]=(0,q.useState)(!1),[l,m]=(0,q.useState)(()=>aJ(void 0,993)),[n,o]=(0,q.useState)(()=>aJ(void 0,465)),{data:p}=(0,ak.useServerRoute)(r.queryKey.config),v=()=>{i(""),e(!1),k(!1),(0,ak.revalidate)(r.queryKey.config),(0,ak.revalidate)(r.queryKey.reach)},[w,x]=(0,aj.useServerAction)(ap,{onOk:a=>{if(a?.found)return v();k(!0)}}),[y,z]=(0,aj.useServerAction)(ao,{onOk:v}),A=async()=>{await u.notify.confirm({title:"Remove her mailbox?",description:"Email stops, and the address that could write is let go. The mailbox itself is not touched.",okText:"Remove",destructive:!0})&&y()};if((0,I.isConfigFromEnv)(p,aq.EMAIL_PASSWORD_KEY))return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{className:"max-w-xl text-muted-foreground",children:(0,I.envWords)("Her mailbox's app password")}),b&&(0,c.jsx)("p",{className:"max-w-xl text-destructive",children:b})]});if(a&&!d&&null===b)return(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[a.address," · ",a.imap," · ",a.smtp]}),(0,c.jsx)(s.Button,{size:"xs",variant:"ghost",onClick:()=>{g(a.address),e(!0)},className:"-ml-2 text-muted-foreground",children:"Change"})]});let B=f.includes("@")?f.slice(f.lastIndexOf("@")+1):"Its domain",C="grid gap-1 font-mono text-[11px] text-muted-foreground";return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("form",{className:"space-y-2.5",onSubmit:b=>{b.preventDefault();let c=!j&&a?.address.toLowerCase()===f.trim().toLowerCase();w({address:f.trim(),password:h,...j?{imap:`${l.host.trim()}:${l.port.trim()}`,smtp:`${n.host.trim()}:${n.port.trim()}`}:c?{imap:a.imap,smtp:a.smtp}:{}})},children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,c.jsxs)("label",{className:C,children:["Address",(0,c.jsx)(t.Input,{value:f,onChange:a=>{g(a.target.value),k(!1)},placeholder:"thursday@example.com",type:"email",autoComplete:"off",spellCheck:!1,className:"w-64 font-sans"})]}),(0,c.jsxs)("label",{className:C,children:["App password",(0,c.jsx)(t.Input,{value:h,onChange:a=>i(a.target.value),placeholder:"paste it here",type:"password",autoComplete:"off",spellCheck:!1,className:"w-52 placeholder:font-sans"})]})]}),j&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("p",{className:"max-w-xl text-muted-foreground",children:[B," doesn't say where its mail servers are. Its help pages name them — one for reading mail (IMAP) and one for sending it (SMTP)."]}),(0,c.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,c.jsx)(aL,{label:"Reading server",looks:`imap.${B}`,value:l,onChange:m}),(0,c.jsx)(aL,{label:"Sending server",looks:`smtp.${B}`,value:n,onChange:o})]})]}),(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,c.jsx)(s.Button,{type:"submit",size:"sm",loading:x,disabled:!f.includes("@")||h.trim().length<8||j&&!(l.host.trim()&&n.host.trim()),children:a?"Replace":"Save"}),a&&(0,c.jsxs)(c.Fragment,{children:[null===b&&(0,c.jsx)(s.Button,{size:"sm",variant:"ghost",onClick:()=>e(!1),children:"Cancel"}),(0,c.jsx)(s.Button,{size:"sm",variant:"ghost",loading:z,onClick:()=>void A(),className:"ml-auto text-destructive hover:text-destructive",children:"Remove"})]})]})]}),b&&(0,c.jsx)("p",{className:"max-w-xl text-destructive",children:b})]})}function aL({label:a,looks:b,value:d,onChange:e}){let f="grid gap-1 font-mono text-[11px] text-muted-foreground";return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("label",{className:f,children:[a,(0,c.jsx)(t.Input,{value:d.host,onChange:a=>e({...d,host:a.target.value}),placeholder:b,autoComplete:"off",spellCheck:!1,className:"w-52 font-mono"})]}),(0,c.jsxs)("label",{className:f,children:["Port",(0,c.jsx)(t.Input,{value:d.port,onChange:a=>e({...d,port:a.target.value}),inputMode:"numeric",autoComplete:"off",className:"w-18 font-mono"})]})]})}function aM({who:a}){let[b,d]=(0,q.useState)(!1),[e,f]=(0,q.useState)(""),g=()=>{f(""),d(!1),(0,ak.revalidate)(r.queryKey.reach)},[h,i]=(0,aj.useServerAction)(an,{onOk:g}),[j,k]=(0,aj.useServerAction)(am,{onOk:g});return a&&!b?(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground",children:a}),(0,c.jsx)(s.Button,{size:"xs",variant:"ghost",onClick:()=>d(!0),className:"-ml-2 text-muted-foreground",children:"Change"})]}):(0,c.jsxs)("form",{className:"flex flex-wrap items-center gap-2",onSubmit:a=>{a.preventDefault(),h("email",e.trim())},children:[(0,c.jsx)(t.Input,{value:e,onChange:a=>f(a.target.value),placeholder:"you@example.org","aria-label":"Your own address",type:"email",autoComplete:"email",spellCheck:!1,className:"w-64"}),(0,c.jsx)(s.Button,{type:"submit",size:"sm",loading:i,disabled:!e.includes("@"),children:a?"Replace":"Save"}),a&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.Button,{size:"sm",variant:"ghost",onClick:()=>d(!1),children:"Cancel"}),(0,c.jsx)(s.Button,{size:"sm",variant:"ghost",loading:k,onClick:async()=>{await u.notify.confirm({title:`Stop reading mail from ${a}?`,description:"Nobody can write to Thursday by email until an address is named again.",okText:"Stop",destructive:!0})&&j("email")},className:"ml-auto text-destructive hover:text-destructive",children:"Remove"})]})]})}function aN({address:a}){let[b,d]=(0,q.useState)(!1);return(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,c.jsxs)(aF,{href:`mailto:${a}`,children:["Write to ",a]}),(0,c.jsxs)(s.Button,{size:"sm",variant:"outline",onClick:()=>void navigator.clipboard.writeText(a).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)}),children:[b?(0,c.jsx)(h.Check,{}):(0,c.jsx)(J.Copy,{}),b?"Copied":"Copy her address"]})]})}let aO={[I.EXA_API_KEY]:o.Search},aP={image:m.Image,video:l,speech:f.AudioLines,transcription:g.Captions},aQ={keys:["voice","easy","text","search"],models:["bots","studio"]};function aR({screen:a}){let{data:b,isLoading:d,error:e}=(0,ak.useServerRoute)(r.queryKey.config),f=(0,E.useVoiceLine)();if(d)return(0,c.jsx)(ai.SettingSkeleton,{rows:4});if(e)return(0,c.jsx)(ai.SettingError,{message:e.message});let g=a=>(0,I.isConfigSet)(b,a),h=a=>(0,I.isConfigUnreadable)(b,a),i=a=>(0,I.isConfigFromEnv)(b,a),j=a=>(0,I.groupSatisfied)(a,a.id===I.VOICE_GROUP_ID?f.countsForCall:g),k=a=>b?.find(b=>b.key===a)?.value,l=aQ[a].flatMap(a=>I.CONFIG_GROUPS.find(b=>b.id===a)??[]),m=l.filter(a=>"keys"===a.section).flatMap(a=>a.entries),n=m.filter(a=>h(a.key)).length;return(0,c.jsx)(ai.SettingScreen,{footer:(0,c.jsx)(ai.SettingRailNote,{children:"models"===a?"Her own voice and backend models are in Thursday. A bot can pick its own on its page.":`${m.filter(a=>g(a.key)).length} of ${m.length} set${n?` \xb7 ${n} to enter again`:""}${l.some(a=>!j(a))?" · a call needs the GPT Subscription or an OpenAI key":" · your keys stay on this machine"}`}),children:l.map(a=>(0,c.jsx)(ai.SettingGroup,{label:a.title,hint:a.hint,right:(0,c.jsx)(aT,{group:a,met:j(a)}),children:"easy"===a.id?(0,c.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:a.entries.map(a=>(0,c.jsx)(aU,{card:!0,entry:a,set:g(a.key),lost:h(a.key),env:i(a.key)},a.key))}):"text"===a.id?(0,c.jsx)("div",{className:"flex flex-wrap gap-x-1.5 gap-y-3.5",children:a.entries.map(a=>(0,c.jsx)(aS,{entry:a,set:g(a.key),lost:h(a.key),env:i(a.key)},a.key))}):(0,c.jsx)(ai.SettingItems,{children:a.entries.map(b=>b.effortOf?null:b.choices?(0,c.jsx)(a3,{entry:b,choices:b.choices,value:k(b.key),effort:a4(a,b.key),effortValue:k(I.DEFAULT_EFFORT_KEY)},b.key):(0,c.jsx)(aU,{entry:b,set:g(b.key),lost:h(b.key),env:i(b.key)},b.key))})},a.id))})}function aS({entry:a,set:b,lost:d,env:e}){return(0,c.jsxs)("button",{type:"button",onClick:()=>a6(a,b),"aria-label":`${a.label}: ${e?"set in env":b?"set":d?"enter it again":"not set"}`,className:"group flex w-17 flex-col items-center gap-1.5 rounded-xl py-1 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,c.jsxs)("span",{className:"relative grid size-10.5 place-items-center rounded-[13px] bg-muted/60 transition-colors group-hover:bg-muted",children:[(0,c.jsx)(a2,{entry:a}),b?(0,c.jsx)("span",{className:"absolute -top-1 -right-1 grid size-4 place-items-center rounded-full bg-primary text-primary-foreground ring-2 ring-background",children:(0,c.jsx)(h.Check,{className:"size-2.5"})}):d&&(0,c.jsx)("span",{className:"absolute -top-1 -right-1 grid size-4 place-items-center rounded-full bg-waiting text-background ring-2 ring-background",children:(0,c.jsx)(p.TriangleAlert,{className:"size-2.5"})})]}),(0,c.jsx)("span",{className:(0,al.cn)("max-w-full truncate text-[11px]",b?"text-foreground":"text-muted-foreground"),children:a.label}),e&&(0,c.jsx)("span",{className:"-mt-1.5 font-mono text-[10px] text-muted-foreground",children:"env"})]})}function aT({group:a,met:b}){return"none"===a.require?null:b?(0,c.jsxs)("span",{className:"flex items-center gap-1 font-mono text-[11px] text-muted-foreground",children:[(0,c.jsx)(h.Check,{className:"size-3"}),"ready"]}):(0,c.jsxs)("span",{className:(0,al.cn)("flex items-center gap-1 font-mono text-[11px]",al.WAITING_INK),children:[(0,c.jsx)(p.TriangleAlert,{className:"size-3"}),a.note??"Required"]})}function aU({entry:a,set:b,lost:d,env:e,card:f=!1,narrow:g=!1}){let j=aX(a,b),k=aZ(a,b),l=aY(a,b),m=k.data?a$(k.data):aW(b,j.data,a.signIn,d,e),n=j.isLoading||k.isLoading,o=(0,c.jsxs)("span",{className:(0,al.cn)("flex shrink-0 items-center gap-1.5 font-mono text-xs",m.ink),children:[m.warn?(0,c.jsx)(p.TriangleAlert,{className:"size-3"}):b&&(0,c.jsx)(h.Check,{className:"size-3"}),m.text]});return(0,c.jsxs)("button",{type:"button",onClick:()=>{var d;return a.signIn?(d=a,u.notify.component({className:"sm:max-w-md",renderer:({close:a})=>(0,c.jsx)(a5,{entry:d,onDone:a})})):a6(a,b)},className:(0,al.cn)("group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",f&&"rounded-xl border border-border/60"),children:[(0,c.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,c.jsx)(a2,{entry:a})}),(0,c.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,c.jsxs)("span",{className:"flex items-center gap-2 truncate text-sm font-medium",children:[a.label,a.signIn&&b&&(0,c.jsx)(a0,{usage:k.data,plan:l})]}),g?n?(0,c.jsx)(w.Skeleton,{className:"h-3 w-20"}):o:(0,c.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:a.signIn?b?a_(k.data)??"signed in":"sign in with your account":a.key}),a.signIn&&b&&k.data&&(0,c.jsx)(a1,{usage:k.data})]}),g?null:n?(0,c.jsx)(w.Skeleton,{className:"h-3 w-20 shrink-0"}):o,(0,c.jsx)(i.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}let aV=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});function aW(a,b,c,d=!1,e=!1){var f,g,h;let i=function(a,b,c,d=!1){return!a&&d?{text:c?"Sign in again":"Enter again",ink:al.WAITING_INK,warn:!0}:a?b?"refused"in b?{text:"Key refused",ink:"text-destructive",warn:!0}:{text:`${aV.format(b.balance)} left`,ink:b.low?al.WAITING_INK:"text-muted-foreground",warn:b.low}:{text:c?"Signed in":"Set",ink:"text-muted-foreground",warn:!1}:{text:c?"Signed out":"Not set",ink:"text-muted-foreground",warn:!1}}(a,b,c,d);return a?(f=i,g=e,h=!!b,g?h?{...f,text:`${f.text} \xb7 env`}:{...f,text:"Set in env"}:f):i}function aX(a,b){return(0,ak.useServerRoute)(b&&(0,C.isCatalogProvider)(a.provider)?r.queryKey.keyCredits(a.provider):null)}function aY(a,b){let{data:c}=(0,ak.useServerRoute)(b&&a.signIn?r.queryKey.llmModel:null);return c?.find(b=>b.id===a.provider)?.plan??null}function aZ(a,b){return(0,ak.useServerRoute)(b&&a.signIn?r.queryKey.subscriptionUsage:null)}function a$(a){return"refused"in a?{text:"Sign-in refused",ink:"text-destructive",warn:!0}:{text:a.spent?"Limit reached":`${a.usedPercent}% used`,ink:a.high?al.WAITING_INK:"text-muted-foreground",warn:a.high}}function a_(a){let b=!a||"refused"in a?null:a;return b?.resetsAt?`resets in ${(0,d.formatDistanceToNowStrict)(new Date(b.resetsAt))}`:null}function a0({usage:a,plan:b}){let d=(0,C.planName)((!a||"refused"in a?null:a.plan)??b);return d?(0,c.jsx)("span",{className:"rounded-full px-1.5 font-mono text-[9.5px] leading-4 font-normal text-foreground ring-1 ring-border ring-inset",children:d}):null}function a1({usage:a}){return"refused"in a?null:(0,c.jsx)("span",{role:"meter","aria-label":"Plan used","aria-valuenow":a.usedPercent,"aria-valuemin":0,"aria-valuemax":100,className:"mt-1.5 block h-1 w-full max-w-48 overflow-hidden rounded-full bg-muted",children:(0,c.jsx)("span",{className:(0,al.cn)("block h-full rounded-full transition-[width] duration-500",a.high?"bg-waiting":"bg-foreground/45"),style:{width:`${Math.min(100,Math.max(2,a.usedPercent))}%`}})})}function a2({entry:a}){if(a.provider)return(0,c.jsx)(B.ProviderIcon,{provider:a.provider,className:"size-4"});let b=aO[a.key]??n.KeyRound,d=(0,c.jsx)(b,{className:"size-4 text-muted-foreground"});return a.site?(0,c.jsx)(v.SiteIcon,{host:a.site,className:"size-4 rounded-[4px]",fallback:d}):d}function a3({entry:a,choices:b,value:d,effort:e,effortValue:f}){let g=a.text?(0,C.parseTextModel)(d):(0,C.parseMediaModel)(d),{data:h}=(0,ak.useServerRoute)(a.text&&!d&&r.queryKey.automaticModel),{data:i}=(0,ak.useServerRoute)(a.kind&&!d&&r.queryKey.llmModel),j=i?.find(a=>a.signIn),k=a.kind&&!d?(0,C.planMediaOf)(a.kind,j?.hasKey?{plan:j.plan??null}:null):null,l=a.kind?aP[a.kind]:D.BotsMark,[m]=(0,aj.useServerAction)(H.setConfigAction,{onOk:()=>{(0,ak.revalidate)(r.queryKey.config),(0,ak.revalidate)(r.queryKey.automaticModel)}}),[n]=(0,aj.useServerAction)(G,{onOk:()=>{(0,ak.revalidate)(r.queryKey.config),(0,ak.revalidate)(r.queryKey.automaticModel)}});return(0,c.jsxs)("div",{className:"flex w-full items-start gap-3 p-4",children:[(0,c.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,c.jsx)(l,{className:"size-4 text-muted-foreground"})}),(0,c.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,c.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 pt-1.5",children:[(0,c.jsx)("span",{className:"truncate text-sm font-medium",children:a.label}),!d&&(0,c.jsx)("span",{className:(0,al.cn)("shrink-0 rounded-[5px] border border-border/60 px-1 font-mono text-[10px]",a.kind&&!k?al.WAITING_INK:"text-muted-foreground"),children:a.kind&&!k?"off":"auto"})]}),(0,c.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,c.jsx)("div",{className:"min-w-0",children:(0,c.jsx)(A.ModelPicker,{kind:a.kind,provider:g?.provider??null,model:g?.model??"",unset:a.kind?k?`Automatic \xb7 ${b.find(a=>a.value===`${k.provider}/${k.model}`)?.label??k.model}`:"Not offered to bots until you pick one":function(a,b){if(!a)return"Automatic";if(!a.ref)return a.problem;let{provider:c,model:d}=a.ref,e=b.find(a=>a.value===`${c}/${d}`);return`Automatic \xb7 ${e?.label??d}`}(h,b),onChange:b=>m(a.key,`${b.provider}/${b.model.trim()}`),onUnset:d?()=>{n(a.key),e&&f&&n(e.key)}:void 0})}),e&&g&&(0,c.jsxs)("div",{className:"flex items-start gap-3 pt-0.5",children:[(0,c.jsx)("span",{className:"w-12 shrink-0 pt-1.5 font-mono text-[11px] text-muted-foreground",children:"effort"}),(0,c.jsx)(z.EffortSwitch,{provider:g.provider,model:g.model,value:C.effortSchema.safeParse(f).data??null,onChange:a=>a?m(e.key,a):n(e.key)})]})]})]})]})}let a4=(a,b)=>a.entries.find(a=>a.effortOf===b);function a5({entry:a,onDone:b}){let{data:d}=(0,ak.useServerRoute)(r.queryKey.config),e=(0,I.isConfigSet)(d,a.key),f=(0,I.isConfigUnreadable)(d,a.key),g=(0,I.isConfigFromEnv)(d,a.key),h=aY(a,e),i=aZ(a,e),j=i.data?a$(i.data):null,[k,l]=(0,aj.useServerAction)(G,{okMessage:`Signed out of ${a.label}`,onOk:()=>{(0,ak.revalidate)(r.queryKey.config),(0,ak.revalidate)(r.queryKey.llmModel),b()}});return(0,c.jsx)(ai.SettingDialogContent,{title:a.label,description:e?(0,c.jsxs)(c.Fragment,{children:["Signed in ",(0,c.jsx)(a0,{usage:i.data,plan:h}),a_(i.data)&&(0,c.jsxs)(c.Fragment,{children:[" · ",(0,c.jsx)("span",{className:"font-mono",children:a_(i.data)})]}),j&&(0,c.jsxs)(c.Fragment,{children:[" · ",(0,c.jsx)("span",{className:(0,al.cn)("font-mono",j.ink),children:j.text})]})]}):"Sign in with your ChatGPT account instead of a key",footer:(0,c.jsxs)(c.Fragment,{children:[(e||f)&&!g&&(0,c.jsx)(s.Button,{variant:"ghost",loading:l,onClick:async()=>{await u.notify.confirm({title:`Sign out of ${a.label}?`,description:"Nothing runs on your plan until you sign in again.",okText:"Sign out",destructive:!0})&&k(a.key)},children:"Sign out"}),(0,c.jsx)(s.Button,{variant:"ghost",onClick:b,children:e?"Close":"Cancel"}),!e&&(0,c.jsx)(y.ChatGptSignIn,{})]}),children:(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)(ai.SettingNote,{children:e?"Bots on this subscription spend your plan's usage, not a key. When it runs out, the job stops and says when it resets.":"The sign-in opens in its own window. Approve it there, and this turns to signed in by itself."}),i.data&&"refused"in i.data&&(0,c.jsx)(ai.SettingNote,{className:"wrap-break-word text-destructive",children:i.data.refused}),f&&(0,c.jsx)(ai.SettingNote,{className:(0,al.cn)("wrap-break-word",al.WAITING_INK),children:(0,I.lostWords)("The sign-in saved here","Sign in again.")}),g&&(0,c.jsx)(ai.SettingNote,{className:"wrap-break-word",children:(0,I.envWords)(a.label)})]})})}function a6(a,b){return u.notify.component({className:"sm:max-w-md",renderer:({close:d})=>(0,c.jsx)(a7,{entry:a,set:b,onDone:d})})}function a7({entry:a,set:b,onDone:d}){let[f,g]=(0,q.useState)(""),{data:h}=(0,ak.useServerRoute)(r.queryKey.config),i=h?(0,I.isConfigSet)(h,a.key):b,j=(0,I.isConfigUnreadable)(h,a.key),k=(0,I.isConfigFromEnv)(h,a.key),{data:l}=aX(a,i),m=l?aW(i,l):null,n=()=>{(0,ak.revalidate)(r.queryKey.config),(0,ak.revalidate)(r.queryKey.llmModel)},[o,p]=(0,aj.useServerAction)(H.setConfigAction,{okMessage:`${a.label} key saved`,onOk:()=>{n(),d()}}),[v,w]=(0,aj.useServerAction)(G,{okMessage:`${a.label} key removed`,onOk:()=>{n(),d()}}),y=async()=>{await u.notify.confirm({title:`Remove the ${a.label} key?`,description:"It is deleted from this computer, and nothing runs on it until a key is pasted again.",okText:"Remove",destructive:!0})&&v(a.key)};return(0,c.jsx)(ai.SettingDialogContent,{title:a.label,description:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"font-mono",children:a.key}),k?(0,c.jsx)(c.Fragment,{children:" · set in env"}):a.hint&&(0,c.jsxs)(c.Fragment,{children:[" · ",a.hint]}),m&&(0,c.jsxs)(c.Fragment,{children:[" · ",(0,c.jsx)("span",{className:(0,al.cn)("font-mono",m.ink),children:m.text})]})]}),footer:k?(0,c.jsx)(s.Button,{onClick:d,children:"Close"}):(0,c.jsxs)(c.Fragment,{children:[(i||j)&&(0,c.jsx)(s.Button,{variant:"ghost",loading:w,onClick:()=>void y(),className:"mr-auto text-destructive hover:text-destructive",children:"Remove"}),(0,c.jsx)(s.Button,{variant:"ghost",onClick:d,children:"Cancel"}),(0,c.jsx)(s.Button,{loading:p,disabled:f.trim().length<x.KEY_MIN,onClick:()=>o(a.key,f),children:i?"Replace":"Save"})]}),children:(0,c.jsxs)("div",{className:"space-y-2",children:[k?(0,c.jsx)(ai.SettingNote,{className:"wrap-break-word",children:(0,I.envWords)(a.label)}):(0,c.jsx)(t.Input,{value:f,onChange:a=>g(a.target.value),onKeyDown:b=>{"Enter"===b.key&&f.trim().length>=x.KEY_MIN&&o(a.key,f)},placeholder:i?"New value — replaces the current key":j?"Paste the key again":a.keyLooks??"Paste the key",spellCheck:!1,type:"password",autoFocus:!0}),!i&&a.keysAt&&(0,c.jsxs)("a",{href:a.keysAt,target:"_blank",rel:"noreferrer",className:"flex w-fit items-center gap-1 px-0.5 text-[13px] text-foreground underline underline-offset-3 hover:text-foreground/80",children:["Get a key at ",new URL(a.keysAt).host,(0,c.jsx)(e.ArrowUpRight,{className:"size-3.5"})]}),l&&"refused"in l&&(0,c.jsx)(ai.SettingNote,{className:"wrap-break-word text-destructive",children:l.refused}),j&&(0,c.jsx)(ai.SettingNote,{className:(0,al.cn)("wrap-break-word",al.WAITING_INK),children:(0,I.lostWords)("The key saved here","Paste it again.")})]})})}a.s(["KeysSetting",0,()=>(0,c.jsx)(aR,{screen:"keys"}),"ModelsSetting",0,()=>(0,c.jsx)(aR,{screen:"models"}),"PhoneSetting",0,()=>(0,c.jsx)(ai.SettingScreen,{footer:(0,c.jsx)(ai.SettingRailNote,{children:"Nothing on this computer is opened to the internet: the app asks the chat service, or her mailbox, what was written."}),children:(0,c.jsx)(aw,{})}),"PlanBadge",0,a0],405593)}];
|
|
19
19
|
|
|
20
20
|
//# sourceMappingURL=features_config_components_config-setting_tsx_0xfwqdg._.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[26444,a=>{"use strict";var b=a.i(187924),c=a.i(752562),d=a.i(589027),e=a.i(141146),f=a.i(738835),g=a.i(403512),h=a.i(164831);let i={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};i.node;let j=(0,h.default)(i),k={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};k.node;let l=(0,h.default)(k);var m=a.i(951675),n=a.i(474215),o=a.i(572131),p=a.i(767561),q=a.i(340695),r=a.i(316474),s=a.i(205522),t=a.i(497895);let u=(0,o.memo)(({data:a,name:c,initialExpandDepth:d=2})=>{let e=(0,o.useMemo)(()=>"string"==typeof a?function(a){let b=a.trim();if(!(b.startsWith("{")&&b.endsWith("}"))&&!(b.startsWith("[")&&b.endsWith("]")))return{success:!1,data:a};try{return{success:!0,data:JSON.parse(a)}}catch{return{success:!1,data:a}}}(a).data:a,[a]);return(0,b.jsx)("div",{className:"text-sm",children:(0,b.jsx)(x,{data:e,name:c,depth:0,initialExpandDepth:d})})});u.displayName="JsonView";let v=(a,b)=>({role:"button",tabIndex:0,"aria-expanded":a,onClick:b,onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&(a.preventDefault(),b())}}),w="outline-none focus-visible:ring-3 focus-visible:ring-ring/50",x=(0,o.memo)(({data:a,name:c,depth:d=0,initialExpandDepth:e})=>{var f;let g=void 0===a?"undefined":Array.isArray(a)?"array":null===a?"null":typeof a,[h,i]=(0,o.useState)("string"!==g&&d<e),j={number:"text-blue-500",boolean:"text-amber-500",null:"text-purple-500",undefined:"text-gray-500",string:"text-foreground break-all whitespace-pre-wrap",default:"text-muted-foreground"};switch(g){case"object":case"array":let k,l,m;return l=(k=(f="array"===g)?a:Object.entries(a)).length,m={open:f?"[":"{",close:f?"]":"}",collapsed:f?"[ ... ]":"{ ... }",empty:f?"[]":"{}"},0===l?(0,b.jsxs)("div",{className:"flex items-center",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:m.empty})]}):(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsxs)("div",{className:(0,t.cn)("flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30",w),...v(h,()=>i(!h)),children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[c,":"]}),h?(0,b.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:m.open}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:m.collapsed}),(0,b.jsxs)("span",{className:"ml-1 text-muted-foreground group-hover:text-foreground",children:[l," ",1===l?"item":"items"]})]})]}),h&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"pl-2 ml-4 border-l border-border",children:f?k.map((a,c)=>(0,b.jsx)("div",{className:"my-1",children:(0,b.jsx)(x,{data:a,name:`${c}`,depth:d+1,initialExpandDepth:e})},c)):k.map(([a,c])=>(0,b.jsx)("div",{className:"my-1",children:(0,b.jsx)(x,{data:c,name:a,depth:d+1,initialExpandDepth:e})},a))}),(0,b.jsx)("div",{className:"text-muted-foreground",children:m.close})]})]});case"string":return a.length>100?(0,b.jsxs)("div",{className:"flex mr-1 rounded group hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[c,":"]}),(0,b.jsx)("pre",{className:(0,t.cn)(j.string,"cursor-pointer group-hover:text-foreground",w),...v(h,()=>i(!h)),title:h?"Click to collapse":"Click to expand",children:h?`"${a}"`:`"${a.slice(0,100)}..."`})]}):(0,b.jsxs)("div",{className:"flex mr-1 rounded hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsxs)("pre",{className:j.string,children:['"',a,'"']})]});case"undefined":return(0,b.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsx)("span",{className:j.undefined,children:"undefined"})]});default:return(0,b.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsx)("span",{className:j[g]||j.default,children:null===a?"null":String(a)})]})}});x.displayName="JsonNode";var y=a.i(446181),z=a.i(341889),A=a.i(280281),B=a.i(621958),C=a.i(546893),D=a.i(864037),E=a.i(405050);let F=(0,E.createServerReference)("7fa2f23779743326186dee802ae44f5ac711376d28",E.callServer,void 0,E.findSourceMapURL,"callToolAction"),G=(0,E.createServerReference)("7fcf816059ccd3b84339b6994b716e164eb4be737d",E.callServer,void 0,E.findSourceMapURL,"deleteServerAction"),H=(0,E.createServerReference)("7f68b3db831b2bfca64717ddc0839037feb4f5753a",E.callServer,void 0,E.findSourceMapURL,"refreshServerAction"),I=(0,E.createServerReference)("7f428eb40ee4894f5b2f282fd603d4e4b651a294d4",E.callServer,void 0,E.findSourceMapURL,"registerServerAction");var J=a.i(954714),K=a.i(199169);let L=J.object({url:J.url(),headers:J.record(J.string(),J.string()).optional()}),M=J.object({command:J.string().min(1),args:J.array(J.string()).optional(),env:J.record(J.string(),J.string()).optional()}),N=J.union([L,M]),O=J.object({name:J.string(),description:J.string().optional(),inputSchema:J.looseObject({}).optional(),outputSchema:J.looseObject({}).optional()});function P(a){return"url"in a}J.object({clientInformation:J.looseObject({}).optional(),tokens:J.looseObject({}).optional(),authorizationServer:J.looseObject({}).optional(),codeVerifier:J.string().optional(),state:J.string().optional()});let Q=J.object({name:J.string().min(1).max(40),config:N,toolCount:J.number().int(),lastError:J.string().nullish()}),R=O.extend({id:J.number().int(),description:J.string().nullish()});Q.omit({toolCount:!0}).extend({tools:R.array().default([]),toolsSyncedAt:K.DateLikeSchema});let S=J.object({name:J.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:N}),T=J.union([J.object({mcpServers:J.record(J.string(),N)}),J.record(J.string(),N)]),U=[{name:"todoist",icon:"todoist.com",description:"Tasks, projects, and due dates",config:{url:"https://ai.todoist.net/mcp"}},{name:"home-assistant",icon:"home-assistant.io",description:"Lights, switches, and the rest of the house — your address and a long-lived token",config:{url:"http://homeassistant.local:8123/api/mcp",headers:{Authorization:"Bearer <your-home-assistant-token>"}}},{name:"kiwi",icon:"kiwi.com",description:"Flight search — no account",config:{url:"https://mcp.kiwi.com"}},{name:"zapier",icon:"zapier.com",description:"Gmail, Google Calendar, and thousands of apps you connect there",config:{url:"https://mcp.zapier.com/api/v1/connect"}},{name:"notion",icon:"notion.so",description:"Pages, databases, and search",config:{url:"https://mcp.notion.com/mcp"}},{name:"canva",icon:"canva.com",description:"Create and manage designs",config:{url:"https://mcp.canva.com/mcp"}},{name:"slack",icon:"slack.com",description:"Channels, messages, and search",config:{url:"https://mcp.slack.com/mcp"}},{name:"box",icon:"box.com",description:"Files, folders, and content search",config:{url:"https://mcp.box.com/mcp"}},{name:"airtable",icon:"airtable.com",description:"Bases, tables, and records",config:{url:"https://mcp.airtable.com/mcp"}},{name:"fireflies",icon:"fireflies.ai",description:"Meeting transcripts and summaries",config:{url:"https://mcp.fireflies.ai/mcp"}},{name:"asana",icon:"asana.com",description:"Tasks, projects, and portfolios",config:{url:"https://mcp.asana.com/mcp"}},{name:"monday",icon:"monday.com",description:"Boards, items, and updates",config:{url:"https://mcp.monday.com/mcp"}},{name:"clickup",icon:"clickup.com",description:"Tasks, docs, and spaces",config:{url:"https://mcp.clickup.com/mcp"}},{name:"linear",icon:"linear.app",description:"Issues, projects, and cycles",config:{url:"https://mcp.linear.app/mcp"}},{name:"atlassian",icon:"atlassian.com",description:"Jira and Confluence",config:{url:"https://mcp.atlassian.com/v1/mcp"}},{name:"hubspot",icon:"hubspot.com",description:"Contacts, deals, and companies",config:{url:"https://app.hubspot.com/mcp/v1/http"}},{name:"attio",icon:"attio.com",description:"CRM records and lists",config:{url:"https://mcp.attio.com/mcp"}},{name:"intercom",icon:"intercom.com",description:"Conversations and support tickets",config:{url:"https://mcp.intercom.com/mcp"}},{name:"wix",icon:"wix.com",description:"Sites, stores, and bookings",config:{url:"https://mcp.wix.com/mcp"}},{name:"webflow",icon:"webflow.com",description:"Sites, pages, and CMS collections",config:{url:"https://mcp.webflow.com/mcp"}},{name:"sanity",icon:"sanity.io",description:"Structured content and datasets",config:{url:"https://mcp.sanity.io/mcp"}},{name:"stripe",icon:"stripe.com",description:"Payments, invoices, and customers",config:{url:"https://mcp.stripe.com"}},{name:"paypal",icon:"paypal.com",description:"Payments and orders",config:{url:"https://mcp.paypal.com/mcp"}},{name:"square",icon:"squareup.com",description:"Payments, catalog, and orders",config:{url:"https://mcp.squareup.com/mcp"}},{name:"ramp",icon:"ramp.com",description:"Spend, cards, and transactions",config:{url:"https://mcp.ramp.com/mcp"}},{name:"github",icon:"github.com",description:"Repos, issues, PRs — paste a personal access token",config:{url:"https://api.githubcopilot.com/mcp/",headers:{Authorization:"Bearer <your-github-pat>"}}},{name:"vercel",icon:"vercel.com",description:"Deployments and projects",config:{url:"https://mcp.vercel.com"}},{name:"netlify",icon:"netlify.com",description:"Sites, builds, and deploys",config:{url:"https://mcp.netlify.com/mcp"}},{name:"cloudflare",icon:"cloudflare.com",description:"Workers bindings — D1, R2, KV",config:{url:"https://bindings.mcp.cloudflare.com/mcp"}},{name:"supabase",icon:"supabase.com",description:"Projects, tables, and SQL",config:{url:"https://mcp.supabase.com/mcp"}},{name:"neon",icon:"neon.tech",description:"Postgres branches and queries",config:{url:"https://mcp.neon.tech/mcp"}},{name:"prisma",icon:"prisma.io",description:"Postgres databases and schema",config:{url:"https://mcp.prisma.io/mcp"}},{name:"sentry",icon:"sentry.io",description:"Errors and performance issues",config:{url:"https://mcp.sentry.dev/mcp"}},{name:"grafana",icon:"grafana.com",description:"Dashboards, metrics, and alerts",config:{url:"https://mcp.grafana.com/mcp"}},{name:"semgrep",icon:"semgrep.dev",description:"Scan code for security findings",config:{url:"https://mcp.semgrep.ai/mcp"}},{name:"postman",icon:"postman.com",description:"Collections, environments, and requests",config:{url:"https://mcp.postman.com/mcp"}},{name:"resend",icon:"resend.com",description:"Send email and manage audiences",config:{url:"https://mcp.resend.com/mcp"}},{name:"hugging-face",icon:"huggingface.co",description:"Models, datasets, and Spaces",config:{url:"https://huggingface.co/mcp"}},{name:"apify",icon:"apify.com",description:"Run scrapers and automation actors",config:{url:"https://mcp.apify.com"}},{name:"exa",icon:"exa.ai",description:"Web search for agents",config:{url:"https://mcp.exa.ai/mcp"}},{name:"kagi",icon:"kagi.com",description:"Search, summarize, and answer",config:{url:"https://mcp.kagi.com/mcp"}},{name:"context7",icon:"context7.com",description:"Up-to-date library docs",config:{url:"https://mcp.context7.com/mcp"}},{name:"deepwiki",icon:"deepwiki.com",description:"Ask questions about any GitHub repo",config:{url:"https://mcp.deepwiki.com/mcp"}},{name:"microsoft-learn",icon:"learn.microsoft.com",description:"Microsoft and Azure docs — no account",config:{url:"https://learn.microsoft.com/api/mcp"}},{name:"aws-knowledge",icon:"aws.amazon.com",description:"AWS docs and API references — no account",config:{url:"https://knowledge-mcp.global.api.aws"}},{name:"cloudflare-docs",icon:"developers.cloudflare.com",description:"Cloudflare docs — no account",config:{url:"https://docs.mcp.cloudflare.com/mcp"}},{name:"stack-overflow",icon:"stackoverflow.com",description:"Questions, answers, and teams",config:{url:"https://mcp.stackoverflow.com"}}];var V=a.i(619477),W=a.i(30681),X=a.i(313237),Y=a.i(759497);function Z({name:a,onDone:c}){let[d,e]=(0,o.useState)(""),{data:f,isLoading:g,error:h}=(0,Y.useServerRoute)(p.queryKey.mcpServer(a)),[i,k]=(0,X.useServerAction)(H,{...aj,onOk:b=>{aj.onOk(b),(0,Y.revalidate)(p.queryKey.mcpServer(a))}}),[l,n]=(0,X.useServerAction)(G,{okMessage:"Server deleted",onOk:()=>{c(),(0,Y.revalidate)(p.queryKey.mcp)}}),r=async()=>{await y.notify.confirm({title:`Delete ${a}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&l(a)};if(g)return(0,b.jsx)(V.SettingSkeleton,{rows:4});if(!f)return(0,b.jsx)(V.SettingDialogContent,{title:a,footer:(0,b.jsxs)(q.Button,{variant:"ghost",loading:n,onClick:r,className:"mr-auto text-destructive hover:text-destructive",children:[(0,b.jsx)(m.Trash2,{}),"Delete"]}),children:(0,b.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:h?(0,t.errorToString)(h):"This server could not be read."})});let s=f.tools.length,u=d.trim().toLowerCase(),v=u?f.tools.filter(a=>`${a.name} ${a.description??""}`.toLowerCase().includes(u)):f.tools,w=P(f.config)?"HTTP":"STDIO";return(0,b.jsxs)(V.SettingDialogContent,{title:f.name,description:(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,b.jsx)("span",{className:"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px]",children:w}),(0,b.jsx)("span",{className:"truncate font-mono",children:al(f.config)})]}),footer:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(q.Button,{variant:"ghost",loading:n,onClick:r,className:"mr-auto text-destructive hover:text-destructive",children:[(0,b.jsx)(m.Trash2,{}),"Delete"]}),(0,b.jsxs)(q.Button,{variant:"outline",loading:k,onClick:()=>i(f.name),children:[(0,b.jsx)(j,{}),"Reconnect"]})]}),children:[f.lastError&&(0,b.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:f.lastError}),(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(V.SettingFilter,{value:d,onChange:e,placeholder:"Filter tools"}),(0,b.jsxs)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:[s," ",1===s?"tool":"tools"]})]}),v.map(a=>(0,b.jsx)(aa,{tool:a,serverName:f.name},a.name)),0===v.length&&s>0&&(0,b.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"No tool here goes by that."})]})}function $({server:a}){let d=a.toolCount,f=a.lastError?"error":d>0?"connected":"idle";return(0,b.jsxs)("button",{type:"button",onClick:()=>{y.notify.component({className:"sm:max-w-3xl",renderer:({close:c})=>(0,b.jsx)(Z,{name:a.name,onDone:c})})},className:"group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,b.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",children:(0,b.jsx)(_,{server:a})}),(0,b.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,b.jsx)("span",{className:"truncate text-sm font-medium",children:a.name}),"connected"===f&&(0,b.jsx)(c.Check,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,b.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:"error"===f?(0,b.jsx)("span",{className:"text-destructive",children:a.lastError}):(0,b.jsxs)(b.Fragment,{children:[d>0?`${d} ${1===d?"tool":"tools"}`:"No tools yet",(0,b.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground/70",children:[" · ",al(a.config)]})]})})]}),(0,b.jsx)(e.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function _({server:a}){let c,d=(c=U.find(b=>P(b.config)?P(a.config)&&b.config.url.replace(/\/+$/,"")===a.config.url.replace(/\/+$/,""):!P(a.config)&&b.config.command===a.config.command&&(b.config.args??[]).join(" ")===(a.config.args??[]).join(" "))??U.find(b=>b.name===a.name),c?.icon);return d?(0,b.jsx)(z.SiteIcon,{host:d,className:"size-5",fallback:(0,b.jsx)(l,{className:"size-4"})}):(0,b.jsx)(l,{className:"size-4"})}function aa({tool:a,serverName:c}){let[f,g]=(0,o.useState)(!1),[h,i]=(0,o.useState)(!1),[j,k]=(0,o.useState)(!1),l=[["inputSchema",a.inputSchema],["outputSchema",a.outputSchema]].filter(([,a])=>a);return(0,b.jsxs)("div",{className:"rounded-xl border border-border/60 bg-background p-4",children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-sm",children:a.name}),l.length>0&&(0,b.jsxs)(q.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>g(!f),children:[f?(0,b.jsx)(d.ChevronDown,{}):(0,b.jsx)(e.ChevronRight,{}),"Schema"]}),(0,b.jsxs)(q.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>i(!h),children:[h?(0,b.jsx)(d.ChevronDown,{}):(0,b.jsx)(e.ChevronRight,{}),"Test"]})]}),a.description?(0,b.jsx)("p",{className:(0,t.cn)("mt-0.5 text-xs leading-relaxed text-muted-foreground",!j&&"line-clamp-2",a.description.length>140&&"cursor-pointer"),onClick:()=>k(!j),children:a.description}):null,f?(0,b.jsx)("div",{className:"mt-2 space-y-3 overflow-x-auto rounded-lg border border-input p-3",children:l.map(([a,c])=>(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("span",{className:"block font-mono text-xs text-muted-foreground",children:"inputSchema"===a?"in":"out"}),(0,b.jsx)("pre",{className:"font-mono text-xs leading-relaxed whitespace-pre",children:function a(b,c=0){if(!b||"object"!=typeof b)return"unknown";let d=" ".repeat(c+1),e=" ".repeat(c);if(Array.isArray(b.enum))return b.enum.map(a=>JSON.stringify(a)).join(" | ");let f=b.anyOf??b.oneOf;if(Array.isArray(f))return f.map(b=>a(b,c)).join(" | ");if("array"===b.type){let d=a(b.items,c);return/[|{]/.test(d)?`(${d})[]`:`${d}[]`}if("object"===b.type||b.properties){let f=b.properties;if(!f||0===Object.keys(f).length)return"{}";let g=b.required??[],h=Object.entries(f).map(([b,e])=>{let f=g.includes(b)?"":"?",h=e?.description,i="string"==typeof h&&h.length<=60?` // ${h}`:"";return`${d}${b}${f}: ${a(e,c+1)}${i}`});return`{
|
|
1
|
+
module.exports=[26444,a=>{"use strict";var b=a.i(187924),c=a.i(752562),d=a.i(589027),e=a.i(141146),f=a.i(738835),g=a.i(403512),h=a.i(164831);let i={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};i.node;let j=(0,h.default)(i),k={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};k.node;let l=(0,h.default)(k);var m=a.i(951675),n=a.i(474215),o=a.i(572131),p=a.i(767561),q=a.i(340695),r=a.i(316474),s=a.i(205522),t=a.i(497895);let u=(0,o.memo)(({data:a,name:c,initialExpandDepth:d=2})=>{let e=(0,o.useMemo)(()=>"string"==typeof a?function(a){let b=a.trim();if(!(b.startsWith("{")&&b.endsWith("}"))&&!(b.startsWith("[")&&b.endsWith("]")))return{success:!1,data:a};try{return{success:!0,data:JSON.parse(a)}}catch{return{success:!1,data:a}}}(a).data:a,[a]);return(0,b.jsx)("div",{className:"text-sm",children:(0,b.jsx)(x,{data:e,name:c,depth:0,initialExpandDepth:d})})});u.displayName="JsonView";let v=(a,b)=>({role:"button",tabIndex:0,"aria-expanded":a,onClick:b,onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&(a.preventDefault(),b())}}),w="outline-none focus-visible:ring-3 focus-visible:ring-ring/50",x=(0,o.memo)(({data:a,name:c,depth:d=0,initialExpandDepth:e})=>{var f;let g=void 0===a?"undefined":Array.isArray(a)?"array":null===a?"null":typeof a,[h,i]=(0,o.useState)("string"!==g&&d<e),j={number:"text-blue-500",boolean:"text-amber-500",null:"text-purple-500",undefined:"text-gray-500",string:"text-foreground break-all whitespace-pre-wrap",default:"text-muted-foreground"};switch(g){case"object":case"array":let k,l,m;return l=(k=(f="array"===g)?a:Object.entries(a)).length,m={open:f?"[":"{",close:f?"]":"}",collapsed:f?"[ ... ]":"{ ... }",empty:f?"[]":"{}"},0===l?(0,b.jsxs)("div",{className:"flex items-center",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:m.empty})]}):(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsxs)("div",{className:(0,t.cn)("flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30",w),...v(h,()=>i(!h)),children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[c,":"]}),h?(0,b.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:m.open}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:m.collapsed}),(0,b.jsxs)("span",{className:"ml-1 text-muted-foreground group-hover:text-foreground",children:[l," ",1===l?"item":"items"]})]})]}),h&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"pl-2 ml-4 border-l border-border",children:f?k.map((a,c)=>(0,b.jsx)("div",{className:"my-1",children:(0,b.jsx)(x,{data:a,name:`${c}`,depth:d+1,initialExpandDepth:e})},c)):k.map(([a,c])=>(0,b.jsx)("div",{className:"my-1",children:(0,b.jsx)(x,{data:c,name:a,depth:d+1,initialExpandDepth:e})},a))}),(0,b.jsx)("div",{className:"text-muted-foreground",children:m.close})]})]});case"string":return a.length>100?(0,b.jsxs)("div",{className:"flex mr-1 rounded group hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[c,":"]}),(0,b.jsx)("pre",{className:(0,t.cn)(j.string,"cursor-pointer group-hover:text-foreground",w),...v(h,()=>i(!h)),title:h?"Click to collapse":"Click to expand",children:h?`"${a}"`:`"${a.slice(0,100)}..."`})]}):(0,b.jsxs)("div",{className:"flex mr-1 rounded hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsxs)("pre",{className:j.string,children:['"',a,'"']})]});case"undefined":return(0,b.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsx)("span",{className:j.undefined,children:"undefined"})]});default:return(0,b.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsx)("span",{className:j[g]||j.default,children:null===a?"null":String(a)})]})}});x.displayName="JsonNode";var y=a.i(446181),z=a.i(341889),A=a.i(280281),B=a.i(621958),C=a.i(546893),D=a.i(864037),E=a.i(405050);let F=(0,E.createServerReference)("7f4b1193ee95397637f7a6fab56bdda82fc4b4b7ac",E.callServer,void 0,E.findSourceMapURL,"callToolAction"),G=(0,E.createServerReference)("7f4ef00dfa0ce5dad1f073de405da0e1b3f6fdb56b",E.callServer,void 0,E.findSourceMapURL,"deleteServerAction"),H=(0,E.createServerReference)("7f369fcbf18386b0897be1d901d8f6df8f58e41577",E.callServer,void 0,E.findSourceMapURL,"refreshServerAction"),I=(0,E.createServerReference)("7fa05e97f36d7952b6ddaf61739f0cc4508985df3c",E.callServer,void 0,E.findSourceMapURL,"registerServerAction");var J=a.i(954714),K=a.i(199169);let L=J.object({url:J.url(),headers:J.record(J.string(),J.string()).optional()}),M=J.object({command:J.string().min(1),args:J.array(J.string()).optional(),env:J.record(J.string(),J.string()).optional()}),N=J.union([L,M]),O=J.object({name:J.string(),description:J.string().optional(),inputSchema:J.looseObject({}).optional(),outputSchema:J.looseObject({}).optional()});function P(a){return"url"in a}J.object({clientInformation:J.looseObject({}).optional(),tokens:J.looseObject({}).optional(),authorizationServer:J.looseObject({}).optional(),codeVerifier:J.string().optional(),state:J.string().optional()});let Q=J.object({name:J.string().min(1).max(40),config:N,toolCount:J.number().int(),lastError:J.string().nullish()}),R=O.extend({id:J.number().int(),description:J.string().nullish()});Q.omit({toolCount:!0}).extend({tools:R.array().default([]),toolsSyncedAt:K.DateLikeSchema});let S=J.object({name:J.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:N}),T=J.union([J.object({mcpServers:J.record(J.string(),N)}),J.record(J.string(),N)]),U=[{name:"todoist",icon:"todoist.com",description:"Tasks, projects, and due dates",config:{url:"https://ai.todoist.net/mcp"}},{name:"home-assistant",icon:"home-assistant.io",description:"Lights, switches, and the rest of the house — your address and a long-lived token",config:{url:"http://homeassistant.local:8123/api/mcp",headers:{Authorization:"Bearer <your-home-assistant-token>"}}},{name:"kiwi",icon:"kiwi.com",description:"Flight search — no account",config:{url:"https://mcp.kiwi.com"}},{name:"zapier",icon:"zapier.com",description:"Gmail, Google Calendar, and thousands of apps you connect there",config:{url:"https://mcp.zapier.com/api/v1/connect"}},{name:"notion",icon:"notion.so",description:"Pages, databases, and search",config:{url:"https://mcp.notion.com/mcp"}},{name:"canva",icon:"canva.com",description:"Create and manage designs",config:{url:"https://mcp.canva.com/mcp"}},{name:"slack",icon:"slack.com",description:"Channels, messages, and search",config:{url:"https://mcp.slack.com/mcp"}},{name:"box",icon:"box.com",description:"Files, folders, and content search",config:{url:"https://mcp.box.com/mcp"}},{name:"airtable",icon:"airtable.com",description:"Bases, tables, and records",config:{url:"https://mcp.airtable.com/mcp"}},{name:"fireflies",icon:"fireflies.ai",description:"Meeting transcripts and summaries",config:{url:"https://mcp.fireflies.ai/mcp"}},{name:"asana",icon:"asana.com",description:"Tasks, projects, and portfolios",config:{url:"https://mcp.asana.com/mcp"}},{name:"monday",icon:"monday.com",description:"Boards, items, and updates",config:{url:"https://mcp.monday.com/mcp"}},{name:"clickup",icon:"clickup.com",description:"Tasks, docs, and spaces",config:{url:"https://mcp.clickup.com/mcp"}},{name:"linear",icon:"linear.app",description:"Issues, projects, and cycles",config:{url:"https://mcp.linear.app/mcp"}},{name:"atlassian",icon:"atlassian.com",description:"Jira and Confluence",config:{url:"https://mcp.atlassian.com/v1/mcp"}},{name:"hubspot",icon:"hubspot.com",description:"Contacts, deals, and companies",config:{url:"https://app.hubspot.com/mcp/v1/http"}},{name:"attio",icon:"attio.com",description:"CRM records and lists",config:{url:"https://mcp.attio.com/mcp"}},{name:"intercom",icon:"intercom.com",description:"Conversations and support tickets",config:{url:"https://mcp.intercom.com/mcp"}},{name:"wix",icon:"wix.com",description:"Sites, stores, and bookings",config:{url:"https://mcp.wix.com/mcp"}},{name:"webflow",icon:"webflow.com",description:"Sites, pages, and CMS collections",config:{url:"https://mcp.webflow.com/mcp"}},{name:"sanity",icon:"sanity.io",description:"Structured content and datasets",config:{url:"https://mcp.sanity.io/mcp"}},{name:"stripe",icon:"stripe.com",description:"Payments, invoices, and customers",config:{url:"https://mcp.stripe.com"}},{name:"paypal",icon:"paypal.com",description:"Payments and orders",config:{url:"https://mcp.paypal.com/mcp"}},{name:"square",icon:"squareup.com",description:"Payments, catalog, and orders",config:{url:"https://mcp.squareup.com/mcp"}},{name:"ramp",icon:"ramp.com",description:"Spend, cards, and transactions",config:{url:"https://mcp.ramp.com/mcp"}},{name:"github",icon:"github.com",description:"Repos, issues, PRs — paste a personal access token",config:{url:"https://api.githubcopilot.com/mcp/",headers:{Authorization:"Bearer <your-github-pat>"}}},{name:"vercel",icon:"vercel.com",description:"Deployments and projects",config:{url:"https://mcp.vercel.com"}},{name:"netlify",icon:"netlify.com",description:"Sites, builds, and deploys",config:{url:"https://mcp.netlify.com/mcp"}},{name:"cloudflare",icon:"cloudflare.com",description:"Workers bindings — D1, R2, KV",config:{url:"https://bindings.mcp.cloudflare.com/mcp"}},{name:"supabase",icon:"supabase.com",description:"Projects, tables, and SQL",config:{url:"https://mcp.supabase.com/mcp"}},{name:"neon",icon:"neon.tech",description:"Postgres branches and queries",config:{url:"https://mcp.neon.tech/mcp"}},{name:"prisma",icon:"prisma.io",description:"Postgres databases and schema",config:{url:"https://mcp.prisma.io/mcp"}},{name:"sentry",icon:"sentry.io",description:"Errors and performance issues",config:{url:"https://mcp.sentry.dev/mcp"}},{name:"grafana",icon:"grafana.com",description:"Dashboards, metrics, and alerts",config:{url:"https://mcp.grafana.com/mcp"}},{name:"semgrep",icon:"semgrep.dev",description:"Scan code for security findings",config:{url:"https://mcp.semgrep.ai/mcp"}},{name:"postman",icon:"postman.com",description:"Collections, environments, and requests",config:{url:"https://mcp.postman.com/mcp"}},{name:"resend",icon:"resend.com",description:"Send email and manage audiences",config:{url:"https://mcp.resend.com/mcp"}},{name:"hugging-face",icon:"huggingface.co",description:"Models, datasets, and Spaces",config:{url:"https://huggingface.co/mcp"}},{name:"apify",icon:"apify.com",description:"Run scrapers and automation actors",config:{url:"https://mcp.apify.com"}},{name:"exa",icon:"exa.ai",description:"Web search for agents",config:{url:"https://mcp.exa.ai/mcp"}},{name:"kagi",icon:"kagi.com",description:"Search, summarize, and answer",config:{url:"https://mcp.kagi.com/mcp"}},{name:"context7",icon:"context7.com",description:"Up-to-date library docs",config:{url:"https://mcp.context7.com/mcp"}},{name:"deepwiki",icon:"deepwiki.com",description:"Ask questions about any GitHub repo",config:{url:"https://mcp.deepwiki.com/mcp"}},{name:"microsoft-learn",icon:"learn.microsoft.com",description:"Microsoft and Azure docs — no account",config:{url:"https://learn.microsoft.com/api/mcp"}},{name:"aws-knowledge",icon:"aws.amazon.com",description:"AWS docs and API references — no account",config:{url:"https://knowledge-mcp.global.api.aws"}},{name:"cloudflare-docs",icon:"developers.cloudflare.com",description:"Cloudflare docs — no account",config:{url:"https://docs.mcp.cloudflare.com/mcp"}},{name:"stack-overflow",icon:"stackoverflow.com",description:"Questions, answers, and teams",config:{url:"https://mcp.stackoverflow.com"}}];var V=a.i(619477),W=a.i(30681),X=a.i(313237),Y=a.i(759497);function Z({name:a,onDone:c}){let[d,e]=(0,o.useState)(""),{data:f,isLoading:g,error:h}=(0,Y.useServerRoute)(p.queryKey.mcpServer(a)),[i,k]=(0,X.useServerAction)(H,{...aj,onOk:b=>{aj.onOk(b),(0,Y.revalidate)(p.queryKey.mcpServer(a))}}),[l,n]=(0,X.useServerAction)(G,{okMessage:"Server deleted",onOk:()=>{c(),(0,Y.revalidate)(p.queryKey.mcp)}}),r=async()=>{await y.notify.confirm({title:`Delete ${a}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&l(a)};if(g)return(0,b.jsx)(V.SettingSkeleton,{rows:4});if(!f)return(0,b.jsx)(V.SettingDialogContent,{title:a,footer:(0,b.jsxs)(q.Button,{variant:"ghost",loading:n,onClick:r,className:"mr-auto text-destructive hover:text-destructive",children:[(0,b.jsx)(m.Trash2,{}),"Delete"]}),children:(0,b.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:h?(0,t.errorToString)(h):"This server could not be read."})});let s=f.tools.length,u=d.trim().toLowerCase(),v=u?f.tools.filter(a=>`${a.name} ${a.description??""}`.toLowerCase().includes(u)):f.tools,w=P(f.config)?"HTTP":"STDIO";return(0,b.jsxs)(V.SettingDialogContent,{title:f.name,description:(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,b.jsx)("span",{className:"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px]",children:w}),(0,b.jsx)("span",{className:"truncate font-mono",children:al(f.config)})]}),footer:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(q.Button,{variant:"ghost",loading:n,onClick:r,className:"mr-auto text-destructive hover:text-destructive",children:[(0,b.jsx)(m.Trash2,{}),"Delete"]}),(0,b.jsxs)(q.Button,{variant:"outline",loading:k,onClick:()=>i(f.name),children:[(0,b.jsx)(j,{}),"Reconnect"]})]}),children:[f.lastError&&(0,b.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:f.lastError}),(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(V.SettingFilter,{value:d,onChange:e,placeholder:"Filter tools"}),(0,b.jsxs)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:[s," ",1===s?"tool":"tools"]})]}),v.map(a=>(0,b.jsx)(aa,{tool:a,serverName:f.name},a.name)),0===v.length&&s>0&&(0,b.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"No tool here goes by that."})]})}function $({server:a}){let d=a.toolCount,f=a.lastError?"error":d>0?"connected":"idle";return(0,b.jsxs)("button",{type:"button",onClick:()=>{y.notify.component({className:"sm:max-w-3xl",renderer:({close:c})=>(0,b.jsx)(Z,{name:a.name,onDone:c})})},className:"group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,b.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",children:(0,b.jsx)(_,{server:a})}),(0,b.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,b.jsx)("span",{className:"truncate text-sm font-medium",children:a.name}),"connected"===f&&(0,b.jsx)(c.Check,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,b.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:"error"===f?(0,b.jsx)("span",{className:"text-destructive",children:a.lastError}):(0,b.jsxs)(b.Fragment,{children:[d>0?`${d} ${1===d?"tool":"tools"}`:"No tools yet",(0,b.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground",children:[" · ",al(a.config)]})]})})]}),(0,b.jsx)(e.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function _({server:a}){let c,d=(c=U.find(b=>P(b.config)?P(a.config)&&b.config.url.replace(/\/+$/,"")===a.config.url.replace(/\/+$/,""):!P(a.config)&&b.config.command===a.config.command&&(b.config.args??[]).join(" ")===(a.config.args??[]).join(" "))??U.find(b=>b.name===a.name),c?.icon);return d?(0,b.jsx)(z.SiteIcon,{host:d,className:"size-5",fallback:(0,b.jsx)(l,{className:"size-4"})}):(0,b.jsx)(l,{className:"size-4"})}function aa({tool:a,serverName:c}){let[f,g]=(0,o.useState)(!1),[h,i]=(0,o.useState)(!1),[j,k]=(0,o.useState)(!1),l=[["inputSchema",a.inputSchema],["outputSchema",a.outputSchema]].filter(([,a])=>a);return(0,b.jsxs)("div",{className:"rounded-xl border border-border/60 bg-background p-4",children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-sm",children:a.name}),l.length>0&&(0,b.jsxs)(q.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>g(!f),children:[f?(0,b.jsx)(d.ChevronDown,{}):(0,b.jsx)(e.ChevronRight,{}),"Schema"]}),(0,b.jsxs)(q.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>i(!h),children:[h?(0,b.jsx)(d.ChevronDown,{}):(0,b.jsx)(e.ChevronRight,{}),"Test"]})]}),a.description?(0,b.jsx)("p",{className:(0,t.cn)("mt-0.5 text-xs leading-relaxed text-muted-foreground",!j&&"line-clamp-2",a.description.length>140&&"cursor-pointer"),onClick:()=>k(!j),children:a.description}):null,f?(0,b.jsx)("div",{className:"mt-2 space-y-3 overflow-x-auto rounded-lg border border-input p-3",children:l.map(([a,c])=>(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("span",{className:"block font-mono text-xs text-muted-foreground",children:"inputSchema"===a?"in":"out"}),(0,b.jsx)("pre",{className:"font-mono text-xs leading-relaxed whitespace-pre",children:function a(b,c=0){if(!b||"object"!=typeof b)return"unknown";let d=" ".repeat(c+1),e=" ".repeat(c);if(Array.isArray(b.enum))return b.enum.map(a=>JSON.stringify(a)).join(" | ");let f=b.anyOf??b.oneOf;if(Array.isArray(f))return f.map(b=>a(b,c)).join(" | ");if("array"===b.type){let d=a(b.items,c);return/[|{]/.test(d)?`(${d})[]`:`${d}[]`}if("object"===b.type||b.properties){let f=b.properties;if(!f||0===Object.keys(f).length)return"{}";let g=b.required??[],h=Object.entries(f).map(([b,e])=>{let f=g.includes(b)?"":"?",h=e?.description,i="string"==typeof h&&h.length<=60?` // ${h}`:"";return`${d}${b}${f}: ${a(e,c+1)}${i}`});return`{
|
|
2
2
|
${h.join("\n")}
|
|
3
3
|
${e}}`}return Array.isArray(b.type)?b.type.join(" | "):"string"==typeof b.type?b.type:"unknown"}(c)})]},a))}):null,h?(0,b.jsx)(ab,{tool:a,serverName:c}):null]})}function ab({tool:a,serverName:c}){let[d,e]=(0,o.useState)(()=>(function(a){let b=a.inputSchema?.properties;if(!b||"object"!=typeof b)return"{}";let c={};for(let[a,d]of Object.entries(b))c[a]=d?.type==="number"||d?.type==="integer"?0:d?.type!=="boolean"&&(d?.type==="array"?[]:d?.type==="object"?{}:"");return JSON.stringify(c,null,2)})(a)),[g,h]=(0,o.useState)(""),[i,j,k,l,m]=(0,X.useServerAction)(F,{errorMessage:!1});return(0,b.jsxs)("div",{className:"mt-2 space-y-2 rounded-lg border border-input p-3",children:[(0,b.jsx)(C.Textarea,{value:d,onChange:a=>e(a.target.value),spellCheck:!1,className:"min-h-24 resize-none font-mono text-xs"}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsx)("span",{className:"font-mono text-xs text-destructive",children:g||l}),(0,b.jsxs)(q.Button,{size:"sm",loading:j,onClick:()=>{let b;try{b=d.trim()?JSON.parse(d):void 0}catch{h("Not valid JSON");return}h(""),m(),i(c,a.name,b)},children:[!j&&(0,b.jsx)(f.Play,{}),"Run"]})]}),void 0!==k&&(0,b.jsx)("div",{className:"overflow-x-auto rounded-lg bg-muted/40 p-3",children:(0,b.jsx)(u,{data:k,initialExpandDepth:3})})]})}function ac(a){return y.notify.component({className:"sm:max-w-lg",renderer:({close:c})=>(0,b.jsx)(ad,{initial:a,onDone:c})})}function ad({initial:a,onDone:c}){let d=a&&P(a.config)?a.config:void 0,e=a&&!P(a.config)?a.config:void 0,[f,g]=(0,W.useObjectState)({mode:e?"stdio":"http",name:a?.name??"",url:d?.url??"",headers:ag(d?.headers),command:e?.command??"",args:(e?.args??[]).join(" "),env:ag(e?.env),raw:""}),{mode:h,name:i,url:j,headers:k,command:l,args:m,env:n,raw:p}=f,[t,u]=(0,X.useServerAction)(I,{...aj,onOk:a=>{aj.onOk(a),"error"!==a.status&&c()}}),v=(0,o.useMemo)(()=>{var a,b,c,d,e;let f,g;return"json"===h?function(a){let b,c=a.trim();if(!c)return{value:null,error:""};try{b=JSON.parse(c)}catch{return{value:null,error:"Not valid JSON"}}let d=N.safeParse(b);if(d.success)return{value:{name:null,config:d.data},error:""};let e=T.safeParse(b);if(!e.success)return{value:null,error:"Needs a url or a command"};let f=Object.entries("mcpServers"in e.data?e.data.mcpServers:e.data)[0];return f?{value:{name:f[0],config:f[1]},error:""}:{value:null,error:"No server in there"}}(p):"http"===h?(a=j,b=k,(f=L.safeParse({url:a.trim(),headers:ah(b)})).success?{value:{name:null,config:f.data},error:""}:{value:null,error:a.trim()?"Needs a valid url":""}):(c=l,d=m,e=n,(g=M.safeParse({command:c.trim(),args:d.split(/\s+/).filter(Boolean),env:ah(e)})).success?{value:{name:null,config:g.data},error:""}:{value:null,error:c.trim()?"Needs a command":""})},[h,p,j,k,l,m,n]),w="json"===h?p:JSON.stringify([h,j,k,l,m,n]),[x,y]=(0,o.useState)(w);(0,o.useEffect)(()=>{let a=setTimeout(()=>y(w),700);return()=>clearTimeout(a)},[w]);let z=x===w?v.error:"",D=i||v.value?.name||"",E=S.safeParse({name:D,config:v.value?.config});function F(a){let b=v.value?.config;return b?"json"===a?g({mode:a,raw:JSON.stringify(b,null,2)}):"http"===a&&P(b)?g({mode:a,url:b.url,headers:ag(b.headers)}):"stdio"!==a||P(b)?void g({mode:a}):g({mode:a,command:b.command,args:(b.args??[]).join(" "),env:ag(b.env)}):g({mode:a})}let G=(0,b.jsxs)("span",{className:"flex items-center gap-2 font-mono text-xs text-muted-foreground",children:["JSON",(0,b.jsx)(A.Switch,{size:"sm",checked:"json"===h,onCheckedChange:a=>{let b;return a?F("json"):void F((b=v.value?.config)&&!P(b)?"stdio":"http")}})]});return(0,b.jsx)(V.SettingDialogContent,{title:"Add MCP server",description:"Its tools become available to every bot.",footer:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(q.Button,{variant:"ghost",onClick:c,children:"Cancel"}),(0,b.jsx)(q.Button,{disabled:!E.success,loading:u,onClick:()=>{E.success&&!u&&t(E.data)},children:"Connect"})]}),children:(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)(r.Field,{children:[(0,b.jsx)(r.FieldLabel,{children:"Name"}),(0,b.jsx)(s.Input,{value:D,onChange:a=>g({name:a.target.value}),placeholder:"notion",spellCheck:!1})]}),"json"===h?(0,b.jsxs)(r.Field,{children:[(0,b.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,b.jsx)(r.FieldLabel,{children:"JSON"}),G]}),(0,b.jsx)(C.Textarea,{value:p,onChange:a=>g({raw:a.target.value}),spellCheck:!1,placeholder:ai,className:"min-h-64 resize-none font-mono text-xs"})]}):(0,b.jsxs)(B.Tabs,{value:h,onValueChange:a=>F(a),className:"gap-6",children:[(0,b.jsxs)(r.Field,{children:[(0,b.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,b.jsx)(r.FieldLabel,{children:"Transport"}),G]}),(0,b.jsxs)(B.TabsList,{className:"w-full",children:[(0,b.jsx)(B.TabsTrigger,{value:"http",children:"HTTP"}),(0,b.jsx)(B.TabsTrigger,{value:"stdio",children:"STDIO"})]})]}),(0,b.jsxs)(B.TabsContent,{value:"http",className:"space-y-6",children:[(0,b.jsxs)(r.Field,{children:[(0,b.jsx)(r.FieldLabel,{children:"URL"}),(0,b.jsx)(s.Input,{value:j,onChange:a=>g({url:a.target.value}),placeholder:"https://mcp.notion.com/mcp",spellCheck:!1,className:"font-mono text-xs"})]}),(0,b.jsx)(ae,{label:"Headers",pairs:k,onChange:a=>g({headers:a}),keyPlaceholder:"Authorization",valuePlaceholder:"Bearer sk-..."})]}),(0,b.jsxs)(B.TabsContent,{value:"stdio",className:"space-y-6",children:[(0,b.jsxs)(r.Field,{children:[(0,b.jsx)(r.FieldLabel,{children:"Command"}),(0,b.jsx)(s.Input,{value:l,onChange:a=>g({command:a.target.value}),placeholder:"npx",spellCheck:!1,className:"font-mono text-xs"})]}),(0,b.jsxs)(r.Field,{children:[(0,b.jsx)(r.FieldLabel,{children:"Args"}),(0,b.jsx)(s.Input,{value:m,onChange:a=>g({args:a.target.value}),placeholder:"-y @notionhq/notion-mcp-server",spellCheck:!1,className:"font-mono text-xs"})]}),(0,b.jsx)(ae,{label:"Env",pairs:n,onChange:a=>g({env:a}),keyPlaceholder:"NOTION_TOKEN",valuePlaceholder:"ntn_..."})]})]}),z&&(0,b.jsx)("p",{className:"font-mono text-xs text-destructive",children:z})]})})}function ae({label:a,pairs:c,onChange:d,keyPlaceholder:e,valuePlaceholder:f}){let h=(a,b)=>d(c.map(c=>c.id===a?{...c,...b}:c));return(0,b.jsxs)(r.Field,{children:[(0,b.jsx)(r.FieldLabel,{children:a}),(0,b.jsxs)("div",{className:"space-y-2",children:[c.map(a=>(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(s.Input,{value:a.key,onChange:b=>h(a.id,{key:b.target.value}),placeholder:e,spellCheck:!1,className:"font-mono text-xs"}),(0,b.jsx)(s.Input,{value:a.value,onChange:b=>h(a.id,{value:b.target.value}),placeholder:f,spellCheck:!1,className:"font-mono text-xs"}),(0,b.jsx)(q.Button,{variant:"ghost",size:"icon","aria-label":"Remove this row",onClick:()=>d(c.filter(b=>b.id!==a.id)),children:(0,b.jsx)(n.X,{})})]},a.id)),(0,b.jsxs)(q.Button,{variant:"outline",size:"sm",onClick:()=>d([...c,af()]),children:[(0,b.jsx)(g.Plus,{}),"Add"]})]})]})}let af=(a="",b="")=>({id:crypto.randomUUID(),key:a,value:b}),ag=a=>Object.entries(a??{}).map(([a,b])=>af(a,b)),ah=a=>{let b=a.filter(a=>a.key.trim());if(b.length)return Object.fromEntries(b.map(a=>[a.key.trim(),a.value]))},ai=`/** STDIO Example */
|
|
4
4
|
{
|