@lobehub/cli 0.0.225 → 0.0.226

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
@@ -21096,7 +21096,7 @@ const DEFAULT_AGENT_CONFIG = {
21096
21096
 
21097
21097
  //#endregion
21098
21098
  //#region ../../package.json
21099
- var version$2 = "2.3.4";
21099
+ var version$2 = "2.3.6";
21100
21100
 
21101
21101
  //#endregion
21102
21102
  //#region ../../packages/const/src/version.ts
@@ -26684,7 +26684,7 @@ const GOMS_KLM_TIMING_SECONDS = {
26684
26684
  };
26685
26685
 
26686
26686
  //#endregion
26687
- //#region node_modules/.pnpm/@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/observable-CodTG6Sf.mjs
26687
+ //#region node_modules/.pnpm/@trpc+server@11.29.10_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/observable-CodTG6Sf.mjs
26688
26688
  /**
26689
26689
  * Creates an observable. `subscribe` runs for each subscriber, and can
26690
26690
  * return a function that cleans up when it unsubscribes.
@@ -26910,7 +26910,7 @@ function observableToAsyncIterable(observable, signal) {
26910
26910
  }
26911
26911
 
26912
26912
  //#endregion
26913
- //#region node_modules/.pnpm/@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/observable-BjUZYMQq.mjs
26913
+ //#region node_modules/.pnpm/@trpc+server@11.29.10_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/observable-BjUZYMQq.mjs
26914
26914
  /**
26915
26915
  * Shares one subscription to the source between all subscribers. It
26916
26916
  * starts with the first subscriber and ends when the last unsubscribes.
@@ -27036,7 +27036,7 @@ function behaviorSubject(initialValue) {
27036
27036
  }
27037
27037
 
27038
27038
  //#endregion
27039
- //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/splitLink-PFsRy7Mf.mjs
27039
+ //#region node_modules/.pnpm/@trpc+client@11.29.10_@trpc+server@11.29.10_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/splitLink-PFsRy7Mf.mjs
27040
27040
  /** @internal */
27041
27041
  function createChain(opts) {
27042
27042
  return observable((observer) => {
@@ -27055,7 +27055,7 @@ function createChain(opts) {
27055
27055
  }
27056
27056
 
27057
27057
  //#endregion
27058
- //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/objectSpread2-pyA4QVO4.mjs
27058
+ //#region node_modules/.pnpm/@trpc+client@11.29.10_@trpc+server@11.29.10_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/objectSpread2-pyA4QVO4.mjs
27059
27059
  function _typeof$1(o) {
27060
27060
  "@babel/helpers - typeof";
27061
27061
  return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -27109,7 +27109,7 @@ function _objectSpread2$1(e) {
27109
27109
  }
27110
27110
 
27111
27111
  //#endregion
27112
- //#region node_modules/.pnpm/@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/codes-BCsCCyMj.mjs
27112
+ //#region node_modules/.pnpm/@trpc+server@11.29.10_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/codes-BCsCCyMj.mjs
27113
27113
  /**
27114
27114
  * Check that value is object
27115
27115
  * @internal
@@ -27172,7 +27172,7 @@ const retryableRpcCodes = [
27172
27172
  ];
27173
27173
 
27174
27174
  //#endregion
27175
- //#region node_modules/.pnpm/@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/getErrorShape-CVrl8_-w.mjs
27175
+ //#region node_modules/.pnpm/@trpc+server@11.29.10_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/getErrorShape-CVrl8_-w.mjs
27176
27176
  const noop$4 = () => {};
27177
27177
  const freezeIfAvailable = (obj) => {
27178
27178
  if (Object.freeze) Object.freeze(obj);
@@ -27277,7 +27277,7 @@ function _objectSpread2(e) {
27277
27277
  }
27278
27278
 
27279
27279
  //#endregion
27280
- //#region node_modules/.pnpm/@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/asyncGeneratorDelegate-Bmz6asKS.mjs
27280
+ //#region node_modules/.pnpm/@trpc+server@11.29.10_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/asyncGeneratorDelegate-qZNHzmPI.mjs
27281
27281
  /** @internal */
27282
27282
  function transformResultInner(response, transformer) {
27283
27283
  if ("error" in response) {
@@ -27383,7 +27383,7 @@ AsyncGenerator$1.prototype["function" == typeof Symbol && Symbol.asyncIterator |
27383
27383
  };
27384
27384
 
27385
27385
  //#endregion
27386
- //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/TRPCClientError-DE6-fd1n.mjs
27386
+ //#region node_modules/.pnpm/@trpc+client@11.29.10_@trpc+server@11.29.10_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/TRPCClientError-DE6-fd1n.mjs
27387
27387
  /**
27388
27388
  * Whether a value is a `TRPCClientError`, typed for a router or procedure.
27389
27389
  * @see https://trpc.io/docs/client/vanilla/error-handling#catching-a-thrown-error
@@ -27439,7 +27439,7 @@ var TRPCClientError = class TRPCClientError extends Error {
27439
27439
  };
27440
27440
 
27441
27441
  //#endregion
27442
- //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/unstable-internals.mjs
27442
+ //#region node_modules/.pnpm/@trpc+client@11.29.10_@trpc+server@11.29.10_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/unstable-internals.mjs
27443
27443
  /**
27444
27444
  * @internal
27445
27445
  */
@@ -27466,7 +27466,7 @@ function getTransformer(transformer) {
27466
27466
  }
27467
27467
 
27468
27468
  //#endregion
27469
- //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/httpUtils-CtMuyl9j.mjs
27469
+ //#region node_modules/.pnpm/@trpc+client@11.29.10_@trpc+server@11.29.10_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/httpUtils-CtMuyl9j.mjs
27470
27470
  const isFunction$1 = (fn) => typeof fn === "function";
27471
27471
  /**
27472
27472
  * The `fetch` to use: `customFetchImpl` if given, or else the global one.
@@ -27602,7 +27602,7 @@ async function httpRequest(opts) {
27602
27602
  }
27603
27603
 
27604
27604
  //#endregion
27605
- //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/httpLink-B4UwXApa.mjs
27605
+ //#region node_modules/.pnpm/@trpc+client@11.29.10_@trpc+server@11.29.10_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/httpLink-B4UwXApa.mjs
27606
27606
  /** Whether an input is binary: a `Uint8Array`, `Blob` or `File`. */
27607
27607
  function isOctetType(input) {
27608
27608
  return input instanceof Uint8Array || input instanceof Blob;
@@ -27695,7 +27695,7 @@ function httpLink(opts) {
27695
27695
  }
27696
27696
 
27697
27697
  //#endregion
27698
- //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/wsLink-DYx-NUSN.mjs
27698
+ //#region node_modules/.pnpm/@trpc+client@11.29.10_@trpc+server@11.29.10_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/wsLink-DYx-NUSN.mjs
27699
27699
  /**
27700
27700
  * Get the result of a value or function that returns a value
27701
27701
  * It also optionally accepts typesafe arguments for the function
@@ -27885,7 +27885,7 @@ var WsConnection = class WsConnection {
27885
27885
  _defineProperty$1(WsConnection, "connectCount", 0);
27886
27886
 
27887
27887
  //#endregion
27888
- //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/index.mjs
27888
+ //#region node_modules/.pnpm/@trpc+client@11.29.10_@trpc+server@11.29.10_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/index.mjs
27889
27889
  const observerKeys = [
27890
27890
  "onStarted",
27891
27891
  "onData",
@@ -50256,6 +50256,7 @@ const CLI_USER_RATE_LIMIT_PATTERNS = [
50256
50256
  /you'?ve hit your limit/i,
50257
50257
  /you'?ve hit your \S+ limit/i,
50258
50258
  ...CLI_CREDIT_LIMIT_PATTERNS,
50259
+ /\bindividual quota reached\b/i,
50259
50260
  /usage limit reached/i,
50260
50261
  /\blimit reached\b/i,
50261
50262
  /使用上限/
@@ -50317,23 +50318,35 @@ const classifyCliQuotaMessage = (message) => {
50317
50318
  //#endregion
50318
50319
  //#region ../../packages/heterogeneous-agents/src/errors/classifyCliMessageError.ts
50319
50320
  init_config();
50321
+ /** agy reports its reset as a compact relative duration, for example 28m39s. */
50322
+ const antigravityQuotaResetAt = (message) => {
50323
+ const duration = /\bResets in\s+(?:(\d+)d\s*)?(?:(\d+)h\s*)?(?:(\d+)m\s*)?(?:(\d+)s)?(?=\.|$)/i.exec(message);
50324
+ if (!duration) return;
50325
+ const [, days = "0", hours = "0", minutes = "0", seconds = "0"] = duration;
50326
+ const reset = Number(days) * 86400 + Number(hours) * 3600 + Number(minutes) * 60 + Number(seconds);
50327
+ if (Number.isSafeInteger(reset) && reset > 0) return Math.floor(Date.now() / 1e3) + reset;
50328
+ };
50320
50329
  /** Error text shared by stream adapters and process failure handling. */
50321
50330
  const classifyCliMessageError = ({ agentType, command, detail: rawDetail }) => {
50322
50331
  const detail = rawDetail?.trim();
50323
50332
  if (!detail) return;
50324
50333
  const quota = classifyCliQuotaMessage(detail);
50325
- if (quota) return {
50326
- agentType,
50327
- code: "rate_limit",
50328
- details: { kind: quota.kind },
50329
- error: detail,
50330
- message: detail,
50331
- ...quota.rateLimitType ? { rateLimitInfo: {
50332
- rateLimitType: quota.rateLimitType,
50333
- status: "rejected"
50334
- } } : {},
50335
- stderr: detail
50336
- };
50334
+ if (quota) {
50335
+ const resetsAt = agentType === "antigravity" ? antigravityQuotaResetAt(detail) : void 0;
50336
+ return {
50337
+ agentType,
50338
+ code: "rate_limit",
50339
+ details: { kind: quota.kind },
50340
+ error: detail,
50341
+ message: detail,
50342
+ ...quota.rateLimitType || resetsAt ? { rateLimitInfo: {
50343
+ ...quota.rateLimitType && { rateLimitType: quota.rateLimitType },
50344
+ ...resetsAt && { resetsAt },
50345
+ status: "rejected"
50346
+ } } : {},
50347
+ stderr: detail
50348
+ };
50349
+ }
50337
50350
  if (isHeterogeneousAgentAuthRequired(agentType, detail)) return buildHeterogeneousAgentAuthRequiredError({
50338
50351
  agentType,
50339
50352
  command,
@@ -50750,16 +50763,16 @@ var AntigravityAcpAdapter = class extends TraeAcpAdapter {
50750
50763
  uuid: value.uuid
50751
50764
  })];
50752
50765
  }
50753
- const events = super.adapt(value);
50754
- if (value.type !== `${IDENTIFIER}_error`) return events;
50766
+ if (value.type !== `${IDENTIFIER}_error`) return super.adapt(value);
50755
50767
  const classified = classifyCliMessageError({
50756
50768
  agentType: IDENTIFIER,
50757
50769
  detail: typeof value.message === "string" ? value.message : void 0
50758
50770
  });
50759
- return classified ? events.map((event) => event.type === "error" ? {
50771
+ if (!classified) return super.adapt(value);
50772
+ return [...classified.code === "rate_limit" && this.stream.pendingStepBoundary ? this.stream.ensureStream(true) : [], ...super.adapt(value).map((event) => event.type === "error" ? {
50760
50773
  ...event,
50761
50774
  data: classified
50762
- } : event) : events;
50775
+ } : event)];
50763
50776
  }
50764
50777
  toUsageData(usage) {
50765
50778
  return toAntigravityUsage(usage);
@@ -56336,7 +56349,7 @@ const createAdapter = (agentType) => {
56336
56349
  };
56337
56350
 
56338
56351
  //#endregion
56339
- //#region node_modules/.pnpm/@lobehub+icons@6.20.0_@lobehub+ui@6.19.1_lucide-react@1.78.0_@types+react@19.2.13_react_83b87415d089dbb3f7729bef71b36e36/node_modules/@lobehub/icons/es/features/getLobeIconCDN/index.mjs
56352
+ //#region node_modules/.pnpm/@lobehub+icons@6.20.0_@lobehub+ui@6.19.2_lucide-react@1.78.0_@types+react@19.2.13_react_0b302560b79dc828ef2bbaba6d030453/node_modules/@lobehub/icons/es/features/getLobeIconCDN/index.mjs
56340
56353
  const GITHUB_ICON_CDN = (type) => `https://raw.githubusercontent.com/lobehub/lobe-icons/refs/heads/master/packages/static-${type}`;
56341
56354
  const ALIYUN_ICON_CDN = (type) => `https://registry.npmmirror.com/@lobehub/icons-static-${type}/latest/files`;
56342
56355
  const UNPKG_ICON_CDN = (type) => `https://unpkg.com/@lobehub/icons-static-${type}@latest`;
@@ -76238,6 +76251,7 @@ const isPromptResponse = (message) => {
76238
76251
  if (message.error) return message.requestMethod === "session/prompt";
76239
76252
  return isRecord$8(message.result) && "stopReason" in message.result;
76240
76253
  };
76254
+ const QUOTA_NOTICE = /^(?:⚠️?\s*)?Individual quota reached\.\s+Please upgrade your subscription to increase your limits\.(?:\s+Resets in (?:\d+[dhms]\s*)+\.?)?$/i;
76241
76255
  /**
76242
76256
  * Antigravity over `agy acp`. One run is one user turn; a message the user
76243
76257
  * sends while it runs is steered in with another `session/prompt`: agy ends
@@ -76247,9 +76261,8 @@ const isPromptResponse = (message) => {
76247
76261
  var AntigravityAcpSession = class extends AcpAgentSession {
76248
76262
  /** Session updates before the prompt (a `session/load` replay) are history, not output. */
76249
76263
  acceptUpdates = false;
76250
- /** Read confirmations, chained so each lands before any update that follows it. */
76251
- confirmations = Promise.resolve();
76252
76264
  launch;
76265
+ writingAnswer = false;
76253
76266
  /** Prompt responses handled so far, in stdout order. */
76254
76267
  promptResponses = 0;
76255
76268
  /** Steered prompts written to agy, in order, that the run has not settled yet. */
@@ -76281,24 +76294,22 @@ var AntigravityAcpSession = class extends AcpAgentSession {
76281
76294
  }
76282
76295
  /**
76283
76296
  * Write a user message into the running turn. `false` when the run takes no
76284
- * input now (not prompting yet, interrupted, or settling): nothing was
76285
- * written, so the message can wait for the next run. agy confirms it read
76297
+ * input now (not prompting yet, writing an answer, interrupted, or settling):
76298
+ * nothing was written, so the message can wait for the next run. agy confirms it read
76286
76299
  * the message when the prompt it interrupts returns, reported as
76287
76300
  * `step_complete { phase: 'user_message', uuid }`.
76288
76301
  */
76289
76302
  steer(prompt, uuid) {
76290
76303
  const sessionId = this.acpSessionId;
76291
- if (!this.steerable || !sessionId || this.closedByHost) return false;
76304
+ if (!this.steerable || !sessionId || this.closedByHost || this.writingAnswer || this.promptResponses > this.steerCount) return false;
76292
76305
  const result = this.client.request("session/prompt", {
76293
76306
  prompt,
76294
76307
  sessionId
76295
76308
  }, false);
76296
76309
  result.catch(() => {});
76297
76310
  this.steers.push(result);
76298
- const index = ++this.steerCount;
76299
- if (this.promptResponses >= index) this.confirmSteer(uuid);
76300
- else this.unconfirmedSteers.push({
76301
- index,
76311
+ this.unconfirmedSteers.push({
76312
+ index: ++this.steerCount,
76302
76313
  uuid
76303
76314
  });
76304
76315
  return true;
@@ -76371,7 +76382,6 @@ var AntigravityAcpSession = class extends AcpAgentSession {
76371
76382
  this.addUsage(last.usage);
76372
76383
  }
76373
76384
  this.steerable = false;
76374
- await this.confirmations;
76375
76385
  const used = Object.values(this.usage).some((value) => value > 0);
76376
76386
  await this.pushToPipeline({
76377
76387
  stopReason: last.stopReason,
@@ -76398,13 +76408,16 @@ var AntigravityAcpSession = class extends AcpAgentSession {
76398
76408
  this.steerable = false;
76399
76409
  }
76400
76410
  async handleAgentMessage(message) {
76401
- await this.confirmations;
76402
76411
  if (isPromptResponse(message)) {
76403
76412
  this.promptResponses += 1;
76413
+ this.writingAnswer = false;
76404
76414
  const next = this.unconfirmedSteers[0];
76405
- if (next && next.index <= this.promptResponses) {
76415
+ if (!message.error && next && next.index <= this.promptResponses) {
76406
76416
  this.unconfirmedSteers.shift();
76407
- await this.confirmSteer(next.uuid);
76417
+ await this.pushToPipeline({
76418
+ type: "antigravity_user_message",
76419
+ uuid: next.uuid
76420
+ });
76408
76421
  }
76409
76422
  return;
76410
76423
  }
@@ -76412,7 +76425,12 @@ var AntigravityAcpSession = class extends AcpAgentSession {
76412
76425
  const params = isRecord$8(message.params) ? message.params : void 0;
76413
76426
  if (!isRecord$8(params?.update)) return;
76414
76427
  if (typeof params.sessionId === "string" && params.sessionId !== this.acpSessionId) return;
76415
- const { name, sessionUpdate, status } = params.update;
76428
+ const { content, name, sessionUpdate, status } = params.update;
76429
+ if (sessionUpdate === "agent_message_chunk" && isRecord$8(content) && content.type === "text") {
76430
+ const text = typeof content.text === "string" ? content.text.trim() : "";
76431
+ if (QUOTA_NOTICE.test(text)) throw new Error(text);
76432
+ if (text) this.writingAnswer = true;
76433
+ } else if (sessionUpdate === "tool_call") this.writingAnswer = false;
76416
76434
  if (this.options.askUserBridge && name === "ask_question" && (sessionUpdate === "tool_call" || sessionUpdate === "tool_call_update") && (status === "in_progress" || status === "pending" || status === void 0)) return;
76417
76435
  await this.pushToPipeline(params.update);
76418
76436
  }
@@ -76501,15 +76519,6 @@ var AntigravityAcpSession = class extends AcpAgentSession {
76501
76519
  const variant = level ? `${family}-${level}` : void 0;
76502
76520
  return variant && availableModelIds(sessionResult).has(variant) ? variant : family;
76503
76521
  }
76504
- confirmSteer(uuid) {
76505
- const confirmed = this.confirmations.then(() => this.pushToPipeline({
76506
- type: "antigravity_user_message",
76507
- uuid
76508
- }));
76509
- confirmed.catch(() => {});
76510
- this.confirmations = confirmed;
76511
- return confirmed;
76512
- }
76513
76522
  addUsage(usage) {
76514
76523
  if (!isRecord$8(usage)) return;
76515
76524
  for (const field of USAGE_FIELDS) {
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.225" "User Commands"
3
+ .TH LH 1 "" "@lobehub/cli 0.0.226" "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.225",
3
+ "version": "0.0.226",
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": "3bf7170d71c83b5bec9adc6b1579e694f189c2cf"
86
+ "gitHead": "2abd2692a1ee733ee9252fd2126dd8b13ad5242c"
87
87
  }