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

Function loadPiSdk

apps/sim/executor/handlers/pi/local-backend.ts:43–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41let sdkPromise: Promise<PiSdk> | undefined
42
43function loadPiSdk(): Promise<PiSdk> {
44 if (!sdkPromise) {
45 // A static specifier (not a variable) is required so Next's dependency tracer
46 // copies the package + its transitive deps into the standalone Docker output,
47 // the same way `@e2b/code-interpreter` is handled. Clear the cache on failure
48 // so a transient import error doesn't permanently break later local runs.
49 sdkPromise = import('@earendil-works/pi-coding-agent').catch((error) => {
50 sdkPromise = undefined
51 throw error
52 })
53 }
54 return sdkPromise
55}
56
57function toPiTool(sdk: PiSdk, spec: PiToolSpec): ToolDefinition {
58 return sdk.defineTool({

Callers 1

runLocalPiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected