@xortex/xcode 3.0.8 → 3.1.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.
- package/INSTALLATION.md +285 -0
- package/QUICKSTART.md +151 -0
- package/SYSTEM_PROMPT.md +583 -0
- package/SYSTEM_PROMPT_EXTRACTED.md +1 -0
- package/Untitled +1 -0
- package/bin/xcode +33 -85
- package/bootstrap/state.ts +1758 -0
- package/bun.lock +645 -0
- package/context/QueuedMessageContext.tsx +63 -0
- package/context/fpsMetrics.tsx +30 -0
- package/context/mailbox.tsx +38 -0
- package/context/modalContext.tsx +58 -0
- package/context/notifications.tsx +240 -0
- package/context/overlayContext.tsx +151 -0
- package/context/promptOverlayContext.tsx +125 -0
- package/context/stats.tsx +220 -0
- package/context/voice.tsx +88 -0
- package/coordinator/coordinatorMode.ts +369 -0
- package/costHook.ts +22 -0
- package/dialogLaunchers.tsx +133 -0
- package/entrypoints/cli.tsx +1 -1
- package/extract_prompt.ts +304 -0
- package/ink.ts +85 -0
- package/install.sh +221 -0
- package/interactiveHelpers.tsx +366 -0
- package/macro.ts +1 -1
- package/memdir/findRelevantMemories.ts +141 -0
- package/memdir/memdir.ts +511 -0
- package/memdir/memoryAge.ts +53 -0
- package/memdir/memoryScan.ts +94 -0
- package/memdir/memoryTypes.ts +271 -0
- package/memdir/paths.ts +291 -0
- package/memdir/teamMemPaths.ts +292 -0
- package/memdir/teamMemPrompts.ts +100 -0
- package/moreright/useMoreRight.tsx +26 -0
- package/native-ts/color-diff/index.ts +999 -0
- package/native-ts/file-index/index.ts +370 -0
- package/native-ts/yoga-layout/enums.ts +134 -0
- package/native-ts/yoga-layout/index.ts +2578 -0
- package/outputStyles/loadOutputStylesDir.ts +98 -0
- package/package.json +3 -42
- package/plugins/builtinPlugins.ts +159 -0
- package/plugins/bundled/index.ts +23 -0
- package/projectOnboardingState.ts +83 -0
- package/public/claude-files.png +0 -0
- package/public/leak-tweet.png +0 -0
- package/query/config.ts +46 -0
- package/query/deps.ts +40 -0
- package/query/stopHooks.ts +470 -0
- package/query/tokenBudget.ts +93 -0
- package/replLauncher.tsx +27 -0
- package/schemas/hooks.ts +222 -0
- package/screens/Doctor.tsx +575 -0
- package/screens/REPL.tsx +7107 -0
- package/screens/ResumeConversation.tsx +399 -0
- package/scripts/postinstall.js +90 -0
- package/server/createDirectConnectSession.ts +88 -0
- package/server/directConnectManager.ts +213 -0
- package/server/types.ts +57 -0
- package/setup.ts +477 -0
- package/stub_types.sh +13 -0
- package/tasks.ts +39 -0
- package/tools.ts +396 -0
- package/upstreamproxy/relay.ts +455 -0
- package/upstreamproxy/upstreamproxy.ts +285 -0
- package/vim/motions.ts +82 -0
- package/vim/operators.ts +556 -0
- package/vim/textObjects.ts +186 -0
- package/vim/transitions.ts +490 -0
- package/vim/types.ts +199 -0
- package/voice/voiceModeEnabled.ts +54 -0
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
|
|
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
|
-
// ──
|
|
19
|
+
// ── find Bun ──────────────────────────────────────────────────────────────────
|
|
21
20
|
|
|
22
|
-
function
|
|
23
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
49
|
+
console.log('xcode v3.1.0 — 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
|
|
118
|
-
--model <name>
|
|
119
|
-
--openrouter
|
|
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
|
|
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
|
-
// ──
|
|
87
|
+
// ── launch with Bun ───────────────────────────────────────────────────────────
|
|
88
|
+
|
|
89
|
+
const bun = findBun();
|
|
144
90
|
|
|
145
|
-
let bun = bunBinPath();
|
|
146
91
|
if (!bun) {
|
|
147
|
-
|
|
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
|
-
|
|
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
|
});
|