kob-cli 1.0.6 → 1.0.20
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/package.json +6 -7
- package/src/scripts/release.ts +32 -5
- package/src/ui/code-tui.tsx +2 -5
- package/src/ui/config-form.tsx +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kob-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"description": "KOB CLI — AI-powered code generation tool. Built by Kob AI, made in Thailand.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -21,12 +21,11 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"dev": "bun run src/index.ts",
|
|
23
23
|
"start": "bun run src/index.ts",
|
|
24
|
-
"build": "bun
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"release:
|
|
28
|
-
"release:
|
|
29
|
-
"release:major": "npm version major --no-git-tag-version && npm publish"
|
|
24
|
+
"build": "bun run src/scripts/release.ts",
|
|
25
|
+
"build:only": "bun build src/index.ts --compile --outfile kob-cli",
|
|
26
|
+
"release:patch": "bun run src/scripts/release.ts patch",
|
|
27
|
+
"release:minor": "bun run src/scripts/release.ts minor",
|
|
28
|
+
"release:major": "bun run src/scripts/release.ts major"
|
|
30
29
|
},
|
|
31
30
|
"engines": {
|
|
32
31
|
"node": ">=18.0.0"
|
package/src/scripts/release.ts
CHANGED
|
@@ -2,15 +2,42 @@ import { readFileSync, writeFileSync } from 'fs';
|
|
|
2
2
|
import { execSync } from 'child_process';
|
|
3
3
|
import { resolve } from 'path';
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const root = resolve(import.meta.dir, '../..');
|
|
6
|
+
const pkgPath = resolve(root, 'package.json');
|
|
6
7
|
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
7
8
|
|
|
9
|
+
const bumpType = (process.argv[2] as 'patch' | 'minor' | 'major') || 'patch';
|
|
10
|
+
const idx = { patch: 2, minor: 1, major: 0 }[bumpType];
|
|
8
11
|
const parts = pkg.version.split('.').map(Number);
|
|
9
|
-
parts[
|
|
12
|
+
parts[idx] += 1;
|
|
13
|
+
if (bumpType === 'major') parts[1] = 0;
|
|
14
|
+
if (bumpType !== 'patch') parts[2] = 0;
|
|
10
15
|
pkg.version = parts.join('.');
|
|
11
16
|
|
|
12
17
|
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
13
|
-
console.log(`\n 📦 ${pkg.name}@${pkg.version}\n`);
|
|
18
|
+
console.log(`\n 📦 ${pkg.name}@${pkg.version} (${bumpType})\n`);
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
execSync('
|
|
20
|
+
try {
|
|
21
|
+
execSync('bun run build:only', { stdio: 'inherit', cwd: root });
|
|
22
|
+
} catch (e) {
|
|
23
|
+
console.error('❌ build failed — skipping publish & push');
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
execSync('npm publish --ignore-scripts', { stdio: 'inherit', cwd: root });
|
|
29
|
+
} catch (e) {
|
|
30
|
+
console.error('❌ publish failed — version bumped, please check npm');
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
execSync('git add package.json', { stdio: 'inherit', cwd: root });
|
|
36
|
+
execSync(`git commit -m "release: v${pkg.version}"`, { stdio: 'inherit', cwd: root });
|
|
37
|
+
execSync('git push', { stdio: 'inherit', cwd: root });
|
|
38
|
+
execSync('git tag v' + pkg.version, { stdio: 'inherit', cwd: root });
|
|
39
|
+
execSync('git push --tags', { stdio: 'inherit', cwd: root });
|
|
40
|
+
console.log(`\n ✅ released v${pkg.version}\n`);
|
|
41
|
+
} catch (e) {
|
|
42
|
+
console.error('⚠️ git push failed (published ok) — please push manually');
|
|
43
|
+
}
|
package/src/ui/code-tui.tsx
CHANGED
|
@@ -1510,7 +1510,7 @@ function CodeEngine() {
|
|
|
1510
1510
|
setMode('code');
|
|
1511
1511
|
showBanner('◆ mode → Code');
|
|
1512
1512
|
return true;
|
|
1513
|
-
case '
|
|
1513
|
+
case 'newchat':
|
|
1514
1514
|
setExchanges([]);
|
|
1515
1515
|
messagesRef.current = [];
|
|
1516
1516
|
exchangesLenRef.current = 0;
|
|
@@ -1539,7 +1539,7 @@ function CodeEngine() {
|
|
|
1539
1539
|
return true;
|
|
1540
1540
|
case 'help':
|
|
1541
1541
|
case '?':
|
|
1542
|
-
showBanner('◆ /ask /plan /code /
|
|
1542
|
+
showBanner('◆ /ask /plan /code /newchat /reset /models /config /help /exit');
|
|
1543
1543
|
return true;
|
|
1544
1544
|
case 'exit':
|
|
1545
1545
|
case 'quit':
|
|
@@ -1677,9 +1677,6 @@ function CodeEngine() {
|
|
|
1677
1677
|
setModel(modelId);
|
|
1678
1678
|
configRef.current = { ...configRef.current, modelId };
|
|
1679
1679
|
setPalette(null);
|
|
1680
|
-
setExchanges([]);
|
|
1681
|
-
messagesRef.current = [];
|
|
1682
|
-
exchangesLenRef.current = 0;
|
|
1683
1680
|
showBanner(`◆ model → ${displayName} (${modelId})`);
|
|
1684
1681
|
}}
|
|
1685
1682
|
onClose={() => setPalette(null)}
|
package/src/ui/config-form.tsx
CHANGED
|
@@ -52,6 +52,16 @@ export function ConfigForm({ onDone }: Props) {
|
|
|
52
52
|
}, [idx]);
|
|
53
53
|
|
|
54
54
|
useInput((input, key) => {
|
|
55
|
+
// After saving we're just waiting for the user to acknowledge —
|
|
56
|
+
// any key (Enter / Esc / printable) closes the overlay so focus
|
|
57
|
+
// returns to the chat. Without this, the form would lock the
|
|
58
|
+
// keyboard: InputBox is also disabled while configOpen is true.
|
|
59
|
+
if (saved) {
|
|
60
|
+
if (input || key.return || key.escape || key.backspace || key.tab) {
|
|
61
|
+
onDone(true);
|
|
62
|
+
}
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
55
65
|
if (!editing) return;
|
|
56
66
|
if (key.escape) {
|
|
57
67
|
onDone(false);
|