code-ollama 0.6.1 → 0.7.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.
|
@@ -8,13 +8,20 @@ import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
|
8
8
|
import { Select, Spinner, TextInput } from "@inkjs/ui";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
//#region src/constants/command.ts
|
|
11
|
-
var LIST = [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
var LIST = [
|
|
12
|
+
{
|
|
13
|
+
name: "/clear",
|
|
14
|
+
description: "clear the current session"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "/model",
|
|
18
|
+
description: "switch the model"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "/exit",
|
|
22
|
+
description: "exit the application"
|
|
23
|
+
}
|
|
24
|
+
];
|
|
18
25
|
//#endregion
|
|
19
26
|
//#region src/constants/decision.ts
|
|
20
27
|
var APPROVE = "approve";
|
|
@@ -867,6 +874,7 @@ function ModelPicker({ currentModel, onSelect, onClose }) {
|
|
|
867
874
|
//#endregion
|
|
868
875
|
//#region src/components/App.tsx
|
|
869
876
|
function App() {
|
|
877
|
+
const { exit } = useApp();
|
|
870
878
|
const [model, setModel] = useState(() => loadConfig().model);
|
|
871
879
|
const [picking, setPicking] = useState(false);
|
|
872
880
|
const [mode, setMode] = useState(NAME.SAFE);
|
|
@@ -881,8 +889,11 @@ function App() {
|
|
|
881
889
|
setPicking(false);
|
|
882
890
|
setSessionId((sessionId) => sessionId + 1);
|
|
883
891
|
break;
|
|
892
|
+
case "/exit":
|
|
893
|
+
exit();
|
|
894
|
+
break;
|
|
884
895
|
}
|
|
885
|
-
}, []);
|
|
896
|
+
}, [exit]);
|
|
886
897
|
const handleSelect = useCallback((selected) => {
|
|
887
898
|
setModel(selected);
|
|
888
899
|
saveConfig({ model: selected });
|
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.7.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
|
|
@@ -502,7 +502,7 @@ async function processRunStream(messages, model) {
|
|
|
502
502
|
}
|
|
503
503
|
async function main(args = process.argv.slice(2)) {
|
|
504
504
|
if (!args.length) {
|
|
505
|
-
const { renderApp } = await import("./assets/tui-
|
|
505
|
+
const { renderApp } = await import("./assets/tui-CDaKDOEJ.js");
|
|
506
506
|
process.stdout.write("\x1Bc");
|
|
507
507
|
renderApp();
|
|
508
508
|
return;
|