@snelusha/noto 1.0.2 → 1.0.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.
- package/dist/index.js +19 -9
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -132,10 +132,10 @@ var exit = async (code) => {
|
|
|
132
132
|
};
|
|
133
133
|
|
|
134
134
|
// src/middleware/auth.ts
|
|
135
|
-
var withAuth = (fn, options = {}) => {
|
|
135
|
+
var withAuth = (fn, options = { enabled: true }) => {
|
|
136
136
|
return async (opts) => {
|
|
137
137
|
const storage = await StorageManager.get();
|
|
138
|
-
if (!storage.llm?.apiKey &&
|
|
138
|
+
if (!storage.llm?.apiKey && options.enabled) {
|
|
139
139
|
p.log.error(
|
|
140
140
|
dedent`${color.red("noto api key is missing.")}
|
|
141
141
|
${color.dim(`run ${color.cyan("`noto config key`")} to set it up.`)}`
|
|
@@ -176,10 +176,10 @@ var commit = async (message) => {
|
|
|
176
176
|
};
|
|
177
177
|
|
|
178
178
|
// src/middleware/git.ts
|
|
179
|
-
var withRepository = (fn, options = {}) => {
|
|
179
|
+
var withRepository = (fn, options = { enabled: true }) => {
|
|
180
180
|
return async (opts) => {
|
|
181
181
|
const isRepo = await isGitRepository();
|
|
182
|
-
if (!isRepo &&
|
|
182
|
+
if (!isRepo && options.enabled) {
|
|
183
183
|
p2.log.error(
|
|
184
184
|
dedent2`${color2.red("no git repository found in cwd.")}
|
|
185
185
|
${color2.dim(`run ${color2.cyan("`git init`")} to initialize a new repository.`)}`
|
|
@@ -188,7 +188,7 @@ var withRepository = (fn, options = {}) => {
|
|
|
188
188
|
}
|
|
189
189
|
opts.isRepo = isRepo;
|
|
190
190
|
const diff = await getStagedDiff();
|
|
191
|
-
if (!diff &&
|
|
191
|
+
if (!diff && options.enabled) {
|
|
192
192
|
p2.log.error(
|
|
193
193
|
dedent2`${color2.red("no staged changes found.")}
|
|
194
194
|
${color2.dim(`run ${color2.cyan("`git add <file>`")} or ${color2.cyan("`git add .`")} to stage changes.`)}`
|
|
@@ -222,7 +222,7 @@ var NotoError = class _NotoError extends Error {
|
|
|
222
222
|
var google = createGoogleGenerativeAI({
|
|
223
223
|
apiKey: (await StorageManager.get()).llm?.apiKey ?? "api-key"
|
|
224
224
|
});
|
|
225
|
-
var defaultModel = "gemini-2.0-
|
|
225
|
+
var defaultModel = "gemini-2.0-pro-exp-02-05";
|
|
226
226
|
var models = {
|
|
227
227
|
"gemini-1.5-flash": google("gemini-1.5-flash"),
|
|
228
228
|
"gemini-1.5-flash-latest": google("gemini-1.5-flash-latest"),
|
|
@@ -238,7 +238,17 @@ var models = {
|
|
|
238
238
|
};
|
|
239
239
|
var availableModels = Object.keys(models);
|
|
240
240
|
var getModel = async () => {
|
|
241
|
-
|
|
241
|
+
let model2 = (await StorageManager.get()).llm?.model;
|
|
242
|
+
if (!model2) {
|
|
243
|
+
model2 = defaultModel;
|
|
244
|
+
await StorageManager.update((current) => ({
|
|
245
|
+
...current,
|
|
246
|
+
llm: {
|
|
247
|
+
...current.llm,
|
|
248
|
+
model: model2
|
|
249
|
+
}
|
|
250
|
+
}));
|
|
251
|
+
}
|
|
242
252
|
if (!availableModels.includes(model2)) {
|
|
243
253
|
throw new NotoError({
|
|
244
254
|
code: "model-not-found",
|
|
@@ -481,7 +491,7 @@ var command2 = {
|
|
|
481
491
|
}
|
|
482
492
|
console.log();
|
|
483
493
|
},
|
|
484
|
-
{
|
|
494
|
+
{ enabled: false }
|
|
485
495
|
)
|
|
486
496
|
)
|
|
487
497
|
};
|
|
@@ -606,7 +616,7 @@ var getCommand = (name, cmds = commands) => {
|
|
|
606
616
|
};
|
|
607
617
|
|
|
608
618
|
// package.json
|
|
609
|
-
var version = "1.0.
|
|
619
|
+
var version = "1.0.4";
|
|
610
620
|
|
|
611
621
|
// src/index.ts
|
|
612
622
|
var globalSpec = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snelusha/noto",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Generate clean commit messages in a snap! ✨",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"dist",
|
|
34
|
+
"bin",
|
|
34
35
|
"README.md"
|
|
35
36
|
],
|
|
36
37
|
"keywords": [
|
|
@@ -45,9 +46,9 @@
|
|
|
45
46
|
"typescript": "^5.8.2"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@ai-sdk/google": "^1.1.
|
|
49
|
+
"@ai-sdk/google": "^1.1.25",
|
|
49
50
|
"@clack/prompts": "^0.10.0",
|
|
50
|
-
"ai": "^4.1.
|
|
51
|
+
"ai": "^4.1.61",
|
|
51
52
|
"arg": "^5.0.2",
|
|
52
53
|
"clipboardy": "^4.0.0",
|
|
53
54
|
"dedent": "^1.5.3",
|