Repository navigation
perf(2a): pi SDK snapshot bundle (one snapshottable IIFE) - #1525
Merged
NathanFlurry merged 1 commit intoJun 25, 2026
Merged
NathanFlurry merged 1 commit into
NathanFlurry merged 1 commit into
Conversation
Member
Author
|
Stack for rivet-dev/agentos
Get stack: |
This was referenced Jun 25, 2026
railway-app
Bot
temporarily deployed
to
rivet-frontend / agentos-pr-1525
June 25, 2026 01:43
Destroyed
|
🚅 Deployed to the agentos-pr-1525 environment in agentos
🚅 Deployed to the agentos-pr-1525 environment in rivet-frontend
|
esbuild bundles the lean pi-SDK graph (the 13 exports loadPiSdkRuntime needs) into a single IIFE, dist/pi-sdk-snapshot.js, that publishes globalThis.__PI_SDK_RUNTIME__. - src/snapshot-entry.ts: imports the SDK exports, assigns the runtime global. - scripts/build-snapshot-bundle.mjs: format:iife, platform:node (node builtins external), deep-import plugin to bypass the package exports map (avoids the ~100MB TUI graph the adapter skips), provider SDKs kept lazy/external, sha256 sidecar for dep-keying. C0 mitigations baked in: import.meta.url pinned to projected guest path; clipboard native-addon require made unreachable (DISPLAY=''). - package.json build chains build:snapshot; tsconfig excludes the esbuild-only entry. Validated (host, CJS harness): 13/13 exports populate, ~201ms eval, 880 modules inlined, 7.6MB. Traced top-level fs footprint = 2 deterministic package.json reads only (no net/ sockets/timers/native addons/per-session config). Artifact (dist) is gitignored. Step 2a of the agent-SDK snapshot goal. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
NathanFlurry
force-pushed
the
stack/perf-2a-pi-sdk-snapshot-bundle-one-snapshottable-iife-swtnlxlr
branch
from
June 25, 2026 08:11
b51b360 to
0edfda0
Compare
railway-app
Bot
temporarily deployed
to
rivet-frontend / agentos-pr-1525
June 25, 2026 08:11
Destroyed
NathanFlurry
deleted the
stack/perf-2a-pi-sdk-snapshot-bundle-one-snapshottable-iife-swtnlxlr
branch
June 25, 2026 08:12
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
esbuild bundles the lean pi-SDK graph (the 13 exports loadPiSdkRuntime needs) into a
single IIFE, dist/pi-sdk-snapshot.js, that publishes globalThis.PI_SDK_RUNTIME.
deep-import plugin to bypass the package exports map (avoids the ~100MB TUI graph the
adapter skips), provider SDKs kept lazy/external, sha256 sidecar for dep-keying.
C0 mitigations baked in: import.meta.url pinned to projected guest path; clipboard
native-addon require made unreachable (DISPLAY='').
Validated (host, CJS harness): 13/13 exports populate, ~201ms eval, 880 modules inlined,
7.6MB. Traced top-level fs footprint = 2 deterministic package.json reads only (no net/
sockets/timers/native addons/per-session config). Artifact (dist) is gitignored.
Step 2a of the agent-SDK snapshot goal.