thursday-agent 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/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/keep-working/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/thread/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
- package/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/server/app/api/events/route.js.nft.json +1 -1
- package/.next/server/app/api/favicon/[host]/route.js.nft.json +1 -1
- package/.next/server/app/api/file/[...path]/route.js.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 +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/probe/route.js.nft.json +1 -1
- package/.next/server/app/api/reach/route.js +11 -11
- package/.next/server/app/api/reach/route.js.nft.json +1 -1
- package/.next/server/app/api/routine/route.js +6 -6
- package/.next/server/app/api/routine/route.js.nft.json +1 -1
- package/.next/server/app/api/signins/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/text/route.js +11 -11
- package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/tool-call/route.js +6 -6
- package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/files/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/favicon.ico/route.js.nft.json +1 -1
- package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/.next/server/app/page/server-reference-manifest.json +56 -56
- package/.next/server/app/page.js +3 -3
- 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]__012s2o8._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__04r4h-2._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0mrk2it._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0nmhgeo._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1fy2g82._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ndi14y._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1nmflqk._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1v7-zke._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1wnzmx9._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1xv-5cq._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1ygplx1._.js +1 -1
- package/.next/server/chunks/_05v8k21._.js +1 -1
- package/.next/server/chunks/_0awtznl._.js +4 -4
- package/.next/server/chunks/_0k6qjcf._.js +1 -1
- package/.next/server/chunks/_0na2fj1._.js +5 -5
- package/.next/server/chunks/_0x-ej3f._.js +21 -21
- package/.next/server/chunks/_1dc_d1q._.js +22 -20
- package/.next/server/chunks/_1jc5g4p._.js +2 -2
- package/.next/server/chunks/_1jn-aep._.js +50 -48
- package/.next/server/chunks/{_1u8ygbz._.js → _1m88lkh._.js} +7 -7
- package/.next/server/chunks/_1uuucy-._.js +4 -4
- package/.next/server/chunks/_1v9r2ke._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__1h4bnrf._.js → [root-of-the-server]__0oo-wlv._.js} +2 -2
- package/.next/server/chunks/ssr/{[root-of-the-server]__1kyi568._.js → [root-of-the-server]__0tvavy9._.js} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0tzekbl._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0zuns7e._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1se25x0._.js +1 -1
- package/.next/server/chunks/ssr/{_1i3ddn7._.js → _05pl_u8._.js} +1 -1
- package/.next/server/chunks/ssr/_070nv1_._.js +3 -0
- package/.next/server/chunks/ssr/_097-ljd._.js +1 -1
- package/.next/server/chunks/ssr/_0dshsh4._.js +3 -0
- package/.next/server/chunks/ssr/_0fqhhwi._.js +1 -1
- package/.next/server/chunks/ssr/{_0z8jpch._.js → _0ital-2._.js} +2 -2
- package/.next/server/chunks/ssr/{_19g570d._.js → _0kjj5ts._.js} +3 -3
- package/.next/server/chunks/ssr/{_1nod5hh._.js → _0l_mcfz._.js} +2 -2
- package/.next/server/chunks/ssr/_0ld9_qq._.js +1 -1
- package/.next/server/chunks/ssr/_0ltz2q5._.js +3 -0
- package/.next/server/chunks/ssr/_0scf7xy._.js +3 -0
- package/.next/server/chunks/ssr/_0u5xv6g._.js +3 -0
- package/.next/server/chunks/ssr/{_0ewory0._.js → _0urj3mc._.js} +2 -2
- package/.next/server/chunks/ssr/{_0pm-2p-._.js → _1-zyvdb._.js} +2 -2
- package/.next/server/chunks/ssr/{_1_rqu8x._.js → _12mijol._.js} +7 -7
- package/.next/server/chunks/ssr/_15zqt-t._.js +1 -1
- package/.next/server/chunks/ssr/_184327j._.js +1 -1
- package/.next/server/chunks/ssr/{_1y-ea28._.js → _1a-nuxx._.js} +2 -2
- package/.next/server/chunks/ssr/_1alxym6._.js +3 -0
- package/.next/server/chunks/ssr/{_0hzz82u._.js → _1d423aj._.js} +25 -23
- package/.next/server/chunks/ssr/{_1u1mxu9._.js → _1flbs77._.js} +2 -2
- package/.next/server/chunks/ssr/_1mqn9mc._.js +1 -1
- package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
- package/.next/server/chunks/ssr/{_1oijqjw._.js → _1tmu8z-._.js} +2 -2
- package/.next/server/chunks/ssr/{_10y6r1n._.js → _1uy0xom._.js} +3 -3
- package/.next/server/chunks/ssr/_1x-kojb._.js +20 -0
- package/.next/server/chunks/ssr/_1xoch6f._.js +1 -1
- package/.next/server/chunks/ssr/_1z74dmq._.js +164 -0
- package/.next/server/chunks/ssr/features_bot_1nr94ks._.js +3 -0
- package/.next/server/chunks/ssr/features_bot_1s_-2vj._.js +1 -1
- package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
- package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
- package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
- package/.next/server/chunks/ssr/{node_modules_111sh9o._.js → node_modules_03d0rfz._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0lg75qx._.js → node_modules_04_sbbc._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_10gbm2y._.js → node_modules_05ybmta._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1v9tc1c._.js → node_modules_068ws5v._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1_8mv4v._.js → node_modules_06bb4q8._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_01f8_se._.js → node_modules_07rs_p2._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0ii1l89._.js → node_modules_0dzm4um._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_20xmwtu._.js → node_modules_0jljel9._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1ix-g49._.js → node_modules_0sgy-dc._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0woscox._.js → node_modules_0t_ez6-._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_059vtf2._.js → node_modules_0th357h._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_06w645b._.js → node_modules_0ubdtk-._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0b8df3s._.js → node_modules_0uyh_vb._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_07ih6wb._.js → node_modules_0wnlddw._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0gt-uw9._.js → node_modules_0x630an._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1x825hz._.js → node_modules_0yvz9e0._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0t-44lj._.js → node_modules_12et8d5._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1m3gb16._.js → node_modules_13kwejm._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1p9rdsy._.js → node_modules_1af3w91._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0sz5yg1._.js → node_modules_1bucjlk._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1teyzfa._.js → node_modules_1lkix61._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1lsyy7k._.js → node_modules_1ogczzz._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1-7qawg._.js → node_modules_1s-gb-1._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0yv-re6._.js → node_modules_1uwg-gz._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_03ptrl9._.js → node_modules_1wbkzl9._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_00jv9_3._.js → node_modules_1z1lrbk._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@base-ui_react_0jne69c._.js → node_modules_@base-ui_react_0buz1-j._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_00q1oa3._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0r443fh._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1-2_5z7._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_10wnlbk._.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 +57 -57
- package/.next/static/chunks/06nt9tatr-dug.js +1 -0
- package/.next/static/chunks/0_awn8tucznxc.js +1 -0
- package/.next/static/chunks/{34s52v8f841zo.js → 0ge-hx0ed83a1.js} +1 -1
- package/.next/static/chunks/0pda_vf-abwvx.js +1 -0
- package/.next/static/chunks/{2u9yjkpkoij75.js → 0qmd8n52hp-6v.js} +1 -1
- package/.next/static/chunks/0rowp9rx3qbxu.js +18 -0
- package/.next/static/chunks/{1ocy4w0v20a3v.js → 13ixzheqw7o-w.js} +2 -2
- package/.next/static/chunks/1grkt5gr8pbg1.js +17 -0
- package/.next/static/chunks/{21gf2t_whhurc.js → 1yugpvvi8qrbu.js} +2 -2
- package/.next/static/chunks/{1e4yrzs5evq_r.js → 245hb85nsy6j4.js} +1 -1
- package/.next/static/chunks/27lkanxvtdn09.js +1 -0
- package/.next/static/chunks/{0oz7a68qanm99.js → 27tvv1i-smrck.js} +1 -1
- package/.next/static/chunks/{2zhfdbq50ee5i.js → 2c64drdevdla3.js} +1 -1
- package/.next/static/chunks/{0k5tkt_qi52kb.js → 2ndw4w4u2x51r.js} +1 -1
- package/.next/static/chunks/37j27b3e1gt7r.js +1 -0
- package/.next/static/chunks/{2om4lkg86feb4.js → 38301ji-85i30.js} +1 -1
- package/.next/static/chunks/{09c13vnqy7al3.js → 3bbzsitgiltnt.js} +2 -2
- package/.next/static/chunks/3fec-aeteddr-.js +1 -0
- package/.next/static/chunks/3go3hwp1z2_h2.css +1 -0
- package/.next/static/chunks/3h2bun3hcggg8.js +1 -0
- package/.next/static/chunks/{0g1p98s2pfx2w.js → 3h2e-xv1zxh_f.js} +2 -2
- package/.next/static/chunks/3j1y335o95mj7.js +1 -0
- package/.next/static/chunks/3obf9n3cxj99k.js +1 -0
- package/.next/static/chunks/{2upc9mkcc3nlq.js → 427qsc6kahxyo.js} +1 -1
- package/README.md +31 -14
- package/bin/port.mjs +11 -7
- package/bin/thursday.mjs +1 -1
- package/components/ui/radio-group.tsx +2 -2
- package/components/ui/shiny-text.tsx +3 -22
- package/docs/how-it-works.md +11 -3
- package/docs/images/first-run.png +0 -0
- package/docs/images/keeps-going.png +0 -0
- package/docs/images/two-minds.png +0 -0
- package/features/ai/components/model-browser.tsx +1 -1
- package/features/ai/components/model-picker.tsx +1 -1
- package/features/ai/guide.ts +9 -4
- package/features/ai/prompts/bot.prompt.ts +4 -1
- package/features/ai/tools/routine.tool.ts +28 -16
- package/features/bot/bot.runner.ts +3 -1
- package/features/bot/components/bot-mark.tsx +6 -1
- package/features/bot/components/bot-setting.tsx +2 -4
- package/features/bot/components/bot-tool.tsx +2 -0
- package/features/bot/components/room-list.tsx +12 -3
- package/features/bot/components/room-pill.tsx +26 -19
- package/features/config/components/config-setting.tsx +17 -5
- package/features/config/components/voice-key.tsx +38 -18
- package/features/connectors/mcp.const.ts +90 -59
- package/features/intro/components/intro.tsx +50 -27
- package/features/routine/components/routine-mark.tsx +4 -6
- package/features/routine/components/routine-setting.tsx +332 -143
- package/features/routine/routine.query.ts +24 -3
- package/features/routine/routine.schema.ts +55 -4
- package/features/settings/components/install-app.tsx +1 -4
- package/features/settings/components/setting-ui.tsx +1 -1
- package/features/skills/skills.discover.ts +2 -1
- package/features/skills/skills.query.ts +5 -1
- package/features/skills/skills.schema.ts +2 -0
- package/features/thursday/components/ascii-orb.tsx +39 -10
- package/features/thursday/components/connect-wave.tsx +284 -0
- package/features/thursday/components/side-captions.tsx +29 -17
- package/features/thursday/components/thursday-setting.tsx +2 -2
- package/features/thursday/components/thursday.tsx +130 -58
- package/features/thursday/components/voice-picker.tsx +1 -1
- package/features/thursday/components/write-line.tsx +2 -2
- package/features/thursday/open-work.ts +11 -3
- package/features/thursday/tool-line.ts +94 -12
- package/features/thursday/use-text-call.ts +3 -2
- package/features/thursday/use-thursday.ts +5 -2
- package/features/workspace/components/artifact-view.tsx +129 -7
- package/guide/bots.md +17 -5
- package/guide/calls.md +15 -7
- package/guide/setup.md +10 -2
- package/lib/desktop-notify.ts +3 -2
- package/package.json +1 -1
- package/scripts/bot-context.test.mts +1 -1
- package/skills/computer/SKILL.md +1 -0
- package/skills/interactive-page/SKILL.md +4 -0
- package/.next/server/chunks/[root-of-the-server]__0n-l_n_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0wvo2of._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1e6aut3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ziojdq._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1srp8l5._.js +0 -3
- package/.next/server/chunks/ssr/_0mes4s0._.js +0 -3
- package/.next/server/chunks/ssr/_0ya0cb0._.js +0 -3
- package/.next/server/chunks/ssr/_0yto5s7._.js +0 -20
- package/.next/server/chunks/ssr/_10dw2nv._.js +0 -3
- package/.next/server/chunks/ssr/_1p0gxeo._.js +0 -164
- package/.next/server/chunks/ssr/_1r41yvh._.js +0 -3
- package/.next/server/chunks/ssr/_1r79ksv._.js +0 -3
- package/.next/server/chunks/ssr/features_bot_1ogjt52._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_@base-ui_react_0b3d4m9._.js +0 -3
- package/.next/static/chunks/03omwz_vi2ndg.js +0 -1
- package/.next/static/chunks/0_1bqgd6wt_og.js +0 -1
- package/.next/static/chunks/0abgkzikaznxc.js +0 -1
- package/.next/static/chunks/0bddkpash59-o.js +0 -17
- package/.next/static/chunks/0c2-bzhy3a0ib.js +0 -1
- package/.next/static/chunks/0iilfb1ocevnx.js +0 -1
- package/.next/static/chunks/0imbhx-j830a_.css +0 -1
- package/.next/static/chunks/24h1y9dhy3m_2.js +0 -1
- package/.next/static/chunks/2be08eqxsfc1y.js +0 -1
- package/.next/static/chunks/2d3yhjtafgmtw.js +0 -1
- package/.next/static/chunks/2f_5saocsko_b.js +0 -1
- package/.next/static/chunks/2lwbr5vx0ixaj.js +0 -18
- package/.next/static/chunks/44kjmi5h_p8px.js +0 -1
- /package/.next/static/{UiOMPYpQ4fqGyu5PzS-7j → u8kJqShUAa49vY7BxAWsw}/_buildManifest.js +0 -0
- /package/.next/static/{UiOMPYpQ4fqGyu5PzS-7j → u8kJqShUAa49vY7BxAWsw}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{UiOMPYpQ4fqGyu5PzS-7j → u8kJqShUAa49vY7BxAWsw}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[
|
|
1
|
+
module.exports=[56802,e=>e.a(async(t,a)=>{try{e.i(687388);var o=e.i(378884);e.i(704161);var n=t([o]);[o]=n.then?(await n)():n,e.s([]),a()}catch(e){a(e)}},!1),962072,e=>e.a(async(t,a)=>{try{var o=e.i(687388),n=e.i(186304),s=e.i(353885),r=e.i(265143),i=e.i(378884),h=e.i(619898),l=e.i(453569),d=e.i(636882),u=e.i(22676),c=e.i(786025),m=e.i(660948),w=e.i(54282),y=t([r,i,h,u,m]);async function p(e,t=!1){var a,y,f,b,k,v,O;let T,E=await (0,c.openWorkspace)(),[S,$,A,_,M,L,N,C,I]=await Promise.all([(0,d.loadSkills)(E),(0,h.listNoteIndex)(),(0,h.listAlwaysLoaded)(),(0,h.readNotes)(l.MEMORY_ALWAYS_LISTED,{touch:!1}),(0,m.listConnectedToolNames)(),(0,r.listJobBots)(),(0,u.listRecentTurns)(o.RECENT_CALL.rows),(0,u.readCallSkillsOn)(),(0,r.readBotMemoryOn)()]),x=await (0,i.listCallJobs)(N.map(e=>e.callId)),j=[(0,w.thursdayIdentity)(),t?"":(0,w.callEnding)(),function(e,t,a){let{crowded:o,heavy:n}=(0,w.tidying)(e),r=[...n].sort((e,t)=>t.factCount-e.factCount).slice(0,3).map(e=>e.path),i=o||n.length?`
|
|
2
2
|
|
|
3
3
|
Saved memory has grown past what it holds well${r.length?` (${r.join(", ")})`:""}: say so once in what you return, go through what looks out of date with the user, and forget only what they name.`:"",h=new Set(a.map(e=>e.path)),d=new Set(t.map(e=>e.id)),u=`## Memory
|
|
4
4
|
|
|
@@ -7,7 +7,7 @@ What you have kept from talking with this user — the only thing that survives
|
|
|
7
7
|
${a.map(e=>(function(e,t){let{shown:a,hidden:o}=(0,w.expandedFacts)(e.facts,t),n=a.map(e=>`- ${e.text} #${e.id}`);return o&&n.push(`- … ${o} older not shown — \`${s.TOOL_NAMES.memory_recall}\` ${e.path} opens the whole note`),`${e.path} — ${e.description}
|
|
8
8
|
${n.length?n.join("\n"):"- (nothing yet)"}`})(e,d)).join("\n\n")}`,m=t.filter(e=>!h.has(e.path)),y=m.length?`Already known — carried into every call:
|
|
9
9
|
|
|
10
|
-
${(0,w.carriedLines)(m)}`:"",
|
|
10
|
+
${(0,w.carriedLines)(m)}`:"",p=`Every other note — path — what is under it (facts) "what the user calls it":
|
|
11
11
|
|
|
12
12
|
${(0,w.noteLines)(e.filter(e=>!h.has(e.path)),o)}${i}
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@ Keep what the user tells you as it comes up, with \`${s.TOOL_NAMES.memory_rememb
|
|
|
17
17
|
|
|
18
18
|
**Keep memory clean as you write.** A fact that repeats, narrows or changes one already in the note replaces it, merged into one line, rather than sitting beside it. A later call finds a note only by its path, its line and the names in quotes: keep the line true, and give something new its own path below.
|
|
19
19
|
|
|
20
|
-
${l.MEMORY_PATHS.map(e=>`- ${e.path} — ${e.of}`).join("\n")}`;return[u,c,y,
|
|
20
|
+
${l.MEMORY_PATHS.map(e=>`- ${e.path} — ${e.of}`).join("\n")}`;return[u,c,y,p].filter(Boolean).join("\n\n")}($,A,_.notes),(a=L,y=(0,w.reachNames)(C?[]:S,M),f=I,0===a.length?"":`## Background work
|
|
21
21
|
|
|
22
22
|
Who you hand work to — the names \`${s.TOOL_NAMES.thread_start}\` takes.
|
|
23
23
|
|
|
@@ -31,7 +31,7 @@ What bots can reach for: ${y}.`:""}
|
|
|
31
31
|
|
|
32
32
|
**Work that should start by itself — every morning, every few hours — is a routine.** \`${s.TOOL_NAMES.routine}\` makes one from a bot, the work in the user's own words, and when; from then on it starts a thread for it each time without being asked, and the result reaches the user like any thread's. Ask once for whichever of those they left out, and read the ones that exist before making, changing or deleting one.
|
|
33
33
|
|
|
34
|
-
Updates and questions from threads reach the conversation by themselves, naming their thread and the bot that asks; they come from bots, not the user, and a question is answered with \`${s.TOOL_NAMES.thread_answer}\`. When the user wants to see what a thread made, \`${s.TOOL_NAMES.thread_show}\` puts it on their screen. Once you have explained enough of how a thread ended, mark it with \`${s.TOOL_NAMES.thread_seen}\`, or leave it for the user to open; never mention seen to them.`),(b=
|
|
34
|
+
Updates and questions from threads reach the conversation by themselves, naming their thread and the bot that asks; they come from bots, not the user, and a question is answered with \`${s.TOOL_NAMES.thread_answer}\`. When the user wants to see what a thread made, \`${s.TOOL_NAMES.thread_show}\` puts it on their screen. Once you have explained enough of how a thread ended, mark it with \`${s.TOOL_NAMES.thread_seen}\`, or leave it for the user to open; never mention seen to them.`),(b=E.cwd,k=C?S:[],T=`## This computer
|
|
35
35
|
|
|
36
36
|
Current Cwd: ${b}
|
|
37
37
|
Platform: ${process.platform}
|
|
@@ -52,10 +52,10 @@ What was said on the last calls, verbatim, newest last. It is the past: pick it
|
|
|
52
52
|
|
|
53
53
|
A \`${s.TOOL_NAMES.thread_start}\` line carries the thread's handle and how it ended; the handle is for the thread tools, never said aloud. What they ask for now is often one of these carried further.
|
|
54
54
|
|
|
55
|
-
${(0,w.recentCallLines)(v.map(e=>({...e,jobs:O.filter(t=>t.callId===e.callId)})),o.RECENT_CALL.tokens)}`:""),
|
|
55
|
+
${(0,w.recentCallLines)(v.map(e=>({...e,jobs:O.filter(t=>t.callId===e.callId)})),o.RECENT_CALL.tokens)}`:""),g(e)].filter(Boolean).join("\n\n");return(0,w.logPromptSize)("thursday",j),j}[r,i,h,u,m]=y.then?(await y)():y;let g=e=>e?.trim()?`## Additional instructions
|
|
56
56
|
|
|
57
57
|
Written by the user. Follow them together with everything above.
|
|
58
58
|
|
|
59
|
-
${e.trim()}`:"";e.s(["loadThursdayPrompt",0,
|
|
59
|
+
${e.trim()}`:"";e.s(["loadThursdayPrompt",0,p]),a()}catch(e){a(e)}},!1),97334,e=>e.a(async(t,a)=>{try{var o=e.i(68356),n=e.i(915874),s=e.i(469719),r=e.i(687388),i=e.i(911757),h=e.i(159479),l=e.i(386075),d=e.i(264079),u=e.i(56802),c=e.i(962072),m=e.i(353885),w=e.i(279041),y=e.i(340698),p=e.i(878498),g=e.i(640911),f=e.i(53748),b=e.i(22676),k=e.i(134344),v=t([h,l,u,c,y,b]);async function O(){let e=await Promise.all(k.TEXT_CALL_PROVIDERS.map(async e=>await (0,y.readConfig)(e.apiKeyName)?e.apiKeyName:null));return(0,k.textCallRunsOn)(t=>e.includes(t))}async function T(e,t){if(t)return t;let a=await O();return a||(0,f.publicError)(_),{provider:a,model:e.backendModel}}[h,l,u,c,y,b]=v.then?(await v)():v;let A=s.z.object({callId:s.z.string().min(1),settings:k.ThursdaySettingsSchema,standing:s.z.string().nullish(),runsOn:d.textModelRefSchema.nullish(),messages:s.z.array(s.z.unknown()).min(1)});async function E(e,t){var a,s;let i,h;try{i=await $(e)}catch(o){let{status:e,message:t}=(a=o,(0,f.isPublicError)(a)?{status:400,message:a.message}:a instanceof n.ZodError?{status:400,message:a.issues[0]?.message??"That request does not fit"}:(g.logger.error(a),{status:500,message:"Could not reach her"}));return new Response(t,{status:e})}let d=(0,o.streamText)({model:i.model,instructions:i.system,messages:i.messages,allowSystemInMessages:!0,tools:i.tools,providerOptions:i.providerOptions,stopWhen:(0,o.stepCountIs)(r.TEXT_CALL.maxSteps),abortSignal:t,onStepEnd:(s=i.callId,h=i.seq,async e=>{for(let t of e.content)if("tool-call"===t.type){let a=e.content.find(e=>"tool-result"===e.type&&e.toolCallId===t.toolCallId);await (0,b.saveTurns)(s,[{id:t.toolCallId,role:"tool",tool:t.toolName,text:t.toolName===m.TOOL_NAMES.web_search?function(e,t){let a=t??{},o=[(e??{}).query,a.action?.query].find(e=>"string"==typeof e&&!!e.trim()),n=Array.isArray(a.sources)?a.sources.flatMap(e=>e&&"object"==typeof e&&"url"in e&&"string"==typeof e.url?[{url:e.url,..."title"in e&&"string"==typeof e.title?{title:e.title}:{}}]:[]):[];return JSON.stringify({query:o??null,sources:n})}(t.input,a?.type==="tool-result"?a.output:null):JSON.stringify(t.input??{}),seq:h++}])}else"text"===t.type&&t.text.trim()?await (0,b.saveTurns)(s,[{id:crypto.randomUUID(),role:"assistant",text:t.text.trim(),seq:h++}]):"reasoning"===t.type&&t.text.trim()&&await (0,b.saveThought)(s,{id:crypto.randomUUID(),text:t.text.trim(),seq:h})})});return(0,o.createUIMessageStreamResponse)({stream:(0,o.toUIMessageStream)({stream:d.stream,tools:i.tools,onError:l.modelErrorToString})})}async function S(e,t,a){let o=await T(t,a),n="openai"===o.provider||"chatgpt"===o.provider,[s,r,d,u,g]=await Promise.all([(0,l.getTextModel)(o),(0,c.loadThursdayPrompt)(t.backendPrompt,!0),(0,h.loadTools)({target:"thursday",callId:e,webSearch:t.webSearch,written:!0}),(0,y.readConfig)(w.EXA_API_KEY),(0,y.readConfig)(i.LIVE_PROVIDER.apiKeyName)]),f=s.searchTools&&Object.values(s.searchTools)[0],b={...d,...t.webSearch&&!u&&f?{[m.TOOL_NAMES.web_search]:f}:{}},k=n?g?await (0,p.acceptedReasoning)({apiKey:g,model:o.model,effort:t.reasoningEffort}):"none"===t.reasoningEffort?{effort:"none"}:{effort:t.reasoningEffort??void 0,summary:"auto"}:null;return{model:s.model,system:r,tools:b,providerOptions:{openai:{...k?.effort?{reasoningEffort:k.effort}:{},...k&&"summary"in k&&k.summary?{reasoningSummary:k.summary}:{}}}}}async function $(e){let{callId:t,settings:a,standing:n,runsOn:s,messages:r}=A.parse(e),[i,h,l]=await Promise.all([S(t,a,s),(0,o.validateUIMessages)({messages:r}),(0,b.nextTurnSeq)(t)]),d=h.at(-1);d?.role!=="user"&&(0,f.publicError)("The last message is not yours.");let u=d.metadata?.relay===!0;return u||await (0,b.saveTurns)(t,[{id:d.id,role:"user",text:M(d),seq:l}]),{...i,callId:t,seq:u?l:l+1,messages:[...n?[{role:"system",content:n}]:[],...await (0,o.convertToModelMessages)(h,{ignoreIncompleteToolCalls:!0})]}}let _="Writing to Thursday needs a GPT subscription sign-in or an OpenAI key — Settings › API keys.",M=e=>e.parts.flatMap(e=>"text"===e.type?e.text:[]).join("\n").trim();e.s(["streamTextCall",0,E]),a()}catch(e){a(e)}},!1),878498,e=>{"use strict";var t=e.i(469719),a=e.i(687388),o=e.i(640911);e.i(904309),t.z.object({session:t.z.object({id:t.z.string().min(1)}),transport:t.z.object({type:t.z.literal("webrtc"),sdp:t.z.string().min(1)})});let n=new Map;async function s(e){let{apiKey:t,model:s,effort:r}=e,i=`${s} ${r??"auto"}`,h=n.get(i);if(void 0!==h)return h;let l="none"===r?{effort:r}:{...r?{effort:r}:{},summary:"auto"};for(;;){let e=await fetch("https://api.openai.com/v1/responses/input_tokens",{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},signal:AbortSignal.timeout(a.LIVE_CALL.reasoningCheckMs),body:JSON.stringify({model:s,input:".",reasoning:l})}).catch(()=>null);if(!e)return l;let r=Object.keys(l).length?l:null;if(e.ok)return n.set(i,r),r;let h=await e.json().catch(()=>null),d=h?.error?.param?.replace(/^reasoning\./,"");if("effort"!==d&&"summary"!==d||!(d in l))return l;if(o.logger.warn(`${s} takes no reasoning ${d}; calls omit it`),delete l[d],!Object.keys(l).length)return n.set(i,null),null}}e.s(["acceptedReasoning",0,s])}];
|
|
60
60
|
|
|
61
|
-
//# sourceMappingURL=
|
|
61
|
+
//# sourceMappingURL=_1m88lkh._.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
module.exports=[159479,e=>e.a(async(t,a)=>{try{var i=e.i(847841),n=e.i(983477),r=e.i(687388),o=e.i(386075),s=e.i(54282),l=e.i(316172),h=e.i(349047),c=e.i(170801),d=e.i(926435),u=e.i(770639),m=e.i(418919),p=e.i(489956),w=e.i(205863),f=e.i(41181),g=e.i(353885),y=e.i(123203),b=e.i(944971),S=e.i(636882),T=e.i(22676),O=e.i(786025),$=e.i(704161),k=e.i(640911),_=e.i(53748),v=e.i(388439),M=e.i(41444),A=t([o,l,d,u,m,p,T]);async function E(t){let{listThreadOverview:a}=await e.A(866938),i=await a();if(!i.length)return"No thread has been started yet.";let n=i.map(e=>`"${e.label}" (${e.bot}, ${e.status})`).join(", ");return`There is no thread called "${t}". The latest are: ${n}. Call again with one of those labels.`}async function N(e,t){let a=[];for(let[e,n]of Object.entries(t)){let t=await (0,i.asSchema)(n.inputSchema).jsonSchema,r="string"==typeof n.description?n.description:"";a.push({name:e,tokens:(0,v.estimateTokens)(r)+(0,v.estimateTokens)(JSON.stringify(t))})}a.sort((e,t)=>t.tokens-e.tokens);let n=a.reduce((e,t)=>e+t.tokens,0);k.logger.debug(`${e} tools ${n} tokens over ${a.length} — ${a.map(e=>`${e.name} ${e.tokens}`).join(", ")}`)}async function x(e){let t=await L(e);return r.IS_DEV&&await N(e.target,t),t}async function L(t){if("memory-edit"===t.target){let e=(0,u.createMemoryTools)("user",null,{countReads:!1});return{[g.TOOL_NAMES.memory_recall]:e[g.TOOL_NAMES.memory_recall],[g.TOOL_NAMES.memory_remember]:e[g.TOOL_NAMES.memory_remember],[g.TOOL_NAMES.memory_forget]:e[g.TOOL_NAMES.memory_forget]}}let{[g.TOOL_NAMES.memory_conversation]:a,...k}=(0,u.createMemoryTools)("call","thursday"===t.target?t.callId??null:null),v={[g.TOOL_NAMES.memory_conversation]:a},A=await (0,O.openWorkspace)();if("thursday"===t.target){var N;let a,o,d=await (0,T.readCallSkillsOn)()?(0,f.createSkillTools)({sandbox:A,skills:await (0,S.loadSkills)(A)}):{};return{...k,...v,...d,...(0,y.createWorkspaceTools)(A,{write:!1,timeoutMs:r.CALL_EXEC_TIMEOUT_MS}),...!1===t.webSearch?{}:await (0,p.createCallSearchTool)(A),...(N=t.callId,a=async t=>{let{resolveThread:a}=await e.A(866938);return(t.trim()?await a(t.trim()):null)??await E(t)},o=async(t,a,i)=>{let n=await e.A(994193);try{return await n.answerThread(t,a,"thursday",i)}catch(e){if((0,_.isPublicError)(e))return e.message;throw e}},{[g.TOOL_NAMES.thread_start]:(0,i.tool)({description:l.threadStartSpec.description,inputSchema:l.threadStartSpec.parameters,execute:async({bot:t,request:a,label:i})=>{let{findJobBot:n,listJobBots:r}=await e.A(814317),o=await n(t);if(!o||o.disabled){let e=(await r()).map(e=>e.name);return`There is no bot called "${t}". The bots are: ${e.join(", ")}. Nothing was started — call again with one of those.`}let{startThread:s}=await e.A(994193);return{threadId:await s({bot:o.name,request:a,label:i,callId:N,from:"thursday"}),note:`${o.name} has "${i}". Its updates reach the conversation on their own. Anything further about this work — a correction, the next step once it finishes — is \`${g.TOOL_NAMES.thread_tell}\` with "${i}"; a question it asks is answered with \`${g.TOOL_NAMES.thread_answer}\`.`}}}),[g.TOOL_NAMES.thread_tell]:(0,i.tool)({description:l.threadTellSpec.description,inputSchema:l.threadTellSpec.parameters,execute:async({thread:e,words:t})=>{let i=await a(e);if("string"==typeof i)return i;if(!t.trim())return"Say what to pass on.";let n=await o(i.id,t.trim());return"string"==typeof n?n:n?.answered?{label:i.label,answered:n.answered,note:`${n.answered.bot} was waiting on a question, and took this as its answer.`}:{label:i.label,bot:n?.to??i.bot,status:"running",note:"running"===i.status?"The bot reads it before its next step.":"The bot picks the thread back up from there."}}}),[g.TOOL_NAMES.thread_answer]:(0,i.tool)({description:l.threadAnswerSpec.description,inputSchema:l.threadAnswerSpec.parameters,execute:async({thread:t,bot:i,answer:n})=>{let r=await a(t);if("string"==typeof r)return r;if(!n.trim())return"Say what the answer is.";let{findThreadView:s}=await e.A(866938),l=(await s(r.id))?.room.questions??[],h=l.find(e=>e.bot.toLowerCase()===i.trim().toLowerCase());if(!h)return l.length?`${i} is not asking anything in "${r.label}". Waiting there: ${l.map(e=>e.bot).join(", ")}. Call again with that bot.`:`No question is waiting in "${r.label}". To say something else to it, use \`${g.TOOL_NAMES.thread_tell}\`.`;let c=await o(r.id,n.trim(),h.bot);return"string"==typeof c?c:{label:r.label,answered:c?.answered??{bot:h.bot,question:h.text},note:`${h.bot} has the answer to its question and goes on from it.`}}}),[g.TOOL_NAMES.thread_status]:(0,i.tool)({description:l.threadStatusSpec.description,inputSchema:l.threadStatusSpec.parameters,execute:async({thread:t})=>{let{listThreadOverview:i,findThreadView:r}=await e.A(866938),o={now:(0,s.clockNow)()},l=e=>(0,n.formatDistanceToNowStrict)((0,$.toDate)(e),{addSuffix:!0});if(!(!t.trim()||"all"===t.trim().toLowerCase())){let e=await a(t);if("string"==typeof e)return e;let i=(await r(e.id))?.room;return{...o,label:e.label,id:e.id,bot:e.bot,participants:i?.participants??[],questions:i?.questions??[],status:e.status,since:l(e.updatedAt),outcome:e.outcome,..."waiting"===e.status&&e.pending?.options.length?{options:e.pending.options}:{}}}let h=await i();return h.length?{...o,threads:h.map(e=>({id:e.id,label:e.label,bot:e.bot,status:e.status,participants:e.room.participants,questions:e.room.questions.map(e=>({...e,text:(0,M.clip)(e.text,200)})),since:l(e.updatedAt),...e.ask?{asking:e.ask.question,options:e.ask.options}:{},..."running"===e.status?{now:(0,b.threadActivity)(e.lines)}:{},...e.outcome&&"waiting"!==e.status?{outcome:(0,M.clip)(e.outcome,200)}:{}}))}:"No thread has been started yet."}}),[g.TOOL_NAMES.thread_cancel]:(0,i.tool)({description:l.threadCancelSpec.description,inputSchema:l.threadCancelSpec.parameters,execute:async({thread:t})=>{let i=await a(t);if("string"==typeof i)return i;let{cancelThread:n}=await e.A(994193);return await n(i.id),{label:i.label,status:"cancelled"}}}),[g.TOOL_NAMES.thread_show]:(0,i.tool)({description:l.threadShowSpec.description,inputSchema:l.threadShowSpec.parameters,execute:async({thread:t})=>{let i=await a(t);if("string"==typeof i)return i;let{appEvents:n}=await e.A(522275),{filesOnDisk:r}=await e.A(149325),{opensOnFinish:o,pathsIn:s}=await e.A(628124),l=await r(s(i.outcome??""),null);if(!l.length)return n.emit({type:"showThread",threadId:i.id}),{label:i.label,showing:"the thread"};let h=Math.max(0,l.findIndex(o));n.emit({type:"showFile",paths:[l[h],...l.filter((e,t)=>t!==h)]});let{markSeen:c}=await e.A(866938);return await c([i.id]),{label:i.label,showing:l[h]}}}),[g.TOOL_NAMES.thread_seen]:(0,i.tool)({description:l.threadSeenSpec.description,inputSchema:l.threadSeenSpec.parameters,execute:async({thread:t})=>{let i=await a(t);if("string"==typeof i)return i;let{markSeen:n}=await e.A(866938);return await n([i.id]),{label:i.label,seen:!0}}})}),...(0,m.createRoutineTools)(),...t.written?(0,c.createLookTool)():(0,h.callTools)()}}let x=await (0,S.loadSkills)(A,t.bot);return{[g.TOOL_NAMES.memory_recall]:k[g.TOOL_NAMES.memory_recall],...v,...await (0,p.createSearchTool)(t.model,A),...(0,y.createWorkspaceTools)(A,{write:!0,env:{...(0,O.jobShellEnv)(t.session),...(0,O.botShellEnv)(t.bot)},guide:!0,bot:t.bot}),...await (0,d.createMcpTools)(t.bot,A),...(0,f.createSkillTools)({sandbox:A,skills:x,bot:t.bot}),...t.model&&(0,o.seesToolImages)(t.model.ref)?(0,c.createLookTool)():{},...(0,w.createSignInTools)(A,t.bot,(0,O.jobShellEnv)(t.session)),...await (0,l.createThreadRecallTool)(t.bot,t.thread??null)}}[o,l,d,u,m,p,T]=A.then?(await A)():A,e.s(["loadTools",0,x]),a()}catch(e){a(e)}},!1),54282,e=>{"use strict";var t=e.i(343747),a=e.i(983477),i=e.i(687388),n=e.i(353885);n.TOOL_NAMES.memory_recall,n.TOOL_NAMES.memory_remember,n.TOOL_NAMES.memory_forget,n.TOOL_NAMES.bash,n.TOOL_NAMES.web_search,n.TOOL_NAMES.load_skill,n.TOOL_NAMES.look_at,n.TOOL_NAMES.end_call;var r=e.i(704161),o=e.i(640911),s=e.i(388439),l=e.i(41444);let h=(e=new Date)=>`${(0,t.format)(e,"yyyy-MM-dd (EEE) HH:mm")} ${Intl.DateTimeFormat().resolvedOptions().timeZone}`,c=(e=new Date)=>`**Now**: ${h(e)}`,d=e=>`${(0,t.format)(e,"yyyy-MM-dd (EEE) HH:mm")} (${(0,a.formatDistanceToNowStrict)(e,{addSuffix:!0})})`,u={[n.STUDIO_TOOLS.generate_image]:"images",[n.STUDIO_TOOLS.generate_speech]:"speech",[n.STUDIO_TOOLS.transcribe]:"transcription",[n.STUDIO_TOOLS.generate_video]:"video"};e.s(["botWorkHead",0,function(e,i){let n=(0,a.formatDistanceToNowStrict)(e.updatedAt,{addSuffix:!0}),r="running"===e.status?`running, last moved ${n}`:e.asking?`waiting on the user's answer since ${n}`:"waiting"===e.status?`stopped ${n}, not finished`:`${"done"===e.status?"ended":"stopped by the user"} ${(0,t.format)(e.updatedAt,"yyyy-MM-dd")}`;return`"${e.label}" — ${e.owner===i?"yours":`${e.owner}'s`} — ${r}`},"callEnding",0,()=>`IMPORTANT — always follow this: when the user wants the call to end, however they say it, forget every other task, answer yes in one word of their language, then immediately, without thinking, use the ${n.TOOL_NAMES.end_call} tool.`,"callStamp",0,d,"carriedLines",0,(e,t={})=>e.map(e=>`- ${e.text} \xb7 ${e.path}${!1===t.ids?"":` #${e.id}`}`).join("\n"),"clockNow",0,h,"conversationLines",0,e=>e.map(e=>"tool"===e.role?`you → ${e.tool??"tool"}`:`${"user"===e.role?"user":"you"}: ${e.text}`).join("\n"),"expandedFacts",0,function(e,t){let a=e.filter(e=>t.has(e.id)),n=e.filter(e=>!t.has(e.id)),r=Math.max(0,i.MEMORY_LIMITS.expanded-a.length),o=new Set([...a,...n.slice(Math.max(0,n.length-r))].map(e=>e.id)),s=e.filter(e=>o.has(e.id));return{shown:s,hidden:e.length-s.length}},"logPromptSize",0,function(e,t){let a=(0,s.sectionTokens)(t),n=a.reduce((e,t)=>e+t.tokens,0);o.logger.debug(`${e} prompt ${n} tokens — ${a.map(e=>`${e.name} ${e.tokens}`).join(", ")}`);let r=a[0];n>i.PROMPT_BUDGET&&r&&o.logger.warn(`${e} prompt is ${n} tokens, over ${i.PROMPT_BUDGET}: ${r.name} carries ${r.tokens} of it. Every call and every job pays this.`)},"mcpToolLines",0,function(e){let t=new Map;for(let a of e){let e=t.get(a.server);e?e.push(a.name):t.set(a.server,[a.name])}return[...t].map(([e,t])=>`- **${e}**: ${t.join(", ")}`).join("\n")},"noteLines",0,function(e,t=!1){return e.length?e.map(e=>{var a;let i,n=e.aliases?.length?` ${e.aliases.map(e=>`"${e}"`).join(" ")}`:"",o=t?` \xb7 ${a=e.lastSeenAt,(i=Math.floor((Date.now()-(0,r.toDate)(a).getTime())/864e5))>=365?`${Math.floor(i/365)}y`:i>=30?`${Math.floor(i/30)}mo`:`${Math.max(i,0)}d`}`:"";return`- ${e.path} — ${e.description?.trim()} (${e.factCount})${n}${o}`}).join("\n"):"(nothing saved yet)"},"nowLine",0,c,"reachNames",0,function(e,t){let a=t.map(e=>e.server===i.STUDIO_SERVER?u[e.name]??e.name:e.server);return[...new Set([...e.map(e=>e.name),...a])].join(", ")},"recentCallLines",0,function(e,t){let a=[],r=0;e:for(let o=e.length-1;o>=0;o--){let h=e[o];for(let e=h.turns.length-1;e>=0;e--){let o=function(e,t){if("tool"!==e.role)return`${"user"===e.role?"user":"you"}: ${e.text}`;let a=function(e,t){if(e!==n.TOOL_NAMES.web_search)return null;try{let e=JSON.parse(t),a=Array.isArray(e.sources)?e.sources.flatMap(e=>e&&"object"==typeof e&&"string"==typeof e.url?[e]:[]):[];return{query:"string"==typeof e.query?e.query:null,sources:a}}catch{return null}}(e.tool,e.text);if(a){let t=[...new Set(a.sources.flatMap(e=>{try{return[new URL(e.url).hostname.replace(/^www\./,"")]}catch{return[]}}))];return`you → ${e.tool} "${(0,l.clip)(a.query??"",i.PROMPT_LINE.toolArgs)}"${t.length?` — ${t.join(", ")}`:""}`}let r=`you → ${e.tool??"tool"} ${(0,l.clip)(e.text,i.PROMPT_LINE.toolArgs)}`;if(e.tool!==n.TOOL_NAMES.thread_start)return r;let o=function(e,t){if(e!==n.TOOL_NAMES.thread_start)return null;try{let e=JSON.parse(t);return"string"==typeof e.label?e.label:null}catch{return null}}(e.tool,e.text),s=o?t.jobs?.find(e=>e.label===o):void 0;if(!s)return r;let h=s.outcome?`: ${(0,l.clip)(s.outcome,i.PROMPT_LINE.jobOutcome)}`:"";return`you → ${e.tool} "${s.label}" (${s.id}) — ${s.status}${h}`}(h.turns[e],h),c=(0,s.estimateTokens)(o)+3;if(r+c>t&&a.length)break e;r+=c,a.push({call:h,line:o})}}a.reverse();let o=[],h=null;for(let{call:e,line:t}of a)e!==h&&(h=e,o.push(`### ${d(e.startedAt)}`)),o.push(t);return o.join("\n")},"saidStamp",0,e=>(0,t.format)(e,"yyyy-MM-dd (EEE) HH:mm"),"skillLines",0,(e,t={})=>e.map(e=>{var a;let n,r;return`- **${e.name}**: ${t.short?(a=e.description,n=i.PROMPT_LINE.skill,(r=a.trim().split(/(?<=[.。])\s|\n/)[0].trim()).length>n?`${r.slice(0,n).trim()}…`:r):e.description}`}).join("\n"),"thursdayIdentity",0,(e=new Date)=>`You are Thursday, this user's own personal assistant, on their side, modeled on Friday, the AI in *Iron Man*. ${c(e)}
|
|
1
|
+
module.exports=[159479,e=>e.a(async(t,a)=>{try{var i=e.i(847841),n=e.i(983477),r=e.i(687388),o=e.i(386075),s=e.i(54282),l=e.i(316172),h=e.i(349047),c=e.i(170801),d=e.i(926435),u=e.i(770639),m=e.i(418919),p=e.i(489956),w=e.i(205863),f=e.i(41181),g=e.i(353885),y=e.i(123203),b=e.i(944971),S=e.i(636882),T=e.i(22676),O=e.i(786025),$=e.i(704161),_=e.i(640911),k=e.i(53748),v=e.i(388439),M=e.i(41444),A=t([o,l,d,u,m,p,T]);async function E(t){let{listThreadOverview:a}=await e.A(866938),i=await a();if(!i.length)return"No thread has been started yet.";let n=i.map(e=>`"${e.label}" (${e.bot}, ${e.status})`).join(", ");return`There is no thread called "${t}". The latest are: ${n}. Call again with one of those labels.`}async function N(e,t){let a=[];for(let[e,n]of Object.entries(t)){let t=await (0,i.asSchema)(n.inputSchema).jsonSchema,r="string"==typeof n.description?n.description:"";a.push({name:e,tokens:(0,v.estimateTokens)(r)+(0,v.estimateTokens)(JSON.stringify(t))})}a.sort((e,t)=>t.tokens-e.tokens);let n=a.reduce((e,t)=>e+t.tokens,0);_.logger.debug(`${e} tools ${n} tokens over ${a.length} — ${a.map(e=>`${e.name} ${e.tokens}`).join(", ")}`)}async function L(e){let t=await x(e);return r.IS_DEV&&await N(e.target,t),t}async function x(t){if("memory-edit"===t.target){let e=(0,u.createMemoryTools)("user",null,{countReads:!1});return{[g.TOOL_NAMES.memory_recall]:e[g.TOOL_NAMES.memory_recall],[g.TOOL_NAMES.memory_remember]:e[g.TOOL_NAMES.memory_remember],[g.TOOL_NAMES.memory_forget]:e[g.TOOL_NAMES.memory_forget]}}let{[g.TOOL_NAMES.memory_conversation]:a,..._}=(0,u.createMemoryTools)("call","thursday"===t.target?t.callId??null:null),v={[g.TOOL_NAMES.memory_conversation]:a},A=await (0,O.openWorkspace)();if("thursday"===t.target){var N;let a,o,d=await (0,T.readCallSkillsOn)()?(0,f.createSkillTools)({sandbox:A,skills:await (0,S.loadSkills)(A)}):{};return{..._,...v,...d,...(0,y.createWorkspaceTools)(A,{write:!1,timeoutMs:r.CALL_EXEC_TIMEOUT_MS}),...!1===t.webSearch?{}:await (0,p.createCallSearchTool)(A),...(N=t.callId,a=async t=>{let{resolveThread:a}=await e.A(866938);return(t.trim()?await a(t.trim()):null)??await E(t)},o=async(t,a,i)=>{let n=await e.A(994193);try{return await n.answerThread(t,a,"thursday",i)}catch(e){if((0,k.isPublicError)(e))return e.message;throw e}},{[g.TOOL_NAMES.thread_start]:(0,i.tool)({description:l.threadStartSpec.description,inputSchema:l.threadStartSpec.parameters,execute:async({bot:t,request:a,label:i})=>{let{findJobBot:n,listJobBots:r}=await e.A(814317),o=await n(t);if(!o||o.disabled){let e=(await r()).map(e=>e.name);return`There is no bot called "${t}". The bots are: ${e.join(", ")}. Nothing was started — call again with one of those.`}let{startThread:s}=await e.A(994193);return{threadId:await s({bot:o.name,request:a,label:i,callId:N,from:"thursday"}),note:`${o.name} has "${i}". Its updates reach the conversation on their own. Anything further about this work — a correction, the next step once it finishes — is \`${g.TOOL_NAMES.thread_tell}\` with "${i}"; a question it asks is answered with \`${g.TOOL_NAMES.thread_answer}\`.`}}}),[g.TOOL_NAMES.thread_tell]:(0,i.tool)({description:l.threadTellSpec.description,inputSchema:l.threadTellSpec.parameters,execute:async({thread:e,words:t})=>{let i=await a(e);if("string"==typeof i)return i;if(!t.trim())return"Say what to pass on.";let n=await o(i.id,t.trim());return"string"==typeof n?n:n?.answered?{label:i.label,answered:n.answered,note:`${n.answered.bot} was waiting on a question, and took this as its answer.`}:{label:i.label,bot:n?.to??i.bot,status:"running",note:"running"===i.status?"The bot reads it before its next step.":"The bot picks the thread back up from there."}}}),[g.TOOL_NAMES.thread_answer]:(0,i.tool)({description:l.threadAnswerSpec.description,inputSchema:l.threadAnswerSpec.parameters,execute:async({thread:t,bot:i,answer:n})=>{let r=await a(t);if("string"==typeof r)return r;if(!n.trim())return"Say what the answer is.";let{findThreadView:s}=await e.A(866938),l=(await s(r.id))?.room.questions??[],h=l.find(e=>e.bot.toLowerCase()===i.trim().toLowerCase());if(!h)return l.length?`${i} is not asking anything in "${r.label}". Waiting there: ${l.map(e=>e.bot).join(", ")}. Call again with that bot.`:`No question is waiting in "${r.label}". To say something else to it, use \`${g.TOOL_NAMES.thread_tell}\`.`;let c=await o(r.id,n.trim(),h.bot);return"string"==typeof c?c:{label:r.label,answered:c?.answered??{bot:h.bot,question:h.text},note:`${h.bot} has the answer to its question and goes on from it.`}}}),[g.TOOL_NAMES.thread_status]:(0,i.tool)({description:l.threadStatusSpec.description,inputSchema:l.threadStatusSpec.parameters,execute:async({thread:t})=>{let{listThreadOverview:i,findThreadView:r}=await e.A(866938),o={now:(0,s.clockNow)()},l=e=>(0,n.formatDistanceToNowStrict)((0,$.toDate)(e),{addSuffix:!0});if(!(!t.trim()||"all"===t.trim().toLowerCase())){let e=await a(t);if("string"==typeof e)return e;let i=(await r(e.id))?.room;return{...o,label:e.label,id:e.id,bot:e.bot,participants:i?.participants??[],questions:i?.questions??[],status:e.status,since:l(e.updatedAt),outcome:e.outcome,..."waiting"===e.status&&e.pending?.options.length?{options:e.pending.options}:{}}}let h=await i();return h.length?{...o,threads:h.map(e=>({id:e.id,label:e.label,bot:e.bot,status:e.status,participants:e.room.participants,questions:e.room.questions.map(e=>({...e,text:(0,M.clip)(e.text,200)})),since:l(e.updatedAt),...e.ask?{asking:e.ask.question,options:e.ask.options}:{},..."running"===e.status?{now:(0,b.threadActivity)(e.lines)}:{},...e.outcome&&"waiting"!==e.status?{outcome:(0,M.clip)(e.outcome,200)}:{}}))}:"No thread has been started yet."}}),[g.TOOL_NAMES.thread_cancel]:(0,i.tool)({description:l.threadCancelSpec.description,inputSchema:l.threadCancelSpec.parameters,execute:async({thread:t})=>{let i=await a(t);if("string"==typeof i)return i;let{cancelThread:n}=await e.A(994193);return await n(i.id),{label:i.label,status:"cancelled"}}}),[g.TOOL_NAMES.thread_show]:(0,i.tool)({description:l.threadShowSpec.description,inputSchema:l.threadShowSpec.parameters,execute:async({thread:t})=>{let i=await a(t);if("string"==typeof i)return i;let{appEvents:n}=await e.A(522275),{filesOnDisk:r}=await e.A(149325),{opensOnFinish:o,pathsIn:s}=await e.A(628124),l=await r(s(i.outcome??""),null);if(!l.length)return n.emit({type:"showThread",threadId:i.id}),{label:i.label,showing:"the thread"};let h=Math.max(0,l.findIndex(o));n.emit({type:"showFile",paths:[l[h],...l.filter((e,t)=>t!==h)]});let{markSeen:c}=await e.A(866938);return await c([i.id]),{label:i.label,showing:l[h]}}}),[g.TOOL_NAMES.thread_seen]:(0,i.tool)({description:l.threadSeenSpec.description,inputSchema:l.threadSeenSpec.parameters,execute:async({thread:t})=>{let i=await a(t);if("string"==typeof i)return i;let{markSeen:n}=await e.A(866938);return await n([i.id]),{label:i.label,seen:!0}}})}),...(0,m.createRoutineTools)(),...t.written?(0,c.createLookTool)():(0,h.callTools)()}}let L=await (0,S.loadSkills)(A,t.bot);return{[g.TOOL_NAMES.memory_recall]:_[g.TOOL_NAMES.memory_recall],...v,...await (0,p.createSearchTool)(t.model,A),...(0,y.createWorkspaceTools)(A,{write:!0,env:{...(0,O.jobShellEnv)(t.session),...(0,O.botShellEnv)(t.bot)},guide:!0,bot:t.bot}),...await (0,d.createMcpTools)(t.bot,A),...(0,f.createSkillTools)({sandbox:A,skills:L,bot:t.bot}),...t.model&&(0,o.seesToolImages)(t.model.ref)?(0,c.createLookTool)():{},...(0,w.createSignInTools)(A,t.bot,(0,O.jobShellEnv)(t.session)),...await (0,l.createThreadRecallTool)(t.bot,t.thread??null)}}[o,l,d,u,m,p,T]=A.then?(await A)():A,e.s(["loadTools",0,L]),a()}catch(e){a(e)}},!1),54282,e=>{"use strict";var t=e.i(343747),a=e.i(983477),i=e.i(687388),n=e.i(353885);n.TOOL_NAMES.memory_recall,n.TOOL_NAMES.memory_remember,n.TOOL_NAMES.memory_forget,n.TOOL_NAMES.memory_conversation,n.TOOL_NAMES.bash,n.TOOL_NAMES.web_search,n.TOOL_NAMES.load_skill,n.TOOL_NAMES.look_at,n.TOOL_NAMES.end_call,n.TOOL_NAMES.routine,n.TOOL_NAMES.thread_tell,n.TOOL_NAMES.thread_answer,n.TOOL_NAMES.thread_status,n.TOOL_NAMES.thread_show,n.TOOL_NAMES.thread_cancel,n.TOOL_NAMES.thread_seen;var r=e.i(704161),o=e.i(640911),s=e.i(388439),l=e.i(41444);let h=(e=new Date)=>`${(0,t.format)(e,"yyyy-MM-dd (EEE) HH:mm")} ${Intl.DateTimeFormat().resolvedOptions().timeZone}`,c=(e=new Date)=>`**Now**: ${h(e)}`,d=e=>`${(0,t.format)(e,"yyyy-MM-dd (EEE) HH:mm")} (${(0,a.formatDistanceToNowStrict)(e,{addSuffix:!0})})`,u={[n.STUDIO_TOOLS.generate_image]:"images",[n.STUDIO_TOOLS.generate_speech]:"speech",[n.STUDIO_TOOLS.transcribe]:"transcription",[n.STUDIO_TOOLS.generate_video]:"video"};e.s(["botWorkHead",0,function(e,i){let n=(0,a.formatDistanceToNowStrict)(e.updatedAt,{addSuffix:!0}),r="running"===e.status?`running, last moved ${n}`:e.asking?`waiting on the user's answer since ${n}`:"waiting"===e.status?`stopped ${n}, not finished`:`${"done"===e.status?"ended":"stopped by the user"} ${(0,t.format)(e.updatedAt,"yyyy-MM-dd")}`;return`"${e.label}" — ${e.owner===i?"yours":`${e.owner}'s`} — ${r}`},"callEnding",0,()=>`IMPORTANT — always follow this: when the user wants the call to end, however they say it, forget every other task, answer yes in one word of their language, then immediately, without thinking, use the ${n.TOOL_NAMES.end_call} tool.`,"callStamp",0,d,"carriedLines",0,(e,t={})=>e.map(e=>`- ${e.text} \xb7 ${e.path}${!1===t.ids?"":` #${e.id}`}`).join("\n"),"clockNow",0,h,"conversationLines",0,e=>e.map(e=>"tool"===e.role?`you → ${e.tool??"tool"}`:`${"user"===e.role?"user":"you"}: ${e.text}`).join("\n"),"expandedFacts",0,function(e,t){let a=e.filter(e=>t.has(e.id)),n=e.filter(e=>!t.has(e.id)),r=Math.max(0,i.MEMORY_LIMITS.expanded-a.length),o=new Set([...a,...n.slice(Math.max(0,n.length-r))].map(e=>e.id)),s=e.filter(e=>o.has(e.id));return{shown:s,hidden:e.length-s.length}},"logPromptSize",0,function(e,t){let a=(0,s.sectionTokens)(t),n=a.reduce((e,t)=>e+t.tokens,0);o.logger.debug(`${e} prompt ${n} tokens — ${a.map(e=>`${e.name} ${e.tokens}`).join(", ")}`);let r=a[0];n>i.PROMPT_BUDGET&&r&&o.logger.warn(`${e} prompt is ${n} tokens, over ${i.PROMPT_BUDGET}: ${r.name} carries ${r.tokens} of it. Every call and every job pays this.`)},"mcpToolLines",0,function(e){let t=new Map;for(let a of e){let e=t.get(a.server);e?e.push(a.name):t.set(a.server,[a.name])}return[...t].map(([e,t])=>`- **${e}**: ${t.join(", ")}`).join("\n")},"noteLines",0,function(e,t=!1){return e.length?e.map(e=>{var a;let i,n=e.aliases?.length?` ${e.aliases.map(e=>`"${e}"`).join(" ")}`:"",o=t?` \xb7 ${a=e.lastSeenAt,(i=Math.floor((Date.now()-(0,r.toDate)(a).getTime())/864e5))>=365?`${Math.floor(i/365)}y`:i>=30?`${Math.floor(i/30)}mo`:`${Math.max(i,0)}d`}`:"";return`- ${e.path} — ${e.description?.trim()} (${e.factCount})${n}${o}`}).join("\n"):"(nothing saved yet)"},"nowLine",0,c,"reachNames",0,function(e,t){let a=t.map(e=>e.server===i.STUDIO_SERVER?u[e.name]??e.name:e.server);return[...new Set([...e.map(e=>e.name),...a])].join(", ")},"recentCallLines",0,function(e,t){let a=[],r=0;e:for(let o=e.length-1;o>=0;o--){let h=e[o];for(let e=h.turns.length-1;e>=0;e--){let o=function(e,t){if("tool"!==e.role)return`${"user"===e.role?"user":"you"}: ${e.text}`;let a=function(e,t){if(e!==n.TOOL_NAMES.web_search)return null;try{let e=JSON.parse(t),a=Array.isArray(e.sources)?e.sources.flatMap(e=>e&&"object"==typeof e&&"string"==typeof e.url?[e]:[]):[];return{query:"string"==typeof e.query?e.query:null,sources:a}}catch{return null}}(e.tool,e.text);if(a){let t=[...new Set(a.sources.flatMap(e=>{try{return[new URL(e.url).hostname.replace(/^www\./,"")]}catch{return[]}}))];return`you → ${e.tool} "${(0,l.clip)(a.query??"",i.PROMPT_LINE.toolArgs)}"${t.length?` — ${t.join(", ")}`:""}`}let r=`you → ${e.tool??"tool"} ${(0,l.clip)(e.text,i.PROMPT_LINE.toolArgs)}`;if(e.tool!==n.TOOL_NAMES.thread_start)return r;let o=function(e,t){if(e!==n.TOOL_NAMES.thread_start)return null;try{let e=JSON.parse(t);return"string"==typeof e.label?e.label:null}catch{return null}}(e.tool,e.text),s=o?t.jobs?.find(e=>e.label===o):void 0;if(!s)return r;let h=s.outcome?`: ${(0,l.clip)(s.outcome,i.PROMPT_LINE.jobOutcome)}`:"";return`you → ${e.tool} "${s.label}" (${s.id}) — ${s.status}${h}`}(h.turns[e],h),c=(0,s.estimateTokens)(o)+3;if(r+c>t&&a.length)break e;r+=c,a.push({call:h,line:o})}}a.reverse();let o=[],h=null;for(let{call:e,line:t}of a)e!==h&&(h=e,o.push(`### ${d(e.startedAt)}`)),o.push(t);return o.join("\n")},"saidStamp",0,e=>(0,t.format)(e,"yyyy-MM-dd (EEE) HH:mm"),"skillLines",0,(e,t={})=>e.map(e=>{var a;let n,r;return`- **${e.name}**: ${t.short?(a=e.description,n=i.PROMPT_LINE.skill,(r=a.trim().split(/(?<=[.。])\s|\n/)[0].trim()).length>n?`${r.slice(0,n).trim()}…`:r):e.description}`}).join("\n"),"thursdayIdentity",0,(e=new Date)=>`You are Thursday, this user's own personal assistant, on their side, modeled on Friday, the AI in *Iron Man*. ${c(e)}
|
|
2
2
|
|
|
3
3
|
What they tell you is kept, so you know them better over time, and whatever they want done can be done for them in the background.`,"tidying",0,e=>({crowded:e.reduce((e,t)=>e+t.factCount,0)>i.MEMORY_LIMITS.facts,heavy:e.filter(e=>e.factCount>i.MEMORY_LIMITS.factsPerNote)})],54282)},316172,e=>e.a(async(t,a)=>{try{var i=e.i(847841),n=e.i(907855),r=e.i(687388),o=e.i(54282),s=e.i(353885),l=e.i(944971),h=e.i(889034),c=e.i(378884),d=e.i(41444),u=t([c]);[c]=u.then?(await u)():u;let p=n.string().describe("The thread, by its label or its id."),w={description:"Start a new thread: hand work to a bot. Returns a receipt at once; the work runs in the background and its updates reach the conversation on their own.",parameters:n.object({bot:n.string().describe("A name from the bot list."),request:n.string().describe("The whole of the work. The bot cannot hear the call, so everything it needs goes here — names, paths, what the user actually asked for — in their own language and their own words: it is the only language the bot has, and whatever it writes comes back to them. **Their request, never your reading of it**: a condition, a caution or a smaller goal they did not say is how work comes back as the wrong thing. When their words leave a real choice open, ask them on the call and put the answer here."),label:n.string().describe("Two or three words naming the thread, in the user's language. Used on screen and said out loud.")})},f={description:"Say something to a thread that exists: a correction while it runs, the next step once it has finished, or to go on after it stopped. Its bot reads it with everything the thread already holds.",parameters:n.object({thread:p,words:n.string().describe("What to tell its bot, in the user's language and words.")})},g={description:`Answer a question a bot asked the user. Only for a question that is waiting; anything else said to a thread is \`${s.TOOL_NAMES.thread_tell}\`.`,parameters:n.object({thread:p,bot:n.string().describe("The bot that asked."),answer:n.string().describe("The user's answer, in their words.")})},y={description:`Read threads as they are now. "all" lists up to ${r.THREAD_STATUS_LIMIT}, running and waiting work before recent endings; a label or an id reads that one whole, with its result and any question waiting.`,parameters:n.object({thread:n.string().describe('"all", or one thread by its label or its id.')})},b={description:"Stop a thread for good. It cannot be taken back.",parameters:n.object({thread:p})},S={description:"Put a thread in front of the user on their screen: the file it made, or the thread itself when it made none. Showing it also counts as them having seen its result.",parameters:n.object({thread:p})},T={description:"Mark a thread's result as seen by the user, once they have heard it and have nothing more to ask about it. It leaves the work waiting on them.",parameters:n.object({thread:p})},O={description:"Send a message to a participant or Thursday and receive a delivery receipt immediately. Mark a question for Thursday to request user input; ordinary messages to Thursday are notifications and need no answer.",parameters:h.RoomMessageSchema.extend({kind:h.RoomMessageSchema.shape.kind.describe("Use question only when Thursday must obtain an answer from the user: it ends your turn, and you continue when the answer arrives. Use message for bot collaboration, progress updates and reports."),options:h.RoomMessageSchema.shape.options.describe("With a question, offer concise answer choices when useful. Omit for an open-ended question; the user can always type their own answer."),to:n.string().trim().min(1).describe("Choose a bot from the roster, or Thursday to reach the user."),text:n.string().trim().min(1).describe("Write the message and include the context the recipient needs."),replyTo:n.string().nullish().describe("Use an incoming message ID to send an explicit reply; omit to start a new exchange. Your ordinary final text already replies to your current correspondent.")})},$={description:"Open one of your other threads whole: what you were asked there and your last words in full.",parameters:n.object({id:n.string().describe("The id in brackets on its line under Your other threads.")})};async function m(e,t){let a=await (0,c.listBotWork)(e,t),n=[...a.open,...a.recent];if(!n.some(e=>e.cut))return{};let h=new Set;return{[s.TOOL_NAMES.thread_recall]:(0,i.tool)({description:$.description,inputSchema:$.parameters,execute:async({id:t})=>{let a=t.trim().replace(/^\[|\]$/g,"").toLowerCase(),i=n.find(e=>a.length>=4&&(e.id.startsWith(a)||e.label.toLowerCase()===a));if(!i)return`No thread "${t}" on your list. The ids there: ${n.filter(e=>e.cut).map(e=>(0,l.workHandle)(e.id)).join(", ")}.`;if(!i.cut)return"Its line already shows all of it.";if(h.has(i.id))return"Already opened above, this turn.";if(h.size>=r.BOT_WORK.reads)return`${r.BOT_WORK.reads} threads are open already this turn. Carry on with what you have.`;h.add(i.id);let s=await (0,c.readBotAsk)(e,i),u=i.said??"";return[(0,o.botWorkHead)(i,e),s?`You were asked: ${(0,d.clip)(s,r.BOT_WORK.asked)}`:"",`Your last words there:
|
|
4
4
|
${u.length>r.BOT_WORK.readChars?`${u.slice(0,r.BOT_WORK.readChars)}
|
|
5
5
|
[Cut here; the files it names hold the rest.]`:u}`].filter(Boolean).join("\n\n")}})}}e.s(["createThreadRecallTool",0,m,"sendMessageSpec",0,O,"threadAnswerSpec",0,g,"threadCancelSpec",0,b,"threadSeenSpec",0,T,"threadShowSpec",0,S,"threadStartSpec",0,w,"threadStatusSpec",0,y,"threadTellSpec",0,f]),a()}catch(e){a(e)}},!1),349047,e=>{"use strict";var t=e.i(847841),a=e.i(907855),i=e.i(353885);let n=Object.keys({A:[".##.","#..#","####","#..#","#..#"],B:["###.","#..#","###.","#..#","###."],C:[".###","#...","#...","#...",".###"],D:["###.","#..#","#..#","#..#","###."],E:["####","#...","###.","#...","####"],F:["####","#...","###.","#...","#..."],G:[".###","#...","#.##","#..#",".###"],H:["#..#","#..#","####","#..#","#..#"],I:["###",".#.",".#.",".#.","###"],J:["..##","...#","...#","#..#",".##."],K:["#..#","#.#.","##..","#.#.","#..#"],L:["#...","#...","#...","#...","####"],M:["#...#","##.##","#.#.#","#...#","#...#"],N:["#..#","##.#","#.##","#..#","#..#"],O:[".##.","#..#","#..#","#..#",".##."],P:["###.","#..#","###.","#...","#..."],Q:[".##.","#..#","#..#","#.#.",".#.#"],R:["###.","#..#","###.","#.#.","#..#"],S:[".###","#...",".##.","...#","###."],T:["###",".#.",".#.",".#.",".#."],U:["#..#","#..#","#..#","#..#",".##."],V:["#...#","#...#",".#.#.",".#.#.","..#.."],W:["#...#","#...#","#.#.#","##.##","#...#"],X:["#..#","#..#",".##.","#..#","#..#"],Y:["#.#","#.#",".#.",".#.",".#."],Z:["####","...#",".##.","#...","####"],0:[".##.","#.##","#..#","##.#",".##."],1:[".#.","##.",".#.",".#.","###"],2:["###.","...#",".##.","#...","####"],3:["###.","...#",".##.","...#","###."],4:["#..#","#..#","####","...#","...#"],5:["####","#...","###.","...#","###."],6:[".##.","#...","###.","#..#",".##."],7:["####","...#","..#.",".#..",".#.."],8:[".##.","#..#",".##.","#..#",".##."],9:[".##.","#..#",".###","...#",".##."],"!":["#","#","#",".","#"],"?":["###.","...#",".##.","....",".#.."],".":[".",".",".",".","#"],",":["..","..","..",".#","#."],"'":["#","#",".",".","."],"-":["...","...","###","...","..."],"+":["...",".#.","###",".#.","..."],":":[".","#",".","#","."],"(":[".#","#.","#.","#.",".#"],")":["#.",".#",".#",".#","#."],"<":["..#",".#.","#..",".#.","..#"],">":["#..",".#.","..#",".#.","#.."],"^":[".#.","#.#","...","...","..."],"~":["....",".#.#","#.#.","....","...."],"♥":[".#.#.","#####","#####",".###.","..#.."]," ":["..","..","..","..",".."]}).filter(e=>!/^[A-Z0-9 ]$/.test(e)),r={description:`End the call.
|
|
6
6
|
|
|
7
|
-
The line stays open until this runs, and drops once the goodbye being said is over.`,parameters:a.object({})},o=(0,t.tool)({description:r.description,inputSchema:r.parameters}),s={description:"Show a short word on your face for a few seconds.",parameters:a.object({text:a.string().describe(`Up to 8 characters: A-Z, 0-9, space and ${n.join(" ")}.`)})},l=(0,t.tool)({description:s.description,inputSchema:s.parameters});e.s(["callTools",0,function(){return{[i.TOOL_NAMES.end_call]:o,[i.TOOL_NAMES.emote]:l}}],349047)},170801,e=>{"use strict";var t=e.i(912714),a=e.i(847841),i=e.i(105249),n=e.i(687388),r=e.i(353885),o=e.i(629668),s=e.i(786025);e.s(["createLookTool",0,function(){return{[r.TOOL_NAMES.look_at]:(0,a.tool)({description:"See an image file yourself: a screenshot you took, a picture the user handed over, a chart you made. For what a picture shows — text files are read in the shell.",inputSchema:i.default.object({path:i.default.string().describe("Workspace-relative path to a png, jpg, webp or gif.")}),execute:async({path:e})=>{let a=await (0,s.insideWorkspace)(e.trim()),i=a?await (0,t.stat)(a).catch(()=>null):null;return a&&i?.isFile()?"image"!==(0,o.viewKindOf)(e)?`${e} is not an image. Read it in the shell instead.`:i.size>n.LOOK.maxBytes?`${e} is ${Math.ceil(i.size/1024/1024)} MB, over the ${n.LOOK.maxBytes/1024/1024} MB one look takes. Make a smaller copy in the shell first (on a Mac: sips -Z 1600 in.png --out out.png), then look at that.`:{path:e.trim(),mediaType:(0,o.mimeOf)(e),bytes:i.size}:`There is no file at ${e}. Give the path from the workspace root, as \`ls\` shows it.`},toModelOutput:async({output:e})=>{if("string"==typeof e)return{type:"text",value:e};let a=await (0,s.insideWorkspace)(e.path),i=a?await (0,t.readFile)(a).catch(()=>null):null;return i?{type:"content",value:[{type:"text",text:`${e.path}, as an image:`},{type:"file",mediaType:e.mediaType,data:{type:"data",data:i.toString("base64")}}]}:{type:"text",value:`${e.path} is no longer there.`}}})}}])},926435,e=>e.a(async(t,a)=>{try{var i=e.i(847841),n=e.i(907855),r=e.i(353885),o=e.i(148831),s=e.i(786025),l=e.i(660948),h=t([o,l]);[o,l]=h.then?(await h)():h;let u={[r.TOOL_NAMES.tool_search]:{description:`Return the description and exact inputSchema of tools on a connected server, so they can be called with \`${r.TOOL_NAMES.tool_call}\`.`,parameters:n.object({server:n.string().describe("A server name, exactly as the Connected tools section writes it."),tools:n.string().array().describe("Tool names listed under that server. Only the ones you may actually call — schemas are large, and at most 8 come back.")})},[r.TOOL_NAMES.tool_call]:{description:`Run one tool whose definition came back from \`${r.TOOL_NAMES.tool_search}\`.`,parameters:n.object({server:n.string().describe("The server the tool lives on."),tool:n.string().describe("Its name, as search returned it."),args:n.record(n.string(),n.unknown()).nullish().describe("Arguments matching the inputSchema search returned — do not guess. Null when it takes none."),description:n.string().nullish().describe("One short line for the user: what this call is for. Shown on their screen while it runs.")})}},m=(e,t)=>`${e.replace(/[^a-zA-Z0-9]+/g,"_")}__${t.replace(/[^a-zA-Z0-9_-]+/g,"_")}`.slice(0,64);async function c(e,t){let[a,n]=await Promise.all([(0,l.listConnectedToolNames)(),(0,o.findPinnedTools)(e)]),r={},h=(0,s.botArtifacts)(e);for(let e of n){let a=m(e.server,e.name);r[a]||(r[a]=(0,i.tool)({description:e.description??`${e.name} on the ${e.server} server.`,inputSchema:(0,i.jsonSchema)(e.inputSchema??{type:"object",properties:{}}),execute:(a,{abortSignal:i})=>(0,l.callConnectedTool)(t,e.server,e.name,a??void 0,{artifacts:h,abortSignal:i})}))}return a.length>n.length&&Object.assign(r,p(t,h)),r}async function d(e){let t=(await (0,l.listConnectedToolNames)(e)).map(e=>e.name);if(t.length)return`Tools on "${e}": ${t.join(", ")}.`;let a=await (0,l.listConnectedServerNames)();return a.length?`There is no server called "${e}". Connected: ${a.join(", ")}.`:"Nothing is connected."}let p=(e,t)=>({[r.TOOL_NAMES.tool_search]:(0,i.tool)({description:u[r.TOOL_NAMES.tool_search].description,inputSchema:u[r.TOOL_NAMES.tool_search].parameters,execute:async({server:e,tools:t})=>{let a=[...new Set(t.map(e=>e.trim()).filter(Boolean))],i=a.slice(0,8),n=await (0,l.findConnectedSchemas)(e.trim(),i);if(!n.length)return{tools:[],note:await d(e)};let r=i.filter(e=>!n.some(t=>t.name===e)),o=a.slice(8),s=[r.length?`Not on "${e}": ${r.join(", ")}.`:"",o.length?`Only 8 at a time — ask again for: ${o.join(", ")}.`:""].filter(Boolean);return{tools:n,...s.length?{note:s.join(" ")}:{}}}}),[r.TOOL_NAMES.tool_call]:(0,i.tool)({description:u[r.TOOL_NAMES.tool_call].description,inputSchema:u[r.TOOL_NAMES.tool_call].parameters,execute:async({server:a,tool:i,args:n},{abortSignal:r})=>(await (0,l.listConnectedToolNames)(a.trim())).some(e=>e.name===i.trim())?(0,l.callConnectedTool)(e,a.trim(),i.trim(),n??void 0,{artifacts:t,abortSignal:r}):{status:"error",text:await d(a)}})});e.s(["createMcpTools",0,c]),a()}catch(e){a(e)}},!1),770639,e=>e.a(async(t,a)=>{try{var i=e.i(847841),n=e.i(907855),r=e.i(687388),o=e.i(54282),s=e.i(353885),l=e.i(619898),h=e.i(453569),c=e.i(22676),d=t([l,c]);[l,c]=d.then?(await d)():d;let u=h.MEMORY_PATHS.map(e=>e.path.endsWith("/")?`${e.path}<name>`:e.path).join(", "),m=e=>({...e,facts:e.facts.map(({saidAt:e,...t})=>e?{...t,said:(0,o.saidStamp)(e)}:t),factCount:e.facts.length}),p=e=>"user"===e?"Typed on the screen — there is no conversation behind it.":"bot"===e?"Saved by a bot during a job — there is no conversation behind it.":"The conversation it was saved in is not kept.",w=e=>e>r.MEMORY_LIMITS.factsPerNote?` This note now holds ${e} facts, past the ${r.MEMORY_LIMITS.factsPerNote} one note holds well. Ask the user which of it is no longer true and delete what they name.`:"";e.s(["createMemoryTools",0,(e,t=null,{countReads:a=!0}={})=>({[s.TOOL_NAMES.memory_recall]:(0,i.tool)({description:"Open one note from the listing, whole.",inputSchema:n.object({path:n.string().describe("Exactly as the listing writes it — the path, or one of the names in quotes after it.")}),execute:async({path:e})=>{let{notes:t}=await (0,l.readNotes)([e],{touch:a}),i=t[0];if(!i)return{note:`Nothing on the listing called ${e.trim()}.`};let n=w(i.facts.length);return n?{...m(i),note:n.trim()}:m(i)}}),[s.TOOL_NAMES.memory_remember]:(0,i.tool)({description:"Write to one note: facts, and the line the listing shows for it. The path is the key — a path not on the listing is created (with at least one fact), one that is gets amended.",inputSchema:n.object({path:n.string().describe("The group this note is found by — the person, project or topic its facts are about. Exactly as the listing writes it, or a new path following the same convention. A fact goes under the one note it is about; other notes name it rather than repeat it."),facts:n.object({text:n.string().describe('One statement that stands on its own later — a date as a date, never "next week".'),replaces:n.number().int().nullish().describe(`The id of the fact this replaces — from this note as handed back here or by \`${s.TOOL_NAMES.memory_recall}\`. Null if this is new. A fact that stopped being true is replaced rather than deleted, and so is a note saying the same thing twice: replacing keeps what changed on the record, deleting does not.`),alwaysLoad:n.boolean().nullish().describe(`True carries this line into every call's instructions without opening its note — for what every call needs before any note is opened: what to call them, their language and register. At most ${r.MEMORY_LIMITS.carried}. Null leaves it; false makes a carried line an ordinary fact.`)}).array().nullish().describe("What to write under this note. Send everything that came up at once: one call is one pause in the conversation, three calls are three. Null when only naming it."),description:n.string().nullish().describe(`One line saying what this note holds, so the listing alone tells which facts are inside. Give it for a new note, and again with new facts: rewritten from the current line and the new facts together, so it covers the whole note rather than only what was added. Null leaves it; ${h.MEMORY_ALWAYS_LISTED.join(", ")} keep their own line.`),aliases:n.string().array().nullish().describe('What the user calls this note out loud, in the language they say it — the words they would use to ask for it, not the facts inside. A note at people/partner might be "my partner" and their first name. Replaces the set it has, so send the whole set. Null leaves it.')}),execute:async a=>{let i=a.path.trim(),n=await (0,l.resolveNotePath)(i),o=a.aliases??null,s=n??i,c=(0,h.isAlwaysListed)(s)?(0,h.appNoteLine)(s):a.description?.trim()||null,d=a.facts??[];if(!d.length&&!c&&!o)return{note:"Nothing to write: send facts, a line, names, or any of them."};if(!n&&!(0,h.isMemoryPath)(i))return{note:`Nothing was saved: "${i}" is not a path this listing can carry. Write it again under one of ${u}.`};if(!n&&!d.length)return{note:`Nothing on the listing called ${i}. A note comes into being with a fact — send at least one.`};let p=await (0,l.writeNotes)([{path:s,description:c,aliases:o,facts:d}],e,t),f=p.unnamed.length?` ${p.unnamed[0]} is new and has no line yet — the listing shows its first fact instead. Call again with \`description\` (one line about what it is) and \`aliases\` (the names they say for it).`:"",g=p.notLoaded.length?` All ${r.MEMORY_LIMITS.carried} carried lines are taken, so ${p.notLoaded.map(e=>`"${e}"`).join(", ")} saved as an ordinary fact. Say which carried line you would drop for it and let them choose.`:"",y=m(p.notes[0]),b=n&&d.length&&!c?` Its line still reads "${y.description}"; if that no longer says what the note holds, send \`description\`.`:"";return{...y,note:`Saved. The listing in your instructions is from when this session opened and will not show this until the next one — the note below is current.${f}${g}${b}${w(y.factCount)}`}}}),[s.TOOL_NAMES.memory_conversation]:(0,i.tool)({description:"Open the conversation a fact was saved in, whole: what each side said, and which tools were used.",inputSchema:n.object({factId:n.number().int().describe("The id that came with the fact when its note was opened."),page:n.number().int().min(1).nullish().describe(`${r.MEMORY_CONVERSATION_PAGE} turns a page, oldest first. Null for the first.`)}),execute:async({factId:e,page:a})=>{let i=await (0,l.findFactCall)(e);if(!i)return{note:`No fact with id ${e}.`};if(!i.callId)return{note:p(i.source)};if(i.callId===t)return{note:"Said in this call — it is the conversation you are in."};let n=a??1,s=await (0,c.readCallConversation)(i.callId,n,r.MEMORY_CONVERSATION_PAGE);if(!s)return{note:p(i.source)};let h=Math.max(1,Math.ceil(s.total/r.MEMORY_CONVERSATION_PAGE));return n>h?{note:`That conversation has ${h} page${h>1?"s":""}.`}:{when:(0,o.callStamp)(s.startedAt),page:n,pages:h,conversation:(0,o.conversationLines)(s.turns)}}}),[s.TOOL_NAMES.memory_forget]:(0,i.tool)({description:"Delete facts for good.",inputSchema:n.object({factIds:n.number().int().array().min(1).describe("The ids that came with the facts when their notes were opened — every one to delete, in one call.")}),execute:async({factIds:e})=>{let t=[],a=[],i=new Set;for(let n of new Set(e)){let e=await (0,l.forgetFactById)(n);if(!e){t.push(n);continue}e.noteGone?(i.delete(e.path),a.push(e.path)):i.add(e.path)}if(!a.length&&!i.size)return{note:`No fact with id ${t.join(", ")}. Nothing was deleted.`};let n=["Deleted for good. The listing in your instructions is from when this session opened and still shows it that way until the next one.",1===a.length?`That was the last fact under ${a[0]}, so the note went with it.`:a.length?`That was the last of ${a.join(", ")}, so those notes went with them.`:"",t.length?`No fact with id ${t.join(", ")}, so those were skipped.`:""].filter(Boolean).join(" ");if(!i.size)return{note:n};let{notes:r}=await (0,l.readNotes)([...i],{touch:!1});return{notes:r.map(m),note:n}}})})]),a()}catch(e){a(e)}},!1),418919,e=>e.a(async(t,a)=>{try{var i=e.i(847841),n=e.i(907855),r=e.i(687388),o=e.i(353885),s=e.i(265143),l=e.i(963219),h=e.i(473139),c=e.i(704161),d=e.i(53748),u=e.i(41444),m=t([s,l]);[s,l]=m.then?(await m)():m;let f={description:`Routines: work that starts by itself, each one a bot, the work and a time. List them, make one, change one, or delete one. Every start opens a thread like one started by hand; its result reaches the conversation the same way. At most ${r.ROUTINE.max} exist.`,parameters:n.object({action:n.enum(["list","create","change","delete"]),routine:n.string().nullish().describe("With change or delete: the routine, by its name or ID."),bot:n.string().nullish().describe("With create: a name from the bot list. With change: a new bot."),label:n.string().nullish().describe("With create: two or three words naming it, in the user's language. It names every thread the routine opens, on screen and out loud."),request:n.string().nullish().describe("With create: the whole of the work, handed to the bot as written every time it starts. Nobody is there then to fill in what is missing, so everything it needs goes here, in the user's own language and words. Their request, never your reading of it."),time:n.string().nullish().describe('Starts at this time of day, 24-hour "HH:MM" in the user\'s own time, on `days`. Give this or `everyHours`, never both.'),days:n.array(n.number().int().min(1).max(7)).nullish().describe("With `time`: the days it starts, 1 Monday to 7 Sunday. Omit for every day."),everyHours:n.number().int().nullish().describe(`Starts again this many hours after it last started, ${r.ROUTINE.minHours} at least. Give this or \`time\`, never both.`),enabled:n.boolean().nullish().describe("With change: false switches it off without deleting it, true back on.")})};function p(e){let t=e.runs[0];return{id:e.id,label:e.label,bot:e.bot,when:(0,h.scheduleText)(e.schedule),enabled:e.enabled,...e.enabled?{next:(0,c.whenOf)((0,c.toDate)(e.nextRunAt))}:{},request:(0,u.clip)(e.request,300),...t?{lastRun:{thread:t.id,status:t.status,at:(0,c.whenOf)((0,c.toDate)(t.updatedAt)),...t.outcome?{outcome:(0,u.clip)(t.outcome,200)}:{}}}:{}}}let g=e=>{if((0,d.isPublicError)(e))return e.message;throw e};async function w(e){let t=(await (0,l.listRoutines)()).map(e=>`"${e.label}"`);return t.length?e?`There is no single routine called "${e}". The routines are: ${t.join(", ")}. Call again with one of those, or its ID.`:`Name the routine. The routines are: ${t.join(", ")}.`:"There are no routines yet."}e.s(["createRoutineTools",0,function(){return{[o.TOOL_NAMES.routine]:(0,i.tool)({description:f.description,inputSchema:f.parameters,execute:async e=>{if("list"===e.action)return{routines:(await (0,l.listRoutines)()).map(p)};let t=function(e){if(e.time&&e.everyHours)return"Give `time` or `everyHours`, not both.";let t=e.time?{kind:"daily",time:e.time,days:e.days?.length?e.days:[1,2,3,4,5,6,7]}:e.everyHours?{kind:"every",hours:e.everyHours}:null;if(!t)return null;let a=h.RoutineScheduleSchema.safeParse(t);return a.success?a.data:a.error.issues[0].message}(e);if("string"==typeof t)return t;if("create"===e.action){if(!t)return"Say when it starts: `time` (with `days`), or `everyHours`.";let a=h.RoutineInputSchema.safeParse({bot:e.bot??"",label:e.label??"",request:e.request??"",schedule:t});if(!a.success)return`${a.error.issues[0].message}. Nothing was made — call again with bot, label, request and when.`;let i=(await (0,s.listJobBots)()).map(e=>e.name);if(!i.some(e=>e.toLowerCase()===a.data.bot.toLowerCase()))return`There is no bot called "${a.data.bot}". The bots are: ${i.join(", ")}. Nothing was made — call again with one of those.`;let n=await (0,l.createRoutine)(a.data).catch(g);if("string"==typeof n)return n;let r=await (0,s.readKeepWorkingOn)()?"":" As things are set, it starts only while the app is open in a tab: a time that passes with it closed starts once when it is opened again. Settings › Routines has the switch that lets work go on with the app closed.";return{...p(n),note:`${n.bot} starts "${n.label}" by itself, ${(0,h.scheduleText)(n.schedule)}, first ${(0,c.whenOf)((0,c.toDate)(n.nextRunAt))}. Each start is a thread of its own, and its result reaches the conversation like any thread's.${r}`}}let a=e.routine?await (0,l.resolveRoutine)(e.routine):null;if(!a)return await w(e.routine);if("delete"===e.action)return await (0,l.deleteRoutine)(a.id),`"${a.label}" is deleted and starts no more. The threads it already opened stay.`;let i={...e.bot?{bot:e.bot}:{},...e.label?.trim()?{label:e.label.trim()}:{},...e.request?.trim()?{request:e.request.trim()}:{},...t?{schedule:t}:{},..."boolean"==typeof e.enabled?{enabled:e.enabled}:{}};if(!Object.keys(i).length)return"Nothing to change was given: bot, label, request, when, or enabled.";let n=await (0,l.updateRoutine)(a.id,i).catch(g);return"string"==typeof n?n:n?p(n):await w(e.routine)}})}}]),a()}catch(e){a(e)}},!1),489956,e=>e.a(async(t,a)=>{try{var i=e.i(68356),n=e.i(847841),r=e.i(105249),o=e.i(687388),s=e.i(353885),l=e.i(279041),h=e.i(340698),c=e.i(41444),d=t([h]);[h]=d.then?(await d)():d;let w=`Answer the question from the web. Lead with the answer, then
|
|
7
|
+
The line stays open until this runs, and drops once the goodbye being said is over.`,parameters:a.object({})},o=(0,t.tool)({description:r.description,inputSchema:r.parameters}),s={description:"Show a short word on your face for a few seconds.",parameters:a.object({text:a.string().describe(`Up to 8 characters: A-Z, 0-9, space and ${n.join(" ")}.`)})},l=(0,t.tool)({description:s.description,inputSchema:s.parameters});e.s(["callTools",0,function(){return{[i.TOOL_NAMES.end_call]:o,[i.TOOL_NAMES.emote]:l}}],349047)},170801,e=>{"use strict";var t=e.i(912714),a=e.i(847841),i=e.i(105249),n=e.i(687388),r=e.i(353885),o=e.i(629668),s=e.i(786025);e.s(["createLookTool",0,function(){return{[r.TOOL_NAMES.look_at]:(0,a.tool)({description:"See an image file yourself: a screenshot you took, a picture the user handed over, a chart you made. For what a picture shows — text files are read in the shell.",inputSchema:i.default.object({path:i.default.string().describe("Workspace-relative path to a png, jpg, webp or gif.")}),execute:async({path:e})=>{let a=await (0,s.insideWorkspace)(e.trim()),i=a?await (0,t.stat)(a).catch(()=>null):null;return a&&i?.isFile()?"image"!==(0,o.viewKindOf)(e)?`${e} is not an image. Read it in the shell instead.`:i.size>n.LOOK.maxBytes?`${e} is ${Math.ceil(i.size/1024/1024)} MB, over the ${n.LOOK.maxBytes/1024/1024} MB one look takes. Make a smaller copy in the shell first (on a Mac: sips -Z 1600 in.png --out out.png), then look at that.`:{path:e.trim(),mediaType:(0,o.mimeOf)(e),bytes:i.size}:`There is no file at ${e}. Give the path from the workspace root, as \`ls\` shows it.`},toModelOutput:async({output:e})=>{if("string"==typeof e)return{type:"text",value:e};let a=await (0,s.insideWorkspace)(e.path),i=a?await (0,t.readFile)(a).catch(()=>null):null;return i?{type:"content",value:[{type:"text",text:`${e.path}, as an image:`},{type:"file",mediaType:e.mediaType,data:{type:"data",data:i.toString("base64")}}]}:{type:"text",value:`${e.path} is no longer there.`}}})}}])},926435,e=>e.a(async(t,a)=>{try{var i=e.i(847841),n=e.i(907855),r=e.i(353885),o=e.i(148831),s=e.i(786025),l=e.i(660948),h=t([o,l]);[o,l]=h.then?(await h)():h;let u={[r.TOOL_NAMES.tool_search]:{description:`Return the description and exact inputSchema of tools on a connected server, so they can be called with \`${r.TOOL_NAMES.tool_call}\`.`,parameters:n.object({server:n.string().describe("A server name, exactly as the Connected tools section writes it."),tools:n.string().array().describe("Tool names listed under that server. Only the ones you may actually call — schemas are large, and at most 8 come back.")})},[r.TOOL_NAMES.tool_call]:{description:`Run one tool whose definition came back from \`${r.TOOL_NAMES.tool_search}\`.`,parameters:n.object({server:n.string().describe("The server the tool lives on."),tool:n.string().describe("Its name, as search returned it."),args:n.record(n.string(),n.unknown()).nullish().describe("Arguments matching the inputSchema search returned — do not guess. Null when it takes none."),description:n.string().nullish().describe("One short line for the user: what this call is for. Shown on their screen while it runs.")})}},m=(e,t)=>`${e.replace(/[^a-zA-Z0-9]+/g,"_")}__${t.replace(/[^a-zA-Z0-9_-]+/g,"_")}`.slice(0,64);async function c(e,t){let[a,n]=await Promise.all([(0,l.listConnectedToolNames)(),(0,o.findPinnedTools)(e)]),r={},h=(0,s.botArtifacts)(e);for(let e of n){let a=m(e.server,e.name);r[a]||(r[a]=(0,i.tool)({description:e.description??`${e.name} on the ${e.server} server.`,inputSchema:(0,i.jsonSchema)(e.inputSchema??{type:"object",properties:{}}),execute:(a,{abortSignal:i})=>(0,l.callConnectedTool)(t,e.server,e.name,a??void 0,{artifacts:h,abortSignal:i})}))}return a.length>n.length&&Object.assign(r,p(t,h)),r}async function d(e){let t=(await (0,l.listConnectedToolNames)(e)).map(e=>e.name);if(t.length)return`Tools on "${e}": ${t.join(", ")}.`;let a=await (0,l.listConnectedServerNames)();return a.length?`There is no server called "${e}". Connected: ${a.join(", ")}.`:"Nothing is connected."}let p=(e,t)=>({[r.TOOL_NAMES.tool_search]:(0,i.tool)({description:u[r.TOOL_NAMES.tool_search].description,inputSchema:u[r.TOOL_NAMES.tool_search].parameters,execute:async({server:e,tools:t})=>{let a=[...new Set(t.map(e=>e.trim()).filter(Boolean))],i=a.slice(0,8),n=await (0,l.findConnectedSchemas)(e.trim(),i);if(!n.length)return{tools:[],note:await d(e)};let r=i.filter(e=>!n.some(t=>t.name===e)),o=a.slice(8),s=[r.length?`Not on "${e}": ${r.join(", ")}.`:"",o.length?`Only 8 at a time — ask again for: ${o.join(", ")}.`:""].filter(Boolean);return{tools:n,...s.length?{note:s.join(" ")}:{}}}}),[r.TOOL_NAMES.tool_call]:(0,i.tool)({description:u[r.TOOL_NAMES.tool_call].description,inputSchema:u[r.TOOL_NAMES.tool_call].parameters,execute:async({server:a,tool:i,args:n},{abortSignal:r})=>(await (0,l.listConnectedToolNames)(a.trim())).some(e=>e.name===i.trim())?(0,l.callConnectedTool)(e,a.trim(),i.trim(),n??void 0,{artifacts:t,abortSignal:r}):{status:"error",text:await d(a)}})});e.s(["createMcpTools",0,c]),a()}catch(e){a(e)}},!1),770639,e=>e.a(async(t,a)=>{try{var i=e.i(847841),n=e.i(907855),r=e.i(687388),o=e.i(54282),s=e.i(353885),l=e.i(619898),h=e.i(453569),c=e.i(22676),d=t([l,c]);[l,c]=d.then?(await d)():d;let u=h.MEMORY_PATHS.map(e=>e.path.endsWith("/")?`${e.path}<name>`:e.path).join(", "),m=e=>({...e,facts:e.facts.map(({saidAt:e,...t})=>e?{...t,said:(0,o.saidStamp)(e)}:t),factCount:e.facts.length}),p=e=>"user"===e?"Typed on the screen — there is no conversation behind it.":"bot"===e?"Saved by a bot during a job — there is no conversation behind it.":"The conversation it was saved in is not kept.",w=e=>e>r.MEMORY_LIMITS.factsPerNote?` This note now holds ${e} facts, past the ${r.MEMORY_LIMITS.factsPerNote} one note holds well. Ask the user which of it is no longer true and delete what they name.`:"";e.s(["createMemoryTools",0,(e,t=null,{countReads:a=!0}={})=>({[s.TOOL_NAMES.memory_recall]:(0,i.tool)({description:"Open one note from the listing, whole.",inputSchema:n.object({path:n.string().describe("Exactly as the listing writes it — the path, or one of the names in quotes after it.")}),execute:async({path:e})=>{let{notes:t}=await (0,l.readNotes)([e],{touch:a}),i=t[0];if(!i)return{note:`Nothing on the listing called ${e.trim()}.`};let n=w(i.facts.length);return n?{...m(i),note:n.trim()}:m(i)}}),[s.TOOL_NAMES.memory_remember]:(0,i.tool)({description:"Write to one note: facts, and the line the listing shows for it. The path is the key — a path not on the listing is created (with at least one fact), one that is gets amended.",inputSchema:n.object({path:n.string().describe("The group this note is found by — the person, project or topic its facts are about. Exactly as the listing writes it, or a new path following the same convention. A fact goes under the one note it is about; other notes name it rather than repeat it."),facts:n.object({text:n.string().describe('One statement that stands on its own later — a date as a date, never "next week".'),replaces:n.number().int().nullish().describe(`The id of the fact this replaces — from this note as handed back here or by \`${s.TOOL_NAMES.memory_recall}\`. Null if this is new. A fact that stopped being true is replaced rather than deleted, and so is a note saying the same thing twice: replacing keeps what changed on the record, deleting does not.`),alwaysLoad:n.boolean().nullish().describe(`True carries this line into every call's instructions without opening its note — for what every call needs before any note is opened: what to call them, their language and register. At most ${r.MEMORY_LIMITS.carried}. Null leaves it; false makes a carried line an ordinary fact.`)}).array().nullish().describe("What to write under this note. Send everything that came up at once: one call is one pause in the conversation, three calls are three. Null when only naming it."),description:n.string().nullish().describe(`One line saying what this note holds, so the listing alone tells which facts are inside. Give it for a new note, and again with new facts: rewritten from the current line and the new facts together, so it covers the whole note rather than only what was added. Null leaves it; ${h.MEMORY_ALWAYS_LISTED.join(", ")} keep their own line.`),aliases:n.string().array().nullish().describe('What the user calls this note out loud, in the language they say it — the words they would use to ask for it, not the facts inside. A note at people/partner might be "my partner" and their first name. Replaces the set it has, so send the whole set. Null leaves it.')}),execute:async a=>{let i=a.path.trim(),n=await (0,l.resolveNotePath)(i),o=a.aliases??null,s=n??i,c=(0,h.isAlwaysListed)(s)?(0,h.appNoteLine)(s):a.description?.trim()||null,d=a.facts??[];if(!d.length&&!c&&!o)return{note:"Nothing to write: send facts, a line, names, or any of them."};if(!n&&!(0,h.isMemoryPath)(i))return{note:`Nothing was saved: "${i}" is not a path this listing can carry. Write it again under one of ${u}.`};if(!n&&!d.length)return{note:`Nothing on the listing called ${i}. A note comes into being with a fact — send at least one.`};let p=await (0,l.writeNotes)([{path:s,description:c,aliases:o,facts:d}],e,t),f=p.unnamed.length?` ${p.unnamed[0]} is new and has no line yet — the listing shows its first fact instead. Call again with \`description\` (one line about what it is) and \`aliases\` (the names they say for it).`:"",g=p.notLoaded.length?` All ${r.MEMORY_LIMITS.carried} carried lines are taken, so ${p.notLoaded.map(e=>`"${e}"`).join(", ")} saved as an ordinary fact. Say which carried line you would drop for it and let them choose.`:"",y=m(p.notes[0]),b=n&&d.length&&!c?` Its line still reads "${y.description}"; if that no longer says what the note holds, send \`description\`.`:"";return{...y,note:`Saved. The listing in your instructions is from when this session opened and will not show this until the next one — the note below is current.${f}${g}${b}${w(y.factCount)}`}}}),[s.TOOL_NAMES.memory_conversation]:(0,i.tool)({description:"Open the conversation a fact was saved in, whole: what each side said, and which tools were used.",inputSchema:n.object({factId:n.number().int().describe("The id that came with the fact when its note was opened."),page:n.number().int().min(1).nullish().describe(`${r.MEMORY_CONVERSATION_PAGE} turns a page, oldest first. Null for the first.`)}),execute:async({factId:e,page:a})=>{let i=await (0,l.findFactCall)(e);if(!i)return{note:`No fact with id ${e}.`};if(!i.callId)return{note:p(i.source)};if(i.callId===t)return{note:"Said in this call — it is the conversation you are in."};let n=a??1,s=await (0,c.readCallConversation)(i.callId,n,r.MEMORY_CONVERSATION_PAGE);if(!s)return{note:p(i.source)};let h=Math.max(1,Math.ceil(s.total/r.MEMORY_CONVERSATION_PAGE));return n>h?{note:`That conversation has ${h} page${h>1?"s":""}.`}:{when:(0,o.callStamp)(s.startedAt),page:n,pages:h,conversation:(0,o.conversationLines)(s.turns)}}}),[s.TOOL_NAMES.memory_forget]:(0,i.tool)({description:"Delete facts for good.",inputSchema:n.object({factIds:n.number().int().array().min(1).describe("The ids that came with the facts when their notes were opened — every one to delete, in one call.")}),execute:async({factIds:e})=>{let t=[],a=[],i=new Set;for(let n of new Set(e)){let e=await (0,l.forgetFactById)(n);if(!e){t.push(n);continue}e.noteGone?(i.delete(e.path),a.push(e.path)):i.add(e.path)}if(!a.length&&!i.size)return{note:`No fact with id ${t.join(", ")}. Nothing was deleted.`};let n=["Deleted for good. The listing in your instructions is from when this session opened and still shows it that way until the next one.",1===a.length?`That was the last fact under ${a[0]}, so the note went with it.`:a.length?`That was the last of ${a.join(", ")}, so those notes went with them.`:"",t.length?`No fact with id ${t.join(", ")}, so those were skipped.`:""].filter(Boolean).join(" ");if(!i.size)return{note:n};let{notes:r}=await (0,l.readNotes)([...i],{touch:!1});return{notes:r.map(m),note:n}}})})]),a()}catch(e){a(e)}},!1),418919,e=>e.a(async(t,a)=>{try{var i=e.i(847841),n=e.i(907855),r=e.i(687388),o=e.i(353885),s=e.i(265143),l=e.i(963219),h=e.i(473139),c=e.i(704161),d=e.i(53748),u=e.i(41444),m=t([s,l]);[s,l]=m.then?(await m)():m;let f={description:`Routines: work that starts by itself, each one a bot, the work and a time — once at a moment, a time of day on chosen days, or every few hours. List them, make one, change one, or delete one. Every start opens a thread like one started by hand; its result reaches the conversation the same way. At most ${r.ROUTINE.max} exist.`,parameters:n.object({action:n.enum(["list","create","change","delete"]),routine:n.string().nullish().describe("With change or delete: the routine, by its name or ID."),bot:n.string().nullish().describe("With create: a name from the bot list. With change: a new bot."),label:n.string().nullish().describe("With create: two or three words naming it, in the user's language. It names every thread the routine opens, on screen and out loud."),request:n.string().nullish().describe("With create: the whole of the work, handed to the bot as written every time it starts. Nobody is there then to fill in what is missing, so everything it needs goes here, in the user's own language and words. Their request, never your reading of it."),at:n.string().nullish().describe('Starts once, at this moment, "YYYY-MM-DD HH:MM" in the user\'s own time, then switches itself off. Count "in an hour" or "tomorrow at eight" from **Now**. Give one of `at`, `time` or `everyHours`.'),time:n.string().nullish().describe('Starts at this time of day, 24-hour "HH:MM" in the user\'s own time, on `days`. Give one of `at`, `time` or `everyHours`.'),days:n.array(n.number().int().min(1).max(7)).nullish().describe("With `time`: the days it starts, 1 Monday to 7 Sunday. Omit for every day."),everyHours:n.number().int().nullish().describe(`Starts again this many hours after it last started, ${r.ROUTINE.minHours} at least. Give one of \`at\`, \`time\` or \`everyHours\`.`),enabled:n.boolean().nullish().describe("With change: false switches it off without deleting it, true back on.")})};function p(e){let t=e.runs[0];return{id:e.id,label:e.label,bot:e.bot,when:(0,h.scheduleText)(e.schedule),enabled:e.enabled,...e.enabled?{next:(0,c.whenOf)((0,c.toDate)(e.nextRunAt))}:{},request:(0,u.clip)(e.request,300),...t?{lastRun:{thread:t.id,status:t.status,at:(0,c.whenOf)((0,c.toDate)(t.updatedAt)),...t.outcome?{outcome:(0,u.clip)(t.outcome,200)}:{}}}:{}}}let g=e=>{if((0,d.isPublicError)(e))return e.message;throw e};async function w(e){let t=(await (0,l.listRoutines)()).map(e=>`"${e.label}"`);return t.length?e?`There is no single routine called "${e}". The routines are: ${t.join(", ")}. Call again with one of those, or its ID.`:`Name the routine. The routines are: ${t.join(", ")}.`:"There are no routines yet."}e.s(["createRoutineTools",0,function(){return{[o.TOOL_NAMES.routine]:(0,i.tool)({description:f.description,inputSchema:f.parameters,execute:async e=>{if("list"===e.action)return{routines:(await (0,l.listRoutines)()).map(p)};let t=function(e){if([e.at,e.time,e.everyHours].filter(Boolean).length>1)return"Give one of `at`, `time` or `everyHours`, not two.";let t=e.at?{kind:"once",at:e.at}:e.time?{kind:"daily",time:e.time,days:e.days?.length?e.days:[1,2,3,4,5,6,7]}:e.everyHours?{kind:"every",hours:e.everyHours}:null;if(!t)return null;let a=h.RoutineScheduleSchema.safeParse(t);return a.success?a.data:a.error.issues[0].message}(e);if("string"==typeof t)return t;if("create"===e.action){if(!t)return"Say when it starts: `at`, `time` (with `days`), or `everyHours`.";let a=h.RoutineInputSchema.safeParse({bot:e.bot??"",label:e.label??"",request:e.request??"",schedule:t});if(!a.success)return`${a.error.issues[0].message}. Nothing was made — call again with bot, label, request and when.`;let i=(await (0,s.listJobBots)()).map(e=>e.name);if(!i.some(e=>e.toLowerCase()===a.data.bot.toLowerCase()))return`There is no bot called "${a.data.bot}". The bots are: ${i.join(", ")}. Nothing was made — call again with one of those.`;let n=await (0,l.createRoutine)(a.data).catch(g);if("string"==typeof n)return n;let r=await (0,s.readKeepWorkingOn)()?"":" As things are set, it starts only while the app is open in a tab: a time that passes with it closed starts once when it is opened again. Settings › Routines has the switch that lets work go on with the app closed.",o=(0,c.whenOf)((0,c.toDate)(n.nextRunAt));return{...p(n),note:"once"===n.schedule.kind?`${n.bot} starts "${n.label}" once, ${o}, and the routine then switches itself off. The start is a thread of its own, and its result reaches the conversation like any thread's.${r}`:`${n.bot} starts "${n.label}" by itself, ${(0,h.scheduleText)(n.schedule)}, first ${o}. Each start is a thread of its own, and its result reaches the conversation like any thread's.${r}`}}let a=e.routine?await (0,l.resolveRoutine)(e.routine):null;if(!a)return await w(e.routine);if("delete"===e.action)return await (0,l.deleteRoutine)(a.id),`"${a.label}" is deleted and starts no more. The threads it already opened stay.`;let i={...e.bot?{bot:e.bot}:{},...e.label?.trim()?{label:e.label.trim()}:{},...e.request?.trim()?{request:e.request.trim()}:{},...t?{schedule:t}:{},..."boolean"==typeof e.enabled?{enabled:e.enabled}:{}};if(!Object.keys(i).length)return"Nothing to change was given: bot, label, request, when, or enabled.";let n=await (0,l.updateRoutine)(a.id,i).catch(g);return"string"==typeof n?n:n?p(n):await w(e.routine)}})}}]),a()}catch(e){a(e)}},!1),489956,e=>e.a(async(t,a)=>{try{var i=e.i(68356),n=e.i(847841),r=e.i(105249),o=e.i(687388),s=e.i(353885),l=e.i(279041),h=e.i(340698),c=e.i(41444),d=t([h]);[h]=d.then?(await d)():d;let w=`Answer the question from the web. Lead with the answer, then
|
|
8
8
|
what supports it. Say plainly what you could not find or confirm — do not fill
|
|
9
9
|
the gap with a guess. Every number carries the date you saw it. Be brief: this
|
|
10
10
|
is read by another model, not by a person.`,f=r.default.string().describe("What you want to know, as one full question. Put the place and the time in when they matter — the searcher sees nothing but this line.");async function u(e,t,a){let i=await fetch("https://api.exa.ai/search",{method:"POST",signal:a,headers:{"content-type":"application/json","x-api-key":e},body:JSON.stringify({query:t,type:"auto",numResults:o.SEARCH.sources,contents:{text:{maxCharacters:o.SEARCH.excerptChars},livecrawl:"fallback",livecrawlTimeout:5e3}})});if(!i.ok)return{text:`Exa answered ${i.status}: ${(0,c.clip)((await i.text()).trim(),200)}`,sources:[]};let n=(await i.json()).results??[];if(!n.length)return{text:"Nothing came back for that. Try other words, or open the page itself.",sources:[]};let r=n.flatMap(e=>e.url?.trim()?[{url:e.url.trim(),...e.title?.trim()?{title:e.title.trim()}:{}}]:[]);return{text:n.map(e=>{let t=[e.title?.trim(),e.url?.trim()].filter(Boolean).join(" — "),a=e.publishedDate?.slice(0,10);return[a?`${t} \xb7 ${a}`:t,e.text?.trim()].filter(Boolean).join("\n")}).join("\n\n"),sources:r}}async function m(e,t,a){let{text:n,sources:r}=await (0,i.generateText)({model:e.model,tools:e.tools,instructions:w,prompt:t,abortSignal:a}),s=[...new Set(r.flatMap(e=>"url"===e.sourceType?[e.title?`${e.title} — ${e.url}`:e.url]:[]))].slice(0,o.SEARCH.sources);return{text:[n.trim(),s.length?`Sources:
|
|
@@ -18,12 +18,12 @@ ${h.segments.map(e=>{var t;let a,i;return`- ${t=e.startSecond,a=Math.floor(t/60)
|
|
|
18
18
|
${h.text.trim()}${c}
|
|
19
19
|
`));return`${u}
|
|
20
20
|
|
|
21
|
-
${await a.fold(h.text,"transcript")}`}})},
|
|
21
|
+
${await a.fold(h.text,"transcript")}`}})},_=async()=>{let e=await (0,l.resolveMediaRef)("video");if(!e)return null;let t=(0,l.buildVideoModel)(e.ref,e.apiKey);return m({name:h.STUDIO_TOOLS.generate_video,description:"Make a short video and save it as a file in the workspace. Takes minutes. What comes back is its path.",inputSchema:s.default.object({prompt:s.default.string().describe("What happens: the scene, the motion, the camera, the mood. The video model does not see the job or the conversation, so nothing can be left implied."),aspectRatio:s.default.enum(["16:9","9:16"]).nullish().describe("Aspect ratio. Null for 16:9."),seconds:s.default.number().int().min(2).max(10).nullish().describe("Length in seconds, 2 to 10. Null for the provider's default.")}),execute:async({prompt:e,aspectRatio:a,seconds:i},{sandbox:n,artifacts:o,abortSignal:s})=>{let{video:l}=await (0,r.experimental_generateVideo)({model:t,prompt:e,aspectRatio:a??"16:9",duration:i??void 0,abortSignal:s}),h=await w(n,o,p(e,b(l.mediaType,"mp4")),l.uint8Array);return y(h)}})};async function f(){return(await Promise.all([g(T),g(O),g($),g(_)])).filter(e=>null!==e)}async function g(e){try{return await e()}catch(e){return c.logger.warn(`studio: a tool could not be built — ${(0,d.errorToString)(e)}`),null}}e.s(["loadStudio",0,f]),a()}catch(e){a(e)}},!1),660948,e=>e.a(async(t,a)=>{try{var i=e.i(105249),n=e.i(687388),r=e.i(105303),o=e.i(148831),s=e.i(41444),l=e.i(741376),h=t([r,o,l]);async function c(e){let[t,a]=await Promise.all([!e||e===n.STUDIO_SERVER?(0,l.loadStudio)():[],e===n.STUDIO_SERVER?[]:(0,o.listToolNames)(e)]);return[...t.map(e=>({server:n.STUDIO_SERVER,name:e.name})),...a]}[r,o,l]=h.then?(await h)():h;let w=async()=>{let[e,t]=await Promise.all([(0,l.loadStudio)(),(0,o.listServerNames)()]);return[...e.length?[n.STUDIO_SERVER]:[],...t.map(e=>e.name)]};async function d(e,t){if(e===n.STUDIO_SERVER){let e=new Set(t);return(await (0,l.loadStudio)()).filter(t=>e.has(t.name)).map(e=>({name:e.name,description:e.description,inputSchema:i.default.toJSONSchema(e.inputSchema)}))}return(await (0,o.findToolSchemas)(e,t)).map(e=>({name:e.name,description:e.description??null,inputSchema:e.inputSchema??null}))}async function u(e,t,a,i,{artifacts:o,abortSignal:l}){let h=AbortSignal.timeout(n.CONNECTED_TOOL_TIMEOUT_MS),c=l?AbortSignal.any([l,h]):h;try{let r=t===n.STUDIO_SERVER?await m(e,a,i,o,c):await p(t,a,i,c);if("string"!=typeof r)return r;return{status:"ok",text:await e.fold(r,`${t}-${a}`)}}catch(e){if(e instanceof r.McpAuthRequiredError)return{status:"auth_required",server:t,authorizationUrl:e.authorizationUrl};if(h.aborted&&!l?.aborted)return{status:"error",text:`${a} on ${t} gave no answer in ${n.CONNECTED_TOOL_TIMEOUT_MS/6e4} minutes and was given up on.`};return{status:"error",text:(0,s.errorToString)(e)}}}async function m(e,t,a,i,r){let o=(await (0,l.loadStudio)()).find(e=>e.name===t);if(!o)throw Error(`"${t}" is not in the ${n.STUDIO_SERVER} right now — the key that runs it is gone.`);return o.execute(a??{},{sandbox:e,artifacts:i,abortSignal:r})}async function p(e,t,a,i){let n=function(e){let t=e??{},a=!0===t.isError;if(!Array.isArray(t.content)){let e=void 0===t.toolResult?"":"string"==typeof t.toolResult?t.toolResult:JSON.stringify(t.toolResult);return{status:a?"error":"ok",text:e||f(a)}}let i=t.content.map(e=>"text"===e.type&&"string"==typeof e.text?e.text:`[${e.type}${e.mimeType?` ${e.mimeType}`:""} — not shown]`).join("\n").trim();return{status:a?"error":"ok",text:i||f(a)}}(await r.mcpManager.callTool(e,t,a,i));return"ok"===n.status?n.text:n}let f=e=>e?"The tool failed without a message.":"Done.";e.s(["callConnectedTool",0,u,"findConnectedSchemas",0,d,"listConnectedServerNames",0,w,"listConnectedToolNames",0,c]),a()}catch(e){a(e)}},!1),123203,e=>{"use strict";var t=e.i(750227),a=e.i(847841),i=e.i(105249),n=e.i(687388),r=e.i(353885),o=e.i(393189),s=e.i(786025);let l=`## The shell here
|
|
22
22
|
|
|
23
23
|
Every command is a new shell: \`cd\`, exported variables and an activated venv are gone by the next one — chain what depends on the last step into a single command.
|
|
24
24
|
|
|
25
25
|
Nothing is watching it. A command that stops to ask never gets an answer and is killed after ${n.EXEC_TIMEOUT_MS/1e3}s, so pass the flag that skips the question (\`-y\`, \`--yes\`, \`--no-input\`), and send anything genuinely long to the background with its output redirected to a file.
|
|
26
26
|
|
|
27
|
-
Keys are not in the environment: every variable named like a key, a token or a secret is removed before the shell starts. An empty one is not an unset one — say which it was, and ask for what a command needs.`;e.s(["createWorkspaceTools",0,(e,n)=>{let h=!0===n.guide,c=async e=>{let t=n.bot;if(!t)return{result:await e(),memory:null};let a=await (0,o.holdBotMemory)(t);return{result:await e(),memory:await (0,o.keepBotMemory)(t,a)}},d=(0,a.tool)({description:"Run a bash command.",inputSchema:i.default.object({command:i.default.string(),description:i.default.string().nullish().describe("One short line for the user: what this command does and why. Shown on their screen while it runs — not a restatement of the command.")}),execute:async({command:t},{abortSignal:a})=>{let{result:i,memory:r}=await c(()=>e.exec(t,{signal:a,env:n.env,timeoutMs:n.timeoutMs})),o=r?{...i,memory:r}:i;return h?(h=!1,{...o,guide:l}):o}});if(!n.write)return{[r.TOOL_NAMES.bash]:d};let u=(0,a.tool)({description:"Write a whole file — what was there is gone. Parent directories are created.",inputSchema:i.default.object({path:i.default.string().describe("Relative to the working directory — under one of its folders — or absolute"),content:i.default.string(),description:i.default.string().nullish().describe("One short line for the user: what this file is. Shown on their screen next to the path.")}),execute:async({path:a,content:i})=>{let r,o=e.resolve(a),l=(0,s.writeRefusal)(o,n.bot);if(l)return l;let{memory:h}=await c(()=>e.writeFile(a,i));return h??`Wrote ${(r=(0,t.relative)(e.cwd,o))&&!r.startsWith("..")?r:o} (${i.split("\n").length} lines)`}});return{[r.TOOL_NAMES.bash]:d,[r.TOOL_NAMES.write_file]:u}}])},636882,e=>{"use strict";e.i(912714);var t=e.i(750227),a=e.i(687388),i=e.i(786025),n=e.i(640911),r=e.i(41444),o=e.i(696968);let s=(0,t.join)(a.APP_DIR,a.PATHS.skills.default),l=(0,t.join)(a.DATA_DIR,a.PATHS.skills.custom);async function h(e,t){let a=[],i=new Set;for(let s of t){let t;try{t=await e.readdir(s,{withFileTypes:!0})}catch{continue}for(let l of t){let t,h;if(!l.isDirectory())continue;let c=`${s}/${l.name}`,d=`${c}/SKILL.md`;try{t=await e.readFile(d,"utf-8")}catch{continue}try{h=(0,o.parseFrontmatter)(t)}catch(e){n.logger.warn(`skill ${c}: SKILL.md front matter did not load — ${(0,r.errorToString)(e)}`);continue}!i.has(h.name)&&(i.add(h.name),h.disabled||a.push({name:h.name,description:h.description,path:c}))}}return a}e.s(["loadSkills",0,(e,n)=>h(e,n?[s,(0,t.join)(i.WORKSPACE,(0,i.botFolder)(n),a.PATHS.skills.own),l]:[s,l])])},388439,e=>{"use strict";let t=/[\u1100-\u11ff\u3040-\u30ff\u3130-\u318f\u4e00-\u9fff\uac00-\ud7af]/;function a(e){let a=0,i=0;for(let n of e)t.test(n)?a+=1:i+=1;return Math.ceil(a/1.3+i/4)}e.s(["estimateTokens",0,a,"sectionTokens",0,function(e){return e.split(/\n(?=## )/).map(e=>({name:e.startsWith("## ")?e.slice(3,e.indexOf("\n")):"identity",tokens:a(e)})).sort((e,t)=>t.tokens-e.tokens)}])}];
|
|
27
|
+
Keys are not in the environment: every variable named like a key, a token or a secret is removed before the shell starts. An empty one is not an unset one — say which it was, and ask for what a command needs.`;e.s(["createWorkspaceTools",0,(e,n)=>{let h=!0===n.guide,c=async e=>{let t=n.bot;if(!t)return{result:await e(),memory:null};let a=await (0,o.holdBotMemory)(t);return{result:await e(),memory:await (0,o.keepBotMemory)(t,a)}},d=(0,a.tool)({description:"Run a bash command.",inputSchema:i.default.object({command:i.default.string(),description:i.default.string().nullish().describe("One short line for the user: what this command does and why. Shown on their screen while it runs — not a restatement of the command.")}),execute:async({command:t},{abortSignal:a})=>{let{result:i,memory:r}=await c(()=>e.exec(t,{signal:a,env:n.env,timeoutMs:n.timeoutMs})),o=r?{...i,memory:r}:i;return h?(h=!1,{...o,guide:l}):o}});if(!n.write)return{[r.TOOL_NAMES.bash]:d};let u=(0,a.tool)({description:"Write a whole file — what was there is gone. Parent directories are created.",inputSchema:i.default.object({path:i.default.string().describe("Relative to the working directory — under one of its folders — or absolute"),content:i.default.string(),description:i.default.string().nullish().describe("One short line for the user: what this file is. Shown on their screen next to the path.")}),execute:async({path:a,content:i})=>{let r,o=e.resolve(a),l=(0,s.writeRefusal)(o,n.bot);if(l)return l;let{memory:h}=await c(()=>e.writeFile(a,i));return h??`Wrote ${(r=(0,t.relative)(e.cwd,o))&&!r.startsWith("..")?r:o} (${i.split("\n").length} lines)`}});return{[r.TOOL_NAMES.bash]:d,[r.TOOL_NAMES.write_file]:u}}])},636882,e=>{"use strict";e.i(912714);var t=e.i(750227),a=e.i(687388),i=e.i(786025),n=e.i(640911),r=e.i(41444),o=e.i(696968);let s=(0,t.join)(a.APP_DIR,a.PATHS.skills.default),l=(0,t.join)(a.DATA_DIR,a.PATHS.skills.custom);async function h(e,t){let a=[],i=new Set;for(let s of t){let t;try{t=await e.readdir(s,{withFileTypes:!0})}catch{continue}for(let l of t){let t,h;if(!l.isDirectory())continue;let c=`${s}/${l.name}`,d=`${c}/SKILL.md`;try{t=await e.readFile(d,"utf-8")}catch{continue}try{h=(0,o.parseFrontmatter)(t)}catch(e){n.logger.warn(`skill ${c}: SKILL.md front matter did not load — ${(0,r.errorToString)(e)}`);continue}!(!(0,o.runsHere)(h)||i.has(h.name))&&(i.add(h.name),h.disabled||a.push({name:h.name,description:h.description,path:c}))}}return a}e.s(["loadSkills",0,(e,n)=>h(e,n?[s,(0,t.join)(i.WORKSPACE,(0,i.botFolder)(n),a.PATHS.skills.own),l]:[s,l])])},388439,e=>{"use strict";let t=/[\u1100-\u11ff\u3040-\u30ff\u3130-\u318f\u4e00-\u9fff\uac00-\ud7af]/;function a(e){let a=0,i=0;for(let n of e)t.test(n)?a+=1:i+=1;return Math.ceil(a/1.3+i/4)}e.s(["estimateTokens",0,a,"sectionTokens",0,function(e){return e.split(/\n(?=## )/).map(e=>({name:e.startsWith("## ")?e.slice(3,e.indexOf("\n")):"identity",tokens:a(e)})).sort((e,t)=>t.tokens-e.tokens)}])}];
|
|
28
28
|
|
|
29
29
|
//# sourceMappingURL=_1uuucy-._.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[696968,280809,e=>{"use strict";var t=e.i(912714),s=e.i(750227),r=e.i(523008),i=e.i(687388),n=e.i(469719);let a=n.z.enum(["custom","default"]),o=n.z.string().trim().min(1,"Skill name is required").max(64,"Skill name is too long").regex(/^[a-z0-9][a-z0-9_-]*$/i,"Use letters, numbers, dashes and underscores only"),l=n.z.object({name:o,description:n.z.string().trim().min(1,"Description is required"),disabled:n.z.boolean().optional()});l.extend({content:n.z.string().trim().min(1,"Content is required")}),n.z.object({fileName:n.z.string().trim().min(1),base64:n.z.string().min(1)}),e.s(["SkillFrontmatterSchema",0,l,"SkillSourceSchema",0,a],280809);var c=e.i(53748);let u={default:(0,s.resolve)(i.APP_DIR,i.PATHS.skills.default),custom:(0,s.resolve)(i.DATA_DIR,i.PATHS.skills.custom)},f=new Set([".DS_Store","__MACOSX"]);function h(e){let t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);if(!t)return{head:null,body:e.trim(),rest:e,fence:""};let s=e.slice(t[0].length);return{head:t[1]??null,body:s.trim(),rest:s,fence:t[0]}}function d(e){let t,{head:s}=h(e);s||(0,c.publicError)("SKILL.md needs a YAML block with name and description");try{t=(0,r.parse)(s)}catch{(0,c.publicError)("SKILL.md frontmatter is not valid YAML")}let i=l.safeParse(t);return i.success||(0,c.publicError)(`SKILL.md frontmatter: ${i.error.issues[0]?.message??"invalid"}`),i.data}async function p(e,r){try{let i=await (0,t.readFile)((0,s.join)(u[e],r,"SKILL.md"),"utf-8");return{...d(i),source:e,dir:r}}catch{return null}}async function m(){let e=[];for(let s of["default","custom"]){let r=[];try{r=(await (0,t.readdir)(u[s],{withFileTypes:!0})).filter(e=>e.isDirectory()&&!f.has(e.name)).map(e=>e.name).sort()}catch{continue}for(let t of r){let r=await p(s,t);r&&e.push(r)}}return e}async function g(e,r,i=""){var n;let a,o,l,h,d,p=(o=u[e],l=(0,s.resolve)(o,r),(!(h=(0,s.relative)(o,l))||h.startsWith("..")||h.includes(s.sep)||"."===h)&&(0,c.publicError)("Skill not found"),n=l,d=(0,s.resolve)(n,i),((0,s.relative)(n,d).startsWith("..")||(0,s.resolve)(d)!==d)&&(0,c.publicError)("File not found"),d);try{a=await (0,t.stat)(p)}catch{(0,c.publicError)("File not found")}if(a.isDirectory()){let e=await (0,t.readdir)(p,{withFileTypes:!0}),r=[];for(let i of e)if(!f.has(i.name)){if(i.isDirectory())r.push({name:i.name,kind:"dir"});else if(i.isFile()){let e=await (0,t.stat)((0,s.join)(p,i.name));r.push({name:i.name,kind:"file",size:e.size})}}return r.sort((e,t)=>Number("file"===e.kind)-Number("file"===t.kind)||e.name.localeCompare(t.name)),{kind:"dir",entries:r}}if(a.size>524288)return{kind:"file",content:null,size:a.size};let m=await (0,t.readFile)(p);return{kind:"file",content:m.subarray(0,1024).includes(0)?null:m.toString("utf-8"),size:a.size}}e.s(["findAllSkills",0,m,"parseFrontmatter",0,d,"readSkillNode",0,g,"splitFrontmatter",0,h],696968)},962004,(e,t,s)=>{"use strict";let r=Symbol.for("yaml.alias"),i=Symbol.for("yaml.document"),n=Symbol.for("yaml.map"),a=Symbol.for("yaml.pair"),o=Symbol.for("yaml.scalar"),l=Symbol.for("yaml.seq"),c=Symbol.for("yaml.node.type"),u=e=>!!e&&"object"==typeof e&&e[c]===o;function f(e){if(e&&"object"==typeof e)switch(e[c]){case n:case l:return!0}return!1}s.ALIAS=r,s.DOC=i,s.MAP=n,s.NODE_TYPE=c,s.PAIR=a,s.SCALAR=o,s.SEQ=l,s.hasAnchor=e=>(u(e)||f(e))&&!!e.anchor,s.isAlias=e=>!!e&&"object"==typeof e&&e[c]===r,s.isCollection=f,s.isDocument=e=>!!e&&"object"==typeof e&&e[c]===i,s.isMap=e=>!!e&&"object"==typeof e&&e[c]===n,s.isNode=function(e){if(e&&"object"==typeof e)switch(e[c]){case r:case n:case o:case l:return!0}return!1},s.isPair=e=>!!e&&"object"==typeof e&&e[c]===a,s.isScalar=u,s.isSeq=e=>!!e&&"object"==typeof e&&e[c]===l},705746,(e,t,s)=>{"use strict";var r=e.r(962004);let i=Symbol("break visit"),n=Symbol("skip children"),a=Symbol("remove node");function o(e,t){let s=f(t);r.isDocument(e)?l(null,e.contents,s,Object.freeze([e]))===a&&(e.contents=null):l(null,e,s,Object.freeze([]))}function l(e,t,s,n){let o=h(e,t,s,n);if(r.isNode(o)||r.isPair(o))return d(e,n,o),l(e,o,s,n);if("symbol"!=typeof o){if(r.isCollection(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let r=l(e,t.items[e],s,n);if("number"==typeof r)e=r-1;else{if(r===i)return i;r===a&&(t.items.splice(e,1),e-=1)}}}else if(r.isPair(t)){n=Object.freeze(n.concat(t));let e=l("key",t.key,s,n);if(e===i)return i;e===a&&(t.key=null);let r=l("value",t.value,s,n);if(r===i)return i;r===a&&(t.value=null)}}return o}async function c(e,t){let s=f(t);r.isDocument(e)?await u(null,e.contents,s,Object.freeze([e]))===a&&(e.contents=null):await u(null,e,s,Object.freeze([]))}async function u(e,t,s,n){let o=await h(e,t,s,n);if(r.isNode(o)||r.isPair(o))return d(e,n,o),u(e,o,s,n);if("symbol"!=typeof o){if(r.isCollection(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let r=await u(e,t.items[e],s,n);if("number"==typeof r)e=r-1;else{if(r===i)return i;r===a&&(t.items.splice(e,1),e-=1)}}}else if(r.isPair(t)){n=Object.freeze(n.concat(t));let e=await u("key",t.key,s,n);if(e===i)return i;e===a&&(t.key=null);let r=await u("value",t.value,s,n);if(r===i)return i;r===a&&(t.value=null)}}return o}function f(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function h(e,t,s,i){return"function"==typeof s?s(e,t,i):r.isMap(t)?s.Map?.(e,t,i):r.isSeq(t)?s.Seq?.(e,t,i):r.isPair(t)?s.Pair?.(e,t,i):r.isScalar(t)?s.Scalar?.(e,t,i):r.isAlias(t)?s.Alias?.(e,t,i):void 0}function d(e,t,s){let i=t[t.length-1];if(r.isCollection(i))i.items[e]=s;else if(r.isPair(i))"key"===e?i.key=s:i.value=s;else if(r.isDocument(i))i.contents=s;else{let e=r.isAlias(i)?"alias":"scalar";throw Error(`Cannot replace node with ${e} parent`)}}o.BREAK=i,o.SKIP=n,o.REMOVE=a,c.BREAK=i,c.SKIP=n,c.REMOVE=a,s.visit=o,s.visitAsync=c},343474,(e,t,s)=>{"use strict";var r=e.r(962004),i=e.r(705746);let n={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},a=e=>e.replace(/[!,[\]{}]/g,e=>n[e]);class o{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},o.defaultYaml,e),this.tags=Object.assign({},o.defaultTags,t)}clone(){let e=new o(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new o(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:o.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},o.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:o.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},o.defaultTags),this.atNextDocument=!1);let s=e.trim().split(/[ \t]+/),r=s.shift();switch(r){case"%TAG":{if(2!==s.length&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[e,r]=s;return this.tags[e]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==s.length)return t(0,"%YAML directive should contain exactly one part"),!1;let[e]=s;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;{let s=/^\d+\.\d+$/.test(e);return t(6,`Unsupported YAML version ${e}`,s),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){let s=e.slice(2,-1);return"!"===s||"!!"===s?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),s)}let[,s,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return"!"===s?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+a(e.substring(s.length));return"!"===e[0]?e:`!<${e}>`}toString(e){let t,s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);if(e&&n.length>0&&r.isNode(e.contents)){let s={};i.visit(e.contents,(e,t)=>{r.isNode(t)&&t.tag&&(s[t.tag]=!0)}),t=Object.keys(s)}else t=[];for(let[r,i]of n)("!!"!==r||"tag:yaml.org,2002:"!==i)&&(!e||t.some(e=>e.startsWith(i)))&&s.push(`%TAG ${r} ${i}`);return s.join("\n")}}o.defaultYaml={explicit:!1,version:"1.2"},o.defaultTags={"!!":"tag:yaml.org,2002:"},s.Directives=o},397943,(e,t,s)=>{"use strict";var r=e.r(962004),i=e.r(705746);function n(e){let t=new Set;return i.visit(e,{Value(e,s){s.anchor&&t.add(s.anchor)}}),t}function a(e,t){for(let s=1;;++s){let r=`${e}${s}`;if(!t.has(r))return r}}s.anchorIsValid=function(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=JSON.stringify(e);throw Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0},s.anchorNames=n,s.createNodeAnchors=function(e,t){let s=[],i=new Map,o=null;return{onAnchor:r=>{s.push(r),o??(o=n(e));let i=a(t,o);return o.add(i),i},setAnchors:()=>{for(let e of s){let t=i.get(e);if("object"==typeof t&&t.anchor&&(r.isScalar(t.node)||r.isCollection(t.node)))t.node.anchor=t.anchor;else{let t=Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}}},sourceObjects:i}},s.findNewAnchor=a},53418,(e,t,s)=>{"use strict";s.applyReviver=function e(t,s,r,i){if(i&&"object"==typeof i)if(Array.isArray(i))for(let s=0,r=i.length;s<r;++s){let r=i[s],n=e(t,i,String(s),r);void 0===n?delete i[s]:n!==r&&(i[s]=n)}else if(i instanceof Map)for(let s of Array.from(i.keys())){let r=i.get(s),n=e(t,i,s,r);void 0===n?i.delete(s):n!==r&&i.set(s,n)}else if(i instanceof Set)for(let s of Array.from(i)){let r=e(t,i,s,s);void 0===r?i.delete(s):r!==s&&(i.delete(s),i.add(r))}else for(let[s,r]of Object.entries(i)){let n=e(t,i,s,r);void 0===n?delete i[s]:n!==r&&(i[s]=n)}return t.call(s,r,i)}},984922,(e,t,s)=>{"use strict";var r=e.r(962004);s.toJS=function e(t,s,i){if(Array.isArray(t))return t.map((t,s)=>e(t,String(s),i));if(t&&"function"==typeof t.toJSON){if(!i||!r.hasAnchor(t))return t.toJSON(s,i);let e={aliasCount:0,count:1,res:void 0};i.anchors.set(t,e),i.onCreate=t=>{e.res=t,delete i.onCreate};let n=t.toJSON(s,i);return i.onCreate&&i.onCreate(n),n}return"bigint"!=typeof t||i?.keep?t:Number(t)}},88865,(e,t,s)=>{"use strict";var r=e.r(53418),i=e.r(962004),n=e.r(984922);s.NodeBase=class{constructor(e){Object.defineProperty(this,i.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:a,reviver:o}={}){if(!i.isDocument(e))throw TypeError("A document argument is required");let l={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof s?s:100},c=n.toJS(this,"",l);if("function"==typeof a)for(let{count:e,res:t}of l.anchors.values())a(t,e);return"function"==typeof o?r.applyReviver(o,{"":c},"",c):c}}},378862,(e,t,s)=>{"use strict";var r=e.r(397943),i=e.r(705746),n=e.r(962004),a=e.r(88865),o=e.r(984922);class l extends a.NodeBase{constructor(e){super(n.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){let s,r;if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");for(let a of(t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],i.visit(e,{Node:(e,t)=>{(n.isAlias(t)||n.hasAnchor(t))&&s.push(t)}}),t&&(t.aliasResolveCache=s)),s)){if(a===this)break;a.anchor===this.source&&(r=a)}if(r&&t){let{anchors:e,doc:s,maxAliasCount:i}=t,a=e.get(r);if(a||(o.toJS(r,null,t),a=e.get(r)),a?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(a.count+=1,0===a.aliasCount&&(a.aliasCount=function e(t,s,r){if(n.isAlias(s)){let e=s.resolve(t),i=r&&e&&r.get(e);return i?i.count*i.aliasCount:0}if(n.isCollection(s)){let i=0;for(let n of s.items){let s=e(t,n,r);s>i&&(i=s)}return i}return n.isPair(s)?Math.max(e(t,s.key,r),e(t,s.value,r)):1}(s,r,e)),a.count*a.aliasCount>i))throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return r}toJSON(e,t){if(!t)return{source:this.source};let s=this.resolve(t.doc,t);if(!s)throw ReferenceError(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);return t.anchors.get(s).res}toString(e,t,s){let i=`*${this.source}`;if(e){if(r.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source))throw Error(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);if(e.implicitKey)return`${i} `}return i}}s.Alias=l},45942,(e,t,s)=>{"use strict";var r=e.r(962004),i=e.r(88865),n=e.r(984922);class a extends i.NodeBase{constructor(e){super(r.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:n.toJS(this.value,e,t)}toString(){return String(this.value)}}a.BLOCK_FOLDED="BLOCK_FOLDED",a.BLOCK_LITERAL="BLOCK_LITERAL",a.PLAIN="PLAIN",a.QUOTE_DOUBLE="QUOTE_DOUBLE",a.QUOTE_SINGLE="QUOTE_SINGLE",s.Scalar=a,s.isScalarValue=e=>!e||"function"!=typeof e&&"object"!=typeof e},312270,(e,t,s)=>{"use strict";var r=e.r(378862),i=e.r(962004),n=e.r(45942);s.createNode=function(e,t,s){let a;if(i.isDocument(e)&&(e=e.contents),i.isNode(e))return e;if(i.isPair(e)){let t=s.schema[i.MAP].createNode?.(s.schema,null,s);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"u">typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:o,onAnchor:l,onTagObj:c,schema:u,sourceObjects:f}=s;if(o&&e&&"object"==typeof e){if(a=f.get(e))return a.anchor??(a.anchor=l(e)),new r.Alias(a.anchor);a={anchor:null,node:null},f.set(e,a)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let h=function(e,t,s){if(t){let e=s.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return s.find(t=>t.identify?.(e)&&!t.format)}(e,t,u.tags);if(!h){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){let t=new n.Scalar(e);return a&&(a.node=t),t}h=e instanceof Map?u[i.MAP]:Symbol.iterator in Object(e)?u[i.SEQ]:u[i.MAP]}c&&(c(h),delete s.onTagObj);let d=h?.createNode?h.createNode(s.schema,e,s):"function"==typeof h?.nodeClass?.from?h.nodeClass.from(s.schema,e,s):new n.Scalar(e);return t?d.tag=t:h.default||(d.tag=h.tag),a&&(a.node=d),d}},226634,(e,t,s)=>{"use strict";var r=e.r(312270),i=e.r(962004),n=e.r(88865);function a(e,t,s){let i=s;for(let e=t.length-1;e>=0;--e){let s=t[e];if("number"==typeof s&&Number.isInteger(s)&&s>=0){let e=[];e[s]=i,i=e}else i=new Map([[s,i]])}return r.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}let o=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class l extends n.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>i.isNode(t)||i.isPair(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(o(e))this.add(t);else{let[s,...r]=e,n=this.get(s,!0);if(i.isCollection(n))n.addIn(r,t);else if(void 0===n&&this.schema)this.set(s,a(this.schema,r,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}deleteIn(e){let[t,...s]=e;if(0===s.length)return this.delete(t);let r=this.get(t,!0);if(i.isCollection(r))return r.deleteIn(s);throw Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){let[s,...r]=e,n=this.get(s,!0);return 0===r.length?!t&&i.isScalar(n)?n.value:n:i.isCollection(n)?n.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!i.isPair(t))return!1;let s=t.value;return null==s||e&&i.isScalar(s)&&null==s.value&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[t,...s]=e;if(0===s.length)return this.has(t);let r=this.get(t,!0);return!!i.isCollection(r)&&r.hasIn(s)}setIn(e,t){let[s,...r]=e;if(0===r.length)this.set(s,t);else{let e=this.get(s,!0);if(i.isCollection(e))e.setIn(r,t);else if(void 0===e&&this.schema)this.set(s,a(this.schema,r,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}}s.Collection=l,s.collectionFromPath=a,s.isEmptyPath=o},836803,(e,t,s)=>{"use strict";function r(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}s.indentComment=r,s.lineComment=(e,t,s)=>e.endsWith("\n")?r(s,t):s.includes("\n")?"\n"+r(s,t):(e.endsWith(" ")?"":" ")+s,s.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#")},136502,(e,t,s)=>{"use strict";let r="block",i="quoted";function n(e,t,s){let r=t,i=t+1,n=e[i];for(;" "===n||" "===n;)if(t<i+s)n=e[++t];else{do n=e[++t];while(n&&"\n"!==n)r=t,n=e[i=t+1]}return r}s.FOLD_BLOCK=r,s.FOLD_FLOW="flow",s.FOLD_QUOTED=i,s.foldFlowLines=function(e,t,s="flow",{indentAtStart:a,lineWidth:o=80,minContentWidth:l=20,onFold:c,onOverflow:u}={}){let f,h,d;if(!o||o<0)return e;o<l&&(l=0);let p=Math.max(1+l,1+o-t.length);if(e.length<=p)return e;let m=[],g={},y=o-t.length;"number"==typeof a&&(a>o-Math.max(2,l)?m.push(0):y=o-a);let b=!1,k=-1,S=-1,v=-1;for(s===r&&-1!==(k=n(e,k,t.length))&&(y=k+p);d=e[k+=1];){if(s===i&&"\\"===d){switch(S=k,e[k+1]){case"x":k+=3;break;case"u":k+=5;break;case"U":k+=9;break;default:k+=1}v=k}if("\n"===d)s===r&&(k=n(e,k,t.length)),y=k+t.length+p,f=void 0;else{if(" "===d&&h&&" "!==h&&"\n"!==h&&" "!==h){let t=e[k+1];t&&" "!==t&&"\n"!==t&&" "!==t&&(f=k)}if(k>=y)if(f)m.push(f),y=f+p,f=void 0;else if(s===i){for(;" "===h||" "===h;)h=d,d=e[k+=1],b=!0;let t=k>v+1?k-2:S-1;if(g[t])return e;m.push(t),g[t]=!0,y=t+p,f=void 0}else b=!0}h=d}if(b&&u&&u(),0===m.length)return e;c&&c();let w=e.slice(0,m[0]);for(let r=0;r<m.length;++r){let n=m[r],a=m[r+1]||e.length;0===n?w=`
|
|
1
|
+
module.exports=[696968,280809,e=>{"use strict";var t=e.i(912714),s=e.i(750227),r=e.i(523008),i=e.i(687388),n=e.i(469719);let a=n.z.enum(["custom","default"]),o=n.z.string().trim().min(1,"Skill name is required").max(64,"Skill name is too long").regex(/^[a-z0-9][a-z0-9_-]*$/i,"Use letters, numbers, dashes and underscores only"),l=n.z.object({name:o,description:n.z.string().trim().min(1,"Description is required"),disabled:n.z.boolean().optional(),platforms:n.z.array(n.z.string()).optional()});l.extend({content:n.z.string().trim().min(1,"Content is required")}),n.z.object({fileName:n.z.string().trim().min(1),base64:n.z.string().min(1)}),e.s(["SkillFrontmatterSchema",0,l,"SkillSourceSchema",0,a],280809);var c=e.i(53748);let u={default:(0,s.resolve)(i.APP_DIR,i.PATHS.skills.default),custom:(0,s.resolve)(i.DATA_DIR,i.PATHS.skills.custom)},f=new Set([".DS_Store","__MACOSX"]);function h(e){let t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);if(!t)return{head:null,body:e.trim(),rest:e,fence:""};let s=e.slice(t[0].length);return{head:t[1]??null,body:s.trim(),rest:s,fence:t[0]}}let d=({platforms:e})=>!e||e.includes(process.platform);function p(e){let t,{head:s}=h(e);s||(0,c.publicError)("SKILL.md needs a YAML block with name and description");try{t=(0,r.parse)(s)}catch{(0,c.publicError)("SKILL.md frontmatter is not valid YAML")}let i=l.safeParse(t);return i.success||(0,c.publicError)(`SKILL.md frontmatter: ${i.error.issues[0]?.message??"invalid"}`),i.data}async function m(e,r){try{let i=await (0,t.readFile)((0,s.join)(u[e],r,"SKILL.md"),"utf-8");return{...p(i),source:e,dir:r}}catch{return null}}async function g(){let e=[];for(let s of["default","custom"]){let r=[];try{r=(await (0,t.readdir)(u[s],{withFileTypes:!0})).filter(e=>e.isDirectory()&&!f.has(e.name)).map(e=>e.name).sort()}catch{continue}for(let t of r){let r=await m(s,t);r&&d(r)&&e.push(r)}}return e}async function y(e,r,i=""){var n;let a,o,l,h,d,p=(o=u[e],l=(0,s.resolve)(o,r),(!(h=(0,s.relative)(o,l))||h.startsWith("..")||h.includes(s.sep)||"."===h)&&(0,c.publicError)("Skill not found"),n=l,d=(0,s.resolve)(n,i),((0,s.relative)(n,d).startsWith("..")||(0,s.resolve)(d)!==d)&&(0,c.publicError)("File not found"),d);try{a=await (0,t.stat)(p)}catch{(0,c.publicError)("File not found")}if(a.isDirectory()){let e=await (0,t.readdir)(p,{withFileTypes:!0}),r=[];for(let i of e)if(!f.has(i.name)){if(i.isDirectory())r.push({name:i.name,kind:"dir"});else if(i.isFile()){let e=await (0,t.stat)((0,s.join)(p,i.name));r.push({name:i.name,kind:"file",size:e.size})}}return r.sort((e,t)=>Number("file"===e.kind)-Number("file"===t.kind)||e.name.localeCompare(t.name)),{kind:"dir",entries:r}}if(a.size>524288)return{kind:"file",content:null,size:a.size};let m=await (0,t.readFile)(p);return{kind:"file",content:m.subarray(0,1024).includes(0)?null:m.toString("utf-8"),size:a.size}}e.s(["findAllSkills",0,g,"parseFrontmatter",0,p,"readSkillNode",0,y,"runsHere",0,d,"splitFrontmatter",0,h],696968)},962004,(e,t,s)=>{"use strict";let r=Symbol.for("yaml.alias"),i=Symbol.for("yaml.document"),n=Symbol.for("yaml.map"),a=Symbol.for("yaml.pair"),o=Symbol.for("yaml.scalar"),l=Symbol.for("yaml.seq"),c=Symbol.for("yaml.node.type"),u=e=>!!e&&"object"==typeof e&&e[c]===o;function f(e){if(e&&"object"==typeof e)switch(e[c]){case n:case l:return!0}return!1}s.ALIAS=r,s.DOC=i,s.MAP=n,s.NODE_TYPE=c,s.PAIR=a,s.SCALAR=o,s.SEQ=l,s.hasAnchor=e=>(u(e)||f(e))&&!!e.anchor,s.isAlias=e=>!!e&&"object"==typeof e&&e[c]===r,s.isCollection=f,s.isDocument=e=>!!e&&"object"==typeof e&&e[c]===i,s.isMap=e=>!!e&&"object"==typeof e&&e[c]===n,s.isNode=function(e){if(e&&"object"==typeof e)switch(e[c]){case r:case n:case o:case l:return!0}return!1},s.isPair=e=>!!e&&"object"==typeof e&&e[c]===a,s.isScalar=u,s.isSeq=e=>!!e&&"object"==typeof e&&e[c]===l},705746,(e,t,s)=>{"use strict";var r=e.r(962004);let i=Symbol("break visit"),n=Symbol("skip children"),a=Symbol("remove node");function o(e,t){let s=f(t);r.isDocument(e)?l(null,e.contents,s,Object.freeze([e]))===a&&(e.contents=null):l(null,e,s,Object.freeze([]))}function l(e,t,s,n){let o=h(e,t,s,n);if(r.isNode(o)||r.isPair(o))return d(e,n,o),l(e,o,s,n);if("symbol"!=typeof o){if(r.isCollection(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let r=l(e,t.items[e],s,n);if("number"==typeof r)e=r-1;else{if(r===i)return i;r===a&&(t.items.splice(e,1),e-=1)}}}else if(r.isPair(t)){n=Object.freeze(n.concat(t));let e=l("key",t.key,s,n);if(e===i)return i;e===a&&(t.key=null);let r=l("value",t.value,s,n);if(r===i)return i;r===a&&(t.value=null)}}return o}async function c(e,t){let s=f(t);r.isDocument(e)?await u(null,e.contents,s,Object.freeze([e]))===a&&(e.contents=null):await u(null,e,s,Object.freeze([]))}async function u(e,t,s,n){let o=await h(e,t,s,n);if(r.isNode(o)||r.isPair(o))return d(e,n,o),u(e,o,s,n);if("symbol"!=typeof o){if(r.isCollection(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let r=await u(e,t.items[e],s,n);if("number"==typeof r)e=r-1;else{if(r===i)return i;r===a&&(t.items.splice(e,1),e-=1)}}}else if(r.isPair(t)){n=Object.freeze(n.concat(t));let e=await u("key",t.key,s,n);if(e===i)return i;e===a&&(t.key=null);let r=await u("value",t.value,s,n);if(r===i)return i;r===a&&(t.value=null)}}return o}function f(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function h(e,t,s,i){return"function"==typeof s?s(e,t,i):r.isMap(t)?s.Map?.(e,t,i):r.isSeq(t)?s.Seq?.(e,t,i):r.isPair(t)?s.Pair?.(e,t,i):r.isScalar(t)?s.Scalar?.(e,t,i):r.isAlias(t)?s.Alias?.(e,t,i):void 0}function d(e,t,s){let i=t[t.length-1];if(r.isCollection(i))i.items[e]=s;else if(r.isPair(i))"key"===e?i.key=s:i.value=s;else if(r.isDocument(i))i.contents=s;else{let e=r.isAlias(i)?"alias":"scalar";throw Error(`Cannot replace node with ${e} parent`)}}o.BREAK=i,o.SKIP=n,o.REMOVE=a,c.BREAK=i,c.SKIP=n,c.REMOVE=a,s.visit=o,s.visitAsync=c},343474,(e,t,s)=>{"use strict";var r=e.r(962004),i=e.r(705746);let n={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},a=e=>e.replace(/[!,[\]{}]/g,e=>n[e]);class o{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},o.defaultYaml,e),this.tags=Object.assign({},o.defaultTags,t)}clone(){let e=new o(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new o(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:o.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},o.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:o.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},o.defaultTags),this.atNextDocument=!1);let s=e.trim().split(/[ \t]+/),r=s.shift();switch(r){case"%TAG":{if(2!==s.length&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[e,r]=s;return this.tags[e]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==s.length)return t(0,"%YAML directive should contain exactly one part"),!1;let[e]=s;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;{let s=/^\d+\.\d+$/.test(e);return t(6,`Unsupported YAML version ${e}`,s),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){let s=e.slice(2,-1);return"!"===s||"!!"===s?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),s)}let[,s,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return"!"===s?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+a(e.substring(s.length));return"!"===e[0]?e:`!<${e}>`}toString(e){let t,s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);if(e&&n.length>0&&r.isNode(e.contents)){let s={};i.visit(e.contents,(e,t)=>{r.isNode(t)&&t.tag&&(s[t.tag]=!0)}),t=Object.keys(s)}else t=[];for(let[r,i]of n)("!!"!==r||"tag:yaml.org,2002:"!==i)&&(!e||t.some(e=>e.startsWith(i)))&&s.push(`%TAG ${r} ${i}`);return s.join("\n")}}o.defaultYaml={explicit:!1,version:"1.2"},o.defaultTags={"!!":"tag:yaml.org,2002:"},s.Directives=o},397943,(e,t,s)=>{"use strict";var r=e.r(962004),i=e.r(705746);function n(e){let t=new Set;return i.visit(e,{Value(e,s){s.anchor&&t.add(s.anchor)}}),t}function a(e,t){for(let s=1;;++s){let r=`${e}${s}`;if(!t.has(r))return r}}s.anchorIsValid=function(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=JSON.stringify(e);throw Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0},s.anchorNames=n,s.createNodeAnchors=function(e,t){let s=[],i=new Map,o=null;return{onAnchor:r=>{s.push(r),o??(o=n(e));let i=a(t,o);return o.add(i),i},setAnchors:()=>{for(let e of s){let t=i.get(e);if("object"==typeof t&&t.anchor&&(r.isScalar(t.node)||r.isCollection(t.node)))t.node.anchor=t.anchor;else{let t=Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}}},sourceObjects:i}},s.findNewAnchor=a},53418,(e,t,s)=>{"use strict";s.applyReviver=function e(t,s,r,i){if(i&&"object"==typeof i)if(Array.isArray(i))for(let s=0,r=i.length;s<r;++s){let r=i[s],n=e(t,i,String(s),r);void 0===n?delete i[s]:n!==r&&(i[s]=n)}else if(i instanceof Map)for(let s of Array.from(i.keys())){let r=i.get(s),n=e(t,i,s,r);void 0===n?i.delete(s):n!==r&&i.set(s,n)}else if(i instanceof Set)for(let s of Array.from(i)){let r=e(t,i,s,s);void 0===r?i.delete(s):r!==s&&(i.delete(s),i.add(r))}else for(let[s,r]of Object.entries(i)){let n=e(t,i,s,r);void 0===n?delete i[s]:n!==r&&(i[s]=n)}return t.call(s,r,i)}},984922,(e,t,s)=>{"use strict";var r=e.r(962004);s.toJS=function e(t,s,i){if(Array.isArray(t))return t.map((t,s)=>e(t,String(s),i));if(t&&"function"==typeof t.toJSON){if(!i||!r.hasAnchor(t))return t.toJSON(s,i);let e={aliasCount:0,count:1,res:void 0};i.anchors.set(t,e),i.onCreate=t=>{e.res=t,delete i.onCreate};let n=t.toJSON(s,i);return i.onCreate&&i.onCreate(n),n}return"bigint"!=typeof t||i?.keep?t:Number(t)}},88865,(e,t,s)=>{"use strict";var r=e.r(53418),i=e.r(962004),n=e.r(984922);s.NodeBase=class{constructor(e){Object.defineProperty(this,i.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:s,onAnchor:a,reviver:o}={}){if(!i.isDocument(e))throw TypeError("A document argument is required");let l={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof s?s:100},c=n.toJS(this,"",l);if("function"==typeof a)for(let{count:e,res:t}of l.anchors.values())a(t,e);return"function"==typeof o?r.applyReviver(o,{"":c},"",c):c}}},378862,(e,t,s)=>{"use strict";var r=e.r(397943),i=e.r(705746),n=e.r(962004),a=e.r(88865),o=e.r(984922);class l extends a.NodeBase{constructor(e){super(n.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){let s,r;if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");for(let a of(t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],i.visit(e,{Node:(e,t)=>{(n.isAlias(t)||n.hasAnchor(t))&&s.push(t)}}),t&&(t.aliasResolveCache=s)),s)){if(a===this)break;a.anchor===this.source&&(r=a)}if(r&&t){let{anchors:e,doc:s,maxAliasCount:i}=t,a=e.get(r);if(a||(o.toJS(r,null,t),a=e.get(r)),a?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(a.count+=1,0===a.aliasCount&&(a.aliasCount=function e(t,s,r){if(n.isAlias(s)){let e=s.resolve(t),i=r&&e&&r.get(e);return i?i.count*i.aliasCount:0}if(n.isCollection(s)){let i=0;for(let n of s.items){let s=e(t,n,r);s>i&&(i=s)}return i}return n.isPair(s)?Math.max(e(t,s.key,r),e(t,s.value,r)):1}(s,r,e)),a.count*a.aliasCount>i))throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return r}toJSON(e,t){if(!t)return{source:this.source};let s=this.resolve(t.doc,t);if(!s)throw ReferenceError(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);return t.anchors.get(s).res}toString(e,t,s){let i=`*${this.source}`;if(e){if(r.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source))throw Error(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);if(e.implicitKey)return`${i} `}return i}}s.Alias=l},45942,(e,t,s)=>{"use strict";var r=e.r(962004),i=e.r(88865),n=e.r(984922);class a extends i.NodeBase{constructor(e){super(r.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:n.toJS(this.value,e,t)}toString(){return String(this.value)}}a.BLOCK_FOLDED="BLOCK_FOLDED",a.BLOCK_LITERAL="BLOCK_LITERAL",a.PLAIN="PLAIN",a.QUOTE_DOUBLE="QUOTE_DOUBLE",a.QUOTE_SINGLE="QUOTE_SINGLE",s.Scalar=a,s.isScalarValue=e=>!e||"function"!=typeof e&&"object"!=typeof e},312270,(e,t,s)=>{"use strict";var r=e.r(378862),i=e.r(962004),n=e.r(45942);s.createNode=function(e,t,s){let a;if(i.isDocument(e)&&(e=e.contents),i.isNode(e))return e;if(i.isPair(e)){let t=s.schema[i.MAP].createNode?.(s.schema,null,s);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"u">typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:o,onAnchor:l,onTagObj:c,schema:u,sourceObjects:f}=s;if(o&&e&&"object"==typeof e){if(a=f.get(e))return a.anchor??(a.anchor=l(e)),new r.Alias(a.anchor);a={anchor:null,node:null},f.set(e,a)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let h=function(e,t,s){if(t){let e=s.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return s.find(t=>t.identify?.(e)&&!t.format)}(e,t,u.tags);if(!h){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){let t=new n.Scalar(e);return a&&(a.node=t),t}h=e instanceof Map?u[i.MAP]:Symbol.iterator in Object(e)?u[i.SEQ]:u[i.MAP]}c&&(c(h),delete s.onTagObj);let d=h?.createNode?h.createNode(s.schema,e,s):"function"==typeof h?.nodeClass?.from?h.nodeClass.from(s.schema,e,s):new n.Scalar(e);return t?d.tag=t:h.default||(d.tag=h.tag),a&&(a.node=d),d}},226634,(e,t,s)=>{"use strict";var r=e.r(312270),i=e.r(962004),n=e.r(88865);function a(e,t,s){let i=s;for(let e=t.length-1;e>=0;--e){let s=t[e];if("number"==typeof s&&Number.isInteger(s)&&s>=0){let e=[];e[s]=i,i=e}else i=new Map([[s,i]])}return r.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}let o=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class l extends n.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>i.isNode(t)||i.isPair(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(o(e))this.add(t);else{let[s,...r]=e,n=this.get(s,!0);if(i.isCollection(n))n.addIn(r,t);else if(void 0===n&&this.schema)this.set(s,a(this.schema,r,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}deleteIn(e){let[t,...s]=e;if(0===s.length)return this.delete(t);let r=this.get(t,!0);if(i.isCollection(r))return r.deleteIn(s);throw Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){let[s,...r]=e,n=this.get(s,!0);return 0===r.length?!t&&i.isScalar(n)?n.value:n:i.isCollection(n)?n.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!i.isPair(t))return!1;let s=t.value;return null==s||e&&i.isScalar(s)&&null==s.value&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[t,...s]=e;if(0===s.length)return this.has(t);let r=this.get(t,!0);return!!i.isCollection(r)&&r.hasIn(s)}setIn(e,t){let[s,...r]=e;if(0===r.length)this.set(s,t);else{let e=this.get(s,!0);if(i.isCollection(e))e.setIn(r,t);else if(void 0===e&&this.schema)this.set(s,a(this.schema,r,t));else throw Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}}s.Collection=l,s.collectionFromPath=a,s.isEmptyPath=o},836803,(e,t,s)=>{"use strict";function r(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}s.indentComment=r,s.lineComment=(e,t,s)=>e.endsWith("\n")?r(s,t):s.includes("\n")?"\n"+r(s,t):(e.endsWith(" ")?"":" ")+s,s.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#")},136502,(e,t,s)=>{"use strict";let r="block",i="quoted";function n(e,t,s){let r=t,i=t+1,n=e[i];for(;" "===n||" "===n;)if(t<i+s)n=e[++t];else{do n=e[++t];while(n&&"\n"!==n)r=t,n=e[i=t+1]}return r}s.FOLD_BLOCK=r,s.FOLD_FLOW="flow",s.FOLD_QUOTED=i,s.foldFlowLines=function(e,t,s="flow",{indentAtStart:a,lineWidth:o=80,minContentWidth:l=20,onFold:c,onOverflow:u}={}){let f,h,d;if(!o||o<0)return e;o<l&&(l=0);let p=Math.max(1+l,1+o-t.length);if(e.length<=p)return e;let m=[],g={},y=o-t.length;"number"==typeof a&&(a>o-Math.max(2,l)?m.push(0):y=o-a);let b=!1,k=-1,S=-1,v=-1;for(s===r&&-1!==(k=n(e,k,t.length))&&(y=k+p);d=e[k+=1];){if(s===i&&"\\"===d){switch(S=k,e[k+1]){case"x":k+=3;break;case"u":k+=5;break;case"U":k+=9;break;default:k+=1}v=k}if("\n"===d)s===r&&(k=n(e,k,t.length)),y=k+t.length+p,f=void 0;else{if(" "===d&&h&&" "!==h&&"\n"!==h&&" "!==h){let t=e[k+1];t&&" "!==t&&"\n"!==t&&" "!==t&&(f=k)}if(k>=y)if(f)m.push(f),y=f+p,f=void 0;else if(s===i){for(;" "===h||" "===h;)h=d,d=e[k+=1],b=!0;let t=k>v+1?k-2:S-1;if(g[t])return e;m.push(t),g[t]=!0,y=t+p,f=void 0}else b=!0}h=d}if(b&&u&&u(),0===m.length)return e;c&&c();let w=e.slice(0,m[0]);for(let r=0;r<m.length;++r){let n=m[r],a=m[r+1]||e.length;0===n?w=`
|
|
2
2
|
${t}${e.slice(0,a)}`:(s===i&&g[n]&&(w+=`${e[n]}\\`),w+=`
|
|
3
3
|
${t}${e.slice(n+1,a)}`)}return w}},623157,(e,t,s)=>{"use strict";let r;var i=e.r(45942),n=e.r(136502);let a=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth});function o(e,t){let s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(/^(%|---|\.\.\.)/m.test(e)?" ":""),l="",c=0;for(let e=0,t=s[e];t;t=s[++e])if(" "===t&&"\\"===s[e+1]&&"n"===s[e+2]&&(l+=s.slice(c,e)+"\\ ",e+=1,c=e,t="\\"),"\\"===t)switch(s[e+1]){case"u":{l+=s.slice(c,e);let t=s.substr(e+2,4);switch(t){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:"00"===t.substr(0,2)?l+="\\x"+t.substr(2):l+=s.substr(e,6)}e+=5,c=e+1}break;case"n":if(r||'"'===s[e+2]||s.length<i)e+=1;else{for(l+=s.slice(c,e)+"\n\n";"\\"===s[e+2]&&"n"===s[e+3]&&'"'!==s[e+4];)l+="\n",e+=2;l+=o," "===s[e+2]&&(l+="\\"),e+=1,c=e+1}break;default:e+=1}return l=c?l+s.slice(c):s,r?l:n.foldFlowLines(l,o,n.FOLD_QUOTED,a(t,!1))}function l(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return o(e,t);let s=t.indent||(/^(%|---|\.\.\.)/m.test(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
4
4
|
${s}`)+"'";return t.implicitKey?r:n.foldFlowLines(r,s,n.FOLD_FLOW,a(t,!1))}function c(e,t){let s,{singleQuote:r}=t.options;if(!1===r)s=o;else{let t=e.includes('"'),i=e.includes("'");s=t&&!i?l:i&&!t?o:r?l:o}return s(e,t)}try{r=RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{r=/\n+(?!\n|$)/g}function u({comment:e,type:t,value:s},o,l,f){let h,d,p,m,{blockQuote:g,commentString:y,lineWidth:b}=o.options;if(!g||/\n[\t ]+$/.test(s))return c(s,o);let k=o.indent||(o.forceBlockIndent||(m=s,/^(%|---|\.\.\.)/m.test(m))?" ":""),S="literal"===g||"folded"!==g&&t!==i.Scalar.BLOCK_FOLDED&&(t===i.Scalar.BLOCK_LITERAL||!function(e,t,s){if(!t||t<0)return!1;let r=t-s,i=e.length;if(i<=r)return!1;for(let t=0,s=0;t<i;++t)if("\n"===e[t]){if(t-s>r)return!0;if(i-(s=t+1)<=r)return!1}return!0}(s,b,k.length));if(!s)return S?"|\n":">\n";for(d=s.length;d>0;--d){let e=s[d-1];if("\n"!==e&&" "!==e&&" "!==e)break}let v=s.substring(d),w=v.indexOf("\n");-1===w?h="-":s===v||w!==v.length-1?(h="+",f&&f()):h="",v&&(s=s.slice(0,-v.length),"\n"===v[v.length-1]&&(v=v.slice(0,-1)),v=v.replace(r,`$&${k}`));let E=!1,N=-1;for(p=0;p<s.length;++p){let e=s[p];if(" "===e)E=!0;else if("\n"===e)N=p;else break}let A=s.substring(0,N<p?N+1:p);A&&(s=s.substring(A.length),A=A.replace(/\n+/g,`$&${k}`));let O=k?"2":"1",L=(E?O:"")+h;if(e&&(L+=" "+y(e.replace(/ ?[\r\n]+/g," ")),l&&l()),!S){let e=s.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${k}`),r=!1,l=a(o,!0);"folded"!==g&&t!==i.Scalar.BLOCK_FOLDED&&(l.onOverflow=()=>{r=!0});let c=n.foldFlowLines(`${A}${e}${v}`,k,n.FOLD_BLOCK,l);if(!r)return`>${L}
|
|
@@ -98,6 +98,6 @@ The composer is the one part not to memorise. Its refs change on every snapshot,
|
|
|
98
98
|
|
|
99
99
|
Ask before it goes up: a \`${c.TOOL_NAMES.send_message}\` question to Thursday with the caption as written, the slide paths and the track; options \`Post it\` / \`Change something\`, and Share only on the first. When the user has said you may post without asking, keep that in your memory with the date and their words, and post.
|
|
100
100
|
|
|
101
|
-
Once it is up, open the post and check its image is the size you built; a cut one is deleted and posted again. Answer with the post's url and the file paths.`}];a.s(["BOT_SEEDS",0,e,"rollSeedIcons",0,()=>(0,d.randomBotIcons)(e.length)])},159861,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f6872465924b31b2cbb7668c23b2de0cf381b4f87",b.callServer,void 0,b.findSourceMapURL,"createSeedBotsAction");a.s(["createSeedBotsAction",0,c])},404826,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f10a1c030ed4e74513d3245478c08dce2e28ce613",b.callServer,void 0,b.findSourceMapURL,"setSignInBotAction");a.s(["setSignInBotAction",0,c])},579587,801548,a=>{"use strict";let b="data-composite-item-active";a.s(["ACTIVE_COMPOSITE_ITEM",0,b],579587);var c=a.i(572131),d=a.i(524715),e=a.i(579923),f=a.i(854401),g=a.i(801811),h=a.i(357738),i=a.i(669649),j=a.i(796e3),k=a.i(30116),l=a.i(559539),m=a.i(926184),n=a.i(162903),o=a.i(187924);a.s(["CompositeRoot",0,function(a){let{render:p,className:q,style:r,refs:s=d.EMPTY_ARRAY,props:t=d.EMPTY_ARRAY,state:u=d.EMPTY_OBJECT,stateAttributesMapping:v,highlightedIndex:w,onHighlightedIndexChange:x,orientation:y,grid:z,loopFocus:A,onLoop:B,enableHomeAndEndKeys:C,onMapChange:D,stopEventPropagation:E=!0,rootRef:F,disabledIndices:G,modifierKeys:H,highlightItemOnHover:I=!1,tag:J="div",...K}=a,{props:L,highlightedIndex:M,onHighlightedIndexChange:N,elementsRef:O,onMapChange:P,relayKeyboardEvent:Q}=function(a){let{loopFocus:e=!0,orientation:l="both",grid:m,onLoop:n,direction:o,highlightedIndex:p,onHighlightedIndexChange:q,rootRef:r,enableHomeAndEndKeys:s=!1,stopEventPropagation:t,disabledIndices:u,modifierKeys:v=d.EMPTY_ARRAY}=a,[w,x]=c.useState(0),y=null!=m,z=c.useRef(null),A=(0,g.useMergedRefs)(z,r),B=c.useRef([]),C=c.useRef(!1),D=c.useRef(null),E=p??w,F=(0,f.useStableCallback)((a,b=!1)=>{if(D.current=B.current[a]??null,(q??x)(a),b){let b=B.current[a];(0,i.scrollIntoViewIfNeeded)(z.current,b,o,l)}}),G=(0,f.useStableCallback)(a=>{if(0===a.size)return;if(C.current){let a=B.current,c=a.indexOf(D.current);if(-1===c){let c=a[E];!c||(0,j.isListIndexDisabled)(a,E,u)?F(function(a,c){let d=-1;for(let e=0;e<a.length;e+=1){let f=a[e];if(!(!f||(0,j.isListIndexDisabled)(a,e,c))){if(f.hasAttribute(b))return e;-1===d&&(d=e)}}return Math.max(d,0)}(a,u)):D.current=c}else c!==E&&F(c);return}C.current=!0;let c=Array.from(a.keys()),d=c.find(a=>a?.hasAttribute(b))??null,e=d?a.get(d)?.index??-1:-1;if(-1!==e)F(e);else if((0,j.isListIndexDisabled)(c,E,u)){let a=(0,j.findNonDisabledListIndex)(c,{disabledIndices:u});(0,j.isIndexOutOfListBounds)(c,a)||F(a)}(0,i.scrollIntoViewIfNeeded)(z.current,d,o,l)});(0,h.useIsoLayoutEffect)(()=>{if(null==u||null!=p||!C.current)return;let a=B.current;if((0,j.isListIndexDisabled)(a,E,u)){let b=(0,j.findNonDisabledListIndex)(a,{disabledIndices:u});(0,j.isIndexOutOfListBounds)(a,b)||F(b)}},[u,p,E,B,F]);let H=(0,f.useStableCallback)((a,b,c)=>n?n(a,b,c,B):c),I=(0,f.useStableCallback)(a=>{let b=a.key===i.HOME||a.key===i.END;if(!i.COMPOSITE_KEYS.has(a.key)||!s&&b||function(a,b){for(let c of i.MODIFIER_KEYS)if(!b.includes(c)&&a.getModifierState(c))return!0;return!1}(a,v)||!z.current)return;let c="rtl"===o,d=c?i.ARROW_LEFT:i.ARROW_RIGHT,f=c?i.ARROW_RIGHT:i.ARROW_LEFT,g="vertical"===l?i.ARROW_DOWN:d,h="vertical"===l?i.ARROW_UP:f,p=(0,k.getTarget)(a.nativeEvent);if(null!=p&&(0,i.isNativeInput)(p)&&!(null==p||p.hasAttribute("disabled")||"true"===p.getAttribute("aria-disabled"))){let b=p.selectionStart,c=p.selectionEnd,d=p.value;if(null==b||a.shiftKey||b!==c||a.key!==h&&b<d.length||a.key!==g&&b>0)return}let q=E,r=(0,j.getMinListIndex)(B,u),w=(0,j.getMaxListIndex)(B,u);null!=m&&(q=m({disabledIndices:u,elementsRef:B,event:a,highlightedIndex:E,loopFocus:e,maxIndex:w,minIndex:r,onLoop:H,orientation:l,rtl:c}));let x="vertical"!==l&&a.key===d||"horizontal"!==l&&a.key===i.ARROW_DOWN,A="vertical"!==l&&a.key===f||"horizontal"!==l&&a.key===i.ARROW_UP;s&&(a.key===i.HOME?q=r:a.key===i.END&&(q=w)),q===E&&(x||A)&&(e&&q===w&&x?(q=r,n&&(q=n(a,E,q,B))):e&&q===r&&A?(q=w,n&&(q=n(a,E,q,B))):q=(0,j.findNonDisabledListIndex)(B.current,{startingIndex:q,decrement:A,disabledIndices:u})),q===E||(0,j.isIndexOutOfListBounds)(B.current,q)||(t&&a.stopPropagation(),(y||b||x||A)&&a.preventDefault(),F(q,!0),queueMicrotask(()=>{B.current[q]?.focus()}))});return{props:{ref:A,onFocus(a){let b=z.current,c=(0,k.getTarget)(a.nativeEvent);b&&null!=c&&(0,i.isNativeInput)(c)&&c.setSelectionRange(0,c.value.length)},onKeyDown:I},highlightedIndex:E,onHighlightedIndexChange:F,elementsRef:B,onMapChange:G,relayKeyboardEvent:I}}({grid:z,loopFocus:A,onLoop:B,orientation:y,highlightedIndex:w,onHighlightedIndexChange:x,rootRef:F,stopEventPropagation:E,enableHomeAndEndKeys:C,direction:(0,n.useDirection)(),disabledIndices:G,modifierKeys:H}),R=(0,m.useRenderElement)(J,a,{state:u,ref:s,props:[L,...t,K],stateAttributesMapping:v}),S=c.useMemo(()=>({highlightedIndex:M,onHighlightedIndexChange:N,highlightItemOnHover:I,relayKeyboardEvent:Q}),[M,N,I,Q]);return(0,o.jsx)(l.CompositeRootContext.Provider,{value:S,children:(0,o.jsx)(e.CompositeList,{elementsRef:O,onMapChange:a=>{D?.(a),P(a)},children:R})})}],801548)},118816,a=>{"use strict";var b=a.i(572131),c=a.i(926184);let d=b.forwardRef(function(a,b){let{className:d,render:e,orientation:f="horizontal",style:g,...h}=a;return(0,c.useRenderElement)("div",a,{state:{orientation:f},ref:b,props:[{role:"separator","aria-orientation":f},h]})});a.s(["Separator",0,d])},144501,a=>{"use strict";var b=a.i(20265),c=a.i(426476);a.s(["getCssDimensions",0,function(a){let d=(0,c.getComputedStyle)(a),e=parseFloat(d.width)||0,f=parseFloat(d.height)||0,g=(0,c.isHTMLElement)(a),h=g?a.offsetWidth:e,i=g?a.offsetHeight:f;return((0,b.round)(e)!==h||(0,b.round)(f)!==i)&&(e=h,f=i),{width:e,height:f}}])},57753,(a,b,c)=>{"use strict";var d=Object.create,e=Object.defineProperty,f=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,h=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,j=(a,b,c,d)=>{if(b&&"object"==typeof b||"function"==typeof b)for(let h of g(b))i.call(a,h)||h===c||e(a,h,{get:()=>b[h],enumerable:!(d=f(b,h))||d.enumerable});return a},k=(a,b,c)=>(c=null!=a?d(h(a)):{},j(!b&&a&&a.__esModule?c:e(c,"default",{value:a,enumerable:!0}),a)),l={},m={isValidAccessToken:()=>u,readAuthConfig:()=>s,writeAuthConfig:()=>t};for(var n in m)e(l,n,{get:m[n],enumerable:!0});b.exports=j(e({},"__esModule",{value:!0}),l);var o=k(a.r(522734)),p=k(a.r(814747)),q=a.r(809750);function r(){let a=(0,q.getVercelDataDir)();if(!a)throw Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);return p.join(a,"auth.json")}function s(){try{let a=r();if(!o.existsSync(a))return null;let b=o.readFileSync(a,"utf8");if(!b)return null;return JSON.parse(b)}catch(a){return null}}function t(a){let b=r(),c=p.dirname(b);o.existsSync(c)||o.mkdirSync(c,{mode:504,recursive:!0}),o.writeFileSync(b,JSON.stringify(a,null,2),{mode:384})}function u(a,b=0){if(!a.token)return!1;if("number"!=typeof a.expiresAt)return!0;let c=Math.floor(Date.now()/1e3);return a.expiresAt>=c+b/1e3}},69845,(a,b,c)=>{"use strict";var d=Object.defineProperty,e=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,h={},i={AccessTokenMissingError:()=>k,RefreshAccessTokenFailedError:()=>l};for(var j in i)d(h,j,{get:i[j],enumerable:!0});b.exports=((a,b,c)=>{if(b&&"object"==typeof b||"function"==typeof b)for(let h of f(b))g.call(a,h)||void 0===h||d(a,h,{get:()=>b[h],enumerable:!(c=e(b,h))||c.enumerable});return a})(d({},"__esModule",{value:!0}),h);class k extends Error{constructor(){super("No authentication found. Please log in with the Vercel CLI (vercel login)."),this.name="AccessTokenMissingError"}}class l extends Error{constructor(a){super("Failed to refresh authentication token.",{cause:a}),this.name="RefreshAccessTokenFailedError"}}},301479,(a,b,c)=>{"use strict";var d=Object.defineProperty,e=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,h={},i={processTokenResponse:()=>p,refreshTokenRequest:()=>o};for(var j in i)d(h,j,{get:i[j],enumerable:!0});b.exports=((a,b,c)=>{if(b&&"object"==typeof b||"function"==typeof b)for(let h of f(b))g.call(a,h)||void 0===h||d(a,h,{get:()=>b[h],enumerable:!(c=e(b,h))||c.enumerable});return a})(d({},"__esModule",{value:!0}),h);var k=a.r(446786);let l=`@vercel/oidc node-${process.version} ${(0,k.platform)()} (${(0,k.arch)()}) ${(0,k.hostname)()}`,m=null;async function n(){if(m)return m;let a=await fetch("https://vercel.com/.well-known/openid-configuration",{headers:{"user-agent":l}});if(!a.ok)throw Error("Failed to discover OAuth endpoints");let b=await a.json();if(!b||"string"!=typeof b.token_endpoint)throw Error("Invalid OAuth discovery response");let c=b.token_endpoint;return m=c,c}async function o(a){let b=await n();return await fetch(b,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":l},body:new URLSearchParams({client_id:"cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp",grant_type:"refresh_token",...a})})}async function p(a){let b=await a.json();return a.ok?"object"!=typeof b||null===b?[Error("Invalid token response")]:"string"!=typeof b.access_token?[Error("Missing access_token in response")]:"Bearer"!==b.token_type?[Error("Invalid token_type in response")]:"number"!=typeof b.expires_in?[Error("Missing expires_in in response")]:[null,b]:[Error("object"==typeof b&&b&&"error"in b?String(b.error):"Token refresh failed")]}},325279,(a,b,c)=>{"use strict";var d=Object.defineProperty,e=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,h={},i={VercelOidcTokenError:()=>k};for(var j in i)d(h,j,{get:i[j],enumerable:!0});b.exports=((a,b,c)=>{if(b&&"object"==typeof b||"function"==typeof b)for(let h of f(b))g.call(a,h)||void 0===h||d(a,h,{get:()=>b[h],enumerable:!(c=e(b,h))||c.enumerable});return a})(d({},"__esModule",{value:!0}),h);class k extends Error{constructor(a,b){super(a),this.name="VercelOidcTokenError",this.cause=b}toString(){return this.cause?`${this.name}: ${this.message}: ${this.cause}`:`${this.name}: ${this.message}`}}},314225,(a,b,c)=>{"use strict";var d=Object.create,e=Object.defineProperty,f=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,h=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,j=(a,b,c,d)=>{if(b&&"object"==typeof b||"function"==typeof b)for(let h of g(b))i.call(a,h)||h===c||e(a,h,{get:()=>b[h],enumerable:!(d=f(b,h))||d.enumerable});return a},k=(a,b,c)=>(c=null!=a?d(h(a)):{},j(!b&&a&&a.__esModule?c:e(c,"default",{value:a,enumerable:!0}),a)),l={},m={findRootDir:()=>s,getUserDataDir:()=>t};for(var n in m)e(l,n,{get:m[n],enumerable:!0});b.exports=j(e({},"__esModule",{value:!0}),l);var o=k(a.r(814747)),p=k(a.r(522734)),q=k(a.r(446786)),r=a.r(325279);function s(){try{let a=process.cwd();for(;a!==o.default.dirname(a);){let b=o.default.join(a,".vercel");if(p.default.existsSync(b))return a;a=o.default.dirname(a)}}catch(a){throw new r.VercelOidcTokenError("Token refresh only supported in node server environments")}return null}function t(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(q.default.platform()){case"darwin":return o.default.join(q.default.homedir(),"Library/Application Support");case"linux":return o.default.join(q.default.homedir(),".local/share");case"win32":if(process.env.LOCALAPPDATA)return process.env.LOCALAPPDATA;return null;default:return null}}},809750,(a,b,c)=>{"use strict";var d=Object.create,e=Object.defineProperty,f=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,h=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,j=(a,b,c,d)=>{if(b&&"object"==typeof b||"function"==typeof b)for(let h of g(b))i.call(a,h)||h===c||e(a,h,{get:()=>b[h],enumerable:!(d=f(b,h))||d.enumerable});return a},k=(a,b,c)=>(c=null!=a?d(h(a)):{},j(!b&&a&&a.__esModule?c:e(c,"default",{value:a,enumerable:!0}),a)),l={},m={assertVercelOidcTokenResponse:()=>y,findProjectInfo:()=>z,getTokenPayload:()=>C,getVercelDataDir:()=>v,getVercelOidcToken:()=>x,getVercelToken:()=>w,isExpired:()=>D,loadToken:()=>B,saveToken:()=>A};for(var n in m)e(l,n,{get:m[n],enumerable:!0});b.exports=j(e({},"__esModule",{value:!0}),l);var o=k(a.r(814747)),p=k(a.r(522734)),q=a.r(325279),r=a.r(314225),s=a.r(57753),t=a.r(301479),u=a.r(69845);function v(){let a=(0,r.getUserDataDir)();return a?o.join(a,"com.vercel.cli"):null}async function w(a){let b=(0,s.readAuthConfig)();if(!b?.token)throw new u.AccessTokenMissingError;if((0,s.isValidAccessToken)(b,a?.expirationBufferMs))return b.token;if(!b.refreshToken)throw(0,s.writeAuthConfig)({}),new u.RefreshAccessTokenFailedError("No refresh token available");try{let a=await (0,t.refreshTokenRequest)({refresh_token:b.refreshToken}),[c,d]=await (0,t.processTokenResponse)(a);if(c||!d)throw(0,s.writeAuthConfig)({}),new u.RefreshAccessTokenFailedError(c);let e={token:d.access_token,expiresAt:Math.floor(Date.now()/1e3)+d.expires_in};return d.refresh_token&&(e.refreshToken=d.refresh_token),(0,s.writeAuthConfig)(e),e.token}catch(a){if((0,s.writeAuthConfig)({}),a instanceof u.AccessTokenMissingError||a instanceof u.RefreshAccessTokenFailedError)throw a;throw new u.RefreshAccessTokenFailedError(a)}}async function x(a,b,c){let d=`https://api.vercel.com/v1/projects/${b}/token?source=vercel-oidc-refresh${c?`&teamId=${c}`:""}`,e=await fetch(d,{method:"POST",headers:{Authorization:`Bearer ${a}`}});if(!e.ok)throw new q.VercelOidcTokenError(`Failed to refresh OIDC token: ${e.statusText}`);let f=await e.json();return y(f),f}function y(a){if(!a||"object"!=typeof a)throw TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again");if(!("token"in a)||"string"!=typeof a.token)throw TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again")}function z(){let a=(0,r.findRootDir)();if(!a)throw new q.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");let b=o.join(a,".vercel","project.json");if(!p.existsSync(b))throw new q.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");let c=JSON.parse(p.readFileSync(b,"utf8"));if("string"!=typeof c.projectId&&"string"!=typeof c.orgId)throw TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");return{projectId:c.projectId,teamId:c.orgId}}function A(a,b){let c=(0,r.getUserDataDir)();if(!c)throw new q.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let d=o.join(c,"com.vercel.token",`${b}.json`),e=JSON.stringify(a);p.mkdirSync(o.dirname(d),{mode:504,recursive:!0}),p.writeFileSync(d,e),p.chmodSync(d,432)}function B(a){let b=(0,r.getUserDataDir)();if(!b)throw new q.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let c=o.join(b,"com.vercel.token",`${a}.json`);if(!p.existsSync(c))return null;let d=JSON.parse(p.readFileSync(c,"utf8"));return y(d),d}function C(a){let b=a.split(".");if(3!==b.length)throw new q.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again");let c=b[1].replace(/-/g,"+").replace(/_/g,"/"),d=c.padEnd(c.length+(4-c.length%4)%4,"=");return JSON.parse(Buffer.from(d,"base64").toString("utf8"))}function D(a,b=0){return 1e3*a.exp<Date.now()+b}},327598,a=>{"use strict";var b=a.i(164831);let c={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};c.node;let d=(0,b.default)(c);a.s(["ArrowUp",0,d],327598)},444080,a=>{"use strict";var b=a.i(164831);let c={name:"book-bookmark",size:24,node:[["path",{d:"M10 2v7.751a.25.25 0 00.407.195l2.28-1.834a.5.5 0 01.627 0l2.28 1.834A.25.25 0 0016 9.751V2",key:"x9x4jl"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 016.5 2H19a1 1 0 011 1v18a1 1 0 01-1 1H6.5a1 1 0 010-5H20",key:"1889un"}]],aliases:["book-marked"]};c.node;let d=(0,b.default)(c);a.s(["BookMarked",0,d],444080)},585650,a=>{"use strict";var b=a.i(164831);let c={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};c.node;let d=(0,b.default)(c);a.s(["Copy",0,d],585650)},607396,a=>{"use strict";var b=a.i(164831);let c={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"]};c.node;let d=(0,b.default)(c);a.s(["default",0,d])},844561,a=>{"use strict";var b=a.i(164831);let c={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};c.node;let d=(0,b.default)(c);a.s(["FolderOpen",0,d],844561)},696732,a=>{"use strict";var b=a.i(164831);let c={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};c.node;let d=(0,b.default)(c);a.s(["Globe",0,d],696732)},71215,a=>{"use strict";var b=a.i(164831);let c={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};c.node;let d=(0,b.default)(c);a.s(["Image",0,d],71215)},474896,a=>{"use strict";var b=a.i(164831);let c={name:"log-in",size:24,node:[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]};c.node;let d=(0,b.default)(c);a.s(["LogIn",0,d],474896)},26268,a=>{"use strict";var b=a.i(623577);a.s(["TriangleAlert",()=>b.default])},869789,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={actionAsyncStorage:function(){return f.actionAsyncStorage},workAsyncStorage:function(){return g.workAsyncStorage},workUnitAsyncStorage:function(){return h.workUnitAsyncStorage}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(120635),g=a.r(556704),h=a.r(832319);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)}];
|
|
101
|
+
Once it is up, open the post and check its image is the size you built; a cut one is deleted and posted again. Answer with the post's url and the file paths.`}];a.s(["BOT_SEEDS",0,e,"rollSeedIcons",0,()=>(0,d.randomBotIcons)(e.length)])},630307,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fe5490edefe26bbd6ca2aad6d89e46ca9383af8e3",b.callServer,void 0,b.findSourceMapURL,"createSeedBotsAction");a.s(["createSeedBotsAction",0,c])},255903,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fae66a0d5faa8a35f076c4c73c00631832f637565",b.callServer,void 0,b.findSourceMapURL,"setSignInBotAction");a.s(["setSignInBotAction",0,c])},579587,801548,a=>{"use strict";let b="data-composite-item-active";a.s(["ACTIVE_COMPOSITE_ITEM",0,b],579587);var c=a.i(572131),d=a.i(524715),e=a.i(579923),f=a.i(854401),g=a.i(801811),h=a.i(357738),i=a.i(669649),j=a.i(796e3),k=a.i(30116),l=a.i(559539),m=a.i(926184),n=a.i(162903),o=a.i(187924);a.s(["CompositeRoot",0,function(a){let{render:p,className:q,style:r,refs:s=d.EMPTY_ARRAY,props:t=d.EMPTY_ARRAY,state:u=d.EMPTY_OBJECT,stateAttributesMapping:v,highlightedIndex:w,onHighlightedIndexChange:x,orientation:y,grid:z,loopFocus:A,onLoop:B,enableHomeAndEndKeys:C,onMapChange:D,stopEventPropagation:E=!0,rootRef:F,disabledIndices:G,modifierKeys:H,highlightItemOnHover:I=!1,tag:J="div",...K}=a,{props:L,highlightedIndex:M,onHighlightedIndexChange:N,elementsRef:O,onMapChange:P,relayKeyboardEvent:Q}=function(a){let{loopFocus:e=!0,orientation:l="both",grid:m,onLoop:n,direction:o,highlightedIndex:p,onHighlightedIndexChange:q,rootRef:r,enableHomeAndEndKeys:s=!1,stopEventPropagation:t,disabledIndices:u,modifierKeys:v=d.EMPTY_ARRAY}=a,[w,x]=c.useState(0),y=null!=m,z=c.useRef(null),A=(0,g.useMergedRefs)(z,r),B=c.useRef([]),C=c.useRef(!1),D=c.useRef(null),E=p??w,F=(0,f.useStableCallback)((a,b=!1)=>{if(D.current=B.current[a]??null,(q??x)(a),b){let b=B.current[a];(0,i.scrollIntoViewIfNeeded)(z.current,b,o,l)}}),G=(0,f.useStableCallback)(a=>{if(0===a.size)return;if(C.current){let a=B.current,c=a.indexOf(D.current);if(-1===c){let c=a[E];!c||(0,j.isListIndexDisabled)(a,E,u)?F(function(a,c){let d=-1;for(let e=0;e<a.length;e+=1){let f=a[e];if(!(!f||(0,j.isListIndexDisabled)(a,e,c))){if(f.hasAttribute(b))return e;-1===d&&(d=e)}}return Math.max(d,0)}(a,u)):D.current=c}else c!==E&&F(c);return}C.current=!0;let c=Array.from(a.keys()),d=c.find(a=>a?.hasAttribute(b))??null,e=d?a.get(d)?.index??-1:-1;if(-1!==e)F(e);else if((0,j.isListIndexDisabled)(c,E,u)){let a=(0,j.findNonDisabledListIndex)(c,{disabledIndices:u});(0,j.isIndexOutOfListBounds)(c,a)||F(a)}(0,i.scrollIntoViewIfNeeded)(z.current,d,o,l)});(0,h.useIsoLayoutEffect)(()=>{if(null==u||null!=p||!C.current)return;let a=B.current;if((0,j.isListIndexDisabled)(a,E,u)){let b=(0,j.findNonDisabledListIndex)(a,{disabledIndices:u});(0,j.isIndexOutOfListBounds)(a,b)||F(b)}},[u,p,E,B,F]);let H=(0,f.useStableCallback)((a,b,c)=>n?n(a,b,c,B):c),I=(0,f.useStableCallback)(a=>{let b=a.key===i.HOME||a.key===i.END;if(!i.COMPOSITE_KEYS.has(a.key)||!s&&b||function(a,b){for(let c of i.MODIFIER_KEYS)if(!b.includes(c)&&a.getModifierState(c))return!0;return!1}(a,v)||!z.current)return;let c="rtl"===o,d=c?i.ARROW_LEFT:i.ARROW_RIGHT,f=c?i.ARROW_RIGHT:i.ARROW_LEFT,g="vertical"===l?i.ARROW_DOWN:d,h="vertical"===l?i.ARROW_UP:f,p=(0,k.getTarget)(a.nativeEvent);if(null!=p&&(0,i.isNativeInput)(p)&&!(null==p||p.hasAttribute("disabled")||"true"===p.getAttribute("aria-disabled"))){let b=p.selectionStart,c=p.selectionEnd,d=p.value;if(null==b||a.shiftKey||b!==c||a.key!==h&&b<d.length||a.key!==g&&b>0)return}let q=E,r=(0,j.getMinListIndex)(B,u),w=(0,j.getMaxListIndex)(B,u);null!=m&&(q=m({disabledIndices:u,elementsRef:B,event:a,highlightedIndex:E,loopFocus:e,maxIndex:w,minIndex:r,onLoop:H,orientation:l,rtl:c}));let x="vertical"!==l&&a.key===d||"horizontal"!==l&&a.key===i.ARROW_DOWN,A="vertical"!==l&&a.key===f||"horizontal"!==l&&a.key===i.ARROW_UP;s&&(a.key===i.HOME?q=r:a.key===i.END&&(q=w)),q===E&&(x||A)&&(e&&q===w&&x?(q=r,n&&(q=n(a,E,q,B))):e&&q===r&&A?(q=w,n&&(q=n(a,E,q,B))):q=(0,j.findNonDisabledListIndex)(B.current,{startingIndex:q,decrement:A,disabledIndices:u})),q===E||(0,j.isIndexOutOfListBounds)(B.current,q)||(t&&a.stopPropagation(),(y||b||x||A)&&a.preventDefault(),F(q,!0),queueMicrotask(()=>{B.current[q]?.focus()}))});return{props:{ref:A,onFocus(a){let b=z.current,c=(0,k.getTarget)(a.nativeEvent);b&&null!=c&&(0,i.isNativeInput)(c)&&c.setSelectionRange(0,c.value.length)},onKeyDown:I},highlightedIndex:E,onHighlightedIndexChange:F,elementsRef:B,onMapChange:G,relayKeyboardEvent:I}}({grid:z,loopFocus:A,onLoop:B,orientation:y,highlightedIndex:w,onHighlightedIndexChange:x,rootRef:F,stopEventPropagation:E,enableHomeAndEndKeys:C,direction:(0,n.useDirection)(),disabledIndices:G,modifierKeys:H}),R=(0,m.useRenderElement)(J,a,{state:u,ref:s,props:[L,...t,K],stateAttributesMapping:v}),S=c.useMemo(()=>({highlightedIndex:M,onHighlightedIndexChange:N,highlightItemOnHover:I,relayKeyboardEvent:Q}),[M,N,I,Q]);return(0,o.jsx)(l.CompositeRootContext.Provider,{value:S,children:(0,o.jsx)(e.CompositeList,{elementsRef:O,onMapChange:a=>{D?.(a),P(a)},children:R})})}],801548)},118816,a=>{"use strict";var b=a.i(572131),c=a.i(926184);let d=b.forwardRef(function(a,b){let{className:d,render:e,orientation:f="horizontal",style:g,...h}=a;return(0,c.useRenderElement)("div",a,{state:{orientation:f},ref:b,props:[{role:"separator","aria-orientation":f},h]})});a.s(["Separator",0,d])},144501,a=>{"use strict";var b=a.i(20265),c=a.i(426476);a.s(["getCssDimensions",0,function(a){let d=(0,c.getComputedStyle)(a),e=parseFloat(d.width)||0,f=parseFloat(d.height)||0,g=(0,c.isHTMLElement)(a),h=g?a.offsetWidth:e,i=g?a.offsetHeight:f;return((0,b.round)(e)!==h||(0,b.round)(f)!==i)&&(e=h,f=i),{width:e,height:f}}])},57753,(a,b,c)=>{"use strict";var d=Object.create,e=Object.defineProperty,f=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,h=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,j=(a,b,c,d)=>{if(b&&"object"==typeof b||"function"==typeof b)for(let h of g(b))i.call(a,h)||h===c||e(a,h,{get:()=>b[h],enumerable:!(d=f(b,h))||d.enumerable});return a},k=(a,b,c)=>(c=null!=a?d(h(a)):{},j(!b&&a&&a.__esModule?c:e(c,"default",{value:a,enumerable:!0}),a)),l={},m={isValidAccessToken:()=>u,readAuthConfig:()=>s,writeAuthConfig:()=>t};for(var n in m)e(l,n,{get:m[n],enumerable:!0});b.exports=j(e({},"__esModule",{value:!0}),l);var o=k(a.r(522734)),p=k(a.r(814747)),q=a.r(809750);function r(){let a=(0,q.getVercelDataDir)();if(!a)throw Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);return p.join(a,"auth.json")}function s(){try{let a=r();if(!o.existsSync(a))return null;let b=o.readFileSync(a,"utf8");if(!b)return null;return JSON.parse(b)}catch(a){return null}}function t(a){let b=r(),c=p.dirname(b);o.existsSync(c)||o.mkdirSync(c,{mode:504,recursive:!0}),o.writeFileSync(b,JSON.stringify(a,null,2),{mode:384})}function u(a,b=0){if(!a.token)return!1;if("number"!=typeof a.expiresAt)return!0;let c=Math.floor(Date.now()/1e3);return a.expiresAt>=c+b/1e3}},69845,(a,b,c)=>{"use strict";var d=Object.defineProperty,e=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,h={},i={AccessTokenMissingError:()=>k,RefreshAccessTokenFailedError:()=>l};for(var j in i)d(h,j,{get:i[j],enumerable:!0});b.exports=((a,b,c)=>{if(b&&"object"==typeof b||"function"==typeof b)for(let h of f(b))g.call(a,h)||void 0===h||d(a,h,{get:()=>b[h],enumerable:!(c=e(b,h))||c.enumerable});return a})(d({},"__esModule",{value:!0}),h);class k extends Error{constructor(){super("No authentication found. Please log in with the Vercel CLI (vercel login)."),this.name="AccessTokenMissingError"}}class l extends Error{constructor(a){super("Failed to refresh authentication token.",{cause:a}),this.name="RefreshAccessTokenFailedError"}}},301479,(a,b,c)=>{"use strict";var d=Object.defineProperty,e=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,h={},i={processTokenResponse:()=>p,refreshTokenRequest:()=>o};for(var j in i)d(h,j,{get:i[j],enumerable:!0});b.exports=((a,b,c)=>{if(b&&"object"==typeof b||"function"==typeof b)for(let h of f(b))g.call(a,h)||void 0===h||d(a,h,{get:()=>b[h],enumerable:!(c=e(b,h))||c.enumerable});return a})(d({},"__esModule",{value:!0}),h);var k=a.r(446786);let l=`@vercel/oidc node-${process.version} ${(0,k.platform)()} (${(0,k.arch)()}) ${(0,k.hostname)()}`,m=null;async function n(){if(m)return m;let a=await fetch("https://vercel.com/.well-known/openid-configuration",{headers:{"user-agent":l}});if(!a.ok)throw Error("Failed to discover OAuth endpoints");let b=await a.json();if(!b||"string"!=typeof b.token_endpoint)throw Error("Invalid OAuth discovery response");let c=b.token_endpoint;return m=c,c}async function o(a){let b=await n();return await fetch(b,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":l},body:new URLSearchParams({client_id:"cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp",grant_type:"refresh_token",...a})})}async function p(a){let b=await a.json();return a.ok?"object"!=typeof b||null===b?[Error("Invalid token response")]:"string"!=typeof b.access_token?[Error("Missing access_token in response")]:"Bearer"!==b.token_type?[Error("Invalid token_type in response")]:"number"!=typeof b.expires_in?[Error("Missing expires_in in response")]:[null,b]:[Error("object"==typeof b&&b&&"error"in b?String(b.error):"Token refresh failed")]}},325279,(a,b,c)=>{"use strict";var d=Object.defineProperty,e=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,h={},i={VercelOidcTokenError:()=>k};for(var j in i)d(h,j,{get:i[j],enumerable:!0});b.exports=((a,b,c)=>{if(b&&"object"==typeof b||"function"==typeof b)for(let h of f(b))g.call(a,h)||void 0===h||d(a,h,{get:()=>b[h],enumerable:!(c=e(b,h))||c.enumerable});return a})(d({},"__esModule",{value:!0}),h);class k extends Error{constructor(a,b){super(a),this.name="VercelOidcTokenError",this.cause=b}toString(){return this.cause?`${this.name}: ${this.message}: ${this.cause}`:`${this.name}: ${this.message}`}}},314225,(a,b,c)=>{"use strict";var d=Object.create,e=Object.defineProperty,f=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,h=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,j=(a,b,c,d)=>{if(b&&"object"==typeof b||"function"==typeof b)for(let h of g(b))i.call(a,h)||h===c||e(a,h,{get:()=>b[h],enumerable:!(d=f(b,h))||d.enumerable});return a},k=(a,b,c)=>(c=null!=a?d(h(a)):{},j(!b&&a&&a.__esModule?c:e(c,"default",{value:a,enumerable:!0}),a)),l={},m={findRootDir:()=>s,getUserDataDir:()=>t};for(var n in m)e(l,n,{get:m[n],enumerable:!0});b.exports=j(e({},"__esModule",{value:!0}),l);var o=k(a.r(814747)),p=k(a.r(522734)),q=k(a.r(446786)),r=a.r(325279);function s(){try{let a=process.cwd();for(;a!==o.default.dirname(a);){let b=o.default.join(a,".vercel");if(p.default.existsSync(b))return a;a=o.default.dirname(a)}}catch(a){throw new r.VercelOidcTokenError("Token refresh only supported in node server environments")}return null}function t(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(q.default.platform()){case"darwin":return o.default.join(q.default.homedir(),"Library/Application Support");case"linux":return o.default.join(q.default.homedir(),".local/share");case"win32":if(process.env.LOCALAPPDATA)return process.env.LOCALAPPDATA;return null;default:return null}}},809750,(a,b,c)=>{"use strict";var d=Object.create,e=Object.defineProperty,f=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,h=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,j=(a,b,c,d)=>{if(b&&"object"==typeof b||"function"==typeof b)for(let h of g(b))i.call(a,h)||h===c||e(a,h,{get:()=>b[h],enumerable:!(d=f(b,h))||d.enumerable});return a},k=(a,b,c)=>(c=null!=a?d(h(a)):{},j(!b&&a&&a.__esModule?c:e(c,"default",{value:a,enumerable:!0}),a)),l={},m={assertVercelOidcTokenResponse:()=>y,findProjectInfo:()=>z,getTokenPayload:()=>C,getVercelDataDir:()=>v,getVercelOidcToken:()=>x,getVercelToken:()=>w,isExpired:()=>D,loadToken:()=>B,saveToken:()=>A};for(var n in m)e(l,n,{get:m[n],enumerable:!0});b.exports=j(e({},"__esModule",{value:!0}),l);var o=k(a.r(814747)),p=k(a.r(522734)),q=a.r(325279),r=a.r(314225),s=a.r(57753),t=a.r(301479),u=a.r(69845);function v(){let a=(0,r.getUserDataDir)();return a?o.join(a,"com.vercel.cli"):null}async function w(a){let b=(0,s.readAuthConfig)();if(!b?.token)throw new u.AccessTokenMissingError;if((0,s.isValidAccessToken)(b,a?.expirationBufferMs))return b.token;if(!b.refreshToken)throw(0,s.writeAuthConfig)({}),new u.RefreshAccessTokenFailedError("No refresh token available");try{let a=await (0,t.refreshTokenRequest)({refresh_token:b.refreshToken}),[c,d]=await (0,t.processTokenResponse)(a);if(c||!d)throw(0,s.writeAuthConfig)({}),new u.RefreshAccessTokenFailedError(c);let e={token:d.access_token,expiresAt:Math.floor(Date.now()/1e3)+d.expires_in};return d.refresh_token&&(e.refreshToken=d.refresh_token),(0,s.writeAuthConfig)(e),e.token}catch(a){if((0,s.writeAuthConfig)({}),a instanceof u.AccessTokenMissingError||a instanceof u.RefreshAccessTokenFailedError)throw a;throw new u.RefreshAccessTokenFailedError(a)}}async function x(a,b,c){let d=`https://api.vercel.com/v1/projects/${b}/token?source=vercel-oidc-refresh${c?`&teamId=${c}`:""}`,e=await fetch(d,{method:"POST",headers:{Authorization:`Bearer ${a}`}});if(!e.ok)throw new q.VercelOidcTokenError(`Failed to refresh OIDC token: ${e.statusText}`);let f=await e.json();return y(f),f}function y(a){if(!a||"object"!=typeof a)throw TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again");if(!("token"in a)||"string"!=typeof a.token)throw TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again")}function z(){let a=(0,r.findRootDir)();if(!a)throw new q.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");let b=o.join(a,".vercel","project.json");if(!p.existsSync(b))throw new q.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");let c=JSON.parse(p.readFileSync(b,"utf8"));if("string"!=typeof c.projectId&&"string"!=typeof c.orgId)throw TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");return{projectId:c.projectId,teamId:c.orgId}}function A(a,b){let c=(0,r.getUserDataDir)();if(!c)throw new q.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let d=o.join(c,"com.vercel.token",`${b}.json`),e=JSON.stringify(a);p.mkdirSync(o.dirname(d),{mode:504,recursive:!0}),p.writeFileSync(d,e),p.chmodSync(d,432)}function B(a){let b=(0,r.getUserDataDir)();if(!b)throw new q.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let c=o.join(b,"com.vercel.token",`${a}.json`);if(!p.existsSync(c))return null;let d=JSON.parse(p.readFileSync(c,"utf8"));return y(d),d}function C(a){let b=a.split(".");if(3!==b.length)throw new q.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again");let c=b[1].replace(/-/g,"+").replace(/_/g,"/"),d=c.padEnd(c.length+(4-c.length%4)%4,"=");return JSON.parse(Buffer.from(d,"base64").toString("utf8"))}function D(a,b=0){return 1e3*a.exp<Date.now()+b}},987234,a=>{"use strict";var b=a.i(934754),c=a.i(244513),d=a.i(852587),e=a.i(23464),f=a.i(57270),g=a.i(774016),h=a.i(959296);a.s(["formatDistanceToNowStrict",0,function(a,i){return function(a,b,i){var j;let k,l,m=(0,d.getDefaultOptions)(),n=i?.locale??m.locale??c.defaultLocale,o=(l=(0,g.toDate)(a)-(0,g.toDate)(b))<0?-1:l>0?1:l;if(isNaN(o))throw RangeError("Invalid time value");let p=Object.assign({},i,{addSuffix:i?.addSuffix,comparison:o}),[q,r]=(0,f.normalizeDates)(i?.in,...o>0?[b,a]:[a,b]),s=(j=i?.roundingMethod??"round",a=>{let b=(j?Math[j]:Math.trunc)(a);return 0===b?0:b}),t=r.getTime()-q.getTime(),u=t/h.millisecondsInMinute,v=(t-((0,e.getTimezoneOffsetInMilliseconds)(r)-(0,e.getTimezoneOffsetInMilliseconds)(q)))/h.millisecondsInMinute,w=i?.unit;if("second"===(k=w||(u<1?"second":u<60?"minute":u<h.minutesInDay?"hour":v<h.minutesInMonth?"day":v<h.minutesInYear?"month":"year"))){let a=s(t/1e3);return n.formatDistance("xSeconds",a,p)}if("minute"===k){let a=s(u);return n.formatDistance("xMinutes",a,p)}if("hour"===k){let a=s(u/60);return n.formatDistance("xHours",a,p)}if("day"===k){let a=s(v/h.minutesInDay);return n.formatDistance("xDays",a,p)}if("month"===k){let a=s(v/h.minutesInMonth);return 12===a&&"month"!==w?n.formatDistance("xYears",1,p):n.formatDistance("xMonths",a,p)}else{let a=s(v/h.minutesInYear);return n.formatDistance("xYears",a,p)}}(a,(0,b.constructNow)(a),i)}],987234)},327598,a=>{"use strict";var b=a.i(164831);let c={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};c.node;let d=(0,b.default)(c);a.s(["ArrowUp",0,d],327598)},444080,a=>{"use strict";var b=a.i(164831);let c={name:"book-bookmark",size:24,node:[["path",{d:"M10 2v7.751a.25.25 0 00.407.195l2.28-1.834a.5.5 0 01.627 0l2.28 1.834A.25.25 0 0016 9.751V2",key:"x9x4jl"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 016.5 2H19a1 1 0 011 1v18a1 1 0 01-1 1H6.5a1 1 0 010-5H20",key:"1889un"}]],aliases:["book-marked"]};c.node;let d=(0,b.default)(c);a.s(["BookMarked",0,d],444080)},585650,a=>{"use strict";var b=a.i(164831);let c={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};c.node;let d=(0,b.default)(c);a.s(["Copy",0,d],585650)},607396,a=>{"use strict";var b=a.i(164831);let c={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"]};c.node;let d=(0,b.default)(c);a.s(["default",0,d])},844561,a=>{"use strict";var b=a.i(164831);let c={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};c.node;let d=(0,b.default)(c);a.s(["FolderOpen",0,d],844561)},696732,a=>{"use strict";var b=a.i(164831);let c={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};c.node;let d=(0,b.default)(c);a.s(["Globe",0,d],696732)},71215,a=>{"use strict";var b=a.i(164831);let c={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};c.node;let d=(0,b.default)(c);a.s(["Image",0,d],71215)},474896,a=>{"use strict";var b=a.i(164831);let c={name:"log-in",size:24,node:[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]};c.node;let d=(0,b.default)(c);a.s(["LogIn",0,d],474896)},26268,a=>{"use strict";var b=a.i(623577);a.s(["TriangleAlert",()=>b.default])},869789,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={actionAsyncStorage:function(){return f.actionAsyncStorage},workAsyncStorage:function(){return g.workAsyncStorage},workUnitAsyncStorage:function(){return h.workUnitAsyncStorage}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(120635),g=a.r(556704),h=a.r(832319);("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)}];
|
|
102
102
|
|
|
103
|
-
//# sourceMappingURL=%5Broot-of-the-server%
|
|
103
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0oo-wlv._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module.exports=[70729,a=>{a.v(a=>Promise.resolve().then(()=>a(666680)))},133300,a=>{a.v(a=>Promise.resolve().then(()=>a(203469)))},276307,a=>{a.v(a=>Promise.resolve().then(()=>a(221214)))},763543,a=>{a.v(a=>Promise.resolve().then(()=>a(674986)))},951922,a=>{a.v(a=>Promise.resolve().then(()=>a(839430)))},343064,a=>{a.v(a=>Promise.resolve().then(()=>a(344853)))},453556,a=>{a.v(a=>Promise.resolve().then(()=>a(233398)))},394298,a=>{a.v(a=>Promise.resolve().then(()=>a(684321)))},122690,a=>{a.v(a=>Promise.resolve().then(()=>a(821415)))},682672,a=>{a.v(a=>Promise.resolve().then(()=>a(72918)))},966249,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@vercel_oidc_dist_token_16gdpgb.js"].map(b=>a.l(b))).then(()=>b(860544)))},832030,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[externals]_node_readline_1u65a-m._.js","server/chunks/ssr/node_modules_consola_dist_chunks_prompt_mjs_1j4x-_j._.js"].map(b=>a.l(b))).then(()=>b(322479)))}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=%5Broot-of-the-server%
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0tvavy9._.js.map
|