@yoooclaw/cli 0.0.5 → 0.0.6

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.cjs CHANGED
@@ -5941,7 +5941,7 @@ function buildContext(flags) {
5941
5941
  var import_node_fs3 = require("node:fs");
5942
5942
  function readBuildInjectedVersion() {
5943
5943
  if (false) {}
5944
- const version = "0.0.5".trim();
5944
+ const version = "0.0.6".trim();
5945
5945
  return version || undefined;
5946
5946
  }
5947
5947
  function readVersionFromPackageJson() {
@@ -5955,6 +5955,15 @@ function readVersionFromPackageJson() {
5955
5955
  }
5956
5956
  }
5957
5957
  var CLI_VERSION = readBuildInjectedVersion() ?? readVersionFromPackageJson() ?? "unknown";
5958
+ function readBuildInjectedDist() {
5959
+ if (false)
5960
+ ;
5961
+ const value = "npm".trim();
5962
+ if (value === "npm" || value === "native" || value === "dev")
5963
+ return value;
5964
+ return;
5965
+ }
5966
+ var CLI_DIST = readBuildInjectedDist() ?? "dev";
5958
5967
 
5959
5968
  // src/fs-utils.ts
5960
5969
  var import_node_fs4 = require("node:fs");
@@ -9966,8 +9975,8 @@ function quantizeWindow(value) {
9966
9975
  init_env();
9967
9976
  async function sendLightEffect(apiKey, segments, logger, repeatInput, reason, title) {
9968
9977
  const apiUrl = getEnvUrls().lightApiUrl;
9969
- const appKey = process.env.LIGHT_APP_KEY;
9970
- const templateId = process.env.LIGHT_TEMPLATE_ID;
9978
+ const appKey = "7Q617S1G5WD274JI";
9979
+ const templateId = "1990771146010017800";
9971
9980
  const resolvedTitle = resolveLightTitle(title, reason, segments);
9972
9981
  logger?.info(`Light sender: apiUrl=${apiUrl ?? "UNSET"}, appKey=${appKey ? appKey.substring(0, 8) + "…" : "UNSET"}, templateId=${templateId ?? "UNSET"}, apiKey=${apiKey ? apiKey.substring(0, 20) + "…" : "EMPTY"}, title=${resolvedTitle}, reason=${reason ?? ""}, segments=${JSON.stringify(segments)}`);
9973
9982
  if (!apiUrl || !appKey || !templateId) {
@@ -12360,8 +12369,43 @@ function migrateFromOpenclaw(ctx, _args, opts) {
12360
12369
  }
12361
12370
 
12362
12371
  // src/commands/update.ts
12372
+ var import_node_os8 = require("node:os");
12363
12373
  var PACKAGE = "@yoooclaw/cli";
12364
12374
  var REGISTRY = "https://registry.npmjs.org";
12375
+ var INSTALL_SH = "https://raw.githubusercontent.com/Yoooclaw/openclaw-plugin/master/packages/cli/scripts/install.sh";
12376
+ function normalizeOs(p) {
12377
+ if (p === "darwin")
12378
+ return "darwin";
12379
+ if (p === "linux")
12380
+ return "linux";
12381
+ return null;
12382
+ }
12383
+ function normalizeArch(a) {
12384
+ if (a === "arm64")
12385
+ return "arm64";
12386
+ if (a === "x64")
12387
+ return "x64";
12388
+ return null;
12389
+ }
12390
+ function nativeTargetName() {
12391
+ const os3 = normalizeOs(import_node_os8.platform());
12392
+ const arch2 = normalizeArch(import_node_os8.arch());
12393
+ if (!os3 || !arch2)
12394
+ return null;
12395
+ return `yoooclaw-${os3}-${arch2}`;
12396
+ }
12397
+ function upgradeCommand(channel, latest) {
12398
+ if (CLI_DIST === "native") {
12399
+ const target = nativeTargetName();
12400
+ if (!target) {
12401
+ return `curl -fsSL ${INSTALL_SH} | sh`;
12402
+ }
12403
+ return `curl -fsSL ${INSTALL_SH} | sh -s -- --version ${latest}`;
12404
+ }
12405
+ if (channel === "beta")
12406
+ return `npm i -g ${PACKAGE}@beta`;
12407
+ return `npm update -g ${PACKAGE}`;
12408
+ }
12365
12409
  function compareSemver(a, b) {
12366
12410
  const pa = a.split("-")[0].split(".").map(Number);
12367
12411
  const pb = b.split("-")[0].split(".").map(Number);
@@ -12403,10 +12447,11 @@ async function updateSelf(_ctx, _args, opts) {
12403
12447
  ok: true,
12404
12448
  package: PACKAGE,
12405
12449
  channel: tag,
12450
+ dist: CLI_DIST,
12406
12451
  current: CLI_VERSION,
12407
12452
  latest,
12408
12453
  updateAvailable,
12409
- command: updateAvailable ? `npm update -g ${PACKAGE}` : null,
12454
+ command: updateAvailable ? upgradeCommand(tag, latest) : null,
12410
12455
  hint: updateAvailable ? "发现新版本;CLI 不做自动更新,请手动执行上面的命令" : "已是最新版本"
12411
12456
  };
12412
12457
  }
@@ -12508,7 +12553,7 @@ function doctor(ctx, _args, opts) {
12508
12553
  // src/commands/skills.ts
12509
12554
  var import_node_fs27 = require("node:fs");
12510
12555
  var import_node_url = require("node:url");
12511
- var import_node_os8 = require("node:os");
12556
+ var import_node_os9 = require("node:os");
12512
12557
  var import_node_path23 = require("node:path");
12513
12558
  var AGENT_IDS = ["claude", "codex"];
12514
12559
  var INSTALL_AGENT_IDS = ["auto", "custom", ...AGENT_IDS];
@@ -12517,10 +12562,10 @@ function trimEnv(name) {
12517
12562
  return value ? value : undefined;
12518
12563
  }
12519
12564
  function claudeHomeDir() {
12520
- return import_node_path23.join(import_node_os8.homedir(), ".claude");
12565
+ return import_node_path23.join(import_node_os9.homedir(), ".claude");
12521
12566
  }
12522
12567
  function codexHomeDir() {
12523
- return trimEnv("CODEX_HOME") ?? import_node_path23.join(import_node_os8.homedir(), ".codex");
12568
+ return trimEnv("CODEX_HOME") ?? import_node_path23.join(import_node_os9.homedir(), ".codex");
12524
12569
  }
12525
12570
  var AGENT_ADAPTERS = [
12526
12571
  {
@@ -14557,5 +14602,5 @@ async function run(argv = process.argv) {
14557
14602
  await program.parseAsync(argv);
14558
14603
  }
14559
14604
 
14560
- //# debugId=DB9D4AD9EEBC2A3864756E2164756E21
14605
+ //# debugId=9473441866DCD1D764756E2164756E21
14561
14606
  //# sourceMappingURL=index.cjs.map