dimcode 0.0.67-beta.31 → 0.0.67-beta.36

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.
Files changed (2) hide show
  1. package/bin/dim.mjs +17 -6
  2. package/package.json +6 -6
package/bin/dim.mjs CHANGED
@@ -11,14 +11,25 @@ const __dirname = path.dirname(__filename)
11
11
  const isWindows = os.platform() === 'win32'
12
12
 
13
13
  let wrapperVersion = ''
14
+ let wrapperName = 'dimcode'
14
15
  try {
15
16
  const pkg = JSON.parse(
16
17
  fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'),
17
18
  )
18
19
  wrapperVersion = pkg.version || ''
20
+ if (pkg.name)
21
+ wrapperName = pkg.name
19
22
  }
20
23
  catch {}
21
24
 
25
+ // Inner binary file name shipped inside each platform sub-package's bin/.
26
+ // dimcode → bin/dimcode(.exe); goatchain-cli → bin/goatchain(.exe).
27
+ const BINARY_BASENAMES = {
28
+ 'dimcode': 'dimcode',
29
+ 'goatchain-cli': 'goatchain',
30
+ }
31
+ const binaryBasename = BINARY_BASENAMES[wrapperName] || wrapperName
32
+
22
33
  const wrapperDir = path.join(__dirname, '..').replace(/\\/g, '/').toLowerCase()
23
34
  const wrapperPm
24
35
  = wrapperDir.includes('.bun/') || wrapperDir.includes('bun/install/')
@@ -49,11 +60,11 @@ function runOpentui(restArgs) {
49
60
  const archMap = { x64: 'x64', arm64: 'arm64' }
50
61
  const platform = platformMap[os.platform()] || os.platform()
51
62
  const arch = archMap[os.arch()] || os.arch()
52
- const base = 'dimcode-' + platform + '-' + arch
53
- const binary = platform === 'windows' ? 'dimcode.exe' : 'dimcode'
63
+ const base = wrapperName + '-' + platform + '-' + arch
64
+ const binary = platform === 'windows' ? binaryBasename + '.exe' : binaryBasename
54
65
 
55
66
  if (process.env.DIMCODE_DEBUG) {
56
- console.error('[dim] Wrapper version: ' + wrapperVersion)
67
+ console.error('[dim] Wrapper: ' + wrapperName + '@' + wrapperVersion)
57
68
  console.error('[dim] Platform: ' + platform + ' Arch: ' + arch)
58
69
  console.error('[dim] Looking for package: ' + base)
59
70
  console.error('[dim] Script dir: ' + scriptDir)
@@ -70,7 +81,7 @@ function runOpentui(restArgs) {
70
81
  + ' Searched: ' + scriptDir + ' (and parent directories)\n'
71
82
  + '\n'
72
83
  + 'Try uninstalling and reinstalling the beta channel:\n'
73
- + ' npm uninstall -g dimcode && npm install -g dimcode@beta\n',
84
+ + ' npm uninstall -g ' + wrapperName + ' && npm install -g ' + wrapperName + '@beta\n',
74
85
  )
75
86
  process.exit(1)
76
87
  }
@@ -100,7 +111,7 @@ function findBinary(startDir, base, binary) {
100
111
  function spawnBinary(target, forwardedArgs) {
101
112
  const env = {
102
113
  ...process.env,
103
- DIMCODE_NPM_PACKAGE: 'dimcode',
114
+ DIMCODE_NPM_PACKAGE: wrapperName,
104
115
  DIMCODE_NPM_PACKAGE_MANAGER: wrapperPm,
105
116
  DIMCODE_NPM_PACKAGE_ROOT: path.resolve(__dirname, '..'),
106
117
  }
@@ -124,7 +135,7 @@ function spawnBinary(target, forwardedArgs) {
124
135
  '[dim] The binary file was not found. Try reinstalling:',
125
136
  )
126
137
  console.error(
127
- ' npm uninstall -g dimcode && npm install -g dimcode@beta',
138
+ ' npm uninstall -g ' + wrapperName + ' && npm install -g ' + wrapperName + '@beta',
128
139
  )
129
140
  }
130
141
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dimcode",
3
- "version": "0.0.67-beta.31",
3
+ "version": "0.0.67-beta.36",
4
4
  "description": "AI coding agent CLI and terminal coding assistant with an interactive TUI (beta channel)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,10 +11,10 @@
11
11
  "bin"
12
12
  ],
13
13
  "optionalDependencies": {
14
- "dimcode-darwin-arm64": "0.0.67-beta.31",
15
- "dimcode-darwin-x64": "0.0.67-beta.31",
16
- "dimcode-linux-arm64": "0.0.67-beta.31",
17
- "dimcode-linux-x64": "0.0.67-beta.31",
18
- "dimcode-windows-x64": "0.0.67-beta.31"
14
+ "dimcode-darwin-arm64": "0.0.67-beta.36",
15
+ "dimcode-darwin-x64": "0.0.67-beta.36",
16
+ "dimcode-linux-arm64": "0.0.67-beta.36",
17
+ "dimcode-linux-x64": "0.0.67-beta.36",
18
+ "dimcode-windows-x64": "0.0.67-beta.36"
19
19
  }
20
20
  }