@x-otto/tools 0.1.0-alpha.13 → 0.1.0-alpha.14

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/dist/index.d.ts CHANGED
@@ -956,8 +956,8 @@ declare function buildDelegationAgentListDescription(profiles: AgentSummary[]):
956
956
  declare const TaskInspectArgsSchema: z.ZodObject<{
957
957
  action: z.ZodEnum<{
958
958
  output: "output";
959
- list: "list";
960
959
  get: "get";
960
+ list: "list";
961
961
  }>;
962
962
  taskId: z.ZodOptional<z.ZodString>;
963
963
  statusFilter: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/hitl/grill-me.ts","../src/binary/binary-executor.ts","../src/binary/binary-executor-registry.ts","../src/orchestration/delegate-job.ts","../src/memory/memory-archive.ts","../src/scheduling/create.ts","../src/scheduling/list.ts","../src/scheduling/delete.ts","../src/scheduling/run.ts","../src/scheduling/cancel.ts","../src/orchestration/capability-gap.ts","../src/shell/execution-backend.ts","../src/shell/process.ts","../src/shell/sandbox/types.ts","../src/shell/background-types.ts","../src/orchestration/capture-file-state.ts","../src/orchestration/learn.ts","../src/web/search.ts","../src/orchestration/list-models.ts","../src/session/session-manager.ts","../src/skill/skill.ts","../src/memory/memory-record.ts","../src/memory/memory-read.ts","../src/orchestration/delegation-runners.ts","../src/register-builtin.ts","../src/types.ts","../src/tool-registry.ts","../src/tool-nodes.ts","../src/fs/read.ts","../src/fs/write.ts","../src/fs/edit.ts","../src/orchestration/write-todos.ts","../src/orchestration/agent-call-description.ts","../src/orchestration/task-inspect.ts","../src/orchestration/task-control.ts","../src/orchestration/tool-search.ts","../src/orchestration/constants.ts","../src/web/fetch.ts","../src/lsp/types.ts","../src/lsp/lsp-server-manager.ts","../src/lsp/lsp-client.ts","../src/lsp/lsp-wrapper.ts","../src/lsp/definition.ts","../src/lsp/references.ts","../src/lsp/symbols.ts","../src/lsp/diagnostics.ts","../src/lsp/rename.ts","../src/shell/sandbox/noop.ts","../src/shell/sandbox/macos-seatbelt.ts","../src/shell/sandbox/bubblewrap.ts","../src/shell/sandbox/platform.ts"],"mappings":";;;;;;;;KAIY,YAAA,IACV,SAAA,UACA,QAAA,EAAU,IAAA,CAAK,aAAA,YACZ,OAAA,CAAQ,WAAA;AAAA,cASP,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;KAWlB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA;AAAA,iBAElB,aAAA,CAAc,YAAA,UAAsB,KAAA,GAAQ,YAAA,GAAe,mBAAA,CAAoB,WAAA;;;UCC9E,0BAAA,SAAmC,wBAAA;;;;;EAKlD,SAAA;AAAA;AAAA,UAGe,yBAAA;EACf,MAAA;EACA,MAAA;EACA,QAAA;EDlCW;ECoCX,SAAA;AAAA;AAAA,UAGe,UAAA;EACf,IAAA;EACA,OAAA;EACA,OAAA,CAAQ,IAAA,YAAgB,OAAA,GAAU,0BAAA,GAA6B,OAAA,CAAQ,yBAAA;AAAA;;;cCzC5D,0BAAA;EAAA,QACH,QAAA;EAER,GAAA,CAAI,IAAA;EAIJ,GAAA,CAAI,IAAA,WAAe,UAAA;EAInB,QAAA,CAAS,IAAA,EAAM,UAAA;EAQf,UAAA,CAAW,IAAA;EAQL,SAAA,CAAA,GAAa,OAAA;EAQb,MAAA,CAAO,IAAA,WAAe,OAAA,CAAQ,UAAA;EAapC,OAAA,CAAA;AAAA;AAAA,cAKW,gCAAA,GACX,WAAA,UACA,cAAA,GAAiB,cAAA,KAChB,0BAAA;;;;KC5BS,QAAA,IAAY,KAAA;EAAS,MAAA;EAAgB,KAAA;EAAe,SAAA;AAAA;EAA0B,KAAA;AAAA;;;;;;;;;AHhC1F;;;;;;UIaiB,gBAAA;EACf,IAAA;EACA,SAAA;EACA,YAAA;EACA,OAAA;AAAA;AAAA,KAGU,WAAA,IAAe,WAAA,aAAwB,OAAA;AAAA,KACvC,Y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ill-me.ts","../src/binary/binary-executor.ts","../src/binary/binary-executor-registry.ts","../src/orchestration/delegate-job.ts","../src/memory/memory-archive.ts","../src/scheduling/create.ts","../src/scheduling/list.ts","../src/scheduling/delete.ts","../src/scheduling/run.ts","../src/scheduling/cancel.ts","../src/orchestration/capability-gap.ts","../src/shell/execution-backend.ts","../src/shell/process.ts","../src/shell/sandbox/types.ts","../src/shell/background-types.ts","../src/orchestration/capture-file-state.ts","../src/orchestration/learn.ts","../src/web/search.ts","../src/orchestration/list-models.ts","../src/session/session-manager.ts","../src/skill/skill.ts","../src/memory/memory-record.ts","../src/memory/memory-read.ts","../src/orchestration/delegation-runners.ts","../src/register-builtin.ts","../src/types.ts","../src/tool-registry.ts","../src/tool-nodes.ts","../src/fs/read.ts","../src/fs/write.ts","../src/fs/edit.ts","../src/orchestration/write-todos.ts","../src/orchestration/agent-call-description.ts","../src/orchestration/task-inspect.ts","../src/orchestration/task-control.ts","../src/orchestration/tool-search.ts","../src/orchestration/constants.ts","../src/web/fetch.ts","../src/lsp/types.ts","../src/lsp/lsp-server-manager.ts","../src/lsp/lsp-client.ts","../src/lsp/lsp-wrapper.ts","../src/lsp/definition.ts","../src/lsp/references.ts","../src/lsp/symbols.ts","../src/lsp/diagnostics.ts","../src/lsp/rename.ts","../src/shell/sandbox/noop.ts","../src/shell/sandbox/macos-seatbelt.ts","../src/shell/sandbox/bubblewrap.ts","../src/shell/sandbox/platform.ts"],"mappings":";;;;;;;;KAIY,YAAA,IACV,SAAA,UACA,QAAA,EAAU,IAAA,CAAK,aAAA,YACZ,OAAA,CAAQ,WAAA;AAAA,cASP,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;KAWlB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA;AAAA,iBAElB,aAAA,CAAc,YAAA,UAAsB,KAAA,GAAQ,YAAA,GAAe,mBAAA,CAAoB,WAAA;;;UCC9E,0BAAA,SAAmC,wBAAA;;;;;EAKlD,SAAA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AAA;;;;;UAyDA,iBAAA;AAAA;AAAA,iBAYM,0BAAA,CAA2B,OAAA,GAAU,oBAAA,GAAuB,oBAAA;;;;;;UC9I3D,iBAAA;;;;AjDJjB;EiDSE,OAAA;;;;;;EAMA,aAAA;EjDZU;;;;;;EiDmBV,aAAA;AAAA;;AjDnBuB;;;;;;;;;;;;;;;;;ciDwCZ,iBAAA,YAA6B,eAAA;EAAA,SAC/B,IAAA;EAAA,iBAEQ,OAAA;cAEL,OAAA,GAAS,iBAAA;EAQrB,IAAA,CAAK,KAAA,EAAO,gBAAA,GAAmB,iBAAA;EAuEzB,OAAA,CAAA,GAAW,OAAA;AAAA;AAAA,iBASH,uBAAA,CAAwB,OAAA,GAAU,iBAAA,GAAoB,iBAAA;;;;;;UC7HrD,sBAAA;;EAEf,OAAA;;AlDbF;;;EkDkBE,aAAA;ElDhBU;;;;EkDqBV,aAAA;ElDtBA;;;;EkD2BA,KAAA;AAAA;;;AlDzBuB;;;iBkDiCT,uBAAA,CAAA;;;;;;;;;iBAmBA,qBAAA,CAAsB,OAAA,GAAS,sBAAA,GAA8B,eAAA;;;;;;;;;;;iBA8C7D,0BAAA,CAAA"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import{z as e}from"zod";import{API_IMAGE_DIMENSION_LIMIT_PX as t,PROVIDER_IMAGE_INLINE_MAX_BYTES as n,acquireFileLock as r,buildAllowedEnv as i,createLogger as a,createProjectOverflowLogPath as o,createTempLoggerPath as s,exists as c,formatBytes as l,getHomeDir as u,getThirdPartyToolBinaryDir as d,getThirdPartyToolDir as f,invariant as p,isDirectory as m,isFile as h,mime as g,mkdirp as _,normalizePath as v,parseJsonc as y,probeImageDimensions as ee,releaseFileLock as b,sweepStaleProjectOverflowLogs as te,sweepStaleTempLogs as ne,toTruncationMeta as x,truncateHead as S,truncateLine as C,truncateTail as w}from"@x-otto/shared";import T from"os";import E,{homedir as re,tmpdir as ie}from"node:os";import{appendFileSync as ae,chmodSync as oe,closeSync as se,copyFileSync as ce,createReadStream as le,createWriteStream as ue,existsSync as D,mkdirSync as O,openSync as de,readFileSync as fe,readdirSync as pe,realpathSync as me,rmSync as he,statSync as ge,writeFileSync as _e}from"node:fs";import{glob as ve,readFile as k,rename as ye,stat as be,unlink as xe,writeFile as A}from"node:fs/promises";import{createHash as Se,randomUUID as Ce}from"node:crypto";import{dirname as j,extname as we,isAbsolute as Te,join as M,relative as N,resolve as P,sep as Ee}from"node:path";import{Readable as De}from"node:stream";import{pipeline as Oe}from"node:stream/promises";import{setTimeout as ke}from"node:timers/promises";import{spawn as F}from"node:child_process";import{OTTO_PROJECT_DIR as Ae,OTTO_USER_AGENT as je,SETTING_OFFLINE_MODE_ENABLED as Me,normalizeEnv as I}from"@x-otto/env";import{createInterface as Ne}from"node:readline";import{Worker as Pe}from"node:worker_threads";import{diffLines as Fe}from"diff";import{WORKFLOW_SLOTS as Ie}from"@x-otto/ai";import{checkDelegationDepth as Le,createTodoStore as Re,resolveTodoSyncTargets as ze}from"@x-otto/orchestration-contracts";import{fileURLToPath as Be,pathToFileURL as L}from"node:url";const Ve=e.object({label:e.string(),rationale:e.string().describe(`选这项的含义/利弊(plain language)`),recommended:e.boolean().optional(),preview:e.string().optional().describe(`两段具体产物并排对比`)}),He=e.object({header:e.string().max(24).describe(`短主题标签(≤24 字),便于 UI/日志`),question:e.string().describe(`一个清晰具体的关键问题`),background:e.string().describe(`详细背景与前因后果(grill 纪律:必填)`),recommendation:e.string().describe(`推荐答案 + 理由(必填);无真人应答时被自动采纳`),options:e.array(Ve).optional(),allowFreeform:e.boolean().optional().default(!0),multiSelect:e.boolean().optional().default(!1),evidence:e.array(e.string()).optional().describe(`引用的本地证据/社区方案`)});function Ue(e,t){return{name:`grill_me`,description:`Background and recommendation are required fields; advisory only — side effects still pass permission/approval. Otherwise decide yourself.`,parameters:He,readonly:!1,async execute({params:e,agentName:n,sessionId:r}){if(!t||!r)return{content:[{type:`text`,text:`grill_me is not available in this context. If you need clarification, return your open question in your result so the lead/main agent can ask the human.`}],isError:!0,errorKind:`runtime`};let i=await t(r,{header:e.header,question:e.question,background:e.background,recommendation:e.recommendation,options:e.options,allowFreeform:e.allowFreeform,multiSelect:e.multiSelect,evidence:e.evidence,askedBy:n??`agent`});return{content:[{type:`text`,text:`${i.resolvedBy===`auto_recommendation`?`(无真人应答,已采纳推荐)`:``}${i.answer}`}],details:{resolvedBy:i.resolvedBy,acceptedRecommendation:i.acceptedRecommendation,selectedOptionLabels:i.selectedOptionLabels,freeformText:i.freeformText}}}}}const R=I(process.env.TOOLS_MAX_OUTPUT_LINES,2e3),z=I(process.env.TOOLS_MAX_OUTPUT_BYTES,60*1024),B=I(process.env.TOOLS_EXECUTE_TIMEOUT_MS,3e4),We=I(process.env.TOOLS_BINARY_DOWNLOAD_TIMEOUT_MS,12e5),Ge=I(process.env.TOOLS_MAX_WRITE_BYTES,10*1024*1024),V=I(process.env.TOOLS_MAX_FETCH_BYTES,5*1024*1024),Ke=I(process.env.TOOLS_BINARY_PROBE_TIMEOUT_MS,5e3);function H(e,t){return Object.assign(Error(e),{errorKind:t})}const qe=a(`@x-otto/tools:binary`),Je=256*1024;async function Ye(e,t=[`--version`]){try{return(await Xe(e,t,{timeout:Ke})).status===0}catch{return!1}}function Xe(e,t,n){return new Promise((r,i)=>{let a=F(e,t,{stdio:[`ignore`,`ignore`,`pipe`]}),o=``;a.stderr?.on(`data`,e=>{o+=e.toString()}),n?.timeout&&setTimeout(()=>{a.kill(),i(Error(`timeout`))},n.timeout),a.on(`close`,e=>r({status:e,stderr:o})),a.on(`error`,i)})}async function Ze(e,t=e){let n=E.platform()===`win32`?`.exe`:``,r=d(t,e)+n;try{if(D(r))return r}catch{qe.debug(`Error checking existence of ${r}, will try PATH lookup: %s`,r)}return await Ye(e)?e:null}const Qe=`tool-download`;async function $e(e,t,n){if(!t){qe.warn(`No checksum configured for %s — integrity not verified`,n);return}let r=Se(`sha256`);r.update(await k(e));let i=r.digest(`hex`);if(i.toLowerCase()!==t.toLowerCase())throw H(`Checksum mismatch for ${n}: expected ${t}, got ${i}`,`validation`)}async function et(e,t,n){let r=async(t,n)=>{try{let{status:e,stderr:r}=await Xe(t,n);if(e!==0)throw Error(r?.trim()||`exit code ${e}`)}catch(t){throw H(`Failed to extract ${e}: ${t instanceof Error?t.message:String(t)}`,`io`)}};if(e.endsWith(`.tar.gz`)||e.endsWith(`.tgz`)){await r(`tar`,[`xzf`,t,`-C`,n]);return}if(e.endsWith(`.zip`)){E.platform()===`win32`?await r(`powershell`,[`-NoProfile`,`-Command`,`Expand-Archive -LiteralPath '${t}' -DestinationPath '${n}' -Force`]):await r(`unzip`,[`-o`,`-q`,t,`-d`,n]);return}throw H(`Unsupported archive format: ${e}`,`validation`)}async function tt(e,t,n){let i=Date.now()+We,a={prefix:Qe,timeoutMs:3e5};for(;;){if(await r(e,t,a))return!0;if(D(n)||Date.now()>i)return!1;await ke(200)}}async function nt(e){let{name:t,cacheDir:n,url:r,checksum:i}=e,a=E.platform(),o=f(),s=t+(a===`win32`?`.exe`:``),c=P(o,n),l=P(c,s),u=Ce(),d=P(o,`${n}-${u}.download`),p=P(o,`${n}-extract-${u}`);if(O(o,{recursive:!0}),await tt(o,n,l))try{if(D(l))return;let e=await fetch(r,{headers:{"User-Agent":je},signal:AbortSignal.timeout(We)});if(!e.ok||!e.body)throw H(`Failed to download: ${e.status}`,`network`);let t=ue(d);await Oe(De.fromWeb(e.body),t),await $e(d,i,r),O(c,{recursive:!0}),O(p,{recursive:!0}),await et(r,d,p);let n=rt(p,s);if(!n)throw H(`Binary ${s} not found in archive`,`not_found`);ce(n,l),a!==`win32`&&oe(l,493)}catch(e){return qe.warn(e),e instanceof Error?e:Error(String(e))}finally{he(d,{force:!0}),he(p,{recursive:!0,force:!0}),await b(o,n,{prefix:Qe})}}function rt(e,t){let n=[e];for(;n.length>0;){let e=n.pop(),r;try{r=pe(e,{encoding:`utf-8`})}catch{continue}for(let i of r){let r=M(e,i);try{let e=ge(r);if(e.isDirectory())n.push(r);else if(e.isFile()&&i===t)return r}catch{continue}}}}var U=class{get cacheDir(){return`${this.name}-${this.version}`}projectRoot;downloadTask=null;lastDownloadError;processTracker;constructor(e,t){this.projectRoot=e,this.processTracker=t}resolveChecksum(){}async ensure(){let e=await Ze(this.name,this.cacheDir);if(e)return e;if(Me)throw H(`${this.name} not found and offline mode is enabled`,`not_found`);this.downloadTask||=this.download().finally(()=>{this.downloadTask=null}),await this.downloadTask;let t=await Ze(this.name,this.cacheDir);if(!t){let e=this.lastDownloadError,t=H(`${this.name}: download failed${e?` — ${e.message}`:` (binary not found)`}`,`not_found`);throw e&&(t.cause=e),t}return t}async download(){let e=this.resolveUrl();p(e,`No download URL for ${this.name}`),this.lastDownloadError=await nt({name:this.name,cacheDir:this.cacheDir,url:e,checksum:this.resolveChecksum()})}async execute(e,t){let n=await this.ensure(),r=t?.maxBuffer;return new Promise((i,a)=>{let o=F(n,e,{cwd:t?.cwd,env:t?.env,timeout:t?.timeout,signal:t?.signal});this.processTracker?.registerChild({command:n,args:e,owner:{type:`agent-tool`,id:`binary`},category:`tool`,lifecycle:`evictable`,cwd:typeof t?.cwd==`string`?t.cwd:void 0},o);let s=[],c=[],l=0,u=0,d=!1,f,p=()=>{try{o.kill(`SIGTERM`)}catch{}f=setTimeout(()=>{try{o.kill(`SIGKILL`)}catch{}},2e3),f.unref?.()};o.stdout.on(`data`,e=>{if(!d){if(r!==void 0&&l+e.byteLength>r){let t=r-l;t>0&&(s.push(e.subarray(0,t)),l=r),d=!0,p();return}s.push(e),l+=e.byteLength}}),o.stderr.on(`data`,e=>{if(u>=Je)return;let t=Je-u;e.byteLength>t?(c.push(e.subarray(0,t)),u=Je):(c.push(e),u+=e.byteLength)}),o.on(`error`,e=>{f&&clearTimeout(f),a(e)}),o.on(`close`,e=>{if(f&&clearTimeout(f),!d&&e!==0)return a(Error(`Process exited with code ${e}: ${Buffer.concat(c).toString()}`));i({stdout:Buffer.concat(s).toString(),stderr:Buffer.concat(c).toString(),exitCode:d?0:e,truncated:d})})})}};function it(e,t,n){return`https://github.com/${e}/releases/download/v${t}/${n}`}const at={"fd-v10.4.2-aarch64-apple-darwin.tar.gz":`623dc0afc81b92e4d4606b380d7bc91916ba7b97814263e554d50923a39e480a`,"fd-v10.4.2-aarch64-unknown-linux-gnu.tar.gz":`6c51f7c5446b3338b1e401ff15dc194c590bb2fa64fd43ff3278300f073adec5`,"fd-v10.4.2-x86_64-unknown-linux-gnu.tar.gz":`def59805cd14b5651b68990855f426ad087f3b96881296d963910431ba3143c8`,"fd-v10.4.2-aarch64-pc-windows-msvc.zip":`4f9110c2d5b33a7f760bfa5510f4c113d828109f7277d421b1053a9943c0fc92`,"fd-v10.4.2-x86_64-pc-windows-msvc.zip":`b2816e506390a89941c63c9187d58a3cc10e9a55f2ef0685f9ea0eccaf7c98c8`},W=`10.4.2`,ot={"darwin/arm64":`fd-v${W}-aarch64-apple-darwin.tar.gz`,"darwin/x64":`fd-v${W}-x86_64-apple-darwin.tar.gz`,"linux/arm64":`fd-v${W}-aarch64-unknown-linux-gnu.tar.gz`,"linux/x64":`fd-v${W}-x86_64-unknown-linux-gnu.tar.gz`,"win32/arm64":`fd-v${W}-aarch64-pc-windows-msvc.zip`,"win32/x64":`fd-v${W}-x86_64-pc-windows-msvc.zip`};var st=class extends U{name=`fd`;version=W;repository=`sharkdp/fd`;constructor(e,t){super(e,t)}resolveAsset(){let e=`${T.platform()}/${T.arch()}`,t=ot[e];if(!t)throw Error(`Unsupported platform/architecture: ${e}`);return t}resolveUrl(){return it(this.repository,this.version,this.resolveAsset())}resolveChecksum(){return at[this.resolveAsset()]}};const ct=(e,t)=>new st(e,t);function lt(e,t,n){return`https://github.com/${e}/releases/download/${t}/${n}`}const ut={"ripgrep-15.1.0-aarch64-apple-darwin.tar.gz":`378e973289176ca0c6054054ee7f631a065874a352bf43f0fa60ef079b6ba715`,"ripgrep-15.1.0-x86_64-apple-darwin.tar.gz":`64811cb24e77cac3057d6c40b63ac9becf9082eedd54ca411b475b755d334882`,"ripgrep-15.1.0-aarch64-unknown-linux-gnu.tar.gz":`2b661c6ef508e902f388e9098d9c4c5aca72c87b55922d94abdba830b4dc885e`,"ripgrep-15.1.0-x86_64-unknown-linux-musl.tar.gz":`1c9297be4a084eea7ecaedf93eb03d058d6faae29bbc57ecdaf5063921491599`,"ripgrep-15.1.0-aarch64-pc-windows-msvc.zip":`00d931fb5237c9696ca49308818edb76d8eb6fc132761cb2a1bd616b2df02f8e`,"ripgrep-15.1.0-x86_64-pc-windows-msvc.zip":`124510b94b6baa3380d051fdf4650eaa80a302c876d611e9dba0b2e18d87493a`};var dt=class extends U{name=`rg`;repository=`BurntSushi/ripgrep`;version=`15.1.0`;constructor(e,t){super(e,t)}resolveAsset(){let e=T.platform(),t=T.arch();switch(e){case`darwin`:return t===`arm64`?`ripgrep-${this.version}-aarch64-apple-darwin.tar.gz`:`ripgrep-${this.version}-x86_64-apple-darwin.tar.gz`;case`linux`:return t===`arm64`?`ripgrep-${this.version}-aarch64-unknown-linux-gnu.tar.gz`:`ripgrep-${this.version}-x86_64-unknown-linux-musl.tar.gz`;case`win32`:return t===`arm64`?`ripgrep-${this.version}-aarch64-pc-windows-msvc.zip`:`ripgrep-${this.version}-x86_64-pc-windows-msvc.zip`}throw Error(`Unsupported platform/architecture: ${e}/${t}`)}resolveUrl(){return lt(this.repository,this.version,this.resolveAsset())}resolveChecksum(){return ut[this.resolveAsset()]}};const ft=(e,t)=>new dt(e,t),pt=a(`@x-otto/tools:binary-executor-registry`);var mt=class{binaries=new Map;has(e){return this.binaries.has(e)}get(e){return this.binaries.get(e)}register(e){this.binaries.has(e.name)?pt.warn(`Tool ${e.name} is already registered, skipping`):this.binaries.set(e.name,e)}unregister(e){this.binaries.has(e)?this.binaries.delete(e):pt.warn(`Tool ${e} is not registered, skipping`)}async ensureAll(){for(let e of this.binaries.values())e instanceof U&&await e.ensure()}async ensure(e){let t=this.binaries.get(e);if(!t)throw Error(`Tool ${e} not found in registry`);return t instanceof U&&await t.ensure(),t}dispose(){this.binaries.clear()}};const ht=(e,t)=>{let n=new mt;return n.register(ct(e,t)),n.register(ft(e,t)),n};function gt(e){return typeof e==`function`?e():e}const _t=()=>({chunks:Buffer.alloc(0),stdout:Buffer.alloc(0),stderr:Buffer.alloc(0),exitCode:-1,timedOut:!1}),vt=(e,t)=>{try{process.kill(-e,t)}catch{try{process.kill(e,t)}catch{}}},yt=new class{name=`local`;execute(e,t,n,r){let{cwd:a,env:o,timeout:s,signal:c}=n;return new Promise((n,l)=>{if(c?.aborted){l(Error(`Process execution aborted before start`));return}let u=_t(),d=[],f=[],p=[],m,h=()=>{let e=y.pid;if(e!==void 0){if(process.platform===`win32`){F(`taskkill`,[`/F`,`/T`,`/PID`,`${e}`],{stdio:`ignore`,detached:!0});return}vt(e,`SIGTERM`),m=setTimeout(()=>vt(e,`SIGKILL`),2e3)}},g=setTimeout(()=>{u.timedOut=!0,h()},s),_=()=>h();c?.addEventListener(`abort`,_,{once:!0});let v=()=>{clearTimeout(g),m&&clearTimeout(m),c?.removeEventListener(`abort`,_)},y=F(e,t,{cwd:a,env:i(o),stdio:[`ignore`,`pipe`,`pipe`],detached:process.platform!==`win32`});y.stdout?.on(`data`,e=>{d.push(e),p.push(e),r?.(e,`stdout`)}),y.stderr?.on(`data`,e=>{f.push(e),p.push(e),r?.(e,`stderr`)}),y.on(`error`,e=>{v(),l(e)}),y.on(`close`,e=>{u.exitCode=e??-1,u.stdout=Buffer.concat(d),u.stderr=Buffer.concat(f),u.chunks=Buffer.concat(p),v(),u.timedOut?l(Error(`Process timed out after ${s}ms`)):n(u)})})}};function bt(e,t,n){let r=e,a=t,o=n.cwd,s=n.env;if(n.sandbox){let e=n.projectRoot??o,t=n.sandbox.wrap({command:r,args:a,options:{timeout:0,cwd:o,env:s,projectRoot:e},projectRoot:e});r=t.command,a=t.args,o=t.options.cwd??o,s=t.options.env}let c=n.onOutputChunk!==void 0,l,u;if(c){u=de(n.logPath,`a`),l=F(r,a,{cwd:o,env:i(s),stdio:[`ignore`,`pipe`,`pipe`],detached:process.platform!==`win32`});let e=(e,t)=>{if(u!==void 0)try{ae(u,e)}catch{}n.onOutputChunk?.(e,t)};l.stdout?.on(`data`,t=>e(t,`stdout`)),l.stderr?.on(`data`,t=>e(t,`stderr`)),l.once(`exit`,()=>{if(u!==void 0){try{se(u)}catch{}u=void 0}}),l.stdout?.unref?.(),l.stderr?.unref?.()}else{let e=de(n.logPath,`a`);try{l=F(r,a,{cwd:o,env:i(s),stdio:[`ignore`,e,e],detached:process.platform!==`win32`})}finally{se(e)}}l.once(`error`,e=>{try{ae(n.logPath,`\n[otto] background spawn error: ${e.message}\n`)}catch{}}),l.unref();let d=l.pid;if(d===void 0)throw Error(`Failed to spawn background process (no pid)`);return{child:l,pid:d}}function xt(e,t,n){let r=n.sandbox;if(r){let i=n.projectRoot??n.cwd??process.cwd(),a=r.wrap({command:e,args:t,options:n,projectRoot:i});e=a.command,t=a.args,n=a.options}let{cwd:i,env:a,timeout:o,signal:s,onProgress:c}=n;return(gt(n.backend)??yt).execute(e,t,{cwd:i,env:a,timeout:o,signal:s},c)}const St=new Set([2,126,127]),Ct={seatbelt:{fatal:[/operation not permitted/i,/permission denied/i,/deny file-write/i,/sandbox.*denied/i,/not allowed by sandbox/i],benign:[]},bubblewrap:{fatal:[/bwrap.*(?:denied|refused|not permitted)/i,/operation not permitted/i,/read-only file system/i,/no such file or directory: \/proc/i],benign:[/^bwrap: warning/i,/^bwrap: creating new namespace/i]},"windows-acl":{fatal:[/access is denied/i,/eacces/i,/erofs/i,/file.*denied/i],benign:[]},unknown:{fatal:[/permission denied/i,/eacces/i,/eperm/i,/erofs/i,/read-only file system/i,/seccomp/i,/landlock/i,/operation not permitted/i],benign:[]}};function wt(e,t,n=`unknown`){if(e===159)return{denied:!0,reason:`exit code 159 (128+SIGSYS, seccomp violation)`,backend:n};if(e!==null&&e!==2&&St.has(e))return{denied:!1,backend:n};let r=Tt(t,Ct[n].benign),i=Et(r,Ct[n].fatal);if(i)return{denied:!0,reason:`${n} dialect: ${i}`,backend:n};let a=Et(r,Ct.unknown.fatal);return a?{denied:!0,reason:`generic signature: ${a}`,backend:`unknown`}:{denied:!1,backend:n}}function Tt(e,t){return t.length===0?e:e.split(`
2
2
  `).filter(e=>!t.some(t=>t.test(e))).join(`
3
- `)}function Et(e,t){for(let n of t){let t=n.exec(e);if(t)return t[0]}}const Dt=/\b(https?|wss?):\/\/([-\w.]+)(?::(\d{2,5}))?(\/[^\s)\],."']*)?/i,Ot=/\b(?:listening on\s+(?:port\s+)?|(?:running\s+)?at\s+:|on\s+:|port[:\s]+)(\d{2,5})\b/i;function kt(e){return/^wss?$/i.test(e)?`ws`:`http`}function At(e){let t=e.match(Dt);if(t){let[e,n,,r]=t,i=r?Number(r):void 0;return{url:e,port:i!==void 0&&i>0&&i<=65535?i:void 0,protocol:kt(n)}}let n=e.match(Ot);if(n){let e=Number(n[1]);if(e>0&&e<=65535)return{port:e,protocol:`tcp`}}return null}const jt=e.object({command:e.string().describe(`Shell command to execute`),targetDir:e.string().optional().describe(`Working directory (relative to project root)`),timeout:e.number().int().min(1e3).optional().describe(`Timeout (ms), default 30000`),run_in_background:e.boolean().optional().describe(`Run as a long-lived background process (dev servers, watchers). Returns immediately with a background id.`)}),Mt=a(`@x-otto/tools:bash`);function Nt(e,t,n,r,i,a){return{name:`bash`,description:`Execute a shell command and return stdout/stderr. Default timeout is 30 seconds.`,parameters:jt,regenerableOutput:!0,async execute({params:o,signal:s,id:c,sessionId:l}){let u=P(e,o.targetDir??`.`),d=o.timeout??B,f=typeof n==`function`?n({command:o.command}):n,p=gt(i);return o.run_in_background?!r||!l?{content:[{type:`text`,text:`Background execution is unavailable in this context (no process registry / session). Re-run without run_in_background, or run a short-lived foreground command.`}],isError:!0,errorKind:`runtime`}:It(o.command,u,e,f,r,l,c,a?.()):await Bt(o.command,u,e,d,t,s,f,p,a?.())}}}function Pt(e){let t=e.match(/(?:--port[ =]|-p\s+|localhost:|0\.0\.0\.0:|127\.0\.0\.1:|http\.server\s+)(\d{2,5})\b/i);if(t){let e=Number(t[1]);if(e>0&&e<=65535)return e}}function Ft(e){let t=``;return n=>{t+=n.toString(`utf-8`);let r;for(;(r=t.indexOf(`
3
+ `)}function Et(e,t){for(let n of t){let t=n.exec(e);if(t)return t[0]}}const Dt=/\b(https?|wss?):\/\/([-\w.]+)(?::(\d{2,5}))?(\/[^\s)\],."']*)?/i,Ot=/\b(?:listening on\s+(?:port\s+)?|(?:running\s+)?at\s+:|on\s+:|port[:\s]+)(\d{2,5})\b/i;function kt(e){return/^wss?$/i.test(e)?`ws`:`http`}function At(e){let t=e.match(Dt);if(t){let[e,n,,r]=t,i=r?Number(r):void 0;return{url:e,port:i!==void 0&&i>0&&i<=65535?i:void 0,protocol:kt(n)}}let n=e.match(Ot);if(n){let e=Number(n[1]);if(e>0&&e<=65535)return{port:e,protocol:`tcp`}}return null}const jt=e.object({command:e.string().describe(`Shell command to execute`),targetDir:e.string().optional().describe(`Working directory (relative to project root)`),timeout:e.number().int().min(1e3).optional().describe(`Timeout (ms), default 30000`),run_in_background:e.boolean().optional().describe(`Run as a long-lived background process (dev servers, watchers). Returns immediately with a background id.`)}),Mt=a(`@x-otto/tools:bash`);function Nt(e,t,n,r,i,a){return{name:`bash`,description:`Execute a shell command and return stdout/stderr. Default timeout is 30 seconds; set reasonable timeouts for long-running commands rather than waiting indefinitely. Avoid commands requiring interactive input. Prefer non-interactive flags (e.g. git --no-pager, --non-interactive).`,parameters:jt,regenerableOutput:!0,async execute({params:o,signal:s,id:c,sessionId:l}){let u=P(e,o.targetDir??`.`),d=o.timeout??B,f=typeof n==`function`?n({command:o.command}):n,p=gt(i);return o.run_in_background?!r||!l?{content:[{type:`text`,text:`Background execution is unavailable in this context (no process registry / session). Re-run without run_in_background, or run a short-lived foreground command.`}],isError:!0,errorKind:`runtime`}:It(o.command,u,e,f,r,l,c,a?.()):await Bt(o.command,u,e,d,t,s,f,p,a?.())}}}function Pt(e){let t=e.match(/(?:--port[ =]|-p\s+|localhost:|0\.0\.0\.0:|127\.0\.0\.1:|http\.server\s+)(\d{2,5})\b/i);if(t){let e=Number(t[1]);if(e>0&&e<=65535)return e}}function Ft(e){let t=``;return n=>{t+=n.toString(`utf-8`);let r;for(;(r=t.indexOf(`
4
4
  `))!==-1;){let n=t.slice(0,r);t=t.slice(r+1);let i=At(n);i&&e(i)}}}function It(e,t,n,r,i,a,o,c){let l=`bg_${a}_${o}`,u=s();ne(Lt,Date.now());try{let o=Ft(e=>{i.updateDetectedService(l,e)}),{child:s,pid:d}=bt(`sh`,[`-c`,e],{cwd:t,projectRoot:n,sandbox:r,env:c,logPath:u,onOutputChunk:e=>o(e)}),f=Pt(e);try{i.register({id:l,sessionId:a,child:s,command:e,cwd:t,logPath:u,port:f})}catch(e){try{process.kill(-d,`SIGKILL`)}catch{try{s.kill(`SIGKILL`)}catch{}}throw e}return{content:[{type:`text`,text:`Started in background.\nid: ${l}\npid: ${d}\nlog: ${u}${f?`\nlikely port: ${f}`:``}\n\nRead output with bash_output(background_id="${l}"); stop it with kill_shell(background_id="${l}"). It is auto-killed when the session ends.`}],details:{backgroundProcessId:l,pid:d,logPath:u,port:f}}}catch(e){let t=e instanceof Error?e.message:String(e);return Mt.warn({err:t},`Failed to start background process`),{content:[{type:`text`,text:`Failed to start background process: ${t}`}],isError:!0,errorKind:`runtime`}}}const Lt=60*6e4;function Rt(e){return e?e.includes(`seatbelt`)?`seatbelt`:e.includes(`bubblewrap`)||e.includes(`bwrap`)?`bubblewrap`:`unknown`:`unknown`}function zt(e){let t=e.trim();return t?(t.length>2048?`${t.slice(0,2048)}…`:t).split(`
5
5
  `).slice(0,8).join(`
6
6
  `):``}async function Bt(e,t,n,r,i,a,c,u,d){let f=z*2,p=[],m=0,h=0,g=0,_=0,v,y,ee=()=>{if(!i)return;let e=w(Buffer.concat(p).toString(`utf-8`),{maxLines:R,maxBytes:z});i({content:[{type:`text`,text:e.content||``}],details:{truncation:x(e),outputPath:v}})},b=await xt(`sh`,[`-c`,e],{timeout:r,signal:a,cwd:t,sandbox:c,projectRoot:n,backend:u,env:d,onProgress:e=>{if(p.push(e),m+=e.byteLength,h+=e.byteLength,m>z&&!v){ne(Lt,Date.now()),te(6048e5,Date.now());let e=o();try{O(j(e),{recursive:!0})}catch{e=s()}v=e,y=ue(e),y.on(`error`,e=>{Mt.warn({err:e.message},`bash overflow log write failed; disabling overflow log`),y=void 0,v=void 0});for(let e of p)y.write(e)}else y&&y.write(e);for(;h>f&&p.length>1;){let e=p.shift();e&&(h-=e.byteLength)}g+=e.byteLength;let t=Date.now();g>=4096&&t-_>=100&&(g=0,_=t,ee())}});y?.end();let S=Buffer.concat(p).toString(`utf-8`),C=w(S,{maxLines:R,maxBytes:z}),T=C.content||`(no output)`,E={truncation:x(C),outputPath:v};if(C.truncated){let e=C.totalLines-C.outputLines+1,t=C.totalLines,n=v?` Full output: ${v}`:``;if(C.lastLinePartial){let e=l(Buffer.byteLength(S.split(`
@@ -89,7 +89,7 @@ import{z as e}from"zod";import{API_IMAGE_DIMENSION_LIMIT_PX as t,PROVIDER_IMAGE_
89
89
  `)}\n\nTell the user what you found and let THEM run the install command — you cannot install it yourself, and installing high-risk capabilities requires their explicit approval.`+u}],details:{suggestion:`install`,hits:c.length}}}let d=wr(t.need);return{content:[{type:`text`,text:`No existing plugin in the ecosystem provides "${t.need}".\n\nYou can offer to build one. Blueprint:\n 1. Ask the user whether they want this capability added as a plugin.\n 2. Scaffold it: otto extension create ${d} --with-tool\n 3. Implement it with delegate_job (isolated worktree, produces a reviewable diff) — describe the tool's name, parameters, and behaviour in the job prompt.\n 4. The user reviews the diff (/job apply), then installs it — installation and any high-risk capability grants always go through their explicit approval.`+u}],details:{suggestion:`generate`,hits:0}}}}}const Er=e.object({action:e.enum([`get`,`list`,`output`]).describe(`get task by ID, list all tasks, or get background task output`),taskId:e.string().optional().describe(`Task ID (required for get/output actions)`),statusFilter:e.enum([`all`,`pending`,`running`,`completed`,`failed`,`cancelled`]).optional().default(`all`).describe(`Filter by status (list action only)`)});function Dr(e,t){let{get:n,list:r,output:i}=t;return{name:`task_inspect`,description:`Inspect tasks: get details by ID, list with optional status filter, or get background task output.`,parameters:Er,readonly:!0,async execute({params:e}){switch(e.action){case`get`:{if(!n)return K(`task_inspect(get)`);if(!e.taskId)return{content:[{type:`text`,text:`taskId is required for get action`}],isError:!0,errorKind:`validation`};let t=await n(e.taskId);if(!t.ok)return{content:[{type:`text`,text:t.error}],isError:!0,errorKind:`runtime`};let r=t.value,i=r.status===`failed`||!!r.error;return{content:[{type:`text`,text:[`Task: ${r.id}`,`Status: ${r.status}`,r.prompt?`Prompt: ${r.prompt}`:void 0,`Output: ${r.output??`N/A`}`,r.error?`Error: ${r.error}`:void 0].filter(e=>!!e).join(`
90
90
  `)}],isError:i,details:{task:r}}}case`list`:{if(!r)return K(`task_inspect(list)`);let t=await r(e.statusFilter===`all`?void 0:e.statusFilter);if(t.ok){let e=t.value;return e.length===0?{content:[{type:`text`,text:`No tasks found.`}]}:{content:[{type:`text`,text:e.map(e=>`- [${e.status}] ${e.id}: ${e.prompt.slice(0,80)}`).join(`
91
91
  `)}]}}throw Error(t.error)}case`output`:{if(!i)return K(`task_inspect(output)`);if(!e.taskId)return{content:[{type:`text`,text:`taskId is required for output action`}],isError:!0,errorKind:`validation`};let t=await i(e.taskId);if(t.ok){let{status:e,output:n}=t.value;return{content:[{type:`text`,text:`Status: ${e}\nOutput:\n${n??`(no output)`}`}],details:{status:e}}}return{content:[{type:`text`,text:t.error}],isError:!0,errorKind:`runtime`}}}}}}const Or=e.object({action:e.enum([`cancel`,`retry`]).describe(`cancel a running task, or retry a failed task`),taskId:e.string().describe(`Task ID to act on`)});function kr(e,t){let{update:n,cancelBackground:r}=t;return{name:`task_control`,description:`Control tasks: cancel a running task or retry a failed one.`,parameters:Or,async execute({params:e}){switch(e.action){case`cancel`:if(n){let t=await n(e.taskId,`cancel`);return t.ok?{content:[{type:`text`,text:t.value}]}:{content:[{type:`text`,text:t.error}],isError:!0,errorKind:`runtime`}}if(r){let t=await r(e.taskId);return t.ok?{content:[{type:`text`,text:`Task ${e.taskId} cancelled successfully`}]}:{content:[{type:`text`,text:t.error}],isError:!0,errorKind:`runtime`}}return K(`task_control(cancel)`);case`retry`:{if(!n)return K(`task_control(retry)`);let t=await n(e.taskId,`retry`);return t.ok?{content:[{type:`text`,text:t.value}]}:{content:[{type:`text`,text:t.error}],isError:!0,errorKind:`runtime`}}}}}}const Ar=e.object({availableOnly:e.boolean().optional().describe(`Only list models usable by the current account (authenticated, not rate-limit-risky) — recommended before picking a subagent model`)});function jr(e,t){return{name:`list_models`,description:"List models with their capability strengths (planning/knowledge/coding/reasoning/vision/speed/long-context) and usability. Use this to choose the best model for a sub-agent via the `model` param of task_delegate. Only pick models marked ✓ (usable); ✗ models are unauthenticated or rate-limit-risky and will be rejected.",parameters:Ar,readonly:!0,isConcurrencySafe:()=>!0,async execute({params:n}){if(!e)return K(`list_models`);let r=await e(t);return n.availableOnly&&(r=r.filter(e=>e.usable!==!1)),r.length===0?{content:[{type:`text`,text:`No usable models. Run /login or /model refresh first.`}]}:{content:[{type:`text`,text:`Models (✓ = usable, ✗ = unauthenticated/rate-limit-risky):\n${r.map(e=>{let t=e.usable===!1?`✗`:`✓`,n=e.usable===!1&&e.unusableReason?` (${e.unusableReason})`:``;return`${t} ${e.id} [${e.strengths.join(`/`)||`general`}]${n}`}).join(`
92
- `)}`}]}}}}const Mr=e.object({id:e.string().describe(`Unique identifier`),title:e.string().describe(`Short description of the task`),status:e.enum([`pending`,`in_progress`,`done`,`skipped`,`failed`]).describe(`Current status`)}),Nr=e.object({title:e.string().optional().describe(`Optional list title (e.g. "Bug fixes"); defaults to "Task".`),action:e.enum([`set`,`update`]).describe(`set: replace all todos; update: merge by id`),todos:e.array(Mr).describe(`Todo items`)});function Pr(e){let t=e??Re();return{name:`write_todos`,description:`Track progress with a lightweight todo list (shown pinned above the input). "set" replaces all todos; "update" merges by id. Optional "title" labels the list (defaults to "Task"). Use for multi-step tasks (3+ steps).`,parameters:Nr,async execute({params:e,sessionId:n}){let r=await t({title:e.title,action:e.action,todos:e.todos,sessionId:n});if(r.ok){let e=r.value;return{content:[{type:`text`,text:e.map(e=>`[${e.status}] ${e.id}: ${e.title}`).join(`
92
+ `)}`}]}}}}const Mr=e.object({id:e.string().describe(`Unique identifier`),title:e.string().describe(`Short description of the task`),status:e.enum([`pending`,`in_progress`,`done`,`skipped`,`failed`]).describe(`Current status`)}),Nr=e.object({title:e.string().optional().describe(`Optional list title (e.g. "Bug fixes"); defaults to "Task".`),action:e.enum([`set`,`update`]).describe(`set: replace all todos; update: merge by id`),todos:e.array(Mr).describe(`Todo items`)});function Pr(e){let t=e??Re();return{name:`write_todos`,description:`Track progress with a lightweight todo list (shown pinned above the input). "set" replaces all todos; "update" merges by id. Optional "title" labels the list (defaults to "Task"). Use for multi-step tasks (3+ steps). Keep exactly ONE item in_progress; mark items done the moment you finish (no batching). Never end a turn with pending/in_progress items — finish them or mark skipped/failed with a reason.`,parameters:Nr,async execute({params:e,sessionId:n}){let r=await t({title:e.title,action:e.action,todos:e.todos,sessionId:n});if(r.ok){let e=r.value;return{content:[{type:`text`,text:e.map(e=>`[${e.status}] ${e.id}: ${e.title}`).join(`
93
93
  `)||`(empty todo list)`}],details:{todos:e}}}return{content:[{type:`text`,text:`Failed to update todos`}],isError:!0,errorKind:`runtime`}}}}const Fr=e.object({plan_status:e.string().optional().describe(`Current plan execution status summary`),recent_files:e.array(e.string()).optional().describe(`Recently modified file paths to focus on`),findings:e.array(e.string()).optional().describe(`Key findings or observations to record`)});function Ir(e){return{name:`capture_file_state`,description:`Capture a snapshot of the current workspace file state.`,parameters:Fr,readonly:!0,async execute({params:t}){if(!e)return K(`capture_file_state`);let n=await e({planStatus:t.plan_status,recentFiles:t.recent_files,findings:t.findings});return n.success?{content:[{type:`text`,text:n.summary}],details:{timestamp:n.timestamp}}:{content:[{type:`text`,text:`Failed to capture file state`}],isError:!0,errorKind:`io`}}}}const Lr=e.object({tags:e.array(e.string()).describe(`Free-form tags categorizing this lesson`),trigger:e.string().describe(`What situation or pattern triggered this insight`),insight:e.string().describe(`The lesson learned — what to do or avoid`),scope:e.enum([`workspace`,`local`]).optional().default(`workspace`).describe(`Lesson scope (default 'workspace'). Use 'workspace' for durable, project-applicable lessons that hold on any machine. Use 'local' for machine-specific lessons (tied to this machine's local paths, installed tools/plugins, or environment quirks) that should never sync to other devices.`)});function Rr(e,t){return{name:`learn`,description:`Record an operational lesson learned during this session for future reference.`,parameters:Lr,async execute({params:n}){if(!t)return K(`learn`);let r=await t({tags:n.tags,trigger:n.trigger,insight:n.insight,sessionId:e,scope:n.scope});return r.success?{content:[{type:`text`,text:`${r.deduped?`Similar lesson already recorded, reusing`:`Lesson recorded`} (${r.lessonId}): [${n.tags.join(`, `)}] ${n.trigger} → ${n.insight}`}],details:{lessonId:r.lessonId,deduped:r.deduped??!1}}:{content:[{type:`text`,text:`Failed to record lesson: ${r.error??`Unknown error`}`}],isError:!0,errorKind:`runtime`}}}}const zr=e.object({query:e.string().describe(`Tool name or keyword to search for in the deferred tool pool`)});function Br(e){return{name:`tool_search`,description:`Search for available tools not shown in the default tool list (e.g. MCP server tools). Use this to discover and load tool schemas on demand.`,parameters:zr,readonly:!0,async execute({params:t}){let n=e(),r=t.query.toLowerCase(),i=n.find(e=>e.name.toLowerCase()===r);if(i)return Vr(i);let a=n.filter(e=>e.name.toLowerCase().includes(r)||typeof e.description==`string`&&e.description.toLowerCase().includes(r));if(a.length===0)return{content:[{type:`text`,text:`No deferred tools found matching "${t.query}". Available deferred tools: ${n.map(e=>e.name).join(`, `)||`(none)`}`}]};if(a.length===1)return Vr(a[0]);let o=a.map(e=>`- **${e.name}**: ${typeof e.description==`string`?e.description.slice(0,100):`(no description)`}`).join(`
94
94
  `);return{content:[{type:`text`,text:`Multiple deferred tools match "${t.query}":\n\n${o}\n\nUse tool_search with the exact tool name to load its full schema.`}]}}}}function Vr(e){let t=`(no parameters)`;if(e.parameters)try{let n=e.parameters;t=typeof n.toJSONSchema==`function`?JSON.stringify(n.toJSONSchema(),null,2):`(binary schema — parameters not introspectable)`}catch{t=`(schema serialization failed)`}let n=typeof e.description==`string`?e.description:``;return{content:[{type:`text`,text:[`## ${e.name}`,``,n?`${n}`:``,``,`**Parameters:**`,"```json",t,"```"].filter(Boolean).join(`
95
95
  `)}]}}const Hr={1:`File`,2:`Module`,3:`Namespace`,4:`Package`,5:`Class`,6:`Method`,7:`Property`,8:`Field`,9:`Constructor`,10:`Enum`,11:`Interface`,12:`Function`,13:`Variable`,14:`Constant`,15:`String`,16:`Number`,17:`Boolean`,18:`Array`,19:`Object`,20:`Key`,21:`Null`,22:`EnumMember`,23:`Struct`,24:`Event`,25:`Operator`,26:`TypeParameter`},Ur={1:`error`,2:`warning`,3:`information`,4:`hint`},Wr={".abap":`abap`,".bat":`bat`,".bib":`bibtex`,".bibtex":`bibtex`,".clj":`clojure`,".cljs":`clojure`,".cljc":`clojure`,".edn":`clojure`,".coffee":`coffeescript`,".c":`c`,".cpp":`cpp`,".cxx":`cpp`,".cc":`cpp`,".c++":`cpp`,".cs":`csharp`,".css":`css`,".d":`d`,".pas":`pascal`,".pascal":`pascal`,".diff":`diff`,".patch":`diff`,".dart":`dart`,".dockerfile":`dockerfile`,".ex":`elixir`,".exs":`elixir`,".erl":`erlang`,".hrl":`erlang`,".fs":`fsharp`,".fsi":`fsharp`,".fsx":`fsharp`,".fsscript":`fsharp`,".gitcommit":`git-commit`,".gitrebase":`git-rebase`,".go":`go`,".groovy":`groovy`,".gleam":`gleam`,".hbs":`handlebars`,".handlebars":`handlebars`,".hs":`haskell`,".html":`html`,".htm":`html`,".ini":`ini`,".java":`java`,".js":`javascript`,".jsx":`javascriptreact`,".json":`json`,".jsonc":`jsonc`,".tex":`latex`,".latex":`latex`,".less":`less`,".lua":`lua`,".makefile":`makefile`,makefile:`makefile`,".md":`markdown`,".markdown":`markdown`,".m":`objective-c`,".mm":`objective-cpp`,".pl":`perl`,".pm":`perl`,".pm6":`perl6`,".php":`php`,".ps1":`powershell`,".psm1":`powershell`,".pug":`jade`,".jade":`jade`,".py":`python`,".pyi":`python`,".r":`r`,".cshtml":`razor`,".razor":`razor`,".rb":`ruby`,".rake":`ruby`,".gemspec":`ruby`,".ru":`ruby`,".erb":`erb`,".html.erb":`erb`,".js.erb":`erb`,".css.erb":`erb`,".json.erb":`erb`,".rs":`rust`,".scss":`scss`,".sass":`sass`,".scala":`scala`,".shader":`shaderlab`,".sh":`shellscript`,".bash":`shellscript`,".zsh":`shellscript`,".ksh":`shellscript`,".sql":`sql`,".svelte":`svelte`,".swift":`swift`,".ts":`typescript`,".tsx":`typescriptreact`,".mts":`typescript`,".cts":`typescript`,".mtsx":`typescriptreact`,".ctsx":`typescriptreact`,".xml":`xml`,".xsl":`xsl`,".yaml":`yaml`,".yml":`yaml`,".mjs":`javascript`,".cjs":`javascript`,".vue":`vue`,".zig":`zig`,".zon":`zig`,".astro":`astro`,".ml":`ocaml`,".mli":`ocaml`,".tf":`terraform`,".tfvars":`terraform-vars`,".hcl":`hcl`,".nix":`nix`,".typ":`typst`,".typc":`typst`,".ets":`typescript`,".lhs":`haskell`,".kt":`kotlin`,".kts":`kotlin`,".prisma":`prisma`,".h":`c`,".hpp":`cpp`,".hh":`cpp`,".hxx":`cpp`,".h++":`cpp`,".objc":`objective-c`,".objcpp":`objective-cpp`,".fish":`fish`,".graphql":`graphql`,".gql":`graphql`},Gr={typescript:`npm install -g typescript-language-server typescript`,deno:`Install Deno from https://deno.land`,vue:`npm install -g @vue/language-server`,eslint:`npm install -g vscode-langservers-extracted`,oxlint:`npm install -g oxlint`,biome:`npm install -g @biomejs/biome`,gopls:`go install golang.org/x/tools/gopls@latest`,"ruby-lsp":`gem install ruby-lsp`,basedpyright:`pip install basedpyright`,pyright:`pip install pyright`,ty:`pip install ty`,ruff:`pip install ruff`,"elixir-ls":`See https://github.com/elixir-lsp/elixir-ls`,zls:`See https://github.com/zigtools/zls`,csharp:`dotnet tool install -g csharp-ls`,fsharp:`dotnet tool install -g fsautocomplete`,"sourcekit-lsp":`Included with Xcode or Swift toolchain`,rust:`rustup component add rust-analyzer`,clangd:`See https://clangd.llvm.org/installation`,svelte:`npm install -g svelte-language-server`,astro:`npm install -g @astrojs/language-server`,"bash-ls":`npm install -g bash-language-server`,jdtls:`See https://github.com/eclipse-jdtls/eclipse.jdt.ls`,"yaml-ls":`npm install -g yaml-language-server`,"lua-ls":`See https://github.com/LuaLS/lua-language-server`,php:`npm install -g intelephense`,dart:`Included with Dart SDK`,"terraform-ls":`See https://github.com/hashicorp/terraform-ls`,terraform:`See https://github.com/hashicorp/terraform-ls`,prisma:`npm install -g prisma`,"ocaml-lsp":`opam install ocaml-lsp-server`,texlab:`See https://github.com/latex-lsp/texlab`,dockerfile:`npm install -g dockerfile-language-server-nodejs`,gleam:`See https://gleam.run/getting-started/installing/`,"clojure-lsp":`See https://clojure-lsp.io/installation/`,nixd:`nix profile install nixpkgs#nixd`,tinymist:`See https://github.com/Myriad-Dreamin/tinymist`,"haskell-language-server":`ghcup install hls`,bash:`npm install -g bash-language-server`,"kotlin-ls":`See https://github.com/Kotlin/kotlin-lsp`},Kr={typescript:{command:[`typescript-language-server`,`--stdio`],extensions:[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.mts`,`.cts`]},deno:{command:[`deno`,`lsp`],extensions:[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`]},vue:{command:[`vue-language-server`,`--stdio`],extensions:[`.vue`]},eslint:{command:[`vscode-eslint-language-server`,`--stdio`],extensions:[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.mts`,`.cts`,`.vue`]},oxlint:{command:[`oxlint`,`--lsp`],extensions:[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.mts`,`.cts`,`.vue`,`.astro`,`.svelte`]},biome:{command:[`biome`,`lsp-proxy`,`--stdio`],extensions:[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.mts`,`.cts`,`.json`,`.jsonc`,`.vue`,`.astro`,`.svelte`,`.css`,`.graphql`,`.gql`,`.html`]},gopls:{command:[`gopls`],extensions:[`.go`]},"ruby-lsp":{command:[`rubocop`,`--lsp`],extensions:[`.rb`,`.rake`,`.gemspec`,`.ru`]},basedpyright:{command:[`basedpyright-langserver`,`--stdio`],extensions:[`.py`,`.pyi`]},pyright:{command:[`pyright-langserver`,`--stdio`],extensions:[`.py`,`.pyi`]},ty:{command:[`ty`,`server`],extensions:[`.py`,`.pyi`]},ruff:{command:[`ruff`,`server`],extensions:[`.py`,`.pyi`]},"elixir-ls":{command:[`elixir-ls`],extensions:[`.ex`,`.exs`]},zls:{command:[`zls`],extensions:[`.zig`,`.zon`]},csharp:{command:[`csharp-ls`],extensions:[`.cs`]},fsharp:{command:[`fsautocomplete`],extensions:[`.fs`,`.fsi`,`.fsx`,`.fsscript`]},"sourcekit-lsp":{command:[`sourcekit-lsp`],extensions:[`.swift`,`.objc`,`.objcpp`]},rust:{command:[`rust-analyzer`],extensions:[`.rs`]},clangd:{command:[`clangd`,`--background-index`,`--clang-tidy`],extensions:[`.c`,`.cpp`,`.cc`,`.cxx`,`.c++`,`.h`,`.hpp`,`.hh`,`.hxx`,`.h++`]},svelte:{command:[`svelteserver`,`--stdio`],extensions:[`.svelte`]},astro:{command:[`astro-ls`,`--stdio`],extensions:[`.astro`]},bash:{command:[`bash-language-server`,`start`],extensions:[`.sh`,`.bash`,`.zsh`,`.ksh`]},"bash-ls":{command:[`bash-language-server`,`start`],extensions:[`.sh`,`.bash`,`.zsh`,`.ksh`]},jdtls:{command:[`jdtls`],extensions:[`.java`]},"yaml-ls":{command:[`yaml-language-server`,`--stdio`],extensions:[`.yaml`,`.yml`]},"lua-ls":{command:[`lua-language-server`],extensions:[`.lua`]},php:{command:[`intelephense`,`--stdio`],extensions:[`.php`]},dart:{command:[`dart`,`language-server`,`--lsp`],extensions:[`.dart`]},terraform:{command:[`terraform-ls`,`serve`],extensions:[`.tf`,`.tfvars`]},"terraform-ls":{command:[`terraform-ls`,`serve`],extensions:[`.tf`,`.tfvars`]},prisma:{command:[`prisma`,`language-server`],extensions:[`.prisma`]},"ocaml-lsp":{command:[`ocamllsp`],extensions:[`.ml`,`.mli`]},texlab:{command:[`texlab`],extensions:[`.tex`,`.bib`]},dockerfile:{command:[`docker-langserver`,`--stdio`],extensions:[`.dockerfile`]},gleam:{command:[`gleam`,`lsp`],extensions:[`.gleam`]},"clojure-lsp":{command:[`clojure-lsp`,`listen`],extensions:[`.clj`,`.cljs`,`.cljc`,`.edn`]},nixd:{command:[`nixd`],extensions:[`.nix`]},tinymist:{command:[`tinymist`],extensions:[`.typ`,`.typc`]},"haskell-language-server":{command:[`haskell-language-server-wrapper`,`--lsp`],extensions:[`.hs`,`.lhs`]},"kotlin-ls":{command:[`kotlin-lsp`],extensions:[`.kt`,`.kts`]}};function q(e){return Be(e)}function J(e,t){if(t===void 0)return!0;let n=N(P(t),P(e));return n===``||!n.startsWith(`..`+Ee)&&n!==`..`&&!Te(n)}async function qr(e,t){try{let n=(await k(e,`utf-8`)).split(`
@@ -116,17 +116,17 @@ import{z as e}from"zod";import{API_IMAGE_DIMENSION_LIMIT_PX as t,PROVIDER_IMAGE_
116
116
  `)}]}}}}e.object({cron:e.string().describe(`5-field cron expression (minute hour dom month dow). Examples: "0 9 * * 1-5" = weekdays 9am, "*/30 * * * *" = every 30 min`),prompt:e.string().describe(`Natural language instruction for the agent to execute at the scheduled time`),recurring:e.boolean().describe(`true = run on schedule repeatedly, false = one-shot (delete after first fire)`),name:e.string().optional().describe(`Short label for the task (shown in schedule list)`),maxDurationMs:e.number().int().positive().optional().describe(`Timeout in milliseconds for a single fire attempt (default 300000 = 5 minutes). Raise this for tasks expected to take longer.`),target:e.enum([`job`,`session`]).optional().describe(`Where the prompt fires. Default "job": isolated git worktree, produces a diff for /job apply — for tasks that change files, need independent review, or should stay decoupled from this conversation (e.g. "scan dependencies for updates every morning"). "session": injects into THIS conversation when it fires (no worktree, no diff) — for polling/check-in/report-back tasks that continue this conversation and typically do not change files. A visible notice is shown on first creation and each fire.`),modelId:e.string().optional().describe(`Model to run this scheduled task with, e.g. "deepseek/deepseek-v4-flash". Defaults to the current session model. Invalid ids are rejected at creation time.`),thinkingLevel:e.enum([`low`,`medium`,`high`,`xhigh`,`max`]).optional().describe(`Thinking level for the model (defaults to the provider default).`),onEvent:e.enum([`job.applied`,`job.failed`,`job.canceled`]).optional().describe(`Fire when an in-process event happens instead of on the cron schedule. "job.applied" = when any background job's diff gets applied; "job.failed"/"job.canceled" similarly. Requires target:"session" (injects into THIS conversation) — event triggers cannot dispatch isolated jobs. Use for "wait until the current work lands, then continue" flows. When set, "cron" is ignored (pass any valid placeholder like "0 0 * * *").`)}),e.object({task_id:e.string().describe(`ID of the scheduled task to delete`)}),e.object({task_id:e.string().describe(`ID of the scheduled task to run immediately`)}),e.object({task_id:e.string().describe(`ID of the scheduled task whose currently running job should be canceled`)});const Qi=e.object({type:e.enum([`create`,`list`,`delete`,`run`,`cancel`]).describe(`Schedule action to perform: "create" (new task), "list" (view all), "delete" (remove task), "run" (trigger immediately), "cancel" (stop running job). See tool description for per-action parameters.`),cron:e.string().optional().describe(`5-field cron expression (minute hour dom month dow). Examples: "0 9 * * 1-5" = weekdays 9am, "*/30 * * * *" = every 30 min. Required for create.`),prompt:e.string().optional().describe(`Natural language instruction for the agent to execute at the scheduled time. Required for create.`),recurring:e.boolean().optional().describe(`true = run on schedule repeatedly, false = one-shot (delete after first fire). Required for create.`),name:e.string().optional().describe(`Short label for the task (shown in schedule list). Optional for create.`),maxDurationMs:e.number().int().positive().optional().describe(`Timeout in milliseconds for a single fire attempt (default 300000 = 5 minutes). Raise for long tasks. Optional for create.`),target:e.enum([`job`,`session`]).optional().describe(`Where the prompt fires. Default "job": isolated worktree, produces a diff for /job apply. "session": injects into THIS conversation. Optional for create.`),modelId:e.string().optional().describe(`Model to run this scheduled task with, e.g. "deepseek/deepseek-v4-flash". Defaults to current session model. Optional for create.`),thinkingLevel:e.enum([`low`,`medium`,`high`,`xhigh`,`max`]).optional().describe(`Thinking level for the model. Optional for create.`),onEvent:e.enum([`job.applied`,`job.failed`,`job.canceled`]).optional().describe(`Fire on an in-process event instead of cron (requires target:"session"). Optional for create.`),task_id:e.string().optional().describe(`ID of the scheduled task. Required for delete/run/cancel.`)});function $i(e){return{name:`schedule`,description:`Manage scheduled tasks: create (new cron/event task), list (view all), delete (remove), run (trigger immediately), cancel (stop running job). Use the "type" field to select the action; per-action parameters are shown above.`,parameters:Qi,execute:async({params:t})=>{if(!e)return{content:[{type:`text`,text:`Schedule scheduling is not available in this session.`}],isError:!0};let{type:n,...r}=t;switch(n){case`create`:{let{onEvent:t,...n}=r;if(!n.cron||!n.prompt||n.recurring===void 0)return{content:[{type:`text`,text:`schedule create requires cron, prompt, recurring`}],isError:!0};let i={...n,eventTrigger:t?{source:`job`,event:t.slice(4)}:void 0};try{let t=e.create(i),n=t.target===`session`?` (fires into this conversation)`:``;return{content:[{type:`text`,text:`Schedule created: ${t.taskId} — "${t.name}"${n}
117
117
  Next fire: ${new Date(t.nextFireAt).toLocaleString()}
118
118
  Use schedule (type:list) to view all schedules, schedule (type:delete) to remove.`}]}}catch(e){return{content:[{type:`text`,text:e instanceof Error?e.message:String(e)}],isError:!0}}}case`list`:{let t=e.list();return t.length===0?{content:[{type:`text`,text:`No scheduled tasks.`}]}:{content:[{type:`text`,text:t.map(e=>`- ${e.id}: ${e.name} (${e.recurring?e.cronExpression:`one-shot`}) next: ${new Date(e.nextFireAt).toLocaleString()}`).join(`
119
- `)}]}}case`delete`:return r.task_id?{content:[{type:`text`,text:e.delete(r.task_id)?`Schedule ${r.task_id} deleted.`:`Schedule ${r.task_id} not found.`}]}:{content:[{type:`text`,text:`schedule delete requires task_id`}],isError:!0};case`run`:if(!r.task_id)return{content:[{type:`text`,text:`schedule run requires task_id`}],isError:!0};try{return e.run(r.task_id),{content:[{type:`text`,text:`Triggering schedule ${r.task_id}…`}]}}catch(e){return{content:[{type:`text`,text:e instanceof Error?e.message:String(e)}],isError:!0}}case`cancel`:{if(!r.task_id)return{content:[{type:`text`,text:`schedule cancel requires task_id`}],isError:!0};let t=e.cancel(r.task_id);return{content:[{type:`text`,text:t.ok?`Schedule ${r.task_id} canceled.`:`Could not cancel ${r.task_id}: ${t.reason??`unknown`}`}]}}default:return{content:[{type:`text`,text:`unknown schedule action "${n}"`}],isError:!0}}}}}const Q=(...e)=>e,ea=[`Use read to understand existing code before making changes. Read targeted ranges instead of entire large files.`,`Prefer edit over write for modifying existing files — edit replaces exact text and is safer.`,`Use write only for new files or full content replacement.`,`Verify file existence with read before editing — never edit on stale assumptions.`,`For edit: provide enough surrounding context to avoid ambiguous matches.`].join(`
120
- `),ta=[`Use bash for running tests, installing dependencies, build commands, git operations, and system tasks that have no dedicated tool.`,"For long-lived processes (dev servers, watchers), pass run_in_background:true instead of blocking or trailing `&`; it returns immediately with a background id.","Read accumulated output with bash_output; stop with kill_shell. Background processes are auto-killed at session end — no cleanup of `&` jobs.",`Avoid programs requiring interactive input.`,`Prefer dedicated tools (read, write, edit, grep, find) over shell equivalents (cat, sed, grep) for file operations.`,`Avoid destructive commands (rm -rf, git reset --hard, DROP TABLE) without explicit user approval.`,`Set reasonable timeouts for long-running commands. Kill stale processes rather than waiting indefinitely.`,`Always check the exit code; on failure, inspect stdout/stderr before deciding next steps.`,`Prefer non-interactive flags, e.g. git --no-pager, --non-interactive.`].join(`
119
+ `)}]}}case`delete`:return r.task_id?{content:[{type:`text`,text:e.delete(r.task_id)?`Schedule ${r.task_id} deleted.`:`Schedule ${r.task_id} not found.`}]}:{content:[{type:`text`,text:`schedule delete requires task_id`}],isError:!0};case`run`:if(!r.task_id)return{content:[{type:`text`,text:`schedule run requires task_id`}],isError:!0};try{return e.run(r.task_id),{content:[{type:`text`,text:`Triggering schedule ${r.task_id}…`}]}}catch(e){return{content:[{type:`text`,text:e instanceof Error?e.message:String(e)}],isError:!0}}case`cancel`:{if(!r.task_id)return{content:[{type:`text`,text:`schedule cancel requires task_id`}],isError:!0};let t=e.cancel(r.task_id);return{content:[{type:`text`,text:t.ok?`Schedule ${r.task_id} canceled.`:`Could not cancel ${r.task_id}: ${t.reason??`unknown`}`}]}}default:return{content:[{type:`text`,text:`unknown schedule action "${n}"`}],isError:!0}}}}}const Q=(...e)=>e,ea=[`Prefer edit over write for modifying existing files — edit replaces exact text and is safer.`,`For edit: provide enough surrounding context to avoid ambiguous matches.`].join(`
120
+ `),ta=[`Use bash for running tests, installing dependencies, build commands, git operations, and system tasks that have no dedicated tool.`,"For long-lived processes (dev servers, watchers), pass run_in_background:true instead of blocking or trailing `&`; it returns immediately with a background id.","Read accumulated output with bash_output; stop with kill_shell. Background processes are auto-killed at session end — no cleanup of `&` jobs.",`Prefer dedicated tools (read, write, edit, grep, find) over shell equivalents (cat, sed, grep) for file operations.`,`Always check the exit code; on failure, inspect stdout/stderr before deciding next steps.`].join(`
121
121
  `),na=[`Use find to locate files by name or glob pattern; use grep to search file contents by text or regex.`,"Start broad (find) then narrow (grep → read) to efficiently navigate unfamiliar codebases. There is no dedicated listing tool — for ad-hoc directory listing run `ls` via bash.",`Combine grep results with read to understand full context around matches.`,`Use precise grep patterns; prefer regex alternation over many separate searches.`].join(`
122
122
  `),ra=[`Use web_fetch to read specific URLs when you know the page address.`,`Prefer web_search → web_fetch workflow: search first, then fetch specific results. (See the Factual Verification rule in the base instructions for when verification is required.)`,`web_fetch cannot render JavaScript-heavy pages (SPAs). Use for documentation, articles, APIs.`].join(`
123
- `),ia=[`Use task_delegate to route tasks to more suitable sub-agents by category — useful for specialization or lifecycle management. Provide clear, complete context — sub-agents start with a blank slate.`,`Use write_todos for complex tasks to build and maintain a step list first, then work it to completion. Optional "title" labels the list (defaults to "Task").`,`Todo discipline: keep exactly ONE item in_progress; mark items done the moment you finish (no batching). Never end a turn with pending/in_progress items — finish them or mark skipped/failed with a reason. Unfinished todos = reported incomplete.`,`Break complex tasks into small, independently verifiable subtasks (2-5 minutes each) before delegating.`,`Do not delegate tasks that require the current conversation context or interactive clarification.`].join(`
123
+ `),ia=[`Use task_delegate to route tasks to more suitable sub-agents by category — useful for specialization or lifecycle management. Provide clear, complete context — sub-agents start with a blank slate.`,`Use write_todos for complex tasks to build and maintain a step list first, then work it to completion. Optional "title" labels the list (defaults to "Task"). Unfinished todos = reported incomplete.`,`Break complex tasks into small, independently verifiable subtasks (2-5 minutes each) before delegating.`,`Do not delegate tasks that require the current conversation context or interactive clarification.`].join(`
124
124
  `),aa=[`Use task_delegate for delegation — tracked:false for lightweight synchronous agent opinions, default (tracked) for background or stateful execution with retries.`,`Use task_inspect to check task status and output before acting; use task_control to cancel or retry tasks.`,`Use grill_me to ask the human ONE key decision (detailed background + required recommendation) when a fork genuinely needs a human steer. Advisory only — never authorizes side effects.`,`Use capture_file_state when conversation is long and you need to refresh understanding of workspace changes.`,`Use learn to record reusable insights (patterns, mistakes, strategies) — not routine progress notes.`].join(`
125
125
  `),oa=[`Use session management to organize separate conversation threads per task or topic.`,`Compact sessions proactively when conversation history grows long to avoid context window exhaustion.`,`Do not create excessive sessions — reuse existing ones when the topic is the same.`].join(`
126
126
  `),sa=[`Use skill to load or execute reusable workflow templates. Skills are auto-loaded on first execute if a path is given.`,`Prefer invoking a matching skill over ad-hoc multi-step workflows when one exists.`,`Skills encapsulate best practices — follow their structure rather than shortcutting steps.`].join(`
127
127
  `),ca=[`Use memory_record to persist durable facts (user preferences, environment quirks, project constraints) across sessions.`,`The memory index is always visible in the system prompt; fetch full entries on demand with memory_read.`,`Scope choice and what to remember: see <memory_guidelines> (injected with the memory index).`].join(`
128
128
  `),la=[`When a conversation summary is marked low-fidelity (only part of the history made it into the summary), use memory_archive_read to pull back the original messages instead of guessing or asking the user to repeat themselves.`,`Use memory_archive_list to see which chunks of earlier history are available and pick the right archive id.`,`Archives are scoped to the current conversation — you cannot read another session's history.`].join(`
129
- `),ua=[{names:[`read`,`write`,`edit`],preset:`minimal`,category:`fs`,guidance:ea,create:e=>Q(dn(e.projectRoot),_n(e.projectRoot),Fn(e.projectRoot))},{names:[`bash`],preset:`minimal`,category:`shell`,guidance:ta,create:e=>Q(Nt(e.projectRoot,void 0,e.features.sandbox,e.features.processRegistry,void 0,e.features.shellEnv))},{names:[`bash_output`,`kill_shell`],preset:`standard`,category:`shell`,when:e=>!!e.features.processRegistry,create:e=>Q(Wt(e.features.processRegistry),Kt(e.features.processRegistry))},{names:[`find`,`grep`],preset:`standard`,category:`search`,guidance:na,create:e=>Q(Yt(e.projectRoot,{binaryExecutorRegistry:e.registry.getBinaryToolExecutors()}),nn(e.projectRoot,{binaryToolExecutorRegistry:e.registry.getBinaryToolExecutors(),processTracker:e.processTracker}))},{names:[`web_fetch`,`web_search`],preset:`standard`,category:`web`,guidance:ra,create:e=>Q(tr(e.projectRoot),lr(e.projectRoot,e.features.webSearch))},{names:[`tool_search`],preset:`standard`,category:`orchestration`,guidance:`Use tool_search to discover deferred tools by name or keyword and load their full parameter schema.`,create:e=>Q(Br(()=>e.registry.project(`full`).deferred))},{names:[`task_delegate`,`delegate_job`,`write_todos`],preset:`standard`,category:`orchestration`,guidance:ia,create:e=>Q(vr(e.projectRoot,e.orchestration.dispatchTask,e.orchestration.writeTodos,e.fork?.fork,e.team?.runTeam,void 0,e.agents.callAgent,e.agentProfiles??[]),br(e.orchestration.startJob),Pr(e.orchestration.writeTodos))},{names:[`lsp_goto_definition`,`lsp_find_references`,`lsp_symbols`,`lsp_diagnostics`,`lsp_prepare_rename`,`lsp_rename`],preset:`standard`,category:`lsp`,when:e=>!!e.features.enableLsp,create:e=>(e.processTracker&&Y.setProcessTracker(e.processTracker),Q(Ci(e.projectRoot),Ti(e.projectRoot),Di(e.projectRoot),ki(e.projectRoot),ji(e.projectRoot),Ni(e.projectRoot)))},{names:[`list_models`,`task_inspect`,`task_control`,`grill_me`,`capture_file_state`,`learn`],preset:`full`,category:`orchestration`,guidance:aa,create:e=>Q(jr(e.features.listModels,e.features.sessionId),Dr(e.projectRoot,{get:e.orchestration.getTask,list:e.orchestration.listTasks,output:e.orchestration.getBackgroundOutput}),kr(e.projectRoot,{update:e.orchestration.updateTask,cancelBackground:e.orchestration.cancelBackground}),Ue(e.projectRoot,e.features.grill),Ir(e.features.captureFileState),Rr(e.features.sessionId??``,e.features.learn))},{names:[`session_manager`],preset:`full`,category:`session`,guidance:oa,when:e=>!!e.session,create:e=>{let t=e.session;return t?Q(Fi({sessionManager:t.manager})):Q()}},{names:[`skill`],preset:`full`,category:`skill`,guidance:sa,create:e=>Q(Ri(e.projectRoot,e.loadSkill,e.executeSkill,e.features.sessionId))},{names:[`memory_record`,`memory_read`],preset:`full`,category:`memory`,guidance:ca,create:e=>Q(Vi(e.memory?.recordMemory),Ui(e.memory?.readMemory))},{names:[`memory_archive_read`,`memory_archive_list`],preset:`full`,category:`memory`,when:e=>!!e.memory?.archive,guidance:la,create:e=>Q(Xi(e.memory?.archive?.read),Zi(e.memory?.archive?.list))},{names:[`schedule`],preset:`full`,category:`schedule`,guidance:`Schedule tool — manage timer tasks (create/list/delete/run/cancel) via the "type" action field. Semantics are in the tool description.`,when:e=>!!e.schedule,create:e=>Q($i(e.schedule))},{names:[`capability_gap`],preset:`full`,category:`orchestration`,guidance:`Use capability_gap when you genuinely cannot do what the user asks with current tools: searches the plugin ecosystem for an existing capability, else returns a build blueprint (scaffold + delegate_job).`,when:e=>!!e.capabilityGap,create:e=>Q(Tr(e.capabilityGap.search,{...e.capabilityGap.recorder?{recorder:e.capabilityGap.recorder}:{},...e.capabilityGap.now?{now:e.capabilityGap.now}:{}}))}],da=`Skill provider not configured. Pass skillProvider to createApp().`;function fa(e,t){let n=t.map(e=>e.name).sort(),r=[...e.names].sort();if(n.length!==r.length||n.some((e,t)=>e!==r[t]))throw Error(`TOOL_NODES drift in category "${e.category}": declared [${r.join(`, `)}] but factory produced [${n.join(`, `)}]`)}function pa(e,t,n){let{orchestration:r,agents:i,features:a={}}=n,o={projectRoot:t,registry:e,orchestration:r,agents:i,features:a,loadSkill:n.skills?.loadSkill??(async()=>({success:!1,error:da})),executeSkill:n.skills?.executeSkill??(async()=>({success:!1,error:da})),fork:n.fork,team:n.team,memory:n.memory,session:n.session,agentProfiles:n.agentProfiles,schedule:n.schedule,capabilityGap:n.capabilityGap,processTracker:n.processTracker};for(let t of ua){if(t.when&&!t.when(o))continue;let n=t.create(o);fa(t,n),e.register(n,{preset:t.preset,category:t.category,builtin:!0,guideline:t.guidance})}}const $={minimal:new Set([`minimal`]),standard:new Set([`minimal`,`standard`]),full:new Set([`minimal`,`standard`,`full`])};function ma(e){if(!e||typeof e!=`object`)return!1;let t=e,n=t.description;return typeof t.name==`string`&&(typeof n==`string`||typeof n==`function`)&&typeof t.execute==`function`&&t.parameters!==void 0}var ha=class e{tools=new Map;binaryToolExecutors=null;disposers=[];onMutation;get size(){return this.tools.size}setBinaryToolExecutors(e){this.binaryToolExecutors=e}getBinaryToolExecutors(){if(!this.binaryToolExecutors)throw Error(`BinaryToolExecutorRegistry is not set in ToolRegistry`);return this.binaryToolExecutors}registerDisposer(e){this.disposers.push(e)}register(e,t={}){let n={preset:t.preset??`full`,category:t.category,builtin:t.builtin??!1,snippet:t.snippet,guideline:t.guideline,source:t.source},r=Array.isArray(e)?e:[e];for(let e of r){if(!ma(e))throw Error(`Invalid tool registration input`);let r=e,i=typeof r.description==`function`?r.description({projectRoot:t.projectRoot??``}):r.description,a={...r,description:i,metadata:n};this.tools.set(r.name,a)}this.onMutation?.({added:r.map(e=>e.name),source:t.source})}unregister(e){let t=[];if(Array.isArray(e)){let n=!0;for(let r of e)this.tools.delete(r)?t.push(r):n=!1;return t.length>0&&this.onMutation?.({removed:t}),n}let n=this.tools.delete(e);return n&&this.onMutation?.({removed:[e]}),n}unregisterBySource(e){let t=[...this.tools.values()].filter(t=>t.metadata.source===e).map(e=>e.name);for(let e of t)this.tools.delete(e);return t.length>0&&this.onMutation?.({removed:t,source:e}),t.length}get(e){return this.tools.get(e)}has(e){return this.tools.has(e)}listRegenerableNames(){let e=[];for(let t of this.tools.values())t.regenerableOutput===!0&&e.push(t.name);return e}getAll(){return[...this.tools.values()].sort((e,t)=>e.name.localeCompare(t.name))}getAvailable(e=`standard`){let t=$[e]??$.standard;return this.getAll().filter(e=>t.has(e.metadata.preset))}project(e=`standard`){let t=$[e]??$.standard,n=[],r=[];for(let e of this.getAll())t.has(e.metadata.preset)&&(e.exposure===`deferred`?r.push(e):e.exposure!==`hidden`&&n.push(e));return{direct:n,deferred:r}}static TOOL_GUIDANCE_BUDGET_TOKENS=5e3;static estimatedTokens(e){let t=0;for(let n of e)/[\u3000-\u9fff\uff00-\uffef]/.test(n)&&t++;return Math.ceil(t+(e.length-t)/4)}buildToolGuidance(t=`standard`){let{direct:n,deferred:r}=this.project(t);if(n.length===0&&r.length===0)return``;let i=new Map;for(let e of n){let{snippet:t,guideline:n,category:r}=e.metadata,a=n?`${r??``}\u0000${n}`:`\u0000tool:${e.name}`,o=i.get(a);o||(o={guideline:n,entries:[]},i.set(a,o));let s=[`#### ${e.name}`];!n&&!t&&s.push(e.description),t&&s.push(`Example:\n\`\`\`\n${t}\n\`\`\``),o.entries.push(s.join(`
129
+ `),ua=[{names:[`read`,`write`,`edit`],preset:`minimal`,category:`fs`,guidance:ea,create:e=>Q(dn(e.projectRoot),_n(e.projectRoot),Fn(e.projectRoot))},{names:[`bash`],preset:`minimal`,category:`shell`,guidance:ta,create:e=>Q(Nt(e.projectRoot,void 0,e.features.sandbox,e.features.processRegistry,void 0,e.features.shellEnv))},{names:[`bash_output`,`kill_shell`],preset:`standard`,category:`shell`,when:e=>!!e.features.processRegistry,create:e=>Q(Wt(e.features.processRegistry),Kt(e.features.processRegistry))},{names:[`find`,`grep`],preset:`standard`,category:`search`,guidance:na,create:e=>Q(Yt(e.projectRoot,{binaryExecutorRegistry:e.registry.getBinaryToolExecutors()}),nn(e.projectRoot,{binaryToolExecutorRegistry:e.registry.getBinaryToolExecutors(),processTracker:e.processTracker}))},{names:[`web_fetch`,`web_search`],preset:`standard`,category:`web`,guidance:ra,create:e=>Q(tr(e.projectRoot),lr(e.projectRoot,e.features.webSearch))},{names:[`tool_search`],preset:`standard`,category:`orchestration`,guidance:`Use tool_search to discover deferred tools by name or keyword and load their full parameter schema.`,create:e=>Q(Br(()=>e.registry.project(`full`).deferred))},{names:[`task_delegate`,`delegate_job`,`write_todos`],preset:`standard`,category:`orchestration`,guidance:ia,create:e=>Q(vr(e.projectRoot,e.orchestration.dispatchTask,e.orchestration.writeTodos,e.fork?.fork,e.team?.runTeam,void 0,e.agents.callAgent,e.agentProfiles??[]),br(e.orchestration.startJob),Pr(e.orchestration.writeTodos))},{names:[`lsp_goto_definition`,`lsp_find_references`,`lsp_symbols`,`lsp_diagnostics`,`lsp_prepare_rename`,`lsp_rename`],preset:`standard`,category:`lsp`,when:e=>!!e.features.enableLsp,create:e=>(e.processTracker&&Y.setProcessTracker(e.processTracker),Q(Ci(e.projectRoot),Ti(e.projectRoot),Di(e.projectRoot),ki(e.projectRoot),ji(e.projectRoot),Ni(e.projectRoot)))},{names:[`list_models`,`task_inspect`,`task_control`,`grill_me`,`capture_file_state`,`learn`],preset:`full`,category:`orchestration`,guidance:aa,create:e=>Q(jr(e.features.listModels,e.features.sessionId),Dr(e.projectRoot,{get:e.orchestration.getTask,list:e.orchestration.listTasks,output:e.orchestration.getBackgroundOutput}),kr(e.projectRoot,{update:e.orchestration.updateTask,cancelBackground:e.orchestration.cancelBackground}),Ue(e.projectRoot,e.features.grill),Ir(e.features.captureFileState),Rr(e.features.sessionId??``,e.features.learn))},{names:[`session_manager`],preset:`full`,category:`session`,guidance:oa,when:e=>!!e.session,create:e=>{let t=e.session;return t?Q(Fi({sessionManager:t.manager})):Q()}},{names:[`skill`],preset:`full`,category:`skill`,guidance:sa,create:e=>Q(Ri(e.projectRoot,e.loadSkill,e.executeSkill,e.features.sessionId))},{names:[`memory_record`,`memory_read`],preset:`full`,category:`memory`,guidance:ca,create:e=>Q(Vi(e.memory?.recordMemory),Ui(e.memory?.readMemory))},{names:[`memory_archive_read`,`memory_archive_list`],preset:`full`,category:`memory`,when:e=>!!e.memory?.archive,guidance:la,create:e=>Q(Xi(e.memory?.archive?.read),Zi(e.memory?.archive?.list))},{names:[`schedule`],preset:`full`,category:`schedule`,guidance:`Schedule tool — manage timer tasks (create/list/delete/run/cancel) via the "type" action field. Semantics are in the tool description.`,when:e=>!!e.schedule,create:e=>Q($i(e.schedule))},{names:[`capability_gap`],preset:`full`,category:`orchestration`,guidance:`Use capability_gap when you genuinely cannot do what the user asks with current tools: searches the plugin ecosystem for an existing capability, else returns a build blueprint (scaffold + delegate_job).`,when:e=>!!e.capabilityGap,create:e=>Q(Tr(e.capabilityGap.search,{...e.capabilityGap.recorder?{recorder:e.capabilityGap.recorder}:{},...e.capabilityGap.now?{now:e.capabilityGap.now}:{}}))}],da=`Skill provider not configured. Pass skillProvider to createApp().`;function fa(e,t){let n=t.map(e=>e.name).sort(),r=[...e.names].sort();if(n.length!==r.length||n.some((e,t)=>e!==r[t]))throw Error(`TOOL_NODES drift in category "${e.category}": declared [${r.join(`, `)}] but factory produced [${n.join(`, `)}]`)}function pa(e,t,n){let{orchestration:r,agents:i,features:a={}}=n,o={projectRoot:t,registry:e,orchestration:r,agents:i,features:a,loadSkill:n.skills?.loadSkill??(async()=>({success:!1,error:da})),executeSkill:n.skills?.executeSkill??(async()=>({success:!1,error:da})),fork:n.fork,team:n.team,memory:n.memory,session:n.session,agentProfiles:n.agentProfiles,schedule:n.schedule,capabilityGap:n.capabilityGap,processTracker:n.processTracker};for(let t of ua){if(t.when&&!t.when(o))continue;let n=t.create(o);fa(t,n),e.register(n,{preset:t.preset,category:t.category,builtin:!0,guideline:t.guidance})}}const $={minimal:new Set([`minimal`]),standard:new Set([`minimal`,`standard`]),full:new Set([`minimal`,`standard`,`full`])};function ma(e){if(!e||typeof e!=`object`)return!1;let t=e,n=t.description;return typeof t.name==`string`&&(typeof n==`string`||typeof n==`function`)&&typeof t.execute==`function`&&t.parameters!==void 0}var ha=class e{tools=new Map;binaryToolExecutors=null;disposers=[];onMutation;get size(){return this.tools.size}setBinaryToolExecutors(e){this.binaryToolExecutors=e}getBinaryToolExecutors(){if(!this.binaryToolExecutors)throw Error(`BinaryToolExecutorRegistry is not set in ToolRegistry`);return this.binaryToolExecutors}registerDisposer(e){this.disposers.push(e)}register(e,t={}){let n={preset:t.preset??`full`,category:t.category,builtin:t.builtin??!1,snippet:t.snippet,guideline:t.guideline,source:t.source},r=Array.isArray(e)?e:[e];for(let e of r){if(!ma(e))throw Error(`Invalid tool registration input`);let r=e,i=typeof r.description==`function`?r.description({projectRoot:t.projectRoot??``}):r.description,a={...r,description:i,metadata:n};this.tools.set(r.name,a)}this.onMutation?.({added:r.map(e=>e.name),source:t.source})}unregister(e){let t=[];if(Array.isArray(e)){let n=!0;for(let r of e)this.tools.delete(r)?t.push(r):n=!1;return t.length>0&&this.onMutation?.({removed:t}),n}let n=this.tools.delete(e);return n&&this.onMutation?.({removed:[e]}),n}unregisterBySource(e){let t=[...this.tools.values()].filter(t=>t.metadata.source===e).map(e=>e.name);for(let e of t)this.tools.delete(e);return t.length>0&&this.onMutation?.({removed:t,source:e}),t.length}get(e){return this.tools.get(e)}has(e){return this.tools.has(e)}listRegenerableNames(){let e=[];for(let t of this.tools.values())t.regenerableOutput===!0&&e.push(t.name);return e}getAll(){return[...this.tools.values()].sort((e,t)=>e.name.localeCompare(t.name))}getAvailable(e=`standard`){let t=$[e]??$.standard;return this.getAll().filter(e=>t.has(e.metadata.preset))}project(e=`standard`){let t=$[e]??$.standard,n=[],r=[];for(let e of this.getAll())t.has(e.metadata.preset)&&(e.exposure===`deferred`?r.push(e):e.exposure!==`hidden`&&n.push(e));return{direct:n,deferred:r}}static TOOL_GUIDANCE_BUDGET_TOKENS=5e3;static estimatedTokens(e){let t=0;for(let n of e)/[\u3000-\u9fff\uff00-\uffef]/.test(n)&&t++;return Math.ceil(t+(e.length-t)/4)}buildToolGuidance(t=`standard`){let{direct:n,deferred:r}=this.project(t);if(n.length===0&&r.length===0)return``;let i=new Map;for(let e of n){let{snippet:t,guideline:n,category:r}=e.metadata,a=n?`${r??``}\u0000${n}`:`\u0000tool:${e.name}`,o=i.get(a);if(o||(o={guideline:n,toolNames:[],entries:[]},i.set(a,o)),n){o.toolNames.push(e.name),t&&o.entries.push(`#### ${e.name}\nExample:\n\`\`\`\n${t}\n\`\`\``);continue}let s=[`#### ${e.name}`];t?s.push(`Example:\n\`\`\`\n${t}\n\`\`\``):s.push(e.description),o.entries.push(s.join(`
130
130
  `))}let a=[];for(let e of i.values()){let t=[];e.guideline&&t.push(e.guideline),t.push(...e.entries),a.push(t.join(`
131
131
 
132
132
  `))}let o=e.TOOL_GUIDANCE_BUDGET_TOKENS,s=0,c=[],l=0;for(let t of a){let n=e.estimatedTokens(t);s+n<=o?(c.push(t),s+=n):l++}return l>0&&c.push(`> ⚠ [${l} additional tool guidance section(s) omitted — guidance budget (${o} tokens) reached; use tool_search or the tool's own description]`),r.length>0&&c.push(`> ${r.length} additional tool(s) discoverable via tool_search (not shown here to keep this section focused; use tool_search to look them up by name or capability).`),c.length===0?``:`### Tool Reference (per category)\n\n${c.join(`