@snelusha/noto 1.2.2 → 1.2.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.
Files changed (2) hide show
  1. package/dist/index.js +7 -27
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -63,9 +63,8 @@ var AvailableModelsSchema = z.enum([
63
63
  "gemini-1.5-pro",
64
64
  "gemini-1.5-pro-latest",
65
65
  "gemini-2.0-flash-001",
66
- "gemini-2.0-flash-exp",
66
+ "gemini-2.0-flash",
67
67
  "gemini-2.0-flash-lite-preview-02-05",
68
- "gemini-2.5-pro-exp-03-25",
69
68
  "gemini-2.5-flash-preview-04-17",
70
69
  "gemini-2.5-pro-preview-05-06"
71
70
  ]);
@@ -74,7 +73,7 @@ var AvailableModelsSchema = z.enum([
74
73
  var StorageSchema = z2.object({
75
74
  llm: z2.object({
76
75
  apiKey: z2.string().optional(),
77
- model: AvailableModelsSchema.optional()
76
+ model: AvailableModelsSchema.optional().or(z2.string())
78
77
  }).optional(),
79
78
  lastGeneratedMessage: z2.string().optional()
80
79
  });
@@ -270,22 +269,10 @@ import dedent3 from "dedent";
270
269
 
271
270
  // src/ai/models.ts
272
271
  import { createGoogleGenerativeAI } from "@ai-sdk/google";
273
-
274
- // src/errors.ts
275
- var NotoError = class _NotoError extends Error {
276
- code;
277
- constructor(options) {
278
- super(options.message);
279
- this.code = options.code;
280
- Object.setPrototypeOf(this, _NotoError.prototype);
281
- }
282
- };
283
-
284
- // src/ai/models.ts
285
272
  var google = createGoogleGenerativeAI({
286
273
  apiKey: (await StorageManager.get()).llm?.apiKey ?? "api-key"
287
274
  });
288
- var defaultModel = "gemini-2.0-flash-lite-preview-02-05";
275
+ var defaultModel = "gemini-2.0-flash";
289
276
  var models = {
290
277
  "gemini-1.5-flash": google("gemini-1.5-flash"),
291
278
  "gemini-1.5-flash-latest": google("gemini-1.5-flash-latest"),
@@ -294,33 +281,26 @@ var models = {
294
281
  "gemini-1.5-pro": google("gemini-1.5-pro"),
295
282
  "gemini-1.5-pro-latest": google("gemini-1.5-pro-latest"),
296
283
  "gemini-2.0-flash-001": google("gemini-2.0-flash-001"),
297
- "gemini-2.0-flash-exp": google("gemini-2.0-flash-exp"),
284
+ "gemini-2.0-flash": google("gemini-2.0-flash"),
298
285
  "gemini-2.0-flash-lite-preview-02-05": google(
299
286
  "gemini-2.0-flash-lite-preview-02-05"
300
287
  ),
301
- "gemini-2.5-pro-exp-03-25": google("gemini-2.5-pro-exp-03-25"),
302
288
  "gemini-2.5-flash-preview-04-17": google("gemini-2.5-flash-preview-04-17"),
303
289
  "gemini-2.5-pro-preview-05-06": google("gemini-2.5-pro-preview-05-06")
304
290
  };
305
291
  var availableModels = Object.keys(models);
306
292
  var getModel = async () => {
307
293
  let model2 = (await StorageManager.get()).llm?.model;
308
- if (!model2) {
294
+ if (!model2 || !availableModels.includes(model2)) {
309
295
  model2 = defaultModel;
310
296
  await StorageManager.update((current2) => ({
311
297
  ...current2,
312
298
  llm: {
313
299
  ...current2.llm,
314
- model: model2
300
+ model: defaultModel
315
301
  }
316
302
  }));
317
303
  }
318
- if (!availableModels.includes(model2)) {
319
- throw new NotoError({
320
- code: "model-not-found",
321
- message: `model "${model2}" not found.`
322
- });
323
- }
324
304
  return models[model2];
325
305
  };
326
306
 
@@ -1065,7 +1045,7 @@ var listCommand = () => {
1065
1045
  };
1066
1046
 
1067
1047
  // package.json
1068
- var version = "1.2.2";
1048
+ var version = "1.2.4";
1069
1049
 
1070
1050
  // src/index.ts
1071
1051
  var globalSpec = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snelusha/noto",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Generate clean commit messages in a snap! ✨",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -41,21 +41,21 @@
41
41
  "cli"
42
42
  ],
43
43
  "devDependencies": {
44
- "@types/node": "^22.15.14",
45
- "tsup": "^8.4.0",
44
+ "@types/node": "^22.15.19",
45
+ "tsup": "^8.5.0",
46
46
  "typescript": "^5.8.3",
47
- "vitest": "^3.1.3"
47
+ "vitest": "^3.1.4"
48
48
  },
49
49
  "dependencies": {
50
- "@ai-sdk/google": "^1.2.16",
50
+ "@ai-sdk/google": "^1.2.18",
51
51
  "@clack/prompts": "^0.10.1",
52
- "ai": "^4.3.14",
52
+ "ai": "^4.3.16",
53
53
  "arg": "^5.0.2",
54
54
  "clipboardy": "^4.0.0",
55
55
  "dedent": "^1.6.0",
56
56
  "picocolors": "^1.1.1",
57
57
  "simple-git": "^3.27.0",
58
58
  "tinyexec": "^0.3.2",
59
- "zod": "^3.24.4"
59
+ "zod": "^3.25.3"
60
60
  }
61
61
  }