codemaxxing 1.0.16 → 1.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/README.md +72 -21
- package/dist/agent.d.ts +12 -1
- package/dist/agent.js +296 -31
- package/dist/index.js +256 -1303
- package/dist/ui/banner.d.ts +12 -0
- package/dist/ui/banner.js +28 -0
- package/dist/ui/connection-types.d.ts +33 -0
- package/dist/ui/connection-types.js +1 -0
- package/dist/ui/connection.d.ts +11 -0
- package/dist/ui/connection.js +182 -0
- package/dist/ui/input-router.d.ts +176 -0
- package/dist/ui/input-router.js +710 -0
- package/dist/ui/paste-interceptor.d.ts +21 -0
- package/dist/ui/paste-interceptor.js +179 -0
- package/dist/ui/pickers.d.ts +171 -0
- package/dist/ui/pickers.js +120 -0
- package/dist/ui/status-bar.d.ts +8 -0
- package/dist/ui/status-bar.js +15 -0
- package/dist/ui/wizard-types.d.ts +27 -0
- package/dist/ui/wizard-types.js +1 -0
- package/dist/ui/wizard.d.ts +3 -0
- package/dist/ui/wizard.js +214 -0
- package/dist/utils/anthropic-oauth.d.ts +13 -0
- package/dist/utils/anthropic-oauth.js +171 -0
- package/dist/utils/auth.d.ts +2 -0
- package/dist/utils/auth.js +42 -3
- package/dist/utils/ollama.js +6 -1
- package/dist/utils/openai-oauth.d.ts +19 -0
- package/dist/utils/openai-oauth.js +233 -0
- package/dist/utils/responses-api.d.ts +40 -0
- package/dist/utils/responses-api.js +264 -0
- package/package.json +2 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Theme } from "../themes.js";
|
|
2
|
+
interface BannerProps {
|
|
3
|
+
version: string;
|
|
4
|
+
colors: Theme["colors"];
|
|
5
|
+
}
|
|
6
|
+
export declare function Banner({ version, colors }: BannerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
interface ConnectionInfoProps {
|
|
8
|
+
connectionInfo: string[];
|
|
9
|
+
colors: Theme["colors"];
|
|
10
|
+
}
|
|
11
|
+
export declare function ConnectionInfo({ connectionInfo, colors }: ConnectionInfoProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
const CODE_LINES = [
|
|
4
|
+
" _(`-') (`-') _ ",
|
|
5
|
+
" _ .-> ( (OO ).-> ( OO).-/ ",
|
|
6
|
+
" \\-,-----.(`-')----. \\ .'_ (,------. ",
|
|
7
|
+
" | .--./( OO).-. ''`'-..__) | .---' ",
|
|
8
|
+
" /_) (`-')( _) | | || | ' |(| '--. ",
|
|
9
|
+
" || |OO ) \\| |)| || | / : | .--' ",
|
|
10
|
+
"(_' '--'\\ ' '-' '| '-' / | `---. ",
|
|
11
|
+
" `-----' `-----' `------' `------' ",
|
|
12
|
+
];
|
|
13
|
+
const MAXXING_LINES = [
|
|
14
|
+
"<-. (`-') (`-') _ (`-') (`-') _ <-. (`-')_ ",
|
|
15
|
+
" \\(OO )_ (OO ).-/ (OO )_.-> (OO )_.-> (_) \\( OO) ) .-> ",
|
|
16
|
+
",--./ ,-.) / ,---. (_| \\_)--. (_| \\_)--.,-(`-'),--./ ,--/ ,---(`-') ",
|
|
17
|
+
"| `.' | | \\ /`.\\ \\ `.' / \\ `.' / | ( OO)| \\ | | ' .-(OO ) ",
|
|
18
|
+
"| |'.'| | '-'|_.' | \\ .') \\ .') | | )| . '| |)| | .-, \\ ",
|
|
19
|
+
"| | | |(| .-. | .' \\ .' \\ (| |_/ | |\\ | | | '.(_/ ",
|
|
20
|
+
"| | | | | | | | / .'. \\ / .'. \\ | |'->| | \\ | | '-' | ",
|
|
21
|
+
"`--' `--' `--' `--'`--' '--'`--' '--'`--' `--' `--' `-----' ",
|
|
22
|
+
];
|
|
23
|
+
export function Banner({ version, colors }) {
|
|
24
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: colors.border, paddingX: 1, children: [CODE_LINES.map((line, i) => (_jsx(Text, { color: colors.primary, children: line }, `c${i}`))), MAXXING_LINES.map((line, i) => (_jsx(Text, { color: colors.secondary, children: line }, `m${i}`))), _jsxs(Text, { children: [_jsx(Text, { color: colors.muted, children: " v" + version }), " ", _jsx(Text, { color: colors.primary, children: "\uD83D\uDCAA" }), " ", _jsx(Text, { dimColor: true, children: "your code. your model. no excuses." })] }), _jsxs(Text, { dimColor: true, children: [" Type ", _jsx(Text, { color: colors.muted, children: "/help" }), " for commands · ", _jsx(Text, { color: colors.muted, children: "Ctrl+C" }), " twice to exit"] })] }));
|
|
25
|
+
}
|
|
26
|
+
export function ConnectionInfo({ connectionInfo, colors }) {
|
|
27
|
+
return (_jsx(Box, { flexDirection: "column", borderStyle: "single", borderColor: colors.muted, paddingX: 1, marginBottom: 1, children: connectionInfo.map((line, i) => (_jsx(Text, { color: line.startsWith("✔") ? colors.primary : line.startsWith("✗") ? colors.error : colors.muted, children: line }, i))) }));
|
|
28
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CodingAgent } from "../agent.js";
|
|
2
|
+
import type { WizardScreen } from "./wizard-types.js";
|
|
3
|
+
export interface ChatMessage {
|
|
4
|
+
id: number;
|
|
5
|
+
type: "user" | "response" | "tool" | "tool-result" | "error" | "info";
|
|
6
|
+
text: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ConnectionContext {
|
|
9
|
+
setConnectionInfo: (val: string[]) => void;
|
|
10
|
+
setReady: (val: boolean) => void;
|
|
11
|
+
setAgent: (val: CodingAgent | null) => void;
|
|
12
|
+
setModelName: (val: string) => void;
|
|
13
|
+
providerRef: {
|
|
14
|
+
current: {
|
|
15
|
+
baseUrl: string;
|
|
16
|
+
apiKey: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
setLoading: (val: boolean) => void;
|
|
20
|
+
setStreaming: (val: boolean) => void;
|
|
21
|
+
setSpinnerMsg: (val: string) => void;
|
|
22
|
+
setMessages: (fn: (prev: ChatMessage[]) => ChatMessage[]) => void;
|
|
23
|
+
addMsg: (type: ChatMessage["type"], text: string) => void;
|
|
24
|
+
nextMsgId: () => number;
|
|
25
|
+
setApproval: (val: {
|
|
26
|
+
tool: string;
|
|
27
|
+
args: Record<string, unknown>;
|
|
28
|
+
diff?: string;
|
|
29
|
+
resolve: (decision: "yes" | "no" | "always") => void;
|
|
30
|
+
} | null) => void;
|
|
31
|
+
setWizardScreen: (val: WizardScreen) => void;
|
|
32
|
+
setWizardIndex: (val: number) => void;
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ConnectionContext } from "./connection-types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Build and set the connection banner (provider status + git info).
|
|
4
|
+
* Used for quick refreshes after reconnects / model changes.
|
|
5
|
+
*/
|
|
6
|
+
export declare function refreshConnectionBanner(setConnectionInfo: (val: string[]) => void): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Connect (or reconnect) to the LLM provider.
|
|
9
|
+
* Handles local detection, wizard triggers, agent creation, and post-connection setup.
|
|
10
|
+
*/
|
|
11
|
+
export declare function connectToProvider(isRetry: boolean, ctx: ConnectionContext): Promise<void>;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { CodingAgent } from "../agent.js";
|
|
2
|
+
import { loadConfig, parseCLIArgs, applyOverrides, detectLocalProvider, detectLocalProviderDetailed } from "../config.js";
|
|
3
|
+
import { isOllamaRunning } from "../utils/ollama.js";
|
|
4
|
+
import { isGitRepo, getBranch, getStatus } from "../utils/git.js";
|
|
5
|
+
/**
|
|
6
|
+
* Build and set the connection banner (provider status + git info).
|
|
7
|
+
* Used for quick refreshes after reconnects / model changes.
|
|
8
|
+
*/
|
|
9
|
+
export async function refreshConnectionBanner(setConnectionInfo) {
|
|
10
|
+
const info = [];
|
|
11
|
+
const cliArgs = parseCLIArgs();
|
|
12
|
+
const rawConfig = loadConfig();
|
|
13
|
+
const config = applyOverrides(rawConfig, cliArgs);
|
|
14
|
+
const provider = config.provider;
|
|
15
|
+
if (provider.model === "auto" || (provider.baseUrl === "http://localhost:1234/v1" && !cliArgs.baseUrl)) {
|
|
16
|
+
const detected = await detectLocalProvider();
|
|
17
|
+
if (detected) {
|
|
18
|
+
info.push(`✔ Connected to ${detected.baseUrl} → ${detected.model}`);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const ollamaUp = await isOllamaRunning();
|
|
22
|
+
info.push(ollamaUp ? "Ollama running (no model loaded)" : "✗ No local LLM server found");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
info.push(`Provider: ${provider.baseUrl}`);
|
|
27
|
+
info.push(`Model: ${provider.model}`);
|
|
28
|
+
}
|
|
29
|
+
const cwd = process.cwd();
|
|
30
|
+
if (isGitRepo(cwd)) {
|
|
31
|
+
const branch = getBranch(cwd);
|
|
32
|
+
const status = getStatus(cwd);
|
|
33
|
+
info.push(`Git: ${branch} (${status})`);
|
|
34
|
+
}
|
|
35
|
+
setConnectionInfo(info);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Connect (or reconnect) to the LLM provider.
|
|
39
|
+
* Handles local detection, wizard triggers, agent creation, and post-connection setup.
|
|
40
|
+
*/
|
|
41
|
+
export async function connectToProvider(isRetry, ctx) {
|
|
42
|
+
const cliArgs = parseCLIArgs();
|
|
43
|
+
const rawConfig = loadConfig();
|
|
44
|
+
const config = applyOverrides(rawConfig, cliArgs);
|
|
45
|
+
let provider = config.provider;
|
|
46
|
+
const info = [];
|
|
47
|
+
if (isRetry) {
|
|
48
|
+
info.push("Retrying connection...");
|
|
49
|
+
ctx.setConnectionInfo([...info]);
|
|
50
|
+
}
|
|
51
|
+
if (provider.model === "auto" || (provider.baseUrl === "http://localhost:1234/v1" && !cliArgs.baseUrl)) {
|
|
52
|
+
info.push("Detecting local LLM server...");
|
|
53
|
+
ctx.setConnectionInfo([...info]);
|
|
54
|
+
const detection = await detectLocalProviderDetailed();
|
|
55
|
+
if (detection.status === "connected") {
|
|
56
|
+
// Keep CLI model override if specified
|
|
57
|
+
if (cliArgs.model)
|
|
58
|
+
detection.provider.model = cliArgs.model;
|
|
59
|
+
provider = detection.provider;
|
|
60
|
+
info.push(`✔ Connected to ${provider.baseUrl} → ${provider.model}`);
|
|
61
|
+
ctx.setConnectionInfo([...info]);
|
|
62
|
+
}
|
|
63
|
+
else if (detection.status === "no-models") {
|
|
64
|
+
info.push(`⚠ ${detection.serverName} is running but has no models. Use /ollama pull to download one.`);
|
|
65
|
+
ctx.setConnectionInfo([...info]);
|
|
66
|
+
ctx.setReady(true);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
info.push("✗ No local LLM server found.");
|
|
71
|
+
ctx.setConnectionInfo([...info]);
|
|
72
|
+
ctx.setReady(true);
|
|
73
|
+
// Show the setup wizard on first run
|
|
74
|
+
ctx.setWizardScreen("connection");
|
|
75
|
+
ctx.setWizardIndex(0);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
info.push(`Provider: ${provider.baseUrl}`);
|
|
81
|
+
info.push(`Model: ${provider.model}`);
|
|
82
|
+
ctx.setConnectionInfo([...info]);
|
|
83
|
+
}
|
|
84
|
+
const cwd = process.cwd();
|
|
85
|
+
// Git info
|
|
86
|
+
if (isGitRepo(cwd)) {
|
|
87
|
+
const branch = getBranch(cwd);
|
|
88
|
+
const status = getStatus(cwd);
|
|
89
|
+
info.push(`Git: ${branch} (${status})`);
|
|
90
|
+
ctx.setConnectionInfo([...info]);
|
|
91
|
+
}
|
|
92
|
+
const a = new CodingAgent({
|
|
93
|
+
provider,
|
|
94
|
+
cwd,
|
|
95
|
+
maxTokens: config.defaults.maxTokens,
|
|
96
|
+
autoApprove: config.defaults.autoApprove,
|
|
97
|
+
onToken: (token) => {
|
|
98
|
+
// Switch from big spinner to streaming mode
|
|
99
|
+
ctx.setLoading(false);
|
|
100
|
+
ctx.setStreaming(true);
|
|
101
|
+
// Update the current streaming response in-place
|
|
102
|
+
ctx.setMessages((prev) => {
|
|
103
|
+
const lastIdx = prev.length - 1;
|
|
104
|
+
const last = prev[lastIdx];
|
|
105
|
+
if (last && last.type === "response" && last._streaming) {
|
|
106
|
+
return [
|
|
107
|
+
...prev.slice(0, lastIdx),
|
|
108
|
+
{ ...last, text: last.text + token },
|
|
109
|
+
];
|
|
110
|
+
}
|
|
111
|
+
// First token of a new response
|
|
112
|
+
return [...prev, { id: ctx.nextMsgId(), type: "response", text: token, _streaming: true }];
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
onToolCall: (name, args) => {
|
|
116
|
+
ctx.setLoading(true);
|
|
117
|
+
ctx.setSpinnerMsg("Executing tools...");
|
|
118
|
+
const argStr = Object.entries(args)
|
|
119
|
+
.map(([k, v]) => {
|
|
120
|
+
const val = String(v);
|
|
121
|
+
return val.length > 60 ? val.slice(0, 60) + "..." : val;
|
|
122
|
+
})
|
|
123
|
+
.join(", ");
|
|
124
|
+
ctx.addMsg("tool", `${name}(${argStr})`);
|
|
125
|
+
},
|
|
126
|
+
onToolResult: (_name, result) => {
|
|
127
|
+
const numLines = result.split("\n").length;
|
|
128
|
+
const size = result.length > 1024 ? `${(result.length / 1024).toFixed(1)}KB` : `${result.length}B`;
|
|
129
|
+
ctx.addMsg("tool-result", `└ ${numLines} lines (${size})`);
|
|
130
|
+
},
|
|
131
|
+
onThinking: (text) => {
|
|
132
|
+
if (text.length > 0) {
|
|
133
|
+
ctx.addMsg("info", `💭 Thought for ${text.split(/\s+/).length} words`);
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
onGitCommit: (message) => {
|
|
137
|
+
ctx.addMsg("info", `📝 Auto-committed: ${message}`);
|
|
138
|
+
},
|
|
139
|
+
onContextCompressed: (oldTokens, newTokens) => {
|
|
140
|
+
const saved = oldTokens - newTokens;
|
|
141
|
+
const savedStr = saved >= 1000 ? `${(saved / 1000).toFixed(1)}k` : String(saved);
|
|
142
|
+
ctx.addMsg("info", `📦 Context compressed (~${savedStr} tokens freed)`);
|
|
143
|
+
},
|
|
144
|
+
onArchitectPlan: (plan) => {
|
|
145
|
+
ctx.addMsg("info", `🏗️ Architect Plan:\n${plan}`);
|
|
146
|
+
},
|
|
147
|
+
onLintResult: (file, errors) => {
|
|
148
|
+
ctx.addMsg("info", `🔍 Lint errors in ${file}:\n${errors}`);
|
|
149
|
+
},
|
|
150
|
+
onMCPStatus: (server, status) => {
|
|
151
|
+
ctx.addMsg("info", `🔌 MCP ${server}: ${status}`);
|
|
152
|
+
},
|
|
153
|
+
contextCompressionThreshold: config.defaults.contextCompressionThreshold,
|
|
154
|
+
onToolApproval: (name, args, diff) => {
|
|
155
|
+
return new Promise((resolve) => {
|
|
156
|
+
ctx.setApproval({ tool: name, args, diff, resolve });
|
|
157
|
+
ctx.setLoading(false);
|
|
158
|
+
});
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
// Initialize async context (repo map)
|
|
162
|
+
await a.init();
|
|
163
|
+
// Show project rules in banner
|
|
164
|
+
const rulesSource = a.getProjectRulesSource();
|
|
165
|
+
if (rulesSource) {
|
|
166
|
+
info.push(`📋 ${rulesSource} loaded`);
|
|
167
|
+
ctx.setConnectionInfo([...info]);
|
|
168
|
+
}
|
|
169
|
+
// Show MCP server count
|
|
170
|
+
const mcpCount = a.getMCPServerCount();
|
|
171
|
+
if (mcpCount > 0) {
|
|
172
|
+
info.push(`🔌 ${mcpCount} MCP server${mcpCount > 1 ? "s" : ""} connected`);
|
|
173
|
+
ctx.setConnectionInfo([...info]);
|
|
174
|
+
}
|
|
175
|
+
ctx.setAgent(a);
|
|
176
|
+
ctx.setModelName(provider.model);
|
|
177
|
+
ctx.providerRef.current = { baseUrl: provider.baseUrl, apiKey: provider.apiKey };
|
|
178
|
+
ctx.setReady(true);
|
|
179
|
+
if (isRetry) {
|
|
180
|
+
ctx.addMsg("info", `✅ Connected to ${provider.model}`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import type { Key } from "ink";
|
|
2
|
+
import type { CodingAgent } from "../agent.js";
|
|
3
|
+
import type { Theme } from "../themes.js";
|
|
4
|
+
import type { WizardContext } from "./wizard-types.js";
|
|
5
|
+
export interface InputRouterContext extends WizardContext {
|
|
6
|
+
showSuggestionsRef: {
|
|
7
|
+
current: boolean;
|
|
8
|
+
};
|
|
9
|
+
cmdMatchesRef: {
|
|
10
|
+
current: Array<{
|
|
11
|
+
cmd: string;
|
|
12
|
+
desc: string;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
cmdIndexRef: {
|
|
16
|
+
current: number;
|
|
17
|
+
};
|
|
18
|
+
setCmdIndex: (fn: (prev: number) => number) => void;
|
|
19
|
+
setInput: (val: string) => void;
|
|
20
|
+
setInputKey: (fn: (prev: number) => number) => void;
|
|
21
|
+
loginMethodPicker: {
|
|
22
|
+
provider: string;
|
|
23
|
+
methods: string[];
|
|
24
|
+
} | null;
|
|
25
|
+
loginMethodIndex: number;
|
|
26
|
+
setLoginMethodIndex: (fn: (prev: number) => number) => void;
|
|
27
|
+
setLoginMethodPicker: (val: {
|
|
28
|
+
provider: string;
|
|
29
|
+
methods: string[];
|
|
30
|
+
} | null) => void;
|
|
31
|
+
loginPicker: boolean;
|
|
32
|
+
loginPickerIndex: number;
|
|
33
|
+
skillsPicker: "menu" | "browse" | "installed" | "remove" | null;
|
|
34
|
+
skillsPickerIndex: number;
|
|
35
|
+
setSkillsPickerIndex: (fn: (prev: number) => number) => void;
|
|
36
|
+
setSkillsPicker: (val: "menu" | "browse" | "installed" | "remove" | null) => void;
|
|
37
|
+
sessionDisabledSkills: Set<string>;
|
|
38
|
+
setSessionDisabledSkills: (fn: (prev: Set<string>) => Set<string>) => void;
|
|
39
|
+
providerPicker: Array<{
|
|
40
|
+
name: string;
|
|
41
|
+
description: string;
|
|
42
|
+
authed: boolean;
|
|
43
|
+
}> | null;
|
|
44
|
+
providerPickerIndex: number;
|
|
45
|
+
setProviderPickerIndex: (fn: (prev: number) => number) => void;
|
|
46
|
+
setProviderPicker: (val: Array<{
|
|
47
|
+
name: string;
|
|
48
|
+
description: string;
|
|
49
|
+
authed: boolean;
|
|
50
|
+
}> | null) => void;
|
|
51
|
+
selectedProvider: string | null;
|
|
52
|
+
setSelectedProvider: (val: string | null) => void;
|
|
53
|
+
modelPickerGroups: {
|
|
54
|
+
[providerName: string]: Array<{
|
|
55
|
+
name: string;
|
|
56
|
+
baseUrl: string;
|
|
57
|
+
apiKey: string;
|
|
58
|
+
providerType: "openai" | "anthropic";
|
|
59
|
+
}>;
|
|
60
|
+
} | null;
|
|
61
|
+
modelPickerIndex: number;
|
|
62
|
+
setModelPickerIndex: (fn: (prev: number) => number) => void;
|
|
63
|
+
setModelPickerGroups: (val: {
|
|
64
|
+
[providerName: string]: Array<{
|
|
65
|
+
name: string;
|
|
66
|
+
baseUrl: string;
|
|
67
|
+
apiKey: string;
|
|
68
|
+
providerType: "openai" | "anthropic";
|
|
69
|
+
}>;
|
|
70
|
+
} | null) => void;
|
|
71
|
+
flatModelList: Array<{
|
|
72
|
+
name: string;
|
|
73
|
+
baseUrl: string;
|
|
74
|
+
apiKey: string;
|
|
75
|
+
providerType: "openai" | "anthropic";
|
|
76
|
+
}>;
|
|
77
|
+
setFlatModelList: (val: Array<{
|
|
78
|
+
name: string;
|
|
79
|
+
baseUrl: string;
|
|
80
|
+
apiKey: string;
|
|
81
|
+
providerType: "openai" | "anthropic";
|
|
82
|
+
}>) => void;
|
|
83
|
+
ollamaDeletePicker: {
|
|
84
|
+
models: {
|
|
85
|
+
name: string;
|
|
86
|
+
size: number;
|
|
87
|
+
}[];
|
|
88
|
+
} | null;
|
|
89
|
+
ollamaDeletePickerIndex: number;
|
|
90
|
+
setOllamaDeletePickerIndex: (fn: (prev: number) => number) => void;
|
|
91
|
+
setOllamaDeletePicker: (val: {
|
|
92
|
+
models: {
|
|
93
|
+
name: string;
|
|
94
|
+
size: number;
|
|
95
|
+
}[];
|
|
96
|
+
} | null) => void;
|
|
97
|
+
ollamaPullPicker: boolean;
|
|
98
|
+
ollamaPullPickerIndex: number;
|
|
99
|
+
setOllamaPullPickerIndex: (fn: (prev: number) => number) => void;
|
|
100
|
+
setOllamaPullPicker: (val: boolean) => void;
|
|
101
|
+
ollamaDeleteConfirm: {
|
|
102
|
+
model: string;
|
|
103
|
+
size: number;
|
|
104
|
+
} | null;
|
|
105
|
+
setOllamaDeleteConfirm: (val: {
|
|
106
|
+
model: string;
|
|
107
|
+
size: number;
|
|
108
|
+
} | null) => void;
|
|
109
|
+
ollamaExitPrompt: boolean;
|
|
110
|
+
setOllamaExitPrompt: (val: boolean) => void;
|
|
111
|
+
themePicker: boolean;
|
|
112
|
+
themePickerIndex: number;
|
|
113
|
+
setThemePickerIndex: (fn: (prev: number) => number) => void;
|
|
114
|
+
setThemePicker: (val: boolean) => void;
|
|
115
|
+
setTheme: (val: Theme) => void;
|
|
116
|
+
sessionPicker: Array<{
|
|
117
|
+
id: string;
|
|
118
|
+
display: string;
|
|
119
|
+
}> | null;
|
|
120
|
+
sessionPickerIndex: number;
|
|
121
|
+
setSessionPickerIndex: (fn: (prev: number) => number) => void;
|
|
122
|
+
setSessionPicker: (val: Array<{
|
|
123
|
+
id: string;
|
|
124
|
+
display: string;
|
|
125
|
+
}> | null) => void;
|
|
126
|
+
deleteSessionConfirm: {
|
|
127
|
+
id: string;
|
|
128
|
+
display: string;
|
|
129
|
+
} | null;
|
|
130
|
+
setDeleteSessionConfirm: (val: {
|
|
131
|
+
id: string;
|
|
132
|
+
display: string;
|
|
133
|
+
} | null) => void;
|
|
134
|
+
deleteSessionPicker: Array<{
|
|
135
|
+
id: string;
|
|
136
|
+
display: string;
|
|
137
|
+
}> | null;
|
|
138
|
+
deleteSessionPickerIndex: number;
|
|
139
|
+
setDeleteSessionPickerIndex: (fn: (prev: number) => number) => void;
|
|
140
|
+
setDeleteSessionPicker: (val: Array<{
|
|
141
|
+
id: string;
|
|
142
|
+
display: string;
|
|
143
|
+
}> | null) => void;
|
|
144
|
+
input: string;
|
|
145
|
+
pastedChunksRef: {
|
|
146
|
+
current: Array<{
|
|
147
|
+
id: number;
|
|
148
|
+
lines: number;
|
|
149
|
+
content: string;
|
|
150
|
+
}>;
|
|
151
|
+
};
|
|
152
|
+
setPastedChunks: (fn: (prev: Array<{
|
|
153
|
+
id: number;
|
|
154
|
+
lines: number;
|
|
155
|
+
content: string;
|
|
156
|
+
}>) => Array<{
|
|
157
|
+
id: number;
|
|
158
|
+
lines: number;
|
|
159
|
+
content: string;
|
|
160
|
+
}>) => void;
|
|
161
|
+
approval: {
|
|
162
|
+
tool: string;
|
|
163
|
+
args: Record<string, unknown>;
|
|
164
|
+
diff?: string;
|
|
165
|
+
resolve: (decision: "yes" | "no" | "always") => void;
|
|
166
|
+
} | null;
|
|
167
|
+
setApproval: (val: InputRouterContext["approval"]) => void;
|
|
168
|
+
ctrlCPressed: boolean;
|
|
169
|
+
setCtrlCPressed: (val: boolean) => void;
|
|
170
|
+
agent: CodingAgent | null;
|
|
171
|
+
setModelName: (val: string) => void;
|
|
172
|
+
exit: () => void;
|
|
173
|
+
refreshConnectionBanner: () => Promise<void>;
|
|
174
|
+
handleSubmit: (value: string) => void;
|
|
175
|
+
}
|
|
176
|
+
export declare function routeKeyPress(inputChar: string, key: Key, ctx: InputRouterContext): boolean;
|