UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 20.3 kB
import{r as e}from"./openclaw-state-read-semver-CqfGj9gv.mjs";import{ht as t}from"./openclaw-state-read-map-size-DJbMcZYM.mjs";import{v as n}from"./openclaw-state-read-home-dir-BQZX1pD2.mjs";import{R as r}from"./openclaw-state-read-read-open-flags-CtNL1rJs.mjs";import{St as i}from"./openclaw-state-read-root-symlink-policy-AldRD6ik.mjs";import{n as a}from"./openclaw-state-read-path-existence-Bp_sxI9A.mjs";import{a as o}from"./openclaw-state-read-record-coerce-D1s3ReAs.mjs";import{n as s}from"./openclaw-state-read-runtime-process-entrypoints-ItwYqjQs.mjs";import{r as c}from"./openclaw-state-read-runtime-worker-url-ClM3d-g2.mjs";import{t as l}from"./openclaw-state-read-subsystem-DSi0tJn8.mjs";import{t as u}from"./openclaw-state-read-usingCtx-03vOGQ3v.mjs";import{s as d}from"./openclaw-state-read-worker-request-diagnostics-CbvzxbuX.mjs";import{n as f}from"./openclaw-state-read-spawn-diagnostics-CpCgfk1o.mjs";import{C as p,I as m,T as h,U as g,_,a as v,f as y,m as b,p as x,r as S,v as C,w,z as T}from"./openclaw-state-read-workspace-path-exclusions-Cjo9Lmns.mjs";import{n as E}from"./openclaw-state-read-worker-task-pool-BbckrCtm.mjs";import{qt as D}from"./openclaw-state-read.worker.js";import{n as O}from"./openclaw-state-read-workspace-state-guard-lmfygG7O.mjs";import{n as k,t as A}from"./openclaw-state-read-session-source-authority-B_K2ljxL.mjs";import{n as j}from"./openclaw-state-read-workspace-manifest-B5vKGqPY.mjs";import{n as M}from"./openclaw-state-read-workspace-result-git-DMTU1gvD.mjs";import N from"node:path";import P from"node:fs/promises";import F from"node:os";import{createHash as I}from"node:crypto";import{channel as L}from"node:diagnostics_channel";import{performance as R}from"node:perf_hooks";function createWorkerMutationAuthority(e,t){let n=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)),r,refuse=()=>{r??={error:t?.reason},Atomics.store(n,0,2),Atomics.notify(n,0)};return t?.throwIfAborted(),t?.addEventListener(`abort`,refuse,{once:!0}),{buffer:n.buffer,onNotification:()=>{try{if(r)throw r.error;return t?.throwIfAborted(),e(),t?.throwIfAborted(),Atomics.compareExchange(n,0,0,1),!0}catch(e){return r??={error:e},Atomics.store(n,0,2),!1}finally{Atomics.notify(n,0)}},throwIfRefused:()=>{if(r)throw r.error},dispose:()=>t?.removeEventListener(`abort`,refuse)}}function createPendingPromiseTracker(e){return t=>{e.add(t);let settled=()=>e.delete(t);return t.then(settled,settled),t}}const z=n(Symbol.for(`openclaw.gitContentBudget`),()=>({active:0,activeInteractive:0,waiters:/* @__PURE__ */ new Set,interactiveWaiters:/* @__PURE__ */ new Set}));async function withContentGitSlot(e,n,r=!1){n?.throwIfAborted();let i=r?z.interactiveWaiters:z.waiters;await new Promise((e,a)=>{let start=()=>{i.delete(start),n?.removeEventListener(`abort`,abort),z.active++,z.activeInteractive+=Number(r),e()},abort=()=>{i.delete(start),a(t(n?.reason,`Git operation aborted`))};z.active<2?start():(i.add(start),n?.addEventListener(`abort`,abort,{once:!0}))});try{return n?.throwIfAborted(),await e()}finally{z.active--,z.activeInteractive-=Number(r),(z.interactiveWaiters.size>0&&(z.waiters.size===0||z.activeInteractive===0)?z.interactiveWaiters:z.waiters).values().next().value?.()}}const B=[`reads`,`summary`,`content`,`workspace`,`worktrees`,`worktreeMaintenance`],V=18e5,H=l(`git/worker`),U=L(`openclaw.git.operation`),W={"github.profile-token":`github.identity`,"github.profile-stage":`github.identity`,"github.profile-refresh":`github.identity`,"checkout.bootstrap-workspace":`repository.identities`,"repository.identities":`repository.identities`,"repository.branches":`repository.branches`,"checkout.revision":`checkout.revision`,"checkout.context":`checkout.context`,"checkout.diff":`checkout.diff`,"checkout.baseline":`checkout.baseline`,"pull-request.branch-facts":`pull-request.branch-facts`,"pull-request.branch-comparison":`pull-request.branch-facts`,"worktree.snapshot":`worktree.snapshot`,"worktree.snapshot-verify-exact":`worktree.snapshot`,"worktree.cleanup-inspection":`worktree.cleanup`,"worktree.cleanup-fingerprint":`worktree.cleanup`,"worktree.eviction-classify":`worktree.cleanup`,"worktree.eviction-source":`worktree.cleanup`,"worktree.eviction-repositories":`worktree.cleanup`,"worktree.eviction-purge":`worktree.cleanup`,"worktree.provisioning-inspection":`worktree.provision`,"worktree.git-size":`worktree.inspect`,"worktree.checkout-transition-size":`worktree.inspect`,"worktree.directory-size":`worktree.inspect`,"workspace.artifacts":`workspace.inventory`,"workspace.inventory.select":`workspace.inventory`,"workspace.inventory.existing":`workspace.inventory`,"workspace.inventory.paths":`workspace.inventory`,"workspace.inventory.staged-directories":`workspace.inventory`,"workspace.manifest.local":`workspace.manifest`,"workspace.manifest.capture":`workspace.manifest`,"workspace.manifest.base-refresh":`workspace.manifest`,"workspace.manifest.equal":`workspace.manifest`,"workspace.manifest.snapshot":`workspace.manifest`,"workspace.manifest.document":`workspace.manifest`,"workspace.manifest.initial":`workspace.manifest`,"workspace.manifest.template":`workspace.manifest`,"workspace.manifest.reference":`workspace.manifest`,"workspace.manifest.parse":`workspace.manifest`,"workspace.manifest.paths":`workspace.manifest`,"workspace.manifest.serialize":`workspace.manifest`,"workspace.manifest.overlay":`workspace.manifest`,"workspace.manifest.pair":`workspace.manifest`,"workspace.manifest.staged":`workspace.manifest`,"workspace.manifest.result":`workspace.manifest`,"workspace.manifest.file":`workspace.manifest`,"workspace.manifest.nodes":`workspace.manifest`,"workspace.manifest.stage-input":`workspace.manifest`,"workspace.manifest.tree-input":`workspace.manifest`,"workspace.manifest.remote-capture":`workspace.manifest`,"workspace.reconcile.preflight":`workspace.manifest`,"workspace.reconcile.patch":`workspace.manifest`,"workspace.reconcile.diff":`workspace.manifest`,"workspace.reconcile.ownership":`workspace.manifest`,"workspace.reconcile.apply":`workspace.manifest`,"workspace.reconcile.recover":`workspace.manifest`,"workspace.reconcile.temporary":`workspace.manifest`};function runtime(){return n(Symbol.for(`openclaw.gitOperations`),()=>({pending:/* @__PURE__ */ new Set}),e=>(e.closing??=(async()=>{await Promise.all(B.map(t=>e[t]?.close()??Promise.resolve())),await Promise.allSettled(e.pending);for(let t of B)e[t]=void 0})().finally(()=>{e.closing=void 0}),e.closing))}function poolFor(e,t,n,r){let i=r?`summary`:t.type===`worktree.snapshot`||t.type===`worktree.cleanup-inspection`||t.type===`worktree.cleanup-fingerprint`||t.type===`worktree.eviction-classify`||t.type===`worktree.eviction-repositories`||t.type===`worktree.eviction-purge`?`worktreeMaintenance`:t.type.startsWith(`worktree.`)||t.type===`github.profile-stage`||t.type===`github.profile-refresh`?`worktrees`:t.type.startsWith(`workspace.`)?`workspace`:n?`content`:`reads`;return e[i]??=E({workerUrl:c(s.gitOperations),workerClass:i===`summary`?`singleton`:i===`reads`||i===`content`?`reader`:i===`workspace`?`compute`:`writer`,workerOptions:i===`summary`||i===`workspace`?{resourceLimits:{maxOldGenerationSizeMb:i===`summary`?512:1024}}:void 0,idleTimeoutMs:i===`reads`?12e4:void 0,sharedCompute:i===`workspace`},i===`content`||i===`workspace`?{retainOneIdleWorker:!0}:void 0)}async function runGitWorkerOperation(e,t={}){let n=runtime();if(n.closing||n.pending.size>=128)throw new d(`Git operation capacity is unavailable; retry the request.`,`unavailable`);t.signal?.throwIfAborted(),t.assertCurrent?.();let r=t.transferList?.(e),i=r?structuredClone(e,{transfer:[...new Set(r)]}):structuredClone(e),a=i.type.startsWith(`github.profile-`)||i.type===`checkout.bootstrap-workspace`,o=a?{}:{...process.env};i.filesystemRefs=!a&&t.git===void 0&&!Object.entries(o).some(([e,t])=>t!==void 0&&(/^(GIT_DIR|GIT_WORK_TREE|GIT_COMMON_DIR|GIT_CEILING_DIRECTORIES|GIT_DISCOVERY_ACROSS_FILESYSTEM|GIT_NAMESPACE|GIT_SHALLOW_FILE|GIT_GRAFT_FILE|GIT_REPLACE_REF_BASE|GIT_NO_REPLACE_OBJECTS|GIT_INDEX_FILE|GIT_OBJECT_DIRECTORY|GIT_ALTERNATE_OBJECT_DIRECTORIES|GIT_CONFIG_PARAMETERS)$/i.test(e)||/^(HOME|XDG_CONFIG_HOME|GIT_CONFIG_GLOBAL|GIT_CONFIG_SYSTEM)$/i.test(e)&&/[\r\n]/u.test(t)))?I(`sha256`).update(JSON.stringify(Object.entries(o).filter(([e])=>/^(GIT_|HOME$|XDG_CONFIG_HOME$|PATH$|SUDO_UID$)/i.test(e)).toSorted(([e],[t])=>e.localeCompare(t)))).digest(`hex`):void 0;let s=executeOperation(n,i,o,{...t,git:t.git?{text:t.git.text,buffered:t.git.buffered}:void 0});return createPendingPromiseTracker(n.pending)(s)}async function executeOperation(e,t,n,r){let i=U.hasSubscribers?R.now():void 0,a=t.type===`checkout.diff`||t.type===`checkout.baseline`?t.input.cwd:t.type===`pull-request.branch-facts`||t.type===`pull-request.branch-comparison`?t.input.root:void 0,s=a!==void 0,c=t.type===`checkout.diff`&&t.input.summaryOnly===!0||t.type===`checkout.revision`&&t.input.scope===`diff`,l=t.type===`worktree.snapshot`||t.type===`worktree.snapshot-verify-exact`,u=s||l;l&&(n.GIT_NO_LAZY_FETCH=`1`,n.GIT_ALLOW_PROTOCOL=``);let d=0,h=0,v=0,b=0,S=0,w=0,E=null,O,k=a===void 0?void 0:p(`content-read`,H,()=>({operation:t.type,...t.type===`checkout.diff`?{scope:t.input.scope??`all`,summaryOnly:t.input.summaryOnly===!0}:{},checkoutId:I(`sha256`).update(N.resolve(a)).digest(`hex`).slice(0,16),checkoutClass:t.type===`pull-request.branch-facts`&&t.input.refreshIndex?`managed`:`unspecified`,gitCommandCount:d,workerQueueWaitMs:E,summedGitWallMs:Math.round(h),summedGitQueueWaitMs:Math.round(v),gitStdoutBytes:b,gitStderrBytes:S,gitTimeoutCount:w,slowestGitCommand:O})),A=!0,j=k||r.diffTiming,M=`threw`,L=/* @__PURE__ */ new Set,z=/* @__PURE__ */ new Set,B=/* @__PURE__ */ new Map,G,K=0,request=async(e,i)=>{try{i.throwIfAborted();let a=e,o,s=[];if(a.type===`git.text`||a.type===`git.buffer`){let e=j?R.now():0,execute=async()=>{let o=j?R.now():0,s=`threw`;k&&(d++,v+=o-e);try{let e=await f(W[t.type],async()=>{let e={...a.input.options,operation:W[t.type],baseEnv:n,signal:i,beforeRun:r.assertCurrent,killProcessTree:!0,lowerPriority:u};if(a.type===`git.text`){let t=await(r.git?.text??x)(a.input.cwd,a.input.args,e);if(t.cleanup===`uncertain`)throw new m;return t}let o=await(r.git?.buffered??y)(a.input.cwd,a.input.args,e);if(o.error&&(T(o.error)||g(o.error)?.cleanup===`uncertain`))throw o.error;return o});return k&&(s=e.termination,b+=e.stdout.byteLength,S+=e.stderr.byteLength,w+=Number(s===`timeout`)),e}finally{if(r.diffTiming){let e=r.diffTiming.durations;e[`git-wall`]=(e[`git-wall`]??0)+R.now()-o}if(k){let e=Math.round(R.now()-o);if(h+=e,!O||e>O.durationMs){let t=a.input.args,n=0;for(;n<t.length&&t[n].startsWith(`-`);)n+=t[n]===`-c`||t[n]===`-C`?2:1;let r=t[n]??``;O={command:/^(diff|ls-files|rev-parse|rev-list|merge-base|cat-file|symbolic-ref|for-each-ref|version|log|show|hash-object)$/.test(r)?r:`other`,...r===`diff`?{diffMode:t.includes(`--no-index`)?`--no-index`:t.slice(n+1).find(e=>/^(--shortstat|--raw|--patch|--name-status)$/.test(e))??`other`}:{},durationMs:e,termination:s}}}}},l=await(u?withContentGitSlot(execute,i,c):execute()),p=D(l.stdout),_=D(l.stderr);o={...l,stdout:p,stderr:_},s.push(p.buffer,_.buffer)}else if(a.type===`git.temporary-directory`){let e=await P.mkdtemp(N.join(F.tmpdir(),`openclaw-git-operation-`));z.add(e),o=e}else if(a.type===`workspace.inventory.write`){if(!r.onInventoryChunk)throw Error(`Workspace inventory has no active output owner`);r.assertCurrent?.(),await r.onInventoryChunk(a.input.bytes,{signal:i})}else if(a.type===`workspace.manifest.read`){if(!r.readWorkspaceManifest)throw Error(`Workspace manifest has no active read owner`);r.assertCurrent?.();let e=await r.readWorkspaceManifest(a.input.knownTreeRoot,{signal:i});o=e,s.push(e.buffer)}else{if(!r.onEffect)throw Error(`Git read operation requested a lifecycle effect`);r.assertCurrent?.(),o=await r.onEffect(a,{signal:i})}return{input:{ok:!0,value:o},transferList:[...new Set(s)],timeoutMs:V}}catch(e){T(e)?G??=e instanceof Error?e:new m({cause:e}):g(e)?.cleanup===`uncertain`&&(G??=new m({cause:e}));let t=++K;return B.set(t,e),{input:{ok:!1,error:{...C(e),origin:t}},timeoutMs:V}}},q=t.type===`github.profile-refresh`?createWorkerMutationAuthority(()=>r.assertCurrent?.(),r.signal):void 0;t.mutationAuthority=q?.buffer;try{let n=j?R.now():0,i=j?()=>{let e=R.now()-n;return E=Math.round(e),r.diffTiming&&(r.diffTiming.durations[`worker-queue`]=e),t}:t,a=await poolFor(e,t,s,c).run(i,{inputBytes:r.inputBytes,transferList:r.transferList,signal:r.signal,timeoutMs:V,onNotification:q?.onNotification??r.onNotification,onRequest:(e,t)=>{if(A&&(A=!1,k?.markPhase()),!o(e)||e.type!==`git.batch`||!o(e.input)||!Array.isArray(e.input.requests)||e.input.requests.length===0||e.input.requests.length>16)throw Error(`Invalid Git worker request batch`);let n=Promise.all(e.input.requests.map(e=>request(e,t.signal))).then(e=>({input:e.map(e=>e.input),transferList:[...new Set(e.flatMap(e=>e.transferList??[]))],timeoutMs:V}));return createPendingPromiseTracker(L)(n)}});if(k?.markPhase(),q?.throwIfRefused(),!a.ok)throw a.error.origin!==void 0&&B.has(a.error.origin)?B.get(a.error.origin):_(a.error);return r.signal?.throwIfAborted(),r.assertCurrent?.(),r.diffTiming&&(r.diffTiming.revisionUnavailableReason=a.revisionUnavailableReason),M=`returned`,a.value}catch(e){throw q?.throwIfRefused(),e}finally{q?.dispose();let e=!1;try{await Promise.allSettled(L).then(()=>{if(G)throw G;return Promise.all([...z].map(e=>P.rm(e,{recursive:!0,force:!0})))}),e=!0}finally{k?.finish(e?M:`threw`),i!==void 0&&U.publish({operation:t.type,outcome:e&&M===`returned`?`ok`:`error`,elapsedMs:R.now()-i})}}}function computationInputBytes(e){if(typeof e==`string`)return e.length*2;if(ArrayBuffer.isView(e))return e.byteLength;if(e instanceof Set){let t=64;for(let n of e)t+=computationInputBytes(n);return t}return e&&typeof e==`object`?Object.entries(e).reduce((e,[t,n])=>e+t.length*2+computationInputBytes(n),64):8}function transferableManifestInput(e){if(`payload`in e.input)return[e.input.payload.buffer];switch(e.type){case`workspace.manifest.paths`:case`workspace.manifest.parse`:return[e.input.raw.buffer];case`workspace.manifest.base-refresh`:return[e.input.baseRaw.buffer];case`workspace.manifest.equal`:case`workspace.manifest.pair`:return[e.input.baseRaw.buffer,e.input.currentRaw.buffer];case`workspace.manifest.stage-input`:return`publication`in e.input?[e.input.publication.metadata.buffer]:[e.input.baseManifestRaw.buffer,e.input.currentManifestRaw.buffer];default:return[]}}async function computeWorkspaceManifest(e,t,n){if(b()){let{executeWorkspaceManifestComputation:t}=await import(`./openclaw-state-read-workspace-manifest-computation.runtime-D1b_EAKI.mjs`);return await t(e)}return await runGitWorkerOperation(e,{signal:t,git:n,inputBytes:256+computationInputBytes(e.input),transferList:transferableManifestInput})}async function computeValue(e,t,n){return n?.throwIfAborted(),computeWorkspaceManifest({type:e,input:{payload:new TextEncoder().encode(JSON.stringify(t))}},n)}function captureHashes(e=!0){let t=w();return t&&e&&h(t.memo),{hashes:t?{owner:t.owner,entries:e?[...t.memo]:[]}:void 0,accept(e){if(t){for(let[n,r]of e.hashes)t.memo.set(n,r);h(t.memo),t.metrics&&(t.metrics.contentHashCount+=e.metrics.contentHashCount,t.metrics.memoHitCount+=e.metrics.memoHitCount)}return e.value}}}async function computeWorkspaceFileSnapshot(e,t,n){if(b()){let{readWorkspaceFileSnapshotWithLimit:r}=await import(`./openclaw-state-read-workspace-actual-manifest-oEZtzR3V.mjs`).then(e=>e.i);return await r(e,t,n)}let r=captureHashes(!1);return r.accept(await computeValue(`workspace.manifest.file`,{path:e,maxBytes:t,root:n,hashes:r.hashes}))}async function readWorkspaceNodes(e,t){let n=captureHashes();return new Map(n.accept(await computeValue(`workspace.manifest.nodes`,{root:e,paths:t,hashes:n.hashes})))}async function prepareWorkspaceTreeInput(e){if(b()){let{buildWorkspaceTreeInput:t}=await import(`./openclaw-state-read-workspace-result-preparation.runtime-8jbRtj8C.mjs`);return t(e)}return computeValue(`workspace.manifest.tree-input`,e)}async function prepareWorkspaceTemporaryDirectory(e,t){let n=await runWorkspaceFilesystemComputation({type:`workspace.reconcile.temporary`,input:{prefix:e}},t);return await P.mkdtemp(n)}async function runWorkspaceFilesystemComputation(e,t={}){try{var n=u();let r=await k(A([t.assertCurrent,t.workerAuthority?.assertCurrent]));n.a({[Symbol.asyncDispose]:async()=>await r.release?.()});let a=[.../* @__PURE__ */ new Set([...r.workspaceEvidence??[],...t.workerAuthority?.workspaceEvidence??[]])];if(`root`in e.input){let t=e.input.root,n=a.find(e=>e.workspaceDir===t);n||(n=await O(e.input.root),a.push(n)),e.input.root=n.canonical}let o=r.assertCurrent;o();let s=createWorkerMutationAuthority(o,t.workerAuthority?.signal);try{let n={...e,mutation:{decision:s.buffer,filesystem:a,stateOwnerPath:t.workerAuthority?.stateOwnerPath,nativeMode:i().mode}},r=await runGitWorkerOperation(n,{assertCurrent:o,signal:t.workerAuthority?.signal,onNotification:s.onNotification,inputBytes:256+computationInputBytes(e.input)+computationInputBytes(n.mutation),transferList:transferableManifestInput});return s.throwIfRefused(),r}catch(e){throw s.throwIfRefused(),e}finally{s.dispose()}}catch(e){n.e=e}finally{await n.d()}}var G=/* @__PURE__ */ e({absoluteEntryMatches:()=>absoluteEntryMatches,directoryContainsOnlyWorkspaceEntries:()=>directoryContainsOnlyWorkspaceEntries,localPath:()=>localPath,localWorkspaceNode:()=>localWorkspaceNode,readWorkspaceTreeFile:()=>readWorkspaceTreeFile,removeEmptyWorkspaceDirectory:()=>removeEmptyWorkspaceDirectory});function localPath(e,t){return N.join(e,...t.split(`/`))}async function removeEmptyWorkspaceDirectory(e,t){let n;try{n=await e.list(t)}catch(e){if(e instanceof r&&[`not-found`,`path-alias`].includes(e.code))return;throw e}if(!(n.length>0))try{await e.remove(t)}catch(n){if(n instanceof r&&[`not-found`,`path-alias`].includes(n.code)||(await e.list(t).catch(()=>void 0))?.length)return;throw n}}async function localWorkspaceNode(e,t){let n=localPath(e,t),r=await a(n);if(r)return r.isDirectory()&&!r.isSymbolicLink()?{path:t,type:`directory`}:r.isSymbolicLink()?{path:t,type:`symlink`,mode:511,target:await P.readlink(n)}:r.isFile()?{path:t,...await computeWorkspaceFileSnapshot(n,j,e)}:{path:t,type:`unsupported`}}async function fileEntryMatches(e,t){let n=await computeWorkspaceFileSnapshot(e,j).catch(e=>{if(e instanceof d)throw e});return n?.type===`file`&&n.mode===t.mode&&n.size===t.size&&n.sha256===t.sha256}async function absoluteEntryMatches(e,t){let n=await P.lstat(e).catch(()=>void 0);return n?t.type===`symlink`?n.isSymbolicLink()&&await P.readlink(e)===t.target:!n.isFile()||n.isSymbolicLink()?!1:await fileEntryMatches(e,t):!1}async function readWorkspaceTreeFile(e){let t=await M(e.repositoryRoot,[`--literal-pathspecs`,`ls-tree`,`-z`,`--full-tree`,e.tree,`--`,e.entry.path],{maxOutputBytes:1048576},`git ls-tree failed`),n=t.indexOf(0),r=t.indexOf(9);if(n!==t.byteLength-1||r<0||r>n)throw Error(`Cloud workspace recovery snapshot is missing: ${e.entry.path}`);let i=t.subarray(0,r).toString(`utf8`),a=/^100(?:644|755) blob ([a-f0-9]{40})$/u.exec(i),o=t.subarray(r+1,n);if(!a||!o.equals(Buffer.from(e.entry.path)))throw Error(`Cloud workspace recovery snapshot is invalid: ${e.entry.path}`);let s=await M(e.repositoryRoot,[`cat-file`,`blob`,a[1]],{maxOutputBytes:j+1});if(s.byteLength!==e.entry.size||I(`sha256`).update(s).digest(`hex`)!==e.entry.sha256)throw Error(`Cloud workspace recovery snapshot is invalid: ${e.entry.path}`);return s}async function directoryContainsOnlyWorkspaceEntries(e,t,n,r,i=!1){let a=!1;for(let o of await P.readdir(localPath(e,t))){let s=`${t}/${o}`;if(v(s))return!1;if(!S(s,await n(s),i)){let t=await P.lstat(localPath(e,s));if(t.isDirectory()&&!t.isSymbolicLink()){if(!await directoryContainsOnlyWorkspaceEntries(e,s,n,r?.directories.has(s)?r:void 0,i))return!1}else if(!r?.paths.has(s))return!1}a=!0}return r!==void 0||a}export{readWorkspaceTreeFile as a,computeWorkspaceManifest as c,readWorkspaceNodes as d,runWorkspaceFilesystemComputation as f,localWorkspaceNode as i,prepareWorkspaceTemporaryDirectory as l,directoryContainsOnlyWorkspaceEntries as n,removeEmptyWorkspaceDirectory as o,localPath as r,G as s,absoluteEntryMatches as t,prepareWorkspaceTreeInput as u};