mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-15 21:05:51 +00:00
Phase 1: Replace @ant/computer-use-mcp stub (12 files, 6517 lines). Phase 2: Remove 8 macOS-only guards in src/: - main.tsx: remove getPlatform()==='macos' check - swiftLoader.ts: remove darwin-only throw - executor.ts: extend platform guard, clipboard dispatch, paste key - drainRunLoop.ts: skip CFRunLoop pump on non-darwin - escHotkey.ts: non-darwin returns false (Ctrl+C fallback) - hostAdapter.ts: non-darwin permissions granted - common.ts: dynamic platform + screenshotFiltering - gates.ts: enabled:true, subscription check removed Phase 3: Add Linux backends (xdotool/scrot/xrandr/wmctrl): - computer-use-input/backends/linux.ts (173 lines) - computer-use-swift/backends/linux.ts (278 lines) Verified on Windows x64: mouse, screenshot, displays, foreground app. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
#!/usr/bin/env bun
|
|
/**
|
|
* Dev entrypoint — launches cli.tsx with MACRO.* defines injected
|
|
* via Bun's -d flag (bunfig.toml [define] doesn't propagate to
|
|
* dynamically imported modules at runtime).
|
|
*/
|
|
import { getMacroDefines } from "./defines.ts";
|
|
|
|
const defines = getMacroDefines();
|
|
|
|
const defineArgs = Object.entries(defines).flatMap(([k, v]) => [
|
|
"-d",
|
|
`${k}:${v}`,
|
|
]);
|
|
|
|
// Bun --feature flags: enable feature() gates at runtime.
|
|
// Default features enabled in dev mode.
|
|
const DEFAULT_FEATURES = ["BUDDY", "TRANSCRIPT_CLASSIFIER", "BRIDGE_MODE", "AGENT_TRIGGERS_REMOTE", "CHICAGO_MCP"];
|
|
|
|
// Any env var matching FEATURE_<NAME>=1 will also enable that feature.
|
|
// e.g. FEATURE_PROACTIVE=1 bun run dev
|
|
const envFeatures = Object.entries(process.env)
|
|
.filter(([k]) => k.startsWith("FEATURE_"))
|
|
.map(([k]) => k.replace("FEATURE_", ""));
|
|
|
|
const allFeatures = [...new Set([...DEFAULT_FEATURES, ...envFeatures])];
|
|
const featureArgs = allFeatures.flatMap((name) => ["--feature", name]);
|
|
|
|
// If BUN_INSPECT is set, pass --inspect-wait to the child process
|
|
const inspectArgs = process.env.BUN_INSPECT
|
|
? ["--inspect-wait=" + process.env.BUN_INSPECT]
|
|
: [];
|
|
|
|
const result = Bun.spawnSync(
|
|
["bun", ...inspectArgs, "run", ...defineArgs, ...featureArgs, "src/entrypoints/cli.tsx", ...process.argv.slice(2)],
|
|
{ stdio: ["inherit", "inherit", "inherit"] },
|
|
);
|
|
|
|
process.exit(result.exitCode ?? 0);
|