@golba98/codexa 1.0.3 → 1.0.4
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/README.md +17 -18
- package/bin/codexa.js +62 -144
- package/package.json +4 -3
- package/src/app.tsx +533 -275
- package/src/commands/handler.ts +2 -2
- package/src/config/buildInfo.ts +2 -2
- package/src/config/layeredConfig.ts +1 -1
- package/src/config/runtimeConfig.ts +1 -1
- package/src/config/settings.ts +1 -1
- package/src/config/trustStore.ts +1 -1
- package/src/core/README.md +52 -0
- package/src/core/agent/loop.ts +282 -0
- package/src/core/agent/protocol.ts +211 -0
- package/src/core/agent/tools.ts +414 -0
- package/src/core/{codexExecArgs.ts → codex/codexExecArgs.ts} +2 -2
- package/src/core/{codexLaunch.ts → codex/codexLaunch.ts} +3 -3
- package/src/core/{codexPrompt.ts → codex/codexPrompt.ts} +3 -3
- package/src/core/debug/modelStateDebug.ts +34 -0
- package/src/core/executables/antigravityExecutable.ts +48 -0
- package/src/core/executables/executableResolver.ts +5 -1
- package/src/core/perf/renderDebug.ts +10 -6
- package/src/core/providerLauncher/registry.ts +30 -14
- package/src/core/providerLauncher/types.ts +11 -9
- package/src/core/providerLauncher/workspaceConfig.ts +41 -26
- package/src/core/providerRuntime/anthropic.ts +7 -1
- package/src/core/providerRuntime/antigravity.ts +305 -0
- package/src/core/providerRuntime/claudeCodeDiscovery.ts +268 -22
- package/src/core/providerRuntime/claudeCodeDiscoveryDebug.ts +55 -0
- package/src/core/providerRuntime/contextMetadata.ts +12 -24
- package/src/core/providerRuntime/local.ts +129 -51
- package/src/core/providerRuntime/models.ts +22 -11
- package/src/core/providerRuntime/registry.ts +58 -31
- package/src/core/providerRuntime/types.ts +19 -14
- package/src/core/providers/codexSubprocess.ts +2 -2
- package/src/core/providers/types.ts +1 -1
- package/src/core/{attachments.ts → shared/attachments.ts} +27 -4
- package/src/core/{cleanupFastFail.ts → shared/cleanupFastFail.ts} +1 -1
- package/src/core/{hollowResponseFormat.ts → shared/hollowResponseFormat.ts} +1 -1
- package/src/core/terminal/clearFrameBoundary.ts +814 -0
- package/src/core/terminal/frameLock.ts +109 -0
- package/src/core/terminal/inkRenderReset.ts +123 -0
- package/src/core/terminal/terminalControl.ts +22 -0
- package/src/core/terminal/terminalTitle.ts +16 -102
- package/src/core/{channel.ts → version/channel.ts} +1 -1
- package/src/core/{updateCheck.ts → version/updateCheck.ts} +10 -5
- package/src/core/{launchContext.ts → workspace/launchContext.ts} +9 -16
- package/src/core/{planStorage.ts → workspace/planStorage.ts} +2 -2
- package/src/core/{workspaceGuard.ts → workspace/workspaceGuard.ts} +97 -13
- package/src/headless/execRunner.ts +2 -2
- package/src/index.tsx +43 -89
- package/src/session/appSession.ts +10 -7
- package/src/session/chatLifecycle.ts +1 -1
- package/src/session/liveRenderScheduler.ts +1 -1
- package/src/session/types.ts +1 -1
- package/src/ui/AppShell.tsx +672 -706
- package/src/ui/AttachmentImportPanel.tsx +2 -2
- package/src/ui/BottomComposer.tsx +145 -144
- package/src/ui/ModelPickerScreen.tsx +216 -36
- package/src/ui/ModelReasoningPicker.tsx +1 -1
- package/src/ui/PlanReviewPanel.tsx +1 -1
- package/src/ui/ProviderPicker.tsx +735 -321
- package/src/ui/RuntimeStatusBar.tsx +108 -0
- package/src/ui/SelectionPanel.tsx +4 -0
- package/src/ui/SettingsPanel.tsx +1 -1
- package/src/ui/TextEntryPanel.tsx +1 -1
- package/src/ui/Timeline.tsx +1619 -1470
- package/src/ui/TopHeader.tsx +46 -30
- package/src/ui/TranscriptShell.tsx +322 -0
- package/src/ui/TurnGroup.tsx +2 -2
- package/src/ui/UpdateAvailableCard.tsx +3 -3
- package/src/ui/UpdatePromptPanel.tsx +16 -22
- package/src/ui/layout.ts +298 -24
- package/src/ui/layoutListWindow.ts +145 -0
- package/src/ui/logoVariants.ts +4 -8
- package/src/ui/runtimeDisplay.ts +15 -3
- package/src/ui/textLayout.ts +15 -4
- package/src/ui/timelineMeasure.ts +194 -122
- package/src/core/codex.ts +0 -124
- package/src/ui/StaticTranscriptItem.tsx +0 -56
- /package/src/core/{inputDebug.ts → debug/inputDebug.ts} +0 -0
- /package/src/core/{clipboard.ts → shared/clipboard.ts} +0 -0
- /package/src/core/{githubDiagnostics.ts → shared/githubDiagnostics.ts} +0 -0
- /package/src/core/{projectInstructions.ts → workspace/projectInstructions.ts} +0 -0
- /package/src/core/{workspaceActivity.ts → workspace/workspaceActivity.ts} +0 -0
- /package/src/core/{workspaceRoot.ts → workspace/workspaceRoot.ts} +0 -0
package/src/core/codex.ts
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { spawn } from "child_process";
|
|
2
|
-
import type { ResolvedRuntimeConfig } from "../config/runtimeConfig.js";
|
|
3
|
-
import { formatCodexLaunchError, spawnCodexProcess } from "./executables/codexExecutable.js";
|
|
4
|
-
import { prepareCodexExecLaunch } from "./codexLaunch.js";
|
|
5
|
-
import { createTerminalTitleSequenceStripper } from "./terminal/terminalTitle.js";
|
|
6
|
-
|
|
7
|
-
export interface CodexHandlers {
|
|
8
|
-
onLine: (line: string) => void;
|
|
9
|
-
onDone: () => void;
|
|
10
|
-
onError: (message: string) => void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function streamCodex(
|
|
14
|
-
prompt: string,
|
|
15
|
-
runtime: ResolvedRuntimeConfig,
|
|
16
|
-
workspaceRoot: string,
|
|
17
|
-
handlers: CodexHandlers,
|
|
18
|
-
): () => void {
|
|
19
|
-
let done = false;
|
|
20
|
-
let cancelled = false;
|
|
21
|
-
let proc: ReturnType<typeof spawn> | null = null;
|
|
22
|
-
|
|
23
|
-
const finishError = (message: string) => {
|
|
24
|
-
if (done) return;
|
|
25
|
-
done = true;
|
|
26
|
-
handlers.onError(message);
|
|
27
|
-
};
|
|
28
|
-
const finishSuccess = () => {
|
|
29
|
-
if (done) return;
|
|
30
|
-
done = true;
|
|
31
|
-
handlers.onDone();
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
void prepareCodexExecLaunch(
|
|
35
|
-
{
|
|
36
|
-
runtime,
|
|
37
|
-
cwd: workspaceRoot,
|
|
38
|
-
structuredOutput: false,
|
|
39
|
-
},
|
|
40
|
-
import.meta.url,
|
|
41
|
-
)
|
|
42
|
-
.then((launchPlan) => {
|
|
43
|
-
if (cancelled) return;
|
|
44
|
-
if (!launchPlan.ok) {
|
|
45
|
-
finishError(launchPlan.error);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (!launchPlan.executable) {
|
|
49
|
-
finishError("Codex launch preparation did not return an executable.");
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
proc = spawnCodexProcess(
|
|
54
|
-
launchPlan.executable,
|
|
55
|
-
launchPlan.args,
|
|
56
|
-
{ stdio: ["pipe", "pipe", "pipe"] },
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
proc.stdin?.write(prompt);
|
|
60
|
-
proc.stdin?.end();
|
|
61
|
-
|
|
62
|
-
let buffer = "";
|
|
63
|
-
|
|
64
|
-
// Strip title escape sequences from child output — prevents the subprocess from overwriting the terminal title.
|
|
65
|
-
const stdoutTitleStripper = createTerminalTitleSequenceStripper({
|
|
66
|
-
source: "src/core/codex.ts:codex.stdout",
|
|
67
|
-
stream: "stdout",
|
|
68
|
-
origin: "codex-cli",
|
|
69
|
-
});
|
|
70
|
-
const stderrTitleStripper = createTerminalTitleSequenceStripper({
|
|
71
|
-
source: "src/core/codex.ts:codex.stderr",
|
|
72
|
-
stream: "stderr",
|
|
73
|
-
origin: "codex-cli",
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
const flushLine = (line: string) => {
|
|
77
|
-
if (cancelled || done) return;
|
|
78
|
-
if (line.trim()) handlers.onLine(line);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const handleText = (text: string) => {
|
|
82
|
-
if (!text) return;
|
|
83
|
-
if (cancelled || done) return;
|
|
84
|
-
buffer += text;
|
|
85
|
-
const lines = buffer.split("\n");
|
|
86
|
-
buffer = lines.pop() ?? "";
|
|
87
|
-
lines.forEach(flushLine);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
proc.stdout?.on("data", (chunk: Buffer) => handleText(stdoutTitleStripper.process(chunk)));
|
|
91
|
-
proc.stderr?.on("data", (chunk: Buffer) => handleText(stderrTitleStripper.process(chunk)));
|
|
92
|
-
|
|
93
|
-
proc.on("close", (code) => {
|
|
94
|
-
if (cancelled || done) return;
|
|
95
|
-
handleText(stdoutTitleStripper.flush());
|
|
96
|
-
handleText(stderrTitleStripper.flush());
|
|
97
|
-
if (buffer.trim()) flushLine(buffer);
|
|
98
|
-
buffer = "";
|
|
99
|
-
if (done) return;
|
|
100
|
-
if (code === 0) {
|
|
101
|
-
finishSuccess();
|
|
102
|
-
} else {
|
|
103
|
-
finishError(`Process exited with code ${code}`);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
proc.on("error", (err) => {
|
|
108
|
-
if (cancelled || done) return;
|
|
109
|
-
const errno = err as NodeJS.ErrnoException;
|
|
110
|
-
const msg = formatCodexLaunchError(errno);
|
|
111
|
-
finishError(msg);
|
|
112
|
-
});
|
|
113
|
-
})
|
|
114
|
-
.catch((error) => {
|
|
115
|
-
const errno = error as NodeJS.ErrnoException;
|
|
116
|
-
finishError(formatCodexLaunchError(errno));
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
return () => {
|
|
120
|
-
cancelled = true;
|
|
121
|
-
done = true;
|
|
122
|
-
proc?.kill();
|
|
123
|
-
};
|
|
124
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Box } from "ink";
|
|
2
|
-
import type { Layout } from "./layout.js";
|
|
3
|
-
import type { TimelineItem } from "./Timeline.js";
|
|
4
|
-
import { TimelineRowView } from "./Timeline.js";
|
|
5
|
-
import { MemoizedTurnGroup, resolveTurnRunPhase } from "./TurnGroup.js";
|
|
6
|
-
import { buildStandaloneEventRows } from "./timelineMeasure.js";
|
|
7
|
-
import type { RenderTimelineItem } from "./Timeline.js";
|
|
8
|
-
|
|
9
|
-
interface StaticTranscriptItemProps {
|
|
10
|
-
item: TimelineItem;
|
|
11
|
-
layout: Layout;
|
|
12
|
-
verboseMode: boolean;
|
|
13
|
-
workspaceRoot: string | null;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function StaticTranscriptItem({
|
|
17
|
-
item,
|
|
18
|
-
layout,
|
|
19
|
-
verboseMode,
|
|
20
|
-
workspaceRoot,
|
|
21
|
-
}: StaticTranscriptItemProps) {
|
|
22
|
-
if (item.type === "turn") {
|
|
23
|
-
if (!item.user) return null;
|
|
24
|
-
return (
|
|
25
|
-
<MemoizedTurnGroup
|
|
26
|
-
cols={layout.cols}
|
|
27
|
-
turnIndex={item.turnIndex}
|
|
28
|
-
user={item.user}
|
|
29
|
-
run={item.run}
|
|
30
|
-
assistant={item.assistant}
|
|
31
|
-
opacity="active"
|
|
32
|
-
question={null}
|
|
33
|
-
runPhase={resolveTurnRunPhase(item.run, item.assistant, { kind: "IDLE" }, item.turnId)}
|
|
34
|
-
streamPreviewRows={0}
|
|
35
|
-
streamMode="assistant-first"
|
|
36
|
-
verboseMode={verboseMode}
|
|
37
|
-
workspaceRoot={workspaceRoot}
|
|
38
|
-
/>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const renderItem: Extract<RenderTimelineItem, { type: "event" }> = {
|
|
43
|
-
key: `static-event-${item.event.id}`,
|
|
44
|
-
type: "event",
|
|
45
|
-
padded: false,
|
|
46
|
-
event: item.event,
|
|
47
|
-
};
|
|
48
|
-
const rows = buildStandaloneEventRows(renderItem, layout.cols);
|
|
49
|
-
return (
|
|
50
|
-
<Box flexDirection="column">
|
|
51
|
-
{rows.map((row) => (
|
|
52
|
-
<TimelineRowView key={row.key} row={row} />
|
|
53
|
-
))}
|
|
54
|
-
</Box>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|