fix(KB-140): fix standalone CLI native asset packaging for terminal support

- Stage node-pty native assets (pty.node, spawn-helper) alongside compiled binary

- Add runtime native-patch.ts to resolve native assets in Bun-compiled binaries

- Fix eager native module loading crash for non-terminal commands

- Enable terminal functionality in isolated standalone deployments

- Update release workflows and add STANDALONE.md documentation
This commit is contained in:
gsxdsm
2026-03-30 23:32:30 -07:00
parent 748f9440b9
commit 3c87514f95
13 changed files with 458 additions and 43 deletions

View File

@@ -126,4 +126,27 @@ Prebuilt standalone binaries are available that require no Node.js runtime. You
bun run build.ts
```
### Runtime Assets
When using standalone binaries, the dashboard's integrated terminal requires native platform assets that must be co-located with the binary:
```
dist/
├── kb # Binary (or kb-darwin-arm64, kb-linux-x64, etc.)
├── client/ # Dashboard web assets (required)
└── runtime/ # Native terminal assets (required for terminal)
└── darwin-arm64/ # Platform-specific subdirectory
├── pty.node # Native PTY module
└── spawn-helper # Unix spawn helper (macOS/Linux only)
```
**Platform-specific subdirectories:**
- `darwin-arm64/` - macOS Apple Silicon
- `darwin-x64/` - macOS Intel
- `linux-arm64/` - Linux ARM64
- `linux-x64/` - Linux x64
- `win32-x64/` - Windows x64
**Important:** When distributing or moving the binary, ensure the `client/` and `runtime/` directories are copied alongside it. Terminal functionality will be unavailable if runtime assets are missing.
See the [GitHub repository](https://github.com/dustinbyrne/kb) for platform-specific binaries and build instructions.