@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.
- package/bin/xcode +33 -85
- package/bootstrap/state.ts +1758 -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/entrypoints/cli.tsx +1 -1
- package/ink.ts +85 -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/package.json +42 -28
- 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/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/setup.ts +477 -0
- package/tasks.ts +39 -0
- package/tools.ts +396 -0
- package/upstreamproxy/relay.ts +455 -0
- package/upstreamproxy/upstreamproxy.ts +285 -0
- package/voice/voiceModeEnabled.ts +54 -0
- package/inspect.js +0 -7
- package/patch-box.js +0 -54
- package/patch-compact.js +0 -13
- package/patch-condensed-center.js +0 -13
- package/patch-condensed-row.js +0 -13
- package/patch-condensed.js +0 -13
- package/patch-final.js +0 -58
- package/patch-input-body.js +0 -46
- package/patch-input-body2.js +0 -35
- package/patch-input-style.js +0 -13
- package/patch-input-width.js +0 -13
- package/patch-layout.js +0 -87
- package/patch-logo-row.js +0 -12
- package/patch-width.js +0 -13
- package/patch-width2.js +0 -13
- package/patch2.js +0 -74
- package/patch3.js +0 -13
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!");
|