@clawos-dev/clawd 0.2.266 → 0.2.267

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/cli.cjs CHANGED
@@ -450,8 +450,8 @@ var init_parseUtil = __esm({
450
450
  init_errors();
451
451
  init_en();
452
452
  makeIssue = (params) => {
453
- const { data, path: path75, errorMaps, issueData } = params;
454
- const fullPath = [...path75, ...issueData.path || []];
453
+ const { data, path: path76, errorMaps, issueData } = params;
454
+ const fullPath = [...path76, ...issueData.path || []];
455
455
  const fullIssue = {
456
456
  ...issueData,
457
457
  path: fullPath
@@ -762,11 +762,11 @@ var init_types = __esm({
762
762
  init_parseUtil();
763
763
  init_util();
764
764
  ParseInputLazyPath = class {
765
- constructor(parent, value, path75, key) {
765
+ constructor(parent, value, path76, key) {
766
766
  this._cachedPath = [];
767
767
  this.parent = parent;
768
768
  this.data = value;
769
- this._path = path75;
769
+ this._path = path76;
770
770
  this._key = key;
771
771
  }
772
772
  get path() {
@@ -5920,7 +5920,14 @@ var init_schemas = __esm({
5920
5920
  /** UI 拼 file-sharing HTTP 路由的前缀(http(s)://host:port),不含尾斜杠;frpc 反代时返反代地址 */
5921
5921
  httpBaseUrl: external_exports.string().optional(),
5922
5922
  /** file-sharing HTTP 路由的 Authorization: Bearer token;与 WS token 解耦,HTTP 401 仅触发 ReAuth 不强踢 WS(spec §11 第 4 条) */
5923
- httpToken: external_exports.string().optional()
5923
+ httpToken: external_exports.string().optional(),
5924
+ /** daemon 进程从 OTA bundle 还是 packaged 路径起的。daemon 侧由 CLAWD_DAEMON_SOURCE env
5925
+ * 决定(未设一律 'packaged',所以 npm 起的 daemon 落在 'packaged')。
5926
+ * UI 原样显示,禁止二次推断出第三种来源。旧 daemon 不发 → undefined。 */
5927
+ daemonSource: external_exports.enum(["ota", "packaged"]).optional(),
5928
+ /** 本机 PATH 里全局安装的 @clawos-dev/clawd 版本;null = 没装。
5929
+ * 探测见 daemon/src/cli-probe/probe.ts。旧 daemon 不发 → undefined。 */
5930
+ globalCliVersion: external_exports.string().nullable().optional()
5924
5931
  });
5925
5932
  PROJECT_PORT_MIN = 6173;
5926
5933
  PROJECT_PORT_MAX = 6272;
@@ -7001,8 +7008,8 @@ var require_req = __commonJS({
7001
7008
  if (req.originalUrl) {
7002
7009
  _req.url = req.originalUrl;
7003
7010
  } else {
7004
- const path75 = req.path;
7005
- _req.url = typeof path75 === "string" ? path75 : req.url ? req.url.path || req.url : void 0;
7011
+ const path76 = req.path;
7012
+ _req.url = typeof path76 === "string" ? path76 : req.url ? req.url.path || req.url : void 0;
7006
7013
  }
7007
7014
  if (req.query) {
7008
7015
  _req.query = req.query;
@@ -7167,14 +7174,14 @@ var require_redact = __commonJS({
7167
7174
  }
7168
7175
  return obj;
7169
7176
  }
7170
- function parsePath(path75) {
7177
+ function parsePath(path76) {
7171
7178
  const parts = [];
7172
7179
  let current = "";
7173
7180
  let inBrackets = false;
7174
7181
  let inQuotes = false;
7175
7182
  let quoteChar = "";
7176
- for (let i = 0; i < path75.length; i++) {
7177
- const char = path75[i];
7183
+ for (let i = 0; i < path76.length; i++) {
7184
+ const char = path76[i];
7178
7185
  if (!inBrackets && char === ".") {
7179
7186
  if (current) {
7180
7187
  parts.push(current);
@@ -7305,10 +7312,10 @@ var require_redact = __commonJS({
7305
7312
  return current;
7306
7313
  }
7307
7314
  function redactPaths(obj, paths, censor, remove = false) {
7308
- for (const path75 of paths) {
7309
- const parts = parsePath(path75);
7315
+ for (const path76 of paths) {
7316
+ const parts = parsePath(path76);
7310
7317
  if (parts.includes("*")) {
7311
- redactWildcardPath(obj, parts, censor, path75, remove);
7318
+ redactWildcardPath(obj, parts, censor, path76, remove);
7312
7319
  } else {
7313
7320
  if (remove) {
7314
7321
  removeKey(obj, parts);
@@ -7393,8 +7400,8 @@ var require_redact = __commonJS({
7393
7400
  }
7394
7401
  } else {
7395
7402
  if (afterWildcard.includes("*")) {
7396
- const wrappedCensor = typeof censor === "function" ? (value, path75) => {
7397
- const fullPath = [...pathArray.slice(0, pathLength), ...path75];
7403
+ const wrappedCensor = typeof censor === "function" ? (value, path76) => {
7404
+ const fullPath = [...pathArray.slice(0, pathLength), ...path76];
7398
7405
  return censor(value, fullPath);
7399
7406
  } : censor;
7400
7407
  redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
@@ -7429,8 +7436,8 @@ var require_redact = __commonJS({
7429
7436
  return null;
7430
7437
  }
7431
7438
  const pathStructure = /* @__PURE__ */ new Map();
7432
- for (const path75 of pathsToClone) {
7433
- const parts = parsePath(path75);
7439
+ for (const path76 of pathsToClone) {
7440
+ const parts = parsePath(path76);
7434
7441
  let current = pathStructure;
7435
7442
  for (let i = 0; i < parts.length; i++) {
7436
7443
  const part = parts[i];
@@ -7482,24 +7489,24 @@ var require_redact = __commonJS({
7482
7489
  }
7483
7490
  return cloneSelectively(obj, pathStructure);
7484
7491
  }
7485
- function validatePath(path75) {
7486
- if (typeof path75 !== "string") {
7492
+ function validatePath(path76) {
7493
+ if (typeof path76 !== "string") {
7487
7494
  throw new Error("Paths must be (non-empty) strings");
7488
7495
  }
7489
- if (path75 === "") {
7496
+ if (path76 === "") {
7490
7497
  throw new Error("Invalid redaction path ()");
7491
7498
  }
7492
- if (path75.includes("..")) {
7493
- throw new Error(`Invalid redaction path (${path75})`);
7499
+ if (path76.includes("..")) {
7500
+ throw new Error(`Invalid redaction path (${path76})`);
7494
7501
  }
7495
- if (path75.includes(",")) {
7496
- throw new Error(`Invalid redaction path (${path75})`);
7502
+ if (path76.includes(",")) {
7503
+ throw new Error(`Invalid redaction path (${path76})`);
7497
7504
  }
7498
7505
  let bracketCount = 0;
7499
7506
  let inQuotes = false;
7500
7507
  let quoteChar = "";
7501
- for (let i = 0; i < path75.length; i++) {
7502
- const char = path75[i];
7508
+ for (let i = 0; i < path76.length; i++) {
7509
+ const char = path76[i];
7503
7510
  if ((char === '"' || char === "'") && bracketCount > 0) {
7504
7511
  if (!inQuotes) {
7505
7512
  inQuotes = true;
@@ -7513,20 +7520,20 @@ var require_redact = __commonJS({
7513
7520
  } else if (char === "]" && !inQuotes) {
7514
7521
  bracketCount--;
7515
7522
  if (bracketCount < 0) {
7516
- throw new Error(`Invalid redaction path (${path75})`);
7523
+ throw new Error(`Invalid redaction path (${path76})`);
7517
7524
  }
7518
7525
  }
7519
7526
  }
7520
7527
  if (bracketCount !== 0) {
7521
- throw new Error(`Invalid redaction path (${path75})`);
7528
+ throw new Error(`Invalid redaction path (${path76})`);
7522
7529
  }
7523
7530
  }
7524
7531
  function validatePaths(paths) {
7525
7532
  if (!Array.isArray(paths)) {
7526
7533
  throw new TypeError("paths must be an array");
7527
7534
  }
7528
- for (const path75 of paths) {
7529
- validatePath(path75);
7535
+ for (const path76 of paths) {
7536
+ validatePath(path76);
7530
7537
  }
7531
7538
  }
7532
7539
  function slowRedact(options = {}) {
@@ -7694,8 +7701,8 @@ var require_redaction = __commonJS({
7694
7701
  if (shape[k2] === null) {
7695
7702
  o[k2] = (value) => topCensor(value, [k2]);
7696
7703
  } else {
7697
- const wrappedCensor = typeof censor === "function" ? (value, path75) => {
7698
- return censor(value, [k2, ...path75]);
7704
+ const wrappedCensor = typeof censor === "function" ? (value, path76) => {
7705
+ return censor(value, [k2, ...path76]);
7699
7706
  } : censor;
7700
7707
  o[k2] = Redact({
7701
7708
  paths: shape[k2],
@@ -7913,10 +7920,10 @@ var require_atomic_sleep = __commonJS({
7913
7920
  var require_sonic_boom = __commonJS({
7914
7921
  "../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js"(exports2, module2) {
7915
7922
  "use strict";
7916
- var fs66 = require("fs");
7923
+ var fs67 = require("fs");
7917
7924
  var EventEmitter3 = require("events");
7918
7925
  var inherits = require("util").inherits;
7919
- var path75 = require("path");
7926
+ var path76 = require("path");
7920
7927
  var sleep2 = require_atomic_sleep();
7921
7928
  var assert = require("assert");
7922
7929
  var BUSY_WRITE_TIMEOUT = 100;
@@ -7970,20 +7977,20 @@ var require_sonic_boom = __commonJS({
7970
7977
  const mode = sonic.mode;
7971
7978
  if (sonic.sync) {
7972
7979
  try {
7973
- if (sonic.mkdir) fs66.mkdirSync(path75.dirname(file), { recursive: true });
7974
- const fd = fs66.openSync(file, flags, mode);
7980
+ if (sonic.mkdir) fs67.mkdirSync(path76.dirname(file), { recursive: true });
7981
+ const fd = fs67.openSync(file, flags, mode);
7975
7982
  fileOpened(null, fd);
7976
7983
  } catch (err) {
7977
7984
  fileOpened(err);
7978
7985
  throw err;
7979
7986
  }
7980
7987
  } else if (sonic.mkdir) {
7981
- fs66.mkdir(path75.dirname(file), { recursive: true }, (err) => {
7988
+ fs67.mkdir(path76.dirname(file), { recursive: true }, (err) => {
7982
7989
  if (err) return fileOpened(err);
7983
- fs66.open(file, flags, mode, fileOpened);
7990
+ fs67.open(file, flags, mode, fileOpened);
7984
7991
  });
7985
7992
  } else {
7986
- fs66.open(file, flags, mode, fileOpened);
7993
+ fs67.open(file, flags, mode, fileOpened);
7987
7994
  }
7988
7995
  }
7989
7996
  function SonicBoom(opts) {
@@ -8024,8 +8031,8 @@ var require_sonic_boom = __commonJS({
8024
8031
  this.flush = flushBuffer;
8025
8032
  this.flushSync = flushBufferSync;
8026
8033
  this._actualWrite = actualWriteBuffer;
8027
- fsWriteSync = () => fs66.writeSync(this.fd, this._writingBuf);
8028
- fsWrite = () => fs66.write(this.fd, this._writingBuf, this.release);
8034
+ fsWriteSync = () => fs67.writeSync(this.fd, this._writingBuf);
8035
+ fsWrite = () => fs67.write(this.fd, this._writingBuf, this.release);
8029
8036
  } else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
8030
8037
  this._writingBuf = "";
8031
8038
  this.write = write;
@@ -8034,15 +8041,15 @@ var require_sonic_boom = __commonJS({
8034
8041
  this._actualWrite = actualWrite;
8035
8042
  fsWriteSync = () => {
8036
8043
  if (Buffer.isBuffer(this._writingBuf)) {
8037
- return fs66.writeSync(this.fd, this._writingBuf);
8044
+ return fs67.writeSync(this.fd, this._writingBuf);
8038
8045
  }
8039
- return fs66.writeSync(this.fd, this._writingBuf, "utf8");
8046
+ return fs67.writeSync(this.fd, this._writingBuf, "utf8");
8040
8047
  };
8041
8048
  fsWrite = () => {
8042
8049
  if (Buffer.isBuffer(this._writingBuf)) {
8043
- return fs66.write(this.fd, this._writingBuf, this.release);
8050
+ return fs67.write(this.fd, this._writingBuf, this.release);
8044
8051
  }
8045
- return fs66.write(this.fd, this._writingBuf, "utf8", this.release);
8052
+ return fs67.write(this.fd, this._writingBuf, "utf8", this.release);
8046
8053
  };
8047
8054
  } else {
8048
8055
  throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
@@ -8099,7 +8106,7 @@ var require_sonic_boom = __commonJS({
8099
8106
  }
8100
8107
  }
8101
8108
  if (this._fsync) {
8102
- fs66.fsyncSync(this.fd);
8109
+ fs67.fsyncSync(this.fd);
8103
8110
  }
8104
8111
  const len = this._len;
8105
8112
  if (this._reopening) {
@@ -8213,7 +8220,7 @@ var require_sonic_boom = __commonJS({
8213
8220
  const onDrain = () => {
8214
8221
  if (!this._fsync) {
8215
8222
  try {
8216
- fs66.fsync(this.fd, (err) => {
8223
+ fs67.fsync(this.fd, (err) => {
8217
8224
  this._flushPending = false;
8218
8225
  cb(err);
8219
8226
  });
@@ -8315,7 +8322,7 @@ var require_sonic_boom = __commonJS({
8315
8322
  const fd = this.fd;
8316
8323
  this.once("ready", () => {
8317
8324
  if (fd !== this.fd) {
8318
- fs66.close(fd, (err) => {
8325
+ fs67.close(fd, (err) => {
8319
8326
  if (err) {
8320
8327
  return this.emit("error", err);
8321
8328
  }
@@ -8364,7 +8371,7 @@ var require_sonic_boom = __commonJS({
8364
8371
  buf = this._bufs[0];
8365
8372
  }
8366
8373
  try {
8367
- const n = Buffer.isBuffer(buf) ? fs66.writeSync(this.fd, buf) : fs66.writeSync(this.fd, buf, "utf8");
8374
+ const n = Buffer.isBuffer(buf) ? fs67.writeSync(this.fd, buf) : fs67.writeSync(this.fd, buf, "utf8");
8368
8375
  const releasedBufObj = releaseWritingBuf(buf, this._len, n);
8369
8376
  buf = releasedBufObj.writingBuf;
8370
8377
  this._len = releasedBufObj.len;
@@ -8380,7 +8387,7 @@ var require_sonic_boom = __commonJS({
8380
8387
  }
8381
8388
  }
8382
8389
  try {
8383
- fs66.fsyncSync(this.fd);
8390
+ fs67.fsyncSync(this.fd);
8384
8391
  } catch {
8385
8392
  }
8386
8393
  }
@@ -8401,7 +8408,7 @@ var require_sonic_boom = __commonJS({
8401
8408
  buf = mergeBuf(this._bufs[0], this._lens[0]);
8402
8409
  }
8403
8410
  try {
8404
- const n = fs66.writeSync(this.fd, buf);
8411
+ const n = fs67.writeSync(this.fd, buf);
8405
8412
  buf = buf.subarray(n);
8406
8413
  this._len = Math.max(this._len - n, 0);
8407
8414
  if (buf.length <= 0) {
@@ -8429,13 +8436,13 @@ var require_sonic_boom = __commonJS({
8429
8436
  this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
8430
8437
  if (this.sync) {
8431
8438
  try {
8432
- const written = Buffer.isBuffer(this._writingBuf) ? fs66.writeSync(this.fd, this._writingBuf) : fs66.writeSync(this.fd, this._writingBuf, "utf8");
8439
+ const written = Buffer.isBuffer(this._writingBuf) ? fs67.writeSync(this.fd, this._writingBuf) : fs67.writeSync(this.fd, this._writingBuf, "utf8");
8433
8440
  release(null, written);
8434
8441
  } catch (err) {
8435
8442
  release(err);
8436
8443
  }
8437
8444
  } else {
8438
- fs66.write(this.fd, this._writingBuf, release);
8445
+ fs67.write(this.fd, this._writingBuf, release);
8439
8446
  }
8440
8447
  }
8441
8448
  function actualWriteBuffer() {
@@ -8444,7 +8451,7 @@ var require_sonic_boom = __commonJS({
8444
8451
  this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
8445
8452
  if (this.sync) {
8446
8453
  try {
8447
- const written = fs66.writeSync(this.fd, this._writingBuf);
8454
+ const written = fs67.writeSync(this.fd, this._writingBuf);
8448
8455
  release(null, written);
8449
8456
  } catch (err) {
8450
8457
  release(err);
@@ -8453,7 +8460,7 @@ var require_sonic_boom = __commonJS({
8453
8460
  if (kCopyBuffer) {
8454
8461
  this._writingBuf = Buffer.from(this._writingBuf);
8455
8462
  }
8456
- fs66.write(this.fd, this._writingBuf, release);
8463
+ fs67.write(this.fd, this._writingBuf, release);
8457
8464
  }
8458
8465
  }
8459
8466
  function actualClose(sonic) {
@@ -8469,12 +8476,12 @@ var require_sonic_boom = __commonJS({
8469
8476
  sonic._lens = [];
8470
8477
  assert(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
8471
8478
  try {
8472
- fs66.fsync(sonic.fd, closeWrapped);
8479
+ fs67.fsync(sonic.fd, closeWrapped);
8473
8480
  } catch {
8474
8481
  }
8475
8482
  function closeWrapped() {
8476
8483
  if (sonic.fd !== 1 && sonic.fd !== 2) {
8477
- fs66.close(sonic.fd, done);
8484
+ fs67.close(sonic.fd, done);
8478
8485
  } else {
8479
8486
  done();
8480
8487
  }
@@ -8731,7 +8738,7 @@ var require_thread_stream = __commonJS({
8731
8738
  var { version: version2 } = require_package();
8732
8739
  var { EventEmitter: EventEmitter3 } = require("events");
8733
8740
  var { Worker } = require("worker_threads");
8734
- var { join: join15 } = require("path");
8741
+ var { join: join16 } = require("path");
8735
8742
  var { pathToFileURL } = require("url");
8736
8743
  var { wait } = require_wait();
8737
8744
  var {
@@ -8767,7 +8774,7 @@ var require_thread_stream = __commonJS({
8767
8774
  function createWorker(stream, opts) {
8768
8775
  const { filename, workerData } = opts;
8769
8776
  const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
8770
- const toExecute = bundlerOverrides["thread-stream-worker"] || join15(__dirname, "lib", "worker.js");
8777
+ const toExecute = bundlerOverrides["thread-stream-worker"] || join16(__dirname, "lib", "worker.js");
8771
8778
  const worker = new Worker(toExecute, {
8772
8779
  ...opts.workerOpts,
8773
8780
  trackUnmanagedFds: false,
@@ -9153,7 +9160,7 @@ var require_transport = __commonJS({
9153
9160
  "use strict";
9154
9161
  var { createRequire } = require("module");
9155
9162
  var getCallers = require_caller();
9156
- var { join: join15, isAbsolute: isAbsolute2, sep: sep3 } = require("path");
9163
+ var { join: join16, isAbsolute: isAbsolute2, sep: sep3 } = require("path");
9157
9164
  var sleep2 = require_atomic_sleep();
9158
9165
  var onExit = require_on_exit_leak_free();
9159
9166
  var ThreadStream = require_thread_stream();
@@ -9216,7 +9223,7 @@ var require_transport = __commonJS({
9216
9223
  throw new Error("only one of target or targets can be specified");
9217
9224
  }
9218
9225
  if (targets) {
9219
- target = bundlerOverrides["pino-worker"] || join15(__dirname, "worker.js");
9226
+ target = bundlerOverrides["pino-worker"] || join16(__dirname, "worker.js");
9220
9227
  options.targets = targets.filter((dest) => dest.target).map((dest) => {
9221
9228
  return {
9222
9229
  ...dest,
@@ -9234,7 +9241,7 @@ var require_transport = __commonJS({
9234
9241
  });
9235
9242
  });
9236
9243
  } else if (pipeline3) {
9237
- target = bundlerOverrides["pino-worker"] || join15(__dirname, "worker.js");
9244
+ target = bundlerOverrides["pino-worker"] || join16(__dirname, "worker.js");
9238
9245
  options.pipelines = [pipeline3.map((dest) => {
9239
9246
  return {
9240
9247
  ...dest,
@@ -9256,7 +9263,7 @@ var require_transport = __commonJS({
9256
9263
  return origin;
9257
9264
  }
9258
9265
  if (origin === "pino/file") {
9259
- return join15(__dirname, "..", "file.js");
9266
+ return join16(__dirname, "..", "file.js");
9260
9267
  }
9261
9268
  let fixTarget2;
9262
9269
  for (const filePath of callers) {
@@ -10246,7 +10253,7 @@ var require_safe_stable_stringify = __commonJS({
10246
10253
  return circularValue;
10247
10254
  }
10248
10255
  let res = "";
10249
- let join15 = ",";
10256
+ let join16 = ",";
10250
10257
  const originalIndentation = indentation;
10251
10258
  if (Array.isArray(value)) {
10252
10259
  if (value.length === 0) {
@@ -10260,7 +10267,7 @@ var require_safe_stable_stringify = __commonJS({
10260
10267
  indentation += spacer;
10261
10268
  res += `
10262
10269
  ${indentation}`;
10263
- join15 = `,
10270
+ join16 = `,
10264
10271
  ${indentation}`;
10265
10272
  }
10266
10273
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -10268,13 +10275,13 @@ ${indentation}`;
10268
10275
  for (; i < maximumValuesToStringify - 1; i++) {
10269
10276
  const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
10270
10277
  res += tmp2 !== void 0 ? tmp2 : "null";
10271
- res += join15;
10278
+ res += join16;
10272
10279
  }
10273
10280
  const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
10274
10281
  res += tmp !== void 0 ? tmp : "null";
10275
10282
  if (value.length - 1 > maximumBreadth) {
10276
10283
  const removedKeys = value.length - maximumBreadth - 1;
10277
- res += `${join15}"... ${getItemCount(removedKeys)} not stringified"`;
10284
+ res += `${join16}"... ${getItemCount(removedKeys)} not stringified"`;
10278
10285
  }
10279
10286
  if (spacer !== "") {
10280
10287
  res += `
@@ -10295,7 +10302,7 @@ ${originalIndentation}`;
10295
10302
  let separator = "";
10296
10303
  if (spacer !== "") {
10297
10304
  indentation += spacer;
10298
- join15 = `,
10305
+ join16 = `,
10299
10306
  ${indentation}`;
10300
10307
  whitespace = " ";
10301
10308
  }
@@ -10309,13 +10316,13 @@ ${indentation}`;
10309
10316
  const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
10310
10317
  if (tmp !== void 0) {
10311
10318
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
10312
- separator = join15;
10319
+ separator = join16;
10313
10320
  }
10314
10321
  }
10315
10322
  if (keyLength > maximumBreadth) {
10316
10323
  const removedKeys = keyLength - maximumBreadth;
10317
10324
  res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
10318
- separator = join15;
10325
+ separator = join16;
10319
10326
  }
10320
10327
  if (spacer !== "" && separator.length > 1) {
10321
10328
  res = `
@@ -10356,7 +10363,7 @@ ${originalIndentation}`;
10356
10363
  }
10357
10364
  const originalIndentation = indentation;
10358
10365
  let res = "";
10359
- let join15 = ",";
10366
+ let join16 = ",";
10360
10367
  if (Array.isArray(value)) {
10361
10368
  if (value.length === 0) {
10362
10369
  return "[]";
@@ -10369,7 +10376,7 @@ ${originalIndentation}`;
10369
10376
  indentation += spacer;
10370
10377
  res += `
10371
10378
  ${indentation}`;
10372
- join15 = `,
10379
+ join16 = `,
10373
10380
  ${indentation}`;
10374
10381
  }
10375
10382
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -10377,13 +10384,13 @@ ${indentation}`;
10377
10384
  for (; i < maximumValuesToStringify - 1; i++) {
10378
10385
  const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
10379
10386
  res += tmp2 !== void 0 ? tmp2 : "null";
10380
- res += join15;
10387
+ res += join16;
10381
10388
  }
10382
10389
  const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
10383
10390
  res += tmp !== void 0 ? tmp : "null";
10384
10391
  if (value.length - 1 > maximumBreadth) {
10385
10392
  const removedKeys = value.length - maximumBreadth - 1;
10386
- res += `${join15}"... ${getItemCount(removedKeys)} not stringified"`;
10393
+ res += `${join16}"... ${getItemCount(removedKeys)} not stringified"`;
10387
10394
  }
10388
10395
  if (spacer !== "") {
10389
10396
  res += `
@@ -10396,7 +10403,7 @@ ${originalIndentation}`;
10396
10403
  let whitespace = "";
10397
10404
  if (spacer !== "") {
10398
10405
  indentation += spacer;
10399
- join15 = `,
10406
+ join16 = `,
10400
10407
  ${indentation}`;
10401
10408
  whitespace = " ";
10402
10409
  }
@@ -10405,7 +10412,7 @@ ${indentation}`;
10405
10412
  const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
10406
10413
  if (tmp !== void 0) {
10407
10414
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
10408
- separator = join15;
10415
+ separator = join16;
10409
10416
  }
10410
10417
  }
10411
10418
  if (spacer !== "" && separator.length > 1) {
@@ -10463,20 +10470,20 @@ ${originalIndentation}`;
10463
10470
  indentation += spacer;
10464
10471
  let res2 = `
10465
10472
  ${indentation}`;
10466
- const join16 = `,
10473
+ const join17 = `,
10467
10474
  ${indentation}`;
10468
10475
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
10469
10476
  let i = 0;
10470
10477
  for (; i < maximumValuesToStringify - 1; i++) {
10471
10478
  const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
10472
10479
  res2 += tmp2 !== void 0 ? tmp2 : "null";
10473
- res2 += join16;
10480
+ res2 += join17;
10474
10481
  }
10475
10482
  const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
10476
10483
  res2 += tmp !== void 0 ? tmp : "null";
10477
10484
  if (value.length - 1 > maximumBreadth) {
10478
10485
  const removedKeys = value.length - maximumBreadth - 1;
10479
- res2 += `${join16}"... ${getItemCount(removedKeys)} not stringified"`;
10486
+ res2 += `${join17}"... ${getItemCount(removedKeys)} not stringified"`;
10480
10487
  }
10481
10488
  res2 += `
10482
10489
  ${originalIndentation}`;
@@ -10492,16 +10499,16 @@ ${originalIndentation}`;
10492
10499
  return '"[Object]"';
10493
10500
  }
10494
10501
  indentation += spacer;
10495
- const join15 = `,
10502
+ const join16 = `,
10496
10503
  ${indentation}`;
10497
10504
  let res = "";
10498
10505
  let separator = "";
10499
10506
  let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
10500
10507
  if (isTypedArrayWithEntries(value)) {
10501
- res += stringifyTypedArray(value, join15, maximumBreadth);
10508
+ res += stringifyTypedArray(value, join16, maximumBreadth);
10502
10509
  keys = keys.slice(value.length);
10503
10510
  maximumPropertiesToStringify -= value.length;
10504
- separator = join15;
10511
+ separator = join16;
10505
10512
  }
10506
10513
  if (deterministic) {
10507
10514
  keys = sort(keys, comparator);
@@ -10512,13 +10519,13 @@ ${indentation}`;
10512
10519
  const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
10513
10520
  if (tmp !== void 0) {
10514
10521
  res += `${separator}${strEscape(key2)}: ${tmp}`;
10515
- separator = join15;
10522
+ separator = join16;
10516
10523
  }
10517
10524
  }
10518
10525
  if (keyLength > maximumBreadth) {
10519
10526
  const removedKeys = keyLength - maximumBreadth;
10520
10527
  res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
10521
- separator = join15;
10528
+ separator = join16;
10522
10529
  }
10523
10530
  if (separator !== "") {
10524
10531
  res = `
@@ -11609,11 +11616,11 @@ var init_lib = __esm({
11609
11616
  }
11610
11617
  }
11611
11618
  },
11612
- addToPath: function addToPath(path75, added, removed, oldPosInc, options) {
11613
- var last = path75.lastComponent;
11619
+ addToPath: function addToPath(path76, added, removed, oldPosInc, options) {
11620
+ var last = path76.lastComponent;
11614
11621
  if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
11615
11622
  return {
11616
- oldPos: path75.oldPos + oldPosInc,
11623
+ oldPos: path76.oldPos + oldPosInc,
11617
11624
  lastComponent: {
11618
11625
  count: last.count + 1,
11619
11626
  added,
@@ -11623,7 +11630,7 @@ var init_lib = __esm({
11623
11630
  };
11624
11631
  } else {
11625
11632
  return {
11626
- oldPos: path75.oldPos + oldPosInc,
11633
+ oldPos: path76.oldPos + oldPosInc,
11627
11634
  lastComponent: {
11628
11635
  count: 1,
11629
11636
  added,
@@ -12132,10 +12139,10 @@ function attachmentToHistoryMessage(o, ts) {
12132
12139
  const memories = raw.map((m2) => {
12133
12140
  if (!m2 || typeof m2 !== "object") return null;
12134
12141
  const rec3 = m2;
12135
- const path75 = typeof rec3.path === "string" ? rec3.path : null;
12142
+ const path76 = typeof rec3.path === "string" ? rec3.path : null;
12136
12143
  const content = typeof rec3.content === "string" ? rec3.content : null;
12137
- if (!path75 || content == null) return null;
12138
- const entry = { path: path75, content };
12144
+ if (!path76 || content == null) return null;
12145
+ const entry = { path: path76, content };
12139
12146
  if (typeof rec3.mtimeMs === "number") entry.mtimeMs = rec3.mtimeMs;
12140
12147
  return entry;
12141
12148
  }).filter((m2) => m2 !== null);
@@ -12938,10 +12945,10 @@ function parseAttachment(obj) {
12938
12945
  const memories = raw.map((m2) => {
12939
12946
  if (!m2 || typeof m2 !== "object") return null;
12940
12947
  const rec3 = m2;
12941
- const path75 = typeof rec3.path === "string" ? rec3.path : null;
12948
+ const path76 = typeof rec3.path === "string" ? rec3.path : null;
12942
12949
  const content = typeof rec3.content === "string" ? rec3.content : null;
12943
- if (!path75 || content == null) return null;
12944
- const out = { path: path75, content };
12950
+ if (!path76 || content == null) return null;
12951
+ const out = { path: path76, content };
12945
12952
  if (typeof rec3.mtimeMs === "number") out.mtimeMs = rec3.mtimeMs;
12946
12953
  return out;
12947
12954
  }).filter((m2) => m2 !== null);
@@ -27318,8 +27325,8 @@ var require_CronFileParser = __commonJS({
27318
27325
  * @throws If file cannot be read
27319
27326
  */
27320
27327
  static parseFileSync(filePath) {
27321
- const { readFileSync: readFileSync6 } = require("fs");
27322
- const data = readFileSync6(filePath, "utf8");
27328
+ const { readFileSync: readFileSync7 } = require("fs");
27329
+ const data = readFileSync7(filePath, "utf8");
27323
27330
  return _CronFileParser.#parseContent(data);
27324
27331
  }
27325
27332
  /**
@@ -31320,7 +31327,7 @@ var require_BufferList = __commonJS({
31320
31327
  this.head = this.tail = null;
31321
31328
  this.length = 0;
31322
31329
  };
31323
- BufferList.prototype.join = function join15(s) {
31330
+ BufferList.prototype.join = function join16(s) {
31324
31331
  if (this.length === 0) return "";
31325
31332
  var p2 = this.head;
31326
31333
  var ret = "" + p2.data;
@@ -33910,8 +33917,8 @@ var require_utils = __commonJS({
33910
33917
  var result = transform[inputType][outputType](input);
33911
33918
  return result;
33912
33919
  };
33913
- exports2.resolve = function(path75) {
33914
- var parts = path75.split("/");
33920
+ exports2.resolve = function(path76) {
33921
+ var parts = path76.split("/");
33915
33922
  var result = [];
33916
33923
  for (var index = 0; index < parts.length; index++) {
33917
33924
  var part = parts[index];
@@ -39764,18 +39771,18 @@ var require_object = __commonJS({
39764
39771
  var object = new ZipObject(name, zipObjectContent, o);
39765
39772
  this.files[name] = object;
39766
39773
  };
39767
- var parentFolder = function(path75) {
39768
- if (path75.slice(-1) === "/") {
39769
- path75 = path75.substring(0, path75.length - 1);
39774
+ var parentFolder = function(path76) {
39775
+ if (path76.slice(-1) === "/") {
39776
+ path76 = path76.substring(0, path76.length - 1);
39770
39777
  }
39771
- var lastSlash = path75.lastIndexOf("/");
39772
- return lastSlash > 0 ? path75.substring(0, lastSlash) : "";
39778
+ var lastSlash = path76.lastIndexOf("/");
39779
+ return lastSlash > 0 ? path76.substring(0, lastSlash) : "";
39773
39780
  };
39774
- var forceTrailingSlash = function(path75) {
39775
- if (path75.slice(-1) !== "/") {
39776
- path75 += "/";
39781
+ var forceTrailingSlash = function(path76) {
39782
+ if (path76.slice(-1) !== "/") {
39783
+ path76 += "/";
39777
39784
  }
39778
- return path75;
39785
+ return path76;
39779
39786
  };
39780
39787
  var folderAdd = function(name, createFolders) {
39781
39788
  createFolders = typeof createFolders !== "undefined" ? createFolders : defaults.createFolders;
@@ -47241,8 +47248,8 @@ function turnStartInput(text) {
47241
47248
  const items = [];
47242
47249
  let leftover = text;
47243
47250
  for (const m2 of text.matchAll(SKILL_RE)) {
47244
- const [marker, name, path75] = m2;
47245
- items.push({ type: "skill", name, path: path75 });
47251
+ const [marker, name, path76] = m2;
47252
+ items.push({ type: "skill", name, path: path76 });
47246
47253
  leftover = leftover.replace(marker, "");
47247
47254
  }
47248
47255
  for (const m2 of text.matchAll(ATTACHMENT_RE2)) {
@@ -50280,13 +50287,13 @@ function mapSkillsListResponse(res) {
50280
50287
  const r = s ?? {};
50281
50288
  const name = str3(r.name);
50282
50289
  if (!name) continue;
50283
- const path75 = str3(r.path);
50290
+ const path76 = str3(r.path);
50284
50291
  const description = str3(r.description);
50285
50292
  const isPlugin = name.includes(":");
50286
50293
  out.push({
50287
50294
  name,
50288
50295
  source: isPlugin ? "plugin" : "project",
50289
- ...path75 ? { path: path75 } : {},
50296
+ ...path76 ? { path: path76 } : {},
50290
50297
  ...description ? { description } : {},
50291
50298
  ...isPlugin ? { plugin: name.split(":")[0] } : {}
50292
50299
  });
@@ -54273,9 +54280,9 @@ var CentralClientError = class extends Error {
54273
54280
  code;
54274
54281
  cause;
54275
54282
  };
54276
- async function centralRequest(opts, path75, init) {
54283
+ async function centralRequest(opts, path76, init) {
54277
54284
  const f = opts.fetchImpl ?? globalThis.fetch;
54278
- const url = `${opts.api.replace(/\/+$/, "")}${path75}`;
54285
+ const url = `${opts.api.replace(/\/+$/, "")}${path76}`;
54279
54286
  const ctrl = new AbortController();
54280
54287
  const timer = setTimeout(() => ctrl.abort(), opts.timeoutMs ?? 15e3);
54281
54288
  let res;
@@ -56215,7 +56222,45 @@ function computeMethodAccess(args) {
56215
56222
  }
56216
56223
 
56217
56224
  // src/version.ts
56218
- var version = "0.2.6".length > 0 ? "0.2.6" : "dev";
56225
+ var version = "0.2.267".length > 0 ? "0.2.267" : "dev";
56226
+
56227
+ // src/cli-probe/probe.ts
56228
+ var fs54 = __toESM(require("fs"), 1);
56229
+ var path61 = __toESM(require("path"), 1);
56230
+ var PKG_NAME = "@clawos-dev/clawd";
56231
+ var BIN_NAME = "clawd";
56232
+ var MAX_PARENT_HOPS = 5;
56233
+ function probeGlobalCli(pathEnv) {
56234
+ if (!pathEnv) return null;
56235
+ for (const dir of pathEnv.split(path61.delimiter)) {
56236
+ if (!dir) continue;
56237
+ let real;
56238
+ try {
56239
+ real = fs54.realpathSync(path61.join(dir, BIN_NAME));
56240
+ } catch {
56241
+ continue;
56242
+ }
56243
+ const version2 = readOwnPackageVersion(real);
56244
+ if (version2) return version2;
56245
+ }
56246
+ return null;
56247
+ }
56248
+ function readOwnPackageVersion(entryPath) {
56249
+ let dir = path61.dirname(entryPath);
56250
+ for (let i = 0; i < MAX_PARENT_HOPS; i++) {
56251
+ try {
56252
+ const raw = fs54.readFileSync(path61.join(dir, "package.json"), "utf8");
56253
+ const pkg = JSON.parse(raw);
56254
+ if (pkg.name !== PKG_NAME) return null;
56255
+ return typeof pkg.version === "string" && pkg.version ? pkg.version : null;
56256
+ } catch {
56257
+ const parent = path61.dirname(dir);
56258
+ if (parent === dir) return null;
56259
+ dir = parent;
56260
+ }
56261
+ }
56262
+ return null;
56263
+ }
56219
56264
 
56220
56265
  // src/handlers/meta.ts
56221
56266
  function buildReadyFrame(deps, client) {
@@ -56239,6 +56284,7 @@ function buildReadyFrame(deps, client) {
56239
56284
  if (deps.httpToken) fileSharing.httpToken = deps.httpToken;
56240
56285
  }
56241
56286
  const daemonSource = process.env.CLAWD_DAEMON_SOURCE === "ota" ? "ota" : "packaged";
56287
+ const globalCliVersion = probeGlobalCli(process.env.PATH);
56242
56288
  const logShipping = deps.getLogShipping ? deps.getLogShipping() : null;
56243
56289
  return {
56244
56290
  version,
@@ -56250,6 +56296,7 @@ function buildReadyFrame(deps, client) {
56250
56296
  tunnelUrl,
56251
56297
  mode: deps.mode,
56252
56298
  daemonSource,
56299
+ globalCliVersion,
56253
56300
  ...fileSharing,
56254
56301
  ...logShipping ? { logShipping } : {}
56255
56302
  };