subagent-cli 0.2.9 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/_entry.ts +2 -0
  2. package/dist/cli.cjs +30 -34
  3. package/package.json +6 -5
  4. package/src/commands/agents-platform/index.ts +1 -0
  5. package/src/commands/assistant/index.ts +1 -0
  6. package/src/commands/force-snip.ts +1 -0
  7. package/src/commands/proactive.ts +1 -0
  8. package/src/commands/remoteControlServer/index.ts +1 -0
  9. package/src/commands/subscribe-pr.ts +1 -0
  10. package/src/commands/torch.ts +1 -0
  11. package/src/hunter.ts +1 -0
  12. package/src/proactive/index.ts +1 -2
  13. package/src/proactive/useProactive.ts +1 -0
  14. package/src/services/autoDream/dream.ts +1 -0
  15. package/src/services/compact/snipCompact.ts +1 -2
  16. package/src/skills/bundled/dream.ts +1 -0
  17. package/src/skills/bundled/hunter.ts +1 -0
  18. package/src/skills/bundled/runSkillGenerator.ts +1 -0
  19. package/src/tools/CtxInspectTool/CtxInspectTool.ts +1 -0
  20. package/src/tools/ListPeersTool/ListPeersTool.ts +1 -0
  21. package/src/tools/PushNotificationTool/PushNotificationTool.ts +1 -0
  22. package/src/tools/REPLTool/REPLTool.ts +1 -0
  23. package/src/tools/SendUserFileTool/SendUserFileTool.ts +1 -0
  24. package/src/tools/SleepTool/SleepTool.ts +1 -0
  25. package/src/tools/SnipTool/SnipTool.ts +1 -0
  26. package/src/tools/SubscribePRTool/SubscribePRTool.ts +1 -0
  27. package/src/tools/SuggestBackgroundPRTool/SuggestBackgroundPRTool.ts +1 -0
  28. package/src/tools/TerminalCaptureTool/TerminalCaptureTool.ts +1 -0
  29. package/src/tools/VerifyPlanExecutionTool/VerifyPlanExecutionTool.ts +1 -0
  30. package/src/tools/WebBrowserTool/WebBrowserTool.ts +1 -0
  31. package/src/tools/WorkflowTool/bundled/index.ts +1 -0
  32. package/src/utils/permissions/yolo-classifier-prompts/auto_mode_system_prompt.txt +1 -0
  33. package/src/utils/permissions/yolo-classifier-prompts/permissions_anthropic.txt +1 -0
  34. package/src/utils/permissions/yolo-classifier-prompts/permissions_external.txt +1 -0
  35. package/stubs/@ant/claude-for-chrome-mcp/index.js +1 -4
  36. package/stubs/@ant/computer-use-mcp/index.js +1 -5
  37. package/stubs/@ant/computer-use-mcp/index.ts +1 -5
  38. package/stubs/@anthropic-ai/sandbox-runtime/index.js +4 -42
  39. package/bin/sa.js +0 -4
package/_entry.ts ADDED
@@ -0,0 +1,2 @@
1
+ import './stubs/globals.ts'
2
+ import './src/entrypoints/cli.tsx'
package/dist/cli.cjs CHANGED
@@ -1,48 +1,44 @@
1
1
  #!/usr/bin/env node
2
- const { spawn, execFileSync } = require('child_process');
2
+ // Morph Code launcher builds and caches binary on first run
3
+ const { spawnSync, execSync } = require('child_process');
3
4
  const path = require('path');
4
5
  const fs = require('fs');
5
6
 
6
7
  const libDir = path.resolve(__dirname, '..');
7
- const entry = path.join(libDir, 'src', 'entrypoints', 'cli.tsx');
8
- const preload = path.join(libDir, 'stubs', 'globals.ts');
8
+ const binary = path.join(__dirname, 'sa');
9
+ const entry = path.join(libDir, '_entry.ts');
9
10
 
10
- // Ensure src symlink for path alias resolution
11
- const symlinkPath = path.join(libDir, 'node_modules', 'src');
12
- try {
13
- if (!fs.existsSync(symlinkPath)) {
14
- fs.mkdirSync(path.join(libDir, 'node_modules'), { recursive: true });
15
- fs.symlinkSync(path.join(libDir, 'src'), symlinkPath);
16
- }
17
- } catch {}
11
+ // If binary exists and is newer than _entry.ts, run it directly
12
+ if (fs.existsSync(binary)) {
13
+ const r = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit', cwd: process.cwd(), env: process.env });
14
+ process.exit(r.status ?? 0);
15
+ }
18
16
 
19
- // Find bun
20
- let bunPath;
21
- try {
22
- bunPath = execFileSync('which', ['bun'], { encoding: 'utf-8' }).trim();
23
- } catch {
24
- const home = process.env.HOME || '';
25
- for (const p of [home + '/.bun/bin/bun', '/usr/local/bin/bun']) {
26
- if (fs.existsSync(p)) { bunPath = p; break; }
27
- }
28
- if (!bunPath) {
29
- console.error('Error: Morph Code requires Bun. Install: curl -fsSL https://bun.sh/install | bash');
17
+ // No binary — build it (first run after install)
18
+ let bun = process.env.HOME + '/.bun/bin/bun';
19
+ if (!fs.existsSync(bun)) {
20
+ try { bun = execSync('which bun', { encoding: 'utf-8' }).trim(); } catch {
21
+ console.error('Morph Code requires Bun. Install: curl -fsSL https://bun.sh/install | bash');
30
22
  process.exit(1);
31
23
  }
32
24
  }
33
25
 
34
- // Spawn bun with full TTY pass-through
35
- const child = spawn(bunPath, ['run', '--preload', preload, entry, ...process.argv.slice(2)], {
36
- stdio: 'inherit',
37
- cwd: process.cwd(),
38
- env: process.env,
26
+ console.error('Building Morph Code binary (first run only)...');
27
+ const buildResult = spawnSync(bun, ['build', '--compile', entry, '--outfile', binary, '--target', 'bun'], {
28
+ stdio: 'inherit', cwd: libDir, env: process.env,
39
29
  });
40
30
 
41
- // Forward signals
42
- process.on('SIGINT', () => child.kill('SIGINT'));
43
- process.on('SIGTERM', () => child.kill('SIGTERM'));
31
+ if (buildResult.status !== 0) {
32
+ // Build failed — fall back to running from source
33
+ console.error('Binary build failed, running from source...');
34
+ const preload = path.join(libDir, 'stubs', 'globals.ts');
35
+ const src = path.join(libDir, 'src', 'entrypoints', 'cli.tsx');
36
+ const r = spawnSync(bun, ['run', '--preload', preload, src, ...process.argv.slice(2)], {
37
+ stdio: 'inherit', cwd: process.cwd(), env: process.env,
38
+ });
39
+ process.exit(r.status ?? 0);
40
+ }
44
41
 
45
- child.on('exit', (code, signal) => {
46
- if (signal) process.kill(process.pid, signal);
47
- else process.exit(code ?? 0);
48
- });
42
+ // Run the freshly built binary
43
+ const r = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit', cwd: process.cwd(), env: process.env });
44
+ process.exit(r.status ?? 0);
package/package.json CHANGED
@@ -1,21 +1,22 @@
1
1
  {
2
2
  "name": "subagent-cli",
3
- "version": "0.2.9",
3
+ "version": "0.3.0",
4
4
  "description": "sa — Morph Code CLI (Claude Code fork with multi-provider LLM, WarpGrep, and subagent support)",
5
5
  "type": "module",
6
6
  "bin": {
7
- "sa": "./bin/sa.js"
7
+ "sa": "./dist/cli.js"
8
8
  },
9
9
  "files": [
10
- "bin",
10
+ "dist/cli.js",
11
+ "dist/cli.cjs",
11
12
  "src",
12
13
  "stubs",
14
+ "_entry.ts",
13
15
  "bunfig.toml",
14
- "dist",
15
16
  "tsconfig.json"
16
17
  ],
17
18
  "scripts": {
18
- "build": "tsup src/main.tsx --format esm --dts --target node20",
19
+ "build": "bun build --compile _entry.ts --outfile dist/sa --target bun",
19
20
  "dev": "tsx src/main.tsx",
20
21
  "typecheck": "tsc --noEmit",
21
22
  "test": "vitest --run",
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
package/src/hunter.ts ADDED
@@ -0,0 +1 @@
1
+ export default null
@@ -1,2 +1 @@
1
- // Auto-generated stub
2
- export {}
1
+ export default null
@@ -0,0 +1 @@
1
+ export function useProactive() { return null }; export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -1,2 +1 @@
1
- // Auto-generated stub
2
- export {}
1
+ export default null
@@ -0,0 +1 @@
1
+ export function registerdreamSkill() {}; export default null
@@ -0,0 +1 @@
1
+ export function registerhunterSkill() {}; export default null
@@ -0,0 +1 @@
1
+ export function registerrunSkillGeneratorSkill() {}; export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -0,0 +1 @@
1
+ export default null
@@ -1,4 +1 @@
1
- // Stub for @ant/claude-for-chrome-mcp
2
- export const BROWSER_TOOLS = []
3
- export async function runClaudeInChromeMcpServer() {}
4
- export function createChromeToolServer() { return null }
1
+ export function createClaudeForChromeMcpServer(){return null};export const BROWSER_TOOLS=[];export default{}
@@ -1,5 +1 @@
1
- // Stub for @ant/computer-use-mcp
2
- export function bindSessionContext() { return {} }
3
- export function buildComputerUseTools() { return [] }
4
- export function createComputerUseMcpServer() { return null }
5
- export async function runComputerUseMcpServer() {}
1
+ export const API_RESIZE_PARAMS={};export function targetImageSize(){return{width:0,height:0}};export function bindSessionContext(){return null};export function buildComputerUseTools(){return[]};export function createComputerUseMcpServer(){return null};export const DEFAULT_GRANT_FLAGS={};export function getSentinelCategory(){return null};export default{}
@@ -1,5 +1 @@
1
- // Stub for @ant/computer-use-mcp
2
- export function bindSessionContext(..._args: any[]) { return {} }
3
- export function buildComputerUseTools(..._args: any[]) { return [] }
4
- export function createComputerUseMcpServer(..._args: any[]) { return null }
5
- export async function runComputerUseMcpServer() {}
1
+ export const API_RESIZE_PARAMS = {}; export function targetImageSize() { return {width:0,height:0} }; export default {}
@@ -1,42 +1,4 @@
1
- // Stub for @anthropic-ai/sandbox-runtime
2
- export class SandboxManager {
3
- constructor() {}
4
- async start() {}
5
- async stop() {}
6
- static isSupportedPlatform() { return false }
7
- static checkDependencies() { return { errors: ['sandbox-runtime stub'] } }
8
- static wrapWithSandbox(...args) { return args[0] }
9
- static async initialize() {}
10
- static updateConfig() {}
11
- static async reset() {}
12
- static getFsReadConfig() { return {} }
13
- static getFsWriteConfig() { return {} }
14
- static getNetworkRestrictionConfig() { return {} }
15
- static getIgnoreViolations() { return {} }
16
- static getAllowUnixSockets() { return false }
17
- static getAllowLocalBinding() { return false }
18
- static getEnableWeakerNestedSandbox() { return false }
19
- static getProxyPort() { return null }
20
- static getSocksProxyPort() { return null }
21
- static getLinuxHttpSocketPath() { return null }
22
- static getLinuxSocksSocketPath() { return null }
23
- static async waitForNetworkInitialization() {}
24
- static getSandboxViolationStore() {
25
- return {
26
- getViolations() { return [] },
27
- subscribe(cb) { return () => {} },
28
- getTotalCount() { return 0 },
29
- }
30
- }
31
- static annotateStderrWithSandboxFailures(_cmd, stderr) { return stderr }
32
- static cleanupAfterCommand() {}
33
- static getLinuxGlobPatternWarnings() { return [] }
34
- static refreshConfig() {}
35
- }
36
- export const SandboxRuntimeConfigSchema = {}
37
- export class SandboxViolationStore {
38
- constructor() {}
39
- getViolations() { return [] }
40
- subscribe(cb) { return () => {} }
41
- getTotalCount() { return 0 }
42
- }
1
+ export class SandboxManager{static isSupportedPlatform(){return false};static checkDependencies(){return{errors:['stub']}};static wrapWithSandbox(...a){return a[0]};static async initialize(){};static updateConfig(){};static async reset(){};static getFsReadConfig(){return{}};static getFsWriteConfig(){return{}};static getNetworkRestrictionConfig(){return{}};static getIgnoreViolations(){return{}};static getAllowUnixSockets(){return false};static getAllowLocalBinding(){return false};static getEnableWeakerNestedSandbox(){return false};static getProxyPort(){return null};static getSocksProxyPort(){return null};static getLinuxHttpSocketPath(){return null};static getLinuxSocksSocketPath(){return null};static async waitForNetworkInitialization(){};static getSandboxViolationStore(){return{getViolations(){return[]},subscribe(){return()=>{}},getTotalCount(){return 0}}};static annotateStderrWithSandboxFailures(c,s){return s};static cleanupAfterCommand(){};static getLinuxGlobPatternWarnings(){return[]};static refreshConfig(){}}
2
+ export const SandboxRuntimeConfigSchema={}
3
+ export class SandboxViolationStore{getViolations(){return[]};subscribe(){return()=>{}};getTotalCount(){return 0}}
4
+ export default{}
package/bin/sa.js DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env bun
2
- // Morph Code CLI launcher — runs the Claude Code fork via Bun
3
- import '../stubs/globals.ts'
4
- import '../src/entrypoints/cli.tsx'