thursday-agent 0.3.0 → 0.4.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.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/artifact/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/task/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/task/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/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.nft.json +1 -1
- package/.next/server/app/api/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/route.js.nft.json +1 -1
- package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
- 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/page/server-reference-manifest.json +40 -40
- package/.next/server/app/page.js +2 -2
- 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]__02va5wz._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0ls6_8y._.js +4 -4
- package/.next/server/chunks/[root-of-the-server]__0ncs9uu._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1-ga0kh._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__1anc1p9._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1ccon1w._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__1orn-5b._.js +4 -3
- package/.next/server/chunks/[root-of-the-server]__1wa1k7r._.js +3 -3
- package/.next/server/chunks/_0-fjql4._.js +5 -5
- package/.next/server/chunks/_00xh_q0._.js +3 -5
- package/.next/server/chunks/_05h2cii._.js +1 -1
- package/.next/server/chunks/_0fzqt2y._.js +48 -44
- package/.next/server/chunks/_0mecv0f._.js +5 -5
- package/.next/server/chunks/_0mh8j4m._.js +1 -1
- package/.next/server/chunks/_0wp4le3._.js +1 -1
- package/.next/server/chunks/_0y5fg-x._.js +1 -1
- package/.next/server/chunks/_1230wbx._.js +3 -3
- package/.next/server/chunks/_15hq89o._.js +1 -1
- package/.next/server/chunks/{_03kp0jp._.js → _1c78vw5._.js} +58 -56
- package/.next/server/chunks/_1j8k_j5._.js +1 -1
- package/.next/server/chunks/_1krd9rf._.js +1 -1
- package/.next/server/chunks/_1php4eq._.js +1 -1
- package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
- package/.next/server/chunks/features_1qf3cei._.js +1 -1
- package/.next/server/chunks/features_memory_1uqvksn._.js +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__092knlj._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__1eh7hid._.js → [root-of-the-server]__0s9dq5u._.js} +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__1cyjywu._.js → [root-of-the-server]__0s9l2sv._.js} +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__0zkv7z_._.js → [root-of-the-server]__0xsog8n._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__10-dz5o._.js +13 -9
- package/.next/server/chunks/ssr/[root-of-the-server]__1gtlw6v._.js +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__1mzi-ju._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1ox7hbk._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__0_69wqr._.js → [root-of-the-server]__202p40z._.js} +1 -1
- package/.next/server/chunks/ssr/_001_ms1._.js +1 -1
- package/.next/server/chunks/ssr/{_0c-ql2m._.js → _0fz4mf_._.js} +2 -2
- package/.next/server/chunks/ssr/{_07uchnc._.js → _0gb4gmf._.js} +2 -2
- package/.next/server/chunks/ssr/_0i_6q1w._.js +2 -2
- package/.next/server/chunks/ssr/{_20kd_n0._.js → _0ilna52._.js} +3 -3
- package/.next/server/chunks/ssr/{_0mo2w06._.js → _0n3toaw._.js} +2 -2
- package/.next/server/chunks/ssr/{_0mb8zc8._.js → _0s99bgb._.js} +2 -2
- package/.next/server/chunks/ssr/_0zcjrbg._.js +3 -0
- package/.next/server/chunks/ssr/{_13z3f85._.js → _1-_etts._.js} +2 -2
- package/.next/server/chunks/ssr/_13fke0x._.js +1 -1
- package/.next/server/chunks/ssr/{_01_6m32._.js → _1b2mjwr._.js} +2 -2
- package/.next/server/chunks/ssr/{_1eoqg_g._.js → _1f-dg-6._.js} +2 -2
- package/.next/server/chunks/ssr/{_0y0tiht._.js → _1fojd41._.js} +3 -3
- package/.next/server/chunks/ssr/_1gd8q8l._.js +3 -0
- package/.next/server/chunks/ssr/{_1xvgn77._.js → _1h0rw11._.js} +2 -2
- package/.next/server/chunks/ssr/_1jhd09t._.js +3 -0
- package/.next/server/chunks/ssr/{_0u2jv_x._.js → _1lz_cq2._.js} +46 -44
- package/.next/server/chunks/ssr/{_0kbkmar._.js → _1nnsk7z._.js} +2 -2
- package/.next/server/chunks/ssr/_1sji22n._.js +1 -1
- package/.next/server/chunks/ssr/_1vyd1ji._.js +1 -1
- package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +1 -1
- package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
- package/.next/server/chunks/ssr/{node_modules_0z5tsu8._.js → node_modules_00etblx._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1h4a4pp._.js → node_modules_04jf_m8._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0h5hnr1._.js → node_modules_08dhkiq._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1vqb6po._.js → node_modules_0940ns5._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1i7u1ia._.js → node_modules_09q35v_._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_124bue5._.js → node_modules_0_-_a--._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0h7u60n._.js → node_modules_0arus10._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0rjg6t1._.js → node_modules_0b__sgl._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_113tz0l._.js → node_modules_0cxaxk9._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0lm7_vm._.js → node_modules_0g7fzk3._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0h50b8n._.js → node_modules_0had7xd._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1-hc6uv._.js → node_modules_0pvd7q-._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1bc7gu8._.js → node_modules_0yugy6m._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0y_cded._.js → node_modules_14om4ar._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0zp9r92._.js → node_modules_14q6g4n._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0eu1va6._.js → node_modules_198nmll._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1t9cyee._.js → node_modules_1_pc9kq._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_063xwpp._.js → node_modules_1aaxuef._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0bvraul._.js → node_modules_1cx_ql6._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1xx28h1._.js → node_modules_1cz2hle._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1l0qtdu._.js → node_modules_1efrqxi._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1juq3hs._.js → node_modules_1eg7m6c._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1_n3ztw._.js → node_modules_1gdh31p._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0mwym0g._.js → node_modules_1hpopmo._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1bgb6-f._.js → node_modules_1qpjvy5._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1uuj9x1._.js → node_modules_1vh5ntv._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0d3skpl._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1b748ic._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0i44kk5._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1z4hm5e._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@vercel_oidc_dist_0qe30a_._.js → node_modules_@vercel_oidc_dist_06mk8id._.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 +41 -41
- package/.next/static/chunks/00rd4-v8r7axp.js +1 -0
- package/.next/static/chunks/{0tmgrnlje14-s.js → 08qe4as2q428z.js} +2 -2
- package/.next/static/chunks/{3ok9_x74rip3v.js → 0fl3gwe4-l6tz.js} +1 -1
- package/.next/static/chunks/{2a0k6jlq0_v1u.js → 0gnqdjn2lvdad.js} +2 -2
- package/.next/static/chunks/{1okqiww3pnwka.js → 0hwap1-p0m5sa.js} +1 -1
- package/.next/static/chunks/{1ekc7ul556kbl.js → 0w52rrrmuj9r9.js} +1 -1
- package/.next/static/chunks/{3agpgkwaa321p.js → 0wcprt5ot5she.js} +1 -1
- package/.next/static/chunks/{3xpbkl66ssib5.js → 15m575979un5f.js} +6 -6
- package/.next/static/chunks/{2fzs9fm8yarvq.js → 17p6tk6k88dq6.js} +1 -1
- package/.next/static/chunks/{26-pr2c9ro222.js → 1jd09sxcjddu1.js} +1 -1
- package/.next/static/chunks/{280t0_e99i276.js → 1w73ece_6bheu.js} +1 -1
- package/.next/static/chunks/{1grhjo7a5a0_-.js → 214ya3n5gxeih.js} +1 -1
- package/.next/static/chunks/22_zkas21rpna.js +1 -0
- package/.next/static/chunks/{0x79tx04dxbpp.js → 2u7xt6mxg44lf.js} +1 -1
- package/.next/static/chunks/{17donp69y4do7.js → 39j0fvpybzabl.js} +8 -8
- package/.next/static/chunks/{28cizcdaabd4h.js → 3akmqm77muj4-.js} +1 -1
- package/.next/static/chunks/3cq5g494yuke8.css +1 -0
- package/.next/static/chunks/3woj-xd7ki5_i.js +1 -0
- package/.next/static/chunks/{3cfi_q6d_wtci.js → 3zmcsnuo25zvq.js} +1 -1
- package/README.md +46 -23
- package/app/api/events/app-event.ts +0 -2
- package/bin/port.mjs +65 -0
- package/bin/thursday.mjs +2 -33
- package/docs/how-it-works.md +11 -7
- package/docs/images/face-dark.png +0 -0
- package/docs/images/face-light.png +0 -0
- package/docs/images/keeps-going.png +0 -0
- package/features/ai/chatgpt.ts +42 -20
- package/features/ai/load-tools.ts +20 -14
- package/features/ai/prompts/bot.prompt.ts +90 -88
- package/features/ai/prompts/thursday.prompt.ts +48 -41
- package/features/ai/tools/memory.tool.ts +65 -62
- package/features/ai/tools/tool-name.ts +0 -1
- package/features/ai/tools/workspace.tool.ts +3 -0
- package/features/bot/bot.action.ts +6 -1
- package/features/bot/bot.run.ts +11 -7
- package/features/bot/bot.runner.ts +34 -16
- package/features/bot/bot.schema.ts +25 -0
- package/features/bot/components/bot-room.tsx +57 -4
- package/features/bot/components/bot-tool.tsx +0 -1
- package/features/bot/task.query.ts +25 -6
- package/features/bot/task.store.ts +23 -4
- package/features/memory/components/memory-edit.tsx +7 -5
- package/features/thursday/components/thursday.tsx +0 -3
- package/features/thursday/tool-line.ts +0 -1
- package/features/thursday/use-thursday.ts +1 -1
- package/package.json +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1pduf5n._.js +0 -3
- package/.next/server/chunks/ssr/_14_lw10._.js +0 -3
- package/.next/server/chunks/ssr/_1spzm8z._.js +0 -3
- package/.next/server/chunks/ssr/lib_date-like_ts_02is0pw._.js +0 -3
- package/.next/static/chunks/0xzgvc0fkdb6t.js +0 -1
- package/.next/static/chunks/14hgtsjg-kael.css +0 -1
- package/.next/static/chunks/2hw2f6zmt7fmt.js +0 -1
- package/.next/static/chunks/3111pj5wnjgos.js +0 -1
- package/features/memory/components/memory-view.tsx +0 -84
- /package/.next/static/{x1cCqY0kWpR_VcYx_lWO5 → kaTO0UHqF1bMnWgCDik2f}/_buildManifest.js +0 -0
- /package/.next/static/{x1cCqY0kWpR_VcYx_lWO5 → kaTO0UHqF1bMnWgCDik2f}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{x1cCqY0kWpR_VcYx_lWO5 → kaTO0UHqF1bMnWgCDik2f}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,519029,e=>{"use strict";var t=e.i(843476),n=e.i(647163);function s({color:e,picked:r,onPick:l}){return(0,t.jsx)("button",{type:"button",onClick:l,"aria-label":e??"Follow the theme",style:e?{backgroundColor:e}:void 0,className:(0,n.cn)("size-5 rounded-full outline-none transition-transform hover:scale-110 focus-visible:ring-3 focus-visible:ring-ring/50",!e&&"bg-foreground",r&&"ring-2 ring-foreground/40 ring-offset-2 ring-offset-background")})}var r=e.i(864723);e.s(["MarkPalette",0,function({color:e,themePicked:n,onTheme:l,onPick:a}){return(0,t.jsx)("div",{className:"flex justify-center px-2",children:(0,t.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(s,{color:null,picked:n,onPick:l}),(0,t.jsx)("span",{className:"w-2"}),r.MARK_PALETTE_ROWS[0].map(n=>(0,t.jsx)(s,{color:n,picked:e===n,onPick:()=>a(n)},n))]}),(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 pl-11",children:r.MARK_PALETTE_ROWS[1].map(n=>(0,t.jsx)(s,{color:n,picked:e===n,onPick:()=>a(n)},n))})]})})}],519029)},59158,e=>{"use strict";var t=e.i(843476),n=e.i(689664),s=e.i(466787),r=e.i(271645),l=e.i(798120),a=e.i(167881),i=e.i(736185),o=e.i(23750),c=e.i(917162),d=e.i(421429),u=e.i(184762),h=e.i(41533),m=e.i(968978),x=e.i(265402),f=e.i(519029),p=e.i(864723),g=e.i(895836),v=e.i(867927),j=e.i(456420);let b={name:"phone",size:24,node:[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]};b.node;let y=(0,j.default)(b);var k=e.i(759659),S=e.i(660302),N=e.i(671428),w=e.i(222055),C=e.i(245629),A=e.i(609856),E=e.i(661504),T=e.i(647163),R=e.i(95187);let _=(0,R.createServerReference)("7fa0f05df10fadbdbc32f656a9d5c05cd146302f7a",R.callServer,void 0,R.findSourceMapURL,"deleteCallAction"),I=(0,R.createServerReference)("7fe2a2ec036940cdf16482cfbd7aecf01f5571fe5a",R.callServer,void 0,R.findSourceMapURL,"deleteEndedCallsAction");var M=e.i(561540),K=e.i(256604);function O(){return(0,t.jsx)(g.SettingGroup,{label:"Transcripts",children:(0,t.jsx)(g.SettingItems,{children:(0,t.jsxs)("button",{type:"button",onClick:()=>c.notify.component({className:"sm:max-w-3xl",renderer:()=>(0,t.jsx)(g.SettingDialogContent,{title:"Call history",description:"Everything said on the line, oldest at the top. Scroll up for older calls.",children:(0,t.jsx)(D,{})})}),className:"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)(y,{className:"size-4"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsx)("span",{className:"block text-sm font-medium",children:"Call history"}),(0,t.jsx)("span",{className:"block text-xs text-muted-foreground",children:"Every call, word for word — hers and yours"})]}),(0,t.jsx)(v.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground"})]})})})}let P={running:"working",waiting:"waiting on you",done:"done",failed:"failed"},z={running:"text-muted-foreground",waiting:T.WAITING_INK,done:"text-muted-foreground",failed:"text-destructive"},L="h-[min(34rem,58vh)] min-h-64 px-1";function D(){let{items:e,isLoading:n,isLoadingMore:s,error:i,hasMore:o,sentinelRef:d,refresh:u}=(0,E.useServerPages)({key:(e,t)=>{if(0===e)return l.queryKey.callHistory(null);let n=t?.at(-1);return n?l.queryKey.callHistory((0,C.toDate)(n.startedAt).toISOString()):null},size:h.CALL_HISTORY_PAGE,swr:{revalidateOnFocus:!1}}),m=(0,r.useMemo)(()=>[...e].reverse(),[e]),[x,f]=(0,A.useServerAction)(I,{okMessage:e=>1===e?"1 call deleted":`${e} calls deleted`,onOk:u}),p=async()=>{await c.notify.confirm({title:"Delete every call?",description:"Every turn of every call goes — and she stops reading any of it back into the next call. A call still on the line stays.",okText:"Delete all",destructive:!0})&&x()},v=(0,r.useRef)(null),j=(0,r.useRef)(!1),b=(0,r.useRef)(0);return((0,r.useLayoutEffect)(()=>{let e=v.current;e&&0!==m.length&&(j.current?e.scrollTop=e.scrollHeight-b.current:(j.current=!0,e.scrollTop=e.scrollHeight),b.current=e.scrollHeight-e.scrollTop)},[m]),n)?(0,t.jsx)("div",{className:(0,T.cn)(L,"overflow-hidden"),children:(0,t.jsx)(F,{})}):i?(0,t.jsx)(g.SettingError,{message:i.message}):(0,t.jsx)(t.Fragment,{children:0===m.length?(0,t.jsx)("p",{className:"px-1 text-sm leading-relaxed text-muted-foreground",children:"No calls yet. Everything said on the line is kept here — hers and yours, in the order it was said."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{ref:v,onScroll:e=>{let t=e.currentTarget;b.current=t.scrollHeight-t.scrollTop},className:(0,T.cn)(L,"overflow-y-auto overscroll-contain pb-6"),children:[(0,t.jsx)(g.SettingMore,{hasMore:o,loading:s,sentinelRef:d,count:1,ghost:(0,t.jsx)(F,{})}),m.map((e,n)=>(0,t.jsx)($,{call:e,first:0===n,onDropped:u},e.id))]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(a.Button,{variant:"ghost",loading:f,onClick:p,className:"text-muted-foreground hover:text-destructive",children:[(0,t.jsx)(k.Trash2,{}),"Delete all"]})})]})})}function F(){return(0,t.jsxs)("div",{className:"pb-3",children:[(0,t.jsxs)("div",{className:"flex h-7 items-center gap-2.5",children:[(0,t.jsx)(N.Skeleton,{className:"h-3 w-24"}),(0,t.jsx)(N.Skeleton,{className:"h-3 w-10"})]}),(0,t.jsx)("div",{className:"mt-2 mb-[18px] h-px bg-border/60"}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(N.Skeleton,{className:"h-9 w-3/5 rounded-2xl rounded-br-sm"})}),(0,t.jsxs)("div",{className:"mt-3 flex items-start gap-2",children:[(0,t.jsx)(N.Skeleton,{className:"mt-0.5 size-[18px] shrink-0 rounded-full"}),(0,t.jsx)(N.Skeleton,{className:"mt-1 h-3.5 w-2/3"})]})]})}let H=e=>"user"===e.role?"user":"her";function $({call:e,first:n,onDropped:s}){let[r,l]=(0,A.useServerAction)(_,{okMessage:"Call deleted",onOk:s}),i=(0,C.toDate)(e.startedAt),o=e.turns.at(-1),d=e.endedAt&&o?function(e,t){let n=Math.max(0,Math.round((t.getTime()-e.getTime())/1e3));if(n<60)return`${n}s`;let s=Math.floor(n/60);return s<60?`${s}m ${String(n%60).padStart(2,"0")}s`:`${Math.floor(s/60)}h ${String(s%60).padStart(2,"0")}m`}(i,(0,C.toDate)(o.at)):"on the line",u=async()=>{await c.notify.confirm({title:`Delete the call from ${(0,C.whenOf)(i)}?`,description:"Every turn of it goes — and she stops reading it back into the next call.",okText:"Delete",destructive:!0})&&r(e.id)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:(0,T.cn)("group flex items-center gap-2.5",n?"mt-1":"mt-11"),children:[(0,t.jsx)("span",{title:`${e.provider} \xb7 ${e.model}`,className:"font-mono text-[10px] tracking-[0.14em] uppercase",children:(0,C.whenOf)(i)}),(0,t.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:d}),(0,t.jsx)("span",{className:"ml-auto flex size-7 shrink-0 items-center justify-center",children:e.endedAt&&(0,t.jsx)(a.Button,{size:"icon-sm",variant:"ghost",loading:l,"aria-label":"Delete this call",onClick:u,className:"text-muted-foreground/60 opacity-0 transition-opacity group-hover:opacity-100 hover:text-destructive focus-visible:opacity-100",children:(0,t.jsx)(k.Trash2,{})})})]}),(0,t.jsx)("div",{className:"mt-2 mb-[18px] h-px bg-border/60"}),(function(e){let t=[];for(let n of e){let e=t.at(-1);if(e&&"tool"===n.role&&"tool"===e.turn.role&&e.turn.tool===n.tool&&e.turn.text===n.text){e.repeats+=1;continue}t.push({turn:n,repeats:1})}return t})(e.turns).map(({turn:n,repeats:s},r,l)=>{var a,i;let o,c=l[r-1]?.turn,d=l[r+1]?.turn;return(0,t.jsx)(G,{turn:n,job:(a=e,i=n,(o=(0,M.delegatedLabel)(i.tool,i.text))?a.jobs.find(e=>e.label===o):void 0),repeats:s,opensRun:!c||H(c)!==H(n),closesRun:!d||H(d)!==H(n)},n.id)})]})}function G({turn:e,job:n,opensRun:s,closesRun:r,repeats:l=1}){return"tool"===e.role?(0,t.jsx)(V,{turn:e,job:n,repeats:l,opensRun:s}):"user"===e.role?(0,t.jsx)("div",{className:(0,T.cn)("flex justify-end",s?"mt-3":"mt-1"),children:(0,t.jsx)("p",{className:(0,T.cn)("max-w-[min(34rem,78%)] rounded-2xl bg-muted px-3.5 py-2 text-[13.5px] leading-relaxed break-keep whitespace-pre-wrap",r&&"rounded-br-sm"),children:e.text})}):(0,t.jsxs)("div",{className:(0,T.cn)("flex items-start gap-2",s?"mt-3":"mt-1"),children:[(0,t.jsx)(B,{face:s,className:"mt-0.5"}),(0,t.jsx)("p",{className:"max-w-[min(34rem,78%)] text-[13.5px] leading-relaxed break-keep whitespace-pre-wrap",children:e.text})]})}function B({face:e,className:n}){return(0,t.jsx)("span",{className:(0,T.cn)("grid size-[18px] shrink-0 place-items-center",n),children:e&&(0,t.jsx)(K.ThursdayMark,{size:18})})}function V({turn:e,job:n,repeats:s,opensRun:r}){let l=e.tool??"",a=(0,w.toolIcon)(l),i=(0,M.toolLine)(l,e.text);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:(0,T.cn)("flex items-center gap-2",r?"mt-3":"mt-1.5"),children:[(0,t.jsx)(B,{face:r}),(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-muted-foreground",children:[(0,t.jsx)(a,{className:"size-3 shrink-0"}),i&&(0,t.jsx)("span",{className:"truncate text-[11px] break-keep",children:i}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/60",children:l}),s>1&&(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:["×",s]})]})]}),n&&(0,t.jsxs)("p",{className:"mt-0.5 ml-[26px] flex min-w-0 items-baseline gap-1.5 text-[11px]",children:["running"===n.status?(0,t.jsx)(S.ShinyText,{text:P.running,className:"shrink-0 font-mono text-[10px]"}):(0,t.jsx)("span",{className:(0,T.cn)("shrink-0 font-mono text-[10px]",z[n.status]),children:P[n.status]}),n.outcome&&"running"!==n.status&&(0,t.jsx)("span",{className:"truncate text-muted-foreground",children:(0,T.plainText)(n.outcome)})]})]})}var W=e.i(333495),U=e.i(933916),q=e.i(762074);let Y=(0,R.createServerReference)("7f50cfd7d0e623e886552f9994a05a234251f6b400",R.callServer,void 0,R.findSourceMapURL,"resetHistoryAction"),X=(0,R.createServerReference)("7fb326617fb6fe0d74f20b79af1e912238def02960",R.callServer,void 0,R.findSourceMapURL,"setCallSkillsAction");var Z=e.i(671228),J=e.i(67045),Q=e.i(698570),ee=e.i(319841),et=e.i(981203),en=e.i(283653);function es(){let{data:e}=(0,en.useServerRoute)(l.queryKey.callSkills),[n]=(0,A.useServerAction)(X,{onOk:()=>(0,en.revalidate)(l.queryKey.callSkills)});return(0,t.jsx)(g.SettingGroup,{label:"Skills",children:(0,t.jsx)(g.SettingToggle,{label:"Read a skill herself",description:"A skill is how a thing is done here, written down. On, she opens one mid-call and follows it; off, only bots read them.",checked:e??!1,disabled:void 0===e,onChange:e=>n(e),children:(0,t.jsx)(er,{})})})}function er(){let{data:e}=(0,en.useServerRoute)(l.queryKey.skills);return e?(0,t.jsx)(g.SettingNote,{className:(0,T.cn)(!e.length&&T.WAITING_INK),children:e.length?`The same ${e.length} a bot reads. Each one she opens spends a page of the call on it.`:"Nothing installed yet — there is nothing for her to read."}):null}function el(){let[e,n]=(0,A.useServerAction)(Y,{okMessage:({calls:e,tasks:t,notes:n})=>`Wiped ${e} calls, ${t} jobs, ${n} notes`,onOk:()=>{(0,en.revalidate)(l.queryKey.memory),(0,en.revalidate)(l.queryKey.tasks),(0,en.revalidate)(l.queryKey.callHistory(null))}}),r=async()=>{await c.notify.confirm({title:"Reset history?",description:"Every call, every job and everything she remembers is deleted for good. Keys, bots and connectors stay.",okText:"Reset",destructive:!0})&&e()};return(0,t.jsx)(g.SettingGroup,{label:"Danger zone",note:"Keys, bots and connectors stay.",children:(0,t.jsx)(g.SettingItems,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",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)(s.TriangleAlert,{className:"size-4"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsx)("span",{className:"block text-sm font-medium",children:"Reset history"}),(0,t.jsx)("span",{className:"block text-xs text-muted-foreground",children:"Every call, every job and everything she remembers"})]}),(0,t.jsx)(a.Button,{variant:"outline",size:"sm",loading:n,onClick:r,className:"shrink-0 text-destructive hover:text-destructive",children:"Reset"})]})})})}function ea({value:e,onChange:n}){let s=t=>n({...e,...t});return(0,t.jsx)(g.SettingGroup,{label:"Face",children:(0,t.jsxs)("div",{className:"space-y-5 py-2",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 pt-2",children:[(0,t.jsx)(W.Face,{look:e,size:176,className:"w-44"}),(0,t.jsx)(d.Segmented,{"aria-label":"Face",options:U.FACE_KINDS.map(e=>({value:e,label:W.FACES[e].label})),value:e.kind,onChange:e=>s({kind:e})}),(0,t.jsx)("p",{className:"max-w-sm text-center text-xs text-muted-foreground",children:W.FACES[e.kind].hint})]}),"mark"===e.kind&&(0,t.jsx)(f.MarkPalette,{color:e.color,themePicked:!e.color,onTheme:()=>s({color:void 0}),onPick:e=>s({color:e})}),"mark"===e.kind&&(0,t.jsx)(eo,{label:"Shape",children:(0,t.jsx)(d.Segmented,{"aria-label":"Shape",options:p.MARK_SHAPES.map(e=>({value:e,label:(0,t.jsx)("span",{className:"capitalize",children:e})})),value:e.shape??"blob",onChange:e=>s({shape:e})})}),"mark"===e.kind&&(0,t.jsx)(eo,{label:"Style",children:(0,t.jsx)(d.Segmented,{"aria-label":"Style",options:[{value:"solid",label:"Solid"},{value:"outline",label:"Outline"}],value:e.outline?"outline":"solid",onChange:e=>s({outline:"outline"===e||void 0})})}),"ascii"===e.kind&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eo,{label:"Glyphs",children:(0,t.jsx)(d.Segmented,{"aria-label":"Glyphs",options:U.ASCII_CHARSETS.map(e=>({value:e,label:ei[e]})),value:e.charset,onChange:e=>s({charset:e})})}),(0,t.jsx)(eo,{label:"Size",children:(0,t.jsx)(ec,{min:h.ASCII_FACE.fontSize.min,max:h.ASCII_FACE.fontSize.max,step:1,value:e.fontSize,format:e=>`${e}px`,onChange:e=>s({fontSize:e})})}),(0,t.jsx)(eo,{label:"Density",children:(0,t.jsx)(ec,{min:h.ASCII_FACE.density.min,max:h.ASCII_FACE.density.max,step:.1,value:e.density,format:e=>`${e.toFixed(1)}x`,onChange:e=>s({density:e})})})]})]})})}let ei={ascii:"Characters",emoji:"Sprinkled",emojiOnly:"All emoji"};function eo({label:e,children:n}){return(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"w-16 shrink-0 font-mono text-[11px] text-muted-foreground",children:e}),n]})}function ec({value:e,onChange:n,format:s,...r}){return(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsx)("input",{type:"range",...r,value:e,onChange:e=>n(Number(e.target.value)),className:"min-w-0 flex-1 accent-foreground"}),(0,t.jsx)("span",{className:"w-10 shrink-0 text-right font-mono text-[11px] text-muted-foreground tabular-nums",children:s(e)})]})}function ed({provider:e,value:r,hasKey:l,onPick:a}){let o=!!r,c=r?.voice??e.defaultVoice,d=r?.model??"";return(0,t.jsxs)("div",{className:(0,T.cn)("p-4",o&&"bg-muted/40"),children:[(0,t.jsxs)("button",{type:"button",disabled:o,onClick:()=>a({voice:null,model:null}),className:"flex w-full items-center gap-3 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-default",children:[(0,t.jsx)(m.ProviderIcon,{provider:e.id,className:"size-4 shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsx)("span",{className:"block truncate text-sm font-medium",children:e.label}),(0,t.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:d||e.models[0].id})]}),l?o&&(0,t.jsx)(n.Check,{className:"size-4 shrink-0"}):(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:[(0,t.jsx)(s.TriangleAlert,{className:"size-3"}),"No key"]})]}),o&&(0,t.jsxs)("div",{className:"space-y-3 pt-3",children:[(0,t.jsx)(i.Combobox,{value:d,onChange:e=>a({voice:r?.voice??null,model:e||null}),options:e.models.map(e=>({value:e.id,label:e.label,hint:e.id})),"aria-label":`${e.label} realtime model`,placeholder:e.models[0].id,empty:"Not on the list — it still runs"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.voices.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>a({voice:e,model:r?.model??null}),className:(0,T.cn)("rounded-full border px-2.5 py-1 font-mono text-[11px] transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ring/50",e===c?"border-foreground/40 text-foreground":"border-border/60 text-muted-foreground hover:text-foreground"),children:e},e))})]})]})}let eu={center:{label:"Her last line",hint:"One caption under the mark — only what she said."},sides:{label:"Last three turns",hint:"Hers on the left, yours on the right, beside the mark."}};function eh({value:e,onChange:n}){return(0,t.jsx)(g.SettingGroup,{label:"Calls you",note:"off"!==e&&"Needs this tab open. A tab that has been silent since it loaded may not be allowed to make a sound — the desktop notification covers that.",children:(0,t.jsx)(g.SettingChoiceRows,{options:Z.CALL_BACK_MODES.map(e=>({value:e,label:Z.CALL_BACK_LABEL[e],hint:em[e]})),value:e,onChange:n})})}let em={off:"Nothing opens a call but you.",waiting:"A job that stopped to ask gets her to ring you.",any:"Anything a bot finishes, she opens a line to tell you."};function ex({value:e,onChange:n}){return(0,t.jsx)(g.SettingGroup,{label:"Captions",children:(0,t.jsx)(g.SettingChoiceRows,{options:Z.CAPTION_VIEWS.map(e=>({value:e,label:eu[e].label,hint:eu[e].hint})),value:e,onChange:n})})}function ef({value:e,onChange:n}){let s=(0,Q.useDraft)(e.phrase,t=>n({...e,phrase:t}),{min:Z.WAKE_PHRASE.min}),r=s.value.trim().split(/\s+/).length<2;return(0,t.jsx)(g.SettingGroup,{label:"Wake",children:(0,t.jsx)(g.SettingToggle,{label:"Answer to her name",description:"Between calls, the browser listens for the phrase below and picks up when it hears it.",checked:e.enabled,onChange:t=>n({...e,enabled:t}),children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.Input,{value:s.value,maxLength:Z.WAKE_PHRASE.max,spellCheck:!1,onChange:e=>s.set(e.target.value),onBlur:s.commit,onKeyDown:s.onKeyDown,"aria-label":"Wake phrase",className:"font-mono text-sm"}),(0,t.jsx)(g.SettingNote,{children:r?"One word will wake her by accident — say hello first.":"Heard loosely, in English. Near misses count."})]})})})}function ep({value:e,onChange:n}){let[s,l]=(0,r.useState)(!1),[a,i]=(0,r.useState)(!1),o=(0,ee.useHotkeyLabel)((0,ee.isCombo)(e.combo)?e.combo:null);return(0,t.jsx)(g.SettingGroup,{label:"Shortcut",children:(0,t.jsx)(g.SettingToggle,{label:"Answer to a key",description:"With this tab in front, the key below starts a call — and ends the one that is running.",checked:e.enabled,onChange:t=>n({...e,enabled:t}),children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("button",{type:"button",...ee.HOTKEY_CAPTURE,onClick:()=>{i(!1),l(!0)},onBlur:()=>l(!1),onKeyDown:s?t=>{if("Tab"===t.key)return;if(t.preventDefault(),t.stopPropagation(),"Escape"===t.key)return l(!1);let s=(0,ee.comboOf)(t.nativeEvent);if(!s)return i(!0);i(!1),l(!1),n({...e,combo:s})}:void 0,className:(0,T.cn)("w-full rounded-lg border px-3 py-2 font-mono text-sm outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",s?"border-foreground/40 text-muted-foreground":"border-border/60 hover:bg-muted/50"),children:s?"Press the keys…":o??"Set a shortcut"}),(0,t.jsx)(g.SettingNote,{children:a?"Hold Ctrl, Alt or Cmd — a plain key is typing.":s?"Esc to keep the one you have.":"Only while this tab has focus. Not while you are typing."})]})})})}function eg({value:e,onSave:n}){let[s,l]=(0,r.useState)(e);return(0,t.jsx)(g.SettingGroup,{label:"Instructions",right:`${s.length}/${et.COMMON_VALIDATE.prompt.max}`,children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(u.Textarea,{value:s,maxLength:et.COMMON_VALIDATE.prompt.max,onChange:e=>l(e.target.value),placeholder:"Anything else she should know before the first word — how to address you, what to skip.",className:"min-h-28"}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(a.Button,{size:"sm",disabled:s===e,onClick:()=>n(s),children:"Save"})})]})})}e.s(["ThursdaySetting",0,function(){let e=(0,J.useThursdayStore)(),n=(0,J.useThursdayStore)(e=>e.patch),{data:s=[],isLoading:r,error:a}=(0,en.useServerRoute)(l.queryKey.llmModel),i=(0,q.useThursdayFace)();if(r)return(0,t.jsx)(g.SettingSkeleton,{rows:4});if(a)return(0,t.jsx)(g.SettingError,{message:a.message});let o=e.model?.provider??null;return(0,t.jsxs)(g.SettingScreen,{footer:(0,t.jsx)(g.SettingRailNote,{children:"Her prompt is assembled fresh on every call — memory, the roster and your skills go in."}),children:[(0,t.jsx)(ea,{value:i,onChange:q.setThursdayFace}),(0,t.jsx)(O,{}),(0,t.jsx)(g.SettingGroup,{label:"Voice",note:!o&&"Nothing picked — calls run on whichever key is set.",children:(0,t.jsx)(g.SettingItems,{children:x.SPEACH_MODEL_PROVIDER_LIST.map(r=>{let l;return(0,t.jsx)(ed,{provider:r,value:o===r.id?e.model:null,hasKey:(l=r.apiKeyName,s.some(e=>e.apiKeyName===l&&e.hasKey)),onPick:e=>n({model:{provider:r.id,...e}})},r.id)})})}),(0,t.jsx)(ex,{value:e.captionView,onChange:e=>n({captionView:e})}),(0,t.jsx)(ef,{value:e.wake,onChange:e=>n({wake:e})}),(0,t.jsx)(eh,{value:e.callBack,onChange:e=>n({callBack:e})}),(0,t.jsx)(ep,{value:e.hotkey,onChange:e=>n({hotkey:e})}),(0,t.jsx)(es,{}),(0,t.jsx)(eg,{value:e.systemPrompt??"",onSave:e=>n({systemPrompt:e})}),(0,t.jsx)(el,{})]})}],59158)},698570,e=>{"use strict";var t=e.i(271645);e.s(["useDraft",0,function(e,n,{min:s=1}={}){let[r,l]=(0,t.useState)(e),[a,i]=(0,t.useState)(e);return e!==a&&(i(e),l(e)),{value:r,set:l,commit:()=>{let t=r.trim();if(t.length<s)return l(e);l(t),t!==e&&n(t)},onKeyDown:e=>{"Enter"!==e.key||e.nativeEvent.isComposing||e.currentTarget.blur()}}}])},661504,e=>{"use strict";var t=e.i(271645),n=e.i(699018),s=e.i(677309),r=e.i(271235),l=e.i(802239),a=e.i(646192);let i=Promise.resolve(),o=(0,r.withMiddleware)(n.u,e=>(n,r,o)=>{let c,d=(0,t.useRef)(!1),{cache:u,initialSize:h=1,revalidateAll:m=!1,persistSize:x=!1,revalidateFirstPage:f=!0,revalidateOnMount:p=!1,parallel:g=!1}=o,[,,,v]=s.a.get(s.o);try{(c=(0,s.s)(n?n(0,null):null)[0])&&(c=a.INFINITE_PREFIX+c)}catch(e){}let[j,b,y]=(0,s.c)(u,c),k=(0,t.useCallback)(()=>(0,s.i)(j()._l)?h:j()._l,[u,c,h]);(0,l.useSyncExternalStore)((0,t.useCallback)(e=>c?y(c,()=>{e()}):()=>{},[u,c]),k,k);let S=(0,t.useCallback)(()=>{let e=j()._l;return(0,s.i)(e)?h:e},[c,h]),N=(0,t.useRef)(S());(0,s.u)(()=>{if(!d.current){d.current=!0;return}c&&b({_l:x?N.current:S()})},[c,u]);let w=p&&!d.current,C=e(c,async e=>{let t=j()._i,l=j()._r,a=s.a.get(u),i=a[8],c=()=>a[8]!==i;b({_r:s.U});let d=[],h=S(),[x]=(0,s.c)(u,e),p=x().data,y=[],k=null;for(let e=0;e<h;++e){let[a,i]=(0,s.s)(n(e,g?null:k));if(!a)break;let[h,x]=(0,s.c)(u,a),j=h().data,b=m||t||(0,s.i)(j)||f&&!e&&!(0,s.i)(p)||w||p&&!(0,s.i)(p[e])&&!o.compare(p[e],j);if(r&&("function"==typeof l?l(j,i):b)){let t=async()=>{if(a in v){let e=v[a];delete v[a],j=await e}else j=await r(i);c()||x({data:j,_k:i}),d[e]=j};g?y.push(t):await t()}else d[e]=j;g||(k=j)}return g&&await Promise.all(y.map(e=>e())),c()||b({_i:s.U}),d},o),A=(0,t.useCallback)(function(e,t){let n="boolean"==typeof t?{revalidate:t}:t||{},r=!1!==n.revalidate;return c?(r&&((0,s.i)(e)?b({_i:!0,_r:n.revalidate}):b({_i:!1,_r:n.revalidate})),arguments.length?C.mutate(e,{...n,revalidate:r}):C.mutate()):i},[c,u]),E=(0,t.useCallback)(e=>{let t;if(!c)return i;let[,r]=(0,s.c)(u,c);if((0,s.e)(e)?t=e(S()):"number"==typeof e&&(t=e),"number"!=typeof t)return i;r({_l:t}),N.current=t;let l=[],[a]=(0,s.c)(u,c),o=null;for(let e=0;e<t;++e){let[t]=(0,s.s)(n(e,o)),[r]=(0,s.c)(u,t),i=t?r().data:s.U;if((0,s.i)(i))return A(a().data);l.push(i),o=i}return A(l)},[c,u,A,S]);return{size:S(),setSize:E,mutate:A,get data(){return C.data},get error(){return C.error},get isValidating(){return C.isValidating},get isLoading(){return C.isLoading}}});var c=e.i(41533),d=e.i(283653);e.s(["useServerPages",0,function(e){let n=e.size??c.PAGE_SIZE,{key:s}=e,{data:r,error:l,isLoading:a,isValidating:i,setSize:u,mutate:h}=o((e,t)=>(0,d.resolveKey)(s(e,t)),d.fetchRoute,{dedupingInterval:500,revalidateOnMount:!0,revalidateOnFocus:!0,revalidateOnReconnect:!0,focusThrottleInterval:1e3,revalidateFirstPage:!1,...e.swr}),m=r??[],x=m.flat(),f=m.at(-1),p=void 0!==f&&f.length>=n,g=(0,t.useRef)(0),v=i&&m.length>0&&g.current>m.length,j=(0,t.useRef)({isValidating:i,setSize:u,pages:m.length});j.current={isValidating:i,setSize:u,pages:m.length};let b=(0,d.resolveKey)(s(0,null)),y="string"==typeof b?b:b?.url;(0,t.useEffect)(()=>{if(y)return(0,d.registerPagedReader)({url:y,refresh:()=>h()})},[y,h]);let k=function(e,n={}){let{enabled:s=!0,margin:r="600px",revision:l}=n,a=(0,t.useRef)(e);a.current=e;let i=(0,t.useRef)(null),o=(0,t.useRef)(null),c=(0,t.useCallback)(e=>{i.current=e},[]);return(0,t.useEffect)(()=>{o.current?.disconnect();let e=i.current;if(e&&s)return o.current=new IntersectionObserver(([e])=>{e.isIntersecting&&a.current()},{root:function(e){let t=e.parentElement;for(;t;){let{overflowY:e}=getComputedStyle(t);if(("auto"===e||"scroll"===e)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}(e),rootMargin:r}),o.current.observe(e),()=>o.current?.disconnect()},[s,r,l]),c}(()=>{let e=j.current;e.isValidating||(g.current=e.pages+1,e.setSize(e.pages+1))},{enabled:p,revision:`${m.length}:${i}`});return{items:x,isLoading:a,isLoadingMore:v,error:l,hasMore:p,sentinelRef:k,refresh:()=>h()}}],661504)},759659,e=>{"use strict";var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let s=(0,t.default)(n);e.s(["Trash2",0,s],759659)},466787,e=>{"use strict";var t=e.i(755566);e.s(["TriangleAlert",()=>t.default])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,519029,e=>{"use strict";var t=e.i(843476),n=e.i(647163);function s({color:e,picked:r,onPick:l}){return(0,t.jsx)("button",{type:"button",onClick:l,"aria-label":e??"Follow the theme",style:e?{backgroundColor:e}:void 0,className:(0,n.cn)("size-5 rounded-full outline-none transition-transform hover:scale-110 focus-visible:ring-3 focus-visible:ring-ring/50",!e&&"bg-foreground",r&&"ring-2 ring-foreground/40 ring-offset-2 ring-offset-background")})}var r=e.i(864723);e.s(["MarkPalette",0,function({color:e,themePicked:n,onTheme:l,onPick:a}){return(0,t.jsx)("div",{className:"flex justify-center px-2",children:(0,t.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(s,{color:null,picked:n,onPick:l}),(0,t.jsx)("span",{className:"w-2"}),r.MARK_PALETTE_ROWS[0].map(n=>(0,t.jsx)(s,{color:n,picked:e===n,onPick:()=>a(n)},n))]}),(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 pl-11",children:r.MARK_PALETTE_ROWS[1].map(n=>(0,t.jsx)(s,{color:n,picked:e===n,onPick:()=>a(n)},n))})]})})}],519029)},59158,e=>{"use strict";var t=e.i(843476),n=e.i(689664),s=e.i(466787),r=e.i(271645),l=e.i(798120),a=e.i(167881),i=e.i(736185),o=e.i(23750),c=e.i(917162),d=e.i(421429),u=e.i(184762),h=e.i(41533),m=e.i(968978),x=e.i(265402),p=e.i(519029),f=e.i(864723),g=e.i(895836),v=e.i(867927),b=e.i(456420);let j={name:"phone",size:24,node:[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]};j.node;let y=(0,b.default)(j);var k=e.i(759659),S=e.i(660302),N=e.i(671428),w=e.i(222055),C=e.i(245629),A=e.i(609856),E=e.i(661504),T=e.i(647163),R=e.i(95187);let _=(0,R.createServerReference)("7fc555b36b5925e2051ec959344746fb3809426d0d",R.callServer,void 0,R.findSourceMapURL,"deleteCallAction"),I=(0,R.createServerReference)("7f21d91d9d40f7a3f34d6c13a113858f03876152a7",R.callServer,void 0,R.findSourceMapURL,"deleteEndedCallsAction");var M=e.i(561540),K=e.i(256604);function O(){return(0,t.jsx)(g.SettingGroup,{label:"Transcripts",children:(0,t.jsx)(g.SettingItems,{children:(0,t.jsxs)("button",{type:"button",onClick:()=>c.notify.component({className:"sm:max-w-3xl",renderer:()=>(0,t.jsx)(g.SettingDialogContent,{title:"Call history",description:"Everything said on the line, oldest at the top. Scroll up for older calls.",children:(0,t.jsx)(D,{})})}),className:"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)(y,{className:"size-4"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsx)("span",{className:"block text-sm font-medium",children:"Call history"}),(0,t.jsx)("span",{className:"block text-xs text-muted-foreground",children:"Every call, word for word — hers and yours"})]}),(0,t.jsx)(v.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground"})]})})})}let P={running:"working",waiting:"waiting on you",done:"done",failed:"failed"},z={running:"text-muted-foreground",waiting:T.WAITING_INK,done:"text-muted-foreground",failed:"text-destructive"},L="h-[min(34rem,58vh)] min-h-64 px-1";function D(){let{items:e,isLoading:n,isLoadingMore:s,error:i,hasMore:o,sentinelRef:d,refresh:u}=(0,E.useServerPages)({key:(e,t)=>{if(0===e)return l.queryKey.callHistory(null);let n=t?.at(-1);return n?l.queryKey.callHistory((0,C.toDate)(n.startedAt).toISOString()):null},size:h.CALL_HISTORY_PAGE,swr:{revalidateOnFocus:!1}}),m=(0,r.useMemo)(()=>[...e].reverse(),[e]),[x,p]=(0,A.useServerAction)(I,{okMessage:e=>1===e?"1 call deleted":`${e} calls deleted`,onOk:u}),f=async()=>{await c.notify.confirm({title:"Delete every call?",description:"Every turn of every call goes — and she stops reading any of it back into the next call. A call still on the line stays.",okText:"Delete all",destructive:!0})&&x()},v=(0,r.useRef)(null),b=(0,r.useRef)(!1),j=(0,r.useRef)(0);return((0,r.useLayoutEffect)(()=>{let e=v.current;e&&0!==m.length&&(b.current?e.scrollTop=e.scrollHeight-j.current:(b.current=!0,e.scrollTop=e.scrollHeight),j.current=e.scrollHeight-e.scrollTop)},[m]),n)?(0,t.jsx)("div",{className:(0,T.cn)(L,"overflow-hidden"),children:(0,t.jsx)(F,{})}):i?(0,t.jsx)(g.SettingError,{message:i.message}):(0,t.jsx)(t.Fragment,{children:0===m.length?(0,t.jsx)("p",{className:"px-1 text-sm leading-relaxed text-muted-foreground",children:"No calls yet. Everything said on the line is kept here — hers and yours, in the order it was said."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{ref:v,onScroll:e=>{let t=e.currentTarget;j.current=t.scrollHeight-t.scrollTop},className:(0,T.cn)(L,"overflow-y-auto overscroll-contain pb-6"),children:[(0,t.jsx)(g.SettingMore,{hasMore:o,loading:s,sentinelRef:d,count:1,ghost:(0,t.jsx)(F,{})}),m.map((e,n)=>(0,t.jsx)($,{call:e,first:0===n,onDropped:u},e.id))]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(a.Button,{variant:"ghost",loading:p,onClick:f,className:"text-muted-foreground hover:text-destructive",children:[(0,t.jsx)(k.Trash2,{}),"Delete all"]})})]})})}function F(){return(0,t.jsxs)("div",{className:"pb-3",children:[(0,t.jsxs)("div",{className:"flex h-7 items-center gap-2.5",children:[(0,t.jsx)(N.Skeleton,{className:"h-3 w-24"}),(0,t.jsx)(N.Skeleton,{className:"h-3 w-10"})]}),(0,t.jsx)("div",{className:"mt-2 mb-[18px] h-px bg-border/60"}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(N.Skeleton,{className:"h-9 w-3/5 rounded-2xl rounded-br-sm"})}),(0,t.jsxs)("div",{className:"mt-3 flex items-start gap-2",children:[(0,t.jsx)(N.Skeleton,{className:"mt-0.5 size-[18px] shrink-0 rounded-full"}),(0,t.jsx)(N.Skeleton,{className:"mt-1 h-3.5 w-2/3"})]})]})}let H=e=>"user"===e.role?"user":"her";function $({call:e,first:n,onDropped:s}){let[r,l]=(0,A.useServerAction)(_,{okMessage:"Call deleted",onOk:s}),i=(0,C.toDate)(e.startedAt),o=e.turns.at(-1),d=e.endedAt&&o?function(e,t){let n=Math.max(0,Math.round((t.getTime()-e.getTime())/1e3));if(n<60)return`${n}s`;let s=Math.floor(n/60);return s<60?`${s}m ${String(n%60).padStart(2,"0")}s`:`${Math.floor(s/60)}h ${String(s%60).padStart(2,"0")}m`}(i,(0,C.toDate)(o.at)):"on the line",u=async()=>{await c.notify.confirm({title:`Delete the call from ${(0,C.whenOf)(i)}?`,description:"Every turn of it goes — and she stops reading it back into the next call.",okText:"Delete",destructive:!0})&&r(e.id)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:(0,T.cn)("group flex items-center gap-2.5",n?"mt-1":"mt-11"),children:[(0,t.jsx)("span",{title:`${e.provider} \xb7 ${e.model}`,className:"font-mono text-[10px] tracking-[0.14em] uppercase",children:(0,C.whenOf)(i)}),(0,t.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:d}),(0,t.jsx)("span",{className:"ml-auto flex size-7 shrink-0 items-center justify-center",children:e.endedAt&&(0,t.jsx)(a.Button,{size:"icon-sm",variant:"ghost",loading:l,"aria-label":"Delete this call",onClick:u,className:"text-muted-foreground/60 opacity-0 transition-opacity group-hover:opacity-100 hover:text-destructive focus-visible:opacity-100",children:(0,t.jsx)(k.Trash2,{})})})]}),(0,t.jsx)("div",{className:"mt-2 mb-[18px] h-px bg-border/60"}),(function(e){let t=[];for(let n of e){let e=t.at(-1);if(e&&"tool"===n.role&&"tool"===e.turn.role&&e.turn.tool===n.tool&&e.turn.text===n.text){e.repeats+=1;continue}t.push({turn:n,repeats:1})}return t})(e.turns).map(({turn:n,repeats:s},r,l)=>{var a,i;let o,c=l[r-1]?.turn,d=l[r+1]?.turn;return(0,t.jsx)(G,{turn:n,job:(a=e,i=n,(o=(0,M.delegatedLabel)(i.tool,i.text))?a.jobs.find(e=>e.label===o):void 0),repeats:s,opensRun:!c||H(c)!==H(n),closesRun:!d||H(d)!==H(n)},n.id)})]})}function G({turn:e,job:n,opensRun:s,closesRun:r,repeats:l=1}){return"tool"===e.role?(0,t.jsx)(V,{turn:e,job:n,repeats:l,opensRun:s}):"user"===e.role?(0,t.jsx)("div",{className:(0,T.cn)("flex justify-end",s?"mt-3":"mt-1"),children:(0,t.jsx)("p",{className:(0,T.cn)("max-w-[min(34rem,78%)] rounded-2xl bg-muted px-3.5 py-2 text-[13.5px] leading-relaxed break-keep whitespace-pre-wrap",r&&"rounded-br-sm"),children:e.text})}):(0,t.jsxs)("div",{className:(0,T.cn)("flex items-start gap-2",s?"mt-3":"mt-1"),children:[(0,t.jsx)(B,{face:s,className:"mt-0.5"}),(0,t.jsx)("p",{className:"max-w-[min(34rem,78%)] text-[13.5px] leading-relaxed break-keep whitespace-pre-wrap",children:e.text})]})}function B({face:e,className:n}){return(0,t.jsx)("span",{className:(0,T.cn)("grid size-[18px] shrink-0 place-items-center",n),children:e&&(0,t.jsx)(K.ThursdayMark,{size:18})})}function V({turn:e,job:n,repeats:s,opensRun:r}){let l=e.tool??"",a=(0,w.toolIcon)(l),i=(0,M.toolLine)(l,e.text);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:(0,T.cn)("flex items-center gap-2",r?"mt-3":"mt-1.5"),children:[(0,t.jsx)(B,{face:r}),(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-muted-foreground",children:[(0,t.jsx)(a,{className:"size-3 shrink-0"}),i&&(0,t.jsx)("span",{className:"truncate text-[11px] break-keep",children:i}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/60",children:l}),s>1&&(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:["×",s]})]})]}),n&&(0,t.jsxs)("p",{className:"mt-0.5 ml-[26px] flex min-w-0 items-baseline gap-1.5 text-[11px]",children:["running"===n.status?(0,t.jsx)(S.ShinyText,{text:P.running,className:"shrink-0 font-mono text-[10px]"}):(0,t.jsx)("span",{className:(0,T.cn)("shrink-0 font-mono text-[10px]",z[n.status]),children:P[n.status]}),n.outcome&&"running"!==n.status&&(0,t.jsx)("span",{className:"truncate text-muted-foreground",children:(0,T.plainText)(n.outcome)})]})]})}var W=e.i(333495),U=e.i(933916),q=e.i(762074);let Y=(0,R.createServerReference)("7f1d36b0d1eafa4f7bbf1208f18183bcc64c3ec7e0",R.callServer,void 0,R.findSourceMapURL,"resetHistoryAction"),X=(0,R.createServerReference)("7f163845a4428ceeeb912bcaf5c0c9eef6f501b473",R.callServer,void 0,R.findSourceMapURL,"setCallSkillsAction");var Z=e.i(671228),J=e.i(67045),Q=e.i(698570),ee=e.i(319841),et=e.i(981203),en=e.i(283653);function es(){let{data:e}=(0,en.useServerRoute)(l.queryKey.callSkills),[n]=(0,A.useServerAction)(X,{onOk:()=>(0,en.revalidate)(l.queryKey.callSkills)});return(0,t.jsx)(g.SettingGroup,{label:"Skills",children:(0,t.jsx)(g.SettingToggle,{label:"Read a skill herself",description:"A skill is how a thing is done here, written down. On, she opens one mid-call and follows it; off, only bots read them.",checked:e??!1,disabled:void 0===e,onChange:e=>n(e),children:(0,t.jsx)(er,{})})})}function er(){let{data:e}=(0,en.useServerRoute)(l.queryKey.skills);return e?(0,t.jsx)(g.SettingNote,{className:(0,T.cn)(!e.length&&T.WAITING_INK),children:e.length?`The same ${e.length} a bot reads. Each one she opens spends a page of the call on it.`:"Nothing installed yet — there is nothing for her to read."}):null}function el(){let[e,n]=(0,A.useServerAction)(Y,{okMessage:({calls:e,tasks:t,notes:n})=>`Wiped ${e} calls, ${t} jobs, ${n} notes`,onOk:()=>{(0,en.revalidate)(l.queryKey.memory),(0,en.revalidate)(l.queryKey.tasks),(0,en.revalidate)(l.queryKey.callHistory(null))}}),r=async()=>{await c.notify.confirm({title:"Reset history?",description:"Every call, every job and everything she remembers is deleted for good. Keys, bots and connectors stay.",okText:"Reset",destructive:!0})&&e()};return(0,t.jsx)(g.SettingGroup,{label:"Danger zone",note:"Keys, bots and connectors stay.",children:(0,t.jsx)(g.SettingItems,{children:(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",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)(s.TriangleAlert,{className:"size-4"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsx)("span",{className:"block text-sm font-medium",children:"Reset history"}),(0,t.jsx)("span",{className:"block text-xs text-muted-foreground",children:"Every call, every job and everything she remembers"})]}),(0,t.jsx)(a.Button,{variant:"outline",size:"sm",loading:n,onClick:r,className:"shrink-0 text-destructive hover:text-destructive",children:"Reset"})]})})})}function ea({value:e,onChange:n}){let s=t=>n({...e,...t});return(0,t.jsx)(g.SettingGroup,{label:"Face",children:(0,t.jsxs)("div",{className:"space-y-5 py-2",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 pt-2",children:[(0,t.jsx)(W.Face,{look:e,size:176,className:"w-44"}),(0,t.jsx)(d.Segmented,{"aria-label":"Face",options:U.FACE_KINDS.map(e=>({value:e,label:W.FACES[e].label})),value:e.kind,onChange:e=>s({kind:e})}),(0,t.jsx)("p",{className:"max-w-sm text-center text-xs text-muted-foreground",children:W.FACES[e.kind].hint})]}),"mark"===e.kind&&(0,t.jsx)(p.MarkPalette,{color:e.color,themePicked:!e.color,onTheme:()=>s({color:void 0}),onPick:e=>s({color:e})}),"mark"===e.kind&&(0,t.jsx)(eo,{label:"Shape",children:(0,t.jsx)(d.Segmented,{"aria-label":"Shape",options:f.MARK_SHAPES.map(e=>({value:e,label:(0,t.jsx)("span",{className:"capitalize",children:e})})),value:e.shape??"blob",onChange:e=>s({shape:e})})}),"mark"===e.kind&&(0,t.jsx)(eo,{label:"Style",children:(0,t.jsx)(d.Segmented,{"aria-label":"Style",options:[{value:"solid",label:"Solid"},{value:"outline",label:"Outline"}],value:e.outline?"outline":"solid",onChange:e=>s({outline:"outline"===e||void 0})})}),"ascii"===e.kind&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eo,{label:"Glyphs",children:(0,t.jsx)(d.Segmented,{"aria-label":"Glyphs",options:U.ASCII_CHARSETS.map(e=>({value:e,label:ei[e]})),value:e.charset,onChange:e=>s({charset:e})})}),(0,t.jsx)(eo,{label:"Size",children:(0,t.jsx)(ec,{min:h.ASCII_FACE.fontSize.min,max:h.ASCII_FACE.fontSize.max,step:1,value:e.fontSize,format:e=>`${e}px`,onChange:e=>s({fontSize:e})})}),(0,t.jsx)(eo,{label:"Density",children:(0,t.jsx)(ec,{min:h.ASCII_FACE.density.min,max:h.ASCII_FACE.density.max,step:.1,value:e.density,format:e=>`${e.toFixed(1)}x`,onChange:e=>s({density:e})})})]})]})})}let ei={ascii:"Characters",emoji:"Sprinkled",emojiOnly:"All emoji"};function eo({label:e,children:n}){return(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"w-16 shrink-0 font-mono text-[11px] text-muted-foreground",children:e}),n]})}function ec({value:e,onChange:n,format:s,...r}){return(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsx)("input",{type:"range",...r,value:e,onChange:e=>n(Number(e.target.value)),className:"min-w-0 flex-1 accent-foreground"}),(0,t.jsx)("span",{className:"w-10 shrink-0 text-right font-mono text-[11px] text-muted-foreground tabular-nums",children:s(e)})]})}function ed({provider:e,value:r,hasKey:l,onPick:a}){let o=!!r,c=r?.voice??e.defaultVoice,d=r?.model??"";return(0,t.jsxs)("div",{className:(0,T.cn)("p-4",o&&"bg-muted/40"),children:[(0,t.jsxs)("button",{type:"button",disabled:o,onClick:()=>a({voice:null,model:null}),className:"flex w-full items-center gap-3 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-default",children:[(0,t.jsx)(m.ProviderIcon,{provider:e.id,className:"size-4 shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsx)("span",{className:"block truncate text-sm font-medium",children:e.label}),(0,t.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:d||e.models[0].id})]}),l?o&&(0,t.jsx)(n.Check,{className:"size-4 shrink-0"}):(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:[(0,t.jsx)(s.TriangleAlert,{className:"size-3"}),"No key"]})]}),o&&(0,t.jsxs)("div",{className:"space-y-3 pt-3",children:[(0,t.jsx)(i.Combobox,{value:d,onChange:e=>a({voice:r?.voice??null,model:e||null}),options:e.models.map(e=>({value:e.id,label:e.label,hint:e.id})),"aria-label":`${e.label} realtime model`,placeholder:e.models[0].id,empty:"Not on the list — it still runs"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.voices.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>a({voice:e,model:r?.model??null}),className:(0,T.cn)("rounded-full border px-2.5 py-1 font-mono text-[11px] transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ring/50",e===c?"border-foreground/40 text-foreground":"border-border/60 text-muted-foreground hover:text-foreground"),children:e},e))})]})]})}let eu={center:{label:"Her last line",hint:"One caption under the mark — only what she said."},sides:{label:"Last three turns",hint:"Hers on the left, yours on the right, beside the mark."}};function eh({value:e,onChange:n}){return(0,t.jsx)(g.SettingGroup,{label:"Calls you",note:"off"!==e&&"Needs this tab open. A tab that has been silent since it loaded may not be allowed to make a sound — the desktop notification covers that.",children:(0,t.jsx)(g.SettingChoiceRows,{options:Z.CALL_BACK_MODES.map(e=>({value:e,label:Z.CALL_BACK_LABEL[e],hint:em[e]})),value:e,onChange:n})})}let em={off:"Nothing opens a call but you.",waiting:"A job that stopped to ask gets her to ring you.",any:"Anything a bot finishes, she opens a line to tell you."};function ex({value:e,onChange:n}){return(0,t.jsx)(g.SettingGroup,{label:"Captions",children:(0,t.jsx)(g.SettingChoiceRows,{options:Z.CAPTION_VIEWS.map(e=>({value:e,label:eu[e].label,hint:eu[e].hint})),value:e,onChange:n})})}function ep({value:e,onChange:n}){let s=(0,Q.useDraft)(e.phrase,t=>n({...e,phrase:t}),{min:Z.WAKE_PHRASE.min}),r=s.value.trim().split(/\s+/).length<2;return(0,t.jsx)(g.SettingGroup,{label:"Wake",children:(0,t.jsx)(g.SettingToggle,{label:"Answer to her name",description:"Between calls, the browser listens for the phrase below and picks up when it hears it.",checked:e.enabled,onChange:t=>n({...e,enabled:t}),children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.Input,{value:s.value,maxLength:Z.WAKE_PHRASE.max,spellCheck:!1,onChange:e=>s.set(e.target.value),onBlur:s.commit,onKeyDown:s.onKeyDown,"aria-label":"Wake phrase",className:"font-mono text-sm"}),(0,t.jsx)(g.SettingNote,{children:r?"One word will wake her by accident — say hello first.":"Heard loosely, in English. Near misses count."})]})})})}function ef({value:e,onChange:n}){let[s,l]=(0,r.useState)(!1),[a,i]=(0,r.useState)(!1),o=(0,ee.useHotkeyLabel)((0,ee.isCombo)(e.combo)?e.combo:null);return(0,t.jsx)(g.SettingGroup,{label:"Shortcut",children:(0,t.jsx)(g.SettingToggle,{label:"Answer to a key",description:"With this tab in front, the key below starts a call — and ends the one that is running.",checked:e.enabled,onChange:t=>n({...e,enabled:t}),children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("button",{type:"button",...ee.HOTKEY_CAPTURE,onClick:()=>{i(!1),l(!0)},onBlur:()=>l(!1),onKeyDown:s?t=>{if("Tab"===t.key)return;if(t.preventDefault(),t.stopPropagation(),"Escape"===t.key)return l(!1);let s=(0,ee.comboOf)(t.nativeEvent);if(!s)return i(!0);i(!1),l(!1),n({...e,combo:s})}:void 0,className:(0,T.cn)("w-full rounded-lg border px-3 py-2 font-mono text-sm outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",s?"border-foreground/40 text-muted-foreground":"border-border/60 hover:bg-muted/50"),children:s?"Press the keys…":o??"Set a shortcut"}),(0,t.jsx)(g.SettingNote,{children:a?"Hold Ctrl, Alt or Cmd — a plain key is typing.":s?"Esc to keep the one you have.":"Only while this tab has focus. Not while you are typing."})]})})})}function eg({value:e,onSave:n}){let[s,l]=(0,r.useState)(e);return(0,t.jsx)(g.SettingGroup,{label:"Instructions",right:`${s.length}/${et.COMMON_VALIDATE.prompt.max}`,children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(u.Textarea,{value:s,maxLength:et.COMMON_VALIDATE.prompt.max,onChange:e=>l(e.target.value),placeholder:"Anything else she should know before the first word — how to address you, what to skip.",className:"min-h-28"}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(a.Button,{size:"sm",disabled:s===e,onClick:()=>n(s),children:"Save"})})]})})}e.s(["ThursdaySetting",0,function(){let e=(0,J.useThursdayStore)(),n=(0,J.useThursdayStore)(e=>e.patch),{data:s=[],isLoading:r,error:a}=(0,en.useServerRoute)(l.queryKey.llmModel),i=(0,q.useThursdayFace)();if(r)return(0,t.jsx)(g.SettingSkeleton,{rows:4});if(a)return(0,t.jsx)(g.SettingError,{message:a.message});let o=e.model?.provider??null;return(0,t.jsxs)(g.SettingScreen,{footer:(0,t.jsx)(g.SettingRailNote,{children:"Her prompt is assembled fresh on every call — memory, the roster and your skills go in."}),children:[(0,t.jsx)(ea,{value:i,onChange:q.setThursdayFace}),(0,t.jsx)(O,{}),(0,t.jsx)(g.SettingGroup,{label:"Voice",note:!o&&"Nothing picked — calls run on whichever key is set.",children:(0,t.jsx)(g.SettingItems,{children:x.SPEACH_MODEL_PROVIDER_LIST.map(r=>{let l;return(0,t.jsx)(ed,{provider:r,value:o===r.id?e.model:null,hasKey:(l=r.apiKeyName,s.some(e=>e.apiKeyName===l&&e.hasKey)),onPick:e=>n({model:{provider:r.id,...e}})},r.id)})})}),(0,t.jsx)(ex,{value:e.captionView,onChange:e=>n({captionView:e})}),(0,t.jsx)(ep,{value:e.wake,onChange:e=>n({wake:e})}),(0,t.jsx)(eh,{value:e.callBack,onChange:e=>n({callBack:e})}),(0,t.jsx)(ef,{value:e.hotkey,onChange:e=>n({hotkey:e})}),(0,t.jsx)(es,{}),(0,t.jsx)(eg,{value:e.systemPrompt??"",onSave:e=>n({systemPrompt:e})}),(0,t.jsx)(el,{})]})}],59158)},698570,e=>{"use strict";var t=e.i(271645);e.s(["useDraft",0,function(e,n,{min:s=1}={}){let[r,l]=(0,t.useState)(e),[a,i]=(0,t.useState)(e);return e!==a&&(i(e),l(e)),{value:r,set:l,commit:()=>{let t=r.trim();if(t.length<s)return l(e);l(t),t!==e&&n(t)},onKeyDown:e=>{"Enter"!==e.key||e.nativeEvent.isComposing||e.currentTarget.blur()}}}])},661504,e=>{"use strict";var t=e.i(271645),n=e.i(699018),s=e.i(677309),r=e.i(271235),l=e.i(802239),a=e.i(646192);let i=Promise.resolve(),o=(0,r.withMiddleware)(n.u,e=>(n,r,o)=>{let c,d=(0,t.useRef)(!1),{cache:u,initialSize:h=1,revalidateAll:m=!1,persistSize:x=!1,revalidateFirstPage:p=!0,revalidateOnMount:f=!1,parallel:g=!1}=o,[,,,v]=s.a.get(s.o);try{(c=(0,s.s)(n?n(0,null):null)[0])&&(c=a.INFINITE_PREFIX+c)}catch(e){}let[b,j,y]=(0,s.c)(u,c),k=(0,t.useCallback)(()=>(0,s.i)(b()._l)?h:b()._l,[u,c,h]);(0,l.useSyncExternalStore)((0,t.useCallback)(e=>c?y(c,()=>{e()}):()=>{},[u,c]),k,k);let S=(0,t.useCallback)(()=>{let e=b()._l;return(0,s.i)(e)?h:e},[c,h]),N=(0,t.useRef)(S());(0,s.u)(()=>{if(!d.current){d.current=!0;return}c&&j({_l:x?N.current:S()})},[c,u]);let w=f&&!d.current,C=e(c,async e=>{let t=b()._i,l=b()._r,a=s.a.get(u),i=a[8],c=()=>a[8]!==i;j({_r:s.U});let d=[],h=S(),[x]=(0,s.c)(u,e),f=x().data,y=[],k=null;for(let e=0;e<h;++e){let[a,i]=(0,s.s)(n(e,g?null:k));if(!a)break;let[h,x]=(0,s.c)(u,a),b=h().data,j=m||t||(0,s.i)(b)||p&&!e&&!(0,s.i)(f)||w||f&&!(0,s.i)(f[e])&&!o.compare(f[e],b);if(r&&("function"==typeof l?l(b,i):j)){let t=async()=>{if(a in v){let e=v[a];delete v[a],b=await e}else b=await r(i);c()||x({data:b,_k:i}),d[e]=b};g?y.push(t):await t()}else d[e]=b;g||(k=b)}return g&&await Promise.all(y.map(e=>e())),c()||j({_i:s.U}),d},o),A=(0,t.useCallback)(function(e,t){let n="boolean"==typeof t?{revalidate:t}:t||{},r=!1!==n.revalidate;return c?(r&&((0,s.i)(e)?j({_i:!0,_r:n.revalidate}):j({_i:!1,_r:n.revalidate})),arguments.length?C.mutate(e,{...n,revalidate:r}):C.mutate()):i},[c,u]),E=(0,t.useCallback)(e=>{let t;if(!c)return i;let[,r]=(0,s.c)(u,c);if((0,s.e)(e)?t=e(S()):"number"==typeof e&&(t=e),"number"!=typeof t)return i;r({_l:t}),N.current=t;let l=[],[a]=(0,s.c)(u,c),o=null;for(let e=0;e<t;++e){let[t]=(0,s.s)(n(e,o)),[r]=(0,s.c)(u,t),i=t?r().data:s.U;if((0,s.i)(i))return A(a().data);l.push(i),o=i}return A(l)},[c,u,A,S]);return{size:S(),setSize:E,mutate:A,get data(){return C.data},get error(){return C.error},get isValidating(){return C.isValidating},get isLoading(){return C.isLoading}}});var c=e.i(41533),d=e.i(283653);e.s(["useServerPages",0,function(e){let n=e.size??c.PAGE_SIZE,{key:s}=e,{data:r,error:l,isLoading:a,isValidating:i,setSize:u,mutate:h}=o((e,t)=>(0,d.resolveKey)(s(e,t)),d.fetchRoute,{dedupingInterval:500,revalidateOnMount:!0,revalidateOnFocus:!0,revalidateOnReconnect:!0,focusThrottleInterval:1e3,revalidateFirstPage:!1,...e.swr}),m=r??[],x=m.flat(),p=m.at(-1),f=void 0!==p&&p.length>=n,g=(0,t.useRef)(0),v=i&&m.length>0&&g.current>m.length,b=(0,t.useRef)({isValidating:i,setSize:u,pages:m.length});b.current={isValidating:i,setSize:u,pages:m.length};let j=(0,d.resolveKey)(s(0,null)),y="string"==typeof j?j:j?.url;(0,t.useEffect)(()=>{if(y)return(0,d.registerPagedReader)({url:y,refresh:()=>h()})},[y,h]);let k=function(e,n={}){let{enabled:s=!0,margin:r="600px",revision:l}=n,a=(0,t.useRef)(e);a.current=e;let i=(0,t.useRef)(null),o=(0,t.useRef)(null),c=(0,t.useCallback)(e=>{i.current=e},[]);return(0,t.useEffect)(()=>{o.current?.disconnect();let e=i.current;if(e&&s)return o.current=new IntersectionObserver(([e])=>{e.isIntersecting&&a.current()},{root:function(e){let t=e.parentElement;for(;t;){let{overflowY:e}=getComputedStyle(t);if(("auto"===e||"scroll"===e)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}(e),rootMargin:r}),o.current.observe(e),()=>o.current?.disconnect()},[s,r,l]),c}(()=>{let e=b.current;e.isValidating||(g.current=e.pages+1,e.setSize(e.pages+1))},{enabled:f,revision:`${m.length}:${i}`});return{items:x,isLoading:a,isLoadingMore:v,error:l,hasMore:f,sentinelRef:k,refresh:()=>h()}}],661504)},759659,e=>{"use strict";var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let s=(0,t.default)(n);e.s(["Trash2",0,s],759659)},466787,e=>{"use strict";var t=e.i(755566);e.s(["TriangleAlert",()=>t.default])}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25481,e=>{"use strict";var t=e.i(843476),n=e.i(716327),s=e.i(632781),r=e.i(456420);let i={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};i.node;let a=(0,r.default)(i);var l=e.i(929272),o=e.i(759659),u=e.i(271645),c=e.i(798120),d=e.i(167881),x=e.i(463415),h=e.i(917162),m=e.i(660302),f=e.i(671428),g=e.i(761086),p=e.i(95187);let k=(0,p.createServerReference)("7f673b8897006f8ae8c1a709d306fe394476e76d0b",p.callServer,void 0,p.findSourceMapURL,"clearFinishedTasksAction"),v=(0,p.createServerReference)("7fcad43ea4ae0039c0186bcc86a4e3b3a0e706caa4",p.callServer,void 0,p.findSourceMapURL,"deleteTaskAction");var b=e.i(451888),j=e.i(635963),y=e.i(279265),w=e.i(835878),N=e.i(222055),S=e.i(240829),T=e.i(895836),C=e.i(245629),M=e.i(609856),R=e.i(661504),I=e.i(283653),z=e.i(647163),_=e.i(206721);let A="w-36";function D({task:e,bots:r,open:i,onToggle:c,onStop:h,onDelete:f}){var g,p;let k,v="running"===e.status||"waiting"===e.status,N="running"===e.status,T=(0,u.useMemo)(()=>(0,S.taskFromRow)(e,r),[e,r]),M=function(e){if("waiting"===e.status&&e.ask)return{text:(0,b.isAppStop)(e.ask)?(0,z.plainText)(e.outcome??e.ask.question):e.ask.question,tone:z.WAITING_INK};let t=e.seen;if("failed"===e.status)return{text:(0,z.plainText)(e.outcome??"Failed"),tone:t?"text-destructive/70":"text-destructive"};if("done"===e.status)return{text:(0,z.plainText)(e.outcome??"Done"),tone:t?"text-muted-foreground":"text-foreground/80"};for(let t=e.lines.length-1;t>=0;t--){let n=e.lines[t];if("tool"===n.kind)return{text:n.note??n.input,tone:"text-muted-foreground",tool:n.name,shine:!0};if("text"===n.kind)return{text:n.text,tone:"text-muted-foreground",shine:!0};if("user"===n.kind||"waiting"===n.kind)break}return{text:`${e.bot} is taking it on…`,tone:"text-muted-foreground italic",shine:!0}}(e),R=e.tokens.input+e.tokens.output;return(0,t.jsxs)("div",{className:"group/row relative transition-colors hover:bg-muted/50",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,t.jsxs)("button",{type:"button",onClick:c,className:"flex min-w-0 flex-1 items-center gap-3 rounded-md text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(j.BotMark,{size:40,seed:e.bot,vary:e.id,...(g=e.bot,p=r,k=p?.find(e=>e.name===g)?.icon,{color:k?.color,shape:k?.shape,outline:k?.outline}),state:N?"thinking":"idle",notify:"waiting"===e.status,className:"shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.label}),(0,t.jsx)(w.BotRoster,{bots:(0,S.rosterOf)(T),taskId:e.id}),N&&(0,t.jsx)(s.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"})]}),M&&(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-[13px] leading-snug",children:[M.tool&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:M.tool}),M.shine?(0,t.jsx)(m.ShinyText,{text:M.text,speed:2.2,className:"min-w-0 truncate"}):(0,t.jsx)("span",{className:(0,z.cn)("min-w-0 truncate",M.tone),children:M.text})]})]}),(0,t.jsxs)("span",{className:(0,z.cn)("flex shrink-0 flex-col items-end gap-0.5 font-mono text-[11px] leading-4 text-muted-foreground tabular-nums",A),children:[(0,t.jsx)("span",{children:(0,C.whenOf)(e.updatedAt)}),(0,t.jsxs)("span",{className:"max-w-full truncate text-muted-foreground/70",title:R>0?`${e.id} \xb7 in ${(0,z.formatCount)(e.tokens.input)} \xb7 out ${(0,z.formatCount)(e.tokens.output)}`:e.id,children:[e.bot,R>0&&` \xb7 ${(0,z.formatCount)(R)}`]})]}),(0,t.jsx)(n.ChevronDown,{className:(0,z.cn)("size-4 shrink-0 text-muted-foreground transition-transform",i&&"rotate-180")})]}),(0,t.jsxs)(x.DropdownMenu,{children:[(0,t.jsx)(x.DropdownMenuTrigger,{render:(0,t.jsx)(d.Button,{size:"icon-sm",variant:"ghost"}),children:(0,t.jsx)(a,{})}),(0,t.jsxs)(x.DropdownMenuContent,{align:"end",children:[v&&(0,t.jsxs)(x.DropdownMenuItem,{onClick:h,children:[(0,t.jsx)(l.Square,{}),"Stop"]}),(0,t.jsxs)(x.DropdownMenuItem,{variant:"destructive",onClick:f,children:[(0,t.jsx)(o.Trash2,{}),"Delete"]})]})]})]}),N&&!i&&(0,t.jsx)($,{task:e}),i&&(0,t.jsxs)("div",{className:"mx-4 mb-4 space-y-2",children:[(0,t.jsx)("div",{className:"rounded-xl border border-border/60 bg-background",children:(0,t.jsx)(y.Conversation,{task:T})}),(0,t.jsx)(_.TaskReply,{task:{id:e.id,label:e.label,bot:e.bot,ask:e.ask},status:e.status})]})]})}function $({task:e}){let n=[];if(e.lines.forEach((t,s)=>{if("tool"!==t.kind)return;let r=e.lines[s+1];n.push({step:t,took:r?(0,C.toDate)(r.at).getTime()-(0,C.toDate)(t.at).getTime():null})}),0===n.length)return null;let r=(0,C.toDate)(e.updatedAt).getTime()-(0,C.toDate)(e.createdAt).getTime();return(0,t.jsxs)("div",{className:"pointer-events-none absolute top-[calc(100%-0.75rem)] left-17 z-20 hidden w-96 max-w-[calc(100%-5rem)] rounded-xl bg-background p-3 pb-2 shadow-xl shadow-black/10 ring-1 ring-border/60 group-hover/row:block",children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)("span",{children:e.bot}),(0,t.jsx)("span",{className:"opacity-50",children:"·"}),(0,t.jsxs)("span",{children:[n.length," ",1===n.length?"step":"steps"]}),(0,t.jsx)("span",{className:"opacity-50",children:"·"}),(0,t.jsx)("span",{children:O(r)})]}),n.slice(-6).map(({step:e,took:n})=>{let r=(0,N.toolIcon)(e.name);return(0,t.jsxs)("div",{className:"flex h-5.5 items-center gap-2 font-mono text-[11px]",children:[null===n?(0,t.jsx)(s.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}):(0,t.jsx)(r,{className:"size-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",children:e.name}),null===n?(0,t.jsx)(m.ShinyText,{text:e.note??e.input,speed:2.2,className:"min-w-0 flex-1 truncate"}):(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:e.note??e.input}),(0,t.jsx)("span",{className:"w-10 shrink-0 text-right text-muted-foreground/70 tabular-nums",children:null===n?"":O(n)})]},e.id)})]})}function O(e){let t=Math.max(0,e)/1e3;if(t<10)return`${t.toFixed(1)}s`;if(t<60)return`${Math.round(t)}s`;let n=Math.floor(t/60);return`${n}m ${Math.round(t-60*n)}s`}function E(){return(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,t.jsx)(f.Skeleton,{className:"size-10 shrink-0 rounded-full"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)(f.Skeleton,{className:"h-3 w-40 max-w-full"}),(0,t.jsx)(f.Skeleton,{className:"h-2.5 w-80 max-w-full"})]}),(0,t.jsxs)("span",{className:(0,z.cn)("flex shrink-0 flex-col items-end gap-1.5",A),children:[(0,t.jsx)(f.Skeleton,{className:"h-2.5 w-12"}),(0,t.jsx)(f.Skeleton,{className:"h-2.5 w-24"})]}),(0,t.jsx)("span",{className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:"size-7 shrink-0"})]})}e.s(["TaskSetting",0,function(){let[e,n]=(0,u.useState)(null),[s,r]=(0,u.useState)(""),{data:i}=(0,I.useServerRoute)(c.queryKey.bot),{items:a,isLoading:l,isLoadingMore:o,error:x,hasMore:m,sentinelRef:f}=(0,R.useServerPages)({key:(e,t)=>{if(0===e)return c.queryKey.taskHistory(null);let n=t?.at(-1);return n?c.queryKey.taskHistory((0,C.toDate)(n.updatedAt).toISOString()):null},size:b.TASK_HISTORY_PAGE,swr:{revalidateFirstPage:!0,refreshInterval:e=>3e3*!!e?.[0]?.some(e=>"running"===e.status)}});(0,S.useSeenOnDetail)(a.find(t=>t.id===e));let[p]=(0,M.useServerAction)(g.cancelTaskAction,{okMessage:"Task stopped",onOk:e=>{(0,I.revalidate)(c.queryKey.tasks),S.screenActs.announce({kind:"stopped",id:e.id,label:e.label})}}),[j]=(0,M.useServerAction)(v,{okMessage:"Task deleted",onOk:()=>(0,I.revalidate)(c.queryKey.tasks)}),[y]=(0,M.useServerAction)(k,{onOk:()=>(0,I.revalidate)(c.queryKey.tasks)}),w=async()=>{await h.notify.confirm({title:"Clear finished jobs?",description:"Everything done or failed goes, threads included. Running and waiting jobs stay.",okText:"Clear",destructive:!0})&&y()},N=async e=>{await h.notify.confirm({title:`Delete "${e.label}"?`,description:"The thread goes with it — nothing can be picked back up.",okText:"Delete",destructive:!0})&&j(e.id)};if(l)return(0,t.jsx)(T.SettingSkeleton,{rows:3});if(x)return(0,t.jsx)(T.SettingError,{message:x.message});let z=s.trim().toLowerCase(),_=z?a.filter(e=>[e.label,e.outcome,e.bot].join(" ").toLowerCase().includes(z)):a,A=a.filter(e=>"waiting"===e.status).length,$=a.filter(e=>"failed"===e.status).length;return(0,t.jsx)(T.SettingScreen,{footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(T.SettingRailNote,{children:[a.length," loaded",A>0&&` \xb7 ${A} waiting on you`,$>0&&` \xb7 ${$} failed`]}),(0,t.jsx)(d.Button,{variant:"outline",size:"sm",onClick:w,children:"Clear finished"})]}),children:(0,t.jsx)(T.SettingGroup,{filter:(0,t.jsx)(T.SettingFilter,{value:s,onChange:r,placeholder:"Filter by label, bot or word"}),right:z?`${_.length} of ${a.length}`:void 0,children:(0,t.jsxs)(T.SettingItems,{children:[0===_.length?(0,t.jsx)("p",{className:"p-4 text-sm leading-relaxed text-muted-foreground",children:z?"Nothing loaded matches. Keep scrolling to search further back.":"Nothing yet. When Thursday hands a job to a bot mid-call, it shows up here — while it runs, and after."}):_.map(s=>(0,t.jsx)(D,{task:s,bots:i,open:e===s.id,onToggle:()=>n(e=>e===s.id?null:s.id),onStop:()=>p(s.id),onDelete:()=>N(s)},s.id)),(0,t.jsx)(T.SettingMore,{hasMore:m,loading:o,sentinelRef:f,ghost:(0,t.jsx)(E,{}),className:"divide-y divide-border/60"})]})})})}],25481)},661504,e=>{"use strict";var t=e.i(271645),n=e.i(699018),s=e.i(677309),r=e.i(271235),i=e.i(802239),a=e.i(646192);let l=Promise.resolve(),o=(0,r.withMiddleware)(n.u,e=>(n,r,o)=>{let u,c=(0,t.useRef)(!1),{cache:d,initialSize:x=1,revalidateAll:h=!1,persistSize:m=!1,revalidateFirstPage:f=!0,revalidateOnMount:g=!1,parallel:p=!1}=o,[,,,k]=s.a.get(s.o);try{(u=(0,s.s)(n?n(0,null):null)[0])&&(u=a.INFINITE_PREFIX+u)}catch(e){}let[v,b,j]=(0,s.c)(d,u),y=(0,t.useCallback)(()=>(0,s.i)(v()._l)?x:v()._l,[d,u,x]);(0,i.useSyncExternalStore)((0,t.useCallback)(e=>u?j(u,()=>{e()}):()=>{},[d,u]),y,y);let w=(0,t.useCallback)(()=>{let e=v()._l;return(0,s.i)(e)?x:e},[u,x]),N=(0,t.useRef)(w());(0,s.u)(()=>{if(!c.current){c.current=!0;return}u&&b({_l:m?N.current:w()})},[u,d]);let S=g&&!c.current,T=e(u,async e=>{let t=v()._i,i=v()._r,a=s.a.get(d),l=a[8],u=()=>a[8]!==l;b({_r:s.U});let c=[],x=w(),[m]=(0,s.c)(d,e),g=m().data,j=[],y=null;for(let e=0;e<x;++e){let[a,l]=(0,s.s)(n(e,p?null:y));if(!a)break;let[x,m]=(0,s.c)(d,a),v=x().data,b=h||t||(0,s.i)(v)||f&&!e&&!(0,s.i)(g)||S||g&&!(0,s.i)(g[e])&&!o.compare(g[e],v);if(r&&("function"==typeof i?i(v,l):b)){let t=async()=>{if(a in k){let e=k[a];delete k[a],v=await e}else v=await r(l);u()||m({data:v,_k:l}),c[e]=v};p?j.push(t):await t()}else c[e]=v;p||(y=v)}return p&&await Promise.all(j.map(e=>e())),u()||b({_i:s.U}),c},o),C=(0,t.useCallback)(function(e,t){let n="boolean"==typeof t?{revalidate:t}:t||{},r=!1!==n.revalidate;return u?(r&&((0,s.i)(e)?b({_i:!0,_r:n.revalidate}):b({_i:!1,_r:n.revalidate})),arguments.length?T.mutate(e,{...n,revalidate:r}):T.mutate()):l},[u,d]),M=(0,t.useCallback)(e=>{let t;if(!u)return l;let[,r]=(0,s.c)(d,u);if((0,s.e)(e)?t=e(w()):"number"==typeof e&&(t=e),"number"!=typeof t)return l;r({_l:t}),N.current=t;let i=[],[a]=(0,s.c)(d,u),o=null;for(let e=0;e<t;++e){let[t]=(0,s.s)(n(e,o)),[r]=(0,s.c)(d,t),l=t?r().data:s.U;if((0,s.i)(l))return C(a().data);i.push(l),o=l}return C(i)},[u,d,C,w]);return{size:w(),setSize:M,mutate:C,get data(){return T.data},get error(){return T.error},get isValidating(){return T.isValidating},get isLoading(){return T.isLoading}}});var u=e.i(41533),c=e.i(283653);e.s(["useServerPages",0,function(e){let n=e.size??u.PAGE_SIZE,{key:s}=e,{data:r,error:i,isLoading:a,isValidating:l,setSize:d,mutate:x}=o((e,t)=>(0,c.resolveKey)(s(e,t)),c.fetchRoute,{dedupingInterval:500,revalidateOnMount:!0,revalidateOnFocus:!0,revalidateOnReconnect:!0,focusThrottleInterval:1e3,revalidateFirstPage:!1,...e.swr}),h=r??[],m=h.flat(),f=h.at(-1),g=void 0!==f&&f.length>=n,p=(0,t.useRef)(0),k=l&&h.length>0&&p.current>h.length,v=(0,t.useRef)({isValidating:l,setSize:d,pages:h.length});v.current={isValidating:l,setSize:d,pages:h.length};let b=(0,c.resolveKey)(s(0,null)),j="string"==typeof b?b:b?.url;(0,t.useEffect)(()=>{if(j)return(0,c.registerPagedReader)({url:j,refresh:()=>x()})},[j,x]);let y=function(e,n={}){let{enabled:s=!0,margin:r="600px",revision:i}=n,a=(0,t.useRef)(e);a.current=e;let l=(0,t.useRef)(null),o=(0,t.useRef)(null),u=(0,t.useCallback)(e=>{l.current=e},[]);return(0,t.useEffect)(()=>{o.current?.disconnect();let e=l.current;if(e&&s)return o.current=new IntersectionObserver(([e])=>{e.isIntersecting&&a.current()},{root:function(e){let t=e.parentElement;for(;t;){let{overflowY:e}=getComputedStyle(t);if(("auto"===e||"scroll"===e)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}(e),rootMargin:r}),o.current.observe(e),()=>o.current?.disconnect()},[s,r,i]),u}(()=>{let e=v.current;e.isValidating||(p.current=e.pages+1,e.setSize(e.pages+1))},{enabled:g,revision:`${h.length}:${l}`});return{items:m,isLoading:a,isLoadingMore:k,error:i,hasMore:g,sentinelRef:y,refresh:()=>x()}}],661504)},759659,e=>{"use strict";var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let s=(0,t.default)(n);e.s(["Trash2",0,s],759659)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25481,e=>{"use strict";var t=e.i(843476),n=e.i(716327),s=e.i(632781),r=e.i(456420);let i={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};i.node;let a=(0,r.default)(i);var l=e.i(929272),o=e.i(759659),u=e.i(271645),c=e.i(798120),d=e.i(167881),x=e.i(463415),f=e.i(917162),h=e.i(660302),m=e.i(671428),g=e.i(372851),p=e.i(95187);let k=(0,p.createServerReference)("7fda72369d9fca05cd58aec3dc9180f63cb821b22a",p.callServer,void 0,p.findSourceMapURL,"clearFinishedTasksAction"),v=(0,p.createServerReference)("7ff2d4d8446eefece813fa574882748530dd7fa72a",p.callServer,void 0,p.findSourceMapURL,"deleteTaskAction");var j=e.i(451888),b=e.i(635963),y=e.i(279265),w=e.i(835878),N=e.i(222055),S=e.i(240829),T=e.i(895836),C=e.i(245629),M=e.i(609856),R=e.i(661504),I=e.i(283653),z=e.i(647163),_=e.i(206721);let A="w-36";function D({task:e,bots:r,open:i,onToggle:c,onStop:f,onDelete:m}){var g,p;let k,v="running"===e.status||"waiting"===e.status,N="running"===e.status,T=(0,u.useMemo)(()=>(0,S.taskFromRow)(e,r),[e,r]),M=function(e){if("waiting"===e.status&&e.ask)return{text:(0,j.isAppStop)(e.ask)?(0,z.plainText)(e.outcome??e.ask.question):e.ask.question,tone:z.WAITING_INK};let t=e.seen;if("failed"===e.status)return{text:(0,z.plainText)(e.outcome??"Failed"),tone:t?"text-destructive/70":"text-destructive"};if("done"===e.status)return{text:(0,z.plainText)(e.outcome??"Done"),tone:t?"text-muted-foreground":"text-foreground/80"};for(let t=e.lines.length-1;t>=0;t--){let n=e.lines[t];if("tool"===n.kind)return{text:n.note??n.input,tone:"text-muted-foreground",tool:n.name,shine:!0};if("text"===n.kind)return{text:n.text,tone:"text-muted-foreground",shine:!0};if("user"===n.kind||"waiting"===n.kind)break}return{text:`${e.bot} is taking it on…`,tone:"text-muted-foreground italic",shine:!0}}(e),R=e.tokens.input+e.tokens.output;return(0,t.jsxs)("div",{className:"group/row relative transition-colors hover:bg-muted/50",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,t.jsxs)("button",{type:"button",onClick:c,className:"flex min-w-0 flex-1 items-center gap-3 rounded-md text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,t.jsx)(b.BotMark,{size:40,seed:e.bot,vary:e.id,...(g=e.bot,p=r,k=p?.find(e=>e.name===g)?.icon,{color:k?.color,shape:k?.shape,outline:k?.outline}),state:N?"thinking":"idle",notify:"waiting"===e.status,className:"shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e.label}),(0,t.jsx)(w.BotRoster,{bots:(0,S.rosterOf)(T),taskId:e.id}),N&&(0,t.jsx)(s.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"})]}),M&&(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 text-[13px] leading-snug",children:[M.tool&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:M.tool}),M.shine?(0,t.jsx)(h.ShinyText,{text:M.text,speed:2.2,className:"min-w-0 truncate"}):(0,t.jsx)("span",{className:(0,z.cn)("min-w-0 truncate",M.tone),children:M.text})]})]}),(0,t.jsxs)("span",{className:(0,z.cn)("flex shrink-0 flex-col items-end gap-0.5 font-mono text-[11px] leading-4 text-muted-foreground tabular-nums",A),children:[(0,t.jsx)("span",{children:(0,C.whenOf)(e.updatedAt)}),(0,t.jsxs)("span",{className:"max-w-full truncate text-muted-foreground/70",title:R>0?`${e.id} \xb7 in ${(0,z.formatCount)(e.tokens.input)} \xb7 out ${(0,z.formatCount)(e.tokens.output)}`:e.id,children:[e.bot,R>0&&` \xb7 ${(0,z.formatCount)(R)}`]})]}),(0,t.jsx)(n.ChevronDown,{className:(0,z.cn)("size-4 shrink-0 text-muted-foreground transition-transform",i&&"rotate-180")})]}),(0,t.jsxs)(x.DropdownMenu,{children:[(0,t.jsx)(x.DropdownMenuTrigger,{render:(0,t.jsx)(d.Button,{size:"icon-sm",variant:"ghost"}),children:(0,t.jsx)(a,{})}),(0,t.jsxs)(x.DropdownMenuContent,{align:"end",children:[v&&(0,t.jsxs)(x.DropdownMenuItem,{onClick:f,children:[(0,t.jsx)(l.Square,{}),"Stop"]}),(0,t.jsxs)(x.DropdownMenuItem,{variant:"destructive",onClick:m,children:[(0,t.jsx)(o.Trash2,{}),"Delete"]})]})]})]}),N&&!i&&(0,t.jsx)($,{task:e}),i&&(0,t.jsxs)("div",{className:"mx-4 mb-4 space-y-2",children:[(0,t.jsx)("div",{className:"rounded-xl border border-border/60 bg-background",children:(0,t.jsx)(y.Conversation,{task:T})}),(0,t.jsx)(_.TaskReply,{task:{id:e.id,label:e.label,bot:e.bot,ask:e.ask},status:e.status})]})]})}function $({task:e}){let n=[];if(e.lines.forEach((t,s)=>{if("tool"!==t.kind)return;let r=e.lines[s+1];n.push({step:t,took:r?(0,C.toDate)(r.at).getTime()-(0,C.toDate)(t.at).getTime():null})}),0===n.length)return null;let r=(0,C.toDate)(e.updatedAt).getTime()-(0,C.toDate)(e.createdAt).getTime();return(0,t.jsxs)("div",{className:"pointer-events-none absolute top-[calc(100%-0.75rem)] left-17 z-20 hidden w-96 max-w-[calc(100%-5rem)] rounded-xl bg-background p-3 pb-2 shadow-xl shadow-black/10 ring-1 ring-border/60 group-hover/row:block",children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)("span",{children:e.bot}),(0,t.jsx)("span",{className:"opacity-50",children:"·"}),(0,t.jsxs)("span",{children:[n.length," ",1===n.length?"step":"steps"]}),(0,t.jsx)("span",{className:"opacity-50",children:"·"}),(0,t.jsx)("span",{children:O(r)})]}),n.slice(-6).map(({step:e,took:n})=>{let r=(0,N.toolIcon)(e.name);return(0,t.jsxs)("div",{className:"flex h-5.5 items-center gap-2 font-mono text-[11px]",children:[null===n?(0,t.jsx)(s.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}):(0,t.jsx)(r,{className:"size-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",children:e.name}),null===n?(0,t.jsx)(h.ShinyText,{text:e.note??e.input,speed:2.2,className:"min-w-0 flex-1 truncate"}):(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:e.note??e.input}),(0,t.jsx)("span",{className:"w-10 shrink-0 text-right text-muted-foreground/70 tabular-nums",children:null===n?"":O(n)})]},e.id)})]})}function O(e){let t=Math.max(0,e)/1e3;if(t<10)return`${t.toFixed(1)}s`;if(t<60)return`${Math.round(t)}s`;let n=Math.floor(t/60);return`${n}m ${Math.round(t-60*n)}s`}function E(){return(0,t.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,t.jsx)(m.Skeleton,{className:"size-10 shrink-0 rounded-full"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)(m.Skeleton,{className:"h-3 w-40 max-w-full"}),(0,t.jsx)(m.Skeleton,{className:"h-2.5 w-80 max-w-full"})]}),(0,t.jsxs)("span",{className:(0,z.cn)("flex shrink-0 flex-col items-end gap-1.5",A),children:[(0,t.jsx)(m.Skeleton,{className:"h-2.5 w-12"}),(0,t.jsx)(m.Skeleton,{className:"h-2.5 w-24"})]}),(0,t.jsx)("span",{className:"size-4 shrink-0"}),(0,t.jsx)("span",{className:"size-7 shrink-0"})]})}e.s(["TaskSetting",0,function(){let[e,n]=(0,u.useState)(null),[s,r]=(0,u.useState)(""),{data:i}=(0,I.useServerRoute)(c.queryKey.bot),{items:a,isLoading:l,isLoadingMore:o,error:x,hasMore:h,sentinelRef:m}=(0,R.useServerPages)({key:(e,t)=>{if(0===e)return c.queryKey.taskHistory(null);let n=t?.at(-1);return n?c.queryKey.taskHistory((0,C.toDate)(n.updatedAt).toISOString()):null},size:j.TASK_HISTORY_PAGE,swr:{revalidateFirstPage:!0,refreshInterval:e=>3e3*!!e?.[0]?.some(e=>"running"===e.status)}});(0,S.useSeenOnDetail)(a.find(t=>t.id===e));let[p]=(0,M.useServerAction)(g.cancelTaskAction,{okMessage:"Task stopped",onOk:e=>{(0,I.revalidate)(c.queryKey.tasks),S.screenActs.announce({kind:"stopped",id:e.id,label:e.label})}}),[b]=(0,M.useServerAction)(v,{okMessage:"Task deleted",onOk:()=>(0,I.revalidate)(c.queryKey.tasks)}),[y]=(0,M.useServerAction)(k,{onOk:()=>(0,I.revalidate)(c.queryKey.tasks)}),w=async()=>{await f.notify.confirm({title:"Clear finished jobs?",description:"Everything done or failed goes, threads included. Running and waiting jobs stay.",okText:"Clear",destructive:!0})&&y()},N=async e=>{await f.notify.confirm({title:`Delete "${e.label}"?`,description:"The thread goes with it — nothing can be picked back up.",okText:"Delete",destructive:!0})&&b(e.id)};if(l)return(0,t.jsx)(T.SettingSkeleton,{rows:3});if(x)return(0,t.jsx)(T.SettingError,{message:x.message});let z=s.trim().toLowerCase(),_=z?a.filter(e=>[e.label,e.outcome,e.bot].join(" ").toLowerCase().includes(z)):a,A=a.filter(e=>"waiting"===e.status).length,$=a.filter(e=>"failed"===e.status).length;return(0,t.jsx)(T.SettingScreen,{footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(T.SettingRailNote,{children:[a.length," loaded",A>0&&` \xb7 ${A} waiting on you`,$>0&&` \xb7 ${$} failed`]}),(0,t.jsx)(d.Button,{variant:"outline",size:"sm",onClick:w,children:"Clear finished"})]}),children:(0,t.jsx)(T.SettingGroup,{filter:(0,t.jsx)(T.SettingFilter,{value:s,onChange:r,placeholder:"Filter by label, bot or word"}),right:z?`${_.length} of ${a.length}`:void 0,children:(0,t.jsxs)(T.SettingItems,{children:[0===_.length?(0,t.jsx)("p",{className:"p-4 text-sm leading-relaxed text-muted-foreground",children:z?"Nothing loaded matches. Keep scrolling to search further back.":"Nothing yet. When Thursday hands a job to a bot mid-call, it shows up here — while it runs, and after."}):_.map(s=>(0,t.jsx)(D,{task:s,bots:i,open:e===s.id,onToggle:()=>n(e=>e===s.id?null:s.id),onStop:()=>p(s.id),onDelete:()=>N(s)},s.id)),(0,t.jsx)(T.SettingMore,{hasMore:h,loading:o,sentinelRef:m,ghost:(0,t.jsx)(E,{}),className:"divide-y divide-border/60"})]})})})}],25481)},661504,e=>{"use strict";var t=e.i(271645),n=e.i(699018),s=e.i(677309),r=e.i(271235),i=e.i(802239),a=e.i(646192);let l=Promise.resolve(),o=(0,r.withMiddleware)(n.u,e=>(n,r,o)=>{let u,c=(0,t.useRef)(!1),{cache:d,initialSize:x=1,revalidateAll:f=!1,persistSize:h=!1,revalidateFirstPage:m=!0,revalidateOnMount:g=!1,parallel:p=!1}=o,[,,,k]=s.a.get(s.o);try{(u=(0,s.s)(n?n(0,null):null)[0])&&(u=a.INFINITE_PREFIX+u)}catch(e){}let[v,j,b]=(0,s.c)(d,u),y=(0,t.useCallback)(()=>(0,s.i)(v()._l)?x:v()._l,[d,u,x]);(0,i.useSyncExternalStore)((0,t.useCallback)(e=>u?b(u,()=>{e()}):()=>{},[d,u]),y,y);let w=(0,t.useCallback)(()=>{let e=v()._l;return(0,s.i)(e)?x:e},[u,x]),N=(0,t.useRef)(w());(0,s.u)(()=>{if(!c.current){c.current=!0;return}u&&j({_l:h?N.current:w()})},[u,d]);let S=g&&!c.current,T=e(u,async e=>{let t=v()._i,i=v()._r,a=s.a.get(d),l=a[8],u=()=>a[8]!==l;j({_r:s.U});let c=[],x=w(),[h]=(0,s.c)(d,e),g=h().data,b=[],y=null;for(let e=0;e<x;++e){let[a,l]=(0,s.s)(n(e,p?null:y));if(!a)break;let[x,h]=(0,s.c)(d,a),v=x().data,j=f||t||(0,s.i)(v)||m&&!e&&!(0,s.i)(g)||S||g&&!(0,s.i)(g[e])&&!o.compare(g[e],v);if(r&&("function"==typeof i?i(v,l):j)){let t=async()=>{if(a in k){let e=k[a];delete k[a],v=await e}else v=await r(l);u()||h({data:v,_k:l}),c[e]=v};p?b.push(t):await t()}else c[e]=v;p||(y=v)}return p&&await Promise.all(b.map(e=>e())),u()||j({_i:s.U}),c},o),C=(0,t.useCallback)(function(e,t){let n="boolean"==typeof t?{revalidate:t}:t||{},r=!1!==n.revalidate;return u?(r&&((0,s.i)(e)?j({_i:!0,_r:n.revalidate}):j({_i:!1,_r:n.revalidate})),arguments.length?T.mutate(e,{...n,revalidate:r}):T.mutate()):l},[u,d]),M=(0,t.useCallback)(e=>{let t;if(!u)return l;let[,r]=(0,s.c)(d,u);if((0,s.e)(e)?t=e(w()):"number"==typeof e&&(t=e),"number"!=typeof t)return l;r({_l:t}),N.current=t;let i=[],[a]=(0,s.c)(d,u),o=null;for(let e=0;e<t;++e){let[t]=(0,s.s)(n(e,o)),[r]=(0,s.c)(d,t),l=t?r().data:s.U;if((0,s.i)(l))return C(a().data);i.push(l),o=l}return C(i)},[u,d,C,w]);return{size:w(),setSize:M,mutate:C,get data(){return T.data},get error(){return T.error},get isValidating(){return T.isValidating},get isLoading(){return T.isLoading}}});var u=e.i(41533),c=e.i(283653);e.s(["useServerPages",0,function(e){let n=e.size??u.PAGE_SIZE,{key:s}=e,{data:r,error:i,isLoading:a,isValidating:l,setSize:d,mutate:x}=o((e,t)=>(0,c.resolveKey)(s(e,t)),c.fetchRoute,{dedupingInterval:500,revalidateOnMount:!0,revalidateOnFocus:!0,revalidateOnReconnect:!0,focusThrottleInterval:1e3,revalidateFirstPage:!1,...e.swr}),f=r??[],h=f.flat(),m=f.at(-1),g=void 0!==m&&m.length>=n,p=(0,t.useRef)(0),k=l&&f.length>0&&p.current>f.length,v=(0,t.useRef)({isValidating:l,setSize:d,pages:f.length});v.current={isValidating:l,setSize:d,pages:f.length};let j=(0,c.resolveKey)(s(0,null)),b="string"==typeof j?j:j?.url;(0,t.useEffect)(()=>{if(b)return(0,c.registerPagedReader)({url:b,refresh:()=>x()})},[b,x]);let y=function(e,n={}){let{enabled:s=!0,margin:r="600px",revision:i}=n,a=(0,t.useRef)(e);a.current=e;let l=(0,t.useRef)(null),o=(0,t.useRef)(null),u=(0,t.useCallback)(e=>{l.current=e},[]);return(0,t.useEffect)(()=>{o.current?.disconnect();let e=l.current;if(e&&s)return o.current=new IntersectionObserver(([e])=>{e.isIntersecting&&a.current()},{root:function(e){let t=e.parentElement;for(;t;){let{overflowY:e}=getComputedStyle(t);if(("auto"===e||"scroll"===e)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}(e),rootMargin:r}),o.current.observe(e),()=>o.current?.disconnect()},[s,r,i]),u}(()=>{let e=v.current;e.isValidating||(p.current=e.pages+1,e.setSize(e.pages+1))},{enabled:g,revision:`${f.length}:${l}`});return{items:h,isLoading:a,isLoadingMore:k,error:i,hasMore:g,sentinelRef:y,refresh:()=>x()}}],661504)},759659,e=>{"use strict";var t=e.i(456420);let n={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};n.node;let s=(0,t.default)(n);e.s(["Trash2",0,s],759659)}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,787800,e=>{"use strict";var t=e.i(843476),n=e.i(689664),s=e.i(716327),r=e.i(867927),o=e.i(456420);let a={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};a.node;let i=(0,o.default)(a);var c=e.i(77071);let l={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"}]]};l.node;let d=(0,o.default)(l),m={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"}]]};m.node;let p=(0,o.default)(m);var u=e.i(759659),h=e.i(263676),g=e.i(271645),f=e.i(798120),x=e.i(167881),v=e.i(986530),j=e.i(23750),y=e.i(647163);let b=(0,g.memo)(({data:e,name:n,initialExpandDepth:s=2})=>{let r=(0,g.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 transition-all duration-300",children:(0,t.jsx)(N,{data:r,name:n,depth:0,initialExpandDepth:s})})});b.displayName="JsonView";let N=(0,g.memo)(({data:e,name:n,depth:s=0,initialExpandDepth:r})=>{var o;let a=void 0===e?"undefined":Array.isArray(e)?"array":null===e?"null":typeof e,[i,c]=(0,g.useState)("string"!==a&&s<r),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(a){case"object":case"array":let d,m,p;return m=(d=(o="array"===a)?e:Object.entries(e)).length,p={open:o?"[":"{",close:o?"]":"}",collapsed:o?"[ ... ]":"{ ... }",empty:o?"[]":"{}"},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:p.empty})]}):(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30",onClick:()=>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:p.open}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:p.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:o?d.map((e,n)=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(N,{data:e,name:`${n}`,depth:s+1,initialExpandDepth:r})},n)):d.map(([e,n])=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(N,{data:n,name:e,depth:s+1,initialExpandDepth:r})},e))}),(0,t.jsx)("div",{className:"text-muted-foreground",children:p.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,y.cn)(l.string,"cursor-pointer group-hover:text-foreground"),onClick:()=>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[a]||l.default,children:null===e?"null":String(e)})]})}});N.displayName="JsonNode";var k=e.i(917162),S=e.i(319036),C=e.i(127341),w=e.i(184762),z=e.i(6799),O=e.i(95187);let T=(0,O.createServerReference)("7f5794ac71620e44519ac5e4528c812ec673d30e36",O.callServer,void 0,O.findSourceMapURL,"callToolAction"),A=(0,O.createServerReference)("7f8b31e414a34ee8f44144711314836c2ef544e4d6",O.callServer,void 0,O.findSourceMapURL,"deleteServerAction"),I=(0,O.createServerReference)("7f01ea36e10e34b1bdd93e76c79733f6d9944ba5ab",O.callServer,void 0,O.findSourceMapURL,"refreshServerAction"),P=(0,O.createServerReference)("7f0f31e6c8be9bc825768389fc145a1b3446503296",O.callServer,void 0,O.findSourceMapURL,"registerServerAction");var F=e.i(681307),$=e.i(245629);let M=F.z.object({url:F.z.url(),headers:F.z.record(F.z.string(),F.z.string()).optional(),oauthClient:F.z.object({clientId:F.z.string().min(1),clientSecret:F.z.string().optional()}).optional()}),R=F.z.object({command:F.z.string().min(1),args:F.z.array(F.z.string()).optional(),env:F.z.record(F.z.string(),F.z.string()).optional()}),D=F.z.union([M,R]),E=F.z.object({name:F.z.string(),description:F.z.string().optional(),inputSchema:F.z.looseObject({}).optional(),outputSchema:F.z.looseObject({}).optional()});function L(e){return"url"in e}F.z.object({clientInformation:F.z.looseObject({}).optional(),tokens:F.z.looseObject({}).optional(),authorizationServer:F.z.looseObject({}).optional(),codeVerifier:F.z.string().optional(),state:F.z.string().optional()});let q=F.z.object({name:F.z.string().min(1).max(40),config:D,toolCount:F.z.number().int(),lastError:F.z.string().nullish()}),B=E.extend({id:F.z.number().int(),description:F.z.string().nullish()});q.omit({toolCount:!0}).extend({tools:B.array().default([]),toolsSyncedAt:$.DateLikeSchema});let J=F.z.object({name:F.z.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:D}),U=F.z.union([F.z.object({mcpServers:F.z.record(F.z.string(),D)}),F.z.record(F.z.string(),D)]),K=[{name:"notion",icon:"notion.so",description:"Pages, databases, and search",config:{url:"https://mcp.notion.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:"linear",icon:"linear.app",description:"Issues, projects, and cycles",config:{url:"https://mcp.linear.app/mcp"}},{name:"slack",icon:"slack.com",description:"Channels, messages, and search",config:{url:"https://mcp.slack.com/mcp"}},{name:"atlassian",icon:"atlassian.com",description:"Jira and Confluence",config:{url:"https://mcp.atlassian.com/v1/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:"airtable",icon:"airtable.com",description:"Bases, tables, and records",config:{url:"https://mcp.airtable.com/mcp"}},{name:"box",icon:"box.com",description:"Files, folders, and content search",config:{url:"https://mcp.box.com/mcp"}},{name:"figma",icon:"figma.com",description:"Design files and components",config:{url:"https://mcp.figma.com/mcp"}},{name:"canva",icon:"canva.com",description:"Create and manage designs",config:{url:"https://mcp.canva.com/mcp"}},{name:"sanity",icon:"sanity.io",description:"Structured content and datasets",config:{url:"https://mcp.sanity.io/mcp"}},{name:"webflow",icon:"webflow.com",description:"Sites, pages, and CMS collections",config:{url:"https://mcp.webflow.com/mcp"}},{name:"wix",icon:"wix.com",description:"Sites, stores, and bookings",config:{url:"https://mcp.wix.com/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:"fireflies",icon:"fireflies.ai",description:"Meeting transcripts and summaries",config:{url:"https://mcp.fireflies.ai/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:"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"}},{name:"playwright",icon:"playwright.dev",description:"Drive a real browser",config:{command:"npx",args:["@playwright/mcp@latest"]}},{name:"chrome-devtools",icon:"developer.chrome.com",description:"Inspect and debug Chrome",config:{command:"npx",args:["chrome-devtools-mcp@latest"]}}];var _=e.i(895836),H=e.i(333999),W=e.i(609856),V=e.i(283653);function G({name:e,onDone:n}){let{data:s,isLoading:r}=(0,V.useServerRoute)(f.queryKey.mcpServer(e)),[o,a]=(0,W.useServerAction)(I,{...ec,onOk:t=>{ec.onOk(t),(0,V.revalidate)(f.queryKey.mcpServer(e))}}),[i,c]=(0,W.useServerAction)(A,{okMessage:"Server deleted",onOk:()=>{n(),(0,V.revalidate)(f.queryKey.mcp)}}),l=async()=>{await k.notify.confirm({title:`Delete ${e}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&i(e)};if(r)return(0,t.jsx)(_.SettingSkeleton,{rows:4});if(!s)return null;let m=s.tools.length,p=L(s.config)?"HTTP":"STDIO";return(0,t.jsxs)(_.SettingDialogContent,{title:s.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:p}),(0,t.jsx)("span",{className:"truncate font-mono",children:ed(s.config)})]}),footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(x.Button,{variant:"ghost",loading:c,onClick:l,children:[(0,t.jsx)(u.Trash2,{}),"Delete"]}),(0,t.jsxs)(x.Button,{variant:"outline",loading:a,onClick:()=>o(s.name),children:[(0,t.jsx)(d,{}),"Reconnect"]})]}),children:[s.lastError&&(0,t.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:s.lastError}),(0,t.jsxs)("p",{className:"text-right font-mono text-xs text-muted-foreground",children:[m," ",1===m?"tool":"tools"]}),s.tools.map(e=>(0,t.jsx)(Y,{tool:e,serverName:s.name},e.name))]})}function Q({server:e}){let s=e.toolCount,o=e.lastError?"error":s>0?"connected":"idle";return(0,t.jsxs)("button",{type:"button",onClick:()=>{k.notify.component({className:"sm:max-w-3xl",renderer:({close:n})=>(0,t.jsx)(G,{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)(X,{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"===o&&(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"===o?(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:[" · ",ed(e.config)]})]})})]}),(0,t.jsx)(r.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function X({server:e}){let n,s=(n=K.find(t=>L(t.config)?L(e.config)&&t.config.url.replace(/\/+$/,"")===e.config.url.replace(/\/+$/,""):!L(e.config)&&t.config.command===e.config.command&&(t.config.args??[]).join(" ")===(e.config.args??[]).join(" "))??K.find(t=>t.name===e.name),n?.icon);return s?(0,t.jsx)("img",{src:(0,y.faviconUrl)(s),alt:"",className:"size-5"}):(0,t.jsx)(p,{className:"size-4"})}function Y({tool:e,serverName:n}){let[o,a]=(0,g.useState)(!1),[i,c]=(0,g.useState)(!1),[l,d]=(0,g.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:"min-w-0 space-y-1",children:[(0,t.jsx)("span",{className:"block truncate font-mono text-sm",children:e.name}),e.description?(0,t.jsx)("p",{className:(0,y.cn)("text-xs text-muted-foreground",!l&&"line-clamp-2",e.description.length>140&&"cursor-pointer"),onClick:()=>d(!l),children:e.description}):null]}),(0,t.jsxs)("div",{className:"mt-2 flex justify-end gap-1",children:[m.length>0&&(0,t.jsxs)(x.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>a(!o),children:[o?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(r.ChevronRight,{}),"Schema"]}),(0,t.jsxs)(x.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>c(!i),children:[i?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(r.ChevronRight,{}),"Test"]})]}),o?(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),r=" ".repeat(n);if(Array.isArray(t.enum))return t.enum.map(e=>JSON.stringify(e)).join(" | ");let o=t.anyOf??t.oneOf;if(Array.isArray(o))return o.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 o=t.properties;if(!o||0===Object.keys(o).length)return"{}";let a=t.required??[],i=Object.entries(o).map(([t,r])=>{let o=a.includes(t)?"":"?",i=r?.description,c="string"==typeof i&&i.length<=60?` // ${i}`:"";return`${s}${t}${o}: ${e(r,n+1)}${c}`});return`{
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,787800,e=>{"use strict";var t=e.i(843476),n=e.i(689664),s=e.i(716327),r=e.i(867927),o=e.i(456420);let a={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};a.node;let i=(0,o.default)(a);var c=e.i(77071);let l={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"}]]};l.node;let d=(0,o.default)(l),m={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"}]]};m.node;let p=(0,o.default)(m);var u=e.i(759659),h=e.i(263676),g=e.i(271645),f=e.i(798120),x=e.i(167881),v=e.i(986530),j=e.i(23750),y=e.i(647163);let b=(0,g.memo)(({data:e,name:n,initialExpandDepth:s=2})=>{let r=(0,g.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 transition-all duration-300",children:(0,t.jsx)(N,{data:r,name:n,depth:0,initialExpandDepth:s})})});b.displayName="JsonView";let N=(0,g.memo)(({data:e,name:n,depth:s=0,initialExpandDepth:r})=>{var o;let a=void 0===e?"undefined":Array.isArray(e)?"array":null===e?"null":typeof e,[i,c]=(0,g.useState)("string"!==a&&s<r),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(a){case"object":case"array":let d,m,p;return m=(d=(o="array"===a)?e:Object.entries(e)).length,p={open:o?"[":"{",close:o?"]":"}",collapsed:o?"[ ... ]":"{ ... }",empty:o?"[]":"{}"},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:p.empty})]}):(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30",onClick:()=>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:p.open}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:p.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:o?d.map((e,n)=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(N,{data:e,name:`${n}`,depth:s+1,initialExpandDepth:r})},n)):d.map(([e,n])=>(0,t.jsx)("div",{className:"my-1",children:(0,t.jsx)(N,{data:n,name:e,depth:s+1,initialExpandDepth:r})},e))}),(0,t.jsx)("div",{className:"text-muted-foreground",children:p.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,y.cn)(l.string,"cursor-pointer group-hover:text-foreground"),onClick:()=>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[a]||l.default,children:null===e?"null":String(e)})]})}});N.displayName="JsonNode";var k=e.i(917162),S=e.i(319036),C=e.i(127341),w=e.i(184762),z=e.i(6799),O=e.i(95187);let T=(0,O.createServerReference)("7fa0c79ff2fb7f80629f25e491a9e69729aeedbd9a",O.callServer,void 0,O.findSourceMapURL,"callToolAction"),A=(0,O.createServerReference)("7f3396873361a98f9646981d66a61d2f8a456275ad",O.callServer,void 0,O.findSourceMapURL,"deleteServerAction"),I=(0,O.createServerReference)("7f959e357c3e9baa28d463b01bf77f8d21bdb66ca6",O.callServer,void 0,O.findSourceMapURL,"refreshServerAction"),P=(0,O.createServerReference)("7f6eacef15427e497ad6330ff0fa5820ce77ba0e87",O.callServer,void 0,O.findSourceMapURL,"registerServerAction");var F=e.i(681307),$=e.i(245629);let M=F.z.object({url:F.z.url(),headers:F.z.record(F.z.string(),F.z.string()).optional(),oauthClient:F.z.object({clientId:F.z.string().min(1),clientSecret:F.z.string().optional()}).optional()}),R=F.z.object({command:F.z.string().min(1),args:F.z.array(F.z.string()).optional(),env:F.z.record(F.z.string(),F.z.string()).optional()}),D=F.z.union([M,R]),E=F.z.object({name:F.z.string(),description:F.z.string().optional(),inputSchema:F.z.looseObject({}).optional(),outputSchema:F.z.looseObject({}).optional()});function L(e){return"url"in e}F.z.object({clientInformation:F.z.looseObject({}).optional(),tokens:F.z.looseObject({}).optional(),authorizationServer:F.z.looseObject({}).optional(),codeVerifier:F.z.string().optional(),state:F.z.string().optional()});let q=F.z.object({name:F.z.string().min(1).max(40),config:D,toolCount:F.z.number().int(),lastError:F.z.string().nullish()}),B=E.extend({id:F.z.number().int(),description:F.z.string().nullish()});q.omit({toolCount:!0}).extend({tools:B.array().default([]),toolsSyncedAt:$.DateLikeSchema});let J=F.z.object({name:F.z.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:D}),U=F.z.union([F.z.object({mcpServers:F.z.record(F.z.string(),D)}),F.z.record(F.z.string(),D)]),K=[{name:"notion",icon:"notion.so",description:"Pages, databases, and search",config:{url:"https://mcp.notion.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:"linear",icon:"linear.app",description:"Issues, projects, and cycles",config:{url:"https://mcp.linear.app/mcp"}},{name:"slack",icon:"slack.com",description:"Channels, messages, and search",config:{url:"https://mcp.slack.com/mcp"}},{name:"atlassian",icon:"atlassian.com",description:"Jira and Confluence",config:{url:"https://mcp.atlassian.com/v1/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:"airtable",icon:"airtable.com",description:"Bases, tables, and records",config:{url:"https://mcp.airtable.com/mcp"}},{name:"box",icon:"box.com",description:"Files, folders, and content search",config:{url:"https://mcp.box.com/mcp"}},{name:"figma",icon:"figma.com",description:"Design files and components",config:{url:"https://mcp.figma.com/mcp"}},{name:"canva",icon:"canva.com",description:"Create and manage designs",config:{url:"https://mcp.canva.com/mcp"}},{name:"sanity",icon:"sanity.io",description:"Structured content and datasets",config:{url:"https://mcp.sanity.io/mcp"}},{name:"webflow",icon:"webflow.com",description:"Sites, pages, and CMS collections",config:{url:"https://mcp.webflow.com/mcp"}},{name:"wix",icon:"wix.com",description:"Sites, stores, and bookings",config:{url:"https://mcp.wix.com/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:"fireflies",icon:"fireflies.ai",description:"Meeting transcripts and summaries",config:{url:"https://mcp.fireflies.ai/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:"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"}},{name:"playwright",icon:"playwright.dev",description:"Drive a real browser",config:{command:"npx",args:["@playwright/mcp@latest"]}},{name:"chrome-devtools",icon:"developer.chrome.com",description:"Inspect and debug Chrome",config:{command:"npx",args:["chrome-devtools-mcp@latest"]}}];var _=e.i(895836),H=e.i(333999),W=e.i(609856),V=e.i(283653);function G({name:e,onDone:n}){let{data:s,isLoading:r}=(0,V.useServerRoute)(f.queryKey.mcpServer(e)),[o,a]=(0,W.useServerAction)(I,{...ec,onOk:t=>{ec.onOk(t),(0,V.revalidate)(f.queryKey.mcpServer(e))}}),[i,c]=(0,W.useServerAction)(A,{okMessage:"Server deleted",onOk:()=>{n(),(0,V.revalidate)(f.queryKey.mcp)}}),l=async()=>{await k.notify.confirm({title:`Delete ${e}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&i(e)};if(r)return(0,t.jsx)(_.SettingSkeleton,{rows:4});if(!s)return null;let m=s.tools.length,p=L(s.config)?"HTTP":"STDIO";return(0,t.jsxs)(_.SettingDialogContent,{title:s.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:p}),(0,t.jsx)("span",{className:"truncate font-mono",children:ed(s.config)})]}),footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(x.Button,{variant:"ghost",loading:c,onClick:l,children:[(0,t.jsx)(u.Trash2,{}),"Delete"]}),(0,t.jsxs)(x.Button,{variant:"outline",loading:a,onClick:()=>o(s.name),children:[(0,t.jsx)(d,{}),"Reconnect"]})]}),children:[s.lastError&&(0,t.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:s.lastError}),(0,t.jsxs)("p",{className:"text-right font-mono text-xs text-muted-foreground",children:[m," ",1===m?"tool":"tools"]}),s.tools.map(e=>(0,t.jsx)(Y,{tool:e,serverName:s.name},e.name))]})}function Q({server:e}){let s=e.toolCount,o=e.lastError?"error":s>0?"connected":"idle";return(0,t.jsxs)("button",{type:"button",onClick:()=>{k.notify.component({className:"sm:max-w-3xl",renderer:({close:n})=>(0,t.jsx)(G,{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)(X,{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"===o&&(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"===o?(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:[" · ",ed(e.config)]})]})})]}),(0,t.jsx)(r.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function X({server:e}){let n,s=(n=K.find(t=>L(t.config)?L(e.config)&&t.config.url.replace(/\/+$/,"")===e.config.url.replace(/\/+$/,""):!L(e.config)&&t.config.command===e.config.command&&(t.config.args??[]).join(" ")===(e.config.args??[]).join(" "))??K.find(t=>t.name===e.name),n?.icon);return s?(0,t.jsx)("img",{src:(0,y.faviconUrl)(s),alt:"",className:"size-5"}):(0,t.jsx)(p,{className:"size-4"})}function Y({tool:e,serverName:n}){let[o,a]=(0,g.useState)(!1),[i,c]=(0,g.useState)(!1),[l,d]=(0,g.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:"min-w-0 space-y-1",children:[(0,t.jsx)("span",{className:"block truncate font-mono text-sm",children:e.name}),e.description?(0,t.jsx)("p",{className:(0,y.cn)("text-xs text-muted-foreground",!l&&"line-clamp-2",e.description.length>140&&"cursor-pointer"),onClick:()=>d(!l),children:e.description}):null]}),(0,t.jsxs)("div",{className:"mt-2 flex justify-end gap-1",children:[m.length>0&&(0,t.jsxs)(x.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>a(!o),children:[o?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(r.ChevronRight,{}),"Schema"]}),(0,t.jsxs)(x.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>c(!i),children:[i?(0,t.jsx)(s.ChevronDown,{}):(0,t.jsx)(r.ChevronRight,{}),"Test"]})]}),o?(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),r=" ".repeat(n);if(Array.isArray(t.enum))return t.enum.map(e=>JSON.stringify(e)).join(" | ");let o=t.anyOf??t.oneOf;if(Array.isArray(o))return o.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 o=t.properties;if(!o||0===Object.keys(o).length)return"{}";let a=t.required??[],i=Object.entries(o).map(([t,r])=>{let o=a.includes(t)?"":"?",i=r?.description,c="string"==typeof i&&i.length<=60?` // ${i}`:"";return`${s}${t}${o}: ${e(r,n+1)}${c}`});return`{
|
|
2
2
|
${i.join("\n")}
|
|
3
3
|
${r}}`}return Array.isArray(t.type)?t.type.join(" | "):"string"==typeof t.type?t.type:"unknown"}(n)})]},e))}):null,i?(0,t.jsx)(Z,{tool:e,serverName:n}):null]})}function Z({tool:e,serverName:n}){let[s,r]=(0,g.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,a]=(0,g.useState)(""),[c,l,d,m,p]=(0,W.useServerAction)(T,{errorMessage:!1});return(0,t.jsxs)("div",{className:"mt-2 space-y-2 rounded-lg border border-input p-3",children:[(0,t.jsx)(w.Textarea,{value:s,onChange:e=>r(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)(x.Button,{size:"sm",loading:l,onClick:()=>{let t;try{t=s.trim()?JSON.parse(s):void 0}catch{a("Not valid JSON");return}a(""),p(),c(n,e.name,t)},children:[!l&&(0,t.jsx)(i,{}),"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 ee(e){return k.notify.component({className:"sm:max-w-lg",renderer:({close:n})=>(0,t.jsx)(et,{initial:e,onDone:n})})}function et({initial:e,onDone:n}){let s=e&&L(e.config)?e.config:void 0,r=e&&!L(e.config)?e.config:void 0,[o,a]=(0,H.useObjectState)({mode:r?"stdio":"http",name:e?.name??"",url:s?.url??"",headers:er(s?.headers),clientId:s?.oauthClient?.clientId??"",clientSecret:s?.oauthClient?.clientSecret??"",command:r?.command??"",args:(r?.args??[]).join(" "),env:er(r?.env),raw:""}),{mode:i,name:c,url:l,headers:d,clientId:m,clientSecret:p,command:u,args:h,env:f,raw:y}=o,[b,N]=(0,W.useServerAction)(P,{...ec,onOk:e=>{ec.onOk(e),"error"!==e.status&&n()}}),k=(0,g.useMemo)(()=>{var e,t,n,s,r,o,a;let c,g;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=D.safeParse(t);if(s.success)return{value:{name:null,config:s.data},error:""};let r=U.safeParse(t);if(!r.success)return{value:null,error:"Needs a url or a command"};let o=Object.entries("mcpServers"in r.data?r.data.mcpServers:r.data)[0];return o?{value:{name:o[0],config:o[1]},error:""}:{value:null,error:"No server in there"}}(y):"http"===i?(e=l,t=d,n=m,s=p,(c=M.safeParse({url:e.trim(),headers:eo(t),oauthClient:n.trim()?{clientId:n.trim(),clientSecret:s.trim()}:void 0})).success?{value:{name:null,config:c.data},error:""}:{value:null,error:e.trim()?"Needs a valid url":""}):(r=u,o=h,a=f,(g=R.safeParse({command:r.trim(),args:o.split(/\s+/).filter(Boolean),env:eo(a)})).success?{value:{name:null,config:g.data},error:""}:{value:null,error:r.trim()?"Needs a command":""})},[i,y,l,d,m,p,u,h,f]),z="json"===i?y:JSON.stringify([i,l,d,m,p,u,h,f]),[O,T]=(0,g.useState)(z);(0,g.useEffect)(()=>{let e=setTimeout(()=>T(z),700);return()=>clearTimeout(e)},[z]);let A=O===z?k.error:"",I=c||k.value?.name||"",F=J.safeParse({name:I,config:k.value?.config});function $(e){let t=k.value?.config;return t?"json"===e?a({mode:e,raw:JSON.stringify(t,null,2)}):"http"===e&&L(t)?a({mode:e,url:t.url,headers:er(t.headers),clientId:t.oauthClient?.clientId??"",clientSecret:t.oauthClient?.clientSecret??""}):"stdio"!==e||L(t)?void a({mode:e}):a({mode:e,command:t.command,args:(t.args??[]).join(" "),env:er(t.env)}):a({mode:e})}let E=(0,t.jsxs)("span",{className:"flex items-center gap-2 font-mono text-xs text-muted-foreground",children:["JSON",(0,t.jsx)(S.Switch,{size:"sm",checked:"json"===i,onCheckedChange:e=>{let t;return e?$("json"):void $((t=k.value?.config)&&!L(t)?"stdio":"http")}})]});return(0,t.jsx)(_.SettingDialogContent,{title:"Add MCP server",description:"Its tools become available to Thursday and every sub-agent.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Button,{variant:"ghost",onClick:n,children:"Cancel"}),(0,t.jsx)(x.Button,{disabled:!F.success,loading:N,onClick:()=>{F.success&&!N&&b(F.data)},children:"Connect"})]}),children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"Name"}),(0,t.jsx)(j.Input,{value:I,onChange:e=>a({name:e.target.value}),placeholder:"notion",spellCheck:!1})]}),"json"===i?(0,t.jsxs)(v.Field,{children:[(0,t.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,t.jsx)(v.FieldLabel,{children:"JSON"}),E]}),(0,t.jsx)(w.Textarea,{value:y,onChange:e=>a({raw:e.target.value}),spellCheck:!1,placeholder:ea,className:"min-h-64 resize-none font-mono text-xs"})]}):(0,t.jsxs)(C.Tabs,{value:i,onValueChange:e=>$(e),className:"gap-6",children:[(0,t.jsxs)(v.Field,{children:[(0,t.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,t.jsx)(v.FieldLabel,{children:"Transport"}),E]}),(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)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"URL"}),(0,t.jsx)(j.Input,{value:l,onChange:e=>a({url:e.target.value}),placeholder:"https://mcp.notion.com/mcp",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsx)(en,{label:"Headers",pairs:d,onChange:e=>a({headers:e}),keyPlaceholder:"Authorization",valuePlaceholder:"Bearer sk-..."}),(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"OAuth client"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(j.Input,{value:m,onChange:e=>a({clientId:e.target.value}),placeholder:"Client ID",spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(j.Input,{value:p,onChange:e=>a({clientSecret:e.target.value}),placeholder:"Client secret",spellCheck:!1,type:"password",className:"font-mono text-xs"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Only for servers that refuse to register clients on their own, like Figma. Leave empty and one is created during sign-in."})]})]}),(0,t.jsxs)(C.TabsContent,{value:"stdio",className:"space-y-6",children:[(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"Command"}),(0,t.jsx)(j.Input,{value:u,onChange:e=>a({command:e.target.value}),placeholder:"npx",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.FieldLabel,{children:"Args"}),(0,t.jsx)(j.Input,{value:h,onChange:e=>a({args:e.target.value}),placeholder:"-y @notionhq/notion-mcp-server",spellCheck:!1,className:"font-mono text-xs"})]}),(0,t.jsx)(en,{label:"Env",pairs:f,onChange:e=>a({env:e}),keyPlaceholder:"NOTION_TOKEN",valuePlaceholder:"ntn_..."})]})]}),A&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:A})]})})}function en({label:e,pairs:n,onChange:s,keyPlaceholder:r,valuePlaceholder:o}){let a=(e,t)=>s(n.map(n=>n.id===e?{...n,...t}:n));return(0,t.jsxs)(v.Field,{children:[(0,t.jsx)(v.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)(j.Input,{value:e.key,onChange:t=>a(e.id,{key:t.target.value}),placeholder:r,spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(j.Input,{value:e.value,onChange:t=>a(e.id,{value:t.target.value}),placeholder:o,spellCheck:!1,className:"font-mono text-xs"}),(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",onClick:()=>s(n.filter(t=>t.id!==e.id)),children:(0,t.jsx)(h.X,{})})]},e.id)),(0,t.jsxs)(x.Button,{variant:"outline",size:"sm",onClick:()=>s([...n,es()]),children:[(0,t.jsx)(c.Plus,{}),"Add"]})]})]})}let es=(e="",t="")=>({id:crypto.randomUUID(),key:e,value:t}),er=e=>Object.entries(e??{}).map(([e,t])=>es(e,t)),eo=e=>{let t=e.filter(e=>e.key.trim());if(t.length)return Object.fromEntries(t.map(e=>[e.key.trim(),e.value]))},ea=`/** STDIO Example */
|
|
4
4
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,833959,e=>{"use strict";var t=e.i(843476),s=e.i(456420);let n={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"}]]};n.node;let r=(0,s.default)(n);var i=e.i(328256),l=e.i(24071),a=e.i(867927),o=e.i(829600),d=e.i(226091),c=e.i(726067),u=e.i(91511);let m={name:"mouse-pointer-2",size:24,node:[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]};m.node;let x=(0,s.default)(m);var h=e.i(77071),p=e.i(566595);let f={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"]};f.node;let g=(0,s.default)(f);var j=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 k=(0,s.default)(v);var b=e.i(271645),y=e.i(798120),N=e.i(167881),S=e.i(986530),w=e.i(23750),C=e.i(683408),z=e.i(917162),M=e.i(671428),R=e.i(319036),F=e.i(127341),L=e.i(184762),T=e.i(41533),A=e.i(895836),D=e.i(95187);let $=(0,D.createServerReference)("7f4d47e01fc323498dec73a09cf3336f5d4c1d51e0",D.callServer,void 0,D.findSourceMapURL,"createSkillAction"),K=(0,D.createServerReference)("7f3ddbf37770ac395e5d1cbd8e5defa43d735b967a",D.callServer,void 0,D.findSourceMapURL,"deleteSkillAction"),q=(0,D.createServerReference)("7f3acf83fcc379119e185d7a3834d5eed97ad0a1c1",D.callServer,void 0,D.findSourceMapURL,"setSkillDisabledAction"),P=(0,D.createServerReference)("7fe6ee51994f51caff9011049ffe2a9aa4153d8a4e",D.callServer,void 0,D.findSourceMapURL,"uploadSkillAction");var B=e.i(609856),O=e.i(283653),U=e.i(647163);let I={browser:u.Globe,computer:r,"find-skills":p.Search,"interactive-page":x,"skill-creator":g};function E({skill:e}){let[s,n]=(0,B.useServerAction)(K,{onOk:()=>(0,O.revalidate)(y.queryKey.skills)}),[r]=(0,B.useServerAction)(q,{onOk:()=>(0,O.revalidate)(y.queryKey.skills)}),l=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.dir)},o="default"===e.source&&I[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)(H,{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,U.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,U.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})]}),(0,t.jsx)(a.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)(R.Switch,{checked:!e.disabled,onCheckedChange:t=>r(e.source,e.dir,!t),"aria-label":`${e.name} on or off`,className:"shrink-0"}),"custom"===e.source?(0,t.jsx)(N.Button,{size:"icon-sm",variant:"ghost",loading:n,onClick:l,className:"shrink-0 text-muted-foreground",children:(0,t.jsx)(j.Trash2,{})}):(0,t.jsx)("span",{className:"size-7 shrink-0"})]})]})}function H({skill:e}){let[s,n]=(0,b.useState)(""),[r,i]=(0,b.useState)("SKILL.md");return(0,t.jsx)(A.SettingDialogContent,{title:e.name,description:(0,t.jsx)(W,{skill:e,path:r??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:()=>n(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)(l.ChevronLeft,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:s.split("/").pop()})]}),(0,t.jsx)(G,{source:e.source,dir:e.dir,path:s,current:r,onPick:e=>{let t=s?`${s}/${e.name}`:e.name;"dir"===e.kind?n(t):i(t)}})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r?(0,t.jsx)(Z,{source:e.source,dir:e.dir,path:r}):(0,t.jsx)("p",{className:"p-6 text-sm text-muted-foreground/60",children:"Pick a file"})})]})})}function W({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 n=[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:n.map((e,s)=>(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[s>0&&(0,t.jsx)(a.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,t.jsx)("span",{className:(0,U.cn)("truncate",s===n.length-1&&"text-foreground"),children:e})]},`${s}-${e}`))})}function V({icon:e,label:s,active:n,hasChildren:r,onClick:i}){return(0,t.jsxs)("button",{type:"button",onClick:i,className:(0,U.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",n?"bg-secondary text-foreground":"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}),r&&(0,t.jsx)(a.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground/50"})]})}function G({source:e,dir:s,path:n,current:r,onPick:i}){let{data:l,isLoading:a,error:u}=(0,O.useServerRoute)(y.queryKey.skillNode(e,s,n));return u?(0,t.jsx)("p",{className:"p-3 font-mono text-xs text-destructive",children:u.message}):a||!l?(0,t.jsxs)("div",{className:"space-y-2 p-2",children:[(0,t.jsx)(M.Skeleton,{className:"h-5 w-full"}),(0,t.jsx)(M.Skeleton,{className:"h-5 w-4/5"})]}):"dir"!==l.kind?null:(0,t.jsxs)(t.Fragment,{children:[l.entries.map(e=>(0,t.jsx)(V,{icon:"dir"===e.kind?(0,t.jsx)(c.Folder,{}):e.name.endsWith(".md")?(0,t.jsx)(d.FileText,{}):(0,t.jsx)(o.File,{}),label:e.name,hasChildren:"dir"===e.kind,active:(n?`${n}/${e.name}`:e.name)===r,onClick:()=>i(e)},e.name)),0===l.entries.length&&(0,t.jsx)("p",{className:"p-3 text-xs text-muted-foreground/60",children:"Empty folder"})]})}function Y({content:e}){let s=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e),n=s?.[1].trim(),r=s?e.slice(s[0].length):e;return(0,t.jsxs)("div",{className:"min-w-0",children:[n&&(0,t.jsx)("pre",{className:"border-b border-border/60 bg-muted/20 px-5 py-3 font-mono text-[11px] leading-relaxed whitespace-pre-wrap text-muted-foreground",children:n}),(0,t.jsx)("div",{className:"px-5 py-4 text-sm leading-relaxed",children:(0,t.jsx)(C.Markdown,{children:r})})]})}function Z({source:e,dir:s,path:n}){let{data:r,isLoading:i,error:l}=(0,O.useServerRoute)(y.queryKey.skillNode(e,s,n));if(l)return(0,t.jsx)("p",{className:"p-4 font-mono text-xs text-destructive",children:l.message});if(i||!r)return(0,t.jsxs)("div",{className:"space-y-3 p-5",children:[(0,t.jsx)(M.Skeleton,{className:"h-5 w-2/3"}),(0,t.jsx)(M.Skeleton,{className:"h-4 w-full"}),(0,t.jsx)(M.Skeleton,{className:"h-4 w-5/6"})]});if("file"!==r.kind)return null;let a=n.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:a}),(0,t.jsx)("span",{className:"shrink-0",children:(0,U.formatBytes)(r.size)})]}),null===r.content?(0,t.jsx)("p",{className:"px-5 py-4 text-sm text-muted-foreground/60",children:"Not a text file — the agent can still read it from disk."}):a.toLowerCase().endsWith(".md")?(0,t.jsx)(Y,{content:r.content}):(0,t.jsx)("pre",{className:"overflow-x-auto px-5 py-4 font-mono text-[13px] leading-relaxed whitespace-pre text-foreground/90",children:r.content})]})}function _(){return z.notify.component({className:"sm:max-w-lg",renderer:({close:e})=>(0,t.jsx)(J,{onDone:e})})}function J({onDone:e}){let[s,n]=(0,b.useState)("write"),[r,i]=(0,b.useState)(""),[l,a]=(0,b.useState)(""),[o,d]=(0,b.useState)(""),[c,u]=(0,b.useState)(null),[m,x]=(0,b.useState)(!1),p=(0,b.useRef)(null),f={errorMessage:!1,onOk:()=>{(0,O.revalidate)(y.queryKey.skills),e()}},[g,j,,v]=(0,B.useServerAction)($,f),[C,z,,M]=(0,B.useServerAction)(P,f),R=j||z,D="write"===s?v:M,K=!R&&("write"===s?r.trim()&&l.trim()&&o.trim():null!==c),q=async()=>{var e;!K||("write"===s?g({name:r.trim(),description:l.trim(),content:o}):c&&C({fileName:c.name,base64:await (e=c,new Promise((t,s)=>{let n=new FileReader;n.onload=()=>{let e=n.result;t(e.slice(e.indexOf(",")+1))},n.onerror=()=>s(n.error),n.readAsDataURL(e)}))}))},I=e=>{let t=e?.[0]??null;t&&u(t)};return(0,t.jsxs)(A.SettingDialogContent,{title:"New skill",description:"Instructions the agent loads by name when a task calls for them.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.Button,{variant:"ghost",onClick:e,children:"Cancel"}),(0,t.jsxs)(N.Button,{disabled:!K,loading:R,onClick:q,children:[!R&&("write"===s?(0,t.jsx)(h.Plus,{}):(0,t.jsx)(k,{})),"write"===s?"Create":"Upload"]})]}),children:[(0,t.jsxs)(F.Tabs,{value:s,onValueChange:e=>n(e),children:[(0,t.jsxs)(F.TabsList,{className:"w-full",children:[(0,t.jsx)(F.TabsTrigger,{value:"write",children:"Write"}),(0,t.jsx)(F.TabsTrigger,{value:"upload",children:"Upload"})]}),(0,t.jsxs)(F.TabsContent,{value:"write",className:"space-y-5 pt-4",children:[(0,t.jsxs)(S.Field,{children:[(0,t.jsx)(S.FieldLabel,{htmlFor:"skill-name",children:"Name"}),(0,t.jsxs)(S.FieldContent,{children:[(0,t.jsx)(w.Input,{id:"skill-name",value:r,onChange:e=>i(e.target.value),placeholder:"deploy-checklist",spellCheck:!1,autoFocus:!0}),(0,t.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[T.PATHS.skills.custom,"/",r.trim()||"…","/SKILL.md"]})]})]}),(0,t.jsxs)(S.Field,{children:[(0,t.jsx)(S.FieldLabel,{htmlFor:"skill-description",children:"Description"}),(0,t.jsx)(S.FieldContent,{children:(0,t.jsx)(w.Input,{id:"skill-description",value:l,onChange:e=>a(e.target.value),placeholder:"When to use it — this is how the agent decides to load it"})})]}),(0,t.jsxs)(S.Field,{children:[(0,t.jsx)(S.FieldLabel,{htmlFor:"skill-content",children:"Content"}),(0,t.jsx)(L.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:()=>p.current?.click(),onDragOver:e=>{e.preventDefault(),x(!0)},onDragLeave:()=>x(!1),onDrop:e=>{e.preventDefault(),x(!1),I(e.dataTransfer.files)},className:(0,U.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)(k,{className:"size-5 text-muted-foreground"}),c?(0,t.jsxs)("span",{className:"text-sm",children:[c.name,(0,t.jsx)("span",{className:"ml-2 font-mono text-[11px] text-muted-foreground",children:(0,U.formatBytes)(c.size)})]}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Drop a file here, or click to choose"})]}),(0,t.jsx)("input",{ref:p,type:"file",accept:".md,.zip,.skill",className:"hidden",onChange:e=>I(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."]})]})]})]}),D&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:D})]})}e.s(["SkillsSetting",0,function(){let[e,s]=(0,b.useState)(""),{data:n,isLoading:r,error:i}=(0,O.useServerRoute)(y.queryKey.skills),l=n??[];if(r)return(0,t.jsx)(A.SettingSkeleton,{rows:4});if(i)return(0,t.jsx)(A.SettingError,{message:i.message});let a=e.trim().toLowerCase(),o=l.filter(e=>!a||`${e.name} ${e.description}`.toLowerCase().includes(a)),d=l.filter(e=>!e.disabled).length;return(0,t.jsxs)(A.SettingScreen,{footer:(0,t.jsxs)(A.SettingRailNote,{children:[l.filter(e=>"default"===e.source).length," shipped · ",l.filter(e=>"custom"===e.source).length," ","installed"]}),children:[(0,t.jsx)(A.SettingToolbar,{count:`${d} on \xb7 ${l.length-d} off`,children:(0,t.jsx)(A.SettingFilter,{value:e,onChange:s,placeholder:"Filter skills"})}),(0,t.jsx)(A.SettingGroup,{label:"Custom",hint:"yours — added here · wins a name clash",children:(0,t.jsx)(A.SettingItems,{addRow:{label:"Add skill",onClick:_},children:o.filter(e=>"custom"===e.source).map(e=>(0,t.jsx)(E,{skill:e},`custom/${e.dir}`))})}),(0,t.jsx)(A.SettingGroup,{label:"Default",hint:"ships with the app · switch off, can't edit or delete",children:(0,t.jsx)(A.SettingItems,{children:o.filter(e=>"default"===e.source).map(e=>(0,t.jsx)(E,{skill:e},`default/${e.dir}`))})}),d>T.PROMPT_CROWDED.skills&&(0,t.jsxs)(A.SettingNote,{children:[d," skills are on. Each is a line in every prompt a bot reads, and one more to look past when it picks."]})]})},"openSkillCreate",0,_],833959)},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 n=(0,t.default)(s);e.s(["Folder",0,n],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 n=(0,t.default)(s);e.s(["Trash2",0,n],759659)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,833959,e=>{"use strict";var t=e.i(843476),s=e.i(456420);let n={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"}]]};n.node;let r=(0,s.default)(n);var i=e.i(328256),l=e.i(24071),a=e.i(867927),o=e.i(829600),d=e.i(226091),c=e.i(726067),u=e.i(91511);let m={name:"mouse-pointer-2",size:24,node:[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]};m.node;let x=(0,s.default)(m);var h=e.i(77071),p=e.i(566595);let f={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"]};f.node;let g=(0,s.default)(f);var j=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 k=(0,s.default)(v);var b=e.i(271645),y=e.i(798120),N=e.i(167881),S=e.i(986530),w=e.i(23750),C=e.i(683408),z=e.i(917162),M=e.i(671428),R=e.i(319036),F=e.i(127341),L=e.i(184762),T=e.i(41533),A=e.i(895836),D=e.i(95187);let $=(0,D.createServerReference)("7f6ea0b94fed342484ac46cbadf1b8c4a65574103d",D.callServer,void 0,D.findSourceMapURL,"createSkillAction"),K=(0,D.createServerReference)("7f5d8a58afc993b28e0d65ceb273bbc1563a5a0f96",D.callServer,void 0,D.findSourceMapURL,"deleteSkillAction"),q=(0,D.createServerReference)("7ff3e5663097e128448f141172ac1d19851ee8456b",D.callServer,void 0,D.findSourceMapURL,"setSkillDisabledAction"),P=(0,D.createServerReference)("7fee438d730e3bae9a984816f037af1ba292df2e98",D.callServer,void 0,D.findSourceMapURL,"uploadSkillAction");var B=e.i(609856),O=e.i(283653),U=e.i(647163);let I={browser:u.Globe,computer:r,"find-skills":p.Search,"interactive-page":x,"skill-creator":g};function E({skill:e}){let[s,n]=(0,B.useServerAction)(K,{onOk:()=>(0,O.revalidate)(y.queryKey.skills)}),[r]=(0,B.useServerAction)(q,{onOk:()=>(0,O.revalidate)(y.queryKey.skills)}),l=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.dir)},o="default"===e.source&&I[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)(H,{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,U.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,U.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})]}),(0,t.jsx)(a.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)(R.Switch,{checked:!e.disabled,onCheckedChange:t=>r(e.source,e.dir,!t),"aria-label":`${e.name} on or off`,className:"shrink-0"}),"custom"===e.source?(0,t.jsx)(N.Button,{size:"icon-sm",variant:"ghost",loading:n,onClick:l,className:"shrink-0 text-muted-foreground",children:(0,t.jsx)(j.Trash2,{})}):(0,t.jsx)("span",{className:"size-7 shrink-0"})]})]})}function H({skill:e}){let[s,n]=(0,b.useState)(""),[r,i]=(0,b.useState)("SKILL.md");return(0,t.jsx)(A.SettingDialogContent,{title:e.name,description:(0,t.jsx)(W,{skill:e,path:r??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:()=>n(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)(l.ChevronLeft,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:s.split("/").pop()})]}),(0,t.jsx)(G,{source:e.source,dir:e.dir,path:s,current:r,onPick:e=>{let t=s?`${s}/${e.name}`:e.name;"dir"===e.kind?n(t):i(t)}})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r?(0,t.jsx)(Z,{source:e.source,dir:e.dir,path:r}):(0,t.jsx)("p",{className:"p-6 text-sm text-muted-foreground/60",children:"Pick a file"})})]})})}function W({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 n=[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:n.map((e,s)=>(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[s>0&&(0,t.jsx)(a.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,t.jsx)("span",{className:(0,U.cn)("truncate",s===n.length-1&&"text-foreground"),children:e})]},`${s}-${e}`))})}function V({icon:e,label:s,active:n,hasChildren:r,onClick:i}){return(0,t.jsxs)("button",{type:"button",onClick:i,className:(0,U.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",n?"bg-secondary text-foreground":"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}),r&&(0,t.jsx)(a.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground/50"})]})}function G({source:e,dir:s,path:n,current:r,onPick:i}){let{data:l,isLoading:a,error:u}=(0,O.useServerRoute)(y.queryKey.skillNode(e,s,n));return u?(0,t.jsx)("p",{className:"p-3 font-mono text-xs text-destructive",children:u.message}):a||!l?(0,t.jsxs)("div",{className:"space-y-2 p-2",children:[(0,t.jsx)(M.Skeleton,{className:"h-5 w-full"}),(0,t.jsx)(M.Skeleton,{className:"h-5 w-4/5"})]}):"dir"!==l.kind?null:(0,t.jsxs)(t.Fragment,{children:[l.entries.map(e=>(0,t.jsx)(V,{icon:"dir"===e.kind?(0,t.jsx)(c.Folder,{}):e.name.endsWith(".md")?(0,t.jsx)(d.FileText,{}):(0,t.jsx)(o.File,{}),label:e.name,hasChildren:"dir"===e.kind,active:(n?`${n}/${e.name}`:e.name)===r,onClick:()=>i(e)},e.name)),0===l.entries.length&&(0,t.jsx)("p",{className:"p-3 text-xs text-muted-foreground/60",children:"Empty folder"})]})}function Y({content:e}){let s=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e),n=s?.[1].trim(),r=s?e.slice(s[0].length):e;return(0,t.jsxs)("div",{className:"min-w-0",children:[n&&(0,t.jsx)("pre",{className:"border-b border-border/60 bg-muted/20 px-5 py-3 font-mono text-[11px] leading-relaxed whitespace-pre-wrap text-muted-foreground",children:n}),(0,t.jsx)("div",{className:"px-5 py-4 text-sm leading-relaxed",children:(0,t.jsx)(C.Markdown,{children:r})})]})}function Z({source:e,dir:s,path:n}){let{data:r,isLoading:i,error:l}=(0,O.useServerRoute)(y.queryKey.skillNode(e,s,n));if(l)return(0,t.jsx)("p",{className:"p-4 font-mono text-xs text-destructive",children:l.message});if(i||!r)return(0,t.jsxs)("div",{className:"space-y-3 p-5",children:[(0,t.jsx)(M.Skeleton,{className:"h-5 w-2/3"}),(0,t.jsx)(M.Skeleton,{className:"h-4 w-full"}),(0,t.jsx)(M.Skeleton,{className:"h-4 w-5/6"})]});if("file"!==r.kind)return null;let a=n.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:a}),(0,t.jsx)("span",{className:"shrink-0",children:(0,U.formatBytes)(r.size)})]}),null===r.content?(0,t.jsx)("p",{className:"px-5 py-4 text-sm text-muted-foreground/60",children:"Not a text file — the agent can still read it from disk."}):a.toLowerCase().endsWith(".md")?(0,t.jsx)(Y,{content:r.content}):(0,t.jsx)("pre",{className:"overflow-x-auto px-5 py-4 font-mono text-[13px] leading-relaxed whitespace-pre text-foreground/90",children:r.content})]})}function _(){return z.notify.component({className:"sm:max-w-lg",renderer:({close:e})=>(0,t.jsx)(J,{onDone:e})})}function J({onDone:e}){let[s,n]=(0,b.useState)("write"),[r,i]=(0,b.useState)(""),[l,a]=(0,b.useState)(""),[o,d]=(0,b.useState)(""),[c,u]=(0,b.useState)(null),[m,x]=(0,b.useState)(!1),p=(0,b.useRef)(null),f={errorMessage:!1,onOk:()=>{(0,O.revalidate)(y.queryKey.skills),e()}},[g,j,,v]=(0,B.useServerAction)($,f),[C,z,,M]=(0,B.useServerAction)(P,f),R=j||z,D="write"===s?v:M,K=!R&&("write"===s?r.trim()&&l.trim()&&o.trim():null!==c),q=async()=>{var e;!K||("write"===s?g({name:r.trim(),description:l.trim(),content:o}):c&&C({fileName:c.name,base64:await (e=c,new Promise((t,s)=>{let n=new FileReader;n.onload=()=>{let e=n.result;t(e.slice(e.indexOf(",")+1))},n.onerror=()=>s(n.error),n.readAsDataURL(e)}))}))},I=e=>{let t=e?.[0]??null;t&&u(t)};return(0,t.jsxs)(A.SettingDialogContent,{title:"New skill",description:"Instructions the agent loads by name when a task calls for them.",footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.Button,{variant:"ghost",onClick:e,children:"Cancel"}),(0,t.jsxs)(N.Button,{disabled:!K,loading:R,onClick:q,children:[!R&&("write"===s?(0,t.jsx)(h.Plus,{}):(0,t.jsx)(k,{})),"write"===s?"Create":"Upload"]})]}),children:[(0,t.jsxs)(F.Tabs,{value:s,onValueChange:e=>n(e),children:[(0,t.jsxs)(F.TabsList,{className:"w-full",children:[(0,t.jsx)(F.TabsTrigger,{value:"write",children:"Write"}),(0,t.jsx)(F.TabsTrigger,{value:"upload",children:"Upload"})]}),(0,t.jsxs)(F.TabsContent,{value:"write",className:"space-y-5 pt-4",children:[(0,t.jsxs)(S.Field,{children:[(0,t.jsx)(S.FieldLabel,{htmlFor:"skill-name",children:"Name"}),(0,t.jsxs)(S.FieldContent,{children:[(0,t.jsx)(w.Input,{id:"skill-name",value:r,onChange:e=>i(e.target.value),placeholder:"deploy-checklist",spellCheck:!1,autoFocus:!0}),(0,t.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[T.PATHS.skills.custom,"/",r.trim()||"…","/SKILL.md"]})]})]}),(0,t.jsxs)(S.Field,{children:[(0,t.jsx)(S.FieldLabel,{htmlFor:"skill-description",children:"Description"}),(0,t.jsx)(S.FieldContent,{children:(0,t.jsx)(w.Input,{id:"skill-description",value:l,onChange:e=>a(e.target.value),placeholder:"When to use it — this is how the agent decides to load it"})})]}),(0,t.jsxs)(S.Field,{children:[(0,t.jsx)(S.FieldLabel,{htmlFor:"skill-content",children:"Content"}),(0,t.jsx)(L.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:()=>p.current?.click(),onDragOver:e=>{e.preventDefault(),x(!0)},onDragLeave:()=>x(!1),onDrop:e=>{e.preventDefault(),x(!1),I(e.dataTransfer.files)},className:(0,U.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)(k,{className:"size-5 text-muted-foreground"}),c?(0,t.jsxs)("span",{className:"text-sm",children:[c.name,(0,t.jsx)("span",{className:"ml-2 font-mono text-[11px] text-muted-foreground",children:(0,U.formatBytes)(c.size)})]}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Drop a file here, or click to choose"})]}),(0,t.jsx)("input",{ref:p,type:"file",accept:".md,.zip,.skill",className:"hidden",onChange:e=>I(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."]})]})]})]}),D&&(0,t.jsx)("p",{className:"font-mono text-xs text-destructive",children:D})]})}e.s(["SkillsSetting",0,function(){let[e,s]=(0,b.useState)(""),{data:n,isLoading:r,error:i}=(0,O.useServerRoute)(y.queryKey.skills),l=n??[];if(r)return(0,t.jsx)(A.SettingSkeleton,{rows:4});if(i)return(0,t.jsx)(A.SettingError,{message:i.message});let a=e.trim().toLowerCase(),o=l.filter(e=>!a||`${e.name} ${e.description}`.toLowerCase().includes(a)),d=l.filter(e=>!e.disabled).length;return(0,t.jsxs)(A.SettingScreen,{footer:(0,t.jsxs)(A.SettingRailNote,{children:[l.filter(e=>"default"===e.source).length," shipped · ",l.filter(e=>"custom"===e.source).length," ","installed"]}),children:[(0,t.jsx)(A.SettingToolbar,{count:`${d} on \xb7 ${l.length-d} off`,children:(0,t.jsx)(A.SettingFilter,{value:e,onChange:s,placeholder:"Filter skills"})}),(0,t.jsx)(A.SettingGroup,{label:"Custom",hint:"yours — added here · wins a name clash",children:(0,t.jsx)(A.SettingItems,{addRow:{label:"Add skill",onClick:_},children:o.filter(e=>"custom"===e.source).map(e=>(0,t.jsx)(E,{skill:e},`custom/${e.dir}`))})}),(0,t.jsx)(A.SettingGroup,{label:"Default",hint:"ships with the app · switch off, can't edit or delete",children:(0,t.jsx)(A.SettingItems,{children:o.filter(e=>"default"===e.source).map(e=>(0,t.jsx)(E,{skill:e},`default/${e.dir}`))})}),d>T.PROMPT_CROWDED.skills&&(0,t.jsxs)(A.SettingNote,{children:[d," skills are on. Each is a line in every prompt a bot reads, and one more to look past when it picks."]})]})},"openSkillCreate",0,_],833959)},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 n=(0,t.default)(s);e.s(["Folder",0,n],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 n=(0,t.default)(s);e.s(["Trash2",0,n],759659)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,567334,e=>{"use strict";e.s(["ALPHA_TOP",0,.82,"CHAR_RATE",0,2.2,"EMOJI_CHAR_RATE",0,.6,"EMOJI_MIN_LEVEL",0,6,"EMOJI_POOL",0,["🍎","🌹","🍓","❤️","🎈","🧨","🔴","🍊","🔥","🦊","🏀","🧡","🍑","⭐","🍋","🌻","💛","🐥","🌟","🍌","🍀","🌿","🐸","🥝","💚","🌵","🥑","💧","🌊","🫐","🐳","💙","🔵","🧊","🍇","💜","🔮","🟣","🪻","🍆","🌸","🌷","💗","🦩","🩷","🍫","🐻","🌰","🥐","🤍","☁️","🖤","⚪","⚫","🦢","🌈","🦜","🎨","🪩","🦄","✨","🍬","🎡"],"EMOJI_RATIO",0,.11,"RAMP",0,[[" "],[" ",".","`"],[".",",","·","'"],[":",";","-","^"],["=","+","~",'"'],["*","?","◦","j"],["c","v","○","7"],["o","x","◇","い"],["s","y","t","あ"],["e","a","u","な"],["k","w","z","や"],["q","h","n","米"]],"hash",0,function(e,t){let r=43758.5453*Math.sin(127.1*e+311.7*t);return r-Math.floor(r)},"smoothstep",0,function(e,t,r){let n=Math.min(1,Math.max(0,(r-e)/(t-e)));return n*n*(3-2*n)}])},67045,319841,e=>{"use strict";let t,r;var n=e.i(768834);let a=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>a(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>a(t)(e)}}};var l=e.i(671228);let i=l.ThursdaySettingsSchema.extend({wake:l.WakeSchema.catch(l.WAKE_DEFAULT),hotkey:l.HotkeySchema.catch(l.HOTKEY_DEFAULT),callBack:l.CallBackSchema.catch(l.CALL_BACK_DEFAULT),captionView:l.CaptionViewSchema.catch("center")}),s={systemPrompt:null,model:null,wake:l.WAKE_DEFAULT,hotkey:l.HOTKEY_DEFAULT,callBack:l.CALL_BACK_DEFAULT,captionView:"center"},o=(0,n.create)()((t=e=>({...s,patch:t=>e(t)}),r={name:"thursday.settings",merge:(e,t)=>{let r=i.safeParse(e);return{...t,...r.success?r.data:s}}},(e,n,l)=>{let i,s={storage:function(e){let t;try{t=e()}catch(e){return}return{getItem:e=>{var r;let n=e=>null===e?null:JSON.parse(e,void 0),a=null!=(r=t.getItem(e))?r:null;return a instanceof Promise?a.then(n):n(a)},setItem:(e,r)=>t.setItem(e,JSON.stringify(r,void 0)),removeItem:e=>t.removeItem(e)}}(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...r},o=!1,c=0,u=new Set,h=new Set,f=s.storage;if(!f)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),e(...t)});let g=()=>{let e=s.partialize({...n()});return f.setItem(s.name,{state:e,version:s.version})},m=l.setState;l.setState=(e,t)=>(m(e,t),g());let d=t((...t)=>(e(...t),g()));l.getInitialState=()=>d;let p=()=>{var t,r;if(!f)return;let l=++c;o=!1,u.forEach(e=>{var t;return e(null!=(t=n())?t:d)});let m=(null==(r=s.onRehydrateStorage)?void 0:r.call(s,null!=(t=n())?t:d))||void 0;return a(f.getItem.bind(f))(s.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===s.version)return[!1,e.state];else{if(s.migrate){let t=s.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(t=>{var r;if(l!==c)return;let[a,o]=t;if(e(i=s.merge(o,null!=(r=n())?r:d),!0),a)return g()}).then(()=>{l===c&&(null==m||m(n(),void 0),i=n(),o=!0,h.forEach(e=>e(i)))}).catch(e=>{l===c&&(null==m||m(void 0,e))})};return l.persist={setOptions:e=>{s={...s,...e},e.storage&&(f=e.storage)},clearStorage:()=>{++c,null==f||f.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>o,onHydrate:e=>(u.add(e),()=>{u.delete(e)}),onFinishHydration:e=>(h.add(e),()=>{h.delete(e)})},s.skipHydration||p(),i||d}));e.s(["thursdaySettings",0,()=>{let{systemPrompt:e,model:t}=o.getState();return{systemPrompt:e,model:t,locale:"u"<typeof navigator?null:navigator.language??null}},"useThursdayStore",0,o],67045);var c=e.i(271645);let u=["ctrl","alt","meta"],h=/^(Control|Alt|Shift|Meta|OS)/,f=/^(input|textarea|select)$/i;function g(e){let{code:t,ctrlKey:r,altKey:n,shiftKey:a,metaKey:l}=e;if(!t||h.test(t)||!r&&!n&&!l)return null;let i=[];return r&&i.push("ctrl"),n&&i.push("alt"),a&&i.push("shift"),l&&i.push("meta"),[...i,t].join("+")}let m={ctrl:["Ctrl","⌃"],alt:["Alt","⌥"],shift:["Shift","⇧"],meta:["Meta","⌘"]};e.s(["HOTKEY_CAPTURE",0,{"data-hotkey-capture":""},"comboOf",0,g,"isCombo",0,e=>{let t=e.split("+"),r=t.at(-1);return!!(r&&!h.test(r)&&t.slice(0,-1).some(e=>u.includes(e)))},"useHotkey",0,function({enabled:e,combo:t,onPress:r}){let n=(0,c.useRef)(r);n.current=r,(0,c.useEffect)(()=>{if(!e||!t)return;let r=e=>{var r;e.repeat||(r=e.target)&&(f.test(r.tagName)||r.isContentEditable||r.closest?.("[data-hotkey-capture]"))||g(e)===t&&(e.preventDefault(),n.current())};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e,t])},"useHotkeyLabel",0,function(e){let[t,r]=(0,c.useState)(!1);return(0,c.useEffect)(()=>r(/mac/i.test(navigator.userAgent)),[]),e?function(e,t=!1){let r=e.split("+"),n=r.at(-1)??"",a=r.slice(0,-1).map(e=>m[e]?.[+!!t]??e),l=n.replace(/^(Key|Digit|Numpad)/,"").replace(/([a-z])([A-Z])/g,"$1 $2")||n;return t?[...a,l].join(""):[...a,l].join(" + ")}(e,t):null}],319841)},561540,333495,e=>{"use strict";var t=e.i(213377);let r={[t.TOOL_NAMES.memory_recall]:"Checking your notes",[t.TOOL_NAMES.memory_remember]:"Noting that down",[t.TOOL_NAMES.memory_forget]:"Forgetting that",[t.TOOL_NAMES.bash]:"Doing it on this computer",[t.TOOL_NAMES.web_search]:"Searching the web",[t.TOOL_NAMES.load_skill]:"Reading how to do this",[t.TOOL_NAMES.end_call]:"Ending the call"};function n(e){if(!e)return null;try{let t=JSON.parse(e);if(t&&"object"==typeof t&&!Array.isArray(t))return t}catch{}return null}e.s(["delegatedLabel",0,function(e,r){if(e!==t.TOOL_NAMES.delegate)return null;try{let e=JSON.parse(r);return"string"==typeof e.label?e.label:null}catch{return null}},"toolBot",0,function(e,r){if(e!==t.TOOL_NAMES.delegate&&e!==t.TOOL_NAMES.ask_bot)return null;let a=n(r)?.bot;return"string"==typeof a&&a.trim()?a.trim():null},"toolLine",0,function(e,a){let l;if(e===t.TOOL_NAMES.tool_search||e===t.TOOL_NAMES.tool_call)return"Reaching a connected service";let i=n(a);return(i&&function(e,r){if(e===t.TOOL_NAMES.memory_remember){let e="string"==typeof r.path?r.path.trim():"",t=function(e){if(!Array.isArray(e.facts))return null;let t=e.facts.map(e=>e&&"object"==typeof e&&"string"==typeof e.text?e.text.trim():"").filter(Boolean);return t.length?{text:t[0],more:t.length-1}:null}(r);if(!e)return null;if(!t)return`Noting that under ${e}`;let n=t.more>0?` (+${t.more})`:"";return`Noting under ${e}: ${function(e){let t=e.trim().replace(/\s+/g," ");if(t.length<=28)return t;let r=t.slice(0,28),n=r.lastIndexOf(" ");return`${(n>14?r.slice(0,n):r).trimEnd()}…`}(t.text)}${n}`}if(e===t.TOOL_NAMES.delegate){let e="string"==typeof r.bot?r.bot.trim():"";return e?`Handing this to ${e}`:"Handing this over"}if(e===t.TOOL_NAMES.task){let e="string"==typeof r.task?r.task.trim():"";return"answer"===r.action?"Passing that back":"cancel"===r.action?"Stopping that":e?`Checking on ${e}`:"Checking the jobs"}return null}(e,i))??r[e]??((l=e.indexOf("__"))<=0?null:`Reaching ${e.slice(0,l).replace(/[-_]/g," ")}`)}],561540);var a=e.i(843476),l=e.i(271645),i=e.i(635963),s=e.i(41533),o=e.i(541302),c=e.i(567334);let u=[235,235,235],h=["████ ███ ███ ██ ███ ","█ █ █ █ █ █ █ █ █","███ ███ ███ █ █ ███ ","█ █ █ █ █ █ █ █ █ ","████ █ █ █ █ ██ █ █"],f={happy:[".....................",".....................","....███.......███....","...█████.....█████...","...█████.....█████...","....███.......███....",".....................",".....................","█...................█",".██...............██.","...███.........███...","......█████████......","....................."],sad:[".....................",".....................","....███.......███....","...█████.....█████...","...█████.....█████...","....███.......███....",".....................",".....................","......█████████......","...███.........███...",".██...............██.","█...................█","....................."],love:[".....................","...██.██.....██.██...","..███████...███████..","..███████...███████..","...█████.....█████...","....███.......███....",".....█.........█.....",".....................","█...................█",".██...............██.","...███.........███...","......█████████......","....................."]};function g(e,t){let r=1-(0,c.smoothstep)(104.50000000000001,190,e.dist);return(.58+.2*Math.sin(.05*e.dist-.4*t)+.07*Math.sin(.35*t))*r}function m(e,t,r,n,a){switch(e){case"idle":return g(t,r)*(0,c.smoothstep)(0,1,Math.min(1,n/1.5));case"connecting":{let e=(0,c.smoothstep)(0,1,Math.min(1,n/1.8)),a=t.dist-235*e;return Math.exp(-(a*a)/6e3)*(.2+.85*(0,c.hash)(Math.floor(t.dist/9),Math.floor(11*t.angle))+.5*(0,c.hash)(137*t.seed,7))*e+g(t,r)*(1-e)}case"speaking":{var l;let e=(0,c.smoothstep)(0,1,Math.min(1,n/.8)),i=190+(-6+40*a.phrase+120*a.bob)*e;for(let r=0;r<4;r++)i+=34*a.amp[r]*Math.sin((r+2)*t.angle+a.phase[r])*e;let s=(l=i)<=244?Math.max(130,l):244+34*Math.tanh((l-244)/34),o=(t.grain-.5)*20+20*Math.sin(5*t.angle+.9*r+6.283*t.seed)*.3,u=t.dist-(s+o),h=Math.exp(-(u*u)/800),f=.5*Math.exp(-(t.dist*t.dist)/6e3),g=t.dist<s?.3*(1-t.dist/s)**.6*(.75+.25*Math.sin(.05*t.dist-1.2*r)):0,m=0;if(t.speck<.22){let e=90*(.6+.9*t.grain);for(let n=0;n<a.rings.length;n++){let l=a.rings[n],i=r-l.born,o=t.dist-(s+6+i*e);m+=Math.exp(-(o*o)/500)*l.power*Math.max(0,1-i/.7)}}return h+f+g+m}case"working":{let e=(0,c.smoothstep)(0,1,Math.min(1,n/.7)),a=t.dist-238,l=Math.exp(-(a*a)/1100),i=t.angle-3*r,s=Math.atan2(Math.sin(i),Math.cos(i));return l*Math.exp(-(s*s)/(s<0?2.8:.16))*e+g(t,r)*(1-e)}case"error":{if(t.letter<0)return 0;let e=n%9.2,a=t.letter,l=.12*t.seed;return Math.max(0,(0,c.smoothstep)(0,1,(e-.65*a-l)/.8)-(0,c.smoothstep)(0,1,(e-5.6-.5*a-l)/.7))*(.86+.14*Math.sin(3.5*r+6*t.seed))}}}function d({className:e,mode:t="idle",charset:r=s.ASCII_FACE.charset,emotion:n=null,fontSize:i=s.ASCII_FACE.fontSize.default,density:g=s.ASCII_FACE.density.default,size:p=680,color:M=u,getSpectrum:A}){let y=(0,l.useRef)(null),O=(0,l.useRef)(null),E=(0,l.useRef)([]),b=(0,l.useRef)(null),S=(0,l.useRef)(r),_=(0,l.useRef)({cur:[...M],target:M}),v=(0,l.useRef)({cw:1,ch:1,errScale:3,faceScale:3,size:0}),w=(0,l.useRef)({cur:n,prev:null,start:-1/0}),x=(0,l.useRef)(A);x.current=A;let R=(0,l.useRef)({phrase:0,bob:0,bobVel:0,amp:[,,,,].fill(0),phase:Array.from({length:4},(e,t)=>2.1*t),rings:[]}),k=(0,l.useRef)({mode:t,start:0}),T=(0,l.useRef)(null),L=(0,l.useRef)(-1/0);return(0,l.useEffect)(()=>{let e=y.current;if(!e)return;let t=.95*i/g,r=1.25*i/g,n=680/p,a=t*n,l=r*n,s=Math.max(1,Math.floor(625.6/(h[0].length*a))),o=Math.max(1,Math.floor(557.6/(21*a)));v.current={cw:a,ch:l,errScale:s,faceScale:o,size:p};let u=[],f=Math.ceil(p/t),m=Math.ceil(p/r);for(let e=0;e<m;e++)for(let i=0;i<f;i++){let o=i*t,f=e*r,g=(o-p/2)*n,m=(f-p/2)*n,d=Math.hypot(g,m),M=function(e,t,r,n,a){let l=h.length,i=Math.floor(e/(r*a)+h[0].length/2),s=Math.floor(t/(n*a)+l/2);if(s<0||s>=l)return -1;let o=h[s];return i<0||i>=o.length||"█"!==o[i]?-1:Math.floor(i/5)}(g,m,a,l,s);M<0&&d>328||u.push({x:o+t/2,y:f+r/2,dx:g,dy:m,dist:d,angle:Math.atan2(m,g),seed:(0,c.hash)(i,e),grain:(0,c.hash)(5.7*i+19,2.3*e+53),gap:.05+.3*(0,c.hash)(7.3*i+11,3.1*e+5),birth:(0,c.hash)(3.1*i+7,5.7*e+2),death:(0,c.hash)(9.4*i+3,2.6*e+8),emoji:(0,c.hash)(2.7*i+31,5.9*e+17)<c.EMOJI_RATIO,speck:(0,c.hash)(4.1*i+23,6.3*e+41),letter:M})}E.current=u,b.current={ascii:Array.from({length:c.RAMP.length},()=>new Int32Array(u.length)),emoji:Array.from({length:c.RAMP.length},()=>new Int32Array(u.length)),asciiN:new Int32Array(c.RAMP.length),emojiN:new Int32Array(c.RAMP.length),glyph:Array(u.length)};let d=Math.min(2,window.devicePixelRatio||1);e.width=p*d,e.height=p*d,e.style.width=`${p}px`,e.style.height=`${p}px`;let M=e.getContext("2d");return M&&(M.setTransform(d,0,0,d,0,0),M.font=`700 ${i}px ui-monospace,SFMono-Regular,Menlo,monospace`,M.textAlign="center",M.textBaseline="middle",O.current=M),()=>{M?.clearRect(0,0,p,p),E.current=[],b.current=null}},[i,g,p]),(0,l.useEffect)(()=>{let e=w.current;e.cur!==n&&(w.current={cur:n,prev:e.cur,start:.001*performance.now()})},[n]),(0,l.useEffect)(()=>{S.current=r},[r]),(0,l.useEffect)(()=>{_.current.target=M},[M]),(0,l.useEffect)(()=>{let e=.001*performance.now();k.current.mode!==t?(T.current={...k.current},k.current={mode:t,start:e},L.current=e):k.current={mode:t,start:e}},[t]),(0,l.useEffect)(()=>{let e=0,t=(0,o.createVoiceFollower)(),r=Array(o.SPECTRUM_BANDS).fill(0),n=.001*performance.now(),a=l=>{let i=.001*l,s=Math.min(.05,Math.max(0,i-n));n=i;let o=O.current,u=b.current;if(!o||!u){e=requestAnimationFrame(a);return}let h=S.current,{cw:g,ch:d,faceScale:p,size:M}=v.current;u.asciiN.fill(0),u.emojiN.fill(0);let A=x.current?.();if(!A||A.length<2){for(let e=0;e<r.length;e++){let t=.5*Math.sin(1.7*i+1.7*e)+.3*Math.sin(.8*i+.6*e)+.2*Math.sin(3*i+2.9*e);r[e]=.5*t+.5}A=r}let y=R.current,N=t.read(A,s);y.phrase=N.phrase,N.onset>0&&(y.bobVel+=.06*N.onset,y.rings.push({born:i,power:N.onset}),y.rings.length>5&&y.rings.shift()),y.bobVel+=-(.012*y.bob)-.09*y.bobVel,y.bob+=y.bobVel;for(let e=0;e<4;e++){let t=Math.floor(e*N.bands.length/4),r=Math.max(t+1,Math.floor((e+1)*N.bands.length/4)),n=0;for(let e=t;e<r;e++)n+=N.bands[e];n/=r-t;let a=.7+.6*(0,c.hash)((.9*i|0)+31*e,e);y.amp[e]+=(n*a-y.amp[e])*(.05+.02*e),y.phase[e]+=s*(.5+.37*e)*(e%2?-1:1)}for(;y.rings.length>0&&i-y.rings[0].born>.7;)y.rings.shift();let I=k.current,C=T.current,P=(0,c.smoothstep)(0,1,Math.min(1,(i-L.current)/1.5)),j=null!==C&&P<1,F="error"===I.mode||j&&C?.mode==="error",$=w.current,H=i-$.start,z=Math.min(1,Math.max(0,H/.36)),J=Math.min(1,Math.max(0,(H-.36-.14)/.95)),B=null!==$.cur||H<1.45,U=(e,t)=>{var r,n;let a,l;return r=t.dx,n=t.dy,a=Math.floor(r/(g*p)+10.5),(l=Math.floor(n/(d*p)+6.5))<0||l>=13||a<0||a>=21||"█"!==f[e][l][a]?0:l<7?1:2},V=(e,t)=>0===e?0:(1===e?1:.88)*(.74+.26*(1-Math.min(1,t.dist/270)))*(.42+.85*(0,c.hash)(Math.floor(.09*t.dx+.25*i),Math.floor(.09*t.dy-.18*i))),D=e=>{if(e.seed<.976)return 0;let t=195+160*(0,c.hash)(311*e.seed,9);return Math.exp(-((e.dist-t)**2)/7e3)*(.5+.5*Math.sin(i*(.5+1.5*(0,c.hash)(47*e.seed,21))+300*e.seed))*.36},K=E.current;for(let e=0;e<K.length;e++){let t=K[e],r=m(I.mode,t,i,i-I.start,y);if(j&&C){let e=m(C.mode,t,i,i-C.start,y);r=e+(r-e)*P}!(F&&t.letter>=0)&&((r*=(.66+.72*t.grain)*(.8+.4*(0,c.hash)(Math.floor(.05*t.dx+.5*i),Math.floor(.05*t.dy-.3*i))))>.3&&(0,c.hash)(31.7*Math.floor(1.6*i),613*t.seed)>.992&&(r=Math.max(r,.9)),r<t.gap+.05*Math.sin(.28*i+6.283*t.seed)&&(r=0));let n=!1;if(B){let e=(0,c.smoothstep)(0,1,(1.1*z-t.death)/.08),a=(0,c.smoothstep)(0,1,(1.1*J-t.birth)/.08),l=$.cur?U($.cur,t):0,i=$.prev?U($.prev,t):0,s=D(t);r=($.prev?V(i,t)+s:r)*(1-e)+($.cur?V(l,t)+s:r)*a,n=l>0&&a>.05||i>0&&e<.95}let a=(r=r<0?0:r>1?1:r)*(c.RAMP.length-1)|0;if(0===a)continue;let l=i*(n?.75:"emojiOnly"===h?c.EMOJI_CHAR_RATE:c.CHAR_RATE)+7*t.seed|0;if("emojiOnly"===h||"emoji"===h&&t.emoji&&a>=c.EMOJI_MIN_LEVEL){let r=((t.seed*c.EMOJI_POOL.length|0)+l)%c.EMOJI_POOL.length;u.glyph[e]=c.EMOJI_POOL[r],u.emoji[a][u.emojiN[a]++]=e}else{let r=c.RAMP[a],n=((t.seed*r.length|0)+l)%r.length;u.glyph[e]=r[n],u.ascii[a][u.asciiN[a]++]=e}}o.clearRect(0,0,M,M);let q=E.current,W=c.RAMP.length-1,Y=_.current;for(let e=0;e<3;e++)Y.cur[e]+=(Y.target[e]-Y.cur[e])*.05;o.fillStyle=`rgb(${0|Y.cur[0]},${0|Y.cur[1]},${0|Y.cur[2]})`;for(let e=1;e<=W;e++){let t=u.asciiN[e];if(0===t)continue;o.globalAlpha=c.ALPHA_TOP*(e/W);let r=u.ascii[e];for(let e=0;e<t;e++){let t=q[r[e]];o.fillText(u.glyph[r[e]],t.x,t.y)}}for(let e=1;e<=W;e++){let t=u.emojiN[e];if(0===t)continue;o.globalAlpha=.35+e/W*.65;let r=u.emoji[e];for(let e=0;e<t;e++){let t=q[r[e]];o.fillText(u.glyph[r[e]],t.x,t.y)}}o.globalAlpha=1,!j&&C&&(T.current=null),e=requestAnimationFrame(a)};return e=requestAnimationFrame(a),()=>cancelAnimationFrame(e)},[]),(0,a.jsx)("canvas",{ref:y,className:e,"aria-hidden":!0,style:{display:"block",pointerEvents:"none"}})}var p=e.i(922521),M=e.i(647163);let A={idle:"idle",connecting:"connecting",listening:"listening",speaking:"speaking",working:"thinking",delegating:"delegating"},y={ripple:18,bandEase:.03,pulse:0,punch:.05,stretch:0},O={idle:"idle",connecting:"connecting",listening:"connecting",speaking:"speaking",working:"working",delegating:"working"},E=[247,247,247],b=[10,10,10],S={mark:{label:"Mark",hint:"A silhouette with eyes. Blinks, glances, leans into a voice.",render:function({status:e,size:t,getSpectrum:r,look:n,className:l}){return(0,a.jsx)(i.BotMark,{size:t,seed:"thursday",color:n.color,shape:n.shape,outline:n.outline,state:A[e],getSpectrum:r,options:y,notify:!1,className:l})}},ascii:{label:"Ascii",hint:"A field of characters. No eyes — the whole orb is the expression.",render:function({status:e,size:t,getSpectrum:r,look:n,className:l}){let i="dark"===(0,p.useResolvedTheme)();return(0,a.jsx)(d,{mode:O[e],size:t,color:i?E:b,getSpectrum:r,charset:n.charset,fontSize:n.fontSize,density:n.density,className:l})}}},_=(0,l.memo)(function({look:e,status:t="idle",size:r=448,className:n,...i}){let s=(0,l.useRef)(null),[o,c]=(0,l.useState)(r),[u,h]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=s.current;if(!e)return;let t=new ResizeObserver(([e])=>{let t=Math.round(e.contentRect.width);t>0&&c(t)});return t.observe(e),()=>t.disconnect()},[]),(0,l.useEffect)(()=>{let e=requestAnimationFrame(()=>h(!0));return()=>cancelAnimationFrame(e)},[]);let f=S[e.kind].render;return(0,a.jsx)("div",{ref:s,className:(0,M.cn)("aspect-square transition-opacity duration-700 ease-out",u?"opacity-100":"opacity-0",n),children:(0,a.jsx)(f,{...i,look:e,status:t,size:o})})});e.s(["FACES",0,S,"Face",0,_],333495)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,519029,e=>{"use strict";var t=e.i(843476),r=e.i(647163);function s({color:e,picked:i,onPick:a}){return(0,t.jsx)("button",{type:"button",onClick:a,"aria-label":e??"Follow the theme",style:e?{backgroundColor:e}:void 0,className:(0,r.cn)("size-5 rounded-full outline-none transition-transform hover:scale-110 focus-visible:ring-3 focus-visible:ring-ring/50",!e&&"bg-foreground",i&&"ring-2 ring-foreground/40 ring-offset-2 ring-offset-background")})}var i=e.i(864723);e.s(["MarkPalette",0,function({color:e,themePicked:r,onTheme:a,onPick:n}){return(0,t.jsx)("div",{className:"flex justify-center px-2",children:(0,t.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(s,{color:null,picked:r,onPick:a}),(0,t.jsx)("span",{className:"w-2"}),i.MARK_PALETTE_ROWS[0].map(r=>(0,t.jsx)(s,{color:r,picked:e===r,onPick:()=>n(r)},r))]}),(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 pl-11",children:i.MARK_PALETTE_ROWS[1].map(r=>(0,t.jsx)(s,{color:r,picked:e===r,onPick:()=>n(r)},r))})]})})}],519029)},
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,519029,e=>{"use strict";var t=e.i(843476),r=e.i(647163);function s({color:e,picked:i,onPick:a}){return(0,t.jsx)("button",{type:"button",onClick:a,"aria-label":e??"Follow the theme",style:e?{backgroundColor:e}:void 0,className:(0,r.cn)("size-5 rounded-full outline-none transition-transform hover:scale-110 focus-visible:ring-3 focus-visible:ring-ring/50",!e&&"bg-foreground",i&&"ring-2 ring-foreground/40 ring-offset-2 ring-offset-background")})}var i=e.i(864723);e.s(["MarkPalette",0,function({color:e,themePicked:r,onTheme:a,onPick:n}){return(0,t.jsx)("div",{className:"flex justify-center px-2",children:(0,t.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(s,{color:null,picked:r,onPick:a}),(0,t.jsx)("span",{className:"w-2"}),i.MARK_PALETTE_ROWS[0].map(r=>(0,t.jsx)(s,{color:r,picked:e===r,onPick:()=>n(r)},r))]}),(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 pl-11",children:i.MARK_PALETTE_ROWS[1].map(r=>(0,t.jsx)(s,{color:r,picked:e===r,onPick:()=>n(r)},r))})]})})}],519029)},863605,e=>{"use strict";var t=e.i(95187);let r=(0,t.createServerReference)("7f965a01991fcb050dbcedafae89c62f2e9244fc36",t.callServer,void 0,t.findSourceMapURL,"deleteWorkspaceFileAction");e.s(["deleteWorkspaceFileAction",0,r])},333999,e=>{"use strict";var t=e.i(271645),r=e.i(647163);e.s(["useObjectState",0,e=>{let[s,i]=(0,t.useState)(e);return[s,(0,t.useMemo)(()=>{let e=e=>{i(t=>{let s=(0,r.isFunction)(e)?e(t):e;return Object.keys(s).some(e=>!Object.is(t[e],s[e]))?{...t,...s}:t})},t=new Map;return new Proxy(e,{get(s,i,a){if("symbol"==typeof i)return Reflect.get(s,i,a);let n=t.get(i);return n||(n=t=>{e(e=>({[i]:(0,r.isFunction)(t)?t(e[i]):t}))},t.set(i,n)),n}})},[])]}])},759659,e=>{"use strict";var t=e.i(456420);let r={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"]};r.node;let s=(0,t.default)(r);e.s(["Trash2",0,s],759659)}]);
|