@chatcode/chatcode-cli-test 1.0.8 → 1.0.9

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 (3) hide show
  1. package/dist/cli.js +1315 -1315
  2. package/package.json +3 -15
  3. package/bin/cli.js +0 -59
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatcode/chatcode-cli-test",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "ChatCode CLI command-line coding assistant.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "type": "module",
@@ -20,14 +20,9 @@
20
20
  "scan:public-surface": "bun run scripts/public-surface-scan.mjs --fail-on-match",
21
21
  "verify:public-surface": "bun run scripts/verify-public-surface-release.mjs",
22
22
  "build": "bun run scripts/build.mjs",
23
- "build:native": "bun run scripts/build.mjs --compile",
24
- "build:native:all": "bun run scripts/build.mjs --compile --all",
25
- "build:native:win": "bun run scripts/build.mjs --compile --targets=win32-x64",
26
- "build:native:pack": "node scripts/pack-native.mjs",
27
23
  "prepublishOnly": "bun run build"
28
24
  },
29
25
  "files": [
30
- "bin/",
31
26
  "dist/cli.js",
32
27
  "dist/vendor/",
33
28
  "README.md"
@@ -113,15 +108,8 @@
113
108
  "modifiers-napi": "file:./shims/modifiers-napi",
114
109
  "url-handler-napi": "file:./shims/url-handler-napi"
115
110
  },
116
- "optionalDependencies": {
117
- "@chatcode/chatcode-cli-test-darwin-arm64": "1.0.8",
118
- "@chatcode/chatcode-cli-test-darwin-x64": "1.0.8",
119
- "@chatcode/chatcode-cli-test-linux-x64": "1.0.8",
120
- "@chatcode/chatcode-cli-test-linux-arm64": "1.0.8",
121
- "@chatcode/chatcode-cli-test-win32-x64": "1.0.8"
122
- },
123
111
  "bin": {
124
- "chatcode-cli": "./bin/cli.js",
125
- "cco": "./bin/cli.js"
112
+ "chatcode-cli": "./dist/cli.js",
113
+ "cco": "./dist/cli.js"
126
114
  }
127
115
  }
package/bin/cli.js DELETED
@@ -1,59 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Launcher shim (main package `bin`).
4
- *
5
- * Resolves the prebuilt native binary for the current platform from the
6
- * matching optional dependency (`<mainPkgName>-<os>-<arch>`) and execs it.
7
- * Those binaries are `bun build --compile` standalone executables, so the
8
- * runtime is bun — which (unlike node) delivers mouse events on Windows, so
9
- * fullscreen mouse works there.
10
- *
11
- * If no platform package is installed (unsupported platform, or
12
- * optionalDependencies skipped), it falls back to the bundled node build
13
- * (dist/cli.js). That works everywhere but, on Windows, has no fullscreen
14
- * mouse — same limitation as before.
15
- */
16
- import { spawnSync } from 'node:child_process'
17
- import { createRequire } from 'node:module'
18
- import { existsSync, readFileSync } from 'node:fs'
19
- import { dirname, join } from 'node:path'
20
- import { fileURLToPath, pathToFileURL } from 'node:url'
21
-
22
- const require = createRequire(import.meta.url)
23
- const here = dirname(fileURLToPath(import.meta.url))
24
-
25
- function resolveNativeBinary() {
26
- const key = `${process.platform}-${process.arch}`
27
- const exeName = process.platform === 'win32' ? 'chatcode-cli.exe' : 'chatcode-cli'
28
- let mainName
29
- try {
30
- mainName = JSON.parse(readFileSync(join(here, '..', 'package.json'), 'utf8')).name
31
- } catch {
32
- return null
33
- }
34
- const platformPkg = `${mainName}-${key}`
35
- try {
36
- // Resolve via the platform package's package.json (always resolvable),
37
- // then join the binary name next to it.
38
- const pkgDir = dirname(require.resolve(`${platformPkg}/package.json`))
39
- const bin = join(pkgDir, exeName)
40
- return existsSync(bin) ? bin : null
41
- } catch {
42
- return null
43
- }
44
- }
45
-
46
- const bin = resolveNativeBinary()
47
- if (bin) {
48
- // stdio:'inherit' hands the console straight to the bun binary, so it reads
49
- // mouse input itself. This node launcher never touches stdin.
50
- const res = spawnSync(bin, process.argv.slice(2), { stdio: 'inherit' })
51
- if (res.error) {
52
- console.error(`Failed to launch native binary: ${res.error.message}`)
53
- process.exit(1)
54
- }
55
- process.exit(res.status == null ? 1 : res.status)
56
- } else {
57
- // Fallback: bundled node build. Works everywhere; no Windows fullscreen mouse.
58
- await import(pathToFileURL(join(here, '..', 'dist', 'cli.js')).href)
59
- }