@llmist/cli 11.1.0 → 12.0.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 CHANGED
@@ -12,8 +12,8 @@
12
12
 
13
13
  ```bash
14
14
  npm install -g @llmist/cli
15
- # or
16
- bunx @llmist/cli
15
+ # or run directly with npx:
16
+ npx @llmist/cli
17
17
  ```
18
18
 
19
19
  ## Quick Start
package/dist/cli.js CHANGED
@@ -76,7 +76,7 @@ import { Command, InvalidArgumentError as InvalidArgumentError2 } from "commande
76
76
  // package.json
77
77
  var package_default = {
78
78
  name: "@llmist/cli",
79
- version: "11.1.0",
79
+ version: "12.0.0",
80
80
  description: "CLI for llmist - run LLM agents from the command line",
81
81
  type: "module",
82
82
  main: "dist/cli.js",
@@ -101,7 +101,6 @@ var package_default = {
101
101
  scripts: {
102
102
  build: "tsup",
103
103
  typecheck: "tsc --noEmit",
104
- test: "bun test src",
105
104
  clean: "rimraf dist",
106
105
  postinstall: "node scripts/postinstall.js"
107
106
  },
@@ -148,7 +147,6 @@ var package_default = {
148
147
  "@types/js-yaml": "^4.0.9",
149
148
  "@types/marked-terminal": "^6.1.1",
150
149
  "@types/node": "^20.12.7",
151
- "bun-types": "^1.3.2",
152
150
  rimraf: "^5.0.5",
153
151
  tsup: "^8.3.5",
154
152
  typescript: "^5.4.5"
@@ -1339,23 +1337,6 @@ import { createGadget as createGadget2 } from "llmist";
1339
1337
 
1340
1338
  // src/spawn.ts
1341
1339
  import { spawn as nodeSpawn } from "child_process";
1342
- var isBun = typeof Bun !== "undefined";
1343
- function adaptBunProcess(proc) {
1344
- return {
1345
- exited: proc.exited,
1346
- stdout: proc.stdout ?? null,
1347
- stderr: proc.stderr ?? null,
1348
- stdin: proc.stdin ? {
1349
- write(data) {
1350
- proc.stdin?.write(data);
1351
- },
1352
- end() {
1353
- proc.stdin?.end();
1354
- }
1355
- } : null,
1356
- kill: () => proc.kill()
1357
- };
1358
- }
1359
1340
  function nodeStreamToReadableStream(nodeStream) {
1360
1341
  if (!nodeStream) return null;
1361
1342
  return new ReadableStream({
@@ -1376,9 +1357,6 @@ function nodeStreamToReadableStream(nodeStream) {
1376
1357
  });
1377
1358
  }
1378
1359
  function spawn(argv, options = {}) {
1379
- if (isBun) {
1380
- return adaptBunProcess(Bun.spawn(argv, options));
1381
- }
1382
1360
  const [command, ...args] = argv;
1383
1361
  const proc = nodeSpawn(command, args, {
1384
1362
  cwd: options.cwd,
@@ -2023,36 +2001,19 @@ async function installNpmPackage(spec, cacheDir) {
2023
2001
  fs5.writeFileSync(path4.join(cacheDir, "package.json"), JSON.stringify(packageJson, null, 2));
2024
2002
  const packageSpec = spec.version ? `${spec.package}@${spec.version}` : spec.package;
2025
2003
  const quietEnv = { ...process.env, DISABLE_OPENCOLLECTIVE: "1", ADBLOCK: "1" };
2026
- if (isCommandAvailable("npm")) {
2027
- const installCmd = `npm install --foreground-scripts --loglevel=error "${packageSpec}"`;
2028
- try {
2029
- execSync(installCmd, { stdio: "inherit", cwd: cacheDir, env: quietEnv });
2030
- return;
2031
- } catch (error) {
2032
- const message = error instanceof Error ? error.message : String(error);
2033
- throw new Error(`Failed to install npm package '${packageSpec}': ${message}`);
2034
- }
2035
- }
2036
- if (isCommandAvailable("bun")) {
2037
- console.warn(
2038
- "\u26A0\uFE0F npm not found, using bun. Postinstall scripts for subdependencies may not run.\n For best results, install npm: https://nodejs.org/"
2004
+ if (!isCommandAvailable("npm")) {
2005
+ throw new Error(
2006
+ `npm is not available to install '${packageSpec}'.
2007
+ Please install Node.js: https://nodejs.org/`
2039
2008
  );
2040
- const installCmd = `bun add --trust "${packageSpec}"`;
2041
- try {
2042
- execSync(installCmd, { stdio: "inherit", cwd: cacheDir, env: quietEnv });
2043
- return;
2044
- } catch (error) {
2045
- const message = error instanceof Error ? error.message : String(error);
2046
- throw new Error(`Failed to install package '${packageSpec}' with bun: ${message}`);
2047
- }
2048
2009
  }
2049
- throw new Error(
2050
- `No package manager available to install '${packageSpec}'.
2051
- Please install npm (recommended) or bun:
2052
- - npm: https://nodejs.org/
2053
- - bun: https://bun.sh/
2054
- npm is preferred because it runs all postinstall scripts reliably.`
2055
- );
2010
+ const installCmd = `npm install --foreground-scripts --loglevel=error "${packageSpec}"`;
2011
+ try {
2012
+ execSync(installCmd, { stdio: "inherit", cwd: cacheDir, env: quietEnv });
2013
+ } catch (error) {
2014
+ const message = error instanceof Error ? error.message : String(error);
2015
+ throw new Error(`Failed to install npm package '${packageSpec}': ${message}`);
2016
+ }
2056
2017
  }
2057
2018
  async function installGitPackage(spec, cacheDir) {
2058
2019
  fs5.mkdirSync(path4.dirname(cacheDir), { recursive: true });
@@ -2076,25 +2037,20 @@ async function installGitPackage(spec, cacheDir) {
2076
2037
  }
2077
2038
  if (fs5.existsSync(path4.join(cacheDir, "package.json"))) {
2078
2039
  const hasNpm = isCommandAvailable("npm");
2079
- const hasBun = isCommandAvailable("bun");
2080
- if (!hasNpm && !hasBun) {
2040
+ if (!hasNpm) {
2081
2041
  throw new Error(
2082
- `No package manager available to install dependencies for '${spec.package}'.
2083
- Please install npm or bun:
2084
- - npm: https://nodejs.org/
2085
- - bun: https://bun.sh/`
2042
+ `npm is not available to install dependencies for '${spec.package}'.
2043
+ Please install Node.js: https://nodejs.org/`
2086
2044
  );
2087
2045
  }
2088
- const useBun = hasBun;
2089
- const installCmd = useBun ? "bun install" : "npm install --foreground-scripts --loglevel=error";
2090
- const runCmd = useBun ? "bun run" : "npm run";
2091
- const pmName = useBun ? "bun" : "npm";
2046
+ const installCmd = "npm install --foreground-scripts --loglevel=error";
2047
+ const runCmd = "npm run";
2092
2048
  const quietEnv = { ...process.env, DISABLE_OPENCOLLECTIVE: "1", ADBLOCK: "1" };
2093
2049
  try {
2094
2050
  execSync(installCmd, { cwd: cacheDir, stdio: "inherit", env: quietEnv });
2095
2051
  } catch (error) {
2096
2052
  const message = error instanceof Error ? error.message : String(error);
2097
- throw new Error(`Failed to install dependencies for '${spec.package}' using ${pmName}: ${message}`);
2053
+ throw new Error(`Failed to install dependencies for '${spec.package}' using npm: ${message}`);
2098
2054
  }
2099
2055
  const packageJson = JSON.parse(fs5.readFileSync(path4.join(cacheDir, "package.json"), "utf-8"));
2100
2056
  if (packageJson.scripts?.build) {