@lichao0223/lobehub-cli 0.0.105 → 0.0.107

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
@@ -15,7 +15,7 @@ import { Buffer as Buffer$1 } from "node:buffer";
15
15
  import * as net$1 from "node:net";
16
16
  import net, { BlockList, connect, createServer, isIP } from "node:net";
17
17
  import { scheduler, setImmediate as setImmediate$1, setTimeout as setTimeout$1 } from "node:timers/promises";
18
- import _w, { cwd, execArgv, execPath, hrtime, platform as platform$1 } from "node:process";
18
+ import process$1, { cwd, execArgv, execPath, hrtime, platform as platform$1 } from "node:process";
19
19
  import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url";
20
20
  import { finished, pipeline } from "node:stream/promises";
21
21
  import { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark, pipeline as pipeline$1 } from "node:stream";
@@ -19265,6 +19265,392 @@ const INTEREST_AREA_KEYS = [
19265
19265
  ];
19266
19266
  const interestAreaKeySet = new Set(INTEREST_AREA_KEYS);
19267
19267
 
19268
+ //#endregion
19269
+ //#region ../../packages/const/src/officialMcp.ts
19270
+ const favicon = (domain) => `https://icons.duckduckgo.com/ip3/${domain}.ico`;
19271
+ const OFFICIAL_MCP_SERVERS = [
19272
+ {
19273
+ auth: "oauth",
19274
+ author: "Sentry",
19275
+ category: "developer",
19276
+ description: "Look up issues, errors and releases in your Sentry projects",
19277
+ icon: favicon("sentry.io"),
19278
+ identifier: "sentry",
19279
+ label: "Sentry",
19280
+ url: "https://mcp.sentry.dev/mcp"
19281
+ },
19282
+ {
19283
+ auth: "oauth",
19284
+ author: "Cloudflare",
19285
+ category: "developer",
19286
+ description: "Manage Workers, KV, R2 and D1 in your Cloudflare account",
19287
+ icon: favicon("cloudflare.com"),
19288
+ identifier: "cloudflare",
19289
+ label: "Cloudflare",
19290
+ url: "https://bindings.mcp.cloudflare.com/mcp"
19291
+ },
19292
+ {
19293
+ auth: "oauth",
19294
+ author: "Stripe",
19295
+ category: "developer",
19296
+ description: "Work with customers, payments, invoices and subscriptions in Stripe",
19297
+ icon: favicon("stripe.com"),
19298
+ identifier: "stripe",
19299
+ label: "Stripe",
19300
+ url: "https://mcp.stripe.com"
19301
+ },
19302
+ {
19303
+ auth: "oauth",
19304
+ author: "GitLab",
19305
+ category: "developer",
19306
+ description: "Search projects, issues and merge requests on GitLab",
19307
+ icon: favicon("gitlab.com"),
19308
+ identifier: "gitlab",
19309
+ label: "GitLab",
19310
+ url: "https://gitlab.com/api/v4/mcp"
19311
+ },
19312
+ {
19313
+ auth: "oauth",
19314
+ author: "Neon",
19315
+ category: "developer",
19316
+ description: "Manage Neon Postgres projects, branches and queries",
19317
+ icon: favicon("neon.tech"),
19318
+ identifier: "neon",
19319
+ label: "Neon",
19320
+ url: "https://mcp.neon.tech/mcp"
19321
+ },
19322
+ {
19323
+ auth: "oauth",
19324
+ author: "Netlify",
19325
+ category: "developer",
19326
+ description: "Create, deploy and manage Netlify sites",
19327
+ icon: favicon("netlify.com"),
19328
+ identifier: "netlify",
19329
+ label: "Netlify",
19330
+ url: "https://netlify-mcp.netlify.app/mcp"
19331
+ },
19332
+ {
19333
+ auth: "oauth",
19334
+ author: "Railway",
19335
+ category: "developer",
19336
+ description: "Deploy and manage services and environments on Railway",
19337
+ icon: favicon("railway.com"),
19338
+ identifier: "railway",
19339
+ label: "Railway",
19340
+ url: "https://mcp.railway.com"
19341
+ },
19342
+ {
19343
+ auth: "oauth",
19344
+ author: "Datadog",
19345
+ category: "developer",
19346
+ description: "Query logs, metrics, monitors and incidents in Datadog",
19347
+ icon: favicon("datadoghq.com"),
19348
+ identifier: "datadog",
19349
+ label: "Datadog",
19350
+ url: "https://mcp.datadoghq.com/api/unstable/mcp-server/mcp"
19351
+ },
19352
+ {
19353
+ auth: "oauth",
19354
+ author: "Grafana Labs",
19355
+ category: "developer",
19356
+ description: "Search dashboards, query data sources and inspect alerts in Grafana Cloud",
19357
+ icon: favicon("grafana.com"),
19358
+ identifier: "grafana",
19359
+ label: "Grafana",
19360
+ url: "https://mcp.grafana.com/mcp"
19361
+ },
19362
+ {
19363
+ auth: "oauth",
19364
+ author: "Postman",
19365
+ category: "developer",
19366
+ description: "Work with Postman workspaces, collections and APIs",
19367
+ icon: favicon("postman.com"),
19368
+ identifier: "postman",
19369
+ label: "Postman",
19370
+ url: "https://mcp.postman.com/mcp"
19371
+ },
19372
+ {
19373
+ auth: "oauth",
19374
+ author: "Prisma",
19375
+ category: "developer",
19376
+ description: "Manage Prisma Postgres databases and migrations",
19377
+ icon: favicon("prisma.io"),
19378
+ identifier: "prisma",
19379
+ label: "Prisma",
19380
+ url: "https://mcp.prisma.io/mcp"
19381
+ },
19382
+ {
19383
+ auth: "oauth",
19384
+ author: "ClickHouse",
19385
+ category: "developer",
19386
+ description: "Explore and query ClickHouse Cloud services",
19387
+ icon: favicon("clickhouse.com"),
19388
+ identifier: "clickhouse",
19389
+ label: "ClickHouse",
19390
+ url: "https://mcp.clickhouse.cloud/mcp"
19391
+ },
19392
+ {
19393
+ auth: "oauth",
19394
+ author: "incident.io",
19395
+ category: "developer",
19396
+ description: "Review and manage incidents, alerts and on-call in incident.io",
19397
+ icon: favicon("incident.io"),
19398
+ identifier: "incident-io",
19399
+ label: "incident.io",
19400
+ url: "https://mcp.incident.io/mcp"
19401
+ },
19402
+ {
19403
+ auth: "oauth",
19404
+ author: "Atlassian",
19405
+ category: "projects",
19406
+ description: "Search and update Jira issues and Confluence pages with the official Atlassian server",
19407
+ icon: favicon("atlassian.com"),
19408
+ identifier: "atlassian",
19409
+ label: "Atlassian",
19410
+ url: "https://mcp.atlassian.com/v1/mcp"
19411
+ },
19412
+ {
19413
+ auth: "oauth",
19414
+ author: "monday.com",
19415
+ category: "projects",
19416
+ description: "Manage boards, items and updates in monday.com",
19417
+ icon: favicon("monday.com"),
19418
+ identifier: "monday",
19419
+ label: "monday.com",
19420
+ url: "https://mcp.monday.com/mcp"
19421
+ },
19422
+ {
19423
+ auth: "oauth",
19424
+ author: "Doist",
19425
+ category: "productivity",
19426
+ description: "Add, organize and complete tasks in Todoist",
19427
+ icon: favicon("todoist.com"),
19428
+ identifier: "todoist",
19429
+ label: "Todoist",
19430
+ url: "https://ai.todoist.net/mcp"
19431
+ },
19432
+ {
19433
+ auth: "oauth",
19434
+ author: "Miro",
19435
+ category: "projects",
19436
+ description: "Read and create content on Miro boards",
19437
+ icon: favicon("miro.com"),
19438
+ identifier: "miro",
19439
+ label: "Miro",
19440
+ url: "https://mcp.miro.com/"
19441
+ },
19442
+ {
19443
+ auth: "oauth",
19444
+ author: "Canva",
19445
+ category: "productivity",
19446
+ description: "Search, create and edit designs in Canva",
19447
+ icon: favicon("canva.com"),
19448
+ identifier: "canva",
19449
+ label: "Canva",
19450
+ url: "https://mcp.canva.com/mcp"
19451
+ },
19452
+ {
19453
+ auth: "oauth",
19454
+ author: "Calendly",
19455
+ category: "productivity",
19456
+ description: "Check availability and manage scheduled events in Calendly",
19457
+ icon: favicon("calendly.com"),
19458
+ identifier: "calendly",
19459
+ label: "Calendly",
19460
+ url: "https://mcp.calendly.com"
19461
+ },
19462
+ {
19463
+ auth: "oauth",
19464
+ author: "Intercom",
19465
+ category: "chat",
19466
+ description: "Search conversations, contacts and help articles in Intercom",
19467
+ icon: favicon("intercom.com"),
19468
+ identifier: "intercom",
19469
+ label: "Intercom",
19470
+ url: "https://mcp.intercom.com/mcp"
19471
+ },
19472
+ {
19473
+ auth: "oauth",
19474
+ author: "Webflow",
19475
+ category: "documents",
19476
+ description: "Manage Webflow sites, pages and CMS collections",
19477
+ icon: favicon("webflow.com"),
19478
+ identifier: "webflow",
19479
+ label: "Webflow",
19480
+ url: "https://mcp.webflow.com/mcp"
19481
+ },
19482
+ {
19483
+ auth: "oauth",
19484
+ author: "Automattic",
19485
+ category: "documents",
19486
+ description: "Read and publish posts on your WordPress.com sites",
19487
+ icon: favicon("wordpress.com"),
19488
+ identifier: "wordpress",
19489
+ label: "WordPress.com",
19490
+ url: "https://public-api.wordpress.com/wpcom/v2/mcp/v1"
19491
+ },
19492
+ {
19493
+ auth: "oauth",
19494
+ author: "Coda",
19495
+ category: "documents",
19496
+ description: "Read and update Coda docs and tables",
19497
+ icon: favicon("coda.io"),
19498
+ identifier: "coda",
19499
+ label: "Coda",
19500
+ url: "https://coda.io/apis/mcp"
19501
+ },
19502
+ {
19503
+ auth: "oauth",
19504
+ author: "GitBook",
19505
+ category: "documents",
19506
+ description: "Search and read your GitBook documentation spaces",
19507
+ icon: favicon("gitbook.com"),
19508
+ identifier: "gitbook",
19509
+ label: "GitBook",
19510
+ url: "https://mcp.gitbook.com/mcp"
19511
+ },
19512
+ {
19513
+ auth: "oauth",
19514
+ author: "Granola",
19515
+ category: "productivity",
19516
+ description: "Search your Granola meeting notes and transcripts",
19517
+ icon: favicon("granola.ai"),
19518
+ identifier: "granola",
19519
+ label: "Granola",
19520
+ url: "https://mcp.granola.ai/mcp"
19521
+ },
19522
+ {
19523
+ auth: "oauth",
19524
+ author: "Fireflies.ai",
19525
+ category: "productivity",
19526
+ description: "Search meeting transcripts and summaries in Fireflies",
19527
+ icon: favicon("fireflies.ai"),
19528
+ identifier: "fireflies",
19529
+ label: "Fireflies",
19530
+ url: "https://api.fireflies.ai/mcp"
19531
+ },
19532
+ {
19533
+ auth: "oauth",
19534
+ author: "Amplitude",
19535
+ category: "developer",
19536
+ description: "Query charts, events and user analytics in Amplitude",
19537
+ icon: favicon("amplitude.com"),
19538
+ identifier: "amplitude",
19539
+ label: "Amplitude",
19540
+ url: "https://mcp.amplitude.com/mcp"
19541
+ },
19542
+ {
19543
+ auth: "oauth",
19544
+ author: "Mixpanel",
19545
+ category: "developer",
19546
+ description: "Query events, funnels and retention in Mixpanel",
19547
+ icon: favicon("mixpanel.com"),
19548
+ identifier: "mixpanel",
19549
+ label: "Mixpanel",
19550
+ url: "https://mcp.mixpanel.com/mcp"
19551
+ },
19552
+ {
19553
+ auth: "oauth",
19554
+ author: "Hex",
19555
+ category: "developer",
19556
+ description: "Search and run Hex projects and data analyses",
19557
+ icon: favicon("hex.tech"),
19558
+ identifier: "hex",
19559
+ label: "Hex",
19560
+ url: "https://app.hex.tech/mcp"
19561
+ },
19562
+ {
19563
+ auth: "oauth",
19564
+ author: "Ahrefs",
19565
+ category: "productivity",
19566
+ description: "Pull SEO metrics, backlinks and keyword data from Ahrefs",
19567
+ icon: favicon("ahrefs.com"),
19568
+ identifier: "ahrefs",
19569
+ label: "Ahrefs",
19570
+ url: "https://api.ahrefs.com/mcp/mcp"
19571
+ },
19572
+ {
19573
+ auth: "oauth",
19574
+ author: "Semrush",
19575
+ category: "productivity",
19576
+ description: "Pull keyword, domain and traffic data from Semrush",
19577
+ icon: favicon("semrush.com"),
19578
+ identifier: "semrush",
19579
+ label: "Semrush",
19580
+ url: "https://mcp.semrush.com/v1/mcp"
19581
+ },
19582
+ {
19583
+ auth: "oauth",
19584
+ author: "PayPal",
19585
+ category: "developer",
19586
+ description: "Manage invoices, orders and transactions in PayPal",
19587
+ icon: favicon("paypal.com"),
19588
+ identifier: "paypal",
19589
+ label: "PayPal",
19590
+ url: "https://mcp.paypal.com/mcp"
19591
+ },
19592
+ {
19593
+ auth: "oauth",
19594
+ author: "Zapier",
19595
+ category: "productivity",
19596
+ description: "Run actions across thousands of apps through your Zapier account",
19597
+ icon: favicon("zapier.com"),
19598
+ identifier: "zapier",
19599
+ label: "Zapier",
19600
+ url: "https://mcp.zapier.com/api/mcp/mcp"
19601
+ },
19602
+ {
19603
+ auth: "oauth",
19604
+ author: "Make",
19605
+ category: "productivity",
19606
+ description: "Run your Make scenarios as tools",
19607
+ icon: favicon("make.com"),
19608
+ identifier: "make",
19609
+ label: "Make",
19610
+ url: "https://mcp.make.com"
19611
+ },
19612
+ {
19613
+ auth: "none",
19614
+ author: "Upstash",
19615
+ category: "developer",
19616
+ description: "Fetch up-to-date library documentation and code examples",
19617
+ icon: favicon("context7.com"),
19618
+ identifier: "context7",
19619
+ label: "Context7",
19620
+ url: "https://mcp.context7.com/mcp"
19621
+ },
19622
+ {
19623
+ auth: "none",
19624
+ author: "Cognition",
19625
+ category: "developer",
19626
+ description: "Ask questions about public GitHub repositories",
19627
+ icon: favicon("deepwiki.com"),
19628
+ identifier: "deepwiki",
19629
+ label: "DeepWiki",
19630
+ url: "https://mcp.deepwiki.com/mcp"
19631
+ },
19632
+ {
19633
+ auth: "none",
19634
+ author: "Exa",
19635
+ category: "productivity",
19636
+ description: "Search the web and fetch page content with Exa",
19637
+ icon: favicon("exa.ai"),
19638
+ identifier: "exa",
19639
+ label: "Exa",
19640
+ url: "https://mcp.exa.ai/mcp"
19641
+ },
19642
+ {
19643
+ auth: "none",
19644
+ author: "Cloudflare",
19645
+ category: "developer",
19646
+ description: "Search the Cloudflare developer documentation",
19647
+ icon: favicon("developers.cloudflare.com"),
19648
+ identifier: "cloudflare-docs",
19649
+ label: "Cloudflare Docs",
19650
+ url: "https://docs.mcp.cloudflare.com/mcp"
19651
+ }
19652
+ ];
19653
+
19268
19654
  //#endregion
19269
19655
  //#region ../../packages/const/src/plugin.ts
19270
19656
  const PLUGIN_SCHEMA_SEPARATOR = "____";
@@ -22225,7 +22611,7 @@ var require_command = /* @__PURE__ */ __commonJSMin$2(((exports) => {
22225
22611
  const childProcess$2 = __require("node:child_process");
22226
22612
  const path$16 = __require("node:path");
22227
22613
  const fs$17 = __require("node:fs");
22228
- const process$2 = __require("node:process");
22614
+ const process$3 = __require("node:process");
22229
22615
  const { Argument, humanReadableArgName } = require_argument();
22230
22616
  const { CommanderError } = require_error$1();
22231
22617
  const { Help, stripColor } = require_help();
@@ -22277,13 +22663,13 @@ var require_command = /* @__PURE__ */ __commonJSMin$2(((exports) => {
22277
22663
  this._showSuggestionAfterError = true;
22278
22664
  this._savedState = null;
22279
22665
  this._outputConfiguration = {
22280
- writeOut: (str) => process$2.stdout.write(str),
22281
- writeErr: (str) => process$2.stderr.write(str),
22666
+ writeOut: (str) => process$3.stdout.write(str),
22667
+ writeErr: (str) => process$3.stderr.write(str),
22282
22668
  outputError: (str, write) => write(str),
22283
- getOutHelpWidth: () => process$2.stdout.isTTY ? process$2.stdout.columns : void 0,
22284
- getErrHelpWidth: () => process$2.stderr.isTTY ? process$2.stderr.columns : void 0,
22285
- getOutHasColors: () => useColor() ?? (process$2.stdout.isTTY && process$2.stdout.hasColors?.()),
22286
- getErrHasColors: () => useColor() ?? (process$2.stderr.isTTY && process$2.stderr.hasColors?.()),
22669
+ getOutHelpWidth: () => process$3.stdout.isTTY ? process$3.stdout.columns : void 0,
22670
+ getErrHelpWidth: () => process$3.stderr.isTTY ? process$3.stderr.columns : void 0,
22671
+ getOutHasColors: () => useColor() ?? (process$3.stdout.isTTY && process$3.stdout.hasColors?.()),
22672
+ getErrHasColors: () => useColor() ?? (process$3.stderr.isTTY && process$3.stderr.hasColors?.()),
22287
22673
  stripColor: (str) => stripColor(str)
22288
22674
  };
22289
22675
  this._hidden = false;
@@ -22641,7 +23027,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
22641
23027
  */
22642
23028
  _exit(exitCode, code, message) {
22643
23029
  if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code, message));
22644
- process$2.exit(exitCode);
23030
+ process$3.exit(exitCode);
22645
23031
  }
22646
23032
  /**
22647
23033
  * Register callback `fn` for the command.
@@ -22980,11 +23366,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
22980
23366
  if (argv !== void 0 && !Array.isArray(argv)) throw new Error("first parameter to parse must be array or undefined");
22981
23367
  parseOptions = parseOptions || {};
22982
23368
  if (argv === void 0 && parseOptions.from === void 0) {
22983
- if (process$2.versions?.electron) parseOptions.from = "electron";
22984
- const execArgv = process$2.execArgv ?? [];
23369
+ if (process$3.versions?.electron) parseOptions.from = "electron";
23370
+ const execArgv = process$3.execArgv ?? [];
22985
23371
  if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) parseOptions.from = "eval";
22986
23372
  }
22987
- if (argv === void 0) argv = process$2.argv;
23373
+ if (argv === void 0) argv = process$3.argv;
22988
23374
  this.rawArgs = argv.slice();
22989
23375
  let userArgs;
22990
23376
  switch (parseOptions.from) {
@@ -22994,7 +23380,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
22994
23380
  userArgs = argv.slice(2);
22995
23381
  break;
22996
23382
  case "electron":
22997
- if (process$2.defaultApp) {
23383
+ if (process$3.defaultApp) {
22998
23384
  this._scriptPath = argv[1];
22999
23385
  userArgs = argv.slice(2);
23000
23386
  } else userArgs = argv.slice(1);
@@ -23159,16 +23545,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
23159
23545
  }
23160
23546
  launchWithNode = sourceExt.includes(path$16.extname(executableFile));
23161
23547
  let proc;
23162
- if (process$2.platform !== "win32") if (launchWithNode) {
23548
+ if (process$3.platform !== "win32") if (launchWithNode) {
23163
23549
  args.unshift(executableFile);
23164
- args = incrementNodeInspectorPort(process$2.execArgv).concat(args);
23165
- proc = childProcess$2.spawn(process$2.argv[0], args, { stdio: "inherit" });
23550
+ args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
23551
+ proc = childProcess$2.spawn(process$3.argv[0], args, { stdio: "inherit" });
23166
23552
  } else proc = childProcess$2.spawn(executableFile, args, { stdio: "inherit" });
23167
23553
  else {
23168
23554
  this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
23169
23555
  args.unshift(executableFile);
23170
- args = incrementNodeInspectorPort(process$2.execArgv).concat(args);
23171
- proc = childProcess$2.spawn(process$2.execPath, args, { stdio: "inherit" });
23556
+ args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
23557
+ proc = childProcess$2.spawn(process$3.execPath, args, { stdio: "inherit" });
23172
23558
  }
23173
23559
  if (!proc.killed) [
23174
23560
  "SIGUSR1",
@@ -23177,20 +23563,20 @@ Expecting one of '${allowedValues.join("', '")}'`);
23177
23563
  "SIGINT",
23178
23564
  "SIGHUP"
23179
23565
  ].forEach((signal) => {
23180
- process$2.on(signal, () => {
23566
+ process$3.on(signal, () => {
23181
23567
  if (proc.killed === false && proc.exitCode === null) proc.kill(signal);
23182
23568
  });
23183
23569
  });
23184
23570
  const exitCallback = this._exitCallback;
23185
23571
  proc.on("close", (code) => {
23186
23572
  code = code ?? 1;
23187
- if (!exitCallback) process$2.exit(code);
23573
+ if (!exitCallback) process$3.exit(code);
23188
23574
  else exitCallback(new CommanderError(code, "commander.executeSubCommandAsync", "(close)"));
23189
23575
  });
23190
23576
  proc.on("error", (err) => {
23191
23577
  if (err.code === "ENOENT") this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
23192
23578
  else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
23193
- if (!exitCallback) process$2.exit(1);
23579
+ if (!exitCallback) process$3.exit(1);
23194
23580
  else {
23195
23581
  const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
23196
23582
  wrappedError.nestedError = err;
@@ -23599,13 +23985,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
23599
23985
  */
23600
23986
  _parseOptionsEnv() {
23601
23987
  this.options.forEach((option) => {
23602
- if (option.envVar && option.envVar in process$2.env) {
23988
+ if (option.envVar && option.envVar in process$3.env) {
23603
23989
  const optionKey = option.attributeName();
23604
23990
  if (this.getOptionValue(optionKey) === void 0 || [
23605
23991
  "default",
23606
23992
  "config",
23607
23993
  "env"
23608
- ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$2.env[option.envVar]);
23994
+ ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$3.env[option.envVar]);
23609
23995
  else this.emit(`optionEnv:${option.name()}`);
23610
23996
  }
23611
23997
  });
@@ -24022,7 +24408,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
24022
24408
  */
24023
24409
  help(contextOptions) {
24024
24410
  this.outputHelp(contextOptions);
24025
- let exitCode = Number(process$2.exitCode ?? 0);
24411
+ let exitCode = Number(process$3.exitCode ?? 0);
24026
24412
  if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) exitCode = 1;
24027
24413
  this._exit(exitCode, "commander.help", "(outputHelp)");
24028
24414
  }
@@ -24112,8 +24498,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
24112
24498
  * @package
24113
24499
  */
24114
24500
  function useColor() {
24115
- if (process$2.env.NO_COLOR || process$2.env.FORCE_COLOR === "0" || process$2.env.FORCE_COLOR === "false") return false;
24116
- if (process$2.env.FORCE_COLOR || process$2.env.CLICOLOR_FORCE !== void 0) return true;
24501
+ if (process$3.env.NO_COLOR || process$3.env.FORCE_COLOR === "0" || process$3.env.FORCE_COLOR === "false") return false;
24502
+ if (process$3.env.FORCE_COLOR || process$3.env.CLICOLOR_FORCE !== void 0) return true;
24117
24503
  }
24118
24504
  exports.Command = Command;
24119
24505
  exports.useColor = useColor;
@@ -60397,7 +60783,7 @@ const buildAntigravityArgs = ({ extraArgs = [], resumeSessionId }) => {
60397
60783
 
60398
60784
  //#endregion
60399
60785
  //#region ../../packages/heterogeneous-agents/src/spawn/wsl.ts
60400
- var WSL_COMMAND_PREFIX, isWslCommand, parseWslCommand, formatWslCommand, getWslExecutable, toWslPath, toWslArg, NEVER_FORWARDED, FORWARDED_PREFIXES, FORWARDED_PROXY, ENV_NAME, collectForwardedEnvNames, mergeWslEnv, buildWslSpawnPlan, WSL_PROBE_TIMEOUT_MS, WSL_LIST_TIMEOUT_MS, PATH_MARKER, COMMAND_MARKER, WSL_PROBED_COMMANDS, PROBE_SCRIPT, runWsl, decodeWslOutput, parseWslDistroList, parseWslProbeOutput, distrosPromise, distroProbes, settledPathEnv, listWslDistros, probeWslDistro, invalidateWslCache, findWslCommandCandidates, getWslPathEnv;
60786
+ var WSL_COMMAND_PREFIX, isWslCommand, parseWslCommand, formatWslCommand, getWslExecutable, toWslPath, toWslArg, NEVER_FORWARDED, FORWARDED_PREFIXES, FORWARDED_PROXY, ENV_NAME, collectForwardedEnvNames, mergeWslEnv, WSL_DEFAULT_PATH, withWslBinaryFolder, buildWslSpawnPlan, WSL_PROBE_TIMEOUT_MS, WSL_INTERACTIVE_SHELL_TIMEOUT_S, WSL_LOGIN_SHELL_TIMEOUT_S, WSL_LIST_TIMEOUT_MS, PATH_MARKER, COMMAND_MARKER, SHELL_PATH_MARKER, WSL_PROBED_COMMANDS, WSL_PROBE_SCRIPT, runWsl, decodeWslOutput, parseWslDistroList, isOnWindowsDrive, parseWslProbeOutput, distrosPromise, distroProbes, settledPathEnv, listWslDistros, probeWslDistro, invalidateWslCache, findWslCommandCandidates, getWslPathEnv;
60401
60787
  var init_wsl = __esmMin((() => {
60402
60788
  init_config();
60403
60789
  WSL_COMMAND_PREFIX = "wsl://";
@@ -60479,6 +60865,13 @@ var init_wsl = __esmMin((() => {
60479
60865
  for (const name of names) if (!present.has(name.toLowerCase())) entries.push(`${name}/u`);
60480
60866
  return entries.join(":");
60481
60867
  };
60868
+ WSL_DEFAULT_PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
60869
+ withWslBinaryFolder = (linuxPath, pathEnv) => {
60870
+ const dir = linuxPath.slice(0, linuxPath.lastIndexOf("/"));
60871
+ const current = pathEnv || WSL_DEFAULT_PATH;
60872
+ if (!dir || current.split(":").includes(dir)) return current;
60873
+ return `${dir}:${current}`;
60874
+ };
60482
60875
  buildWslSpawnPlan = ({ distro, linuxPath }, args, env, pathEnv) => {
60483
60876
  const forwarded = env ? collectForwardedEnvNames(env) : [];
60484
60877
  return {
@@ -60486,7 +60879,8 @@ var init_wsl = __esmMin((() => {
60486
60879
  "--distribution",
60487
60880
  distro,
60488
60881
  "--exec",
60489
- ...pathEnv ? ["env", `PATH=${pathEnv}`] : [],
60882
+ "env",
60883
+ `PATH=${withWslBinaryFolder(linuxPath, pathEnv)}`,
60490
60884
  linuxPath,
60491
60885
  ...args.map(toWslArg)
60492
60886
  ],
@@ -60497,18 +60891,62 @@ var init_wsl = __esmMin((() => {
60497
60891
  } : env
60498
60892
  };
60499
60893
  };
60500
- WSL_PROBE_TIMEOUT_MS = 2e4;
60501
- WSL_LIST_TIMEOUT_MS = 5e3;
60894
+ WSL_PROBE_TIMEOUT_MS = 3e4;
60895
+ WSL_INTERACTIVE_SHELL_TIMEOUT_S = 10;
60896
+ WSL_LOGIN_SHELL_TIMEOUT_S = 5;
60897
+ WSL_LIST_TIMEOUT_MS = 15e3;
60502
60898
  PATH_MARKER = "__LOBEHUB_WSL_PATH__=";
60503
60899
  COMMAND_MARKER = "__LOBEHUB_WSL_CMD__=";
60900
+ SHELL_PATH_MARKER = "__LOBEHUB_WSL_SHELL_PATH__=";
60504
60901
  WSL_PROBED_COMMANDS = [...new Set([
60505
60902
  ...HETEROGENEOUS_AGENT_CONFIGS.map((config) => config.defaultCommand),
60506
60903
  "cursor-agent",
60507
60904
  "dsh"
60508
60905
  ])].filter((name) => /^[\w.-]+$/.test(name));
60509
- PROBE_SCRIPT = `lobehub_shell="\${SHELL:-/bin/sh}"
60510
- case "\${lobehub_shell##*/}" in bash|zsh|ksh|sh|dash) ;; *) lobehub_shell=/bin/sh ;; esac
60511
- "$lobehub_shell" -ilc 'printf "\\n${PATH_MARKER}%s\\n" "$PATH"; for c in "$@"; do p=$(command -v "$c" 2>/dev/null) || continue; case "$p" in /*) printf "${COMMAND_MARKER}%s=%s\\n" "$c" "$p" ;; esac; done' lobehub "$@" </dev/null
60906
+ WSL_PROBE_SCRIPT = `lh_c='${COMMAND_MARKER}'
60907
+ lh_to=; command -v timeout >/dev/null 2>&1 && lh_to=timeout
60908
+ lh_run() { lh_s=$1; shift; if [ -n "$lh_to" ]; then timeout "$lh_s" "$@"; else "$@"; fi; }
60909
+ lh_shell="\${SHELL:-/bin/sh}"
60910
+ case "\${lh_shell##*/}" in
60911
+ bash|zsh|ksh|sh|dash) lh_ip=$(lh_run ${WSL_INTERACTIVE_SHELL_TIMEOUT_S} "$lh_shell" -ilc 'printf "\\n${SHELL_PATH_MARKER}%s\\n" "$PATH"' </dev/null 2>/dev/null) ;;
60912
+ fish) lh_ip=$(lh_run ${WSL_INTERACTIVE_SHELL_TIMEOUT_S} "$lh_shell" -ilc 'printf "\\n${SHELL_PATH_MARKER}%s\\n" (string join : $PATH)' </dev/null 2>/dev/null) ;;
60913
+ *) lh_ip= ;;
60914
+ esac
60915
+ lh_ip=$(printf '%s\\n' "$lh_ip" | sed -n 's/^${SHELL_PATH_MARKER}//p' | tail -n 1)
60916
+ lh_lp=$(lh_run ${WSL_LOGIN_SHELL_TIMEOUT_S} sh -lc 'printf "\\n${SHELL_PATH_MARKER}%s\\n" "$PATH"' </dev/null 2>/dev/null | sed -n 's/^${SHELL_PATH_MARKER}//p' | tail -n 1)
60917
+ printf '\\n${PATH_MARKER}%s\\n' "\${lh_ip:-$lh_lp}"
60918
+ lh_wm=$(awk '$1 ~ /^[A-Za-z]:/ {print $2}' /proc/mounts 2>/dev/null)
60919
+ lh_win() { case "$1" in /mnt/[A-Za-z]/*) return 0 ;; esac; for lh_m in $lh_wm; do case "$1" in "$lh_m"/*) return 0 ;; esac; done; return 1; }
60920
+ lh_emit() { case "$2" in /*) ;; *) return 0 ;; esac; lh_win "$2" && return 0; [ -f "$2" ] && [ -x "$2" ] && printf '%s%s=%s\\n' "$lh_c" "$1" "$2"; return 0; }
60921
+ lh_vs() { ls "$1" 2>/dev/null | sed 's/^v*\\([0-9][0-9.]*\\).*$/\\1 &/;t;d' | sort -t. -k1,1nr -k2,2nr -k3,3nr | cut -d' ' -f2; }
60922
+ lh_dirs() {
60923
+ echo "$HOME/.local/bin"
60924
+ lh_np=$(sed -n 's/^[[:space:]]*prefix[[:space:]]*=[[:space:]]*//p' "$HOME/.npmrc" 2>/dev/null | head -n 1 | tr -d "\\"'\\r")
60925
+ case "$lh_np" in "~/"*) echo "$HOME/\${lh_np#??}/bin" ;; /*) echo "$lh_np/bin" ;; esac
60926
+ echo "$HOME/.npm-global/bin"; echo "$HOME/.bun/bin"; echo "$HOME/.local/share/pnpm"; echo "$HOME/.volta/bin"
60927
+ lh_nv="\${NVM_DIR:-$HOME/.nvm}"
60928
+ lh_nd=$(head -n 1 "$lh_nv/alias/default" 2>/dev/null); lh_nd=\${lh_nd#v}
60929
+ case "$lh_nd" in [0-9]*) for lh_v in $(lh_vs "$lh_nv/versions/node"); do case "\${lh_v#v}" in "$lh_nd"|"$lh_nd".*) echo "$lh_nv/versions/node/$lh_v/bin" ;; esac; done ;; esac
60930
+ for lh_v in $(lh_vs "$lh_nv/versions/node"); do echo "$lh_nv/versions/node/$lh_v/bin"; done
60931
+ for lh_r in "$HOME/.local/share/fnm" "$HOME/.fnm"; do [ -d "$lh_r/node-versions" ] || continue; echo "$lh_r/aliases/default/bin"; for lh_v in $(lh_vs "$lh_r/node-versions"); do echo "$lh_r/node-versions/$lh_v/installation/bin"; done; done
60932
+ echo "$HOME/.local/share/mise/shims"
60933
+ for lh_v in $(lh_vs "$HOME/.local/share/mise/installs/node"); do echo "$HOME/.local/share/mise/installs/node/$lh_v/bin"; done
60934
+ echo "$HOME/.asdf/shims"; echo "$HOME/.cargo/bin"; echo "$HOME/.deno/bin"
60935
+ echo /home/linuxbrew/.linuxbrew/bin; echo "$HOME/.linuxbrew/bin"; echo /usr/local/bin; echo /snap/bin
60936
+ for lh_a in .opencode .amp .kimi-code .grok; do echo "$HOME/$lh_a/bin"; done
60937
+ }
60938
+ lh_ds=$(lh_dirs)
60939
+ for lh_name in "$@"; do
60940
+ for lh_p in "$lh_ip" "$lh_lp" "$PATH"; do
60941
+ lh_o=$IFS; IFS=:
60942
+ for lh_d in $lh_p; do IFS=$lh_o; lh_emit "$lh_name" "$lh_d/$lh_name"; done
60943
+ IFS=$lh_o
60944
+ done
60945
+ lh_o=$IFS; IFS='
60946
+ '
60947
+ for lh_d in $lh_ds; do IFS=$lh_o; lh_emit "$lh_name" "$lh_d/$lh_name"; done
60948
+ IFS=$lh_o
60949
+ done
60512
60950
  `;
60513
60951
  runWsl = (args, { env, input, timeout }) => new Promise((resolve, reject) => {
60514
60952
  let settled = false;
@@ -60547,6 +60985,7 @@ case "\${lobehub_shell##*/}" in bash|zsh|ksh|sh|dash) ;; *) lobehub_shell=/bin/s
60547
60985
  });
60548
60986
  decodeWslOutput = (output) => (output.includes(0) ? output.toString("utf16le") : output.toString("utf8")).replace(/^\uFEFF/, "");
60549
60987
  parseWslDistroList = (output) => output.split(/\r?\n/).map((line) => line.replaceAll("\0", "").trim()).filter((name) => name && !/^docker-desktop/i.test(name));
60988
+ isOnWindowsDrive = (linuxPath) => /^\/mnt\/[a-z]\//i.test(linuxPath);
60550
60989
  parseWslProbeOutput = (output) => {
60551
60990
  const commands = /* @__PURE__ */ new Map();
60552
60991
  let pathEnv;
@@ -60558,7 +60997,10 @@ case "\${lobehub_shell##*/}" in bash|zsh|ksh|sh|dash) ;; *) lobehub_shell=/bin/s
60558
60997
  const separator = entry.indexOf("=");
60559
60998
  const name = entry.slice(0, separator);
60560
60999
  const linuxPath = entry.slice(separator + 1);
60561
- if (separator > 0 && linuxPath.startsWith("/")) commands.set(name, linuxPath);
61000
+ if (separator <= 0 || !linuxPath.startsWith("/") || isOnWindowsDrive(linuxPath)) continue;
61001
+ const found = commands.get(name) ?? [];
61002
+ if (!found.includes(linuxPath)) found.push(linuxPath);
61003
+ commands.set(name, found);
60562
61004
  }
60563
61005
  }
60564
61006
  return {
@@ -60570,7 +61012,10 @@ case "\${lobehub_shell##*/}" in bash|zsh|ksh|sh|dash) ;; *) lobehub_shell=/bin/s
60570
61012
  distroProbes = /* @__PURE__ */ new Map();
60571
61013
  settledPathEnv = /* @__PURE__ */ new Map();
60572
61014
  listWslDistros = () => {
60573
- distrosPromise ??= runWsl(["--list", "--quiet"], { timeout: WSL_LIST_TIMEOUT_MS }).then((output) => parseWslDistroList(decodeWslOutput(output))).catch(() => []);
61015
+ distrosPromise ??= runWsl(["--list", "--quiet"], { timeout: WSL_LIST_TIMEOUT_MS }).then((output) => parseWslDistroList(decodeWslOutput(output))).catch(() => {
61016
+ distrosPromise = void 0;
61017
+ return [];
61018
+ });
60574
61019
  return distrosPromise;
60575
61020
  };
60576
61021
  probeWslDistro = (distro) => {
@@ -60585,7 +61030,7 @@ case "\${lobehub_shell##*/}" in bash|zsh|ksh|sh|dash) ;; *) lobehub_shell=/bin/s
60585
61030
  "--",
60586
61031
  ...WSL_PROBED_COMMANDS
60587
61032
  ], {
60588
- input: PROBE_SCRIPT,
61033
+ input: WSL_PROBE_SCRIPT,
60589
61034
  timeout: WSL_PROBE_TIMEOUT_MS
60590
61035
  }).then((output) => {
60591
61036
  const result = parseWslProbeOutput(decodeWslOutput(output));
@@ -60607,13 +61052,10 @@ case "\${lobehub_shell##*/}" in bash|zsh|ksh|sh|dash) ;; *) lobehub_shell=/bin/s
60607
61052
  if (platform() !== "win32") return [];
60608
61053
  const distros = await listWslDistros();
60609
61054
  const probes = await Promise.all(distros.map((distro) => probeWslDistro(distro)));
60610
- return distros.flatMap((distro, index) => {
60611
- const linuxPath = probes[index]?.commands.get(command);
60612
- return linuxPath ? [formatWslCommand({
60613
- distro,
60614
- linuxPath
60615
- })] : [];
60616
- });
61055
+ return distros.flatMap((distro, index) => (probes[index]?.commands.get(command) ?? []).map((linuxPath) => formatWslCommand({
61056
+ distro,
61057
+ linuxPath
61058
+ })));
60617
61059
  };
60618
61060
  getWslPathEnv = async (distro) => (await probeWslDistro(distro))?.pathEnv;
60619
61061
  }));
@@ -60807,6 +61249,192 @@ var init_cliSpawn = __esmMin((() => {
60807
61249
  };
60808
61250
  }));
60809
61251
 
61252
+ //#endregion
61253
+ //#region ../../packages/heterogeneous-agents/src/spawn/userBinDirs.ts
61254
+ var getEnv$1, pathFor, readDirNames, VERSION_DIR, sortVersionDirsDesc, defaultFirst, readFirstLine, readNpmrcPrefix, nodeVersionBins, getWindowsUserBinDirs, getPosixUserBinDirs, getUserBinDirs, WINDOWS_EXTS, isRunnableFile, findCommandInUserBinDirs;
61255
+ var init_userBinDirs = __esmMin((() => {
61256
+ getEnv$1 = (env, name, os) => {
61257
+ const exact = env[name]?.trim();
61258
+ if (exact || os !== "win32") return exact || void 0;
61259
+ const lower = name.toLowerCase();
61260
+ const key = Object.keys(env).find((candidate) => candidate.toLowerCase() === lower && !!env[candidate]?.trim());
61261
+ return key ? env[key].trim() : void 0;
61262
+ };
61263
+ pathFor = (os) => os === "win32" ? path.win32 : path.posix;
61264
+ readDirNames = async (dir) => {
61265
+ try {
61266
+ const entries = await readdir(dir);
61267
+ return Array.isArray(entries) ? entries.map(String) : [];
61268
+ } catch {
61269
+ return [];
61270
+ }
61271
+ };
61272
+ VERSION_DIR = /^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?/;
61273
+ sortVersionDirsDesc = (names) => names.map((name) => ({
61274
+ match: name.match(VERSION_DIR),
61275
+ name
61276
+ })).filter((entry) => !!entry.match).sort((a, b) => {
61277
+ for (let index = 1; index <= 3; index += 1) {
61278
+ const diff = Number(b.match[index] ?? 0) - Number(a.match[index] ?? 0);
61279
+ if (diff !== 0) return diff;
61280
+ }
61281
+ return 0;
61282
+ }).map(({ name }) => name);
61283
+ defaultFirst = (versions, alias) => {
61284
+ const wanted = alias?.trim().replace(/^v/, "");
61285
+ if (!wanted || !/^\d/.test(wanted)) return versions;
61286
+ const matches = (version) => {
61287
+ const bare = version.replace(/^v/, "");
61288
+ return bare === wanted || bare.startsWith(`${wanted}.`);
61289
+ };
61290
+ return [...versions.filter(matches), ...versions.filter((version) => !matches(version))];
61291
+ };
61292
+ readFirstLine = async (file) => {
61293
+ try {
61294
+ const content = await readFile(file, "utf8");
61295
+ return typeof content === "string" ? content.split(/\r?\n/)[0]?.trim() || void 0 : void 0;
61296
+ } catch {
61297
+ return;
61298
+ }
61299
+ };
61300
+ readNpmrcPrefix = async (home, os, env) => {
61301
+ const fromEnv = getEnv$1(env, "NPM_CONFIG_PREFIX", os) ?? getEnv$1(env, "npm_config_prefix", os);
61302
+ if (fromEnv) return fromEnv;
61303
+ let content;
61304
+ try {
61305
+ content = await readFile(pathFor(os).join(home, ".npmrc"), "utf8");
61306
+ } catch {
61307
+ return;
61308
+ }
61309
+ if (typeof content !== "string") return void 0;
61310
+ const value = content.match(/^\s*prefix\s*=\s*(.+?)\s*$/m)?.[1]?.replaceAll(/^["']|["']$/g, "").trim();
61311
+ if (!value) return void 0;
61312
+ if (value.startsWith("~/") || value.startsWith("~\\")) return pathFor(os).join(home, value.slice(2));
61313
+ return pathFor(os).isAbsolute(value) ? value : void 0;
61314
+ };
61315
+ nodeVersionBins = async (versionsDir, alias, toBin, os) => defaultFirst(sortVersionDirsDesc(await readDirNames(versionsDir)), alias).map((version) => toBin(pathFor(os).join(versionsDir, version)));
61316
+ getWindowsUserBinDirs = async (env, home) => {
61317
+ const os = "win32";
61318
+ const { join } = path.win32;
61319
+ const get = (name) => getEnv$1(env, name, os);
61320
+ const appData = get("APPDATA") ?? join(home, "AppData", "Roaming");
61321
+ const localAppData = get("LOCALAPPDATA") ?? join(home, "AppData", "Local");
61322
+ const programData = get("ProgramData") ?? "C:\\ProgramData";
61323
+ const programFiles = get("ProgramFiles") ?? "C:\\Program Files";
61324
+ const npmPrefix = await readNpmrcPrefix(home, os, env);
61325
+ const nvmHome = get("NVM_HOME");
61326
+ const nvmVersions = nvmHome ? await nodeVersionBins(nvmHome, void 0, (dir) => dir, os) : [];
61327
+ const fnmRoots = [
61328
+ get("FNM_DIR"),
61329
+ join(appData, "fnm"),
61330
+ join(localAppData, "fnm")
61331
+ ].filter((dir) => !!dir);
61332
+ const fnmDirs = [];
61333
+ for (const root of new Set(fnmRoots)) fnmDirs.push(join(root, "aliases", "default"), ...await nodeVersionBins(join(root, "node-versions"), void 0, (dir) => join(dir, "installation"), os));
61334
+ const miseData = get("MISE_DATA_DIR") ?? (get("XDG_DATA_HOME") ? join(get("XDG_DATA_HOME"), "mise") : join(localAppData, "mise"));
61335
+ const scoop = get("SCOOP") ?? join(home, "scoop");
61336
+ const scoopGlobal = get("SCOOP_GLOBAL") ?? join(programData, "scoop");
61337
+ return [
61338
+ join(home, ".local", "bin"),
61339
+ ...npmPrefix ? [npmPrefix] : [],
61340
+ join(appData, "npm"),
61341
+ ...get("PNPM_HOME") ? [get("PNPM_HOME")] : [],
61342
+ join(localAppData, "pnpm"),
61343
+ ...get("BUN_INSTALL") ? [join(get("BUN_INSTALL"), "bin")] : [],
61344
+ join(home, ".bun", "bin"),
61345
+ ...get("VOLTA_HOME") ? [join(get("VOLTA_HOME"), "bin")] : [],
61346
+ join(localAppData, "Volta", "bin"),
61347
+ ...get("NVM_SYMLINK") ? [get("NVM_SYMLINK")] : [],
61348
+ "C:\\nvm4w\\nodejs",
61349
+ ...nvmVersions,
61350
+ ...fnmDirs,
61351
+ join(miseData, "shims"),
61352
+ join(scoop, "shims"),
61353
+ join(scoopGlobal, "shims"),
61354
+ join(localAppData, "Microsoft", "WinGet", "Links"),
61355
+ join(programFiles, "WinGet", "Links"),
61356
+ join(get("ChocolateyInstall") ?? join(programData, "chocolatey"), "bin"),
61357
+ join(programFiles, "nodejs"),
61358
+ join(home, ".cargo", "bin"),
61359
+ join(home, ".deno", "bin")
61360
+ ];
61361
+ };
61362
+ getPosixUserBinDirs = async (env, home) => {
61363
+ const os = "linux";
61364
+ const { join } = path.posix;
61365
+ const get = (name) => getEnv$1(env, name, os);
61366
+ const xdgData = get("XDG_DATA_HOME") ?? join(home, ".local", "share");
61367
+ const npmPrefix = await readNpmrcPrefix(home, os, env);
61368
+ const nvmDir = get("NVM_DIR") ?? join(home, ".nvm");
61369
+ const nvmBins = await nodeVersionBins(join(nvmDir, "versions", "node"), await readFirstLine(join(nvmDir, "alias", "default")), (dir) => join(dir, "bin"), os);
61370
+ const fnmRoots = [
61371
+ get("FNM_DIR"),
61372
+ join(xdgData, "fnm"),
61373
+ join(home, "Library", "Application Support", "fnm"),
61374
+ join(home, ".fnm")
61375
+ ].filter((dir) => !!dir);
61376
+ const fnmDirs = [];
61377
+ for (const root of new Set(fnmRoots)) fnmDirs.push(join(root, "aliases", "default", "bin"), ...await nodeVersionBins(join(root, "node-versions"), void 0, (dir) => join(dir, "installation", "bin"), os));
61378
+ const miseData = get("MISE_DATA_DIR") ?? join(xdgData, "mise");
61379
+ const miseNodes = await nodeVersionBins(join(miseData, "installs", "node"), void 0, (dir) => join(dir, "bin"), os);
61380
+ return [
61381
+ join(home, ".local", "bin"),
61382
+ ...npmPrefix ? [join(npmPrefix, "bin")] : [],
61383
+ join(home, ".npm-global", "bin"),
61384
+ join(home, ".npm", "bin"),
61385
+ ...get("BUN_INSTALL") ? [join(get("BUN_INSTALL"), "bin")] : [],
61386
+ join(home, ".bun", "bin"),
61387
+ ...get("PNPM_HOME") ? [get("PNPM_HOME")] : [],
61388
+ join(home, "Library", "pnpm"),
61389
+ join(xdgData, "pnpm"),
61390
+ join(get("VOLTA_HOME") ?? join(home, ".volta"), "bin"),
61391
+ ...nvmBins,
61392
+ ...fnmDirs,
61393
+ join(miseData, "shims"),
61394
+ ...miseNodes,
61395
+ join(get("ASDF_DATA_DIR") ?? join(home, ".asdf"), "shims"),
61396
+ join(home, ".cargo", "bin"),
61397
+ join(home, ".deno", "bin"),
61398
+ "/opt/homebrew/bin",
61399
+ "/usr/local/bin",
61400
+ "/home/linuxbrew/.linuxbrew/bin",
61401
+ join(home, ".linuxbrew", "bin")
61402
+ ];
61403
+ };
61404
+ getUserBinDirs = async ({ env = process.env, home = homedir(), os = platform() } = {}) => {
61405
+ const dirs = os === "win32" ? await getWindowsUserBinDirs(env, home) : await getPosixUserBinDirs(env, home);
61406
+ const seen = /* @__PURE__ */ new Set();
61407
+ return dirs.filter((dir) => {
61408
+ const key = os === "win32" ? dir.toLowerCase() : dir;
61409
+ if (!dir || seen.has(key)) return false;
61410
+ seen.add(key);
61411
+ return true;
61412
+ });
61413
+ };
61414
+ WINDOWS_EXTS = [
61415
+ ".exe",
61416
+ ".cmd",
61417
+ ".bat"
61418
+ ];
61419
+ isRunnableFile = async (file, os) => {
61420
+ try {
61421
+ await access(file, os === "win32" ? constants.F_OK : constants.X_OK);
61422
+ return true;
61423
+ } catch {
61424
+ return false;
61425
+ }
61426
+ };
61427
+ findCommandInUserBinDirs = async (names, options = {}) => {
61428
+ const os = options.os ?? platform();
61429
+ const files = (await getUserBinDirs({
61430
+ ...options,
61431
+ os
61432
+ })).flatMap((dir) => names.flatMap((name) => os === "win32" ? WINDOWS_EXTS.map((ext) => path.win32.join(dir, `${name}${ext}`)) : [path.posix.join(dir, name)]));
61433
+ const runnable = await Promise.all(files.map((file) => isRunnableFile(file, os)));
61434
+ return files.filter((_, index) => runnable[index]);
61435
+ };
61436
+ }));
61437
+
60810
61438
  //#endregion
60811
61439
  //#region ../../packages/heterogeneous-agents/src/spawn/resolveCliCommand.ts
60812
61440
  var resolveCliCommand_exports = /* @__PURE__ */ __exportAll$2({
@@ -60814,6 +61442,7 @@ var resolveCliCommand_exports = /* @__PURE__ */ __exportAll$2({
60814
61442
  LOGIN_SHELL_TIMEOUT_STATUS_ERROR: () => LOGIN_SHELL_TIMEOUT_STATUS_ERROR,
60815
61443
  LoginShellPathTimeoutError: () => LoginShellPathTimeoutError,
60816
61444
  detectHeterogeneousCliCommand: () => detectHeterogeneousCliCommand,
61445
+ detectInUserBinDirs: () => detectInUserBinDirs,
60817
61446
  detectInWslWhenMissing: () => detectInWslWhenMissing,
60818
61447
  detectValidatedCommand: () => detectValidatedCommand,
60819
61448
  detectValidatedCommandCandidates: () => detectValidatedCommandCandidates,
@@ -60822,10 +61451,11 @@ var resolveCliCommand_exports = /* @__PURE__ */ __exportAll$2({
60822
61451
  resolveHeteroSpawnCommand: () => resolveHeteroSpawnCommand,
60823
61452
  resolveUserSpawnPath: () => resolveUserSpawnPath
60824
61453
  });
60825
- var execFilePromise$2, VERSION_PATTERN, extractVersion, isWindows, shellPathPromise, registryPathPromise, WINDOWS_SHELL_METAS, WINDOWS_RUNNABLE_EXTS, WINDOWS_SHIM_EXTS, WINDOWS_SHELL_MAX_COMMAND_LINE_LENGTH, isWindowsRunnablePath, isWindowsShimPath, pickWindowsRunnables, isPathLikeCommand, LOGIN_SHELL_PATH_TIMEOUT_MS, LOGIN_SHELL_TIMEOUT_STATUS_ERROR, isLoginShellTimeoutStatus, LoginShellPathTimeoutError, getLoginShellPath, cachedShellPath, shellPathGeneration, getCurrentLoginShellPath, invalidateLoginShellPathCache, WINDOWS_REGISTRY_PATH_KEYS, WINDOWS_REGISTRY_PATH_VALUE, expandWindowsEnvRefs$1, readWindowsRegistryPathValue, readMergedWindowsRegistryPath, getWindowsRegistryPath, mergePathValues, resolveUserSpawnPath, recoverProbeEnvironment, getCommandPathLines, resolveCommandCandidates, quoteWindowsShellToken, buildWindowsShellProbe, UNRESOLVED_SHIM, execProbe, detectValidatedCommandInEnvironment, isProbeableCommand, detectValidatedCommandCandidates, detectValidatedCommand, HETEROGENEOUS_CLI_AGENT_OPTIONS, DEFAULT_HETERO_COMMAND, getWellKnownCommandPaths, detectHeterogeneousCliCommand, WSL_COMMAND_NAMES, detectInWslWhenMissing, resolveHeteroSpawnCommand;
61454
+ var execFilePromise$2, VERSION_PATTERN, extractVersion, isWindows, shellPathPromise, registryPathPromise, WINDOWS_SHELL_METAS, WINDOWS_RUNNABLE_EXTS, WINDOWS_SHIM_EXTS, WINDOWS_SHELL_MAX_COMMAND_LINE_LENGTH, isWindowsRunnablePath, isWindowsShimPath, pickWindowsRunnables, isPathLikeCommand, LOGIN_SHELL_PATH_TIMEOUT_MS, LOGIN_SHELL_TIMEOUT_STATUS_ERROR, isLoginShellTimeoutStatus, LoginShellPathTimeoutError, getLoginShellPath, cachedShellPath, shellPathGeneration, getCurrentLoginShellPath, invalidateLoginShellPathCache, WINDOWS_REGISTRY_PATH_KEYS, WINDOWS_REGISTRY_PATH_VALUE, expandWindowsEnvRefs$1, readWindowsRegistryPathValue, readMergedWindowsRegistryPath, getWindowsRegistryPath, mergePathValues, resolveUserSpawnPath, recoverProbeEnvironment, getCommandPathLines, resolveCommandCandidates, quoteWindowsShellToken, buildWindowsShellProbe, UNRESOLVED_SHIM, execProbe, detectValidatedCommandInEnvironment, isProbeableCommand, detectValidatedCommandCandidates, detectValidatedCommand, HETEROGENEOUS_CLI_AGENT_OPTIONS, DEFAULT_HETERO_COMMAND, getWellKnownCommandPaths, detectHeterogeneousCliCommand, DEFAULT_COMMAND_ALIASES, withFolderOnPath, detectInUserBinDirs, detectInWslWhenMissing, resolveHeteroSpawnCommand;
60826
61455
  var init_resolveCliCommand = __esmMin((() => {
60827
61456
  init_config();
60828
61457
  init_cliSpawn();
61458
+ init_userBinDirs();
60829
61459
  init_wsl();
60830
61460
  execFilePromise$2 = promisify(execFile);
60831
61461
  VERSION_PATTERN = /v?(\d+\.\d+\.\d+(?:-[\dA-Za-z.-]+)?(?:\+[\dA-Za-z.-]+)?)/;
@@ -61155,7 +61785,7 @@ var init_resolveCliCommand = __esmMin((() => {
61155
61785
  },
61156
61786
  "cursor": {
61157
61787
  validateFlag: "--help",
61158
- validatePattern: /^Usage: agent[\s\S]*Cursor Agent/im
61788
+ validatePattern: /^Usage: (?:cursor-)?agent[\s\S]*Cursor Agent/im
61159
61789
  },
61160
61790
  "droid": {
61161
61791
  validateHelpArgs: ["exec", "--help"],
@@ -61248,7 +61878,7 @@ var init_resolveCliCommand = __esmMin((() => {
61248
61878
  if (platform() === "win32") {
61249
61879
  const localAppData = process.env.LOCALAPPDATA;
61250
61880
  if (!localAppData) return [];
61251
- return [path.win32.join(localAppData, "cursor-agent", "agent.cmd")];
61881
+ return [path.win32.join(localAppData, "cursor-agent", "agent.cmd"), path.win32.join(localAppData, "cursor-agent", "cursor-agent.cmd")];
61252
61882
  }
61253
61883
  if (platform() !== "darwin" && platform() !== "linux") return [];
61254
61884
  return [path.join(homedir(), ".local", "bin", "agent"), path.join(homedir(), ".local", "bin", "cursor-agent")];
@@ -61321,12 +61951,32 @@ var init_resolveCliCommand = __esmMin((() => {
61321
61951
  detectHeterogeneousCliCommand = async (agentType, command, probeEnv) => {
61322
61952
  const validator = HETEROGENEOUS_CLI_AGENT_OPTIONS[agentType];
61323
61953
  if (!validator) return { available: false };
61324
- const isDefaultCommand = command.trim() === DEFAULT_HETERO_COMMAND[agentType];
61325
- const status = await detectValidatedCommandCandidates(isDefaultCommand ? [command, ...getWellKnownCommandPaths(agentType)] : [command], validator, probeEnv);
61326
- if (!isDefaultCommand) return status;
61327
- return detectInWslWhenMissing(status, WSL_COMMAND_NAMES[agentType] ?? [command], validator);
61954
+ if (!(command.trim() === DEFAULT_HETERO_COMMAND[agentType])) return detectValidatedCommandCandidates([command], validator, probeEnv);
61955
+ const names = [command, ...DEFAULT_COMMAND_ALIASES[agentType] ?? []];
61956
+ return detectInWslWhenMissing(await detectInUserBinDirs(await detectValidatedCommandCandidates([...names, ...getWellKnownCommandPaths(agentType)], validator, probeEnv), names, validator, probeEnv), names, validator);
61957
+ };
61958
+ DEFAULT_COMMAND_ALIASES = { cursor: ["cursor-agent"] };
61959
+ withFolderOnPath = (file, env) => {
61960
+ const base = env ?? process.env;
61961
+ const windows = isWindows();
61962
+ const dir = windows ? path.win32.dirname(file) : path.posix.dirname(file);
61963
+ const delimiter = windows ? ";" : ":";
61964
+ const key = base.PATH === void 0 && windows ? Object.keys(base).find((name) => name.toLowerCase() === "path") : "PATH";
61965
+ const current = key && base[key] || "";
61966
+ return current.split(delimiter).some((entry) => windows ? entry.toLowerCase() === dir.toLowerCase() : entry === dir) ? base : {
61967
+ ...base,
61968
+ PATH: current ? `${dir}${delimiter}${current}` : dir
61969
+ };
61970
+ };
61971
+ detectInUserBinDirs = async (status, commandNames, options, probeEnv) => {
61972
+ if (status.available) return status;
61973
+ const candidates = await findCommandInUserBinDirs(commandNames, { env: probeEnv ?? process.env }).catch(() => []);
61974
+ for (const candidate of candidates) {
61975
+ const found = await detectValidatedCommandInEnvironment(candidate, options, withFolderOnPath(candidate, probeEnv));
61976
+ if (found.available) return found;
61977
+ }
61978
+ return status;
61328
61979
  };
61329
- WSL_COMMAND_NAMES = { cursor: ["agent", "cursor-agent"] };
61330
61980
  detectInWslWhenMissing = async (status, commandNames, options) => {
61331
61981
  if (status.available || !isWindows()) return status;
61332
61982
  const candidates = [];
@@ -75341,18 +75991,17 @@ const isSupportedDshVersion = (version) => {
75341
75991
  * Find a `dsh` that can run LobeHub turns. An older CLI still answers
75342
75992
  * `--version` but has no `acp` profile, so it is reported unavailable here
75343
75993
  * rather than failing every turn after the agent was created.
75994
+ *
75995
+ * `dsh` is installed with `npm i -g`, which puts it in whichever global folder
75996
+ * the user's Node setup has: `%APPDATA%\npm`, an nvm-windows or fnm Node's own
75997
+ * folder, a pnpm / bun / Volta global, often off the PATH this app started
75998
+ * with. Those folders are swept before WSL is asked.
75344
75999
  */
75345
- /**
75346
- * `dsh` is installed with `npm i -g`. On Windows that drops `dsh.cmd` in npm's
75347
- * global prefix (`%APPDATA%\npm`), a directory npm's installer only adds to the
75348
- * registry User PATH, so an app started before it never sees it.
75349
- */
75350
- const getDshWellKnownPaths = () => platform() === "win32" ? [path.win32.join(process.env.APPDATA || path.win32.join(homedir(), "AppData", "Roaming"), "npm", "dsh.cmd")] : [];
75351
76000
  const detectDshCommand = async (command = "dsh", env) => {
75352
76001
  const isDefaultCommand = command.trim() === "dsh";
75353
76002
  const validation = { validatePattern: DSH_VERSION_PATTERN };
75354
- const nativeStatus = await detectValidatedCommandCandidates(isDefaultCommand ? [command, ...getDshWellKnownPaths()] : [command], validation, env);
75355
- const status = isDefaultCommand ? await detectInWslWhenMissing(nativeStatus, ["dsh"], validation) : nativeStatus;
76003
+ const nativeStatus = await detectValidatedCommandCandidates([command], validation, env);
76004
+ const status = isDefaultCommand ? await detectInWslWhenMissing(await detectInUserBinDirs(nativeStatus, ["dsh"], validation, env), ["dsh"], validation) : nativeStatus;
75356
76005
  if (!status.available || isSupportedDshVersion(status.version)) return status;
75357
76006
  return {
75358
76007
  ...status,
@@ -335060,7 +335709,7 @@ var stdio_exports = /* @__PURE__ */ __exportAll$2({
335060
335709
  function getDefaultEnvironment() {
335061
335710
  const env = {};
335062
335711
  for (const key of DEFAULT_INHERITED_ENV_VARS) {
335063
- const value = _w.env[key];
335712
+ const value = process$1.env[key];
335064
335713
  if (value === void 0) continue;
335065
335714
  if (value.startsWith("()")) continue;
335066
335715
  env[key] = value;
@@ -335071,7 +335720,7 @@ var import_cross_spawn$1, DEFAULT_INHERITED_ENV_VARS, StdioClientTransport;
335071
335720
  var init_stdio = __esmMin((() => {
335072
335721
  init_src_CeKsbNLO();
335073
335722
  import_cross_spawn$1 = /* @__PURE__ */ __toESM$2(require_cross_spawn(), 1);
335074
- DEFAULT_INHERITED_ENV_VARS = _w.platform === "win32" ? [
335723
+ DEFAULT_INHERITED_ENV_VARS = process$1.platform === "win32" ? [
335075
335724
  "APPDATA",
335076
335725
  "COMSPEC",
335077
335726
  "HOMEDRIVE",
@@ -335128,7 +335777,7 @@ var init_stdio = __esmMin((() => {
335128
335777
  this._serverParams.stderr ?? "inherit"
335129
335778
  ],
335130
335779
  shell: false,
335131
- windowsHide: _w.platform === "win32",
335780
+ windowsHide: process$1.platform === "win32",
335132
335781
  cwd: this._serverParams.cwd
335133
335782
  });
335134
335783
  this._process.on("error", (error) => {
@@ -338162,9 +338811,9 @@ const getSubprocessResult = ({ stdout }) => {
338162
338811
  //#region node_modules/.pnpm/execa@9.6.1/node_modules/execa/lib/utils/standard-stream.js
338163
338812
  const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
338164
338813
  const STANDARD_STREAMS = [
338165
- _w.stdin,
338166
- _w.stdout,
338167
- _w.stderr
338814
+ process$1.stdin,
338815
+ process$1.stdout,
338816
+ process$1.stderr
338168
338817
  ];
338169
338818
  const STANDARD_STREAMS_ALIASES = [
338170
338819
  "stdin",
@@ -338289,9 +338938,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
338289
338938
  //#endregion
338290
338939
  //#region node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
338291
338940
  function isUnicodeSupported() {
338292
- const { env } = _w;
338941
+ const { env } = process$1;
338293
338942
  const { TERM, TERM_PROGRAM } = env;
338294
- if (_w.platform !== "win32") return TERM !== "linux";
338943
+ if (process$1.platform !== "win32") return TERM !== "linux";
338295
338944
  return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
338296
338945
  }
338297
338946
 
@@ -338826,7 +339475,7 @@ function traversePathUp(startPath) {
338826
339475
 
338827
339476
  //#endregion
338828
339477
  //#region node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
338829
- const npmRunPath = ({ cwd = _w.cwd(), path: pathOption = _w.env[pathKey()], preferLocal = true, execPath = _w.execPath, addExecPath = true } = {}) => {
339478
+ const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath = process$1.execPath, addExecPath = true } = {}) => {
338830
339479
  const cwdPath = path.resolve(toPath(cwd));
338831
339480
  const result = [];
338832
339481
  const pathParts = pathOption.split(path.delimiter);
@@ -338844,7 +339493,7 @@ const applyExecPath = (result, pathParts, execPath, cwdPath) => {
338844
339493
  const pathPart = path.resolve(cwdPath, toPath(execPath), "..");
338845
339494
  if (!pathParts.includes(pathPart)) result.push(pathPart);
338846
339495
  };
338847
- const npmRunPathEnv = ({ env = _w.env, ...options } = {}) => {
339496
+ const npmRunPathEnv = ({ env = process$1.env, ...options } = {}) => {
338848
339497
  env = { ...env };
338849
339498
  const pathName = pathKey({ env });
338850
339499
  options.path = env[pathName];
@@ -339979,7 +340628,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
339979
340628
  };
339980
340629
  const getDefaultCwd = () => {
339981
340630
  try {
339982
- return _w.cwd();
340631
+ return process$1.cwd();
339983
340632
  } catch (error) {
339984
340633
  error.message = `The current directory does not exist.\n${error.message}`;
339985
340634
  throw error;
@@ -340015,7 +340664,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
340015
340664
  options.killSignal = normalizeKillSignal(options.killSignal);
340016
340665
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
340017
340666
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
340018
- if (_w.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
340667
+ if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
340019
340668
  return {
340020
340669
  file,
340021
340670
  commandArguments,
@@ -340042,7 +340691,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
340042
340691
  });
340043
340692
  const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
340044
340693
  const env = extendEnv ? {
340045
- ..._w.env,
340694
+ ...process$1.env,
340046
340695
  ...envOption
340047
340696
  } : envOption;
340048
340697
  if (preferLocal || node) return npmRunPathEnv({
@@ -341044,12 +341693,12 @@ const guessStreamDirection = {
341044
341693
  }
341045
341694
  };
341046
341695
  const getStandardStreamDirection = (value) => {
341047
- if ([0, _w.stdin].includes(value)) return "input";
341696
+ if ([0, process$1.stdin].includes(value)) return "input";
341048
341697
  if ([
341049
341698
  1,
341050
341699
  2,
341051
- _w.stdout,
341052
- _w.stderr
341700
+ process$1.stdout,
341701
+ process$1.stderr
341053
341702
  ].includes(value)) return "output";
341054
341703
  };
341055
341704
  const DEFAULT_DIRECTION = "output";
@@ -342113,9 +342762,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
342113
342762
  Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
342114
342763
  };
342115
342764
  const getIpcExport = () => {
342116
- const anyProcess = _w;
342765
+ const anyProcess = process$1;
342117
342766
  const isSubprocess = true;
342118
- const ipc = _w.channel !== void 0;
342767
+ const ipc = process$1.channel !== void 0;
342119
342768
  return {
342120
342769
  ...getIpcMethods(anyProcess, isSubprocess, ipc),
342121
342770
  getCancelSignal: getCancelSignal$1.bind(void 0, {
@@ -342592,7 +343241,7 @@ var SignalExitFallback = class extends SignalExitBase {
342592
343241
  };
342593
343242
  var SignalExit = class extends SignalExitBase {
342594
343243
  /* c8 ignore start */
342595
- #hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
343244
+ #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
342596
343245
  /* c8 ignore stop */
342597
343246
  #emitter = new Emitter();
342598
343247
  #process;
@@ -342687,8 +343336,8 @@ var SignalExit = class extends SignalExitBase {
342687
343336
  } else return og.call(this.#process, ev, ...args);
342688
343337
  }
342689
343338
  };
342690
- const process$1 = globalThis.process;
342691
- const { onExit, load: load$1, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
343339
+ const process$2 = globalThis.process;
343340
+ const { onExit, load: load$1, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
342692
343341
 
342693
343342
  //#endregion
342694
343343
  //#region node_modules/.pnpm/execa@9.6.1/node_modules/execa/lib/terminate/cleanup.js