@xortex/xcode 3.0.8 → 3.1.1

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 (57) hide show
  1. package/bin/xcode +33 -85
  2. package/bootstrap/state.ts +1758 -0
  3. package/context/QueuedMessageContext.tsx +63 -0
  4. package/context/fpsMetrics.tsx +30 -0
  5. package/context/mailbox.tsx +38 -0
  6. package/context/modalContext.tsx +58 -0
  7. package/context/notifications.tsx +240 -0
  8. package/context/overlayContext.tsx +151 -0
  9. package/context/promptOverlayContext.tsx +125 -0
  10. package/context/stats.tsx +220 -0
  11. package/context/voice.tsx +88 -0
  12. package/coordinator/coordinatorMode.ts +369 -0
  13. package/entrypoints/cli.tsx +1 -1
  14. package/ink.ts +85 -0
  15. package/interactiveHelpers.tsx +366 -0
  16. package/macro.ts +1 -1
  17. package/memdir/findRelevantMemories.ts +141 -0
  18. package/memdir/memdir.ts +511 -0
  19. package/memdir/memoryAge.ts +53 -0
  20. package/memdir/memoryScan.ts +94 -0
  21. package/memdir/memoryTypes.ts +271 -0
  22. package/memdir/paths.ts +291 -0
  23. package/memdir/teamMemPaths.ts +292 -0
  24. package/memdir/teamMemPrompts.ts +100 -0
  25. package/package.json +42 -28
  26. package/query/config.ts +46 -0
  27. package/query/deps.ts +40 -0
  28. package/query/stopHooks.ts +470 -0
  29. package/query/tokenBudget.ts +93 -0
  30. package/schemas/hooks.ts +222 -0
  31. package/screens/Doctor.tsx +575 -0
  32. package/screens/REPL.tsx +7107 -0
  33. package/screens/ResumeConversation.tsx +399 -0
  34. package/scripts/postinstall.js +90 -0
  35. package/setup.ts +477 -0
  36. package/tasks.ts +39 -0
  37. package/tools.ts +396 -0
  38. package/upstreamproxy/relay.ts +455 -0
  39. package/upstreamproxy/upstreamproxy.ts +285 -0
  40. package/voice/voiceModeEnabled.ts +54 -0
  41. package/inspect.js +0 -7
  42. package/patch-box.js +0 -54
  43. package/patch-compact.js +0 -13
  44. package/patch-condensed-center.js +0 -13
  45. package/patch-condensed-row.js +0 -13
  46. package/patch-condensed.js +0 -13
  47. package/patch-final.js +0 -58
  48. package/patch-input-body.js +0 -46
  49. package/patch-input-body2.js +0 -35
  50. package/patch-input-style.js +0 -13
  51. package/patch-input-width.js +0 -13
  52. package/patch-layout.js +0 -87
  53. package/patch-logo-row.js +0 -12
  54. package/patch-width.js +0 -13
  55. package/patch-width2.js +0 -13
  56. package/patch2.js +0 -74
  57. package/patch3.js +0 -13
package/bin/xcode CHANGED
@@ -1,14 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * XCode CLI Entry Point
4
- *
5
- * This codebase is built for Bun (bun.sh). If Bun is not installed,
6
- * this script installs it automatically, then hands off to Bun.
7
- *
8
4
  * Installed via: npm install -g @xortex/xcode
5
+ *
6
+ * Bun is installed as part of npm postinstall.
7
+ * This launcher finds Bun and runs the app with it.
9
8
  */
10
9
 
11
- const { execSync, spawnSync } = require('child_process');
10
+ const { execSync } = require('child_process');
12
11
  const { spawn } = require('child_process');
13
12
  const path = require('path');
14
13
  const fs = require('fs');
@@ -17,81 +16,26 @@ const os = require('os');
17
16
  const projectRoot = path.resolve(__dirname, '..');
18
17
  const mainScript = path.join(projectRoot, 'entrypoints', 'cli.tsx');
19
18
 
20
- // ── helpers ──────────────────────────────────────────────────────────────────
19
+ // ── find Bun ──────────────────────────────────────────────────────────────────
21
20
 
22
- function tryExec(cmd) {
23
- try { execSync(cmd, { stdio: 'ignore' }); return true; } catch { return false; }
24
- }
21
+ function findBun() {
22
+ // 1. Check PATH
23
+ try {
24
+ const p = execSync('which bun', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim();
25
+ if (p && fs.existsSync(p)) return p;
26
+ } catch {}
25
27
 
26
- function bunBinPath() {
27
- // Common Bun install locations
28
+ // 2. Common install locations
28
29
  const candidates = [
29
30
  path.join(os.homedir(), '.bun', 'bin', 'bun'),
30
31
  '/usr/local/bin/bun',
31
32
  '/usr/bin/bun',
33
+ 'C:\\Users\\' + (process.env.USERNAME || '') + '\\.bun\\bin\\bun.exe',
32
34
  ];
33
35
  for (const c of candidates) {
34
36
  if (fs.existsSync(c)) return c;
35
37
  }
36
- // Try PATH
37
- try {
38
- return execSync('which bun', { encoding: 'utf8' }).trim();
39
- } catch {
40
- return null;
41
- }
42
- }
43
-
44
- function installBun() {
45
- console.log('');
46
- console.log('📦 XCode requires Bun runtime. Installing Bun now...');
47
- console.log(' (This is a one-time setup)');
48
- console.log('');
49
-
50
- const platform = os.platform();
51
-
52
- try {
53
- if (platform === 'win32') {
54
- execSync('powershell -c "irm bun.sh/install.ps1 | iex"', { stdio: 'inherit' });
55
- } else {
56
- // curl or wget
57
- if (tryExec('which curl')) {
58
- execSync('curl -fsSL https://bun.sh/install | bash', {
59
- stdio: 'inherit',
60
- shell: '/bin/bash',
61
- });
62
- } else if (tryExec('which wget')) {
63
- execSync('wget -qO- https://bun.sh/install | bash', {
64
- stdio: 'inherit',
65
- shell: '/bin/bash',
66
- });
67
- } else {
68
- throw new Error('Neither curl nor wget is available');
69
- }
70
- }
71
-
72
- console.log('');
73
- console.log('✅ Bun installed successfully!');
74
- console.log('');
75
-
76
- // Re-source PATH
77
- const bunBin = bunBinPath();
78
- if (bunBin) return bunBin;
79
-
80
- // Add ~/.bun/bin to PATH for this process
81
- const bunBinDir = path.join(os.homedir(), '.bun', 'bin');
82
- process.env.PATH = `${bunBinDir}${path.delimiter}${process.env.PATH}`;
83
- return path.join(bunBinDir, 'bun');
84
-
85
- } catch (err) {
86
- console.error('');
87
- console.error('❌ Could not auto-install Bun. Please install it manually:');
88
- console.error('');
89
- console.error(' curl -fsSL https://bun.sh/install | bash');
90
- console.error('');
91
- console.error(' Then run: xcode');
92
- console.error('');
93
- process.exit(1);
94
- }
38
+ return null;
95
39
  }
96
40
 
97
41
  // ── CLI flags ─────────────────────────────────────────────────────────────────
@@ -102,7 +46,7 @@ process.env.NODE_ENV = process.env.NODE_ENV || 'production';
102
46
  const args = process.argv.slice(2);
103
47
 
104
48
  if (args[0] === '--version' || args[0] === '-v' || args[0] === '-V') {
105
- console.log('xcode v3.0.8 — AI coding assistant with XMem memory');
49
+ console.log('xcode v3.1.1 — AI coding assistant with XMem memory');
106
50
  process.exit(0);
107
51
  }
108
52
 
@@ -114,14 +58,14 @@ Usage: xcode [options]
114
58
 
115
59
  Options:
116
60
  -v, --version Show version
117
- -h, --help Show this help
118
- --model <name> Choose model: gemini-2.5-pro, kimi-k2.5, deepseek-v3.2
119
- --openrouter Force OpenRouter as provider
61
+ -h, --help Show help
62
+ --model <name> Model: gemini-2.5-pro, kimi-k2.5, deepseek-v3.2, sonnet, opus
63
+ --openrouter Use OpenRouter provider
120
64
 
121
65
  Environment:
122
66
  ANTHROPIC_API_KEY Anthropic API key (for Claude models)
123
67
  OPENROUTER_API_KEY OpenRouter API key (optional, default provided)
124
- XMEM_API_URL XMem server URL (default: http://localhost:8000)
68
+ XMEM_API_URL XMem memory server URL (default: http://localhost:8000)
125
69
  `);
126
70
  process.exit(0);
127
71
  }
@@ -132,7 +76,7 @@ if (modelIdx !== -1 && args[modelIdx + 1]) {
132
76
  const model = args[modelIdx + 1];
133
77
  process.env.ANTHROPIC_MODEL = model;
134
78
  const orModels = ['kimi', 'deepseek', 'gemini', 'moonshot', 'google/'];
135
- if (orModels.some(m => model.toLowerCase().includes(m.toLowerCase()))) {
79
+ if (orModels.some(m => model.toLowerCase().includes(m))) {
136
80
  process.env.CLAUDE_CODE_USE_OPENROUTER = 'true';
137
81
  }
138
82
  }
@@ -140,11 +84,20 @@ if (args.includes('--openrouter')) {
140
84
  process.env.CLAUDE_CODE_USE_OPENROUTER = 'true';
141
85
  }
142
86
 
143
- // ── find / install Bun, then run ──────────────────────────────────────────────
87
+ // ── launch with Bun ───────────────────────────────────────────────────────────
88
+
89
+ const bun = findBun();
144
90
 
145
- let bun = bunBinPath();
146
91
  if (!bun) {
147
- bun = installBun();
92
+ console.error('');
93
+ console.error('❌ Bun runtime not found.');
94
+ console.error('');
95
+ console.error(' Please install Bun and try again:');
96
+ console.error(' curl -fsSL https://bun.sh/install | bash');
97
+ console.error('');
98
+ console.error(' Then restart your terminal and run: xcode');
99
+ console.error('');
100
+ process.exit(1);
148
101
  }
149
102
 
150
103
  const child = spawn(bun, ['run', mainScript, ...args], {
@@ -155,11 +108,6 @@ const child = spawn(bun, ['run', mainScript, ...args], {
155
108
 
156
109
  child.on('exit', code => process.exit(code ?? 0));
157
110
  child.on('error', err => {
158
- if (err.code === 'ENOENT') {
159
- console.error('\n❌ Bun not found at: ' + bun);
160
- console.error('Please run: curl -fsSL https://bun.sh/install | bash && xcode');
161
- } else {
162
- console.error('\n❌ Failed to start XCode:', err.message);
163
- }
111
+ console.error('\n❌ Failed to start XCode:', err.message);
164
112
  process.exit(1);
165
113
  });