Lines 1-26javascript
2// Sandbox launcher for `container run`. Self-contained: only node:* builtins,
3// no imports from common.ts/ghapp.ts, so this single compiled file can be
4// copied to ~/.unclaude/share/sbx.js and run standalone by the `sbx`
5// wrapper (see common.ts:sbxWrapperContent). Replaces the old generated bash
6// script (see docs/image-paste.md §10 for why).
7import { spawn, spawnSync, execFileSync } from 'node:child_process';
8import { createServer } from 'node:http';
HighChild Process
Package source references child process execution.
dist/sbx.jsView on unpkg · L6 9import crypto from 'node:crypto';
10import { existsSync, mkdtempSync, writeFileSync, readFileSync, rmSync, unlinkSync, chmodSync, } from 'node:fs';
11import { homedir, tmpdir } from 'node:os';
12import { basename, join } from 'node:path';
13const HOME = homedir();
14const UNCLAUDE_DIR = join(HOME, '.unclaude');
15const SHARE_DIR = join(UNCLAUDE_DIR, 'share');
16const CACHE_DIR = join(HOME, '.cache', 'unclaude');
17const GH_APPS_DIR = join(UNCLAUDE_DIR, 'github-apps');
18function ghAppConfigPath(owner) {
19 const p = join(GH_APPS_DIR, `${owner}.json`);
20 return existsSync(p) ? p : null;
22const GH_APP_KEYCHAIN = 'unclaude-container-github-app';
23const CLIP_BRIDGE_LABEL = 'com.unclaude.clipbridge';
24const CLIP_BRIDGE_PLIST = join(HOME, 'Library', 'LaunchAgents', `${CLIP_BRIDGE_LABEL}.plist`);
25function runOut(cmd, args = []) {
26 const r = spawnSync(cmd, args, { encoding: 'utf8' });
MediumInstall Persistence
Source writes installer persistence such as shell profile or service configuration.
dist/sbx.jsView on unpkg · L6