@lichao0223/lobehub-cli 0.0.80 → 0.0.82

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
@@ -2,7 +2,7 @@
2
2
  import { createRequire } from "node:module";
3
3
  import crypto$1, { X509Certificate, createHash, randomBytes, randomUUID, sign } from "node:crypto";
4
4
  import * as fs$5 from "node:fs";
5
- import fs, { appendFileSync, closeSync, constants, createReadStream, createWriteStream, existsSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, readlinkSync, realpathSync, rmSync, statSync, symlinkSync, unlink, writeFileSync } from "node:fs";
5
+ import fs, { appendFileSync, closeSync, constants, createReadStream, createWriteStream, existsSync, fstatSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, readlinkSync, realpathSync, rmSync, statSync, symlinkSync, unlink, writeFileSync } from "node:fs";
6
6
  import * as os$4 from "node:os";
7
7
  import os, { EOL, constants as constants$1, homedir, platform, tmpdir } from "node:os";
8
8
  import * as path$4 from "node:path";
@@ -9469,11 +9469,15 @@ var init_brief = __esmMin((() => {}));
9469
9469
 
9470
9470
  //#endregion
9471
9471
  //#region ../../packages/types/src/channel.ts
9472
- var LOCAL_EXECUTION_RUNTIMES, CHANNEL_RUNTIMES;
9472
+ var REMOTE_RUNTIMES, CHANNEL_RUNTIMES;
9473
9473
  var init_channel = __esmMin((() => {
9474
9474
  init_heterogeneousAgent();
9475
- LOCAL_EXECUTION_RUNTIMES = LocalExecutionHeterogeneousAgentTypeSchema.options;
9476
- CHANNEL_RUNTIMES = ["native", ...LOCAL_EXECUTION_RUNTIMES];
9475
+ REMOTE_RUNTIMES = REMOTE_HETEROGENEOUS_AGENT_CONFIGS.map(({ type }) => type);
9476
+ CHANNEL_RUNTIMES = [
9477
+ "native",
9478
+ ...LocalExecutionHeterogeneousAgentTypeSchema.options,
9479
+ ...REMOTE_RUNTIMES
9480
+ ];
9477
9481
  }));
9478
9482
 
9479
9483
  //#endregion
@@ -24140,7 +24144,7 @@ const GOMS_KLM_TIMING_SECONDS = {
24140
24144
  };
24141
24145
 
24142
24146
  //#endregion
24143
- //#region node_modules/.pnpm/@trpc+server@11.28.3_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/observable-CodTG6Sf.mjs
24147
+ //#region node_modules/.pnpm/@trpc+server@11.29.4_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/observable-CodTG6Sf.mjs
24144
24148
  /**
24145
24149
  * Creates an observable. `subscribe` runs for each subscriber, and can
24146
24150
  * return a function that cleans up when it unsubscribes.
@@ -24366,7 +24370,7 @@ function observableToAsyncIterable(observable, signal) {
24366
24370
  }
24367
24371
 
24368
24372
  //#endregion
24369
- //#region node_modules/.pnpm/@trpc+server@11.28.3_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/observable-BjUZYMQq.mjs
24373
+ //#region node_modules/.pnpm/@trpc+server@11.29.4_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/observable-BjUZYMQq.mjs
24370
24374
  /**
24371
24375
  * Shares one subscription to the source between all subscribers. It
24372
24376
  * starts with the first subscriber and ends when the last unsubscribes.
@@ -24492,7 +24496,7 @@ function behaviorSubject(initialValue) {
24492
24496
  }
24493
24497
 
24494
24498
  //#endregion
24495
- //#region node_modules/.pnpm/@trpc+client@11.28.3_@trpc+server@11.28.3_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/splitLink-PFsRy7Mf.mjs
24499
+ //#region node_modules/.pnpm/@trpc+client@11.29.4_@trpc+server@11.29.4_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/splitLink-PFsRy7Mf.mjs
24496
24500
  /** @internal */
24497
24501
  function createChain(opts) {
24498
24502
  return observable$1((observer) => {
@@ -24511,7 +24515,7 @@ function createChain(opts) {
24511
24515
  }
24512
24516
 
24513
24517
  //#endregion
24514
- //#region node_modules/.pnpm/@trpc+client@11.28.3_@trpc+server@11.28.3_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/objectSpread2-pyA4QVO4.mjs
24518
+ //#region node_modules/.pnpm/@trpc+client@11.29.4_@trpc+server@11.29.4_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/objectSpread2-pyA4QVO4.mjs
24515
24519
  function _typeof$1(o) {
24516
24520
  "@babel/helpers - typeof";
24517
24521
  return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -24565,7 +24569,7 @@ function _objectSpread2$1(e) {
24565
24569
  }
24566
24570
 
24567
24571
  //#endregion
24568
- //#region node_modules/.pnpm/@trpc+server@11.28.3_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/codes-BCsCCyMj.mjs
24572
+ //#region node_modules/.pnpm/@trpc+server@11.29.4_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/codes-BCsCCyMj.mjs
24569
24573
  /**
24570
24574
  * Check that value is object
24571
24575
  * @internal
@@ -24628,7 +24632,7 @@ const retryableRpcCodes = [
24628
24632
  ];
24629
24633
 
24630
24634
  //#endregion
24631
- //#region node_modules/.pnpm/@trpc+server@11.28.3_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/getErrorShape-CVrl8_-w.mjs
24635
+ //#region node_modules/.pnpm/@trpc+server@11.29.4_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/getErrorShape-CVrl8_-w.mjs
24632
24636
  const noop$4 = () => {};
24633
24637
  const freezeIfAvailable = (obj) => {
24634
24638
  if (Object.freeze) Object.freeze(obj);
@@ -24733,7 +24737,7 @@ function _objectSpread2(e) {
24733
24737
  }
24734
24738
 
24735
24739
  //#endregion
24736
- //#region node_modules/.pnpm/@trpc+server@11.28.3_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/asyncGeneratorDelegate-BRQGtkYG.mjs
24740
+ //#region node_modules/.pnpm/@trpc+server@11.29.4_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/asyncGeneratorDelegate-Bmz6asKS.mjs
24737
24741
  /** @internal */
24738
24742
  function transformResultInner(response, transformer) {
24739
24743
  if ("error" in response) {
@@ -24839,7 +24843,7 @@ AsyncGenerator$1.prototype["function" == typeof Symbol && Symbol.asyncIterator |
24839
24843
  };
24840
24844
 
24841
24845
  //#endregion
24842
- //#region node_modules/.pnpm/@trpc+client@11.28.3_@trpc+server@11.28.3_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/TRPCClientError-DE6-fd1n.mjs
24846
+ //#region node_modules/.pnpm/@trpc+client@11.29.4_@trpc+server@11.29.4_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/TRPCClientError-DE6-fd1n.mjs
24843
24847
  /**
24844
24848
  * Whether a value is a `TRPCClientError`, typed for a router or procedure.
24845
24849
  * @see https://trpc.io/docs/client/vanilla/error-handling#catching-a-thrown-error
@@ -24895,7 +24899,7 @@ var TRPCClientError = class TRPCClientError extends Error {
24895
24899
  };
24896
24900
 
24897
24901
  //#endregion
24898
- //#region node_modules/.pnpm/@trpc+client@11.28.3_@trpc+server@11.28.3_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/unstable-internals.mjs
24902
+ //#region node_modules/.pnpm/@trpc+client@11.29.4_@trpc+server@11.29.4_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/unstable-internals.mjs
24899
24903
  /**
24900
24904
  * @internal
24901
24905
  */
@@ -24922,7 +24926,7 @@ function getTransformer(transformer) {
24922
24926
  }
24923
24927
 
24924
24928
  //#endregion
24925
- //#region node_modules/.pnpm/@trpc+client@11.28.3_@trpc+server@11.28.3_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/httpUtils-CtMuyl9j.mjs
24929
+ //#region node_modules/.pnpm/@trpc+client@11.29.4_@trpc+server@11.29.4_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/httpUtils-CtMuyl9j.mjs
24926
24930
  const isFunction$1 = (fn) => typeof fn === "function";
24927
24931
  /**
24928
24932
  * The `fetch` to use: `customFetchImpl` if given, or else the global one.
@@ -25058,7 +25062,7 @@ async function httpRequest(opts) {
25058
25062
  }
25059
25063
 
25060
25064
  //#endregion
25061
- //#region node_modules/.pnpm/@trpc+client@11.28.3_@trpc+server@11.28.3_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/httpLink-B4UwXApa.mjs
25065
+ //#region node_modules/.pnpm/@trpc+client@11.29.4_@trpc+server@11.29.4_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/httpLink-B4UwXApa.mjs
25062
25066
  /** Whether an input is binary: a `Uint8Array`, `Blob` or `File`. */
25063
25067
  function isOctetType(input) {
25064
25068
  return input instanceof Uint8Array || input instanceof Blob;
@@ -25151,7 +25155,7 @@ function httpLink(opts) {
25151
25155
  }
25152
25156
 
25153
25157
  //#endregion
25154
- //#region node_modules/.pnpm/@trpc+client@11.28.3_@trpc+server@11.28.3_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/wsLink-BiIe_j6D.mjs
25158
+ //#region node_modules/.pnpm/@trpc+client@11.29.4_@trpc+server@11.29.4_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/wsLink-DYx-NUSN.mjs
25155
25159
  /**
25156
25160
  * Get the result of a value or function that returns a value
25157
25161
  * It also optionally accepts typesafe arguments for the function
@@ -25341,7 +25345,7 @@ var WsConnection = class WsConnection {
25341
25345
  _defineProperty$1(WsConnection, "connectCount", 0);
25342
25346
 
25343
25347
  //#endregion
25344
- //#region node_modules/.pnpm/@trpc+client@11.28.3_@trpc+server@11.28.3_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/index.mjs
25348
+ //#region node_modules/.pnpm/@trpc+client@11.29.4_@trpc+server@11.29.4_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/index.mjs
25345
25349
  const observerKeys = [
25346
25350
  "onStarted",
25347
25351
  "onData",
@@ -26486,7 +26490,7 @@ const cliVersion = pkg.version;
26486
26490
  const cliNodeEngine = pkg.engines?.node;
26487
26491
 
26488
26492
  //#endregion
26489
- //#region ../../node_modules/.pnpm/@trpc+server@11.28.3_@types+aws-lambda@8.10.164_@types+express@5.0.6_@types+ws@8.18.2_n_4faacf2dd8c5d7e32e12b289867122f6/node_modules/@trpc/server/dist/observable-CodTG6Sf.mjs
26493
+ //#region ../../node_modules/.pnpm/@trpc+server@11.29.4_@types+aws-lambda@8.10.164_@types+express@5.0.6_@types+ws@8.18.2_n_1da893035cfd9de0030f23e9af289d37/node_modules/@trpc/server/dist/observable-CodTG6Sf.mjs
26490
26494
  /**
26491
26495
  * Creates an observable. `subscribe` runs for each subscriber, and can
26492
26496
  * return a function that cleans up when it unsubscribes.
@@ -27100,7 +27104,16 @@ function printKanban(columns) {
27100
27104
  }).join(" ");
27101
27105
  console.log(bottomBorder);
27102
27106
  }
27107
+ /**
27108
+ * Ask a `(y/N)` question on the terminal.
27109
+ *
27110
+ * Without a terminal there is nobody to answer: an agent's shell, a pipe or CI
27111
+ * either never closes stdin (the command hangs until it is killed) or closes it
27112
+ * empty (the action is silently cancelled). Fail loudly instead, so the caller
27113
+ * learns it has to pass `--yes`.
27114
+ */
27103
27115
  function confirm(message) {
27116
+ if (!process.stdin.isTTY) return Promise.reject(/* @__PURE__ */ new Error(`${message}\nRefusing to continue without an interactive terminal to confirm. Re-run with --yes to skip the prompt.`));
27104
27117
  const rl = createInterface({
27105
27118
  input: process.stdin,
27106
27119
  output: process.stderr
@@ -49846,9 +49859,21 @@ function formatFsLongListing(nodes) {
49846
49859
  async function readFsContentInput(options) {
49847
49860
  if (options.contentFile) return readFileSync(options.contentFile, "utf8");
49848
49861
  if (options.content !== void 0) return options.content;
49849
- if (process.stdin.isTTY === false) return text(process.stdin);
49862
+ if (isStdinRedirected()) return text(process.stdin);
49850
49863
  return "";
49851
49864
  }
49865
+ /**
49866
+ * Whether stdin was piped (`echo x | lh …`) or redirected from a file (`< x`).
49867
+ * A terminal, a closed stdin or `/dev/null` (an agent shell) is not input.
49868
+ */
49869
+ function isStdinRedirected() {
49870
+ try {
49871
+ const stat = fstatSync(0);
49872
+ return stat.isFIFO() || stat.isFile();
49873
+ } catch {
49874
+ return false;
49875
+ }
49876
+ }
49852
49877
  async function resolveAgentFsContext(client, options) {
49853
49878
  return {
49854
49879
  agentId: await resolveAgentId$1(client, options),
@@ -74270,7 +74295,8 @@ const spawnCliAgent = async (options, command, cwd, inputPlan, childEnv, codexJw
74270
74295
  if (!live.isOpen) return false;
74271
74296
  const plan = await buildAgentInput("claude-code", prompt, options.inputOptions);
74272
74297
  return live.send(plan.stdin, sendOptions?.uuid);
74273
- }
74298
+ },
74299
+ supportsSteerImageAttachments: true
74274
74300
  },
74275
74301
  kill: (signal = "SIGINT") => {
74276
74302
  killedByUs = true;
@@ -268578,8 +268604,13 @@ var require_tree_kill = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
268578
268604
  var import_tree_kill = /* @__PURE__ */ __toESM$2(require_tree_kill());
268579
268605
  const KILL_SIGNAL = "SIGKILL";
268580
268606
  /**
268581
- * Non-interactive backend: a plain `child_process` with stdin left as an
268582
- * unused pipe and stdout/stderr inherited straight into the output files.
268607
+ * Non-interactive backend: a plain `child_process` with stdin bound to the
268608
+ * null device and stdout/stderr inherited straight into the output files.
268609
+ *
268610
+ * Nothing ever writes to a command's stdin here, so it must not be an open
268611
+ * pipe: a command that reads stdin (a `(y/N)` confirm, `read`, a CLI that falls
268612
+ * back to piped input) would wait on it until the shell timeout. With `ignore`
268613
+ * it reads EOF at once and fails or cancels instead of hanging.
268583
268614
  */
268584
268615
  var ChildProcessBackend = class {
268585
268616
  capabilities = {
@@ -268613,7 +268644,7 @@ var ChildProcessBackend = class {
268613
268644
  env,
268614
268645
  shell: false,
268615
268646
  stdio: [
268616
- "pipe",
268647
+ "ignore",
268617
268648
  outputFiles.stdout.fd,
268618
268649
  outputFiles.stderr.fd
268619
268650
  ],
@@ -579323,7 +579354,7 @@ var WebStandardStreamableHTTPServerTransport = class {
579323
579354
  };
579324
579355
 
579325
579356
  //#endregion
579326
- //#region node_modules/.pnpm/@hono+node-server@2.1.8_hono@4.13.19/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs
579357
+ //#region node_modules/.pnpm/@hono+node-server@2.1.9_hono@4.13.19/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs
579327
579358
  const X_ALREADY_SENT = "x-hono-already-sent";
579328
579359
 
579329
579360
  //#endregion
@@ -579352,7 +579383,7 @@ const defineWebSocketHelper = (handler) => {
579352
579383
  };
579353
579384
 
579354
579385
  //#endregion
579355
- //#region node_modules/.pnpm/@hono+node-server@2.1.8_hono@4.13.19/node_modules/@hono/node-server/dist/index.mjs
579386
+ //#region node_modules/.pnpm/@hono+node-server@2.1.9_hono@4.13.19/node_modules/@hono/node-server/dist/index.mjs
579356
579387
  var RequestError = class extends Error {
579357
579388
  constructor(message, options) {
579358
579389
  super(message, options);
@@ -579539,7 +579570,11 @@ const toRequestError = (e) => {
579539
579570
  return new RequestError(e.message, { cause: e });
579540
579571
  };
579541
579572
  const GlobalRequest = global.Request;
579542
- var Request$1 = class extends GlobalRequest {
579573
+ var Request$1 = class Request$1 extends GlobalRequest {
579574
+ static [Symbol.hasInstance](instance) {
579575
+ if (this === Request$1) return instance instanceof GlobalRequest || Function.prototype[Symbol.hasInstance].call(this, instance);
579576
+ return Function.prototype[Symbol.hasInstance].call(this, instance);
579577
+ }
579543
579578
  constructor(input, options) {
579544
579579
  if (typeof input === "object" && getRequestCache in input) {
579545
579580
  const hasReplacementBody = options !== void 0 && "body" in options && options.body != null;
@@ -579578,8 +579613,8 @@ const readBodyBufferedBeforeDisconnect = (incoming, chunks) => {
579578
579613
  else if (incomingWithRecovery[bodyBufferedLengthBeforeDisconnectKey] !== void 0 && incoming.readableLength !== incomingWithRecovery[bodyBufferedLengthBeforeDisconnectKey]) result = newBodyUnusableError();
579579
579614
  else {
579580
579615
  const bodyChunks = chunks ?? [];
579581
- const chunk = incoming.read();
579582
- if (chunk !== null) bodyChunks.push(toBufferChunk(chunk, incoming.readableEncoding));
579616
+ let chunk;
579617
+ while ((chunk = incoming.read()) !== null) bodyChunks.push(toBufferChunk(chunk, incoming.readableEncoding));
579583
579618
  const buffer = bodyChunks.length === 1 ? bodyChunks[0] : Buffer.concat(bodyChunks);
579584
579619
  result = buffer;
579585
579620
  const contentLength = incoming.headers["content-length"];
@@ -579916,6 +579951,9 @@ Object.defineProperty(requestPrototype, "blob", { value: function() {
579916
579951
  return new Response(buf, type ? { headers: { "content-type": type } } : void 0).blob();
579917
579952
  });
579918
579953
  } });
579954
+ Object.defineProperty(requestPrototype, "bytes", { value: function() {
579955
+ return this.arrayBuffer().then((buf) => new Uint8Array(buf));
579956
+ } });
579919
579957
  Object.defineProperty(requestPrototype, "json", { value: function() {
579920
579958
  if (this[bodyConsumedDirectlyKey]) return rejectBodyUnusable();
579921
579959
  return this.text().then(JSON.parse);
@@ -579970,6 +580008,10 @@ const GlobalResponse = global.Response;
579970
580008
  var Response$1 = class Response$1 {
579971
580009
  #body;
579972
580010
  #init;
580011
+ static [Symbol.hasInstance](instance) {
580012
+ if (this === Response$1) return instance instanceof GlobalResponse || Function.prototype[Symbol.hasInstance].call(this, instance);
580013
+ return Function.prototype[Symbol.hasInstance].call(this, instance);
580014
+ }
579973
580015
  [getResponseCache]() {
579974
580016
  const cache = this[cacheKey];
579975
580017
  const liveHeaders = cache && cache[2] instanceof Headers ? cache[2] : void 0;
@@ -579990,7 +580032,7 @@ var Response$1 = class Response$1 {
579990
580032
  this[getResponseCache]();
579991
580033
  return;
579992
580034
  }
579993
- this.#init = init instanceof Response$1 ? init.#init : init;
580035
+ this.#init = #init in init ? init.#init : init;
579994
580036
  headers = new Headers(init.headers);
579995
580037
  } else this.#init = init;
579996
580038
  if (body == null || typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) this[cacheKey] = [
@@ -580031,6 +580073,7 @@ var Response$1 = class Response$1 {
580031
580073
  [
580032
580074
  "arrayBuffer",
580033
580075
  "blob",
580076
+ "bytes",
580034
580077
  "clone",
580035
580078
  "formData",
580036
580079
  "json",
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 "" "@lichao0223/lobehub\-cli 0.0.80" "User Commands"
3
+ .TH LH 1 "" "@lichao0223/lobehub\-cli 0.0.82" "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": "@lichao0223/lobehub-cli",
3
- "version": "0.0.80",
3
+ "version": "0.0.82",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/lichao0223/lobehub",
@@ -83,5 +83,5 @@
83
83
  "access": "public",
84
84
  "registry": "https://registry.npmjs.org"
85
85
  },
86
- "gitHead": "8bccb477727f96c43528f3649ead68d747c3d99b"
86
+ "gitHead": "1cf8a95396bef78410893415c6e0d41863c802ed"
87
87
  }