Files
oh-my-claudecode/scripts/build-runtime-cli.mjs
Bellman 09817cbb3b fix: ship complete plugin runtime closure (#3479)
* fix: ship complete plugin runtime closure

* fix: refresh plugin runtime closure after dev merge

* test: combine package closure regressions after dev merge

* test: extract full package for runtime closure parity

* fix(ci): fail closed on generated PR artifacts

* test(workflow): accept fail-closed transcript race

* fix(session-end): bound deferred recovery

* fix(session-end): close recovery edge cases

* fix(session-end): terminalize exhausted recovery

* fix(session-end): release detached action handles

* fix(plugin): verify complete package closure

* fix(session-end): recover sealed wiki interleaving

* fix(plugin): ship complete declaration closure

* test(session-end): tolerate detached teardown lag

* test(session-end): wait for detached shutdown

* fix(session-end): preserve OpenClaw routing context

* fix(shipping): bind generated trust and recovery routing

* chore(shipping): remove unreachable generated extras

* fix(shipping): support exact generated deletions
2026-07-19 01:01:02 +09:00

38 lines
1.1 KiB
JavaScript

#!/usr/bin/env node
import * as esbuild from 'esbuild';
import { mkdir } from 'fs/promises';
const outfile = 'bridge/runtime-cli.cjs';
await mkdir('bridge', { recursive: true });
const watchMode = process.argv.includes('--watch');
const buildConfig = {
entryPoints: ['src/team/runtime-cli.ts'],
bundle: true,
preserveSymlinks: true,
platform: 'node',
target: 'node18',
format: 'cjs',
outfile,
// Note: platform:'node' auto-externalizes all Node built-in subpaths (fs/promises, etc.)
external: [
'fs', 'fs/promises', 'path', 'os', 'util', 'stream', 'events',
'buffer', 'crypto', 'http', 'https', 'url',
'child_process', 'assert', 'module', 'net', 'tls',
'dns', 'readline', 'tty', 'worker_threads',
'@ast-grep/napi', 'better-sqlite3',
// jsonc-parser has dynamic requires that don't bundle well; we use a custom parser
'jsonc-parser',
],
};
if (watchMode) {
const ctx = await esbuild.context(buildConfig);
await ctx.watch();
console.error(`Watching ${outfile}...`);
} else {
await esbuild.build(buildConfig);
console.error(`Built ${outfile}`);
}