code-ollama 0.15.1 → 0.17.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/dist/cli.js CHANGED
@@ -8,7 +8,7 @@ import { v7 } from "uuid";
8
8
  import { exec } from "node:child_process";
9
9
  import { promisify } from "node:util";
10
10
  //#region src/constants/command.ts
11
- var LIST = [
11
+ var LIST$1 = [
12
12
  {
13
13
  name: "/clear",
14
14
  description: "clear the current session"
@@ -21,6 +21,10 @@ var LIST = [
21
21
  name: "/model",
22
22
  description: "switch the model"
23
23
  },
24
+ {
25
+ name: "/theme",
26
+ description: "change the theme"
27
+ },
24
28
  {
25
29
  name: "/search",
26
30
  description: "configure web search"
@@ -33,7 +37,7 @@ var LIST = [
33
37
  //#endregion
34
38
  //#region package.json
35
39
  var name = "code-ollama";
36
- var version = "0.15.1";
40
+ var version = "0.17.0";
37
41
  //#endregion
38
42
  //#region src/constants/package.ts
39
43
  var NAME = name;
@@ -102,6 +106,146 @@ var USER = "user";
102
106
  var ASSISTANT = "assistant";
103
107
  var SYSTEM = "system";
104
108
  //#endregion
109
+ //#region src/constants/theme.ts
110
+ var DEFAULT_THEME_ID = "github-dark";
111
+ var LIST = [
112
+ {
113
+ id: "github-light",
114
+ label: "GitHub Light",
115
+ description: "Light GitHub palette",
116
+ markdownTheme: "gitHub",
117
+ codeTheme: "github-light",
118
+ colors: {
119
+ accent: "blue",
120
+ border: "blue",
121
+ codeBorder: "blue",
122
+ command: "blue",
123
+ error: "red",
124
+ messageSystem: "gray",
125
+ modeAuto: "magenta",
126
+ modePlan: "blue",
127
+ modeSafe: "green",
128
+ model: "blue",
129
+ secondary: "gray",
130
+ status: "cyan",
131
+ warning: "yellow"
132
+ }
133
+ },
134
+ {
135
+ id: "github-dark",
136
+ label: "GitHub Dark",
137
+ description: "Dark GitHub palette",
138
+ markdownTheme: "gitHub",
139
+ codeTheme: "github-dark",
140
+ colors: {
141
+ accent: "cyan",
142
+ border: "cyan",
143
+ codeBorder: "gray",
144
+ command: "cyan",
145
+ error: "red",
146
+ messageSystem: "gray",
147
+ modeAuto: "magenta",
148
+ modePlan: "blue",
149
+ modeSafe: "green",
150
+ model: "cyan",
151
+ secondary: "gray",
152
+ status: "cyan",
153
+ warning: "yellow"
154
+ }
155
+ },
156
+ {
157
+ id: "nord",
158
+ label: "Nord",
159
+ description: "Cool nordic blues",
160
+ markdownTheme: "nord",
161
+ codeTheme: "nord",
162
+ colors: {
163
+ accent: "cyan",
164
+ border: "blue",
165
+ codeBorder: "blue",
166
+ command: "cyan",
167
+ error: "red",
168
+ messageSystem: "gray",
169
+ modeAuto: "magenta",
170
+ modePlan: "blue",
171
+ modeSafe: "green",
172
+ model: "cyan",
173
+ secondary: "gray",
174
+ status: "blue",
175
+ warning: "yellow"
176
+ }
177
+ },
178
+ {
179
+ id: "dracula",
180
+ label: "Dracula",
181
+ description: "Bright neon contrast",
182
+ markdownTheme: "dracula",
183
+ codeTheme: "dracula",
184
+ colors: {
185
+ accent: "magenta",
186
+ border: "magenta",
187
+ codeBorder: "magenta",
188
+ command: "magenta",
189
+ error: "red",
190
+ messageSystem: "gray",
191
+ modeAuto: "yellow",
192
+ modePlan: "magenta",
193
+ modeSafe: "green",
194
+ model: "magenta",
195
+ secondary: "gray",
196
+ status: "cyan",
197
+ warning: "yellow"
198
+ }
199
+ },
200
+ {
201
+ id: "solarized-light",
202
+ label: "Solarized Light",
203
+ description: "Warm light contrast",
204
+ markdownTheme: "solarized",
205
+ codeTheme: "solarized-light",
206
+ colors: {
207
+ accent: "yellow",
208
+ border: "yellow",
209
+ codeBorder: "yellow",
210
+ command: "yellow",
211
+ error: "red",
212
+ messageSystem: "gray",
213
+ modeAuto: "cyan",
214
+ modePlan: "blue",
215
+ modeSafe: "green",
216
+ model: "yellow",
217
+ secondary: "gray",
218
+ status: "cyan",
219
+ warning: "yellow"
220
+ }
221
+ },
222
+ {
223
+ id: "solarized-dark",
224
+ label: "Solarized Dark",
225
+ description: "Warm dark contrast",
226
+ markdownTheme: "solarized",
227
+ codeTheme: "solarized-dark",
228
+ colors: {
229
+ accent: "yellow",
230
+ border: "yellow",
231
+ codeBorder: "yellow",
232
+ command: "yellow",
233
+ error: "red",
234
+ messageSystem: "gray",
235
+ modeAuto: "cyan",
236
+ modePlan: "blue",
237
+ modeSafe: "green",
238
+ model: "yellow",
239
+ secondary: "gray",
240
+ status: "cyan",
241
+ warning: "yellow"
242
+ }
243
+ }
244
+ ];
245
+ function getTheme(themeId = DEFAULT_THEME_ID) {
246
+ return LIST.find(({ id }) => id === themeId) ?? LIST[0];
247
+ }
248
+ //#endregion
105
249
  //#region src/constants/tool.ts
106
250
  var READ_FILE = "read_file";
107
251
  var WRITE_FILE = "write_file";
@@ -166,7 +310,8 @@ function loadConfig() {
166
310
  return {
167
311
  host: process.env.OLLAMA_HOST ?? file.host ?? DEFAULT_HOST,
168
312
  model: process.env.OLLAMA_MODEL ?? file.model ?? DEFAULT_MODEL$1,
169
- searxngBaseUrl: file.searxngBaseUrl
313
+ searxngBaseUrl: file.searxngBaseUrl,
314
+ theme: file.theme ?? "github-dark"
170
315
  };
171
316
  }
172
317
  function saveConfig(patch) {
@@ -370,7 +515,16 @@ function deleteSession(id) {
370
515
  }
371
516
  //#endregion
372
517
  //#region src/utils/terminal.ts
373
- var ANSI_COLOR = { cyan: ["\x1B[36m", "\x1B[39m"] };
518
+ var ANSI_RESET_FOREGROUND = "\x1B[39m";
519
+ var ANSI_COLOR = {
520
+ blue: ["\x1B[34m", ANSI_RESET_FOREGROUND],
521
+ cyan: ["\x1B[36m", ANSI_RESET_FOREGROUND],
522
+ gray: ["\x1B[90m", ANSI_RESET_FOREGROUND],
523
+ green: ["\x1B[32m", ANSI_RESET_FOREGROUND],
524
+ magenta: ["\x1B[35m", ANSI_RESET_FOREGROUND],
525
+ red: ["\x1B[31m", ANSI_RESET_FOREGROUND],
526
+ yellow: ["\x1B[33m", ANSI_RESET_FOREGROUND]
527
+ };
374
528
  function color(text, name) {
375
529
  const [open, close] = ANSI_COLOR[name];
376
530
  return `${open}${text}${close}`;
@@ -931,7 +1085,7 @@ async function main(args = process.argv.slice(2)) {
931
1085
  else await launchTui();
932
1086
  }
933
1087
  async function launchTui(sessionId) {
934
- const { renderApp } = await import("./assets/tui-CSRbnCod.js");
1088
+ const { renderApp } = await import("./assets/tui-CCHcdC7V.js");
935
1089
  reset();
936
1090
  renderApp(sessionId);
937
1091
  }
@@ -947,4 +1101,4 @@ function isEntrypoint(argv1 = process.argv[1]) {
947
1101
  if (isEntrypoint()) main();
948
1102
  // v8 ignore stop
949
1103
  //#endregion
950
- export { LABEL as A, withSystemMessage as C, USER as D, SYSTEM as E, VERSION as F, LIST as I, SAFE as M, APPROVE as N, PLAN_GENERATION_INSTRUCTION as O, REJECT as P, resetSystemMessage as S, ASSISTANT as T, setClearHandler as _, tick as a, loadConfig as b, appendMessage as c, deleteSessionIfEmpty as d, listSessions as f, reset as g, clear as h, WRITE_TOOLS as i, PLAN as j, AUTO as k, createSession as l, updateSessionModel as m, main, READ_TOOLS as n, color as o, loadSession as p, TOOLS as r, write as s, executeTool as t, deleteSession as u, listModels as v, HEADER_PREFIX as w, saveConfig as x, streamChat as y };
1104
+ export { PLAN_GENERATION_INSTRUCTION as A, withSystemMessage as C, ASSISTANT as D, getTheme as E, APPROVE as F, REJECT as I, VERSION as L, LABEL as M, PLAN as N, SYSTEM as O, SAFE as P, LIST$1 as R, resetSystemMessage as S, LIST as T, setClearHandler as _, tick as a, loadConfig as b, appendMessage as c, deleteSessionIfEmpty as d, listSessions as f, reset as g, clear as h, WRITE_TOOLS as i, AUTO as j, USER as k, createSession as l, updateSessionModel as m, main, READ_TOOLS as n, color as o, loadSession as p, TOOLS as r, write as s, executeTool as t, deleteSession as u, listModels as v, HEADER_PREFIX as w, saveConfig as x, streamChat as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-ollama",
3
- "version": "0.15.1",
3
+ "version": "0.17.0",
4
4
  "description": "Ollama coding agent that runs in your terminal",
5
5
  "author": "Mark <mark@remarkablemark.org> (https://remarkablemark.org)",
6
6
  "type": "module",
@@ -52,18 +52,17 @@
52
52
  "devDependencies": {
53
53
  "@commitlint/cli": "21.0.1",
54
54
  "@commitlint/config-conventional": "21.0.1",
55
- "@eslint/config-helpers": "0.6.0",
56
55
  "@eslint/js": "10.0.1",
57
56
  "@types/node": "25.8.0",
58
57
  "@types/react": "19.2.14",
59
58
  "@vitest/coverage-v8": "4.1.6",
60
- "eslint": "10.3.0",
59
+ "eslint": "10.4.0",
61
60
  "eslint-plugin-prettier": "5.5.5",
62
61
  "eslint-plugin-simple-import-sort": "13.0.0",
63
62
  "globals": "17.6.0",
64
63
  "husky": "9.1.7",
65
64
  "ink-testing-library": "4.0.0",
66
- "lint-staged": "17.0.4",
65
+ "lint-staged": "17.0.5",
67
66
  "prettier": "3.8.3",
68
67
  "publint": "0.3.21",
69
68
  "tsx": "4.22.0",