thursday-agent 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- 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.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/artifact/route.js +9 -9
- package/.next/server/app/api/artifact/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/files/route.js +3 -3
- package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/route.js +8 -8
- package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/route.js +8 -8
- package/.next/server/app/api/bot/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/thread/[id]/route.js +3 -3
- package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/thread/route.js +3 -3
- package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
- package/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/server/app/api/events/route.js.nft.json +1 -1
- package/.next/server/app/api/favicon/[host]/route.js.nft.json +1 -1
- package/.next/server/app/api/file/[...path]/route.js +4 -4
- package/.next/server/app/api/file/[...path]/route.js.nft.json +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.nft.json +1 -1
- package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
- package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/edit/route.js +11 -11
- package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
- package/.next/server/app/api/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/reach/route.js +11 -11
- package/.next/server/app/api/reach/route.js.nft.json +1 -1
- package/.next/server/app/api/routine/route.js +7 -7
- package/.next/server/app/api/routine/route.js.nft.json +1 -1
- package/.next/server/app/api/signins/route.js +5 -5
- package/.next/server/app/api/signins/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/[source]/[name]/route.js +7 -7
- package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/route.js +7 -7
- package/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/call/route.js +5 -5
- package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/settings/route.js +5 -5
- package/.next/server/app/api/thursday/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/text/route.js +13 -13
- package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/tool-call/route.js +12 -12
- package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/files/route.js +8 -8
- package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/route.js +9 -9
- package/.next/server/app/api/workspace/route.js.nft.json +1 -1
- package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +3 -3
- package/.next/server/app/artifact/[...path]/page.js +4 -4
- 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 +60 -60
- package/.next/server/app/page.js +5 -5
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__00qyw01._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__01ypm_z._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__021dkui._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__18e65_-._.js → [root-of-the-server]__03xamry._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__05dp5tr._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__09gdscj._.js +7 -0
- package/.next/server/chunks/{[root-of-the-server]__10_7vqz._.js → [root-of-the-server]__0b36yfw._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1gamvcz._.js → [root-of-the-server]__0jzwdg-._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0mrk2it._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0nmust6._.js +5 -0
- package/.next/server/chunks/[root-of-the-server]__0svzjwa._.js +7 -0
- package/.next/server/chunks/{[root-of-the-server]__16yw3mb._.js → [root-of-the-server]__12m24xl._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1zrwxis._.js → [root-of-the-server]__12tahb4._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1ep-pao._.js → [root-of-the-server]__1_h4hf9._.js} +4 -4
- package/.next/server/chunks/{[root-of-the-server]__1-tdj60._.js → [root-of-the-server]__1de1o6m._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1voqqyc._.js → [root-of-the-server]__1ignh6-._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1t02-1p._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ygplx1._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__11g20j-._.js → [root-of-the-server]__1yl5l25._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1mbd2w_._.js → [root-of-the-server]__208vmyf._.js} +1 -1
- package/.next/server/chunks/{_1mfu9a3._.js → _02lipqs._.js} +1 -1
- package/.next/server/chunks/_05sa7xl._.js +1 -1
- package/.next/server/chunks/{_1rg5bfd._.js → _074f2ts._.js} +1 -1
- package/.next/server/chunks/_07nxi75._.js +3 -3
- package/.next/server/chunks/_08btiir._.js +7 -0
- package/.next/server/chunks/_0caua_s._.js +1 -1
- package/.next/server/chunks/{_0qoush_._.js → _0gt6cbj._.js} +1 -1
- package/.next/server/chunks/_0xygcxs._.js +3 -3
- package/.next/server/chunks/{_09c4we8._.js → _17i1lt2._.js} +1 -1
- package/.next/server/chunks/_19kea1l._.js +9 -9
- package/.next/server/chunks/_1gn2r2q._.js +3 -3
- package/.next/server/chunks/{_03niwml._.js → _1ntwp1s._.js} +1 -1
- package/.next/server/chunks/_1q6e56i._.js +3 -3
- package/.next/server/chunks/{_02fn1o3._.js → _1tkzgtm._.js} +1 -1
- package/.next/server/chunks/_1wl2g8_._.js +2 -2
- package/.next/server/chunks/{_1w6uf9k._.js → _1y3mnz4._.js} +1 -1
- package/.next/server/chunks/features_workspace_workspace_ts_13h82gv._.js +4 -4
- package/.next/server/chunks/features_workspace_workspace_ts_1iyjroj._.js +4 -4
- package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0cux6zt._.js → node_modules_consola_dist_chunks_prompt_mjs_04oxl25._.js} +1 -1
- package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0w32bqh._.js → node_modules_consola_dist_chunks_prompt_mjs_0g87zst._.js} +1 -1
- package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_1clmnaj._.js → node_modules_consola_dist_chunks_prompt_mjs_1341cnf._.js} +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__02jdtqa._.js → [root-of-the-server]__07660xu._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__0rnjkw2._.js → [root-of-the-server]__149x25m._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__17h1ggo._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__19s8qyj._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1jyeu61._.js +1 -1
- package/.next/server/chunks/ssr/_088vzgn._.js +3 -0
- package/.next/server/chunks/ssr/{_0wupyvd._.js → _0_vnw9v._.js} +2 -2
- package/.next/server/chunks/ssr/{_1u5vsy-._.js → _0aeknva._.js} +2 -2
- package/.next/server/chunks/ssr/_0fo4552._.js +3 -3
- package/.next/server/chunks/ssr/{_0-ou1b0._.js → _0n2scfq._.js} +2 -2
- package/.next/server/chunks/ssr/_0o_o9ji._.js +3 -0
- package/.next/server/chunks/ssr/_0qne8xs._.js +3 -0
- package/.next/server/chunks/ssr/_0r0g9ki._.js +1 -1
- package/.next/server/chunks/ssr/_0v9r8g2._.js +3 -0
- package/.next/server/chunks/ssr/_0x8ophf._.js +1 -1
- package/.next/server/chunks/ssr/{_0ncuqct._.js → _0ztbn5q._.js} +2 -2
- package/.next/server/chunks/ssr/{_0w8r7o7._.js → _1-41lck._.js} +2 -2
- package/.next/server/chunks/ssr/{_10fwcz_._.js → _14dfh7a._.js} +2 -2
- package/.next/server/chunks/ssr/{_1f6s34p._.js → _15m5ctz._.js} +2 -2
- package/.next/server/chunks/ssr/{_11pnnvd._.js → _18-e7zi._.js} +2 -2
- package/.next/server/chunks/ssr/{_0y28gl3._.js → _1c5iqz1._.js} +3 -3
- package/.next/server/chunks/ssr/{_1dqaksc._.js → _1hbjh6n._.js} +2 -2
- package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
- package/.next/server/chunks/ssr/{_1k0efi3._.js → _1sttj8x._.js} +2 -2
- package/.next/server/chunks/ssr/_1uij_rj._.js +1 -1
- package/.next/server/chunks/ssr/_1umbr78._.js +1 -1
- package/.next/server/chunks/ssr/{_17ble8k._.js → _1vtgiou._.js} +3 -3
- package/.next/server/chunks/ssr/_1w9w1ok._.js +1 -1
- package/.next/server/chunks/ssr/{_1z586yw._.js → _1z6pirx._.js} +2 -2
- package/.next/server/chunks/ssr/features_0796o8r._.js +1 -1
- package/.next/server/chunks/ssr/features_bot_1knyan7._.js +3 -0
- package/.next/server/chunks/ssr/features_bot_1kr0_m-._.js +3 -0
- package/.next/server/chunks/ssr/{features_config_11dpa7r._.js → features_config_0n0zu89._.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_1r5o-bo._.js → node_modules_00h1t1j._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1o9n7_n._.js → node_modules_02ficyi._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0u24mg0._.js → node_modules_03q71_j._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_138kcrz._.js → node_modules_03uejh6._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0x_2io2._.js → node_modules_06grs09._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0n1js5k._.js → node_modules_07mo9rn._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0bas34k._.js → node_modules_09e8kz_._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1dzye0n._.js → node_modules_09ikzel._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_18yn_bs._.js → node_modules_0_d_7gq._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0ka8te1._.js → node_modules_0_p8w7p._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0mark4f._.js → node_modules_0f5bmkb._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0sdjzae._.js → node_modules_0kwie-o._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1ozyial._.js → node_modules_0r-9e4n._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_156m1qh._.js → node_modules_0u_8z64._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0-ew8f8._.js → node_modules_0zf3wuu._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1xua-g1._.js → node_modules_1-7fc7h._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0ld7p-1._.js → node_modules_142z3o5._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0-8r9yw._.js → node_modules_180l3i0._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1tj7_9z._.js → node_modules_197vh1s._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0y5uubt._.js → node_modules_1_n9o9s._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0etz1i0._.js → node_modules_1fw32pg._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0bbwe-u._.js → node_modules_1hefp6h._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_097cl9f._.js → node_modules_1irot3r._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0uibk9z._.js → node_modules_1om2itc._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1zkzksd._.js → node_modules_1ubln7w._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_02uwbwp._.js → node_modules_1wyhtw9._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_133hjui._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0aczkbn._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1b3vwd3._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0ah684s._.js} +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +61 -61
- package/.next/static/chunks/{1ub9obhgfm4jl.js → 024plctckvq-1.js} +1 -1
- package/.next/static/chunks/04toe_3nqfjqt.js +1 -0
- package/.next/static/chunks/{0609ejkwuy4sf.js → 0_b_bi2pobasx.js} +2 -2
- package/.next/static/chunks/{3ro66d9dc70bc.js → 0dfvwgnyrp8qt.js} +1 -1
- package/.next/static/chunks/{314szf8yer-3n.js → 0f47nnshdlucs.js} +1 -1
- package/.next/static/chunks/0sowxe4nnl5qu.js +1 -0
- package/.next/static/chunks/{07vcuxousbmy1.js → 0sv142q1yrva2.js} +1 -1
- package/.next/static/chunks/{0q4ws7qd21chx.js → 0tp868040z9nn.js} +2 -2
- package/.next/static/chunks/{0unonxbajyknw.js → 1-63yde5eaz7i.js} +1 -1
- package/.next/static/chunks/14qitm0kwsb6g.js +15 -0
- package/.next/static/chunks/{2xjr5b-yk_h3o.js → 1bgvxd3xny53w.js} +1 -1
- package/.next/static/chunks/{245_cp14iz637.js → 1cyrrz4q871aj.js} +1 -1
- package/.next/static/chunks/1st3b0c9vhxg3.js +1 -0
- package/.next/static/chunks/{39miwvg4k-b2d.js → 1wbqaidq7vc3_.js} +1 -1
- package/.next/static/chunks/{0cl_fgkphk1oz.js → 28sxb_k460e9h.js} +1 -1
- package/.next/static/chunks/{3j-l8un0d77v7.js → 2v6e_9p95o2e3.js} +1 -1
- package/.next/static/chunks/{23tx-2paw9qa6.js → 3-qp777vtfglj.js} +1 -1
- package/.next/static/chunks/{2jbjyazqfqyoh.js → 33ekkscpcq-z1.js} +1 -1
- package/.next/static/chunks/388l-zszwa_jf.js +1 -0
- package/.next/static/chunks/{3vwjs5kq11417.js → 38edd4rpcbvzp.js} +1 -1
- package/.next/static/chunks/3bwrvpjk95_x4.js +1 -0
- package/.next/static/chunks/{42m371fn687r5.js → 3itdg6t243u6f.js} +1 -1
- package/.next/static/chunks/{2oa4gpkzjtpni.js → 44vre0f7xqsh-.js} +1 -1
- package/README.md +12 -12
- package/guide/bots.md +48 -8
- package/guide/calls.md +13 -12
- package/guide/setup.md +4 -2
- package/package.json +1 -1
- package/public/sounds/NOTICE +3 -0
- package/public/sounds/opening-land.ogg +0 -0
- package/public/sounds/opening-rise.ogg +0 -0
- package/public/sounds/opening-step-1.ogg +0 -0
- package/public/sounds/opening-step-2.ogg +0 -0
- package/public/sounds/opening-step-3.ogg +0 -0
- package/skills/README.md +3 -0
- package/skills/artifact/SKILL.md +6 -5
- package/skills/artifact/references/book.md +22 -8
- package/skills/artifact/references/deck.md +4 -2
- package/skills/artifact/references/document.md +9 -0
- package/skills/artifact/references/sheet.md +108 -0
- package/skills/artifact/runtime/book/book.css +75 -0
- package/skills/artifact/runtime/book/book.html +6 -3
- package/skills/artifact/runtime/book/book.js +21 -0
- package/skills/artifact/runtime/canvas/canvas.css +1 -1
- package/skills/artifact/runtime/canvas/canvas.js +11 -1
- package/skills/artifact/runtime/deck/deck.css +164 -1
- package/skills/artifact/runtime/deck/deck.js +76 -1
- package/skills/artifact/runtime/document/docx.js +631 -0
- package/skills/artifact/runtime/document/markdown.mjs +58 -2
- package/skills/artifact/runtime/document/quick.css +66 -0
- package/skills/artifact/runtime/document/quick.html +1 -0
- package/skills/artifact/runtime/document/quick.js +154 -0
- package/skills/artifact/runtime/document/word.mjs +65 -0
- package/skills/artifact/runtime/sheet/format.mjs +385 -0
- package/skills/artifact/runtime/sheet/formula.mjs +755 -0
- package/skills/artifact/runtime/sheet/sheet.css +499 -0
- package/skills/artifact/runtime/sheet/sheet.html +102 -0
- package/skills/artifact/runtime/sheet/sheet.js +1361 -0
- package/skills/artifact/runtime/sheet/xlsx.mjs +320 -0
- package/skills/artifact/runtime/shell/head.html +1 -1
- package/skills/artifact/runtime/shell/shell.css +3 -0
- package/skills/artifact/runtime/shell/wear.mjs +47 -1
- package/skills/artifact/runtime/vendor/fflate.LICENSE.md +23 -0
- package/skills/artifact/runtime/vendor/fflate.mjs +2710 -0
- package/skills/artifact/scripts/book.mjs +141 -5
- package/skills/artifact/scripts/chart.mjs +229 -11
- package/skills/artifact/scripts/document.mjs +29 -2
- package/skills/artifact/scripts/spreadsheet.mjs +1068 -0
- package/skills/data-report/SKILL.md +8 -1
- package/.next/server/chunks/[root-of-the-server]__0aijj66._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0tvoct-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__118qjk_._.js +0 -7
- package/.next/server/chunks/[root-of-the-server]__1b8tp42._.js +0 -5
- package/.next/server/chunks/[root-of-the-server]__1gzcbda._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1qcn1ti._.js +0 -7
- package/.next/server/chunks/_0xx3ryc._.js +0 -7
- package/.next/server/chunks/ssr/[root-of-the-server]__1y5_1cv._.js +0 -3
- package/.next/server/chunks/ssr/_0l1-xc6._.js +0 -3
- package/.next/server/chunks/ssr/_1g48r6t._.js +0 -3
- package/.next/server/chunks/ssr/features_bot_1k25jdg._.js +0 -3
- package/.next/server/chunks/ssr/features_bot_1s_-2vj._.js +0 -3
- package/.next/server/chunks/ssr/lib_utils_ts_0_f1xvm._.js +0 -3
- package/.next/static/chunks/00d54fcfm-lko.js +0 -1
- package/.next/static/chunks/0gjlsu6vrfzod.js +0 -1
- package/.next/static/chunks/17yqt1p_svv13.js +0 -1
- package/.next/static/chunks/203pbwecfs3tm.js +0 -1
- package/.next/static/chunks/3ghvoe_mlljzs.js +0 -15
- package/.next/static/chunks/3gn7dubb4-pwy.js +0 -1
- /package/.next/static/{RtLRT9EEaGn-OqwpMFdYg → VtbCMn-0G969p8QJsWdGv}/_buildManifest.js +0 -0
- /package/.next/static/{RtLRT9EEaGn-OqwpMFdYg → VtbCMn-0G969p8QJsWdGv}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{RtLRT9EEaGn-OqwpMFdYg → VtbCMn-0G969p8QJsWdGv}/_ssgManifest.js +0 -0
|
@@ -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)("7f2607be463b8eeb1a2cac4aae2faabaeed529db3a",T.callServer,void 0,T.findSourceMapURL,"callToolAction"),F=(0,T.createServerReference)("7f431d2117cb26852604d2d8066222a52b92e65acb",T.callServer,void 0,T.findSourceMapURL,"deleteServerAction"),$=(0,T.createServerReference)("7f9eab4ab2fa9c2c4b962ac33d68d9b653879cd2f3",T.callServer,void 0,T.findSourceMapURL,"refreshServerAction"),R=(0,T.createServerReference)("7f85484c6a1f815367476f4d19618dadb7f6ab48da",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)("7fbe22831bc040ecc1f8eaafddab5bdba1ee25eb16",T.callServer,void 0,T.findSourceMapURL,"callToolAction"),F=(0,T.createServerReference)("7f43b273cbb47910cab79412873a51d14c9b1bd53e",T.callServer,void 0,T.findSourceMapURL,"deleteServerAction"),$=(0,T.createServerReference)("7f98e816ec063870c70f3b3cc687c3ab9a86784e4a",T.callServer,void 0,T.findSourceMapURL,"refreshServerAction"),R=(0,T.createServerReference)("7fdc006116034da96403babb00852ffd8d552211b6",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
|
{
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,947627,e=>{"use strict";var t=e.i(843476),n=e.i(647163);e.s(["Table",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,t.jsx)("table",{"data-slot":"table",className:(0,n.cn)("w-full caption-bottom text-sm",e),...r})})},"TableBody",0,function({className:e,...r}){return(0,t.jsx)("tbody",{"data-slot":"table-body",className:(0,n.cn)("[&_tr:last-child]:border-0",e),...r})},"TableCell",0,function({className:e,...r}){return(0,t.jsx)("td",{"data-slot":"table-cell",className:(0,n.cn)("p-2 align-middle [&:has([role=checkbox])]:pr-0",e),...r})},"TableHead",0,function({className:e,...r}){return(0,t.jsx)("th",{"data-slot":"table-head",className:(0,n.cn)("h-9 px-2 text-left align-middle font-mono text-[11px] font-normal tracking-[0.1em] whitespace-nowrap text-muted-foreground uppercase [&:has([role=checkbox])]:pr-0",e),...r})},"TableHeader",0,function({className:e,...r}){return(0,t.jsx)("thead",{"data-slot":"table-header",className:(0,n.cn)("[&_tr]:border-b",e),...r})},"TableRow",0,function({className:e,...r}){return(0,t.jsx)("tr",{"data-slot":"table-row",className:(0,n.cn)("border-b border-border/60 transition-colors data-[state=selected]:bg-muted hover:bg-muted/40",e),...r})}])},621285,442466,988027,e=>{"use strict";var t=e.i(843476),n=e.i(24071),r=e.i(867927),i=e.i(482022),l=e.i(657688),a=e.i(271645),s=e.i(798120),o=e.i(167881),u=e.i(630374),d=e.i(683408),c=e.i(671428),f=e.i(947627),m=e.i(41533),p=e.i(616172),h=e.i(95187);let g=(0,h.createServerReference)("7f3121fc646d0a75f62e314461151534a6388fac09",h.callServer,void 0,h.findSourceMapURL,"openFileAction");e.s(["openFileAction",0,g],442466);let x=(0,h.createServerReference)("7fcd5a8bb2806bee334cec73e729c90e26ad83eb5f",h.callServer,void 0,h.findSourceMapURL,"revealFileAction");e.s(["revealFileAction",0,x],988027);let b=(0,h.createServerReference)("7fd1f6e08972507c65d599a7276b77ecf6e44aaf17",h.callServer,void 0,h.findSourceMapURL,"savePageAction");var w=e.i(393080),v=e.i(609856),y=e.i(647163);let j=new Set(["frame","image","audio","video"]);function k(e){let t=(0,p.workspaceRelative)(e);return t?"none"===(0,p.viewKindOf)(t)?{how:"os"}:{how:"dialog",path:t}:{how:"os"}}let _=(0,a.createContext)(null),S={dialog:{prose:"px-5 py-4",block:"px-4 py-3"},page:{prose:"px-5 py-6 sm:px-8",block:"px-5 py-5"},inline:{prose:"pb-3",block:"pb-3"}};function O({kind:e,content:n,truncated:r,where:i="dialog"}){return(0,t.jsxs)(t.Fragment,{children:[null!=r&&(0,t.jsx)(C,{of:r}),(0,t.jsx)(P,{kind:e,content:n,where:i})]})}function C({of:e}){return(0,t.jsxs)("p",{className:"border-b border-border/60 px-5 py-2.5 font-mono text-[11px] text-muted-foreground",children:[`Showing the first ${(0,y.formatBytes)(m.WORKSPACE_VIEW.textMax)} of ${(0,y.formatBytes)(e)}. `,"Open the file itself for the rest."]})}function P({kind:e,content:n,where:r}){let i=S[r];switch(e){case"markdown":return(0,t.jsx)("div",{className:(0,y.cn)("min-w-0 text-sm leading-relaxed",i.prose),children:(0,t.jsx)(d.Markdown,{children:n})});case"csv":return(0,t.jsx)(D,{content:n,className:i.block});case"json":return(0,t.jsx)(L,{text:function(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}(n),className:i.block});default:return(0,t.jsx)(L,{text:n,className:i.block})}}function R(e){let[t,n]=(0,a.useState)(null),[r,i]=(0,a.useState)(null),[l,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e)return;n(null),i(null),o(null);let t=!1;return fetch(s.queryKey.file(e),{headers:{range:`bytes=0-${m.WORKSPACE_VIEW.textMax-1}`}}).then(async e=>{if(!e.ok)throw Error(await e.text());return{text:await e.text(),of:function(e){let t=e.headers.get("content-range")?.match(/^bytes \d+-(\d+)\/(\d+)$/);if(!t)return null;let[,n,r]=t.map(Number);return n+1<r?r:null}(e)}}).then(({text:e,of:r})=>{t||(n(null===r?e:e.slice(0,e.lastIndexOf("\n")+1||void 0)),o(r))}).catch(e=>!t&&i((0,y.errorToString)(e))),()=>{t=!0}},[e]),{content:t,failure:r,truncated:l}}let N={named:new Map,opened:new Map,showing:new WeakMap,listening:!1},E=e=>{let t=N.named.get(e);return t||(t=crypto.randomUUID(),N.named.set(e,t),N.opened.set(t,e)),{thursday:"host",as:t}};async function M(e){let t=e.source,n=e.data;if(!t||"null"!==e.origin||"string"!=typeof n?.thursday)return;if("hello"===n.thursday){let e=N.showing.get(t);e&&t.postMessage(E(e),"*");return}let r="save"===n.thursday&&N.opened.get(n.as);if(!r||"string"!=typeof n.html)return;let i=await b(r,n.html,"string"==typeof n.base?n.base:""),l={as:n.as,id:n.id};t.postMessage((0,w.isResultOk)(i)?i.data.changed?{...l,thursday:"not-saved",changed:!0}:{...l,thursday:"saved",revision:i.data.revision}:{...l,thursday:"not-saved",error:i.message},"*")}function I({path:e,className:n,takeKeys:r}){let i=(0,a.useRef)(null),l=(0,a.useCallback)(()=>{r&&i.current?.focus();let t=i.current?.contentWindow;t&&(N.showing.set(t,e),t.postMessage(E(e),"*"))},[e,r]);return(0,a.useEffect)(l,[l]),(0,a.useEffect)(()=>{N.listening||(N.listening=!0,window.addEventListener("message",M))},[]),(0,t.jsx)("iframe",{ref:i,title:e,src:s.queryKey.file(e),allow:"clipboard-read *; clipboard-write *; fullscreen *; autoplay *",className:n,onLoad:l})}function z({path:e,kind:n,where:r,takeKeys:i}){return"frame"===n?(0,t.jsx)(I,{path:e,className:"h-full w-full bg-white",takeKeys:i}):"image"===n?(0,t.jsx)("img",{src:s.queryKey.file(e),alt:e,className:"dialog"===r?"mx-auto max-h-[calc(100vh-11rem)] object-contain p-4":"mx-auto max-w-full p-6"}):"audio"===n?(0,t.jsx)("audio",{controls:!0,src:s.queryKey.file(e),className:"w-full p-6",children:(0,t.jsx)("track",{kind:"captions"})}):(0,t.jsx)("video",{controls:!0,src:s.queryKey.file(e),className:"mx-auto max-h-full max-w-full p-4",children:(0,t.jsx)("track",{kind:"captions"})})}function T({path:e}){let[n,r]=(0,v.useServerAction)(g);return(0,t.jsxs)("div",{className:"space-y-4 p-8",children:[(0,t.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:"Nothing here can draw this file. It opens in its own program."}),(0,t.jsx)(o.Button,{variant:"outline",loading:r,onClick:()=>n(e),children:"Open it"})]})}function $({path:e,bytes:n}){let[r,i]=(0,v.useServerAction)(x);return(0,t.jsxs)("div",{className:"space-y-4 p-8",children:[(0,t.jsxs)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:[`This file is ${(0,y.formatBytes)(n)} — too big to draw here without `,"taking the window with it. Open it where it is instead."]}),(0,t.jsx)(o.Button,{variant:"outline",loading:i,onClick:()=>r(e),children:"Reveal in the file manager"})]})}function A({path:e,opening:d,group:f=[],kind:p,byHer:h,onPath:g,onClose:x}){let b="image"===p,w=j.has(p),{content:v,failure:k,truncated:_}=R(w?null:e),S=e?.split("/").pop()??"",C=e?f.indexOf(e):-1,P=e=>{!(C<0)&&g&&g(f[(C+e+f.length)%f.length])},{left:N,keep:E}=function(e,t){let[n,r]=(0,a.useState)(null),i=(0,a.useRef)(t);i.current=t;let l=(0,a.useRef)(()=>void 0);return(0,a.useEffect)(()=>{if(!e)return void r(null);let t=Math.round(m.WORKSPACE_VIEW.autoCloseMs/1e3);r(t);let n=()=>{for(let e of(window.clearInterval(s),["pointermove","keydown","wheel","blur"]))window.removeEventListener(e,a);r(null)},a=()=>n(),s=window.setInterval(()=>{if((t-=1)>0)return r(t);n(),i.current()},1e3);for(let e of["pointermove","keydown","wheel","blur"])window.addEventListener(e,a);return l.current=n,n},[e]),{left:n,keep:(0,a.useCallback)(()=>l.current(),[])}}(h&&null!==e,x),M="frame"===p||"video"===p,I=(0,a.useRef)(null);return(0,t.jsx)(u.Dialog,{open:null!==e,onOpenChange:e=>!e&&x(),children:(0,t.jsxs)(u.DialogContent,{ref:I,initialFocus:I,onKeyDown:e=>{"ArrowLeft"===e.key&&P(-1),"ArrowRight"===e.key&&P(1)},onPointerOver:E,className:(0,y.cn)("flex flex-col gap-0 overflow-hidden p-0",M?"h-[min(42rem,calc(100vh-3rem))] sm:max-w-232":"max-h-[calc(100vh-3rem)] sm:max-w-4xl"),children:[(0,t.jsx)(u.DialogTitle,{className:"sr-only",children:S}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1 border-b border-border/60 py-2 pr-12 pl-4",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px]",children:e}),null!==N&&(0,t.jsx)("span",{className:"shrink-0 pr-1 font-mono text-[11px] text-muted-foreground tabular-nums",children:`Closing in ${N}s`}),C>=0&&f.length>1&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:[C+1," / ",f.length]}),(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm","aria-label":"Previous image",onClick:()=>P(-1),children:(0,t.jsx)(n.ChevronLeft,{})}),(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm","aria-label":"Next image",onClick:()=>P(1),children:(0,t.jsx)(r.ChevronRight,{})})]}),e&&(0,t.jsx)("a",{href:s.queryKey.fileView(e),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:(0,y.cn)((0,o.buttonVariants)({variant:"ghost",size:"icon-sm"})),children:(0,t.jsx)(i.ExternalLink,{})})]}),(0,t.jsx)("div",{className:(0,y.cn)("min-h-0 flex-1","frame"===p?"overflow-hidden":"overflow-auto"),children:w&&e?(0,t.jsx)(z,{path:e,kind:p,where:"dialog",takeKeys:!h},d):k?(0,t.jsx)("p",{className:"p-5 font-mono text-xs text-destructive",children:k}):null===v?(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"})]}):(0,t.jsx)(O,{kind:p,content:v,truncated:_})}),b&&f.length>1&&(0,t.jsx)("div",{className:"flex shrink-0 justify-center gap-1.5 border-t border-border/60 p-2.5",children:f.map(n=>(0,t.jsx)("button",{type:"button","aria-label":n.split("/").pop(),onClick:()=>g?.(n),className:(0,y.cn)("size-11 shrink-0 overflow-hidden rounded-md outline-none focus-visible:ring-3 focus-visible:ring-ring/50",n===e?"ring-2 ring-foreground":"opacity-55"),children:(0,t.jsx)(l.default,{src:s.queryKey.file(n),alt:"",width:96,height:96,loading:"lazy",className:"size-full bg-muted object-cover"})},n))})]})})}function L({text:e,className:n}){return(0,t.jsx)("pre",{className:(0,y.cn)("overflow-x-auto font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-foreground/90",n),children:e})}function D({content:e,className:n}){let[r,...i]=(0,a.useMemo)(()=>(function(e){let t=[],n=[],r="",i=!1;for(let l=0;l<e.length;l++){let a=e[l];i?'"'===a&&'"'===e[l+1]?(r+='"',l++):'"'===a?i=!1:r+=a:'"'===a?i=!0:","===a?(n.push(r),r=""):"\n"===a||"\r"===a?("\r"===a&&"\n"===e[l+1]&&l++,n.push(r),t.push(n),n=[],r=""):r+=a}return(r.length||n.length)&&(n.push(r),t.push(n)),t.filter(e=>e.some(e=>e.trim()))})(e),[e]),l=(0,a.useMemo)(()=>(r??[]).map((e,t)=>i.some(e=>""!==(e[t]??"").trim())&&i.every(e=>{let n=(e[t]??"").trim();return""===n||/^[+-]?[\d,]*\.?\d+%?$/.test(n)})),[r,i]);return r?(0,t.jsx)("div",{className:(0,y.cn)("overflow-x-auto",n),children:(0,t.jsxs)(f.Table,{children:[(0,t.jsx)(f.TableHeader,{children:(0,t.jsx)(f.TableRow,{children:r.map((e,n)=>(0,t.jsx)(f.TableHead,{className:(0,y.cn)("whitespace-nowrap",l[n]&&"text-right"),children:e},`${n}-${e}`))})}),(0,t.jsx)(f.TableBody,{children:i.map((e,n)=>(0,t.jsx)(f.TableRow,{children:r.map((r,i)=>(0,t.jsx)(f.TableCell,{className:(0,y.cn)("whitespace-nowrap",l[i]&&"text-right tabular-nums"),children:e[i]??""},`${n}-${i}`))},`${n}-${e[0]??""}`))})]})}):(0,t.jsx)(L,{text:e,className:n})}e.s(["FileBody",0,O,"FileFrame",0,I,"FileLink",0,function({path:e,group:n,className:r,title:i,label:l,children:o}){let u=k(e),d=(0,a.useContext)(_),[c,f]=(0,v.useServerAction)(g);return(0,t.jsx)("button",{type:"button",disabled:f,title:i??e,"aria-label":l,className:r,onClick:()=>{"dialog"===u.how?d?d(u.path,n):window.open(s.queryKey.fileView(u.path),"_blank"):c(e)},children:o})},"FilePreview",0,function({path:e,bytes:n}){let r=(0,p.viewKindOf)(e),{content:i,failure:l,truncated:a}=R(j.has(r)||"none"===r?null:e);return"none"===r?(0,t.jsx)(T,{path:e}):("frame"===r||"image"===r)&&n>m.WORKSPACE_VIEW.elementMax?(0,t.jsx)($,{path:e,bytes:n}):j.has(r)?(0,t.jsx)(z,{path:e,kind:r,where:"preview"}):l?(0,t.jsx)("p",{className:"p-5 font-mono text-xs text-destructive",children:l}):null===i?(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"})]}):(0,t.jsx)(O,{kind:r,content:i,truncated:a})},"FileViewer",0,function({children:e}){let[n,r]=(0,a.useState)(null),i=(0,a.useRef)(0),l=(0,a.useCallback)((e,t=[],n=!1)=>r({path:e,group:t,byHer:n,n:++i.current}),[]);return(0,t.jsxs)(_,{value:l,children:[e,(0,t.jsx)(A,{path:n?.path??null,opening:n?.n??0,group:n?.group??[],kind:n?(0,p.viewKindOf)(n.path):"text",byHer:n?.byHer??!1,onPath:e=>r(t=>t&&{...t,path:e}),onClose:()=>r(null)})]})},"fileTarget",0,k,"useFileText",0,R,"useOpenFile",0,function(){let e=(0,a.useContext)(_);return(0,a.useCallback)((t,n=[],r=!1)=>{let i=k(t);return"os"!==i.how&&(e?(e(i.path,n,r),!0):null!==window.open(s.queryKey.fileView(i.path),"_blank"))},[e])}],621285)},616172,e=>{"use strict";var t=e.i(798120),n=e.i(41533);let r=e=>`text/${e}; charset=utf-8`,i={md:{kind:"markdown",mime:r("markdown")},markdown:{kind:"markdown",mime:r("markdown")},csv:{kind:"csv",mime:r("csv")},json:{kind:"json",mime:"application/json; charset=utf-8"},txt:{kind:"text",mime:r("plain")},log:{kind:"text",mime:r("plain")},html:{kind:"frame",mime:r("html")},htm:{kind:"frame",mime:r("html")},pdf:{kind:"frame",mime:"application/pdf"},png:{kind:"image",mime:"image/png"},jpg:{kind:"image",mime:"image/jpeg"},jpeg:{kind:"image",mime:"image/jpeg"},gif:{kind:"image",mime:"image/gif"},webp:{kind:"image",mime:"image/webp"},svg:{kind:"image",mime:"image/svg+xml"},mp3:{kind:"audio",mime:"audio/mpeg"},wav:{kind:"audio",mime:"audio/wav"},mp4:{kind:"video",mime:"video/mp4"},webm:{kind:"video",mime:"video/webm"},docx:{kind:"none",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},xlsx:{kind:"none",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},pptx:{kind:"none",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},css:{kind:"none",mime:r("css")},js:{kind:"none",mime:r("javascript")},woff2:{kind:"none",mime:"font/woff2"}},l=e=>e.split(".").pop()?.toLowerCase()??"",a=new Set(["css","js","woff2"]),s=Object.keys(i).filter(e=>!a.has(e)),o=RegExp(String.raw`(?<![\p{L}\p{N}_/:@%-])\/?(?:[\p{L}\p{N}_.@%-]+/)*[\p{L}\p{N}_@%-]+(?:\.[\p{L}\p{N}_-]+)*\.(?:${s.join("|")})\b`,"giu"),u=`${n.PATHS.workspace}/`,d=t.queryKey.file("");function c(e){let t=function(e){if(!e.startsWith(d))return e;let t=e.slice(d.length);try{return decodeURIComponent(t)}catch{return t}}(e.trim()),n=t.indexOf(u);return n>=0?t.slice(n+u.length)||null:t.startsWith("/")||/^[A-Za-z]:/.test(t)||t.split("/").includes("..")?null:t||null}let f=e=>e.startsWith(`${n.PATHS.artifacts}/`)&&["md","markdown","html","htm"].includes(l(e));e.s(["extensionOf",0,l,"leadFirst",0,function(e){let t=e.findIndex(f);return t>0?[e[t],...e.filter((e,n)=>n!==t)]:e},"pathsIn",0,function(e){let t=e.replace(/\b[a-z][\w+.-]*:\/\/\S+/gi," ").replace(/\b[a-z][\w+.-]+:(?=\/)/gi," "),n=new Set,r="";for(let[e]of t.matchAll(o)){let t=!e.includes("/"),i=function(e){let t=c(e);if(!t)return null;let[n,...r]=t.split("/");return r.length&&n.includes(".")?null:t}(t?r+e:e);t||(r=i?.slice(0,i.lastIndexOf("/")+1)??""),i&&n.add(i)}return[...n].slice(0,12)},"viewKindOf",0,e=>i[l(e)]?.kind??"none","workspaceRelative",0,c])},325633,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return h},defaultHead:function(){return c}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let l=e.r(555682),a=e.r(190809),s=e.r(843476),o=a._(e.r(271645)),u=l._(e.r(898879)),d=e.r(742732);function c(){return[(0,s.jsx)("meta",{charSet:"utf-8"},"charset"),(0,s.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===o.default.Fragment?e.concat(o.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}let m=["name","httpEquiv","charSet","itemProp"];function p(e){let t,n,r,i;return e.reduce(f,[]).reverse().concat(c().reverse()).filter((t=new Set,n=new Set,r=new Set,i={},e=>{let l=!0,a=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){a=!0;let n=e.key.slice(e.key.indexOf("$")+1);t.has(n)?l=!1:t.add(n)}switch(e.type){case"title":case"base":n.has(e.type)?l=!1:n.add(e.type);break;case"meta":for(let t=0,n=m.length;t<n;t++){let n=m[t];if(e.props.hasOwnProperty(n))if("charSet"===n)r.has(n)?l=!1:r.add(n);else{let t=e.props[n],r=i[n]||new Set;("name"!==n||!a)&&r.has(t)?l=!1:(r.add(t),i[n]=r)}}}return l})).reverse().map((e,t)=>{let n=e.key||t;return o.default.cloneElement(e,{key:n})})}let h=function({children:e}){let t=(0,o.useContext)(d.HeadManagerContext);return(0,s.jsx)(u.default,{reduceComponentsToState:p,headManager:t,children:e})};("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},918556,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"ImageConfigContext",{enumerable:!0,get:function(){return l}});let r=e.r(555682)._(e.r(271645)),i=e.r(987690),l=r.default.createContext(i.imageConfigDefault)},65856,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"RouterContext",{enumerable:!0,get:function(){return r}});let r=e.r(555682)._(e.r(271645)).default.createContext(null)},670965,(e,t,n)=>{"use strict";function r(e,t){let n=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-n)<Math.abs(e-n)?t:e,t.qualities[0]):n}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"findClosestQuality",{enumerable:!0,get:function(){return r}})},1948,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return a}});let r=e.r(670965),i=e.r(543369);function l({config:e,src:t,width:n,quality:a}){let s=(0,i.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//"))if(t.includes("/_next/static/immutable")&&!(0,i.getAssetToken)())s=void 0;else{let e=t.indexOf("?");if(-1!==e){let n=new URLSearchParams(t.slice(e+1)),r=n.get("dpl");if(r){s=r,n.delete("dpl");let i=n.toString();t=t.slice(0,e)+(i?"?"+i:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,947627,e=>{"use strict";var t=e.i(843476),n=e.i(647163);e.s(["Table",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,t.jsx)("table",{"data-slot":"table",className:(0,n.cn)("w-full caption-bottom text-sm",e),...r})})},"TableBody",0,function({className:e,...r}){return(0,t.jsx)("tbody",{"data-slot":"table-body",className:(0,n.cn)("[&_tr:last-child]:border-0",e),...r})},"TableCell",0,function({className:e,...r}){return(0,t.jsx)("td",{"data-slot":"table-cell",className:(0,n.cn)("p-2 align-middle [&:has([role=checkbox])]:pr-0",e),...r})},"TableHead",0,function({className:e,...r}){return(0,t.jsx)("th",{"data-slot":"table-head",className:(0,n.cn)("h-9 px-2 text-left align-middle font-mono text-[11px] font-normal tracking-[0.1em] whitespace-nowrap text-muted-foreground uppercase [&:has([role=checkbox])]:pr-0",e),...r})},"TableHeader",0,function({className:e,...r}){return(0,t.jsx)("thead",{"data-slot":"table-header",className:(0,n.cn)("[&_tr]:border-b",e),...r})},"TableRow",0,function({className:e,...r}){return(0,t.jsx)("tr",{"data-slot":"table-row",className:(0,n.cn)("border-b border-border/60 transition-colors data-[state=selected]:bg-muted hover:bg-muted/40",e),...r})}])},621285,357553,837012,e=>{"use strict";var t=e.i(843476),n=e.i(24071),r=e.i(867927),i=e.i(482022),l=e.i(657688),a=e.i(271645),s=e.i(798120),o=e.i(167881),u=e.i(630374),d=e.i(683408),c=e.i(671428),f=e.i(947627),m=e.i(41533),p=e.i(616172),h=e.i(95187);let g=(0,h.createServerReference)("7fe61c424a192eff8b33705563234528ffd3439904",h.callServer,void 0,h.findSourceMapURL,"openFileAction");e.s(["openFileAction",0,g],357553);let x=(0,h.createServerReference)("7fb306c03a36ba57f08b97ce0197e84dfde019688e",h.callServer,void 0,h.findSourceMapURL,"revealFileAction");e.s(["revealFileAction",0,x],837012);let b=(0,h.createServerReference)("7f4457235d7fbf5ecbfad58feb9d9f75eb0f89ccec",h.callServer,void 0,h.findSourceMapURL,"savePageAction");var w=e.i(393080),v=e.i(609856),y=e.i(647163);let j=new Set(["frame","image","audio","video"]);function k(e){let t=(0,p.workspaceRelative)(e);return t?"none"===(0,p.viewKindOf)(t)?{how:"os"}:{how:"dialog",path:t}:{how:"os"}}let _=(0,a.createContext)(null),S={dialog:{prose:"px-5 py-4",block:"px-4 py-3"},page:{prose:"px-5 py-6 sm:px-8",block:"px-5 py-5"},inline:{prose:"pb-3",block:"pb-3"}};function O({kind:e,content:n,truncated:r,where:i="dialog"}){return(0,t.jsxs)(t.Fragment,{children:[null!=r&&(0,t.jsx)(C,{of:r}),(0,t.jsx)(P,{kind:e,content:n,where:i})]})}function C({of:e}){return(0,t.jsxs)("p",{className:"border-b border-border/60 px-5 py-2.5 font-mono text-[11px] text-muted-foreground",children:[`Showing the first ${(0,y.formatBytes)(m.WORKSPACE_VIEW.textMax)} of ${(0,y.formatBytes)(e)}. `,"Open the file itself for the rest."]})}function P({kind:e,content:n,where:r}){let i=S[r];switch(e){case"markdown":return(0,t.jsx)("div",{className:(0,y.cn)("min-w-0 text-sm leading-relaxed",i.prose),children:(0,t.jsx)(d.Markdown,{children:n})});case"csv":return(0,t.jsx)(D,{content:n,className:i.block});case"json":return(0,t.jsx)(L,{text:function(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}(n),className:i.block});default:return(0,t.jsx)(L,{text:n,className:i.block})}}function R(e){let[t,n]=(0,a.useState)(null),[r,i]=(0,a.useState)(null),[l,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e)return;n(null),i(null),o(null);let t=!1;return fetch(s.queryKey.file(e),{headers:{range:`bytes=0-${m.WORKSPACE_VIEW.textMax-1}`}}).then(async e=>{if(!e.ok)throw Error(await e.text());return{text:await e.text(),of:function(e){let t=e.headers.get("content-range")?.match(/^bytes \d+-(\d+)\/(\d+)$/);if(!t)return null;let[,n,r]=t.map(Number);return n+1<r?r:null}(e)}}).then(({text:e,of:r})=>{t||(n(null===r?e:e.slice(0,e.lastIndexOf("\n")+1||void 0)),o(r))}).catch(e=>!t&&i((0,y.errorToString)(e))),()=>{t=!0}},[e]),{content:t,failure:r,truncated:l}}let N={named:new Map,opened:new Map,showing:new WeakMap,listening:!1},E=e=>{let t=N.named.get(e);return t||(t=crypto.randomUUID(),N.named.set(e,t),N.opened.set(t,e)),{thursday:"host",as:t}};async function M(e){let t=e.source,n=e.data;if(!t||"null"!==e.origin||"string"!=typeof n?.thursday)return;if("hello"===n.thursday){let e=N.showing.get(t);e&&t.postMessage(E(e),"*");return}let r="save"===n.thursday&&N.opened.get(n.as);if(!r||"string"!=typeof n.html)return;let i=await b(r,n.html,"string"==typeof n.base?n.base:""),l={as:n.as,id:n.id};t.postMessage((0,w.isResultOk)(i)?i.data.changed?{...l,thursday:"not-saved",changed:!0}:{...l,thursday:"saved",revision:i.data.revision}:{...l,thursday:"not-saved",error:i.message},"*")}function I({path:e,className:n,takeKeys:r}){let i=(0,a.useRef)(null),l=(0,a.useCallback)(()=>{r&&i.current?.focus();let t=i.current?.contentWindow;t&&(N.showing.set(t,e),t.postMessage(E(e),"*"))},[e,r]);return(0,a.useEffect)(l,[l]),(0,a.useEffect)(()=>{N.listening||(N.listening=!0,window.addEventListener("message",M))},[]),(0,t.jsx)("iframe",{ref:i,title:e,src:s.queryKey.file(e),allow:"clipboard-read *; clipboard-write *; fullscreen *; autoplay *",className:n,onLoad:l})}function z({path:e,kind:n,where:r,takeKeys:i}){return"frame"===n?(0,t.jsx)(I,{path:e,className:"h-full w-full bg-white",takeKeys:i}):"image"===n?(0,t.jsx)("img",{src:s.queryKey.file(e),alt:e,className:"dialog"===r?"mx-auto max-h-[calc(100vh-11rem)] object-contain p-4":"mx-auto max-w-full p-6"}):"audio"===n?(0,t.jsx)("audio",{controls:!0,src:s.queryKey.file(e),className:"w-full p-6",children:(0,t.jsx)("track",{kind:"captions"})}):(0,t.jsx)("video",{controls:!0,src:s.queryKey.file(e),className:"mx-auto max-h-full max-w-full p-4",children:(0,t.jsx)("track",{kind:"captions"})})}function T({path:e}){let[n,r]=(0,v.useServerAction)(g);return(0,t.jsxs)("div",{className:"space-y-4 p-8",children:[(0,t.jsx)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:"Nothing here can draw this file. It opens in its own program."}),(0,t.jsx)(o.Button,{variant:"outline",loading:r,onClick:()=>n(e),children:"Open it"})]})}function $({path:e,bytes:n}){let[r,i]=(0,v.useServerAction)(x);return(0,t.jsxs)("div",{className:"space-y-4 p-8",children:[(0,t.jsxs)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:[`This file is ${(0,y.formatBytes)(n)} — too big to draw here without `,"taking the window with it. Open it where it is instead."]}),(0,t.jsx)(o.Button,{variant:"outline",loading:i,onClick:()=>r(e),children:"Reveal in the file manager"})]})}function A({path:e,opening:d,group:f=[],kind:p,byHer:h,onPath:g,onClose:x}){let b="image"===p,w=j.has(p),{content:v,failure:k,truncated:_}=R(w?null:e),S=e?.split("/").pop()??"",C=e?f.indexOf(e):-1,P=e=>{!(C<0)&&g&&g(f[(C+e+f.length)%f.length])},{left:N,keep:E}=function(e,t){let[n,r]=(0,a.useState)(null),i=(0,a.useRef)(t);i.current=t;let l=(0,a.useRef)(()=>void 0);return(0,a.useEffect)(()=>{if(!e)return void r(null);let t=Math.round(m.WORKSPACE_VIEW.autoCloseMs/1e3);r(t);let n=()=>{for(let e of(window.clearInterval(s),["pointermove","keydown","wheel","blur"]))window.removeEventListener(e,a);r(null)},a=()=>n(),s=window.setInterval(()=>{if((t-=1)>0)return r(t);n(),i.current()},1e3);for(let e of["pointermove","keydown","wheel","blur"])window.addEventListener(e,a);return l.current=n,n},[e]),{left:n,keep:(0,a.useCallback)(()=>l.current(),[])}}(h&&null!==e,x),M="frame"===p||"video"===p,I=(0,a.useRef)(null);return(0,t.jsx)(u.Dialog,{open:null!==e,onOpenChange:e=>!e&&x(),children:(0,t.jsxs)(u.DialogContent,{ref:I,initialFocus:I,onKeyDown:e=>{"ArrowLeft"===e.key&&P(-1),"ArrowRight"===e.key&&P(1)},onPointerOver:E,className:(0,y.cn)("flex flex-col gap-0 overflow-hidden p-0",M?"h-[min(42rem,calc(100vh-3rem))] sm:max-w-232":"max-h-[calc(100vh-3rem)] sm:max-w-4xl"),children:[(0,t.jsx)(u.DialogTitle,{className:"sr-only",children:S}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1 border-b border-border/60 py-2 pr-12 pl-4",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px]",children:e}),null!==N&&(0,t.jsx)("span",{className:"shrink-0 pr-1 font-mono text-[11px] text-muted-foreground tabular-nums",children:`Closing in ${N}s`}),C>=0&&f.length>1&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",children:[C+1," / ",f.length]}),(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm","aria-label":"Previous image",onClick:()=>P(-1),children:(0,t.jsx)(n.ChevronLeft,{})}),(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm","aria-label":"Next image",onClick:()=>P(1),children:(0,t.jsx)(r.ChevronRight,{})})]}),e&&(0,t.jsx)("a",{href:s.queryKey.fileView(e),target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",className:(0,y.cn)((0,o.buttonVariants)({variant:"ghost",size:"icon-sm"})),children:(0,t.jsx)(i.ExternalLink,{})})]}),(0,t.jsx)("div",{className:(0,y.cn)("min-h-0 flex-1","frame"===p?"overflow-hidden":"overflow-auto"),children:w&&e?(0,t.jsx)(z,{path:e,kind:p,where:"dialog",takeKeys:!h},d):k?(0,t.jsx)("p",{className:"p-5 font-mono text-xs text-destructive",children:k}):null===v?(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"})]}):(0,t.jsx)(O,{kind:p,content:v,truncated:_})}),b&&f.length>1&&(0,t.jsx)("div",{className:"flex shrink-0 justify-center gap-1.5 border-t border-border/60 p-2.5",children:f.map(n=>(0,t.jsx)("button",{type:"button","aria-label":n.split("/").pop(),onClick:()=>g?.(n),className:(0,y.cn)("size-11 shrink-0 overflow-hidden rounded-md outline-none focus-visible:ring-3 focus-visible:ring-ring/50",n===e?"ring-2 ring-foreground":"opacity-55"),children:(0,t.jsx)(l.default,{src:s.queryKey.file(n),alt:"",width:96,height:96,loading:"lazy",className:"size-full bg-muted object-cover"})},n))})]})})}function L({text:e,className:n}){return(0,t.jsx)("pre",{className:(0,y.cn)("overflow-x-auto font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-foreground/90",n),children:e})}function D({content:e,className:n}){let[r,...i]=(0,a.useMemo)(()=>(function(e){let t=[],n=[],r="",i=!1;for(let l=0;l<e.length;l++){let a=e[l];i?'"'===a&&'"'===e[l+1]?(r+='"',l++):'"'===a?i=!1:r+=a:'"'===a?i=!0:","===a?(n.push(r),r=""):"\n"===a||"\r"===a?("\r"===a&&"\n"===e[l+1]&&l++,n.push(r),t.push(n),n=[],r=""):r+=a}return(r.length||n.length)&&(n.push(r),t.push(n)),t.filter(e=>e.some(e=>e.trim()))})(e),[e]),l=(0,a.useMemo)(()=>(r??[]).map((e,t)=>i.some(e=>""!==(e[t]??"").trim())&&i.every(e=>{let n=(e[t]??"").trim();return""===n||/^[+-]?[\d,]*\.?\d+%?$/.test(n)})),[r,i]);return r?(0,t.jsx)("div",{className:(0,y.cn)("overflow-x-auto",n),children:(0,t.jsxs)(f.Table,{children:[(0,t.jsx)(f.TableHeader,{children:(0,t.jsx)(f.TableRow,{children:r.map((e,n)=>(0,t.jsx)(f.TableHead,{className:(0,y.cn)("whitespace-nowrap",l[n]&&"text-right"),children:e},`${n}-${e}`))})}),(0,t.jsx)(f.TableBody,{children:i.map((e,n)=>(0,t.jsx)(f.TableRow,{children:r.map((r,i)=>(0,t.jsx)(f.TableCell,{className:(0,y.cn)("whitespace-nowrap",l[i]&&"text-right tabular-nums"),children:e[i]??""},`${n}-${i}`))},`${n}-${e[0]??""}`))})]})}):(0,t.jsx)(L,{text:e,className:n})}e.s(["FileBody",0,O,"FileFrame",0,I,"FileLink",0,function({path:e,group:n,className:r,title:i,label:l,children:o}){let u=k(e),d=(0,a.useContext)(_),[c,f]=(0,v.useServerAction)(g);return(0,t.jsx)("button",{type:"button",disabled:f,title:i??e,"aria-label":l,className:r,onClick:()=>{"dialog"===u.how?d?d(u.path,n):window.open(s.queryKey.fileView(u.path),"_blank"):c(e)},children:o})},"FilePreview",0,function({path:e,bytes:n}){let r=(0,p.viewKindOf)(e),{content:i,failure:l,truncated:a}=R(j.has(r)||"none"===r?null:e);return"none"===r?(0,t.jsx)(T,{path:e}):("frame"===r||"image"===r)&&n>m.WORKSPACE_VIEW.elementMax?(0,t.jsx)($,{path:e,bytes:n}):j.has(r)?(0,t.jsx)(z,{path:e,kind:r,where:"preview"}):l?(0,t.jsx)("p",{className:"p-5 font-mono text-xs text-destructive",children:l}):null===i?(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"})]}):(0,t.jsx)(O,{kind:r,content:i,truncated:a})},"FileViewer",0,function({children:e}){let[n,r]=(0,a.useState)(null),i=(0,a.useRef)(0),l=(0,a.useCallback)((e,t=[],n=!1)=>r({path:e,group:t,byHer:n,n:++i.current}),[]);return(0,t.jsxs)(_,{value:l,children:[e,(0,t.jsx)(A,{path:n?.path??null,opening:n?.n??0,group:n?.group??[],kind:n?(0,p.viewKindOf)(n.path):"text",byHer:n?.byHer??!1,onPath:e=>r(t=>t&&{...t,path:e}),onClose:()=>r(null)})]})},"fileTarget",0,k,"useFileText",0,R,"useOpenFile",0,function(){let e=(0,a.useContext)(_);return(0,a.useCallback)((t,n=[],r=!1)=>{let i=k(t);return"os"!==i.how&&(e?(e(i.path,n,r),!0):null!==window.open(s.queryKey.fileView(i.path),"_blank"))},[e])}],621285)},616172,e=>{"use strict";var t=e.i(798120),n=e.i(41533);let r=e=>`text/${e}; charset=utf-8`,i={md:{kind:"markdown",mime:r("markdown")},markdown:{kind:"markdown",mime:r("markdown")},csv:{kind:"csv",mime:r("csv")},json:{kind:"json",mime:"application/json; charset=utf-8"},txt:{kind:"text",mime:r("plain")},log:{kind:"text",mime:r("plain")},html:{kind:"frame",mime:r("html")},htm:{kind:"frame",mime:r("html")},pdf:{kind:"frame",mime:"application/pdf"},png:{kind:"image",mime:"image/png"},jpg:{kind:"image",mime:"image/jpeg"},jpeg:{kind:"image",mime:"image/jpeg"},gif:{kind:"image",mime:"image/gif"},webp:{kind:"image",mime:"image/webp"},svg:{kind:"image",mime:"image/svg+xml"},mp3:{kind:"audio",mime:"audio/mpeg"},wav:{kind:"audio",mime:"audio/wav"},mp4:{kind:"video",mime:"video/mp4"},webm:{kind:"video",mime:"video/webm"},docx:{kind:"none",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},xlsx:{kind:"none",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},pptx:{kind:"none",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},css:{kind:"none",mime:r("css")},js:{kind:"none",mime:r("javascript")},woff2:{kind:"none",mime:"font/woff2"}},l=e=>e.split(".").pop()?.toLowerCase()??"",a=new Set(["css","js","woff2"]),s=Object.keys(i).filter(e=>!a.has(e)),o=RegExp(String.raw`(?<![\p{L}\p{N}_/:@%-])\/?(?:[\p{L}\p{N}_.@%-]+/)*[\p{L}\p{N}_@%-]+(?:\.[\p{L}\p{N}_-]+)*\.(?:${s.join("|")})\b`,"giu"),u=`${n.PATHS.workspace}/`,d=t.queryKey.file("");function c(e){let t=function(e){if(!e.startsWith(d))return e;let t=e.slice(d.length);try{return decodeURIComponent(t)}catch{return t}}(e.trim()),n=t.indexOf(u);return n>=0?t.slice(n+u.length)||null:t.startsWith("/")||/^[A-Za-z]:/.test(t)||t.split("/").includes("..")?null:t||null}let f=e=>e.startsWith(`${n.PATHS.artifacts}/`)&&["md","markdown","html","htm"].includes(l(e));e.s(["extensionOf",0,l,"leadFirst",0,function(e){let t=e.findIndex(f);return t>0?[e[t],...e.filter((e,n)=>n!==t)]:e},"pathsIn",0,function(e){let t=e.replace(/\b[a-z][\w+.-]*:\/\/\S+/gi," ").replace(/\b[a-z][\w+.-]+:(?=\/)/gi," "),n=new Set,r="";for(let[e]of t.matchAll(o)){let t=!e.includes("/"),i=function(e){let t=c(e);if(!t)return null;let[n,...r]=t.split("/");return r.length&&n.includes(".")?null:t}(t?r+e:e);t||(r=i?.slice(0,i.lastIndexOf("/")+1)??""),i&&n.add(i)}return[...n].slice(0,12)},"viewKindOf",0,e=>i[l(e)]?.kind??"none","workspaceRelative",0,c])},325633,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return h},defaultHead:function(){return c}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let l=e.r(555682),a=e.r(190809),s=e.r(843476),o=a._(e.r(271645)),u=l._(e.r(898879)),d=e.r(742732);function c(){return[(0,s.jsx)("meta",{charSet:"utf-8"},"charset"),(0,s.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===o.default.Fragment?e.concat(o.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}let m=["name","httpEquiv","charSet","itemProp"];function p(e){let t,n,r,i;return e.reduce(f,[]).reverse().concat(c().reverse()).filter((t=new Set,n=new Set,r=new Set,i={},e=>{let l=!0,a=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){a=!0;let n=e.key.slice(e.key.indexOf("$")+1);t.has(n)?l=!1:t.add(n)}switch(e.type){case"title":case"base":n.has(e.type)?l=!1:n.add(e.type);break;case"meta":for(let t=0,n=m.length;t<n;t++){let n=m[t];if(e.props.hasOwnProperty(n))if("charSet"===n)r.has(n)?l=!1:r.add(n);else{let t=e.props[n],r=i[n]||new Set;("name"!==n||!a)&&r.has(t)?l=!1:(r.add(t),i[n]=r)}}}return l})).reverse().map((e,t)=>{let n=e.key||t;return o.default.cloneElement(e,{key:n})})}let h=function({children:e}){let t=(0,o.useContext)(d.HeadManagerContext);return(0,s.jsx)(u.default,{reduceComponentsToState:p,headManager:t,children:e})};("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},918556,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"ImageConfigContext",{enumerable:!0,get:function(){return l}});let r=e.r(555682)._(e.r(271645)),i=e.r(987690),l=r.default.createContext(i.imageConfigDefault)},65856,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"RouterContext",{enumerable:!0,get:function(){return r}});let r=e.r(555682)._(e.r(271645)).default.createContext(null)},670965,(e,t,n)=>{"use strict";function r(e,t){let n=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-n)<Math.abs(e-n)?t:e,t.qualities[0]):n}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"findClosestQuality",{enumerable:!0,get:function(){return r}})},1948,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return a}});let r=e.r(670965),i=e.r(543369);function l({config:e,src:t,width:n,quality:a}){let s=(0,i.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//"))if(t.includes("/_next/static/immutable")&&!(0,i.getAssetToken)())s=void 0;else{let e=t.indexOf("?");if(-1!==e){let n=new URLSearchParams(t.slice(e+1)),r=n.get("dpl");if(r){s=r,n.delete("dpl");let i=n.toString();t=t.slice(0,e)+(i?"?"+i:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
|
|
2
2
|
Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,configurable:!0});let o=(0,r.findClosestQuality)(a,e);return`${e.path}?url=${encodeURIComponent(t)}&w=${n}&q=${o}${t.startsWith("/")&&s?`&dpl=${s}`:""}`}l.__next_img_default=!0;let a=l},818581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return i}});let r=e.r(271645);function i(e,t){let n=(0,r.useRef)(null),i=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(n.current=l(e,r)),t&&(i.current=l(t,r))},[e,t])}function l(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},605500,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Image",{enumerable:!0,get:function(){return y}});let r=e.r(555682),i=e.r(190809),l=e.r(843476),a=i._(e.r(271645)),s=r._(e.r(174080)),o=r._(e.r(325633)),u=e.r(908927),d=e.r(987690),c=e.r(918556),f=e.r(65856),m=r._(e.r(1948)),p=e.r(818581),h={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[48,96,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function g(e,t,n,r,i,l,a){let s=e?.src;e&&e["data-loaded-src"]!==s&&(e["data-loaded-src"]=s,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&i(!0),n?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,i=!1;n.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>i,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{i=!0,t.stopPropagation()}})}r?.current&&r.current(e)}}))}function x(e){return a.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let b="u"<typeof window?a.useEffect:a.useLayoutEffect,w=(0,a.forwardRef)(({src:e,srcSet:t,sizes:n,height:r,width:i,decoding:s,className:o,style:u,fetchPriority:d,placeholder:c,loading:f,unoptimized:m,fill:h,onLoadRef:w,onLoadingCompleteRef:v,setBlurComplete:y,setShowAltText:j,sizesInput:k,onLoad:_,onError:S,...O},C)=>{let P=(0,a.useRef)(!1),R=(0,a.useRef)(null);b(()=>{let{current:e}=P,{current:t}=R;e||null===t||(S&&(t.src=t.src),t.complete&&g(t,c,w,v,y,m,k),P.current=!0)},[e,c,w,v,S,m,k]);let N=(0,p.useMergedRef)(C,R);return(0,l.jsx)("img",{...O,...x(d),loading:f,width:i,height:r,decoding:s,"data-nimg":h?"fill":"1",className:o,style:u,sizes:n,srcSet:t,src:e,ref:N,onLoad:e=>{g(e.currentTarget,c,w,v,y,m,k)},onError:e=>{j(!0),"empty"!==c&&y(!0),S&&S(e)}})});function v({isAppRouter:e,imgAttributes:t}){let n={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...x(t.fetchPriority)};return e&&s.default.preload?(s.default.preload(t.src,n),null):(0,l.jsx)(o.default,{children:(0,l.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...n},"__nimg-"+t.src+t.srcSet+t.sizes)})}let y=(0,a.forwardRef)((e,t)=>{let n=(0,a.useContext)(f.RouterContext),r=(0,a.useContext)(c.ImageConfigContext),i=(0,a.useMemo)(()=>{let e=h||r||d.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),n=e.deviceSizes.sort((e,t)=>e-t),i=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:n,qualities:i,localPatterns:"u"<typeof window?r?.localPatterns:e.localPatterns}},[r]),{onLoad:s,onLoadingComplete:o}=e,p=(0,a.useRef)(s);(0,a.useEffect)(()=>{p.current=s},[s]);let g=(0,a.useRef)(o);(0,a.useEffect)(()=>{g.current=o},[o]);let[x,b]=(0,a.useState)(!1),[y,j]=(0,a.useState)(!1),{props:k,meta:_}=(0,u.getImgProps)(e,{defaultLoader:m.default,imgConf:i,blurComplete:x,showAltText:y});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(w,{...k,unoptimized:_.unoptimized,placeholder:_.placeholder,fill:_.fill,onLoadRef:p,onLoadingCompleteRef:g,setBlurComplete:b,setShowAltText:j,sizesInput:e.sizes,ref:t}),_.preload?(0,l.jsx)(v,{isAppRouter:!n,imgAttributes:k}):null]})});("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},794909,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return d},getImageProps:function(){return u}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let l=e.r(555682),a=e.r(908927),s=e.r(605500),o=l._(e.r(1948));function u(e){let{props:t}=(0,a.getImgProps)(e,{defaultLoader:o.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[48,96,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,n]of Object.entries(t))void 0===n&&delete t[e];return{props:t}}let d=s.Image},657688,(e,t,n)=>{t.exports=e.r(794909)},488143,(e,t,n)=>{"use strict";function r({widthInt:e,heightInt:t,blurWidth:n,blurHeight:i,blurDataURL:l,objectFit:a}){let s=n?40*n:e,o=i?40*i:t,u=s&&o?`viewBox='0 0 ${s} ${o}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${u}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${u?"none":"contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${l}'/%3E%3C/svg%3E`}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},987690,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={VALID_LOADERS:function(){return l},imageConfigDefault:function(){return a}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let l=["default","imgix","cloudinary","akamai","custom"],a={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},908927,(e,t,n)=>{"use strict";e.i(247167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"getImgProps",{enumerable:!0,get:function(){return u}});let r=e.r(543369),i=e.r(488143),l=e.r(987690),a=["-moz-initial","fill","none","scale-down",void 0];function s(e){return void 0!==e.default}function o(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function u({src:e,sizes:t,unoptimized:n=!1,priority:d=!1,preload:c=!1,loading:f,className:m,quality:p,width:h,height:g,fill:x=!1,style:b,overrideSrc:w,onLoad:v,onLoadingComplete:y,placeholder:j="empty",blurDataURL:k,fetchPriority:_,decoding:S="async",layout:O,objectFit:C,objectPosition:P,lazyBoundary:R,lazyRoot:N,...E},M){var I;let z,T,$,{imgConf:A,showAltText:L,blurComplete:D,defaultLoader:F}=M,W=A||l.imageConfigDefault;if("allSizes"in W)z=W;else{let e=[...W.deviceSizes,...W.imageSizes].sort((e,t)=>e-t),t=W.deviceSizes.sort((e,t)=>e-t),n=W.qualities?.sort((e,t)=>e-t);z={...W,allSizes:e,deviceSizes:t,qualities:n}}if(void 0===F)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let K=E.loader||F;delete E.loader,delete E.srcSet;let q="__next_img_default"in K;if(q){if("custom"===z.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop.
|
|
3
3
|
Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=K;K=t=>{let{config:n,...r}=t;return e(r)}}if(O){"fill"===O&&(x=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[O];e&&(b={...b,...e});let n={responsive:"100vw",fill:"100vw"}[O];n&&!t&&(t=n)}let B="",U=o(h),V=o(g);if((I=e)&&"object"==typeof I&&(s(I)||void 0!==I.src)){let t=s(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(T=t.blurWidth,$=t.blurHeight,k=k||t.blurDataURL,B=t.src,!x)if(U||V){if(U&&!V){let e=U/t.width;V=Math.round(t.height*e)}else if(!U&&V){let e=V/t.height;U=Math.round(t.width*e)}}else U=t.width,V=t.height}let H=!d&&!c&&("lazy"===f||void 0===f);(!(e="string"==typeof e?e:B)||e.startsWith("data:")||e.startsWith("blob:"))&&(n=!0,H=!1),z.unoptimized&&(n=!0),q&&!z.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(n=!0);let G=o(p),X=Object.assign(x?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:C,objectPosition:P}:{},L?{}:{color:"transparent"},b),J=D||"empty"===j?null:"blur"===j?`url("data:image/svg+xml;charset=utf-8,${(0,i.getImageBlurSvg)({widthInt:U,heightInt:V,blurWidth:T,blurHeight:$,blurDataURL:k||"",objectFit:X.objectFit})}")`:`url("${j}")`,Q=a.includes(X.objectFit)?"fill"===X.objectFit?"100% 100%":"cover":X.objectFit,Y=J?{backgroundSize:Q,backgroundPosition:X.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:J}:{},Z=function({config:e,src:t,unoptimized:n,width:i,quality:l,sizes:a,loader:s}){if(n){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,r.getDeploymentId)();if(t.includes("/_next/static/immutable")&&!(0,r.getAssetToken)())e=void 0;else if(e){let n=t.indexOf("?");if(-1!==n){let r=new URLSearchParams(t.slice(n+1));r.get("dpl")||(r.append("dpl",e),t=t.slice(0,n)+"?"+r.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:o,kind:u}=function({deviceSizes:e,allSizes:t},n,r){if(r){let n=/(^|\s)(1?\d?\d)vw/g,i=[];for(let e;e=n.exec(r);)i.push(parseInt(e[2]));if(i.length){let n=.01*Math.min(...i);return{widths:t.filter(t=>t>=e[0]*n),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof n?{widths:e,kind:"w"}:{widths:[...new Set([n,2*n].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,i,a),d=o.length-1;return{sizes:a||"w"!==u?a:"100vw",srcSet:o.map((n,r)=>`${s({config:e,src:t,quality:l,width:n})} ${"w"===u?n:r+1}${u}`).join(", "),src:s({config:e,src:t,quality:l,width:o[d]})}}({config:z,src:e,unoptimized:n,width:U,quality:G,sizes:t,loader:K}),ee=H?"lazy":f;return{props:{...E,loading:ee,fetchPriority:_,width:U,height:V,decoding:S,className:m,style:{...X,...Y},sizes:Z.sizes,srcSet:Z.srcSet,src:w||Z.src},meta:{unoptimized:n,preload:c||d,placeholder:j,fill:x}}}},898879,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return s}});let r=e.r(271645),i="u"<typeof window,l=i?()=>{}:r.useLayoutEffect,a=i?()=>{}:r.useEffect;function s(e){let{headManager:t,reduceComponentsToState:n}=e;function s(){if(t&&t.mountedInstances){let e=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(n(e))}}return i&&(t?.mountedInstances?.add(e.children),s()),l(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),l(()=>(t&&(t._pendingUpdate=s),()=>{t&&(t._pendingUpdate=s)})),a(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}}]);
|
|
@@ -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)("7f590fa54250fddb87269a4f5a54396ec76abfcbe6",$.callServer,void 0,$.findSourceMapURL,"createSkillAction"),A=(0,$.createServerReference)("7f2fdd3ac62b5d70d08e3c5e090531b4f5363b8e8f",$.callServer,void 0,$.findSourceMapURL,"deleteSkillAction"),B=(0,$.createServerReference)("7fb905eb5033cd99f340dce1c0f0be4e14dfbe67ad",$.callServer,void 0,$.findSourceMapURL,"setSkillDisabledAction"),q=(0,$.createServerReference)("7fd72c8e2441652e9bd6fb9fc5f4bc8764beb41c26",$.callServer,void 0,$.findSourceMapURL,"uploadSkillAction"),I=(0,$.createServerReference)("7fa043625880da0524e8c5b598ede9093c93084d27",$.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 U=e=>"custom"===e||e.startsWith("own:"),E=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:E,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:()=>(0,t.jsx)(G,{skill:s})})},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"}),U(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}){let[s,i]=(0,k.useState)(""),[l,r]=(0,k.useState)("SKILL.md"),a=(0,k.useRef)(!1),o=async e=>{let t=s?`${s}/${e.name}`:e.name;"dir"===e.kind?i(t):t===l||(!a.current||await z.notify.confirm({title:"Discard your changes?",description:`What you wrote in ${l?.split("/").pop()} is not saved.`,okText:"Discard",destructive:!0}))&&(a.current=!1,r(t))};return(0,t.jsx)(T.SettingDialogContent,{title:e.name,description:(0,t.jsx)(Y,{skill:e,path:l??s}),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:[s&&(0,t.jsxs)("button",{type:"button",onClick:()=>i(s.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:s.split("/").pop()})]}),(0,t.jsx)(J,{source:e.source,dir:e.dir,path:s,current:l,onPick:o})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 overflow-y-auto",children:l?(0,t.jsx)(X,{source:e.source,dir:e.dir,path:l,editable:U(e.source),onUnsaved:e=>{a.current=e}},l):(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})=>(0,t.jsx)(et,{onDone:e})})}function et({onDone:e}){let[s,i]=(0,k.useState)("write"),[n,l]=(0,k.useState)(""),[r,a]=(0,k.useState)(""),[o,d]=(0,k.useState)(""),[c,u]=(0,k.useState)(null),[m,f]=(0,k.useState)(!1),h=(0,k.useRef)(null),p={errorMessage:!1,onOk:()=>{(0,W.revalidate)(j.queryKey.skills),e()}},[g,v,,S]=(0,P.useServerAction)(D,p),[z,C,,L]=(0,P.useServerAction)(q,p),$=v||C,A="write"===s?S:L,B=null!==c&&c.size>R.SKILL_FILES.uploadBytes,I=Math.round(R.SKILL_FILES.uploadBytes/1024/1024),K=!$&&("write"===s?n.trim()&&r.trim()&&o.trim():null!==c&&!B),U=async()=>{if(!K)return;if("write"===s)return void g({name:n.trim(),description:r.trim(),content:o});if(!c)return;let e=new FormData;e.append("file",c),z(e)},E=e=>{let t=e?.[0]??null;t&&u(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:!K,loading:$,onClick:U,children:[!$&&("write"===s?(0,t.jsx)(x.Plus,{}):(0,t.jsx)(b,{})),"write"===s?"Create":"Upload"]})]}),children:[(0,t.jsxs)(F.Tabs,{value:s,onValueChange:e=>i(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:n,onChange:e=>l(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,"/",n.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:r,onChange:e=>a(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:o,onChange:e=>d(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:()=>h.current?.click(),onDragOver:e=>{e.preventDefault(),f(!0)},onDragLeave:()=>f(!1),onDrop:e=>{e.preventDefault(),f(!1),E(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",m?"border-foreground/60 bg-muted/60":"border-border hover:bg-muted/40"),children:[(0,t.jsx)(b,{className:"size-5 text-muted-foreground"}),c?(0,t.jsxs)("span",{className:"text-sm",children:[c.name,(0,t.jsxs)("span",{className:(0,_.cn)("ml-2 font-mono text-[11px]",B?"text-destructive":"text-muted-foreground"),children:[(0,_.formatBytes)(c.size),B&&` \xb7 over ${I} 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:h,type:"file",accept:".md,.zip,.skill",className:"hidden",onChange:e=>E(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 ",I," MB."]})]})]})]}),A&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:A})]})}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=>!U(e.source)).length," ","shipped ·"," ",r.filter(e=>U(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)("7f8c6a27dda5a5a057db303c9c7b7ac22b160582cc",$.callServer,void 0,$.findSourceMapURL,"createSkillAction"),A=(0,$.createServerReference)("7ff1c8aaa4c86bc64778174d7d295a2a5f2e317220",$.callServer,void 0,$.findSourceMapURL,"deleteSkillAction"),B=(0,$.createServerReference)("7fac04a74f473449ed3dca2203b5251c213b1a93f7",$.callServer,void 0,$.findSourceMapURL,"setSkillDisabledAction"),q=(0,$.createServerReference)("7f57e5c043e10df0ea091eeabc308690ca44a75c34",$.callServer,void 0,$.findSourceMapURL,"uploadSkillAction"),I=(0,$.createServerReference)("7fe99e84fa1cf393ca8b71774c6ecb56e5c3d8588f",$.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 U=e=>"custom"===e||e.startsWith("own:"),E=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:E,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:()=>(0,t.jsx)(G,{skill:s})})},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"}),U(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}){let[s,i]=(0,k.useState)(""),[l,r]=(0,k.useState)("SKILL.md"),a=(0,k.useRef)(!1),o=async e=>{let t=s?`${s}/${e.name}`:e.name;"dir"===e.kind?i(t):t===l||(!a.current||await z.notify.confirm({title:"Discard your changes?",description:`What you wrote in ${l?.split("/").pop()} is not saved.`,okText:"Discard",destructive:!0}))&&(a.current=!1,r(t))};return(0,t.jsx)(T.SettingDialogContent,{title:e.name,description:(0,t.jsx)(Y,{skill:e,path:l??s}),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:[s&&(0,t.jsxs)("button",{type:"button",onClick:()=>i(s.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:s.split("/").pop()})]}),(0,t.jsx)(J,{source:e.source,dir:e.dir,path:s,current:l,onPick:o})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 overflow-y-auto",children:l?(0,t.jsx)(X,{source:e.source,dir:e.dir,path:l,editable:U(e.source),onUnsaved:e=>{a.current=e}},l):(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})=>(0,t.jsx)(et,{onDone:e})})}function et({onDone:e}){let[s,i]=(0,k.useState)("write"),[n,l]=(0,k.useState)(""),[r,a]=(0,k.useState)(""),[o,d]=(0,k.useState)(""),[c,u]=(0,k.useState)(null),[m,f]=(0,k.useState)(!1),h=(0,k.useRef)(null),p={errorMessage:!1,onOk:()=>{(0,W.revalidate)(j.queryKey.skills),e()}},[g,v,,S]=(0,P.useServerAction)(D,p),[z,C,,L]=(0,P.useServerAction)(q,p),$=v||C,A="write"===s?S:L,B=null!==c&&c.size>R.SKILL_FILES.uploadBytes,I=Math.round(R.SKILL_FILES.uploadBytes/1024/1024),K=!$&&("write"===s?n.trim()&&r.trim()&&o.trim():null!==c&&!B),U=async()=>{if(!K)return;if("write"===s)return void g({name:n.trim(),description:r.trim(),content:o});if(!c)return;let e=new FormData;e.append("file",c),z(e)},E=e=>{let t=e?.[0]??null;t&&u(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:!K,loading:$,onClick:U,children:[!$&&("write"===s?(0,t.jsx)(x.Plus,{}):(0,t.jsx)(b,{})),"write"===s?"Create":"Upload"]})]}),children:[(0,t.jsxs)(F.Tabs,{value:s,onValueChange:e=>i(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:n,onChange:e=>l(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,"/",n.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:r,onChange:e=>a(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:o,onChange:e=>d(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:()=>h.current?.click(),onDragOver:e=>{e.preventDefault(),f(!0)},onDragLeave:()=>f(!1),onDrop:e=>{e.preventDefault(),f(!1),E(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",m?"border-foreground/60 bg-muted/60":"border-border hover:bg-muted/40"),children:[(0,t.jsx)(b,{className:"size-5 text-muted-foreground"}),c?(0,t.jsxs)("span",{className:"text-sm",children:[c.name,(0,t.jsxs)("span",{className:(0,_.cn)("ml-2 font-mono text-[11px]",B?"text-destructive":"text-muted-foreground"),children:[(0,_.formatBytes)(c.size),B&&` \xb7 over ${I} 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:h,type:"file",accept:".md,.zip,.skill",className:"hidden",onChange:e=>E(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 ",I," MB."]})]})]})]}),A&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:A})]})}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=>!U(e.source)).length," ","shipped ·"," ",r.filter(e=>U(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)}]);
|