@lobehub/cli 0.0.164 → 0.0.166

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/dist/index.js CHANGED
@@ -65168,7 +65168,7 @@ var AcpStdioClient = class {
65168
65168
  async start() {
65169
65169
  if (this.child) return;
65170
65170
  if (this.closed) throw new Error("ACP stdio client is closed");
65171
- const spawnPlan = await resolveCliSpawnPlan(this.options.commandPath, this.options.args);
65171
+ const spawnPlan = await resolveCliSpawnPlan(this.options.commandPath, this.options.args, this.options.env);
65172
65172
  if (this.closed) throw new Error("ACP stdio client is closed");
65173
65173
  const detached = process.platform !== "win32" && (this.options.detached ?? true);
65174
65174
  const child = spawnManaged(spawnPlan.command, spawnPlan.args, {
@@ -74762,6 +74762,22 @@ const detectDshCommand = async (command = "dsh", env) => {
74762
74762
  error: `DeepSeek Harness CLI ${status.version} is too old; LobeHub needs ${DSH_MIN_VERSION} or newer. Update it with: npm i -g @deepseek-ai/dsh`
74763
74763
  };
74764
74764
  };
74765
+ /**
74766
+ * The `dsh` binary a session should spawn, with the PATH that validated it.
74767
+ * A custom command is used verbatim; the default one is re-detected so a CLI
74768
+ * installed after the host started (a fresh registry PATH on Windows, a new
74769
+ * login-shell PATH elsewhere) still launches instead of failing with ENOENT.
74770
+ */
74771
+ const resolveDshSpawnCommand = async (command, env) => {
74772
+ const requested = command?.trim();
74773
+ if (requested && requested !== "dsh") return { command: requested };
74774
+ const detected = await detectDshCommand("dsh", env).catch(() => void 0);
74775
+ return detected?.available && detected.path ? {
74776
+ command: detected.path,
74777
+ pathEnv: detected.resolvedPathEnv,
74778
+ version: detected.version
74779
+ } : { command: "dsh" };
74780
+ };
74765
74781
  /** Select the CLI's shipped ACP profile, served on stdio until disconnect. */
74766
74782
  const DSH_ACP_PROFILE_ARGS = ["--profile", "acp"];
74767
74783
  /** The profile boots its plugin tree before answering `initialize`. */
@@ -76155,7 +76171,7 @@ const spawnCliAgent = async (options, command, cwd, inputPlan, childEnv, codexJw
76155
76171
  home: childEnv.HOME,
76156
76172
  sessionId: options.resumeSessionId
76157
76173
  }) : void 0;
76158
- const cliSpawnPlan = await resolveCliSpawnPlan(command, args);
76174
+ const cliSpawnPlan = await resolveCliSpawnPlan(command, args, childEnv);
76159
76175
  const detached = platform() !== "win32" && (options.detached ?? true);
76160
76176
  const startedAt = Date.now();
76161
76177
  const proc = spawnManaged(cliSpawnPlan.command, cliSpawnPlan.args, {
@@ -306298,7 +306314,7 @@ const listHeterogeneousAgentModels = async (params) => {
306298
306314
  "list",
306299
306315
  "--json"
306300
306316
  ] : params.type === "pi" ? buildPiCatalogArgs(params.args) : ["--list-models"];
306301
- const spawnPlan = await resolveCliSpawnPlan(resolved.command, args);
306317
+ const spawnPlan = await resolveCliSpawnPlan(resolved.command, args, env);
306302
306318
  const { stderr, stdout } = await execFilePromise(spawnPlan.command, spawnPlan.args, {
306303
306319
  cwd,
306304
306320
  encoding: "utf8",
@@ -583278,7 +583294,7 @@ var RpcStdioClient = class {
583278
583294
  */
583279
583295
  async start() {
583280
583296
  if (this.child || this.closed) return;
583281
- const spawnPlan = await resolveCliSpawnPlan(this.options.commandPath, this.options.args);
583297
+ const spawnPlan = await resolveCliSpawnPlan(this.options.commandPath, this.options.args, this.options.env);
583282
583298
  if (this.closed) return;
583283
583299
  const child = spawnManaged(spawnPlan.command, spawnPlan.args, {
583284
583300
  cwd: this.options.cwd,
@@ -585346,13 +585362,15 @@ const exec = async (options) => {
585346
585362
  session?.dispose().catch(() => {});
585347
585363
  };
585348
585364
  try {
585365
+ const dshCommand = await resolveDshSpawnCommand(options.command);
585349
585366
  session = spawnDshAcpSession({
585350
585367
  args: options.agentArg,
585351
585368
  clientVersion: "lobehub-cli",
585352
- command: options.command,
585369
+ command: dshCommand.command,
585353
585370
  cwd: options.cwd || process.cwd(),
585354
585371
  env: buildAgentProcessEnv({
585355
585372
  operationId: serverIngest ? operationId : void 0,
585373
+ pathEnv: dshCommand.pathEnv,
585356
585374
  topicId: options.topic
585357
585375
  }),
585358
585376
  model: options.model,
package/man/man1/lh.1 CHANGED
@@ -1,6 +1,6 @@
1
1
  .\" Code generated by `npm run man:generate`; DO NOT EDIT.
2
2
  .\" Manual command details come from the Commander command tree.
3
- .TH LH 1 "" "@lobehub/cli 0.0.164" "User Commands"
3
+ .TH LH 1 "" "@lobehub/cli 0.0.166" "User Commands"
4
4
  .SH NAME
5
5
  lh \- LobeHub CLI \- manage and connect to LobeHub services
6
6
  .SH SYNOPSIS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/cli",
3
- "version": "0.0.164",
3
+ "version": "0.0.166",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/lobehub/lobehub",
@@ -83,5 +83,5 @@
83
83
  "access": "public",
84
84
  "registry": "https://registry.npmjs.org"
85
85
  },
86
- "gitHead": "3bdcf55a4329e37e6ffb060c2d63214a2cdab38f"
86
+ "gitHead": "7e89e67daa82d38b037a7ea435c4c1c4a9aba635"
87
87
  }