thursday-agent 0.17.2 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +1 -0
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +6 -0
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error.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 +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/artifact/route.js +7 -7
- package/.next/server/app/api/artifact/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/files/route.js +4 -4
- package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/route.js +1 -1
- package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/route.js +1 -1
- package/.next/server/app/api/bot/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/thread/[id]/route.js +1 -1
- package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/thread/file/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/bot/thread/file/route/build-manifest.json +12 -0
- package/.next/server/app/api/bot/thread/file/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/bot/thread/file/route.js +29 -0
- package/.next/server/app/api/bot/thread/file/route.js.map +5 -0
- package/.next/server/app/api/bot/thread/file/route.js.nft.json +1 -0
- package/.next/server/app/api/bot/thread/file/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/bot/thread/route.js +1 -1
- package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
- package/.next/server/app/api/config/route.js +1 -1
- package/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/server/app/api/events/route.js +2 -2
- 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 +4 -4
- package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/automatic/route.js +1 -1
- package/.next/server/app/api/llm-model/automatic/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/catalog/route.js +1 -1
- package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/credits/route.js +1 -1
- package/.next/server/app/api/llm-model/credits/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/route.js +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 +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 +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 +1 -1
- package/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/tools/route.js +1 -1
- package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/edit/route.js +1 -1
- 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 +1 -1
- package/.next/server/app/api/reach/route.js.nft.json +1 -1
- package/.next/server/app/api/routine/route.js +1 -1
- package/.next/server/app/api/routine/route.js.nft.json +1 -1
- package/.next/server/app/api/signins/route.js +1 -1
- package/.next/server/app/api/signins/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/[source]/[name]/route.js +1 -1
- package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/route.js +1 -1
- package/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/call/end/route.js +1 -1
- package/.next/server/app/api/thursday/call/end/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/call/route.js +1 -1
- package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/settings/route.js +1 -1
- package/.next/server/app/api/thursday/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/text/route.js +1 -1
- package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/tool-call/route.js +1 -1
- 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 +94 -6
- package/.next/server/app/artifact/[...path]/page.js +9 -6
- 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/server-reference-manifest.json +161 -128
- package/.next/server/app/page.js +9 -9
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +1 -0
- package/.next/server/chunks/{[externals]__12stas-._.js → [externals]__178rv3v._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__00qyw01._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__02ra64t._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__03xamry._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__04hhvpu._.js +7 -0
- package/.next/server/chunks/[root-of-the-server]__05dp5tr._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0bqveex._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1_h4hf9._.js → [root-of-the-server]__0brmiv2._.js} +4 -4
- package/.next/server/chunks/[root-of-the-server]__0gvdr2h._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__0h656y-._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0lvjz0b._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__0mgyt8p._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0mrk2it._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0my9geo._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0qdoc_9._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__0sm5xvm._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0v_kuor._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__1-rmal0._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__13hng6h._.js +1 -1
- 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]__1dth047._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__1etbk64._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1izes4_._.js +7 -0
- package/.next/server/chunks/[root-of-the-server]__1ksm9m-._.js +12 -0
- package/.next/server/chunks/[root-of-the-server]__1m_dmf6._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__1mys2c3._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__1ndi14y._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1p0njle._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__1p47fbb._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__1ygplx1._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1zn039k._.js +1 -1
- package/.next/server/chunks/_01c32w9._.js +1 -1
- package/.next/server/chunks/_02bov6_._.js +1 -1
- package/.next/server/chunks/_06hnfi8._.js +2 -2
- package/.next/server/chunks/_06u9yo-._.js +1 -1
- package/.next/server/chunks/_07nxi75._.js +42 -41
- package/.next/server/chunks/_08354bn._.js +12 -11
- package/.next/server/chunks/{_08btiir._.js → _08_-9ay._.js} +3 -3
- package/.next/server/chunks/_08s4vft._.js +1 -1
- package/.next/server/chunks/_0bgjf07._.js +5 -0
- package/.next/server/chunks/_0fb6dvr._.js +1 -1
- package/.next/server/chunks/_0hgvg55._.js +1 -1
- package/.next/server/chunks/_0iw19ig._.js +1 -1
- package/.next/server/chunks/_0poi1t2._.js +1 -1
- package/.next/server/chunks/_0srlnvd._.js +6 -6
- package/.next/server/chunks/_0t_7gji._.js +1 -1
- package/.next/server/chunks/_0uzj57i._.js +1 -1
- package/.next/server/chunks/_0wyh244._.js +112 -0
- package/.next/server/chunks/_0xygcxs._.js +42 -41
- package/.next/server/chunks/_1-sk_q4._.js +1 -1
- package/.next/server/chunks/_108gsm8._.js +2 -2
- package/.next/server/chunks/_136j09a._.js +5 -5
- package/.next/server/chunks/_15negpy._.js +2 -2
- package/.next/server/chunks/_1d7og_q._.js +1 -1
- package/.next/server/chunks/_1dxq827._.js +2 -2
- package/.next/server/chunks/_1e54wxa._.js +1 -1
- package/.next/server/chunks/_1gn2r2q._.js +6 -6
- package/.next/server/chunks/_1i3uucm._.js +1 -1
- package/.next/server/chunks/_1jvy78-._.js +5 -0
- package/.next/server/chunks/_1q6e56i._.js +6 -6
- package/.next/server/chunks/_1qgix-j._.js +1 -1
- package/.next/server/chunks/_1wwl_7o._.js +1 -1
- package/.next/server/chunks/_1y8w80a._.js +5 -5
- package/.next/server/chunks/_1yx285_._.js +3 -0
- package/.next/server/chunks/_20qn224._.js +3 -0
- package/.next/server/chunks/_211dn2c._.js +1 -1
- package/.next/server/chunks/_next-internal_server_app_api_bot_thread_file_route_actions_0q3be0o.js +3 -0
- package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
- package/.next/server/chunks/features_bot_08z387_._.js +3 -3
- package/.next/server/chunks/features_workspace_workspace_ts_13h82gv._.js +3 -3
- package/.next/server/chunks/features_workspace_workspace_ts_1iyjroj._.js +3 -3
- package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_04oxl25._.js → node_modules_consola_dist_chunks_prompt_mjs_0yd5xa0._.js} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__04upd5v._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__06knwl5._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__07ehpky._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0h6jo0s._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__128hnrd._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1867koj._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1gzje-h._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__1d7usu0._.js → [root-of-the-server]__1qn0axo._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__1r7tj27._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1tb5vve._.js +46 -0
- package/.next/server/chunks/ssr/{features_bot_1knyan7._.js → _07nmtxo._.js} +2 -2
- package/.next/server/chunks/ssr/{_10-_awu._.js → _0f9hx5p._.js} +2 -2
- package/.next/server/chunks/ssr/_0fo4552._.js +10 -9
- package/.next/server/chunks/ssr/{_123y-ah._.js → _0is8m6y._.js} +2 -2
- package/.next/server/chunks/ssr/{_17a4qyk._.js → _0ixe3g3._.js} +3 -3
- package/.next/server/chunks/ssr/_0j9vh-8._.js +3 -0
- package/.next/server/chunks/ssr/_0l7rjg5._.js +1 -1
- package/.next/server/chunks/ssr/{lib_logger_ts_0-olsze._.js → _0mfgsk-._.js} +4 -2
- package/.next/server/chunks/ssr/_0mpn6q0._.js +5 -0
- package/.next/server/chunks/ssr/{_0e2fnvg._.js → _0osvxkt._.js} +2 -2
- package/.next/server/chunks/ssr/_0p6w0ef._.js +3 -0
- package/.next/server/chunks/ssr/_0pbav_w._.js +3 -0
- package/.next/server/chunks/ssr/{_1aqjk-1._.js → _0wuvkqk._.js} +2 -2
- package/.next/server/chunks/ssr/_0x8ophf._.js +1 -1
- package/.next/server/chunks/ssr/_0x9f717._.js +60 -0
- package/.next/server/chunks/ssr/_1-41lck._.js +1 -1
- package/.next/server/chunks/ssr/_10jtmhl._.js +3 -0
- package/.next/server/chunks/ssr/{_0xfafez._.js → _12jv_41._.js} +2 -2
- package/.next/server/chunks/ssr/{_163dr78._.js → _165wnr4._.js} +2 -2
- package/.next/server/chunks/ssr/_16_7zeo._.js +3 -0
- package/.next/server/chunks/ssr/{_14oirtb._.js → _1_ogjze._.js} +2 -2
- package/.next/server/chunks/ssr/_1bfrntd._.js +6 -0
- package/.next/server/chunks/ssr/_1i2swyr._.js +3 -0
- package/.next/server/chunks/ssr/{_10_ph1t._.js → _1jd8rjm._.js} +2 -2
- package/.next/server/chunks/ssr/_1mdjoak._.js +162 -0
- package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
- package/.next/server/chunks/ssr/{_1dfv66y._.js → _1oafxdu._.js} +2 -2
- package/.next/server/chunks/ssr/_1omom9y._.js +3 -0
- package/.next/server/chunks/ssr/_1pgxh81._.js +271 -0
- package/.next/server/chunks/ssr/{_0vo_oym._.js → _1r4mc3i._.js} +2 -2
- package/.next/server/chunks/ssr/_1soynbw._.js +6 -0
- package/.next/server/chunks/ssr/{_01al00i._.js → _1tx-2k7._.js} +2 -2
- package/.next/server/chunks/ssr/_1w899wx._.js +3 -0
- package/.next/server/chunks/ssr/_1xwtbdz._.js +3 -0
- package/.next/server/chunks/ssr/features_0796o8r._.js +1 -1
- package/.next/server/chunks/ssr/features_bot_0tb4ui-._.js +2 -2
- package/.next/server/chunks/ssr/features_bot_18gqkr_._.js +3 -0
- package/.next/server/chunks/ssr/{features_config_09n-q9q._.js → features_config_1ond01n._.js} +3 -3
- 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_workspace_workspace_ts_1wc7_u_._.js +4 -4
- package/.next/server/chunks/ssr/{node_modules_0msrhxf._.js → node_modules_004qt-z._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0q-klni._.js → node_modules_06m6e97._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_13g-d25._.js → node_modules_09dy7tk._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0gd9hbz._.js → node_modules_0_hy3i2._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1gq3ght._.js → node_modules_0f485jl._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_096up6a._.js → node_modules_0gbx70b._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_13bqv6i._.js → node_modules_0i_v0-m._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_04x5wyv._.js → node_modules_0lrn9ci._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0d6j33x._.js → node_modules_0lxwg2v._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_113l3e5._.js → node_modules_0n2-p5q._.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_0nj36zf._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_0cjnmzp._.js → node_modules_0ppirau._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0m73b88._.js → node_modules_0pw13ww._.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_0qd7p5f._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_0nmkv-v._.js → node_modules_0upwx50._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0__0tvm._.js → node_modules_0v__o4h._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1k5i-_9._.js → node_modules_1-4q6is._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_156kv_t._.js → node_modules_10mb0cv._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_10_fv2a._.js → node_modules_16z7p8b._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1lmyts8._.js → node_modules_17o218r._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0k8-y89._.js → node_modules_1gpapfv._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1_8-jcj._.js → node_modules_1hdaxu9._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1ri_eip._.js → node_modules_1hjvwkh._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0nw5jz7._.js → node_modules_1j886a5._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1xb-ndg._.js → node_modules_1srjf5c._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1p_6sq7._.js → node_modules_1tus4vi._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_021lid9._.js → node_modules_1tv_7lk._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1qstb1x._.js → node_modules_20448xv._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0amkw0b._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0lg9pkl._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0zq3l45._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1xgbf5j._.js} +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/middleware.js +1 -1
- 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 +205 -132
- package/.next/static/chunks/{166smhw8v-s3j.js → 05uvci-bk-vgp.js} +1 -1
- package/.next/static/chunks/09y_43y1cy5jw.js +1 -0
- package/.next/static/chunks/0_s4z70lx1tgs.js +1 -0
- package/.next/static/chunks/0oqviw3f55nfp.js +58 -0
- package/.next/static/chunks/0q9b2n6l4flqb.js +1 -0
- package/.next/static/chunks/0ruf3dqs--3ve.js +1 -0
- package/.next/static/chunks/0vggwjufw2-6r.js +1 -0
- package/.next/static/chunks/{3sla-dm1puqd1.js → 0x4m9nj2fazl2.js} +1 -1
- package/.next/static/chunks/{3t2c76awm9k_p.js → 1-1yfu34-3p2p.js} +1 -1
- package/.next/static/chunks/10oyyypxn_cpx.js +1 -0
- package/.next/static/chunks/{1cglo3a2mbeou.js → 17dx6w478vnb0.js} +1 -1
- package/.next/static/chunks/184-r80rv0xay.css +1 -0
- package/.next/static/chunks/1_hgdoungpm0o.js +1 -0
- package/.next/static/chunks/{0obogzscwwekj.js → 1dpg1u4a16ujt.js} +1 -1
- package/.next/static/chunks/{2qgkbdshzpq1c.js → 1h_6rh86q3i4p.js} +1 -1
- package/.next/static/chunks/{3b96xy59nl_gd.js → 1pe7i5yu779ta.js} +1 -1
- package/.next/static/chunks/{2zbl41hed17g3.js → 240nfv2dtidhc.js} +1 -1
- package/.next/static/chunks/{0uxq_vs6uxi-b.js → 27l8qwnk1j66z.js} +1 -1
- package/.next/static/chunks/2gxfy__ef51n9.js +3 -0
- package/.next/static/chunks/2kjwmo70judc2.js +15 -0
- package/.next/static/chunks/{3gsxnqqqphh-1.js → 2lzg4zedtmyic.js} +1 -1
- package/.next/static/chunks/2ug8q1x9e-_j6.js +1 -0
- package/.next/static/chunks/{01l7kw74vfp32.js → 2uk8rdtr-pk58.js} +1 -1
- package/.next/static/chunks/337g9g_ux2gj-.js +1 -0
- package/.next/static/chunks/{0o7o0eb7ihxi6.js → 396enq-m0sss5.js} +1 -1
- package/.next/static/chunks/{0p2f6uv4xytfm.js → 3r7u1y9xjoh-v.js} +1 -1
- package/.next/static/chunks/{3jtcieuk1l6tw.js → 3vg1-oc-zgw_7.js} +1 -1
- package/.next/static/chunks/40re_3ukjulg9.js +1 -0
- package/.next/static/chunks/41ztsnjn4qrn-.js +1 -0
- package/README.md +5 -5
- package/bin/autostart.mjs +32 -2
- package/bin/lock.mjs +85 -4
- package/bin/thursday.mjs +42 -15
- package/bin/tools.mjs +18 -1
- package/database/migrations/20260926021847_thread_cache_tokens/migration.sql +2 -0
- package/database/migrations/20260926021847_thread_cache_tokens/snapshot.json +1949 -0
- package/guide/bots.md +173 -317
- package/guide/calls.md +98 -146
- package/guide/index.md +2 -2
- package/guide/memory.md +14 -18
- package/guide/phone.md +86 -133
- package/guide/setup.md +127 -172
- package/guide/trouble.md +42 -65
- package/package.json +1 -1
- package/seed-skills/concierge/travel/scripts/itinerary.mjs +1 -1
- package/skills/artifact/runtime/shell/shell.js +32 -3
- package/.next/server/chunks/[root-of-the-server]__01ypm_z._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__021dkui._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__09gdscj._.js +0 -7
- package/.next/server/chunks/[root-of-the-server]__0ljizgj._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__0nmust6._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__0svzjwa._.js +0 -7
- package/.next/server/chunks/[root-of-the-server]__1c2kwku._.js +0 -12
- package/.next/server/chunks/[root-of-the-server]__1t02-1p._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1t0jj1j._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__1vlxv19._.js +0 -5
- package/.next/server/chunks/_0j0-gq6._.js +0 -5
- package/.next/server/chunks/_0p6v1fr._.js +0 -5
- package/.next/server/chunks/_1ic3bew._.js +0 -5
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0g87zst._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0-af_o7._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__09f39cp._.js +0 -4
- package/.next/server/chunks/ssr/[root-of-the-server]__0ouu4qp._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0q9g9ea._.js +0 -5
- package/.next/server/chunks/ssr/[root-of-the-server]__17h1ggo._.js +0 -46
- package/.next/server/chunks/ssr/[root-of-the-server]__1jyeu61._.js +0 -5
- package/.next/server/chunks/ssr/_0afrpci._.js +0 -3
- package/.next/server/chunks/ssr/_0bgse1c._.js +0 -162
- package/.next/server/chunks/ssr/_0qsmpcu._.js +0 -3
- package/.next/server/chunks/ssr/_0z38nha._.js +0 -3
- package/.next/server/chunks/ssr/_116lfdc._.js +0 -3
- package/.next/server/chunks/ssr/_14dfh7a._.js +0 -4
- package/.next/server/chunks/ssr/_17qtuv7._.js +0 -3
- package/.next/server/chunks/ssr/_1_5xof_._.js +0 -3
- package/.next/server/chunks/ssr/_1alxym6._.js +0 -3
- package/.next/server/chunks/ssr/_1ou5sj0._.js +0 -3
- package/.next/server/chunks/ssr/_1tmw842._.js +0 -5
- package/.next/server/chunks/ssr/_1uij_rj._.js +0 -3
- package/.next/server/chunks/ssr/_1w9w1ok._.js +0 -3
- package/.next/server/chunks/ssr/_20gq_24._.js +0 -3
- package/.next/server/chunks/ssr/features_bot_0ouemw8._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_@base-ui_react_1j9i1ho._.js +0 -3
- package/.next/static/chunks/0a5_-jqhaktjj.js +0 -1
- package/.next/static/chunks/0npvak0wpgagb.js +0 -1
- package/.next/static/chunks/19l81deo_pyoc.js +0 -1
- package/.next/static/chunks/1bnhw-5fj7aiz.js +0 -1
- package/.next/static/chunks/1in6nxpu33iab.js +0 -1
- package/.next/static/chunks/1u7kg91f9qy3g.js +0 -1
- package/.next/static/chunks/1xv4g10m-cl1s.js +0 -1
- package/.next/static/chunks/2ajs12-fcdwzm.js +0 -1
- package/.next/static/chunks/2i7qtmxc1kuqg.js +0 -1
- package/.next/static/chunks/2kz1f6r59nky0.js +0 -3
- package/.next/static/chunks/31kn4_h2rvf6k.css +0 -1
- package/.next/static/chunks/35jj-5u4te56r.js +0 -1
- package/.next/static/chunks/37ixzapa06xlo.js +0 -1
- package/.next/static/chunks/3k1d8y03t5nax.js +0 -58
- package/.next/static/chunks/3yiqr95d7ybeq.js +0 -15
- /package/.next/static/{8I2hKtciyA9LXvd8txuOz → -IBxB5oqr6e3RuOCCmYtL}/_buildManifest.js +0 -0
- /package/.next/static/{8I2hKtciyA9LXvd8txuOz → -IBxB5oqr6e3RuOCCmYtL}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{8I2hKtciyA9LXvd8txuOz → -IBxB5oqr6e3RuOCCmYtL}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,986530,e=>{"use strict";var t=e.i(843476),s=e.i(225913);e.i(271645);var i=e.i(647163);function n({className:e,...s}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,i.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...s})}e.i(652225);let l=(0,s.cva)("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function({className:e,orientation:s="vertical",...n}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":s,className:(0,i.cn)(l({orientation:s}),e),...n})},"FieldContent",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"field-content",className:(0,i.cn)("group/field-content flex flex-1 flex-col gap-0.5 leading-snug",e),...s})},"FieldLabel",0,function({className:e,...s}){return(0,t.jsx)(n,{"data-slot":"field-label",className:(0,i.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...s})}],986530)},833959,e=>{"use strict";var t=e.i(843476),s=e.i(437750),i=e.i(856539),n=e.i(24071),l=e.i(867927),r=e.i(829600),a=e.i(226091),o=e.i(726067),d=e.i(456420);let c={name:"frame",size:24,node:[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]]};c.node;let u=(0,d.default)(c);var m=e.i(91511),x=e.i(77071),f=e.i(566595);let h={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};h.node;let p=(0,d.default)(h);var g=e.i(759659);let v={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};v.node;let b=(0,d.default)(v);var k=e.i(271645),j=e.i(798120),y=e.i(167881),w=e.i(986530),N=e.i(23750),S=e.i(683408),z=e.i(917162),C=e.i(671428),L=e.i(319036),F=e.i(127341),M=e.i(184762),R=e.i(41533),T=e.i(895836),$=e.i(95187);let D=(0,$.createServerReference)("7f85a49d039510ceee57ee7d2b329b96c06551a77a",$.callServer,void 0,$.findSourceMapURL,"createSkillAction"),A=(0,$.createServerReference)("7faafce42cf973bdbb9083a6b4124bc2d8bc91c5c8",$.callServer,void 0,$.findSourceMapURL,"deleteSkillAction"),B=(0,$.createServerReference)("7fddaddcbf8c9216c6e81cf69e08d528e77d5c9b95",$.callServer,void 0,$.findSourceMapURL,"setSkillDisabledAction"),q=(0,$.createServerReference)("7f8e1e7b0412e588b555987ced6892dc4303906f22",$.callServer,void 0,$.findSourceMapURL,"uploadSkillAction"),I=(0,$.createServerReference)("7f8623f0cd7d7e85bf12c1ecf92e572c093a2a4abb",$.callServer,void 0,$.findSourceMapURL,"writeSkillFileAction");var K=e.i(681307);K.z.union([K.z.enum(["custom","default"]),K.z.templateLiteral(["kit:",K.z.string().regex(/^[\p{L}\p{N}_-]+$/u)]),K.z.templateLiteral(["own:",K.z.string().regex(/^[\p{L}\p{N}_-]+$/u)])]);let E=e=>"custom"===e||e.startsWith("own:"),U=K.z.string().trim().min(1,"Skill name is required").max(64,"Skill name is too long").regex(/^[a-z0-9][a-z0-9_-]*$/i,"Use letters, numbers, dashes and underscores only"),O=K.z.string().trim().min(1,"Skill name is required").max(64,"Skill name is too long");K.z.object({name:O,description:K.z.string().trim().min(1,"Description is required"),metadata:K.z.record(K.z.string(),K.z.unknown()).optional(),disabled:K.z.boolean().optional(),platforms:K.z.array(K.z.string()).optional()}).extend({name:U,content:K.z.string().trim().min(1,"Content is required")});var P=e.i(609856),W=e.i(283653),_=e.i(647163);let H={artifact:u,browser:m.Globe,computer:s.AppWindow,"find-skills":f.Search,"skill-creator":p};function V({skill:e}){let[s,n]=(0,P.useServerAction)(A,{onOk:()=>(0,W.revalidate)(j.queryKey.skills)}),[r]=(0,P.useServerAction)(B,{onOk:()=>(0,W.revalidate)(j.queryKey.skills)}),a=async()=>{await z.notify.confirm({title:`Delete ${e.name}?`,description:"Every file in this skill is deleted for good.",okText:"Delete",destructive:!0})&&s(e.source,e.dir)},o="default"===e.source&&H[e.dir]||i.BookMarked;return(0,t.jsxs)("div",{className:"group flex items-center transition-colors hover:bg-muted/50",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{var s;return s=e,z.notify.component({className:"sm:max-w-4xl",renderer:({guard:e})=>(0,t.jsx)(G,{skill:s,guard:e})})},className:"flex min-w-0 flex-1 items-center gap-3 py-4 pl-4 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)("span",{className:(0,_.cn)("grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",e.disabled&&"opacity-45"),children:(0,t.jsx)(o,{className:"size-4"})}),(0,t.jsxs)("span",{className:(0,_.cn)("min-w-0 flex-1 space-y-0.5",e.disabled&&"opacity-45"),children:[(0,t.jsx)("span",{className:"block truncate text-sm font-medium",children:e.name}),(0,t.jsx)("span",{className:"line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:e.description.trim().split(/(?<=[.。])\s|\n/)[0].trim()})]}),(0,t.jsx)(l.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 group-hover:text-foreground"})]}),(0,t.jsxs)("div",{className:"mr-4 ml-5 flex w-18 shrink-0 items-center justify-end gap-3",children:[(0,t.jsx)(L.Switch,{checked:!e.disabled,onCheckedChange:t=>r(e.source,e.dir,!t),"aria-label":`${e.name} on or off`,className:"shrink-0"}),E(e.source)?(0,t.jsx)(y.Button,{size:"icon-sm",variant:"ghost",loading:n,onClick:a,"aria-label":`Delete ${e.name}`,className:"shrink-0 text-muted-foreground",children:(0,t.jsx)(g.Trash2,{})}):(0,t.jsx)("span",{className:"size-7 shrink-0"})]})]})}function G({skill:e,guard:s}){let[i,l]=(0,k.useState)(""),[r,a]=(0,k.useState)("SKILL.md"),o=(0,k.useRef)(!1);(0,k.useEffect)(()=>s(()=>o.current),[s]);let d=async e=>{let t=i?`${i}/${e.name}`:e.name;"dir"===e.kind?l(t):t===r||(!o.current||await z.notify.confirm({title:"Discard your changes?",description:`What you wrote in ${r?.split("/").pop()} is not saved.`,okText:"Discard",destructive:!0}))&&(o.current=!1,a(t))};return(0,t.jsx)(T.SettingDialogContent,{title:e.name,description:(0,t.jsx)(Y,{skill:e,path:r??i}),children:(0,t.jsxs)("div",{className:"flex h-[36rem] divide-x divide-border/60 overflow-hidden rounded-xl border border-border/60 bg-background",children:[(0,t.jsxs)("div",{className:"flex w-44 shrink-0 flex-col overflow-y-auto bg-muted/20 py-1",children:[i&&(0,t.jsxs)("button",{type:"button",onClick:()=>l(i.split("/").slice(0,-1).join("/")),className:"mx-1 mb-1 flex items-center gap-1 rounded-md px-2 py-1 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/50 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(n.ChevronLeft,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:i.split("/").pop()})]}),(0,t.jsx)(J,{source:e.source,dir:e.dir,path:i,current:r,onPick:d})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r?(0,t.jsx)(X,{source:e.source,dir:e.dir,path:r,editable:E(e.source),onUnsaved:e=>{o.current=e}},r):(0,t.jsx)("p",{className:"p-6 text-sm text-muted-foreground/60",children:"Pick a file"})})]})})}function Y({skill:e,path:s}){if(!e)return(0,t.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground/60",children:"Pick a skill"});let i=[e.name,...s.split("/").filter(Boolean)];return(0,t.jsx)("span",{className:"flex min-w-0 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:i.map((e,s)=>(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[s>0&&(0,t.jsx)(l.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,t.jsx)("span",{className:(0,_.cn)("truncate",s===i.length-1&&"text-foreground"),children:e})]},`${s}-${e}`))})}function Z({icon:e,label:s,active:i,hasChildren:n,onClick:r}){return(0,t.jsxs)("button",{type:"button",onClick:r,className:(0,_.cn)("mx-1 flex items-center gap-1.5 rounded-md px-2 py-1 text-left text-xs outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",i?T.PICKED_ROW:"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/70 [&>svg]:size-3",children:e}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:s}),n&&(0,t.jsx)(l.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground/50"})]})}function J({source:e,dir:s,path:i,current:n,onPick:l}){let{data:d,isLoading:c,error:u}=(0,W.useServerRoute)(j.queryKey.skillNode(e,s,i));return u?(0,t.jsx)("p",{className:"p-3 font-mono text-xs text-destructive",children:u.message}):c||!d?(0,t.jsxs)("div",{className:"space-y-2 p-2",children:[(0,t.jsx)(C.Skeleton,{className:"h-5 w-full"}),(0,t.jsx)(C.Skeleton,{className:"h-5 w-4/5"})]}):"dir"!==d.kind?null:(0,t.jsxs)(t.Fragment,{children:[d.entries.map(e=>(0,t.jsx)(Z,{icon:"dir"===e.kind?(0,t.jsx)(o.Folder,{}):e.name.endsWith(".md")?(0,t.jsx)(a.FileText,{}):(0,t.jsx)(r.File,{}),label:e.name,hasChildren:"dir"===e.kind,active:(i?`${i}/${e.name}`:e.name)===n,onClick:()=>l(e)},e.name)),0===d.entries.length&&(0,t.jsx)("p",{className:"p-3 text-xs text-muted-foreground/60",children:"Empty folder"})]})}function Q({content:e,description:s}){let i=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e),n=s?.trim(),l=i?e.slice(i[0].length):e;return(0,t.jsxs)("div",{className:"min-w-0",children:[n&&(0,t.jsx)("p",{className:"border-b border-border/60 px-5 py-3 text-[13px] leading-relaxed text-muted-foreground",children:n}),(0,t.jsx)("div",{className:"px-5 py-4 text-sm leading-relaxed",children:(0,t.jsx)(S.Markdown,{children:l})})]})}function X({source:e,dir:s,path:i,editable:n,onUnsaved:l}){let[r,a]=(0,k.useState)(null),{data:o,isLoading:d,error:c}=(0,W.useServerRoute)(j.queryKey.skillNode(e,s,i)),u=null!==r&&(o?.kind!=="file"||r!==o.content);(0,k.useEffect)(()=>l?.(u),[u,l]);let[m,x]=(0,P.useServerAction)(I,{okMessage:"Saved",onOk:()=>{a(null),(0,W.revalidate)(j.queryKey.skills)}});if(c)return(0,t.jsx)("p",{className:"p-4 font-mono text-xs text-destructive",children:c.message});if(d||!o)return(0,t.jsxs)("div",{className:"space-y-3 p-5",children:[(0,t.jsx)(C.Skeleton,{className:"h-5 w-2/3"}),(0,t.jsx)(C.Skeleton,{className:"h-4 w-full"}),(0,t.jsx)(C.Skeleton,{className:"h-4 w-5/6"})]});if("file"!==o.kind)return null;let f=i.split("/").pop()??"";return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"sticky top-0 z-20 flex items-center justify-between gap-2 border-b border-border/60 bg-background/90 px-5 py-2 font-mono text-[11px] text-muted-foreground backdrop-blur",children:[(0,t.jsx)("span",{className:"truncate",children:f}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)("span",{children:(0,_.formatBytes)(o.size)}),n&&null!==o.content&&null===r&&(0,t.jsxs)(y.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>a(o.content??""),children:[(0,t.jsx)(p,{}),"Edit"]}),null!==r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>a(null),children:"Cancel"}),(0,t.jsx)(y.Button,{size:"xs",className:"font-mono",loading:x,disabled:r===o.content,onClick:()=>m(e,s,i,r),children:"Save"})]})]})]}),null!==r?(0,t.jsx)(M.Textarea,{value:r,onChange:e=>a(e.target.value),spellCheck:!1,"aria-label":`${f} contents`,className:"min-h-120 resize-none rounded-none border-0 font-mono text-[13px] leading-relaxed shadow-none focus-visible:ring-0"}):null===o.content?(0,t.jsx)("p",{className:"px-5 py-4 text-sm text-muted-foreground/60",children:o.size>R.SKILL_FILES.inlineBytes?"Too long to show here — a bot still reads it from disk.":"Not a text file — a bot can still read it from disk."}):f.toLowerCase().endsWith(".md")?(0,t.jsx)(Q,{content:o.content,description:o.description}):(0,t.jsx)("pre",{className:"overflow-x-auto px-5 py-4 font-mono text-[13px] leading-relaxed whitespace-pre text-foreground/90",children:o.content})]})}function ee(){return z.notify.component({className:"sm:max-w-lg",renderer:({close:e,guard:s})=>(0,t.jsx)(et,{onDone:e,guard:s})})}function et({onDone:e,guard:s}){let[i,n]=(0,k.useState)("write"),[l,r]=(0,k.useState)(""),[a,o]=(0,k.useState)(""),[d,c]=(0,k.useState)(""),[u,m]=(0,k.useState)(null),[f,h]=(0,k.useState)(!1),p=(0,k.useRef)(null),g=(0,k.useRef)(!1);g.current=!!(l.trim()||a.trim()||d.trim()||u),(0,k.useEffect)(()=>s(()=>g.current),[s]);let v={errorMessage:!1,onOk:()=>{(0,W.revalidate)(j.queryKey.skills),e()}},[S,z,,C]=(0,P.useServerAction)(D,v),[L,$,,A]=(0,P.useServerAction)(q,v),B=z||$,I="write"===i?C:A,K=null!==u&&u.size>R.SKILL_FILES.uploadBytes,E=Math.round(R.SKILL_FILES.uploadBytes/1024/1024),U=!B&&("write"===i?l.trim()&&a.trim()&&d.trim():null!==u&&!K),O=async()=>{if(!U)return;if("write"===i)return void S({name:l.trim(),description:a.trim(),content:d});if(!u)return;let e=new FormData;e.append("file",u),L(e)},H=e=>{let t=e?.[0]??null;t&&m(t)};return(0,t.jsxs)(T.SettingDialogContent,{title:"New skill",description:"Instructions a bot reads when a job calls for them.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.Button,{variant:"ghost",onClick:e,children:"Cancel"}),(0,t.jsxs)(y.Button,{disabled:!U,loading:B,onClick:O,children:[!B&&("write"===i?(0,t.jsx)(x.Plus,{}):(0,t.jsx)(b,{})),"write"===i?"Create":"Upload"]})]}),children:[(0,t.jsxs)(F.Tabs,{value:i,onValueChange:e=>n(e),children:[(0,t.jsxs)(F.TabsList,{className:"w-full",children:[(0,t.jsx)(F.TabsTrigger,{value:"write",children:"Write"}),(0,t.jsx)(F.TabsTrigger,{value:"upload",children:"Upload"})]}),(0,t.jsxs)(F.TabsContent,{value:"write",className:"space-y-5 pt-4",children:[(0,t.jsxs)(w.Field,{children:[(0,t.jsx)(w.FieldLabel,{htmlFor:"skill-name",children:"Name"}),(0,t.jsxs)(w.FieldContent,{children:[(0,t.jsx)(N.Input,{id:"skill-name",value:l,onChange:e=>r(e.target.value),placeholder:"deploy-checklist",spellCheck:!1,autoFocus:!0}),(0,t.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[R.PATHS.skills.custom,"/",l.trim()||"…","/SKILL.md"]})]})]}),(0,t.jsxs)(w.Field,{children:[(0,t.jsx)(w.FieldLabel,{htmlFor:"skill-description",children:"Description"}),(0,t.jsx)(w.FieldContent,{children:(0,t.jsx)(N.Input,{id:"skill-description",value:a,onChange:e=>o(e.target.value),placeholder:"What it does, then when to use it — a bot reads this to decide"})})]}),(0,t.jsxs)(w.Field,{children:[(0,t.jsx)(w.FieldLabel,{htmlFor:"skill-content",children:"Content"}),(0,t.jsx)(M.Textarea,{id:"skill-content",value:d,onChange:e=>c(e.target.value),placeholder:"Markdown. The steps, the rules, the examples.",className:"min-h-40 resize-none font-mono text-xs"})]})]}),(0,t.jsxs)(F.TabsContent,{value:"upload",className:"space-y-4 pt-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>p.current?.click(),onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:()=>h(!1),onDrop:e=>{e.preventDefault(),h(!1),H(e.dataTransfer.files)},className:(0,_.cn)("flex w-full flex-col items-center gap-2 rounded-xl border border-dashed px-6 py-10 text-center outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",f?"border-foreground/60 bg-muted/60":"border-border hover:bg-muted/40"),children:[(0,t.jsx)(b,{className:"size-5 text-muted-foreground"}),u?(0,t.jsxs)("span",{className:"text-sm",children:[u.name,(0,t.jsxs)("span",{className:(0,_.cn)("ml-2 font-mono text-[11px]",K?"text-destructive":"text-muted-foreground"),children:[(0,_.formatBytes)(u.size),K&&` \xb7 over ${E} MB`]})]}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Drop a file here, or click to choose"})]}),(0,t.jsx)("input",{ref:p,type:"file",accept:".md,.zip,.skill",className:"hidden",onChange:e=>H(e.target.files)}),(0,t.jsxs)("div",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("p",{className:"font-medium text-foreground/80",children:"File requirements"}),(0,t.jsxs)("p",{children:["A ",(0,t.jsx)("span",{className:"font-mono",children:".md"})," file needs a YAML block with the skill's name and description."]}),(0,t.jsxs)("p",{children:["A ",(0,t.jsx)("span",{className:"font-mono",children:".zip"})," or"," ",(0,t.jsx)("span",{className:"font-mono",children:".skill"})," archive needs a SKILL.md inside — the rest of its folder comes along."]}),(0,t.jsxs)("p",{children:["Up to ",E," MB."]})]})]})]}),I&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:I})]})}e.s(["SkillsSetting",0,function(){let[e,s]=(0,k.useState)(""),{data:i,isLoading:n,error:l}=(0,W.useServerRoute)(j.queryKey.skills),r=i??[];if(n)return(0,t.jsx)(T.SettingSkeleton,{rows:4});if(l)return(0,t.jsx)(T.SettingError,{message:l.message});let a=e.trim().toLowerCase(),o=r.filter(e=>!a||`${e.name} ${e.description}`.toLowerCase().includes(a)),d=r.filter(e=>!e.disabled).length,c=r.filter(e=>!e.disabled&&("default"===e.source||"custom"===e.source)).length,u=new Map;for(let e of o)e.bot&&u.set(e.bot,[...u.get(e.bot)??[],e]);return(0,t.jsxs)(T.SettingScreen,{footer:(0,t.jsxs)(T.SettingRailNote,{children:[r.filter(e=>!E(e.source)).length," ","shipped ·"," ",r.filter(e=>E(e.source)).length," ","installed"]}),children:[(0,t.jsx)(T.SettingToolbar,{count:`${d} on \xb7 ${r.length-d} off`,children:(0,t.jsx)(T.SettingFilter,{value:e,onChange:s,placeholder:"Filter skills"})}),(0,t.jsx)(T.SettingGroup,{label:"Custom",hint:"yours — added here · a Default skill of the same name wins",children:(0,t.jsx)(T.SettingItems,{addRow:{label:"Add skill",onClick:ee},children:o.filter(e=>"custom"===e.source).map(e=>(0,t.jsx)(V,{skill:e},`custom/${e.dir}`))})}),[...u].map(([e,s])=>(0,t.jsx)(T.SettingGroup,{label:`${e}'s own`,hint:`only ${e} reads these \xb7 what it found or wrote can be edited or deleted`,children:(0,t.jsx)(T.SettingItems,{children:s.map(e=>(0,t.jsx)(V,{skill:e},`${e.source}/${e.dir}`))})},e)),(0,t.jsx)(T.SettingGroup,{label:"Default",hint:"ships with the app · switch off, can't edit or delete",children:(0,t.jsx)(T.SettingItems,{children:o.filter(e=>"default"===e.source).map(e=>(0,t.jsx)(V,{skill:e},`default/${e.dir}`))})}),c>R.PROMPT_CROWDED.skills&&(0,t.jsxs)(T.SettingNote,{children:[c," skills are on for every bot. Each is a line in every prompt a bot reads, and one more to look past when it picks."]})]})}],833959)},437750,e=>{"use strict";var t=e.i(456420);let s={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};s.node;let i=(0,t.default)(s);e.s(["AppWindow",0,i],437750)},726067,e=>{"use strict";var t=e.i(456420);let s={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};s.node;let i=(0,t.default)(s);e.s(["Folder",0,i],726067)},759659,e=>{"use strict";var t=e.i(456420);let s={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};s.node;let i=(0,t.default)(s);e.s(["Trash2",0,i],759659)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,986530,e=>{"use strict";var t=e.i(843476),s=e.i(225913);e.i(271645);var i=e.i(647163);function n({className:e,...s}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,i.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...s})}e.i(652225);let l=(0,s.cva)("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function({className:e,orientation:s="vertical",...n}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":s,className:(0,i.cn)(l({orientation:s}),e),...n})},"FieldContent",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"field-content",className:(0,i.cn)("group/field-content flex flex-1 flex-col gap-0.5 leading-snug",e),...s})},"FieldLabel",0,function({className:e,...s}){return(0,t.jsx)(n,{"data-slot":"field-label",className:(0,i.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...s})}],986530)},833959,e=>{"use strict";var t=e.i(843476),s=e.i(437750),i=e.i(856539),n=e.i(24071),l=e.i(867927),r=e.i(829600),a=e.i(226091),o=e.i(726067),d=e.i(456420);let c={name:"frame",size:24,node:[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]]};c.node;let u=(0,d.default)(c);var m=e.i(91511),x=e.i(77071),f=e.i(566595);let h={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};h.node;let p=(0,d.default)(h);var g=e.i(759659);let v={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};v.node;let b=(0,d.default)(v);var k=e.i(271645),j=e.i(798120),y=e.i(167881),w=e.i(986530),N=e.i(23750),S=e.i(683408),z=e.i(917162),C=e.i(671428),L=e.i(319036),F=e.i(127341),M=e.i(184762),R=e.i(41533),T=e.i(895836),$=e.i(95187);let D=(0,$.createServerReference)("7fcdc18a9f0d21580596814819ed96e5b21d51494e",$.callServer,void 0,$.findSourceMapURL,"createSkillAction"),A=(0,$.createServerReference)("7f5cbe350c8d9bd6c9c4dbee26eacf1334826465f0",$.callServer,void 0,$.findSourceMapURL,"deleteSkillAction"),B=(0,$.createServerReference)("7fde1c1c825a89c4b52db4c593ab94774fbeea596e",$.callServer,void 0,$.findSourceMapURL,"setSkillDisabledAction"),q=(0,$.createServerReference)("7fe83132401dc1d8c2bf42a8ebbb4707ed624e3441",$.callServer,void 0,$.findSourceMapURL,"uploadSkillAction"),I=(0,$.createServerReference)("7f5a2a5e91c96d99bc5f00673531bf65d0eaa2dd86",$.callServer,void 0,$.findSourceMapURL,"writeSkillFileAction");var K=e.i(681307);K.z.union([K.z.enum(["custom","default"]),K.z.templateLiteral(["kit:",K.z.string().regex(/^[\p{L}\p{N}_-]+$/u)]),K.z.templateLiteral(["own:",K.z.string().regex(/^[\p{L}\p{N}_-]+$/u)])]);let E=e=>"custom"===e||e.startsWith("own:"),U=K.z.string().trim().min(1,"Skill name is required").max(64,"Skill name is too long").regex(/^[a-z0-9][a-z0-9_-]*$/i,"Use letters, numbers, dashes and underscores only"),O=K.z.string().trim().min(1,"Skill name is required").max(64,"Skill name is too long");K.z.object({name:O,description:K.z.string().trim().min(1,"Description is required"),metadata:K.z.record(K.z.string(),K.z.unknown()).optional(),disabled:K.z.boolean().optional(),platforms:K.z.array(K.z.string()).optional()}).extend({name:U,content:K.z.string().trim().min(1,"Content is required")});var P=e.i(609856),W=e.i(283653),_=e.i(647163);let H={artifact:u,browser:m.Globe,computer:s.AppWindow,"find-skills":f.Search,"skill-creator":p};function V({skill:e}){let[s,n]=(0,P.useServerAction)(A,{onOk:()=>(0,W.revalidate)(j.queryKey.skills)}),[r]=(0,P.useServerAction)(B,{onOk:()=>(0,W.revalidate)(j.queryKey.skills)}),a=async()=>{await z.notify.confirm({title:`Delete ${e.name}?`,description:"Every file in this skill is deleted for good.",okText:"Delete",destructive:!0})&&s(e.source,e.dir)},o="default"===e.source&&H[e.dir]||i.BookMarked;return(0,t.jsxs)("div",{className:"group flex items-center transition-colors hover:bg-muted/50",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{var s;return s=e,z.notify.component({className:"sm:max-w-4xl",renderer:({guard:e})=>(0,t.jsx)(G,{skill:s,guard:e})})},className:"flex min-w-0 flex-1 items-center gap-3 py-4 pl-4 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)("span",{className:(0,_.cn)("grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",e.disabled&&"opacity-45"),children:(0,t.jsx)(o,{className:"size-4"})}),(0,t.jsxs)("span",{className:(0,_.cn)("min-w-0 flex-1 space-y-0.5",e.disabled&&"opacity-45"),children:[(0,t.jsx)("span",{className:"block truncate text-sm font-medium",children:e.name}),(0,t.jsx)("span",{className:"line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:e.description.trim().split(/(?<=[.。])\s|\n/)[0].trim()})]}),(0,t.jsx)(l.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 group-hover:text-foreground"})]}),(0,t.jsxs)("div",{className:"mr-4 ml-5 flex w-18 shrink-0 items-center justify-end gap-3",children:[(0,t.jsx)(L.Switch,{checked:!e.disabled,onCheckedChange:t=>r(e.source,e.dir,!t),"aria-label":`${e.name} on or off`,className:"shrink-0"}),E(e.source)?(0,t.jsx)(y.Button,{size:"icon-sm",variant:"ghost",loading:n,onClick:a,"aria-label":`Delete ${e.name}`,className:"shrink-0 text-muted-foreground",children:(0,t.jsx)(g.Trash2,{})}):(0,t.jsx)("span",{className:"size-7 shrink-0"})]})]})}function G({skill:e,guard:s}){let[i,l]=(0,k.useState)(""),[r,a]=(0,k.useState)("SKILL.md"),o=(0,k.useRef)(!1);(0,k.useEffect)(()=>s(()=>o.current),[s]);let d=async e=>{let t=i?`${i}/${e.name}`:e.name;"dir"===e.kind?l(t):t===r||(!o.current||await z.notify.confirm({title:"Discard your changes?",description:`What you wrote in ${r?.split("/").pop()} is not saved.`,okText:"Discard",destructive:!0}))&&(o.current=!1,a(t))};return(0,t.jsx)(T.SettingDialogContent,{title:e.name,description:(0,t.jsx)(Y,{skill:e,path:r??i}),children:(0,t.jsxs)("div",{className:"flex h-[36rem] divide-x divide-border/60 overflow-hidden rounded-xl border border-border/60 bg-background",children:[(0,t.jsxs)("div",{className:"flex w-44 shrink-0 flex-col overflow-y-auto bg-muted/20 py-1",children:[i&&(0,t.jsxs)("button",{type:"button",onClick:()=>l(i.split("/").slice(0,-1).join("/")),className:"mx-1 mb-1 flex items-center gap-1 rounded-md px-2 py-1 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/50 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(n.ChevronLeft,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:i.split("/").pop()})]}),(0,t.jsx)(J,{source:e.source,dir:e.dir,path:i,current:r,onPick:d})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r?(0,t.jsx)(X,{source:e.source,dir:e.dir,path:r,editable:E(e.source),onUnsaved:e=>{o.current=e}},r):(0,t.jsx)("p",{className:"p-6 text-sm text-muted-foreground/60",children:"Pick a file"})})]})})}function Y({skill:e,path:s}){if(!e)return(0,t.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground/60",children:"Pick a skill"});let i=[e.name,...s.split("/").filter(Boolean)];return(0,t.jsx)("span",{className:"flex min-w-0 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:i.map((e,s)=>(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[s>0&&(0,t.jsx)(l.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,t.jsx)("span",{className:(0,_.cn)("truncate",s===i.length-1&&"text-foreground"),children:e})]},`${s}-${e}`))})}function Z({icon:e,label:s,active:i,hasChildren:n,onClick:r}){return(0,t.jsxs)("button",{type:"button",onClick:r,className:(0,_.cn)("mx-1 flex items-center gap-1.5 rounded-md px-2 py-1 text-left text-xs outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",i?T.PICKED_ROW:"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/70 [&>svg]:size-3",children:e}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:s}),n&&(0,t.jsx)(l.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground/50"})]})}function J({source:e,dir:s,path:i,current:n,onPick:l}){let{data:d,isLoading:c,error:u}=(0,W.useServerRoute)(j.queryKey.skillNode(e,s,i));return u?(0,t.jsx)("p",{className:"p-3 font-mono text-xs text-destructive",children:u.message}):c||!d?(0,t.jsxs)("div",{className:"space-y-2 p-2",children:[(0,t.jsx)(C.Skeleton,{className:"h-5 w-full"}),(0,t.jsx)(C.Skeleton,{className:"h-5 w-4/5"})]}):"dir"!==d.kind?null:(0,t.jsxs)(t.Fragment,{children:[d.entries.map(e=>(0,t.jsx)(Z,{icon:"dir"===e.kind?(0,t.jsx)(o.Folder,{}):e.name.endsWith(".md")?(0,t.jsx)(a.FileText,{}):(0,t.jsx)(r.File,{}),label:e.name,hasChildren:"dir"===e.kind,active:(i?`${i}/${e.name}`:e.name)===n,onClick:()=>l(e)},e.name)),0===d.entries.length&&(0,t.jsx)("p",{className:"p-3 text-xs text-muted-foreground/60",children:"Empty folder"})]})}function Q({content:e,description:s}){let i=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e),n=s?.trim(),l=i?e.slice(i[0].length):e;return(0,t.jsxs)("div",{className:"min-w-0",children:[n&&(0,t.jsx)("p",{className:"border-b border-border/60 px-5 py-3 text-[13px] leading-relaxed text-muted-foreground",children:n}),(0,t.jsx)("div",{className:"px-5 py-4 text-sm leading-relaxed",children:(0,t.jsx)(S.Markdown,{children:l})})]})}function X({source:e,dir:s,path:i,editable:n,onUnsaved:l}){let[r,a]=(0,k.useState)(null),{data:o,isLoading:d,error:c}=(0,W.useServerRoute)(j.queryKey.skillNode(e,s,i)),u=null!==r&&(o?.kind!=="file"||r!==o.content);(0,k.useEffect)(()=>l?.(u),[u,l]);let[m,x]=(0,P.useServerAction)(I,{okMessage:"Saved",onOk:()=>{a(null),(0,W.revalidate)(j.queryKey.skills)}});if(c)return(0,t.jsx)("p",{className:"p-4 font-mono text-xs text-destructive",children:c.message});if(d||!o)return(0,t.jsxs)("div",{className:"space-y-3 p-5",children:[(0,t.jsx)(C.Skeleton,{className:"h-5 w-2/3"}),(0,t.jsx)(C.Skeleton,{className:"h-4 w-full"}),(0,t.jsx)(C.Skeleton,{className:"h-4 w-5/6"})]});if("file"!==o.kind)return null;let f=i.split("/").pop()??"";return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"sticky top-0 z-20 flex items-center justify-between gap-2 border-b border-border/60 bg-background/90 px-5 py-2 font-mono text-[11px] text-muted-foreground backdrop-blur",children:[(0,t.jsx)("span",{className:"truncate",children:f}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)("span",{children:(0,_.formatBytes)(o.size)}),n&&null!==o.content&&null===r&&(0,t.jsxs)(y.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>a(o.content??""),children:[(0,t.jsx)(p,{}),"Edit"]}),null!==r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>a(null),children:"Cancel"}),(0,t.jsx)(y.Button,{size:"xs",className:"font-mono",loading:x,disabled:r===o.content,onClick:()=>m(e,s,i,r),children:"Save"})]})]})]}),null!==r?(0,t.jsx)(M.Textarea,{value:r,onChange:e=>a(e.target.value),spellCheck:!1,"aria-label":`${f} contents`,className:"min-h-120 resize-none rounded-none border-0 font-mono text-[13px] leading-relaxed shadow-none focus-visible:ring-0"}):null===o.content?(0,t.jsx)("p",{className:"px-5 py-4 text-sm text-muted-foreground/60",children:o.size>R.SKILL_FILES.inlineBytes?"Too long to show here — a bot still reads it from disk.":"Not a text file — a bot can still read it from disk."}):f.toLowerCase().endsWith(".md")?(0,t.jsx)(Q,{content:o.content,description:o.description}):(0,t.jsx)("pre",{className:"overflow-x-auto px-5 py-4 font-mono text-[13px] leading-relaxed whitespace-pre text-foreground/90",children:o.content})]})}function ee(){return z.notify.component({className:"sm:max-w-lg",renderer:({close:e,guard:s})=>(0,t.jsx)(et,{onDone:e,guard:s})})}function et({onDone:e,guard:s}){let[i,n]=(0,k.useState)("write"),[l,r]=(0,k.useState)(""),[a,o]=(0,k.useState)(""),[d,c]=(0,k.useState)(""),[u,m]=(0,k.useState)(null),[f,h]=(0,k.useState)(!1),p=(0,k.useRef)(null),g=(0,k.useRef)(!1);g.current=!!(l.trim()||a.trim()||d.trim()||u),(0,k.useEffect)(()=>s(()=>g.current),[s]);let v={errorMessage:!1,onOk:()=>{(0,W.revalidate)(j.queryKey.skills),e()}},[S,z,,C]=(0,P.useServerAction)(D,v),[L,$,,A]=(0,P.useServerAction)(q,v),B=z||$,I="write"===i?C:A,K=null!==u&&u.size>R.SKILL_FILES.uploadBytes,E=Math.round(R.SKILL_FILES.uploadBytes/1024/1024),U=!B&&("write"===i?l.trim()&&a.trim()&&d.trim():null!==u&&!K),O=async()=>{if(!U)return;if("write"===i)return void S({name:l.trim(),description:a.trim(),content:d});if(!u)return;let e=new FormData;e.append("file",u),L(e)},H=e=>{let t=e?.[0]??null;t&&m(t)};return(0,t.jsxs)(T.SettingDialogContent,{title:"New skill",description:"Instructions a bot reads when a job calls for them.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.Button,{variant:"ghost",onClick:e,children:"Cancel"}),(0,t.jsxs)(y.Button,{disabled:!U,loading:B,onClick:O,children:[!B&&("write"===i?(0,t.jsx)(x.Plus,{}):(0,t.jsx)(b,{})),"write"===i?"Create":"Upload"]})]}),children:[(0,t.jsxs)(F.Tabs,{value:i,onValueChange:e=>n(e),children:[(0,t.jsxs)(F.TabsList,{className:"w-full",children:[(0,t.jsx)(F.TabsTrigger,{value:"write",children:"Write"}),(0,t.jsx)(F.TabsTrigger,{value:"upload",children:"Upload"})]}),(0,t.jsxs)(F.TabsContent,{value:"write",className:"space-y-5 pt-4",children:[(0,t.jsxs)(w.Field,{children:[(0,t.jsx)(w.FieldLabel,{htmlFor:"skill-name",children:"Name"}),(0,t.jsxs)(w.FieldContent,{children:[(0,t.jsx)(N.Input,{id:"skill-name",value:l,onChange:e=>r(e.target.value),placeholder:"deploy-checklist",spellCheck:!1,autoFocus:!0}),(0,t.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[R.PATHS.skills.custom,"/",l.trim()||"…","/SKILL.md"]})]})]}),(0,t.jsxs)(w.Field,{children:[(0,t.jsx)(w.FieldLabel,{htmlFor:"skill-description",children:"Description"}),(0,t.jsx)(w.FieldContent,{children:(0,t.jsx)(N.Input,{id:"skill-description",value:a,onChange:e=>o(e.target.value),placeholder:"What it does, then when to use it — a bot reads this to decide"})})]}),(0,t.jsxs)(w.Field,{children:[(0,t.jsx)(w.FieldLabel,{htmlFor:"skill-content",children:"Content"}),(0,t.jsx)(M.Textarea,{id:"skill-content",value:d,onChange:e=>c(e.target.value),placeholder:"Markdown. The steps, the rules, the examples.",className:"min-h-40 resize-none font-mono text-xs"})]})]}),(0,t.jsxs)(F.TabsContent,{value:"upload",className:"space-y-4 pt-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>p.current?.click(),onDragOver:e=>{e.preventDefault(),h(!0)},onDragLeave:()=>h(!1),onDrop:e=>{e.preventDefault(),h(!1),H(e.dataTransfer.files)},className:(0,_.cn)("flex w-full flex-col items-center gap-2 rounded-xl border border-dashed px-6 py-10 text-center outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",f?"border-foreground/60 bg-muted/60":"border-border hover:bg-muted/40"),children:[(0,t.jsx)(b,{className:"size-5 text-muted-foreground"}),u?(0,t.jsxs)("span",{className:"text-sm",children:[u.name,(0,t.jsxs)("span",{className:(0,_.cn)("ml-2 font-mono text-[11px]",K?"text-destructive":"text-muted-foreground"),children:[(0,_.formatBytes)(u.size),K&&` \xb7 over ${E} MB`]})]}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Drop a file here, or click to choose"})]}),(0,t.jsx)("input",{ref:p,type:"file",accept:".md,.zip,.skill",className:"hidden",onChange:e=>H(e.target.files)}),(0,t.jsxs)("div",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("p",{className:"font-medium text-foreground/80",children:"File requirements"}),(0,t.jsxs)("p",{children:["A ",(0,t.jsx)("span",{className:"font-mono",children:".md"})," file needs a YAML block with the skill's name and description."]}),(0,t.jsxs)("p",{children:["A ",(0,t.jsx)("span",{className:"font-mono",children:".zip"})," or"," ",(0,t.jsx)("span",{className:"font-mono",children:".skill"})," archive needs a SKILL.md inside — the rest of its folder comes along."]}),(0,t.jsxs)("p",{children:["Up to ",E," MB."]})]})]})]}),I&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:I})]})}e.s(["SkillsSetting",0,function(){let[e,s]=(0,k.useState)(""),{data:i,isLoading:n,error:l}=(0,W.useServerRoute)(j.queryKey.skills),r=i??[];if(n)return(0,t.jsx)(T.SettingSkeleton,{rows:4});if(l)return(0,t.jsx)(T.SettingError,{message:l.message});let a=e.trim().toLowerCase(),o=r.filter(e=>!a||`${e.name} ${e.description}`.toLowerCase().includes(a)),d=r.filter(e=>!e.disabled).length,c=r.filter(e=>!e.disabled&&("default"===e.source||"custom"===e.source)).length,u=new Map;for(let e of o)e.bot&&u.set(e.bot,[...u.get(e.bot)??[],e]);return(0,t.jsxs)(T.SettingScreen,{footer:(0,t.jsxs)(T.SettingRailNote,{children:[r.filter(e=>!E(e.source)).length," ","shipped ·"," ",r.filter(e=>E(e.source)).length," ","installed"]}),children:[(0,t.jsx)(T.SettingToolbar,{count:`${d} on \xb7 ${r.length-d} off`,children:(0,t.jsx)(T.SettingFilter,{value:e,onChange:s,placeholder:"Filter skills"})}),(0,t.jsx)(T.SettingGroup,{label:"Custom",hint:"yours — added here · a Default skill of the same name wins",children:(0,t.jsx)(T.SettingItems,{addRow:{label:"Add skill",onClick:ee},children:o.filter(e=>"custom"===e.source).map(e=>(0,t.jsx)(V,{skill:e},`custom/${e.dir}`))})}),[...u].map(([e,s])=>(0,t.jsx)(T.SettingGroup,{label:`${e}'s own`,hint:`only ${e} reads these \xb7 what it found or wrote can be edited or deleted`,children:(0,t.jsx)(T.SettingItems,{children:s.map(e=>(0,t.jsx)(V,{skill:e},`${e.source}/${e.dir}`))})},e)),(0,t.jsx)(T.SettingGroup,{label:"Default",hint:"ships with the app · switch off, can't edit or delete",children:(0,t.jsx)(T.SettingItems,{children:o.filter(e=>"default"===e.source).map(e=>(0,t.jsx)(V,{skill:e},`default/${e.dir}`))})}),c>R.PROMPT_CROWDED.skills&&(0,t.jsxs)(T.SettingNote,{children:[c," skills are on for every bot. Each is a line in every prompt a bot reads, and one more to look past when it picks."]})]})}],833959)},437750,e=>{"use strict";var t=e.i(456420);let s={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};s.node;let i=(0,t.default)(s);e.s(["AppWindow",0,i],437750)},726067,e=>{"use strict";var t=e.i(456420);let s={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};s.node;let i=(0,t.default)(s);e.s(["Folder",0,i],726067)},759659,e=>{"use strict";var t=e.i(456420);let s={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};s.node;let i=(0,t.default)(s);e.s(["Trash2",0,i],759659)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,480869,e=>{"use strict";var t=e.i(843476),n=e.i(401851),a=e.i(493801),i=e.i(456420);let s={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"}]]};s.node;let r=(0,i.default)(s);var l=e.i(689664),o=e.i(716327),d=e.i(867927),u=e.i(632781),c=e.i(648119),m=e.i(21357),h=e.i(759659),x=e.i(263676),f=e.i(271645),p=e.i(798120),g=e.i(167881),b=e.i(630374),y=e.i(463415),j=e.i(23750),k=e.i(917162),v=e.i(421429),w=e.i(660302),N=e.i(319036),M=e.i(184762),S=e.i(41533),D=e.i(635963),T=e.i(978411),C=e.i(895836),$=e.i(989409),R=e.i(245629),O=e.i(609856),A=e.i(283653),z=e.i(647163),q=e.i(95187);let I=(0,q.createServerReference)("7fb21b18c6abc3ba14c4c0c36f2c9ecbe3c644d6c7",q.callServer,void 0,q.findSourceMapURL,"createRoutineAction"),E=(0,q.createServerReference)("7f97b1aa7b52044a0c13d09b86cc1c92cf27b14d0e",q.callServer,void 0,q.findSourceMapURL,"deleteRoutineAction"),P=(0,q.createServerReference)("7ff8891bc45feda5327738f21c7a3de9c84c3f4f7e",q.callServer,void 0,q.findSourceMapURL,"runRoutineNowAction"),B=(0,q.createServerReference)("7f4c705cd2ff4be324c689fd2c3bd08c5adeb41e60",q.callServer,void 0,q.findSourceMapURL,"updateRoutineAction");var F=e.i(504565);let H=[1,2,3,4,5,6,7],U=F.default.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/,"A time is HH:MM, 00:00 to 23:59");function K(e){let[t,n]=e.split(" "),[a,i,s]=t.split("-").map(Number),[r,l]=n.split(":").map(Number);return new Date(a,i-1,s,r,l)}let W=/^\d{4}-\d\d-\d\d ([01]\d|2[0-3]):[0-5]\d$/,L=F.default.string().regex(W,'A moment is "YYYY-MM-DD HH:MM"').refine(e=>{if(!W.test(e))return!0;let t=K(e);return t.getMonth()===Number(e.slice(5,7))-1&&t.getDate()===Number(e.slice(8,10))},"There is no such day"),G=F.default.discriminatedUnion("kind",[F.default.object({kind:F.default.literal("once"),at:L}),F.default.object({kind:F.default.literal("daily"),time:U,days:F.default.array(F.default.number().int().min(1).max(7)).min(1,"Pick at least one day").transform(e=>[...new Set(e)].sort((e,t)=>e-t))}),F.default.object({kind:F.default.literal("every"),hours:F.default.number().int().min(S.ROUTINE.minHours,`No more often than every ${S.ROUTINE.minHours}h`).max(168)})]),J=F.default.object({bot:F.default.string().trim().min(1,"Pick a bot"),label:F.default.string().trim().min(1,"Give it a name").max(80),request:F.default.string().trim().min(1,"Say what it should do"),schedule:G}),Y=F.default.object({id:F.default.string(),status:F.default.enum(["running","waiting","done","cancelled"]),outcome:F.default.string().nullable(),updatedAt:R.DateLikeSchema});J.extend({id:F.default.string(),enabled:F.default.boolean(),nextRunAt:R.DateLikeSchema,runs:F.default.array(Y)});let _=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],V=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function X(e){if("once"===e.kind){let[t,n]=e.at.split(" "),[,a,i]=t.split("-").map(Number);return`Once \xb7 ${V[a-1]} ${i} ${n}`}if("every"===e.kind)return 1===e.hours?"Every hour":`Every ${e.hours} hours`;let{days:t,time:n}=e;if(7===t.length)return`Daily ${n}`;if(1===t.length)return`${_[t[0]-1]} ${n}`;let a=t.every((e,n)=>0===n||e===t[n-1]+1)?`${_[t[0]-1]}–${_[t.at(-1)-1]}`:t.map(e=>_[e-1]).join(" ");return`Daily ${n} \xb7 ${a}`}var Q=e.i(431594);function Z({routine:e,bots:n,open:a,onOpen:i,onSwitch:s}){let r=function(e,t){let n=e.runs[0],a=n?.outcome?(0,z.plainText)(n.outcome):"",i=n?`${(0,R.whenOf)(n.updatedAt)}${a?` — ${a}`:""}`:"Not run yet";if(!e.enabled)return{text:`Off \xb7 ${i}`,tone:"text-muted-foreground"};let s=t?.find(t=>t.name===e.bot);return t&&(!s||s.disabled)?{text:s?`${e.bot} is switched off`:`${e.bot} is gone — pick another bot`,tone:z.WAITING_INK,waits:!0}:n?.status==="running"?{text:"Running now",tone:"",shine:!0}:n?.status==="waiting"?{text:`The last run waits on you${a?`: ${a}`:""}`,tone:z.WAITING_INK,waits:!0}:{text:i,tone:"text-muted-foreground"}}(e,n),l=e.runs[0]?.status==="running";return(0,t.jsxs)("div",{className:(0,z.cn)("flex items-center gap-3 p-4 transition-colors",a?"bg-muted/80":"hover:bg-muted/50"),children:[(0,t.jsxs)("button",{type:"button",onClick:i,className:(0,z.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",!e.enabled&&"opacity-70"),children:[(0,t.jsx)(D.BotMark,{size:40,seed:e.bot,...(0,D.markOf)(e.bot,n),state:l?"thinking":"idle",notify:!!r.waits,className:"shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.label}),l&&(0,t.jsx)(u.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"})]}),(0,t.jsx)("span",{className:"flex min-w-0 text-[13px] leading-snug",children:r.shine?(0,t.jsx)(w.ShinyText,{text:r.text,speed:2.2,className:"min-w-0 truncate"}):(0,t.jsx)("span",{className:(0,z.cn)("min-w-0 truncate",r.tone),children:r.text})})]}),(0,t.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,t.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 text-foreground",children:[(0,t.jsx)(Q.RoutineMark,{className:"size-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:X(e.schedule)})]}),(0,t.jsx)("span",{className:"max-w-full truncate text-muted-foreground/70",children:e.enabled?`next ${(0,R.whenOf)(e.nextRunAt)}`:"off"})]})]}),(0,t.jsx)(N.Switch,{checked:e.enabled,onCheckedChange:s,"aria-label":`${e.label} on or off`,className:"shrink-0"}),(0,t.jsx)("button",{type:"button",onClick:i,"aria-label":`Open ${e.label}`,className:"shrink-0 rounded-md text-muted-foreground outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(d.ChevronRight,{className:"size-4"})})]})}let ee=e=>String(e).padStart(2,"0");function et(e,t=new Date){let a=new Date(t);return a.setDate(a.getDate()+e),(0,n.format)(a,"yyyy-MM-dd")}let en=(e,t)=>{let n=e?.schedule;return{label:e?.label??"",bot:e?.bot??t.find(e=>!e.disabled)?.name??"",request:e?.request??"",kind:n?.kind??"daily",time:n?.kind==="daily"?n.time:n?.kind==="once"?n.at.slice(11):"09:00",days:n?.kind==="daily"?n.days:[...H],hours:n?.kind==="every"?n.hours:6,date:n?.kind==="once"?n.at.slice(0,10):et(1)}};function ea(e){let t=/^\d\d:\d\d$/.test(e.time);return"once"===e.kind?t&&e.date?{kind:"once",at:`${e.date} ${e.time}`}:null:"daily"===e.kind?e.days.length&&t?{kind:"daily",time:e.time,days:e.days}:null:{kind:"every",hours:e.hours}}let ei=e=>e?.kind==="once"&&K(e.at)<=new Date,es=[{label:"Every day",days:[...H]},{label:"Weekdays",days:[1,2,3,4,5]},{label:"Weekends",days:[6,7]}],er=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],el=[1,2,3,6,12,24].filter(e=>e>=S.ROUTINE.minHours);function eo({routine:e,bots:n,onClose:a,onMade:i}){var s,r;let l,[u,w]=(0,f.useState)(null),S=(0,f.useCallback)(e=>{w(e?.closest("[data-slot=dialog-content]")??null)},[]),C="new"===e?null:e,q="new"===e?"new":e?.id??"",[F,U]=(0,f.useState)(()=>en(C,n));(0,f.useEffect)(()=>U(en(C,n)),[q]);let K=e=>U(t=>({...t,...e})),W=()=>(0,A.revalidate)(p.queryKey.routines),[L,G]=(0,O.useServerAction)(I,{onOk:e=>{W(),i(e.id)}}),[J]=(0,O.useServerAction)(B,{onOk:W}),[Y]=(0,O.useServerAction)(E,{onOk:W}),[V,Z]=(0,O.useServerAction)(P,{onOk:()=>{W(),(0,A.revalidate)(p.queryKey.threads)}}),em=ea(F),eg=em&&!ei(em)&&F.label.trim()&&F.bot&&F.request.trim()?{label:F.label.trim(),bot:F.bot,request:F.request.trim(),schedule:em}:null,eb=e=>{C&&J(C.id,e)},ey=e=>{K(e);let t=ea({...F,...e});!t||ei(t)||C&&function(e,t){if("once"===e.kind)return"once"===t.kind&&e.at===t.at;if("every"===e.kind)return"every"===t.kind&&e.hours===t.hours;let n=e=>[...e].sort((e,t)=>e-t).join();return"daily"===t.kind&&e.time===t.time&&n(e.days)===n(t.days)}(t,C.schedule)||eb({schedule:t,..."once"===t.kind?{enabled:!0}:{}})},ej=!!(C&&(F.label.trim()&&F.label.trim()!==C.label||F.request.trim()&&F.request.trim()!==C.request)),ek=C?ej:!!(F.label.trim()||F.request.trim()),ev=(0,f.useRef)(ek);ev.current=ek;let ew=(0,$.useSettingsStore)(e=>e.holdUnsaved);(0,f.useEffect)(()=>(ew(()=>ev.current),()=>ew(null)),[ew]);let eN=async()=>{(!ev.current||await k.notify.discard())&&a()},eM=async()=>{!C||await k.notify.confirm({title:`Delete "${C.label}"?`,description:"It starts no more. The jobs it already opened stay.",okText:"Delete",destructive:!0})&&(await Y(C.id).catch(()=>{}),a())},eS=n.find(e=>e.name===F.bot),eD=C?.runs[0]?.status==="running"||C?.runs[0]?.status==="waiting";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{ref:S,hidden:!0}),(0,t.jsx)(b.Dialog,{open:!!(e&&u),onOpenChange:e=>!e&&void eN(),modal:!1,disablePointerDismissal:!0,children:(0,t.jsx)(b.DialogPortal,{container:u,children:(0,t.jsx)(b.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:e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2.5 pt-3.5 pr-3 pb-1.5 pl-5",children:[eS?(0,t.jsx)(D.BotMark,{size:28,seed:eS.name,...(0,D.markOf)(eS.name,n),notify:!1,className:"shrink-0"}):(0,t.jsx)("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,t.jsx)(Q.RoutineMark,{className:"size-3.5"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(b.DialogTitle,{className:"sr-only",children:C?C.label:"New routine"}),(0,t.jsx)("p",{className:"truncate text-[15px] leading-5 font-semibold",children:C?C.label:"New routine"}),C&&(0,t.jsxs)("p",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[(0,t.jsx)(Q.RoutineMark,{className:"size-3 shrink-0"}),(0,t.jsxs)("span",{className:"truncate",children:[C.bot," · ",X(C.schedule),C.enabled&&` \xb7 next ${(0,R.whenOf)(C.nextRunAt)}`]})]})]}),C&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.Switch,{checked:C.enabled,onCheckedChange:e=>void J(C.id,{enabled:e}),"aria-label":`${C.label} on or off`,className:"mr-1 shrink-0"}),(0,t.jsxs)(y.DropdownMenu,{children:[(0,t.jsx)(y.DropdownMenuTrigger,{render:(0,t.jsx)(g.Button,{size:"icon-sm",variant:"ghost","aria-label":"More",className:"text-muted-foreground"}),children:(0,t.jsx)(c.MoreHorizontal,{})}),(0,t.jsx)(y.DropdownMenuContent,{align:"end",children:(0,t.jsxs)(y.DropdownMenuItem,{variant:"destructive",onClick:eM,children:[(0,t.jsx)(h.Trash2,{}),"Delete"]})})]})]}),(0,t.jsx)(b.DialogClose,{render:(0,t.jsx)(g.Button,{size:"icon-sm",variant:"ghost","aria-label":"Close the routine"}),children:(0,t.jsx)(x.X,{})})]}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pt-3 pb-5",children:[(0,t.jsxs)(ep,{label:"Name",htmlFor:"routine-name",children:[(0,t.jsx)(j.Input,{id:"routine-name",value:F.label,onChange:e=>K({label:e.target.value}),placeholder:"Morning mail",maxLength:80,autoFocus:!C}),(0,t.jsx)(ed,{children:"What it is called in this list, and what she calls it on a call."})]}),(0,t.jsxs)(ep,{label:"Bot",children:[(0,t.jsxs)(y.DropdownMenu,{children:[(0,t.jsxs)(y.DropdownMenuTrigger,{render:(0,t.jsx)(g.Button,{variant:"outline",className:"justify-start gap-2 pl-1.5 font-normal"}),children:[eS?(0,t.jsx)(D.BotMark,{size:20,seed:eS.name,...(0,D.markOf)(eS.name,n),notify:!1,className:"shrink-0"}):null,(0,t.jsx)("span",{className:(0,z.cn)(!eS&&"pl-1.5 text-muted-foreground"),children:eS?.name??(F.bot||"Pick a bot")}),(0,t.jsx)(o.ChevronDown,{className:"ml-1 size-3.5 text-muted-foreground"})]}),(0,t.jsx)(y.DropdownMenuContent,{align:"start",children:(0,t.jsx)(y.DropdownMenuGroup,{children:n.filter(e=>!e.disabled).map(e=>(0,t.jsxs)(y.DropdownMenuItem,{onClick:()=>{K({bot:e.name}),e.name!==C?.bot&&eb({bot:e.name})},children:[(0,t.jsx)(D.BotMark,{size:16,seed:e.name,...(0,D.markOf)(e.name,n),notify:!1,className:"shrink-0"}),e.name]},e.name))})})]}),(0,t.jsx)(ed,{children:"Who does the job each time it starts."})]}),(0,t.jsx)(ep,{label:"When",children:(0,t.jsxs)("div",{className:"space-y-3.5",children:[(0,t.jsx)(v.Segmented,{"aria-label":"How it starts",value:F.kind,onChange:e=>ey({kind:e}),options:[{value:"once",label:"Once"},{value:"daily",label:"On set days"},{value:"every",label:"Every few hours"}]}),(0,t.jsx)("div",{className:"space-y-2.5",children:"once"===F.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ec,{word:"On",children:(0,t.jsx)(eh,{value:F.date,onPick:e=>ey({date:e})})}),(0,t.jsxs)(ec,{word:"At",children:[(0,t.jsx)(ex,{value:F.time,onChange:e=>K({time:e}),onDone:()=>ey({})}),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"or"}),(0,t.jsx)(eu,{picked:!1,onClick:()=>{let e;return ey(((e=new Date(Date.now()+36e5)).setMinutes(5*Math.ceil(e.getMinutes()/5),0,0),{date:et(0,e),time:`${ee(e.getHours())}:${ee(e.getMinutes())}`}))},children:"In an hour"})]})]}):"daily"===F.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ec,{word:"On",children:H.map(e=>{let n=F.days.includes(e);return(0,t.jsx)(eu,{picked:n,several:!0,"aria-label":er[e-1],onClick:()=>ey({days:n?F.days.filter(t=>t!==e):[...F.days,e].sort((e,t)=>e-t)}),children:_[e-1]},e)})}),(0,t.jsx)(ec,{children:es.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>ey({days:[...e.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:e.label},e.label))}),(0,t.jsx)(ec,{word:"At",children:(0,t.jsx)(ex,{value:F.time,onChange:e=>K({time:e}),onDone:()=>ey({})})})]}):(0,t.jsxs)(ec,{word:"Every",children:[(el.includes(F.hours)?el:[...el,F.hours].sort((e,t)=>e-t)).map(e=>(0,t.jsx)(eu,{picked:e===F.hours,onClick:()=>ey({hours:e}),className:"min-w-10 px-3",children:e},e)),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"hours"})]})}),(0,t.jsx)(ef,{schedule:em,kind:F.kind})]})}),(0,t.jsxs)(ep,{label:"Job",htmlFor:"routine-request",children:[(0,t.jsx)(M.Textarea,{id:"routine-request",value:F.request,onChange:e=>K({request:e.target.value}),placeholder:"Go through the mail that came since the last run and draft replies to what needs one. Send nothing.",className:"min-h-28"}),(0,t.jsx)(ed,{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."})]}),C&&(0,t.jsxs)("div",{className:"pt-1",children:[(0,t.jsx)("div",{className:"flex h-6 items-center",children:(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"Runs"})}),0===C.runs.length?(0,t.jsx)("p",{className:"py-2 text-[13px] text-muted-foreground",children:"Not run yet."}):C.runs.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>{var t;return t=e.id,void($.useSettingsStore.getState().hide(),T.roomOpens.open(t))},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,t.jsx)("span",{className:"w-28 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:(0,R.whenOf)(e.updatedAt)}),(0,t.jsx)("span",{className:(0,z.cn)("min-w-0 flex-1 truncate","waiting"===e.status?z.WAITING_INK:"text-muted-foreground"),children:"running"===e.status?"Running now":e.outcome?(0,z.plainText)(e.outcome):"cancelled"===e.status?"Stopped":"No words"}),(0,t.jsx)(d.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground"})]},e.id))]})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-t border-border/60 px-5 py-3",children:[(0,t.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-4 text-muted-foreground",children:C||eg?"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 ${s=F,r=em,(l=[s.label.trim()?null:"a name",s.bot?null:"a bot",!r?"a time":ei(r)?"a time still ahead":null,s.request.trim()?null:"a job"].filter(e=>null!==e)).length>1?`${l.slice(0,-1).join(", ")} and ${l.at(-1)}`:l[0]??"nothing"}.`}),ej&&(0,t.jsx)(g.Button,{size:"sm",onClick:()=>{if(!C)return;let e={};F.label.trim()&&F.label.trim()!==C.label&&(e.label=F.label.trim()),F.request.trim()&&F.request.trim()!==C.request&&(e.request=F.request.trim()),Object.keys(e).length&&eb(e)},children:"Save"}),C?(0,t.jsxs)(g.Button,{variant:"outline",size:"sm",loading:Z,disabled:eD,title:eD?"Its last run is still open":void 0,onClick:()=>void V(C.id),children:[(0,t.jsx)(m.Play,{}),"Run now"]}):(0,t.jsx)(g.Button,{size:"sm",loading:G,disabled:!eg,onClick:()=>eg&&void L(eg),children:"Create"})]})]})})})})]})}let ed=({children:e})=>(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e});function eu({picked:e,several:n=!1,className:a,children:i,...s}){return(0,t.jsxs)("button",{type:"button","aria-pressed":e,className:(0,z.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",!e&&"text-foreground ring-1 ring-border ring-inset hover:bg-muted",e&&(n?"bg-brand/10 pl-2.5 font-medium text-brand ring-1 ring-brand/30 ring-inset":"bg-brand font-medium text-brand-foreground"),a),...s,children:[e&&n&&(0,t.jsx)(l.Check,{className:"size-3.5"}),i]})}function ec({word:e,children:n}){return(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"flex h-8 w-9 shrink-0 items-center text-[13px] text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:n})]})}function em(e){let t=K(`${e} 00:00`),a=(t.getTime()-K(`${et(0)} 00:00`).getTime())/864e5;return(0,n.format)(t,a<7?"EEE d":"EEE, MMM d")}function eh({value:e,onPick:n}){let a=(0,f.useRef)(null),i=[0,1,2,3].map(e=>et(e)),s=()=>a.current?.showPicker();return(0,t.jsxs)(t.Fragment,{children:[i.map((a,i)=>(0,t.jsx)(eu,{picked:a===e,onClick:()=>n(a),children:0===i?"Today":1===i?"Tomorrow":em(a)},a)),!i.includes(e)&&(0,t.jsx)(eu,{picked:!0,onClick:s,children:em(e)}),(0,t.jsxs)("span",{className:"relative",children:[(0,t.jsx)(eu,{picked:!1,"aria-label":"Another day",onClick:s,className:"w-8 px-0",children:(0,t.jsx)(r,{className:"size-3.5"})}),(0,t.jsx)("input",{ref:a,type:"date",tabIndex:-1,"aria-hidden":!0,min:i[0],value:e,onChange:e=>e.target.value&&n(e.target.value),className:"pointer-events-none absolute inset-0 opacity-0"})]})]})}function ex({value:e,onChange:n,onDone:a}){return(0,t.jsx)(j.Input,{type:"time","aria-label":"Time of day",value:e,onChange:e=>n(e.target.value),onBlur:a,onClick:e=>e.currentTarget.showPicker?.(),className:"h-8.5 w-28 px-3 text-[15px] tabular-nums md:text-[15px] [&::-webkit-calendar-picker-indicator]:hidden"})}function ef({schedule:e,kind:n}){if(!e||ei(e))return(0,t.jsx)("p",{className:"text-xs text-destructive",children:e?"That time has passed. Pick a later one.":"daily"===n?"Pick a time and at least one day.":"Pick a time."});let i=function(e,t){if("once"===e.kind)return K(e.at);if("every"===e.kind)return new Date(t.getTime()+36e5*e.hours);let[n,a]=e.time.split(":").map(Number);for(let i=0;i<=7;i++){let s=new Date(t);s.setDate(s.getDate()+i),s.setHours(n,a,0,0);let r=0===s.getDay()?7:s.getDay();if(s>t&&e.days.includes(r))return s}return new Date(t.getTime()+864e5)}(e,new Date);return(0,t.jsxs)("p",{className:"flex items-start gap-2 text-[13px] leading-5",children:[(0,t.jsx)(Q.RoutineMark,{className:"mt-0.75 size-3.5 shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:"min-w-0",children:[X(e),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" · ","once"===e.kind?`${(0,a.formatDistanceToNowStrict)(i,{addSuffix:!0})}, then it switches itself off`:`first start ${(0,R.whenOf)(i)}`]})]})]})}function ep({label:e,htmlFor:n,children:a}){return(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("label",{htmlFor:n,className:"w-14 shrink-0 pt-2 font-mono text-xs text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"min-w-0 flex-1 space-y-1.5",children:a})]})}e.s(["RoutineSetting",0,function(){let[e,n]=(0,f.useState)(null),{data:a,isLoading:i,error:s}=(0,A.useServerRoute)(p.queryKey.routines),{data:r}=(0,A.useServerRoute)(p.queryKey.bot),[l]=(0,O.useServerAction)(B,{onOk:()=>(0,A.revalidate)(p.queryKey.routines)});if(i)return(0,t.jsx)(C.SettingSkeleton,{rows:3});if(s)return(0,t.jsx)(C.SettingError,{message:s.message});let o=a??[],d=o.filter(e=>e.enabled).length,u=o.find(t=>t.id===e);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C.SettingScreen,{footer:(0,t.jsxs)(C.SettingRailNote,{children:[o.length," set up · ",d," on",o.length>=S.ROUTINE.max&&` \xb7 ${S.ROUTINE.max} is the most`]}),children:(0,t.jsx)(C.SettingItems,{addRow:o.length<S.ROUTINE.max?{label:"New routine",onClick:()=>n("new")}:void 0,children:0===o.length?(0,t.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.'}):o.map(a=>(0,t.jsx)(Z,{routine:a,bots:r,open:a.id===e,onOpen:()=>n(a.id),onSwitch:e=>l(a.id,{enabled:e})},a.id))})}),(0,t.jsx)(eo,{routine:"new"===e?"new":u??null,bots:r??[],onClose:()=>n(null),onMade:e=>n(e)})]})}],480869)},648119,e=>{"use strict";var t=e.i(560972);e.s(["MoreHorizontal",()=>t.default])},21357,e=>{"use strict";var t=e.i(456420);let n={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};n.node;let a=(0,t.default)(n);e.s(["Play",0,a],21357)},759659,e=>{"use strict";var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let a=(0,t.default)(n);e.s(["Trash2",0,a],759659)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,480869,e=>{"use strict";var t=e.i(843476),n=e.i(401851),a=e.i(493801),i=e.i(456420);let s={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"}]]};s.node;let r=(0,i.default)(s);var l=e.i(689664),o=e.i(716327),d=e.i(867927),u=e.i(632781),c=e.i(648119),m=e.i(21357),h=e.i(759659),x=e.i(263676),f=e.i(271645),p=e.i(798120),g=e.i(167881),b=e.i(630374),y=e.i(463415),j=e.i(23750),k=e.i(917162),v=e.i(421429),w=e.i(660302),N=e.i(319036),M=e.i(184762),S=e.i(41533),D=e.i(635963),T=e.i(978411),C=e.i(895836),$=e.i(989409),R=e.i(245629),O=e.i(609856),A=e.i(283653),z=e.i(647163),q=e.i(95187);let I=(0,q.createServerReference)("7ffb58c3feabd7c2d7b6a68ea74e0f6c8c4ab3bf88",q.callServer,void 0,q.findSourceMapURL,"createRoutineAction"),E=(0,q.createServerReference)("7f71527ec42a6a1d49f0ac0ac61b0f48e402e2897e",q.callServer,void 0,q.findSourceMapURL,"deleteRoutineAction"),P=(0,q.createServerReference)("7f1219ab1d0f05e08fe1e0b893832f88edc81139be",q.callServer,void 0,q.findSourceMapURL,"runRoutineNowAction"),B=(0,q.createServerReference)("7fcb5e12bd83f0e6c87d755be6ac63220cb70d1d1c",q.callServer,void 0,q.findSourceMapURL,"updateRoutineAction");var F=e.i(504565);let H=[1,2,3,4,5,6,7],U=F.default.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/,"A time is HH:MM, 00:00 to 23:59");function K(e){let[t,n]=e.split(" "),[a,i,s]=t.split("-").map(Number),[r,l]=n.split(":").map(Number);return new Date(a,i-1,s,r,l)}let W=/^\d{4}-\d\d-\d\d ([01]\d|2[0-3]):[0-5]\d$/,L=F.default.string().regex(W,'A moment is "YYYY-MM-DD HH:MM"').refine(e=>{if(!W.test(e))return!0;let t=K(e);return t.getMonth()===Number(e.slice(5,7))-1&&t.getDate()===Number(e.slice(8,10))},"There is no such day"),G=F.default.discriminatedUnion("kind",[F.default.object({kind:F.default.literal("once"),at:L}),F.default.object({kind:F.default.literal("daily"),time:U,days:F.default.array(F.default.number().int().min(1).max(7)).min(1,"Pick at least one day").transform(e=>[...new Set(e)].sort((e,t)=>e-t))}),F.default.object({kind:F.default.literal("every"),hours:F.default.number().int().min(S.ROUTINE.minHours,`No more often than every ${S.ROUTINE.minHours}h`).max(168)})]),J=F.default.object({bot:F.default.string().trim().min(1,"Pick a bot"),label:F.default.string().trim().min(1,"Give it a name").max(80),request:F.default.string().trim().min(1,"Say what it should do"),schedule:G}),Y=F.default.object({id:F.default.string(),status:F.default.enum(["running","waiting","done","cancelled"]),outcome:F.default.string().nullable(),updatedAt:R.DateLikeSchema});J.extend({id:F.default.string(),enabled:F.default.boolean(),nextRunAt:R.DateLikeSchema,runs:F.default.array(Y)});let _=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],V=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function X(e){if("once"===e.kind){let[t,n]=e.at.split(" "),[,a,i]=t.split("-").map(Number);return`Once \xb7 ${V[a-1]} ${i} ${n}`}if("every"===e.kind)return 1===e.hours?"Every hour":`Every ${e.hours} hours`;let{days:t,time:n}=e;if(7===t.length)return`Daily ${n}`;if(1===t.length)return`${_[t[0]-1]} ${n}`;let a=t.every((e,n)=>0===n||e===t[n-1]+1)?`${_[t[0]-1]}–${_[t.at(-1)-1]}`:t.map(e=>_[e-1]).join(" ");return`Daily ${n} \xb7 ${a}`}var Q=e.i(431594);function Z({routine:e,bots:n,open:a,onOpen:i,onSwitch:s}){let r=function(e,t){let n=e.runs[0],a=n?.outcome?(0,z.plainText)(n.outcome):"",i=n?`${(0,R.whenOf)(n.updatedAt)}${a?` — ${a}`:""}`:"Not run yet";if(!e.enabled)return{text:`Off \xb7 ${i}`,tone:"text-muted-foreground"};let s=t?.find(t=>t.name===e.bot);return t&&(!s||s.disabled)?{text:s?`${e.bot} is switched off`:`${e.bot} is gone — pick another bot`,tone:z.WAITING_INK,waits:!0}:n?.status==="running"?{text:"Running now",tone:"",shine:!0}:n?.status==="waiting"?{text:`The last run waits on you${a?`: ${a}`:""}`,tone:z.WAITING_INK,waits:!0}:{text:i,tone:"text-muted-foreground"}}(e,n),l=e.runs[0]?.status==="running";return(0,t.jsxs)("div",{className:(0,z.cn)("flex items-center gap-3 p-4 transition-colors",a?"bg-muted/80":"hover:bg-muted/50"),children:[(0,t.jsxs)("button",{type:"button",onClick:i,className:(0,z.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",!e.enabled&&"opacity-70"),children:[(0,t.jsx)(D.BotMark,{size:40,seed:e.bot,...(0,D.markOf)(e.bot,n),state:l?"thinking":"idle",notify:!!r.waits,className:"shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.label}),l&&(0,t.jsx)(u.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"})]}),(0,t.jsx)("span",{className:"flex min-w-0 text-[13px] leading-snug",children:r.shine?(0,t.jsx)(w.ShinyText,{text:r.text,speed:2.2,className:"min-w-0 truncate"}):(0,t.jsx)("span",{className:(0,z.cn)("min-w-0 truncate",r.tone),children:r.text})})]}),(0,t.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,t.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 text-foreground",children:[(0,t.jsx)(Q.RoutineMark,{className:"size-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate",children:X(e.schedule)})]}),(0,t.jsx)("span",{className:"max-w-full truncate text-muted-foreground/70",children:e.enabled?`next ${(0,R.whenOf)(e.nextRunAt)}`:"off"})]})]}),(0,t.jsx)(N.Switch,{checked:e.enabled,onCheckedChange:s,"aria-label":`${e.label} on or off`,className:"shrink-0"}),(0,t.jsx)("button",{type:"button",onClick:i,"aria-label":`Open ${e.label}`,className:"shrink-0 rounded-md text-muted-foreground outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(d.ChevronRight,{className:"size-4"})})]})}let ee=e=>String(e).padStart(2,"0");function et(e,t=new Date){let a=new Date(t);return a.setDate(a.getDate()+e),(0,n.format)(a,"yyyy-MM-dd")}let en=(e,t)=>{let n=e?.schedule;return{label:e?.label??"",bot:e?.bot??t.find(e=>!e.disabled)?.name??"",request:e?.request??"",kind:n?.kind??"daily",time:n?.kind==="daily"?n.time:n?.kind==="once"?n.at.slice(11):"09:00",days:n?.kind==="daily"?n.days:[...H],hours:n?.kind==="every"?n.hours:6,date:n?.kind==="once"?n.at.slice(0,10):et(1)}};function ea(e){let t=/^\d\d:\d\d$/.test(e.time);return"once"===e.kind?t&&e.date?{kind:"once",at:`${e.date} ${e.time}`}:null:"daily"===e.kind?e.days.length&&t?{kind:"daily",time:e.time,days:e.days}:null:{kind:"every",hours:e.hours}}let ei=e=>e?.kind==="once"&&K(e.at)<=new Date,es=[{label:"Every day",days:[...H]},{label:"Weekdays",days:[1,2,3,4,5]},{label:"Weekends",days:[6,7]}],er=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],el=[1,2,3,6,12,24].filter(e=>e>=S.ROUTINE.minHours);function eo({routine:e,bots:n,onClose:a,onMade:i}){var s,r;let l,[u,w]=(0,f.useState)(null),S=(0,f.useCallback)(e=>{w(e?.closest("[data-slot=dialog-content]")??null)},[]),C="new"===e?null:e,q="new"===e?"new":e?.id??"",[F,U]=(0,f.useState)(()=>en(C,n));(0,f.useEffect)(()=>U(en(C,n)),[q]);let K=e=>U(t=>({...t,...e})),W=()=>(0,A.revalidate)(p.queryKey.routines),[L,G]=(0,O.useServerAction)(I,{onOk:e=>{W(),i(e.id)}}),[J]=(0,O.useServerAction)(B,{onOk:W}),[Y]=(0,O.useServerAction)(E,{onOk:W}),[V,Z]=(0,O.useServerAction)(P,{onOk:()=>{W(),(0,A.revalidate)(p.queryKey.threads)}}),em=ea(F),eg=em&&!ei(em)&&F.label.trim()&&F.bot&&F.request.trim()?{label:F.label.trim(),bot:F.bot,request:F.request.trim(),schedule:em}:null,eb=e=>{C&&J(C.id,e)},ey=e=>{K(e);let t=ea({...F,...e});!t||ei(t)||C&&function(e,t){if("once"===e.kind)return"once"===t.kind&&e.at===t.at;if("every"===e.kind)return"every"===t.kind&&e.hours===t.hours;let n=e=>[...e].sort((e,t)=>e-t).join();return"daily"===t.kind&&e.time===t.time&&n(e.days)===n(t.days)}(t,C.schedule)||eb({schedule:t,..."once"===t.kind?{enabled:!0}:{}})},ej=!!(C&&(F.label.trim()&&F.label.trim()!==C.label||F.request.trim()&&F.request.trim()!==C.request)),ek=C?ej:!!(F.label.trim()||F.request.trim()),ev=(0,f.useRef)(ek);ev.current=ek;let ew=(0,$.useSettingsStore)(e=>e.holdUnsaved);(0,f.useEffect)(()=>(ew(()=>ev.current),()=>ew(null)),[ew]);let eN=async()=>{(!ev.current||await k.notify.discard())&&a()},eM=async()=>{!C||await k.notify.confirm({title:`Delete "${C.label}"?`,description:"It starts no more. The jobs it already opened stay.",okText:"Delete",destructive:!0})&&(await Y(C.id).catch(()=>{}),a())},eS=n.find(e=>e.name===F.bot),eD=C?.runs[0]?.status==="running"||C?.runs[0]?.status==="waiting";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{ref:S,hidden:!0}),(0,t.jsx)(b.Dialog,{open:!!(e&&u),onOpenChange:e=>!e&&void eN(),modal:!1,disablePointerDismissal:!0,children:(0,t.jsx)(b.DialogPortal,{container:u,children:(0,t.jsx)(b.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:e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2.5 pt-3.5 pr-3 pb-1.5 pl-5",children:[eS?(0,t.jsx)(D.BotMark,{size:28,seed:eS.name,...(0,D.markOf)(eS.name,n),notify:!1,className:"shrink-0"}):(0,t.jsx)("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,t.jsx)(Q.RoutineMark,{className:"size-3.5"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)(b.DialogTitle,{className:"sr-only",children:C?C.label:"New routine"}),(0,t.jsx)("p",{className:"truncate text-[15px] leading-5 font-semibold",children:C?C.label:"New routine"}),C&&(0,t.jsxs)("p",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[(0,t.jsx)(Q.RoutineMark,{className:"size-3 shrink-0"}),(0,t.jsxs)("span",{className:"truncate",children:[C.bot," · ",X(C.schedule),C.enabled&&` \xb7 next ${(0,R.whenOf)(C.nextRunAt)}`]})]})]}),C&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.Switch,{checked:C.enabled,onCheckedChange:e=>void J(C.id,{enabled:e}),"aria-label":`${C.label} on or off`,className:"mr-1 shrink-0"}),(0,t.jsxs)(y.DropdownMenu,{children:[(0,t.jsx)(y.DropdownMenuTrigger,{render:(0,t.jsx)(g.Button,{size:"icon-sm",variant:"ghost","aria-label":"More",className:"text-muted-foreground"}),children:(0,t.jsx)(c.MoreHorizontal,{})}),(0,t.jsx)(y.DropdownMenuContent,{align:"end",children:(0,t.jsxs)(y.DropdownMenuItem,{variant:"destructive",onClick:eM,children:[(0,t.jsx)(h.Trash2,{}),"Delete"]})})]})]}),(0,t.jsx)(b.DialogClose,{render:(0,t.jsx)(g.Button,{size:"icon-sm",variant:"ghost","aria-label":"Close the routine"}),children:(0,t.jsx)(x.X,{})})]}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pt-3 pb-5",children:[(0,t.jsxs)(ep,{label:"Name",htmlFor:"routine-name",children:[(0,t.jsx)(j.Input,{id:"routine-name",value:F.label,onChange:e=>K({label:e.target.value}),placeholder:"Morning mail",maxLength:80,autoFocus:!C}),(0,t.jsx)(ed,{children:"What it is called in this list, and what she calls it on a call."})]}),(0,t.jsxs)(ep,{label:"Bot",children:[(0,t.jsxs)(y.DropdownMenu,{children:[(0,t.jsxs)(y.DropdownMenuTrigger,{render:(0,t.jsx)(g.Button,{variant:"outline",className:"justify-start gap-2 pl-1.5 font-normal"}),children:[eS?(0,t.jsx)(D.BotMark,{size:20,seed:eS.name,...(0,D.markOf)(eS.name,n),notify:!1,className:"shrink-0"}):null,(0,t.jsx)("span",{className:(0,z.cn)(!eS&&"pl-1.5 text-muted-foreground"),children:eS?.name??(F.bot||"Pick a bot")}),(0,t.jsx)(o.ChevronDown,{className:"ml-1 size-3.5 text-muted-foreground"})]}),(0,t.jsx)(y.DropdownMenuContent,{align:"start",children:(0,t.jsx)(y.DropdownMenuGroup,{children:n.filter(e=>!e.disabled).map(e=>(0,t.jsxs)(y.DropdownMenuItem,{onClick:()=>{K({bot:e.name}),e.name!==C?.bot&&eb({bot:e.name})},children:[(0,t.jsx)(D.BotMark,{size:16,seed:e.name,...(0,D.markOf)(e.name,n),notify:!1,className:"shrink-0"}),e.name]},e.name))})})]}),(0,t.jsx)(ed,{children:"Who does the job each time it starts."})]}),(0,t.jsx)(ep,{label:"When",children:(0,t.jsxs)("div",{className:"space-y-3.5",children:[(0,t.jsx)(v.Segmented,{"aria-label":"How it starts",value:F.kind,onChange:e=>ey({kind:e}),options:[{value:"once",label:"Once"},{value:"daily",label:"On set days"},{value:"every",label:"Every few hours"}]}),(0,t.jsx)("div",{className:"space-y-2.5",children:"once"===F.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ec,{word:"On",children:(0,t.jsx)(eh,{value:F.date,onPick:e=>ey({date:e})})}),(0,t.jsxs)(ec,{word:"At",children:[(0,t.jsx)(ex,{value:F.time,onChange:e=>K({time:e}),onDone:()=>ey({})}),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"or"}),(0,t.jsx)(eu,{picked:!1,onClick:()=>{let e;return ey(((e=new Date(Date.now()+36e5)).setMinutes(5*Math.ceil(e.getMinutes()/5),0,0),{date:et(0,e),time:`${ee(e.getHours())}:${ee(e.getMinutes())}`}))},children:"In an hour"})]})]}):"daily"===F.kind?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ec,{word:"On",children:H.map(e=>{let n=F.days.includes(e);return(0,t.jsx)(eu,{picked:n,several:!0,"aria-label":er[e-1],onClick:()=>ey({days:n?F.days.filter(t=>t!==e):[...F.days,e].sort((e,t)=>e-t)}),children:_[e-1]},e)})}),(0,t.jsx)(ec,{children:es.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>ey({days:[...e.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:e.label},e.label))}),(0,t.jsx)(ec,{word:"At",children:(0,t.jsx)(ex,{value:F.time,onChange:e=>K({time:e}),onDone:()=>ey({})})})]}):(0,t.jsxs)(ec,{word:"Every",children:[(el.includes(F.hours)?el:[...el,F.hours].sort((e,t)=>e-t)).map(e=>(0,t.jsx)(eu,{picked:e===F.hours,onClick:()=>ey({hours:e}),className:"min-w-10 px-3",children:e},e)),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground",children:"hours"})]})}),(0,t.jsx)(ef,{schedule:em,kind:F.kind})]})}),(0,t.jsxs)(ep,{label:"Job",htmlFor:"routine-request",children:[(0,t.jsx)(M.Textarea,{id:"routine-request",value:F.request,onChange:e=>K({request:e.target.value}),placeholder:"Go through the mail that came since the last run and draft replies to what needs one. Send nothing.",className:"min-h-28"}),(0,t.jsx)(ed,{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."})]}),C&&(0,t.jsxs)("div",{className:"pt-1",children:[(0,t.jsx)("div",{className:"flex h-6 items-center",children:(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"Runs"})}),0===C.runs.length?(0,t.jsx)("p",{className:"py-2 text-[13px] text-muted-foreground",children:"Not run yet."}):C.runs.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>{var t;return t=e.id,void($.useSettingsStore.getState().hide(),T.roomOpens.open(t))},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,t.jsx)("span",{className:"w-28 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:(0,R.whenOf)(e.updatedAt)}),(0,t.jsx)("span",{className:(0,z.cn)("min-w-0 flex-1 truncate","waiting"===e.status?z.WAITING_INK:"text-muted-foreground"),children:"running"===e.status?"Running now":e.outcome?(0,z.plainText)(e.outcome):"cancelled"===e.status?"Stopped":"No words"}),(0,t.jsx)(d.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground"})]},e.id))]})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-t border-border/60 px-5 py-3",children:[(0,t.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-4 text-muted-foreground",children:C||eg?"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 ${s=F,r=em,(l=[s.label.trim()?null:"a name",s.bot?null:"a bot",!r?"a time":ei(r)?"a time still ahead":null,s.request.trim()?null:"a job"].filter(e=>null!==e)).length>1?`${l.slice(0,-1).join(", ")} and ${l.at(-1)}`:l[0]??"nothing"}.`}),ej&&(0,t.jsx)(g.Button,{size:"sm",onClick:()=>{if(!C)return;let e={};F.label.trim()&&F.label.trim()!==C.label&&(e.label=F.label.trim()),F.request.trim()&&F.request.trim()!==C.request&&(e.request=F.request.trim()),Object.keys(e).length&&eb(e)},children:"Save"}),C?(0,t.jsxs)(g.Button,{variant:"outline",size:"sm",loading:Z,disabled:eD,title:eD?"Its last run is still open":void 0,onClick:()=>void V(C.id),children:[(0,t.jsx)(m.Play,{}),"Run now"]}):(0,t.jsx)(g.Button,{size:"sm",loading:G,disabled:!eg,onClick:()=>eg&&void L(eg),children:"Create"})]})]})})})})]})}let ed=({children:e})=>(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e});function eu({picked:e,several:n=!1,className:a,children:i,...s}){return(0,t.jsxs)("button",{type:"button","aria-pressed":e,className:(0,z.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",!e&&"text-foreground ring-1 ring-border ring-inset hover:bg-muted",e&&(n?"bg-brand/10 pl-2.5 font-medium text-brand ring-1 ring-brand/30 ring-inset":"bg-brand font-medium text-brand-foreground"),a),...s,children:[e&&n&&(0,t.jsx)(l.Check,{className:"size-3.5"}),i]})}function ec({word:e,children:n}){return(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"flex h-8 w-9 shrink-0 items-center text-[13px] text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:n})]})}function em(e){let t=K(`${e} 00:00`),a=(t.getTime()-K(`${et(0)} 00:00`).getTime())/864e5;return(0,n.format)(t,a<7?"EEE d":"EEE, MMM d")}function eh({value:e,onPick:n}){let a=(0,f.useRef)(null),i=[0,1,2,3].map(e=>et(e)),s=()=>a.current?.showPicker();return(0,t.jsxs)(t.Fragment,{children:[i.map((a,i)=>(0,t.jsx)(eu,{picked:a===e,onClick:()=>n(a),children:0===i?"Today":1===i?"Tomorrow":em(a)},a)),!i.includes(e)&&(0,t.jsx)(eu,{picked:!0,onClick:s,children:em(e)}),(0,t.jsxs)("span",{className:"relative",children:[(0,t.jsx)(eu,{picked:!1,"aria-label":"Another day",onClick:s,className:"w-8 px-0",children:(0,t.jsx)(r,{className:"size-3.5"})}),(0,t.jsx)("input",{ref:a,type:"date",tabIndex:-1,"aria-hidden":!0,min:i[0],value:e,onChange:e=>e.target.value&&n(e.target.value),className:"pointer-events-none absolute inset-0 opacity-0"})]})]})}function ex({value:e,onChange:n,onDone:a}){return(0,t.jsx)(j.Input,{type:"time","aria-label":"Time of day",value:e,onChange:e=>n(e.target.value),onBlur:a,onClick:e=>e.currentTarget.showPicker?.(),className:"h-8.5 w-28 px-3 text-[15px] tabular-nums md:text-[15px] [&::-webkit-calendar-picker-indicator]:hidden"})}function ef({schedule:e,kind:n}){if(!e||ei(e))return(0,t.jsx)("p",{className:"text-xs text-destructive",children:e?"That time has passed. Pick a later one.":"daily"===n?"Pick a time and at least one day.":"Pick a time."});let i=function(e,t){if("once"===e.kind)return K(e.at);if("every"===e.kind)return new Date(t.getTime()+36e5*e.hours);let[n,a]=e.time.split(":").map(Number);for(let i=0;i<=7;i++){let s=new Date(t);s.setDate(s.getDate()+i),s.setHours(n,a,0,0);let r=0===s.getDay()?7:s.getDay();if(s>t&&e.days.includes(r))return s}return new Date(t.getTime()+864e5)}(e,new Date);return(0,t.jsxs)("p",{className:"flex items-start gap-2 text-[13px] leading-5",children:[(0,t.jsx)(Q.RoutineMark,{className:"mt-0.75 size-3.5 shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:"min-w-0",children:[X(e),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" · ","once"===e.kind?`${(0,a.formatDistanceToNowStrict)(i,{addSuffix:!0})}, then it switches itself off`:`first start ${(0,R.whenOf)(i)}`]})]})]})}function ep({label:e,htmlFor:n,children:a}){return(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("label",{htmlFor:n,className:"w-14 shrink-0 pt-2 font-mono text-xs text-muted-foreground",children:e}),(0,t.jsx)("div",{className:"min-w-0 flex-1 space-y-1.5",children:a})]})}e.s(["RoutineSetting",0,function(){let[e,n]=(0,f.useState)(null),{data:a,isLoading:i,error:s}=(0,A.useServerRoute)(p.queryKey.routines),{data:r}=(0,A.useServerRoute)(p.queryKey.bot),[l]=(0,O.useServerAction)(B,{onOk:()=>(0,A.revalidate)(p.queryKey.routines)});if(i)return(0,t.jsx)(C.SettingSkeleton,{rows:3});if(s)return(0,t.jsx)(C.SettingError,{message:s.message});let o=a??[],d=o.filter(e=>e.enabled).length,u=o.find(t=>t.id===e);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C.SettingScreen,{footer:(0,t.jsxs)(C.SettingRailNote,{children:[o.length," set up · ",d," on",o.length>=S.ROUTINE.max&&` \xb7 ${S.ROUTINE.max} is the most`]}),children:(0,t.jsx)(C.SettingItems,{addRow:o.length<S.ROUTINE.max?{label:"New routine",onClick:()=>n("new")}:void 0,children:0===o.length?(0,t.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.'}):o.map(a=>(0,t.jsx)(Z,{routine:a,bots:r,open:a.id===e,onOpen:()=>n(a.id),onSwitch:e=>l(a.id,{enabled:e})},a.id))})}),(0,t.jsx)(eo,{routine:"new"===e?"new":u??null,bots:r??[],onClose:()=>n(null),onMade:e=>n(e)})]})}],480869)},648119,e=>{"use strict";var t=e.i(560972);e.s(["MoreHorizontal",()=>t.default])},21357,e=>{"use strict";var t=e.i(456420);let n={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};n.node;let a=(0,t.default)(n);e.s(["Play",0,a],21357)},759659,e=>{"use strict";var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let a=(0,t.default)(n);e.s(["Trash2",0,a],759659)}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,805995,
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,805995,18068,e=>{"use strict";var t,n=e.i(843476),s=e.i(493801),r=e.i(375775),i=e.i(422411),o=e.i(525335),a=e.i(689664),l=e.i(867927),d=e.i(456420);let c={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"}]]};c.node;let u=(0,d.default)(c);var h=e.i(560972),h=h,f=e.i(815170),m=e.i(758925),g=e.i(566595),x=e.i(466787),p=e.i(271645),y=e.i(798120),k=e.i(167881),v=e.i(23750),j=e.i(917162),b=e.i(59377),w=e.i(818125),N=e.i(671428),A=e.i(41533),S=e.i(412294),C=e.i(458898),M=e.i(146538),z=e.i(968978),E=e.i(265402),R=e.i(635963),I=e.i(95187);let F=(0,I.createServerReference)("7f9f5cbd4d689ed4d45ffcafb4479363132599b1c5",I.callServer,void 0,I.findSourceMapURL,"removeConfigAction");e.s(["removeConfigAction",0,F],18068);var P=e.i(734899),T=e.i(992112),K=e.i(508734),_=e.i(482022),$=((t=$||{})[t.Border=-1]="Border",t[t.Data=0]="Data",t[t.Function=1]="Function",t[t.Position=2]="Position",t[t.Timing=3]="Timing",t[t.Alignment=4]="Alignment",t);let B=[1,0],O=[2,3],L=[3,2],q={L:[0,1],M:B,Q:O,H:L},D=/^\d*$/,H=/^[A-Z0-9 $%*+./:-]*$/,U="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",G=[[-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]],Y=[[-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(e,t,n,s){if(this.version=e,this.ecc=t,e<1||e>40)throw RangeError("Version value out of range");if(s<-1||s>7)throw RangeError("Mask value out of range");this.size=4*e+17;const r=Array.from({length:this.size}).fill(!1);for(let e=0;e<this.size;e++)this.modules.push(r.slice()),this.types.push(r.map(()=>0));this.drawFunctionPatterns();const i=this.addEccAndInterleave(n);if(this.drawCodewords(i),-1===s){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(s=t,e=n),this.applyMask(t)}}this.mask=s,this.applyMask(s),this.drawFormatBits(s)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,$.Timing),this.setFunctionModule(e,6,e%2==0,$.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let s=0;s<t;s++)(0!==n||0!==s)&&(0!==n||s!==t-1)&&(n!==t-1||0!==s)&&this.drawAlignmentPattern(e[n],e[s]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let s=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,Q(s,e));this.setFunctionModule(8,7,Q(s,6)),this.setFunctionModule(8,8,Q(s,7)),this.setFunctionModule(7,8,Q(s,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,Q(s,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,Q(s,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,Q(s,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=Q(t,e),s=this.size-11+e%3,r=Math.floor(e/3);this.setFunctionModule(s,r,n),this.setFunctionModule(r,s,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let s=-4;s<=4;s++){let r=Math.max(Math.abs(s),Math.abs(n)),i=e+s,o=t+n;i>=0&&i<this.size&&o>=0&&o<this.size&&this.setFunctionModule(i,o,2!==r&&4!==r,$.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let s=-2;s<=2;s++)this.setFunctionModule(e+s,t+n,1!==Math.max(Math.abs(s),Math.abs(n)),$.Alignment)}setFunctionModule(e,t,n,s=$.Function){this.modules[t][e]=n,this.types[t][e]=s}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==er(t,n))throw RangeError("Invalid argument");let s=Y[n[0]][t],r=G[n[0]][t],i=Math.floor(es(t)/8),o=s-i%s,a=Math.floor(i/s),l=[],d=function(e){if(e<1||e>255)throw RangeError("Degree out of range");let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let s=0;s<e;s++){for(let e=0;e<t.length;e++)t[e]=ei(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=ei(n,2)}return t}(r);for(let t=0,n=0;t<s;t++){let s=e.slice(n,n+a-r+(t<o?0:1));n+=s.length;let i=function(e,t){let n=t.map(e=>0);for(let s of e){let e=s^n.shift();n.push(0),t.forEach((t,s)=>n[s]^=ei(t,e))}return n}(s,d);t<o&&s.push(0),l.push(s.concat(i))}let c=[];for(let e=0;e<l[0].length;e++)l.forEach((t,n)=>{(e!==a-r||n>=o)&&c.push(t[e])});return c}drawCodewords(e){if(e.length!==Math.floor(es(this.version)/8))throw RangeError("Invalid argument");let t=0;for(let n=this.size-1;n>=1;n-=2){6===n&&(n=5);for(let s=0;s<this.size;s++)for(let r=0;r<2;r++){let i=n-r,o=(n+1&2)==0?this.size-1-s:s;!this.types[o][i]&&t<8*e.length&&(this.modules[o][i]=Q(e[t>>>3],7-(7&t)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let s;switch(e){case 0:s=(n+t)%2==0;break;case 1:s=t%2==0;break;case 2:s=n%3==0;break;case 3:s=(n+t)%3==0;break;case 4:s=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:s=n*t%2+n*t%3==0;break;case 6:s=(n*t%2+n*t%3)%2==0;break;case 7:s=((n+t)%2+n*t%3)%2==0;break;default:throw Error("Unreachable")}!this.types[t][n]&&s&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,s=0,r=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[t][i]===n?5==++s?e+=3:s>5&&e++:(this.finderPenaltyAddHistory(s,r),n||(e+=40*this.finderPenaltyCountPatterns(r)),n=this.modules[t][i],s=1);e+=40*this.finderPenaltyTerminateAndCount(n,s,r)}for(let t=0;t<this.size;t++){let n=!1,s=0,r=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[i][t]===n?5==++s?e+=3:s>5&&e++:(this.finderPenaltyAddHistory(s,r),n||(e+=40*this.finderPenaltyCountPatterns(r)),n=this.modules[i][t],s=1);e+=40*this.finderPenaltyTerminateAndCount(n,s,r)}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let s=this.modules[t][n];s===this.modules[t][n+1]&&s===this.modules[t+1][n]&&s===this.modules[t+1][n+1]&&(e+=3)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size;return e+(Math.ceil(Math.abs(20*t-10*n)/n)-1)*10}getAlignmentPatternPositions(){if(1===this.version)return[];{let e=Math.floor(this.version/7)+2,t=32===this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2)),n=[6];for(let s=this.size-7;n.length<e;s-=t)n.splice(1,0,s);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===3*t&&e[4]===t&&e[5]===t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0===t[0]&&(e+=this.size),t.pop(),t.unshift(e)}}function V(e,t,n){if(t<0||t>31||e>>>t!=0)throw RangeError("Value out of range");for(let s=t-1;s>=0;s--)n.push(e>>>s&1)}function Q(e,t){return(e>>>t&1)!=0}class X{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError("Invalid argument");this.bitData=n.slice()}getData(){return this.bitData.slice()}}let Z=[1,10,12,14],J=[2,9,11,13],ee=[4,8,16,16];function et(e,t){return e[Math.floor((t+7)/17)+1]}function en(e){let t=[];for(let n of e)V(n,8,t);return new X(ee,e.length,t)}function es(e){if(e<1||e>40)throw RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function er(e,t){return Math.floor(es(e)/8)-G[t[0]][e]*Y[t[0]][e]}function ei(e,t){if(e>>>8!=0||t>>>8!=0)throw RangeError("Byte out of range");let n=0;for(let s=7;s>=0;s--)n=n<<1^(n>>>7)*285^(t>>>s&1)*e;return n}var eo=e.i(511769),ea=e.i(660302),el=e.i(895836),ed=e.i(609856),ec=e.i(283653),eu=e.i(647163);let eh=(0,I.createServerReference)("7f787b69f6e9bbb92118d8190ab3b8f9f18bd05fb9",I.callServer,void 0,I.findSourceMapURL,"forgetReachAction");var ef=e.i(36174);let em={telegram:"telegram.org",discord:"discord.com",slack:"slack.com"},eg=`display_information:
|
|
2
2
|
name: Thursday
|
|
3
3
|
features:
|
|
4
4
|
app_home:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,986530,e=>{"use strict";var t=e.i(843476),n=e.i(225913);e.i(271645);var s=e.i(647163);function a({className:e,...n}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,s.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}e.i(652225);let r=(0,n.cva)("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function({className:e,orientation:n="vertical",...a}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":n,className:(0,s.cn)(r({orientation:n}),e),...a})},"FieldContent",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"field-content",className:(0,s.cn)("group/field-content flex flex-1 flex-col gap-0.5 leading-snug",e),...n})},"FieldLabel",0,function({className:e,...n}){return(0,t.jsx)(a,{"data-slot":"field-label",className:(0,s.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...n})}],986530)},787800,e=>{"use strict";var t=e.i(843476),n=e.i(689664),s=e.i(716327),a=e.i(867927),r=e.i(21357),o=e.i(77071),i=e.i(456420);let c={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"}]]};c.node;let l=(0,i.default)(c),d={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"}]]};d.node;let m=(0,i.default)(d);var u=e.i(759659),p=e.i(263676),h=e.i(271645),f=e.i(798120),g=e.i(167881),x=e.i(986530),v=e.i(23750),j=e.i(647163);let b=(0,h.memo)(({data:e,name:n,initialExpandDepth:s=2})=>{let a=(0,h.useMemo)(()=>"string"==typeof e?function(e){let t=e.trim();if(!(t.startsWith("{")&&t.endsWith("}"))&&!(t.startsWith("[")&&t.endsWith("]")))return{success:!1,data:e};try{return{success:!0,data:JSON.parse(e)}}catch{return{success:!1,data:e}}}(e).data:e,[e]);return(0,t.jsx)("div",{className:"text-sm",children:(0,t.jsx)(k,{data:a,name:n,depth:0,initialExpandDepth:s})})});b.displayName="JsonView";let y=(e,t)=>({role:"button",tabIndex:0,"aria-expanded":e,onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())}}),N="outline-none focus-visible:ring-3 focus-visible:ring-ring/50",k=(0,h.memo)(({data:e,name:n,depth:s=0,initialExpandDepth:a})=>{var r;let o=void 0===e?"undefined":Array.isArray(e)?"array":null===e?"null":typeof e,[i,c]=(0,h.useState)("string"!==o&&s<a),l={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(o){case"object":case"array":let d,m,u;return m=(d=(r="array"===o)?e:Object.entries(e)).length,u={open:r?"[":"{",close:r?"]":"}",collapsed:r?"[ ... ]":"{ ... }",empty:r?"[]":"{}"},0===m?(0,t.jsxs)("div",{className:"flex items-center",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:u.empty})]}):(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:(0,j.cn)("flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30",N),...y(i,()=>c(!i)),children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[n,":"]}),i?(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:u.open}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:u.collapsed}),(0,t.jsxs)("span",{className:"ml-1 text-muted-foreground group-hover:text-foreground",children:[m," ",1===m?"item":"items"]})]})]}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"pl-2 ml-4 border-l border-border",children:r?d.map((e,n)=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(k,{data:e,name:`${n}`,depth:s+1,initialExpandDepth:a})},n)):d.map(([e,n])=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(k,{data:n,name:e,depth:s+1,initialExpandDepth:a})},e))}),(0,t.jsx)("div",{className:"text-muted-foreground",children:u.close})]})]});case"string":return e.length>100?(0,t.jsxs)("div",{className:"flex mr-1 rounded group hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[n,":"]}),(0,t.jsx)("pre",{className:(0,j.cn)(l.string,"cursor-pointer group-hover:text-foreground",N),...y(i,()=>c(!i)),title:i?"Click to collapse":"Click to expand",children:i?`"${e}"`:`"${e.slice(0,100)}..."`})]}):(0,t.jsxs)("div",{className:"flex mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsxs)("pre",{className:l.string,children:['"',e,'"']})]});case"undefined":return(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:l.undefined,children:"undefined"})]});default:return(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:l[o]||l.default,children:null===e?"null":String(e)})]})}});k.displayName="JsonNode";var S=e.i(917162),w=e.i(818125),z=e.i(319036),C=e.i(127341),O=e.i(184762),A=e.i(6799),T=e.i(95187);let P=(0,T.createServerReference)("7f10eeeae5a5dfd240dc39c1c1581fc058b565613c",T.callServer,void 0,T.findSourceMapURL,"callToolAction"),F=(0,T.createServerReference)("7ffb4e07fd3bef80a532307d58a2755d5d24601cf9",T.callServer,void 0,T.findSourceMapURL,"deleteServerAction"),$=(0,T.createServerReference)("7fe1df1fac3631cbf0e1651eba77b0846c28a15eb1",T.callServer,void 0,T.findSourceMapURL,"refreshServerAction"),R=(0,T.createServerReference)("7ff56366a5a6ccb74f36a746cee8e3b6a1d2f3e691",T.callServer,void 0,T.findSourceMapURL,"registerServerAction");var M=e.i(681307),D=e.i(245629);let L=M.z.object({url:M.z.url(),headers:M.z.record(M.z.string(),M.z.string()).optional()}),E=M.z.object({command:M.z.string().min(1),args:M.z.array(M.z.string()).optional(),env:M.z.record(M.z.string(),M.z.string()).optional()}),I=M.z.union([L,E]),q=M.z.object({name:M.z.string(),description:M.z.string().optional(),inputSchema:M.z.looseObject({}).optional(),outputSchema:M.z.looseObject({}).optional()});function B(e){return"url"in e}M.z.object({clientInformation:M.z.looseObject({}).optional(),tokens:M.z.looseObject({}).optional(),authorizationServer:M.z.looseObject({}).optional(),codeVerifier:M.z.string().optional(),state:M.z.string().optional()});let J=M.z.object({name:M.z.string().min(1).max(40),config:I,toolCount:M.z.number().int(),lastError:M.z.string().nullish()}),U=q.extend({id:M.z.number().int(),description:M.z.string().nullish()});J.omit({toolCount:!0}).extend({tools:U.array().default([]),toolsSyncedAt:D.DateLikeSchema});let K=M.z.object({name:M.z.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:I}),H=M.z.union([M.z.object({mcpServers:M.z.record(M.z.string(),I)}),M.z.record(M.z.string(),I)]),V=[{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 W=e.i(895836),_=e.i(333999),G=e.i(609856),Q=e.i(283653);function X({name:e,onDone:n}){let[s,a]=(0,h.useState)(""),{data:r,isLoading:o}=(0,Q.useServerRoute)(f.queryKey.mcpServer(e)),[i,c]=(0,G.useServerAction)($,{...el,onOk:t=>{el.onOk(t),(0,Q.revalidate)(f.queryKey.mcpServer(e))}}),[d,m]=(0,G.useServerAction)(F,{okMessage:"Server deleted",onOk:()=>{n(),(0,Q.revalidate)(f.queryKey.mcp)}}),p=async()=>{await S.notify.confirm({title:`Delete ${e}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&d(e)};if(o)return(0,t.jsx)(W.SettingSkeleton,{rows:4});if(!r)return null;let x=r.tools.length,v=s.trim().toLowerCase(),j=v?r.tools.filter(e=>`${e.name} ${e.description??""}`.toLowerCase().includes(v)):r.tools,b=B(r.config)?"HTTP":"STDIO";return(0,t.jsxs)(W.SettingDialogContent,{title:r.name,description:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px]",children:b}),(0,t.jsx)("span",{className:"truncate font-mono",children:em(r.config)})]}),footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(g.Button,{variant:"ghost",loading:m,onClick:p,className:"mr-auto text-destructive hover:text-destructive",children:[(0,t.jsx)(u.Trash2,{}),"Delete"]}),(0,t.jsxs)(g.Button,{variant:"outline",loading:c,onClick:()=>i(r.name),children:[(0,t.jsx)(l,{}),"Reconnect"]})]}),children:[r.lastError&&(0,t.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:r.lastError}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(W.SettingFilter,{value:s,onChange:a,placeholder:"Filter tools"}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:[x," ",1===x?"tool":"tools"]})]}),j.map(e=>(0,t.jsx)(ee,{tool:e,serverName:r.name},e.name)),0===j.length&&x>0&&(0,t.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"No tool here goes by that."})]})}function Y({server:e}){let s=e.toolCount,r=e.lastError?"error":s>0?"connected":"idle";return(0,t.jsxs)("button",{type:"button",onClick:()=>{S.notify.component({className:"sm:max-w-3xl",renderer:({close:n})=>(0,t.jsx)(X,{name:e.name,onDone:n})})},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,t.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",children:(0,t.jsx)(Z,{server:e})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.name}),"connected"===r&&(0,t.jsx)(n.Check,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:"error"===r?(0,t.jsx)("span",{className:"text-destructive",children:e.lastError}):(0,t.jsxs)(t.Fragment,{children:[s>0?`${s} ${1===s?"tool":"tools"}`:"No tools yet",(0,t.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground/70",children:[" · ",em(e.config)]})]})})]}),(0,t.jsx)(a.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function Z({server:e}){let n,s=(n=V.find(t=>B(t.config)?B(e.config)&&t.config.url.replace(/\/+$/,"")===e.config.url.replace(/\/+$/,""):!B(e.config)&&t.config.command===e.config.command&&(t.config.args??[]).join(" ")===(e.config.args??[]).join(" "))??V.find(t=>t.name===e.name),n?.icon);return s?(0,t.jsx)(w.SiteIcon,{host:s,className:"size-5",fallback:(0,t.jsx)(m,{className:"size-4"})}):(0,t.jsx)(m,{className:"size-4"})}function ee({tool:e,serverName:n}){let[r,o]=(0,h.useState)(!1),[i,c]=(0,h.useState)(!1),[l,d]=(0,h.useState)(!1),m=[["inputSchema",e.inputSchema],["outputSchema",e.outputSchema]].filter(([,e])=>e);return(0,t.jsxs)("div",{className:"rounded-xl border border-border/60 bg-background p-4",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-sm",children:e.name}),m.length>0&&(0,t.jsxs)(g.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>o(!r),children:[r?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(a.ChevronRight,{}),"Schema"]}),(0,t.jsxs)(g.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>c(!i),children:[i?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(a.ChevronRight,{}),"Test"]})]}),e.description?(0,t.jsx)("p",{className:(0,j.cn)("mt-0.5 text-xs leading-relaxed text-muted-foreground",!l&&"line-clamp-2",e.description.length>140&&"cursor-pointer"),onClick:()=>d(!l),children:e.description}):null,r?(0,t.jsx)("div",{className:"mt-2 space-y-3 overflow-x-auto rounded-lg border border-input p-3",children:m.map(([e,n])=>(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"block font-mono text-xs text-muted-foreground",children:"inputSchema"===e?"in":"out"}),(0,t.jsx)("pre",{className:"font-mono text-xs leading-relaxed whitespace-pre",children:function e(t,n=0){if(!t||"object"!=typeof t)return"unknown";let s=" ".repeat(n+1),a=" ".repeat(n);if(Array.isArray(t.enum))return t.enum.map(e=>JSON.stringify(e)).join(" | ");let r=t.anyOf??t.oneOf;if(Array.isArray(r))return r.map(t=>e(t,n)).join(" | ");if("array"===t.type){let s=e(t.items,n);return/[|{]/.test(s)?`(${s})[]`:`${s}[]`}if("object"===t.type||t.properties){let r=t.properties;if(!r||0===Object.keys(r).length)return"{}";let o=t.required??[],i=Object.entries(r).map(([t,a])=>{let r=o.includes(t)?"":"?",i=a?.description,c="string"==typeof i&&i.length<=60?` // ${i}`:"";return`${s}${t}${r}: ${e(a,n+1)}${c}`});return`{
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,986530,e=>{"use strict";var t=e.i(843476),n=e.i(225913);e.i(271645);var s=e.i(647163);function a({className:e,...n}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,s.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}e.i(652225);let r=(0,n.cva)("group/field flex w-full gap-2 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});e.s(["Field",0,function({className:e,orientation:n="vertical",...a}){return(0,t.jsx)("div",{role:"group","data-slot":"field","data-orientation":n,className:(0,s.cn)(r({orientation:n}),e),...a})},"FieldContent",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"field-content",className:(0,s.cn)("group/field-content flex flex-1 flex-col gap-0.5 leading-snug",e),...n})},"FieldLabel",0,function({className:e,...n}){return(0,t.jsx)(a,{"data-slot":"field-label",className:(0,s.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...n})}],986530)},787800,e=>{"use strict";var t=e.i(843476),n=e.i(689664),s=e.i(716327),a=e.i(867927),r=e.i(21357),o=e.i(77071),i=e.i(456420);let c={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"}]]};c.node;let l=(0,i.default)(c),d={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"}]]};d.node;let m=(0,i.default)(d);var u=e.i(759659),p=e.i(263676),h=e.i(271645),f=e.i(798120),g=e.i(167881),x=e.i(986530),v=e.i(23750),j=e.i(647163);let b=(0,h.memo)(({data:e,name:n,initialExpandDepth:s=2})=>{let a=(0,h.useMemo)(()=>"string"==typeof e?function(e){let t=e.trim();if(!(t.startsWith("{")&&t.endsWith("}"))&&!(t.startsWith("[")&&t.endsWith("]")))return{success:!1,data:e};try{return{success:!0,data:JSON.parse(e)}}catch{return{success:!1,data:e}}}(e).data:e,[e]);return(0,t.jsx)("div",{className:"text-sm",children:(0,t.jsx)(k,{data:a,name:n,depth:0,initialExpandDepth:s})})});b.displayName="JsonView";let y=(e,t)=>({role:"button",tabIndex:0,"aria-expanded":e,onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())}}),N="outline-none focus-visible:ring-3 focus-visible:ring-ring/50",k=(0,h.memo)(({data:e,name:n,depth:s=0,initialExpandDepth:a})=>{var r;let o=void 0===e?"undefined":Array.isArray(e)?"array":null===e?"null":typeof e,[i,c]=(0,h.useState)("string"!==o&&s<a),l={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(o){case"object":case"array":let d,m,u;return m=(d=(r="array"===o)?e:Object.entries(e)).length,u={open:r?"[":"{",close:r?"]":"}",collapsed:r?"[ ... ]":"{ ... }",empty:r?"[]":"{}"},0===m?(0,t.jsxs)("div",{className:"flex items-center",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:u.empty})]}):(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:(0,j.cn)("flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30",N),...y(i,()=>c(!i)),children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[n,":"]}),i?(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:u.open}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:u.collapsed}),(0,t.jsxs)("span",{className:"ml-1 text-muted-foreground group-hover:text-foreground",children:[m," ",1===m?"item":"items"]})]})]}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"pl-2 ml-4 border-l border-border",children:r?d.map((e,n)=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(k,{data:e,name:`${n}`,depth:s+1,initialExpandDepth:a})},n)):d.map(([e,n])=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(k,{data:n,name:e,depth:s+1,initialExpandDepth:a})},e))}),(0,t.jsx)("div",{className:"text-muted-foreground",children:u.close})]})]});case"string":return e.length>100?(0,t.jsxs)("div",{className:"flex mr-1 rounded group hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[n,":"]}),(0,t.jsx)("pre",{className:(0,j.cn)(l.string,"cursor-pointer group-hover:text-foreground",N),...y(i,()=>c(!i)),title:i?"Click to collapse":"Click to expand",children:i?`"${e}"`:`"${e.slice(0,100)}..."`})]}):(0,t.jsxs)("div",{className:"flex mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsxs)("pre",{className:l.string,children:['"',e,'"']})]});case"undefined":return(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:l.undefined,children:"undefined"})]});default:return(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[n&&(0,t.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[n,":"]}),(0,t.jsx)("span",{className:l[o]||l.default,children:null===e?"null":String(e)})]})}});k.displayName="JsonNode";var S=e.i(917162),w=e.i(818125),z=e.i(319036),C=e.i(127341),O=e.i(184762),A=e.i(6799),T=e.i(95187);let P=(0,T.createServerReference)("7fb52537f824151c3f09a681c12fd009cb58ccf561",T.callServer,void 0,T.findSourceMapURL,"callToolAction"),F=(0,T.createServerReference)("7f7da376e35d8d3bf47cdd19a8ff964d99fb6d9be9",T.callServer,void 0,T.findSourceMapURL,"deleteServerAction"),$=(0,T.createServerReference)("7f357f864f8433b1d36cc0d2d6ca3fd6a0544e927f",T.callServer,void 0,T.findSourceMapURL,"refreshServerAction"),R=(0,T.createServerReference)("7f83975f99a33a27bf1a46da37bd7b8edebdef5d78",T.callServer,void 0,T.findSourceMapURL,"registerServerAction");var M=e.i(681307),D=e.i(245629);let L=M.z.object({url:M.z.url(),headers:M.z.record(M.z.string(),M.z.string()).optional()}),E=M.z.object({command:M.z.string().min(1),args:M.z.array(M.z.string()).optional(),env:M.z.record(M.z.string(),M.z.string()).optional()}),I=M.z.union([L,E]),q=M.z.object({name:M.z.string(),description:M.z.string().optional(),inputSchema:M.z.looseObject({}).optional(),outputSchema:M.z.looseObject({}).optional()});function B(e){return"url"in e}M.z.object({clientInformation:M.z.looseObject({}).optional(),tokens:M.z.looseObject({}).optional(),authorizationServer:M.z.looseObject({}).optional(),codeVerifier:M.z.string().optional(),state:M.z.string().optional()});let J=M.z.object({name:M.z.string().min(1).max(40),config:I,toolCount:M.z.number().int(),lastError:M.z.string().nullish()}),U=q.extend({id:M.z.number().int(),description:M.z.string().nullish()});J.omit({toolCount:!0}).extend({tools:U.array().default([]),toolsSyncedAt:D.DateLikeSchema});let K=M.z.object({name:M.z.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:I}),H=M.z.union([M.z.object({mcpServers:M.z.record(M.z.string(),I)}),M.z.record(M.z.string(),I)]),V=[{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 W=e.i(895836),_=e.i(333999),G=e.i(609856),Q=e.i(283653);function X({name:e,onDone:n}){let[s,a]=(0,h.useState)(""),{data:r,isLoading:o}=(0,Q.useServerRoute)(f.queryKey.mcpServer(e)),[i,c]=(0,G.useServerAction)($,{...el,onOk:t=>{el.onOk(t),(0,Q.revalidate)(f.queryKey.mcpServer(e))}}),[d,m]=(0,G.useServerAction)(F,{okMessage:"Server deleted",onOk:()=>{n(),(0,Q.revalidate)(f.queryKey.mcp)}}),p=async()=>{await S.notify.confirm({title:`Delete ${e}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&d(e)};if(o)return(0,t.jsx)(W.SettingSkeleton,{rows:4});if(!r)return null;let x=r.tools.length,v=s.trim().toLowerCase(),j=v?r.tools.filter(e=>`${e.name} ${e.description??""}`.toLowerCase().includes(v)):r.tools,b=B(r.config)?"HTTP":"STDIO";return(0,t.jsxs)(W.SettingDialogContent,{title:r.name,description:(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px]",children:b}),(0,t.jsx)("span",{className:"truncate font-mono",children:em(r.config)})]}),footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(g.Button,{variant:"ghost",loading:m,onClick:p,className:"mr-auto text-destructive hover:text-destructive",children:[(0,t.jsx)(u.Trash2,{}),"Delete"]}),(0,t.jsxs)(g.Button,{variant:"outline",loading:c,onClick:()=>i(r.name),children:[(0,t.jsx)(l,{}),"Reconnect"]})]}),children:[r.lastError&&(0,t.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:r.lastError}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(W.SettingFilter,{value:s,onChange:a,placeholder:"Filter tools"}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:[x," ",1===x?"tool":"tools"]})]}),j.map(e=>(0,t.jsx)(ee,{tool:e,serverName:r.name},e.name)),0===j.length&&x>0&&(0,t.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"No tool here goes by that."})]})}function Y({server:e}){let s=e.toolCount,r=e.lastError?"error":s>0?"connected":"idle";return(0,t.jsxs)("button",{type:"button",onClick:()=>{S.notify.component({className:"sm:max-w-3xl",renderer:({close:n})=>(0,t.jsx)(X,{name:e.name,onDone:n})})},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,t.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",children:(0,t.jsx)(Z,{server:e})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.name}),"connected"===r&&(0,t.jsx)(n.Check,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:"error"===r?(0,t.jsx)("span",{className:"text-destructive",children:e.lastError}):(0,t.jsxs)(t.Fragment,{children:[s>0?`${s} ${1===s?"tool":"tools"}`:"No tools yet",(0,t.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground/70",children:[" · ",em(e.config)]})]})})]}),(0,t.jsx)(a.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function Z({server:e}){let n,s=(n=V.find(t=>B(t.config)?B(e.config)&&t.config.url.replace(/\/+$/,"")===e.config.url.replace(/\/+$/,""):!B(e.config)&&t.config.command===e.config.command&&(t.config.args??[]).join(" ")===(e.config.args??[]).join(" "))??V.find(t=>t.name===e.name),n?.icon);return s?(0,t.jsx)(w.SiteIcon,{host:s,className:"size-5",fallback:(0,t.jsx)(m,{className:"size-4"})}):(0,t.jsx)(m,{className:"size-4"})}function ee({tool:e,serverName:n}){let[r,o]=(0,h.useState)(!1),[i,c]=(0,h.useState)(!1),[l,d]=(0,h.useState)(!1),m=[["inputSchema",e.inputSchema],["outputSchema",e.outputSchema]].filter(([,e])=>e);return(0,t.jsxs)("div",{className:"rounded-xl border border-border/60 bg-background p-4",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-sm",children:e.name}),m.length>0&&(0,t.jsxs)(g.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>o(!r),children:[r?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(a.ChevronRight,{}),"Schema"]}),(0,t.jsxs)(g.Button,{size:"xs",variant:"ghost",className:"shrink-0 font-mono",onClick:()=>c(!i),children:[i?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(a.ChevronRight,{}),"Test"]})]}),e.description?(0,t.jsx)("p",{className:(0,j.cn)("mt-0.5 text-xs leading-relaxed text-muted-foreground",!l&&"line-clamp-2",e.description.length>140&&"cursor-pointer"),onClick:()=>d(!l),children:e.description}):null,r?(0,t.jsx)("div",{className:"mt-2 space-y-3 overflow-x-auto rounded-lg border border-input p-3",children:m.map(([e,n])=>(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"block font-mono text-xs text-muted-foreground",children:"inputSchema"===e?"in":"out"}),(0,t.jsx)("pre",{className:"font-mono text-xs leading-relaxed whitespace-pre",children:function e(t,n=0){if(!t||"object"!=typeof t)return"unknown";let s=" ".repeat(n+1),a=" ".repeat(n);if(Array.isArray(t.enum))return t.enum.map(e=>JSON.stringify(e)).join(" | ");let r=t.anyOf??t.oneOf;if(Array.isArray(r))return r.map(t=>e(t,n)).join(" | ");if("array"===t.type){let s=e(t.items,n);return/[|{]/.test(s)?`(${s})[]`:`${s}[]`}if("object"===t.type||t.properties){let r=t.properties;if(!r||0===Object.keys(r).length)return"{}";let o=t.required??[],i=Object.entries(r).map(([t,a])=>{let r=o.includes(t)?"":"?",i=a?.description,c="string"==typeof i&&i.length<=60?` // ${i}`:"";return`${s}${t}${r}: ${e(a,n+1)}${c}`});return`{
|
|
2
2
|
${i.join("\n")}
|
|
3
3
|
${a}}`}return Array.isArray(t.type)?t.type.join(" | "):"string"==typeof t.type?t.type:"unknown"}(n)})]},e))}):null,i?(0,t.jsx)(et,{tool:e,serverName:n}):null]})}function et({tool:e,serverName:n}){let[s,a]=(0,h.useState)(()=>(function(e){let t=e.inputSchema?.properties;if(!t||"object"!=typeof t)return"{}";let n={};for(let[e,s]of Object.entries(t))n[e]=s?.type==="number"||s?.type==="integer"?0:s?.type!=="boolean"&&(s?.type==="array"?[]:s?.type==="object"?{}:"");return JSON.stringify(n,null,2)})(e)),[o,i]=(0,h.useState)(""),[c,l,d,m,u]=(0,G.useServerAction)(P,{errorMessage:!1});return(0,t.jsxs)("div",{className:"mt-2 space-y-2 rounded-lg border border-input p-3",children:[(0,t.jsx)(O.Textarea,{value:s,onChange:e=>a(e.target.value),spellCheck:!1,className:"min-h-24 resize-none font-mono text-xs"}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"font-mono text-xs text-destructive",children:o||m}),(0,t.jsxs)(g.Button,{size:"sm",loading:l,onClick:()=>{let t;try{t=s.trim()?JSON.parse(s):void 0}catch{i("Not valid JSON");return}i(""),u(),c(n,e.name,t)},children:[!l&&(0,t.jsx)(r.Play,{}),"Run"]})]}),void 0!==d&&(0,t.jsx)("div",{className:"overflow-x-auto rounded-lg bg-muted/40 p-3",children:(0,t.jsx)(b,{data:d,initialExpandDepth:3})})]})}function en(e){return S.notify.component({className:"sm:max-w-lg",renderer:({close:n})=>(0,t.jsx)(es,{initial:e,onDone:n})})}function es({initial:e,onDone:n}){let s=e&&B(e.config)?e.config:void 0,a=e&&!B(e.config)?e.config:void 0,[r,o]=(0,_.useObjectState)({mode:a?"stdio":"http",name:e?.name??"",url:s?.url??"",headers:eo(s?.headers),command:a?.command??"",args:(a?.args??[]).join(" "),env:eo(a?.env),raw:""}),{mode:i,name:c,url:l,headers:d,command:m,args:u,env:p,raw:f}=r,[j,b]=(0,G.useServerAction)(R,{...el,onOk:e=>{el.onOk(e),"error"!==e.status&&n()}}),y=(0,h.useMemo)(()=>{var e,t,n,s,a;let r,o;return"json"===i?function(e){let t,n=e.trim();if(!n)return{value:null,error:""};try{t=JSON.parse(n)}catch{return{value:null,error:"Not valid JSON"}}let s=I.safeParse(t);if(s.success)return{value:{name:null,config:s.data},error:""};let a=H.safeParse(t);if(!a.success)return{value:null,error:"Needs a url or a command"};let r=Object.entries("mcpServers"in a.data?a.data.mcpServers:a.data)[0];return r?{value:{name:r[0],config:r[1]},error:""}:{value:null,error:"No server in there"}}(f):"http"===i?(e=l,t=d,(r=L.safeParse({url:e.trim(),headers:ei(t)})).success?{value:{name:null,config:r.data},error:""}:{value:null,error:e.trim()?"Needs a valid url":""}):(n=m,s=u,a=p,(o=E.safeParse({command:n.trim(),args:s.split(/\s+/).filter(Boolean),env:ei(a)})).success?{value:{name:null,config:o.data},error:""}:{value:null,error:n.trim()?"Needs a command":""})},[i,f,l,d,m,u,p]),N="json"===i?f:JSON.stringify([i,l,d,m,u,p]),[k,S]=(0,h.useState)(N);(0,h.useEffect)(()=>{let e=setTimeout(()=>S(N),700);return()=>clearTimeout(e)},[N]);let w=k===N?y.error:"",A=c||y.value?.name||"",T=K.safeParse({name:A,config:y.value?.config});function P(e){let t=y.value?.config;return t?"json"===e?o({mode:e,raw:JSON.stringify(t,null,2)}):"http"===e&&B(t)?o({mode:e,url:t.url,headers:eo(t.headers)}):"stdio"!==e||B(t)?void o({mode:e}):o({mode:e,command:t.command,args:(t.args??[]).join(" "),env:eo(t.env)}):o({mode:e})}let F=(0,t.jsxs)("span",{className:"flex items-center gap-2 font-mono text-xs text-muted-foreground",children:["JSON",(0,t.jsx)(z.Switch,{size:"sm",checked:"json"===i,onCheckedChange:e=>{let t;return e?P("json"):void P((t=y.value?.config)&&!B(t)?"stdio":"http")}})]});return(0,t.jsx)(W.SettingDialogContent,{title:"Add MCP server",description:"Its tools become available to every bot.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.Button,{variant:"ghost",onClick:n,children:"Cancel"}),(0,t.jsx)(g.Button,{disabled:!T.success,loading:b,onClick:()=>{T.success&&!b&&j(T.data)},children:"Connect"})]}),children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:"Name"}),(0,t.jsx)(v.Input,{value:A,onChange:e=>o({name:e.target.value}),placeholder:"notion",spellCheck:!1})]}),"json"===i?(0,t.jsxs)(x.Field,{children:[(0,t.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,t.jsx)(x.FieldLabel,{children:"JSON"}),F]}),(0,t.jsx)(O.Textarea,{value:f,onChange:e=>o({raw:e.target.value}),spellCheck:!1,placeholder:ec,className:"min-h-64 resize-none font-mono text-xs"})]}):(0,t.jsxs)(C.Tabs,{value:i,onValueChange:e=>P(e),className:"gap-6",children:[(0,t.jsxs)(x.Field,{children:[(0,t.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,t.jsx)(x.FieldLabel,{children:"Transport"}),F]}),(0,t.jsxs)(C.TabsList,{className:"w-full",children:[(0,t.jsx)(C.TabsTrigger,{value:"http",children:"HTTP"}),(0,t.jsx)(C.TabsTrigger,{value:"stdio",children:"STDIO"})]})]}),(0,t.jsxs)(C.TabsContent,{value:"http",className:"space-y-6",children:[(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:"URL"}),(0,t.jsx)(v.Input,{value:l,onChange:e=>o({url:e.target.value}),placeholder:"https://mcp.notion.com/mcp",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsx)(ea,{label:"Headers",pairs:d,onChange:e=>o({headers:e}),keyPlaceholder:"Authorization",valuePlaceholder:"Bearer sk-..."})]}),(0,t.jsxs)(C.TabsContent,{value:"stdio",className:"space-y-6",children:[(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:"Command"}),(0,t.jsx)(v.Input,{value:m,onChange:e=>o({command:e.target.value}),placeholder:"npx",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:"Args"}),(0,t.jsx)(v.Input,{value:u,onChange:e=>o({args:e.target.value}),placeholder:"-y @notionhq/notion-mcp-server",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsx)(ea,{label:"Env",pairs:p,onChange:e=>o({env:e}),keyPlaceholder:"NOTION_TOKEN",valuePlaceholder:"ntn_..."})]})]}),w&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:w})]})})}function ea({label:e,pairs:n,onChange:s,keyPlaceholder:a,valuePlaceholder:r}){let i=(e,t)=>s(n.map(n=>n.id===e?{...n,...t}:n));return(0,t.jsxs)(x.Field,{children:[(0,t.jsx)(x.FieldLabel,{children:e}),(0,t.jsxs)("div",{className:"space-y-2",children:[n.map(e=>(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(v.Input,{value:e.key,onChange:t=>i(e.id,{key:t.target.value}),placeholder:a,spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(v.Input,{value:e.value,onChange:t=>i(e.id,{value:t.target.value}),placeholder:r,spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(g.Button,{variant:"ghost",size:"icon","aria-label":"Remove this row",onClick:()=>s(n.filter(t=>t.id!==e.id)),children:(0,t.jsx)(p.X,{})})]},e.id)),(0,t.jsxs)(g.Button,{variant:"outline",size:"sm",onClick:()=>s([...n,er()]),children:[(0,t.jsx)(o.Plus,{}),"Add"]})]})]})}let er=(e="",t="")=>({id:crypto.randomUUID(),key:e,value:t}),eo=e=>Object.entries(e??{}).map(([e,t])=>er(e,t)),ei=e=>{let t=e.filter(e=>e.key.trim());if(t.length)return Object.fromEntries(t.map(e=>[e.key.trim(),e.value]))},ec=`/** STDIO Example */
|
|
4
4
|
{
|