Files
kandev/apps/cli/package.json
T
José Almeida 1c8b3075af feat(cli): replace self-update with package-manager-owned runtime resolution
The CLI no longer downloads runtime bundles from GitHub on first run. Instead:

- A new resolveRuntime() in apps/cli/src/runtime.ts resolves the bundle in
  three steps: KANDEV_BUNDLE_DIR env var (Homebrew wrapper, tests) → installed
  @kdlbs/runtime-{platform} npm package → cached download (only when
  --runtime-version is given explicitly).
- apps/cli/src/run.ts is split: launch logic separated from download logic.
  The download path stays for the explicit --runtime-version flag only.
- The --version flag now prints CLI semver (was: runtime tag selector). The
  old behavior moves to --runtime-version, documented as advanced/debug.
- The npm self-update prompt (apps/cli/src/update.ts) is removed entirely.
- apps/cli/package.json declares optionalDependencies for five
  @kdlbs/runtime-{platform} packages and engines.npm: ">=7" (required for
  optional-dep resolution during npx).
- Adds esbuild + a "bundle" script that produces dist/cli.bundle.js — a
  single-file CJS bundle with all Node deps inlined. The Homebrew formula
  uses this; the npm package keeps the unbundled dist/cli.js.

Tests: 130/130 passing. Bundle smoke-tested in a directory with no
node_modules to confirm tree-kill is correctly inlined.
2026-05-04 22:44:26 +01:00

46 lines
1.1 KiB
JSON

{
"name": "kandev",
"version": "0.17.0",
"private": false,
"description": "Launcher for Kandev — manage tasks, orchestrate agents, review changes, and ship value",
"license": "AGPL-3.0-only",
"type": "commonjs",
"bin": {
"kandev": "bin/cli.js"
},
"main": "dist/cli.js",
"files": [
"bin",
"dist"
],
"engines": {
"npm": ">=7"
},
"optionalDependencies": {
"@kdlbs/runtime-linux-x64": "0.16.0",
"@kdlbs/runtime-linux-arm64": "0.16.0",
"@kdlbs/runtime-darwin-x64": "0.16.0",
"@kdlbs/runtime-darwin-arm64": "0.16.0",
"@kdlbs/runtime-win32-x64": "0.16.0"
},
"dependencies": {
"tar": "^7.5.11",
"tree-kill": "^1.2.2"
},
"devDependencies": {
"@types/node": "^20",
"esbuild": "^0.24.0",
"tsx": "^4.15.7",
"typescript": "^5",
"vitest": "^1.6.0"
},
"scripts": {
"dev": "unset npm_config_prefix && tsx src/cli.ts",
"build": "tsc -p tsconfig.json",
"bundle": "esbuild dist/cli.js --bundle --platform=node --format=cjs --outfile=dist/cli.bundle.js",
"start": "node dist/cli.js",
"test": "vitest run",
"prepublishOnly": "pnpm build"
}
}