@lobehub/cli 0.0.84 → 0.0.86

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
@@ -6996,7 +6996,7 @@ var init_heterogeneousAgent = __esmMin((() => {
6996
6996
 
6997
6997
  //#endregion
6998
6998
  //#region ../../packages/types/src/agent/heteroSelectorCapabilities.ts
6999
- var HETEROGENEOUS_AGENT_DEFAULT_SELECTION, AMP_AGENT_MODES, CLAUDE_CODE_REASONING_EFFORT_LEVELS, GROK_BUILD_REASONING_EFFORT_LEVELS, GROK_BUILD_REASONING_EFFORT_FLAGS, CODEX_COMMON_REASONING_EFFORT_LEVELS, CODEX_REASONING_EFFORT_LEVELS, CODEX_REASONING_EFFORT_CONFIG_KEY$1, CODEX_DEEPSEEK_V4_REASONING_EFFORT_LEVELS, CODEX_GLM_5_2_REASONING_EFFORT_LEVELS, CODEX_MAX_REASONING_EFFORT_LEVELS, CODEX_ULTRA_REASONING_MODELS, CODEX_MAX_REASONING_MODELS, QODER_REASONING_EFFORT_LEVELS, QODER_REASONING_EFFORT_FLAG, COPILOT_REASONING_EFFORT_LEVELS, COPILOT_REASONING_EFFORT_FLAG, CODEX_SERVICE_TIER_CONFIG_KEY$1, toCodexServiceTier, CODEX_FAST_SERVICE_TIER_VALUES, isAmpAgentMode, isClaudeCodeReasoningEffort, isCodexReasoningEffort, isGrokBuildReasoningEffort, isQoderReasoningEffort, isCopilotReasoningEffort, isCodexFastServiceTier, getCodexReasoningEffortLevels, resolveAmpAgentMode, CODEX_MODEL_FLAGS$2, resolveClaudeCodeModel, resolveClaudeCodeReasoningEffort, resolveCodexModel, resolveCodexReasoningEffort, resolveCodexSpeedMode, resolveGrokBuildReasoningEffort, resolveQoderReasoningEffort, resolveCopilotReasoningEffort, resolvePersistedModel, MODEL_FLAGS_ENCODING, HETERO_SELECTOR_CAPABILITIES, modelFlagsOf, COPILOT_MODEL_FLAGS, GROK_BUILD_MODEL_FLAGS, KIMI_CODE_MODEL_FLAGS, OPENCODE_MODEL_FLAGS, PI_MODEL_FLAGS, QODER_MODEL_FLAGS;
6999
+ var HETEROGENEOUS_AGENT_DEFAULT_SELECTION, AMP_AGENT_MODES, CLAUDE_CODE_REASONING_EFFORT_LEVELS, GROK_BUILD_REASONING_EFFORT_LEVELS, GROK_BUILD_REASONING_EFFORT_FLAGS, CODEX_COMMON_REASONING_EFFORT_LEVELS, CODEX_REASONING_EFFORT_LEVELS, CODEX_REASONING_EFFORT_CONFIG_KEY$1, CODEX_DEEPSEEK_V4_REASONING_EFFORT_LEVELS, CODEX_GLM_5_2_REASONING_EFFORT_LEVELS, CODEX_MAX_REASONING_EFFORT_LEVELS, CODEX_ULTRA_REASONING_MODELS, CODEX_MAX_REASONING_MODELS, QODER_REASONING_EFFORT_LEVELS, QODER_REASONING_EFFORT_FLAG, COPILOT_REASONING_EFFORT_LEVELS, COPILOT_REASONING_EFFORT_FLAG, CODEX_SERVICE_TIER_CONFIG_KEY$1, toCodexServiceTier, CODEX_FAST_SERVICE_TIER_VALUES, isAmpAgentMode, isClaudeCodeReasoningEffort, isCodexReasoningEffort, isGrokBuildReasoningEffort, isQoderReasoningEffort, isCopilotReasoningEffort, isCodexFastServiceTier, getCodexReasoningEffortLevels, resolveAmpAgentMode, CODEX_MODEL_FLAGS$2, resolveClaudeCodeModel, resolveClaudeCodeReasoningEffort, resolveCodexModel, resolveCodexReasoningEffort, resolveCodexSpeedMode, resolveGrokBuildReasoningEffort, resolveQoderReasoningEffort, resolveCopilotReasoningEffort, resolvePersistedModel, parseModelTuple, MODEL_FLAGS_ENCODING, HETERO_SELECTOR_CAPABILITIES, modelFlagsOf, COPILOT_MODEL_FLAGS, GROK_BUILD_MODEL_FLAGS, KIMI_CODE_MODEL_FLAGS, OPENCODE_MODEL_FLAGS, PI_MODEL_FLAGS, QODER_MODEL_FLAGS;
7000
7000
  var init_heteroSelectorCapabilities = __esmMin((() => {
7001
7001
  init_heteroCliArgs();
7002
7002
  HETEROGENEOUS_AGENT_DEFAULT_SELECTION = "default";
@@ -7121,6 +7121,16 @@ var init_heteroSelectorCapabilities = __esmMin((() => {
7121
7121
  const model = source?.model?.trim();
7122
7122
  return model && model !== "default" ? model : HETEROGENEOUS_AGENT_DEFAULT_SELECTION;
7123
7123
  };
7124
+ parseModelTuple = (value) => {
7125
+ if (!value.startsWith("[")) return;
7126
+ try {
7127
+ const parsed = JSON.parse(value);
7128
+ if (Array.isArray(parsed) && parsed.length === 2 && typeof parsed[0] === "string" && typeof parsed[1] === "string") return {
7129
+ modelId: parsed[1],
7130
+ providerId: parsed[0]
7131
+ };
7132
+ } catch {}
7133
+ };
7124
7134
  MODEL_FLAGS_ENCODING = {
7125
7135
  flags: ["-m", "--model"],
7126
7136
  kind: "flag"
@@ -7221,6 +7231,11 @@ var init_heteroSelectorCapabilities = __esmMin((() => {
7221
7231
  resolve: resolvePersistedModel,
7222
7232
  source: "catalog"
7223
7233
  } },
7234
+ "deepseek-harness": { model: {
7235
+ encodings: [],
7236
+ resolve: resolvePersistedModel,
7237
+ source: "catalog"
7238
+ } },
7224
7239
  "droid": { model: {
7225
7240
  encodings: [],
7226
7241
  resolve: resolvePersistedModel,
@@ -7540,6 +7555,12 @@ var init_chatConfig = __esmMin((() => {
7540
7555
  "high"
7541
7556
  ]).optional(),
7542
7557
  thinkingLevel4: _enum(["minimal", "high"]).optional(),
7558
+ thinkingLevel5: _enum([
7559
+ "low",
7560
+ "medium",
7561
+ "high",
7562
+ "xhigh"
7563
+ ]).optional(),
7543
7564
  toolResultMaxLength: number$1().default(25e3),
7544
7565
  topicGroupMode: _enum([
7545
7566
  "byTime",
@@ -8201,6 +8222,8 @@ var init_agentRuntime = __esmMin((() => {
8201
8222
  RequestTrigger["InputCompletion"] = "input_completion";
8202
8223
  RequestTrigger["Memory"] = "memory";
8203
8224
  RequestTrigger["MultimodalAnalysis"] = "multimodal_analysis";
8225
+ /** Text-to-music generation from a music generation topic. */
8226
+ RequestTrigger["Music"] = "music";
8204
8227
  RequestTrigger["Notify"] = "notify";
8205
8228
  RequestTrigger["Onboarding"] = "onboarding";
8206
8229
  RequestTrigger["Openapi"] = "openapi";
@@ -9848,6 +9871,7 @@ var init_files = __esmMin((() => {
9848
9871
  FileSource["ImageGeneration"] = "image_generation";
9849
9872
  /** Audio recording owned by a meeting (`meetings.audio_file_id`), not the resource library. */
9850
9873
  FileSource["Meeting"] = "meeting";
9874
+ FileSource["MusicGeneration"] = "music_generation";
9851
9875
  FileSource["PageEditor"] = "page-editor";
9852
9876
  /**
9853
9877
  * A file a skill package holds: a binary file beside its `SKILL.md`, or a
@@ -10767,7 +10791,13 @@ var init_aiModel = __esmMin((() => {
10767
10791
  "medium",
10768
10792
  "high"
10769
10793
  ]).optional(),
10770
- thinkingLevel4: _enum(["minimal", "high"]).optional()
10794
+ thinkingLevel4: _enum(["minimal", "high"]).optional(),
10795
+ thinkingLevel5: _enum([
10796
+ "low",
10797
+ "medium",
10798
+ "high",
10799
+ "xhigh"
10800
+ ]).optional()
10771
10801
  });
10772
10802
  MODEL_REASONING_EXTEND_PARAMS = Object.keys(AiModelReasoningConfigSchema.shape);
10773
10803
  ExtendParamsTypeSchema = _enum([
@@ -10810,6 +10840,7 @@ var init_aiModel = __esmMin((() => {
10810
10840
  "thinkingLevel2",
10811
10841
  "thinkingLevel3",
10812
10842
  "thinkingLevel4",
10843
+ "thinkingLevel5",
10813
10844
  "imageAspectRatio",
10814
10845
  "imageAspectRatio2",
10815
10846
  "imageResolution",
@@ -10831,7 +10862,8 @@ var init_aiModel = __esmMin((() => {
10831
10862
  disabledParams: array(DisabledParamTypeSchema).optional(),
10832
10863
  extendParams: array(ExtendParamsTypeSchema).optional(),
10833
10864
  searchImpl: ModelSearchImplementTypeSchema.optional(),
10834
- searchProvider: string().optional()
10865
+ searchProvider: string().optional(),
10866
+ ttsVoice: string().optional()
10835
10867
  });
10836
10868
  CreateAiModelSchema = object$1({
10837
10869
  abilities: AiModelAbilitiesSchema.optional(),
@@ -12299,7 +12331,7 @@ var DeviceMetricsSampler = class {
12299
12331
  };
12300
12332
 
12301
12333
  //#endregion
12302
- //#region node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/constants.js
12334
+ //#region node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/constants.js
12303
12335
  var require_constants$5 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
12304
12336
  const BINARY_TYPES = [
12305
12337
  "nodebuffer",
@@ -12323,7 +12355,7 @@ var require_constants$5 = /* @__PURE__ */ __commonJSMin$2(((exports, module) =>
12323
12355
  }));
12324
12356
 
12325
12357
  //#endregion
12326
- //#region node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/buffer-util.js
12358
+ //#region node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/buffer-util.js
12327
12359
  var require_buffer_util = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
12328
12360
  const { websocketMask, websocketUnmask } = __require("http");
12329
12361
  const { EMPTY_BUFFER } = require_constants$5();
@@ -12433,7 +12465,7 @@ var require_buffer_util = /* @__PURE__ */ __commonJSMin$2(((exports, module) =>
12433
12465
  }));
12434
12466
 
12435
12467
  //#endregion
12436
- //#region node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/limiter.js
12468
+ //#region node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/limiter.js
12437
12469
  var require_limiter = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
12438
12470
  const kDone = Symbol("kDone");
12439
12471
  const kRun = Symbol("kRun");
@@ -12485,7 +12517,7 @@ var require_limiter = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
12485
12517
  }));
12486
12518
 
12487
12519
  //#endregion
12488
- //#region node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/permessage-deflate.js
12520
+ //#region node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/permessage-deflate.js
12489
12521
  var require_permessage_deflate = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
12490
12522
  const zlib$3 = __require("zlib");
12491
12523
  const bufferUtil = require_buffer_util();
@@ -12819,7 +12851,7 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJSMin$2(((exports, modu
12819
12851
  }));
12820
12852
 
12821
12853
  //#endregion
12822
- //#region node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/validation.js
12854
+ //#region node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/validation.js
12823
12855
  var require_validation$5 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
12824
12856
  const { isUtf8 } = __require("buffer");
12825
12857
  const { hasBlob } = require_constants$5();
@@ -13016,7 +13048,7 @@ var require_validation$5 = /* @__PURE__ */ __commonJSMin$2(((exports, module) =>
13016
13048
  }));
13017
13049
 
13018
13050
  //#endregion
13019
- //#region node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/receiver.js
13051
+ //#region node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/receiver.js
13020
13052
  var require_receiver = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
13021
13053
  const { Writable: Writable$3 } = __require("stream");
13022
13054
  const PerMessageDeflate = require_permessage_deflate();
@@ -13481,7 +13513,7 @@ var require_receiver = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
13481
13513
  }));
13482
13514
 
13483
13515
  //#endregion
13484
- //#region node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/sender.js
13516
+ //#region node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/sender.js
13485
13517
  var require_sender = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
13486
13518
  const { Duplex: Duplex$4 } = __require("stream");
13487
13519
  const { randomFillSync } = __require("crypto");
@@ -13981,7 +14013,7 @@ var require_sender = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
13981
14013
  }));
13982
14014
 
13983
14015
  //#endregion
13984
- //#region node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/event-target.js
14016
+ //#region node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/event-target.js
13985
14017
  var require_event_target = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
13986
14018
  const { kForOnEventAttribute, kListener } = require_constants$5();
13987
14019
  const kCode = Symbol("kCode");
@@ -14220,7 +14252,7 @@ var require_event_target = /* @__PURE__ */ __commonJSMin$2(((exports, module) =>
14220
14252
  }));
14221
14253
 
14222
14254
  //#endregion
14223
- //#region node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/extension.js
14255
+ //#region node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/extension.js
14224
14256
  var require_extension = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
14225
14257
  const { tokenChars } = require_validation$5();
14226
14258
  /**
@@ -14364,7 +14396,7 @@ var require_extension = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
14364
14396
  }));
14365
14397
 
14366
14398
  //#endregion
14367
- //#region node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/websocket.js
14399
+ //#region node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/websocket.js
14368
14400
  var require_websocket = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
14369
14401
  const EventEmitter$7 = __require("events");
14370
14402
  const https = __require("https");
@@ -14434,12 +14466,15 @@ var require_websocket = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
14434
14466
  else if (Array.isArray(options.protocols)) protocols = options.protocols;
14435
14467
  else protocols = [options.protocols];
14436
14468
  } else protocols = [protocols];
14437
- initAsClient(this, address, protocols, options);
14438
- } else {
14439
- this._autoPong = options.autoPong;
14440
- this._closeTimeout = options.closeTimeout;
14441
- this._isServer = true;
14469
+ options = initAsClient(this, address, protocols, options);
14470
+ } else this._isServer = true;
14471
+ if (options.autoPong) {
14472
+ this._autoPong = true;
14473
+ this._autoPongComplete = () => autoPongComplete(this);
14474
+ this._pendingAutoPongs = 0;
14475
+ this._maxPendingAutoPongs = options.maxPendingAutoPongs | 0;
14442
14476
  }
14477
+ this._closeTimeout = options.closeTimeout;
14443
14478
  }
14444
14479
  /**
14445
14480
  * For historical reasons, the custom "nodebuffer" type is used by the default
@@ -14880,6 +14915,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
14880
14915
  * fragments
14881
14916
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
14882
14917
  * size
14918
+ * @param {Number} [options.maxPendingAutoPongs=60] The maximum number of
14919
+ * pending automatic pongs
14883
14920
  * @param {Number} [options.maxRedirects=10] The maximum number of redirects
14884
14921
  * allowed
14885
14922
  * @param {String} [options.origin] Value of the `Origin` or
@@ -14890,6 +14927,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
14890
14927
  * `Sec-WebSocket-Version` header
14891
14928
  * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
14892
14929
  * not to skip UTF-8 validation for text and close messages
14930
+ * @return {Object} The resolved options object used for initialization
14893
14931
  * @private
14894
14932
  */
14895
14933
  function initAsClient(websocket, address, protocols, options) {
@@ -14901,6 +14939,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
14901
14939
  maxBufferedChunks: 256 * 1024,
14902
14940
  maxFragments: 16 * 1024,
14903
14941
  maxPayload: 100 * 1024 * 1024,
14942
+ maxPendingAutoPongs: 60,
14904
14943
  skipUTF8Validation: false,
14905
14944
  perMessageDeflate: true,
14906
14945
  followRedirects: false,
@@ -14916,8 +14955,6 @@ var require_websocket = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
14916
14955
  path: void 0,
14917
14956
  port: void 0
14918
14957
  };
14919
- websocket._autoPong = opts.autoPong;
14920
- websocket._closeTimeout = opts.closeTimeout;
14921
14958
  if (!protocolVersions.includes(opts.protocolVersion)) throw new RangeError(`Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})`);
14922
14959
  let parsedUrl;
14923
14960
  if (address instanceof URL$2) parsedUrl = address;
@@ -15105,6 +15142,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
15105
15142
  });
15106
15143
  if (opts.finishRequest) opts.finishRequest(req, websocket);
15107
15144
  else req.end();
15145
+ return opts;
15108
15146
  }
15109
15147
  /**
15110
15148
  * Emit the `'error'` and `'close'` events.
@@ -15261,10 +15299,23 @@ var require_websocket = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
15261
15299
  */
15262
15300
  function receiverOnPing(data) {
15263
15301
  const websocket = this[kWebSocket];
15264
- if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);
15302
+ if (websocket._autoPong && websocket.readyState === WebSocket.OPEN) if (websocket._maxPendingAutoPongs > 0 && websocket._pendingAutoPongs >= websocket._maxPendingAutoPongs) websocket.terminate();
15303
+ else {
15304
+ websocket._pendingAutoPongs++;
15305
+ websocket.pong(data, !this._isServer, websocket._autoPongComplete);
15306
+ }
15265
15307
  websocket.emit("ping", data);
15266
15308
  }
15267
15309
  /**
15310
+ * The callback for automatic pong responses.
15311
+ *
15312
+ * @param {WebSocket} websocket The WebSocket instance
15313
+ * @private
15314
+ */
15315
+ function autoPongComplete(websocket) {
15316
+ websocket._pendingAutoPongs--;
15317
+ }
15318
+ /**
15268
15319
  * The listener of the `Receiver` `'pong'` event.
15269
15320
  *
15270
15321
  * @param {Buffer} data The data included in the pong frame
@@ -15371,7 +15422,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
15371
15422
  }));
15372
15423
 
15373
15424
  //#endregion
15374
- //#region node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/stream.js
15425
+ //#region node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/stream.js
15375
15426
  var require_stream$6 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
15376
15427
  require_websocket();
15377
15428
  const { Duplex: Duplex$2 } = __require("stream");
@@ -15488,7 +15539,7 @@ var require_stream$6 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
15488
15539
  }));
15489
15540
 
15490
15541
  //#endregion
15491
- //#region node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/subprotocol.js
15542
+ //#region node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/subprotocol.js
15492
15543
  var require_subprotocol = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
15493
15544
  const { tokenChars } = require_validation$5();
15494
15545
  /**
@@ -15528,7 +15579,7 @@ var require_subprotocol = /* @__PURE__ */ __commonJSMin$2(((exports, module) =>
15528
15579
  }));
15529
15580
 
15530
15581
  //#endregion
15531
- //#region node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/websocket-server.js
15582
+ //#region node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/websocket-server.js
15532
15583
  var require_websocket_server = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
15533
15584
  const EventEmitter$6 = __require("events");
15534
15585
  const http$1 = __require("http");
@@ -15573,6 +15624,8 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin$2(((exports, module
15573
15624
  * fragments
15574
15625
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
15575
15626
  * size
15627
+ * @param {Number} [options.maxPendingAutoPongs=60] The maximum number of
15628
+ * pending automatic pongs
15576
15629
  * @param {Boolean} [options.noServer=false] Enable no server mode
15577
15630
  * @param {String} [options.path] Accept only connections matching this path
15578
15631
  * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
@@ -15595,6 +15648,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin$2(((exports, module
15595
15648
  maxBufferedChunks: 256 * 1024,
15596
15649
  maxFragments: 16 * 1024,
15597
15650
  maxPayload: 100 * 1024 * 1024,
15651
+ maxPendingAutoPongs: 60,
15598
15652
  skipUTF8Validation: false,
15599
15653
  perMessageDeflate: false,
15600
15654
  handleProtocols: null,
@@ -15915,7 +15969,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin$2(((exports, module
15915
15969
  }));
15916
15970
 
15917
15971
  //#endregion
15918
- //#region node_modules/.pnpm/ws@8.22.2/node_modules/ws/wrapper.mjs
15972
+ //#region node_modules/.pnpm/ws@8.23.0/node_modules/ws/wrapper.mjs
15919
15973
  var import_stream = /* @__PURE__ */ __toESM$2(require_stream$6(), 1);
15920
15974
  var import_extension = /* @__PURE__ */ __toESM$2(require_extension(), 1);
15921
15975
  var import_permessage_deflate = /* @__PURE__ */ __toESM$2(require_permessage_deflate(), 1);
@@ -17624,7 +17678,7 @@ const ZH_HANT = toZhPools((text) => [...text].map((char) => ZH_HANT_CHARS[char]
17624
17678
  const API_KEY_FULL_ACCESS_SCOPE = "*";
17625
17679
  /**
17626
17680
  * The selectable scope catalog. `model:invoke` is its own tier because it is
17627
- * the one that burns money (chat/completions, image, video, asr).
17681
+ * the one that burns money (chat/completions, image, video, music, asr).
17628
17682
  *
17629
17683
  * Deliberately absent (a restricted key can never obtain them):
17630
17684
  * - `api_key:*` — keys must not mint keys (self-provisioning)
@@ -17737,6 +17791,7 @@ const TRPC_NAMESPACE_API_KEY_RULES = {
17737
17791
  message: rw("chat:read", "chat:write"),
17738
17792
  messenger: "blocked",
17739
17793
  metric: rw("agent:read", "agent:write"),
17794
+ music: { any: "model:invoke" },
17740
17795
  notebook: rw("knowledge:read", "knowledge:write"),
17741
17796
  notification: rw("user:read", "user:write"),
17742
17797
  oauthApp: "blocked",
@@ -49491,7 +49546,7 @@ function registerAgentCommand(program) {
49491
49546
  console.log(r.systemRole);
49492
49547
  }
49493
49548
  });
49494
- agent.command("create").description("Create a new agent").option("-t, --title <title>", "Agent title").option("-d, --description <desc>", "Agent description").option("-m, --model <model>", "Model ID").option("-p, --provider <provider>", "Provider ID").option("-s, --system-role <role>", "System role prompt").option("--group <groupId>", "Group ID").addOption(new Option("--visibility <visibility>", "Who can see the agent in a workspace: `private` (only you) or `public` (workspace members). Omit to use the server default").choices(AGENT_VISIBILITIES)).option("--json [fields]", "Output the created agent as JSON, optionally selecting fields").action(async (options) => {
49549
+ agent.command("create").description("Create a new agent").option("-t, --title <title>", "Agent title").option("-d, --description <desc>", "Agent description").option("-m, --model <model>", "Model ID").option("-p, --provider <provider>", "Provider ID").option("-s, --system-role <role>", "System role prompt").option("--group <groupId>", "Group ID").option("--tag <tag>", "Tag the agent (repeatable), e.g. so an app can find the agents it created", (tag, tags = []) => [...tags, tag]).addOption(new Option("--visibility <visibility>", "Who can see the agent in a workspace: `private` (only you) or `public` (workspace members). Omit to use the server default").choices(AGENT_VISIBILITIES)).option("--json [fields]", "Output the created agent as JSON, optionally selecting fields").action(async (options) => {
49495
49550
  const client = await getTrpcClient();
49496
49551
  const buildUrl = await resolveAppUrlBuilder(client);
49497
49552
  const config = {};
@@ -49500,6 +49555,8 @@ function registerAgentCommand(program) {
49500
49555
  if (options.model) config.model = options.model;
49501
49556
  if (options.provider) config.provider = options.provider;
49502
49557
  if (options.systemRole) config.systemRole = options.systemRole;
49558
+ const tags = [...new Set((options.tag ?? []).map((t) => t.trim()).filter(Boolean))];
49559
+ if (tags.length > 0) config.tags = tags;
49503
49560
  const input = { config };
49504
49561
  if (options.group) input.groupId = options.group;
49505
49562
  if (options.visibility) input.visibility = options.visibility;
@@ -78941,6 +78998,8 @@ var init_resolveCliCommand = __esmMin((() => {
78941
78998
 
78942
78999
  //#endregion
78943
79000
  //#region ../../packages/heterogeneous-agents/src/spawn/dshAcpSession.ts
79001
+ init_src$1();
79002
+ init_resolveCliCommand();
78944
79003
  /**
78945
79004
  * DeepSeek Harness over the Agent Client Protocol.
78946
79005
  *
@@ -78952,6 +79011,32 @@ var init_resolveCliCommand = __esmMin((() => {
78952
79011
  */
78953
79012
  /** The official DeepSeek Harness CLI executable (`npm i -g @deepseek-ai/dsh`). */
78954
79013
  const DSH_COMMAND = "dsh";
79014
+ /** `dsh --version` prints a bare semantic version (e.g. `0.2.0-rc.2`). */
79015
+ const DSH_VERSION_PATTERN = /^v?\d+\.\d+\.\d+(?:[-+][\dA-Za-z.-]+)?$/;
79016
+ /** First release whose CLI ships the `acp` profile with `session/resume`. */
79017
+ const DSH_MIN_VERSION = "0.2.0";
79018
+ /** Compare release numbers only, so `0.2.0-rc.2` already counts as 0.2. */
79019
+ const isSupportedDshVersion = (version) => {
79020
+ const parts = version?.match(/(\d+)\.(\d+)\.(\d+)/)?.slice(1).map(Number);
79021
+ if (!parts) return false;
79022
+ const minimum = DSH_MIN_VERSION.split(".").map(Number);
79023
+ for (const [index, part] of parts.entries()) if (part !== minimum[index]) return part > minimum[index];
79024
+ return true;
79025
+ };
79026
+ /**
79027
+ * Find a `dsh` that can run LobeHub turns. An older CLI still answers
79028
+ * `--version` but has no `acp` profile, so it is reported unavailable here
79029
+ * rather than failing every turn after the agent was created.
79030
+ */
79031
+ const detectDshCommand = async (command = "dsh", env) => {
79032
+ const status = await detectValidatedCommand(command, { validatePattern: DSH_VERSION_PATTERN }, env);
79033
+ if (!status.available || isSupportedDshVersion(status.version)) return status;
79034
+ return {
79035
+ ...status,
79036
+ available: false,
79037
+ 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`
79038
+ };
79039
+ };
78955
79040
  /** Select the CLI's shipped ACP profile, served on stdio until disconnect. */
78956
79041
  const DSH_ACP_PROFILE_ARGS = ["--profile", "acp"];
78957
79042
  /** The profile boots its plugin tree before answering `initialize`. */
@@ -78979,14 +79064,7 @@ const modelChoices = (configOptions) => {
78979
79064
  };
78980
79065
  };
78981
79066
  /** The model name inside a `[provider, model]` choice value. */
78982
- const modelOf = (value) => {
78983
- if (!value) return;
78984
- try {
78985
- const parsed = JSON.parse(value);
78986
- if (Array.isArray(parsed) && typeof parsed[1] === "string") return parsed[1];
78987
- } catch {}
78988
- return value;
78989
- };
79067
+ const modelOf = (value) => value ? parseModelTuple(value)?.modelId ?? value : void 0;
78990
79068
  /** DeepSeek Harness's ACP lifecycle on the shared session base. */
78991
79069
  var DshAcpSession = class extends AcpAgentSession {
78992
79070
  constructor(options) {
@@ -79006,6 +79084,38 @@ var DshAcpSession = class extends AcpAgentSession {
79006
79084
  get sessionId() {
79007
79085
  return this.acpSessionId;
79008
79086
  }
79087
+ /**
79088
+ * Enumerate the configured providers through ACP without sending a prompt.
79089
+ * The harness advertises its model selector on `session/new`; the same
79090
+ * lifecycle a real turn uses, so discovery sees exactly what a turn can pick.
79091
+ */
79092
+ async discoverModels() {
79093
+ try {
79094
+ const initialized = await this.initializeConnection();
79095
+ const result = await this.client.request("session/new", {
79096
+ cwd: this.options.cwd,
79097
+ mcpServers: []
79098
+ });
79099
+ if (!result?.sessionId) throw new Error("DeepSeek Harness ACP returned no session id");
79100
+ if (!result.configOptions?.some(({ id }) => id === DSH_MODEL_CONFIG_ID)) throw new Error("DeepSeek Harness ACP did not expose a model configuration option");
79101
+ const seen = /* @__PURE__ */ new Set();
79102
+ const models = modelChoices(result.configOptions).choices.flatMap(({ name, value }) => {
79103
+ if (seen.has(value)) return [];
79104
+ seen.add(value);
79105
+ const tuple = parseModelTuple(value);
79106
+ return [{
79107
+ id: value,
79108
+ ...name ? { label: name } : {},
79109
+ modelId: tuple?.modelId ?? value,
79110
+ providerId: tuple?.providerId ?? "deepseek-harness"
79111
+ }];
79112
+ });
79113
+ if (initialized?.agentCapabilities?.sessionCapabilities?.close) await this.client.request("session/close", { sessionId: result.sessionId });
79114
+ return models;
79115
+ } finally {
79116
+ this.client.close();
79117
+ }
79118
+ }
79009
79119
  buildInitializeParams() {
79010
79120
  return {
79011
79121
  clientCapabilities: {
@@ -79092,7 +79202,7 @@ var DshAcpSession = class extends AcpAgentSession {
79092
79202
  async selectModel(sessionId, configOptions) {
79093
79203
  const { choices, current } = modelChoices(configOptions);
79094
79204
  const wanted = this.options.model?.trim();
79095
- const choice = wanted ? choices.find(({ name, value }) => name === wanted || modelOf(value) === wanted) : void 0;
79205
+ const choice = wanted ? choices.find(({ value }) => value === wanted) ?? choices.find(({ name, value }) => name === wanted || modelOf(value) === wanted) : void 0;
79096
79206
  if (!choice || choice.value === current) return modelOf(current);
79097
79207
  await this.client.request("session/set_config_option", {
79098
79208
  configId: DSH_MODEL_CONFIG_ID,
@@ -79182,6 +79292,23 @@ const spawnDshAcpSession = (options) => {
79182
79292
  }
79183
79293
  };
79184
79294
  };
79295
+ /** Discover the runtime's grouped model catalog over the `acp` profile. */
79296
+ const listDshAcpModels = async (options) => new DshAcpSession({
79297
+ args: options.args ?? [],
79298
+ clientVersion: options.clientVersion ?? "1.0.0",
79299
+ commandPath: options.commandPath,
79300
+ cwd: options.cwd,
79301
+ env: options.env,
79302
+ onEvents: () => {},
79303
+ onRawMessage: () => {},
79304
+ onRuntimeStatus: () => {},
79305
+ onSessionId: () => {},
79306
+ onStderr: () => {},
79307
+ operationId: "dsh-model-discovery",
79308
+ prompt: "",
79309
+ requestTimeoutMs: options.timeoutMs,
79310
+ sessionId: "dsh-model-discovery"
79311
+ }).discoverModels();
79185
79312
 
79186
79313
  //#endregion
79187
79314
  //#region ../../packages/heterogeneous-agents/src/spawn/fileStoreImageUploader.ts
@@ -79500,13 +79627,13 @@ const assertPrivateRoot = async (rootDir) => {
79500
79627
  if (stat.uid !== process.getuid()) throw new Error(`${rootDir} belongs to another user`);
79501
79628
  if ((stat.mode & 63) !== 0) throw new Error(`${rootDir} is accessible to other users`);
79502
79629
  };
79503
- const pathExists = async (target) => lstat(target).then(() => true, () => false);
79630
+ const pathExists$1 = async (target) => lstat(target).then(() => true, () => false);
79504
79631
  const materializePlugin = async (rootDir) => {
79505
79632
  const files = buildLobeHubCliPluginFiles();
79506
79633
  const digest = createHash("sha256").update(JSON.stringify(files)).digest("hex").slice(0, 16);
79507
79634
  const pluginDir = path.join(rootDir, digest);
79508
79635
  await assertPrivateRoot(rootDir);
79509
- if (await pathExists(path.join(pluginDir, `skills/${"lobehub"}/SKILL.md`))) return pluginDir;
79636
+ if (await pathExists$1(path.join(pluginDir, `skills/${"lobehub"}/SKILL.md`))) return pluginDir;
79510
79637
  const stagingDir = path.join(rootDir, `.staging-${randomUUID()}`);
79511
79638
  try {
79512
79639
  for (const [relativePath, content] of Object.entries(files)) {
@@ -79518,7 +79645,7 @@ const materializePlugin = async (rootDir) => {
79518
79645
  await writeFile(target, content, { mode: 384 });
79519
79646
  }
79520
79647
  await rename(stagingDir, pluginDir).catch(async (error) => {
79521
- if (!await pathExists(pluginDir)) throw error;
79648
+ if (!await pathExists$1(pluginDir)) throw error;
79522
79649
  });
79523
79650
  return pluginDir;
79524
79651
  } finally {
@@ -264960,12 +265087,57 @@ const prepareSkillDirectory = async (params, deps = {}) => {
264960
265087
  const MAX_SKILL_FILE_COUNT = 1e3;
264961
265088
  const DEFAULT_DIRECTORY_PAGE_SIZE = 200;
264962
265089
  const MAX_DIRECTORY_PAGE_SIZE = 1e3;
264963
- const SKILL_SOURCES = [".agents/skills", ".claude/skills"];
264964
- const createProjectSkillRoots = (root) => SKILL_SOURCES.map((source) => ({
264965
- previewRoot: root,
264966
- scope: "project",
264967
- source,
264968
- sourceRoot: path.join(root, source)
265090
+ const SKILL_SOURCES = [
265091
+ ".agents/skills",
265092
+ ".claude/skills",
265093
+ ".codex/skills"
265094
+ ];
265095
+ /**
265096
+ * Upper bound on directories walked from the working directory to the
265097
+ * repository root, so a pathological path cannot turn one scan into hundreds
265098
+ * of filesystem probes.
265099
+ */
265100
+ const MAX_ANCESTOR_DEPTH = 32;
265101
+ const pathExists = async (target) => {
265102
+ try {
265103
+ await stat(target);
265104
+ return true;
265105
+ } catch {
265106
+ return false;
265107
+ }
265108
+ };
265109
+ /**
265110
+ * Directories whose agent files apply to `root`, nearest first: `root` itself,
265111
+ * then each parent up to and including the repository root (the nearest
265112
+ * ancestor containing `.git`, a directory in a checkout and a file in a
265113
+ * worktree or submodule). Without a repository root only `root` applies, so a
265114
+ * directory outside any repository never picks up files from `~` or `/`.
265115
+ *
265116
+ * Mirrors the startup discovery of Codex, Claude Code, OpenCode and pi, so a
265117
+ * run bound to `packages/web` of a monorepo still sees the root `AGENTS.md`
265118
+ * and `.agents/skills`.
265119
+ */
265120
+ const resolveAgentFileDirs = async (root) => {
265121
+ const start = path.resolve(root);
265122
+ const dirs = [];
265123
+ let current = start;
265124
+ for (let depth = 0; depth < MAX_ANCESTOR_DEPTH; depth += 1) {
265125
+ dirs.push(current);
265126
+ if (await pathExists(path.join(current, ".git"))) return dirs;
265127
+ const parent = path.dirname(current);
265128
+ if (parent === current) break;
265129
+ current = parent;
265130
+ }
265131
+ return [start];
265132
+ };
265133
+ const createProjectSkillRoots = (root, dirs) => dirs.flatMap((dir, index) => SKILL_SOURCES.map((source) => {
265134
+ const sourceRoot = path.join(dir, source);
265135
+ return {
265136
+ previewRoot: index === 0 ? root : sourceRoot,
265137
+ scope: "project",
265138
+ source,
265139
+ sourceRoot
265140
+ };
264969
265141
  }));
264970
265142
  const createDeviceSkillRoots = () => {
264971
265143
  const home = os$4.homedir();
@@ -264979,7 +265151,11 @@ const createDeviceSkillRoots = () => {
264979
265151
  };
264980
265152
  });
264981
265153
  };
264982
- const createSkillRoots = (root) => [...createProjectSkillRoots(root), ...createDeviceSkillRoots()];
265154
+ /**
265155
+ * Scan order decides name collisions (first wins): the working directory
265156
+ * before its parents, project before device.
265157
+ */
265158
+ const createSkillRoots = async (root) => [...createProjectSkillRoots(root, await resolveAgentFileDirs(root)), ...createDeviceSkillRoots()];
264983
265159
  const toPosixRelativePath = (filePath) => filePath.split(path.sep).join("/");
264984
265160
  const listSkillFilesRecursive = async (dir) => {
264985
265161
  const results = [];
@@ -265072,34 +265248,75 @@ const approvePreviewRoots = async (skills, deps, extraRoots = []) => {
265072
265248
  const roots = new Set([...extraRoots, ...skills.map((skill) => skill.previewRoot)]);
265073
265249
  await Promise.all([...roots].map((root) => deps.approveProjectRoot(root)));
265074
265250
  };
265251
+ /** Per-file cap, so one oversized file cannot crowd out the others. */
265252
+ const MAX_INSTRUCTIONS_FILE_BYTES = 64 * 1024;
265253
+ /** Cap across every directory, bounding the cached payload and the system role. */
265254
+ const MAX_INSTRUCTIONS_TOTAL_BYTES = 128 * 1024;
265255
+ const INSTRUCTION_FILENAMES = ["AGENTS.md", "CLAUDE.md"];
265075
265256
  /**
265076
- * Read the project-root agent instructions files (`AGENTS.md`, then `CLAUDE.md`).
265077
- * Collects every present candidate rather than first-match, since both can
265078
- * coexist. Each body is capped so a pathologically large file can't bloat the
265079
- * cached payload or the injected system role.
265257
+ * Cut `raw` to at most `maxBytes` of UTF-8. Measuring `string.length` would
265258
+ * count UTF-16 units, letting CJK text exceed the budget about threefold. A
265259
+ * character split at the boundary decodes to U+FFFD and is dropped.
265080
265260
  */
265081
- const readWorkspaceInstructions = async (root) => {
265082
- const MAX_INSTRUCTIONS_BYTES = 64 * 1024;
265083
- const candidates = ["AGENTS.md", "CLAUDE.md"];
265084
- const instructions = [];
265085
- for (const source of candidates) try {
265086
- const raw = await readFile(path.join(root, source), "utf8");
265087
- const content = raw.length > MAX_INSTRUCTIONS_BYTES ? raw.slice(0, MAX_INSTRUCTIONS_BYTES) : raw;
265088
- instructions.push({
265089
- content,
265090
- source
265091
- });
265092
- } catch {}
265093
- return instructions;
265261
+ const truncateUtf8 = (raw, maxBytes) => {
265262
+ const buffer = Buffer.from(raw, "utf8");
265263
+ if (buffer.length <= maxBytes) return {
265264
+ bytes: buffer.length,
265265
+ content: raw
265266
+ };
265267
+ const content = buffer.subarray(0, maxBytes).toString("utf8").replace(/\uFFFD+$/, "");
265268
+ return {
265269
+ bytes: Buffer.byteLength(content, "utf8"),
265270
+ content
265271
+ };
265094
265272
  };
265095
265273
  /**
265096
- * Scan agent skill directories for the project and the execution device.
265097
- * Project skills win over device skills on name collision. Approves each
265274
+ * Read the agent instructions files (`AGENTS.md`, then `CLAUDE.md`) in `dirs`
265275
+ * (nearest first), returned root first so the most specific file comes last
265276
+ * in the prompt, as the other harnesses order them.
265277
+ *
265278
+ * Both names are read in each directory since they can coexist, except when
265279
+ * one is a symlink to the other (a common way to share one file between
265280
+ * harnesses): the same file is never injected twice. The total budget is
265281
+ * spent nearest first, so when it runs out the farthest parents are dropped,
265282
+ * not the working directory's own rules.
265283
+ */
265284
+ const readWorkspaceInstructions = async (dirs) => {
265285
+ const seen = /* @__PURE__ */ new Set();
265286
+ const byDir = [];
265287
+ let remaining = MAX_INSTRUCTIONS_TOTAL_BYTES;
265288
+ for (const dir of dirs) {
265289
+ const found = [];
265290
+ for (const source of INSTRUCTION_FILENAMES) {
265291
+ if (remaining <= 0) break;
265292
+ const filePath = path.join(dir, source);
265293
+ try {
265294
+ const real = await realpath(filePath);
265295
+ if (seen.has(real)) continue;
265296
+ seen.add(real);
265297
+ const { bytes, content } = truncateUtf8(await readFile(filePath, "utf8"), Math.min(MAX_INSTRUCTIONS_FILE_BYTES, remaining));
265298
+ remaining -= bytes;
265299
+ found.push({
265300
+ content,
265301
+ path: filePath,
265302
+ source
265303
+ });
265304
+ } catch {}
265305
+ }
265306
+ byDir.push(found);
265307
+ }
265308
+ return byDir.reverse().flat();
265309
+ };
265310
+ /**
265311
+ * Scan agent skill directories for the project (the working directory and its
265312
+ * parents up to the repository root) and the execution device. Nearer project
265313
+ * skills win over farther ones, and project skills over device skills, on name
265314
+ * collision. Approves each
265098
265315
  * discovered skill's preview root for the host preview protocol.
265099
265316
  */
265100
265317
  const listProjectSkills = async (params, deps = {}) => {
265101
265318
  const root = params.scope;
265102
- const skills = await collectSkills(createSkillRoots(root));
265319
+ const skills = await collectSkills(await createSkillRoots(root));
265103
265320
  if (skills.length > 0) await approvePreviewRoots(skills, deps);
265104
265321
  return {
265105
265322
  root,
@@ -265109,14 +265326,15 @@ const listProjectSkills = async (params, deps = {}) => {
265109
265326
  };
265110
265327
  /**
265111
265328
  * One-call "workspace init" scan: merge project and execution-device skills
265112
- * (deduped by name, project winning) and read the project-root agent
265113
- * instructions. Approves the project root regardless of what was found, since
265329
+ * (deduped by name, project winning) and read the agent instructions from the
265330
+ * working directory up to the repository root. Approves the project root regardless of what was found, since
265114
265331
  * the run is now bound to this root.
265115
265332
  */
265116
265333
  const initWorkspace = async (params, deps = {}) => {
265117
265334
  const root = params.scope;
265118
- const skills = await collectSkills(createSkillRoots(root));
265119
- const instructions = await readWorkspaceInstructions(root);
265335
+ const dirs = await resolveAgentFileDirs(root);
265336
+ const skills = await collectSkills([...createProjectSkillRoots(root, dirs), ...createDeviceSkillRoots()]);
265337
+ const instructions = await readWorkspaceInstructions(dirs);
265120
265338
  await approvePreviewRoots(skills, deps, [root]);
265121
265339
  return {
265122
265340
  instructions,
@@ -300730,15 +300948,20 @@ const createTerminalDeps = (terminals) => ({
300730
300948
  //#region ../../packages/heterogeneous-agents/src/labels.ts
300731
300949
  init_config();
300732
300950
  /**
300733
- * Display-name mapping for all heterogeneous agent types (local CLI + remote platform).
300951
+ * Display-name mapping for all heterogeneous agent types (local CLI, local
300952
+ * runtime, remote platform).
300734
300953
  *
300735
300954
  * Keys mirror the registry keys in `registry.ts` (adapter type). UI layers
300736
300955
  * use this to render user-facing names (e.g. "Claude Code is running")
300737
300956
  * without knowing adapter-specific branding.
300738
- * Add new types to HETEROGENEOUS_AGENT_CONFIGS or REMOTE_HETEROGENEOUS_AGENT_CONFIGS
300739
- * in config.ts to automatically include them here.
300957
+ * Add new types to HETEROGENEOUS_AGENT_CONFIGS, LOCAL_RUNTIME_HETEROGENEOUS_AGENT_CONFIGS
300958
+ * or REMOTE_HETEROGENEOUS_AGENT_CONFIGS in config.ts to automatically include them here.
300740
300959
  */
300741
- const HETEROGENEOUS_TYPE_LABELS = Object.fromEntries([...HETEROGENEOUS_AGENT_CONFIGS.map((config) => [config.type, config.title]), ...REMOTE_HETEROGENEOUS_AGENT_CONFIGS.map((config) => [config.type, config.title])]);
300960
+ const HETEROGENEOUS_TYPE_LABELS = Object.fromEntries([
300961
+ ...HETEROGENEOUS_AGENT_CONFIGS.map((config) => [config.type, config.title]),
300962
+ ...LOCAL_RUNTIME_HETEROGENEOUS_AGENT_CONFIGS.map((config) => [config.type, config.title]),
300963
+ ...REMOTE_HETEROGENEOUS_AGENT_CONFIGS.map((config) => [config.type, config.title])
300964
+ ]);
300742
300965
  const getHeterogeneousTypeLabel = (type) => {
300743
300966
  if (!type) return void 0;
300744
300967
  return Object.hasOwn(HETEROGENEOUS_TYPE_LABELS, type) ? HETEROGENEOUS_TYPE_LABELS[type] : type;
@@ -301065,6 +301288,22 @@ const getCatalogErrorMessage = (code, type) => {
301065
301288
  return `${name} model discovery failed`;
301066
301289
  };
301067
301290
  /**
301291
+ * Resolve the runtime to launch for catalog discovery. DeepSeek Harness is a
301292
+ * protocol runtime with no local-CLI descriptor, so it is not covered by
301293
+ * {@link resolveHeteroSpawnCommand}; its own detector validates the version and
301294
+ * resolves the executable the same way.
301295
+ */
301296
+ const resolveCatalogCommand = async (params, env) => {
301297
+ if (params.type !== "deepseek-harness") return resolveHeteroSpawnCommand(params.type, params.command);
301298
+ const requested = params.command?.trim();
301299
+ if (requested && requested !== "dsh") return { command: requested };
301300
+ const detected = await detectDshCommand("dsh", env).catch(() => void 0);
301301
+ return detected?.available && detected.path ? {
301302
+ command: detected.path,
301303
+ pathEnv: detected.resolvedPathEnv
301304
+ } : { command: "dsh" };
301305
+ };
301306
+ /**
301068
301307
  * Query the model catalog from the same host that will execute the agent.
301069
301308
  *
301070
301309
  * Callers own construction of the full child environment so Desktop can apply
@@ -301074,8 +301313,8 @@ const getCatalogErrorMessage = (code, type) => {
301074
301313
  */
301075
301314
  const listHeterogeneousAgentModels = async (params) => {
301076
301315
  const updatedAt = Date.now();
301077
- const resolved = await resolveHeteroSpawnCommand(params.type, params.command);
301078
301316
  const callerEnv = params.env ?? process.env;
301317
+ const resolved = await resolveCatalogCommand(params, callerEnv);
301079
301318
  const mergedPath = [...new Set([callerEnv.PATH, resolved.pathEnv].filter(Boolean).join(path.delimiter).split(path.delimiter))].filter(Boolean).join(path.delimiter);
301080
301319
  const env = {
301081
301320
  ...callerEnv,
@@ -301094,6 +301333,17 @@ const listHeterogeneousAgentModels = async (params) => {
301094
301333
  updatedAt
301095
301334
  };
301096
301335
  const cwd = resolveHeteroSpawnCwd(params.cwd ?? process.cwd());
301336
+ if (params.type === "deepseek-harness") return {
301337
+ models: await listDshAcpModels({
301338
+ args: params.args,
301339
+ commandPath: resolved.command,
301340
+ cwd: cwd ?? process.cwd(),
301341
+ env,
301342
+ timeoutMs: MODEL_CATALOG_TIMEOUT_MS
301343
+ }),
301344
+ status: "success",
301345
+ updatedAt
301346
+ };
301097
301347
  if (params.type === "copilot") return {
301098
301348
  models: await listCopilotAcpModels({
301099
301349
  args: params.args,
@@ -556026,9 +556276,9 @@ const buildTtsParams = (options) => {
556026
556276
  };
556027
556277
  };
556028
556278
  function registerTtsCommand(parent) {
556029
- parent.command("tts <text>").description("Convert text to speech").option("-o, --output <file>", "Output audio file path (default: output.<format>)").option("--voice <voice>", "Voice id (default: the model's default voice)").option("--speed <n>", "Speed multiplier").option("--pitch <n>", "Pitch adjustment").option("--volume <n>", "Volume adjustment").option("--emotion <emotion>", "Emotion, e.g. happy, sad").option("--format <format>", "Audio format: mp3, opus, aac").option("--sample-rate <hz>", "Output sample rate in Hz").option("--instructions <text>", "Style instructions, for models that accept them").option("--params <json>", "Extra standard TTS params as a JSON object").option("-m, --model <model>", "Model ID (provider/model format)", "tts-1").option("-p, --provider <provider>", "Provider name (derived from model if omitted)").action(async (text, options) => {
556279
+ parent.command("tts <text>").description("Convert text to speech").option("-o, --output <file>", "Output audio file path (default: output.<format>)").option("--voice <voice>", "Voice id (default: the voice saved for the model in provider settings, else the model's default)").option("--speed <n>", "Speed multiplier").option("--pitch <n>", "Pitch adjustment").option("--volume <n>", "Volume adjustment").option("--emotion <emotion>", "Emotion, e.g. happy, sad").option("--format <format>", "Audio format: mp3, opus, aac (as the model supports)").option("--sample-rate <hz>", "Output sample rate in Hz").option("--instructions <text>", "Style instructions, for models that accept them").option("--params <json>", "Extra standard TTS params as a JSON object").option("-m, --model <model>", "Model ID (provider/model format)", "tts-1").option("-p, --provider <provider>", "Provider name (default: the model prefix, else the built-in model's provider)").action(async (text, options) => {
556030
556280
  const parts = options.model.split("/");
556031
- const provider = options.provider || (parts.length > 1 ? parts[0] : "openai");
556281
+ const provider = options.provider || (parts.length > 1 ? parts[0] : void 0);
556032
556282
  const model = parts.length > 1 ? parts.slice(1).join("/") : options.model;
556033
556283
  let params;
556034
556284
  try {
@@ -574334,7 +574584,7 @@ var WebStandardStreamableHTTPServerTransport = class {
574334
574584
  };
574335
574585
 
574336
574586
  //#endregion
574337
- //#region node_modules/.pnpm/@hono+node-server@2.1.7_hono@4.13.18/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs
574587
+ //#region node_modules/.pnpm/@hono+node-server@2.1.8_hono@4.13.18/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs
574338
574588
  const X_ALREADY_SENT = "x-hono-already-sent";
574339
574589
 
574340
574590
  //#endregion
@@ -574363,7 +574613,7 @@ const defineWebSocketHelper = (handler) => {
574363
574613
  };
574364
574614
 
574365
574615
  //#endregion
574366
- //#region node_modules/.pnpm/@hono+node-server@2.1.7_hono@4.13.18/node_modules/@hono/node-server/dist/index.mjs
574616
+ //#region node_modules/.pnpm/@hono+node-server@2.1.8_hono@4.13.18/node_modules/@hono/node-server/dist/index.mjs
574367
574617
  var RequestError = class extends Error {
574368
574618
  constructor(message, options) {
574369
574619
  super(message, options);
@@ -574894,6 +575144,7 @@ Object.defineProperty(requestPrototype, "signal", { get() {
574894
575144
  "cache",
574895
575145
  "credentials",
574896
575146
  "destination",
575147
+ "duplex",
574897
575148
  "integrity",
574898
575149
  "mode",
574899
575150
  "redirect",
@@ -575113,6 +575364,11 @@ function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromi
575113
575364
  const cancel = (error) => {
575114
575365
  reader.cancel(error).catch(() => {});
575115
575366
  };
575367
+ const stream = writable.stream;
575368
+ if (writable.destroyed || stream?.closed || stream?.destroyed) {
575369
+ cancel();
575370
+ return reader.closed;
575371
+ }
575116
575372
  writable.on("close", cancel);
575117
575373
  writable.on("error", cancel);
575118
575374
  (currentReadPromise ?? reader.read()).then(flow, handleStreamError);
@@ -575130,7 +575386,7 @@ function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromi
575130
575386
  try {
575131
575387
  if (done) writable.end();
575132
575388
  else if (!writable.write(value)) writable.once("drain", onDrain);
575133
- else return reader.read().then(flow, handleStreamError);
575389
+ else reader.read().then(flow, handleStreamError);
575134
575390
  } catch (e) {
575135
575391
  handleStreamError(e);
575136
575392
  }
@@ -575138,7 +575394,10 @@ function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromi
575138
575394
  }
575139
575395
  function writeFromReadableStream(stream, writable) {
575140
575396
  if (stream.locked) throw new TypeError("ReadableStream is locked.");
575141
- else if (writable.destroyed) return;
575397
+ else if (writable.destroyed) {
575398
+ stream.cancel().catch(() => {});
575399
+ return;
575400
+ }
575142
575401
  return writeFromReadableStreamDefaultReader(stream.getReader(), writable);
575143
575402
  }
575144
575403
  const buildOutgoingHttpHeaders = (headers, defaultContentType) => {
@@ -575329,10 +575588,7 @@ const responseViaResponseObject = async (res, outgoing, options = {}) => {
575329
575588
  let maxReadCount = 2;
575330
575589
  for (let i = 0; i < maxReadCount; i++) {
575331
575590
  currentReadPromise ||= reader.read();
575332
- const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {
575333
- console.error(e);
575334
- done = true;
575335
- });
575591
+ const chunk = await readWithoutBlocking(currentReadPromise);
575336
575592
  if (!chunk) {
575337
575593
  if (i === 1) {
575338
575594
  await new Promise((resolve) => setTimeout(resolve));