thursday-agent 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/artifact/route.js +3 -3
- package/.next/server/app/api/artifact/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/route.js.nft.json +1 -1
- package/.next/server/app/api/bot/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/file/[...path]/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/skills/[source]/[name]/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/thursday/tool-call/route.js +1 -1
- package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/missing/route.js +2 -2
- package/.next/server/app/api/workspace/missing/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/route.js.nft.json +1 -1
- package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
- package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
- package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page/server-reference-manifest.json +42 -42
- package/.next/server/app/page.js +5 -4
- 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]__0-06t3f._.js +8 -0
- package/.next/server/chunks/{[root-of-the-server]__049f521._.js → [root-of-the-server]__06l05n_._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0_ue8oe._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0ye3da2._.js → [root-of-the-server]__0btqrct._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0c9fgca._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0zp35ul._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1kv8p3e._.js +1 -1
- package/.next/server/chunks/_02szwk8._.js +1 -1
- package/.next/server/chunks/_06c9kie._.js +24 -24
- package/.next/server/chunks/_0i55en5._.js +6 -6
- package/.next/server/chunks/_0p56fn0._.js +1 -1
- package/.next/server/chunks/_11ujpya._.js +1 -1
- package/.next/server/chunks/_1dbixxz._.js +1 -1
- package/.next/server/chunks/_1dc_d1q._.js +16 -16
- package/.next/server/chunks/_1gnjfli._.js +3 -0
- package/.next/server/chunks/_1klbcft._.js +1 -1
- package/.next/server/chunks/features_0-cnt0l._.js +1 -1
- package/.next/server/chunks/features_0hdaci0._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0-e011f._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0pd8yr7._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1nygfik._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1sdphb0._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__1fll8dc._.js → [root-of-the-server]__1vdmfbe._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__1waa3rc._.js +34 -49
- package/.next/server/chunks/ssr/{_1anqots._.js → _0-2qsxo._.js} +2 -2
- package/.next/server/chunks/ssr/_02oc_h5._.js +9 -9
- package/.next/server/chunks/ssr/_05yghx6._.js +1 -1
- package/.next/server/chunks/ssr/_07nbwap._.js +3 -0
- package/.next/server/chunks/ssr/_08c4z-9._.js +1 -1
- package/.next/server/chunks/ssr/_0_qfdlw._.js +1 -1
- package/.next/server/chunks/ssr/_0b6_jv-._.js +3 -0
- package/.next/server/chunks/ssr/_0hxt2ul._.js +1 -1
- package/.next/server/chunks/ssr/_0i_6q1w._.js +1 -1
- package/.next/server/chunks/ssr/{_18xqmny._.js → _0no7i1o._.js} +2 -2
- package/.next/server/chunks/ssr/_0tzg--b._.js +3 -0
- package/.next/server/chunks/ssr/{_1ztk7p6._.js → _114ylv7._.js} +3 -3
- package/.next/server/chunks/ssr/{_1k0spz7._.js → _12c-iwh._.js} +2 -2
- package/.next/server/chunks/ssr/_12w42gi._.js +1 -1
- package/.next/server/chunks/ssr/{_0eaog6_._.js → _167hchk._.js} +2 -2
- package/.next/server/chunks/ssr/{_1x9pskj._.js → _1_x5spz._.js} +3 -3
- package/.next/server/chunks/ssr/{_0dr-ddg._.js → _1a61fc9._.js} +2 -2
- package/.next/server/chunks/ssr/_1jmz33w._.js +1 -1
- package/.next/server/chunks/ssr/{_1y6b5mr._.js → _1w_t7h7._.js} +2 -2
- package/.next/server/chunks/ssr/{_0dh2e1j._.js → _1wyfaq_._.js} +7 -7
- package/.next/server/chunks/ssr/{[root-of-the-server]__0bxsfyn._.js → _200gt-m._.js} +4 -3
- package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +1 -1
- package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
- package/.next/server/chunks/ssr/{_0c9e5w6._.js → features_workspace_00jz2hu._.js} +3 -4
- package/.next/server/chunks/ssr/{node_modules_0746rzi._.js → node_modules_02ai7br._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0vsxbzp._.js → node_modules_02deexj._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1g1eihe._.js → node_modules_07za262._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0332gw4._.js → node_modules_0_s9get._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1gpednh._.js → node_modules_0n3c7h0._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0t-9nup._.js → node_modules_0od6jwr._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0mxvg8h._.js → node_modules_0rdt7pk._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0vv0-fg._.js → node_modules_0w1z7kz._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1d53yiq._.js → node_modules_0wdupfz._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1u6w1pb._.js → node_modules_1720w0a._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1gu1pph._.js → node_modules_18lsg7d._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1he1w8_._.js → node_modules_1b94fxf._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0qbfyjh._.js → node_modules_1ecdo1s._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0qapgjr._.js → node_modules_1fa9ag7._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0d5uzof._.js → node_modules_1fv-_si._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1lnjapm._.js → node_modules_1hf461g._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1-urho9._.js → node_modules_1m71ta-._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1lynj9m._.js → node_modules_1n93n-g._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0fr-ml8._.js → node_modules_1n9lqu9._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_04vxchl._.js → node_modules_1npnsvd._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0exkwcm._.js → node_modules_1rn2r0n._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_022sipm._.js → node_modules_1vq-mfk._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_00_51_v._.js → node_modules_1vzyw1t._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_0wsvp00._.js → node_modules_1w359w4._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_1xn6saw._.js → node_modules_1yajbl6._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_16pi_dd._.js → node_modules_20eqhy8._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_067_exa._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_019sbis._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0nrrdaq._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0s6piq3._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_@vercel_oidc_dist_21a5haa._.js → node_modules_@vercel_oidc_dist_05itbb1._.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 +43 -43
- package/.next/static/chunks/{0dr16v67vj4n7.js → 07vqbk_9t4em4.js} +2 -2
- package/.next/static/chunks/{2nvepds1fu2ux.js → 08krja1zx7nqg.js} +1 -1
- package/.next/static/chunks/{42wcg3wfg_m_p.js → 0qcuwdk132jjt.js} +1 -1
- package/.next/static/chunks/{2_pnccjp6j1ca.js → 0z69gvysmave7.js} +1 -1
- package/.next/static/chunks/12fvz1w5ows75.js +1 -0
- package/.next/static/chunks/14t03ned286iu.js +1 -0
- package/.next/static/chunks/{2jlz8zp4jax_m.js → 156xxbkrz5lzu.js} +1 -1
- package/.next/static/chunks/1fz14reod4lft.js +1 -0
- package/.next/static/chunks/{0joan-69kbspd.js → 1g23dbabl-vkr.js} +1 -1
- package/.next/static/chunks/{18mkhstgiqcbt.js → 1qy_rc3oxfxok.js} +1 -1
- package/.next/static/chunks/1zea7qdl-7365.js +1 -0
- package/.next/static/chunks/1zvqumkg7kmo0.css +1 -0
- package/.next/static/chunks/26hpqt3y6bogl.js +12 -0
- package/.next/static/chunks/{3zk6q3-3f9swq.js → 2_j5mqm6d-z18.js} +1 -1
- package/.next/static/chunks/{1vj_5bnbxx84e.js → 2dt6tu7a22svs.js} +1 -1
- package/.next/static/chunks/2h5ls3d86kya6.js +1 -0
- package/.next/static/chunks/2wc6y1ht6dfuy.js +1 -0
- package/.next/static/chunks/{1i-u2wzub_to1.js → 2xr0zpll7thyi.js} +6 -6
- package/.next/static/chunks/{26ql4y-43xwhp.js → 31jztc-yq30m7.js} +1 -1
- package/.next/static/chunks/391af0i8eljzk.js +1 -0
- package/.next/static/chunks/{1kp5nfp06nj9h.js → 3p2s2cjokx1aa.js} +2 -2
- package/.next/static/chunks/{1wlo979mx-y3w.js → 41s3fml5oivsa.js} +1 -1
- package/README.md +60 -19
- package/docs/how-it-works.md +2 -0
- package/docs/live-calls.md +38 -33
- package/features/ai/load-tools.ts +4 -2
- package/features/ai/prompts/bot.prompt.ts +5 -5
- package/features/ai/prompts/live.prompt.ts +36 -132
- package/features/ai/prompts/prompt-helper.ts +5 -4
- package/features/ai/prompts/thursday.prompt.ts +75 -54
- package/features/ai/tools/call.tool.ts +32 -4
- package/features/ai/tools/tool-name.ts +1 -0
- package/features/bot/bot.runner.ts +5 -5
- package/features/thursday/ascii.const.ts +74 -0
- package/features/thursday/components/ascii-orb.tsx +173 -30
- package/features/thursday/components/face.tsx +6 -1
- package/features/thursday/components/side-captions.tsx +273 -0
- package/features/thursday/components/tab-state.tsx +11 -3
- package/features/thursday/components/thursday-setting.tsx +6 -5
- package/features/thursday/components/thursday.tsx +227 -251
- package/features/thursday/face.store.ts +5 -0
- package/features/thursday/thursday.action.ts +4 -6
- package/features/thursday/thursday.schema.ts +10 -5
- package/features/thursday/thursday.store.ts +3 -0
- package/features/thursday/use-thursday.ts +461 -392
- package/features/workspace/file-kind.ts +9 -0
- package/hooks/use-hotkey.ts +3 -2
- package/lib/live/live.schema.ts +0 -21
- package/lib/live/live.server.ts +1 -3
- package/package.json +1 -1
- package/scripts/artifact-paths.test.mts +13 -0
- package/scripts/live-session.test.mts +56 -66
- package/.next/server/chunks/[root-of-the-server]__0g-ueei._.js +0 -8
- package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1kipdeo._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__172cq4x._.js +0 -3
- package/.next/server/chunks/ssr/_03_928f._.js +0 -3
- package/.next/server/chunks/ssr/_0g_rlog._.js +0 -3
- package/.next/server/chunks/ssr/_123ttsf._.js +0 -3
- package/.next/static/chunks/10k2xvap03z20.css +0 -1
- package/.next/static/chunks/1t9qms5pwwa3n.js +0 -1
- package/.next/static/chunks/2a51-ywz9b2a3.js +0 -1
- package/.next/static/chunks/2fvdgxih7x7hr.js +0 -1
- package/.next/static/chunks/3addj3i4-izma.js +0 -1
- package/.next/static/chunks/3gfh7nxwusbt0.js +0 -1
- package/.next/static/chunks/3gwa44cvz4qoi.js +0 -1
- package/.next/static/chunks/3zkg5iup3v4a2.js +0 -12
- package/.next/static/chunks/405m0bqtoihev.js +0 -1
- /package/.next/static/{0qzGoKn2wTERVZtblX1tp → yyRVBc0xxYQsh3GpbQX9b}/_buildManifest.js +0 -0
- /package/.next/static/{0qzGoKn2wTERVZtblX1tp → yyRVBc0xxYQsh3GpbQX9b}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{0qzGoKn2wTERVZtblX1tp → yyRVBc0xxYQsh3GpbQX9b}/_ssgManifest.js +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
module.exports=[159479,e=>e.a(async(t,n)=>{try{var a=e.i(847841),i=e.i(983477),r=e.i(687388),o=e.i(54282),s=e.i(316172),l=e.i(349047),c=e.i(926435),u=e.i(770639),h=e.i(489956),d=e.i(41181),m=e.i(353885),f=e.i(123203),w=e.i(944971),p=e.i(636882),g=e.i(22676),y=e.i(786025),b=e.i(704161),S=e.i(640911),T=e.i(53748),O=e.i(388439),v=e.i(41444),k=t([c,u,h,g]);async function M(t){let{listThreadOverview:n}=await e.A(866938),a=await n();if(!a.length)return"No jobs have been handed over yet.";let i=a.map(e=>`"${e.label}" (${e.bot}, ${e.status})`).join(", ");return`There is no job called "${t}". The latest are: ${i}. Call again with one of those names.`}async function $(e,t){let n=[];for(let[e,i]of Object.entries(t)){let t=await (0,a.asSchema)(i.inputSchema).jsonSchema,r="string"==typeof i.description?i.description:"";n.push({name:e,tokens:(0,O.estimateTokens)(r)+(0,O.estimateTokens)(JSON.stringify(t))})}n.sort((e,t)=>t.tokens-e.tokens);let i=n.reduce((e,t)=>e+t.tokens,0);S.logger.debug(`${e} tools ${i} tokens over ${n.length} — ${n.map(e=>`${e.name} ${e.tokens}`).join(", ")}`)}async function E(e){let t=await _(e);return r.IS_DEV&&await $(e.target,t),t}async function _(t){if("memory-edit"===t.target){let e=(0,u.createMemoryTools)("user",null,{countReads:!1});return{[m.TOOL_NAMES.memory_recall]:e[m.TOOL_NAMES.memory_recall],[m.TOOL_NAMES.memory_remember]:e[m.TOOL_NAMES.memory_remember],[m.TOOL_NAMES.memory_forget]:e[m.TOOL_NAMES.memory_forget]}}let{[m.TOOL_NAMES.memory_conversation]:n,...S}=(0,u.createMemoryTools)("call","thursday"===t.target?t.callId??null:null),O={[m.TOOL_NAMES.memory_conversation]:n},k=await (0,y.openWorkspace)();if("thursday"===t.target){var $;let n=await (0,g.readCallSkillsOn)()?(0,d.createSkillTools)({sandbox:k,skills:await (0,p.loadSkills)(k)}):{};return{...S,...O,...n,...(0,f.createWorkspaceTools)(k,{write:!1,timeoutMs:r.CALL_EXEC_TIMEOUT_MS}),...($=t.callId,{[m.TOOL_NAMES.delegate]:(0,a.tool)({description:s.delegateSpec.description,inputSchema:s.delegateSpec.parameters,execute:async({bot:t,request:n,label:a})=>{let{findJobBot:i,listJobBots:r}=await e.A(814317),o=await i(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 handed over — call again with one of those.`}let{startThread:s}=await e.A(994193);return{threadId:await s({bot:o.name,request:n,label:a,callId:$,from:"thursday"}),note:`${o.name} has "${a}". Its updates reach the conversation on their own. Anything further about this work — an answer, a correction, the next step once it finishes — is \`${m.TOOL_NAMES.thread}\` with "${a}".`}}}),[m.TOOL_NAMES.thread]:(0,a.tool)({description:s.threadSpec.description,inputSchema:s.threadSpec.parameters,execute:async({action:t,thread:n,answer:a,recipient:r,replyTo:s})=>{let l,{listThreadOverview:c,resolveThread:u}=await e.A(866938);if("status"===t){let t=a?.trim()?{note:"The text in `answer` was not passed on — `status` only reads. Send it again as `answer` if the bot is meant to hear it."}:{},r={now:(0,o.clockNow)()};if(n){let a=await u(n);if(!a)return await M(n);let{findThreadView:o}=await e.A(866938),s=(await o(a.id))?.room;return{...r,...t,label:a.label,id:a.id,bot:a.bot,participants:s?.participants??[],questions:s?.questions??[],status:a.status,since:(0,i.formatDistanceToNowStrict)((0,b.toDate)(a.updatedAt),{addSuffix:!0}),outcome:a.outcome,..."waiting"===a.status&&a.pending?.options.length?{options:a.pending.options}:{}}}let s=await c();return{...r,...t,threads:s.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,v.clip)(e.text,200)})),since:(0,i.formatDistanceToNowStrict)((0,b.toDate)(e.updatedAt),{addSuffix:!0}),...e.ask?{asking:e.ask.question,options:e.ask.options}:{},..."running"===e.status?{now:(0,w.threadActivity)(e.lines)}:{},...e.outcome&&"waiting"!==e.status?{outcome:(0,v.clip)(e.outcome,200)}:{}}))}}let{listInboxThreads:h,markSeen:d}=await e.A(866938),f=!n&&("answer"===t||"open"===t),p=f?await h():[],g="answer"===t?p.filter(e=>e.room.questions.length):[];if(g.length>1)return`Questions are waiting in more than one job: ${g.map(e=>`"${e.label}" (${e.room.questions.map(e=>e.bot).join(", ")})`).join(", ")}. Name the job.`;let y=n?await u(n):"answer"===t?g[0]??null:f?p[0]??null:null;if(!y)return n?await M(n):"answer"===t?`No question is waiting. Name the job this is for; \`${m.TOOL_NAMES.thread}\` \`status\` lists them.`:f?"No job has moved yet — say which one, or check `status` first.":"Say which job — by its label. Call `status` with no job named to see them.";if("open"===t){if(!(f?p:await h()).some(e=>e.id===y.id))return`"${y.label}" is older than the call screen keeps; it is under Settings › Threads.`;let{appEvents:t}=await e.A(522275);return t.emit({type:"showThread",threadId:y.id}),{label:y.label,open:!0}}if("seen"===t)return await d([y.id]),{label:y.label,seen:!0};let{answerThread:S,cancelThread:O}=await e.A(994193);if("cancel"===t)return await O(y.id),{label:y.label,status:"cancelled"};if(!a?.trim())return"Say what to pass on.";try{l=await S(y.id,a.trim(),"thursday",r??void 0,s??void 0)}catch(e){if((0,T.isPublicError)(e))return e.message;throw e}return l?.answered?{label:y.label,answered:l.answered,note:`${l.answered.bot} has the answer to its question and goes on from it.`}:{label:y.label,bot:l?.to??y.bot,status:"running",note:"running"===y.status?"The bot reads it before its next step.":"The bot picks the job back up from there."}}})}),...l.CALL_TOOLS}}let E=await (0,p.loadSkills)(k);return{[m.TOOL_NAMES.memory_recall]:S[m.TOOL_NAMES.memory_recall],...O,...await (0,h.createSearchTool)(t.model,k),...(0,f.createWorkspaceTools)(k,{write:!0,env:{...(0,y.jobShellEnv)(t.session),...(0,y.botShellEnv)(t.bot)},guide:!0,bot:t.bot}),...await (0,c.createMcpTools)(t.bot,k),...(0,d.createSkillTools)({sandbox:k,skills:E})}}[c,u,h,g]=k.then?(await k)():k,e.s(["loadTools",0,E]),n()}catch(e){n(e)}},!1),54282,e=>{"use strict";var t=e.i(343747),n=e.i(983477),a=e.i(687388),i=e.i(353885),r=e.i(704161),o=e.i(640911),s=e.i(388439);let l=(e=new Date)=>`${(0,t.format)(e,"yyyy-MM-dd (EEE) HH:mm")} ${Intl.DateTimeFormat().resolvedOptions().timeZone}`;i.STUDIO_TOOLS.generate_image,i.STUDIO_TOOLS.generate_speech,i.STUDIO_TOOLS.transcribe,i.STUDIO_TOOLS.generate_video,e.s(["callStamp",0,e=>`${(0,t.format)(e,"yyyy-MM-dd (EEE) HH:mm")} (${(0,n.formatDistanceToNowStrict)(e,{addSuffix:!0})})`,"clockNow",0,l,"conversationLines",0,e=>e.map(e=>"tool"===e.role?`you → ${e.tool??"tool"}`:`${"user"===e.role?"user":"you"}: ${e.text}`).join("\n"),"logPromptSize",0,function(e,t){let n=(0,s.sectionTokens)(t),i=n.reduce((e,t)=>e+t.tokens,0);o.logger.debug(`${e} prompt ${i} tokens — ${n.map(e=>`${e.name} ${e.tokens}`).join(", ")}`);let r=n[0];i>a.PROMPT_BUDGET&&r&&o.logger.warn(`${e} prompt is ${i} tokens, over ${a.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 n of e){let e=t.get(n.server);e?e.push(n.name):t.set(n.server,[n.name])}return[...t].map(([e,t])=>`- **${e}**: ${t.join(", ")}`).join("\n")},"noteLines",0,function(e,t=!1){return e.length?e.map(e=>{var n;let a,i=e.aliases?.length?` ${e.aliases.map(e=>`"${e}"`).join(" ")}`:"",o=t?` \xb7 ${n=e.lastSeenAt,(a=Math.floor((Date.now()-(0,r.toDate)(n).getTime())/864e5))>=365?`${Math.floor(a/365)}y`:a>=30?`${Math.floor(a/30)}mo`:`${Math.max(a,0)}d`}`:"";return`- ${e.path} — ${e.description?.trim()} (${e.factCount})${i}${o}`}).join("\n"):"(nothing saved yet)"},"nowLine",0,(e=new Date)=>`**Now**: ${l(e)}`,"saidStamp",0,e=>(0,t.format)(e,"yyyy-MM-dd (EEE) HH:mm"),"skillLines",0,(e,t={})=>e.map(e=>{var n;let i,r;return`- **${e.name}**: ${t.short?(n=e.description,i=a.PROMPT_LINE.skill,(r=n.trim().split(/(?<=[.。])\s|\n/)[0].trim()).length>i?`${r.slice(0,i).trim()}…`:r):e.description}`}).join("\n")])},316172,e=>{"use strict";var t=e.i(907855),n=e.i(687388),a=e.i(353885),i=e.i(944971),r=e.i(889034);let o={name:a.TOOL_NAMES.delegate,description:"Hand a job to a bot. Returns a receipt at once; the job runs in the background and its updates reach the conversation on their own.",parameters:t.object({bot:t.string().describe("A name from the bot list."),request:t.string().describe("The whole job. 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 a job 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:t.string().describe("Two or three words naming the job, in the user's language. Used on screen and said out loud.")})},s={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:r.RoomMessageSchema.extend({kind:r.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:r.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:t.string().trim().min(1).describe("Choose a bot from the roster, or Thursday to reach the user."),text:t.string().trim().min(1).describe("Write the message and include the context the recipient needs."),replyTo:t.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.")})},l={name:a.TOOL_NAMES.thread,description:`List up to ${n.THREAD_STATUS_LIMIT} jobs, prioritizing running and waiting work before recent endings; inspect one job, answer it, cancel it, open it on the user's screen, or mark it seen — the same as the user opening it, which takes it off the work waiting on them.`,parameters:t.object({action:t.enum(["status","answer","cancel","open","seen"]),recipient:t.string().nullish().describe("With answer, name the participant to receive it. Words to a participant waiting on its question answer that question; omit to reach the only open question, or the coordinator when none is open."),replyTo:t.string().nullish().describe("With answer, use the message ID of the question being answered when several questions are open."),thread:t.string().nullish().describe(`Identify the job by label or ID. With status, omit or use null to list up to ${n.THREAD_STATUS_LIMIT} jobs, prioritizing open work and filling remaining places with recent endings; name one to read its full result and pending questions. With open, omit to show the job that moved last. With answer, omit only to answer the one question waiting.`),answer:t.string().nullish().describe(`With \`answer\`: what to tell the bot — the answer to its question, a course correction for a job still running, or what to do next on one that finished. \`${i.THREAD_CONTINUE}\` carries on a job that stopped before finishing, from where it was.`)})};e.s(["delegateSpec",0,o,"sendMessageSpec",0,s,"threadSpec",0,l])},349047,e=>{"use strict";var t=e.i(847841),n=e.i(907855),a=e.i(353885);let i={name:a.TOOL_NAMES.end_call,description:`End the call.
|
|
1
|
+
module.exports=[159479,e=>e.a(async(t,n)=>{try{var a=e.i(847841),i=e.i(983477),r=e.i(687388),o=e.i(54282),s=e.i(316172),l=e.i(349047),c=e.i(926435),u=e.i(770639),h=e.i(489956),d=e.i(41181),m=e.i(353885),f=e.i(123203),w=e.i(944971),p=e.i(636882),g=e.i(22676),b=e.i(786025),y=e.i(704161),S=e.i(640911),T=e.i(53748),O=e.i(388439),v=e.i(41444),M=t([c,u,h,g]);async function k(t){let{listThreadOverview:n}=await e.A(866938),a=await n();if(!a.length)return"No jobs have been handed over yet.";let i=a.map(e=>`"${e.label}" (${e.bot}, ${e.status})`).join(", ");return`There is no job called "${t}". The latest are: ${i}. Call again with one of those names.`}async function $(e,t){let n=[];for(let[e,i]of Object.entries(t)){let t=await (0,a.asSchema)(i.inputSchema).jsonSchema,r="string"==typeof i.description?i.description:"";n.push({name:e,tokens:(0,O.estimateTokens)(r)+(0,O.estimateTokens)(JSON.stringify(t))})}n.sort((e,t)=>t.tokens-e.tokens);let i=n.reduce((e,t)=>e+t.tokens,0);S.logger.debug(`${e} tools ${i} tokens over ${n.length} — ${n.map(e=>`${e.name} ${e.tokens}`).join(", ")}`)}async function E(e){let t=await _(e);return r.IS_DEV&&await $(e.target,t),t}async function _(t){if("memory-edit"===t.target){let e=(0,u.createMemoryTools)("user",null,{countReads:!1});return{[m.TOOL_NAMES.memory_recall]:e[m.TOOL_NAMES.memory_recall],[m.TOOL_NAMES.memory_remember]:e[m.TOOL_NAMES.memory_remember],[m.TOOL_NAMES.memory_forget]:e[m.TOOL_NAMES.memory_forget]}}let{[m.TOOL_NAMES.memory_conversation]:n,...S}=(0,u.createMemoryTools)("call","thursday"===t.target?t.callId??null:null),O={[m.TOOL_NAMES.memory_conversation]:n},M=await (0,b.openWorkspace)();if("thursday"===t.target){var $;let n=await (0,g.readCallSkillsOn)()?(0,d.createSkillTools)({sandbox:M,skills:await (0,p.loadSkills)(M)}):{};return{...S,...O,...n,...(0,f.createWorkspaceTools)(M,{write:!1,timeoutMs:r.CALL_EXEC_TIMEOUT_MS}),...($=t.callId,{[m.TOOL_NAMES.delegate]:(0,a.tool)({description:s.delegateSpec.description,inputSchema:s.delegateSpec.parameters,execute:async({bot:t,request:n,label:a})=>{let{findJobBot:i,listJobBots:r}=await e.A(814317),o=await i(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 handed over — call again with one of those.`}let{startThread:s}=await e.A(994193);return{threadId:await s({bot:o.name,request:n,label:a,callId:$,from:"thursday"}),note:`${o.name} has "${a}". Its updates reach the conversation on their own. Anything further about this work — an answer, a correction, the next step once it finishes — is \`${m.TOOL_NAMES.thread}\` with "${a}".`}}}),[m.TOOL_NAMES.thread]:(0,a.tool)({description:s.threadSpec.description,inputSchema:s.threadSpec.parameters,execute:async({action:t,thread:n,answer:a,recipient:r,replyTo:s})=>{let l,{listThreadOverview:c,resolveThread:u}=await e.A(866938);if("status"===t){let t=a?.trim()?{note:"The text in `answer` was not passed on — `status` only reads. Send it again as `answer` if the bot is meant to hear it."}:{},r={now:(0,o.clockNow)()};if(n){let a=await u(n);if(!a)return await k(n);let{findThreadView:o}=await e.A(866938),s=(await o(a.id))?.room;return{...r,...t,label:a.label,id:a.id,bot:a.bot,participants:s?.participants??[],questions:s?.questions??[],status:a.status,since:(0,i.formatDistanceToNowStrict)((0,y.toDate)(a.updatedAt),{addSuffix:!0}),outcome:a.outcome,..."waiting"===a.status&&a.pending?.options.length?{options:a.pending.options}:{}}}let s=await c();return{...r,...t,threads:s.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,v.clip)(e.text,200)})),since:(0,i.formatDistanceToNowStrict)((0,y.toDate)(e.updatedAt),{addSuffix:!0}),...e.ask?{asking:e.ask.question,options:e.ask.options}:{},..."running"===e.status?{now:(0,w.threadActivity)(e.lines)}:{},...e.outcome&&"waiting"!==e.status?{outcome:(0,v.clip)(e.outcome,200)}:{}}))}}let{listInboxThreads:h,markSeen:d}=await e.A(866938),f=!n&&("answer"===t||"open"===t),p=f?await h():[],g="answer"===t?p.filter(e=>e.room.questions.length):[];if(g.length>1)return`Questions are waiting in more than one job: ${g.map(e=>`"${e.label}" (${e.room.questions.map(e=>e.bot).join(", ")})`).join(", ")}. Name the job.`;let b=n?await u(n):"answer"===t?g[0]??null:f?p[0]??null:null;if(!b)return n?await k(n):"answer"===t?`No question is waiting. Name the job this is for; \`${m.TOOL_NAMES.thread}\` \`status\` lists them.`:f?"No job has moved yet — say which one, or check `status` first.":"Say which job — by its label. Call `status` with no job named to see them.";if("open"===t){if(!(f?p:await h()).some(e=>e.id===b.id))return`"${b.label}" is older than the call screen keeps; it is under Settings › Threads.`;let{appEvents:t}=await e.A(522275);return t.emit({type:"showThread",threadId:b.id}),{label:b.label,open:!0}}if("seen"===t)return await d([b.id]),{label:b.label,seen:!0};let{answerThread:S,cancelThread:O}=await e.A(994193);if("cancel"===t)return await O(b.id),{label:b.label,status:"cancelled"};if(!a?.trim())return"Say what to pass on.";try{l=await S(b.id,a.trim(),"thursday",r??void 0,s??void 0)}catch(e){if((0,T.isPublicError)(e))return e.message;throw e}return l?.answered?{label:b.label,answered:l.answered,note:`${l.answered.bot} has the answer to its question and goes on from it.`}:{label:b.label,bot:l?.to??b.bot,status:"running",note:"running"===b.status?"The bot reads it before its next step.":"The bot picks the job back up from there."}}})}),...(0,l.callTools)(t.faceWords??!1)}}let E=await (0,p.loadSkills)(M);return{[m.TOOL_NAMES.memory_recall]:S[m.TOOL_NAMES.memory_recall],...O,...await (0,h.createSearchTool)(t.model,M),...(0,f.createWorkspaceTools)(M,{write:!0,env:{...(0,b.jobShellEnv)(t.session),...(0,b.botShellEnv)(t.bot)},guide:!0,bot:t.bot}),...await (0,c.createMcpTools)(t.bot,M),...(0,d.createSkillTools)({sandbox:M,skills:E})}}[c,u,h,g]=M.then?(await M)():M,e.s(["loadTools",0,E]),n()}catch(e){n(e)}},!1),54282,e=>{"use strict";var t=e.i(343747),n=e.i(983477),a=e.i(687388),i=e.i(353885),r=e.i(704161),o=e.i(640911),s=e.i(388439);let l=(e=new Date)=>`${(0,t.format)(e,"yyyy-MM-dd (EEE) HH:mm")} ${Intl.DateTimeFormat().resolvedOptions().timeZone}`;i.STUDIO_TOOLS.generate_image,i.STUDIO_TOOLS.generate_speech,i.STUDIO_TOOLS.transcribe,i.STUDIO_TOOLS.generate_video,e.s(["callStamp",0,e=>`${(0,t.format)(e,"yyyy-MM-dd (EEE) HH:mm")} (${(0,n.formatDistanceToNowStrict)(e,{addSuffix:!0})})`,"clockNow",0,l,"conversationLines",0,e=>e.map(e=>"tool"===e.role?`you → ${e.tool??"tool"}`:`${"user"===e.role?"user":"you"}: ${e.text}`).join("\n"),"logPromptSize",0,function(e,t){let n=(0,s.sectionTokens)(t),i=n.reduce((e,t)=>e+t.tokens,0);o.logger.debug(`${e} prompt ${i} tokens — ${n.map(e=>`${e.name} ${e.tokens}`).join(", ")}`);let r=n[0];i>a.PROMPT_BUDGET&&r&&o.logger.warn(`${e} prompt is ${i} tokens, over ${a.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 n of e){let e=t.get(n.server);e?e.push(n.name):t.set(n.server,[n.name])}return[...t].map(([e,t])=>`- **${e}**: ${t.join(", ")}`).join("\n")},"noteLines",0,function(e,t=!1){return e.length?e.map(e=>{var n;let a,i=e.aliases?.length?` ${e.aliases.map(e=>`"${e}"`).join(" ")}`:"",o=t?` \xb7 ${n=e.lastSeenAt,(a=Math.floor((Date.now()-(0,r.toDate)(n).getTime())/864e5))>=365?`${Math.floor(a/365)}y`:a>=30?`${Math.floor(a/30)}mo`:`${Math.max(a,0)}d`}`:"";return`- ${e.path} — ${e.description?.trim()} (${e.factCount})${i}${o}`}).join("\n"):"(nothing saved yet)"},"nowLine",0,(e=new Date)=>`**Now**: ${l(e)}`,"saidStamp",0,e=>(0,t.format)(e,"yyyy-MM-dd (EEE) HH:mm"),"skillLines",0,(e,t={})=>e.map(e=>{var n;let i,r;return`- **${e.name}**: ${t.short?(n=e.description,i=a.PROMPT_LINE.skill,(r=n.trim().split(/(?<=[.。])\s|\n/)[0].trim()).length>i?`${r.slice(0,i).trim()}…`:r):e.description}`}).join("\n")])},316172,e=>{"use strict";var t=e.i(907855),n=e.i(687388),a=e.i(353885),i=e.i(944971),r=e.i(889034);let o={name:a.TOOL_NAMES.delegate,description:"Hand a job to a bot. Returns a receipt at once; the job runs in the background and its updates reach the conversation on their own.",parameters:t.object({bot:t.string().describe("A name from the bot list."),request:t.string().describe("The whole job. 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 a job 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:t.string().describe("Two or three words naming the job, in the user's language. Used on screen and said out loud.")})},s={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:r.RoomMessageSchema.extend({kind:r.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:r.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:t.string().trim().min(1).describe("Choose a bot from the roster, or Thursday to reach the user."),text:t.string().trim().min(1).describe("Write the message and include the context the recipient needs."),replyTo:t.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.")})},l={name:a.TOOL_NAMES.thread,description:`List up to ${n.THREAD_STATUS_LIMIT} jobs, prioritizing running and waiting work before recent endings; inspect one job, answer it, cancel it, open it on the user's screen, or mark it seen — the same as the user opening it, which takes it off the work waiting on them.`,parameters:t.object({action:t.enum(["status","answer","cancel","open","seen"]),recipient:t.string().nullish().describe("With answer, name the participant to receive it. Words to a participant waiting on its question answer that question; omit to reach the only open question, or the coordinator when none is open."),replyTo:t.string().nullish().describe("With answer, use the message ID of the question being answered when several questions are open."),thread:t.string().nullish().describe(`Identify the job by label or ID. With status, omit or use null to list up to ${n.THREAD_STATUS_LIMIT} jobs, prioritizing open work and filling remaining places with recent endings; name one to read its full result and pending questions. With open, omit to show the job that moved last. With answer, omit only to answer the one question waiting.`),answer:t.string().nullish().describe(`With \`answer\`: what to tell the bot — the answer to its question, a course correction for a job still running, or what to do next on one that finished. \`${i.THREAD_CONTINUE}\` carries on a job that stopped before finishing, from where it was.`)})};e.s(["delegateSpec",0,o,"sendMessageSpec",0,s,"threadSpec",0,l])},349047,e=>{"use strict";var t=e.i(847841),n=e.i(907855),a=e.i(353885);let i=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={name:a.TOOL_NAMES.end_call,description:`End the call.
|
|
2
2
|
|
|
3
|
-
The line stays open until this runs, and drops once the goodbye being said is over.`,parameters:n.object({})},r=(0,t.tool)({description:i.description,inputSchema:i.parameters}),o={[a.TOOL_NAMES.end_call]:r};e.s(["CALL_TOOLS",0,o])},926435,e=>e.a(async(t,n)=>{try{var a=e.i(847841),i=e.i(907855),r=e.i(353885),o=e.i(148831),s=e.i(786025),l=e.i(660948),c=t([o,l]);[o,l]=c.then?(await c)():c;let d={[r.TOOL_NAMES.tool_search]:{name: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:i.object({server:i.string().describe("A server name, exactly as the Connected tools section writes it."),tools:i.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]:{name:r.TOOL_NAMES.tool_call,description:`Run one tool whose definition came back from \`${r.TOOL_NAMES.tool_search}\`.`,parameters:i.object({server:i.string().describe("The server the tool lives on."),tool:i.string().describe("Its name, as search returned it."),args:i.record(i.string(),i.unknown()).nullish().describe("Arguments matching the inputSchema search returned — do not guess. Null when it takes none."),description:i.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 u(e,t){let[n,i]=await Promise.all([(0,l.listConnectedToolNames)(),(0,o.findPinnedTools)(e)]),r={},c=(0,s.botArtifacts)(e);for(let e of i){let n=m(e.server,e.name);r[n]||(r[n]=(0,a.tool)({description:e.description??`${e.name} on the ${e.server} server.`,inputSchema:(0,a.jsonSchema)(e.inputSchema??{type:"object",properties:{}}),execute:(n,{abortSignal:a})=>(0,l.callConnectedTool)(t,e.server,e.name,n??void 0,{artifacts:c,abortSignal:a})}))}return n.length>i.length&&Object.assign(r,f(t,c)),r}async function h(e){let t=(await (0,l.listConnectedToolNames)(e)).map(e=>e.name);if(t.length)return`Tools on "${e}": ${t.join(", ")}.`;let n=await (0,l.listConnectedServerNames)();return n.length?`There is no server called "${e}". Connected: ${n.join(", ")}.`:"Nothing is connected."}let f=(e,t)=>({[r.TOOL_NAMES.tool_search]:(0,a.tool)({description:d[r.TOOL_NAMES.tool_search].description,inputSchema:d[r.TOOL_NAMES.tool_search].parameters,execute:async({server:e,tools:t})=>{let n=[...new Set(t.map(e=>e.trim()).filter(Boolean))],a=n.slice(0,8),i=await (0,l.findConnectedSchemas)(e.trim(),a);if(!i.length)return{tools:[],note:await h(e)};let r=a.filter(e=>!i.some(t=>t.name===e)),o=n.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:i,...s.length?{note:s.join(" ")}:{}}}}),[r.TOOL_NAMES.tool_call]:(0,a.tool)({description:d[r.TOOL_NAMES.tool_call].description,inputSchema:d[r.TOOL_NAMES.tool_call].parameters,execute:async({server:n,tool:a,args:i},{abortSignal:r})=>(await (0,l.listConnectedToolNames)(n.trim())).some(e=>e.name===a.trim())?(0,l.callConnectedTool)(e,n.trim(),a.trim(),i??void 0,{artifacts:t,abortSignal:r}):{status:"error",text:await h(n)}})});e.s(["createMcpTools",0,u]),n()}catch(e){n(e)}},!1),770639,e=>e.a(async(t,n)=>{try{var a=e.i(847841),i=e.i(907855),r=e.i(687388),o=e.i(54282),s=e.i(353885),l=e.i(619898),c=e.i(453569),u=e.i(22676),h=t([l,u]);[l,u]=h.then?(await h)():h;let d=c.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}),f=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:n=!0}={})=>({[s.TOOL_NAMES.memory_recall]:(0,a.tool)({description:"Open one note from the listing, whole.",inputSchema:i.object({path:i.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:n}),a=t[0];if(!a)return{note:`Nothing on the listing called ${e.trim()}.`};let i=w(a.facts.length);return i?{...m(a),note:i.trim()}:m(a)}}),[s.TOOL_NAMES.memory_remember]:(0,a.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:i.object({path:i.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:i.object({text:i.string().describe('One statement that stands on its own later — a date as a date, never "next week".'),replaces:i.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:i.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:i.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; ${c.MEMORY_ALWAYS_LISTED.join(", ")} keep their own line.`),aliases:i.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 n=>{let a=n.path.trim(),i=await (0,l.resolveNotePath)(a),o=n.aliases??null,s=i??a,u=(0,c.isAlwaysListed)(s)?(0,c.appNoteLine)(s):n.description?.trim()||null,h=n.facts??[];if(!h.length&&!u&&!o)return{note:"Nothing to write: send facts, a line, names, or any of them."};if(!i&&!(0,c.isMemoryPath)(a))return{note:`Nothing was saved: "${a}" is not a path this listing can carry. Write it again under one of ${d}.`};if(!i&&!h.length)return{note:`Nothing on the listing called ${a}. A note comes into being with a fact — send at least one.`};let f=await (0,l.writeNotes)([{path:s,description:u,aliases:o,facts:h}],e,t),p=f.unnamed.length?` ${f.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=f.notLoaded.length?` All ${r.MEMORY_LIMITS.carried} carried lines are taken, so ${f.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(f.notes[0]),b=i&&h.length&&!u?` 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.${p}${g}${b}${w(y.factCount)}`}}}),[s.TOOL_NAMES.memory_conversation]:(0,a.tool)({description:"Open the conversation a fact was saved in, whole: what each side said, and which tools were used.",inputSchema:i.object({factId:i.number().int().describe("The id that came with the fact when its note was opened."),page:i.number().int().min(1).nullish().describe(`${r.MEMORY_CONVERSATION_PAGE} turns a page, oldest first. Null for the first.`)}),execute:async({factId:e,page:n})=>{let a=await (0,l.findFactCall)(e);if(!a)return{note:`No fact with id ${e}.`};if(!a.callId)return{note:f(a.source)};if(a.callId===t)return{note:"Said in this call — it is the conversation you are in."};let i=n??1,s=await (0,u.readCallConversation)(a.callId,i,r.MEMORY_CONVERSATION_PAGE);if(!s)return{note:f(a.source)};let c=Math.max(1,Math.ceil(s.total/r.MEMORY_CONVERSATION_PAGE));return i>c?{note:`That conversation has ${c} page${c>1?"s":""}.`}:{when:(0,o.callStamp)(s.startedAt),page:i,pages:c,conversation:(0,o.conversationLines)(s.turns)}}}),[s.TOOL_NAMES.memory_forget]:(0,a.tool)({description:"Delete facts for good.",inputSchema:i.object({factIds:i.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=[],n=[],a=new Set;for(let i of new Set(e)){let e=await (0,l.forgetFactById)(i);if(!e){t.push(i);continue}e.noteGone?(a.delete(e.path),n.push(e.path)):a.add(e.path)}if(!n.length&&!a.size)return{note:`No fact with id ${t.join(", ")}. Nothing was deleted.`};let i=["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===n.length?`That was the last fact under ${n[0]}, so the note went with it.`:n.length?`That was the last of ${n.join(", ")}, so those notes went with them.`:"",t.length?`No fact with id ${t.join(", ")}, so those were skipped.`:""].filter(Boolean).join(" ");if(!a.size)return{note:i};let{notes:r}=await (0,l.readNotes)([...a],{touch:!1});return{notes:r.map(m),note:i}}})})]),n()}catch(e){n(e)}},!1),489956,e=>e.a(async(t,n)=>{try{var a=e.i(68356),i=e.i(847841),r=e.i(105249),o=e.i(687388),s=e.i(353885),l=e.i(279041),c=e.i(340698),u=e.i(41444),h=t([c]);[c]=h.then?(await h)():h;let f=`Answer the question from the web. Lead with the answer, then
|
|
3
|
+
The line stays open until this runs, and drops once the goodbye being said is over.`,parameters:n.object({})},o=(0,t.tool)({description:r.description,inputSchema:r.parameters}),s={name:a.TOOL_NAMES.emote,description:"Show a short word on your face for a few seconds.",parameters:n.object({text:n.string().describe(`Up to 8 characters: A-Z, 0-9, space and ${i.join(" ")}.`)})},l=(0,t.tool)({description:s.description,inputSchema:s.parameters});e.s(["callTools",0,function(e){return{[a.TOOL_NAMES.end_call]:o,...e?{[a.TOOL_NAMES.emote]:l}:{}}}],349047)},926435,e=>e.a(async(t,n)=>{try{var a=e.i(847841),i=e.i(907855),r=e.i(353885),o=e.i(148831),s=e.i(786025),l=e.i(660948),c=t([o,l]);[o,l]=c.then?(await c)():c;let d={[r.TOOL_NAMES.tool_search]:{name: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:i.object({server:i.string().describe("A server name, exactly as the Connected tools section writes it."),tools:i.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]:{name:r.TOOL_NAMES.tool_call,description:`Run one tool whose definition came back from \`${r.TOOL_NAMES.tool_search}\`.`,parameters:i.object({server:i.string().describe("The server the tool lives on."),tool:i.string().describe("Its name, as search returned it."),args:i.record(i.string(),i.unknown()).nullish().describe("Arguments matching the inputSchema search returned — do not guess. Null when it takes none."),description:i.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 u(e,t){let[n,i]=await Promise.all([(0,l.listConnectedToolNames)(),(0,o.findPinnedTools)(e)]),r={},c=(0,s.botArtifacts)(e);for(let e of i){let n=m(e.server,e.name);r[n]||(r[n]=(0,a.tool)({description:e.description??`${e.name} on the ${e.server} server.`,inputSchema:(0,a.jsonSchema)(e.inputSchema??{type:"object",properties:{}}),execute:(n,{abortSignal:a})=>(0,l.callConnectedTool)(t,e.server,e.name,n??void 0,{artifacts:c,abortSignal:a})}))}return n.length>i.length&&Object.assign(r,f(t,c)),r}async function h(e){let t=(await (0,l.listConnectedToolNames)(e)).map(e=>e.name);if(t.length)return`Tools on "${e}": ${t.join(", ")}.`;let n=await (0,l.listConnectedServerNames)();return n.length?`There is no server called "${e}". Connected: ${n.join(", ")}.`:"Nothing is connected."}let f=(e,t)=>({[r.TOOL_NAMES.tool_search]:(0,a.tool)({description:d[r.TOOL_NAMES.tool_search].description,inputSchema:d[r.TOOL_NAMES.tool_search].parameters,execute:async({server:e,tools:t})=>{let n=[...new Set(t.map(e=>e.trim()).filter(Boolean))],a=n.slice(0,8),i=await (0,l.findConnectedSchemas)(e.trim(),a);if(!i.length)return{tools:[],note:await h(e)};let r=a.filter(e=>!i.some(t=>t.name===e)),o=n.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:i,...s.length?{note:s.join(" ")}:{}}}}),[r.TOOL_NAMES.tool_call]:(0,a.tool)({description:d[r.TOOL_NAMES.tool_call].description,inputSchema:d[r.TOOL_NAMES.tool_call].parameters,execute:async({server:n,tool:a,args:i},{abortSignal:r})=>(await (0,l.listConnectedToolNames)(n.trim())).some(e=>e.name===a.trim())?(0,l.callConnectedTool)(e,n.trim(),a.trim(),i??void 0,{artifacts:t,abortSignal:r}):{status:"error",text:await h(n)}})});e.s(["createMcpTools",0,u]),n()}catch(e){n(e)}},!1),770639,e=>e.a(async(t,n)=>{try{var a=e.i(847841),i=e.i(907855),r=e.i(687388),o=e.i(54282),s=e.i(353885),l=e.i(619898),c=e.i(453569),u=e.i(22676),h=t([l,u]);[l,u]=h.then?(await h)():h;let d=c.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}),f=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:n=!0}={})=>({[s.TOOL_NAMES.memory_recall]:(0,a.tool)({description:"Open one note from the listing, whole.",inputSchema:i.object({path:i.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:n}),a=t[0];if(!a)return{note:`Nothing on the listing called ${e.trim()}.`};let i=w(a.facts.length);return i?{...m(a),note:i.trim()}:m(a)}}),[s.TOOL_NAMES.memory_remember]:(0,a.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:i.object({path:i.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:i.object({text:i.string().describe('One statement that stands on its own later — a date as a date, never "next week".'),replaces:i.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:i.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:i.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; ${c.MEMORY_ALWAYS_LISTED.join(", ")} keep their own line.`),aliases:i.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 n=>{let a=n.path.trim(),i=await (0,l.resolveNotePath)(a),o=n.aliases??null,s=i??a,u=(0,c.isAlwaysListed)(s)?(0,c.appNoteLine)(s):n.description?.trim()||null,h=n.facts??[];if(!h.length&&!u&&!o)return{note:"Nothing to write: send facts, a line, names, or any of them."};if(!i&&!(0,c.isMemoryPath)(a))return{note:`Nothing was saved: "${a}" is not a path this listing can carry. Write it again under one of ${d}.`};if(!i&&!h.length)return{note:`Nothing on the listing called ${a}. A note comes into being with a fact — send at least one.`};let f=await (0,l.writeNotes)([{path:s,description:u,aliases:o,facts:h}],e,t),p=f.unnamed.length?` ${f.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=f.notLoaded.length?` All ${r.MEMORY_LIMITS.carried} carried lines are taken, so ${f.notLoaded.map(e=>`"${e}"`).join(", ")} saved as an ordinary fact. Say which carried line you would drop for it and let them choose.`:"",b=m(f.notes[0]),y=i&&h.length&&!u?` Its line still reads "${b.description}"; if that no longer says what the note holds, send \`description\`.`:"";return{...b,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.${p}${g}${y}${w(b.factCount)}`}}}),[s.TOOL_NAMES.memory_conversation]:(0,a.tool)({description:"Open the conversation a fact was saved in, whole: what each side said, and which tools were used.",inputSchema:i.object({factId:i.number().int().describe("The id that came with the fact when its note was opened."),page:i.number().int().min(1).nullish().describe(`${r.MEMORY_CONVERSATION_PAGE} turns a page, oldest first. Null for the first.`)}),execute:async({factId:e,page:n})=>{let a=await (0,l.findFactCall)(e);if(!a)return{note:`No fact with id ${e}.`};if(!a.callId)return{note:f(a.source)};if(a.callId===t)return{note:"Said in this call — it is the conversation you are in."};let i=n??1,s=await (0,u.readCallConversation)(a.callId,i,r.MEMORY_CONVERSATION_PAGE);if(!s)return{note:f(a.source)};let c=Math.max(1,Math.ceil(s.total/r.MEMORY_CONVERSATION_PAGE));return i>c?{note:`That conversation has ${c} page${c>1?"s":""}.`}:{when:(0,o.callStamp)(s.startedAt),page:i,pages:c,conversation:(0,o.conversationLines)(s.turns)}}}),[s.TOOL_NAMES.memory_forget]:(0,a.tool)({description:"Delete facts for good.",inputSchema:i.object({factIds:i.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=[],n=[],a=new Set;for(let i of new Set(e)){let e=await (0,l.forgetFactById)(i);if(!e){t.push(i);continue}e.noteGone?(a.delete(e.path),n.push(e.path)):a.add(e.path)}if(!n.length&&!a.size)return{note:`No fact with id ${t.join(", ")}. Nothing was deleted.`};let i=["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===n.length?`That was the last fact under ${n[0]}, so the note went with it.`:n.length?`That was the last of ${n.join(", ")}, so those notes went with them.`:"",t.length?`No fact with id ${t.join(", ")}, so those were skipped.`:""].filter(Boolean).join(" ");if(!a.size)return{note:i};let{notes:r}=await (0,l.readNotes)([...a],{touch:!1});return{notes:r.map(m),note:i}}})})]),n()}catch(e){n(e)}},!1),489956,e=>e.a(async(t,n)=>{try{var a=e.i(68356),i=e.i(847841),r=e.i(105249),o=e.i(687388),s=e.i(353885),l=e.i(279041),c=e.i(340698),u=e.i(41444),h=t([c]);[c]=h.then?(await h)():h;let f=`Answer the question from the web. Lead with the answer, then
|
|
4
4
|
what supports it. Say plainly what you could not find or confirm — do not fill
|
|
5
5
|
the gap with a guess. Every number carries the date you saw it. Be brief: this
|
|
6
6
|
is read by another model, not by a person.`,w=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 d(e,t,n){let a=await fetch("https://api.exa.ai/search",{method:"POST",signal:n,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(!a.ok)return`Exa answered ${a.status}: ${(0,u.clip)((await a.text()).trim(),200)}`;let i=(await a.json()).results??[];return i.length?i.map(e=>{let t=[e.title?.trim(),e.url?.trim()].filter(Boolean).join(" — "),n=e.publishedDate?.slice(0,10);return[n?`${t} \xb7 ${n}`:t,e.text?.trim()].filter(Boolean).join("\n")}).join("\n\n"):"Nothing came back for that. Try other words, or open a page in the browser."}async function m(e,t,n){let{text:i,sources:r}=await (0,a.generateText)({model:e.model,tools:e.tools,system:f,prompt:t,abortSignal:n}),s=[...new Set(r.flatMap(e=>"url"===e.sourceType?[e.title?`${e.title} — ${e.url}`:e.url]:[]))].slice(0,o.SEARCH.sources);return[i.trim(),s.length?`Sources:
|
|
7
|
-
${s.join("\n")}`:""].filter(Boolean).join("\n\n")}let p=async(e,t)=>{let n=await (0,c.readConfig)(l.EXA_API_KEY),a=e?.searchTools?{model:e.model,tools:e.searchTools}:null,h=n?(e,t)=>d(n,e,t):a?(e,t)=>m(a,e,t):null;return h?{[s.TOOL_NAMES.web_search]:(0,i.tool)({description:"Search the web and get back what the pages say, with their links. For a fact, a price, a date, what a page says. Not for a page that has to be clicked, filled, or signed into — that is the browser.",inputSchema:r.default.object({query:w}),execute:async({query:e},{abortSignal:n})=>{let a=AbortSignal.timeout(o.SEARCH.timeoutMs),i=n?AbortSignal.any([n,a]):a,r=await h(e,i).catch(e=>{if(n?.aborted)throw e;return a.aborted?`The search did not come back in ${o.SEARCH.timeoutMs/1e3}s. Ask something narrower, or open the page in the browser.`:`Search failed: ${(0,u.errorToString)(e)}. The browser is the other way in.`});return t.fold(r,"web-search")}})}:{}};e.s(["createSearchTool",0,p]),n()}catch(e){n(e)}},!1),41181,e=>{"use strict";var t=e.i(847841),n=e.i(105249),a=e.i(353885),i=e.i(636882),r=e.i(696968);e.s(["createSkillTools",0,({skills:e,sandbox:o})=>({[a.TOOL_NAMES.load_skill]:(0,t.tool)({description:"Load one skill: its instructions, and the files that ship with it.",inputSchema:n.default.object({name:n.default.string().describe("Exact name from the Skills list, or of a skill installed during this job. Do not guess names.")}),execute:async({name:t},{messages:n})=>{let s=e=>e.find(e=>e.name.toLowerCase()===t.toLowerCase()),l=s(e)?e:await (0,i.loadSkills)(o),c=s(l);if(!c)return{error:`No skill named '${t}'.`,available:l.map(e=>e.name)};let u=`${c.path}/SKILL.md`;if(n.some(e=>Array.isArray(e.content)&&e.content.some(e=>{if("tool-result"!==e.type||e.toolName!==a.TOOL_NAMES.load_skill||"json"!==e.output.type)return!1;let t=e.output.value;return t?.skillDirectory===c.path&&"string"==typeof t.content})))return{skillDirectory:c.path,note:`Use the full '${c.name}' instructions already in your conversation. To check for changes on disk, read ${u} with the shell.`};let h=await o.readFile(u,"utf-8"),{body:d}=(0,r.splitFrontmatter)(h),m=await o.glob("**/*",{path:c.path,limit:50});return{skillDirectory:c.path,files:m,content:d}}})})])},741376,e=>e.a(async(t,n)=>{try{var a=e.i(912714),i=e.i(750227),r=e.i(68356),o=e.i(343747),s=e.i(105249),l=e.i(386075),c=e.i(353885),u=e.i(640911),h=e.i(41444),d=t([l]);function m(e){return{...e,execute:(t,n)=>{let a=e.inputSchema.safeParse(t);if(!a.success)throw Error(s.default.prettifyError(a.error));return e.execute(a.data,n)}}}function f(e,t){let n=e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,40),a=(0,o.format)(new Date,"yyyyMMdd-HHmmss");return`${a}${n?`-${n}`:""}.${t}`}async function w(e,t,n,a){let i=`${t}/${n}`;return await e.exec(`mkdir -p ${t}`),await e.writeFile(i,Buffer.from(a)),i}[l]=d.then?(await d)():d;let
|
|
8
|
-
Saved. Give the user this path — the file opens from the thread row. Do not describe it back to them; they can open it.`,
|
|
7
|
+
${s.join("\n")}`:""].filter(Boolean).join("\n\n")}let p=async(e,t)=>{let n=await (0,c.readConfig)(l.EXA_API_KEY),a=e?.searchTools?{model:e.model,tools:e.searchTools}:null,h=n?(e,t)=>d(n,e,t):a?(e,t)=>m(a,e,t):null;return h?{[s.TOOL_NAMES.web_search]:(0,i.tool)({description:"Search the web and get back what the pages say, with their links. For a fact, a price, a date, what a page says. Not for a page that has to be clicked, filled, or signed into — that is the browser.",inputSchema:r.default.object({query:w}),execute:async({query:e},{abortSignal:n})=>{let a=AbortSignal.timeout(o.SEARCH.timeoutMs),i=n?AbortSignal.any([n,a]):a,r=await h(e,i).catch(e=>{if(n?.aborted)throw e;return a.aborted?`The search did not come back in ${o.SEARCH.timeoutMs/1e3}s. Ask something narrower, or open the page in the browser.`:`Search failed: ${(0,u.errorToString)(e)}. The browser is the other way in.`});return t.fold(r,"web-search")}})}:{}};e.s(["createSearchTool",0,p]),n()}catch(e){n(e)}},!1),41181,e=>{"use strict";var t=e.i(847841),n=e.i(105249),a=e.i(353885),i=e.i(636882),r=e.i(696968);e.s(["createSkillTools",0,({skills:e,sandbox:o})=>({[a.TOOL_NAMES.load_skill]:(0,t.tool)({description:"Load one skill: its instructions, and the files that ship with it.",inputSchema:n.default.object({name:n.default.string().describe("Exact name from the Skills list, or of a skill installed during this job. Do not guess names.")}),execute:async({name:t},{messages:n})=>{let s=e=>e.find(e=>e.name.toLowerCase()===t.toLowerCase()),l=s(e)?e:await (0,i.loadSkills)(o),c=s(l);if(!c)return{error:`No skill named '${t}'.`,available:l.map(e=>e.name)};let u=`${c.path}/SKILL.md`;if(n.some(e=>Array.isArray(e.content)&&e.content.some(e=>{if("tool-result"!==e.type||e.toolName!==a.TOOL_NAMES.load_skill||"json"!==e.output.type)return!1;let t=e.output.value;return t?.skillDirectory===c.path&&"string"==typeof t.content})))return{skillDirectory:c.path,note:`Use the full '${c.name}' instructions already in your conversation. To check for changes on disk, read ${u} with the shell.`};let h=await o.readFile(u,"utf-8"),{body:d}=(0,r.splitFrontmatter)(h),m=await o.glob("**/*",{path:c.path,limit:50});return{skillDirectory:c.path,files:m,content:d}}})})])},741376,e=>e.a(async(t,n)=>{try{var a=e.i(912714),i=e.i(750227),r=e.i(68356),o=e.i(343747),s=e.i(105249),l=e.i(386075),c=e.i(353885),u=e.i(640911),h=e.i(41444),d=t([l]);function m(e){return{...e,execute:(t,n)=>{let a=e.inputSchema.safeParse(t);if(!a.success)throw Error(s.default.prettifyError(a.error));return e.execute(a.data,n)}}}function f(e,t){let n=e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,40),a=(0,o.format)(new Date,"yyyyMMdd-HHmmss");return`${a}${n?`-${n}`:""}.${t}`}async function w(e,t,n,a){let i=`${t}/${n}`;return await e.exec(`mkdir -p ${t}`),await e.writeFile(i,Buffer.from(a)),i}[l]=d.then?(await d)():d;let b=e=>`${e}
|
|
8
|
+
Saved. Give the user this path — the file opens from the thread row. Do not describe it back to them; they can open it.`,y=(e,t)=>e?.split("/")[1]?.split(";")[0]||t,S=["1:1","16:9","9:16","4:3","3:4"],T=async()=>{let e=await (0,l.resolveMediaRef)("image");if(!e)return null;let t=(0,l.buildImageModel)(e.ref,e.apiKey);return m({name:c.STUDIO_TOOLS.generate_image,description:"Draw an image and save it as a file in the workspace. What comes back is its path.",inputSchema:s.default.object({prompt:s.default.string().describe("What to draw, described: subject, style, mood, what is in frame. The image model does not see the job or the conversation, so nothing can be left implied."),aspectRatio:s.default.enum(S).nullish().describe("Aspect ratio. Null for square.")}),execute:async({prompt:e,aspectRatio:n},{sandbox:a,artifacts:i,abortSignal:o})=>{let{image:s}=await (0,r.generateImage)({model:t,prompt:e,aspectRatio:n??"1:1",abortSignal:o}),l=await w(a,i,f(e,y(s.mediaType,"png")),s.uint8Array);return b(l)}})},O=async()=>{let e=await (0,l.resolveMediaRef)("speech");if(!e)return null;let t=(0,l.buildSpeechModel)(e.ref,e.apiKey);return m({name:c.STUDIO_TOOLS.generate_speech,description:"Read text aloud into an audio file in the workspace — something the user listens to or sends, not Thursday's voice. What comes back is its path.",inputSchema:s.default.object({text:s.default.string().min(1).max(4e3).describe("The words to read, up to 4000 characters. Longer pieces are read in parts, one call each."),voice:s.default.string().nullish().describe("A voice name the provider knows. Null for its default."),instructions:s.default.string().nullish().describe('How to read it — "slowly", "warm", "like a news anchor". Null for plain.')}),execute:async({text:e,voice:n,instructions:a},{sandbox:i,artifacts:o,abortSignal:s})=>{let{audio:l}=await (0,r.generateSpeech)({model:t,text:e,voice:n??void 0,instructions:a??void 0,outputFormat:"mp3",abortSignal:s}),c=await w(i,o,f(e.slice(0,60),l.format||"mp3"),l.uint8Array);return b(c)}})},v=async()=>{let e=await (0,l.resolveMediaRef)("transcription");if(!e)return null;let t=(0,l.buildTranscriptionModel)(e.ref,e.apiKey);return m({name:c.STUDIO_TOOLS.transcribe,description:"Turn an audio file — a recording, a voice memo, a meeting — into text. The transcript is saved as a file in the workspace; what comes back is its path and the text.",inputSchema:s.default.object({path:s.default.string().min(1).describe("The audio file: a path relative to the workspace, or an absolute one anywhere on this machine.")}),execute:async({path:e},{sandbox:n,artifacts:o,abortSignal:s})=>{let l=await (0,a.readFile)(n.resolve(e)),c=await (0,r.transcribe)({model:t,audio:l,abortSignal:s}),u=c.segments.length?`
|
|
9
9
|
|
|
10
10
|
## Timeline
|
|
11
11
|
|
|
@@ -14,12 +14,12 @@ ${c.segments.map(e=>{var t;let n,a;return`- ${t=e.startSecond,n=Math.floor(t/60)
|
|
|
14
14
|
${c.text.trim()}${u}
|
|
15
15
|
`));return`${d}
|
|
16
16
|
|
|
17
|
-
${await n.fold(c.text,"transcript")}`}})},
|
|
17
|
+
${await n.fold(c.text,"transcript")}`}})},M=async()=>{let e=await (0,l.resolveMediaRef)("video");if(!e)return null;let t=(0,l.buildVideoModel)(e.ref,e.apiKey);return m({name:c.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:n,seconds:a},{sandbox:i,artifacts:o,abortSignal:s})=>{let{video:l}=await (0,r.experimental_generateVideo)({model:t,prompt:e,aspectRatio:n??"16:9",duration:a??void 0,abortSignal:s}),c=await w(i,o,f(e,y(l.mediaType,"mp4")),l.uint8Array);return b(c)}})};async function p(){return(await Promise.all([g(T),g(O),g(v),g(M)])).filter(e=>null!==e)}async function g(e){try{return await e()}catch(e){return u.logger.warn(`studio: a tool could not be built — ${(0,h.errorToString)(e)}`),null}}e.s(["loadStudio",0,p]),n()}catch(e){n(e)}},!1),660948,e=>e.a(async(t,n)=>{try{var a=e.i(105249),i=e.i(687388),r=e.i(105303),o=e.i(148831),s=e.i(41444),l=e.i(741376),c=t([r,o,l]);async function u(e){let[t,n]=await Promise.all([!e||e===i.STUDIO_SERVER?(0,l.loadStudio)():[],e===i.STUDIO_SERVER?[]:(0,o.listToolNames)(e)]);return[...t.map(e=>({server:i.STUDIO_SERVER,name:e.name})),...n]}[r,o,l]=c.then?(await c)():c;let w=async()=>{let[e,t]=await Promise.all([(0,l.loadStudio)(),(0,o.listServerNames)()]);return[...e.length?[i.STUDIO_SERVER]:[],...t.map(e=>e.name)]};async function h(e,t){if(e===i.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:a.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 d(e,t,n,a,{artifacts:o,abortSignal:l}){let c=AbortSignal.timeout(i.CONNECTED_TOOL_TIMEOUT_MS),u=l?AbortSignal.any([l,c]):c;try{let r=t===i.STUDIO_SERVER?await m(e,n,a,o,u):await f(t,n,a,u);if("string"!=typeof r)return r;return{status:"ok",text:await e.fold(r,`${t}-${n}`)}}catch(e){if(e instanceof r.McpAuthRequiredError)return{status:"auth_required",server:t,authorizationUrl:e.authorizationUrl};if(c.aborted&&!l?.aborted)return{status:"error",text:`${n} on ${t} gave no answer in ${i.CONNECTED_TOOL_TIMEOUT_MS/6e4} minutes and was given up on.`};return{status:"error",text:(0,s.errorToString)(e)}}}async function m(e,t,n,a,r){let o=(await (0,l.loadStudio)()).find(e=>e.name===t);if(!o)throw Error(`"${t}" is not in the ${i.STUDIO_SERVER} right now — the key that runs it is gone.`);return o.execute(n??{},{sandbox:e,artifacts:a,abortSignal:r})}async function f(e,t,n,a){let i=function(e){let t=e??{},n=!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:n?"error":"ok",text:e||p(n)}}let a=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:n?"error":"ok",text:a||p(n)}}(await r.mcpManager.callTool(e,t,n,a));return"ok"===i.status?i.text:i}let p=e=>e?"The tool failed without a message.":"Done.";e.s(["callConnectedTool",0,d,"findConnectedSchemas",0,h,"listConnectedServerNames",0,w,"listConnectedToolNames",0,u]),n()}catch(e){n(e)}},!1),123203,e=>{"use strict";var t=e.i(750227),n=e.i(847841),a=e.i(105249),i=e.i(687388),r=e.i(353885),o=e.i(393189),s=e.i(786025);let l=`## The shell here
|
|
18
18
|
|
|
19
19
|
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.
|
|
20
20
|
|
|
21
21
|
Nothing is watching it. A command that stops to ask never gets an answer and is killed after ${i.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.
|
|
22
22
|
|
|
23
|
-
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,i)=>{let c=!0===i.guide,u=async e=>{let t=i.bot;if(!t)return{result:await e(),memory:null};let n=await (0,o.holdBotMemory)(t);return{result:await e(),memory:await (0,o.keepBotMemory)(t,n)}},h=(0,n.tool)({description:"Run a bash command.",inputSchema:a.default.object({command:a.default.string(),description:a.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:n})=>{let{result:a,memory:r}=await u(()=>e.exec(t,{signal:n,env:i.env,timeoutMs:i.timeoutMs})),o=r?{...a,memory:r}:a;return c?(c=!1,{...o,guide:l}):o}});if(!i.write)return{[r.TOOL_NAMES.bash]:h};let d=(0,n.tool)({description:"Write a whole file — what was there is gone. Parent directories are created.",inputSchema:a.default.object({path:a.default.string().describe("Relative to the working directory — under one of its folders — or absolute"),content:a.default.string(),description:a.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:n,content:a})=>{let r,o=e.resolve(n),l=(0,s.writeRefusal)(o,i.bot);if(l)return l;let{memory:c}=await u(()=>e.writeFile(n,a));return c??`Wrote ${(r=(0,t.relative)(e.cwd,o))&&!r.startsWith("..")?r:o} (${a.split("\n").length} lines)`}});return{[r.TOOL_NAMES.bash]:h,[r.TOOL_NAMES.write_file]:d}}])},636882,e=>{"use strict";var t=e.i(750227),n=e.i(687388),a=e.i(640911),i=e.i(41444),r=e.i(696968);let o=[(0,t.join)(n.APP_DIR,n.PATHS.skills.default),(0,t.join)(n.DATA_DIR,n.PATHS.skills.custom)];async function s(e,t){let n=[],o=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,c;if(!l.isDirectory())continue;let u=`${s}/${l.name}`,h=`${u}/SKILL.md`;try{t=await e.readFile(h,"utf-8")}catch{continue}try{c=(0,r.parseFrontmatter)(t)}catch(e){a.logger.warn(`skill ${u}: SKILL.md front matter did not load — ${(0,i.errorToString)(e)}`);continue}!o.has(c.name)&&(o.add(c.name),c.disabled||n.push({name:c.name,description:c.description,path:u}))}}return n}e.s(["loadSkills",0,e=>s(e,o)])},388439,e=>{"use strict";let t=/[\u1100-\u11ff\u3040-\u30ff\u3130-\u318f\u4e00-\u9fff\uac00-\ud7af]/;function n(e){let n=0,a=0;for(let i of e)t.test(i)?n+=1:a+=1;return Math.ceil(n/1.3+a/4)}e.s(["estimateTokens",0,n,"sectionTokens",0,function(e){return e.split(/\n(?=## )/).map(e=>({name:e.startsWith("## ")?e.slice(3,e.indexOf("\n")):"identity",tokens:n(e)})).sort((e,t)=>t.tokens-e.tokens)}])},343747,e=>{"use strict";var t=e.i(881237),n=e.i(662001),a=e.i(89929),i=e.i(277988),r=e.i(438220),o=e.i(609730);function s(e,t){let n=(0,o.toDate)(e,t?.in);return n.setHours(0,0,0,0),n}function l(e,t){let a=(0,n.getDefaultOptions)(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,r=(0,o.toDate)(e,t?.in),s=r.getDay();return r.setDate(r.getDate()-(7*(s<i)+s-i)),r.setHours(0,0,0,0),r}function c(e,t){return l(e,{...t,weekStartsOn:1})}var u=e.i(874321);function h(e,t){let n=(0,o.toDate)(e,t?.in),a=n.getFullYear(),i=(0,u.constructFrom)(n,0);i.setFullYear(a+1,0,4),i.setHours(0,0,0,0);let r=c(i),s=(0,u.constructFrom)(n,0);s.setFullYear(a,0,4),s.setHours(0,0,0,0);let l=c(s);return n.getTime()>=r.getTime()?a+1:n.getTime()>=l.getTime()?a:a-1}function d(e,t){let a=(0,o.toDate)(e,t?.in),i=a.getFullYear(),r=(0,n.getDefaultOptions)(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,c=(0,u.constructFrom)(t?.in||e,0);c.setFullYear(i+1,0,s),c.setHours(0,0,0,0);let h=l(c,t),d=(0,u.constructFrom)(t?.in||e,0);d.setFullYear(i,0,s),d.setHours(0,0,0,0);let m=l(d,t);return+a>=+h?i+1:+a>=+m?i:i-1}function m(e,t){let n=Math.abs(e).toString().padStart(t,"0");return(e<0?"-":"")+n}let f={y(e,t){let n=e.getFullYear(),a=n>0?n:1-n;return m("yy"===t?a%100:a,t.length)},M(e,t){let n=e.getMonth();return"M"===t?String(n+1):m(n+1,2)},d:(e,t)=>m(e.getDate(),t.length),a(e,t){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>m(e.getHours()%12||12,t.length),H:(e,t)=>m(e.getHours(),t.length),m:(e,t)=>m(e.getMinutes(),t.length),s:(e,t)=>m(e.getSeconds(),t.length),S(e,t){let n=t.length;return m(Math.trunc(e.getMilliseconds()*Math.pow(10,n-3)),t.length)}},w={G:function(e,t,n){let a=+(e.getFullYear()>0);switch(t){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});default:return n.era(a,{width:"wide"})}},y:function(e,t,n){if("yo"===t){let t=e.getFullYear();return n.ordinalNumber(t>0?t:1-t,{unit:"year"})}return f.y(e,t)},Y:function(e,t,n,a){let i=d(e,a),r=i>0?i:1-i;return"YY"===t?m(r%100,2):"Yo"===t?n.ordinalNumber(r,{unit:"year"}):m(r,t.length)},R:function(e,t){return m(h(e),t.length)},u:function(e,t){return m(e.getFullYear(),t.length)},Q:function(e,t,n){let a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return m(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,n){let a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return m(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,n){let a=e.getMonth();switch(t){case"M":case"MM":return f.M(e,t);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,n){let a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return m(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,a,i){let s,c,h,f,w,p=Math.round((l(s=(0,o.toDate)(e,i?.in),i)-(c=(0,n.getDefaultOptions)(),h=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??c.firstWeekContainsDate??c.locale?.options?.firstWeekContainsDate??1,f=d(s,i),(w=(0,u.constructFrom)(i?.in||s,0)).setFullYear(f,0,h),w.setHours(0,0,0,0),l(w,i)))/r.millisecondsInWeek)+1;return"wo"===t?a.ordinalNumber(p,{unit:"week"}):m(p,t.length)},I:function(e,t,n){let a,i,s,l=Math.round((c(a=(0,o.toDate)(e,void 0))-(i=h(a,void 0),(s=(0,u.constructFrom)(a,0)).setFullYear(i,0,4),s.setHours(0,0,0,0),c(s)))/r.millisecondsInWeek)+1;return"Io"===t?n.ordinalNumber(l,{unit:"week"}):m(l,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):f.d(e,t)},D:function(e,t,n){let l,c,u=function(e,t){let[n,o]=(0,i.normalizeDates)(void 0,e,t),l=s(n),c=s(o);return Math.round((l-(0,a.getTimezoneOffsetInMilliseconds)(l)-(c-(0,a.getTimezoneOffsetInMilliseconds)(c)))/r.millisecondsInDay)}(l=(0,o.toDate)(e,void 0),((c=(0,o.toDate)(l,void 0)).setFullYear(c.getFullYear(),0,1),c.setHours(0,0,0,0),c))+1;return"Do"===t?n.ordinalNumber(u,{unit:"dayOfYear"}):m(u,t.length)},E:function(e,t,n){let a=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,n,a){let i=e.getDay(),r=(i-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return m(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,a){let i=e.getDay(),r=(i-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return m(r,t.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){let a=e.getDay(),i=0===a?7:a;switch(t){case"i":return String(i);case"ii":return m(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,n){let a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){let a,i=e.getHours();switch(a=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){let a,i=e.getHours();switch(a=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return f.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):f.H(e,t)},K:function(e,t,n){let a=e.getHours()%12;return"Ko"===t?n.ordinalNumber(a,{unit:"hour"}):m(a,t.length)},k:function(e,t,n){let a=e.getHours();return(0===a&&(a=24),"ko"===t)?n.ordinalNumber(a,{unit:"hour"}):m(a,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):f.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):f.s(e,t)},S:function(e,t){return f.S(e,t)},X:function(e,t,n){let a=e.getTimezoneOffset();if(0===a)return"Z";switch(t){case"X":return g(a);case"XXXX":case"XX":return y(a);default:return y(a,":")}},x:function(e,t,n){let a=e.getTimezoneOffset();switch(t){case"x":return g(a);case"xxxx":case"xx":return y(a);default:return y(a,":")}},O:function(e,t,n){let a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+p(a,":");default:return"GMT"+y(a,":")}},z:function(e,t,n){let a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+p(a,":");default:return"GMT"+y(a,":")}},t:function(e,t,n){return m(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return m(+e,t.length)}};function p(e,t=""){let n=e>0?"-":"+",a=Math.abs(e),i=Math.trunc(a/60),r=a%60;return 0===r?n+String(i):n+String(i)+t+m(r,2)}function g(e,t){return e%60==0?(e>0?"-":"+")+m(Math.abs(e)/60,2):y(e,t)}function y(e,t=""){let n=Math.abs(e);return(e>0?"-":"+")+m(Math.trunc(n/60),2)+t+m(n%60,2)}let b=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},S=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},T={p:S,P:(e,t)=>{let n,a=e.match(/(P+)(p+)?/)||[],i=a[1],r=a[2];if(!r)return b(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",b(i,t)).replace("{{time}}",S(r,t))}},O=/^D+$/,v=/^Y+$/,k=["D","DD","YY","YYYY"],M=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,E=/^'([^]*?)'?$/,_=/''/g,N=/[a-zA-Z]/;e.s(["format",0,function(e,a,i){let r=(0,n.getDefaultOptions)(),s=i?.locale??r.locale??t.defaultLocale,l=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,c=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,u=(0,o.toDate)(e,i?.in);if(!(u instanceof Date||"object"==typeof u&&"[object Date]"===Object.prototype.toString.call(u))&&"number"!=typeof u||isNaN(+(0,o.toDate)(u)))throw RangeError("Invalid time value");let h=a.match($).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,T[t])(e,s.formatLong):e}).join("").match(M).map(e=>{if("''"===e)return{isToken:!1,value:"'"};let t=e[0];if("'"===t){var n;let t;return{isToken:!1,value:(t=(n=e).match(E))?t[1].replace(_,"'"):n}}if(w[t])return{isToken:!0,value:e};if(t.match(N))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});s.localize.preprocessor&&(h=s.localize.preprocessor(u,h));let d={firstWeekContainsDate:l,weekStartsOn:c,locale:s};return h.map(t=>{if(!t.isToken)return t.value;let n=t.value;return(!i?.useAdditionalWeekYearTokens&&v.test(n)||!i?.useAdditionalDayOfYearTokens&&O.test(n))&&function(e,t,n){var a,i,r;let o,s=(a=e,i=t,r=n,o="Y"===a[0]?"years":"days of the month",`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${i}\`) for formatting ${o} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(s),k.includes(e))throw RangeError(s)}(n,a,String(e)),(0,w[n[0]])(u,n,s.localize,d)}).join("")}],343747)}];
|
|
23
|
+
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,i)=>{let c=!0===i.guide,u=async e=>{let t=i.bot;if(!t)return{result:await e(),memory:null};let n=await (0,o.holdBotMemory)(t);return{result:await e(),memory:await (0,o.keepBotMemory)(t,n)}},h=(0,n.tool)({description:"Run a bash command.",inputSchema:a.default.object({command:a.default.string(),description:a.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:n})=>{let{result:a,memory:r}=await u(()=>e.exec(t,{signal:n,env:i.env,timeoutMs:i.timeoutMs})),o=r?{...a,memory:r}:a;return c?(c=!1,{...o,guide:l}):o}});if(!i.write)return{[r.TOOL_NAMES.bash]:h};let d=(0,n.tool)({description:"Write a whole file — what was there is gone. Parent directories are created.",inputSchema:a.default.object({path:a.default.string().describe("Relative to the working directory — under one of its folders — or absolute"),content:a.default.string(),description:a.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:n,content:a})=>{let r,o=e.resolve(n),l=(0,s.writeRefusal)(o,i.bot);if(l)return l;let{memory:c}=await u(()=>e.writeFile(n,a));return c??`Wrote ${(r=(0,t.relative)(e.cwd,o))&&!r.startsWith("..")?r:o} (${a.split("\n").length} lines)`}});return{[r.TOOL_NAMES.bash]:h,[r.TOOL_NAMES.write_file]:d}}])},636882,e=>{"use strict";var t=e.i(750227),n=e.i(687388),a=e.i(640911),i=e.i(41444),r=e.i(696968);let o=[(0,t.join)(n.APP_DIR,n.PATHS.skills.default),(0,t.join)(n.DATA_DIR,n.PATHS.skills.custom)];async function s(e,t){let n=[],o=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,c;if(!l.isDirectory())continue;let u=`${s}/${l.name}`,h=`${u}/SKILL.md`;try{t=await e.readFile(h,"utf-8")}catch{continue}try{c=(0,r.parseFrontmatter)(t)}catch(e){a.logger.warn(`skill ${u}: SKILL.md front matter did not load — ${(0,i.errorToString)(e)}`);continue}!o.has(c.name)&&(o.add(c.name),c.disabled||n.push({name:c.name,description:c.description,path:u}))}}return n}e.s(["loadSkills",0,e=>s(e,o)])},388439,e=>{"use strict";let t=/[\u1100-\u11ff\u3040-\u30ff\u3130-\u318f\u4e00-\u9fff\uac00-\ud7af]/;function n(e){let n=0,a=0;for(let i of e)t.test(i)?n+=1:a+=1;return Math.ceil(n/1.3+a/4)}e.s(["estimateTokens",0,n,"sectionTokens",0,function(e){return e.split(/\n(?=## )/).map(e=>({name:e.startsWith("## ")?e.slice(3,e.indexOf("\n")):"identity",tokens:n(e)})).sort((e,t)=>t.tokens-e.tokens)}])},343747,e=>{"use strict";var t=e.i(881237),n=e.i(662001),a=e.i(89929),i=e.i(277988),r=e.i(438220),o=e.i(609730);function s(e,t){let n=(0,o.toDate)(e,t?.in);return n.setHours(0,0,0,0),n}function l(e,t){let a=(0,n.getDefaultOptions)(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,r=(0,o.toDate)(e,t?.in),s=r.getDay();return r.setDate(r.getDate()-(7*(s<i)+s-i)),r.setHours(0,0,0,0),r}function c(e,t){return l(e,{...t,weekStartsOn:1})}var u=e.i(874321);function h(e,t){let n=(0,o.toDate)(e,t?.in),a=n.getFullYear(),i=(0,u.constructFrom)(n,0);i.setFullYear(a+1,0,4),i.setHours(0,0,0,0);let r=c(i),s=(0,u.constructFrom)(n,0);s.setFullYear(a,0,4),s.setHours(0,0,0,0);let l=c(s);return n.getTime()>=r.getTime()?a+1:n.getTime()>=l.getTime()?a:a-1}function d(e,t){let a=(0,o.toDate)(e,t?.in),i=a.getFullYear(),r=(0,n.getDefaultOptions)(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,c=(0,u.constructFrom)(t?.in||e,0);c.setFullYear(i+1,0,s),c.setHours(0,0,0,0);let h=l(c,t),d=(0,u.constructFrom)(t?.in||e,0);d.setFullYear(i,0,s),d.setHours(0,0,0,0);let m=l(d,t);return+a>=+h?i+1:+a>=+m?i:i-1}function m(e,t){let n=Math.abs(e).toString().padStart(t,"0");return(e<0?"-":"")+n}let f={y(e,t){let n=e.getFullYear(),a=n>0?n:1-n;return m("yy"===t?a%100:a,t.length)},M(e,t){let n=e.getMonth();return"M"===t?String(n+1):m(n+1,2)},d:(e,t)=>m(e.getDate(),t.length),a(e,t){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>m(e.getHours()%12||12,t.length),H:(e,t)=>m(e.getHours(),t.length),m:(e,t)=>m(e.getMinutes(),t.length),s:(e,t)=>m(e.getSeconds(),t.length),S(e,t){let n=t.length;return m(Math.trunc(e.getMilliseconds()*Math.pow(10,n-3)),t.length)}},w={G:function(e,t,n){let a=+(e.getFullYear()>0);switch(t){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});default:return n.era(a,{width:"wide"})}},y:function(e,t,n){if("yo"===t){let t=e.getFullYear();return n.ordinalNumber(t>0?t:1-t,{unit:"year"})}return f.y(e,t)},Y:function(e,t,n,a){let i=d(e,a),r=i>0?i:1-i;return"YY"===t?m(r%100,2):"Yo"===t?n.ordinalNumber(r,{unit:"year"}):m(r,t.length)},R:function(e,t){return m(h(e),t.length)},u:function(e,t){return m(e.getFullYear(),t.length)},Q:function(e,t,n){let a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return m(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,n){let a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return m(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,n){let a=e.getMonth();switch(t){case"M":case"MM":return f.M(e,t);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,n){let a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return m(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,a,i){let s,c,h,f,w,p=Math.round((l(s=(0,o.toDate)(e,i?.in),i)-(c=(0,n.getDefaultOptions)(),h=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??c.firstWeekContainsDate??c.locale?.options?.firstWeekContainsDate??1,f=d(s,i),(w=(0,u.constructFrom)(i?.in||s,0)).setFullYear(f,0,h),w.setHours(0,0,0,0),l(w,i)))/r.millisecondsInWeek)+1;return"wo"===t?a.ordinalNumber(p,{unit:"week"}):m(p,t.length)},I:function(e,t,n){let a,i,s,l=Math.round((c(a=(0,o.toDate)(e,void 0))-(i=h(a,void 0),(s=(0,u.constructFrom)(a,0)).setFullYear(i,0,4),s.setHours(0,0,0,0),c(s)))/r.millisecondsInWeek)+1;return"Io"===t?n.ordinalNumber(l,{unit:"week"}):m(l,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):f.d(e,t)},D:function(e,t,n){let l,c,u=function(e,t){let[n,o]=(0,i.normalizeDates)(void 0,e,t),l=s(n),c=s(o);return Math.round((l-(0,a.getTimezoneOffsetInMilliseconds)(l)-(c-(0,a.getTimezoneOffsetInMilliseconds)(c)))/r.millisecondsInDay)}(l=(0,o.toDate)(e,void 0),((c=(0,o.toDate)(l,void 0)).setFullYear(c.getFullYear(),0,1),c.setHours(0,0,0,0),c))+1;return"Do"===t?n.ordinalNumber(u,{unit:"dayOfYear"}):m(u,t.length)},E:function(e,t,n){let a=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,n,a){let i=e.getDay(),r=(i-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return m(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,a){let i=e.getDay(),r=(i-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return m(r,t.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){let a=e.getDay(),i=0===a?7:a;switch(t){case"i":return String(i);case"ii":return m(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,n){let a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){let a,i=e.getHours();switch(a=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){let a,i=e.getHours();switch(a=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return f.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):f.H(e,t)},K:function(e,t,n){let a=e.getHours()%12;return"Ko"===t?n.ordinalNumber(a,{unit:"hour"}):m(a,t.length)},k:function(e,t,n){let a=e.getHours();return(0===a&&(a=24),"ko"===t)?n.ordinalNumber(a,{unit:"hour"}):m(a,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):f.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):f.s(e,t)},S:function(e,t){return f.S(e,t)},X:function(e,t,n){let a=e.getTimezoneOffset();if(0===a)return"Z";switch(t){case"X":return g(a);case"XXXX":case"XX":return b(a);default:return b(a,":")}},x:function(e,t,n){let a=e.getTimezoneOffset();switch(t){case"x":return g(a);case"xxxx":case"xx":return b(a);default:return b(a,":")}},O:function(e,t,n){let a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+p(a,":");default:return"GMT"+b(a,":")}},z:function(e,t,n){let a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+p(a,":");default:return"GMT"+b(a,":")}},t:function(e,t,n){return m(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return m(+e,t.length)}};function p(e,t=""){let n=e>0?"-":"+",a=Math.abs(e),i=Math.trunc(a/60),r=a%60;return 0===r?n+String(i):n+String(i)+t+m(r,2)}function g(e,t){return e%60==0?(e>0?"-":"+")+m(Math.abs(e)/60,2):b(e,t)}function b(e,t=""){let n=Math.abs(e);return(e>0?"-":"+")+m(Math.trunc(n/60),2)+t+m(n%60,2)}let y=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},S=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},T={p:S,P:(e,t)=>{let n,a=e.match(/(P+)(p+)?/)||[],i=a[1],r=a[2];if(!r)return y(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",y(i,t)).replace("{{time}}",S(r,t))}},O=/^D+$/,v=/^Y+$/,M=["D","DD","YY","YYYY"],k=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,E=/^'([^]*?)'?$/,_=/''/g,N=/[a-zA-Z]/;e.s(["format",0,function(e,a,i){let r=(0,n.getDefaultOptions)(),s=i?.locale??r.locale??t.defaultLocale,l=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,c=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,u=(0,o.toDate)(e,i?.in);if(!(u instanceof Date||"object"==typeof u&&"[object Date]"===Object.prototype.toString.call(u))&&"number"!=typeof u||isNaN(+(0,o.toDate)(u)))throw RangeError("Invalid time value");let h=a.match($).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,T[t])(e,s.formatLong):e}).join("").match(k).map(e=>{if("''"===e)return{isToken:!1,value:"'"};let t=e[0];if("'"===t){var n;let t;return{isToken:!1,value:(t=(n=e).match(E))?t[1].replace(_,"'"):n}}if(w[t])return{isToken:!0,value:e};if(t.match(N))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});s.localize.preprocessor&&(h=s.localize.preprocessor(u,h));let d={firstWeekContainsDate:l,weekStartsOn:c,locale:s};return h.map(t=>{if(!t.isToken)return t.value;let n=t.value;return(!i?.useAdditionalWeekYearTokens&&v.test(n)||!i?.useAdditionalDayOfYearTokens&&O.test(n))&&function(e,t,n){var a,i,r;let o,s=(a=e,i=t,r=n,o="Y"===a[0]?"years":"days of the month",`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${i}\`) for formatting ${o} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(s),M.includes(e))throw RangeError(s)}(n,a,String(e)),(0,w[n[0]])(u,n,s.localize,d)}).join("")}],343747)}];
|
|
24
24
|
|
|
25
25
|
//# sourceMappingURL=_0i55en5._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[271647,e=>{"use strict";var t=e.i(105249),i=e.i(440998),a=e.i(91264);let n=t.default.array(t.default.string().min(1)),r=(0,a.serverRoute)(async e=>{let t,a=new URL(e.url).searchParams.get("paths")??"[]";try{t=JSON.parse(a)}catch{t=null}return(0,i.findMissingFiles)(n.parse(t))});e.s(["GET",0,r])},768240,e=>{"use strict";var t=e.i(747909),i=e.i(174017),a=e.i(996250),n=e.i(759756),r=e.i(561916),s=e.i(174677),o=e.i(869741),l=e.i(316795),d=e.i(487718),u=e.i(995169),
|
|
1
|
+
module.exports=[271647,e=>{"use strict";var t=e.i(105249),i=e.i(440998),a=e.i(91264);let n=t.default.array(t.default.string().min(1)),r=(0,a.serverRoute)(async e=>{let t,a=new URL(e.url).searchParams.get("paths")??"[]";try{t=JSON.parse(a)}catch{t=null}return(0,i.findMissingFiles)(n.parse(t))});e.s(["GET",0,r])},768240,e=>{"use strict";var t=e.i(747909),i=e.i(174017),a=e.i(996250),n=e.i(759756),r=e.i(561916),s=e.i(174677),o=e.i(869741),l=e.i(316795),d=e.i(487718),u=e.i(995169),c=e.i(47587),p=e.i(666012),m=e.i(570101),h=e.i(626937),g=e.i(10372),f=e.i(193695);e.i(52474);var w=e.i(600220);let v=new t.AppRouteRouteModule({definition:{kind:i.RouteKind.APP_ROUTE,page:"/api/workspace/missing/route",pathname:"/api/workspace/missing",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/workspace/missing/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(271647),...{}}),{workAsyncStorage:R,workUnitAsyncStorage:k,serverHooks:E}=v;async function C(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),v.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let R="/api/workspace/missing/route";R=R.replace(/\/index$/,"")||"/";let k=await v.prepare(e,t,{srcPage:R,multiZoneDraftMode:!1});if(!k)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:E,deploymentId:C,params:x,nextConfig:y,parsedUrl:b,isDraftMode:A,prerenderManifest:S,routerServerContext:T,isOnDemandRevalidate:N,revalidateOnlyGenerated:P,resolvedPathname:_,clientReferenceManifest:O,serverActionsManifest:H}=k,j=(0,o.normalizeAppPath)(R),q=!!(S.dynamicRoutes[j]||S.routes[_]),F=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,b,!1):t.end("This page could not be found"),null);if(q&&!A){let e=!!S.routes[_],t=S.dynamicRoutes[j];if(t&&!1===t.fallback&&!e){if(y.adapterPath)return await F();throw new f.NoFallbackError}}let I=null;!q||v.isDev||A||(I="/index"===(I=_)?"/":I);let M=!0===v.isDev||!q,U=q&&!M;H&&O&&(0,s.setManifestsSingleton)({page:R,clientReferenceManifest:O,serverActionsManifest:H});let D=e.method||"GET",L=(0,r.getTracer)(),$=L.getActiveScopeSpan(),K=!!(null==T?void 0:T.isWrappedByNextServer),W=!!(0,n.getRequestMeta)(e,"minimalMode"),B=(0,n.getRequestMeta)(e,"incrementalCache")||await v.getIncrementalCache(e,y,S,W);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let G={params:x,previewProps:S.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:B,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,i,a,n)=>v.onRequestError(e,t,a,n,T)},sharedContext:{buildId:E,deploymentId:C}},z=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),X=d.NextRequestAdapter.fromNodeNextRequest(z,(0,d.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:i})=>{try{if(!W&&N&&P&&!i)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await v.handle(X,G);e.fetchMetrics=G.renderOpts.fetchMetrics;let r=G.renderOpts.pendingWaitUntil;r&&a.waitUntil&&(a.waitUntil(r),r=void 0);let s=G.renderOpts.collectedTags;if(!q)return await (0,p.sendResponse)(z,V,n,r),null;{let e=await n.blob(),t=(0,m.toNodeOutgoingHttpHeaders)(n.headers);s&&(t[g.NEXT_CACHE_TAGS_HEADER]=s),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let i=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,a=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=g.INFINITE_CACHE?!1!==i&&i>0?y.expireTime:void 0:G.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:i,expire:a}}}}catch(t){throw(null==i?void 0:i.isStale)&&await v.onRequestError(e,t,{routerKind:"App Router",routePath:R,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:N})},!1,T),t}},J=async(n,s)=>{try{var o,l;let n=await v.handleResponse({req:e,nextConfig:y,cacheKey:I,routeKind:i.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:P,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:W});if(!q)return;if((null==n||null==(o=n.value)?void 0:o.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});W||t.setHeader("x-nextjs-cache",N?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let r=(0,m.fromNodeOutgoingHttpHeaders)(n.value.headers);W&&q||r.delete(g.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||r.get("Cache-Control")||r.set("Cache-Control",(0,h.getCacheControlHeader)(n.cacheControl)),await (0,p.sendResponse)(z,V,new Response(n.value.body,{headers:r,status:n.value.status||200}));return}catch(t){if(t instanceof f.NoFallbackError||await v.onRequestError(e,t,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:N})},!1,T),q)throw t;await (0,p.sendResponse)(z,V,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:r.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let i=L.getRootSpanAttributes();if(!i)return;if(i.get("next.span_type")!==u.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${i.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=i.get("next.route")||j,o=`${D} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":o}),n.updateName(o),s&&s!==n&&(s.setAttribute("http.route",a),s.updateName(o))})()}};if(K&&$)await J($,void 0);else{let t=L.getActiveScopeSpan();await L.withPropagatedContext(e.headers,()=>L.trace(u.BaseServerSpan.handleRequest,{spanName:`${D} ${R}`,kind:r.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},e=>J(e,t)),void 0,!K)}}e.s(["handler",0,C,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:R,workUnitAsyncStorage:k})},"routeModule",0,v,"serverHooks",0,E,"workAsyncStorage",0,R,"workUnitAsyncStorage",0,k])},629668,e=>{"use strict";var t=e.i(687388);let i=e=>`text/${e}; charset=utf-8`,a={md:{kind:"markdown",mime:i("markdown")},markdown:{kind:"markdown",mime:i("markdown")},csv:{kind:"csv",mime:i("csv")},json:{kind:"json",mime:"application/json; charset=utf-8"},txt:{kind:"text",mime:i("plain")},log:{kind:"text",mime:i("plain")},html:{kind:"frame",mime:i("html")},htm:{kind:"frame",mime:i("html")},pdf:{kind:"frame",mime:"application/pdf"},png:{kind:"image",mime:"image/png"},jpg:{kind:"image",mime:"image/jpeg"},jpeg:{kind:"image",mime:"image/jpeg"},gif:{kind:"image",mime:"image/gif"},webp:{kind:"image",mime:"image/webp"},svg:{kind:"image",mime:"image/svg+xml"},mp3:{kind:"audio",mime:"audio/mpeg"},wav:{kind:"audio",mime:"audio/wav"},mp4:{kind:"video",mime:"video/mp4"},webm:{kind:"video",mime:"video/webm"},css:{kind:"none",mime:i("css")},js:{kind:"none",mime:i("javascript")},woff2:{kind:"none",mime:"font/woff2"}},n=e=>e.split(".").pop()?.toLowerCase()??"",r=new Set(["node_modules","__pycache__"]),s=Object.entries(a).filter(([,e])=>"none"!==e.kind).map(([e])=>e),o=RegExp(String.raw`(?<![\p{L}\p{N}_/:@%-])(?:[\p{L}\p{N}_.@%-]+/)*[\p{L}\p{N}_@%-]+(?:\.[\p{L}\p{N}_-]+)*\.(?:${s.join("|")})\b`,"giu"),l=`${t.PATHS.workspace}/`;e.s(["isListedFolder",0,e=>!e.startsWith(".")&&!r.has(e),"mimeOf",0,e=>a[n(e)]?.mime??"application/octet-stream","opensOnFinish",0,e=>e.startsWith(`${t.PATHS.artifacts}/`)&&["md","markdown","html","htm"].includes(n(e)),"pathsIn",0,function(e){let t=e.replace(/\b[a-z][\w+.-]*:\/\/\S+/gi," "),i=new Set;for(let e of t.match(o)??[]){let t=function(e){let t,i,a=(i=(t=e.trim()).indexOf(l))>=0?t.slice(i+l.length)||null:t.startsWith("/")||/^[A-Za-z]:/.test(t)||t.split("/").includes("..")?null:t||null;if(!a)return null;let[n,...r]=a.split("/");return r.length&&n.includes(".")?null:a}(e);t&&i.add(t)}return[...i].slice(0,6)},"viewKindOf",0,e=>a[n(e)]?.kind??"none"])},440998,e=>{"use strict";var t=e.i(912714),i=e.i(750227),a=e.i(687388),n=e.i(53748),r=e.i(629668),s=e.i(786025);async function o(e,l=a.WORKSPACE_VIEW.rows){let d=await (0,s.insideWorkspace)(e);d||(0,n.publicError)("Outside the workspace");let u=await (0,t.readdir)(d,{withFileTypes:!0}).catch(()=>null);u||(0,n.publicError)("No such folder");let c=u.filter(e=>e.isDirectory()?(0,r.isListedFolder)(e.name):e.isFile()&&"none"!==(0,r.viewKindOf)(e.name)).sort((e,t)=>Number(e.isFile())-Number(t.isFile())||e.name.localeCompare(t.name)),p=await Promise.all(c.slice(0,l).map(async a=>{let n=e?`${e}/${a.name}`:a.name;if(a.isDirectory())return{kind:"dir",name:a.name,path:n};let s=await (0,t.stat)((0,i.join)(d,a.name)).catch(()=>null);return s?{kind:"file",name:a.name,path:n,bytes:s.size,at:s.mtime,view:(0,r.viewKindOf)(a.name)}:null}));return{path:e,entries:p.filter(e=>null!==e),total:c.length}}async function l(e){return(await Promise.all(e.map(async e=>{let i=await (0,s.insideWorkspace)(e);if(!i)return null;let a=await (0,t.stat)(i).catch(()=>null);return a?.isFile()?null:e}))).filter(e=>null!==e)}e.s(["findMissingFiles",0,l,"readWorkspaceFolder",0,o])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=_0p56fn0._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[238857,e=>{"use strict";var t=e.i(440998);let i=(0,e.i(91264).serverRoute)(async e=>{let i=new URL(e.url).searchParams,a=Number(i.get("rows"));return(0,t.readWorkspaceFolder)(i.get("path")??"",Number.isSafeInteger(a)&&a>0?a:void 0)});e.s(["GET",0,i])},161286,e=>{"use strict";var t=e.i(747909),i=e.i(174017),a=e.i(996250),n=e.i(759756),r=e.i(561916),s=e.i(174677),o=e.i(869741),l=e.i(316795),d=e.i(487718),u=e.i(995169),
|
|
1
|
+
module.exports=[238857,e=>{"use strict";var t=e.i(440998);let i=(0,e.i(91264).serverRoute)(async e=>{let i=new URL(e.url).searchParams,a=Number(i.get("rows"));return(0,t.readWorkspaceFolder)(i.get("path")??"",Number.isSafeInteger(a)&&a>0?a:void 0)});e.s(["GET",0,i])},161286,e=>{"use strict";var t=e.i(747909),i=e.i(174017),a=e.i(996250),n=e.i(759756),r=e.i(561916),s=e.i(174677),o=e.i(869741),l=e.i(316795),d=e.i(487718),u=e.i(995169),c=e.i(47587),p=e.i(666012),m=e.i(570101),h=e.i(626937),f=e.i(10372),g=e.i(193695);e.i(52474);var w=e.i(600220);let v=new t.AppRouteRouteModule({definition:{kind:i.RouteKind.APP_ROUTE,page:"/api/workspace/route",pathname:"/api/workspace",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/workspace/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(238857),...{}}),{workAsyncStorage:R,workUnitAsyncStorage:k,serverHooks:E}=v;async function C(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),v.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let R="/api/workspace/route";R=R.replace(/\/index$/,"")||"/";let k=await v.prepare(e,t,{srcPage:R,multiZoneDraftMode:!1});if(!k)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:E,deploymentId:C,params:x,nextConfig:b,parsedUrl:y,isDraftMode:A,prerenderManifest:S,routerServerContext:T,isOnDemandRevalidate:N,revalidateOnlyGenerated:P,resolvedPathname:_,clientReferenceManifest:O,serverActionsManifest:H}=k,I=(0,o.normalizeAppPath)(R),j=!!(S.dynamicRoutes[I]||S.routes[_]),q=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,y,!1):t.end("This page could not be found"),null);if(j&&!A){let e=!!S.routes[_],t=S.dynamicRoutes[I];if(t&&!1===t.fallback&&!e){if(b.adapterPath)return await q();throw new g.NoFallbackError}}let F=null;!j||v.isDev||A||(F="/index"===(F=_)?"/":F);let M=!0===v.isDev||!j,U=j&&!M;H&&O&&(0,s.setManifestsSingleton)({page:R,clientReferenceManifest:O,serverActionsManifest:H});let D=e.method||"GET",L=(0,r.getTracer)(),$=L.getActiveScopeSpan(),K=!!(null==T?void 0:T.isWrappedByNextServer),W=!!(0,n.getRequestMeta)(e,"minimalMode"),B=(0,n.getRequestMeta)(e,"incrementalCache")||await v.getIncrementalCache(e,b,S,W);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let G={params:x,previewProps:S.preview,renderOpts:{experimental:{authInterrupts:!!b.experimental.authInterrupts,useCacheTimeout:b.experimental.useCacheTimeout},cacheComponents:!!b.cacheComponents,validationLevel:b.experimental.instantInsights.validationLevel,supportsDynamicResponse:M,incrementalCache:B,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:b.cacheLife,staticPageGenerationTimeout:b.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,i,a,n)=>v.onRequestError(e,t,a,n,T)},sharedContext:{buildId:E,deploymentId:C}},z=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),X=d.NextRequestAdapter.fromNodeNextRequest(z,(0,d.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:i})=>{try{if(!W&&N&&P&&!i)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await v.handle(X,G);e.fetchMetrics=G.renderOpts.fetchMetrics;let r=G.renderOpts.pendingWaitUntil;r&&a.waitUntil&&(a.waitUntil(r),r=void 0);let s=G.renderOpts.collectedTags;if(!j)return await (0,p.sendResponse)(z,V,n,r),null;{let e=await n.blob(),t=(0,m.toNodeOutgoingHttpHeaders)(n.headers);s&&(t[f.NEXT_CACHE_TAGS_HEADER]=s),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let i=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,a=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=f.INFINITE_CACHE?!1!==i&&i>0?b.expireTime:void 0:G.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:i,expire:a}}}}catch(t){throw(null==i?void 0:i.isStale)&&await v.onRequestError(e,t,{routerKind:"App Router",routePath:R,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:N})},!1,T),t}},J=async(n,s)=>{try{var o,l;let n=await v.handleResponse({req:e,nextConfig:b,cacheKey:F,routeKind:i.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:P,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:W});if(!j)return;if((null==n||null==(o=n.value)?void 0:o.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});W||t.setHeader("x-nextjs-cache",N?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let r=(0,m.fromNodeOutgoingHttpHeaders)(n.value.headers);W&&j||r.delete(f.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||r.get("Cache-Control")||r.set("Cache-Control",(0,h.getCacheControlHeader)(n.cacheControl)),await (0,p.sendResponse)(z,V,new Response(n.value.body,{headers:r,status:n.value.status||200}));return}catch(t){if(t instanceof g.NoFallbackError||await v.onRequestError(e,t,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:N})},!1,T),j)throw t;await (0,p.sendResponse)(z,V,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:r.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let i=L.getRootSpanAttributes();if(!i)return;if(i.get("next.span_type")!==u.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${i.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=i.get("next.route")||I,o=`${D} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":o}),n.updateName(o),s&&s!==n&&(s.setAttribute("http.route",a),s.updateName(o))})()}};if(K&&$)await J($,void 0);else{let t=L.getActiveScopeSpan();await L.withPropagatedContext(e.headers,()=>L.trace(u.BaseServerSpan.handleRequest,{spanName:`${D} ${R}`,kind:r.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},e=>J(e,t)),void 0,!K)}}e.s(["handler",0,C,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:R,workUnitAsyncStorage:k})},"routeModule",0,v,"serverHooks",0,E,"workAsyncStorage",0,R,"workUnitAsyncStorage",0,k])},629668,e=>{"use strict";var t=e.i(687388);let i=e=>`text/${e}; charset=utf-8`,a={md:{kind:"markdown",mime:i("markdown")},markdown:{kind:"markdown",mime:i("markdown")},csv:{kind:"csv",mime:i("csv")},json:{kind:"json",mime:"application/json; charset=utf-8"},txt:{kind:"text",mime:i("plain")},log:{kind:"text",mime:i("plain")},html:{kind:"frame",mime:i("html")},htm:{kind:"frame",mime:i("html")},pdf:{kind:"frame",mime:"application/pdf"},png:{kind:"image",mime:"image/png"},jpg:{kind:"image",mime:"image/jpeg"},jpeg:{kind:"image",mime:"image/jpeg"},gif:{kind:"image",mime:"image/gif"},webp:{kind:"image",mime:"image/webp"},svg:{kind:"image",mime:"image/svg+xml"},mp3:{kind:"audio",mime:"audio/mpeg"},wav:{kind:"audio",mime:"audio/wav"},mp4:{kind:"video",mime:"video/mp4"},webm:{kind:"video",mime:"video/webm"},css:{kind:"none",mime:i("css")},js:{kind:"none",mime:i("javascript")},woff2:{kind:"none",mime:"font/woff2"}},n=e=>e.split(".").pop()?.toLowerCase()??"",r=new Set(["node_modules","__pycache__"]),s=Object.entries(a).filter(([,e])=>"none"!==e.kind).map(([e])=>e),o=RegExp(String.raw`(?<![\p{L}\p{N}_/:@%-])(?:[\p{L}\p{N}_.@%-]+/)*[\p{L}\p{N}_@%-]+(?:\.[\p{L}\p{N}_-]+)*\.(?:${s.join("|")})\b`,"giu"),l=`${t.PATHS.workspace}/`;e.s(["isListedFolder",0,e=>!e.startsWith(".")&&!r.has(e),"mimeOf",0,e=>a[n(e)]?.mime??"application/octet-stream","opensOnFinish",0,e=>e.startsWith(`${t.PATHS.artifacts}/`)&&["md","markdown","html","htm"].includes(n(e)),"pathsIn",0,function(e){let t=e.replace(/\b[a-z][\w+.-]*:\/\/\S+/gi," "),i=new Set;for(let e of t.match(o)??[]){let t=function(e){let t,i,a=(i=(t=e.trim()).indexOf(l))>=0?t.slice(i+l.length)||null:t.startsWith("/")||/^[A-Za-z]:/.test(t)||t.split("/").includes("..")?null:t||null;if(!a)return null;let[n,...r]=a.split("/");return r.length&&n.includes(".")?null:a}(e);t&&i.add(t)}return[...i].slice(0,6)},"viewKindOf",0,e=>a[n(e)]?.kind??"none"])},440998,e=>{"use strict";var t=e.i(912714),i=e.i(750227),a=e.i(687388),n=e.i(53748),r=e.i(629668),s=e.i(786025);async function o(e,l=a.WORKSPACE_VIEW.rows){let d=await (0,s.insideWorkspace)(e);d||(0,n.publicError)("Outside the workspace");let u=await (0,t.readdir)(d,{withFileTypes:!0}).catch(()=>null);u||(0,n.publicError)("No such folder");let c=u.filter(e=>e.isDirectory()?(0,r.isListedFolder)(e.name):e.isFile()&&"none"!==(0,r.viewKindOf)(e.name)).sort((e,t)=>Number(e.isFile())-Number(t.isFile())||e.name.localeCompare(t.name)),p=await Promise.all(c.slice(0,l).map(async a=>{let n=e?`${e}/${a.name}`:a.name;if(a.isDirectory())return{kind:"dir",name:a.name,path:n};let s=await (0,t.stat)((0,i.join)(d,a.name)).catch(()=>null);return s?{kind:"file",name:a.name,path:n,bytes:s.size,at:s.mtime,view:(0,r.viewKindOf)(a.name)}:null}));return{path:e,entries:p.filter(e=>null!==e),total:c.length}}async function l(e){return(await Promise.all(e.map(async e=>{let i=await (0,s.insideWorkspace)(e);if(!i)return null;let a=await (0,t.stat)(i).catch(()=>null);return a?.isFile()?null:e}))).filter(e=>null!==e)}e.s(["findMissingFiles",0,l,"readWorkspaceFolder",0,o])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=_11ujpya._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[629668,e=>{"use strict";var i=e.i(687388);let m=e=>`text/${e}; charset=utf-8`,n={md:{kind:"markdown",mime:m("markdown")},markdown:{kind:"markdown",mime:m("markdown")},csv:{kind:"csv",mime:m("csv")},json:{kind:"json",mime:"application/json; charset=utf-8"},txt:{kind:"text",mime:m("plain")},log:{kind:"text",mime:m("plain")},html:{kind:"frame",mime:m("html")},htm:{kind:"frame",mime:m("html")},pdf:{kind:"frame",mime:"application/pdf"},png:{kind:"image",mime:"image/png"},jpg:{kind:"image",mime:"image/jpeg"},jpeg:{kind:"image",mime:"image/jpeg"},gif:{kind:"image",mime:"image/gif"},webp:{kind:"image",mime:"image/webp"},svg:{kind:"image",mime:"image/svg+xml"},mp3:{kind:"audio",mime:"audio/mpeg"},wav:{kind:"audio",mime:"audio/wav"},mp4:{kind:"video",mime:"video/mp4"},webm:{kind:"video",mime:"video/webm"},css:{kind:"none",mime:m("css")},js:{kind:"none",mime:m("javascript")},woff2:{kind:"none",mime:"font/woff2"}},t=e=>e.split(".").pop()?.toLowerCase()??"",a=new Set(["node_modules","__pycache__"]),
|
|
1
|
+
module.exports=[629668,e=>{"use strict";var i=e.i(687388);let m=e=>`text/${e}; charset=utf-8`,n={md:{kind:"markdown",mime:m("markdown")},markdown:{kind:"markdown",mime:m("markdown")},csv:{kind:"csv",mime:m("csv")},json:{kind:"json",mime:"application/json; charset=utf-8"},txt:{kind:"text",mime:m("plain")},log:{kind:"text",mime:m("plain")},html:{kind:"frame",mime:m("html")},htm:{kind:"frame",mime:m("html")},pdf:{kind:"frame",mime:"application/pdf"},png:{kind:"image",mime:"image/png"},jpg:{kind:"image",mime:"image/jpeg"},jpeg:{kind:"image",mime:"image/jpeg"},gif:{kind:"image",mime:"image/gif"},webp:{kind:"image",mime:"image/webp"},svg:{kind:"image",mime:"image/svg+xml"},mp3:{kind:"audio",mime:"audio/mpeg"},wav:{kind:"audio",mime:"audio/wav"},mp4:{kind:"video",mime:"video/mp4"},webm:{kind:"video",mime:"video/webm"},css:{kind:"none",mime:m("css")},js:{kind:"none",mime:m("javascript")},woff2:{kind:"none",mime:"font/woff2"}},t=e=>e.split(".").pop()?.toLowerCase()??"",a=new Set(["node_modules","__pycache__"]),s=Object.entries(n).filter(([,e])=>"none"!==e.kind).map(([e])=>e),d=RegExp(String.raw`(?<![\p{L}\p{N}_/:@%-])(?:[\p{L}\p{N}_.@%-]+/)*[\p{L}\p{N}_@%-]+(?:\.[\p{L}\p{N}_-]+)*\.(?:${s.join("|")})\b`,"giu"),o=`${i.PATHS.workspace}/`;e.s(["isListedFolder",0,e=>!e.startsWith(".")&&!a.has(e),"mimeOf",0,e=>n[t(e)]?.mime??"application/octet-stream","opensOnFinish",0,e=>e.startsWith(`${i.PATHS.artifacts}/`)&&["md","markdown","html","htm"].includes(t(e)),"pathsIn",0,function(e){let i=e.replace(/\b[a-z][\w+.-]*:\/\/\S+/gi," "),m=new Set;for(let e of i.match(d)??[]){let i=function(e){let i,m,n=(m=(i=e.trim()).indexOf(o))>=0?i.slice(m+o.length)||null:i.startsWith("/")||/^[A-Za-z]:/.test(i)||i.split("/").includes("..")?null:i||null;if(!n)return null;let[t,...a]=n.split("/");return a.length&&t.includes(".")?null:n}(e);i&&m.add(i)}return[...m].slice(0,6)},"viewKindOf",0,e=>n[t(e)]?.kind??"none"])},329280,e=>{e.v(i=>Promise.all(["server/chunks/[externals]_node_readline_1u65a-m._.js","server/chunks/node_modules_consola_dist_chunks_prompt_mjs_02axwqv._.js"].map(i=>e.l(i))).then(()=>i(781937)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=_1dbixxz._.js.map
|