@xortex/xcode 3.1.0 → 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 (52) hide show
  1. package/bin/xcode +1 -1
  2. package/entrypoints/cli.tsx +1 -1
  3. package/macro.ts +1 -1
  4. package/package.json +54 -1
  5. package/INSTALLATION.md +0 -285
  6. package/QUICKSTART.md +0 -151
  7. package/SYSTEM_PROMPT.md +0 -583
  8. package/SYSTEM_PROMPT_EXTRACTED.md +0 -1
  9. package/Untitled +0 -1
  10. package/bun.lock +0 -645
  11. package/costHook.ts +0 -22
  12. package/dialogLaunchers.tsx +0 -133
  13. package/extract_prompt.ts +0 -304
  14. package/inspect.js +0 -7
  15. package/install.sh +0 -221
  16. package/moreright/useMoreRight.tsx +0 -26
  17. package/native-ts/color-diff/index.ts +0 -999
  18. package/native-ts/file-index/index.ts +0 -370
  19. package/native-ts/yoga-layout/enums.ts +0 -134
  20. package/native-ts/yoga-layout/index.ts +0 -2578
  21. package/outputStyles/loadOutputStylesDir.ts +0 -98
  22. package/patch-box.js +0 -54
  23. package/patch-compact.js +0 -13
  24. package/patch-condensed-center.js +0 -13
  25. package/patch-condensed-row.js +0 -13
  26. package/patch-condensed.js +0 -13
  27. package/patch-final.js +0 -58
  28. package/patch-input-body.js +0 -46
  29. package/patch-input-body2.js +0 -35
  30. package/patch-input-style.js +0 -13
  31. package/patch-input-width.js +0 -13
  32. package/patch-layout.js +0 -87
  33. package/patch-logo-row.js +0 -12
  34. package/patch-width.js +0 -13
  35. package/patch-width2.js +0 -13
  36. package/patch2.js +0 -74
  37. package/patch3.js +0 -13
  38. package/plugins/builtinPlugins.ts +0 -159
  39. package/plugins/bundled/index.ts +0 -23
  40. package/projectOnboardingState.ts +0 -83
  41. package/public/claude-files.png +0 -0
  42. package/public/leak-tweet.png +0 -0
  43. package/replLauncher.tsx +0 -27
  44. package/server/createDirectConnectSession.ts +0 -88
  45. package/server/directConnectManager.ts +0 -213
  46. package/server/types.ts +0 -57
  47. package/stub_types.sh +0 -13
  48. package/vim/motions.ts +0 -82
  49. package/vim/operators.ts +0 -556
  50. package/vim/textObjects.ts +0 -186
  51. package/vim/transitions.ts +0 -490
  52. package/vim/types.ts +0 -199
@@ -1,98 +0,0 @@
1
- import memoize from 'lodash-es/memoize.js'
2
- import { basename } from 'path'
3
- import type { OutputStyleConfig } from '../constants/outputStyles.js'
4
- import { logForDebugging } from '../utils/debug.js'
5
- import { coerceDescriptionToString } from '../utils/frontmatterParser.js'
6
- import { logError } from '../utils/log.js'
7
- import {
8
- extractDescriptionFromMarkdown,
9
- loadMarkdownFilesForSubdir,
10
- } from '../utils/markdownConfigLoader.js'
11
- import { clearPluginOutputStyleCache } from '../utils/plugins/loadPluginOutputStyles.js'
12
-
13
- /**
14
- * Loads markdown files from .claude/output-styles directories throughout the project
15
- * and from ~/.claude/output-styles directory and converts them to output styles.
16
- *
17
- * Each filename becomes a style name, and the file content becomes the style prompt.
18
- * The frontmatter provides name and description.
19
- *
20
- * Structure:
21
- * - Project .claude/output-styles/*.md -> project styles
22
- * - User ~/.claude/output-styles/*.md -> user styles (overridden by project styles)
23
- *
24
- * @param cwd Current working directory for project directory traversal
25
- */
26
- export const getOutputStyleDirStyles = memoize(
27
- async (cwd: string): Promise<OutputStyleConfig[]> => {
28
- try {
29
- const markdownFiles = await loadMarkdownFilesForSubdir(
30
- 'output-styles',
31
- cwd,
32
- )
33
-
34
- const styles = markdownFiles
35
- .map(({ filePath, frontmatter, content, source }) => {
36
- try {
37
- const fileName = basename(filePath)
38
- const styleName = fileName.replace(/\.md$/, '')
39
-
40
- // Get style configuration from frontmatter
41
- const name = (frontmatter['name'] || styleName) as string
42
- const description =
43
- coerceDescriptionToString(
44
- frontmatter['description'],
45
- styleName,
46
- ) ??
47
- extractDescriptionFromMarkdown(
48
- content,
49
- `Custom ${styleName} output style`,
50
- )
51
-
52
- // Parse keep-coding-instructions flag (supports both boolean and string values)
53
- const keepCodingInstructionsRaw =
54
- frontmatter['keep-coding-instructions']
55
- const keepCodingInstructions =
56
- keepCodingInstructionsRaw === true ||
57
- keepCodingInstructionsRaw === 'true'
58
- ? true
59
- : keepCodingInstructionsRaw === false ||
60
- keepCodingInstructionsRaw === 'false'
61
- ? false
62
- : undefined
63
-
64
- // Warn if force-for-plugin is set on non-plugin output style
65
- if (frontmatter['force-for-plugin'] !== undefined) {
66
- logForDebugging(
67
- `Output style "${name}" has force-for-plugin set, but this option only applies to plugin output styles. Ignoring.`,
68
- { level: 'warn' },
69
- )
70
- }
71
-
72
- return {
73
- name,
74
- description,
75
- prompt: content.trim(),
76
- source,
77
- keepCodingInstructions,
78
- }
79
- } catch (error) {
80
- logError(error)
81
- return null
82
- }
83
- })
84
- .filter(style => style !== null)
85
-
86
- return styles
87
- } catch (error) {
88
- logError(error)
89
- return []
90
- }
91
- },
92
- )
93
-
94
- export function clearOutputStyleCaches(): void {
95
- getOutputStyleDirStyles.cache?.clear?.()
96
- loadMarkdownFilesForSubdir.cache?.clear?.()
97
- clearPluginOutputStyleCache()
98
- }
package/patch-box.js DELETED
@@ -1,54 +0,0 @@
1
- const fs = require('fs');
2
- const inputPath = 'components/PromptInput/PromptInput.tsx';
3
- let src = fs.readFileSync(inputPath, 'utf8');
4
-
5
- // Replace the complicated border logic with a cleaner approach for the first prompt
6
- // By removing Ink's built-in borders, we can simulate the "blue left border" and "grey background" using a parent Box and children.
7
- const oldBoxRegex = /<Box flexDirection="row" alignItems="flex-start" justifyContent="flex-start" borderColor=\{messages\.length === 0 \? "#4285f4" : getBorderColor\(\)\} borderStyle=\{messages\.length === 0 \? "single" : "round"\} borderLeft=\{messages\.length === 0 \? true : false\} borderRight=\{false\} borderBottom=\{messages\.length === 0 \? false : true\} borderTop=\{messages\.length === 0 \? false : true\} backgroundColor=\{messages\.length === 0 \? "#1e1e1e" : undefined\} width=\{messages\.length === 0 \? Math\.floor\(columns \* 0\.6\) : "100%"\} alignSelf="center" borderText=\{messages\.length === 0 \? undefined : buildBorderText\(showFastIcon \?\? false, showFastIconHint, fastModeCooldown\)\} minHeight=\{messages\.length === 0 \? 2 : undefined\} paddingX=\{messages\.length === 0 \? 1 : 0\} paddingY=\{messages\.length === 0 \? 1 : 0\}>/g;
8
-
9
- // If we can't find it, let's just do a simpler replace by reading the file and replacing the specific Box string
10
- let targetPos = src.indexOf('<Box flexDirection="row" alignItems="flex-start" justifyContent="flex-start" borderColor={messages.length === 0 ? "#4285f4"');
11
- if (targetPos > -1) {
12
- let endPos = src.indexOf('>', targetPos);
13
-
14
- const newBox = `
15
- {messages.length === 0 ? (
16
- <Box flexDirection="row" width={Math.floor(columns * 0.6)} alignSelf="center" height={5}>
17
- <Box width={1} backgroundColor="blue" />
18
- <Box flexGrow={1} backgroundColor="#1e1e1e" flexDirection="row" paddingX={1}>
19
- <PromptInputModeIndicator mode={mode} isLoading={isLoading} viewingAgentName={viewingAgentName} viewingAgentColor={viewingAgentColor} />
20
- <Box flexGrow={1} flexShrink={1} flexDirection="column" onClick={handleInputClick}>
21
- <Box flexGrow={1} paddingTop={1}>{textInputElement}</Box>
22
- <Box paddingBottom={1}>
23
- <Text color="blue">Build </Text><Text dimColor>{modelDisplayName}</Text>
24
- </Box>
25
- </Box>
26
- </Box>
27
- </Box>
28
- ) : (
29
- <Box flexDirection="row" alignItems="flex-start" justifyContent="flex-start" borderColor={getBorderColor()} borderStyle="round" borderLeft={false} borderRight={false} borderBottom={true} width="100%" borderText={buildBorderText(showFastIcon ?? false, showFastIconHint, fastModeCooldown)}>
30
- <PromptInputModeIndicator mode={mode} isLoading={isLoading} viewingAgentName={viewingAgentName} viewingAgentColor={viewingAgentColor} />
31
- <Box flexGrow={1} flexShrink={1} flexDirection="column" onClick={handleInputClick}>
32
- <Box>{textInputElement}</Box>
33
- </Box>
34
- </Box>
35
- )}
36
- `;
37
-
38
- // Since we replaced the inner content too, we need to remove the original inner content.
39
- // The original inner content is:
40
- // <PromptInputModeIndicator ... />
41
- // <Box flexGrow={1} ... >
42
- // <Box minHeight={...}>{textInputElement}</Box>
43
- // ... Build modelDisplayName ...
44
- // </Box>
45
- // </Box>}
46
-
47
- const endOfBox = src.indexOf('</Box>}', targetPos);
48
-
49
- src = src.substring(0, targetPos - 4) + newBox + src.substring(endOfBox + 7);
50
- fs.writeFileSync(inputPath, src);
51
- console.log("Updated Box layout!");
52
- } else {
53
- console.log("Could not find the target Box!");
54
- }
package/patch-compact.js DELETED
@@ -1,13 +0,0 @@
1
- const fs = require('fs');
2
-
3
- const logoPath = 'components/LogoV2/LogoV2.tsx';
4
- let logoSrc = fs.readFileSync(logoPath, 'utf8');
5
-
6
- // Replace the compact layout return block
7
- logoSrc = logoSrc.replace(
8
- /<Text bold=\{true\}>\{welcomeMessage\}<\/Text>\{t12\}\{t13\}<Text dimColor=\{true\}>\{billingType\}<\/Text><Text dimColor=\{true\}>\{agentName \? \`@\$\{agentName\} · \$\{truncatedCwd\}\` : truncatedCwd\}<\/Text>/g,
9
- `{t12}<Text bold>X Code v3.0.0</Text><Text bold={true}>{welcomeMessage}</Text>`
10
- );
11
-
12
- fs.writeFileSync(logoPath, logoSrc);
13
- console.log("Patched compact layout!");
@@ -1,13 +0,0 @@
1
- const fs = require('fs');
2
-
3
- const condensedPath = 'components/LogoV2/CondensedLogo.tsx';
4
- let condensedSrc = fs.readFileSync(condensedPath, 'utf8');
5
-
6
- // Replace the return block for condensed logo to add width="100%"
7
- condensedSrc = condensedSrc.replace(
8
- /<OffscreenFreeze><Box flexDirection="column" alignItems="center">\{t4\}\{t6\}<Text bold>Welcome to Xcode now you can you have persistent memory\.<\/Text>\{t10\}\{t11\}<\/Box><\/OffscreenFreeze>/g,
9
- `<OffscreenFreeze><Box width="100%" flexDirection="column" alignItems="center">{t4}{t6}<Text bold align="center">Welcome to Xcode now you can you have persistent memory.</Text>{t10}{t11}</Box></OffscreenFreeze>`
10
- );
11
-
12
- fs.writeFileSync(condensedPath, condensedSrc);
13
- console.log("Patched CondensedLogo centering!");
@@ -1,13 +0,0 @@
1
- const fs = require('fs');
2
-
3
- const condensedPath = 'components/LogoV2/CondensedLogo.tsx';
4
- let condensedSrc = fs.readFileSync(condensedPath, 'utf8');
5
-
6
- // Replace the layout to put logo (t4) and text (t6) in a row
7
- condensedSrc = condensedSrc.replace(
8
- /<OffscreenFreeze><Box width="100%" flexDirection="column" alignItems="center">\{t4\}\{t6\}<Text bold align="center">Welcome to Xcode now you can you have persistent memory\.<\/Text>\{t10\}\{t11\}<\/Box><\/OffscreenFreeze>/g,
9
- `<OffscreenFreeze><Box width="100%" flexDirection="column" alignItems="center"><Box flexDirection="row" alignItems="center" gap={2}>{t4}{t6}</Box><Text bold align="center">Welcome to Xcode now you can you have persistent memory.</Text>{t10}{t11}</Box></OffscreenFreeze>`
10
- );
11
-
12
- fs.writeFileSync(condensedPath, condensedSrc);
13
- console.log("Patched CondensedLogo side-by-side!");
@@ -1,13 +0,0 @@
1
- const fs = require('fs');
2
-
3
- const condensedPath = 'components/LogoV2/CondensedLogo.tsx';
4
- let condensedSrc = fs.readFileSync(condensedPath, 'utf8');
5
-
6
- // Replace the return block for condensed logo
7
- condensedSrc = condensedSrc.replace(
8
- /<OffscreenFreeze><Box flexDirection="row" gap=\{2\} alignItems="center">\{t4\}<Box flexDirection="column">\{t6\}\{t7\}\{t9\}<Text bold>Welcome to Xcode now you can you have persistent memory\.<\/Text>\{t10\}\{t11\}<\/Box><\/Box><\/OffscreenFreeze>/g,
9
- `<OffscreenFreeze><Box flexDirection="column" alignItems="center">{t4}{t6}<Text bold>Welcome to Xcode now you can you have persistent memory.</Text>{t10}{t11}</Box></OffscreenFreeze>`
10
- );
11
-
12
- fs.writeFileSync(condensedPath, condensedSrc);
13
- console.log("Patched CondensedLogo!");
package/patch-final.js DELETED
@@ -1,58 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const inputPath = path.join(__dirname, 'components/PromptInput/PromptInput.tsx');
5
- let src = fs.readFileSync(inputPath, 'utf8');
6
-
7
- // 1. Inject model display name
8
- if (!src.includes('import { useMainLoopModel }')) {
9
- src = src.replace(
10
- "import { useInputBuffer } from '../../hooks/useInputBuffer.js';",
11
- "import { useInputBuffer } from '../../hooks/useInputBuffer.js';\nimport { useMainLoopModel } from '../../hooks/useMainLoopModel.js';\nimport { renderModelSetting } from '../../utils/model/model.js';\nimport { getEffortSuffix } from '../../utils/effort.js';"
12
- );
13
- }
14
-
15
- if (!src.includes('modelDisplayName = renderModelSetting')) {
16
- src = src.replace(
17
- /const maxVisibleLines = isFullscreenEnvEnabled\(\)/,
18
- `const _model = useMainLoopModel();
19
- const _effortValue = useAppState(function(s) { return s.effortValue; });
20
- const _effortSuffix = getEffortSuffix(_model, _effortValue);
21
- const modelDisplayName = renderModelSetting(_model) + _effortSuffix;
22
- const maxVisibleLines = isFullscreenEnvEnabled()`
23
- );
24
- }
25
-
26
- // 2. Replace the layout for messages.length === 0
27
- const targetBoxStr = /<Box flexDirection="row" alignItems="flex-start" justifyContent="flex-start" borderColor=\{getBorderColor\(\)\} borderStyle="round" borderLeft=\{false\} borderRight=\{false\} borderBottom width="100%" borderText=\{buildBorderText\(showFastIcon \?\? false, showFastIconHint, fastModeCooldown\)\} minHeight=\{messages\.length === 0 \? 5 : undefined\}>/g;
28
- if (targetBoxStr.test(src)) {
29
- src = src.replace(
30
- targetBoxStr,
31
- `{messages.length === 0 ? (
32
- <Box flexDirection="row" width={Math.floor(columns * 0.6)} alignSelf="center" height={5} borderStyle="round" borderColor="#4285f4" backgroundColor="#1e1e1e" paddingX={1}>
33
- <PromptInputModeIndicator mode={mode} isLoading={isLoading} viewingAgentName={viewingAgentName} viewingAgentColor={viewingAgentColor} />
34
- <Box flexGrow={1} flexShrink={1} flexDirection="column" onClick={handleInputClick}>
35
- <Box flexGrow={1} paddingTop={0}>{textInputElement}</Box>
36
- <Box paddingBottom={0}>
37
- <Text color="#4285f4">Build </Text><Text dimColor>Gemini 3.1 Pro Preview Google · medium</Text>
38
- </Box>
39
- </Box>
40
- </Box>
41
- ) : (
42
- <Box flexDirection="row" alignItems="flex-start" justifyContent="flex-start" borderColor={getBorderColor()} borderStyle="round" borderLeft={false} borderRight={false} borderBottom={true} width="100%" borderText={buildBorderText(showFastIcon ?? false, showFastIconHint, fastModeCooldown)}>
43
- `
44
- );
45
-
46
- const endBox = /<Box flexGrow=\{1\} flexShrink=\{1\} onClick=\{handleInputClick\}>\s*\{textInputElement\}\s*<\/Box>\s*<\/Box>\}/g;
47
- src = src.replace(
48
- endBox,
49
- `<Box flexGrow={1} flexShrink={1} flexDirection="column" onClick={handleInputClick}>
50
- <Box>{textInputElement}</Box>
51
- </Box>
52
- </Box>
53
- )}`
54
- );
55
- }
56
-
57
- fs.writeFileSync(inputPath, src);
58
- console.log('Applied final prompt input changes with rounded full border');
@@ -1,46 +0,0 @@
1
- const fs = require('fs');
2
- const inputPath = 'components/PromptInput/PromptInput.tsx';
3
- let src = fs.readFileSync(inputPath, 'utf8');
4
-
5
- // Inject the imports
6
- if (!src.includes('renderModelSetting')) {
7
- src = src.replace(
8
- "import { useMainLoopModel } from '../../hooks/useMainLoopModel.js';",
9
- "import { useMainLoopModel } from '../../hooks/useMainLoopModel.js';\nimport { renderModelSetting } from '../../utils/model/model.js';\nimport { getEffortSuffix } from '../../utils/effort.js';"
10
- );
11
- }
12
-
13
- // Inject the modelDisplayName computation in the component body
14
- if (!src.includes('modelDisplayName = renderModelSetting')) {
15
- src = src.replace(
16
- "const mode = isVimModeEnabled() ? vimMode : undefined;",
17
- `const mode = isVimModeEnabled() ? vimMode : undefined;
18
- const _model = useMainLoopModel();
19
- const _effortValue = useAppState(_temp2);
20
- const _effortSuffix = getEffortSuffix(_model, _effortValue);
21
- const modelDisplayName = renderModelSetting(_model) + _effortSuffix;`
22
- );
23
- }
24
-
25
- // Ensure _temp2 is defined. It probably is in LogoV2, but let's just make it a local inline function or use the direct selector `s => s.effortValue`.
26
- // Actually, `useAppState(s => s.effortValue)` might not work because the compiler compiled it. Let's just use an inline function `function(s) { return s.effortValue; }`.
27
- src = src.replace(
28
- `useAppState(_temp2)`,
29
- `useAppState(function(s) { return s.effortValue; })`
30
- );
31
-
32
- // Update the rendering box
33
- const oldRenderBox = /<Box flexGrow=\{1\} flexShrink=\{1\} onClick=\{handleInputClick\}>\s*\{textInputElement\}\s*<\/Box>/g;
34
- const newRenderBox = `<Box flexGrow={1} flexShrink={1} flexDirection="column" onClick={handleInputClick}>
35
- <Box minHeight={messages.length === 0 ? 3 : undefined}>{textInputElement}</Box>
36
- {messages.length === 0 && (
37
- <Box marginTop={1}>
38
- <Text color="blue">Build </Text><Text>{modelDisplayName}</Text>
39
- </Box>
40
- )}
41
- </Box>`;
42
-
43
- src = src.replace(oldRenderBox, newRenderBox);
44
-
45
- fs.writeFileSync(inputPath, src);
46
- console.log("Updated PromptInput rendering box!");
@@ -1,35 +0,0 @@
1
- const fs = require('fs');
2
- const inputPath = 'components/PromptInput/PromptInput.tsx';
3
- let src = fs.readFileSync(inputPath, 'utf8');
4
-
5
- // Inject the modelDisplayName computation right at the top of the PromptInput function body
6
- const funcStart = "function PromptInput({\n";
7
- const funcBodyStart = /\} = t0;\s*const debug = t1 === undefined \? false : t1;/;
8
-
9
- // We can just use string replacement on a known line inside the function
10
- if (!src.includes('modelDisplayName = renderModelSetting')) {
11
- src = src.replace(
12
- /const maxVisibleLines = isFullscreenEnvEnabled\(\)/,
13
- `const _model = useMainLoopModel();
14
- const _effortValue = useAppState(function(s) { return s.effortValue; });
15
- const _effortSuffix = getEffortSuffix(_model, _effortValue);
16
- const modelDisplayName = renderModelSetting(_model) + _effortSuffix;
17
- const maxVisibleLines = isFullscreenEnvEnabled()`
18
- );
19
- }
20
-
21
- // Update the rendering box
22
- const oldRenderBox = /<Box flexGrow=\{1\} flexShrink=\{1\} onClick=\{handleInputClick\}>\s*\{textInputElement\}\s*<\/Box>/g;
23
- const newRenderBox = `<Box flexGrow={1} flexShrink={1} flexDirection="column" onClick={handleInputClick}>
24
- <Box minHeight={messages.length === 0 ? 3 : undefined}>{textInputElement}</Box>
25
- {messages.length === 0 && (
26
- <Box marginTop={1}>
27
- <Text color="blue">Build </Text><Text>{modelDisplayName}</Text>
28
- </Box>
29
- )}
30
- </Box>`;
31
-
32
- src = src.replace(oldRenderBox, newRenderBox);
33
-
34
- fs.writeFileSync(inputPath, src);
35
- console.log("Updated PromptInput rendering box!");
@@ -1,13 +0,0 @@
1
- const fs = require('fs');
2
- const inputPath = 'components/PromptInput/PromptInput.tsx';
3
- let src = fs.readFileSync(inputPath, 'utf8');
4
-
5
- // The string we want to replace
6
- const targetStr = /borderColor=\{getBorderColor\(\)\} borderStyle="round" borderLeft=\{messages\.length === 0 \? true : false\} borderRight=\{messages\.length === 0 \? true : false\} borderBottom width=\{messages\.length === 0 \? Math\.floor\(columns \* 0\.5\) : "100%"\} alignSelf="center" borderText=\{buildBorderText\(showFastIcon \?\? false, showFastIconHint, fastModeCooldown\)\} minHeight=\{messages\.length === 0 \? 2 : undefined\}/;
7
-
8
- const newStr = `borderColor={messages.length === 0 ? "#4285f4" : getBorderColor()} borderStyle={messages.length === 0 ? "single" : "round"} borderLeft={messages.length === 0 ? true : false} borderRight={false} borderBottom={messages.length === 0 ? false : true} borderTop={messages.length === 0 ? false : true} backgroundColor={messages.length === 0 ? "#1e1e1e" : undefined} width={messages.length === 0 ? Math.floor(columns * 0.6) : "100%"} alignSelf="center" borderText={messages.length === 0 ? undefined : buildBorderText(showFastIcon ?? false, showFastIconHint, fastModeCooldown)} minHeight={messages.length === 0 ? 2 : undefined} paddingX={messages.length === 0 ? 1 : 0} paddingY={messages.length === 0 ? 1 : 0}`;
9
-
10
- src = src.replace(targetStr, newStr);
11
-
12
- fs.writeFileSync(inputPath, src);
13
- console.log("Updated PromptInput styling!");
@@ -1,13 +0,0 @@
1
- const fs = require('fs');
2
-
3
- const inputPath = 'components/PromptInput/PromptInput.tsx';
4
- let inputSrc = fs.readFileSync(inputPath, 'utf8');
5
-
6
- // Replace the width calculation
7
- inputSrc = inputSrc.replace(
8
- /borderLeft=\{messages\.length === 0 \? true : false\} borderRight=\{messages\.length === 0 \? true : false\} borderBottom width="100%" borderText=\{buildBorderText\(showFastIcon \?\? false, showFastIconHint, fastModeCooldown\)\} minHeight=\{messages\.length === 0 \? 2 : undefined\}/g,
9
- `borderLeft={messages.length === 0 ? true : false} borderRight={messages.length === 0 ? true : false} borderBottom width={messages.length === 0 ? Math.floor(columns * 0.5) : "100%"} alignSelf="center" borderText={buildBorderText(showFastIcon ?? false, showFastIconHint, fastModeCooldown)} minHeight={messages.length === 0 ? 2 : undefined}`
10
- );
11
-
12
- fs.writeFileSync(inputPath, inputSrc);
13
- console.log("Patched PromptInput width!");
package/patch-layout.js DELETED
@@ -1,87 +0,0 @@
1
- const fs = require('fs');
2
-
3
- // 1. Patch FullscreenLayout.tsx
4
- let flPath = 'components/FullscreenLayout.tsx';
5
- let flCode = fs.readFileSync(flPath, 'utf8');
6
-
7
- flCode = flCode.replace('const $ = _c(47);', 'const $ = _c(48);');
8
- flCode = flCode.replace(
9
- 'newMessageCount: t3,\n onPillClick\n } = t0;',
10
- 'newMessageCount: t3,\n onPillClick,\n isFirstPrompt: t100\n } = t0;'
11
- );
12
-
13
- flCode = flCode.replace(
14
- 'if ($[11] !== overlay || $[12] !== scrollRef || $[13] !== t10 || $[14] !== t9) {',
15
- 'if ($[11] !== overlay || $[12] !== scrollRef || $[13] !== t10 || $[14] !== t9 || $[47] !== t100) {'
16
- );
17
- flCode = flCode.replace(
18
- 't11 = <ScrollBox ref={scrollRef} flexGrow={1} flexDirection="column" paddingTop={t9} stickyScroll={true}>{t10}{overlay}</ScrollBox>;',
19
- 't11 = <ScrollBox ref={scrollRef} flexGrow={t100 ? 0 : 1} flexDirection="column" paddingTop={t9} stickyScroll={true}>{t10}{overlay}</ScrollBox>;'
20
- );
21
-
22
- flCode = flCode.replace(
23
- 'if ($[24] !== t11 || $[25] !== t12 || $[26] !== t13 || $[27] !== t8) {',
24
- 'if ($[24] !== t11 || $[25] !== t12 || $[26] !== t13 || $[27] !== t8 || $[47] !== t100) {'
25
- );
26
- flCode = flCode.replace(
27
- 't14 = <Box flexGrow={1} flexDirection="column" overflow="hidden">{t8}{t11}{t12}{t13}</Box>;',
28
- 't14 = <Box flexGrow={t100 ? 0 : 1} flexDirection="column" overflow="hidden" alignItems={t100 ? "center" : undefined}>{t8}{t11}{t12}{t13}</Box>;'
29
- );
30
-
31
- flCode = flCode.replace(
32
- 'if ($[31] !== bottom) {',
33
- 'if ($[31] !== bottom || $[47] !== t100) {'
34
- );
35
- flCode = flCode.replace(
36
- 't17 = <Box flexDirection="column" flexShrink={0} width="100%" maxHeight="50%">{t15}{t16}<Box flexDirection="column" width="100%" flexGrow={1} overflowY="hidden">{bottom}</Box></Box>;',
37
- 't17 = <Box flexDirection="column" flexShrink={0} width="100%" maxHeight={t100 ? "100%" : "50%"}>{t15}{t16}<Box flexDirection="column" width="100%" flexGrow={t100 ? 0 : 1} overflowY="hidden">{bottom}</Box></Box>;'
38
- );
39
-
40
- flCode = flCode.replace(
41
- 'if ($[38] !== t14 || $[39] !== t17 || $[40] !== t18) {',
42
- 'if ($[38] !== t14 || $[39] !== t17 || $[40] !== t18 || $[47] !== t100) {'
43
- );
44
- flCode = flCode.replace(
45
- 't19 = <PromptOverlayProvider>{t14}{t17}{t18}</PromptOverlayProvider>;',
46
- `t19 = <PromptOverlayProvider>
47
- {t100 ? (
48
- <Box flexGrow={1} flexDirection="column" justifyContent="center" alignItems="center" width="100%">
49
- {t14}
50
- <Box width="80%" flexDirection="column" alignItems="center">
51
- {t17}
52
- </Box>
53
- </Box>
54
- ) : (
55
- <>{t14}{t17}</>
56
- )}
57
- {t18}
58
- </PromptOverlayProvider>;`
59
- );
60
-
61
- fs.writeFileSync(flPath, flCode);
62
-
63
- // 2. Patch REPL.tsx
64
- let replPath = 'screens/REPL.tsx';
65
- let replCode = fs.readFileSync(replPath, 'utf8');
66
-
67
- if (!replCode.includes('isFirstPrompt={messages.length === 0}')) {
68
- replCode = replCode.replace(
69
- '<FullscreenLayout\n scrollRef={scrollRef}',
70
- '<FullscreenLayout\n isFirstPrompt={messages.length === 0}\n scrollRef={scrollRef}'
71
- );
72
- fs.writeFileSync(replPath, replCode);
73
- }
74
-
75
- // 3. Patch PromptInput.tsx
76
- let piPath = 'components/PromptInput/PromptInput.tsx';
77
- let piCode = fs.readFileSync(piPath, 'utf8');
78
-
79
- if (!piCode.includes('minHeight={messages.length === 0 ? 5 : undefined}')) {
80
- piCode = piCode.replace(
81
- /borderText=\{buildBorderText\(showFastIcon \?\? false, showFastIconHint, fastModeCooldown\)\}>/g,
82
- 'borderText={buildBorderText(showFastIcon ?? false, showFastIconHint, fastModeCooldown)} minHeight={messages.length === 0 ? 5 : undefined}>'
83
- );
84
- fs.writeFileSync(piPath, piCode);
85
- }
86
-
87
- console.log("Patched files successfully.");
package/patch-logo-row.js DELETED
@@ -1,12 +0,0 @@
1
- const fs = require('fs');
2
-
3
- const logoPath = 'components/LogoV2/LogoV2.tsx';
4
- let logoSrc = fs.readFileSync(logoPath, 'utf8');
5
-
6
- logoSrc = logoSrc.replace(
7
- /t23 = <Box flexDirection="column" width="100%" justifyContent="center" alignItems="center" minHeight=\{9\}>\{t19\}\{t22\}\{t18\}<\/Box>;/g,
8
- `t23 = <Box flexDirection="column" width="100%" justifyContent="center" alignItems="center" minHeight={9}><Box flexDirection="row" alignItems="center" gap={2}>{t19}{t22}</Box>{t18}</Box>;`
9
- );
10
-
11
- fs.writeFileSync(logoPath, logoSrc);
12
- console.log("Patched LogoV2 side-by-side!");
package/patch-width.js DELETED
@@ -1,13 +0,0 @@
1
- const fs = require('fs');
2
-
3
- const fsLayoutPath = 'components/FullscreenLayout.tsx';
4
- let fsLayoutSrc = fs.readFileSync(fsLayoutPath, 'utf8');
5
-
6
- // Replace width="80%" with width="50%" for the initial prompt centered box
7
- fsLayoutSrc = fsLayoutSrc.replace(
8
- /<Box width="80%" flexDirection="column" alignItems="center">/g,
9
- `<Box width="50%" flexDirection="column" alignItems="center">`
10
- );
11
-
12
- fs.writeFileSync(fsLayoutPath, fsLayoutSrc);
13
- console.log("Patched FullscreenLayout width!");
package/patch-width2.js DELETED
@@ -1,13 +0,0 @@
1
- const fs = require('fs');
2
-
3
- const fsLayoutPath = 'components/FullscreenLayout.tsx';
4
- let fsLayoutSrc = fs.readFileSync(fsLayoutPath, 'utf8');
5
-
6
- // Replace width="50%" with width={Math.floor(columns * 0.6)}
7
- fsLayoutSrc = fsLayoutSrc.replace(
8
- /<Box width="50%" flexDirection="column" alignItems="center">/g,
9
- `<Box width={Math.floor(columns * 0.6)} flexDirection="column" alignItems="center">`
10
- );
11
-
12
- fs.writeFileSync(fsLayoutPath, fsLayoutSrc);
13
- console.log("Patched FullscreenLayout integer width!");
package/patch2.js DELETED
@@ -1,74 +0,0 @@
1
- const fs = require('fs');
2
-
3
- const logoPath = 'components/LogoV2/LogoV2.tsx';
4
- let logoSrc = fs.readFileSync(logoPath, 'utf8');
5
-
6
- // 1. Remove t20, t21, t22 rendering in LogoV2.tsx (the full logo part)
7
- logoSrc = logoSrc.replace(
8
- /let t22;\s+if \(\$\[53\] !== t20 \|\| \$\[54\] !== t21\) \{\s+t22 = <Box flexDirection="column" alignItems="center">\{t20\}\{t21\}<\/Box>;/g,
9
- `let t22;\n if (true) {\n t22 = <Box flexDirection="column" alignItems="center"><Text bold>X Code v3.0.0</Text></Box>;`
10
- );
11
-
12
- // Modify t23 to put t19 (logo), then t22 (version), then t18 (welcome message) and take full width
13
- logoSrc = logoSrc.replace(
14
- /t23 = <Box flexDirection="column" width=\{leftWidth\} justifyContent="space-between" alignItems="center" minHeight=\{9\}>\{t18\}\{t19\}\{t22\}<\/Box>;/g,
15
- `t23 = <Box flexDirection="column" width="100%" justifyContent="center" alignItems="center" minHeight={9}>{t19}{t22}{t18}</Box>;`
16
- );
17
-
18
- // Remove t24 and t25 to clear the right panel (FeedColumn) and divider
19
- logoSrc = logoSrc.replace(
20
- /t24 = layoutMode === "horizontal" && <Box height="100%" borderStyle="single" borderColor="claude" borderDimColor=\{true\} borderTop=\{false\} borderBottom=\{false\} borderLeft=\{false\} \/>;/g,
21
- `t24 = null;`
22
- );
23
-
24
- logoSrc = logoSrc.replace(
25
- /const t25 = layoutMode === "horizontal" && <FeedColumn .*? \/>;/g,
26
- `const t25 = null;`
27
- );
28
-
29
- fs.writeFileSync(logoPath, logoSrc);
30
-
31
- const footerPath = 'components/PromptInput/PromptInputFooterLeftSide.tsx';
32
- let footerSrc = fs.readFileSync(footerPath, 'utf8');
33
-
34
- // Add imports for model name in PromptInputFooterLeftSide.tsx
35
- if (!footerSrc.includes('useMainLoopModel')) {
36
- const importInsertPoint = "import { getGlobalConfig, saveGlobalConfig } from '../../utils/config.js';";
37
- footerSrc = footerSrc.replace(
38
- importInsertPoint,
39
- importInsertPoint + "\nimport { useMainLoopModel } from '../../hooks/useMainLoopModel.js';\nimport { renderModelSetting } from '../../utils/model/model.js';\nimport { getEffortSuffix } from '../../utils/effort.js';"
40
- );
41
- }
42
-
43
- // Inject model name resolution
44
- if (!footerSrc.includes('const _model = useMainLoopModel()')) {
45
- const bodyInsertPoint = "const hasBackgroundTasks =";
46
- footerSrc = footerSrc.replace(
47
- bodyInsertPoint,
48
- `const _model = useMainLoopModel();
49
- const _effortValue = useAppState(s => s.effortValue);
50
- const _effortSuffix = getEffortSuffix(_model, _effortValue);
51
- const modelDisplayName = renderModelSetting(_model) + _effortSuffix;
52
- const hasBackgroundTasks =`
53
- );
54
- }
55
-
56
- // Replace "? for shortcuts" with model name
57
- footerSrc = footerSrc.replace(
58
- /\? for shortcuts/g,
59
- `{modelDisplayName}`
60
- );
61
-
62
- fs.writeFileSync(footerPath, footerSrc);
63
-
64
- const inputPath = 'components/PromptInput/PromptInput.tsx';
65
- let inputSrc = fs.readFileSync(inputPath, 'utf8');
66
-
67
- // Make the input box full and small
68
- inputSrc = inputSrc.replace(
69
- /borderLeft=\{false\} borderRight=\{false\} borderBottom width="100%" borderText=\{buildBorderText\(showFastIcon \?\? false, showFastIconHint, fastModeCooldown\)\} minHeight=\{messages\.length === 0 \? 5 : undefined\}/g,
70
- `width="80%" alignSelf="center" borderText={buildBorderText(showFastIcon ?? false, showFastIconHint, fastModeCooldown)} minHeight={messages.length === 0 ? 2 : undefined}`
71
- );
72
-
73
- fs.writeFileSync(inputPath, inputSrc);
74
- console.log("Patched successfully!");
package/patch3.js DELETED
@@ -1,13 +0,0 @@
1
- const fs = require('fs');
2
-
3
- const inputPath = 'components/PromptInput/PromptInput.tsx';
4
- let inputSrc = fs.readFileSync(inputPath, 'utf8');
5
-
6
- // Replace the previous incorrect width="80%" alignSelf="center" with conditional borders
7
- inputSrc = inputSrc.replace(
8
- /width="80%" alignSelf="center" borderText=\{buildBorderText\(showFastIcon \?\? false, showFastIconHint, fastModeCooldown\)\} minHeight=\{messages\.length === 0 \? 2 : undefined\}/g,
9
- `borderLeft={messages.length === 0 ? true : false} borderRight={messages.length === 0 ? true : false} borderBottom width="100%" borderText={buildBorderText(showFastIcon ?? false, showFastIconHint, fastModeCooldown)} minHeight={messages.length === 0 ? 2 : undefined}`
10
- );
11
-
12
- fs.writeFileSync(inputPath, inputSrc);
13
- console.log("Fixed PromptInput!");