cc-safety-net 2.6.12 → 2.6.13

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.
@@ -1,2 +1,2 @@
1
- import{_e,L,_,Z,c,Pe,m,x,se,ge,l,f}from"./index-1wy9mq4k.js";import{oe}from"./index-wkjncmhg.js";import{Te,H}from"./index-hcky80cs.js";import{join as T,resolve as y}from"node:path";function Le(){return{"cc-safety-net":{description:"Operate CC Safety Net: explain blocks, rules, integrations, diagnostics",template:oe.slice(oe.indexOf("# CC Safety Net"))}}}var O=new Set(["powershell","pwsh"]),k=new Set(["fish","nu"]),Ye="bash",ke="shell";function gt(n={}){return async({directory:t,homeDir:a})=>{let e=y(t),o;return{config:async(i)=>{o=i;let s=Le(),u=i.command??{};i.command={...s,...u}},"tool.execute.before":async(i,s)=>{Ze({configCwd:e,homeDir:a,tool:i.tool,sessionID:i.sessionID,toolInput:s.args,route:P(i.tool,Xe(o?.shell)),guardDependencies:n})}}}}function Ze({configCwd:n,homeDir:t,expandHomeWorkdir:a=!1,tool:e,sessionID:o,toolInput:i,route:s,guardDependencies:u={}}){let C=t===void 0?c():{...c(),home:t},d=(r,D,v=n)=>{Te(C,r,()=>o,{agent:"opencode",toolName:D,cwd:v}),h(r)};if(typeof e!=="string"||e.trim()==="")d(L());let p;try{p=se(i)}catch(r){if(!(r instanceof m))throw r;d(L({toolName:e}),e)}if(!ge(n)){d(_({directory:"session",problem:"unusable",cwd:n},{command:p,toolName:e}),e);return}let g=S(n,i,a?C.home:void 0);if(g===null){d(L({command:p,toolName:e}),e);return}if(typeof g!=="string"){d(_(g,{command:p,toolName:e}),e,g.cwd);return}let E=l(e,i,s,{configCwd:n,executionCwd:g},p??null);try{let r=H(C,E,{guard:{auditAllowed:Pe(C.env),dependencies:u},audit:{agent:"opencode",getSessionId:()=>o}});w(r)}catch(r){if(!(r instanceof f))throw r;if(r.stage==="policy-protection"||r.stage==="config-load"||r.stage==="secret-protection")throw r.cause;w(r.evaluation);return}}function Xe(n,t=process.platform,a=process.env.SHELL){let o=(typeof n==="string"?n:a)?.trim().split(/[\\/]/).at(-1)?.toLowerCase().replace(/\.exe$/,"");if(typeof n!=="string"&&t==="win32"&&(!o||k.has(o)))return"powershell";if(!o)return"auto";if(O.has(o))return"powershell";return o==="cmd"?"auto":"posix"}function P(n,t){if(n===Ye)return{kind:"command",shell:t};return{kind:x(n)}}function S(n,t,a){if(!t||typeof t!=="object"||Array.isArray(t))return n;if(!Object.hasOwn(t,"workdir"))return n;let e=t.workdir;if(typeof e!=="string"||e.trim()==="")return null;let o=process.platform==="win32"?N(e):e,i=o.startsWith("~/")||process.platform==="win32"&&o.startsWith("~\\"),s=a===void 0?o:o==="~"?a:i?T(a,o.slice(2)):o,u=y(n,s);return ge(u)?u:{directory:"requested",problem:"unusable",cwd:e}}function N(n){return n.replace(/^\/([a-zA-Z]):(?:[\\/]|$)/,(a,e)=>`${e.toUpperCase()}:/`).replace(/^\/([a-zA-Z])(?:[\\/]|$)/,(a,e)=>`${e.toUpperCase()}:/`).replace(/^\/cygdrive\/([a-zA-Z])(?:[\\/]|$)/,(a,e)=>`${e.toUpperCase()}:/`).replace(/^\/mnt\/([a-zA-Z])(?:[\\/]|$)/,(a,e)=>`${e.toUpperCase()}:/`)}function w(n){let t=_e(n,{includeEvidence:!0});if(t)h(t)}function h(n){throw Error(Z(n))}
1
+ import{_e,L,_,Z,c,Pe,m,x,se,ge,l,f}from"./index-rdxjms22.js";import{oe}from"./index-wkjncmhg.js";import{Te,W}from"./index-x95aj0ja.js";import{join as T,resolve as y}from"node:path";function Le(){return{"cc-safety-net":{description:"Operate CC Safety Net: explain blocks, rules, integrations, diagnostics",template:oe.slice(oe.indexOf("# CC Safety Net"))}}}var O=new Set(["powershell","pwsh"]),k=new Set(["fish","nu"]),Ye="bash",ke="shell";function gt(n={}){return async({directory:t,homeDir:a})=>{let e=y(t),o;return{config:async(i)=>{o=i;let s=Le(),u=i.command??{};i.command={...s,...u}},"tool.execute.before":async(i,s)=>{Ze({configCwd:e,homeDir:a,tool:i.tool,sessionID:i.sessionID,toolInput:s.args,route:P(i.tool,Xe(o?.shell)),guardDependencies:n})}}}}function Ze({configCwd:n,homeDir:t,expandHomeWorkdir:a=!1,tool:e,sessionID:o,toolInput:i,route:s,guardDependencies:u={}}){let C=t===void 0?c():{...c(),home:t},d=(r,D,v=n)=>{Te(C,r,()=>o,{agent:"opencode",toolName:D,cwd:v}),h(r)};if(typeof e!=="string"||e.trim()==="")d(L());let p;try{p=se(i)}catch(r){if(!(r instanceof m))throw r;d(L({toolName:e}),e)}if(!ge(n)){d(_({directory:"session",problem:"unusable",cwd:n},{command:p,toolName:e}),e);return}let g=S(n,i,a?C.home:void 0);if(g===null){d(L({command:p,toolName:e}),e);return}if(typeof g!=="string"){d(_(g,{command:p,toolName:e}),e,g.cwd);return}let E=l(e,i,s,{configCwd:n,executionCwd:g},p??null);try{let r=W(C,E,{guard:{auditAllowed:Pe(C.env),dependencies:u},audit:{agent:"opencode",getSessionId:()=>o}});w(r)}catch(r){if(!(r instanceof f))throw r;if(r.stage==="policy-protection"||r.stage==="config-load"||r.stage==="secret-protection")throw r.cause;w(r.evaluation);return}}function Xe(n,t=process.platform,a=process.env.SHELL){let o=(typeof n==="string"?n:a)?.trim().split(/[\\/]/).at(-1)?.toLowerCase().replace(/\.exe$/,"");if(typeof n!=="string"&&t==="win32"&&(!o||k.has(o)))return"powershell";if(!o)return"auto";if(O.has(o))return"powershell";return o==="cmd"?"auto":"posix"}function P(n,t){if(n===Ye)return{kind:"command",shell:t};return{kind:x(n)}}function S(n,t,a){if(!t||typeof t!=="object"||Array.isArray(t))return n;if(!Object.hasOwn(t,"workdir"))return n;let e=t.workdir;if(typeof e!=="string"||e.trim()==="")return null;let o=process.platform==="win32"?N(e):e,i=o.startsWith("~/")||process.platform==="win32"&&o.startsWith("~\\"),s=a===void 0?o:o==="~"?a:i?T(a,o.slice(2)):o,u=y(n,s);return ge(u)?u:{directory:"requested",problem:"unusable",cwd:e}}function N(n){return n.replace(/^\/([a-zA-Z]):(?:[\\/]|$)/,(a,e)=>`${e.toUpperCase()}:/`).replace(/^\/([a-zA-Z])(?:[\\/]|$)/,(a,e)=>`${e.toUpperCase()}:/`).replace(/^\/cygdrive\/([a-zA-Z])(?:[\\/]|$)/,(a,e)=>`${e.toUpperCase()}:/`).replace(/^\/mnt\/([a-zA-Z])(?:[\\/]|$)/,(a,e)=>`${e.toUpperCase()}:/`)}function w(n){let t=_e(n,{includeEvidence:!0});if(t)h(t)}function h(n){throw Error(Z(n))}
2
2
  export{Le,Ye,ke,gt,Ze,Xe};
@@ -1,4 +1,4 @@
1
- import{a,s,Y,m,Fe,u,Be,b,U,f,K}from"./index-1wy9mq4k.js";import{appendFileSync as re,mkdirSync as oe}from"node:fs";import{isAbsolute as ae,join as S}from"node:path";import{lstatSync as F,readdirSync as j,readFileSync as V,rmdirSync as B,statSync as D,unlinkSync as X,utimesSync as z,writeFileSync as Z}from"node:fs";import{join as g}from"node:path";function ie(t,e={}){return Be(u(t,e),t.home).policy.audit.retention_days}var A=86400000,Q=".last-prune",W=/^\d{4}-\d{2}$/,q=/^((\d{4}-\d{2})-\d{2})-.+\.jsonl$/,C=(t)=>Math.floor(t/A);function J(t,e,r=()=>new Date){try{let n=r().getTime();if(!D(e,{throwIfNoEntry:!1})?.isDirectory())return;let o=g(e,Q),c=D(o,{throwIfNoEntry:!1})?.mtimeMs;if(c!==void 0&&C(c)===C(n))return;let i=n-ie(t)*A,d=new Date(n).toISOString().slice(0,7);for(let l of v(e)){if(l.isDirectory()){ee(g(e,l.name),i,d);continue}if(l.isFile()&&l.name.endsWith(".jsonl"))te(g(e,l.name),i)}Z(o,"",{mode:384}),z(o,n/1000,n/1000)}catch{}}function ee(t,e,r){for(let n of v(t)){if(!n.isDirectory()||!W.test(n.name))continue;let o=g(t,n.name);for(let c of v(o)){if(!c.isFile())continue;let i=q.exec(c.name);if(!i||i[2]!==n.name)continue;let d=Date.parse(`${i[1]}T00:00:00.000Z`)+A;if(!Number.isFinite(d)||d>=e)continue;O(g(o,c.name))}if(n.name!==r)L(o)}L(t)}function te(t,e){try{let r=F(t);if(r.mtimeMs>=e)return;let n=V(t,"utf-8").split(`
2
- `).filter((o)=>o.trim()).map(ne);if(n.length===0)return;if(n.some((o)=>o===void 0||o>=e))return;if(F(t).mtimeMs!==r.mtimeMs)return;O(t)}catch{}}function ne(t){try{let e=JSON.parse(t).ts,r=typeof e==="string"?Date.parse(e):Number.NaN;return Number.isFinite(r)?r:void 0}catch{return}}function v(t){try{return j(t,{withFileTypes:!0,encoding:"utf8"})}catch{return[]}}function O(t){try{X(t)}catch{}}function L(t){try{B(t)}catch{}}var ce="2.6.12",de=1e4,ue=2000,se=256,le=32768;function me(t){let e=t.trim();if(!e)return null;let r=e.replace(/[^A-Za-z0-9_.-]+/g,"_");if(r=r.replace(/^[._-]+|[._-]+$/g,"").slice(0,128),!r||r==="."||r==="..")return null;return r}function fe(t){return(t??"").replace(/[^A-Za-z0-9]/g,"-").slice(0,180)||"no-cwd"}function I(t,e,r,n,o,c,i={}){let d=me(e);if(!d)return;let l=G(t);if(!l)return;try{let y=(i.now??(()=>new Date))().toISOString(),_=p(Y(r),i.failureStage?Number.POSITIVE_INFINITY:de),N=p(Y(n),ue),h=i.toolName?p(Y(i.toolName),se):void 0,E=c===null?void 0:p(Y(c),le),w=S(l,fe(E?.value??null),y.slice(0,7));oe(w,{recursive:!0,mode:448});let R=S(w,`${y.slice(0,10)}-${d}.jsonl`),P={ts:y,id:(i.createId??Fe)(),v:ce,sessionId:d,decision:i.decision??"deny",agent:i.agent,shape:i.shape,level:i.level,configFallback:i.configFallback,toolName:h?.value,command:_.value,segment:N.value,..._.truncated||N.truncated||h?.truncated||E?.truncated?{truncated:!0}:{},reason:o,ruleId:i.ruleId,intent:i.intent,failureStage:i.failureStage,errorCode:i.errorCode,cwd:E?.value??null};re(R,`${JSON.stringify(P)}
3
- `,{encoding:"utf-8",mode:384}),J(t,l,i.now)}catch{}}function p(t,e){return{value:t.slice(0,e),truncated:t.length>e}}function tt(t){let e=t.env.get("CC_SAFETY_NET_AUDIT_HOME");if(t.env.get("NODE_ENV")==="test"&&!e)return null;let r=e||t.home;return r&&ae(r)?r:null}function G(t){let e=tt(t);return e?S(e,".cc-safety-net","logs"):null}function k(t,e,r,n=!0,o){if(e.decision.kind==="allow"){if(!r||t.route.kind!=="command")return;let d=T(t);return{decision:"allow",command:d,segment:d,reason:"allowed",cwd:t.context.executionCwd,toolName:t.toolName,level:e.level,...e.configFallback?{configFallback:!0}:{}}}let c=e.decision.evidence,i=c?.command??(n?T(t):"");return{decision:"deny",command:i,segment:c?.segment??i,reason:e.decision.reason,cwd:t.context.executionCwd,toolName:t.toolName,level:e.level,...e.configFallback?{configFallback:!0}:{},ruleId:e.decision.ruleId,intent:e.decision.intent,failureStage:o?.stage,errorCode:o?.errorCode}}function T(t){return"command"in t?t.command??"":""}function x(t,e,r,n){if(!e)return;let o;try{o=r()}catch{return}if(typeof o!=="string"||!o.trim())return;I(t,o,e.command,e.segment,e.reason,e.cwd,{decision:e.decision,agent:n.agent,shape:n.shape,level:e.level,configFallback:e.configFallback,toolName:e.toolName,ruleId:e.ruleId,intent:e.intent,failureStage:e.failureStage,errorCode:e.errorCode})}function Te(t,e,r,n){let o;try{o=r()}catch{return}if(typeof o!=="string"||!o.trim())return;I(t,o,e.command??"",e.segment??e.command??"",e.reason,n.cwd??null,{decision:"deny",agent:n.agent,shape:n.shape,toolName:n.toolName??e.toolName,ruleId:e.ruleId,intent:e.intent})}function H(t,e,r){try{let n=K(e,{environment:t,...r.guard});return M(t,e,n,r),n}catch(n){if(!(n instanceof f))throw n;throw M(t,e,n.evaluation,r,!(n.cause instanceof m),{stage:n.stage,errorCode:ge(n.cause)}),n}}function M(t,e,r,n,o=!0,c){x(t,k(r.promotedInvocation??e,r,n.guard?.auditAllowed??!1,o,c),n.audit.getSessionId,{agent:n.audit.agent,shape:n.audit.shape})}function ge(t){if(t instanceof s)return a[t.kind].errorCode;if(t instanceof m)return"tool-input-limit";if(t instanceof b)return"structural-shell-syntax-limit";if(t instanceof U)return"unparseable-command";return"unexpected-error"}
4
- export{ie,J,tt,G,Te,H};
1
+ import{a,s,Y,m,Fe,u,Be,b,U,f,j}from"./index-rdxjms22.js";import{appendFileSync as re,mkdirSync as oe}from"node:fs";import{isAbsolute as ae,join as S}from"node:path";import{lstatSync as F,readdirSync as P,readFileSync as V,rmdirSync as B,statSync as D,unlinkSync as K,utimesSync as X,writeFileSync as z}from"node:fs";import{join as g}from"node:path";function ie(t,e={}){return Be(u(t,e),t.home).policy.audit.retention_days}var A=86400000,Z=".last-prune",Q=/^\d{4}-\d{2}$/,q=/^((\d{4}-\d{2})-\d{2})-.+\.jsonl$/,C=(t)=>Math.floor(t/A);function J(t,e,r=()=>new Date){try{let n=r().getTime();if(!D(e,{throwIfNoEntry:!1})?.isDirectory())return;let o=g(e,Z),c=D(o,{throwIfNoEntry:!1})?.mtimeMs;if(c!==void 0&&C(c)===C(n))return;let i=n-ie(t)*A,d=new Date(n).toISOString().slice(0,7);for(let l of v(e)){if(l.isDirectory()){ee(g(e,l.name),i,d);continue}if(l.isFile()&&l.name.endsWith(".jsonl"))te(g(e,l.name),i)}z(o,"",{mode:384}),X(o,n/1000,n/1000)}catch{}}function ee(t,e,r){for(let n of v(t)){if(!n.isDirectory()||!Q.test(n.name))continue;let o=g(t,n.name);for(let c of v(o)){if(!c.isFile())continue;let i=q.exec(c.name);if(!i||i[2]!==n.name)continue;let d=Date.parse(`${i[1]}T00:00:00.000Z`)+A;if(!Number.isFinite(d)||d>=e)continue;O(g(o,c.name))}if(n.name!==r)L(o)}L(t)}function te(t,e){try{let r=F(t);if(r.mtimeMs>=e)return;let n=V(t,"utf-8").split(`
2
+ `).filter((o)=>o.trim()).map(ne);if(n.length===0)return;if(n.some((o)=>o===void 0||o>=e))return;if(F(t).mtimeMs!==r.mtimeMs)return;O(t)}catch{}}function ne(t){try{let e=JSON.parse(t).ts,r=typeof e==="string"?Date.parse(e):Number.NaN;return Number.isFinite(r)?r:void 0}catch{return}}function v(t){try{return P(t,{withFileTypes:!0,encoding:"utf8"})}catch{return[]}}function O(t){try{K(t)}catch{}}function L(t){try{B(t)}catch{}}var ce="2.6.13",de=1e4,ue=2000,se=256,le=32768;function me(t){let e=t.trim();if(!e)return null;let r=e.replace(/[^A-Za-z0-9_.-]+/g,"_");if(r=r.replace(/^[._-]+|[._-]+$/g,"").slice(0,128),!r||r==="."||r==="..")return null;return r}function fe(t){return(t??"").replace(/[^A-Za-z0-9]/g,"-").slice(0,180)||"no-cwd"}function I(t,e,r,n,o,c,i={}){let d=me(e);if(!d)return;let l=H(t);if(!l)return;try{let y=(i.now??(()=>new Date))().toISOString(),_=p(Y(r),i.failureStage?Number.POSITIVE_INFINITY:de),N=p(Y(n),ue),h=i.toolName?p(Y(i.toolName),se):void 0,E=c===null?void 0:p(Y(c),le),w=S(l,fe(E?.value??null),y.slice(0,7));oe(w,{recursive:!0,mode:448});let M=S(w,`${y.slice(0,10)}-${d}.jsonl`),R={ts:y,id:(i.createId??Fe)(),v:ce,sessionId:d,decision:i.decision??"deny",agent:i.agent,shape:i.shape,level:i.level,configFallback:i.configFallback,toolName:h?.value,command:_.value,segment:N.value,..._.truncated||N.truncated||h?.truncated||E?.truncated?{truncated:!0}:{},reason:o,ruleId:i.ruleId,intent:i.intent,failureStage:i.failureStage,errorCode:i.errorCode,cwd:E?.value??null};re(M,`${JSON.stringify(R)}
3
+ `,{encoding:"utf-8",mode:384}),J(t,l,i.now)}catch{}}function p(t,e){return{value:t.slice(0,e),truncated:t.length>e}}function tt(t){let e=t.env.get("CC_SAFETY_NET_AUDIT_HOME");if(t.env.get("NODE_ENV")==="test"&&!e)return null;let r=e||t.home;return r&&ae(r)?r:null}function H(t){let e=tt(t);return e?S(e,".cc-safety-net","logs"):null}function T(t,e,r,n=!0,o){if(e.decision.kind==="allow"){if(!r||t.route.kind!=="command")return;let d=G(t);return{decision:"allow",command:d,segment:d,reason:"allowed",cwd:t.context.executionCwd,toolName:t.toolName,level:e.level,...e.configFallback?{configFallback:!0}:{}}}let c=e.decision.evidence,i=c?.command??(n?G(t):"");return{decision:"deny",command:i,segment:c?.segment??i,reason:e.decision.reason,cwd:t.context.executionCwd,toolName:t.toolName,level:e.level,...e.configFallback?{configFallback:!0}:{},ruleId:e.decision.ruleId,intent:e.decision.intent,failureStage:o?.stage,errorCode:o?.errorCode}}function G(t){return"command"in t?t.command??"":""}function k(t,e,r,n){if(!e)return;let o;try{o=r()}catch{return}if(typeof o!=="string"||!o.trim())return;I(t,o,e.command,e.segment,e.reason,e.cwd,{decision:e.decision,agent:n.agent,shape:n.shape,level:e.level,configFallback:e.configFallback,toolName:e.toolName,ruleId:e.ruleId,intent:e.intent,failureStage:e.failureStage,errorCode:e.errorCode})}function Te(t,e,r,n){let o;try{o=r()}catch{return}if(typeof o!=="string"||!o.trim())return;I(t,o,e.command??"",e.segment??e.command??"",e.reason,n.cwd??null,{decision:"deny",agent:n.agent,shape:n.shape,toolName:n.toolName??e.toolName,ruleId:e.ruleId,intent:e.intent})}function W(t,e,r){try{let n=j(e,{environment:t,...r.guard});return x(t,e,n,r),n}catch(n){if(!(n instanceof f))throw n;throw x(t,e,n.evaluation,r,!(n.cause instanceof m),{stage:n.stage,errorCode:ge(n.cause)}),n}}function x(t,e,r,n,o=!0,c){k(t,T(r.promotedInvocation??e,r,n.guard?.auditAllowed??!1,o,c),n.audit.getSessionId,{agent:n.audit.agent,shape:n.audit.shape})}function ge(t){if(t instanceof s)return a[t.kind].errorCode;if(t instanceof m)return"tool-input-limit";if(t instanceof b)return"structural-shell-syntax-limit";if(t instanceof U)return"unparseable-command";return"unexpected-error"}
4
+ export{ie,J,tt,H,Te,W};
@@ -1,2 +1,2 @@
1
- import{Z,x,it,l}from"./index-1wy9mq4k.js";import{j,fe,Re}from"./index-feqnsxd2.js";import{resolve as f}from"node:path";var et=new Map([["bash","posix"],["pwsh","powershell"]]),g={agent:"deepseek-harness",debugLabel:"deepseek-harness tool guard",extract:(e,i,r)=>w(e,i,r),getSessionId:(e)=>e?.agent?.session.header.id,allow:void 0,block:(e)=>Z(e),includeEvidenceOnError:(e)=>e.route.kind==="command"};function yt(e){let i=k();e.tools.guard((r)=>i(r,process.cwd()))}function k(e={}){return Re(g,e)}function w(e,i,r){if(!e||typeof e!=="object")return j(null);let d=e,n=d.name;if(typeof n!=="string"||n.trim()==="")return j(null);let u=d.agent?.session.header.cwd??i,o=it([u],r);if(!o)return fe({directory:"session",problem:"unusable",cwd:u},{toolName:n});let t=d.arguments,c=et.get(n);if(!c)return l(n,t,{kind:x(n)},{configCwd:o,executionCwd:o},null);if(!t||typeof t!=="object"||Array.isArray(t))return j(o,{toolName:n});let p=t,a=p.command;if(typeof a!=="string"||a.trim()==="")return j(o,{toolName:n});let s=p.workdir;if(s!==void 0&&(typeof s!=="string"||s.trim()===""))return j(o,{command:a,toolName:n});let m=s===void 0?o:it([f(o,s)],r);if(!m)return fe({directory:"requested",problem:"unusable",cwd:s},{command:a,toolName:n});return l(n,t,{kind:"command",shell:c},{configCwd:o,executionCwd:m},a)}
1
+ import{Z,x,it,l}from"./index-rdxjms22.js";import{G,fe,Re}from"./index-q29jqk43.js";import{resolve as f}from"node:path";var et=new Map([["bash","posix"],["pwsh","powershell"]]),g={agent:"deepseek-harness",debugLabel:"deepseek-harness tool guard",extract:(e,i,r)=>w(e,i,r),getSessionId:(e)=>e?.agent?.session.header.id,allow:void 0,block:(e)=>Z(e),includeEvidenceOnError:(e)=>e.route.kind==="command"};function yt(e){let i=k();e.tools.guard((r)=>i(r,process.cwd()))}function k(e={}){return Re(g,e)}function w(e,i,r){if(!e||typeof e!=="object")return G(null);let d=e,n=d.name;if(typeof n!=="string"||n.trim()==="")return G(null);let u=d.agent?.session.header.cwd??i,o=it([u],r);if(!o)return fe({directory:"session",problem:"unusable",cwd:u},{toolName:n});let t=d.arguments,c=et.get(n);if(!c)return l(n,t,{kind:x(n)},{configCwd:o,executionCwd:o},null);if(!t||typeof t!=="object"||Array.isArray(t))return G(o,{toolName:n});let p=t,a=p.command;if(typeof a!=="string"||a.trim()==="")return G(o,{toolName:n});let s=p.workdir;if(s!==void 0&&(typeof s!=="string"||s.trim()===""))return G(o,{command:a,toolName:n});let m=s===void 0?o:it([f(o,s)],r);if(!m)return fe({directory:"requested",problem:"unusable",cwd:s},{command:a,toolName:n});return l(n,t,{kind:"command",shell:c},{configCwd:o,executionCwd:m},a)}
2
2
  export{et,yt};