kronk-cli 0.6.1 → 0.8.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 +226 -21
- package/package.json +1 -1
- package/src/agent.js +16 -4
- package/src/argv.js +11 -1
- package/src/boot.js +35 -2
- package/src/config.js +21 -3
- package/src/index.js +87 -28
- package/src/mcp.js +4 -1
- package/src/pane.js +276 -0
- package/src/rescue.js +306 -0
- package/src/rescueStore.js +277 -0
- package/src/resolve.js +27 -0
- package/src/setup.js +16 -3
- package/src/subagent.js +186 -30
- package/src/tasklog.js +7 -1
- package/src/ui.js +20 -6
- package/src/update.js +291 -0
- package/src/version.js +35 -0
package/src/version.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The one place that reads this package's own version.
|
|
5
|
+
*
|
|
6
|
+
* Everything that needs to say what build this is — the `--version` flag, the
|
|
7
|
+
* MCP `clientInfo` handshake, the update check's idea of "current" — imports
|
|
8
|
+
* `VERSION` from here instead of carrying its own copy. `src/mcp.js` used to
|
|
9
|
+
* hardcode `'0.1.0'` and nothing ever noticed it had fallen six releases
|
|
10
|
+
* behind, because nothing read the real number. `package.json` is in the
|
|
11
|
+
* published `files` allowlist, so this works on every install route: npm,
|
|
12
|
+
* Homebrew, the install script, and a git checkout all ship the real file.
|
|
13
|
+
*/
|
|
14
|
+
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
|
|
15
|
+
|
|
16
|
+
export const VERSION = pkg.version;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* `kronk version 1.32.7\n` -> `1.32.7`. `runKronk(['--version'])` is the one
|
|
20
|
+
* door this program uses to ask the `kronk` binary anything, and this is the
|
|
21
|
+
* one place that makes sense of what comes back. Falls back to the first line
|
|
22
|
+
* rather than to null, on the theory that an unexpected format is still more
|
|
23
|
+
* informative on screen than nothing — but only the first line, and only so
|
|
24
|
+
* much of it: `runKronk` captures up to CAPTURE_CAP of whatever the binary
|
|
25
|
+
* decided to print, and `--version` is one line of output, not a place to
|
|
26
|
+
* empty a stack trace into.
|
|
27
|
+
*/
|
|
28
|
+
const STRAY_MAX = 60;
|
|
29
|
+
|
|
30
|
+
export function parseKronkVersion(stdout) {
|
|
31
|
+
const m = String(stdout).match(/version\s+(\S+)/i);
|
|
32
|
+
if (m) return m[1];
|
|
33
|
+
const first = String(stdout).split('\n')[0].trim();
|
|
34
|
+
return first ? first.slice(0, STRAY_MAX) : null;
|
|
35
|
+
}
|