dal-code 1.0.42 → 1.0.44
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/CHANGELOG.md +16 -0
- package/dist/core/agent-session.js +9 -9
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/types.d.ts +19 -0
- package/dist/core/permissions/tool-policy.d.ts +2 -1
- package/dist/core/permissions/tool-policy.js +1 -1
- package/dist/core/sandbox/shell-sandbox.js +7 -5
- package/dist/core/tool-denial.d.ts +13 -0
- package/dist/core/tool-denial.js +1 -0
- package/dist/core/tools/bash.d.ts +1 -0
- package/dist/core/tools/bash.js +14 -14
- package/dist/core/tools/index.d.ts +1 -1
- package/dist/core/tools/index.js +1 -1
- package/dist/dal/manifest.js +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/main.js +3 -3
- package/dist/modes/rpc/approvals.js +1 -0
- package/dist/modes/rpc/message-meta.js +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +15 -1
- package/dist/modes/rpc/rpc-client.js +3 -3
- package/dist/modes/rpc/rpc-mode.js +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +55 -1
- package/dist/node_modules/@dalcode/dal-advisor/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-awake/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-bridge/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-bridge/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-capabilities/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-compat/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-dap/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-gateway/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-goal/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-guard/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-guard/src/index.js +2 -1
- package/dist/node_modules/@dalcode/dal-guard/src/workspace.js +2 -2
- package/dist/node_modules/@dalcode/dal-halo/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-interactive/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-lang/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-learn/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-lsp/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-mcp/package.json +5 -5
- package/dist/node_modules/@dalcode/dal-office/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +2 -2
- package/dist/node_modules/@dalcode/dal-pi-kit/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/src/i18n.js +1 -1
- package/dist/node_modules/@dalcode/dal-plugins/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-recall/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-remote/LICENSE +21 -0
- package/dist/node_modules/@dalcode/dal-remote/package.json +32 -0
- package/dist/node_modules/@dalcode/dal-remote/src/cli.js +15 -0
- package/dist/node_modules/@dalcode/dal-remote/src/index.js +1 -0
- package/dist/node_modules/@dalcode/dal-remote/src/install.js +8 -0
- package/dist/node_modules/@dalcode/dal-remote/src/paths.js +1 -0
- package/dist/node_modules/@dalcode/dal-remote/src/processes.js +2 -0
- package/dist/node_modules/@dalcode/dal-remote/src/service.js +8 -0
- package/dist/node_modules/@dalcode/dal-remote/src/spec.js +1 -0
- package/dist/node_modules/@dalcode/dal-review/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-rewind/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-router/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-rtk/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-skills/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-statusline/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-structured/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-subagent/package.json +5 -5
- package/dist/node_modules/@dalcode/dal-subagent/src/background.js +8 -8
- package/dist/node_modules/@dalcode/dal-subagent/src/index.js +20 -20
- package/dist/node_modules/@dalcode/dal-subagent/src/progress.js +1 -0
- package/dist/node_modules/@dalcode/dal-telemetry/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-terminal/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-tool-catalog/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-usage/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-web/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-workflow/package.json +2 -2
- package/dist/node_modules/@dalcode/deepailab/package.json +3 -3
- package/dist/node_modules/@earendil-works/chord/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +1 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +1 -0
- package/dist/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/dist/node_modules/@earendil-works/pi-client/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-codemode/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-protocol/package.json +2 -2
- package/dist/node_modules/@earendil-works/pi-server/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
`)){const i=s.trim();if(!i)continue;const
|
|
3
|
-
`)}planNetworkEscalation(
|
|
4
|
-
${
|
|
5
|
-
`),
|
|
1
|
+
var Q=Object.defineProperty;var c=(e,o)=>Q(e,"name",{value:o,configurable:!0});import{spawnSync as V}from"node:child_process";import{mkdirSync as z,mkdtempSync as J,rmSync as Z}from"node:fs";import{tmpdir as q}from"node:os";import{isAbsolute as T,join as oo,relative as eo,resolve as no}from"node:path";import{ToolExecutionError as ao}from"@earendil-works/pi-agent-core";import{fill as v,t as h}from"../../dal/i18n.js";import{toolDenial as io,withToolDenial as to}from"../tool-denial.js";import{detectSandboxAvailability as so}from"./availability.js";import{collectBlockedAccesses as O}from"./denial.js";import{detectNetworkCommand as U,FAIL_FAST_NETWORK_ENV as B,networkDomainsFor as ro,packageCacheDirs as lo}from"./package-managers.js";import{domainMatches as L,expandPath as M,filesystemRules as co}from"./policy.js";import{acquireSandboxRuntime as mo,ensureFilteringProxy as ho,proxyUnavailableReason as F,registerNetworkGrant as fo,releaseSandboxRuntime as po,violationsForCommand as uo,wrapCommand as wo}from"./runtime.js";import{prepareWindowsCommand as bo}from"./windows.js";function S(e,o){return new ao(e,to({sandbox:o},io("sandbox",e)))}c(S,"sandboxRefusal");const N=Symbol.for("dal.sandbox.escalationHandlers"),D=globalThis;D[N]instanceof Set||(D[N]=new Set);const R=D[N];function Uo(e){return R.add(e),()=>{R.delete(e)}}c(Uo,"registerSandboxEscalationHandler");const K=Symbol.for("dal.sandbox.processSandbox");function Bo(e){D[K]=e}c(Bo,"setProcessShellSandbox");function Lo(){return D[K]}c(Lo,"getProcessShellSandbox");const H=new Map;function vo(e){const o=H.get(e);if(o)return o;const n=V("git",["rev-parse","--absolute-git-dir","--git-common-dir"],{cwd:e,encoding:"utf8",timeout:3e3}),r=[];if(n.status===0)for(const s of n.stdout.split(`
|
|
2
|
+
`)){const i=s.trim();if(!i)continue;const a=T(i)?i:no(e,i),t=eo(e,a);(t.startsWith("..")||T(t))&&r.push(a)}const l=[...new Set(r)];return H.set(e,l),l}c(vo,"gitDirsOutside");function E(e){return Array.isArray(e)?e.filter(o=>typeof o=="string"&&o.trim().length>0).map(o=>o.trim()):[]}c(E,"cleanList");let yo=0;class Mo{static{c(this,"ShellSandbox")}policy;onEscalation;onEvent;availabilityOverride;sessionDomains=new Set;sessionWritable=new Set;holdsRuntime=!1;sharedScratch;ownScratch;constructor(o){this.policy=o.policy,this.onEscalation=o.onEscalation,this.onEvent=o.onEvent,this.availabilityOverride=o.availability,this.sharedScratch=o.scratchDir,this.active&&(mo(),this.holdsRuntime=!0)}scratchDir(){return this.sharedScratch?this.sharedScratch():(this.ownScratch??=go(),this.ownScratch)}async dispose(){this.ownScratch&&(Z(this.ownScratch,{recursive:!0,force:!0}),this.ownScratch=void 0),this.holdsRuntime&&(this.holdsRuntime=!1,await po())}get level(){return this.policy.level}get active(){return this.policy.level!=="off"}availability(){return this.availabilityOverride??so()}status(){const o=this.availability(),n=F();return{level:this.policy.level,levelSource:this.policy.levelSource,enforced:this.active&&o.available,platform:o.platform,...o.mechanism?{mechanism:o.mechanism}:{},...this.active&&!o.available&&o.reason?{unavailableReason:o.reason}:{},...o.isolationTier?{isolationTier:o.isolationTier}:{},...o.limitations?.length?{limitations:[...o.limitations]}:{},network:{allowedDomains:[...this.policy.network.allowedDomains],deniedDomains:[...this.policy.network.deniedDomains],...n?{proxyError:n}:{}},sessionAllowances:{domains:[...this.sessionDomains],writablePaths:[...this.sessionWritable]}}}describeForModel(){if(!this.active)return;const o=this.policy.level==="read-only"?"writes only to $TMPDIR (session scratch)":"writes only to the working directory, $TMPDIR (session scratch) and package caches (agent/editor config, git hooks and .env stay read-only)",n=this.policy.network.allowedDomains,r=(n.length>0?`network off except ${n.join(", ")}`:"network off")+(this.policy.level==="workspace-write"?" (package installs via npm/pnpm/yarn/pip/uv/cargo/go and curl/wget/git clone ask the user for their hosts by themselves: run them plainly, without sandbox_escalation)":"");return`OS sandbox (${this.policy.level}): ${o}; ${r}; ~/.ssh and other credentials unreadable. Use sandbox_escalation only after the result says the sandbox blocked something the task needs.`}unavailableRefusal(){if(!this.active)return;const o=this.availability();if(!o.available)return[`Command refused: the sandbox level is "${this.policy.level}", but ${o.reason??"the OS sandbox is unavailable."}`,"Commands are not run without the sandbox unless the user says so explicitly.",'The user can fix the sandbox, or opt out explicitly with `dal --sandbox off` or "sandbox": { "level": "off" } in ~/.dal/agent/settings.json.','A single command can still run if the user approves it: retry with sandbox_escalation {"mode":"unsandboxed","justification":"..."}.'].join(`
|
|
3
|
+
`)}planNetworkEscalation(o){if(this.policy.level!=="workspace-write"||!this.availability().available)return;const n=U(o.command);if(!n)return;const r=[...this.policy.network.allowedDomains,...this.sessionDomains],l=this.policy.network.deniedDomains,s=ro(n,o.cwd).filter(a=>!r.some(t=>L(a,t))&&!l.some(t=>L(a,t)));if(s.length===0)return;const i=n.ecosystems.length>0?"package-install":"download";return{mode:"allow",allow_domains:s,trigger:i,justification:i==="package-install"?h("\u8FD9\u6761\u547D\u4EE4\u8981\u5B89\u88C5\u4F9D\u8D56\uFF0C\u9700\u8981\u4ECE\u8F6F\u4EF6\u6E90\u4E0B\u8F7D\u3002"):h("\u8FD9\u6761\u547D\u4EE4\u8981\u4ECE\u7F51\u4E0A\u4E0B\u8F7D\u6587\u4EF6\u3002")}}async prepare(o){const n=this.policy.level;if(n==="off")return X(o.command,{level:n,sandboxed:!1});const r=this.unavailableRefusal();if(r&&o.escalation?.mode!=="unsandboxed")throw S(r,{level:n,sandboxed:!1});let l=[],s=[],i;const a=o.escalation||r?void 0:this.planNetworkEscalation(o),t=a?await this.approveEscalation(o,a,a.trigger):void 0;if(a&&t&&t.decidedBy!=="none"){const f={request:t.request,decision:t.decision};if(i=f,!f.decision.approved)throw S(`The user did not allow network access for this command${f.decision.message?` (${f.decision.message})`:""}: it needs ${a.allow_domains.join(", ")}. Do not retry it with sandbox_escalation; continue without it or ask the user.`,{level:n,sandboxed:!1,escalation:f});l=t.allowDomains,s=t.allowWrite}else if(o.escalation){const{decidedBy:f,allowDomains:g,allowWrite:_,...b}=await this.approveEscalation(o,o.escalation);if(i=b,!b.decision.approved)throw S(`Sandbox escalation refused${b.decision.message?`: ${b.decision.message}`:"."} Do not retry the same escalation; continue without it or ask the user.`,{level:n,sandboxed:!1,escalation:i});if(b.request.mode==="unsandboxed")return X(o.command,{level:n,sandboxed:!1,escalation:i});l=g,s=_}const d=this.availability(),p=o.shellKind??"bash";if(p!=="bash"&&d.mechanism!=="mxc")throw S(`Command refused: ${p} commands cannot run inside the ${d.mechanism??"OS"} sandbox, and the sandbox level is "${n}". Use the bash tool, or the user can opt out with \`dal --sandbox off\`.`,{level:n,sandboxed:!1});const u=this.scratchDir();n==="workspace-write"&&xo(U(o.command)?.managers);const w=co(this.policy,o.cwd,{gitDirs:this.policy.level==="workspace-write"?vo(o.cwd):[],extraWrite:[...this.sessionWritable,...s],scratchDir:u}),m={allowedDomains:[...this.policy.network.allowedDomains,...this.sessionDomains,...l],deniedDomains:this.policy.network.deniedDomains,refusals:[]},k=`${process.pid}-${++yo}`,x=m.allowedDomains.length===0;if(d.mechanism==="mxc"&&d.mxc){const f=x?{...o.env??process.env,...B}:o.env;return this.prepareWindows({...o,...f?{env:f}:{}},{level:n,shellKind:p,scratch:u,rules:w,grant:m,runId:k,escalation:i,availability:d})}const y=Do(u),W=x?Object.entries(B).map(([f,g])=>` ${f}=${g}`).join(""):"",I=`export DAL_SANDBOX_RUN=${k} TMPDIR=${y} TMP=${y} TEMP=${y}${W}
|
|
4
|
+
${o.command}`,Y=Date.now(),$=await wo({command:I,shell:o.shell,allowWrite:w.allowWrite,denyWrite:w.denyWrite,denyRead:w.denyRead,allowLocalBinding:o.background===!0||this.policy.network.allowLocalBinding,...d.ripgrep?{ripgrep:d.ripgrep}:{}},m),j={level:n,sandboxed:!0,...i?{escalation:i}:{}};let A=!1;return{command:$.command,sandboxed:!0,details:j,finish:c(async(f,g)=>{if(A)return j.denial;if(A=!0,$.release(),f===0)return;const _=d.platform==="darwin"?await uo(I,Y,400):[],b=O({refusals:m.refusals,violations:_,output:g});if(!b)return;const P=$.proxied?void 0:F(),C={level:n,platform:d.platform,command:o.command,cwd:o.cwd,blocked:b,scratchDir:u,...P&&b.some(G=>G.kind==="network")?{networkProxyError:P}:{}};return j.denial=C,this.onEvent?.({type:"sandbox_denied",toolCallId:o.toolCallId,toolName:o.toolName,denial:C}),C},"finish")}}async prepareWindows(o,n){const{level:r,grant:l,availability:s}=n,i=s.mxc;if(!i)throw new Error("Command refused: the Windows sandbox (mxc) is not loaded.");let a,t;if(l.allowedDomains.length>0){const m=await ho();"port"in m?a=m.port:t=m.error}const d=bo({runtime:i,kind:n.shellKind,shellPath:o.shell,command:o.command,cwd:o.cwd,level:r,rules:n.rules,env:o.env??process.env,scratchDir:n.scratch,runId:n.runId,...a!==void 0?{proxyPort:a}:{},allowLocalNetwork:o.background===!0||this.policy.network.allowLocalBinding}),p=fo(l),u={level:r,sandboxed:!0,...n.escalation?{escalation:n.escalation}:{}};let w=!1;return{command:d.command,sandboxed:!0,details:u,finish:c(async(m,k)=>{if(w)return u.denial;if(w=!0,p(),d.cleanup(),m===0)return;const x=O({refusals:l.refusals,violations:[],output:k});if(!x)return;const y={level:r,platform:s.platform,command:o.command,cwd:o.cwd,blocked:x,scratchDir:n.scratch,...t&&x.some(W=>W.kind==="network")?{networkProxyError:t}:{}};return u.denial=y,this.onEvent?.({type:"sandbox_denied",toolCallId:o.toolCallId,toolName:o.toolName,denial:y}),y},"finish")}}uiApprovals=Promise.resolve();queueUiApproval(o){const n=this.uiApprovals.then(o,o);return this.uiApprovals=n.catch(()=>{}),n}async approveEscalation(o,n,r){const l=n.mode==="unsandboxed"?"unsandboxed":"allow",s={toolCallId:o.toolCallId,toolName:o.toolName,command:o.command,cwd:o.cwd,level:this.policy.level,mode:l,justification:typeof n.justification=="string"?n.justification.trim():"",allowDomains:l==="allow"?E(n.allow_domains):[],allowWrite:l==="allow"?E(n.allow_write).map(a=>M(a,o.cwd)):[],background:o.background===!0,...r?{trigger:r}:{}},i=c((a,t)=>{const d=a.approved&&a.scope==="session"&&l==="unsandboxed"?{...a,scope:"once"}:a,p=d.approved&&l==="allow"?d.grant:void 0,u=[...new Set([...s.allowDomains,...E(p?.allowDomains)])],w=[...new Set([...s.allowWrite,...E(p?.allowWrite).map(m=>M(m,o.cwd))])];if(d.approved&&d.scope==="session"){for(const m of u)this.sessionDomains.add(m);for(const m of w)this.sessionWritable.add(m)}return r&&t==="none"||this.onEvent?.({type:"sandbox_escalation",toolCallId:o.toolCallId,toolName:o.toolName,request:s,decision:d,decidedBy:t}),{request:s,decision:d,decidedBy:t,allowDomains:u,allowWrite:w}},"finish");if(!s.justification)return i({approved:!1,message:"an escalation needs a justification"},"none");if(l==="allow"&&s.allowDomains.length===0&&s.allowWrite.length===0)return i({approved:!1,message:'mode "allow" needs allow_domains or allow_write'},"none");if(this.onEscalation){const a=await this.onEscalation(s,o.ctx);if(a)return i(a,"sdk")}for(const a of R){const t=await a(s,o.ctx);if(t)return i(t,"handler")}if(o.ctx?.hasUI){const a=o.ctx;return i(await this.queueUiApproval(()=>ko(s,a,o.signal)),"ui")}return i({approved:!1,message:"nobody is available to approve it (no interactive UI and no approver configured)"},"none")}}function X(e,o){return{command:e,sandboxed:!1,details:o,finish:c(async()=>{},"finish")}}c(X,"passthrough");function xo(e){if(!(!e||e.length===0))for(const o of lo(e))try{z(o,{recursive:!0,mode:448})}catch{}}c(xo,"ensurePackageCaches");function go(){return J(oo(q(),"dal-sandbox-"))}c(go,"createScratchDir");function Do(e){return`'${e.replace(/'/g,"'\\''")}'`}c(Do,"shellQuote");async function ko(e,o,n){if(n?.aborted)return{approved:!1,message:"the turn was interrupted before the user answered"};const r=h("\u4EC5\u672C\u6B21\u5141\u8BB8"),l=h("\u672C\u4F1A\u8BDD\u5185\u90FD\u5141\u8BB8"),s=h("\u62D2\u7EDD"),i=e.mode==="unsandboxed"?h("\u5728\u6C99\u7BB1\u4E4B\u5916\u8FD0\u884C\u547D\u4EE4\uFF08\u53EF\u8BBF\u95EE\u4F60\u7684\u5168\u90E8\u6587\u4EF6\u548C\u7F51\u7EDC\uFF09"):[e.allowDomains.length>0?v(h("\u8BBF\u95EE {domains}"),{domains:e.allowDomains.join(", ")}):"",e.allowWrite.length>0?v(h("\u5199\u5165 {paths}"),{paths:e.allowWrite.join(", ")}):""].filter(Boolean).join(h("\uFF0C\u5E76")),a=[v(h("\u52A9\u624B\u60F3\u8981{what}\u3002"),{what:i}),v(h("\u547D\u4EE4\uFF1A{command}"),{command:e.command}),v(h("\u76EE\u5F55\uFF1A{cwd}"),{cwd:e.cwd}),e.trigger?v(h("\u539F\u56E0\uFF1A{reason}"),{reason:e.justification}):v(h("\u52A9\u624B\u7ED9\u7684\u7406\u7531\uFF08\u672A\u7ECF\u6838\u5B9E\uFF09\uFF1A{reason}"),{reason:e.justification})].join(`
|
|
5
|
+
`),t=e.mode==="unsandboxed"?[r,s]:[r,l,s],d=v(h("\u52A9\u624B\u60F3\u8981{what}\u3002"),{what:i}),p=await o.ui.select(a,t,{...n?{signal:n}:{},approval:{source:"sandbox",toolCallId:e.toolCallId,toolName:e.toolName,args:{command:e.command,cwd:e.cwd,mode:e.mode,...e.allowDomains.length>0?{allowDomains:e.allowDomains}:{},...e.allowWrite.length>0?{allowWrite:e.allowWrite}:{},justification:e.justification},risk:{level:e.mode==="unsandboxed"?"high":"medium",reason:e.trigger?e.justification:v(h("\u52A9\u624B\u7ED9\u7684\u7406\u7531\uFF08\u672A\u7ECF\u6838\u5B9E\uFF09\uFF1A{reason}"),{reason:e.justification}),ruleId:`sandbox:${e.mode}`},title:d,description:a.split(`
|
|
6
|
+
`).slice(1).join(`
|
|
7
|
+
`),options:e.mode==="unsandboxed"?["allow_once","deny"]:["allow_once","allow_session","deny"]}});return n?.aborted?{approved:!1,message:"the turn was interrupted before the user answered"}:p===r?{approved:!0,scope:"once"}:p===l?{approved:!0,scope:"session"}:{approved:!1,message:"the user declined"}}c(ko,"askThroughUi");export{Mo as ShellSandbox,go as createScratchDir,Lo as getProcessShellSandbox,Uo as registerSandboxEscalationHandler,Bo as setProcessShellSandbox};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ToolDenialSource = "permission-rule" | "ask-rule" | "dal-guard" | "sandbox" | "dangerous-command" | "bridge" | "extension";
|
|
2
|
+
export interface ToolDenial {
|
|
3
|
+
source: ToolDenialSource;
|
|
4
|
+
reason: string;
|
|
5
|
+
ruleId?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ToolDenialHint {
|
|
8
|
+
source: ToolDenialSource;
|
|
9
|
+
ruleId?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function withToolDenial(details: unknown, denial: ToolDenial): Record<string, unknown>;
|
|
12
|
+
export declare function toolDenial(source: ToolDenialSource, reason: string, ruleId?: string): ToolDenial;
|
|
13
|
+
export declare function getToolDenial(details: unknown): ToolDenial | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var t=(e,n)=>f(e,"name",{value:n,configurable:!0});function u(e,n){return{...e&&typeof e=="object"&&!Array.isArray(e)?e:{},denied:n}}t(u,"withToolDenial");function c(e,n,o){return{source:e,reason:n,...o?{ruleId:o}:{}}}t(c,"toolDenial");function p(e){if(!e||typeof e!="object")return;const n=e.denied;if(!n||typeof n!="object")return;const{source:o,reason:r}=n;return typeof o=="string"&&typeof r=="string"?n:void 0}t(p,"getToolDenial");export{p as getToolDenial,c as toolDenial,u as withToolDenial};
|
|
@@ -61,6 +61,7 @@ export interface ShellExecutionRequest {
|
|
|
61
61
|
}
|
|
62
62
|
export type ShellExecutionGuard = (request: ShellExecutionRequest) => Promise<string | undefined> | string | undefined;
|
|
63
63
|
export declare function registerShellExecutionGuard(guard: ShellExecutionGuard): () => void;
|
|
64
|
+
export declare function shellExecutionRefusal(request: ShellExecutionRequest): Promise<string | undefined>;
|
|
64
65
|
export interface BashSpawnContext {
|
|
65
66
|
command: string;
|
|
66
67
|
cwd: string;
|
package/dist/core/tools/bash.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
Cannot execute ${t} commands.`)}const b=S.commandTransport==="stdin",c=
|
|
3
|
-
${x.fg("muted",` \u23BF ${e} ${o.trim()}`)}`}const w=o===null?
|
|
1
|
+
var $e=Object.defineProperty;var a=(t,e)=>$e(t,"name",{value:e,configurable:!0});import{constants as Le}from"node:fs";import{access as Te}from"node:fs/promises";import{constants as Ce}from"node:os";import{ToolExecutionError as le}from"@earendil-works/pi-agent-core";import{Container as Pe,Text as j,truncateToWidth as Ie}from"@earendil-works/pi-tui";import{spawn as ve}from"child_process";import{Type as l}from"typebox";import{fill as G,t as I}from"../../dal/i18n.js";import{keyHint as De}from"../../modes/interactive/components/keybinding-hints.js";import{truncateToVisualLines as Ae}from"../../modes/interactive/components/visual-truncate.js";import{theme as x}from"../../modes/interactive/theme/theme.js";import{waitForChildProcess as ke}from"../../utils/child-process.js";import{writeOutputFile as Me}from"../../utils/output-files.js";import{getShellConfig as ue,getShellEnv as ce,killProcessTree as me,trackDetachedChildPid as Fe,untrackDetachedChildPid as Ne}from"../../utils/shell.js";import{missingManagedToolHint as Be}from"../../utils/tools-manager.js";import{describeDenialForModel as Re}from"../sandbox/denial.js";import{getProcessShellSandbox as Ue}from"../sandbox/shell-sandbox.js";import{toolDenial as Ge,withToolDenial as He}from"../tool-denial.js";import{isReadOnlyBashCommand as je}from"./bash-read-only.js";import{OutputAccumulator as We}from"./output-accumulator.js";import{condenseShellOutput as Ve,outputCondenseDisabled as Ye}from"./output-condense.js";import{countOutputLines as Xe,formatCollapsedSummary as Ke,getTextOutput as pe,invalidArgText as qe,str as fe,truncateDisplay as ze}from"./render-utils.js";import{wrapToolDefinition as Je}from"./tool-definition-wrapper.js";import{DEFAULT_MAX_BYTES as Qe,formatSize as Ze,SHELL_OUTPUT_MAX_CHARS as ee,truncateHeadTail as et}from"./truncate.js";const he=2147483647,we=1024*1024,tt=8*1024*1024,nt=he/1e3,te=12e4,ne=30;function ot(t){if(t===void 0)return te;if(!Number.isFinite(t)||t<=0)throw new Error("Invalid timeout: must be a finite number of seconds");const e=t*1e3;if(e>he)throw new Error(`Invalid timeout: maximum is ${nt} seconds`);return e}a(ot,"resolveTimeoutMs");const Se=l.Object({command:l.String({description:"Shell command to execute"}),description:l.String({description:`What it does and why, 3-10 words in the user's language, shown instead of the command: "Find hardcoded key names", not "run grep"`}),timeout:l.Optional(l.Number({description:"Seconds to wait for the command (default in the tool description). Raise it for long builds."}))}),it=l.Optional(l.Object({mode:l.Union([l.Literal("allow"),l.Literal("unsandboxed")],{description:'"allow": stay sandboxed with the domains/paths below; "unsandboxed": run outside the sandbox'}),justification:l.String({description:"Why, in one sentence for the user, who must approve it"}),allow_domains:l.Optional(l.Array(l.String(),{description:"e.g. registry.npmjs.org"})),allow_write:l.Optional(l.Array(l.String(),{description:"Paths to make writable"}))},{description:"Only after the sandbox blocked this command: the access it needs. Never pre-emptively."})),st=l.Object({...Se.properties,sandbox_escalation:it}),be={snippet:"Execute bash commands (ls, grep, find, etc.)",guidelines:["You can inspect DAL_* environment variables for current model and session details."]},at=l.Object({output:l.String({description:"Combined stdout and stderr, possibly truncated"}),truncated:l.Boolean(),full_output_path:l.Optional(l.String({description:"Full output, when truncated"})),exit_code:l.Number({description:"-1 while the command runs in the background"}),background_id:l.Optional(l.String({description:"Background process id, when it is still running"})),wall_time_seconds:l.Number()});function rt(t,e){return{exec:a(async(n,o,{onData:u,signal:i,timeout:y,env:w,yieldTo:s})=>{const $=ot(y);if(i?.aborted)throw new Error("aborted");const S=e();try{await Te(o,Le.F_OK)}catch{throw new Error(`Working directory does not exist: ${o}
|
|
2
|
+
Cannot execute ${t} commands.`)}const b=S.commandTransport==="stdin",c=ve(S.shell,b?S.args:[...S.args,n],{cwd:o,detached:process.platform!=="win32",env:w??ce(),stdio:[b?"pipe":"ignore","pipe","pipe"],windowsHide:!0});b&&(c.stdin?.on("error",()=>{}),c.stdin?.end(n)),c.pid&&Fe(c.pid);let r=!1,m=!1,h;const p=new Promise(A=>{h=a(()=>A("yielded"),"onYielded")});let f;const _=a(()=>{c.pid&&me(c.pid)},"onAbort");try{$!==void 0&&(f=setTimeout(()=>{if(s&&c.exitCode===null&&c.signalCode===null&&s(c)){m=!0,h?.();return}r=!0,c.pid&&me(c.pid)},$)),c.stdout?.on("data",u),c.stderr?.on("data",u),i&&(i.aborted?_():i.addEventListener("abort",_,{once:!0}));const A=ke(c),N=await Promise.race([A,p]);if(N==="yielded")return A.catch(()=>{}),{exitCode:null,yielded:!0};const V=N;if(i?.aborted)throw new Error("aborted");if(r)throw new Error(`timeout:${($??te)/1e3}`);const L=c.signalCode;return{exitCode:V??(L?128+(Ce.signals[L]??0):1)}}finally{c.pid&&!m&&Ne(c.pid),f&&clearTimeout(f),i&&i.removeEventListener("abort",_)}},"exec")}}a(rt,"createLocalShellOperations");function dt(t){return rt("bash",()=>ue(t?.shellPath))}a(dt,"createLocalBashOperations");const oe=Symbol.for("dal.shell.executionGuards"),ie=globalThis;ie[oe]instanceof Set||(ie[oe]=new Set);const se=ie[oe];function Xt(t){return se.add(t),()=>{se.delete(t)}}a(Xt,"registerShellExecutionGuard");async function lt(t){for(const e of se){let n;try{n=await e(t)}catch(o){return`Command refused: the safety check could not run (${o instanceof Error?o.message:String(o)}).`}if(n!==void 0)return n}}a(lt,"shellExecutionRefusal");const ut=["SESSION_ID","SESSION_FILE","PROVIDER","MODEL","REASONING_LEVEL"];function ct(t,e,n,o,u){const i={...ce()};if(delete i.PI_SESSION_ID,delete i.PI_SESSION_FILE,delete i.PI_PROVIDER,delete i.PI_MODEL,delete i.PI_REASONING_LEVEL,o&&u){const w=u.model;i.PI_SESSION_ID=u.sessionManager.getSessionId();const s=u.sessionManager.getSessionFile();s&&(i.PI_SESSION_FILE=s),w&&(i.PI_PROVIDER=w.provider,i.PI_MODEL=w.id),u.thinkingLevel&&(i.PI_REASONING_LEVEL=u.thinkingLevel)}for(const w of ut){delete i[`DAL_${w}`];const s=i[`PI_${w}`];s!==void 0&&(i[`DAL_${w}`]=s)}const y={command:t,cwd:e,env:i};return n?n(y):y}a(ct,"resolveSpawnContext");const mt=5,pt=100;class ft extends Pe{static{a(this,"BashResultRenderComponent")}state={cachedWidth:void 0,cachedLines:void 0,cachedSkipped:void 0}}function ht(t){const e=t/1e3;if(e<60)return`${e.toFixed(1)}s`;const n=Math.floor(e),o=Math.floor(n/60),u=n%60;return o<60?`${o}m ${u}s`:`${Math.floor(o/60)}h ${o%60}m ${u}s`}a(ht,"formatDuration");function wt(t,e,n=!1){const o=fe(t?.command),u=fe(t?.description)?.trim(),i=t?.timeout,y=i?x.fg("muted",G(I(" (\u8D85\u65F6 {seconds} \u79D2)"),{seconds:i})):"";if(u){const s=x.fg("toolTitle",x.bold(u))+y;return!n||!o?s:`${s}
|
|
3
|
+
${x.fg("muted",` \u23BF ${e} ${o.trim()}`)}`}const w=o===null?qe(x):o?x.fg("dim",ze(o.replace(/\s+/g," ").trim(),42)):x.fg("dim","\u2026");return`${x.fg("toolTitle",x.bold(e))} ${w}${y}`}a(wt,"formatShellCall");function St(t,e,n,o,u,i,y,w){const s=t.state;t.clear();const $=bt(n,u,i,w);if(!n.expanded&&!y){const r=pe(e,o),m=Xe(r),h=[];m>0&&h.push(G(I("{count} \u884C"),{count:m})),$&&h.push($);const p=Ke(x,h);p&&t.addChild(new j(p,0,0));return}let S=pe(e,o).trim();const b=e.details?.truncation,c=e.details?.fullOutputPath;if(!n.isPartial&&b?.truncated&&c&&S.endsWith("]")){const r=S.lastIndexOf(`
|
|
4
4
|
|
|
5
|
-
[`);
|
|
5
|
+
[`);r!==-1&&S.slice(r).includes(c)&&(S=S.slice(0,r).trimEnd())}if(S){const r=S.split(`
|
|
6
6
|
`).map(m=>x.fg("toolOutput",m)).join(`
|
|
7
|
-
`);n.expanded?t.addChild(new
|
|
8
|
-
${
|
|
9
|
-
${x.fg("warning",`[${
|
|
10
|
-
${x.fg("muted",$)}`,0,0))}
|
|
11
|
-
${
|
|
7
|
+
`);n.expanded?t.addChild(new j(`
|
|
8
|
+
${r}`,0,0)):t.addChild({render:a(m=>{if(s.cachedLines===void 0||s.cachedWidth!==m){const h=Ae(r,mt,m);s.cachedLines=h.visualLines,s.cachedSkipped=h.skippedCount,s.cachedWidth=m}if(s.cachedSkipped&&s.cachedSkipped>0){const h=x.fg("muted",G(I("... (\u524D\u9762\u8FD8\u6709 {count} \u884C\uFF0C"),{count:s.cachedSkipped}))+` ${De("app.tools.expand",I("\u5373\u53EF\u5C55\u5F00"))}${x.fg("muted",")")}`;return["",Ie(h,m,"..."),...s.cachedLines??[]]}return["",...s.cachedLines??[]]},"render"),invalidate:a(()=>{s.cachedWidth=void 0,s.cachedLines=void 0,s.cachedSkipped=void 0},"invalidate")})}if(b?.truncated||c){const r=[];c&&r.push(G(I("\u5B8C\u6574\u8F93\u51FA\uFF1A{path}"),{path:c})),b?.truncated&&(b.truncatedBy==="lines"?r.push(G(I("\u5DF2\u622A\u65AD\uFF1A\u663E\u793A {shown}/{total} \u884C"),{shown:b.outputLines,total:b.totalLines})):r.push(G(I("\u5DF2\u622A\u65AD\uFF1A\u663E\u793A\u4E86 {shown} \u884C\uFF08\u4E0A\u9650 {limit}\uFF09"),{shown:b.outputLines,limit:Ze(b.maxBytes??Qe)}))),t.addChild(new j(`
|
|
9
|
+
${x.fg("warning",`[${r.join(". ")}]`)}`,0,0))}$&&t.addChild(new j(`
|
|
10
|
+
${x.fg("muted",$)}`,0,0))}a(St,"rebuildBashResultRenderComponent");function bt(t,e,n,o){let u;if(!t.isPartial&&o!==void 0)u=o;else if(e!==void 0)u=(n??Date.now())-e;else return;if(!(!t.isPartial&&u<100))return`${t.isPartial?I("\u5DF2\u8FD0\u884C"):I("\u8017\u65F6")} ${ht(u)}`}a(bt,"bashTimingLabel");function xt(t,e,n){const o=n?.operations??e.defaultOperations?.()??dt({shellPath:n?.shellPath}),u=n?.commandPrefix,i=n?.exposeSessionEnvironment??!0,y=n?.spawnHook,w=n?.sandbox,s=n?.operations===void 0,$=w?.describeForModel(),S=n?.background;let b=!1;const c=a(r=>`Execute a ${e.shellName} command in the current working directory; returns stdout and stderr. Long output is cut to its start and end (error lines kept) and the full output saved to a file named in the result. ${r?`A command still running after \`timeout\` seconds (default ${ne}) keeps running in the background: you get its id and the output so far, then use the process tool to poll or kill it.`:`A command still running after \`timeout\` seconds (default ${te/1e3}) is killed.`}${$?` ${$}`:""}`,"describe");return{name:e.name,label:e.label,description:c(!1),prepareLoadout:S&&s?r=>(b=r.declared.some(m=>m.name==="process"),b?{descriptions:{[e.name]:c(!0)}}:void 0):void 0,promptSnippet:e.promptSnippet,promptGuidelines:i&&e.promptGuidelines?[...e.promptGuidelines]:void 0,executionMode:"sequential",executionModeFor:e.readOnlyCommand&&!u?r=>e.readOnlyCommand?.(r?.command)?"parallel":void 0:void 0,parameters:w?.active?st:Se,outputSchema:at,constrainedSampling:{type:"json_schema",strict:"prefer"},async execute(r,m,h,p,f){const{command:_,timeout:A}=m;p&&p({content:[],details:void 0});const N=await lt({toolName:e.name,command:_,cwd:f?.cwd||t,sessionFile:f?.sessionManager?.getSessionFile()});if(N!==void 0)throw new le(N,He(void 0,Ge("dangerous-command",N)));const V=u?`${u}
|
|
11
|
+
${_}`:_,L=ct(V,f?.cwd||t,y,i,f),Y=w??(s?Ue():void 0);let T;if(Y?.active){if(!e.sandboxShell)throw new Error(`Command refused: ${e.shellName} commands cannot run inside the OS sandbox yet, and the sandbox level is "${Y.level}". Use the bash tool, or the user can opt out with \`dal --sandbox off\`.`);T=await Y.prepare({command:L.command,cwd:L.cwd,shell:e.sandboxShell(n?.shellPath),shellKind:e.sandboxShellKind??"bash",env:L.env,toolCallId:r,toolName:e.name,escalation:m.sandbox_escalation,ctx:f,signal:h})}const P=new We({tempFilePrefix:e.tempFilePrefix,maxBytes:ee});let W=!0,H,X=!1,ae=0;const K=a(()=>{if(!p||!X)return;X=!1,ae=Date.now();const d=P.snapshot({persistIfTruncated:!0});p({content:[{type:"text",text:d.content||""}],details:{truncation:d.truncation.truncated?d.truncation:void 0,fullOutputPath:d.fullOutputPath}})},"emitOutputUpdate"),q=a(()=>{H&&(clearTimeout(H),H=void 0)},"clearUpdateTimer"),xe=a(()=>{if(!p)return;X=!0;const d=pt-(Date.now()-ae);if(d<=0){q(),K();return}H??=setTimeout(()=>{H=void 0,K()},d)},"scheduleOutputUpdate"),Ee=a(d=>{W&&(P.append(d),xe())},"handleData"),_e=a(async()=>{W=!1,P.finish(),q(),K();const d=P.snapshot({persistIfTruncated:!0});return await P.closeTempFile(),d},"finishOutput"),z=a(async(d="(no output)")=>{const O=await _e(),k=await P.readFullOutput(tt),C=Ye()?void 0:Ve(k.content),E=et(C?.text??k.content,ee);let D=O.fullOutputPath;(E.truncated||C)&&!D&&(D=await Me(e.tempFilePrefix,".log",k.content));let M=E.content||d,R;const U=O.truncation.totalLines;return E.truncated?(R={truncation:{content:E.content,truncated:!0,truncatedBy:"bytes",totalLines:U,totalBytes:O.truncation.totalBytes,outputLines:E.headLines+E.tailLines,outputBytes:Buffer.byteLength(E.content,"utf-8"),lastLinePartial:!1,firstLineExceedsLimit:!1,maxLines:U,maxBytes:ee},fullOutputPath:D},M+=`
|
|
12
12
|
|
|
13
|
-
[Truncated: first ${E.headLines} and last ${E.tailLines} of ${E.totalLines} lines shown${
|
|
13
|
+
[Truncated: first ${E.headLines} and last ${E.tailLines} of ${E.totalLines} lines shown${C?`, after condensing ${U} lines (${C.summary})`:""}; read more with read (offset/limit) or grep. Full output: ${D}]`):C&&(R={fullOutputPath:D},M+=`
|
|
14
14
|
|
|
15
|
-
[Condensed: ${
|
|
15
|
+
[Condensed: ${C.summary}. Full output: ${D}]`),{text:M,details:R,snapshot:O}},"modelOutput"),B=a((d,O)=>`${d?`${d}
|
|
16
16
|
|
|
17
|
-
`:""}${
|
|
17
|
+
`:""}${O}`,"appendStatus"),re=performance.now();let v;const J=S&&s&&b?d=>{W=!1;try{return v=S.adopt({child:d,command:_,cwd:L.cwd,...T?{prepared:T}:{},...P.handOff()}),!0}catch{return W=!0,!1}}:void 0;try{let d;try{const g=await o.exec(T?.command??L.command,L.cwd,{onData:Ee,signal:h,timeout:A??(J?ne:void 0),env:L.env,...J?{yieldTo:J}:{}});if(g.yielded&&v){const{text:F,details:Z}=await z(""),Oe=A??ne,ge=v.urls.length>0?` It printed ${v.urls.join(" ")}.`:"",ye=`[Still running after ${Oe}s, now in the background as ${v.id}.${ge} For new output and the exit code call process with action "poll" and id "${v.id}"; "kill" stops it.]`,de=await P.readFullOutput(we);return{content:[{type:"text",text:B(F,ye)}],details:{...Z,background:v},structuredContent:{output:de.content,truncated:de.truncated,exit_code:-1,background_id:v.id,wall_time_seconds:Math.round((performance.now()-re)/100)/10}}}d=g.exitCode}catch(g){const{text:F}=await z("");if(await T?.finish(null,""),g instanceof Error&&g.message==="aborted")throw new Error(B(F,"Command aborted"));if(g instanceof Error&&g.message.startsWith("timeout:")){const Z=g.message.split(":")[1];throw new Error(B(F,`Command timed out after ${Z} seconds`))}throw g}const{text:O,details:k,snapshot:C}=await z(),E=await T?.finish(d,C.content||"");if(E&&T)throw new le(`${B(O,`Command exited with code ${d??"(none)"}`)}
|
|
18
18
|
|
|
19
|
-
${
|
|
20
|
-
${
|
|
19
|
+
${Re(E)}`,{...k,sandbox:T.details});if(d===null)throw new Error(B(O,"Command terminated without an exit code"));const D=Math.round((performance.now()-re)/100)/10,M=await P.readFullOutput(we),R={output:M.content,truncated:M.truncated,...M.truncated&&C.fullOutputPath?{full_output_path:C.fullOutputPath}:{},exit_code:d,wall_time_seconds:D},U=T?.details.escalation?T.details:void 0,Q=U?{...k,sandbox:U}:k;if(d!==0){const g=d===127?await Be(O):void 0,F=B(O,`Command exited with code ${d}`);return{content:[{type:"text",text:g?`${F}
|
|
20
|
+
${g}`:F}],details:Q,structuredContent:R,isError:!0}}return{content:[{type:"text",text:O}],details:Q,structuredContent:R}}finally{q()}},renderCall(r,m,h){const p=h.state;h.executionStarted&&p.startedAt===void 0&&(p.startedAt=Date.now(),p.endedAt=void 0);const f=h.lastComponent??new j("",0,0);return f.setText(wt(r,e.prompt,h.expanded===!0)),f},renderResult(r,m,h,p){const f=p.state;f.startedAt!==void 0&&m.isPartial&&!f.interval&&(f.interval=setInterval(()=>p.invalidate(),1e3)),(!m.isPartial||p.isError)&&(f.endedAt??=Date.now(),f.interval&&(clearInterval(f.interval),f.interval=void 0));const _=p.lastComponent??new ft;return St(_,r,m,p.showImages,f.startedAt,f.endedAt,p.isError,p.durationMs),_.invalidate(),_}}}a(xt,"createShellToolDefinition");const Et={name:"bash",label:"bash",shellName:"bash",prompt:"$",promptSnippet:be.snippet,promptGuidelines:be.guidelines,tempFilePrefix:"dal-bash",readOnlyCommand:je,sandboxShell:a(t=>ue(t).shell,"sandboxShell")};function _t(t,e){return xt(t,Et,e)}a(_t,"createBashToolDefinition");function Kt(t,e){const n=_t(t,e),o=Je(n);return Object.assign(o,{promptSnippet:n.promptSnippet,promptGuidelines:n.promptGuidelines}),o}a(Kt,"createBashTool");export{be as bashToolSystemPromptContribution,Kt as createBashTool,_t as createBashToolDefinition,dt as createLocalBashOperations,rt as createLocalShellOperations,xt as createShellToolDefinition,Xt as registerShellExecutionGuard,it as sandboxEscalationSchema,lt as shellExecutionRefusal};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashTool, createBashToolDefinition, createLocalBashOperations, registerShellExecutionGuard, type ShellExecutionGuard, type ShellExecutionRequest, } from "./bash.ts";
|
|
1
|
+
export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashTool, createBashToolDefinition, createLocalBashOperations, registerShellExecutionGuard, type ShellExecutionGuard, type ShellExecutionRequest, shellExecutionRefusal, } from "./bash.ts";
|
|
2
2
|
export { createEditTool, createEditToolDefinition, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, } from "./edit.ts";
|
|
3
3
|
export { withFileMutationQueue } from "./file-mutation-queue.ts";
|
|
4
4
|
export { createFindTool, createFindToolDefinition, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, } from "./find.ts";
|
package/dist/core/tools/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var E=Object.defineProperty;var o=(r,e)=>E(r,"name",{value:e,configurable:!0});import{createBashTool as H,createBashToolDefinition as I,createLocalBashOperations as Q,registerShellExecutionGuard as Y,shellExecutionRefusal as j}from"./bash.js";import{createEditTool as v,createEditToolDefinition as J}from"./edit.js";import{withFileMutationQueue as N}from"./file-mutation-queue.js";import{createFindTool as Z,createFindToolDefinition as w}from"./find.js";import{createGrepTool as re,createGrepToolDefinition as te}from"./grep.js";import{createLsTool as ae,createLsToolDefinition as le}from"./ls.js";import{createLocalPowerShellOperations as ne,createPowerShellTool as fe,createPowerShellToolDefinition as Te}from"./powershell.js";import{createProcessToolDefinition as ce}from"./process.js";import{createReadTool as se,createReadToolDefinition as me}from"./read.js";import{DEFAULT_MAX_BYTES as xe,DEFAULT_MAX_LINES as de,formatSize as ge,truncateHead as pe,truncateLine as Ee,truncateTail as be}from"./truncate.js";import{createWriteTool as Se,createWriteToolDefinition as Fe}from"./write.js";import{createBashTool as i,createBashToolDefinition as n}from"./bash.js";import{createEditTool as f,createEditToolDefinition as T}from"./edit.js";import{createFindTool as u,createFindToolDefinition as c}from"./find.js";import{createGrepTool as h,createGrepToolDefinition as s}from"./grep.js";import{createLsTool as m,createLsToolDefinition as D}from"./ls.js";import{createPowerShellTool as g,createPowerShellToolDefinition as p}from"./powershell.js";import{createReadTool as a,createReadToolDefinition as l}from"./read.js";import{createWriteTool as x,createWriteToolDefinition as d}from"./write.js";const O=new Set(["read","bash","powershell","edit","write","grep","find","ls"]);function U(r,e,t){switch(r){case"read":return l(e,t?.read);case"bash":return n(e,t?.bash);case"powershell":return p(e,t?.powershell);case"edit":return T(e,t?.edit);case"write":return d(e,t?.write);case"grep":return s(e,t?.grep);case"find":return c(e,t?.find);case"ls":return D(e,t?.ls);default:throw new Error(`Unknown tool name: ${r}`)}}o(U,"createToolDefinition");function W(r,e,t){switch(r){case"read":return a(e,t?.read);case"bash":return i(e,t?.bash);case"powershell":return g(e,t?.powershell);case"edit":return f(e,t?.edit);case"write":return x(e,t?.write);case"grep":return h(e,t?.grep);case"find":return u(e,t?.find);case"ls":return m(e,t?.ls);default:throw new Error(`Unknown tool name: ${r}`)}}o(W,"createTool");function _(r,e){return[l(r,e?.read),n(r,e?.bash),T(r,e?.edit),d(r,e?.write)]}o(_,"createCodingToolDefinitions");function M(r,e){return[l(r,e?.read),s(r,e?.grep),c(r,e?.find),D(r,e?.ls)]}o(M,"createReadOnlyToolDefinitions");function k(r,e){return{read:l(r,e?.read),bash:n(r,e?.bash),powershell:p(r,e?.powershell),edit:T(r,e?.edit),write:d(r,e?.write),grep:s(r,e?.grep),find:c(r,e?.find),ls:D(r,e?.ls)}}o(k,"createAllToolDefinitions");function y(r,e){return[a(r,e?.read),i(r,e?.bash),f(r,e?.edit),x(r,e?.write)]}o(y,"createCodingTools");function C(r,e){return[a(r,e?.read),h(r,e?.grep),u(r,e?.find),m(r,e?.ls)]}o(C,"createReadOnlyTools");function X(r,e){return{read:a(r,e?.read),bash:i(r,e?.bash),powershell:g(r,e?.powershell),edit:f(r,e?.edit),write:x(r,e?.write),grep:h(r,e?.grep),find:u(r,e?.find),ls:m(r,e?.ls)}}o(X,"createAllTools");export{xe as DEFAULT_MAX_BYTES,de as DEFAULT_MAX_LINES,O as allToolNames,k as createAllToolDefinitions,X as createAllTools,H as createBashTool,I as createBashToolDefinition,_ as createCodingToolDefinitions,y as createCodingTools,v as createEditTool,J as createEditToolDefinition,Z as createFindTool,w as createFindToolDefinition,re as createGrepTool,te as createGrepToolDefinition,Q as createLocalBashOperations,ne as createLocalPowerShellOperations,ae as createLsTool,le as createLsToolDefinition,fe as createPowerShellTool,Te as createPowerShellToolDefinition,ce as createProcessToolDefinition,M as createReadOnlyToolDefinitions,C as createReadOnlyTools,se as createReadTool,me as createReadToolDefinition,W as createTool,U as createToolDefinition,Se as createWriteTool,Fe as createWriteToolDefinition,ge as formatSize,Y as registerShellExecutionGuard,j as shellExecutionRefusal,pe as truncateHead,Ee as truncateLine,be as truncateTail,N as withFileMutationQueue};
|
package/dist/dal/manifest.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var s=Object.defineProperty;var i=(e,a)=>s(e,"name",{value:a,configurable:!0});import{createRequire as u}from"node:module";import{getLanguage as r,translate as d}from"@dalcode/dal-pi-kit";const c=[{package:"@dalcode/dal-plugins",label:"\u63D2\u4EF6\u517C\u5BB9",description:"\u8BA9\u793E\u533A\u63D2\u4EF6\u5728 DAL \u4E2D\u53EF\u7528\uFF0C\u5E76\u63D0\u4F9B\u63D2\u4EF6\u641C\u7D22",activation:"always"},{package:"@dalcode/deepailab",label:"DeepAILab \u8D26\u53F7",description:"DeepAILab \u767B\u5F55\u3001\u5957\u9910\u4E0E\u6A21\u578B\u63D0\u4F9B\u65B9\uFF08/login\u3001/account\uFF09",activation:"always"},{package:"@dalcode/dal-gateway",label:"DAL \u7F51\u5173",description:"\u7ECF DAL \u7F51\u5173\u8C03\u7528\u6A21\u578B",activation:"always"},{package:"@dalcode/dal-guard",label:"\u547D\u4EE4\u5BA1\u6279",description:"\u9AD8\u98CE\u9669\u547D\u4EE4\u6267\u884C\u524D\u8BF7\u4F60\u786E\u8BA4\uFF08/guard\uFF09",activation:"always",safetyCritical:!0},{package:"@dalcode/dal-lsp",label:"\u8BED\u8A00\u670D\u52A1\u5668",description:"\u67E5\u7C7B\u578B\u9519\u8BEF\u3001\u5B9A\u4E49\u4E0E\u5F15\u7528",activation:"always"},{package:"@dalcode/dal-dap",label:"\u8C03\u8BD5\u5668",description:"\u8C03\u8BD5 Python \u548C Node.js \u7A0B\u5E8F\uFF1A\u65AD\u70B9\u3001\u5355\u6B65\u3001\u67E5\u770B\u8C03\u7528\u6808\u4E0E\u53D8\u91CF",activation:"always"},{package:"@dalcode/dal-subagent",label:"\u5B50\u52A9\u624B",description:"\u6D3E\u51FA\u5B50\u52A9\u624B\u5E76\u884C\u5904\u7406\u4EFB\u52A1",activation:"always"},{package:"@dalcode/dal-router",label:"\u667A\u80FD\u8DEF\u7531",description:"\u6309\u4EFB\u52A1\u81EA\u52A8\u6311\u9009\u6A21\u578B\uFF08/factory\uFF09",activation:"always"},{package:"@dalcode/dal-capabilities",label:"\u80FD\u529B\u4E2D\u5FC3",description:"\u6309\u4EFB\u52A1\u81EA\u52A8\u542F\u7528\u5BA1\u6838\u8FC7\u7684\u8FDE\u63A5\u5668\u3001\u6280\u80FD\u548C\u6269\u5C55\uFF0C\u9700\u8981\u65F6\u81EA\u52A8\u5B89\u88C5\uFF08/capabilities\uFF09",activation:"always"},{package:"@dalcode/dal-mcp",label:"MCP",description:"\u8FDE\u63A5 MCP \u670D\u52A1\u5668\u5E76\u4F7F\u7528\u5176\u5DE5\u5177\uFF08/mcp\uFF09",activation:"always"},{package:"@dalcode/dal-skills",label:"\u6280\u80FD",description:"\u641C\u7D22\u548C\u52A0\u8F7D\u672C\u5730\u4E0E\u4E91\u7AEF\u6280\u80FD\uFF08/skills\uFF09",activation:"always"},{package:"@dalcode/dal-office",label:"\u529E\u516C\u6587\u6863",description:"\u751F\u6210\u3001\u8BFB\u53D6\u548C\u4FEE\u6539 PPT\u3001Word\u3001Excel\u3001\u56FE\u8868",activation:"always"},{package:"@dalcode/dal-web",label:"\u8054\u7F51",description:"\u7F51\u9875\u641C\u7D22\u4E0E\u7F51\u9875\u8BFB\u53D6\uFF08/web\uFF09",activation:"always"},{package:"@dalcode/dal-workflow",label:"\u8BA1\u5212\u4E0E\u5F85\u529E",description:"\u8BA1\u5212\u6A21\u5F0F\u3001\u5F85\u529E\u6E05\u5355\u548C\u5B8C\u6210\u63D0\u9192\uFF08/plan\u3001/todos\uFF09",activation:"always"},{package:"@dalcode/dal-tool-catalog",label:"\u5DE5\u5177\u76EE\u5F55",description:"\u529E\u516C\u3001\u8054\u7F51\u7B49\u5DE5\u5177\u6309\u9700\u52A0\u8F7D\uFF0C\u8282\u7701\u4E0A\u4E0B\u6587\uFF1B\u6A21\u578B\u53D1\u6765\u7684\u5DE5\u5177\u53C2\u6570\u6709\u683C\u5F0F\u5C0F\u9519\u65F6\u5148\u81EA\u52A8\u4FEE\u6B63\u518D\u8C03\u7528",activation:"always"},{package:"@dalcode/dal-halo",label:"Halo",description:"\u5728 Halo \u7075\u52A8\u5C9B\u4E0A\u663E\u793A\u8FDB\u5EA6\u548C\u5BA1\u6279",activation:"halo-app"},{package:"@dalcode/dal-lang",label:"\u754C\u9762\u8BED\u8A00",description:"\u5207\u6362\u4E2D\u6587\u6216\u82F1\u6587\u754C\u9762\uFF08/lang\uFF09",activation:"always"},{package:"@dalcode/dal-bridge",label:"DAL Code \u6865\u63A5",description:"\u5728 DAL Code \u4E2D\u628A\u5BA1\u6279\u3001\u8BA1\u5212\u548C\u63D0\u95EE\u4EA4\u7ED9\u7F16\u8F91\u5668",activation:"dal-code"},{package:"@dalcode/dal-telemetry",label:"\u4F7F\u7528\u7EDF\u8BA1",description:"\u533F\u540D\u4F7F\u7528\u7EDF\u8BA1\uFF08/telemetry\uFF09",activation:"always"},{package:"@dalcode/dal-rewind",label:"\u68C0\u67E5\u70B9",description:"\u6BCF\u8F6E\u6539\u52A8\u81EA\u52A8\u7559\u68C0\u67E5\u70B9\uFF0C\u53EF\u56DE\u9000\uFF08/rewind\uFF09",activation:"always"},{package:"@dalcode/dal-review",label:"\u4EE3\u7801\u8BC4\u5BA1",description:"\u53EA\u8BFB\u8BC4\u5BA1\u6539\u52A8\uFF0C\u6309\u4E25\u91CD\u7A0B\u5EA6\u5217\u51FA\u95EE\u9898\uFF08/review\uFF09\uFF1B\u53EA\u63D0\u7B80\u5316\u5EFA\u8BAE\u3001\u4E0D\u6539\u4EE3\u7801\uFF08/simplify\uFF09",activation:"always"},{package:"@dalcode/dal-goal",label:"\u76EE\u6807\u6A21\u5F0F",description:"\u8BBE\u5B9A\u4E00\u4E2A\u76EE\u6807\uFF0C\u52A9\u624B\u6301\u7EED\u5DE5\u4F5C\u76F4\u5230\u9A8C\u8BC1\u5B8C\u6210\uFF0C\u6709\u7EED\u8DD1\u6B21\u6570\u548C token \u4E0A\u9650\uFF08/goal\uFF09",activation:"always"},{package:"@dalcode/dal-learn",label:"\u81EA\u6211\u8FDB\u5316",description:"\u4ECE\u8FC7\u5F80\u4F1A\u8BDD\u5B66\u7ECF\u9A8C\u3001\u8BB0\u4F4F\u9879\u76EE\u7684\u547D\u4EE4\u548C\u4F4D\u7F6E\uFF0C\u91CD\u590D\u7684\u6D41\u7A0B\u53EF\u8D77\u8349\u6210\u6280\u80FD\uFF08/lessons\uFF09",activation:"always"},{package:"@dalcode/dal-recall",label:"\u4F1A\u8BDD\u68C0\u7D22",description:"\u5728\u8FC7\u5F80\u4F1A\u8BDD\u91CC\u641C\u7D22\u4E4B\u524D\u505A\u8FC7\u7684\u51B3\u5B9A\u548C\u7EA6\u5B9A\uFF08session_search\uFF09",activation:"always"},{package:"@dalcode/dal-usage",label:"\u7528\u91CF\u7EDF\u8BA1",description:"\u8DE8\u4F1A\u8BDD\u6C47\u603B token \u548C\u8D39\u7528\uFF0C\u6309\u5929\u3001\u6A21\u578B\u3001\u9879\u76EE\u67E5\u770B\uFF08/usage\uFF09\uFF1B\u53EF\u8BBE\u8D39\u7528\u4E0A\u9650\uFF08--max-cost\u3001/budget\uFF09\u548C\u8FD0\u884C\u65F6\u957F\u4E0A\u9650\uFF08--max-time\uFF09",activation:"always"},{package:"@dalcode/dal-awake",label:"\u957F\u4EFB\u52A1\u9632\u4F11\u7720",description:"\u4EFB\u52A1\u8FD0\u884C\u8F83\u4E45\u65F6\u8BA9\u7535\u8111\u4FDD\u6301\u5524\u9192\uFF08\u5C4F\u5E55\u4ECD\u53EF\u7184\u706D\uFF09\uFF0C\u7ED3\u675F\u540E\u6062\u590D\uFF1B\u4E0D\u6253\u6270\uFF08/awake\uFF09",activation:"always"},{package:"@dalcode/dal-statusline",label:"\u81EA\u5B9A\u4E49\u72B6\u6001\u884C",description:"\u5728\u5E95\u90E8\u72B6\u6001\u680F\u52A0\u4E00\u884C\u81EA\u5DF1\u7684\u5185\u5BB9\uFF1A\u6A21\u677F\u6216\u547D\u4EE4\uFF08/statusline\uFF09",activation:"tui"},{package:"@dalcode/dal-advisor",label:"\u7B2C\u4E8C\u610F\u89C1",description:"\u7531\u6A21\u578B\u8C03\u7528\uFF1A\u8BF7\u53E6\u4E00\u4E2A\u5F3A\u6A21\u578B\u590D\u6838\u5F53\u524D\u65B9\u6848\u5E76\u6307\u51FA\u98CE\u9669\uFF0C\u8D39\u7528\u8BA1\u5165\u4F1A\u8BDD\uFF0C\u6BCF\u4F1A\u8BDD\u6709\u6B21\u6570\u4E0A\u9650",activation:"always"},{package:"@dalcode/dal-compat",label:"Claude Code \u517C\u5BB9",description:"\u6CBF\u7528 Claude Code \u7684\u89C4\u5219\uFF1A\u7528\u6237\u548C\u9879\u76EE .claude/rules/ \u4E0E .claude/CLAUDE.md\u3001\u8BF4\u660E\u6587\u4EF6\u91CC\u7684 @\u6587\u4EF6 \u5F15\u7528\u3001\u5B50\u76EE\u5F55\u91CC\u7684 AGENTS.md",activation:"always"},{package:"@dalcode/dal-structured",label:"\u7ED3\u6784\u5316\u8F93\u51FA",description:"dal -p --output-schema \u6309 JSON Schema \u8F93\u51FA\u6700\u7EC8\u56DE\u7B54\uFF0C\u4E0D\u7B26\u5408\u65F6\u975E\u96F6\u9000\u51FA\uFF0C\u7528\u4E8E\u811A\u672C\u548C CI",activation:"always"},{package:"@dalcode/dal-interactive",label:"\u7EC8\u7AEF\u4EA4\u4E92",description:"\u95EE\u5377\u63D0\u95EE\u3001/handoff \u4EA4\u63A5\u5230\u65B0\u4F1A\u8BDD\u3001/btw \u65C1\u8DEF\u63D0\u95EE\u3001!vim \u7B49\u4EA4\u4E92\u5F0F\u547D\u4EE4\uFF08\u7EC8\u7AEF\u754C\u9762\uFF09",activation:"tui"},{package:"@dalcode/dal-terminal",label:"\u7EC8\u7AEF\u4E0A\u4E0B\u6587",description:"\u5BBF\u4E3B\u7A0B\u5E8F\u63D0\u4F9B\u7EC8\u7AEF\u65F6\uFF0C\u52A9\u624B\u53EF\u8BFB\u53D6\u7EC8\u7AEF\u8F93\u51FA\uFF08@terminal\uFF09",activation:"host-capability"},{package:"cc-safety-net",label:"\u5371\u9669\u547D\u4EE4\u62E6\u622A",description:"\u6267\u884C\u524D\u62E6\u4E0B rm -rf\u3001\u5F3A\u5236\u63A8\u9001\u7B49\u7834\u574F\u6027\u547D\u4EE4",activation:"always",safetyCritical:!0},{package:"@dalcode/dal-rtk",label:"\u547D\u4EE4\u8F93\u51FA\u538B\u7F29\uFF08rtk\uFF09",description:"\u68C0\u6D4B\u5230\u4F60\u88C5\u4E86 rtk \u65F6\uFF0C\u52A9\u624B\u8FD0\u884C\u7684\u547D\u4EE4\u8F93\u51FA\u7ECF\u5B83\u538B\u7F29\u3001\u8282\u7701\u4E0A\u4E0B\u6587\uFF1B\u6CA1\u88C5\u5219\u4EC0\u4E48\u90FD\u4E0D\u505A\uFF08/rtk\uFF09",activation:"always"}],f=c.map(e=>e.package),v=new Set(c.filter(e=>e.safetyCritical).map(e=>e.package));function m(e){try{const l=u(import.meta.url)(`${e}/package.json`);return{version:l.version??"",extensions:[...l.pi?.extensions??[]]}}catch{return}}i(m,"installedManifest");function g(e=r()){return c.map(a=>{const l=m(a.package);return{name:a.package,label:d(a.label,e),description:d(a.description,e),enabledByDefault:!0,canDisable:!1,safetyCritical:a.safetyCritical===!0,activation:a.activation,installed:l!==void 0,version:l?.version??"",extensions:l?.extensions??[]}})}i(g,"listBundledExtensions");const o=[{name:"read",label:"\u8BFB\u53D6\u6587\u4EF6",summary:"\u8BFB\u53D6\u6587\u4EF6\u5185\u5BB9\uFF0C\u4E5F\u80FD\u770B\u56FE\u7247",source:"core",readOnly:!0,availability:"default"},{name:"bash",label:"\u8FD0\u884C\u547D\u4EE4",summary:"\u5728\u7EC8\u7AEF\u91CC\u8FD0\u884C\u547D\u4EE4",source:"core",readOnly:!1,availability:"default"},{name:"edit",label:"\u7F16\u8F91\u6587\u4EF6",summary:"\u6309\u539F\u6587\u66FF\u6362\u4FEE\u6539\u6587\u4EF6",source:"core",readOnly:!1,availability:"default"},{name:"write",label:"\u5199\u5165\u6587\u4EF6",summary:"\u65B0\u5EFA\u6216\u8986\u76D6\u6587\u4EF6",source:"core",readOnly:!1,availability:"default"},{name:"grep",label:"\u641C\u7D22\u5185\u5BB9",summary:"\u5728\u6587\u4EF6\u91CC\u641C\u7D22\u6587\u672C",source:"core",readOnly:!0,availability:"opt-in"},{name:"find",label:"\u67E5\u627E\u6587\u4EF6",summary:"\u6309\u540D\u79F0\u67E5\u627E\u6587\u4EF6",source:"core",readOnly:!0,availability:"opt-in"},{name:"ls",label:"\u5217\u51FA\u76EE\u5F55",summary:"\u5217\u51FA\u76EE\u5F55\u5185\u5BB9",source:"core",readOnly:!0,availability:"opt-in"},{name:"powershell",label:"\u8FD0\u884C PowerShell",summary:"\u5728 Windows \u4E0A\u7528 PowerShell \u8FD0\u884C\u547D\u4EE4",source:"core",readOnly:!1,availability:"opt-in"},{name:"process",label:"\u540E\u53F0\u8FDB\u7A0B",summary:"\u5728\u540E\u53F0\u8FD0\u884C\u5F00\u53D1\u670D\u52A1\u5668\u7B49\u957F\u65F6\u95F4\u547D\u4EE4\uFF0C\u968F\u65F6\u67E5\u770B\u8F93\u51FA",source:"core",readOnly:!1,availability:"default"},{name:"plugin_search",label:"\u641C\u7D22\u63D2\u4EF6",summary:"\u641C\u7D22\u53EF\u5B89\u88C5\u7684\u63D2\u4EF6",source:"@dalcode/dal-plugins",readOnly:!0,availability:"default"},{name:"lsp",label:"\u8BED\u8A00\u670D\u52A1\u5668",summary:"\u67E5\u7C7B\u578B\u9519\u8BEF\u3001\u7B26\u53F7\u3001\u5B9A\u4E49\u4E0E\u5F15\u7528",source:"@dalcode/dal-lsp",readOnly:!0,availability:"on-demand"},{name:"debug",label:"\u8C03\u8BD5\u5668",summary:"\u8BBE\u65AD\u70B9\u3001\u5355\u6B65\u8FD0\u884C\u7A0B\u5E8F\u5E76\u67E5\u770B\u53D8\u91CF",source:"@dalcode/dal-dap",readOnly:!1,availability:"on-demand"},{name:"task",label:"\u5B50\u52A9\u624B",summary:"\u6D3E\u51FA\u5B50\u52A9\u624B\u5904\u7406\u4E00\u9879\u5B50\u4EFB\u52A1",source:"@dalcode/dal-subagent",readOnly:!1,availability:"default"},{name:"mcp",label:"MCP \u5DE5\u5177",summary:"\u8C03\u7528\u5DF2\u8FDE\u63A5 MCP \u670D\u52A1\u5668\u7684\u5DE5\u5177",source:"@dalcode/dal-mcp",readOnly:!1,availability:"mcp"},{name:"skill",label:"\u6280\u80FD",summary:"\u641C\u7D22\u5E76\u52A0\u8F7D\u4E13\u9879\u4EFB\u52A1\u6307\u5F15",source:"@dalcode/dal-skills",readOnly:!0,availability:"default"},{name:"office_ppt_plan",label:"\u89C4\u5212 PPT",summary:"\u5148\u5217\u51FA PPT \u7684\u9875\u9762\u5927\u7EB2",source:"@dalcode/dal-office",readOnly:!0,availability:"on-demand"},{name:"office_ppt_generate",label:"\u751F\u6210 PPT",summary:"\u751F\u6210 PowerPoint \u6F14\u793A\u6587\u7A3F",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_doc_generate",label:"\u751F\u6210 Word",summary:"\u751F\u6210 Word \u6587\u6863",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_md_generate",label:"\u751F\u6210 Markdown",summary:"\u751F\u6210 Markdown \u6587\u6863",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_sheet_generate",label:"\u751F\u6210\u8868\u683C",summary:"\u751F\u6210 Excel \u8868\u683C",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_chart_generate",label:"\u751F\u6210\u56FE\u8868",summary:"\u751F\u6210 ECharts \u56FE\u8868",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_drawio_generate",label:"\u751F\u6210\u6D41\u7A0B\u56FE",summary:"\u751F\u6210 draw.io \u56FE",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_read_file",label:"\u8BFB\u53D6\u6587\u6863",summary:"\u8BFB\u53D6 Word\u3001PPT\u3001Excel\u3001PDF\u3001CSV",source:"@dalcode/dal-office",readOnly:!0,availability:"on-demand"},{name:"office_docx_edit",label:"\u4FEE\u6539 Word",summary:"\u6309\u4F4D\u7F6E\u4FEE\u6539\u5DF2\u6709\u7684 Word \u6587\u6863",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_pptx_edit",label:"\u4FEE\u6539 PPT",summary:"\u6309\u4F4D\u7F6E\u4FEE\u6539\u5DF2\u6709\u7684 PPT",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_xlsx_edit",label:"\u4FEE\u6539\u8868\u683C",summary:"\u6309\u4F4D\u7F6E\u4FEE\u6539\u5DF2\u6709\u7684 Excel",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"web_search",label:"\u7F51\u9875\u641C\u7D22",summary:"\u8054\u7F51\u641C\u7D22\u6700\u65B0\u4FE1\u606F",source:"@dalcode/dal-web",readOnly:!0,availability:"on-demand"},{name:"web_fetch",label:"\u8BFB\u53D6\u7F51\u9875",summary:"\u8BFB\u53D6\u7F51\u9875\u6216 PDF \u94FE\u63A5\u7684\u6B63\u6587",source:"@dalcode/dal-web",readOnly:!0,availability:"on-demand"},{name:"todo",label:"\u5F85\u529E\u6E05\u5355",summary:"\u7EF4\u62A4\u672C\u6B21\u4EFB\u52A1\u7684\u5F85\u529E\u6E05\u5355",source:"@dalcode/dal-workflow",readOnly:!0,availability:"default"},{name:"tool_catalog",label:"\u5DE5\u5177\u76EE\u5F55",summary:"\u67E5\u770B\u5E76\u542F\u7528\u6309\u9700\u52A0\u8F7D\u7684\u5DE5\u5177\u5206\u7EC4",source:"@dalcode/dal-tool-catalog",readOnly:!0,availability:"default"},{name:"submit_plan",label:"\u63D0\u4EA4\u8BA1\u5212",summary:"\u628A\u8BA1\u5212\u4EA4\u7ED9\u4F60\u5BA1\u6279",source:"@dalcode/dal-bridge",readOnly:!0,availability:"dal-code"},{name:"ask_user",label:"\u8BE2\u95EE\u4F60",summary:"\u5F00\u5DE5\u524D\u7528\u5361\u7247\u786E\u8BA4\u5173\u952E\u51B3\u5B9A",source:"@dalcode/dal-bridge",readOnly:!0,availability:"dal-code"},{name:"review_report",label:"\u63D0\u4EA4\u8BC4\u5BA1\u7ED3\u679C",summary:"\u8BC4\u5BA1\u52A9\u624B\u63D0\u4EA4\u53D1\u73B0\u7684\u95EE\u9898",source:"@dalcode/dal-review",readOnly:!0,availability:"reviewer"},{name:"goal_complete",label:"\u5B8C\u6210\u76EE\u6807",summary:"\u76EE\u6807\u7ECF\u9A8C\u8BC1\u5168\u90E8\u5B8C\u6210\u65F6\u7ED3\u675F\u76EE\u6807",source:"@dalcode/dal-goal",readOnly:!0,availability:"opt-in"},{name:"goal_blocked",label:"\u76EE\u6807\u53D7\u963B",summary:"\u76EE\u6807\u786E\u5B9E\u65E0\u6CD5\u7EE7\u7EED\u3001\u9700\u8981\u4F60\u5904\u7406\u65F6\u505C\u4E0B",source:"@dalcode/dal-goal",readOnly:!0,availability:"opt-in"},{name:"goal_wait",label:"\u76EE\u6807\u7B49\u5F85",summary:"\u76EE\u6807\u7B49\u5F85\u5916\u90E8\u4E8B\u4EF6\u65F6\u6682\u505C\u81EA\u52A8\u7EED\u8DD1",source:"@dalcode/dal-goal",readOnly:!0,availability:"opt-in"},{name:"session_search",label:"\u641C\u7D22\u8FC7\u5F80\u4F1A\u8BDD",summary:"\u641C\u7D22\u8FC7\u5F80\u4F1A\u8BDD\u91CC\u7684\u51B3\u5B9A\u548C\u7EA6\u5B9A",source:"@dalcode/dal-recall",readOnly:!0,availability:"default"},{name:"advisor",label:"\u7B2C\u4E8C\u610F\u89C1",summary:"\u8BF7\u53E6\u4E00\u4E2A\u5F3A\u6A21\u578B\u590D\u6838\u5F53\u524D\u65B9\u6848\u5E76\u6307\u51FA\u98CE\u9669",source:"@dalcode/dal-advisor",readOnly:!0,availability:"default"},{name:"structured_output",label:"\u7ED3\u6784\u5316\u8F93\u51FA",summary:"\u6309 --output-schema \u7ED9\u51FA JSON \u683C\u5F0F\u7684\u6700\u7EC8\u56DE\u7B54",source:"@dalcode/dal-structured",readOnly:!0,availability:"opt-in"},{name:"questionnaire",label:"\u95EE\u5377",summary:"\u7528\u9009\u62E9\u9898\u5411\u4F60\u786E\u8BA4\u9700\u6C42\u6216\u504F\u597D",source:"@dalcode/dal-interactive",readOnly:!0,availability:"tui"},{name:"terminal_read",label:"\u8BFB\u53D6\u7EC8\u7AEF",summary:"\u8BFB\u53D6\u7EC8\u7AEF\u6700\u8FD1\u7684\u8F93\u51FA",source:"@dalcode/dal-terminal",readOnly:!0,availability:"host"}],w=(()=>{const e={};for(const a of o){if(a.source==="core")continue;const l=e[a.source]??[];l.push(a.name),e[a.source]=l}return{builtin:o.filter(a=>a.source==="core").map(a=>a.name),extensions:e}})();function k(e=r()){return o.map(a=>({name:a.name,label:d(a.label,e),summary:d(a.summary,e),source:a.source,readOnly:a.readOnly,availability:a.availability}))}i(k,"listToolCatalog");function O(e,a=r()){const l=o.find(n=>n.name===e);if(l)return d(l.label,a);const t=e.match(/^mcp__(.+?)__(.+)$/);return t?`${t[1]} \xB7 ${t[2]}`:e}i(O,"toolDisplayLabel");export{f as BUNDLED_EXTENSION_PACKAGES,w as DAL_TOOL_NAMES,v as SAFETY_CRITICAL_PACKAGES,g as listBundledExtensions,k as listToolCatalog,O as toolDisplayLabel};
|
|
1
|
+
var s=Object.defineProperty;var i=(e,a)=>s(e,"name",{value:a,configurable:!0});import{createRequire as u}from"node:module";import{getLanguage as r,translate as d}from"@dalcode/dal-pi-kit";const c=[{package:"@dalcode/dal-plugins",label:"\u63D2\u4EF6\u517C\u5BB9",description:"\u8BA9\u793E\u533A\u63D2\u4EF6\u5728 DAL \u4E2D\u53EF\u7528\uFF0C\u5E76\u63D0\u4F9B\u63D2\u4EF6\u641C\u7D22",activation:"always"},{package:"@dalcode/deepailab",label:"DeepAILab \u8D26\u53F7",description:"DeepAILab \u767B\u5F55\u3001\u5957\u9910\u4E0E\u6A21\u578B\u63D0\u4F9B\u65B9\uFF08/login\u3001/account\uFF09",activation:"always"},{package:"@dalcode/dal-gateway",label:"DAL \u7F51\u5173",description:"\u7ECF DAL \u7F51\u5173\u8C03\u7528\u6A21\u578B",activation:"always"},{package:"@dalcode/dal-guard",label:"\u547D\u4EE4\u5BA1\u6279",description:"\u9AD8\u98CE\u9669\u547D\u4EE4\u6267\u884C\u524D\u8BF7\u4F60\u786E\u8BA4\uFF08/guard\uFF09",activation:"always",safetyCritical:!0},{package:"@dalcode/dal-lsp",label:"\u8BED\u8A00\u670D\u52A1\u5668",description:"\u67E5\u7C7B\u578B\u9519\u8BEF\u3001\u5B9A\u4E49\u4E0E\u5F15\u7528",activation:"always"},{package:"@dalcode/dal-dap",label:"\u8C03\u8BD5\u5668",description:"\u8C03\u8BD5 Python \u548C Node.js \u7A0B\u5E8F\uFF1A\u65AD\u70B9\u3001\u5355\u6B65\u3001\u67E5\u770B\u8C03\u7528\u6808\u4E0E\u53D8\u91CF",activation:"always"},{package:"@dalcode/dal-subagent",label:"\u5B50\u52A9\u624B",description:"\u6D3E\u51FA\u5B50\u52A9\u624B\u5E76\u884C\u5904\u7406\u4EFB\u52A1",activation:"always"},{package:"@dalcode/dal-router",label:"\u667A\u80FD\u8DEF\u7531",description:"\u6309\u4EFB\u52A1\u81EA\u52A8\u6311\u9009\u6A21\u578B\uFF08/factory\uFF09",activation:"always"},{package:"@dalcode/dal-capabilities",label:"\u80FD\u529B\u4E2D\u5FC3",description:"\u6309\u4EFB\u52A1\u81EA\u52A8\u542F\u7528\u5BA1\u6838\u8FC7\u7684\u8FDE\u63A5\u5668\u3001\u6280\u80FD\u548C\u6269\u5C55\uFF0C\u9700\u8981\u65F6\u81EA\u52A8\u5B89\u88C5\uFF08/capabilities\uFF09",activation:"always"},{package:"@dalcode/dal-mcp",label:"MCP",description:"\u8FDE\u63A5 MCP \u670D\u52A1\u5668\u5E76\u4F7F\u7528\u5176\u5DE5\u5177\uFF08/mcp\uFF09",activation:"always"},{package:"@dalcode/dal-skills",label:"\u6280\u80FD",description:"\u641C\u7D22\u548C\u52A0\u8F7D\u672C\u5730\u4E0E\u4E91\u7AEF\u6280\u80FD\uFF08/skills\uFF09",activation:"always"},{package:"@dalcode/dal-office",label:"\u529E\u516C\u6587\u6863",description:"\u751F\u6210\u3001\u8BFB\u53D6\u548C\u4FEE\u6539 PPT\u3001Word\u3001Excel\u3001\u56FE\u8868",activation:"always"},{package:"@dalcode/dal-web",label:"\u8054\u7F51",description:"\u7F51\u9875\u641C\u7D22\u4E0E\u7F51\u9875\u8BFB\u53D6\uFF08/web\uFF09",activation:"always"},{package:"@dalcode/dal-workflow",label:"\u8BA1\u5212\u4E0E\u5F85\u529E",description:"\u8BA1\u5212\u6A21\u5F0F\u3001\u5F85\u529E\u6E05\u5355\u548C\u5B8C\u6210\u63D0\u9192\uFF08/plan\u3001/todos\uFF09",activation:"always"},{package:"@dalcode/dal-tool-catalog",label:"\u5DE5\u5177\u76EE\u5F55",description:"\u529E\u516C\u3001\u8054\u7F51\u7B49\u5DE5\u5177\u6309\u9700\u52A0\u8F7D\uFF0C\u8282\u7701\u4E0A\u4E0B\u6587\uFF1B\u6A21\u578B\u53D1\u6765\u7684\u5DE5\u5177\u53C2\u6570\u6709\u683C\u5F0F\u5C0F\u9519\u65F6\u5148\u81EA\u52A8\u4FEE\u6B63\u518D\u8C03\u7528",activation:"always"},{package:"@dalcode/dal-halo",label:"Halo",description:"\u5728 Halo \u7075\u52A8\u5C9B\u4E0A\u663E\u793A\u8FDB\u5EA6\u548C\u5BA1\u6279",activation:"halo-app"},{package:"@dalcode/dal-lang",label:"\u754C\u9762\u8BED\u8A00",description:"\u5207\u6362\u4E2D\u6587\u6216\u82F1\u6587\u754C\u9762\uFF08/lang\uFF09",activation:"always"},{package:"@dalcode/dal-bridge",label:"DAL Code \u6865\u63A5",description:"\u5728 DAL Code \u4E2D\u628A\u5BA1\u6279\u3001\u8BA1\u5212\u548C\u63D0\u95EE\u4EA4\u7ED9\u7F16\u8F91\u5668",activation:"dal-code"},{package:"@dalcode/dal-telemetry",label:"\u4F7F\u7528\u7EDF\u8BA1",description:"\u533F\u540D\u4F7F\u7528\u7EDF\u8BA1\uFF08/telemetry\uFF09",activation:"always"},{package:"@dalcode/dal-rewind",label:"\u68C0\u67E5\u70B9",description:"\u6BCF\u8F6E\u6539\u52A8\u81EA\u52A8\u7559\u68C0\u67E5\u70B9\uFF0C\u53EF\u56DE\u9000\uFF08/rewind\uFF09",activation:"always"},{package:"@dalcode/dal-review",label:"\u4EE3\u7801\u8BC4\u5BA1",description:"\u53EA\u8BFB\u8BC4\u5BA1\u6539\u52A8\uFF0C\u6309\u4E25\u91CD\u7A0B\u5EA6\u5217\u51FA\u95EE\u9898\uFF08/review\uFF09\uFF1B\u53EA\u63D0\u7B80\u5316\u5EFA\u8BAE\u3001\u4E0D\u6539\u4EE3\u7801\uFF08/simplify\uFF09",activation:"always"},{package:"@dalcode/dal-goal",label:"\u76EE\u6807\u6A21\u5F0F",description:"\u8BBE\u5B9A\u4E00\u4E2A\u76EE\u6807\uFF0C\u52A9\u624B\u6301\u7EED\u5DE5\u4F5C\u76F4\u5230\u9A8C\u8BC1\u5B8C\u6210\uFF0C\u6709\u7EED\u8DD1\u6B21\u6570\u548C token \u4E0A\u9650\uFF08/goal\uFF09",activation:"always"},{package:"@dalcode/dal-learn",label:"\u81EA\u6211\u8FDB\u5316",description:"\u4ECE\u8FC7\u5F80\u4F1A\u8BDD\u5B66\u7ECF\u9A8C\u3001\u8BB0\u4F4F\u9879\u76EE\u7684\u547D\u4EE4\u548C\u4F4D\u7F6E\uFF0C\u91CD\u590D\u7684\u6D41\u7A0B\u53EF\u8D77\u8349\u6210\u6280\u80FD\uFF08/lessons\uFF09",activation:"always"},{package:"@dalcode/dal-recall",label:"\u4F1A\u8BDD\u68C0\u7D22",description:"\u5728\u8FC7\u5F80\u4F1A\u8BDD\u91CC\u641C\u7D22\u4E4B\u524D\u505A\u8FC7\u7684\u51B3\u5B9A\u548C\u7EA6\u5B9A\uFF08session_search\uFF09",activation:"always"},{package:"@dalcode/dal-usage",label:"\u7528\u91CF\u7EDF\u8BA1",description:"\u8DE8\u4F1A\u8BDD\u6C47\u603B token \u548C\u8D39\u7528\uFF0C\u6309\u5929\u3001\u6A21\u578B\u3001\u9879\u76EE\u67E5\u770B\uFF08/usage\uFF09\uFF1B\u53EF\u8BBE\u8D39\u7528\u4E0A\u9650\uFF08--max-cost\u3001/budget\uFF09\u548C\u8FD0\u884C\u65F6\u957F\u4E0A\u9650\uFF08--max-time\uFF09",activation:"always"},{package:"@dalcode/dal-awake",label:"\u957F\u4EFB\u52A1\u9632\u4F11\u7720",description:"\u4EFB\u52A1\u8FD0\u884C\u8F83\u4E45\u65F6\u8BA9\u7535\u8111\u4FDD\u6301\u5524\u9192\uFF08\u5C4F\u5E55\u4ECD\u53EF\u7184\u706D\uFF09\uFF0C\u7ED3\u675F\u540E\u6062\u590D\uFF1B\u4E0D\u6253\u6270\uFF08/awake\uFF09",activation:"always"},{package:"@dalcode/dal-remote",label:"\u624B\u673A\u7AEF\u8FDC\u7A0B",description:"\u8BA9 DAL Code \u624B\u673A\u7AEF\u8FDE\u63A5\u8FD9\u53F0\u673A\u5668\uFF1Adal remote enable \u5F00\u542F\uFF0C\u9ED8\u8BA4\u5173\u95ED\uFF08/remote\uFF09",activation:"always"},{package:"@dalcode/dal-statusline",label:"\u81EA\u5B9A\u4E49\u72B6\u6001\u884C",description:"\u5728\u5E95\u90E8\u72B6\u6001\u680F\u52A0\u4E00\u884C\u81EA\u5DF1\u7684\u5185\u5BB9\uFF1A\u6A21\u677F\u6216\u547D\u4EE4\uFF08/statusline\uFF09",activation:"tui"},{package:"@dalcode/dal-advisor",label:"\u7B2C\u4E8C\u610F\u89C1",description:"\u7531\u6A21\u578B\u8C03\u7528\uFF1A\u8BF7\u53E6\u4E00\u4E2A\u5F3A\u6A21\u578B\u590D\u6838\u5F53\u524D\u65B9\u6848\u5E76\u6307\u51FA\u98CE\u9669\uFF0C\u8D39\u7528\u8BA1\u5165\u4F1A\u8BDD\uFF0C\u6BCF\u4F1A\u8BDD\u6709\u6B21\u6570\u4E0A\u9650",activation:"always"},{package:"@dalcode/dal-compat",label:"Claude Code \u517C\u5BB9",description:"\u6CBF\u7528 Claude Code \u7684\u89C4\u5219\uFF1A\u7528\u6237\u548C\u9879\u76EE .claude/rules/ \u4E0E .claude/CLAUDE.md\u3001\u8BF4\u660E\u6587\u4EF6\u91CC\u7684 @\u6587\u4EF6 \u5F15\u7528\u3001\u5B50\u76EE\u5F55\u91CC\u7684 AGENTS.md",activation:"always"},{package:"@dalcode/dal-structured",label:"\u7ED3\u6784\u5316\u8F93\u51FA",description:"dal -p --output-schema \u6309 JSON Schema \u8F93\u51FA\u6700\u7EC8\u56DE\u7B54\uFF0C\u4E0D\u7B26\u5408\u65F6\u975E\u96F6\u9000\u51FA\uFF0C\u7528\u4E8E\u811A\u672C\u548C CI",activation:"always"},{package:"@dalcode/dal-interactive",label:"\u7EC8\u7AEF\u4EA4\u4E92",description:"\u95EE\u5377\u63D0\u95EE\u3001/handoff \u4EA4\u63A5\u5230\u65B0\u4F1A\u8BDD\u3001/btw \u65C1\u8DEF\u63D0\u95EE\u3001!vim \u7B49\u4EA4\u4E92\u5F0F\u547D\u4EE4\uFF08\u7EC8\u7AEF\u754C\u9762\uFF09",activation:"tui"},{package:"@dalcode/dal-terminal",label:"\u7EC8\u7AEF\u4E0A\u4E0B\u6587",description:"\u5BBF\u4E3B\u7A0B\u5E8F\u63D0\u4F9B\u7EC8\u7AEF\u65F6\uFF0C\u52A9\u624B\u53EF\u8BFB\u53D6\u7EC8\u7AEF\u8F93\u51FA\uFF08@terminal\uFF09",activation:"host-capability"},{package:"cc-safety-net",label:"\u5371\u9669\u547D\u4EE4\u62E6\u622A",description:"\u6267\u884C\u524D\u62E6\u4E0B rm -rf\u3001\u5F3A\u5236\u63A8\u9001\u7B49\u7834\u574F\u6027\u547D\u4EE4",activation:"always",safetyCritical:!0},{package:"@dalcode/dal-rtk",label:"\u547D\u4EE4\u8F93\u51FA\u538B\u7F29\uFF08rtk\uFF09",description:"\u68C0\u6D4B\u5230\u4F60\u88C5\u4E86 rtk \u65F6\uFF0C\u52A9\u624B\u8FD0\u884C\u7684\u547D\u4EE4\u8F93\u51FA\u7ECF\u5B83\u538B\u7F29\u3001\u8282\u7701\u4E0A\u4E0B\u6587\uFF1B\u6CA1\u88C5\u5219\u4EC0\u4E48\u90FD\u4E0D\u505A\uFF08/rtk\uFF09",activation:"always"}],f=c.map(e=>e.package),v=new Set(c.filter(e=>e.safetyCritical).map(e=>e.package));function m(e){try{const l=u(import.meta.url)(`${e}/package.json`);return{version:l.version??"",extensions:[...l.pi?.extensions??[]]}}catch{return}}i(m,"installedManifest");function g(e=r()){return c.map(a=>{const l=m(a.package);return{name:a.package,label:d(a.label,e),description:d(a.description,e),enabledByDefault:!0,canDisable:!1,safetyCritical:a.safetyCritical===!0,activation:a.activation,installed:l!==void 0,version:l?.version??"",extensions:l?.extensions??[]}})}i(g,"listBundledExtensions");const o=[{name:"read",label:"\u8BFB\u53D6\u6587\u4EF6",summary:"\u8BFB\u53D6\u6587\u4EF6\u5185\u5BB9\uFF0C\u4E5F\u80FD\u770B\u56FE\u7247",source:"core",readOnly:!0,availability:"default"},{name:"bash",label:"\u8FD0\u884C\u547D\u4EE4",summary:"\u5728\u7EC8\u7AEF\u91CC\u8FD0\u884C\u547D\u4EE4",source:"core",readOnly:!1,availability:"default"},{name:"edit",label:"\u7F16\u8F91\u6587\u4EF6",summary:"\u6309\u539F\u6587\u66FF\u6362\u4FEE\u6539\u6587\u4EF6",source:"core",readOnly:!1,availability:"default"},{name:"write",label:"\u5199\u5165\u6587\u4EF6",summary:"\u65B0\u5EFA\u6216\u8986\u76D6\u6587\u4EF6",source:"core",readOnly:!1,availability:"default"},{name:"grep",label:"\u641C\u7D22\u5185\u5BB9",summary:"\u5728\u6587\u4EF6\u91CC\u641C\u7D22\u6587\u672C",source:"core",readOnly:!0,availability:"opt-in"},{name:"find",label:"\u67E5\u627E\u6587\u4EF6",summary:"\u6309\u540D\u79F0\u67E5\u627E\u6587\u4EF6",source:"core",readOnly:!0,availability:"opt-in"},{name:"ls",label:"\u5217\u51FA\u76EE\u5F55",summary:"\u5217\u51FA\u76EE\u5F55\u5185\u5BB9",source:"core",readOnly:!0,availability:"opt-in"},{name:"powershell",label:"\u8FD0\u884C PowerShell",summary:"\u5728 Windows \u4E0A\u7528 PowerShell \u8FD0\u884C\u547D\u4EE4",source:"core",readOnly:!1,availability:"opt-in"},{name:"process",label:"\u540E\u53F0\u8FDB\u7A0B",summary:"\u5728\u540E\u53F0\u8FD0\u884C\u5F00\u53D1\u670D\u52A1\u5668\u7B49\u957F\u65F6\u95F4\u547D\u4EE4\uFF0C\u968F\u65F6\u67E5\u770B\u8F93\u51FA",source:"core",readOnly:!1,availability:"default"},{name:"plugin_search",label:"\u641C\u7D22\u63D2\u4EF6",summary:"\u641C\u7D22\u53EF\u5B89\u88C5\u7684\u63D2\u4EF6",source:"@dalcode/dal-plugins",readOnly:!0,availability:"default"},{name:"lsp",label:"\u8BED\u8A00\u670D\u52A1\u5668",summary:"\u67E5\u7C7B\u578B\u9519\u8BEF\u3001\u7B26\u53F7\u3001\u5B9A\u4E49\u4E0E\u5F15\u7528",source:"@dalcode/dal-lsp",readOnly:!0,availability:"on-demand"},{name:"debug",label:"\u8C03\u8BD5\u5668",summary:"\u8BBE\u65AD\u70B9\u3001\u5355\u6B65\u8FD0\u884C\u7A0B\u5E8F\u5E76\u67E5\u770B\u53D8\u91CF",source:"@dalcode/dal-dap",readOnly:!1,availability:"on-demand"},{name:"task",label:"\u5B50\u52A9\u624B",summary:"\u6D3E\u51FA\u5B50\u52A9\u624B\u5904\u7406\u4E00\u9879\u5B50\u4EFB\u52A1",source:"@dalcode/dal-subagent",readOnly:!1,availability:"default"},{name:"mcp",label:"MCP \u5DE5\u5177",summary:"\u8C03\u7528\u5DF2\u8FDE\u63A5 MCP \u670D\u52A1\u5668\u7684\u5DE5\u5177",source:"@dalcode/dal-mcp",readOnly:!1,availability:"mcp"},{name:"skill",label:"\u6280\u80FD",summary:"\u641C\u7D22\u5E76\u52A0\u8F7D\u4E13\u9879\u4EFB\u52A1\u6307\u5F15",source:"@dalcode/dal-skills",readOnly:!0,availability:"default"},{name:"office_ppt_plan",label:"\u89C4\u5212 PPT",summary:"\u5148\u5217\u51FA PPT \u7684\u9875\u9762\u5927\u7EB2",source:"@dalcode/dal-office",readOnly:!0,availability:"on-demand"},{name:"office_ppt_generate",label:"\u751F\u6210 PPT",summary:"\u751F\u6210 PowerPoint \u6F14\u793A\u6587\u7A3F",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_doc_generate",label:"\u751F\u6210 Word",summary:"\u751F\u6210 Word \u6587\u6863",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_md_generate",label:"\u751F\u6210 Markdown",summary:"\u751F\u6210 Markdown \u6587\u6863",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_sheet_generate",label:"\u751F\u6210\u8868\u683C",summary:"\u751F\u6210 Excel \u8868\u683C",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_chart_generate",label:"\u751F\u6210\u56FE\u8868",summary:"\u751F\u6210 ECharts \u56FE\u8868",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_drawio_generate",label:"\u751F\u6210\u6D41\u7A0B\u56FE",summary:"\u751F\u6210 draw.io \u56FE",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_read_file",label:"\u8BFB\u53D6\u6587\u6863",summary:"\u8BFB\u53D6 Word\u3001PPT\u3001Excel\u3001PDF\u3001CSV",source:"@dalcode/dal-office",readOnly:!0,availability:"on-demand"},{name:"office_docx_edit",label:"\u4FEE\u6539 Word",summary:"\u6309\u4F4D\u7F6E\u4FEE\u6539\u5DF2\u6709\u7684 Word \u6587\u6863",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_pptx_edit",label:"\u4FEE\u6539 PPT",summary:"\u6309\u4F4D\u7F6E\u4FEE\u6539\u5DF2\u6709\u7684 PPT",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"office_xlsx_edit",label:"\u4FEE\u6539\u8868\u683C",summary:"\u6309\u4F4D\u7F6E\u4FEE\u6539\u5DF2\u6709\u7684 Excel",source:"@dalcode/dal-office",readOnly:!1,availability:"on-demand"},{name:"web_search",label:"\u7F51\u9875\u641C\u7D22",summary:"\u8054\u7F51\u641C\u7D22\u6700\u65B0\u4FE1\u606F",source:"@dalcode/dal-web",readOnly:!0,availability:"on-demand"},{name:"web_fetch",label:"\u8BFB\u53D6\u7F51\u9875",summary:"\u8BFB\u53D6\u7F51\u9875\u6216 PDF \u94FE\u63A5\u7684\u6B63\u6587",source:"@dalcode/dal-web",readOnly:!0,availability:"on-demand"},{name:"todo",label:"\u5F85\u529E\u6E05\u5355",summary:"\u7EF4\u62A4\u672C\u6B21\u4EFB\u52A1\u7684\u5F85\u529E\u6E05\u5355",source:"@dalcode/dal-workflow",readOnly:!0,availability:"default"},{name:"tool_catalog",label:"\u5DE5\u5177\u76EE\u5F55",summary:"\u67E5\u770B\u5E76\u542F\u7528\u6309\u9700\u52A0\u8F7D\u7684\u5DE5\u5177\u5206\u7EC4",source:"@dalcode/dal-tool-catalog",readOnly:!0,availability:"default"},{name:"submit_plan",label:"\u63D0\u4EA4\u8BA1\u5212",summary:"\u628A\u8BA1\u5212\u4EA4\u7ED9\u4F60\u5BA1\u6279",source:"@dalcode/dal-bridge",readOnly:!0,availability:"dal-code"},{name:"ask_user",label:"\u8BE2\u95EE\u4F60",summary:"\u5F00\u5DE5\u524D\u7528\u5361\u7247\u786E\u8BA4\u5173\u952E\u51B3\u5B9A",source:"@dalcode/dal-bridge",readOnly:!0,availability:"dal-code"},{name:"review_report",label:"\u63D0\u4EA4\u8BC4\u5BA1\u7ED3\u679C",summary:"\u8BC4\u5BA1\u52A9\u624B\u63D0\u4EA4\u53D1\u73B0\u7684\u95EE\u9898",source:"@dalcode/dal-review",readOnly:!0,availability:"reviewer"},{name:"goal_complete",label:"\u5B8C\u6210\u76EE\u6807",summary:"\u76EE\u6807\u7ECF\u9A8C\u8BC1\u5168\u90E8\u5B8C\u6210\u65F6\u7ED3\u675F\u76EE\u6807",source:"@dalcode/dal-goal",readOnly:!0,availability:"opt-in"},{name:"goal_blocked",label:"\u76EE\u6807\u53D7\u963B",summary:"\u76EE\u6807\u786E\u5B9E\u65E0\u6CD5\u7EE7\u7EED\u3001\u9700\u8981\u4F60\u5904\u7406\u65F6\u505C\u4E0B",source:"@dalcode/dal-goal",readOnly:!0,availability:"opt-in"},{name:"goal_wait",label:"\u76EE\u6807\u7B49\u5F85",summary:"\u76EE\u6807\u7B49\u5F85\u5916\u90E8\u4E8B\u4EF6\u65F6\u6682\u505C\u81EA\u52A8\u7EED\u8DD1",source:"@dalcode/dal-goal",readOnly:!0,availability:"opt-in"},{name:"session_search",label:"\u641C\u7D22\u8FC7\u5F80\u4F1A\u8BDD",summary:"\u641C\u7D22\u8FC7\u5F80\u4F1A\u8BDD\u91CC\u7684\u51B3\u5B9A\u548C\u7EA6\u5B9A",source:"@dalcode/dal-recall",readOnly:!0,availability:"default"},{name:"advisor",label:"\u7B2C\u4E8C\u610F\u89C1",summary:"\u8BF7\u53E6\u4E00\u4E2A\u5F3A\u6A21\u578B\u590D\u6838\u5F53\u524D\u65B9\u6848\u5E76\u6307\u51FA\u98CE\u9669",source:"@dalcode/dal-advisor",readOnly:!0,availability:"default"},{name:"structured_output",label:"\u7ED3\u6784\u5316\u8F93\u51FA",summary:"\u6309 --output-schema \u7ED9\u51FA JSON \u683C\u5F0F\u7684\u6700\u7EC8\u56DE\u7B54",source:"@dalcode/dal-structured",readOnly:!0,availability:"opt-in"},{name:"questionnaire",label:"\u95EE\u5377",summary:"\u7528\u9009\u62E9\u9898\u5411\u4F60\u786E\u8BA4\u9700\u6C42\u6216\u504F\u597D",source:"@dalcode/dal-interactive",readOnly:!0,availability:"tui"},{name:"terminal_read",label:"\u8BFB\u53D6\u7EC8\u7AEF",summary:"\u8BFB\u53D6\u7EC8\u7AEF\u6700\u8FD1\u7684\u8F93\u51FA",source:"@dalcode/dal-terminal",readOnly:!0,availability:"host"}],w=(()=>{const e={};for(const a of o){if(a.source==="core")continue;const l=e[a.source]??[];l.push(a.name),e[a.source]=l}return{builtin:o.filter(a=>a.source==="core").map(a=>a.name),extensions:e}})();function k(e=r()){return o.map(a=>({name:a.name,label:d(a.label,e),summary:d(a.summary,e),source:a.source,readOnly:a.readOnly,availability:a.availability}))}i(k,"listToolCatalog");function O(e,a=r()){const l=o.find(n=>n.name===e);if(l)return d(l.label,a);const t=e.match(/^mcp__(.+?)__(.+)$/);return t?`${t[1]} \xB7 ${t[2]}`:e}i(O,"toolDisplayLabel");export{f as BUNDLED_EXTENSION_PACKAGES,w as DAL_TOOL_NAMES,v as SAFETY_CRITICAL_PACKAGES,g as listBundledExtensions,k as listToolCatalog,O as toolDisplayLabel};
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { type BackgroundProcessEvent, type BackgroundProcessInfo, BackgroundProc
|
|
|
6
6
|
export type { CacheWarmingDecision, CacheWarmingStatus } from "./core/cache-warmer.ts";
|
|
7
7
|
export { type BranchPreparation, type BranchSummaryResult, type CollectEntriesResult, type CompactionResult, type CutPointResult, calculateContextTokens, collectEntriesForBranchSummary, compact, DEFAULT_COMPACTION_SETTINGS, estimateTokens, type FileOperations, findCutPoint, findTurnStartIndex, type GenerateBranchSummaryOptions, generateBranchSummary, generateSummary, generateSummaryWithUsage, getLastAssistantUsage, prepareBranchEntries, serializeConversation, shouldCompact, } from "./core/compaction/index.ts";
|
|
8
8
|
export { createEventBus, type EventBus, type EventBusController } from "./core/event-bus.ts";
|
|
9
|
-
export type { AfterProviderResponseEvent, AgentActivityOutcome, AgentBeforeSettleEvent, AgentBeforeSettleEventResult, AgentEndEvent, AgentSettledEvent, AgentStartEvent, AgentToolResult, AgentToolUpdateCallback, AppKeybinding, AutocompleteProviderFactory, BashToolCallEvent, BeforeAgentStartCustomEvent, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeAgentStartUserEvent, BeforeProviderHeadersEvent, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, BoundaryContextPreview, BoundaryResult, BoundaryState, BuildSystemPromptOptions, CacheWarmingDecisionEvent, CacheWarmingDecisionEventResult, CompactionEntryDraft, CompactOptions, ContextEditEntryDraft, ContextEvent, ContextEventResult, ContextUsage, ContextWithSystemEvent, CustomEntryDraft, CustomMessageEntryDraft, CustomToolCallEvent, EditToolCallEvent, EntryRenderer, EntryRenderOptions, ExecOptions, ExecResult, ExecuteToolOptions, Extension, ExtensionActions, ExtensionAPI, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFactory, ExtensionFlag, ExtensionHandler, ExtensionRuntime, ExtensionShortcut, ExtensionToolContext, ExtensionUIContext, ExtensionUIDialogOptions, ExtensionVirtualModel, ExtensionWidgetOptions, FindToolCallEvent, GrepToolCallEvent, InlineExtension, InputEvent, InputEventResult, InputSource, KeybindingsManager, LoadExtensionsResult, LsToolCallEvent, MarkdownTransformContext, MarkdownTransformer, McpServersChangeEvent, MessageEndEvent, MessageEndEventResult, MessageRenderer, MessageRenderOptions, MessageStartEvent, MessageUpdateEvent, ModelPickerEntry, ModelPickerEntryState, ModelSelectEvent, ModelSelectSource, NormalizedBuildSystemPromptOptions, PowerShellToolCallEvent, ProjectTrustContext, ProjectTrustEvent, ProjectTrustEventDecision, ProjectTrustEventResult, ProjectTrustHandler, ProviderChatModelConfig, ProviderConfig, ProviderModelConfig, ProviderStreamEvent, ReadToolCallEvent, RegisteredCommand, RegisteredModelPickerEntry, RegisteredTool, ResolvedCommand, ResourcesDiscoverEvent, ResourcesDiscoverResult, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeForkEvent, SessionBeforeForkResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionBeforeTreeEvent, SessionBeforeTreeResult, SessionBoundaryDraft, SessionCompactEvent, SessionCompactFailedEvent, SessionInfoChangedEvent, SessionShutdownEvent, SessionStartEvent, SessionTreeEvent, SlashCommandInfo, SlashCommandSource, SourceInfo, TerminalInputHandler, ThinkingLevelSelectEvent, ToolAnnotations, ToolCallEvent, ToolCallEventResult, ToolDefinition, ToolExecutionEndEvent, ToolExecutionMode, ToolExecutionStartEvent, ToolExecutionUpdateEvent, ToolExposure, ToolInfo, ToolLoadout, ToolLoadoutChanges, ToolNamespace, ToolRendererResolver, ToolRenderers, ToolRenderResultOptions, ToolResultEvent, ToolResultEventResult, TurnEndEvent, TurnEndEventResult, TurnStartEvent, UIPromptEndEvent, UIPromptKind, UIPromptStartEvent, UserBashEvent, UserBashEventResult, WidgetPlacement, WorkingIndicatorOptions, WriteToolCallEvent, } from "./core/extensions/index.ts";
|
|
9
|
+
export type { AfterProviderResponseEvent, AgentActivityOutcome, AgentBeforeSettleEvent, AgentBeforeSettleEventResult, AgentEndEvent, AgentSettledEvent, AgentStartEvent, AgentToolResult, AgentToolUpdateCallback, AppKeybinding, ApprovalOptionKind, ApprovalPrompt, ApprovalSource, AutocompleteProviderFactory, BashToolCallEvent, BeforeAgentStartCustomEvent, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeAgentStartUserEvent, BeforeProviderHeadersEvent, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, BoundaryContextPreview, BoundaryResult, BoundaryState, BuildSystemPromptOptions, CacheWarmingDecisionEvent, CacheWarmingDecisionEventResult, CompactionEntryDraft, CompactOptions, ContextEditEntryDraft, ContextEvent, ContextEventResult, ContextUsage, ContextWithSystemEvent, CustomEntryDraft, CustomMessageEntryDraft, CustomToolCallEvent, EditToolCallEvent, EntryRenderer, EntryRenderOptions, ExecOptions, ExecResult, ExecuteToolOptions, Extension, ExtensionActions, ExtensionAPI, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFactory, ExtensionFlag, ExtensionHandler, ExtensionRuntime, ExtensionShortcut, ExtensionToolContext, ExtensionUIContext, ExtensionUIDialogOptions, ExtensionVirtualModel, ExtensionWidgetOptions, FindToolCallEvent, GrepToolCallEvent, InlineExtension, InputEvent, InputEventResult, InputSource, KeybindingsManager, LoadExtensionsResult, LsToolCallEvent, MarkdownTransformContext, MarkdownTransformer, McpServersChangeEvent, MessageEndEvent, MessageEndEventResult, MessageRenderer, MessageRenderOptions, MessageStartEvent, MessageUpdateEvent, ModelPickerEntry, ModelPickerEntryState, ModelSelectEvent, ModelSelectSource, NormalizedBuildSystemPromptOptions, PowerShellToolCallEvent, ProjectTrustContext, ProjectTrustEvent, ProjectTrustEventDecision, ProjectTrustEventResult, ProjectTrustHandler, ProviderChatModelConfig, ProviderConfig, ProviderModelConfig, ProviderStreamEvent, ReadToolCallEvent, RegisteredCommand, RegisteredModelPickerEntry, RegisteredTool, ResolvedCommand, ResourcesDiscoverEvent, ResourcesDiscoverResult, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeForkEvent, SessionBeforeForkResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionBeforeTreeEvent, SessionBeforeTreeResult, SessionBoundaryDraft, SessionCompactEvent, SessionCompactFailedEvent, SessionInfoChangedEvent, SessionShutdownEvent, SessionStartEvent, SessionTreeEvent, SlashCommandInfo, SlashCommandSource, SourceInfo, TerminalInputHandler, ThinkingLevelSelectEvent, ToolAnnotations, ToolCallEvent, ToolCallEventResult, ToolDefinition, ToolExecutionEndEvent, ToolExecutionMode, ToolExecutionStartEvent, ToolExecutionUpdateEvent, ToolExposure, ToolInfo, ToolLoadout, ToolLoadoutChanges, ToolNamespace, ToolRendererResolver, ToolRenderers, ToolRenderResultOptions, ToolResultEvent, ToolResultEventResult, TurnEndEvent, TurnEndEventResult, TurnStartEvent, UIPromptEndEvent, UIPromptKind, UIPromptStartEvent, UserBashEvent, UserBashEventResult, WidgetPlacement, WorkingIndicatorOptions, WriteToolCallEvent, } from "./core/extensions/index.ts";
|
|
10
10
|
export { createExtensionRuntime, defineTool, discoverAndLoadExtensions, ExtensionRunner, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isPowerShellToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, wrapRegisteredTool, wrapRegisteredTools, } from "./core/extensions/index.ts";
|
|
11
11
|
export type { ReadonlyFooterDataProvider } from "./core/footer-data-provider.ts";
|
|
12
12
|
export { getHostCapabilities, HOST_CAPABILITIES_ENV, HOST_TOKEN_ENV, HOST_TOKEN_HEADER, HOST_URL_ENV, HostCallError, type HostCallErrorCode, type HostCallOptions, type HostCallRequest, HostCapabilities, type HostCapabilitiesListener, type HostCapability, type HostCapabilitySource, type HostTransport, parseHostCapabilities, } from "./core/host-capabilities.ts";
|
|
@@ -29,8 +29,9 @@ export { type BranchSummaryEntry, buildContextEntries, buildSessionContext, buil
|
|
|
29
29
|
export { type CacheWarmingMode, type CompactionModelOverride, type CompactionSettings, type DefaultProjectTrust, type FullscreenExitOutput, type ImageSettings, type PackageSource, type QuietStartup, type RetrySettings, SettingsManager, type SettingsManagerCreateOptions, type TuiMode, } from "./core/settings-manager.ts";
|
|
30
30
|
export { formatSkillsForPrompt, type LoadSkillsFromDirOptions, type LoadSkillsResult, loadSkills, loadSkillsFromDir, type Skill, type SkillFrontmatter, } from "./core/skills.ts";
|
|
31
31
|
export { createSyntheticSourceInfo } from "./core/source-info.ts";
|
|
32
|
+
export { getToolDenial, type ToolDenial, type ToolDenialHint, type ToolDenialSource, } from "./core/tool-denial.ts";
|
|
32
33
|
export { type EditDiffResult, generateDiffString, generateUnifiedPatch, normalizeForFuzzyMatch, } from "./core/tools/edit-diff.ts";
|
|
33
|
-
export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLocalPowerShellOperations, createLsToolDefinition, createPowerShellToolDefinition, createProcessToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, formatSize, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, type PowerShellOperations, type PowerShellSpawnContext, type PowerShellSpawnHook, type PowerShellToolDetails, type PowerShellToolInput, type PowerShellToolOptions, type ProcessToolDetails, type ProcessToolInput, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, registerShellExecutionGuard, type ShellExecutionGuard, type ShellExecutionRequest, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteOperations, type WriteToolInput, type WriteToolOptions, withFileMutationQueue, } from "./core/tools/index.ts";
|
|
34
|
+
export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLocalPowerShellOperations, createLsToolDefinition, createPowerShellToolDefinition, createProcessToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, formatSize, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, type PowerShellOperations, type PowerShellSpawnContext, type PowerShellSpawnHook, type PowerShellToolDetails, type PowerShellToolInput, type PowerShellToolOptions, type ProcessToolDetails, type ProcessToolInput, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, registerShellExecutionGuard, type ShellExecutionGuard, type ShellExecutionRequest, shellExecutionRefusal, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteOperations, type WriteToolInput, type WriteToolOptions, withFileMutationQueue, } from "./core/tools/index.ts";
|
|
34
35
|
export { resolveToCwd } from "./core/tools/path-utils.ts";
|
|
35
36
|
export { hasTrustRequiringProjectResources, type ProjectTrustDecision, ProjectTrustStore, type ProjectTrustStoreEntry, type ProjectTrustUpdate, } from "./core/trust-manager.ts";
|
|
36
37
|
export { type ModelRoute, type ModelRouteReason, type ModelRouteRequest, VIRTUAL_MODEL_STATE_ENTRY, type VirtualModelDefinition, type VirtualModelStateData, } from "./core/virtual-models.ts";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseArgs as t}from"./cli/args.js";import{CONFIG_DIR_NAME as n,getAgentDir as a,getDocsPath as i,getExamplesPath as s,getPackageDir as l,getReadmePath as m,SHARED_SKILL_CONFIG_DIRS as c,VERSION as p}from"./config.js";import{AgentSession as d,parseSkillBlock as T}from"./core/agent-session.js";import{readStoredCredential as f}from"./core/auth-storage.js";import{BackgroundProcessManager as x,MAX_BACKGROUND_PROCESSES as C}from"./core/background-processes.js";import{calculateContextTokens as h,collectEntriesForBranchSummary as P,compact as A,DEFAULT_COMPACTION_SETTINGS as R,estimateTokens as D,findCutPoint as M,findTurnStartIndex as L,generateBranchSummary as _,generateSummary as k,generateSummaryWithUsage as y,getLastAssistantUsage as I,prepareBranchEntries as F,serializeConversation as O,shouldCompact as N}from"./core/compaction/index.js";import{createEventBus as H}from"./core/event-bus.js";import{createExtensionRuntime as b,defineTool as w,discoverAndLoadExtensions as U,ExtensionRunner as j,isBashToolResult as G,isEditToolResult as K,isFindToolResult as V,isGrepToolResult as W,isLsToolResult as z,isPowerShellToolResult as X,isReadToolResult as Y,isToolCallEventType as q,isWriteToolResult as Q,wrapRegisteredTool as J,wrapRegisteredTools as Z}from"./core/extensions/index.js";import{getHostCapabilities as ee,HOST_CAPABILITIES_ENV as oe,HOST_TOKEN_ENV as te,HOST_TOKEN_HEADER as re,HOST_URL_ENV as ne,HostCallError as ae,HostCapabilities as ie,parseHostCapabilities as se}from"./core/host-capabilities.js";import{convertToLlm as me}from"./core/messages.js";import{ModelRegistry as pe}from"./core/model-registry.js";import{resolveCliModel as de,resolveModelScopeWithDiagnostics as Te}from"./core/model-resolver.js";import{CredentialSynchronizationError as fe,ModelRuntime as Ee}from"./core/model-runtime.js";import{DefaultPackageManager as Ce}from"./core/package-manager.js";import{buildRuleSet as he,matchPermissionRules as Pe,parsePermissionRule as Ae}from"./core/permissions/rules.js";import{evaluateToolPolicy as De,readAccessDenial as Me,registerPermissionAskHandler as Le}from"./core/permissions/tool-policy.js";import{describeProjectFacts as ke,detectProjectFacts as ye,projectPackageManager as Ie}from"./core/project-facts.js";import{buildProjectMap as Oe,formatProjectMapPrompt as Ne}from"./core/project-map.js";import{DefaultResourceLoader as He,loadProjectContextFiles as Be}from"./core/resource-loader.js";import{detectSandboxAvailability as we,getProcessShellSandbox as Ue,registerSandboxEscalationHandler as je,resolveSandboxPolicy as Ge,SANDBOX_ENV as Ke,ShellSandbox as Ve}from"./core/sandbox/index.js";import{AgentSessionRuntime as ze,createAgentSession as Xe,createAgentSessionFromServices as Ye,createAgentSessionRuntime as qe,createAgentSessionServices as Qe,createBashTool as Je,createCodingTools as Ze,createEditTool as $e,createFindTool as eo,createGrepTool as oo,createLsTool as to,createPowerShellTool as ro,createReadOnlyTools as no,createReadTool as ao,createWriteTool as io}from"./core/sdk.js";import{buildContextEntries as lo,buildSessionContext as mo,buildSessionProjection as co,CURRENT_SESSION_VERSION as po,getLatestCompactionEntry as So,migrateSessionEntries as To,parseSessionEntries as go,SessionManager as fo,sessionEntryToContextMessages as Eo}from"./core/session-manager.js";import{SettingsManager as Co}from"./core/settings-manager.js";import{formatSkillsForPrompt as ho,loadSkills as Po,loadSkillsFromDir as Ao}from"./core/skills.js";import{createSyntheticSourceInfo as Do}from"./core/source-info.js";import{generateDiffString as Lo,generateUnifiedPatch as _o,normalizeForFuzzyMatch as ko}from"./core/tools/edit-diff.js";import{createBashToolDefinition as Io,createEditToolDefinition as Fo,createFindToolDefinition as Oo,createGrepToolDefinition as No,createLocalBashOperations as vo,createLocalPowerShellOperations as Ho,createLsToolDefinition as Bo,createPowerShellToolDefinition as bo,createProcessToolDefinition as wo,createReadToolDefinition as Uo,createWriteToolDefinition as jo,DEFAULT_MAX_BYTES as Go,DEFAULT_MAX_LINES as Ko,formatSize as Vo,registerShellExecutionGuard as Wo,truncateHead as zo,truncateLine as Xo,truncateTail as Yo,withFileMutationQueue as qo}from"./core/tools/index.js";import{resolveToCwd as Jo}from"./core/tools/path-utils.js";import{hasTrustRequiringProjectResources as $o,ProjectTrustStore as et}from"./core/trust-manager.js";import{VIRTUAL_MODEL_STATE_ENTRY as tt}from"./core/virtual-models.js";import{claimWorkspace as nt,gitDirOf as at,readWorkspaceLock as it,releaseWorkspace as st,STALE_AFTER_MS as lt,shellCommandDirectory as mt,WORKSPACE_LOCK_FILE as ct,workspaceLockIsLive as pt,workspaceOwnerSessionId as St}from"./core/workspace-lock.js";import{applyShellEnvironmentPolicy as Tt,DEFAULT_SHELL_ENV_EXCLUDES as gt,isDalCodeCredentialName as ft,withoutDalCodeCredentials as Et}from"./dal/child-env.js";import{ADAPTATION_FILE as Ct,adaptationState as ut,adaptPackage as ht,applyCommunityEnv as Pt,communityEnv as At,ensurePackageAdapted as Rt,isAdaptablePackage as Dt,readAdaptation as Mt,scanHardcodedPiPaths as Lt,tryEnsurePackageAdapted as _t,verifyAdaptation as kt}from"./dal/extension-compat.js";export*from"./dal/hooks/index.js";import{isHostExtensionPath as Ft,markHostExtensionPaths as Ot}from"./dal/host-extensions.js";import{ENGINE_MARKET_CACHE_FILE as vt,fetchSignedMarket as Ht,MARKET_SECTIONS as Bt,marketCacheDir as bt,readSignedSection as wt,resolveMarketEndpoint as Ut,verifySignedSection as jt}from"./dal/reviewed/market.js";import{createCodemodeExtension as Kt}from"./extensions/codemode/index.js";import{createMcpExtension as Wt}from"./extensions/mcp/index.js";import{loadMcpRuntime as Xt}from"./extensions/mcp/runtime.lazy.js";import{createToolSearchExtension as qt}from"./extensions/tool-search/index.js";import{main as Jt}from"./main.js";import{InteractiveMode as $t,RpcClient as er,runPrintMode as or,runRpcMode as tr}from"./modes/index.js";import{ArminComponent as nr,AssistantMessageComponent as ar,BashExecutionComponent as ir,BorderedLoader as sr,BranchSummaryMessageComponent as lr,CompactionSummaryMessageComponent as mr,CustomEditor as cr,CustomMessageComponent as pr,DynamicBorder as Sr,ExtensionEditorComponent as dr,ExtensionInputComponent as Tr,ExtensionSelectorComponent as gr,FooterComponent as fr,keyHint as Er,keyText as xr,LoginDialogComponent as Cr,ModelSelectorComponent as ur,OAuthSelectorComponent as hr,rawKeyHint as Pr,renderDiff as Ar,SessionSelectorComponent as Rr,SettingsSelectorComponent as Dr,ShowImagesSelectorComponent as Mr,SkillInvocationMessageComponent as Lr,ThemeSelectorComponent as _r,ThinkingSelectorComponent as kr,ToolExecutionComponent as yr,TreeSelectorComponent as Ir,truncateToVisualLines as Fr,UserMessageComponent as Or,UserMessageSelectorComponent as Nr}from"./modes/interactive/components/index.js";import{getLanguageFromPath as Hr,getMarkdownTheme as Br,getSelectListTheme as br,getSettingsListTheme as wr,highlightCode as Ur,initTheme as jr,Theme as Gr}from"./modes/interactive/theme/theme.js";import{copyToClipboard as Vr}from"./utils/clipboard.js";import{parseFrontmatter as zr,stripFrontmatter as Xr}from"./utils/frontmatter.js";import{convertToPng as qr}from"./utils/image-convert.js";import{formatDimensionNote as Jr,resizeImage as Zr}from"./utils/image-resize.js";import{detectSupportedImageMimeTypeFromFile as en}from"./utils/mime.js";import{openBrowser as tn}from"./utils/open-browser.js";import{getPowerShellConfig as nn,getShellConfig as an,getShellEnv as sn}from"./utils/shell.js";export{Ct as ADAPTATION_FILE,d as AgentSession,ze as AgentSessionRuntime,nr as ArminComponent,ar as AssistantMessageComponent,x as BackgroundProcessManager,ir as BashExecutionComponent,sr as BorderedLoader,lr as BranchSummaryMessageComponent,n as CONFIG_DIR_NAME,po as CURRENT_SESSION_VERSION,mr as CompactionSummaryMessageComponent,fe as CredentialSynchronizationError,cr as CustomEditor,pr as CustomMessageComponent,R as DEFAULT_COMPACTION_SETTINGS,Go as DEFAULT_MAX_BYTES,Ko as DEFAULT_MAX_LINES,gt as DEFAULT_SHELL_ENV_EXCLUDES,Ce as DefaultPackageManager,He as DefaultResourceLoader,Sr as DynamicBorder,vt as ENGINE_MARKET_CACHE_FILE,dr as ExtensionEditorComponent,Tr as ExtensionInputComponent,j as ExtensionRunner,gr as ExtensionSelectorComponent,fr as FooterComponent,oe as HOST_CAPABILITIES_ENV,te as HOST_TOKEN_ENV,re as HOST_TOKEN_HEADER,ne as HOST_URL_ENV,ae as HostCallError,ie as HostCapabilities,$t as InteractiveMode,Cr as LoginDialogComponent,Bt as MARKET_SECTIONS,C as MAX_BACKGROUND_PROCESSES,pe as ModelRegistry,Ee as ModelRuntime,ur as ModelSelectorComponent,hr as OAuthSelectorComponent,et as ProjectTrustStore,er as RpcClient,Ke as SANDBOX_ENV,c as SHARED_SKILL_CONFIG_DIRS,lt as STALE_AFTER_MS,fo as SessionManager,Rr as SessionSelectorComponent,Co as SettingsManager,Dr as SettingsSelectorComponent,Ve as ShellSandbox,Mr as ShowImagesSelectorComponent,Lr as SkillInvocationMessageComponent,Gr as Theme,_r as ThemeSelectorComponent,kr as ThinkingSelectorComponent,yr as ToolExecutionComponent,Ir as TreeSelectorComponent,Or as UserMessageComponent,Nr as UserMessageSelectorComponent,p as VERSION,tt as VIRTUAL_MODEL_STATE_ENTRY,ct as WORKSPACE_LOCK_FILE,ht as adaptPackage,ut as adaptationState,Pt as applyCommunityEnv,Tt as applyShellEnvironmentPolicy,lo as buildContextEntries,Oe as buildProjectMap,he as buildRuleSet,mo as buildSessionContext,co as buildSessionProjection,h as calculateContextTokens,nt as claimWorkspace,P as collectEntriesForBranchSummary,At as communityEnv,A as compact,me as convertToLlm,qr as convertToPng,Vr as copyToClipboard,Xe as createAgentSession,Ye as createAgentSessionFromServices,qe as createAgentSessionRuntime,Qe as createAgentSessionServices,Je as createBashTool,Io as createBashToolDefinition,Kt as createCodemodeExtension,Ze as createCodingTools,$e as createEditTool,Fo as createEditToolDefinition,H as createEventBus,b as createExtensionRuntime,eo as createFindTool,Oo as createFindToolDefinition,oo as createGrepTool,No as createGrepToolDefinition,vo as createLocalBashOperations,Ho as createLocalPowerShellOperations,to as createLsTool,Bo as createLsToolDefinition,Wt as createMcpExtension,ro as createPowerShellTool,bo as createPowerShellToolDefinition,wo as createProcessToolDefinition,no as createReadOnlyTools,ao as createReadTool,Uo as createReadToolDefinition,Do as createSyntheticSourceInfo,qt as createToolSearchExtension,io as createWriteTool,jo as createWriteToolDefinition,w as defineTool,ke as describeProjectFacts,ye as detectProjectFacts,we as detectSandboxAvailability,en as detectSupportedImageMimeTypeFromFile,U as discoverAndLoadExtensions,Rt as ensurePackageAdapted,D as estimateTokens,De as evaluateToolPolicy,Ht as fetchSignedMarket,M as findCutPoint,L as findTurnStartIndex,Jr as formatDimensionNote,Ne as formatProjectMapPrompt,Vo as formatSize,ho as formatSkillsForPrompt,_ as generateBranchSummary,Lo as generateDiffString,k as generateSummary,y as generateSummaryWithUsage,_o as generateUnifiedPatch,a as getAgentDir,i as getDocsPath,s as getExamplesPath,ee as getHostCapabilities,Hr as getLanguageFromPath,I as getLastAssistantUsage,So as getLatestCompactionEntry,Br as getMarkdownTheme,l as getPackageDir,nn as getPowerShellConfig,Ue as getProcessShellSandbox,m as getReadmePath,br as getSelectListTheme,wr as getSettingsListTheme,an as getShellConfig,sn as getShellEnv,at as gitDirOf,$o as hasTrustRequiringProjectResources,Ur as highlightCode,jr as initTheme,Dt as isAdaptablePackage,G as isBashToolResult,ft as isDalCodeCredentialName,K as isEditToolResult,V as isFindToolResult,W as isGrepToolResult,Ft as isHostExtensionPath,z as isLsToolResult,X as isPowerShellToolResult,Y as isReadToolResult,q as isToolCallEventType,Q as isWriteToolResult,Er as keyHint,xr as keyText,Xt as loadMcpRuntime,Be as loadProjectContextFiles,Po as loadSkills,Ao as loadSkillsFromDir,Jt as main,Ot as markHostExtensionPaths,bt as marketCacheDir,Pe as matchPermissionRules,To as migrateSessionEntries,ko as normalizeForFuzzyMatch,tn as openBrowser,t as parseArgs,zr as parseFrontmatter,se as parseHostCapabilities,Ae as parsePermissionRule,go as parseSessionEntries,T as parseSkillBlock,F as prepareBranchEntries,Ie as projectPackageManager,Pr as rawKeyHint,Me as readAccessDenial,Mt as readAdaptation,wt as readSignedSection,f as readStoredCredential,it as readWorkspaceLock,Le as registerPermissionAskHandler,je as registerSandboxEscalationHandler,Wo as registerShellExecutionGuard,st as releaseWorkspace,Ar as renderDiff,Zr as resizeImage,de as resolveCliModel,Ut as resolveMarketEndpoint,Te as resolveModelScopeWithDiagnostics,Ge as resolveSandboxPolicy,Jo as resolveToCwd,or as runPrintMode,tr as runRpcMode,Lt as scanHardcodedPiPaths,O as serializeConversation,Eo as sessionEntryToContextMessages,mt as shellCommandDirectory,N as shouldCompact,Xr as stripFrontmatter,zo as truncateHead,Xo as truncateLine,Yo as truncateTail,Fr as truncateToVisualLines,_t as tryEnsurePackageAdapted,kt as verifyAdaptation,jt as verifySignedSection,qo as withFileMutationQueue,Et as withoutDalCodeCredentials,pt as workspaceLockIsLive,St as workspaceOwnerSessionId,J as wrapRegisteredTool,Z as wrapRegisteredTools};
|
|
1
|
+
import{parseArgs as t}from"./cli/args.js";import{CONFIG_DIR_NAME as n,getAgentDir as a,getDocsPath as i,getExamplesPath as s,getPackageDir as l,getReadmePath as m,SHARED_SKILL_CONFIG_DIRS as c,VERSION as p}from"./config.js";import{AgentSession as d,parseSkillBlock as T}from"./core/agent-session.js";import{readStoredCredential as f}from"./core/auth-storage.js";import{BackgroundProcessManager as x,MAX_BACKGROUND_PROCESSES as C}from"./core/background-processes.js";import{calculateContextTokens as h,collectEntriesForBranchSummary as P,compact as R,DEFAULT_COMPACTION_SETTINGS as A,estimateTokens as D,findCutPoint as M,findTurnStartIndex as L,generateBranchSummary as _,generateSummary as k,generateSummaryWithUsage as y,getLastAssistantUsage as I,prepareBranchEntries as F,serializeConversation as O,shouldCompact as N}from"./core/compaction/index.js";import{createEventBus as H}from"./core/event-bus.js";import{createExtensionRuntime as b,defineTool as w,discoverAndLoadExtensions as U,ExtensionRunner as j,isBashToolResult as G,isEditToolResult as K,isFindToolResult as V,isGrepToolResult as W,isLsToolResult as z,isPowerShellToolResult as X,isReadToolResult as Y,isToolCallEventType as q,isWriteToolResult as Q,wrapRegisteredTool as J,wrapRegisteredTools as Z}from"./core/extensions/index.js";import{getHostCapabilities as ee,HOST_CAPABILITIES_ENV as oe,HOST_TOKEN_ENV as te,HOST_TOKEN_HEADER as re,HOST_URL_ENV as ne,HostCallError as ae,HostCapabilities as ie,parseHostCapabilities as se}from"./core/host-capabilities.js";import{convertToLlm as me}from"./core/messages.js";import{ModelRegistry as pe}from"./core/model-registry.js";import{resolveCliModel as de,resolveModelScopeWithDiagnostics as Te}from"./core/model-resolver.js";import{CredentialSynchronizationError as fe,ModelRuntime as Ee}from"./core/model-runtime.js";import{DefaultPackageManager as Ce}from"./core/package-manager.js";import{buildRuleSet as he,matchPermissionRules as Pe,parsePermissionRule as Re}from"./core/permissions/rules.js";import{evaluateToolPolicy as De,readAccessDenial as Me,registerPermissionAskHandler as Le}from"./core/permissions/tool-policy.js";import{describeProjectFacts as ke,detectProjectFacts as ye,projectPackageManager as Ie}from"./core/project-facts.js";import{buildProjectMap as Oe,formatProjectMapPrompt as Ne}from"./core/project-map.js";import{DefaultResourceLoader as He,loadProjectContextFiles as Be}from"./core/resource-loader.js";import{detectSandboxAvailability as we,getProcessShellSandbox as Ue,registerSandboxEscalationHandler as je,resolveSandboxPolicy as Ge,SANDBOX_ENV as Ke,ShellSandbox as Ve}from"./core/sandbox/index.js";import{AgentSessionRuntime as ze,createAgentSession as Xe,createAgentSessionFromServices as Ye,createAgentSessionRuntime as qe,createAgentSessionServices as Qe,createBashTool as Je,createCodingTools as Ze,createEditTool as $e,createFindTool as eo,createGrepTool as oo,createLsTool as to,createPowerShellTool as ro,createReadOnlyTools as no,createReadTool as ao,createWriteTool as io}from"./core/sdk.js";import{buildContextEntries as lo,buildSessionContext as mo,buildSessionProjection as co,CURRENT_SESSION_VERSION as po,getLatestCompactionEntry as So,migrateSessionEntries as To,parseSessionEntries as go,SessionManager as fo,sessionEntryToContextMessages as Eo}from"./core/session-manager.js";import{SettingsManager as Co}from"./core/settings-manager.js";import{formatSkillsForPrompt as ho,loadSkills as Po,loadSkillsFromDir as Ro}from"./core/skills.js";import{createSyntheticSourceInfo as Do}from"./core/source-info.js";import{getToolDenial as Lo}from"./core/tool-denial.js";import{generateDiffString as ko,generateUnifiedPatch as yo,normalizeForFuzzyMatch as Io}from"./core/tools/edit-diff.js";import{createBashToolDefinition as Oo,createEditToolDefinition as No,createFindToolDefinition as vo,createGrepToolDefinition as Ho,createLocalBashOperations as Bo,createLocalPowerShellOperations as bo,createLsToolDefinition as wo,createPowerShellToolDefinition as Uo,createProcessToolDefinition as jo,createReadToolDefinition as Go,createWriteToolDefinition as Ko,DEFAULT_MAX_BYTES as Vo,DEFAULT_MAX_LINES as Wo,formatSize as zo,registerShellExecutionGuard as Xo,shellExecutionRefusal as Yo,truncateHead as qo,truncateLine as Qo,truncateTail as Jo,withFileMutationQueue as Zo}from"./core/tools/index.js";import{resolveToCwd as et}from"./core/tools/path-utils.js";import{hasTrustRequiringProjectResources as tt,ProjectTrustStore as rt}from"./core/trust-manager.js";import{VIRTUAL_MODEL_STATE_ENTRY as at}from"./core/virtual-models.js";import{claimWorkspace as st,gitDirOf as lt,readWorkspaceLock as mt,releaseWorkspace as ct,STALE_AFTER_MS as pt,shellCommandDirectory as St,WORKSPACE_LOCK_FILE as dt,workspaceLockIsLive as Tt,workspaceOwnerSessionId as gt}from"./core/workspace-lock.js";import{applyShellEnvironmentPolicy as Et,DEFAULT_SHELL_ENV_EXCLUDES as xt,isDalCodeCredentialName as Ct,withoutDalCodeCredentials as ut}from"./dal/child-env.js";import{ADAPTATION_FILE as Pt,adaptationState as Rt,adaptPackage as At,applyCommunityEnv as Dt,communityEnv as Mt,ensurePackageAdapted as Lt,isAdaptablePackage as _t,readAdaptation as kt,scanHardcodedPiPaths as yt,tryEnsurePackageAdapted as It,verifyAdaptation as Ft}from"./dal/extension-compat.js";export*from"./dal/hooks/index.js";import{isHostExtensionPath as vt,markHostExtensionPaths as Ht}from"./dal/host-extensions.js";import{ENGINE_MARKET_CACHE_FILE as bt,fetchSignedMarket as wt,MARKET_SECTIONS as Ut,marketCacheDir as jt,readSignedSection as Gt,resolveMarketEndpoint as Kt,verifySignedSection as Vt}from"./dal/reviewed/market.js";import{createCodemodeExtension as zt}from"./extensions/codemode/index.js";import{createMcpExtension as Yt}from"./extensions/mcp/index.js";import{loadMcpRuntime as Qt}from"./extensions/mcp/runtime.lazy.js";import{createToolSearchExtension as Zt}from"./extensions/tool-search/index.js";import{main as er}from"./main.js";import{InteractiveMode as tr,RpcClient as rr,runPrintMode as nr,runRpcMode as ar}from"./modes/index.js";import{ArminComponent as sr,AssistantMessageComponent as lr,BashExecutionComponent as mr,BorderedLoader as cr,BranchSummaryMessageComponent as pr,CompactionSummaryMessageComponent as Sr,CustomEditor as dr,CustomMessageComponent as Tr,DynamicBorder as gr,ExtensionEditorComponent as fr,ExtensionInputComponent as Er,ExtensionSelectorComponent as xr,FooterComponent as Cr,keyHint as ur,keyText as hr,LoginDialogComponent as Pr,ModelSelectorComponent as Rr,OAuthSelectorComponent as Ar,rawKeyHint as Dr,renderDiff as Mr,SessionSelectorComponent as Lr,SettingsSelectorComponent as _r,ShowImagesSelectorComponent as kr,SkillInvocationMessageComponent as yr,ThemeSelectorComponent as Ir,ThinkingSelectorComponent as Fr,ToolExecutionComponent as Or,TreeSelectorComponent as Nr,truncateToVisualLines as vr,UserMessageComponent as Hr,UserMessageSelectorComponent as Br}from"./modes/interactive/components/index.js";import{getLanguageFromPath as wr,getMarkdownTheme as Ur,getSelectListTheme as jr,getSettingsListTheme as Gr,highlightCode as Kr,initTheme as Vr,Theme as Wr}from"./modes/interactive/theme/theme.js";import{copyToClipboard as Xr}from"./utils/clipboard.js";import{parseFrontmatter as qr,stripFrontmatter as Qr}from"./utils/frontmatter.js";import{convertToPng as Zr}from"./utils/image-convert.js";import{formatDimensionNote as en,resizeImage as on}from"./utils/image-resize.js";import{detectSupportedImageMimeTypeFromFile as rn}from"./utils/mime.js";import{openBrowser as an}from"./utils/open-browser.js";import{getPowerShellConfig as ln,getShellConfig as mn,getShellEnv as cn}from"./utils/shell.js";export{Pt as ADAPTATION_FILE,d as AgentSession,ze as AgentSessionRuntime,sr as ArminComponent,lr as AssistantMessageComponent,x as BackgroundProcessManager,mr as BashExecutionComponent,cr as BorderedLoader,pr as BranchSummaryMessageComponent,n as CONFIG_DIR_NAME,po as CURRENT_SESSION_VERSION,Sr as CompactionSummaryMessageComponent,fe as CredentialSynchronizationError,dr as CustomEditor,Tr as CustomMessageComponent,A as DEFAULT_COMPACTION_SETTINGS,Vo as DEFAULT_MAX_BYTES,Wo as DEFAULT_MAX_LINES,xt as DEFAULT_SHELL_ENV_EXCLUDES,Ce as DefaultPackageManager,He as DefaultResourceLoader,gr as DynamicBorder,bt as ENGINE_MARKET_CACHE_FILE,fr as ExtensionEditorComponent,Er as ExtensionInputComponent,j as ExtensionRunner,xr as ExtensionSelectorComponent,Cr as FooterComponent,oe as HOST_CAPABILITIES_ENV,te as HOST_TOKEN_ENV,re as HOST_TOKEN_HEADER,ne as HOST_URL_ENV,ae as HostCallError,ie as HostCapabilities,tr as InteractiveMode,Pr as LoginDialogComponent,Ut as MARKET_SECTIONS,C as MAX_BACKGROUND_PROCESSES,pe as ModelRegistry,Ee as ModelRuntime,Rr as ModelSelectorComponent,Ar as OAuthSelectorComponent,rt as ProjectTrustStore,rr as RpcClient,Ke as SANDBOX_ENV,c as SHARED_SKILL_CONFIG_DIRS,pt as STALE_AFTER_MS,fo as SessionManager,Lr as SessionSelectorComponent,Co as SettingsManager,_r as SettingsSelectorComponent,Ve as ShellSandbox,kr as ShowImagesSelectorComponent,yr as SkillInvocationMessageComponent,Wr as Theme,Ir as ThemeSelectorComponent,Fr as ThinkingSelectorComponent,Or as ToolExecutionComponent,Nr as TreeSelectorComponent,Hr as UserMessageComponent,Br as UserMessageSelectorComponent,p as VERSION,at as VIRTUAL_MODEL_STATE_ENTRY,dt as WORKSPACE_LOCK_FILE,At as adaptPackage,Rt as adaptationState,Dt as applyCommunityEnv,Et as applyShellEnvironmentPolicy,lo as buildContextEntries,Oe as buildProjectMap,he as buildRuleSet,mo as buildSessionContext,co as buildSessionProjection,h as calculateContextTokens,st as claimWorkspace,P as collectEntriesForBranchSummary,Mt as communityEnv,R as compact,me as convertToLlm,Zr as convertToPng,Xr as copyToClipboard,Xe as createAgentSession,Ye as createAgentSessionFromServices,qe as createAgentSessionRuntime,Qe as createAgentSessionServices,Je as createBashTool,Oo as createBashToolDefinition,zt as createCodemodeExtension,Ze as createCodingTools,$e as createEditTool,No as createEditToolDefinition,H as createEventBus,b as createExtensionRuntime,eo as createFindTool,vo as createFindToolDefinition,oo as createGrepTool,Ho as createGrepToolDefinition,Bo as createLocalBashOperations,bo as createLocalPowerShellOperations,to as createLsTool,wo as createLsToolDefinition,Yt as createMcpExtension,ro as createPowerShellTool,Uo as createPowerShellToolDefinition,jo as createProcessToolDefinition,no as createReadOnlyTools,ao as createReadTool,Go as createReadToolDefinition,Do as createSyntheticSourceInfo,Zt as createToolSearchExtension,io as createWriteTool,Ko as createWriteToolDefinition,w as defineTool,ke as describeProjectFacts,ye as detectProjectFacts,we as detectSandboxAvailability,rn as detectSupportedImageMimeTypeFromFile,U as discoverAndLoadExtensions,Lt as ensurePackageAdapted,D as estimateTokens,De as evaluateToolPolicy,wt as fetchSignedMarket,M as findCutPoint,L as findTurnStartIndex,en as formatDimensionNote,Ne as formatProjectMapPrompt,zo as formatSize,ho as formatSkillsForPrompt,_ as generateBranchSummary,ko as generateDiffString,k as generateSummary,y as generateSummaryWithUsage,yo as generateUnifiedPatch,a as getAgentDir,i as getDocsPath,s as getExamplesPath,ee as getHostCapabilities,wr as getLanguageFromPath,I as getLastAssistantUsage,So as getLatestCompactionEntry,Ur as getMarkdownTheme,l as getPackageDir,ln as getPowerShellConfig,Ue as getProcessShellSandbox,m as getReadmePath,jr as getSelectListTheme,Gr as getSettingsListTheme,mn as getShellConfig,cn as getShellEnv,Lo as getToolDenial,lt as gitDirOf,tt as hasTrustRequiringProjectResources,Kr as highlightCode,Vr as initTheme,_t as isAdaptablePackage,G as isBashToolResult,Ct as isDalCodeCredentialName,K as isEditToolResult,V as isFindToolResult,W as isGrepToolResult,vt as isHostExtensionPath,z as isLsToolResult,X as isPowerShellToolResult,Y as isReadToolResult,q as isToolCallEventType,Q as isWriteToolResult,ur as keyHint,hr as keyText,Qt as loadMcpRuntime,Be as loadProjectContextFiles,Po as loadSkills,Ro as loadSkillsFromDir,er as main,Ht as markHostExtensionPaths,jt as marketCacheDir,Pe as matchPermissionRules,To as migrateSessionEntries,Io as normalizeForFuzzyMatch,an as openBrowser,t as parseArgs,qr as parseFrontmatter,se as parseHostCapabilities,Re as parsePermissionRule,go as parseSessionEntries,T as parseSkillBlock,F as prepareBranchEntries,Ie as projectPackageManager,Dr as rawKeyHint,Me as readAccessDenial,kt as readAdaptation,Gt as readSignedSection,f as readStoredCredential,mt as readWorkspaceLock,Le as registerPermissionAskHandler,je as registerSandboxEscalationHandler,Xo as registerShellExecutionGuard,ct as releaseWorkspace,Mr as renderDiff,on as resizeImage,de as resolveCliModel,Kt as resolveMarketEndpoint,Te as resolveModelScopeWithDiagnostics,Ge as resolveSandboxPolicy,et as resolveToCwd,nr as runPrintMode,ar as runRpcMode,yt as scanHardcodedPiPaths,O as serializeConversation,Eo as sessionEntryToContextMessages,St as shellCommandDirectory,Yo as shellExecutionRefusal,N as shouldCompact,Qr as stripFrontmatter,qo as truncateHead,Qo as truncateLine,Jo as truncateTail,vr as truncateToVisualLines,It as tryEnsurePackageAdapted,Ft as verifyAdaptation,Vt as verifySignedSection,Zo as withFileMutationQueue,ut as withoutDalCodeCredentials,Tt as workspaceLockIsLive,gt as workspaceOwnerSessionId,J as wrapRegisteredTool,Z as wrapRegisteredTools};
|