goatchain-cli 0.0.67-beta.0 → 0.0.67-beta.10
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/bin/goatchain.mjs +3 -48
- package/package.json +7 -8
- package/dist/ink.mjs +0 -1297
package/bin/goatchain.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import fs from 'node:fs'
|
|
|
4
4
|
import os from 'node:os'
|
|
5
5
|
import path from 'node:path'
|
|
6
6
|
import process from 'node:process'
|
|
7
|
-
import { fileURLToPath
|
|
7
|
+
import { fileURLToPath } from 'node:url'
|
|
8
8
|
|
|
9
9
|
const __filename = fileURLToPath(import.meta.url)
|
|
10
10
|
const __dirname = path.dirname(__filename)
|
|
@@ -26,53 +26,8 @@ const wrapperPm
|
|
|
26
26
|
: 'npm'
|
|
27
27
|
|
|
28
28
|
const args = process.argv.slice(2)
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
if (routing.target === 'opentui') {
|
|
32
|
-
runOpentui(routing.forwardArgs)
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
await runInk()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function resolveRouting(argv) {
|
|
39
|
-
// Explicit `goatchain ink ...` forces the Ink TUI.
|
|
40
|
-
if (argv[0] === 'ink')
|
|
41
|
-
return { target: 'ink', forwardArgs: argv.slice(1) }
|
|
42
|
-
// Explicit `goatchain opentui ...` also routes to the opentui binary
|
|
43
|
-
// (kept for backwards compatibility; opentui is now the default).
|
|
44
|
-
if (argv[0] === 'opentui')
|
|
45
|
-
return { target: 'opentui', forwardArgs: argv.slice(1) }
|
|
46
|
-
|
|
47
|
-
// Default: everything goes to the opentui binary.
|
|
48
|
-
return { target: 'opentui', forwardArgs: argv }
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async function runInk() {
|
|
52
|
-
const inkEntry = path.join(__dirname, '..', 'dist', 'ink.mjs')
|
|
53
|
-
if (!fs.existsSync(inkEntry)) {
|
|
54
|
-
console.error('[goatchain] Ink bundle missing: ' + inkEntry)
|
|
55
|
-
console.error('[goatchain] Try reinstalling goatchain-cli.')
|
|
56
|
-
process.exit(1)
|
|
57
|
-
}
|
|
58
|
-
// Inject wrapper identity so the in-process upgrade check targets the
|
|
59
|
-
// npm wrapper package rather than upstream `dimcode`.
|
|
60
|
-
process.env.DIMCODE_NPM_PACKAGE = 'goatchain-cli'
|
|
61
|
-
process.env.DIMCODE_NPM_PACKAGE_MANAGER = wrapperPm
|
|
62
|
-
// goatchain-cli is a beta-only channel: ignore any stable releases on the
|
|
63
|
-
// registry when deciding whether to upgrade.
|
|
64
|
-
process.env.DIMCODE_NPM_PACKAGE_BETA_ONLY = '1'
|
|
65
|
-
if (wrapperVersion)
|
|
66
|
-
process.env.DIMCODE_NPM_PACKAGE_VERSION = wrapperVersion
|
|
67
|
-
try {
|
|
68
|
-
await import(pathToFileURL(inkEntry).href)
|
|
69
|
-
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
console.error('[goatchain] Failed to start Ink TUI:')
|
|
72
|
-
console.error(err)
|
|
73
|
-
process.exit(1)
|
|
74
|
-
}
|
|
75
|
-
}
|
|
29
|
+
const forwardArgs = args[0] === 'opentui' ? args.slice(1) : args
|
|
30
|
+
runOpentui(forwardArgs)
|
|
76
31
|
|
|
77
32
|
function runOpentui(restArgs) {
|
|
78
33
|
const envPath = process.env.DIMCODE_BIN_PATH
|
package/package.json
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "goatchain-cli",
|
|
3
|
-
"version": "0.0.67-beta.
|
|
3
|
+
"version": "0.0.67-beta.10",
|
|
4
4
|
"description": "dimcode - AI coding agent CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"goatchain": "./bin/goatchain.mjs"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"bin"
|
|
11
|
-
"dist"
|
|
10
|
+
"bin"
|
|
12
11
|
],
|
|
13
12
|
"optionalDependencies": {
|
|
14
|
-
"dimcode-darwin-arm64": "0.0.67-beta.
|
|
15
|
-
"dimcode-darwin-x64": "0.0.67-beta.
|
|
16
|
-
"dimcode-linux-arm64": "0.0.67-beta.
|
|
17
|
-
"dimcode-linux-x64": "0.0.67-beta.
|
|
18
|
-
"dimcode-windows-x64": "0.0.67-beta.
|
|
13
|
+
"dimcode-darwin-arm64": "0.0.67-beta.10",
|
|
14
|
+
"dimcode-darwin-x64": "0.0.67-beta.10",
|
|
15
|
+
"dimcode-linux-arm64": "0.0.67-beta.10",
|
|
16
|
+
"dimcode-linux-x64": "0.0.67-beta.10",
|
|
17
|
+
"dimcode-windows-x64": "0.0.67-beta.10"
|
|
19
18
|
}
|
|
20
19
|
}
|