code-ollama 0.9.1 → 0.10.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.
|
@@ -253,9 +253,9 @@ function Messages({ messages, isLoading, sessionId = 0, streamingMessage }) {
|
|
|
253
253
|
}
|
|
254
254
|
//#endregion
|
|
255
255
|
//#region src/components/SelectPrompt.tsx
|
|
256
|
-
function SelectPrompt({ children,
|
|
257
|
-
useInput((
|
|
258
|
-
if (key.escape)
|
|
256
|
+
function SelectPrompt({ children, onCancel, ...selectProps }) {
|
|
257
|
+
useInput((input, key) => {
|
|
258
|
+
if (key.escape || key.ctrl && input === "c") onCancel?.();
|
|
259
259
|
});
|
|
260
260
|
return /* @__PURE__ */ jsxs(Box, {
|
|
261
261
|
flexDirection: "column",
|
|
@@ -323,7 +323,7 @@ function PlanApproval({ planContent, onModeChange }) {
|
|
|
323
323
|
onChange: useCallback((value) => {
|
|
324
324
|
onModeChange(value);
|
|
325
325
|
}, [onModeChange]),
|
|
326
|
-
|
|
326
|
+
onCancel: useCallback(() => {
|
|
327
327
|
onModeChange(NAME.PLAN);
|
|
328
328
|
}, [onModeChange]),
|
|
329
329
|
children: /* @__PURE__ */ jsxs(Box, {
|
|
@@ -364,7 +364,7 @@ function ToolApproval({ toolCall, onDecision }) {
|
|
|
364
364
|
return /* @__PURE__ */ jsxs(SelectPrompt, {
|
|
365
365
|
options,
|
|
366
366
|
onChange: handleChange,
|
|
367
|
-
|
|
367
|
+
onCancel: handleEscape,
|
|
368
368
|
children: [
|
|
369
369
|
/* @__PURE__ */ jsx(Text, {
|
|
370
370
|
color: "yellow",
|
|
@@ -1108,11 +1108,12 @@ function getModeColor(mode) {
|
|
|
1108
1108
|
switch (mode) {
|
|
1109
1109
|
case NAME.PLAN: return "blue";
|
|
1110
1110
|
case NAME.AUTO: return "red";
|
|
1111
|
-
case NAME.SAFE:
|
|
1112
|
-
|
|
1111
|
+
case NAME.SAFE: return "green";
|
|
1112
|
+
// v8 ignore next
|
|
1113
|
+
default: return;
|
|
1113
1114
|
}
|
|
1114
1115
|
}
|
|
1115
|
-
function Footer({ mode, onToggleMode }) {
|
|
1116
|
+
function Footer({ mode, model, onToggleMode }) {
|
|
1116
1117
|
useInput((_, key) => {
|
|
1117
1118
|
if (key.tab && key.shift) onToggleMode();
|
|
1118
1119
|
});
|
|
@@ -1128,9 +1129,13 @@ function Footer({ mode, onToggleMode }) {
|
|
|
1128
1129
|
color: getModeColor(mode),
|
|
1129
1130
|
children: modeLabel
|
|
1130
1131
|
}),
|
|
1132
|
+
" (Shift+Tab to toggle)",
|
|
1133
|
+
" ",
|
|
1134
|
+
"❖",
|
|
1135
|
+
" Model: ",
|
|
1131
1136
|
/* @__PURE__ */ jsx(Text, {
|
|
1132
|
-
|
|
1133
|
-
children:
|
|
1137
|
+
color: "cyan",
|
|
1138
|
+
children: model
|
|
1134
1139
|
})
|
|
1135
1140
|
]
|
|
1136
1141
|
})
|
|
@@ -1196,8 +1201,12 @@ function Header({ model, onLoad }) {
|
|
|
1196
1201
|
function ModelPicker({ currentModel, onSelect, onClose }) {
|
|
1197
1202
|
const [options, setOptions] = useState([]);
|
|
1198
1203
|
const [error, setError] = useState(null);
|
|
1199
|
-
useInput((
|
|
1200
|
-
if (options.length
|
|
1204
|
+
useInput(async (_input, key) => {
|
|
1205
|
+
if (!options.length) return;
|
|
1206
|
+
if (key.return) {
|
|
1207
|
+
await tick();
|
|
1208
|
+
onClose();
|
|
1209
|
+
}
|
|
1201
1210
|
});
|
|
1202
1211
|
useEffect(() => {
|
|
1203
1212
|
async function load() {
|
|
@@ -1226,7 +1235,7 @@ function ModelPicker({ currentModel, onSelect, onClose }) {
|
|
|
1226
1235
|
options,
|
|
1227
1236
|
defaultValue: currentModel,
|
|
1228
1237
|
onChange: onSelect,
|
|
1229
|
-
|
|
1238
|
+
onCancel: onClose,
|
|
1230
1239
|
children: /* @__PURE__ */ jsx(SelectPromptHint, { message: "Select a model" })
|
|
1231
1240
|
});
|
|
1232
1241
|
}
|
|
@@ -1305,6 +1314,7 @@ function App() {
|
|
|
1305
1314
|
isHeaderLoaded && body,
|
|
1306
1315
|
/* @__PURE__ */ jsx(Footer, {
|
|
1307
1316
|
mode,
|
|
1317
|
+
model,
|
|
1308
1318
|
onToggleMode: handleToggleMode
|
|
1309
1319
|
})
|
|
1310
1320
|
]
|
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import { exec } from "node:child_process";
|
|
|
8
8
|
import { promisify } from "node:util";
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/constants/package.ts
|
|
11
|
-
var VERSION = "0.
|
|
11
|
+
var VERSION = "0.10.0";
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/constants/prompt.ts
|
|
14
14
|
var BASE_SYSTEM_PROMPT = `You are a coding assistant that helps users write, edit, and understand code. You have access to tools for reading files, writing files, running shell commands, and searching code
|
|
@@ -529,7 +529,7 @@ async function processRunStream(messages, model) {
|
|
|
529
529
|
}
|
|
530
530
|
async function main(args = process.argv.slice(2)) {
|
|
531
531
|
if (!args.length) {
|
|
532
|
-
const { renderApp } = await import("./assets/tui-
|
|
532
|
+
const { renderApp } = await import("./assets/tui-D2NgQSV7.js");
|
|
533
533
|
reset();
|
|
534
534
|
renderApp();
|
|
535
535
|
return;
|