@clawos-dev/clawd 0.2.265 → 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() {
@@ -5630,7 +5630,12 @@ var init_schemas = __esm({
5630
5630
  effort: external_exports.string().optional(),
5631
5631
  cwd: external_exports.string().optional(),
5632
5632
  // 用户在 Edit modal 选择的 icon 标识;UI 端做 enum 兜底
5633
- iconKey: external_exports.string().optional()
5633
+ iconKey: external_exports.string().optional(),
5634
+ // 快速问答会话转正(spec 2026-07-30-quick-ask-promote):只能摘不能打。
5635
+ // z.literal(false) 让「不可逆」这条产品语义与协议约束是同一件事:反向标记会让会话
5636
+ // 从所有 sidebar 消费者视野消失(App.visibleSessions / buildSessionTree),用户看不见
5637
+ // 也删不掉,再被 sweepEphemeralOnStartup 静默删除——数据丢失级别的口子。
5638
+ ephemeral: external_exports.literal(false).optional()
5634
5639
  // 注意:appBuilderProject 字段已从 patch 中砍掉(spec 2026-06-02-app-builder-single-pane-default-design)。
5635
5640
  // 绑定单向不可变 —— 由 appBuilder:createProject 在 daemon 内部一次写入;UI / assistant 不再
5636
5641
  // 通过 sessionUpdate 修改这个字段。SessionFile 仍保留 appBuilderProject 字段供 daemon 内部 mutate。
@@ -5915,7 +5920,14 @@ var init_schemas = __esm({
5915
5920
  /** UI 拼 file-sharing HTTP 路由的前缀(http(s)://host:port),不含尾斜杠;frpc 反代时返反代地址 */
5916
5921
  httpBaseUrl: external_exports.string().optional(),
5917
5922
  /** file-sharing HTTP 路由的 Authorization: Bearer token;与 WS token 解耦,HTTP 401 仅触发 ReAuth 不强踢 WS(spec §11 第 4 条) */
5918
- 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()
5919
5931
  });
5920
5932
  PROJECT_PORT_MIN = 6173;
5921
5933
  PROJECT_PORT_MAX = 6272;
@@ -6996,8 +7008,8 @@ var require_req = __commonJS({
6996
7008
  if (req.originalUrl) {
6997
7009
  _req.url = req.originalUrl;
6998
7010
  } else {
6999
- const path75 = req.path;
7000
- _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;
7001
7013
  }
7002
7014
  if (req.query) {
7003
7015
  _req.query = req.query;
@@ -7162,14 +7174,14 @@ var require_redact = __commonJS({
7162
7174
  }
7163
7175
  return obj;
7164
7176
  }
7165
- function parsePath(path75) {
7177
+ function parsePath(path76) {
7166
7178
  const parts = [];
7167
7179
  let current = "";
7168
7180
  let inBrackets = false;
7169
7181
  let inQuotes = false;
7170
7182
  let quoteChar = "";
7171
- for (let i = 0; i < path75.length; i++) {
7172
- const char = path75[i];
7183
+ for (let i = 0; i < path76.length; i++) {
7184
+ const char = path76[i];
7173
7185
  if (!inBrackets && char === ".") {
7174
7186
  if (current) {
7175
7187
  parts.push(current);
@@ -7300,10 +7312,10 @@ var require_redact = __commonJS({
7300
7312
  return current;
7301
7313
  }
7302
7314
  function redactPaths(obj, paths, censor, remove = false) {
7303
- for (const path75 of paths) {
7304
- const parts = parsePath(path75);
7315
+ for (const path76 of paths) {
7316
+ const parts = parsePath(path76);
7305
7317
  if (parts.includes("*")) {
7306
- redactWildcardPath(obj, parts, censor, path75, remove);
7318
+ redactWildcardPath(obj, parts, censor, path76, remove);
7307
7319
  } else {
7308
7320
  if (remove) {
7309
7321
  removeKey(obj, parts);
@@ -7388,8 +7400,8 @@ var require_redact = __commonJS({
7388
7400
  }
7389
7401
  } else {
7390
7402
  if (afterWildcard.includes("*")) {
7391
- const wrappedCensor = typeof censor === "function" ? (value, path75) => {
7392
- const fullPath = [...pathArray.slice(0, pathLength), ...path75];
7403
+ const wrappedCensor = typeof censor === "function" ? (value, path76) => {
7404
+ const fullPath = [...pathArray.slice(0, pathLength), ...path76];
7393
7405
  return censor(value, fullPath);
7394
7406
  } : censor;
7395
7407
  redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
@@ -7424,8 +7436,8 @@ var require_redact = __commonJS({
7424
7436
  return null;
7425
7437
  }
7426
7438
  const pathStructure = /* @__PURE__ */ new Map();
7427
- for (const path75 of pathsToClone) {
7428
- const parts = parsePath(path75);
7439
+ for (const path76 of pathsToClone) {
7440
+ const parts = parsePath(path76);
7429
7441
  let current = pathStructure;
7430
7442
  for (let i = 0; i < parts.length; i++) {
7431
7443
  const part = parts[i];
@@ -7477,24 +7489,24 @@ var require_redact = __commonJS({
7477
7489
  }
7478
7490
  return cloneSelectively(obj, pathStructure);
7479
7491
  }
7480
- function validatePath(path75) {
7481
- if (typeof path75 !== "string") {
7492
+ function validatePath(path76) {
7493
+ if (typeof path76 !== "string") {
7482
7494
  throw new Error("Paths must be (non-empty) strings");
7483
7495
  }
7484
- if (path75 === "") {
7496
+ if (path76 === "") {
7485
7497
  throw new Error("Invalid redaction path ()");
7486
7498
  }
7487
- if (path75.includes("..")) {
7488
- throw new Error(`Invalid redaction path (${path75})`);
7499
+ if (path76.includes("..")) {
7500
+ throw new Error(`Invalid redaction path (${path76})`);
7489
7501
  }
7490
- if (path75.includes(",")) {
7491
- throw new Error(`Invalid redaction path (${path75})`);
7502
+ if (path76.includes(",")) {
7503
+ throw new Error(`Invalid redaction path (${path76})`);
7492
7504
  }
7493
7505
  let bracketCount = 0;
7494
7506
  let inQuotes = false;
7495
7507
  let quoteChar = "";
7496
- for (let i = 0; i < path75.length; i++) {
7497
- const char = path75[i];
7508
+ for (let i = 0; i < path76.length; i++) {
7509
+ const char = path76[i];
7498
7510
  if ((char === '"' || char === "'") && bracketCount > 0) {
7499
7511
  if (!inQuotes) {
7500
7512
  inQuotes = true;
@@ -7508,20 +7520,20 @@ var require_redact = __commonJS({
7508
7520
  } else if (char === "]" && !inQuotes) {
7509
7521
  bracketCount--;
7510
7522
  if (bracketCount < 0) {
7511
- throw new Error(`Invalid redaction path (${path75})`);
7523
+ throw new Error(`Invalid redaction path (${path76})`);
7512
7524
  }
7513
7525
  }
7514
7526
  }
7515
7527
  if (bracketCount !== 0) {
7516
- throw new Error(`Invalid redaction path (${path75})`);
7528
+ throw new Error(`Invalid redaction path (${path76})`);
7517
7529
  }
7518
7530
  }
7519
7531
  function validatePaths(paths) {
7520
7532
  if (!Array.isArray(paths)) {
7521
7533
  throw new TypeError("paths must be an array");
7522
7534
  }
7523
- for (const path75 of paths) {
7524
- validatePath(path75);
7535
+ for (const path76 of paths) {
7536
+ validatePath(path76);
7525
7537
  }
7526
7538
  }
7527
7539
  function slowRedact(options = {}) {
@@ -7689,8 +7701,8 @@ var require_redaction = __commonJS({
7689
7701
  if (shape[k2] === null) {
7690
7702
  o[k2] = (value) => topCensor(value, [k2]);
7691
7703
  } else {
7692
- const wrappedCensor = typeof censor === "function" ? (value, path75) => {
7693
- return censor(value, [k2, ...path75]);
7704
+ const wrappedCensor = typeof censor === "function" ? (value, path76) => {
7705
+ return censor(value, [k2, ...path76]);
7694
7706
  } : censor;
7695
7707
  o[k2] = Redact({
7696
7708
  paths: shape[k2],
@@ -7908,10 +7920,10 @@ var require_atomic_sleep = __commonJS({
7908
7920
  var require_sonic_boom = __commonJS({
7909
7921
  "../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js"(exports2, module2) {
7910
7922
  "use strict";
7911
- var fs66 = require("fs");
7923
+ var fs67 = require("fs");
7912
7924
  var EventEmitter3 = require("events");
7913
7925
  var inherits = require("util").inherits;
7914
- var path75 = require("path");
7926
+ var path76 = require("path");
7915
7927
  var sleep2 = require_atomic_sleep();
7916
7928
  var assert = require("assert");
7917
7929
  var BUSY_WRITE_TIMEOUT = 100;
@@ -7965,20 +7977,20 @@ var require_sonic_boom = __commonJS({
7965
7977
  const mode = sonic.mode;
7966
7978
  if (sonic.sync) {
7967
7979
  try {
7968
- if (sonic.mkdir) fs66.mkdirSync(path75.dirname(file), { recursive: true });
7969
- 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);
7970
7982
  fileOpened(null, fd);
7971
7983
  } catch (err) {
7972
7984
  fileOpened(err);
7973
7985
  throw err;
7974
7986
  }
7975
7987
  } else if (sonic.mkdir) {
7976
- fs66.mkdir(path75.dirname(file), { recursive: true }, (err) => {
7988
+ fs67.mkdir(path76.dirname(file), { recursive: true }, (err) => {
7977
7989
  if (err) return fileOpened(err);
7978
- fs66.open(file, flags, mode, fileOpened);
7990
+ fs67.open(file, flags, mode, fileOpened);
7979
7991
  });
7980
7992
  } else {
7981
- fs66.open(file, flags, mode, fileOpened);
7993
+ fs67.open(file, flags, mode, fileOpened);
7982
7994
  }
7983
7995
  }
7984
7996
  function SonicBoom(opts) {
@@ -8019,8 +8031,8 @@ var require_sonic_boom = __commonJS({
8019
8031
  this.flush = flushBuffer;
8020
8032
  this.flushSync = flushBufferSync;
8021
8033
  this._actualWrite = actualWriteBuffer;
8022
- fsWriteSync = () => fs66.writeSync(this.fd, this._writingBuf);
8023
- 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);
8024
8036
  } else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
8025
8037
  this._writingBuf = "";
8026
8038
  this.write = write;
@@ -8029,15 +8041,15 @@ var require_sonic_boom = __commonJS({
8029
8041
  this._actualWrite = actualWrite;
8030
8042
  fsWriteSync = () => {
8031
8043
  if (Buffer.isBuffer(this._writingBuf)) {
8032
- return fs66.writeSync(this.fd, this._writingBuf);
8044
+ return fs67.writeSync(this.fd, this._writingBuf);
8033
8045
  }
8034
- return fs66.writeSync(this.fd, this._writingBuf, "utf8");
8046
+ return fs67.writeSync(this.fd, this._writingBuf, "utf8");
8035
8047
  };
8036
8048
  fsWrite = () => {
8037
8049
  if (Buffer.isBuffer(this._writingBuf)) {
8038
- return fs66.write(this.fd, this._writingBuf, this.release);
8050
+ return fs67.write(this.fd, this._writingBuf, this.release);
8039
8051
  }
8040
- return fs66.write(this.fd, this._writingBuf, "utf8", this.release);
8052
+ return fs67.write(this.fd, this._writingBuf, "utf8", this.release);
8041
8053
  };
8042
8054
  } else {
8043
8055
  throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
@@ -8094,7 +8106,7 @@ var require_sonic_boom = __commonJS({
8094
8106
  }
8095
8107
  }
8096
8108
  if (this._fsync) {
8097
- fs66.fsyncSync(this.fd);
8109
+ fs67.fsyncSync(this.fd);
8098
8110
  }
8099
8111
  const len = this._len;
8100
8112
  if (this._reopening) {
@@ -8208,7 +8220,7 @@ var require_sonic_boom = __commonJS({
8208
8220
  const onDrain = () => {
8209
8221
  if (!this._fsync) {
8210
8222
  try {
8211
- fs66.fsync(this.fd, (err) => {
8223
+ fs67.fsync(this.fd, (err) => {
8212
8224
  this._flushPending = false;
8213
8225
  cb(err);
8214
8226
  });
@@ -8310,7 +8322,7 @@ var require_sonic_boom = __commonJS({
8310
8322
  const fd = this.fd;
8311
8323
  this.once("ready", () => {
8312
8324
  if (fd !== this.fd) {
8313
- fs66.close(fd, (err) => {
8325
+ fs67.close(fd, (err) => {
8314
8326
  if (err) {
8315
8327
  return this.emit("error", err);
8316
8328
  }
@@ -8359,7 +8371,7 @@ var require_sonic_boom = __commonJS({
8359
8371
  buf = this._bufs[0];
8360
8372
  }
8361
8373
  try {
8362
- 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");
8363
8375
  const releasedBufObj = releaseWritingBuf(buf, this._len, n);
8364
8376
  buf = releasedBufObj.writingBuf;
8365
8377
  this._len = releasedBufObj.len;
@@ -8375,7 +8387,7 @@ var require_sonic_boom = __commonJS({
8375
8387
  }
8376
8388
  }
8377
8389
  try {
8378
- fs66.fsyncSync(this.fd);
8390
+ fs67.fsyncSync(this.fd);
8379
8391
  } catch {
8380
8392
  }
8381
8393
  }
@@ -8396,7 +8408,7 @@ var require_sonic_boom = __commonJS({
8396
8408
  buf = mergeBuf(this._bufs[0], this._lens[0]);
8397
8409
  }
8398
8410
  try {
8399
- const n = fs66.writeSync(this.fd, buf);
8411
+ const n = fs67.writeSync(this.fd, buf);
8400
8412
  buf = buf.subarray(n);
8401
8413
  this._len = Math.max(this._len - n, 0);
8402
8414
  if (buf.length <= 0) {
@@ -8424,13 +8436,13 @@ var require_sonic_boom = __commonJS({
8424
8436
  this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
8425
8437
  if (this.sync) {
8426
8438
  try {
8427
- 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");
8428
8440
  release(null, written);
8429
8441
  } catch (err) {
8430
8442
  release(err);
8431
8443
  }
8432
8444
  } else {
8433
- fs66.write(this.fd, this._writingBuf, release);
8445
+ fs67.write(this.fd, this._writingBuf, release);
8434
8446
  }
8435
8447
  }
8436
8448
  function actualWriteBuffer() {
@@ -8439,7 +8451,7 @@ var require_sonic_boom = __commonJS({
8439
8451
  this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
8440
8452
  if (this.sync) {
8441
8453
  try {
8442
- const written = fs66.writeSync(this.fd, this._writingBuf);
8454
+ const written = fs67.writeSync(this.fd, this._writingBuf);
8443
8455
  release(null, written);
8444
8456
  } catch (err) {
8445
8457
  release(err);
@@ -8448,7 +8460,7 @@ var require_sonic_boom = __commonJS({
8448
8460
  if (kCopyBuffer) {
8449
8461
  this._writingBuf = Buffer.from(this._writingBuf);
8450
8462
  }
8451
- fs66.write(this.fd, this._writingBuf, release);
8463
+ fs67.write(this.fd, this._writingBuf, release);
8452
8464
  }
8453
8465
  }
8454
8466
  function actualClose(sonic) {
@@ -8464,12 +8476,12 @@ var require_sonic_boom = __commonJS({
8464
8476
  sonic._lens = [];
8465
8477
  assert(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
8466
8478
  try {
8467
- fs66.fsync(sonic.fd, closeWrapped);
8479
+ fs67.fsync(sonic.fd, closeWrapped);
8468
8480
  } catch {
8469
8481
  }
8470
8482
  function closeWrapped() {
8471
8483
  if (sonic.fd !== 1 && sonic.fd !== 2) {
8472
- fs66.close(sonic.fd, done);
8484
+ fs67.close(sonic.fd, done);
8473
8485
  } else {
8474
8486
  done();
8475
8487
  }
@@ -8726,7 +8738,7 @@ var require_thread_stream = __commonJS({
8726
8738
  var { version: version2 } = require_package();
8727
8739
  var { EventEmitter: EventEmitter3 } = require("events");
8728
8740
  var { Worker } = require("worker_threads");
8729
- var { join: join15 } = require("path");
8741
+ var { join: join16 } = require("path");
8730
8742
  var { pathToFileURL } = require("url");
8731
8743
  var { wait } = require_wait();
8732
8744
  var {
@@ -8762,7 +8774,7 @@ var require_thread_stream = __commonJS({
8762
8774
  function createWorker(stream, opts) {
8763
8775
  const { filename, workerData } = opts;
8764
8776
  const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
8765
- const toExecute = bundlerOverrides["thread-stream-worker"] || join15(__dirname, "lib", "worker.js");
8777
+ const toExecute = bundlerOverrides["thread-stream-worker"] || join16(__dirname, "lib", "worker.js");
8766
8778
  const worker = new Worker(toExecute, {
8767
8779
  ...opts.workerOpts,
8768
8780
  trackUnmanagedFds: false,
@@ -9148,7 +9160,7 @@ var require_transport = __commonJS({
9148
9160
  "use strict";
9149
9161
  var { createRequire } = require("module");
9150
9162
  var getCallers = require_caller();
9151
- var { join: join15, isAbsolute: isAbsolute2, sep: sep3 } = require("path");
9163
+ var { join: join16, isAbsolute: isAbsolute2, sep: sep3 } = require("path");
9152
9164
  var sleep2 = require_atomic_sleep();
9153
9165
  var onExit = require_on_exit_leak_free();
9154
9166
  var ThreadStream = require_thread_stream();
@@ -9211,7 +9223,7 @@ var require_transport = __commonJS({
9211
9223
  throw new Error("only one of target or targets can be specified");
9212
9224
  }
9213
9225
  if (targets) {
9214
- target = bundlerOverrides["pino-worker"] || join15(__dirname, "worker.js");
9226
+ target = bundlerOverrides["pino-worker"] || join16(__dirname, "worker.js");
9215
9227
  options.targets = targets.filter((dest) => dest.target).map((dest) => {
9216
9228
  return {
9217
9229
  ...dest,
@@ -9229,7 +9241,7 @@ var require_transport = __commonJS({
9229
9241
  });
9230
9242
  });
9231
9243
  } else if (pipeline3) {
9232
- target = bundlerOverrides["pino-worker"] || join15(__dirname, "worker.js");
9244
+ target = bundlerOverrides["pino-worker"] || join16(__dirname, "worker.js");
9233
9245
  options.pipelines = [pipeline3.map((dest) => {
9234
9246
  return {
9235
9247
  ...dest,
@@ -9251,7 +9263,7 @@ var require_transport = __commonJS({
9251
9263
  return origin;
9252
9264
  }
9253
9265
  if (origin === "pino/file") {
9254
- return join15(__dirname, "..", "file.js");
9266
+ return join16(__dirname, "..", "file.js");
9255
9267
  }
9256
9268
  let fixTarget2;
9257
9269
  for (const filePath of callers) {
@@ -10241,7 +10253,7 @@ var require_safe_stable_stringify = __commonJS({
10241
10253
  return circularValue;
10242
10254
  }
10243
10255
  let res = "";
10244
- let join15 = ",";
10256
+ let join16 = ",";
10245
10257
  const originalIndentation = indentation;
10246
10258
  if (Array.isArray(value)) {
10247
10259
  if (value.length === 0) {
@@ -10255,7 +10267,7 @@ var require_safe_stable_stringify = __commonJS({
10255
10267
  indentation += spacer;
10256
10268
  res += `
10257
10269
  ${indentation}`;
10258
- join15 = `,
10270
+ join16 = `,
10259
10271
  ${indentation}`;
10260
10272
  }
10261
10273
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -10263,13 +10275,13 @@ ${indentation}`;
10263
10275
  for (; i < maximumValuesToStringify - 1; i++) {
10264
10276
  const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
10265
10277
  res += tmp2 !== void 0 ? tmp2 : "null";
10266
- res += join15;
10278
+ res += join16;
10267
10279
  }
10268
10280
  const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
10269
10281
  res += tmp !== void 0 ? tmp : "null";
10270
10282
  if (value.length - 1 > maximumBreadth) {
10271
10283
  const removedKeys = value.length - maximumBreadth - 1;
10272
- res += `${join15}"... ${getItemCount(removedKeys)} not stringified"`;
10284
+ res += `${join16}"... ${getItemCount(removedKeys)} not stringified"`;
10273
10285
  }
10274
10286
  if (spacer !== "") {
10275
10287
  res += `
@@ -10290,7 +10302,7 @@ ${originalIndentation}`;
10290
10302
  let separator = "";
10291
10303
  if (spacer !== "") {
10292
10304
  indentation += spacer;
10293
- join15 = `,
10305
+ join16 = `,
10294
10306
  ${indentation}`;
10295
10307
  whitespace = " ";
10296
10308
  }
@@ -10304,13 +10316,13 @@ ${indentation}`;
10304
10316
  const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
10305
10317
  if (tmp !== void 0) {
10306
10318
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
10307
- separator = join15;
10319
+ separator = join16;
10308
10320
  }
10309
10321
  }
10310
10322
  if (keyLength > maximumBreadth) {
10311
10323
  const removedKeys = keyLength - maximumBreadth;
10312
10324
  res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
10313
- separator = join15;
10325
+ separator = join16;
10314
10326
  }
10315
10327
  if (spacer !== "" && separator.length > 1) {
10316
10328
  res = `
@@ -10351,7 +10363,7 @@ ${originalIndentation}`;
10351
10363
  }
10352
10364
  const originalIndentation = indentation;
10353
10365
  let res = "";
10354
- let join15 = ",";
10366
+ let join16 = ",";
10355
10367
  if (Array.isArray(value)) {
10356
10368
  if (value.length === 0) {
10357
10369
  return "[]";
@@ -10364,7 +10376,7 @@ ${originalIndentation}`;
10364
10376
  indentation += spacer;
10365
10377
  res += `
10366
10378
  ${indentation}`;
10367
- join15 = `,
10379
+ join16 = `,
10368
10380
  ${indentation}`;
10369
10381
  }
10370
10382
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -10372,13 +10384,13 @@ ${indentation}`;
10372
10384
  for (; i < maximumValuesToStringify - 1; i++) {
10373
10385
  const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
10374
10386
  res += tmp2 !== void 0 ? tmp2 : "null";
10375
- res += join15;
10387
+ res += join16;
10376
10388
  }
10377
10389
  const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
10378
10390
  res += tmp !== void 0 ? tmp : "null";
10379
10391
  if (value.length - 1 > maximumBreadth) {
10380
10392
  const removedKeys = value.length - maximumBreadth - 1;
10381
- res += `${join15}"... ${getItemCount(removedKeys)} not stringified"`;
10393
+ res += `${join16}"... ${getItemCount(removedKeys)} not stringified"`;
10382
10394
  }
10383
10395
  if (spacer !== "") {
10384
10396
  res += `
@@ -10391,7 +10403,7 @@ ${originalIndentation}`;
10391
10403
  let whitespace = "";
10392
10404
  if (spacer !== "") {
10393
10405
  indentation += spacer;
10394
- join15 = `,
10406
+ join16 = `,
10395
10407
  ${indentation}`;
10396
10408
  whitespace = " ";
10397
10409
  }
@@ -10400,7 +10412,7 @@ ${indentation}`;
10400
10412
  const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
10401
10413
  if (tmp !== void 0) {
10402
10414
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
10403
- separator = join15;
10415
+ separator = join16;
10404
10416
  }
10405
10417
  }
10406
10418
  if (spacer !== "" && separator.length > 1) {
@@ -10458,20 +10470,20 @@ ${originalIndentation}`;
10458
10470
  indentation += spacer;
10459
10471
  let res2 = `
10460
10472
  ${indentation}`;
10461
- const join16 = `,
10473
+ const join17 = `,
10462
10474
  ${indentation}`;
10463
10475
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
10464
10476
  let i = 0;
10465
10477
  for (; i < maximumValuesToStringify - 1; i++) {
10466
10478
  const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
10467
10479
  res2 += tmp2 !== void 0 ? tmp2 : "null";
10468
- res2 += join16;
10480
+ res2 += join17;
10469
10481
  }
10470
10482
  const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
10471
10483
  res2 += tmp !== void 0 ? tmp : "null";
10472
10484
  if (value.length - 1 > maximumBreadth) {
10473
10485
  const removedKeys = value.length - maximumBreadth - 1;
10474
- res2 += `${join16}"... ${getItemCount(removedKeys)} not stringified"`;
10486
+ res2 += `${join17}"... ${getItemCount(removedKeys)} not stringified"`;
10475
10487
  }
10476
10488
  res2 += `
10477
10489
  ${originalIndentation}`;
@@ -10487,16 +10499,16 @@ ${originalIndentation}`;
10487
10499
  return '"[Object]"';
10488
10500
  }
10489
10501
  indentation += spacer;
10490
- const join15 = `,
10502
+ const join16 = `,
10491
10503
  ${indentation}`;
10492
10504
  let res = "";
10493
10505
  let separator = "";
10494
10506
  let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
10495
10507
  if (isTypedArrayWithEntries(value)) {
10496
- res += stringifyTypedArray(value, join15, maximumBreadth);
10508
+ res += stringifyTypedArray(value, join16, maximumBreadth);
10497
10509
  keys = keys.slice(value.length);
10498
10510
  maximumPropertiesToStringify -= value.length;
10499
- separator = join15;
10511
+ separator = join16;
10500
10512
  }
10501
10513
  if (deterministic) {
10502
10514
  keys = sort(keys, comparator);
@@ -10507,13 +10519,13 @@ ${indentation}`;
10507
10519
  const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
10508
10520
  if (tmp !== void 0) {
10509
10521
  res += `${separator}${strEscape(key2)}: ${tmp}`;
10510
- separator = join15;
10522
+ separator = join16;
10511
10523
  }
10512
10524
  }
10513
10525
  if (keyLength > maximumBreadth) {
10514
10526
  const removedKeys = keyLength - maximumBreadth;
10515
10527
  res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
10516
- separator = join15;
10528
+ separator = join16;
10517
10529
  }
10518
10530
  if (separator !== "") {
10519
10531
  res = `
@@ -11604,11 +11616,11 @@ var init_lib = __esm({
11604
11616
  }
11605
11617
  }
11606
11618
  },
11607
- addToPath: function addToPath(path75, added, removed, oldPosInc, options) {
11608
- var last = path75.lastComponent;
11619
+ addToPath: function addToPath(path76, added, removed, oldPosInc, options) {
11620
+ var last = path76.lastComponent;
11609
11621
  if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
11610
11622
  return {
11611
- oldPos: path75.oldPos + oldPosInc,
11623
+ oldPos: path76.oldPos + oldPosInc,
11612
11624
  lastComponent: {
11613
11625
  count: last.count + 1,
11614
11626
  added,
@@ -11618,7 +11630,7 @@ var init_lib = __esm({
11618
11630
  };
11619
11631
  } else {
11620
11632
  return {
11621
- oldPos: path75.oldPos + oldPosInc,
11633
+ oldPos: path76.oldPos + oldPosInc,
11622
11634
  lastComponent: {
11623
11635
  count: 1,
11624
11636
  added,
@@ -12127,10 +12139,10 @@ function attachmentToHistoryMessage(o, ts) {
12127
12139
  const memories = raw.map((m2) => {
12128
12140
  if (!m2 || typeof m2 !== "object") return null;
12129
12141
  const rec3 = m2;
12130
- const path75 = typeof rec3.path === "string" ? rec3.path : null;
12142
+ const path76 = typeof rec3.path === "string" ? rec3.path : null;
12131
12143
  const content = typeof rec3.content === "string" ? rec3.content : null;
12132
- if (!path75 || content == null) return null;
12133
- const entry = { path: path75, content };
12144
+ if (!path76 || content == null) return null;
12145
+ const entry = { path: path76, content };
12134
12146
  if (typeof rec3.mtimeMs === "number") entry.mtimeMs = rec3.mtimeMs;
12135
12147
  return entry;
12136
12148
  }).filter((m2) => m2 !== null);
@@ -12933,10 +12945,10 @@ function parseAttachment(obj) {
12933
12945
  const memories = raw.map((m2) => {
12934
12946
  if (!m2 || typeof m2 !== "object") return null;
12935
12947
  const rec3 = m2;
12936
- const path75 = typeof rec3.path === "string" ? rec3.path : null;
12948
+ const path76 = typeof rec3.path === "string" ? rec3.path : null;
12937
12949
  const content = typeof rec3.content === "string" ? rec3.content : null;
12938
- if (!path75 || content == null) return null;
12939
- const out = { path: path75, content };
12950
+ if (!path76 || content == null) return null;
12951
+ const out = { path: path76, content };
12940
12952
  if (typeof rec3.mtimeMs === "number") out.mtimeMs = rec3.mtimeMs;
12941
12953
  return out;
12942
12954
  }).filter((m2) => m2 !== null);
@@ -27313,8 +27325,8 @@ var require_CronFileParser = __commonJS({
27313
27325
  * @throws If file cannot be read
27314
27326
  */
27315
27327
  static parseFileSync(filePath) {
27316
- const { readFileSync: readFileSync6 } = require("fs");
27317
- const data = readFileSync6(filePath, "utf8");
27328
+ const { readFileSync: readFileSync7 } = require("fs");
27329
+ const data = readFileSync7(filePath, "utf8");
27318
27330
  return _CronFileParser.#parseContent(data);
27319
27331
  }
27320
27332
  /**
@@ -31315,7 +31327,7 @@ var require_BufferList = __commonJS({
31315
31327
  this.head = this.tail = null;
31316
31328
  this.length = 0;
31317
31329
  };
31318
- BufferList.prototype.join = function join15(s) {
31330
+ BufferList.prototype.join = function join16(s) {
31319
31331
  if (this.length === 0) return "";
31320
31332
  var p2 = this.head;
31321
31333
  var ret = "" + p2.data;
@@ -33905,8 +33917,8 @@ var require_utils = __commonJS({
33905
33917
  var result = transform[inputType][outputType](input);
33906
33918
  return result;
33907
33919
  };
33908
- exports2.resolve = function(path75) {
33909
- var parts = path75.split("/");
33920
+ exports2.resolve = function(path76) {
33921
+ var parts = path76.split("/");
33910
33922
  var result = [];
33911
33923
  for (var index = 0; index < parts.length; index++) {
33912
33924
  var part = parts[index];
@@ -39759,18 +39771,18 @@ var require_object = __commonJS({
39759
39771
  var object = new ZipObject(name, zipObjectContent, o);
39760
39772
  this.files[name] = object;
39761
39773
  };
39762
- var parentFolder = function(path75) {
39763
- if (path75.slice(-1) === "/") {
39764
- 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);
39765
39777
  }
39766
- var lastSlash = path75.lastIndexOf("/");
39767
- return lastSlash > 0 ? path75.substring(0, lastSlash) : "";
39778
+ var lastSlash = path76.lastIndexOf("/");
39779
+ return lastSlash > 0 ? path76.substring(0, lastSlash) : "";
39768
39780
  };
39769
- var forceTrailingSlash = function(path75) {
39770
- if (path75.slice(-1) !== "/") {
39771
- path75 += "/";
39781
+ var forceTrailingSlash = function(path76) {
39782
+ if (path76.slice(-1) !== "/") {
39783
+ path76 += "/";
39772
39784
  }
39773
- return path75;
39785
+ return path76;
39774
39786
  };
39775
39787
  var folderAdd = function(name, createFolders) {
39776
39788
  createFolders = typeof createFolders !== "undefined" ? createFolders : defaults.createFolders;
@@ -47236,8 +47248,8 @@ function turnStartInput(text) {
47236
47248
  const items = [];
47237
47249
  let leftover = text;
47238
47250
  for (const m2 of text.matchAll(SKILL_RE)) {
47239
- const [marker, name, path75] = m2;
47240
- items.push({ type: "skill", name, path: path75 });
47251
+ const [marker, name, path76] = m2;
47252
+ items.push({ type: "skill", name, path: path76 });
47241
47253
  leftover = leftover.replace(marker, "");
47242
47254
  }
47243
47255
  for (const m2 of text.matchAll(ATTACHMENT_RE2)) {
@@ -50275,13 +50287,13 @@ function mapSkillsListResponse(res) {
50275
50287
  const r = s ?? {};
50276
50288
  const name = str3(r.name);
50277
50289
  if (!name) continue;
50278
- const path75 = str3(r.path);
50290
+ const path76 = str3(r.path);
50279
50291
  const description = str3(r.description);
50280
50292
  const isPlugin = name.includes(":");
50281
50293
  out.push({
50282
50294
  name,
50283
50295
  source: isPlugin ? "plugin" : "project",
50284
- ...path75 ? { path: path75 } : {},
50296
+ ...path76 ? { path: path76 } : {},
50285
50297
  ...description ? { description } : {},
50286
50298
  ...isPlugin ? { plugin: name.split(":")[0] } : {}
50287
50299
  });
@@ -54268,9 +54280,9 @@ var CentralClientError = class extends Error {
54268
54280
  code;
54269
54281
  cause;
54270
54282
  };
54271
- async function centralRequest(opts, path75, init) {
54283
+ async function centralRequest(opts, path76, init) {
54272
54284
  const f = opts.fetchImpl ?? globalThis.fetch;
54273
- const url = `${opts.api.replace(/\/+$/, "")}${path75}`;
54285
+ const url = `${opts.api.replace(/\/+$/, "")}${path76}`;
54274
54286
  const ctrl = new AbortController();
54275
54287
  const timer = setTimeout(() => ctrl.abort(), opts.timeoutMs ?? 15e3);
54276
54288
  let res;
@@ -56210,7 +56222,45 @@ function computeMethodAccess(args) {
56210
56222
  }
56211
56223
 
56212
56224
  // src/version.ts
56213
- 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
+ }
56214
56264
 
56215
56265
  // src/handlers/meta.ts
56216
56266
  function buildReadyFrame(deps, client) {
@@ -56234,6 +56284,7 @@ function buildReadyFrame(deps, client) {
56234
56284
  if (deps.httpToken) fileSharing.httpToken = deps.httpToken;
56235
56285
  }
56236
56286
  const daemonSource = process.env.CLAWD_DAEMON_SOURCE === "ota" ? "ota" : "packaged";
56287
+ const globalCliVersion = probeGlobalCli(process.env.PATH);
56237
56288
  const logShipping = deps.getLogShipping ? deps.getLogShipping() : null;
56238
56289
  return {
56239
56290
  version,
@@ -56245,6 +56296,7 @@ function buildReadyFrame(deps, client) {
56245
56296
  tunnelUrl,
56246
56297
  mode: deps.mode,
56247
56298
  daemonSource,
56299
+ globalCliVersion,
56248
56300
  ...fileSharing,
56249
56301
  ...logShipping ? { logShipping } : {}
56250
56302
  };