thursday-agent 0.22.0 → 0.23.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 +3 -3
- package/.next/prerender-manifest.json +4 -4
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +12 -12
- package/.next/server/app/_not-found.segments/_full.segment.rsc +12 -12
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +11 -11
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/artifact/route.js +6 -6
- package/.next/server/app/api/artifact/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/files/route.js +5 -4
- package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/route.js +9 -9
- package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/route.js +9 -9
- package/.next/server/app/api/bot/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/thread/[id]/route.js +2 -2
- package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/thread/file/route.js +12 -12
- package/.next/server/app/api/bot/thread/file/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/thread/route.js +2 -2
- package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
- package/.next/server/app/api/config/route.js +2 -2
- package/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/server/app/api/events/route.js.nft.json +1 -1
- package/.next/server/app/api/favicon/[host]/route.js.nft.json +1 -1
- package/.next/server/app/api/file/[...path]/route.js +3 -3
- package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
- 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.nft.json +1 -1
- package/.next/server/app/api/llm-model/credits/[provider]/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/oauth/callback/route.js +2 -2
- package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/edit/route.js +13 -13
- package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/route.js +1 -1
- package/.next/server/app/api/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/reach/route.js +11 -11
- package/.next/server/app/api/reach/route.js.nft.json +1 -1
- package/.next/server/app/api/routine/route.js +9 -9
- package/.next/server/app/api/routine/route.js.nft.json +1 -1
- package/.next/server/app/api/running/route.js.nft.json +1 -1
- package/.next/server/app/api/signins/route.js +7 -6
- package/.next/server/app/api/signins/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/[source]/[name]/route.js +8 -8
- package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/route.js +8 -8
- package/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/call/end/route.js +6 -6
- package/.next/server/app/api/thursday/call/end/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/call/plan/route.js +16 -16
- 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 +6 -6
- package/.next/server/app/api/thursday/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/text/route.js +16 -16
- package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/tool-call/route.js +10 -10
- package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/files/route.js +1 -1
- package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/route.js +1 -1
- package/.next/server/app/api/workspace/route.js.nft.json +1 -1
- package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +11 -11
- package/.next/server/app/artifact/[...path]/page.js +5 -5
- package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
- package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/.next/server/app/page/react-loadable-manifest.json +2 -2
- package/.next/server/app/page/server-reference-manifest.json +162 -162
- package/.next/server/app/page.js +7 -7
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__019e1fy._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__01jpmcj._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__03bjojd._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__03vunn6._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__06kxzw-._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0atwstu._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__005onk_._.js → [root-of-the-server]__0cfv4rq._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0d-dfqm._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1-i6lgn._.js → [root-of-the-server]__0d00o4_._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0itmdqy._.js → [root-of-the-server]__0e8y4ok._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1tyftcr._.js → [root-of-the-server]__0eem_66._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0xn7a8p._.js → [root-of-the-server]__0jn2qbf._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__08922kg._.js → [root-of-the-server]__0l563r8._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0mh1tgg._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0mq0qmk._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ncs9uu._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1a7rgvy._.js → [root-of-the-server]__0pp2355._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1g08s7l._.js → [root-of-the-server]__0r77huw._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__10_v9ml._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__13hng6h._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1478lu3._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__16xao_p._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__17kdjf6._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__17m7ag9._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__17yv6lg._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__19aqyg-._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__19imprr._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__1ceammd._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1fhule0._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1hing45._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0mttntm._.js → [root-of-the-server]__1ivfglf._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1jcu_e9._.js +5 -0
- package/.next/server/chunks/{[root-of-the-server]__0m0qglo._.js → [root-of-the-server]__1kb-dkn._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0eluax8._.js → [root-of-the-server]__1mowvzz._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1ndi14y._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1o7z93z._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1onvx8x._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1q_d6dj._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1u_6dhy._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1_wtn0q._.js → [root-of-the-server]__1yiqjfx._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1yr_vvq._.js +3 -0
- package/.next/server/chunks/_0-mqt2w._.js +3 -0
- package/.next/server/chunks/_0-qt5if._.js +1 -1
- package/.next/server/chunks/{_0fau3ya._.js → _00aztuo._.js} +2 -2
- package/.next/server/chunks/_021kabv._.js +53 -0
- package/.next/server/chunks/_032k4m6._.js +3 -0
- package/.next/server/chunks/_03p6r2-._.js +1 -1
- package/.next/server/chunks/_06b5b4-._.js +2 -2
- package/.next/server/chunks/_06u9yo-._.js +1 -1
- package/.next/server/chunks/_07mczew._.js +3 -0
- package/.next/server/chunks/_07pkeds._.js +1 -1
- package/.next/server/chunks/_08354bn._.js +22 -22
- package/.next/server/chunks/_083t_nr._.js +5 -0
- package/.next/server/chunks/_0c-s0ei._.js +3 -0
- package/.next/server/chunks/_0cq69mm._.js +1 -1
- package/.next/server/chunks/_0gifi_2._.js +7 -0
- package/.next/server/chunks/_0gxz_1b._.js +1 -1
- package/.next/server/chunks/{_1tjwvoz._.js → _0la8s6t._.js} +2 -2
- package/.next/server/chunks/_0p27in2._.js +1 -1
- package/.next/server/chunks/{_09rtyfn._.js → _0rn3c_0._.js} +24 -26
- package/.next/server/chunks/_0ue8nq-._.js +5 -1
- package/.next/server/chunks/{_1uu4wjr._.js → _0wkhub3._.js} +2 -2
- package/.next/server/chunks/_0wyh244._.js +22 -22
- package/.next/server/chunks/_0ynjnhl._.js +5 -0
- package/.next/server/chunks/_1-wp0r0._.js +1 -1
- package/.next/server/chunks/{_201k0ah._.js → _12-7atf._.js} +2 -2
- package/.next/server/chunks/{_02mn8d7._.js → _124q1p2._.js} +2 -2
- package/.next/server/chunks/{_14xuq46._.js → _13qoxq9._.js} +24 -26
- package/.next/server/chunks/{_11y8h29._.js → _15-_mie._.js} +2 -2
- package/.next/server/chunks/_1823_7a._.js +1 -1
- package/.next/server/chunks/{_0uir6hb._.js → _186uku9._.js} +2 -2
- package/.next/server/chunks/{_0ggqpiz._.js → _18sj4xf._.js} +2 -2
- package/.next/server/chunks/_19kea1l._.js +12 -12
- package/.next/server/chunks/_1ac33qw._.js +2 -2
- package/.next/server/chunks/{_18z965x._.js → _1chy-lk._.js} +2 -2
- package/.next/server/chunks/_1cw6-rv._.js +1 -1
- package/.next/server/chunks/_1evvnbp._.js +1 -1
- package/.next/server/chunks/_1f_x75d._.js +3 -0
- package/.next/server/chunks/_1gn2r2q._.js +7 -9
- package/.next/server/chunks/_1icgbi8._.js +1 -1
- package/.next/server/chunks/{_1ozcb6o._.js → _1k6bmez._.js} +2 -2
- package/.next/server/chunks/_1ko5shz._.js +1 -1
- package/.next/server/chunks/_1ksyu6r._.js +1 -1
- package/.next/server/chunks/_1kwmzab._.js +3 -0
- package/.next/server/chunks/_1lg0lsu._.js +1 -1
- package/.next/server/chunks/_1pv6xbq._.js +5 -0
- package/.next/server/chunks/_1q42187._.js +2 -2
- package/.next/server/chunks/_1q6e56i._.js +7 -9
- package/.next/server/chunks/_1t43w6q._.js +1 -1
- package/.next/server/chunks/_1t8fv7b._.js +1 -1
- package/.next/server/chunks/_1ufbxe1._.js +1 -1
- package/.next/server/chunks/_1wgae1c._.js +1 -1
- package/.next/server/chunks/_1xps4ob._.js +1 -1
- package/.next/server/chunks/_1znrlca._.js +3 -0
- 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 +2 -2
- package/.next/server/chunks/features_bot_1d6ghh5._.js +41 -0
- package/.next/server/chunks/features_bot_1dfrdsb._.js +10 -6
- package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0yd5xa0._.js → node_modules_consola_dist_chunks_prompt_mjs_0k--vqs._.js} +1 -1
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0ufuc3s._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__05qiosr._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0y03pu0._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0zt_au4._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__0eloa6y._.js → [root-of-the-server]__17yeveo._.js} +5 -5
- package/.next/server/chunks/ssr/[root-of-the-server]__1867koj._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1t38-p_._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1u42eh0._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__203utm3._.js +1 -1
- package/.next/server/chunks/ssr/{_0xurp8n._.js → _0-s7ria._.js} +2 -2
- package/.next/server/chunks/ssr/_03vw3u5._.js +3 -0
- package/.next/server/chunks/ssr/_088qe9a._.js +162 -0
- package/.next/server/chunks/ssr/_09a6bpd._.js +1 -1
- package/.next/server/chunks/ssr/{_0u43zjx._.js → _0a_pedm._.js} +2 -2
- package/.next/server/chunks/ssr/_0ali_i8._.js +3 -0
- package/.next/server/chunks/ssr/_0cd6g3l._.js +3 -3
- package/.next/server/chunks/ssr/{_1nwey7a._.js → _0eprrig._.js} +2 -2
- package/.next/server/chunks/ssr/_0flnog5._.js +3 -0
- package/.next/server/chunks/ssr/_0iuvjnw._.js +1 -1
- package/.next/server/chunks/ssr/{_0t_e9rd._.js → _0k-gl8l._.js} +2 -2
- package/.next/server/chunks/ssr/_0kmldic._.js +41 -0
- package/.next/server/chunks/ssr/_0ks03l-._.js +3 -0
- package/.next/server/chunks/ssr/_0mng-y8._.js +6 -0
- package/.next/server/chunks/ssr/_0tg3o37._.js +1 -1
- package/.next/server/chunks/ssr/_0ugzm_0._.js +3 -0
- package/.next/server/chunks/ssr/{_0ntol64._.js → _0wnv6c0._.js} +2 -2
- package/.next/server/chunks/ssr/{_0-y08rv._.js → _0z9zkd-._.js} +2 -2
- package/.next/server/chunks/ssr/_11l9kc0._.js +1 -1
- package/.next/server/chunks/ssr/_12_ail7._.js +3 -0
- package/.next/server/chunks/ssr/_16_7zeo._.js +1 -1
- package/.next/server/chunks/ssr/_16wjbs2._.js +3 -0
- package/.next/server/chunks/ssr/{_16o81mn._.js → _18rmqqu._.js} +2 -2
- package/.next/server/chunks/ssr/_1bfrntd._.js +2 -2
- package/.next/server/chunks/ssr/{_0gn_i4s._.js → _1ckje8g._.js} +2 -2
- package/.next/server/chunks/ssr/_1crszf7._.js +1 -1
- package/.next/server/chunks/ssr/_1h3qetc._.js +3 -0
- package/.next/server/chunks/ssr/{_1gz4ov7._.js → _1kpvfmn._.js} +3 -3
- package/.next/server/chunks/ssr/{_12hdw8x._.js → _1l-3enz._.js} +26 -28
- package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
- package/.next/server/chunks/ssr/_1soynbw._.js +2 -2
- package/.next/server/chunks/ssr/{_0ux4i2m._.js → _1v1pcoh._.js} +2 -2
- package/.next/server/chunks/ssr/features_ai_components_model-picker_tsx_0ucb1y9._.js +1 -1
- package/.next/server/chunks/ssr/{features_bot_06n7hmd._.js → features_bot_0-7flc-._.js} +2 -2
- package/.next/server/chunks/ssr/features_bot_0tb4ui-._.js +1 -1
- package/.next/server/chunks/ssr/features_bot_1stfytf._.js +41 -0
- package/.next/server/chunks/ssr/features_config_10xs4l1._.js +20 -0
- package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
- package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
- package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
- package/.next/server/chunks/ssr/features_thursday_0cf9y0b._.js +1 -1
- package/.next/server/chunks/ssr/features_thursday_components_here-globe_tsx_055duhw._.js +1 -1
- package/.next/server/chunks/ssr/lib_utils_ts_0_f1xvm._.js +1 -1
- package/.next/server/chunks/ssr/{node_modules_1i-g3bz._.js → node_modules_00mh9o-._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1bvw77g._.js → node_modules_04f_uw2._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_16tn8xu._.js → node_modules_07udd3z._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0ksqeyy._.js → node_modules_08-pj-2._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0e398ts._.js → node_modules_098h6h5._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_19r9vjv._.js → node_modules_0_7yfem._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_01v7ybp._.js → node_modules_0ayoorn._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0_zk6yd._.js → node_modules_0bp3vfu._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0m-dnm-._.js → node_modules_0ch5hqr._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0536cp2._.js → node_modules_0e-hyim._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0yn2z6s._.js → node_modules_0ffm9w3._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1jf8aik._.js → node_modules_0jzyuwk._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0m2oth3._.js → node_modules_0ln4iwf._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1dlue-g._.js → node_modules_0my2hph._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0cpegwf._.js → node_modules_0y_k4h5._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_13dwal5._.js → node_modules_10bzndo._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1ctm_ju._.js → node_modules_1b5rxw5._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_01fukqn._.js → node_modules_1b_h09q._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_12hh0bx._.js → node_modules_1e83j9e._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_08m1gvh._.js → node_modules_1e9ugfy._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_06n6ruk._.js → node_modules_1hd66k0._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1zdz2zf._.js → node_modules_1inwr2m._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1zalmtr._.js → node_modules_1j9xx1k._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1kfbdfo._.js → node_modules_1k8kypa._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_056xgci._.js → node_modules_1oeu85h._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0ie8g6a._.js → node_modules_1r2ghv5._.js} +2 -2
- package/.next/server/chunks/ssr/{node_modules_1fqgrh0._.js → node_modules_1ttpnib._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0nj1l8f._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0ir6p7s._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_17ok98u._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1ejf5ye._.js} +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +163 -163
- package/.next/static/chunks/02lze_e5sagjn.js +1 -0
- package/.next/static/chunks/{3866u-edsoyj3.js → 081kl7k8r6f8z.js} +1 -1
- package/.next/static/chunks/0_s4z70lx1tgs.js +1 -0
- package/.next/static/chunks/0fklfoj8o_msg.js +18 -0
- package/.next/static/chunks/0ve2gb0hw3wkq.js +1 -0
- package/.next/static/chunks/11c3uijgqik4m.js +39 -0
- package/.next/static/chunks/{0go5_9zqag7l0.js → 125lh2zzxk3r2.js} +1 -1
- package/.next/static/chunks/{3zv4wiqjl5kex.js → 166v36614ycsf.js} +1 -1
- package/.next/static/chunks/16np6727e61io.js +1 -0
- package/.next/static/chunks/18amidjlaqexf.js +1 -0
- package/.next/static/chunks/{35ehi-okrfot5.js → 1ettmta9iet7b.js} +1 -1
- package/.next/static/chunks/{1dy5xaxjdsy11.js → 1j4rndg17wgfk.js} +1 -1
- package/.next/static/chunks/{01r1uco3ikisc.js → 1mpz4epyg-7pz.js} +1 -1
- package/.next/static/chunks/{05blzta_1i7c2.js → 1oh4hbusfz97l.js} +1 -1
- package/.next/static/chunks/{3qfhjwd9yuijo.js → 1x1-44qmhu437.js} +1 -1
- package/.next/static/chunks/{0hpx0--bh7vld.js → 22jb4s3-8ckup.js} +1 -1
- package/.next/static/chunks/236le5kv_yj6a.css +1 -0
- package/.next/static/chunks/24op50z6sqi_5.js +1 -0
- package/.next/static/chunks/2eczs-lporqt6.js +1 -0
- package/.next/static/chunks/{2nbj2t9yp8ke9.js → 2sxclirl-c-um.js} +1 -1
- package/.next/static/chunks/2yfmmo4qr_f-m.js +1 -0
- package/.next/static/chunks/2z4sodeldj_86.js +1 -0
- package/.next/static/chunks/{3tyacy8fh5_18.js → 2zhiqxw61qowv.js} +2 -2
- package/.next/static/chunks/338dt83llhu5m.js +1 -0
- package/.next/static/chunks/3ezjz93yvzmop.js +4 -0
- package/.next/static/chunks/3h6rqjx92wva9.js +1 -0
- package/.next/static/chunks/3ph9u-51x6jhe.js +15 -0
- package/.next/static/chunks/{052u13mcoxt87.js → 3uf32hp_g9stz.js} +1 -1
- package/.next/static/chunks/3w7zt3xzyjn86.js +3 -0
- package/.next/static/chunks/3xkx7vqefm7on.js +2 -0
- package/.next/static/chunks/3ygk41pgsw7nv.js +1 -0
- package/.next/static/chunks/{3146sccz1j76i.js → 411uyd0is9u5s.js} +1 -1
- package/.next/static/chunks/4384atd5zerir.js +1 -0
- package/README.md +1 -1
- package/database/migrations/20260929121448_thread_started_by/migration.sql +1 -0
- package/database/migrations/20260929121448_thread_started_by/snapshot.json +1969 -0
- package/guide/bots.md +89 -44
- package/guide/calls.md +41 -25
- package/guide/index.md +5 -2
- package/guide/phone.md +7 -4
- package/guide/setup.md +12 -6
- package/guide/trouble.md +3 -2
- package/package.json +1 -1
- package/public/voices/intro/mic-b17ca82d.ogg +0 -0
- package/seed-skills/concierge/travel/SKILL.md +2 -1
- package/seed-skills/concierge/travel/page/itinerary.css +1009 -257
- package/seed-skills/concierge/travel/references/itinerary.md +95 -35
- package/seed-skills/concierge/travel/references/plan.md +11 -4
- package/seed-skills/concierge/travel/scripts/itinerary.mjs +754 -138
- package/skills/README.md +7 -4
- package/skills/artifact/SKILL.md +17 -13
- package/skills/artifact/references/canvas.md +4 -5
- package/skills/artifact/references/deck.md +93 -2
- package/skills/artifact/runtime/app/kit/src/index.css +35 -0
- package/skills/artifact/runtime/app/kit/tailwind.config.js +6 -0
- package/skills/artifact/runtime/deck/data.mjs +21 -0
- package/skills/artifact/runtime/deck/deck.css +254 -4
- package/skills/artifact/runtime/deck/deck.html +3 -0
- package/skills/artifact/runtime/deck/deck.js +88 -5
- package/skills/artifact/runtime/deck/deck.mjs +1 -17
- package/skills/artifact/runtime/document/quick.css +264 -89
- package/skills/artifact/runtime/document/quick.html +16 -7
- package/skills/artifact/runtime/document/quick.js +377 -98
- package/skills/artifact/runtime/render.mjs +52 -6
- package/skills/artifact/runtime/sheet/sheet.css +29 -21
- package/skills/artifact/runtime/shell/drafts.js +25 -0
- package/skills/artifact/runtime/shell/fonts/Geist-latin-ext.woff2 +0 -0
- package/skills/artifact/runtime/shell/fonts/Geist-latin.woff2 +0 -0
- package/skills/artifact/runtime/shell/fonts/GeistMono-latin-ext.woff2 +0 -0
- package/skills/artifact/runtime/shell/fonts/GeistMono-latin.woff2 +0 -0
- package/skills/artifact/runtime/shell/fonts/OFL.txt +93 -0
- package/skills/artifact/runtime/shell/head.html +27 -2
- package/skills/artifact/runtime/shell/shell.css +88 -8
- package/skills/artifact/runtime/shell/shell.js +318 -22
- package/skills/artifact/runtime/shell/wear.mjs +114 -12
- package/skills/artifact/scripts/app.mjs +5 -0
- package/skills/artifact/scripts/chart.mjs +20 -19
- package/skills/artifact/scripts/deck.mjs +276 -0
- package/skills/artifact/scripts/document.mjs +55 -2
- package/skills/artifact/scripts/media.mjs +1 -1
- package/skills/artifact/templates/boards/direction.html +55 -2
- package/skills/browser/SKILL.md +1 -1
- package/skills/browser/references/scripts.md +1 -1
- package/skills/daily-brief/SKILL.md +2 -0
- package/skills/daily-brief/page/brief.css +460 -302
- package/skills/daily-brief/references/brief.md +33 -7
- package/skills/daily-brief/scripts/page.mjs +241 -48
- package/skills/media-digest/SKILL.md +1 -0
- package/skills/media-digest/scripts/digest.mjs +57 -43
- package/.next/server/chunks/[root-of-the-server]__00f051a._.js +0 -7
- package/.next/server/chunks/[root-of-the-server]__0340k46._.js +0 -7
- package/.next/server/chunks/[root-of-the-server]__0ndw2yj._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__16y0k92._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__18e65_-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1a0xgyh._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__1dth047._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__1huywqp._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__1ij4h2a._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1q1s4ls._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1qa67zs._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1t-mfa4._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__20ofm9t._.js +0 -3
- package/.next/server/chunks/_0483t_f._.js +0 -5
- package/.next/server/chunks/_0lcthk8._.js +0 -3
- package/.next/server/chunks/_0uv1gs1._.js +0 -3
- package/.next/server/chunks/_17fjc-7._.js +0 -5
- package/.next/server/chunks/_1dcbwn-._.js +0 -3
- package/.next/server/chunks/_1mgzs18._.js +0 -3
- package/.next/server/chunks/_20qn224._.js +0 -3
- package/.next/server/chunks/features_bot_0zy_q8y._.js +0 -37
- package/.next/server/chunks/ssr/[root-of-the-server]__04upd5v._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0dy20eb._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0yyxgt2._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__14j8gxy._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__20t_4l2._.js +0 -3
- package/.next/server/chunks/ssr/_00buy3i._.js +0 -162
- package/.next/server/chunks/ssr/_014_wjp._.js +0 -3
- package/.next/server/chunks/ssr/_07m4ii5._.js +0 -3
- package/.next/server/chunks/ssr/_0cv9tmv._.js +0 -3
- package/.next/server/chunks/ssr/_0j6rtjm._.js +0 -6
- package/.next/server/chunks/ssr/_0ogkeu-._.js +0 -3
- package/.next/server/chunks/ssr/_10sc7ab._.js +0 -3
- package/.next/server/chunks/ssr/_14nwim3._.js +0 -37
- package/.next/server/chunks/ssr/_1e01b-_._.js +0 -3
- package/.next/server/chunks/ssr/_1nfv27b._.js +0 -3
- package/.next/server/chunks/ssr/features_bot_1c56lew._.js +0 -37
- package/.next/server/chunks/ssr/features_bot_1knyan7._.js +0 -3
- package/.next/server/chunks/ssr/features_config_09wq1s9._.js +0 -20
- package/.next/static/chunks/01gkq9y6_xk4a.js +0 -1
- package/.next/static/chunks/09kwsjbmr_z1w.js +0 -1
- package/.next/static/chunks/0ynv7zu_bguve.js +0 -1
- package/.next/static/chunks/0zi59tghmg1lu.js +0 -18
- package/.next/static/chunks/1_ftsgxa-sia_.js +0 -1
- package/.next/static/chunks/1cg3torc90q5t.js +0 -1
- package/.next/static/chunks/1qnx1h5c8f93b.js +0 -1
- package/.next/static/chunks/1rwn3d9ji5w35.js +0 -1
- package/.next/static/chunks/1so3f5fi7e5g9.js +0 -35
- package/.next/static/chunks/1ya41wxfmp4s8.js +0 -1
- package/.next/static/chunks/27rwkfu7_xvs1.js +0 -4
- package/.next/static/chunks/2hueh8masqd91.js +0 -15
- package/.next/static/chunks/2jrt_752fqz2f.js +0 -1
- package/.next/static/chunks/2ogme4qydxnaq.js +0 -3
- package/.next/static/chunks/2r2tocw2rpvm2.js +0 -1
- package/.next/static/chunks/2t4kimg1lt-p7.js +0 -2
- package/.next/static/chunks/2w6y71o27my_z.js +0 -1
- package/.next/static/chunks/31_am8rtmk_tv.css +0 -1
- package/.next/static/chunks/337g9g_ux2gj-.js +0 -1
- package/public/voices/intro/heard-1f12cd45.ogg +0 -0
- package/public/voices/intro/mic-e561372a.ogg +0 -0
- package/skills/artifact/references/book.md +0 -163
- package/skills/artifact/runtime/book/book.css +0 -256
- package/skills/artifact/runtime/book/book.html +0 -38
- package/skills/artifact/runtime/book/book.js +0 -81
- package/skills/artifact/scripts/book-pdf.mjs +0 -73
- package/skills/artifact/scripts/book-video.mjs +0 -168
- package/skills/artifact/scripts/book.mjs +0 -291
- /package/.next/static/{8exfHAtcoebYtxjUC4ugl → 6tIYlzfG_5P4sIxxgmucO}/_buildManifest.js +0 -0
- /package/.next/static/{8exfHAtcoebYtxjUC4ugl → 6tIYlzfG_5P4sIxxgmucO}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{8exfHAtcoebYtxjUC4ugl → 6tIYlzfG_5P4sIxxgmucO}/_ssgManifest.js +0 -0
- /package/seed-skills/{marketer → writer}/marketing/LICENSE +0 -0
- /package/seed-skills/{marketer → writer}/marketing/SKILL.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/copywriting-copy-frameworks.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/copywriting-natural-transitions.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/copywriting.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/emails-copy-guidelines.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/emails-email-types.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/emails-sequence-templates.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/emails.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/launch.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/product-marketing.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/seo-audit-ai-writing-detection.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/seo-audit-international-seo.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/seo-audit.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/social-carousel-frameworks.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/social-platform-limits.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/social-platforms.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/social-post-templates.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/social-reverse-engineering.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/social-short-form-video.md +0 -0
- /package/seed-skills/{marketer → writer}/marketing/references/social.md +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
module.exports=[221214,a=>a.a(async(b,c)=>{try{a.i(666680);var d=a.i(258261),e=a.i(93321),f=a.i(351674),g=a.i(203469),h=a.i(569572),i=a.i(184838),j=a.i(714428),k=a.i(725466),l=a.i(821415),m=a.i(293480),n=a.i(446957);a.i(636616),a.i(466497);var o=b([i,k]);[i,k]=o.then?(await o)():o;let D=a=>({name:a.name,description:a.description,ownLine:a.ownLine?.line??null,systemPrompt:a.systemPrompt,icon:a.icon,provider:a.provider,model:a.model,disabled:a.disabled,compactAt:a.compactAt,effort:a.effort});async function p(){let a=await i.database.select().from(j.botTable).orderBy(j.botTable.createdAt);return a.length?a.filter(a=>!a.disabled).map(D):[n.DEFAULT_BOT]}async function q(a){let b=await t(a);if(b)return D(b);let c=a.trim().toLowerCase(),[d]=await i.database.select().from(j.botTable).where((0,e.eq)(f.sql`lower(${j.botTable.name})`,c));if(d)return D(d);if(n.DEFAULT_BOT.name.toLowerCase()!==c)return null;let[g]=await i.database.select({name:j.botTable.name}).from(j.botTable).limit(1);return g?null:n.DEFAULT_BOT}async function r(){return(0,n.isBotMemoryOn)(await (0,k.readConfig)(n.BOT_MEMORY_KEY))}async function s(a){await (0,k.writeConfig)(n.BOT_MEMORY_KEY,a?"on":"off")}async function t(a){let[b]=await i.database.select().from(j.botTable).where((0,e.eq)(j.botTable.name,a));return b??null}async function u(a){let b=await t(a);return!b||b.descriptionLocked?null:{line:b.ownLine?.line??null}}async function v(a,b,c){let d=await t(a);if(!d||d.descriptionLocked)return;let f=d.ownLine?.line??null;return f===b||(await i.database.update(j.botTable).set({ownLine:{line:b,reason:c,at:Date.now()}}).where((0,e.eq)(j.botTable.name,d.name)),g.appEvents.emit({type:"bots"})),{was:f}}async function w(a){return(await i.database.update(j.botTable).set({ownLine:null}).where((0,e.eq)(j.botTable.name,a)).returning({name:j.botTable.name})).length>0}async function x(){let[{total:a}]=await i.database.select({total:(0,d.count)()}).from(j.botTable);return a}async function y(){let a=await i.database.select({name:j.botTable.name}).from(j.botTable);return[...new Set([...a.map(a=>a.name),n.DEFAULT_BOT.name])]}async function z(a){let b=(0,l.botFolderName)(a.name).toLowerCase(),c=await i.database.select({name:j.botTable.name}).from(j.botTable);if(c.some(a=>(0,l.botFolderName)(a.name).toLowerCase()===b))return null;c.length>=h.BOT_ROSTER.max&&(0,m.publicError)(`There are already ${h.BOT_ROSTER.max} bots. Delete one to make another.`);let{toolIds:d,...e}=(0,n.pickedModel)(a),[f]=await i.database.insert(j.botTable).values(e).returning();return d?.length&&await B(f.name,d),f}async function A(a,b){let{toolIds:c,...d}="provider"in b||"model"in b?(0,n.pickedModel)(b):b;delete d.name;let[f]=Object.keys(d).length?await i.database.update(j.botTable).set(d).where((0,e.eq)(j.botTable.name,a)).returning():await i.database.select().from(j.botTable).where((0,e.eq)(j.botTable.name,a));return f?(c&&await B(a,c),f):null}async function B(a,b){if(await i.database.delete(j.botMcpToolTable).where((0,e.eq)(j.botMcpToolTable.botName,a)),0===b.length)return;let c=await i.database.select({id:j.mcpToolTable.id}).from(j.mcpToolTable).where((0,e.inArray)(j.mcpToolTable.id,b));0!==c.length&&await i.database.insert(j.botMcpToolTable).values(c.map(({id:b})=>({botName:a,toolId:b})))}async function C(a){return(await i.database.delete(j.botTable).where((0,e.eq)(j.botTable.name,a)).returning({name:j.botTable.name})).length>0}a.s(["clearOwnLine",0,w,"countBots",0,x,"createBot",0,z,"deleteBot",0,C,"findJobBot",0,q,"listBotNames",0,y,"listJobBots",0,p,"ownLineOf",0,u,"readBotMemoryOn",0,r,"updateBot",0,A,"writeBotMemoryOn",0,s,"writeOwnLine",0,v]),c()}catch(a){c(a)}},!1),466497,a=>{"use strict";var b=a.i(666680);let c={Analyst:["2ecfa3bc73c72f027ec35f3c0a9484e4eb6a481acf6692ce1f8003f9f6fa45e0","42b09da7559494b0bdd475c947fb9d185706e8ccaf75875d64cffe496175aa27","5efcd3baeaf8597f66206da925ac1c32ca397198c554c5674dbf367752a7f49e","7fe705163e387936fb1c2c7e74b6fabbdeb4c20baa6a79b59f8754ea947f65fd","99a16fca83539629b01ec4eabca96c239da7f2104810eda9b4a7b866ac7a6e7f","9ad27da4b3e31445c6d5e9f756e2335f18db002a436a1fe379db5c1d816509ec","a34d00a7c55924d29751fbe00add8add48c18cdf9e2defbdc7d5d30dc53833ea","a804cc98c41152743d6a30c426d5446b29d9959dd96c0fa3ec29f78de2a8d556","ac4cb54a355704d05a007af2fd7c883db941db0ca0fb594aafcc1f7acf8a9038","b461b7e117bcd6a16fe0312e61bcd93a05a079898252400c4109e575b197b20e"],Concierge:["0702d68f06738940f98ed6cfbab41715e87590fb5af1466fd30d6aec47270fd0","a7b3aa7f71319fc4884bca24b00fcb05c4e552824ac97ecfdd14be0409e77ce6"],Designer:["41f33cca88277e694d851c30aad3feadbf298db5865d55addbb9c099e2c31c46","bc38b9ebdb47b1997276a8c01540f75ee630ee9e62476b1cf28cbcc14a8a79e6"],Jarvis:["51bf694bcd2f55f283f24dae6210c9a18c69fb2c44beacbda0b925f798e8ea35","80bf400fb3e2572cb6c4f101577f6f4d44fcd711f4c3330a75de2a7a81795cdc","c8ea86b600576cce7e97bc0e249bd13c779a1ef6598bdaa7a75556ef35b80e7b","d4af22b54f71da38146f15b1ea465362c411634485eb80c80e08fb845068f22d","d911d8abf3d2d252e3556026b8bc258027342c017d1a065f056a3e0c7d4d794a"],Tutor:["1761c048db262a2864d3cd6e3d338f52a370b65efd9f61555970008defd66277","341a3aa83a61e767d66e3ec3daf17f80d5ebe462f0342665cfcc2afa37b56fda","e2da41b01905031d1bb1e246c81bfa4c36a6efc14dd58a1e03a977d47941d72b","eacf69e58573b8414fb0936ea0aa7e3d6290a53c4e8dd2a562252bf0352cbadc"]},d={Marketer:["48ac45457c2f1756e0adc439478e94cdd314b535ba8d84eba6b3a043119b5f55","6e0bf4b5821da96d9ee080bb5981191fc2584e7f90027cdd86d5d5073c5a15eb","845e74d57daf14c00a5b47ee73b7094cecd13756721b46ff6e31980ba72efe36","b610e11935754fd46387cb28b1b1e72b971c6e7f91f3cda56085709321f23aa3","b8880b433456f5d66821575f463b8bef3bb9652c6f752886577486f709461340","b8cf680316e888d1192471c6ef103381adbcb32731fb38badc08a4cf49e940ca","d532807b2e69bce7836b005e18b5f78437c5c44dabc7839b45f6e2549866da3a"]};a.s(["wasSeedRole",0,function(a,e){let f=(0,b.createHash)("sha256").update(e.trim()).digest("hex");return!!(c[a]?.includes(f)||d[a]?.includes(f))}])},636616,a=>{"use strict";var b=a.i(569572),c=a.i(762008),d=a.i(446957),e=a.i(62721);let f=[{name:d.DEFAULT_BOT.name,description:d.DEFAULT_BOT.description,hint:"Takes whatever nobody else is for",systemPrompt:"",icon:d.DEFAULT_BOT_ICON},{name:"Analyst",description:"Finds out and answers with sources — what things cost, how numbers moved, which one to pick",hint:"Finds out, cites, and lays it out",icon:{color:e.MARK_INK.violet,shape:"squircle"},systemPrompt:`Questions answered by finding out are yours — what something costs, how a figure moved and why, which to pick, whether to buy now or wait — and the answer is only as good as where it came from.
|
|
2
|
+
|
|
3
|
+
**Answer first.** Whoever asked reads your first lines and may stop there, so they hold the answer and the two or three facts behind it. A title says the finding, not the topic. A few facts are your final text and nothing more; more than that is one page in your folder under \`artifacts/\`, every figure with where it came from — or a sheet, when the figures are their own to keep and go on with.
|
|
4
|
+
|
|
5
|
+
**From the source, never from memory.** A number comes from where it is published, a claim from the text that makes it, with the moment it is said; two sources that disagree, a figure you could not confirm, a page you could not read are said beside the answer, not smoothed over. A number you derive shows its arithmetic; an estimate is a range.
|
|
6
|
+
|
|
7
|
+
**What you keep.** The currency they think in, the sources they trust, what they already own and are weighing — dated, so the next job starts from it.`},{name:"Curator",description:"Keeps them up to date — a morning news brief, a video, podcast, talk or article summed up",hint:"Brings what is worth their time",icon:{color:e.MARK_INK.emerald,shape:"blob"},systemPrompt:`Keeping up is yours — the brief on the topics they follow, and anything long they point you at, a video, a podcast, a talk, an article, a PDF, handed back short — so they spend minutes on what would take them an hour.
|
|
8
|
+
|
|
9
|
+
**Their time is the point.** Lead with what changed and what matters to them; cut what they would skip. Every point links to where it is said: a story to its publisher, a moment to its timestamp.
|
|
10
|
+
|
|
11
|
+
**Never from memory.** A headline, a quote, a figure comes from the page or the transcript you read, with when. A story you could not open, or a video with no words to read, is said, not summed up from its title.
|
|
12
|
+
|
|
13
|
+
**What you keep.** The topics they follow and the ones they skip, the sources they trust, how long a brief they read and in which language — dated, so the next brief starts from it.`},{name:"Concierge",description:"Handles trips and errands — flights, stays, bookings, orders and forms, up to the step that pays",hint:"Takes errands to the last step",icon:{color:e.MARK_INK.sky,shape:"poly"},systemPrompt:`Trips and errands out in the world are yours — a trip planned day by day, flights and stays found and compared, a booking, an order, a reservation, a form filled — each taken as far as it goes before the step that pays or signs, which is theirs. A trip has a skill of your own, \`${b.TRAVEL_SKILL}\`: load it before any step of one.
|
|
14
|
+
|
|
15
|
+
**Real prices, real dates.** A fare, a price, an opening time comes from the page you read, with when; one you could not reach is said, never guessed. Finding them is part of the errand and yours, not a question to hand on. A choice they make by looking — a room, a place, a thing to buy — comes with its picture.
|
|
16
|
+
|
|
17
|
+
**Ready to act.** The answer says what is waiting for them, where, and what it costs, so the one step left is theirs.
|
|
18
|
+
|
|
19
|
+
**What you keep.** Where they travel from and with whom, the seats and rooms they like, the programs they collect with, where things are sent — dated, so the next errand starts from it.`},{name:"Designer",description:"Makes what gets looked at — design options side by side, slide decks, posters, short films",hint:"Draws the options to pick from",icon:{paint:"rainbow",shape:"heart"},systemPrompt:`Anything that has to be looked at is yours — a screen or a page to choose between, a deck to present, a post at the size it will be shown, a poster, a short film for a birthday or a thank-you, a document someone reads. You build it in \`${b.ARTIFACT_SKILL}\` (a canvas of options side by side or anything at its exact size, a document): load it before any step. It starts from ready boards and outlines and shoots what you made itself; writing the HTML from nothing instead costs you those and the check. A deck is \`${c.TOOL_NAMES.make_deck}\`, which draws its slides and shoots them itself; a page someone uses rather than reads — a tool, a small app — is in \`${b.ARTIFACT_SKILL}\` too, with steps of its own, and so is a short film: one film made for the one it is for, never options.
|
|
20
|
+
|
|
21
|
+
**Offer a real choice.** Two to four options, each exploring an axis you can name — everything at once against one thing at a time, dense against roomy — never five shades of one. Every option gets an honest case and the thing it costs; mark the one you would carry forward. Once an option is B it stays B, whatever is dropped before it.
|
|
22
|
+
|
|
23
|
+
**Root it in what is already there.** When the job names something that exists — a product, a site, its code, a brand, a file you were given — read it first and lift its exact colours, type, spacing and control sizes rather than inventing a look; say in one line what you matched. A screen you cannot open is asked for as a picture.
|
|
24
|
+
|
|
25
|
+
**The pictures are how you check your own work.** Look at what was shot, fix what the renderer refuses or the canvas marks as cut, shoot once more: two rounds at most.
|
|
26
|
+
|
|
27
|
+
**What you keep.** The brand's colours, type and spacing, and the direction they chose, so the next thing you draw starts from it.`},{name:"Tutor",description:"Explains anything simply — a picture at a time, read aloud if asked, a study guide, a diagram",hint:"Explains anything, a picture at a time",icon:{color:e.MARK_INK.yellow,shape:"blob"},systemPrompt:`Explaining is yours — anything someone wants to understand, told so that a person who knows nothing about it follows every step. Load \`${b.ARTIFACT_SKILL}\` before any step. What they asked for is what you make; when they did not say, it is slides that explain the way a picture book does, one picture and a line or two a slide, made with \`${c.TOOL_NAMES.make_deck}\` in your folder under \`artifacts/\` — not a question. A PDF of them, or a video that reads them aloud, is made from the same deck when they ask; a one-page guide to study from, and a diagram of how something works, are in \`${b.ARTIFACT_SKILL}\` too.
|
|
28
|
+
|
|
29
|
+
**Simple, never wrong.** Read what you explain from where it is stated before the first slide. A picture that simplifies still shows how it really works; a comparison that would mislead is left out. A new word comes after the picture that shows it, never before.
|
|
30
|
+
|
|
31
|
+
**What you keep.** What the user already knows and how they liked being taught — the level, a picture style, how many slides — dated, so the next lesson starts where they are.`},{name:"Writer",description:"Writes what goes out in their name — mail replies, letters, posts, page copy, a launch plan",hint:"Drafts it in their voice, ready to send",icon:{color:e.MARK_INK.pink,shape:"poly"},systemPrompt:`Anything written for someone else to read is yours — their mail read and answered, a letter, a post, page copy, a launch plan — and it ends as the thing itself, ready to send, paste or post: a draft where it will be sent from, or a file in your folder under \`artifacts/\`. Marketing a product has a skill of your own, \`${b.MARKETING_SKILL}\`, with the method for its positioning, page copy, launch, social posts, email sequences and SEO audit: load it before any step of one.
|
|
32
|
+
|
|
33
|
+
**Their mail.** A connected mail service is the quick way in; without one, their mail is open in their own browser. Read what came since you last looked, tell what needs an answer from what is only to know, and leave each answer as a draft in their mailbox. Sending is theirs unless they told you to send: work they asked to have mailed, to them or to someone they named, goes out, and your answer says where it went.
|
|
34
|
+
|
|
35
|
+
**Their voice, not yours.** Read what they wrote before — the thread you answer, a post of theirs — and write the way they do. A name, a date or a figure you were not given is a visible blank, never a plausible one.
|
|
36
|
+
|
|
37
|
+
**Ground every claim.** Competitors, prices, search terms and what people say about the problem come from pages you opened, with the link beside them. What you could not check is marked as a guess.
|
|
38
|
+
|
|
39
|
+
**What you keep.** How they write and sign off, who they write to and how, one brief per product — dated, so the next job starts from it.`}];a.s(["findBotSeed",0,a=>f.find(b=>b.name===a)??null])}];
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=features_bot_1stfytf._.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
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(607396),m=m,n=a.i(71215),o=a.i(126766),p=a.i(233540),q=a.i(26268),r=a.i(572131),s=a.i(767561),t=a.i(340695),u=a.i(205522),v=a.i(446181),w=a.i(630342),x=a.i(341889),y=a.i(950463),z=a.i(287702),A=a.i(852307),B=a.i(908531),C=a.i(608902),D=a.i(379630),E=a.i(61876),F=a.i(913834),G=a.i(249049),H=a.i(51992),I=a.i(564117),J=a.i(478978),K=a.i(585650),L=a.i(168370),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),am=a.i(405050);let an=(0,am.createServerReference)("7f465a3a44bbc30aaf06fc1756bccae6300f78f6e8",am.callServer,void 0,am.findSourceMapURL,"forgetReachAction");var ao=a.i(907602);let ap={telegram:"telegram.org",discord:"discord.com",slack:"slack.com"},aq=`display_information:
|
|
2
|
+
name: Thursday
|
|
3
|
+
features:
|
|
4
|
+
app_home:
|
|
5
|
+
messages_tab_enabled: true
|
|
6
|
+
messages_tab_read_only_enabled: false
|
|
7
|
+
bot_user:
|
|
8
|
+
display_name: Thursday
|
|
9
|
+
oauth_config:
|
|
10
|
+
scopes:
|
|
11
|
+
bot: [chat:write, im:history, im:read, users:read, files:read, files:write]
|
|
12
|
+
settings:
|
|
13
|
+
event_subscriptions:
|
|
14
|
+
bot_events: [message.im]
|
|
15
|
+
interactivity:
|
|
16
|
+
is_enabled: true
|
|
17
|
+
socket_mode_enabled: true
|
|
18
|
+
`,ar=({children:a})=>(0,c.jsx)("span",{className:"font-medium text-foreground",children:a}),as={telegram:[{body:(0,c.jsxs)(c.Fragment,{children:["In Telegram, write to ",(0,c.jsx)(ar,{children:"@BotFather"}),", send ",(0,c.jsx)(ar,{children:"/newbot"})," and pick a name. It answers with a ",(0,c.jsx)(ar,{children:"token"}),"."]}),slot:{open:"https://t.me/BotFather",label:"Open @BotFather"}},{body:(0,c.jsx)(c.Fragment,{children:"Paste the token here."}),slot:{key:ao.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)(ar,{children:"Allow"})," if your phone shows the same code."]})}],discord:[{body:(0,c.jsxs)(c.Fragment,{children:["At ",(0,c.jsx)(ar,{children:"discord.com/developers"}),", make a ",(0,c.jsx)(ar,{children:"New Application"}),". So nobody else can add it to a server, set ",(0,c.jsx)(ar,{children:"Install Link"})," to"," ",(0,c.jsx)(ar,{children:"None"})," on its ",(0,c.jsx)(ar,{children:"Installation"})," page and turn off"," ",(0,c.jsx)(ar,{children:"Public Bot"})," on its ",(0,c.jsx)(ar,{children:"Bot"})," page. There, press"," ",(0,c.jsx)(ar,{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:ao.DISCORD_TOKEN_KEY,looks:"MTE…"}},{body:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(ar,{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)(ar,{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)(ar,{children:"Message"}),". A question with a code appears here: press ",(0,c.jsx)(ar,{children:"Allow"})," if your phone shows the same code."]})}],slack:[{body:(0,c.jsxs)(c.Fragment,{children:["At ",(0,c.jsx)(({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}),{href:"https://api.slack.com/apps",children:"api.slack.com/apps"}),","," ",(0,c.jsx)(ar,{children:"Create New App › From a manifest"}),", and paste the manifest."]}),slot:{manifest:!0}},{body:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(ar,{children:"Basic Information › App-Level Tokens"}),": generate one with"," ",(0,c.jsx)(ar,{children:"connections:write"}),". It starts with xapp-."]}),slot:{key:ao.SLACK_APP_TOKEN_KEY,looks:"xapp-…"}},{body:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(ar,{children:"Install App"})," to your workspace. The Bot User OAuth Token starts with xoxb-."]}),slot:{key:ao.SLACK_BOT_TOKEN_KEY,looks:"xoxb-…"}},{body:(0,c.jsxs)(c.Fragment,{children:["In Slack, open the app under ",(0,c.jsx)(ar,{children:"Apps"})," and write in its"," ",(0,c.jsx)(ar,{children:"Messages"})," tab. A question with a code appears here: press"," ",(0,c.jsx)(ar,{children:"Allow"})," if Slack shows the same code."]})}]};function at(){let a=(0,ak.useServerRoute)(s.queryKey.config),b=(0,ak.useServerRoute)(s.queryKey.reach);(0,ag.useAppEvent)({reach:()=>void(0,ak.revalidate)(s.queryKey.reach)});let d=b=>(0,J.isConfigSet)(a.data,b),e=b=>(0,J.isConfigUnreadable)(a.data,b),f=a=>b.data?.channels.find(b=>b.name===a)??null,g=a=>!!f(a)?.allowed,h=ao.REACH_CHANNELS.find(a=>f(a)?.refused||ao.REACH_KEYS[a].some(e)),i=ao.REACH_CHANNELS.find(a=>ao.REACH_KEYS[a].every(d)&&!g(a)),j=!ao.REACH_CHANNELS.some(g),[k,l]=(0,r.useState)(h??i??(j?ao.REACH_CHANNELS[0]:null));return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)(ai.SettingItems,{children:ao.REACH_CHANNELS.map(a=>(0,c.jsx)(au,{name:a,status:f(a),tokensIn:ao.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, and only direct messages are read. Work started here runs whether or not a tab is open, while Thursday is running on this computer."})]})}function au({name:a,status:b,tokensIn:d,isSet:e,isLost:f,open:g,onOpen:h}){var j;let k,l,m,n,p=as[a],q=b?.refused??null,r=(j={connected:!!b?.bot,allowed:!!b?.allowed,refused:q},k=p.map(a=>a.slot&&"key"in a.slot?a.slot.key:null),l=a=>!e(a)||a===j.refused,m=k.findIndex(a=>a&&l(a)),n=k.reduce((a,b,c)=>b?c:a,-1),p.map((a,b)=>{let c=k[b];return c?l(c)?b===m?"now":"later":"done":m>=0?b<m?j.refused?"done":"flat":"later":j.allowed||b<n?"done":j.connected?"now":"flat"})),s=!!b?.bot&&!b?.allowed&&!q;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:[(0,c.jsx)(x.SiteIcon,{host:ap[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:ao.REACH_LABEL[a]}),(0,c.jsx)("span",{className:"min-w-0 flex-1 truncate",children:(0,c.jsx)(av,{status:b,tokensIn:d,tokens:ao.REACH_KEYS[a].length,lost:ao.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:p.map((a,d)=>(0,c.jsx)(aw,{n:d+1,step:a,state:r[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===q?b?.problem??"":a.slot&&"key"in a.slot&&f(a.slot.key)?(0,J.lostWords)("The token saved here","Paste it again."):null,link:b?.link??null,waiting:s&&d===p.length-1},d))}),b?.allowed&&(0,c.jsx)(aE,{name:a,who:b.allowed.name,stopped:!!q})]})]})}function av({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 — ",ao.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 aw({n:a,step:b,state:d,set:e,lost:f,refused:g,link:h,waiting:i}){return(0,c.jsxs)("li",{className:"flex gap-3 text-[13px] leading-relaxed",children:[(0,c.jsx)(ax,{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)(ay,{slot:b.slot,state:d,set:e,lost:f,refused:g,link:h,waiting:i})]})]})}function ax({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 ay({slot:a,state:b,set:d,lost:e,refused:f,link:g,waiting:h}){let i=h&&(0,c.jsx)(ah.ShinyText,{text:"Waiting for your first message…",tone:"waiting"});return"later"===b?null:a&&"key"in a?(0,c.jsx)(aC,{configKey:a.key,looks:a.looks,set:d,lost:e,refused:f}):"done"===b?a&&"says"in a&&g?(0,c.jsx)(aB,{href:g,children:a.does??aA(g)}):null:a?"open"in a?(0,c.jsx)(aB,{href:a.open,children:a.label}):"manifest"in a?(0,c.jsx)(aD,{}):g?(0,c.jsxs)("div",{className:"space-y-2.5",children:[(0,c.jsx)(az,{link:g,says:a.says,does:a.does}),i]}):i||null:i||null}function az({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=aA(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)(aB,{href:a,children:d??g})]})]})}let aA=a=>a.replace(/^https:\/\//,"");function aB({href:a,children:b}){return(0,c.jsxs)("a",{href:a,target:"_blank",rel:"noreferrer",className:(0,al.cn)((0,t.buttonVariants)({variant:"outline",size:"sm"})),children:[(0,c.jsx)(L.ExternalLink,{}),b]})}function aC({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,ak.useServerRoute)(s.queryKey.config),l=(0,J.isConfigFromEnv)(k,a),m=()=>{h(""),j(!1),(0,ak.revalidate)(s.queryKey.config),(0,ak.revalidate)(s.queryKey.reach)},[n,o]=(0,aj.useServerAction)(I.setConfigAction,{onOk:m}),[p,q]=(0,aj.useServerAction)(H.removeConfigAction,{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,J.envWords)(J.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 aD(){let[a,b]=(0,r.useState)(!1);return(0,c.jsxs)(t.Button,{size:"sm",variant:"outline",onClick:()=>void navigator.clipboard.writeText(aq).then(()=>{b(!0),setTimeout(()=>b(!1),2e3)}),children:[a?(0,c.jsx)(h.Check,{}):(0,c.jsx)(K.Copy,{}),a?"Copied":"Copy the manifest"]})}function aE({name:a,who:b,stopped:d}){let[e,f]=(0,aj.useServerAction)(an,{onOk:()=>(0,ak.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 aF={[J.EXA_API_KEY]:p.Search},aG={image:n.Image,video:l,speech:f.AudioLines,transcription:g.Captions},aH={keys:["voice","easy","text","search"],models:["bots","studio"]};function aI({screen:a}){let{data:b,isLoading:d,error:e}=(0,ak.useServerRoute)(s.queryKey.config),f=(0,G.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,J.isConfigSet)(b,a),h=a=>(0,J.isConfigUnreadable)(b,a),i=a=>(0,J.isConfigFromEnv)(b,a),j=a=>(0,J.groupSatisfied)(a,a.id===J.VOICE_GROUP_ID?f.countsForCall:g),k=a=>b?.find(b=>b.key===a)?.value,l=aH[a].flatMap(a=>J.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)(aK,{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)(aL,{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)(aJ,{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)(aW,{entry:b,choices:b.choices,value:k(b.key),effort:aX(a,b.key),effortValue:k(J.DEFAULT_EFFORT_KEY)},b.key):(0,c.jsx)(aL,{entry:b,set:g(b.key),lost:h(b.key),env:i(b.key)},b.key))})},a.id))})}function aJ({entry:a,set:b,lost:d,env:e}){return(0,c.jsxs)("button",{type:"button",onClick:()=>aZ(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)(aV,{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,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 aK({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)(q.TriangleAlert,{className:"size-3"}),a.note??"Required"]})}function aL({entry:a,set:b,lost:d,env:e,card:f=!1,narrow:g=!1}){let j=aO(a,b),k=aQ(a,b),l=aP(a,b),m=k.data?aR(k.data):aN(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)(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)(aY,{entry:d,onDone:a})})):aZ(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)(aV,{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)(aT,{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?aS(k.data)??"signed in":"sign in with your account":a.key}),a.signIn&&b&&k.data&&(0,c.jsx)(aU,{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 aM=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});function aN(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:`${aM.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/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 aO(a,b){return(0,ak.useServerRoute)(b&&(0,E.isCatalogProvider)(a.provider)?s.queryKey.keyCredits(a.provider):null)}function aP(a,b){let{data:c}=(0,ak.useServerRoute)(b&&a.signIn?s.queryKey.llmModel:null);return c?.find(b=>b.id===a.provider)?.plan??null}function aQ(a,b){return(0,ak.useServerRoute)(b&&a.signIn?s.queryKey.subscriptionUsage:null)}function aR(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 aS(a){let b=!a||"refused"in a?null:a;return b?.resetsAt?`resets in ${(0,d.formatDistanceToNowStrict)(new Date(b.resetsAt))}`:null}function aT({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 aU({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 aV({entry:a}){if(a.provider)return(0,c.jsx)(D.ProviderIcon,{provider:a.provider,className:"size-4"});let b=aF[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 aW({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,ak.useServerRoute)(a.text&&!d&&s.queryKey.automaticModel),{data:i}=(0,ak.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?aG[a.kind]:F.BotsMark,[m]=(0,aj.useServerAction)(I.setConfigAction,{onOk:()=>{(0,ak.revalidate)(s.queryKey.config),(0,ak.revalidate)(s.queryKey.automaticModel)}}),[n]=(0,aj.useServerAction)(H.removeConfigAction,{onOk:()=>{(0,ak.revalidate)(s.queryKey.config),(0,ak.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,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)(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 aX=(a,b)=>a.entries.find(a=>a.effortOf===b);function aY({entry:a,onDone:b}){let{data:d}=(0,ak.useServerRoute)(s.queryKey.config),e=(0,J.isConfigSet)(d,a.key),f=(0,J.isConfigUnreadable)(d,a.key),g=(0,J.isConfigFromEnv)(d,a.key),h=aP(a,e),i=aQ(a,e),j=i.data?aR(i.data):null,[k,l]=(0,aj.useServerAction)(H.removeConfigAction,{okMessage:`Signed out of ${a.label}`,onOk:()=>{(0,ak.revalidate)(s.queryKey.config),(0,ak.revalidate)(s.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)(aT,{usage:i.data,plan:h}),aS(i.data)&&(0,c.jsxs)(c.Fragment,{children:[" · ",(0,c.jsx)("span",{className:"font-mono",children:aS(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)(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)(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,J.lostWords)("The sign-in saved here","Sign in again.")}),g&&(0,c.jsx)(ai.SettingNote,{className:"wrap-break-word",children:(0,J.envWords)(a.label)})]})})}function aZ(a,b){return v.notify.component({className:"sm:max-w-md",renderer:({close:d})=>(0,c.jsx)(a$,{entry:a,set:b,onDone:d})})}function a$({entry:a,set:b,onDone:d}){let[f,g]=(0,r.useState)(""),{data:h}=(0,ak.useServerRoute)(s.queryKey.config),i=h?(0,J.isConfigSet)(h,a.key):b,j=(0,J.isConfigUnreadable)(h,a.key),k=(0,J.isConfigFromEnv)(h,a.key),{data:l}=aO(a,i),m=l?aN(i,l):null,n=()=>{(0,ak.revalidate)(s.queryKey.config),(0,ak.revalidate)(s.queryKey.llmModel)},[o,p]=(0,aj.useServerAction)(I.setConfigAction,{okMessage:`${a.label} key saved`,onOk:()=>{n(),d()}}),[q,w]=(0,aj.useServerAction)(H.removeConfigAction,{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)(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)(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)(ai.SettingNote,{className:"wrap-break-word",children:(0,J.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)(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,J.lostWords)("The key saved here","Paste it again.")})]})})}a.s(["AccountsSetup",0,function({withoutVoice:a=!1}){let{data:b}=(0,ak.useServerRoute)(s.queryKey.config),d=a=>(0,J.isConfigSet)(b,a),e=a=>(0,J.isConfigUnreadable)(b,a),f=a=>(0,J.isConfigFromEnv)(b,a),g=a=>J.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)(aL,{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)(aJ,{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)(aJ,{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)(aL,{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)(aI,{screen:"keys"}),"ModelsSetting",0,()=>(0,c.jsx)(aI,{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 what was written."}),children:(0,c.jsx)(at,{})}),"PlanBadge",0,aT],405593)},51992,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fc10090f794990bc37a14ff06fd14bfdf6160a71d",b.callServer,void 0,b.findSourceMapURL,"removeConfigAction");a.s(["removeConfigAction",0,c])}];
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=features_config_10xs4l1._.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)("7fad0433bc61c03b7740787a107217dab970d1f0d0",E.callServer,void 0,E.findSourceMapURL,"callToolAction"),G=(0,E.createServerReference)("7f814b74c4c76b775fa51e722867c89bf8b4db8774",E.callServer,void 0,E.findSourceMapURL,"deleteServerAction"),H=(0,E.createServerReference)("7f4f357a8af7de4d63dcdddb1bcc092a6cff2fae56",E.callServer,void 0,E.findSourceMapURL,"refreshServerAction"),I=(0,E.createServerReference)("7f0d90b8e45583a7092d702308b13d529e5b742a41",E.callServer,void 0,E.findSourceMapURL,"registerServerAction");var J=a.i(156757),K=a.i(199169);let L=J.z.object({url:J.z.url(),headers:J.z.record(J.z.string(),J.z.string()).optional()}),M=J.z.object({command:J.z.string().min(1),args:J.z.array(J.z.string()).optional(),env:J.z.record(J.z.string(),J.z.string()).optional()}),N=J.z.union([L,M]),O=J.z.object({name:J.z.string(),description:J.z.string().optional(),inputSchema:J.z.looseObject({}).optional(),outputSchema:J.z.looseObject({}).optional()});function P(a){return"url"in a}J.z.object({clientInformation:J.z.looseObject({}).optional(),tokens:J.z.looseObject({}).optional(),authorizationServer:J.z.looseObject({}).optional(),codeVerifier:J.z.string().optional(),state:J.z.string().optional()});let Q=J.z.object({name:J.z.string().min(1).max(40),config:N,toolCount:J.z.number().int(),lastError:J.z.string().nullish()}),R=O.extend({id:J.z.number().int(),description:J.z.string().nullish()});Q.omit({toolCount:!0}).extend({tools:R.array().default([]),toolsSyncedAt:K.DateLikeSchema});let S=J.z.object({name:J.z.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:N}),T=J.z.union([J.z.object({mcpServers:J.z.record(J.z.string(),N)}),J.z.record(J.z.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}=(0,Y.useServerRoute)(p.queryKey.mcpServer(a)),[h,i]=(0,X.useServerAction)(H,{...aj,onOk:b=>{aj.onOk(b),(0,Y.revalidate)(p.queryKey.mcpServer(a))}}),[k,l]=(0,X.useServerAction)(G,{okMessage:"Server deleted",onOk:()=>{c(),(0,Y.revalidate)(p.queryKey.mcp)}}),n=async()=>{await y.notify.confirm({title:`Delete ${a}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&k(a)};if(g)return(0,b.jsx)(V.SettingSkeleton,{rows:4});if(!f)return null;let r=f.tools.length,s=d.trim().toLowerCase(),t=s?f.tools.filter(a=>`${a.name} ${a.description??""}`.toLowerCase().includes(s)):f.tools,u=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:u}),(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:l,onClick:n,className:"mr-auto text-destructive hover:text-destructive",children:[(0,b.jsx)(m.Trash2,{}),"Delete"]}),(0,b.jsxs)(q.Button,{variant:"outline",loading:i,onClick:()=>h(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:[r," ",1===r?"tool":"tools"]})]}),t.map(a=>(0,b.jsx)(aa,{tool:a,serverName:f.name},a.name)),0===t.length&&r>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)("7fe9a0fe0fb88c4445f910e891a7b9b262f1d47285",E.callServer,void 0,E.findSourceMapURL,"callToolAction"),G=(0,E.createServerReference)("7f17fd8a21bcdd0cf418a825863cccd95828f1f08a",E.callServer,void 0,E.findSourceMapURL,"deleteServerAction"),H=(0,E.createServerReference)("7f98cd44db2be134713ecafd551e41c35b1a13354f",E.callServer,void 0,E.findSourceMapURL,"refreshServerAction"),I=(0,E.createServerReference)("7fe27343a2fa46f433bf6ae380566af1c36acc3b88",E.callServer,void 0,E.findSourceMapURL,"registerServerAction");var J=a.i(156757),K=a.i(199169);let L=J.z.object({url:J.z.url(),headers:J.z.record(J.z.string(),J.z.string()).optional()}),M=J.z.object({command:J.z.string().min(1),args:J.z.array(J.z.string()).optional(),env:J.z.record(J.z.string(),J.z.string()).optional()}),N=J.z.union([L,M]),O=J.z.object({name:J.z.string(),description:J.z.string().optional(),inputSchema:J.z.looseObject({}).optional(),outputSchema:J.z.looseObject({}).optional()});function P(a){return"url"in a}J.z.object({clientInformation:J.z.looseObject({}).optional(),tokens:J.z.looseObject({}).optional(),authorizationServer:J.z.looseObject({}).optional(),codeVerifier:J.z.string().optional(),state:J.z.string().optional()});let Q=J.z.object({name:J.z.string().min(1).max(40),config:N,toolCount:J.z.number().int(),lastError:J.z.string().nullish()}),R=O.extend({id:J.z.number().int(),description:J.z.string().nullish()});Q.omit({toolCount:!0}).extend({tools:R.array().default([]),toolsSyncedAt:K.DateLikeSchema});let S=J.z.object({name:J.z.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:N}),T=J.z.union([J.z.object({mcpServers:J.z.record(J.z.string(),N)}),J.z.record(J.z.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}=(0,Y.useServerRoute)(p.queryKey.mcpServer(a)),[h,i]=(0,X.useServerAction)(H,{...aj,onOk:b=>{aj.onOk(b),(0,Y.revalidate)(p.queryKey.mcpServer(a))}}),[k,l]=(0,X.useServerAction)(G,{okMessage:"Server deleted",onOk:()=>{c(),(0,Y.revalidate)(p.queryKey.mcp)}}),n=async()=>{await y.notify.confirm({title:`Delete ${a}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&k(a)};if(g)return(0,b.jsx)(V.SettingSkeleton,{rows:4});if(!f)return null;let r=f.tools.length,s=d.trim().toLowerCase(),t=s?f.tools.filter(a=>`${a.name} ${a.description??""}`.toLowerCase().includes(s)):f.tools,u=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:u}),(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:l,onClick:n,className:"mr-auto text-destructive hover:text-destructive",children:[(0,b.jsx)(m.Trash2,{}),"Delete"]}),(0,b.jsxs)(q.Button,{variant:"outline",loading:i,onClick:()=>h(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:[r," ",1===r?"tool":"tools"]})]}),t.map(a=>(0,b.jsx)(aa,{tool:a,serverName:f.name},a.name)),0===t.length&&r>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`{
|
|
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
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[857022,a=>{"use strict";var b=a.i(187924),c=a.i(256711),d=a.i(752562),e=a.i(141146),f=a.i(164831);let g={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};g.node;let h=(0,f.default)(g);var i=a.i(403512),j=a.i(951675),k=a.i(474215),l=a.i(572131),m=a.i(767561),n=a.i(340695),o=a.i(316474),p=a.i(205522),q=a.i(446181),r=a.i(950463),s=a.i(621958),t=a.i(546893),u=a.i(287702),v=a.i(379630),w=a.i(61876),x=a.i(275086),y=a.i(172654),z=a.i(327598);let A={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};A.node;let B=(0,f.default)(A);var C=a.i(589027),D=a.i(875160);let E={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};E.node;let F=(0,f.default)(E);var G=a.i(545097),H=a.i(608902),I=a.i(421042),J=a.i(497895);let K=new y.DefaultChatTransport({api:m.queryKey.memoryEdit});function L({notes:a}){let[c,d]=(0,l.useState)(""),[e,f]=(0,l.useState)({provider:null,model:""}),[g,h]=(0,l.useState)(!1),{messages:i,sendMessage:j,setMessages:k,status:m,stop:o,error:p,clearError:q}=(0,x.useChat)({transport:K}),r=(0,l.useRef)(o);r.current=o,(0,l.useEffect)(()=>()=>{r.current()},[]);let s=(0,l.useRef)(new Map);for(let b of a)for(let a of b.facts)s.current.set(a.id,{text:a.text,path:b.path});let t="submitted"===m||"streaming"===m,u=!!(e.provider&&e.model.trim()),w=[...i].reverse().find(a=>"assistant"===a.role),A=w?.parts??[],B=A.filter(y.isToolUIPart),D=A.flatMap(a=>"text"===a.type?[a.text]:[]).join(" ").trim(),E=!!p||B.some(a=>"output-error"===a.state),F=B.filter(a=>"output-available"===a.state&&(0,y.getToolName)(a)!==I.TOOL_NAMES.memory_recall).length;(0,l.useEffect)(()=>{if("ready"!==m||E||0===i.length)return;let a=setTimeout(()=>k([]),4e3);return()=>clearTimeout(a)},[m,E,i.length,k]);let M=t?(0,b.jsx)(G.ShinyText,{text:"Working on memory",className:"text-xs"}):p?(0,b.jsx)("span",{className:"text-xs text-destructive",children:p.message}):w?(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:D||(0===F?"Nothing to change":1===F?"1 change saved":`${F} changes saved`)}):null;return(0,b.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-18 z-10 flex justify-center px-8",children:(0,b.jsxs)("div",{className:"pointer-events-auto flex w-full max-w-120 flex-col items-center gap-2",children:[g&&(0,b.jsx)("div",{className:"w-full rounded-xl bg-popover p-2 shadow-lg ring-1 ring-foreground/10",children:(0,b.jsx)(H.ModelPicker,{provider:e.provider,model:e.model,unset:"Provider",onChange:f})}),B.length>0&&(0,b.jsx)("ul",{className:"w-full divide-y divide-border/60 overflow-hidden rounded-xl bg-popover shadow-lg ring-1 ring-foreground/10",children:B.map(a=>(0,b.jsx)(N,{name:(0,y.getToolName)(a),input:a.input,state:a.state,errorText:"output-error"===a.state?a.errorText:void 0,known:s.current},a.toolCallId))}),M&&(0,b.jsx)("p",{className:"max-w-full truncate px-1",children:M}),(0,b.jsxs)("form",{onSubmit:a=>{a.preventDefault();let b=c.trim();b&&u&&!t&&(d(""),h(!1),q(),k([]),j({text:b},{body:{model:e}}))},className:"flex h-10 w-full items-center gap-1.5 rounded-xl bg-popover pr-1.5 pl-3.5 shadow-lg ring-1 ring-foreground/10",children:[(0,b.jsx)("input",{autoFocus:!0,value:c,onChange:a=>d(a.target.value),disabled:t,"aria-label":"Edit memory",placeholder:"Tell memory what changed",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:opacity-60"}),(0,b.jsxs)(n.Button,{type:"button",size:"xs",variant:"ghost",onClick:()=>h(!g),className:(0,J.cn)("max-w-44",!u&&"text-muted-foreground"),children:[u&&e.provider?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(v.ProviderIcon,{provider:e.provider,className:"size-3"}),(0,b.jsx)("span",{className:"truncate",children:e.model})]}):"Model",(0,b.jsx)(C.ChevronDown,{className:"text-muted-foreground"})]}),(0,b.jsx)(n.Button,{type:"submit",size:"icon-sm",loading:t,disabled:!c.trim()||!u||t,"aria-label":"Send",children:!t&&(0,b.jsx)(z.ArrowUp,{})})]})]})})}let M={Remember:i.Plus,Replace:h,Forget:F,Rename:h,Opened:B};function N({name:a,input:c,state:e,errorText:f,known:g}){let h=function(a,b,c){if(a===I.TOOL_NAMES.memory_recall)return{kind:"Opened",path:(b??{}).path??"",lines:[]};if(a===I.TOOL_NAMES.memory_describe){let a=b??{};return{kind:"Rename",path:a.path??"",lines:a.description?[{after:`“${a.description}”`}]:[]}}if(a===I.TOOL_NAMES.memory_forget){let a=((b??{}).factIds??[]).filter(a=>null!=a),d=a.map(a=>c.get(a));return{kind:"Forget",path:d.find(a=>a)?.path??"",lines:a.map((a,b)=>({before:d[b]?.text??`Fact #${a}`}))}}let d=b??{},e=d.path??"",f=(d.facts??[]).filter(a=>null!=a),g=f.map(a=>null!=a.replaces?{before:c.get(a.replaces)?.text??`Fact #${a.replaces}`,after:a.text}:{after:a.text});return a===I.TOOL_NAMES.memory_create&&d.description&&g.unshift({after:`“${d.description}”`}),{kind:f.some(a=>null!=a.replaces)?"Replace":"Remember",path:e,lines:g}}(a,c,g),i=M[h.kind],j="output-error"===e;return(0,b.jsxs)("li",{className:"flex animate-in items-start gap-2.5 px-3 py-2.5 duration-200 fade-in slide-in-from-bottom-1",children:[(0,b.jsx)(i,{className:"mt-1 size-3.5 shrink-0 text-muted-foreground"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1 space-y-0.5",children:[h.lines.map((a,c)=>(0,b.jsxs)("div",{children:[a.before&&(0,b.jsx)("p",{className:"text-[13px] leading-5 text-muted-foreground/60 line-through",children:a.before}),a.after&&(0,b.jsx)("p",{className:"text-sm leading-5 text-foreground/90",children:a.after})]},`${h.kind}-${c}`)),(0,b.jsxs)("p",{className:"pt-0.5 font-mono text-[11px] text-muted-foreground",children:[h.kind,h.path&&` \xb7 ${h.path}`]}),j&&f&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:f})]}),(0,b.jsx)("span",{className:"mt-0.5 flex size-5 shrink-0 items-center justify-center text-muted-foreground",children:j?(0,b.jsx)(k.X,{className:"size-3.5 text-destructive"}):"output-available"===e?(0,b.jsx)(d.Check,{className:"size-3.5"}):(0,b.jsx)(D.Loader2,{className:"size-3.5 animate-spin"})})]})}var O=a.i(405050);let P=(0,O.createServerReference)("7f514507aa3e03b8114e1ae21ea0f9d1177d1bd921",O.callServer,void 0,O.findSourceMapURL,"addFactsAction"),Q=(0,O.createServerReference)("7f37d1eb5dbeb3a76291c30a68837e065d03d44edf",O.callServer,void 0,O.findSourceMapURL,"createNoteAction"),R=(0,O.createServerReference)("7fdc1c1ad51ef63c641bb258dcb66c4c8604b8c49c",O.callServer,void 0,O.findSourceMapURL,"deleteNoteAction"),S=(0,O.createServerReference)("7fa1e4aefcff8b4d26db50f0ca371326c64d147461",O.callServer,void 0,O.findSourceMapURL,"forgetFactAction"),T=(0,O.createServerReference)("7f594531f6528f1c98632cfb9450ee8f533b088e7c",O.callServer,void 0,O.findSourceMapURL,"reviseFactAction"),U=(0,O.createServerReference)("7f74bfdaa7335873eda514d33eeabc4ea6cd4d6666",O.callServer,void 0,O.findSourceMapURL,"updateNoteAction");var V=a.i(156757),W=a.i(199169);let X=V.z.enum(["user","call","bot"]);V.z.string().trim().min(1,"A note needs a line saying what it is about").max(u.MEMORY_LIMITS.descriptionChars,`A note's line is one line: at most ${u.MEMORY_LIMITS.descriptionChars} characters`);let Y=V.z.object({id:V.z.number(),text:V.z.string(),source:X.nullish(),createdAt:W.DateLikeSchema});V.z.object({id:V.z.number(),path:V.z.string(),description:V.z.string(),ownedByUser:V.z.boolean(),hits:V.z.number(),lastReadAt:W.DateLikeSchema.nullable(),createdAt:W.DateLikeSchema,updatedAt:W.DateLikeSchema,factCount:V.z.number(),facts:Y.array()});let Z=[{path:"profile",of:"The user themselves — name, age, what they do, where they live, whatever else says who they are"},{path:"preferences",of:"How they want things done, and said — read whole on every call, so a rule for a particular situation goes here too"},{path:"people/",of:"Someone in their life, and what matters about them"},{path:"projects/",of:"Something with an end — a trip, a purchase, a deadline, a thing being built"},{path:"topics/",of:"Something ongoing that keeps coming back"}],$=Z.filter(a=>!a.path.endsWith("/")).map(a=>a.path),_=Z.filter(a=>a.path.endsWith("/")).map(a=>a.path.slice(0,-1));RegExp(`^(?:${$.join("|")}|(?:${_.join("|")})/.+)$`);var aa=a.i(619477),ab=a.i(332033),ac=a.i(313237),ad=a.i(862966),ae=a.i(759497);let af=[{key:"you",label:"You"},{key:"people",label:"People"},{key:"projects",label:"Projects"},{key:"topics",label:"Topics"},{key:"other",label:"Other"}],ag={onOk:()=>(0,ae.revalidate)(m.queryKey.memory)},ah=w.textModelProviderSchema.options.filter(a=>"chatgpt"!==a).slice(0,3);function ai(){return(0,b.jsx)("span",{className:"mr-0.5 flex items-center",children:ah.map(a=>(0,b.jsx)("span",{className:"-ml-1.5 grid size-5 place-items-center rounded-full bg-background ring-1 ring-border first:ml-0",children:(0,b.jsx)(v.ProviderIcon,{provider:a,className:"size-3"})},a))})}function aj(a,b){return c=>{(0,ab.composing)(c)||("Enter"===c.key&&(c.preventDefault(),a()),"Escape"===c.key&&(c.stopPropagation(),b()))}}function ak({note:a,open:c,onToggle:d}){var f;let g,i,k,m,o,[p,r]=(0,l.useState)(!1),[s,t]=(0,ac.useServerAction)(R,ag),u=async()=>{await q.notify.confirm({title:`Forget ${a.path}?`,description:"Every fact in this note is deleted for good.",okText:"Delete",destructive:!0})&&s(a.id)},v=(0,b.jsx)("span",{className:"w-36 shrink-0 truncate text-sm font-medium",children:-1===(g=(f=a.path).indexOf("/"))?f:f.slice(g+1)});return(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"flex h-12 items-center gap-3 pr-2 pl-4",children:p?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(e.ChevronRight,{className:"size-3.5 shrink-0 rotate-90 text-muted-foreground"}),v,(0,b.jsx)(al,{note:a,onDone:()=>r(!1)})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{type:"button","aria-expanded":c,onClick:d,className:(0,J.cn)("flex h-full min-w-0 flex-1 items-center gap-3 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",(i=a.path,!$.includes(i)&&.15>(k=(0,W.toDate)(a.lastReadAt??a.createdAt),m=Math.max(0,(Date.now()-k.getTime())/864e5),(a.hits+1)/(1+m))&&!c&&"opacity-55")),children:[(0,b.jsx)(e.ChevronRight,{className:(0,J.cn)("size-3.5 shrink-0 text-muted-foreground transition-transform",c&&"rotate-90")}),v,(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] text-muted-foreground",children:a.description}),(0,b.jsxs)("span",{className:"w-16 shrink-0 text-right font-mono text-[11px] text-muted-foreground/70",children:[a.factCount," ",1===a.factCount?"fact":"facts"]}),(0,b.jsx)("span",{className:"w-10 shrink-0 text-right font-mono text-[11px] text-muted-foreground/50",title:a.lastReadAt?"Last read back":"Never read back",children:a.lastReadAt?(0,W.shortAgo)(a.lastReadAt):"—"})]}),(0,b.jsx)("span",{className:"flex w-15 shrink-0 justify-end",children:c&&(0,b.jsxs)(b.Fragment,{children:[(o=a.path,!$.includes(o)&&(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Edit the note's line",onClick:()=>r(!0),children:(0,b.jsx)(h,{})})),(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Forget this note",loading:t,onClick:u,children:!t&&(0,b.jsx)(j.Trash2,{})})]})})]})}),c&&(0,b.jsxs)("div",{className:"space-y-1 border-t border-border/60 bg-muted/40 py-2.5 pr-2 pl-10",children:[(0,b.jsx)(am,{noteId:a.id}),a.facts.map(c=>(0,b.jsx)(an,{noteId:a.id,fact:c},c.id))]})]})}function al({note:a,onDone:c}){let[e,f]=(0,l.useState)(a.description),[g,h]=(0,ac.useServerAction)(U,{onOk:()=>{c(),(0,ae.revalidate)(m.queryKey.memory)}}),i=()=>{let b=e.trim();if(!b||b===a.description)return c();g(a.id,{description:b})};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(p.Input,{autoFocus:!0,value:e,onChange:a=>f(a.target.value),onKeyDown:aj(i,c),"aria-label":"The note's line",placeholder:"One line Thursday sees in her list",maxLength:u.MEMORY_LIMITS.descriptionChars,className:"h-8 min-w-0 flex-1 text-[13px]"}),(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost","aria-label":"Save",loading:h,onClick:i,children:!h&&(0,b.jsx)(d.Check,{})}),(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost","aria-label":"Cancel",onClick:c,children:(0,b.jsx)(k.X,{})})]})}function am({noteId:a}){let[c,d]=(0,l.useState)(""),[e,f]=(0,ac.useServerAction)(P,{onOk:()=>{d(""),(0,ae.revalidate)(m.queryKey.memory)}}),g=()=>{let b=c.trim();b&&!f&&e(a,[b])};return(0,b.jsxs)("div",{className:"flex items-center gap-1.5 pb-1",children:[(0,b.jsx)(p.Input,{value:c,onChange:a=>d(a.target.value),onKeyDown:aj(g,()=>d("")),"aria-label":"Add a fact",placeholder:"Add a fact",className:"h-8 min-w-0 flex-1 bg-background text-sm"}),(0,b.jsxs)(n.Button,{size:"sm",variant:"outline",loading:f,disabled:!c.trim(),onClick:g,children:[!f&&(0,b.jsx)(i.Plus,{}),"Add"]})]})}function an({noteId:a,fact:e}){let f,[g,i]=(0,l.useState)(!1),[o,r]=(0,l.useState)(e.text),[s,t]=(0,ac.useServerAction)(T,{onOk:()=>{i(!1),(0,ae.revalidate)(m.queryKey.memory)}}),[u,v]=(0,ac.useServerAction)(S,ag),w=async()=>{await q.notify.confirm({title:"Forget this fact?",description:`"${e.text}" is deleted for good.`,okText:"Delete",destructive:!0})&&u(a,e.id)},x=()=>{let b=o.trim();if(!b||b===e.text)return i(!1);s(a,e.id,b)},y="user"===(f=e.source)?"you":"call"===f?"on a call":"bot"===f?"a bot":"";return(0,b.jsx)("div",{className:"flex min-h-10 items-center gap-1.5",children:g?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(p.Input,{autoFocus:!0,value:o,onChange:a=>r(a.target.value),onKeyDown:aj(x,()=>i(!1)),"aria-label":"Fact",className:"h-8 min-w-0 flex-1 bg-background text-sm"}),(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost","aria-label":"Save",loading:t,onClick:x,children:!t&&(0,b.jsx)(d.Check,{})}),(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost","aria-label":"Cancel",onClick:()=>i(!1),children:(0,b.jsx)(k.X,{})})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"min-w-0 flex-1 pl-1 text-sm leading-relaxed text-foreground/90",children:e.text}),(0,b.jsxs)("span",{className:"shrink-0 pr-1 font-mono text-[11px] text-muted-foreground/50",children:[(0,c.format)(e.createdAt,"yyyy.MM.dd"),y&&` \xb7 ${y}`]}),(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Edit this fact",onClick:()=>{r(e.text),i(!0)},children:(0,b.jsx)(h,{})}),(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Forget this fact",loading:v,onClick:()=>void w(),children:!v&&(0,b.jsx)(j.Trash2,{})})]})})}let ao=[{key:"people",label:"Person",placeholder:"jihoon",fact:"Moved to the platform team in March"},{key:"projects",label:"Project",placeholder:"thursday",fact:"Ships behind a feature flag until April"},{key:"topics",label:"Topic",placeholder:"scheduling",fact:"No meetings before 10am"}];function ap(){return q.notify.component({className:"sm:max-w-lg",renderer:({close:a})=>(0,b.jsx)(aq,{onDone:a})})}function aq({onDone:a}){let[c,d]=(0,l.useState)("people"),[e,f]=(0,l.useState)(""),[g,h]=(0,l.useState)(""),[j,k]=(0,l.useState)(""),[q,r,,v]=(0,ac.useServerAction)(Q,{errorMessage:!1,onOk:()=>{(0,ae.revalidate)(m.queryKey.memory),a()}}),w=ao.find(a=>a.key===c),x=e.trim()&&g.trim()&&!r,y=()=>{x&&q(`${c}/${e.trim()}`,g.trim(),j.split("\n").map(a=>a.trim()).filter(Boolean))};return(0,b.jsxs)(aa.SettingDialogContent,{title:"New note",description:"Where Thursday keeps what she learns about this.",footer:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n.Button,{variant:"ghost",onClick:a,children:"Cancel"}),(0,b.jsxs)(n.Button,{disabled:!x,loading:r,onClick:y,children:[!r&&(0,b.jsx)(i.Plus,{}),"Create"]})]}),children:[(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)(o.Field,{children:[(0,b.jsx)(o.FieldLabel,{children:"Kind"}),(0,b.jsx)(s.Tabs,{value:c,onValueChange:a=>d(a),children:(0,b.jsx)(s.TabsList,{className:"w-full",children:ao.map(a=>(0,b.jsx)(s.TabsTrigger,{value:a.key,children:a.label},a.key))})})]}),(0,b.jsxs)(o.Field,{children:[(0,b.jsx)(o.FieldLabel,{htmlFor:"note-name",children:"Name"}),(0,b.jsxs)(o.FieldContent,{children:[(0,b.jsx)(p.Input,{id:"note-name",value:e,onChange:a=>f(a.target.value),placeholder:w?.placeholder,spellCheck:!1,required:!0}),(0,b.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[c,"/",e.trim()||"…"]})]})]}),(0,b.jsxs)(o.Field,{children:[(0,b.jsx)(o.FieldLabel,{htmlFor:"note-summary",children:"Summary"}),(0,b.jsx)(o.FieldContent,{children:(0,b.jsx)(p.Input,{id:"note-summary",value:g,onChange:a=>h(a.target.value),onKeyDown:a=>{a.nativeEvent.isComposing||229===a.keyCode||"Enter"===a.key&&y()},placeholder:"One line Thursday sees in her list",maxLength:u.MEMORY_LIMITS.descriptionChars,required:!0})})]}),(0,b.jsxs)(o.Field,{children:[(0,b.jsx)(o.FieldLabel,{htmlFor:"note-facts",children:"Facts"}),(0,b.jsx)(t.Textarea,{id:"note-facts",value:j,onChange:a=>k(a.target.value),placeholder:`One per line
|
|
1
|
+
module.exports=[857022,a=>{"use strict";var b=a.i(187924),c=a.i(256711),d=a.i(752562),e=a.i(141146),f=a.i(164831);let g={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};g.node;let h=(0,f.default)(g);var i=a.i(403512),j=a.i(951675),k=a.i(474215),l=a.i(572131),m=a.i(767561),n=a.i(340695),o=a.i(316474),p=a.i(205522),q=a.i(446181),r=a.i(950463),s=a.i(621958),t=a.i(546893),u=a.i(287702),v=a.i(379630),w=a.i(61876),x=a.i(275086),y=a.i(172654),z=a.i(327598);let A={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};A.node;let B=(0,f.default)(A);var C=a.i(589027),D=a.i(875160);let E={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};E.node;let F=(0,f.default)(E);var G=a.i(545097),H=a.i(608902),I=a.i(421042),J=a.i(497895);let K=new y.DefaultChatTransport({api:m.queryKey.memoryEdit});function L({notes:a}){let[c,d]=(0,l.useState)(""),[e,f]=(0,l.useState)({provider:null,model:""}),[g,h]=(0,l.useState)(!1),{messages:i,sendMessage:j,setMessages:k,status:m,stop:o,error:p,clearError:q}=(0,x.useChat)({transport:K}),r=(0,l.useRef)(o);r.current=o,(0,l.useEffect)(()=>()=>{r.current()},[]);let s=(0,l.useRef)(new Map);for(let b of a)for(let a of b.facts)s.current.set(a.id,{text:a.text,path:b.path});let t="submitted"===m||"streaming"===m,u=!!(e.provider&&e.model.trim()),w=[...i].reverse().find(a=>"assistant"===a.role),A=w?.parts??[],B=A.filter(y.isToolUIPart),D=A.flatMap(a=>"text"===a.type?[a.text]:[]).join(" ").trim(),E=!!p||B.some(a=>"output-error"===a.state),F=B.filter(a=>"output-available"===a.state&&(0,y.getToolName)(a)!==I.TOOL_NAMES.memory_recall).length;(0,l.useEffect)(()=>{if("ready"!==m||E||0===i.length)return;let a=setTimeout(()=>k([]),4e3);return()=>clearTimeout(a)},[m,E,i.length,k]);let M=t?(0,b.jsx)(G.ShinyText,{text:"Working on memory",className:"text-xs"}):p?(0,b.jsx)("span",{className:"text-xs text-destructive",children:p.message}):w?(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:D||(0===F?"Nothing to change":1===F?"1 change saved":`${F} changes saved`)}):null;return(0,b.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-18 z-10 flex justify-center px-8",children:(0,b.jsxs)("div",{className:"pointer-events-auto flex w-full max-w-120 flex-col items-center gap-2",children:[g&&(0,b.jsx)("div",{className:"w-full rounded-xl bg-popover p-2 shadow-lg ring-1 ring-foreground/10",children:(0,b.jsx)(H.ModelPicker,{provider:e.provider,model:e.model,unset:"Provider",onChange:f})}),B.length>0&&(0,b.jsx)("ul",{className:"w-full divide-y divide-border/60 overflow-hidden rounded-xl bg-popover shadow-lg ring-1 ring-foreground/10",children:B.map(a=>(0,b.jsx)(N,{name:(0,y.getToolName)(a),input:a.input,state:a.state,errorText:"output-error"===a.state?a.errorText:void 0,known:s.current},a.toolCallId))}),M&&(0,b.jsx)("p",{className:"max-w-full truncate px-1",children:M}),(0,b.jsxs)("form",{onSubmit:a=>{a.preventDefault();let b=c.trim();b&&u&&!t&&(d(""),h(!1),q(),k([]),j({text:b},{body:{model:e}}))},className:"flex h-10 w-full items-center gap-1.5 rounded-xl bg-popover pr-1.5 pl-3.5 shadow-lg ring-1 ring-foreground/10",children:[(0,b.jsx)("input",{autoFocus:!0,value:c,onChange:a=>d(a.target.value),disabled:t,"aria-label":"Edit memory",placeholder:"Tell memory what changed",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:opacity-60"}),(0,b.jsxs)(n.Button,{type:"button",size:"xs",variant:"ghost",onClick:()=>h(!g),className:(0,J.cn)("max-w-44",!u&&"text-muted-foreground"),children:[u&&e.provider?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(v.ProviderIcon,{provider:e.provider,className:"size-3"}),(0,b.jsx)("span",{className:"truncate",children:e.model})]}):"Model",(0,b.jsx)(C.ChevronDown,{className:"text-muted-foreground"})]}),(0,b.jsx)(n.Button,{type:"submit",size:"icon-sm",loading:t,disabled:!c.trim()||!u||t,"aria-label":"Send",children:!t&&(0,b.jsx)(z.ArrowUp,{})})]})]})})}let M={Remember:i.Plus,Replace:h,Forget:F,Rename:h,Opened:B};function N({name:a,input:c,state:e,errorText:f,known:g}){let h=function(a,b,c){if(a===I.TOOL_NAMES.memory_recall)return{kind:"Opened",path:(b??{}).path??"",lines:[]};if(a===I.TOOL_NAMES.memory_describe){let a=b??{};return{kind:"Rename",path:a.path??"",lines:a.description?[{after:`“${a.description}”`}]:[]}}if(a===I.TOOL_NAMES.memory_forget){let a=((b??{}).factIds??[]).filter(a=>null!=a),d=a.map(a=>c.get(a));return{kind:"Forget",path:d.find(a=>a)?.path??"",lines:a.map((a,b)=>({before:d[b]?.text??`Fact #${a}`}))}}let d=b??{},e=d.path??"",f=(d.facts??[]).filter(a=>null!=a),g=f.map(a=>null!=a.replaces?{before:c.get(a.replaces)?.text??`Fact #${a.replaces}`,after:a.text}:{after:a.text});return a===I.TOOL_NAMES.memory_create&&d.description&&g.unshift({after:`“${d.description}”`}),{kind:f.some(a=>null!=a.replaces)?"Replace":"Remember",path:e,lines:g}}(a,c,g),i=M[h.kind],j="output-error"===e;return(0,b.jsxs)("li",{className:"flex animate-in items-start gap-2.5 px-3 py-2.5 duration-200 fade-in slide-in-from-bottom-1",children:[(0,b.jsx)(i,{className:"mt-1 size-3.5 shrink-0 text-muted-foreground"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1 space-y-0.5",children:[h.lines.map((a,c)=>(0,b.jsxs)("div",{children:[a.before&&(0,b.jsx)("p",{className:"text-[13px] leading-5 text-muted-foreground/60 line-through",children:a.before}),a.after&&(0,b.jsx)("p",{className:"text-sm leading-5 text-foreground/90",children:a.after})]},`${h.kind}-${c}`)),(0,b.jsxs)("p",{className:"pt-0.5 font-mono text-[11px] text-muted-foreground",children:[h.kind,h.path&&` \xb7 ${h.path}`]}),j&&f&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:f})]}),(0,b.jsx)("span",{className:"mt-0.5 flex size-5 shrink-0 items-center justify-center text-muted-foreground",children:j?(0,b.jsx)(k.X,{className:"size-3.5 text-destructive"}):"output-available"===e?(0,b.jsx)(d.Check,{className:"size-3.5"}):(0,b.jsx)(D.Loader2,{className:"size-3.5 animate-spin"})})]})}var O=a.i(405050);let P=(0,O.createServerReference)("7fa31767ec3b5032a5871f9012317613c15f78f2b9",O.callServer,void 0,O.findSourceMapURL,"addFactsAction"),Q=(0,O.createServerReference)("7f2fffcafc33e4417274b94bb6169b63543c643bf2",O.callServer,void 0,O.findSourceMapURL,"createNoteAction"),R=(0,O.createServerReference)("7f12447d33ce366e085df1066e96f0518d58e9b13b",O.callServer,void 0,O.findSourceMapURL,"deleteNoteAction"),S=(0,O.createServerReference)("7f69b88d52223f6e7eebcc3fb4e2e26bfd6821a297",O.callServer,void 0,O.findSourceMapURL,"forgetFactAction"),T=(0,O.createServerReference)("7f72cbe47c1f7d07eab9c5f73a84057ec03fda4dbc",O.callServer,void 0,O.findSourceMapURL,"reviseFactAction"),U=(0,O.createServerReference)("7f4fb822e09452650925f5a6f83a5cf59d64fb274a",O.callServer,void 0,O.findSourceMapURL,"updateNoteAction");var V=a.i(156757),W=a.i(199169);let X=V.z.enum(["user","call","bot"]);V.z.string().trim().min(1,"A note needs a line saying what it is about").max(u.MEMORY_LIMITS.descriptionChars,`A note's line is one line: at most ${u.MEMORY_LIMITS.descriptionChars} characters`);let Y=V.z.object({id:V.z.number(),text:V.z.string(),source:X.nullish(),createdAt:W.DateLikeSchema});V.z.object({id:V.z.number(),path:V.z.string(),description:V.z.string(),ownedByUser:V.z.boolean(),hits:V.z.number(),lastReadAt:W.DateLikeSchema.nullable(),createdAt:W.DateLikeSchema,updatedAt:W.DateLikeSchema,factCount:V.z.number(),facts:Y.array()});let Z=[{path:"profile",of:"The user themselves — name, age, what they do, where they live, whatever else says who they are"},{path:"preferences",of:"How they want things done, and said — read whole on every call, so a rule for a particular situation goes here too"},{path:"people/",of:"Someone in their life, and what matters about them"},{path:"projects/",of:"Something with an end — a trip, a purchase, a deadline, a thing being built"},{path:"topics/",of:"Something ongoing that keeps coming back"}],$=Z.filter(a=>!a.path.endsWith("/")).map(a=>a.path),_=Z.filter(a=>a.path.endsWith("/")).map(a=>a.path.slice(0,-1));RegExp(`^(?:${$.join("|")}|(?:${_.join("|")})/.+)$`);var aa=a.i(619477),ab=a.i(332033),ac=a.i(313237),ad=a.i(862966),ae=a.i(759497);let af=[{key:"you",label:"You"},{key:"people",label:"People"},{key:"projects",label:"Projects"},{key:"topics",label:"Topics"},{key:"other",label:"Other"}],ag={onOk:()=>(0,ae.revalidate)(m.queryKey.memory)},ah=w.textModelProviderSchema.options.filter(a=>"chatgpt"!==a).slice(0,3);function ai(){return(0,b.jsx)("span",{className:"mr-0.5 flex items-center",children:ah.map(a=>(0,b.jsx)("span",{className:"-ml-1.5 grid size-5 place-items-center rounded-full bg-background ring-1 ring-border first:ml-0",children:(0,b.jsx)(v.ProviderIcon,{provider:a,className:"size-3"})},a))})}function aj(a,b){return c=>{(0,ab.composing)(c)||("Enter"===c.key&&(c.preventDefault(),a()),"Escape"===c.key&&(c.stopPropagation(),b()))}}function ak({note:a,open:c,onToggle:d}){var f;let g,i,k,m,o,[p,r]=(0,l.useState)(!1),[s,t]=(0,ac.useServerAction)(R,ag),u=async()=>{await q.notify.confirm({title:`Forget ${a.path}?`,description:"Every fact in this note is deleted for good.",okText:"Delete",destructive:!0})&&s(a.id)},v=(0,b.jsx)("span",{className:"w-36 shrink-0 truncate text-sm font-medium",children:-1===(g=(f=a.path).indexOf("/"))?f:f.slice(g+1)});return(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"flex h-12 items-center gap-3 pr-2 pl-4",children:p?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(e.ChevronRight,{className:"size-3.5 shrink-0 rotate-90 text-muted-foreground"}),v,(0,b.jsx)(al,{note:a,onDone:()=>r(!1)})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{type:"button","aria-expanded":c,onClick:d,className:(0,J.cn)("flex h-full min-w-0 flex-1 items-center gap-3 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",(i=a.path,!$.includes(i)&&.15>(k=(0,W.toDate)(a.lastReadAt??a.createdAt),m=Math.max(0,(Date.now()-k.getTime())/864e5),(a.hits+1)/(1+m))&&!c&&"opacity-55")),children:[(0,b.jsx)(e.ChevronRight,{className:(0,J.cn)("size-3.5 shrink-0 text-muted-foreground transition-transform",c&&"rotate-90")}),v,(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] text-muted-foreground",children:a.description}),(0,b.jsxs)("span",{className:"w-16 shrink-0 text-right font-mono text-[11px] text-muted-foreground/70",children:[a.factCount," ",1===a.factCount?"fact":"facts"]}),(0,b.jsx)("span",{className:"w-10 shrink-0 text-right font-mono text-[11px] text-muted-foreground/50",title:a.lastReadAt?"Last read back":"Never read back",children:a.lastReadAt?(0,W.shortAgo)(a.lastReadAt):"—"})]}),(0,b.jsx)("span",{className:"flex w-15 shrink-0 justify-end",children:c&&(0,b.jsxs)(b.Fragment,{children:[(o=a.path,!$.includes(o)&&(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Edit the note's line",onClick:()=>r(!0),children:(0,b.jsx)(h,{})})),(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Forget this note",loading:t,onClick:u,children:!t&&(0,b.jsx)(j.Trash2,{})})]})})]})}),c&&(0,b.jsxs)("div",{className:"space-y-1 border-t border-border/60 bg-muted/40 py-2.5 pr-2 pl-10",children:[(0,b.jsx)(am,{noteId:a.id}),a.facts.map(c=>(0,b.jsx)(an,{noteId:a.id,fact:c},c.id))]})]})}function al({note:a,onDone:c}){let[e,f]=(0,l.useState)(a.description),[g,h]=(0,ac.useServerAction)(U,{onOk:()=>{c(),(0,ae.revalidate)(m.queryKey.memory)}}),i=()=>{let b=e.trim();if(!b||b===a.description)return c();g(a.id,{description:b})};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(p.Input,{autoFocus:!0,value:e,onChange:a=>f(a.target.value),onKeyDown:aj(i,c),"aria-label":"The note's line",placeholder:"One line Thursday sees in her list",maxLength:u.MEMORY_LIMITS.descriptionChars,className:"h-8 min-w-0 flex-1 text-[13px]"}),(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost","aria-label":"Save",loading:h,onClick:i,children:!h&&(0,b.jsx)(d.Check,{})}),(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost","aria-label":"Cancel",onClick:c,children:(0,b.jsx)(k.X,{})})]})}function am({noteId:a}){let[c,d]=(0,l.useState)(""),[e,f]=(0,ac.useServerAction)(P,{onOk:()=>{d(""),(0,ae.revalidate)(m.queryKey.memory)}}),g=()=>{let b=c.trim();b&&!f&&e(a,[b])};return(0,b.jsxs)("div",{className:"flex items-center gap-1.5 pb-1",children:[(0,b.jsx)(p.Input,{value:c,onChange:a=>d(a.target.value),onKeyDown:aj(g,()=>d("")),"aria-label":"Add a fact",placeholder:"Add a fact",className:"h-8 min-w-0 flex-1 bg-background text-sm"}),(0,b.jsxs)(n.Button,{size:"sm",variant:"outline",loading:f,disabled:!c.trim(),onClick:g,children:[!f&&(0,b.jsx)(i.Plus,{}),"Add"]})]})}function an({noteId:a,fact:e}){let f,[g,i]=(0,l.useState)(!1),[o,r]=(0,l.useState)(e.text),[s,t]=(0,ac.useServerAction)(T,{onOk:()=>{i(!1),(0,ae.revalidate)(m.queryKey.memory)}}),[u,v]=(0,ac.useServerAction)(S,ag),w=async()=>{await q.notify.confirm({title:"Forget this fact?",description:`"${e.text}" is deleted for good.`,okText:"Delete",destructive:!0})&&u(a,e.id)},x=()=>{let b=o.trim();if(!b||b===e.text)return i(!1);s(a,e.id,b)},y="user"===(f=e.source)?"you":"call"===f?"on a call":"bot"===f?"a bot":"";return(0,b.jsx)("div",{className:"flex min-h-10 items-center gap-1.5",children:g?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(p.Input,{autoFocus:!0,value:o,onChange:a=>r(a.target.value),onKeyDown:aj(x,()=>i(!1)),"aria-label":"Fact",className:"h-8 min-w-0 flex-1 bg-background text-sm"}),(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost","aria-label":"Save",loading:t,onClick:x,children:!t&&(0,b.jsx)(d.Check,{})}),(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost","aria-label":"Cancel",onClick:()=>i(!1),children:(0,b.jsx)(k.X,{})})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"min-w-0 flex-1 pl-1 text-sm leading-relaxed text-foreground/90",children:e.text}),(0,b.jsxs)("span",{className:"shrink-0 pr-1 font-mono text-[11px] text-muted-foreground/50",children:[(0,c.format)(e.createdAt,"yyyy.MM.dd"),y&&` \xb7 ${y}`]}),(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Edit this fact",onClick:()=>{r(e.text),i(!0)},children:(0,b.jsx)(h,{})}),(0,b.jsx)(n.Button,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground","aria-label":"Forget this fact",loading:v,onClick:()=>void w(),children:!v&&(0,b.jsx)(j.Trash2,{})})]})})}let ao=[{key:"people",label:"Person",placeholder:"jihoon",fact:"Moved to the platform team in March"},{key:"projects",label:"Project",placeholder:"thursday",fact:"Ships behind a feature flag until April"},{key:"topics",label:"Topic",placeholder:"scheduling",fact:"No meetings before 10am"}];function ap(){return q.notify.component({className:"sm:max-w-lg",renderer:({close:a})=>(0,b.jsx)(aq,{onDone:a})})}function aq({onDone:a}){let[c,d]=(0,l.useState)("people"),[e,f]=(0,l.useState)(""),[g,h]=(0,l.useState)(""),[j,k]=(0,l.useState)(""),[q,r,,v]=(0,ac.useServerAction)(Q,{errorMessage:!1,onOk:()=>{(0,ae.revalidate)(m.queryKey.memory),a()}}),w=ao.find(a=>a.key===c),x=e.trim()&&g.trim()&&!r,y=()=>{x&&q(`${c}/${e.trim()}`,g.trim(),j.split("\n").map(a=>a.trim()).filter(Boolean))};return(0,b.jsxs)(aa.SettingDialogContent,{title:"New note",description:"Where Thursday keeps what she learns about this.",footer:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n.Button,{variant:"ghost",onClick:a,children:"Cancel"}),(0,b.jsxs)(n.Button,{disabled:!x,loading:r,onClick:y,children:[!r&&(0,b.jsx)(i.Plus,{}),"Create"]})]}),children:[(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)(o.Field,{children:[(0,b.jsx)(o.FieldLabel,{children:"Kind"}),(0,b.jsx)(s.Tabs,{value:c,onValueChange:a=>d(a),children:(0,b.jsx)(s.TabsList,{className:"w-full",children:ao.map(a=>(0,b.jsx)(s.TabsTrigger,{value:a.key,children:a.label},a.key))})})]}),(0,b.jsxs)(o.Field,{children:[(0,b.jsx)(o.FieldLabel,{htmlFor:"note-name",children:"Name"}),(0,b.jsxs)(o.FieldContent,{children:[(0,b.jsx)(p.Input,{id:"note-name",value:e,onChange:a=>f(a.target.value),placeholder:w?.placeholder,spellCheck:!1,required:!0}),(0,b.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[c,"/",e.trim()||"…"]})]})]}),(0,b.jsxs)(o.Field,{children:[(0,b.jsx)(o.FieldLabel,{htmlFor:"note-summary",children:"Summary"}),(0,b.jsx)(o.FieldContent,{children:(0,b.jsx)(p.Input,{id:"note-summary",value:g,onChange:a=>h(a.target.value),onKeyDown:a=>{a.nativeEvent.isComposing||229===a.keyCode||"Enter"===a.key&&y()},placeholder:"One line Thursday sees in her list",maxLength:u.MEMORY_LIMITS.descriptionChars,required:!0})})]}),(0,b.jsxs)(o.Field,{children:[(0,b.jsx)(o.FieldLabel,{htmlFor:"note-facts",children:"Facts"}),(0,b.jsx)(t.Textarea,{id:"note-facts",value:j,onChange:a=>k(a.target.value),placeholder:`One per line
|
|
2
2
|
${w?.fact??""}`,className:"min-h-24 resize-none text-sm"})]})]}),v&&(0,b.jsx)("p",{className:"font-mono text-xs text-destructive",children:v})]})}a.s(["MemorySetting",0,function(){let{items:a,isLoading:c,isLoadingMore:d,error:e,hasMore:f,sentinelRef:g}=(0,ad.useServerPages)({key:a=>m.queryKey.memoryPage(a*u.PAGE_SIZE)}),[h,j]=(0,l.useState)(""),[k,o]=(0,l.useState)(new Set),[p,q]=(0,l.useState)(!1);if(c)return(0,b.jsx)(aa.SettingSkeleton,{});if(e)return(0,b.jsx)(aa.SettingError,{message:e.message});let s=h.trim().toLowerCase(),t=s?a.filter(a=>[a.path,a.description,...a.facts.map(a=>a.text)].some(a=>a.toLowerCase().includes(s))):a,v=a.reduce((a,b)=>a+b.factCount,0),w=f?"+":"";return(0,b.jsxs)("div",{className:"relative h-full min-h-0",children:[(0,b.jsxs)(aa.SettingScreen,{footer:(0,b.jsxs)(n.Button,{size:"sm",variant:p?"secondary":"ghost","aria-pressed":p,onClick:()=>q(!p),children:[(0,b.jsx)(ai,{}),"Edit with a model"]}),children:[(0,b.jsx)(aa.SettingToolbar,{count:(0,b.jsxs)("span",{className:"flex items-center gap-3",children:[`${a.length}${w} notes \xb7 ${v}${w} facts`,(0,b.jsxs)(n.Button,{size:"sm",variant:"outline",className:"font-sans",onClick:ap,children:[(0,b.jsx)(i.Plus,{}),"New note"]})]}),children:(0,b.jsx)(aa.SettingFilter,{value:h,onChange:j,placeholder:"Filter memory"})}),s&&0===t.length&&(0,b.jsx)("p",{className:"px-1 text-xs text-muted-foreground/60",children:"Nothing matches"}),af.map(({key:a,label:c})=>{let d=t.filter(b=>(function(a){if($.includes(a))return"you";let b=a.slice(0,a.indexOf("/"));return _.includes(b)?b:"other"})(b.path)===a);return 0===d.length?null:(0,b.jsx)(aa.SettingGroup,{label:c,children:(0,b.jsx)(aa.SettingItems,{children:d.map(a=>(0,b.jsx)(ak,{note:a,open:k.has(a.id)!==!!s,onToggle:()=>{let b;return b=a.id,o(a=>{let c=new Set(a);return c.delete(b)||c.add(b),c})}},a.id))})},a)}),(0,b.jsx)(aa.SettingMore,{hasMore:f,loading:d,sentinelRef:g,ghost:(0,b.jsxs)("div",{className:"flex h-12 items-center gap-3 px-4",children:[(0,b.jsx)(r.Skeleton,{className:"h-3 w-24"}),(0,b.jsx)(r.Skeleton,{className:"h-3 w-56"})]})})]}),p&&(0,b.jsx)(L,{notes:a})]})}],857022)}];
|
|
3
3
|
|
|
4
4
|
//# sourceMappingURL=features_memory_components_memory-setting_tsx_0oa43sw._.js.map
|
package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[41014,a=>{"use strict";var b=a.i(187924),c=a.i(256711),d=a.i(987234),e=a.i(164831);let f={name:"calendar-days",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M12 13h.01",key:"y0uutt"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M8 17h.01",key:"p3bg7i"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M16 17h.01",key:"ql8jdd"}]]};f.node;let g=(0,e.default)(f);var h=a.i(752562),i=a.i(589027),j=a.i(141146),k=a.i(875160),l=a.i(272944),m=a.i(738835),n=a.i(951675),o=a.i(474215),p=a.i(572131),q=a.i(767561),r=a.i(340695),s=a.i(965733),t=a.i(676504),u=a.i(205522),v=a.i(446181),w=a.i(777794),x=a.i(545097),y=a.i(280281),z=a.i(546893),A=a.i(287702),B=a.i(913834),C=a.i(135432),D=a.i(619477),E=a.i(28996),F=a.i(199169),G=a.i(313237),H=a.i(759497),I=a.i(497895),J=a.i(405050);let K=(0,J.createServerReference)("7fd0304c674bbabbac63354fcd8446f6eb758d0408",J.callServer,void 0,J.findSourceMapURL,"createRoutineAction"),L=(0,J.createServerReference)("7f0375729fbb966b499d38ee9eb2db65aa5959ac23",J.callServer,void 0,J.findSourceMapURL,"deleteRoutineAction"),M=(0,J.createServerReference)("7fa91a53770f9025c546516ecb8724f52522e1bd56",J.callServer,void 0,J.findSourceMapURL,"runRoutineNowAction"),N=(0,J.createServerReference)("7fb428b8e286601420a6d697b143fa9d30d022f56a",J.callServer,void 0,J.findSourceMapURL,"updateRoutineAction");var O=a.i(702080);let P=[1,2,3,4,5,6,7],Q=O.default.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/,"A time is HH:MM, 00:00 to 23:59");function R(a){let[b,c]=a.split(" "),[d,e,f]=b.split("-").map(Number),[g,h]=c.split(":").map(Number);return new Date(d,e-1,f,g,h)}let S=/^\d{4}-\d\d-\d\d ([01]\d|2[0-3]):[0-5]\d$/,T=O.default.string().regex(S,'A moment is "YYYY-MM-DD HH:MM"').refine(a=>{if(!S.test(a))return!0;let b=R(a);return b.getMonth()===Number(a.slice(5,7))-1&&b.getDate()===Number(a.slice(8,10))},"There is no such day"),U=O.default.discriminatedUnion("kind",[O.default.object({kind:O.default.literal("once"),at:T}),O.default.object({kind:O.default.literal("daily"),time:Q,days:O.default.array(O.default.number().int().min(1).max(7)).min(1,"Pick at least one day").transform(a=>[...new Set(a)].sort((a,b)=>a-b))}),O.default.object({kind:O.default.literal("every"),hours:O.default.number().int().min(A.ROUTINE.minHours,`No more often than every ${A.ROUTINE.minHours}h`).max(168)})]),V=O.default.object({bot:O.default.string().trim().min(1,"Pick a bot"),label:O.default.string().trim().min(1,"Give it a name").max(80),request:O.default.string().trim().min(1,"Say what it should do"),schedule:U}),W=O.default.object({id:O.default.string(),status:O.default.enum(["running","waiting","done","cancelled"]),outcome:O.default.string().nullable(),updatedAt:F.DateLikeSchema});V.extend({id:O.default.string(),enabled:O.default.boolean(),nextRunAt:F.DateLikeSchema,runs:O.default.array(W)});let X=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Y=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Z(a){if("once"===a.kind){let[b,c]=a.at.split(" "),[,d,e]=b.split("-").map(Number);return`Once \xb7 ${Y[d-1]} ${e} ${c}`}if("every"===a.kind)return 1===a.hours?"Every hour":`Every ${a.hours} hours`;let{days:b,time:c}=a;if(7===b.length)return`Daily ${c}`;if(1===b.length)return`${X[b[0]-1]} ${c}`;let d=b.every((a,c)=>0===c||a===b[c-1]+1)?`${X[b[0]-1]}–${X[b.at(-1)-1]}`:b.map(a=>X[a-1]).join(" ");return`Daily ${c} \xb7 ${d}`}var $=a.i(156819);function _({routine:a,bots:c,open:d,onOpen:e,onSwitch:f}){let g=function(a,b){let c=a.runs[0],d=c?.outcome?(0,I.plainText)(c.outcome):"",e=c?`${(0,F.whenOf)(c.updatedAt)}${d?` — ${d}`:""}`:"Not run yet";if(!a.enabled)return{text:`Off \xb7 ${e}`,tone:"text-muted-foreground"};let f=b?.find(b=>b.name===a.bot);return b&&(!f||f.disabled)?{text:f?`${a.bot} is switched off`:`${a.bot} is gone — pick another bot`,tone:I.WAITING_INK,waits:!0}:c?.status==="running"?{text:"Running now",tone:"",shine:!0}:c?.status==="waiting"?{text:`The last run waits on you${d?`: ${d}`:""}`,tone:I.WAITING_INK,waits:!0}:{text:e,tone:"text-muted-foreground"}}(a,c),h=a.runs[0]?.status==="running";return(0,b.jsxs)("div",{className:(0,I.cn)("flex items-center gap-3 p-4 transition-colors",d?"bg-muted/80":"hover:bg-muted/50"),children:[(0,b.jsxs)("button",{type:"button",onClick:e,className:(0,I.cn)("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",!a.enabled&&"opacity-70"),children:[(0,b.jsx)(B.BotMark,{size:40,seed:a.bot,...(0,B.markOf)(a.bot,c),state:h?"thinking":"idle",notify:!!g.waits,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}),h&&(0,b.jsx)(k.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"})]}),(0,b.jsx)("span",{className:"flex min-w-0 text-[13px] leading-snug",children:g.shine?(0,b.jsx)(x.ShinyText,{text:g.text,speed:2.2,className:"min-w-0 truncate"}):(0,b.jsx)("span",{className:(0,I.cn)("min-w-0 truncate",g.tone),children:g.text})})]}),(0,b.jsxs)("span",{className:"flex w-44 shrink-0 flex-col items-end gap-0.5 font-mono text-[11px] leading-4 text-muted-foreground tabular-nums",children:[(0,b.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 text-foreground",children:[(0,b.jsx)($.RoutineMark,{className:"size-3 shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"truncate",children:Z(a.schedule)})]}),(0,b.jsx)("span",{className:"max-w-full truncate text-muted-foreground/70",children:a.enabled?`next ${(0,F.whenOf)(a.nextRunAt)}`:"off"})]})]}),(0,b.jsx)(y.Switch,{checked:a.enabled,onCheckedChange:f,"aria-label":`${a.label} on or off`,className:"shrink-0"}),(0,b.jsx)("button",{type:"button",onClick:e,"aria-label":`Open ${a.label}`,className:"shrink-0 rounded-md text-muted-foreground outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,b.jsx)(j.ChevronRight,{className:"size-4"})})]})}let aa=a=>String(a).padStart(2,"0");function ab(a,b=new Date){let d=new Date(b);return d.setDate(d.getDate()+a),(0,c.format)(d,"yyyy-MM-dd")}let ac=(a,b)=>{let c=a?.schedule;return{label:a?.label??"",bot:a?.bot??b.find(a=>!a.disabled)?.name??"",request:a?.request??"",kind:c?.kind??"daily",time:c?.kind==="daily"?c.time:c?.kind==="once"?c.at.slice(11):"09:00",days:c?.kind==="daily"?c.days:[...P],hours:c?.kind==="every"?c.hours:6,date:c?.kind==="once"?c.at.slice(0,10):ab(1)}};function ad(a){let b=/^\d\d:\d\d$/.test(a.time);return"once"===a.kind?b&&a.date?{kind:"once",at:`${a.date} ${a.time}`}:null:"daily"===a.kind?a.days.length&&b?{kind:"daily",time:a.time,days:a.days}:null:{kind:"every",hours:a.hours}}let ae=a=>a?.kind==="once"&&R(a.at)<=new Date,af=[{label:"Every day",days:[...P]},{label:"Weekdays",days:[1,2,3,4,5]},{label:"Weekends",days:[6,7]}],ag=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ah=[1,2,3,6,12,24].filter(a=>a>=A.ROUTINE.minHours);function ai({routine:a,bots:c,onClose:d,onMade:e}){var f,g;let h,[k,x]=(0,p.useState)(null),A=(0,p.useCallback)(a=>{x(a?.closest("[data-slot=dialog-content]")??null)},[]),D="new"===a?null:a,J="new"===a?"new":a?.id??"",[O,Q]=(0,p.useState)(()=>ac(D,c));(0,p.useEffect)(()=>Q(ac(D,c)),[J]);let R=a=>Q(b=>({...b,...a})),S=()=>(0,H.revalidate)(q.queryKey.routines),[T,U]=(0,G.useServerAction)(K,{onOk:a=>{S(),e(a.id)}}),[V]=(0,G.useServerAction)(N,{onOk:S}),[W]=(0,G.useServerAction)(L,{onOk:S}),[Y,_]=(0,G.useServerAction)(M,{onOk:()=>{S(),(0,H.revalidate)(q.queryKey.threads)}}),am=ad(O),ar=am&&!ae(am)&&O.label.trim()&&O.bot&&O.request.trim()?{label:O.label.trim(),bot:O.bot,request:O.request.trim(),schedule:am}:null,as=a=>{D&&V(D.id,a)},at=a=>{R(a);let b=ad({...O,...a});!b||ae(b)||D&&function(a,b){if("once"===a.kind)return"once"===b.kind&&a.at===b.at;if("every"===a.kind)return"every"===b.kind&&a.hours===b.hours;let c=a=>[...a].sort((a,b)=>a-b).join();return"daily"===b.kind&&a.time===b.time&&c(a.days)===c(b.days)}(b,D.schedule)||as({schedule:b,..."once"===b.kind?{enabled:!0}:{}})},au=!!(D&&(O.label.trim()&&O.label.trim()!==D.label||O.request.trim()&&O.request.trim()!==D.request)),av=D?au:!!(O.label.trim()||O.request.trim()),aw=(0,p.useRef)(av);aw.current=av;let ax=(0,E.useSettingsStore)(a=>a.holdUnsaved);(0,p.useEffect)(()=>(ax(()=>aw.current),()=>ax(null)),[ax]);let ay=async()=>{(!aw.current||await v.notify.discard())&&d()},az=async()=>{!D||await v.notify.confirm({title:`Delete "${D.label}"?`,description:"It starts no more. The jobs it already opened stay.",okText:"Delete",destructive:!0})&&(await W(D.id).catch(()=>{}),d())},aA=c.find(a=>a.name===O.bot),aB=D?.runs[0]?.status==="running"||D?.runs[0]?.status==="waiting";return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{ref:A,hidden:!0}),(0,b.jsx)(s.Dialog,{open:!!(a&&k),onOpenChange:a=>!a&&void ay(),modal:!1,disablePointerDismissal:!0,children:(0,b.jsx)(s.DialogPortal,{container:k,children:(0,b.jsx)(s.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&&(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:[aA?(0,b.jsx)(B.BotMark,{size:28,seed:aA.name,...(0,B.markOf)(aA.name,c),notify:!1,className:"shrink-0"}):(0,b.jsx)("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,b.jsx)($.RoutineMark,{className:"size-3.5"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)(s.DialogTitle,{className:"sr-only",children:D?D.label:"New routine"}),(0,b.jsx)("p",{className:"truncate text-[15px] leading-5 font-semibold",children:D?D.label:"New routine"}),D&&(0,b.jsxs)("p",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[(0,b.jsx)($.RoutineMark,{className:"size-3 shrink-0"}),(0,b.jsxs)("span",{className:"truncate",children:[D.bot," · ",Z(D.schedule),D.enabled&&` \xb7 next ${(0,F.whenOf)(D.nextRunAt)}`]})]})]}),D&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(y.Switch,{checked:D.enabled,onCheckedChange:a=>void V(D.id,{enabled:a}),"aria-label":`${D.label} on or off`,className:"mr-1 shrink-0"}),(0,b.jsxs)(t.DropdownMenu,{children:[(0,b.jsx)(t.DropdownMenuTrigger,{render:(0,b.jsx)(r.Button,{size:"icon-sm",variant:"ghost","aria-label":"More",className:"text-muted-foreground"}),children:(0,b.jsx)(l.MoreHorizontal,{})}),(0,b.jsx)(t.DropdownMenuContent,{align:"end",children:(0,b.jsxs)(t.DropdownMenuItem,{variant:"destructive",onClick:az,children:[(0,b.jsx)(n.Trash2,{}),"Delete"]})})]})]}),(0,b.jsx)(s.DialogClose,{render:(0,b.jsx)(r.Button,{size:"icon-sm",variant:"ghost","aria-label":"Close the routine"}),children:(0,b.jsx)(o.X,{})})]}),(0,b.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pt-3 pb-5",children:[(0,b.jsxs)(aq,{label:"Name",htmlFor:"routine-name",children:[(0,b.jsx)(u.Input,{id:"routine-name",value:O.label,onChange:a=>R({label:a.target.value}),placeholder:"e.g. Morning mail",maxLength:80,autoFocus:!D}),(0,b.jsx)(aj,{children:"What it is called in this list, and what she calls it on a call."})]}),(0,b.jsxs)(aq,{label:"Bot",children:[(0,b.jsxs)(t.DropdownMenu,{children:[(0,b.jsxs)(t.DropdownMenuTrigger,{render:(0,b.jsx)(r.Button,{variant:"outline",className:"justify-start gap-2 pl-1.5 font-normal"}),children:[aA?(0,b.jsx)(B.BotMark,{size:20,seed:aA.name,...(0,B.markOf)(aA.name,c),notify:!1,className:"shrink-0"}):null,(0,b.jsx)("span",{className:(0,I.cn)(!aA&&"pl-1.5 text-muted-foreground"),children:aA?.name??(O.bot||"Pick a bot")}),(0,b.jsx)(i.ChevronDown,{className:"ml-1 size-3.5 text-muted-foreground"})]}),(0,b.jsx)(t.DropdownMenuContent,{align:"start",children:(0,b.jsx)(t.DropdownMenuGroup,{children:c.filter(a=>!a.disabled).map(a=>(0,b.jsxs)(t.DropdownMenuItem,{onClick:()=>{R({bot:a.name}),a.name!==D?.bot&&as({bot:a.name})},children:[(0,b.jsx)(B.BotMark,{size:16,seed:a.name,...(0,B.markOf)(a.name,c),notify:!1,className:"shrink-0"}),a.name]},a.name))})})]}),(0,b.jsx)(aj,{children:"Who does the job each time it starts."})]}),(0,b.jsx)(aq,{label:"When",children:(0,b.jsxs)("div",{className:"space-y-3.5",children:[(0,b.jsx)(w.Segmented,{"aria-label":"How it starts",value:O.kind,onChange:a=>at({kind:a}),options:[{value:"once",label:"Once"},{value:"daily",label:"On set days"},{value:"every",label:"Every few hours"}]}),(0,b.jsx)("div",{className:"space-y-2.5",children:"once"===O.kind?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(al,{word:"On",children:(0,b.jsx)(an,{value:O.date,onPick:a=>at({date:a})})}),(0,b.jsxs)(al,{word:"At",children:[(0,b.jsx)(ao,{value:O.time,onChange:a=>R({time:a}),onDone:()=>at({})}),(0,b.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"or"}),(0,b.jsx)(ak,{picked:!1,onClick:()=>{let a;return at(((a=new Date(Date.now()+36e5)).setMinutes(5*Math.ceil(a.getMinutes()/5),0,0),{date:ab(0,a),time:`${aa(a.getHours())}:${aa(a.getMinutes())}`}))},children:"In an hour"})]})]}):"daily"===O.kind?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(al,{word:"On",children:P.map(a=>{let c=O.days.includes(a);return(0,b.jsx)(ak,{picked:c,several:!0,"aria-label":ag[a-1],onClick:()=>at({days:c?O.days.filter(b=>b!==a):[...O.days,a].sort((a,b)=>a-b)}),children:X[a-1]},a)})}),(0,b.jsx)(al,{children:af.map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>at({days:[...a.days]}),className:"h-6.5 rounded-full bg-muted px-2.5 text-xs text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:a.label},a.label))}),(0,b.jsx)(al,{word:"At",children:(0,b.jsx)(ao,{value:O.time,onChange:a=>R({time:a}),onDone:()=>at({})})})]}):(0,b.jsxs)(al,{word:"Every",children:[(ah.includes(O.hours)?ah:[...ah,O.hours].sort((a,b)=>a-b)).map(a=>(0,b.jsx)(ak,{picked:a===O.hours,onClick:()=>at({hours:a}),className:"min-w-10 px-3",children:a},a)),(0,b.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"hours"})]})}),(0,b.jsx)(ap,{schedule:am,kind:O.kind})]})}),(0,b.jsxs)(aq,{label:"Job",htmlFor:"routine-request",children:[(0,b.jsx)(z.Textarea,{id:"routine-request",value:O.request,onChange:a=>R({request:a.target.value}),placeholder:"e.g. Go through the mail that came since the last run and draft replies to what needs one. Send nothing.",className:"min-h-28"}),(0,b.jsx)(aj,{children:"Handed to the bot as a new thread each time, with a line on how the last run ended. Nobody is there to ask, so say everything it needs."})]}),D&&(0,b.jsxs)("div",{className:"pt-1",children:[(0,b.jsx)("div",{className:"flex h-6 items-center",children:(0,b.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"Runs"})}),0===D.runs.length?(0,b.jsx)("p",{className:"py-2 text-[13px] text-muted-foreground",children:"Not run yet."}):D.runs.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>{var b;return b=a.id,void(E.useSettingsStore.getState().hide(),C.roomOpens.open(b))},className:"flex h-9 w-full items-center gap-3 border-t border-border/60 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,b.jsx)("span",{className:"w-28 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:(0,F.whenOf)(a.updatedAt)}),(0,b.jsx)("span",{className:(0,I.cn)("min-w-0 flex-1 truncate","waiting"===a.status?I.WAITING_INK:"text-muted-foreground"),children:"running"===a.status?"Running now":a.outcome?(0,I.plainText)(a.outcome):"cancelled"===a.status?"Stopped":"No words"}),(0,b.jsx)(j.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground"})]},a.id))]})]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-t border-border/60 px-5 py-3",children:[(0,b.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-4 text-muted-foreground",children:D||ar?"Starts while Thursday is running on this computer, whether or not a tab is open. A time that passed meanwhile starts once, not once for each.":`Still needs ${f=O,g=am,(h=[f.label.trim()?null:"a name",f.bot?null:"a bot",!g?"a time":ae(g)?"a time still ahead":null,f.request.trim()?null:"a job"].filter(a=>null!==a)).length>1?`${h.slice(0,-1).join(", ")} and ${h.at(-1)}`:h[0]??"nothing"}.`}),au&&(0,b.jsx)(r.Button,{size:"sm",onClick:()=>{if(!D)return;let a={};O.label.trim()&&O.label.trim()!==D.label&&(a.label=O.label.trim()),O.request.trim()&&O.request.trim()!==D.request&&(a.request=O.request.trim()),Object.keys(a).length&&as(a)},children:"Save"}),D?(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",loading:_,disabled:aB,title:aB?"Its last run is still open":void 0,onClick:()=>void Y(D.id),children:[(0,b.jsx)(m.Play,{}),"Run now"]}):(0,b.jsx)(r.Button,{size:"sm",loading:U,disabled:!ar,onClick:()=>ar&&void T(ar),children:"Create"})]})]})})})})]})}let aj=({children:a})=>(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a});function ak({picked:a,several:c=!1,className:d,children:e,...f}){return(0,b.jsxs)("button",{type:"button","aria-pressed":a,className:(0,I.cn)("inline-flex h-8 items-center justify-center gap-1.5 rounded-full px-3.5 text-[13px] whitespace-nowrap outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",!a&&"text-foreground ring-1 ring-border ring-inset hover:bg-muted",a&&(c?"bg-brand/10 pl-2.5 font-medium text-brand ring-1 ring-brand/30 ring-inset":"bg-brand font-medium text-brand-foreground"),d),...f,children:[a&&c&&(0,b.jsx)(h.Check,{className:"size-3.5"}),e]})}function al({word:a,children:c}){return(0,b.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,b.jsx)("span",{className:"flex h-8 w-9 shrink-0 items-center text-[13px] text-muted-foreground",children:a}),(0,b.jsx)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:c})]})}function am(a){let b=R(`${a} 00:00`),d=(b.getTime()-R(`${ab(0)} 00:00`).getTime())/864e5;return(0,c.format)(b,d<7?"EEE d":"EEE, MMM d")}function an({value:a,onPick:c}){let d=(0,p.useRef)(null),e=[0,1,2,3].map(a=>ab(a)),f=()=>d.current?.showPicker();return(0,b.jsxs)(b.Fragment,{children:[e.map((d,e)=>(0,b.jsx)(ak,{picked:d===a,onClick:()=>c(d),children:0===e?"Today":1===e?"Tomorrow":am(d)},d)),!e.includes(a)&&(0,b.jsx)(ak,{picked:!0,onClick:f,children:am(a)}),(0,b.jsxs)("span",{className:"relative",children:[(0,b.jsx)(ak,{picked:!1,"aria-label":"Another day",onClick:f,className:"w-8 px-0",children:(0,b.jsx)(g,{className:"size-3.5"})}),(0,b.jsx)("input",{ref:d,type:"date",tabIndex:-1,"aria-hidden":!0,min:e[0],value:a,onChange:a=>a.target.value&&c(a.target.value),className:"pointer-events-none absolute inset-0 opacity-0"})]})]})}function ao({value:a,onChange:c,onDone:d}){return(0,b.jsx)(u.Input,{type:"time","aria-label":"Time of day",value:a,onChange:a=>c(a.target.value),onBlur:d,onClick:a=>a.currentTarget.showPicker?.(),className:"h-8.5 w-28 px-3 text-[15px] tabular-nums md:text-[15px] [&::-webkit-calendar-picker-indicator]:hidden"})}function ap({schedule:a,kind:c}){if(!a||ae(a))return(0,b.jsx)("p",{className:"text-xs text-destructive",children:a?"That time has passed. Pick a later one.":"daily"===c?"Pick a time and at least one day.":"Pick a time."});let e=function(a,b){if("once"===a.kind)return R(a.at);if("every"===a.kind)return new Date(b.getTime()+36e5*a.hours);let[c,d]=a.time.split(":").map(Number);for(let e=0;e<=7;e++){let f=new Date(b);f.setDate(f.getDate()+e),f.setHours(c,d,0,0);let g=0===f.getDay()?7:f.getDay();if(f>b&&a.days.includes(g))return f}return new Date(b.getTime()+864e5)}(a,new Date);return(0,b.jsxs)("p",{className:"flex items-start gap-2 text-[13px] leading-5",children:[(0,b.jsx)($.RoutineMark,{className:"mt-0.75 size-3.5 shrink-0 text-muted-foreground"}),(0,b.jsxs)("span",{className:"min-w-0",children:[Z(a),(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" · ","once"===a.kind?`${(0,d.formatDistanceToNowStrict)(e,{addSuffix:!0})}, then it switches itself off`:`first start ${(0,F.whenOf)(e)}`]})]})]})}function aq({label:a,htmlFor:c,children:d}){return(0,b.jsxs)("div",{className:"flex gap-3",children:[(0,b.jsx)("label",{htmlFor:c,className:"w-14 shrink-0 pt-2 font-mono text-xs text-muted-foreground",children:a}),(0,b.jsx)("div",{className:"min-w-0 flex-1 space-y-1.5",children:d})]})}a.s(["RoutineSetting",0,function(){let[a,c]=(0,p.useState)(null),{data:d,isLoading:e,error:f}=(0,H.useServerRoute)(q.queryKey.routines),{data:g}=(0,H.useServerRoute)(q.queryKey.bot),[h]=(0,G.useServerAction)(N,{onOk:()=>(0,H.revalidate)(q.queryKey.routines)});if(e)return(0,b.jsx)(D.SettingSkeleton,{rows:3});if(f)return(0,b.jsx)(D.SettingError,{message:f.message});let i=d??[],j=i.filter(a=>a.enabled).length,k=i.find(b=>b.id===a);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.SettingScreen,{footer:(0,b.jsxs)(D.SettingRailNote,{children:[i.length," set up · ",j," on",i.length>=A.ROUTINE.max&&` \xb7 ${A.ROUTINE.max} is the most`]}),children:(0,b.jsx)(D.SettingItems,{addRow:i.length<A.ROUTINE.max?{label:"New routine",onClick:()=>c("new")}:void 0,children:0===i.length?(0,b.jsx)("p",{className:"p-4 text-sm leading-relaxed text-muted-foreground",children:'Nothing starts by itself yet. Tell Thursday what should — "every weekday at nine, go through my mail" — or make one here.'}):i.map(d=>(0,b.jsx)(_,{routine:d,bots:g,open:d.id===a,onOpen:()=>c(d.id),onSwitch:a=>h(d.id,{enabled:a})},d.id))})}),(0,b.jsx)(ai,{routine:"new"===a?"new":k??null,bots:g??[],onClose:()=>c(null),onMade:a=>c(a)})]})}],41014)}];
|
|
1
|
+
module.exports=[41014,a=>{"use strict";var b=a.i(187924),c=a.i(256711),d=a.i(987234),e=a.i(164831);let f={name:"calendar-days",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M12 13h.01",key:"y0uutt"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M8 17h.01",key:"p3bg7i"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M16 17h.01",key:"ql8jdd"}]]};f.node;let g=(0,e.default)(f);var h=a.i(752562),i=a.i(589027),j=a.i(141146),k=a.i(875160),l=a.i(272944),m=a.i(738835),n=a.i(951675),o=a.i(474215),p=a.i(572131),q=a.i(767561),r=a.i(340695),s=a.i(965733),t=a.i(676504),u=a.i(205522),v=a.i(446181),w=a.i(777794),x=a.i(545097),y=a.i(280281),z=a.i(546893),A=a.i(287702),B=a.i(913834),C=a.i(135432),D=a.i(619477),E=a.i(28996),F=a.i(199169),G=a.i(313237),H=a.i(759497),I=a.i(497895),J=a.i(405050);let K=(0,J.createServerReference)("7f13f97022e2e4f41d0edde565631b58dc7a09d956",J.callServer,void 0,J.findSourceMapURL,"createRoutineAction"),L=(0,J.createServerReference)("7fad3f5b774013446a99524fe82303ed10692a942a",J.callServer,void 0,J.findSourceMapURL,"deleteRoutineAction"),M=(0,J.createServerReference)("7fa3c13892651d1466860cef825252404a5d23ee60",J.callServer,void 0,J.findSourceMapURL,"runRoutineNowAction"),N=(0,J.createServerReference)("7fa811ad9a59918dc05c6e13fa8be4909b175bbfb0",J.callServer,void 0,J.findSourceMapURL,"updateRoutineAction");var O=a.i(702080);let P=[1,2,3,4,5,6,7],Q=O.default.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/,"A time is HH:MM, 00:00 to 23:59");function R(a){let[b,c]=a.split(" "),[d,e,f]=b.split("-").map(Number),[g,h]=c.split(":").map(Number);return new Date(d,e-1,f,g,h)}let S=/^\d{4}-\d\d-\d\d ([01]\d|2[0-3]):[0-5]\d$/,T=O.default.string().regex(S,'A moment is "YYYY-MM-DD HH:MM"').refine(a=>{if(!S.test(a))return!0;let b=R(a);return b.getMonth()===Number(a.slice(5,7))-1&&b.getDate()===Number(a.slice(8,10))},"There is no such day"),U=O.default.discriminatedUnion("kind",[O.default.object({kind:O.default.literal("once"),at:T}),O.default.object({kind:O.default.literal("daily"),time:Q,days:O.default.array(O.default.number().int().min(1).max(7)).min(1,"Pick at least one day").transform(a=>[...new Set(a)].sort((a,b)=>a-b))}),O.default.object({kind:O.default.literal("every"),hours:O.default.number().int().min(A.ROUTINE.minHours,`No more often than every ${A.ROUTINE.minHours}h`).max(168)})]),V=O.default.object({bot:O.default.string().trim().min(1,"Pick a bot"),label:O.default.string().trim().min(1,"Give it a name").max(80),request:O.default.string().trim().min(1,"Say what it should do"),schedule:U}),W=O.default.object({id:O.default.string(),status:O.default.enum(["running","waiting","done","cancelled"]),outcome:O.default.string().nullable(),updatedAt:F.DateLikeSchema});V.extend({id:O.default.string(),enabled:O.default.boolean(),nextRunAt:F.DateLikeSchema,runs:O.default.array(W)});let X=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Y=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Z(a){if("once"===a.kind){let[b,c]=a.at.split(" "),[,d,e]=b.split("-").map(Number);return`Once \xb7 ${Y[d-1]} ${e} ${c}`}if("every"===a.kind)return 1===a.hours?"Every hour":`Every ${a.hours} hours`;let{days:b,time:c}=a;if(7===b.length)return`Daily ${c}`;if(1===b.length)return`${X[b[0]-1]} ${c}`;let d=b.every((a,c)=>0===c||a===b[c-1]+1)?`${X[b[0]-1]}–${X[b.at(-1)-1]}`:b.map(a=>X[a-1]).join(" ");return`Daily ${c} \xb7 ${d}`}var $=a.i(156819);function _({routine:a,bots:c,open:d,onOpen:e,onSwitch:f}){let g=function(a,b){let c=a.runs[0],d=c?.outcome?(0,I.plainText)(c.outcome):"",e=c?`${(0,F.whenOf)(c.updatedAt)}${d?` — ${d}`:""}`:"Not run yet";if(!a.enabled)return{text:`Off \xb7 ${e}`,tone:"text-muted-foreground"};let f=b?.find(b=>b.name===a.bot);return b&&(!f||f.disabled)?{text:f?`${a.bot} is switched off`:`${a.bot} is gone — pick another bot`,tone:I.WAITING_INK,waits:!0}:c?.status==="running"?{text:"Running now",tone:"",shine:!0}:c?.status==="waiting"?{text:`The last run waits on you${d?`: ${d}`:""}`,tone:I.WAITING_INK,waits:!0}:{text:e,tone:"text-muted-foreground"}}(a,c),h=a.runs[0]?.status==="running";return(0,b.jsxs)("div",{className:(0,I.cn)("flex items-center gap-3 p-4 transition-colors",d?"bg-muted/80":"hover:bg-muted/50"),children:[(0,b.jsxs)("button",{type:"button",onClick:e,className:(0,I.cn)("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",!a.enabled&&"opacity-70"),children:[(0,b.jsx)(B.BotMark,{size:40,seed:a.bot,...(0,B.markOf)(a.bot,c),state:h?"thinking":"idle",notify:!!g.waits,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}),h&&(0,b.jsx)(k.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"})]}),(0,b.jsx)("span",{className:"flex min-w-0 text-[13px] leading-snug",children:g.shine?(0,b.jsx)(x.ShinyText,{text:g.text,speed:2.2,className:"min-w-0 truncate"}):(0,b.jsx)("span",{className:(0,I.cn)("min-w-0 truncate",g.tone),children:g.text})})]}),(0,b.jsxs)("span",{className:"flex w-44 shrink-0 flex-col items-end gap-0.5 font-mono text-[11px] leading-4 text-muted-foreground tabular-nums",children:[(0,b.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 text-foreground",children:[(0,b.jsx)($.RoutineMark,{className:"size-3 shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"truncate",children:Z(a.schedule)})]}),(0,b.jsx)("span",{className:"max-w-full truncate text-muted-foreground/70",children:a.enabled?`next ${(0,F.whenOf)(a.nextRunAt)}`:"off"})]})]}),(0,b.jsx)(y.Switch,{checked:a.enabled,onCheckedChange:f,"aria-label":`${a.label} on or off`,className:"shrink-0"}),(0,b.jsx)("button",{type:"button",onClick:e,"aria-label":`Open ${a.label}`,className:"shrink-0 rounded-md text-muted-foreground outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,b.jsx)(j.ChevronRight,{className:"size-4"})})]})}let aa=a=>String(a).padStart(2,"0");function ab(a,b=new Date){let d=new Date(b);return d.setDate(d.getDate()+a),(0,c.format)(d,"yyyy-MM-dd")}let ac=(a,b)=>{let c=a?.schedule;return{label:a?.label??"",bot:a?.bot??b.find(a=>!a.disabled)?.name??"",request:a?.request??"",kind:c?.kind??"daily",time:c?.kind==="daily"?c.time:c?.kind==="once"?c.at.slice(11):"09:00",days:c?.kind==="daily"?c.days:[...P],hours:c?.kind==="every"?c.hours:6,date:c?.kind==="once"?c.at.slice(0,10):ab(1)}};function ad(a){let b=/^\d\d:\d\d$/.test(a.time);return"once"===a.kind?b&&a.date?{kind:"once",at:`${a.date} ${a.time}`}:null:"daily"===a.kind?a.days.length&&b?{kind:"daily",time:a.time,days:a.days}:null:{kind:"every",hours:a.hours}}let ae=a=>a?.kind==="once"&&R(a.at)<=new Date,af=[{label:"Every day",days:[...P]},{label:"Weekdays",days:[1,2,3,4,5]},{label:"Weekends",days:[6,7]}],ag=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ah=[1,2,3,6,12,24].filter(a=>a>=A.ROUTINE.minHours);function ai({routine:a,bots:c,onClose:d,onMade:e}){var f,g;let h,[k,x]=(0,p.useState)(null),A=(0,p.useCallback)(a=>{x(a?.closest("[data-slot=dialog-content]")??null)},[]),D="new"===a?null:a,J="new"===a?"new":a?.id??"",[O,Q]=(0,p.useState)(()=>ac(D,c));(0,p.useEffect)(()=>Q(ac(D,c)),[J]);let R=a=>Q(b=>({...b,...a})),S=()=>(0,H.revalidate)(q.queryKey.routines),[T,U]=(0,G.useServerAction)(K,{onOk:a=>{S(),e(a.id)}}),[V]=(0,G.useServerAction)(N,{onOk:S}),[W]=(0,G.useServerAction)(L,{onOk:S}),[Y,_]=(0,G.useServerAction)(M,{onOk:()=>{S(),(0,H.revalidate)(q.queryKey.threads)}}),am=ad(O),ar=am&&!ae(am)&&O.label.trim()&&O.bot&&O.request.trim()?{label:O.label.trim(),bot:O.bot,request:O.request.trim(),schedule:am}:null,as=a=>{D&&V(D.id,a)},at=a=>{R(a);let b=ad({...O,...a});!b||ae(b)||D&&function(a,b){if("once"===a.kind)return"once"===b.kind&&a.at===b.at;if("every"===a.kind)return"every"===b.kind&&a.hours===b.hours;let c=a=>[...a].sort((a,b)=>a-b).join();return"daily"===b.kind&&a.time===b.time&&c(a.days)===c(b.days)}(b,D.schedule)||as({schedule:b,..."once"===b.kind?{enabled:!0}:{}})},au=!!(D&&(O.label.trim()&&O.label.trim()!==D.label||O.request.trim()&&O.request.trim()!==D.request)),av=D?au:!!(O.label.trim()||O.request.trim()),aw=(0,p.useRef)(av);aw.current=av;let ax=(0,E.useSettingsStore)(a=>a.holdUnsaved);(0,p.useEffect)(()=>(ax(()=>aw.current),()=>ax(null)),[ax]);let ay=async()=>{(!aw.current||await v.notify.discard())&&d()},az=async()=>{!D||await v.notify.confirm({title:`Delete "${D.label}"?`,description:"It starts no more. The jobs it already opened stay.",okText:"Delete",destructive:!0})&&(await W(D.id).catch(()=>{}),d())},aA=c.find(a=>a.name===O.bot),aB=D?.runs[0]?.status==="running"||D?.runs[0]?.status==="waiting";return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{ref:A,hidden:!0}),(0,b.jsx)(s.Dialog,{open:!!(a&&k),onOpenChange:a=>!a&&void ay(),modal:!1,disablePointerDismissal:!0,children:(0,b.jsx)(s.DialogPortal,{container:k,children:(0,b.jsx)(s.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&&(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:[aA?(0,b.jsx)(B.BotMark,{size:28,seed:aA.name,...(0,B.markOf)(aA.name,c),notify:!1,className:"shrink-0"}):(0,b.jsx)("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,b.jsx)($.RoutineMark,{className:"size-3.5"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)(s.DialogTitle,{className:"sr-only",children:D?D.label:"New routine"}),(0,b.jsx)("p",{className:"truncate text-[15px] leading-5 font-semibold",children:D?D.label:"New routine"}),D&&(0,b.jsxs)("p",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[(0,b.jsx)($.RoutineMark,{className:"size-3 shrink-0"}),(0,b.jsxs)("span",{className:"truncate",children:[D.bot," · ",Z(D.schedule),D.enabled&&` \xb7 next ${(0,F.whenOf)(D.nextRunAt)}`]})]})]}),D&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(y.Switch,{checked:D.enabled,onCheckedChange:a=>void V(D.id,{enabled:a}),"aria-label":`${D.label} on or off`,className:"mr-1 shrink-0"}),(0,b.jsxs)(t.DropdownMenu,{children:[(0,b.jsx)(t.DropdownMenuTrigger,{render:(0,b.jsx)(r.Button,{size:"icon-sm",variant:"ghost","aria-label":"More",className:"text-muted-foreground"}),children:(0,b.jsx)(l.MoreHorizontal,{})}),(0,b.jsx)(t.DropdownMenuContent,{align:"end",children:(0,b.jsxs)(t.DropdownMenuItem,{variant:"destructive",onClick:az,children:[(0,b.jsx)(n.Trash2,{}),"Delete"]})})]})]}),(0,b.jsx)(s.DialogClose,{render:(0,b.jsx)(r.Button,{size:"icon-sm",variant:"ghost","aria-label":"Close the routine"}),children:(0,b.jsx)(o.X,{})})]}),(0,b.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pt-3 pb-5",children:[(0,b.jsxs)(aq,{label:"Name",htmlFor:"routine-name",children:[(0,b.jsx)(u.Input,{id:"routine-name",value:O.label,onChange:a=>R({label:a.target.value}),placeholder:"e.g. Morning mail",maxLength:80,autoFocus:!D}),(0,b.jsx)(aj,{children:"What it is called in this list, and what she calls it on a call."})]}),(0,b.jsxs)(aq,{label:"Bot",children:[(0,b.jsxs)(t.DropdownMenu,{children:[(0,b.jsxs)(t.DropdownMenuTrigger,{render:(0,b.jsx)(r.Button,{variant:"outline",className:"justify-start gap-2 pl-1.5 font-normal"}),children:[aA?(0,b.jsx)(B.BotMark,{size:20,seed:aA.name,...(0,B.markOf)(aA.name,c),notify:!1,className:"shrink-0"}):null,(0,b.jsx)("span",{className:(0,I.cn)(!aA&&"pl-1.5 text-muted-foreground"),children:aA?.name??(O.bot||"Pick a bot")}),(0,b.jsx)(i.ChevronDown,{className:"ml-1 size-3.5 text-muted-foreground"})]}),(0,b.jsx)(t.DropdownMenuContent,{align:"start",children:(0,b.jsx)(t.DropdownMenuGroup,{children:c.filter(a=>!a.disabled).map(a=>(0,b.jsxs)(t.DropdownMenuItem,{onClick:()=>{R({bot:a.name}),a.name!==D?.bot&&as({bot:a.name})},children:[(0,b.jsx)(B.BotMark,{size:16,seed:a.name,...(0,B.markOf)(a.name,c),notify:!1,className:"shrink-0"}),a.name]},a.name))})})]}),(0,b.jsx)(aj,{children:"Who does the job each time it starts."})]}),(0,b.jsx)(aq,{label:"When",children:(0,b.jsxs)("div",{className:"space-y-3.5",children:[(0,b.jsx)(w.Segmented,{"aria-label":"How it starts",value:O.kind,onChange:a=>at({kind:a}),options:[{value:"once",label:"Once"},{value:"daily",label:"On set days"},{value:"every",label:"Every few hours"}]}),(0,b.jsx)("div",{className:"space-y-2.5",children:"once"===O.kind?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(al,{word:"On",children:(0,b.jsx)(an,{value:O.date,onPick:a=>at({date:a})})}),(0,b.jsxs)(al,{word:"At",children:[(0,b.jsx)(ao,{value:O.time,onChange:a=>R({time:a}),onDone:()=>at({})}),(0,b.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"or"}),(0,b.jsx)(ak,{picked:!1,onClick:()=>{let a;return at(((a=new Date(Date.now()+36e5)).setMinutes(5*Math.ceil(a.getMinutes()/5),0,0),{date:ab(0,a),time:`${aa(a.getHours())}:${aa(a.getMinutes())}`}))},children:"In an hour"})]})]}):"daily"===O.kind?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(al,{word:"On",children:P.map(a=>{let c=O.days.includes(a);return(0,b.jsx)(ak,{picked:c,several:!0,"aria-label":ag[a-1],onClick:()=>at({days:c?O.days.filter(b=>b!==a):[...O.days,a].sort((a,b)=>a-b)}),children:X[a-1]},a)})}),(0,b.jsx)(al,{children:af.map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>at({days:[...a.days]}),className:"h-6.5 rounded-full bg-muted px-2.5 text-xs text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:a.label},a.label))}),(0,b.jsx)(al,{word:"At",children:(0,b.jsx)(ao,{value:O.time,onChange:a=>R({time:a}),onDone:()=>at({})})})]}):(0,b.jsxs)(al,{word:"Every",children:[(ah.includes(O.hours)?ah:[...ah,O.hours].sort((a,b)=>a-b)).map(a=>(0,b.jsx)(ak,{picked:a===O.hours,onClick:()=>at({hours:a}),className:"min-w-10 px-3",children:a},a)),(0,b.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"hours"})]})}),(0,b.jsx)(ap,{schedule:am,kind:O.kind})]})}),(0,b.jsxs)(aq,{label:"Job",htmlFor:"routine-request",children:[(0,b.jsx)(z.Textarea,{id:"routine-request",value:O.request,onChange:a=>R({request:a.target.value}),placeholder:"e.g. Go through the mail that came since the last run and draft replies to what needs one. Send nothing.",className:"min-h-28"}),(0,b.jsx)(aj,{children:"Handed to the bot as a new thread each time, with a line on how the last run ended. Nobody is there to ask, so say everything it needs."})]}),D&&(0,b.jsxs)("div",{className:"pt-1",children:[(0,b.jsx)("div",{className:"flex h-6 items-center",children:(0,b.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"Runs"})}),0===D.runs.length?(0,b.jsx)("p",{className:"py-2 text-[13px] text-muted-foreground",children:"Not run yet."}):D.runs.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>{var b;return b=a.id,void(E.useSettingsStore.getState().hide(),C.roomOpens.open(b))},className:"flex h-9 w-full items-center gap-3 border-t border-border/60 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,b.jsx)("span",{className:"w-28 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:(0,F.whenOf)(a.updatedAt)}),(0,b.jsx)("span",{className:(0,I.cn)("min-w-0 flex-1 truncate","waiting"===a.status?I.WAITING_INK:"text-muted-foreground"),children:"running"===a.status?"Running now":a.outcome?(0,I.plainText)(a.outcome):"cancelled"===a.status?"Stopped":"No words"}),(0,b.jsx)(j.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground"})]},a.id))]})]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-t border-border/60 px-5 py-3",children:[(0,b.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-4 text-muted-foreground",children:D||ar?"Starts while Thursday is running on this computer, whether or not a tab is open. A time that passed meanwhile starts once, not once for each.":`Still needs ${f=O,g=am,(h=[f.label.trim()?null:"a name",f.bot?null:"a bot",!g?"a time":ae(g)?"a time still ahead":null,f.request.trim()?null:"a job"].filter(a=>null!==a)).length>1?`${h.slice(0,-1).join(", ")} and ${h.at(-1)}`:h[0]??"nothing"}.`}),au&&(0,b.jsx)(r.Button,{size:"sm",onClick:()=>{if(!D)return;let a={};O.label.trim()&&O.label.trim()!==D.label&&(a.label=O.label.trim()),O.request.trim()&&O.request.trim()!==D.request&&(a.request=O.request.trim()),Object.keys(a).length&&as(a)},children:"Save"}),D?(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",loading:_,disabled:aB,title:aB?"Its last run is still open":void 0,onClick:()=>void Y(D.id),children:[(0,b.jsx)(m.Play,{}),"Run now"]}):(0,b.jsx)(r.Button,{size:"sm",loading:U,disabled:!ar,onClick:()=>ar&&void T(ar),children:"Create"})]})]})})})})]})}let aj=({children:a})=>(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a});function ak({picked:a,several:c=!1,className:d,children:e,...f}){return(0,b.jsxs)("button",{type:"button","aria-pressed":a,className:(0,I.cn)("inline-flex h-8 items-center justify-center gap-1.5 rounded-full px-3.5 text-[13px] whitespace-nowrap outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",!a&&"text-foreground ring-1 ring-border ring-inset hover:bg-muted",a&&(c?"bg-brand/10 pl-2.5 font-medium text-brand ring-1 ring-brand/30 ring-inset":"bg-brand font-medium text-brand-foreground"),d),...f,children:[a&&c&&(0,b.jsx)(h.Check,{className:"size-3.5"}),e]})}function al({word:a,children:c}){return(0,b.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,b.jsx)("span",{className:"flex h-8 w-9 shrink-0 items-center text-[13px] text-muted-foreground",children:a}),(0,b.jsx)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:c})]})}function am(a){let b=R(`${a} 00:00`),d=(b.getTime()-R(`${ab(0)} 00:00`).getTime())/864e5;return(0,c.format)(b,d<7?"EEE d":"EEE, MMM d")}function an({value:a,onPick:c}){let d=(0,p.useRef)(null),e=[0,1,2,3].map(a=>ab(a)),f=()=>d.current?.showPicker();return(0,b.jsxs)(b.Fragment,{children:[e.map((d,e)=>(0,b.jsx)(ak,{picked:d===a,onClick:()=>c(d),children:0===e?"Today":1===e?"Tomorrow":am(d)},d)),!e.includes(a)&&(0,b.jsx)(ak,{picked:!0,onClick:f,children:am(a)}),(0,b.jsxs)("span",{className:"relative",children:[(0,b.jsx)(ak,{picked:!1,"aria-label":"Another day",onClick:f,className:"w-8 px-0",children:(0,b.jsx)(g,{className:"size-3.5"})}),(0,b.jsx)("input",{ref:d,type:"date",tabIndex:-1,"aria-hidden":!0,min:e[0],value:a,onChange:a=>a.target.value&&c(a.target.value),className:"pointer-events-none absolute inset-0 opacity-0"})]})]})}function ao({value:a,onChange:c,onDone:d}){return(0,b.jsx)(u.Input,{type:"time","aria-label":"Time of day",value:a,onChange:a=>c(a.target.value),onBlur:d,onClick:a=>a.currentTarget.showPicker?.(),className:"h-8.5 w-28 px-3 text-[15px] tabular-nums md:text-[15px] [&::-webkit-calendar-picker-indicator]:hidden"})}function ap({schedule:a,kind:c}){if(!a||ae(a))return(0,b.jsx)("p",{className:"text-xs text-destructive",children:a?"That time has passed. Pick a later one.":"daily"===c?"Pick a time and at least one day.":"Pick a time."});let e=function(a,b){if("once"===a.kind)return R(a.at);if("every"===a.kind)return new Date(b.getTime()+36e5*a.hours);let[c,d]=a.time.split(":").map(Number);for(let e=0;e<=7;e++){let f=new Date(b);f.setDate(f.getDate()+e),f.setHours(c,d,0,0);let g=0===f.getDay()?7:f.getDay();if(f>b&&a.days.includes(g))return f}return new Date(b.getTime()+864e5)}(a,new Date);return(0,b.jsxs)("p",{className:"flex items-start gap-2 text-[13px] leading-5",children:[(0,b.jsx)($.RoutineMark,{className:"mt-0.75 size-3.5 shrink-0 text-muted-foreground"}),(0,b.jsxs)("span",{className:"min-w-0",children:[Z(a),(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" · ","once"===a.kind?`${(0,d.formatDistanceToNowStrict)(e,{addSuffix:!0})}, then it switches itself off`:`first start ${(0,F.whenOf)(e)}`]})]})]})}function aq({label:a,htmlFor:c,children:d}){return(0,b.jsxs)("div",{className:"flex gap-3",children:[(0,b.jsx)("label",{htmlFor:c,className:"w-14 shrink-0 pt-2 font-mono text-xs text-muted-foreground",children:a}),(0,b.jsx)("div",{className:"min-w-0 flex-1 space-y-1.5",children:d})]})}a.s(["RoutineSetting",0,function(){let[a,c]=(0,p.useState)(null),{data:d,isLoading:e,error:f}=(0,H.useServerRoute)(q.queryKey.routines),{data:g}=(0,H.useServerRoute)(q.queryKey.bot),[h]=(0,G.useServerAction)(N,{onOk:()=>(0,H.revalidate)(q.queryKey.routines)});if(e)return(0,b.jsx)(D.SettingSkeleton,{rows:3});if(f)return(0,b.jsx)(D.SettingError,{message:f.message});let i=d??[],j=i.filter(a=>a.enabled).length,k=i.find(b=>b.id===a);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.SettingScreen,{footer:(0,b.jsxs)(D.SettingRailNote,{children:[i.length," set up · ",j," on",i.length>=A.ROUTINE.max&&` \xb7 ${A.ROUTINE.max} is the most`]}),children:(0,b.jsx)(D.SettingItems,{addRow:i.length<A.ROUTINE.max?{label:"New routine",onClick:()=>c("new")}:void 0,children:0===i.length?(0,b.jsx)("p",{className:"p-4 text-sm leading-relaxed text-muted-foreground",children:'Nothing starts by itself yet. Tell Thursday what should — "every weekday at nine, go through my mail" — or make one here.'}):i.map(d=>(0,b.jsx)(_,{routine:d,bots:g,open:d.id===a,onOpen:()=>c(d.id),onSwitch:a=>h(d.id,{enabled:a})},d.id))})}),(0,b.jsx)(ai,{routine:"new"===a?"new":k??null,bots:g??[],onClose:()=>c(null),onMade:a=>c(a)})]})}],41014)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=features_routine_components_routine-setting_tsx_055fknz._.js.map
|