@johnowennixon/diffdash 1.6.1 → 1.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.
- package/README.md +5 -4
- package/dist/package.json +14 -22
- package/dist/src/lib_abort.js +2 -2
- package/dist/src/lib_assert_type.js +30 -0
- package/dist/src/lib_char_smart.js +4 -0
- package/dist/src/lib_debug.js +1 -0
- package/dist/src/lib_diffdash_cli.js +4 -2
- package/dist/src/lib_diffdash_config.js +32 -3
- package/dist/src/lib_diffdash_llm.js +1 -1
- package/dist/src/lib_diffdash_sequence.js +10 -13
- package/dist/src/lib_file_io.js +13 -0
- package/dist/src/lib_file_is.js +34 -0
- package/dist/src/lib_git_message_generate.js +1 -1
- package/dist/src/lib_git_message_prompt.js +25 -20
- package/dist/src/lib_json5.js +4 -0
- package/dist/src/lib_llm_access.js +28 -23
- package/dist/src/{lib_llm_provider.js → lib_llm_api.js} +29 -13
- package/dist/src/lib_llm_chat.js +42 -11
- package/dist/src/lib_llm_config.js +11 -11
- package/dist/src/lib_llm_list.js +1 -1
- package/dist/src/lib_llm_model.js +155 -74
- package/dist/src/lib_tell.js +5 -5
- package/dist/src/lib_tui_quote.js +26 -0
- package/dist/src/lib_type_guard.js +15 -0
- package/package.json +14 -22
package/dist/src/lib_tell.js
CHANGED
|
@@ -6,8 +6,10 @@ import { datetime_format_local_iso_ymdthms, datetime_now } from "./lib_datetime.
|
|
|
6
6
|
import { enabled_from_env } from "./lib_enabled.js";
|
|
7
7
|
import { stdio_write_stderr_linefeed } from "./lib_stdio_write.js";
|
|
8
8
|
export const tell_enables = {
|
|
9
|
-
|
|
9
|
+
ansi: enabled_from_env("TELL_ANSI", { default: true }),
|
|
10
10
|
okay: enabled_from_env("TELL_OKAY", { default: true }),
|
|
11
|
+
stdout: enabled_from_env("TELL_STDOUT"),
|
|
12
|
+
timestamp: enabled_from_env("TELL_TIMESTAMP"),
|
|
11
13
|
};
|
|
12
14
|
function tell_generic({ message, colourizer }) {
|
|
13
15
|
while (message.endsWith(LF)) {
|
|
@@ -19,9 +21,7 @@ function tell_generic({ message, colourizer }) {
|
|
|
19
21
|
text += ansi_grey(now_local_ymdthms);
|
|
20
22
|
text += SPACE;
|
|
21
23
|
}
|
|
22
|
-
|
|
23
|
-
text += colourizer(message);
|
|
24
|
-
}
|
|
24
|
+
text += tell_enables.ansi && colourizer ? colourizer(message) : message;
|
|
25
25
|
stdio_write_stderr_linefeed(text);
|
|
26
26
|
}
|
|
27
27
|
export function tell_nowhere(_message) {
|
|
@@ -49,7 +49,7 @@ export function tell_debug(message) {
|
|
|
49
49
|
tell_generic({ message, colourizer: ansi_grey });
|
|
50
50
|
}
|
|
51
51
|
export function tell_blank() {
|
|
52
|
-
|
|
52
|
+
tell_generic({ message: EMPTY });
|
|
53
53
|
}
|
|
54
54
|
export function tell_okay() {
|
|
55
55
|
if (tell_enables.okay) {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BACKTICK, LESS_THAN, MORE_THAN, QUOTE_DOUBLE, QUOTE_SINGLE, ROUND_LEFT, ROUND_RIGHT, SQUARE_LEFT, SQUARE_RIGHT, } from "./lib_char_punctuation.js";
|
|
2
|
+
import { LEFT_DOUBLE_QUOTATION_MARK, LEFT_SINGLE_QUOTATION_MARK, RIGHT_DOUBLE_QUOTATION_MARK, RIGHT_SINGLE_QUOTATION_MARK, } from "./lib_char_smart.js";
|
|
3
|
+
export function tui_quote_plain_double(s) {
|
|
4
|
+
return QUOTE_DOUBLE + s + QUOTE_DOUBLE;
|
|
5
|
+
}
|
|
6
|
+
export function tui_quote_plain_single(s) {
|
|
7
|
+
return QUOTE_SINGLE + s + QUOTE_SINGLE;
|
|
8
|
+
}
|
|
9
|
+
export function tui_quote_smart_double(s) {
|
|
10
|
+
return LEFT_DOUBLE_QUOTATION_MARK + s + RIGHT_DOUBLE_QUOTATION_MARK;
|
|
11
|
+
}
|
|
12
|
+
export function tui_quote_smart_single(s) {
|
|
13
|
+
return LEFT_SINGLE_QUOTATION_MARK + s + RIGHT_SINGLE_QUOTATION_MARK;
|
|
14
|
+
}
|
|
15
|
+
export function tui_quote_bracket_round(s) {
|
|
16
|
+
return ROUND_LEFT + s + ROUND_RIGHT;
|
|
17
|
+
}
|
|
18
|
+
export function tui_quote_bracket_square(s) {
|
|
19
|
+
return SQUARE_LEFT + s + SQUARE_RIGHT;
|
|
20
|
+
}
|
|
21
|
+
export function tui_quote_bracket_angle(s) {
|
|
22
|
+
return LESS_THAN + s + MORE_THAN;
|
|
23
|
+
}
|
|
24
|
+
export function tui_quote_backtick(s) {
|
|
25
|
+
return BACKTICK + s + BACKTICK;
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function type_guard_is_boolean(value) {
|
|
2
|
+
return typeof value === "boolean";
|
|
3
|
+
}
|
|
4
|
+
export function type_guard_is_number(value) {
|
|
5
|
+
return typeof value === "number";
|
|
6
|
+
}
|
|
7
|
+
export function type_guard_is_string(value) {
|
|
8
|
+
return typeof value === "string";
|
|
9
|
+
}
|
|
10
|
+
export function type_guard_is_object(value) {
|
|
11
|
+
return typeof value === "object" && !Array.isArray(value) && value !== null;
|
|
12
|
+
}
|
|
13
|
+
export function type_guard_is_array(value) {
|
|
14
|
+
return Array.isArray(value);
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnowennixon/diffdash",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "A command-line tool to generate Git commit messages using AI",
|
|
5
5
|
"license": "0BSD",
|
|
6
6
|
"author": "John Owen Nixon",
|
|
@@ -23,39 +23,30 @@
|
|
|
23
23
|
"@ai-sdk/deepseek": "0.2.16",
|
|
24
24
|
"@ai-sdk/google": "1.2.22",
|
|
25
25
|
"@ai-sdk/openai": "1.3.23",
|
|
26
|
-
"@openrouter/ai-sdk-provider": "0.7.
|
|
26
|
+
"@openrouter/ai-sdk-provider": "0.7.3",
|
|
27
27
|
"@requesty/ai-sdk": "0.0.9",
|
|
28
28
|
"ai": "4.3.19",
|
|
29
29
|
"ansis": "4.1.0",
|
|
30
30
|
"argparse": "2.0.1",
|
|
31
31
|
"cli-table3": "0.6.5",
|
|
32
|
+
"json5": "2.2.3",
|
|
32
33
|
"simple-git": "3.28.0",
|
|
33
34
|
"zod": "3.25.76"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@biomejs/biome": "2.1.
|
|
37
|
-
"@eslint/eslintrc": "3.3.1",
|
|
38
|
-
"@eslint/js": "9.31.0",
|
|
37
|
+
"@biomejs/biome": "2.1.2",
|
|
39
38
|
"@johnowennixon/add-shebangs": "1.1.0",
|
|
40
39
|
"@johnowennixon/chmodx": "2.0.0",
|
|
41
|
-
"@
|
|
40
|
+
"@johnowennixon/pipe-exit": "1.0.1",
|
|
42
41
|
"@types/argparse": "2.0.17",
|
|
43
|
-
"@types/node": "24.0
|
|
44
|
-
"
|
|
45
|
-
"@typescript-eslint/parser": "8.37.0",
|
|
46
|
-
"eslint": "9.31.0",
|
|
47
|
-
"eslint-import-resolver-typescript": "4.4.4",
|
|
48
|
-
"eslint-plugin-import-x": "4.16.1",
|
|
49
|
-
"eslint-plugin-sonarjs": "3.0.4",
|
|
50
|
-
"eslint-plugin-unicorn": "59.0.1",
|
|
51
|
-
"globals": "16.3.0",
|
|
52
|
-
"knip": "5.61.3",
|
|
42
|
+
"@types/node": "24.1.0",
|
|
43
|
+
"knip": "5.62.0",
|
|
53
44
|
"markdownlint-cli2": "0.18.1",
|
|
54
45
|
"npm-run-all2": "8.0.4",
|
|
55
|
-
"oxlint": "1.
|
|
46
|
+
"oxlint": "1.8.0",
|
|
47
|
+
"oxlint-tsgolint": "0.0.0-8",
|
|
56
48
|
"rimraf": "6.0.1",
|
|
57
|
-
"typescript": "5.8.3"
|
|
58
|
-
"typescript-eslint": "8.37.0"
|
|
49
|
+
"typescript": "5.8.3"
|
|
59
50
|
},
|
|
60
51
|
"scripts": {
|
|
61
52
|
"build": "run-s -ls build:clean build:tsc build:shebang build:chmod",
|
|
@@ -65,16 +56,17 @@
|
|
|
65
56
|
"build:tsc": "echo 'Transpiling TypeScript to dist (using tsc)' && tsc --erasableSyntaxOnly --libReplacement false",
|
|
66
57
|
"fix": "run-s -ls fix:biome fix:markdownlint",
|
|
67
58
|
"fix:biome": "echo 'Fixing with Biome' && biome check --write",
|
|
68
|
-
"fix:
|
|
59
|
+
"fix:docbot": "echo 'Fixing with DocBot' && docbot --remove --generate",
|
|
69
60
|
"fix:markdownlint": "echo 'Fixing with markdownlint' && markdownlint-cli2 '**/*.md' --fix",
|
|
70
61
|
"fix:oxlint": "echo 'Fixing with oxlint' && oxlint --fix",
|
|
71
|
-
"lint": "run-s -ls lint:biome lint:oxlint lint:knip lint:markdownlint",
|
|
62
|
+
"lint": "run-s -ls lint:biome lint:oxlint lint:tsgolint lint:knip lint:markdownlint",
|
|
72
63
|
"lint:biome": "echo 'Linting with Biome' && biome check",
|
|
73
|
-
"lint:
|
|
64
|
+
"lint:docbot": "echo 'Linting with DocBot' && docbot",
|
|
74
65
|
"lint:knip": "echo 'Linting with Knip' && knip",
|
|
75
66
|
"lint:markdownlint": "echo 'Linting with markdownlint' && markdownlint-cli2 '**/*.md'",
|
|
76
67
|
"lint:oxlint": "echo 'Linting with oxlint' && oxlint",
|
|
77
68
|
"lint:tsc": "echo 'Linting with tsc' && tsc --noEmit --erasableSyntaxOnly --libReplacement false",
|
|
69
|
+
"lint:tsgolint": "echo 'Linting with tsgolint' && (tsgolint | grep -A5 no-floating-promises) 2>&1 | pipe-exit",
|
|
78
70
|
"test": "run-s -ls lint build"
|
|
79
71
|
}
|
|
80
72
|
}
|