MCPcopy Index your code
hub / github.com/simstudioai/sim / resolveLazyPath

Method resolveLazyPath

apps/sim/lib/copilot/vfs/workspace-vfs.ts:446–465  ·  view source on GitHub ↗

* Resolve a single lazy artifact into files. Idempotent: once resolved * the entry moves to `files` and the loader is dropped. A loader that returns * null (no data) leaves nothing behind, so the path reads as "not found".

(path: string)

Source from the content-addressed store, hash-verified

444 * null (no data) leaves nothing behind, so the path reads as "not found".
445 */
446 private async resolveLazyPath(path: string): Promise<string | null> {
447 const existing = this.files.get(path)
448 if (existing !== undefined) return existing
449 const loader = this.lazy.get(path)
450 if (!loader) return null
451 this.lazy.delete(path)
452 let content: string | null = null
453 try {
454 content = await loader()
455 } catch (err) {
456 logger.warn('Failed to resolve lazy VFS artifact', {
457 workspaceId: this._workspaceId,
458 path,
459 error: toError(err).message,
460 })
461 content = null
462 }
463 if (content !== null) this.files.set(path, content)
464 return content
465 }
466
467 /**
468 * Resolve every lazy artifact a grep over `scope` will scan, in parallel. An

Callers 2

readMethod · 0.95

Calls 5

toErrorFunction · 0.90
getMethod · 0.65
deleteMethod · 0.65
warnMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected