@okxweb3/a2a-node 0.1.3 → 0.1.4-beta-520175e226-260702152522

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
@@ -1840,7 +1840,7 @@ var require_path = __commonJS({
1840
1840
  const parts = splitPathRe.exec(truncated);
1841
1841
  return parts ? parts.slice(1) : [];
1842
1842
  }
1843
- function resolve4(...args) {
1843
+ function resolve5(...args) {
1844
1844
  let resolvedPath = "";
1845
1845
  let resolvedAbsolute = false;
1846
1846
  for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
@@ -1876,8 +1876,8 @@ var require_path = __commonJS({
1876
1876
  return arr.slice(start, end - start + 1);
1877
1877
  }
1878
1878
  function relative(from3, to) {
1879
- from3 = resolve4(from3).slice(1);
1880
- to = resolve4(to).slice(1);
1879
+ from3 = resolve5(from3).slice(1);
1880
+ to = resolve5(to).slice(1);
1881
1881
  const fromParts = trim2(from3.split("/"));
1882
1882
  const toParts = trim2(to.split("/"));
1883
1883
  const length2 = Math.min(fromParts.length, toParts.length);
@@ -1913,7 +1913,7 @@ var require_path = __commonJS({
1913
1913
  function isAbsolute2(path) {
1914
1914
  return path.charAt(0) === "/";
1915
1915
  }
1916
- function join20(...args) {
1916
+ function join21(...args) {
1917
1917
  return normalizePath(args.join("/"));
1918
1918
  }
1919
1919
  function dirname6(path) {
@@ -1938,10 +1938,10 @@ var require_path = __commonJS({
1938
1938
  exports2.basename = basename3;
1939
1939
  exports2.dirname = dirname6;
1940
1940
  exports2.isAbsolute = isAbsolute2;
1941
- exports2.join = join20;
1941
+ exports2.join = join21;
1942
1942
  exports2.normalizePath = normalizePath;
1943
1943
  exports2.relative = relative;
1944
- exports2.resolve = resolve4;
1944
+ exports2.resolve = resolve5;
1945
1945
  }
1946
1946
  });
1947
1947
 
@@ -1960,8 +1960,8 @@ var require_syncpromise = __commonJS({
1960
1960
  States2[States2["REJECTED"] = REJECTED] = "REJECTED";
1961
1961
  })(States || (States = {}));
1962
1962
  function resolvedSyncPromise(value) {
1963
- return new SyncPromise((resolve4) => {
1964
- resolve4(value);
1963
+ return new SyncPromise((resolve5) => {
1964
+ resolve5(value);
1965
1965
  });
1966
1966
  }
1967
1967
  function rejectedSyncPromise(reason) {
@@ -1985,15 +1985,15 @@ var require_syncpromise = __commonJS({
1985
1985
  }
1986
1986
  /** JSDoc */
1987
1987
  then(onfulfilled, onrejected) {
1988
- return new _SyncPromise((resolve4, reject) => {
1988
+ return new _SyncPromise((resolve5, reject) => {
1989
1989
  this._handlers.push([
1990
1990
  false,
1991
1991
  (result) => {
1992
1992
  if (!onfulfilled) {
1993
- resolve4(result);
1993
+ resolve5(result);
1994
1994
  } else {
1995
1995
  try {
1996
- resolve4(onfulfilled(result));
1996
+ resolve5(onfulfilled(result));
1997
1997
  } catch (e) {
1998
1998
  reject(e);
1999
1999
  }
@@ -2004,7 +2004,7 @@ var require_syncpromise = __commonJS({
2004
2004
  reject(reason);
2005
2005
  } else {
2006
2006
  try {
2007
- resolve4(onrejected(reason));
2007
+ resolve5(onrejected(reason));
2008
2008
  } catch (e) {
2009
2009
  reject(e);
2010
2010
  }
@@ -2020,7 +2020,7 @@ var require_syncpromise = __commonJS({
2020
2020
  }
2021
2021
  /** JSDoc */
2022
2022
  finally(onfinally) {
2023
- return new _SyncPromise((resolve4, reject) => {
2023
+ return new _SyncPromise((resolve5, reject) => {
2024
2024
  let val;
2025
2025
  let isRejected;
2026
2026
  return this.then(
@@ -2043,7 +2043,7 @@ var require_syncpromise = __commonJS({
2043
2043
  reject(val);
2044
2044
  return;
2045
2045
  }
2046
- resolve4(val);
2046
+ resolve5(val);
2047
2047
  });
2048
2048
  });
2049
2049
  }
@@ -2133,21 +2133,21 @@ var require_promisebuffer = __commonJS({
2133
2133
  return task;
2134
2134
  }
2135
2135
  function drain(timeout) {
2136
- return new syncpromise.SyncPromise((resolve4, reject) => {
2136
+ return new syncpromise.SyncPromise((resolve5, reject) => {
2137
2137
  let counter = buffer2.length;
2138
2138
  if (!counter) {
2139
- return resolve4(true);
2139
+ return resolve5(true);
2140
2140
  }
2141
2141
  const capturedSetTimeout = setTimeout(() => {
2142
2142
  if (timeout && timeout > 0) {
2143
- resolve4(false);
2143
+ resolve5(false);
2144
2144
  }
2145
2145
  }, timeout);
2146
2146
  buffer2.forEach((item) => {
2147
2147
  void syncpromise.resolvedSyncPromise(item).then(() => {
2148
2148
  if (!--counter) {
2149
2149
  clearTimeout(capturedSetTimeout);
2150
- resolve4(true);
2150
+ resolve5(true);
2151
2151
  }
2152
2152
  }, reject);
2153
2153
  });
@@ -3349,17 +3349,17 @@ var require_eventProcessors = __commonJS({
3349
3349
  getGlobalEventProcessors().push(callback);
3350
3350
  }
3351
3351
  function notifyEventProcessors(processors, event, hint, index2 = 0) {
3352
- return new utils.SyncPromise((resolve4, reject) => {
3352
+ return new utils.SyncPromise((resolve5, reject) => {
3353
3353
  const processor = processors[index2];
3354
3354
  if (event === null || typeof processor !== "function") {
3355
- resolve4(event);
3355
+ resolve5(event);
3356
3356
  } else {
3357
3357
  const result = processor({ ...event }, hint);
3358
3358
  (typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__) && processor.id && result === null && utils.logger.log(`Event processor "${processor.id}" dropped event`);
3359
3359
  if (utils.isThenable(result)) {
3360
- void result.then((final) => notifyEventProcessors(processors, final, hint, index2 + 1).then(resolve4)).then(null, reject);
3360
+ void result.then((final) => notifyEventProcessors(processors, final, hint, index2 + 1).then(resolve5)).then(null, reject);
3361
3361
  } else {
3362
- void notifyEventProcessors(processors, result, hint, index2 + 1).then(resolve4).then(null, reject);
3362
+ void notifyEventProcessors(processors, result, hint, index2 + 1).then(resolve5).then(null, reject);
3363
3363
  }
3364
3364
  }
3365
3365
  });
@@ -6513,18 +6513,18 @@ var require_baseclient = __commonJS({
6513
6513
  * `false` otherwise
6514
6514
  */
6515
6515
  _isClientDoneProcessing(timeout) {
6516
- return new utils.SyncPromise((resolve4) => {
6516
+ return new utils.SyncPromise((resolve5) => {
6517
6517
  let ticked = 0;
6518
6518
  const tick = 1;
6519
6519
  const interval = setInterval(() => {
6520
6520
  if (this._numProcessing == 0) {
6521
6521
  clearInterval(interval);
6522
- resolve4(true);
6522
+ resolve5(true);
6523
6523
  } else {
6524
6524
  ticked += tick;
6525
6525
  if (timeout && ticked >= timeout) {
6526
6526
  clearInterval(interval);
6527
- resolve4(false);
6527
+ resolve5(false);
6528
6528
  }
6529
6529
  }
6530
6530
  }, tick);
@@ -11174,12 +11174,12 @@ var require_promisify = __commonJS({
11174
11174
  Object.defineProperty(exports2, "__esModule", { value: true });
11175
11175
  function promisify2(fn) {
11176
11176
  return function(req, opts) {
11177
- return new Promise((resolve4, reject) => {
11177
+ return new Promise((resolve5, reject) => {
11178
11178
  fn.call(this, req, opts, (err2, rtn) => {
11179
11179
  if (err2) {
11180
11180
  reject(err2);
11181
11181
  } else {
11182
- resolve4(rtn);
11182
+ resolve5(rtn);
11183
11183
  }
11184
11184
  });
11185
11185
  });
@@ -11383,7 +11383,7 @@ var require_parse_proxy_response = __commonJS({
11383
11383
  var debug_1 = __importDefault(require_src());
11384
11384
  var debug = debug_1.default("https-proxy-agent:parse-proxy-response");
11385
11385
  function parseProxyResponse(socket) {
11386
- return new Promise((resolve4, reject) => {
11386
+ return new Promise((resolve5, reject) => {
11387
11387
  let buffersLength = 0;
11388
11388
  const buffers = [];
11389
11389
  function read2() {
@@ -11423,7 +11423,7 @@ var require_parse_proxy_response = __commonJS({
11423
11423
  const firstLine = buffered.toString("ascii", 0, buffered.indexOf("\r\n"));
11424
11424
  const statusCode = +firstLine.split(" ")[1];
11425
11425
  debug("got proxy server response: %o", firstLine);
11426
- resolve4({
11426
+ resolve5({
11427
11427
  statusCode,
11428
11428
  buffered
11429
11429
  });
@@ -11444,11 +11444,11 @@ var require_agent = __commonJS({
11444
11444
  "use strict";
11445
11445
  var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) {
11446
11446
  function adopt(value) {
11447
- return value instanceof P2 ? value : new P2(function(resolve4) {
11448
- resolve4(value);
11447
+ return value instanceof P2 ? value : new P2(function(resolve5) {
11448
+ resolve5(value);
11449
11449
  });
11450
11450
  }
11451
- return new (P2 || (P2 = Promise))(function(resolve4, reject) {
11451
+ return new (P2 || (P2 = Promise))(function(resolve5, reject) {
11452
11452
  function fulfilled(value) {
11453
11453
  try {
11454
11454
  step(generator.next(value));
@@ -11464,7 +11464,7 @@ var require_agent = __commonJS({
11464
11464
  }
11465
11465
  }
11466
11466
  function step(result) {
11467
- result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected);
11467
+ result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected);
11468
11468
  }
11469
11469
  step((generator = generator.apply(thisArg, _arguments || [])).next());
11470
11470
  });
@@ -11675,7 +11675,7 @@ var require_http = __commonJS({
11675
11675
  function createRequestExecutor(options, httpModule, agent) {
11676
11676
  const { hostname, pathname, port, protocol, search } = new url.URL(options.url);
11677
11677
  return function makeRequest(request) {
11678
- return new Promise((resolve4, reject) => {
11678
+ return new Promise((resolve5, reject) => {
11679
11679
  let body = streamFromBody(request.body);
11680
11680
  const headers = { ...options.headers };
11681
11681
  if (request.body.length > GZIP_THRESHOLD) {
@@ -11701,7 +11701,7 @@ var require_http = __commonJS({
11701
11701
  res.setEncoding("utf8");
11702
11702
  const retryAfterHeader = _nullishCoalesce(res.headers["retry-after"], () => null);
11703
11703
  const rateLimitsHeader = _nullishCoalesce(res.headers["x-sentry-rate-limits"], () => null);
11704
- resolve4({
11704
+ resolve5({
11705
11705
  statusCode: res.statusCode,
11706
11706
  headers: {
11707
11707
  "retry-after": retryAfterHeader,
@@ -11969,7 +11969,7 @@ var require_websocket = __commonJS({
11969
11969
  };
11970
11970
  async function createWebSocketClient(rawUrl) {
11971
11971
  const parts = url.parse(rawUrl);
11972
- return new Promise((resolve4, reject) => {
11972
+ return new Promise((resolve5, reject) => {
11973
11973
  const key = crypto3.randomBytes(16).toString("base64");
11974
11974
  const digest2 = createKey(key);
11975
11975
  const req = http2.request({
@@ -12000,7 +12000,7 @@ var require_websocket = __commonJS({
12000
12000
  return;
12001
12001
  }
12002
12002
  const client = new WebSocketInterface(socket);
12003
- resolve4(client);
12003
+ resolve5(client);
12004
12004
  });
12005
12005
  req.on("error", (err2) => {
12006
12006
  reject(err2);
@@ -13329,10 +13329,10 @@ var require_contextlines = __commonJS({
13329
13329
  var FILE_CONTENT_CACHE = new lru_map.LRUMap(100);
13330
13330
  var DEFAULT_LINES_OF_CONTEXT = 7;
13331
13331
  function readTextFileAsync(path) {
13332
- return new Promise((resolve4, reject) => {
13332
+ return new Promise((resolve5, reject) => {
13333
13333
  fs.readFile(path, "utf8", (err2, data) => {
13334
13334
  if (err2) reject(err2);
13335
- else resolve4(data);
13335
+ else resolve5(data);
13336
13336
  });
13337
13337
  });
13338
13338
  }
@@ -13642,13 +13642,13 @@ var require_context = __commonJS({
13642
13642
  version: `10.${Number(os.release().split(".")[0]) - 4}`
13643
13643
  };
13644
13644
  try {
13645
- const output = await new Promise((resolve4, reject) => {
13645
+ const output = await new Promise((resolve5, reject) => {
13646
13646
  child_process.execFile("/usr/bin/sw_vers", (error, stdout) => {
13647
13647
  if (error) {
13648
13648
  reject(error);
13649
13649
  return;
13650
13650
  }
13651
- resolve4(stdout);
13651
+ resolve5(stdout);
13652
13652
  });
13653
13653
  });
13654
13654
  darwinInfo.name = matchFirst(/^ProductName:\s+(.*)$/m, output);
@@ -18753,8 +18753,8 @@ var require_util2 = __commonJS({
18753
18753
  function createDeferredPromise() {
18754
18754
  let res;
18755
18755
  let rej;
18756
- const promise = new Promise((resolve4, reject) => {
18757
- res = resolve4;
18756
+ const promise = new Promise((resolve5, reject) => {
18757
+ res = resolve5;
18758
18758
  rej = reject;
18759
18759
  });
18760
18760
  return { promise, resolve: res, reject: rej };
@@ -20258,8 +20258,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
20258
20258
  });
20259
20259
  }
20260
20260
  });
20261
- const busboyResolve = new Promise((resolve4, reject) => {
20262
- busboy.on("finish", resolve4);
20261
+ const busboyResolve = new Promise((resolve5, reject) => {
20262
+ busboy.on("finish", resolve5);
20263
20263
  busboy.on("error", (err2) => reject(new TypeError(err2)));
20264
20264
  });
20265
20265
  if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk);
@@ -20793,9 +20793,9 @@ var require_dispatcher_base = __commonJS({
20793
20793
  }
20794
20794
  close(callback) {
20795
20795
  if (callback === void 0) {
20796
- return new Promise((resolve4, reject) => {
20796
+ return new Promise((resolve5, reject) => {
20797
20797
  this.close((err2, data) => {
20798
- return err2 ? reject(err2) : resolve4(data);
20798
+ return err2 ? reject(err2) : resolve5(data);
20799
20799
  });
20800
20800
  });
20801
20801
  }
@@ -20833,12 +20833,12 @@ var require_dispatcher_base = __commonJS({
20833
20833
  err2 = null;
20834
20834
  }
20835
20835
  if (callback === void 0) {
20836
- return new Promise((resolve4, reject) => {
20836
+ return new Promise((resolve5, reject) => {
20837
20837
  this.destroy(err2, (err3, data) => {
20838
20838
  return err3 ? (
20839
20839
  /* istanbul ignore next: should never error */
20840
20840
  reject(err3)
20841
- ) : resolve4(data);
20841
+ ) : resolve5(data);
20842
20842
  });
20843
20843
  });
20844
20844
  }
@@ -21898,16 +21898,16 @@ var require_client2 = __commonJS({
21898
21898
  return this[kNeedDrain] < 2;
21899
21899
  }
21900
21900
  async [kClose]() {
21901
- return new Promise((resolve4) => {
21901
+ return new Promise((resolve5) => {
21902
21902
  if (!this[kSize]) {
21903
- resolve4(null);
21903
+ resolve5(null);
21904
21904
  } else {
21905
- this[kClosedResolve] = resolve4;
21905
+ this[kClosedResolve] = resolve5;
21906
21906
  }
21907
21907
  });
21908
21908
  }
21909
21909
  async [kDestroy](err2) {
21910
- return new Promise((resolve4) => {
21910
+ return new Promise((resolve5) => {
21911
21911
  const requests = this[kQueue].splice(this[kPendingIdx]);
21912
21912
  for (let i = 0; i < requests.length; i++) {
21913
21913
  const request = requests[i];
@@ -21918,7 +21918,7 @@ var require_client2 = __commonJS({
21918
21918
  this[kClosedResolve]();
21919
21919
  this[kClosedResolve] = null;
21920
21920
  }
21921
- resolve4();
21921
+ resolve5();
21922
21922
  };
21923
21923
  if (this[kHTTP2Session] != null) {
21924
21924
  util.destroy(this[kHTTP2Session], err2);
@@ -22498,7 +22498,7 @@ var require_client2 = __commonJS({
22498
22498
  });
22499
22499
  }
22500
22500
  try {
22501
- const socket = await new Promise((resolve4, reject) => {
22501
+ const socket = await new Promise((resolve5, reject) => {
22502
22502
  client[kConnector]({
22503
22503
  host,
22504
22504
  hostname,
@@ -22510,7 +22510,7 @@ var require_client2 = __commonJS({
22510
22510
  if (err2) {
22511
22511
  reject(err2);
22512
22512
  } else {
22513
- resolve4(socket2);
22513
+ resolve5(socket2);
22514
22514
  }
22515
22515
  });
22516
22516
  });
@@ -23134,12 +23134,12 @@ upgrade: ${upgrade}\r
23134
23134
  cb();
23135
23135
  }
23136
23136
  }
23137
- const waitForDrain = () => new Promise((resolve4, reject) => {
23137
+ const waitForDrain = () => new Promise((resolve5, reject) => {
23138
23138
  assert(callback === null);
23139
23139
  if (socket[kError]) {
23140
23140
  reject(socket[kError]);
23141
23141
  } else {
23142
- callback = resolve4;
23142
+ callback = resolve5;
23143
23143
  }
23144
23144
  });
23145
23145
  if (client[kHTTPConnVersion] === "h2") {
@@ -23484,8 +23484,8 @@ var require_pool_base = __commonJS({
23484
23484
  if (this[kQueue].isEmpty()) {
23485
23485
  return Promise.all(this[kClients].map((c) => c.close()));
23486
23486
  } else {
23487
- return new Promise((resolve4) => {
23488
- this[kClosedResolve] = resolve4;
23487
+ return new Promise((resolve5) => {
23488
+ this[kClosedResolve] = resolve5;
23489
23489
  });
23490
23490
  }
23491
23491
  }
@@ -24063,7 +24063,7 @@ var require_readable = __commonJS({
24063
24063
  if (this.closed) {
24064
24064
  return Promise.resolve(null);
24065
24065
  }
24066
- return new Promise((resolve4, reject) => {
24066
+ return new Promise((resolve5, reject) => {
24067
24067
  const signalListenerCleanup = signal ? util.addAbortListener(signal, () => {
24068
24068
  this.destroy();
24069
24069
  }) : noop;
@@ -24072,7 +24072,7 @@ var require_readable = __commonJS({
24072
24072
  if (signal && signal.aborted) {
24073
24073
  reject(signal.reason || Object.assign(new Error("The operation was aborted"), { name: "AbortError" }));
24074
24074
  } else {
24075
- resolve4(null);
24075
+ resolve5(null);
24076
24076
  }
24077
24077
  }).on("error", noop).on("data", function(chunk) {
24078
24078
  limit -= chunk.length;
@@ -24094,11 +24094,11 @@ var require_readable = __commonJS({
24094
24094
  throw new TypeError("unusable");
24095
24095
  }
24096
24096
  assert(!stream[kConsume]);
24097
- return new Promise((resolve4, reject) => {
24097
+ return new Promise((resolve5, reject) => {
24098
24098
  stream[kConsume] = {
24099
24099
  type,
24100
24100
  stream,
24101
- resolve: resolve4,
24101
+ resolve: resolve5,
24102
24102
  reject,
24103
24103
  length: 0,
24104
24104
  body: []
@@ -24133,12 +24133,12 @@ var require_readable = __commonJS({
24133
24133
  }
24134
24134
  }
24135
24135
  function consumeEnd(consume2) {
24136
- const { type, body, resolve: resolve4, stream, length: length2 } = consume2;
24136
+ const { type, body, resolve: resolve5, stream, length: length2 } = consume2;
24137
24137
  try {
24138
24138
  if (type === "text") {
24139
- resolve4(toUSVString(Buffer.concat(body)));
24139
+ resolve5(toUSVString(Buffer.concat(body)));
24140
24140
  } else if (type === "json") {
24141
- resolve4(JSON.parse(Buffer.concat(body)));
24141
+ resolve5(JSON.parse(Buffer.concat(body)));
24142
24142
  } else if (type === "arrayBuffer") {
24143
24143
  const dst = new Uint8Array(length2);
24144
24144
  let pos = 0;
@@ -24146,12 +24146,12 @@ var require_readable = __commonJS({
24146
24146
  dst.set(buf, pos);
24147
24147
  pos += buf.byteLength;
24148
24148
  }
24149
- resolve4(dst.buffer);
24149
+ resolve5(dst.buffer);
24150
24150
  } else if (type === "blob") {
24151
24151
  if (!Blob2) {
24152
24152
  Blob2 = require("buffer").Blob;
24153
24153
  }
24154
- resolve4(new Blob2(body, { type: stream[kContentType] }));
24154
+ resolve5(new Blob2(body, { type: stream[kContentType] }));
24155
24155
  }
24156
24156
  consumeFinish(consume2);
24157
24157
  } catch (err2) {
@@ -24406,9 +24406,9 @@ var require_api_request = __commonJS({
24406
24406
  };
24407
24407
  function request(opts, callback) {
24408
24408
  if (callback === void 0) {
24409
- return new Promise((resolve4, reject) => {
24409
+ return new Promise((resolve5, reject) => {
24410
24410
  request.call(this, opts, (err2, data) => {
24411
- return err2 ? reject(err2) : resolve4(data);
24411
+ return err2 ? reject(err2) : resolve5(data);
24412
24412
  });
24413
24413
  });
24414
24414
  }
@@ -24581,9 +24581,9 @@ var require_api_stream = __commonJS({
24581
24581
  };
24582
24582
  function stream(opts, factory, callback) {
24583
24583
  if (callback === void 0) {
24584
- return new Promise((resolve4, reject) => {
24584
+ return new Promise((resolve5, reject) => {
24585
24585
  stream.call(this, opts, factory, (err2, data) => {
24586
- return err2 ? reject(err2) : resolve4(data);
24586
+ return err2 ? reject(err2) : resolve5(data);
24587
24587
  });
24588
24588
  });
24589
24589
  }
@@ -24864,9 +24864,9 @@ var require_api_upgrade = __commonJS({
24864
24864
  };
24865
24865
  function upgrade(opts, callback) {
24866
24866
  if (callback === void 0) {
24867
- return new Promise((resolve4, reject) => {
24867
+ return new Promise((resolve5, reject) => {
24868
24868
  upgrade.call(this, opts, (err2, data) => {
24869
- return err2 ? reject(err2) : resolve4(data);
24869
+ return err2 ? reject(err2) : resolve5(data);
24870
24870
  });
24871
24871
  });
24872
24872
  }
@@ -24955,9 +24955,9 @@ var require_api_connect = __commonJS({
24955
24955
  };
24956
24956
  function connect(opts, callback) {
24957
24957
  if (callback === void 0) {
24958
- return new Promise((resolve4, reject) => {
24958
+ return new Promise((resolve5, reject) => {
24959
24959
  connect.call(this, opts, (err2, data) => {
24960
- return err2 ? reject(err2) : resolve4(data);
24960
+ return err2 ? reject(err2) : resolve5(data);
24961
24961
  });
24962
24962
  });
24963
24963
  }
@@ -28579,7 +28579,7 @@ var require_fetch = __commonJS({
28579
28579
  async function dispatch({ body }) {
28580
28580
  const url = requestCurrentURL(request);
28581
28581
  const agent = fetchParams.controller.dispatcher;
28582
- return new Promise((resolve4, reject) => agent.dispatch(
28582
+ return new Promise((resolve5, reject) => agent.dispatch(
28583
28583
  {
28584
28584
  path: url.pathname + url.search,
28585
28585
  origin: url.origin,
@@ -28655,7 +28655,7 @@ var require_fetch = __commonJS({
28655
28655
  }
28656
28656
  }
28657
28657
  }
28658
- resolve4({
28658
+ resolve5({
28659
28659
  status,
28660
28660
  statusText,
28661
28661
  headersList: headers[kHeadersList],
@@ -28698,7 +28698,7 @@ var require_fetch = __commonJS({
28698
28698
  const val = headersList[n + 1].toString("latin1");
28699
28699
  headers[kHeadersList].append(key, val);
28700
28700
  }
28701
- resolve4({
28701
+ resolve5({
28702
28702
  status,
28703
28703
  statusText: STATUS_CODES[status],
28704
28704
  headersList: headers[kHeadersList],
@@ -29104,7 +29104,7 @@ var require_util4 = __commonJS({
29104
29104
  var { DOMException: DOMException2 } = require_constants3();
29105
29105
  var { serializeAMimeType, parseMIMEType } = require_dataURL();
29106
29106
  var { types } = require("util");
29107
- var { StringDecoder } = require("string_decoder");
29107
+ var { StringDecoder: StringDecoder2 } = require("string_decoder");
29108
29108
  var { btoa: btoa2 } = require("buffer");
29109
29109
  var staticPropertyDescriptors = {
29110
29110
  enumerable: true,
@@ -29195,7 +29195,7 @@ var require_util4 = __commonJS({
29195
29195
  dataURL += serializeAMimeType(parsed);
29196
29196
  }
29197
29197
  dataURL += ";base64,";
29198
- const decoder = new StringDecoder("latin1");
29198
+ const decoder = new StringDecoder2("latin1");
29199
29199
  for (const chunk of bytes) {
29200
29200
  dataURL += btoa2(decoder.write(chunk));
29201
29201
  }
@@ -29224,7 +29224,7 @@ var require_util4 = __commonJS({
29224
29224
  }
29225
29225
  case "BinaryString": {
29226
29226
  let binaryString = "";
29227
- const decoder = new StringDecoder("latin1");
29227
+ const decoder = new StringDecoder2("latin1");
29228
29228
  for (const chunk of bytes) {
29229
29229
  binaryString += decoder.write(chunk);
29230
29230
  }
@@ -32025,11 +32025,11 @@ var require_fetch_pb = __commonJS({
32025
32025
  "use strict";
32026
32026
  var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) {
32027
32027
  function adopt(value) {
32028
- return value instanceof P2 ? value : new P2(function(resolve4) {
32029
- resolve4(value);
32028
+ return value instanceof P2 ? value : new P2(function(resolve5) {
32029
+ resolve5(value);
32030
32030
  });
32031
32031
  }
32032
- return new (P2 || (P2 = Promise))(function(resolve4, reject) {
32032
+ return new (P2 || (P2 = Promise))(function(resolve5, reject) {
32033
32033
  function fulfilled(value) {
32034
32034
  try {
32035
32035
  step(generator.next(value));
@@ -32045,7 +32045,7 @@ var require_fetch_pb = __commonJS({
32045
32045
  }
32046
32046
  }
32047
32047
  function step(result) {
32048
- result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected);
32048
+ result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected);
32049
32049
  }
32050
32050
  step((generator = generator.apply(thisArg, _arguments || [])).next());
32051
32051
  });
@@ -33315,7 +33315,7 @@ var require_aspromise = __commonJS({
33315
33315
  var params = new Array(arguments.length - 1), offset = 0, index2 = 2, pending = true;
33316
33316
  while (index2 < arguments.length)
33317
33317
  params[offset++] = arguments[index2++];
33318
- return new Promise(function executor(resolve4, reject) {
33318
+ return new Promise(function executor(resolve5, reject) {
33319
33319
  params[offset] = function callback(err2) {
33320
33320
  if (pending) {
33321
33321
  pending = false;
@@ -33325,7 +33325,7 @@ var require_aspromise = __commonJS({
33325
33325
  var params2 = new Array(arguments.length - 1), offset2 = 0;
33326
33326
  while (offset2 < params2.length)
33327
33327
  params2[offset2++] = arguments[offset2];
33328
- resolve4.apply(null, params2);
33328
+ resolve5.apply(null, params2);
33329
33329
  }
33330
33330
  }
33331
33331
  };
@@ -42781,7 +42781,7 @@ var require_Observable = __commonJS({
42781
42781
  Observable2.prototype.forEach = function(next, promiseCtor) {
42782
42782
  var _this = this;
42783
42783
  promiseCtor = getPromiseCtor(promiseCtor);
42784
- return new promiseCtor(function(resolve4, reject) {
42784
+ return new promiseCtor(function(resolve5, reject) {
42785
42785
  var subscriber = new Subscriber_1.SafeSubscriber({
42786
42786
  next: function(value) {
42787
42787
  try {
@@ -42792,7 +42792,7 @@ var require_Observable = __commonJS({
42792
42792
  }
42793
42793
  },
42794
42794
  error: reject,
42795
- complete: resolve4
42795
+ complete: resolve5
42796
42796
  });
42797
42797
  _this.subscribe(subscriber);
42798
42798
  });
@@ -42814,14 +42814,14 @@ var require_Observable = __commonJS({
42814
42814
  Observable2.prototype.toPromise = function(promiseCtor) {
42815
42815
  var _this = this;
42816
42816
  promiseCtor = getPromiseCtor(promiseCtor);
42817
- return new promiseCtor(function(resolve4, reject) {
42817
+ return new promiseCtor(function(resolve5, reject) {
42818
42818
  var value;
42819
42819
  _this.subscribe(function(x) {
42820
42820
  return value = x;
42821
42821
  }, function(err2) {
42822
42822
  return reject(err2);
42823
42823
  }, function() {
42824
- return resolve4(value);
42824
+ return resolve5(value);
42825
42825
  });
42826
42826
  });
42827
42827
  };
@@ -43082,11 +43082,11 @@ var require_innerFrom = __commonJS({
43082
43082
  "use strict";
43083
43083
  var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) {
43084
43084
  function adopt(value) {
43085
- return value instanceof P2 ? value : new P2(function(resolve4) {
43086
- resolve4(value);
43085
+ return value instanceof P2 ? value : new P2(function(resolve5) {
43086
+ resolve5(value);
43087
43087
  });
43088
43088
  }
43089
- return new (P2 || (P2 = Promise))(function(resolve4, reject) {
43089
+ return new (P2 || (P2 = Promise))(function(resolve5, reject) {
43090
43090
  function fulfilled(value) {
43091
43091
  try {
43092
43092
  step(generator.next(value));
@@ -43102,7 +43102,7 @@ var require_innerFrom = __commonJS({
43102
43102
  }
43103
43103
  }
43104
43104
  function step(result) {
43105
- result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected);
43105
+ result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected);
43106
43106
  }
43107
43107
  step((generator = generator.apply(thisArg, _arguments || [])).next());
43108
43108
  });
@@ -43184,14 +43184,14 @@ var require_innerFrom = __commonJS({
43184
43184
  }, i);
43185
43185
  function verb(n) {
43186
43186
  i[n] = o[n] && function(v) {
43187
- return new Promise(function(resolve4, reject) {
43188
- v = o[n](v), settle(resolve4, reject, v.done, v.value);
43187
+ return new Promise(function(resolve5, reject) {
43188
+ v = o[n](v), settle(resolve5, reject, v.done, v.value);
43189
43189
  });
43190
43190
  };
43191
43191
  }
43192
- function settle(resolve4, reject, d, v) {
43192
+ function settle(resolve5, reject, d, v) {
43193
43193
  Promise.resolve(v).then(function(v2) {
43194
- resolve4({ value: v2, done: d });
43194
+ resolve5({ value: v2, done: d });
43195
43195
  }, reject);
43196
43196
  }
43197
43197
  };
@@ -64129,13 +64129,13 @@ var init_transactionRequest = __esm({
64129
64129
 
64130
64130
  // ../../node_modules/viem/_esm/utils/promise/withResolvers.js
64131
64131
  function withResolvers() {
64132
- let resolve4 = () => void 0;
64132
+ let resolve5 = () => void 0;
64133
64133
  let reject = () => void 0;
64134
64134
  const promise = new Promise((resolve_, reject_) => {
64135
- resolve4 = resolve_;
64135
+ resolve5 = resolve_;
64136
64136
  reject = reject_;
64137
64137
  });
64138
- return { promise, resolve: resolve4, reject };
64138
+ return { promise, resolve: resolve5, reject };
64139
64139
  }
64140
64140
  var init_withResolvers = __esm({
64141
64141
  "../../node_modules/viem/_esm/utils/promise/withResolvers.js"() {
@@ -64154,8 +64154,8 @@ function createBatchScheduler({ fn, id, shouldSplitBatch, wait: wait3 = 0, sort
64154
64154
  if (sort && Array.isArray(data))
64155
64155
  data.sort(sort);
64156
64156
  for (let i = 0; i < scheduler.length; i++) {
64157
- const { resolve: resolve4 } = scheduler[i];
64158
- resolve4?.([data[i], data]);
64157
+ const { resolve: resolve5 } = scheduler[i];
64158
+ resolve5?.([data[i], data]);
64159
64159
  }
64160
64160
  }).catch((err2) => {
64161
64161
  for (let i = 0; i < scheduler.length; i++) {
@@ -64171,16 +64171,16 @@ function createBatchScheduler({ fn, id, shouldSplitBatch, wait: wait3 = 0, sort
64171
64171
  return {
64172
64172
  flush: flush2,
64173
64173
  async schedule(args) {
64174
- const { promise, resolve: resolve4, reject } = withResolvers();
64174
+ const { promise, resolve: resolve5, reject } = withResolvers();
64175
64175
  const split2 = shouldSplitBatch?.([...getBatchedArgs(), args]);
64176
64176
  if (split2)
64177
64177
  exec2();
64178
64178
  const hasActiveScheduler = getScheduler().length > 0;
64179
64179
  if (hasActiveScheduler) {
64180
- setScheduler({ args, resolve: resolve4, reject });
64180
+ setScheduler({ args, resolve: resolve5, reject });
64181
64181
  return promise;
64182
64182
  }
64183
- setScheduler({ args, resolve: resolve4, reject });
64183
+ setScheduler({ args, resolve: resolve5, reject });
64184
64184
  setTimeout(exec2, wait3);
64185
64185
  return promise;
64186
64186
  }
@@ -67421,7 +67421,7 @@ var require_stream = __commonJS({
67421
67421
  };
67422
67422
  duplex._final = function(callback) {
67423
67423
  if (ws.readyState === ws.CONNECTING) {
67424
- ws.once("open", function open() {
67424
+ ws.once("open", function open2() {
67425
67425
  duplex._final(callback);
67426
67426
  });
67427
67427
  return;
@@ -67442,7 +67442,7 @@ var require_stream = __commonJS({
67442
67442
  };
67443
67443
  duplex._write = function(chunk, encoding, callback) {
67444
67444
  if (ws.readyState === ws.CONNECTING) {
67445
- ws.once("open", function open() {
67445
+ ws.once("open", function open2() {
67446
67446
  duplex._write(chunk, encoding, callback);
67447
67447
  });
67448
67448
  return;
@@ -67938,6 +67938,7 @@ __export(index_exports, {
67938
67938
  SYSTEM_NOTIFICATION_SESSION_KEY: () => SYSTEM_NOTIFICATION_SESSION_KEY,
67939
67939
  SessionStore: () => SessionStore,
67940
67940
  SqliteOutboundBehavior: () => SqliteOutboundBehavior,
67941
+ TASK_NAME: () => TASK_NAME,
67941
67942
  TaskMessageStore: () => TaskMessageStore,
67942
67943
  USER_ATTENTION_CHANGED: () => USER_ATTENTION_CHANGED,
67943
67944
  USER_ATTENTION_WATCHER_SCAN_MS: () => USER_ATTENTION_WATCHER_SCAN_MS,
@@ -67946,6 +67947,7 @@ __export(index_exports, {
67946
67947
  USER_ATTENTION_WATCH_REPLACED_MESSAGE: () => USER_ATTENTION_WATCH_REPLACED_MESSAGE,
67947
67948
  UserCancelledAiProviderSelectionError: () => UserCancelledAiProviderSelectionError,
67948
67949
  XMTP_CLIENT_RECYCLE_INTERVAL_ENV: () => XMTP_CLIENT_RECYCLE_INTERVAL_ENV,
67950
+ assertHermesSetupSupportedOnPlatform: () => assertHermesSetupSupportedOnPlatform,
67949
67951
  bindJobProviderToCurrentDefaultIfMissing: () => bindJobProviderToCurrentDefaultIfMissing,
67950
67952
  bindJobProviderToCurrentRuntimeIfMissing: () => bindJobProviderToCurrentRuntimeIfMissing,
67951
67953
  bindMessageJobProviderToCurrentDefault: () => bindMessageJobProviderToCurrentDefault,
@@ -67953,18 +67955,28 @@ __export(index_exports, {
67953
67955
  buildAgentMessageNotice: () => buildAgentMessageNotice,
67954
67956
  buildAiAdapterCommand: () => buildAiAdapterCommand,
67955
67957
  buildAiProviderEnv: () => buildAiProviderEnv,
67958
+ buildAutostartCmd: () => buildAutostartCmd,
67959
+ buildAutostartVbs: () => buildAutostartVbs,
67956
67960
  buildBackupJobSessionKey: () => buildBackupJobSessionKey,
67957
67961
  buildDispatchSessionKey: () => buildDispatchSessionKey,
67962
+ buildExternalCommandInvocation: () => buildExternalCommandInvocation,
67958
67963
  buildPendingConversationBackupDispatch: () => buildPendingConversationBackupDispatch,
67964
+ buildSchtasksCreateArgs: () => buildSchtasksCreateArgs,
67965
+ buildSchtasksDeleteArgs: () => buildSchtasksDeleteArgs,
67966
+ buildSchtasksEndArgs: () => buildSchtasksEndArgs,
67967
+ buildSchtasksQueryArgs: () => buildSchtasksQueryArgs,
67968
+ buildSchtasksRunArgs: () => buildSchtasksRunArgs,
67959
67969
  buildSessionKey: () => buildSessionKey,
67960
67970
  buildSystemMessageNotice: () => buildSystemMessageNotice,
67961
67971
  buildSystemStoredMessage: () => buildSystemStoredMessage,
67972
+ buildWindowsParentProcessProbe: () => buildWindowsParentProcessProbe,
67962
67973
  callChatInject: () => callChatInject,
67963
67974
  callDeleteSessions: () => callDeleteSessions,
67964
67975
  callOpenClawGateway: () => callOpenClawGateway,
67965
67976
  callSessionsCreate: () => callSessionsCreate,
67966
67977
  callSessionsDelete: () => callSessionsDelete,
67967
67978
  callSessionsSend: () => callSessionsSend,
67979
+ collectCodexCommandCandidates: () => collectCodexCommandCandidates,
67968
67980
  commandExists: () => commandExists,
67969
67981
  createAiToolFailureTracker: () => createAiToolFailureTracker,
67970
67982
  createFileMessageHandler: () => createFileMessageHandler,
@@ -67980,6 +67992,7 @@ __export(index_exports, {
67980
67992
  ensureOpenClawOkxA2aPluginConfig: () => ensureOpenClawOkxA2aPluginConfig,
67981
67993
  extractAiSessionId: () => extractAiSessionId,
67982
67994
  extractXmtpSentAtMs: () => extractXmtpSentAtMs2,
67995
+ followFile: () => followFile,
67983
67996
  getDaemonStatus: () => getDaemonStatus,
67984
67997
  handleXmtpSendCommand: () => handleXmtpSendCommand,
67985
67998
  hasAiRuntimeMarker: () => hasAiRuntimeMarker,
@@ -67992,20 +68005,26 @@ __export(index_exports, {
67992
68005
  isOriginalParentProcessAlive: () => isOriginalParentProcessAlive,
67993
68006
  isPrereleaseVersion: () => isPrereleaseVersion,
67994
68007
  isRetryableOpenClawGatewayError: () => isRetryableOpenClawGatewayError,
68008
+ killProcessTree: () => killProcessTree,
67995
68009
  normalizeAiProvider: () => normalizeAiProvider,
67996
68010
  normalizeHermesOkxA2aPluginConfig: () => normalizeHermesOkxA2aPluginConfig,
67997
68011
  notifyAgentMessageToUserAttention: () => notifyAgentMessageToUserAttention,
67998
68012
  notifySystemMessageToUser: () => notifySystemMessageToUser,
67999
68013
  notifyUserAttentionChanged: () => notifyUserAttentionChanged,
68000
68014
  parsePluginYamlVersion: () => parsePluginYamlVersion,
68015
+ parseWindowsParentProcessJson: () => parseWindowsParentProcessJson,
68016
+ pickOnchainosWin32Candidate: () => pickOnchainosWin32Candidate,
68001
68017
  processFileMessage: () => processFileMessage,
68002
68018
  readAiProviderTimeoutMs: () => readAiProviderTimeoutMs,
68019
+ readLastLines: () => readLastLines,
68020
+ readParentProcessCommandForPlatform: () => readParentProcessCommandForPlatform,
68003
68021
  readUserAttentionWatcherEvent: () => readUserAttentionWatcherEvent,
68004
68022
  registerUserAttentionWatcher: () => registerUserAttentionWatcher,
68005
68023
  removeUserAttentionWatcher: () => removeUserAttentionWatcher,
68006
68024
  resolveAiPermissionPreset: () => resolveAiPermissionPreset,
68007
68025
  resolveAiProviderCommand: () => resolveAiProviderCommand,
68008
68026
  resolveAiProviderForDispatch: () => resolveAiProviderForDispatch,
68027
+ resolveCodexCommandPath: () => resolveCodexCommandPath,
68009
68028
  resolveConfiguredAiProvider: () => resolveConfiguredAiProvider,
68010
68029
  resolveConfiguredAiProviderForJob: () => resolveConfiguredAiProviderForJob,
68011
68030
  resolveDirectCommunicationSessionTarget: () => resolveDirectCommunicationSessionTarget,
@@ -68019,12 +68038,16 @@ __export(index_exports, {
68019
68038
  resolveTaskHome: () => resolveTaskHome,
68020
68039
  resolveTaskPaths: () => resolveTaskPaths,
68021
68040
  resolveUserAttentionIpcPath: () => resolveUserAttentionIpcPath,
68041
+ resolveWindowsAutostartPaths: () => resolveWindowsAutostartPaths,
68022
68042
  resolveXmtpClientRecycleIntervalSec: () => resolveXmtpClientRecycleIntervalSec,
68023
68043
  runAiAdapter: () => runAiAdapter,
68024
68044
  runListener: () => runListener,
68025
68045
  scanUserAttentionWatchers: () => scanUserAttentionWatchers,
68026
68046
  setOpenClawWebSocketFactoryForTests: () => setOpenClawWebSocketFactoryForTests,
68027
68047
  shouldKeepInboundGroupPendingForBuyer: () => shouldKeepInboundGroupPendingForBuyer,
68048
+ shouldRouteThroughWindowsShell: () => shouldRouteThroughWindowsShell,
68049
+ spawnCompat: () => spawnCompat,
68050
+ spawnSyncCompat: () => spawnSyncCompat,
68028
68051
  startCommandProcessor: () => startCommandProcessor,
68029
68052
  startDaemon: () => startDaemon,
68030
68053
  startUserAttentionEventServer: () => startUserAttentionEventServer,
@@ -68034,6 +68057,7 @@ __export(index_exports, {
68034
68057
  subscribeUserAttentionEvents: () => subscribeUserAttentionEvents,
68035
68058
  switchProvider: () => switchProvider,
68036
68059
  toOpenClawGatewaySessionKey: () => toOpenClawGatewaySessionKey,
68060
+ toWindowsInvocation: () => toWindowsInvocation,
68037
68061
  writeAiPermissionPresetToConfig: () => writeAiPermissionPresetToConfig
68038
68062
  });
68039
68063
  module.exports = __toCommonJS(index_exports);
@@ -69541,10 +69565,11 @@ ${route.chatId}
69541
69565
  ${route.threadId ?? ""}`;
69542
69566
  }
69543
69567
  function normalizeGatewayRouteChatType(explicit, parsed, threadId) {
69544
- if (threadId) {
69545
- return "thread";
69568
+ const chatType = parsed || explicit;
69569
+ if (chatType) {
69570
+ return chatType;
69546
69571
  }
69547
- return explicit || parsed || "dm";
69572
+ return threadId ? "thread" : "dm";
69548
69573
  }
69549
69574
  function matchingGatewayRouteFromSessionKey(sessionKey, expected, provider) {
69550
69575
  const parsed = parseGatewayRouteSessionKey(sessionKey, provider);
@@ -69609,7 +69634,8 @@ function parseProviderTelegramRouteSessionKey(provider, platform, scope, rest) {
69609
69634
  return {
69610
69635
  platform,
69611
69636
  chatId: safeDecodeURIComponent(rest[0]),
69612
- ...threadId ? { threadId, chatType: "thread" } : { chatType: scope === "group" ? "group" : "dm" }
69637
+ ...threadId ? { threadId } : {},
69638
+ chatType: scope === "group" ? threadId ? "thread" : "group" : "dm"
69613
69639
  };
69614
69640
  }
69615
69641
  return null;
@@ -69813,15 +69839,15 @@ async function ensureAiWorkspace(paths) {
69813
69839
  return aiWorkingDir;
69814
69840
  }
69815
69841
  async function waitForImmediateExit(child, timeoutMs) {
69816
- return await new Promise((resolve4) => {
69842
+ return await new Promise((resolve5) => {
69817
69843
  let timer;
69818
69844
  const onExit = () => {
69819
69845
  clearTimeout(timer);
69820
- resolve4(true);
69846
+ resolve5(true);
69821
69847
  };
69822
69848
  timer = setTimeout(() => {
69823
69849
  child.off("exit", onExit);
69824
- resolve4(false);
69850
+ resolve5(false);
69825
69851
  }, timeoutMs);
69826
69852
  child.once("exit", onExit);
69827
69853
  });
@@ -69905,6 +69931,9 @@ async function startDaemon(homeDir) {
69905
69931
  const child = (0, import_node_child_process.spawn)(process.execPath, [entry, "run"], {
69906
69932
  cwd: daemonCwd,
69907
69933
  detached: true,
69934
+ // win32: keep the detached daemon from flashing/holding a console window.
69935
+ // Ignored on every non-win32 platform.
69936
+ windowsHide: true,
69908
69937
  env: {
69909
69938
  ...process.env,
69910
69939
  OKX_AGENT_TASK_HOME: paths.homeDir,
@@ -69954,7 +69983,7 @@ async function waitForExit(pid, timeoutMs) {
69954
69983
  if (!isProcessAlive(pid)) {
69955
69984
  return true;
69956
69985
  }
69957
- await new Promise((resolve4) => setTimeout(resolve4, 100));
69986
+ await new Promise((resolve5) => setTimeout(resolve5, 100));
69958
69987
  }
69959
69988
  return !isProcessAlive(pid);
69960
69989
  }
@@ -70127,7 +70156,7 @@ function readReadyTimeoutMs(env) {
70127
70156
  return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_READY_TIMEOUT_MS;
70128
70157
  }
70129
70158
  function sleep(ms) {
70130
- return new Promise((resolve4) => setTimeout(resolve4, ms));
70159
+ return new Promise((resolve5) => setTimeout(resolve5, ms));
70131
70160
  }
70132
70161
 
70133
70162
  // ../core/src/log.ts
@@ -70160,33 +70189,158 @@ function errorWithTimestamp(...args) {
70160
70189
  var import_node_crypto3 = require("node:crypto");
70161
70190
  var import_node_fs7 = require("node:fs");
70162
70191
  var import_promises5 = require("node:fs/promises");
70163
- var import_node_child_process4 = require("node:child_process");
70164
70192
  var import_node_os4 = require("node:os");
70165
- var import_node_path11 = require("node:path");
70193
+ var import_node_path12 = require("node:path");
70166
70194
 
70167
70195
  // src/ai-command.ts
70168
70196
  var import_node_fs4 = require("node:fs");
70169
70197
  var import_node_os2 = require("node:os");
70198
+ var import_node_path7 = require("node:path");
70199
+
70200
+ // src/win-spawn.ts
70201
+ var import_node_child_process2 = require("node:child_process");
70202
+
70203
+ // ../core/src/win-compat.ts
70170
70204
  var import_node_path6 = require("node:path");
70205
+ var WIN_COMPAT_LOG_PREFIX = "[win-compat]";
70206
+ function toWindowsInvocation(command, args, platform = process.platform, comSpec = process.env.ComSpec ?? process.env.COMSPEC) {
70207
+ if (!shouldRouteThroughWindowsShell(command, platform)) {
70208
+ return { command, args, routedThroughWindowsShell: false };
70209
+ }
70210
+ return {
70211
+ command: comSpec || "cmd.exe",
70212
+ args: ["/d", "/s", "/c", buildWindowsShellCommandLine(command, args)],
70213
+ routedThroughWindowsShell: true
70214
+ };
70215
+ }
70216
+ function shouldRouteThroughWindowsShell(command, platform) {
70217
+ if (platform !== "win32") {
70218
+ return false;
70219
+ }
70220
+ const extension = (0, import_node_path6.extname)(command).toLowerCase();
70221
+ return extension !== ".exe" && extension !== ".com";
70222
+ }
70223
+ function buildWindowsShellCommandLine(command, args) {
70224
+ return [command, ...args].map(quoteWindowsShellArg).join(" ");
70225
+ }
70226
+ function quoteWindowsShellArg(value) {
70227
+ if (/^[A-Za-z0-9_@+=:,./\\-]+$/.test(value)) {
70228
+ return value;
70229
+ }
70230
+ return `"${value.replace(/"/g, '\\"')}"`;
70231
+ }
70232
+
70233
+ // src/win-spawn.ts
70234
+ function spawnCompat(command, args, options = {}) {
70235
+ const invocation = toWindowsInvocation(command, args);
70236
+ logSpawnRoute("spawn", command, args, invocation);
70237
+ return (0, import_node_child_process2.spawn)(invocation.command, invocation.args, { windowsHide: true, ...options });
70238
+ }
70239
+ function spawnSyncCompat(command, args, options = {}) {
70240
+ const invocation = toWindowsInvocation(command, args);
70241
+ logSpawnRoute("spawnSync", command, args, invocation);
70242
+ return (0, import_node_child_process2.spawnSync)(invocation.command, invocation.args, { windowsHide: true, ...options });
70243
+ }
70244
+ function killProcessTree(child, signal = "SIGTERM", platform = process.platform) {
70245
+ if (platform === "win32" && typeof child.pid === "number") {
70246
+ const result = (0, import_node_child_process2.spawnSync)("taskkill", ["/pid", String(child.pid), "/t", "/f"], {
70247
+ windowsHide: true,
70248
+ stdio: "ignore"
70249
+ });
70250
+ if (!result.error) {
70251
+ logWithTimestamp(`${WIN_COMPAT_LOG_PREFIX} taskkill /t /f pid=${child.pid}`);
70252
+ return;
70253
+ }
70254
+ logWithTimestamp(
70255
+ `${WIN_COMPAT_LOG_PREFIX} taskkill failed pid=${child.pid}: ${result.error.message}; falling back to child.kill(${signal})`
70256
+ );
70257
+ }
70258
+ child.kill(signal);
70259
+ }
70260
+ function logSpawnRoute(kind, command, args, invocation) {
70261
+ if (!invocation.routedThroughWindowsShell) {
70262
+ return;
70263
+ }
70264
+ logWithTimestamp(
70265
+ `${WIN_COMPAT_LOG_PREFIX} ${kind} route: [${command} ${args.join(" ")}] -> [${invocation.command} ${invocation.args.join(" ")}]`
70266
+ );
70267
+ }
70268
+
70269
+ // src/ai-command.ts
70171
70270
  var DEFAULT_AI_PROVIDER_TIMEOUT_MS = null;
70172
- function resolveAiProviderCommand(provider, env = process.env, storedCommand) {
70271
+ var CODEX_PROBE_TIMEOUT_MS = 1e4;
70272
+ function resolveAiProviderCommand(provider, env = process.env, storedCommand, platform = process.platform) {
70173
70273
  const override = env[`OKX_A2A_AI_${provider.toUpperCase()}_COMMAND`];
70174
70274
  if (override) {
70175
70275
  return override;
70176
70276
  }
70177
- if (storedCommand && commandExists(storedCommand, env)) {
70277
+ if (provider === "codex") {
70278
+ const codex = resolveCodexCommandPath(env, storedCommand, platform);
70279
+ if (codex) {
70280
+ return codex;
70281
+ }
70282
+ }
70283
+ if (storedCommand && commandExists(storedCommand, env, platform)) {
70178
70284
  return storedCommand;
70179
70285
  }
70180
- return resolveCommandPath(provider, env) ?? provider;
70181
- }
70182
- function resolveCommandPath(command, env = process.env) {
70183
- return findExecutable(command, env);
70286
+ return findExecutable(provider, env, platform) ?? provider;
70184
70287
  }
70185
- function commandExists(command, env = process.env) {
70288
+ function commandExists(command, env = process.env, platform = process.platform) {
70289
+ if (platform === "win32" && isCodexCommand(command)) {
70290
+ return resolveCodexCommandPath(env, command, platform) !== null;
70291
+ }
70186
70292
  if (isExecutable(command)) {
70187
70293
  return true;
70188
70294
  }
70189
- return !!findExecutable(command, env);
70295
+ return !!findExecutable(command, env, platform);
70296
+ }
70297
+ function resolveCodexCommandPath(env = process.env, storedCommand, platform = process.platform, probe = probeCodexCommand) {
70298
+ if (platform !== "win32") {
70299
+ return storedCommand && commandExists(storedCommand, env, platform) ? storedCommand : findExecutable("codex", env, platform);
70300
+ }
70301
+ for (const candidate of collectCodexCommandCandidates(env, storedCommand, platform)) {
70302
+ const result = probe(candidate, env, platform);
70303
+ if (result.usable) {
70304
+ return candidate;
70305
+ }
70306
+ }
70307
+ return null;
70308
+ }
70309
+ function collectCodexCommandCandidates(env = process.env, storedCommand, platform = process.platform) {
70310
+ const candidates = [];
70311
+ const seen = /* @__PURE__ */ new Set();
70312
+ const add = (candidate) => {
70313
+ if (!candidate || seen.has(candidate)) {
70314
+ return;
70315
+ }
70316
+ seen.add(candidate);
70317
+ candidates.push(candidate);
70318
+ };
70319
+ if (storedCommand && storedCommand !== "codex") {
70320
+ add(storedCommand);
70321
+ }
70322
+ if (platform !== "win32") {
70323
+ add(findExecutable("codex", env, platform));
70324
+ return candidates;
70325
+ }
70326
+ for (const candidate of localAppDataCodexCandidates(env)) {
70327
+ add(candidate);
70328
+ }
70329
+ const pathCandidates = findExecutableCandidatesOnPath("codex", env.PATH, platform);
70330
+ for (const candidate of pathCandidates.filter((candidate2) => !isWindowsAppsPath(candidate2))) {
70331
+ add(candidate);
70332
+ }
70333
+ const fallbackExecutableCandidates = fallbackCandidates("codex", env, platform).filter(isExecutable);
70334
+ for (const candidate of fallbackExecutableCandidates.filter((candidate2) => !isWindowsAppsPath(candidate2))) {
70335
+ add(candidate);
70336
+ }
70337
+ for (const candidate of pathCandidates.filter(isWindowsAppsPath)) {
70338
+ add(candidate);
70339
+ }
70340
+ for (const candidate of fallbackExecutableCandidates.filter(isWindowsAppsPath)) {
70341
+ add(candidate);
70342
+ }
70343
+ return candidates;
70190
70344
  }
70191
70345
  function readAiProviderTimeoutMs(env = process.env) {
70192
70346
  const raw = env.OKX_A2A_AI_PROVIDER_TIMEOUT_MS ?? env.OKX_AGENT_TASK_AI_PROVIDER_TIMEOUT_MS;
@@ -70213,7 +70367,7 @@ function resolveOkxA2aBinForChild(env) {
70213
70367
  }
70214
70368
  const found = findExecutable("okx-a2a", env);
70215
70369
  if (found) {
70216
- return { bin: found, pathDir: (0, import_node_path6.dirname)(found) };
70370
+ return { bin: found, pathDir: (0, import_node_path7.dirname)(found) };
70217
70371
  }
70218
70372
  const entry = process.argv[1];
70219
70373
  if (entry && /(?:^|[\\/])cli\.js$/.test(entry) && fileExists(entry)) {
@@ -70229,72 +70383,76 @@ function fileExists(filePath) {
70229
70383
  return false;
70230
70384
  }
70231
70385
  }
70232
- function findExecutable(command, env) {
70233
- if ((0, import_node_path6.isAbsolute)(command)) {
70386
+ function findExecutable(command, env, platform = process.platform) {
70387
+ if ((0, import_node_path7.isAbsolute)(command)) {
70234
70388
  return isExecutable(command) ? command : null;
70235
70389
  }
70236
- const fromPath = findExecutableOnPath(command, env.PATH);
70390
+ const fromPath = findExecutableOnPath(command, env.PATH, platform);
70237
70391
  if (fromPath) {
70238
70392
  return fromPath;
70239
70393
  }
70240
- for (const candidate of fallbackCandidates(command, env)) {
70394
+ for (const candidate of fallbackCandidates(command, env, platform)) {
70241
70395
  if (isExecutable(candidate)) {
70242
70396
  return candidate;
70243
70397
  }
70244
70398
  }
70245
70399
  return null;
70246
70400
  }
70247
- function findExecutableOnPath(command, pathValue) {
70401
+ function findExecutableOnPath(command, pathValue, platform = process.platform) {
70402
+ return findExecutableCandidatesOnPath(command, pathValue, platform)[0] ?? null;
70403
+ }
70404
+ function findExecutableCandidatesOnPath(command, pathValue, platform) {
70248
70405
  if (!pathValue) {
70249
- return null;
70406
+ return [];
70250
70407
  }
70251
- for (const dir of pathValue.split(import_node_path6.delimiter).filter(Boolean)) {
70252
- for (const candidate of executableNames(command).map((name2) => (0, import_node_path6.join)(dir, name2))) {
70408
+ const candidates = [];
70409
+ for (const dir of pathValue.split(import_node_path7.delimiter).filter(Boolean)) {
70410
+ for (const candidate of executableNames(command, platform).map((name2) => (0, import_node_path7.join)(dir, name2))) {
70253
70411
  if (isExecutable(candidate)) {
70254
- return candidate;
70412
+ candidates.push(candidate);
70255
70413
  }
70256
70414
  }
70257
70415
  }
70258
- return null;
70416
+ return candidates;
70259
70417
  }
70260
- function fallbackCandidates(command, env) {
70418
+ function fallbackCandidates(command, env, platform = process.platform) {
70261
70419
  const home = (0, import_node_os2.homedir)();
70262
70420
  const dirs = [
70263
- (0, import_node_path6.dirname)(process.execPath),
70264
- (0, import_node_path6.join)(home, ".local", "bin"),
70265
- (0, import_node_path6.join)(home, "Library", "pnpm"),
70421
+ (0, import_node_path7.dirname)(process.execPath),
70422
+ (0, import_node_path7.join)(home, ".local", "bin"),
70423
+ (0, import_node_path7.join)(home, "Library", "pnpm"),
70266
70424
  env.PNPM_HOME,
70267
- (0, import_node_path6.join)(home, ".npm-global", "bin"),
70268
- (0, import_node_path6.join)(home, ".asdf", "shims"),
70425
+ (0, import_node_path7.join)(home, ".npm-global", "bin"),
70426
+ (0, import_node_path7.join)(home, ".asdf", "shims"),
70269
70427
  "/opt/homebrew/bin",
70270
70428
  "/usr/local/bin",
70271
- env.LOCALAPPDATA ? (0, import_node_path6.join)(env.LOCALAPPDATA, "pnpm") : void 0,
70272
- env.APPDATA ? (0, import_node_path6.join)(env.APPDATA, "npm") : void 0
70429
+ env.LOCALAPPDATA ? (0, import_node_path7.join)(env.LOCALAPPDATA, "pnpm") : void 0,
70430
+ env.APPDATA ? (0, import_node_path7.join)(env.APPDATA, "npm") : void 0
70273
70431
  ].filter((dir) => !!dir);
70274
- return dirs.flatMap((dir) => executableNames(command).map((name2) => (0, import_node_path6.join)(dir, name2)));
70432
+ return dirs.flatMap((dir) => executableNames(command, platform).map((name2) => (0, import_node_path7.join)(dir, name2)));
70275
70433
  }
70276
70434
  function providerPathDirs(command, env) {
70277
70435
  return [
70278
- (0, import_node_path6.isAbsolute)(command) ? (0, import_node_path6.dirname)(command) : void 0,
70279
- (0, import_node_path6.dirname)(process.execPath),
70280
- (0, import_node_path6.join)((0, import_node_os2.homedir)(), ".local", "bin"),
70281
- (0, import_node_path6.join)((0, import_node_os2.homedir)(), "Library", "pnpm"),
70436
+ (0, import_node_path7.isAbsolute)(command) ? (0, import_node_path7.dirname)(command) : void 0,
70437
+ (0, import_node_path7.dirname)(process.execPath),
70438
+ (0, import_node_path7.join)((0, import_node_os2.homedir)(), ".local", "bin"),
70439
+ (0, import_node_path7.join)((0, import_node_os2.homedir)(), "Library", "pnpm"),
70282
70440
  env.PNPM_HOME
70283
70441
  ].filter((dir) => !!dir);
70284
70442
  }
70285
70443
  function prependPathDirs(pathValue, dirs) {
70286
70444
  const seen = /* @__PURE__ */ new Set();
70287
- const merged = [...dirs, ...pathValue ? pathValue.split(import_node_path6.delimiter) : []].filter(Boolean).filter((dir) => {
70445
+ const merged = [...dirs, ...pathValue ? pathValue.split(import_node_path7.delimiter) : []].filter(Boolean).filter((dir) => {
70288
70446
  if (seen.has(dir)) {
70289
70447
  return false;
70290
70448
  }
70291
70449
  seen.add(dir);
70292
70450
  return true;
70293
70451
  });
70294
- return merged.join(import_node_path6.delimiter);
70452
+ return merged.join(import_node_path7.delimiter);
70295
70453
  }
70296
- function executableNames(command) {
70297
- if (process.platform !== "win32" || /\.[a-z0-9]+$/i.test(command)) {
70454
+ function executableNames(command, platform = process.platform) {
70455
+ if (platform !== "win32" || /\.[a-z0-9]+$/i.test(command)) {
70298
70456
  return [command];
70299
70457
  }
70300
70458
  return [command, `${command}.cmd`, `${command}.exe`, `${command}.bat`];
@@ -70307,10 +70465,58 @@ function isExecutable(filePath) {
70307
70465
  return false;
70308
70466
  }
70309
70467
  }
70468
+ function localAppDataCodexCandidates(env) {
70469
+ if (!env.LOCALAPPDATA) {
70470
+ return [];
70471
+ }
70472
+ const baseDir = (0, import_node_path7.join)(env.LOCALAPPDATA, "OpenAI", "Codex", "bin");
70473
+ let entries;
70474
+ try {
70475
+ entries = (0, import_node_fs4.readdirSync)(baseDir, { withFileTypes: true });
70476
+ } catch {
70477
+ return [];
70478
+ }
70479
+ return entries.filter((entry) => entry.isDirectory()).map((entry) => {
70480
+ const filePath = (0, import_node_path7.join)(baseDir, entry.name, "codex.exe");
70481
+ try {
70482
+ const stat3 = (0, import_node_fs4.statSync)(filePath);
70483
+ return stat3.isFile() ? { filePath, mtimeMs: stat3.mtimeMs } : null;
70484
+ } catch {
70485
+ return null;
70486
+ }
70487
+ }).filter((entry) => entry !== null).sort((a, b) => b.mtimeMs - a.mtimeMs).map((entry) => entry.filePath);
70488
+ }
70489
+ function probeCodexCommand(command, env, platform) {
70490
+ if (platform !== "win32") {
70491
+ return { usable: true };
70492
+ }
70493
+ const result = spawnSyncCompat(command, ["login", "status"], {
70494
+ env,
70495
+ encoding: "utf8",
70496
+ stdio: ["ignore", "pipe", "pipe"],
70497
+ timeout: CODEX_PROBE_TIMEOUT_MS,
70498
+ windowsHide: true
70499
+ });
70500
+ if (result.error) {
70501
+ const error = result.error;
70502
+ return {
70503
+ usable: false,
70504
+ errorCode: error.code,
70505
+ message: error.message
70506
+ };
70507
+ }
70508
+ return { usable: true };
70509
+ }
70510
+ function isCodexCommand(command) {
70511
+ return /(?:^|[\\/])codex(?:\.(?:cmd|exe|bat))?$/i.test(command);
70512
+ }
70513
+ function isWindowsAppsPath(commandPath) {
70514
+ return /(?:^|[\\/])WindowsApps(?:[\\/]|$)/i.test(commandPath);
70515
+ }
70310
70516
 
70311
70517
  // src/file-store.ts
70312
70518
  var import_promises3 = require("node:fs/promises");
70313
- var import_node_path7 = require("node:path");
70519
+ var import_node_path8 = require("node:path");
70314
70520
  var TaskMessageStore = class {
70315
70521
  paths;
70316
70522
  writeLocks = /* @__PURE__ */ new Map();
@@ -70333,15 +70539,15 @@ var TaskMessageStore = class {
70333
70539
  }
70334
70540
  jobFilePath(jobId, sessionAgentId) {
70335
70541
  if (jobId === BACKUP_JOB_ID) {
70336
- return (0, import_node_path7.join)(this.paths.jobsDir, "back-session.json");
70542
+ return (0, import_node_path8.join)(this.paths.jobsDir, "back-session.json");
70337
70543
  }
70338
70544
  if (sessionAgentId) {
70339
- return (0, import_node_path7.join)(
70545
+ return (0, import_node_path8.join)(
70340
70546
  this.paths.jobsDir,
70341
70547
  `okx-agent-task-${encodeJobIdForFile(jobId)}-${encodeJobIdForFile(sessionAgentId)}.json`
70342
70548
  );
70343
70549
  }
70344
- return (0, import_node_path7.join)(this.paths.jobsDir, `okx-agent-task-${encodeJobIdForFile(jobId)}.json`);
70550
+ return (0, import_node_path8.join)(this.paths.jobsDir, `okx-agent-task-${encodeJobIdForFile(jobId)}.json`);
70345
70551
  }
70346
70552
  append(jobId, message, sessionAgentId) {
70347
70553
  const path = this.jobFilePath(jobId, sessionAgentId);
@@ -70492,7 +70698,7 @@ var TaskMessageStore = class {
70492
70698
  if (!legacy && !(name2.startsWith(prefix) && name2.endsWith(".json"))) {
70493
70699
  continue;
70494
70700
  }
70495
- const path = (0, import_node_path7.join)(this.paths.jobsDir, name2);
70701
+ const path = (0, import_node_path8.join)(this.paths.jobsDir, name2);
70496
70702
  const file = await this.readPath(path);
70497
70703
  if (file?.jobId !== jobId) {
70498
70704
  continue;
@@ -70583,7 +70789,7 @@ function decodeFilePart(value) {
70583
70789
  }
70584
70790
 
70585
70791
  // src/ai-provider.ts
70586
- var import_node_child_process2 = require("node:child_process");
70792
+ var import_node_child_process3 = require("node:child_process");
70587
70793
  var import_promises4 = require("node:readline/promises");
70588
70794
  var import_node_readline = require("node:readline");
70589
70795
  var AI_PROVIDERS = ["codex", "claude", "hermes", "openclaw"];
@@ -70737,11 +70943,17 @@ function hasOpenClawParentProcess(parentPid, readParentProcessCommand2) {
70737
70943
  return false;
70738
70944
  }
70739
70945
  function readParentProcessCommand(pid) {
70740
- const commandResult = (0, import_node_child_process2.spawnSync)("ps", ["-p", String(pid), "-o", "comm="], {
70946
+ return readParentProcessCommandForPlatform(pid, process.platform);
70947
+ }
70948
+ function readParentProcessCommandForPlatform(pid, platform) {
70949
+ if (platform === "win32") {
70950
+ return readWindowsParentProcessCommand(pid);
70951
+ }
70952
+ const commandResult = (0, import_node_child_process3.spawnSync)("ps", ["-p", String(pid), "-o", "comm="], {
70741
70953
  encoding: "utf8",
70742
70954
  stdio: ["ignore", "pipe", "ignore"]
70743
70955
  });
70744
- const parentResult = (0, import_node_child_process2.spawnSync)("ps", ["-p", String(pid), "-o", "ppid="], {
70956
+ const parentResult = (0, import_node_child_process3.spawnSync)("ps", ["-p", String(pid), "-o", "ppid="], {
70745
70957
  encoding: "utf8",
70746
70958
  stdio: ["ignore", "pipe", "ignore"]
70747
70959
  });
@@ -70753,6 +70965,81 @@ function readParentProcessCommand(pid) {
70753
70965
  }
70754
70966
  return { command, parentPid };
70755
70967
  }
70968
+ function buildWindowsParentProcessProbe(pid) {
70969
+ if (!Number.isInteger(pid)) {
70970
+ return null;
70971
+ }
70972
+ return {
70973
+ command: "powershell.exe",
70974
+ args: [
70975
+ "-NoProfile",
70976
+ "-NonInteractive",
70977
+ "-Command",
70978
+ `Get-CimInstance Win32_Process -Filter "ProcessId=${pid}" | Select-Object Name,ParentProcessId | ConvertTo-Json -Compress`
70979
+ ]
70980
+ };
70981
+ }
70982
+ function parseWindowsParentProcessJson(stdout) {
70983
+ const trimmed = stdout.trim();
70984
+ if (!trimmed) {
70985
+ return null;
70986
+ }
70987
+ let parsed;
70988
+ try {
70989
+ parsed = JSON.parse(trimmed);
70990
+ } catch {
70991
+ return null;
70992
+ }
70993
+ const record = Array.isArray(parsed) ? parsed[0] : parsed;
70994
+ if (!record || typeof record !== "object") {
70995
+ return null;
70996
+ }
70997
+ const name2 = record.Name;
70998
+ if (typeof name2 !== "string" || name2.trim() === "") {
70999
+ return null;
71000
+ }
71001
+ const rawParentPid = Number(record.ParentProcessId);
71002
+ const parentPid = Number.isInteger(rawParentPid) && rawParentPid > 0 ? rawParentPid : null;
71003
+ return { command: name2.trim(), parentPid };
71004
+ }
71005
+ function readWindowsParentProcessCommand(pid) {
71006
+ const probe = buildWindowsParentProcessProbe(pid);
71007
+ if (!probe) {
71008
+ errorWithTimestamp(`${WIN_COMPAT_LOG_PREFIX} parent-process probe rejected non-integer pid=${String(pid)}`);
71009
+ return null;
71010
+ }
71011
+ const result = (0, import_node_child_process3.spawnSync)(probe.command, probe.args, {
71012
+ encoding: "utf8",
71013
+ stdio: ["ignore", "pipe", "ignore"],
71014
+ timeout: 5e3,
71015
+ windowsHide: true
71016
+ });
71017
+ if (result.error) {
71018
+ const spawnError = result.error;
71019
+ errorWithTimestamp(
71020
+ `${WIN_COMPAT_LOG_PREFIX} parent-process probe failed pid=${pid} command=${probe.command} errorCode=${spawnError.code ?? "unknown"} error=${spawnError.message}`
71021
+ );
71022
+ return null;
71023
+ }
71024
+ if (result.status !== 0) {
71025
+ errorWithTimestamp(
71026
+ `${WIN_COMPAT_LOG_PREFIX} parent-process probe exited pid=${pid} command=${probe.command} status=${String(result.status)} signal=${String(result.signal)}`
71027
+ );
71028
+ return null;
71029
+ }
71030
+ const stdout = typeof result.stdout === "string" ? result.stdout : "";
71031
+ const parsed = parseWindowsParentProcessJson(stdout);
71032
+ if (!parsed) {
71033
+ errorWithTimestamp(
71034
+ `${WIN_COMPAT_LOG_PREFIX} parent-process probe unparsable output pid=${pid} stdout=${JSON.stringify(stdout.slice(0, 200))}`
71035
+ );
71036
+ return null;
71037
+ }
71038
+ logWithTimestamp(
71039
+ `${WIN_COMPAT_LOG_PREFIX} parent-process probe pid=${pid} -> command=${parsed.command} parentPid=${parsed.parentPid ?? "null"}`
71040
+ );
71041
+ return parsed;
71042
+ }
70756
71043
  async function ensureDefaultAiProvider(options) {
70757
71044
  const env = options.env ?? process.env;
70758
71045
  const commandExists2 = options.commandExists ?? commandExists;
@@ -71296,7 +71583,7 @@ async function promptForAiProviderWithArrows(options) {
71296
71583
  options.stdin.resume();
71297
71584
  options.stdout.write("\x1B[?25l");
71298
71585
  render();
71299
- return await new Promise((resolve4, reject) => {
71586
+ return await new Promise((resolve5, reject) => {
71300
71587
  const cleanup = () => {
71301
71588
  options.stdin.off("keypress", onKeypress);
71302
71589
  options.stdin.setRawMode(false);
@@ -71315,7 +71602,7 @@ async function promptForAiProviderWithArrows(options) {
71315
71602
  clearRendered();
71316
71603
  options.stdout.write(`Selected AI provider: ${provider}
71317
71604
  `);
71318
- resolve4(provider);
71605
+ resolve5(provider);
71319
71606
  };
71320
71607
  const onKeypress = (_str, key) => {
71321
71608
  if (key.ctrl && key.name === "c") {
@@ -71366,13 +71653,12 @@ function parseProviderChoice(answer) {
71366
71653
  }
71367
71654
 
71368
71655
  // src/ai-adapter.ts
71369
- var import_node_child_process3 = require("node:child_process");
71370
71656
  var import_node_os3 = require("node:os");
71371
- var import_node_path9 = require("node:path");
71657
+ var import_node_path10 = require("node:path");
71372
71658
 
71373
71659
  // src/task-config.ts
71374
71660
  var import_node_fs5 = require("node:fs");
71375
- var import_node_path8 = require("node:path");
71661
+ var import_node_path9 = require("node:path");
71376
71662
  var AI_PERMISSION_PRESETS = ["bypass", "auto"];
71377
71663
  var DEFAULT_AI_PERMISSION_PRESET = "bypass";
71378
71664
  function resolveAiPermissionPreset(options = {}) {
@@ -71403,7 +71689,7 @@ function writeAiPermissionPresetToConfig(homeDir, preset) {
71403
71689
  return normalized;
71404
71690
  }
71405
71691
  function resolveTaskConfigPath(homeDir) {
71406
- return (0, import_node_path8.join)(homeDir, "config.toml");
71692
+ return (0, import_node_path9.join)(homeDir, "config.toml");
71407
71693
  }
71408
71694
  function normalizeAiPermissionPreset(value, source) {
71409
71695
  const normalized = value.trim().toLowerCase();
@@ -72094,7 +72380,7 @@ function buildAiAdapterCommand(options) {
72094
72380
  function readCodexAddDirs(env = process.env) {
72095
72381
  const raw = env.OKX_A2A_AI_CODEX_ADD_DIRS ?? env.OKX_AGENT_TASK_CODEX_ADD_DIRS ?? "";
72096
72382
  const seen = /* @__PURE__ */ new Set();
72097
- return raw.split(import_node_path9.delimiter).map((value) => expandHomePath(value.trim())).filter(Boolean).filter((dir) => {
72383
+ return raw.split(import_node_path10.delimiter).map((value) => expandHomePath(value.trim())).filter(Boolean).filter((dir) => {
72098
72384
  if (seen.has(dir)) {
72099
72385
  return false;
72100
72386
  }
@@ -72107,7 +72393,7 @@ function expandHomePath(value) {
72107
72393
  return (0, import_node_os3.homedir)();
72108
72394
  }
72109
72395
  if (value.startsWith("~/")) {
72110
- return (0, import_node_path9.join)((0, import_node_os3.homedir)(), value.slice(2));
72396
+ return (0, import_node_path10.join)((0, import_node_os3.homedir)(), value.slice(2));
72111
72397
  }
72112
72398
  return value;
72113
72399
  }
@@ -72127,7 +72413,7 @@ async function runAiAdapter(options) {
72127
72413
  errorWithTimestamp(
72128
72414
  `[okx-agent-task] AI adapter start provider=${options.provider} command=${built.command} mode=${options.sessionId ? "resume" : "new"} cwd=${options.cwd ?? process.cwd()}`
72129
72415
  );
72130
- const child = (0, import_node_child_process3.spawn)(built.command, built.args, {
72416
+ const child = spawnCompat(built.command, built.args, {
72131
72417
  cwd: options.cwd,
72132
72418
  env: buildAiProviderEnv(built.command, { ...process.env, ...options.env ?? {}, OKX_A2A_IS_CLI: "1" }),
72133
72419
  stdio: ["ignore", "pipe", "pipe"],
@@ -72177,17 +72463,17 @@ async function runAiAdapter(options) {
72177
72463
  const message = `[okx-agent-task] AI adapter timeout provider=${options.provider} timeoutMs=${timeoutMs}; terminating process and preserving partial output
72178
72464
  `;
72179
72465
  stderr += message;
72180
- child.kill("SIGTERM");
72466
+ killProcessTree(child, "SIGTERM");
72181
72467
  setTimeout(() => {
72182
72468
  if (!child.killed || child.exitCode === null) {
72183
- child.kill("SIGKILL");
72469
+ killProcessTree(child, "SIGKILL");
72184
72470
  }
72185
72471
  }, 5e3).unref();
72186
72472
  }, timeoutMs);
72187
72473
  timeout?.unref();
72188
- const exitCode = await new Promise((resolve4, reject) => {
72474
+ const exitCode = await new Promise((resolve5, reject) => {
72189
72475
  child.once("error", reject);
72190
- child.once("close", (code2) => resolve4(code2));
72476
+ child.once("close", (code2) => resolve5(code2));
72191
72477
  });
72192
72478
  if (timeout) {
72193
72479
  clearTimeout(timeout);
@@ -72321,9 +72607,9 @@ function formatOpenClawSessionKey(sessionKey, agentId) {
72321
72607
  function buildClaudeAddDirArgs(homeDir, env) {
72322
72608
  const dirs = [
72323
72609
  homeDir,
72324
- (0, import_node_path9.join)((0, import_node_os3.homedir)(), ".agents"),
72325
- (0, import_node_path9.join)(__dirname, ".."),
72326
- ...env.OKX_A2A_AI_CLAUDE_ADD_DIRS ? env.OKX_A2A_AI_CLAUDE_ADD_DIRS.split(import_node_path9.delimiter).filter(Boolean) : []
72610
+ (0, import_node_path10.join)((0, import_node_os3.homedir)(), ".agents"),
72611
+ (0, import_node_path10.join)(__dirname, ".."),
72612
+ ...env.OKX_A2A_AI_CLAUDE_ADD_DIRS ? env.OKX_A2A_AI_CLAUDE_ADD_DIRS.split(import_node_path10.delimiter).filter(Boolean) : []
72327
72613
  ];
72328
72614
  return ["--add-dir", ...[...new Set(dirs)]];
72329
72615
  }
@@ -72375,20 +72661,20 @@ function applyArgTemplate(template, options) {
72375
72661
  const homeDir = options.homeDir ?? resolveTaskPaths().homeDir;
72376
72662
  const cwd = options.cwd ?? process.cwd();
72377
72663
  return template.map((arg) => {
72378
- return arg.replaceAll("{prompt}", options.prompt).replaceAll("{sessionId}", options.sessionId ?? "").replaceAll("{homeDir}", homeDir).replaceAll("{cwd}", cwd).replaceAll("{repoCli}", (0, import_node_path9.join)(__dirname, "cli.js"));
72664
+ return arg.replaceAll("{prompt}", options.prompt).replaceAll("{sessionId}", options.sessionId ?? "").replaceAll("{homeDir}", homeDir).replaceAll("{cwd}", cwd).replaceAll("{repoCli}", (0, import_node_path10.join)(__dirname, "cli.js"));
72379
72665
  });
72380
72666
  }
72381
72667
 
72382
72668
  // src/user-attention-ipc.ts
72383
72669
  var import_node_fs6 = require("node:fs");
72384
72670
  var import_node_net = require("node:net");
72385
- var import_node_path10 = require("node:path");
72671
+ var import_node_path11 = require("node:path");
72386
72672
  var USER_ATTENTION_CHANGED = "user_attention.changed";
72387
72673
  function resolveUserAttentionIpcPath(homeDir) {
72388
72674
  if (process.platform === "win32") {
72389
72675
  return "\\\\.\\pipe\\okx-a2a-user-attention";
72390
72676
  }
72391
- return (0, import_node_path10.join)(resolveTaskPaths(homeDir).runDir, "user-attention.sock");
72677
+ return (0, import_node_path11.join)(resolveTaskPaths(homeDir).runDir, "user-attention.sock");
72392
72678
  }
72393
72679
  async function startUserAttentionEventServer(options = {}) {
72394
72680
  const path = resolveUserAttentionIpcPath(options.homeDir);
@@ -72423,7 +72709,7 @@ async function startUserAttentionEventServer(options = {}) {
72423
72709
  });
72424
72710
  server.on("error", (err2) => options.onError?.(err2));
72425
72711
  if (process.platform !== "win32") {
72426
- (0, import_node_fs6.mkdirSync)((0, import_node_path10.dirname)(path), { recursive: true });
72712
+ (0, import_node_fs6.mkdirSync)((0, import_node_path11.dirname)(path), { recursive: true });
72427
72713
  try {
72428
72714
  (0, import_node_fs6.unlinkSync)(path);
72429
72715
  } catch (err2) {
@@ -72433,14 +72719,14 @@ async function startUserAttentionEventServer(options = {}) {
72433
72719
  }
72434
72720
  }
72435
72721
  }
72436
- await new Promise((resolve4, reject) => {
72722
+ await new Promise((resolve5, reject) => {
72437
72723
  const onError = (err2) => {
72438
72724
  server.off("listening", onListening);
72439
72725
  reject(err2);
72440
72726
  };
72441
72727
  const onListening = () => {
72442
72728
  server.off("error", onError);
72443
- resolve4();
72729
+ resolve5();
72444
72730
  };
72445
72731
  server.once("error", onError);
72446
72732
  server.once("listening", onListening);
@@ -72455,7 +72741,7 @@ async function startUserAttentionEventServer(options = {}) {
72455
72741
  for (const socket of sockets) {
72456
72742
  socket.destroy();
72457
72743
  }
72458
- return new Promise((resolve4, reject) => {
72744
+ return new Promise((resolve5, reject) => {
72459
72745
  server.close((err2) => {
72460
72746
  if (process.platform !== "win32") {
72461
72747
  try {
@@ -72466,7 +72752,7 @@ async function startUserAttentionEventServer(options = {}) {
72466
72752
  if (err2) {
72467
72753
  reject(err2);
72468
72754
  } else {
72469
- resolve4();
72755
+ resolve5();
72470
72756
  }
72471
72757
  });
72472
72758
  });
@@ -72475,7 +72761,7 @@ async function startUserAttentionEventServer(options = {}) {
72475
72761
  }
72476
72762
  async function subscribeUserAttentionEvents(options) {
72477
72763
  const path = resolveUserAttentionIpcPath(options.homeDir);
72478
- return new Promise((resolve4) => {
72764
+ return new Promise((resolve5) => {
72479
72765
  const socket = (0, import_node_net.createConnection)(path);
72480
72766
  let settled = false;
72481
72767
  let buffer2 = "";
@@ -72484,7 +72770,7 @@ async function subscribeUserAttentionEvents(options) {
72484
72770
  return;
72485
72771
  }
72486
72772
  settled = true;
72487
- resolve4({
72773
+ resolve5({
72488
72774
  path,
72489
72775
  connected,
72490
72776
  close() {
@@ -72516,7 +72802,7 @@ async function subscribeUserAttentionEvents(options) {
72516
72802
  }
72517
72803
  async function notifyUserAttentionChanged(homeDir) {
72518
72804
  const path = resolveUserAttentionIpcPath(homeDir);
72519
- return new Promise((resolve4) => {
72805
+ return new Promise((resolve5) => {
72520
72806
  const socket = (0, import_node_net.createConnection)(path);
72521
72807
  let done = false;
72522
72808
  const finish = (ok) => {
@@ -72525,7 +72811,7 @@ async function notifyUserAttentionChanged(homeDir) {
72525
72811
  }
72526
72812
  done = true;
72527
72813
  socket.destroy();
72528
- resolve4(ok);
72814
+ resolve5(ok);
72529
72815
  };
72530
72816
  socket.setTimeout(1e3, () => finish(false));
72531
72817
  socket.once("connect", () => {
@@ -72596,7 +72882,7 @@ function aiRunSentryExtra(input) {
72596
72882
  closeSignal: input.closeSignal ?? "",
72597
72883
  timedOut: input.timedOut === void 0 ? "" : String(input.timedOut),
72598
72884
  aiSessionId: input.aiSessionId ?? "",
72599
- aiLogFile: input.logPath ? (0, import_node_path11.basename)(input.logPath) : "",
72885
+ aiLogFile: input.logPath ? (0, import_node_path12.basename)(input.logPath) : "",
72600
72886
  commandPendingMs: input.commandPendingMs ?? "",
72601
72887
  queueWaitMs: input.queueWaitMs ?? "",
72602
72888
  cliMs: input.cliMs ?? "",
@@ -72816,7 +73102,7 @@ var AiRunner = class {
72816
73102
  let timedOut = false;
72817
73103
  const timeoutMs = readAiProviderTimeoutMs();
72818
73104
  const spawnStartedAt = Date.now();
72819
- const child = (0, import_node_child_process4.spawn)(command, args, {
73105
+ const child = spawnCompat(command, args, {
72820
73106
  cwd: aiCwd,
72821
73107
  stdio: ["ignore", "pipe", "pipe"],
72822
73108
  env: buildAiProviderEnv(command, {
@@ -72870,17 +73156,17 @@ var AiRunner = class {
72870
73156
  stderrText += message;
72871
73157
  log?.write(message);
72872
73158
  console.error(message.trim());
72873
- child.kill("SIGTERM");
73159
+ killProcessTree(child, "SIGTERM");
72874
73160
  setTimeout(() => {
72875
73161
  if (!child.killed || child.exitCode === null) {
72876
- child.kill("SIGKILL");
73162
+ killProcessTree(child, "SIGKILL");
72877
73163
  }
72878
73164
  }, 5e3).unref();
72879
73165
  }, timeoutMs);
72880
73166
  timeout?.unref();
72881
- const closeResult = await new Promise((resolve4, reject) => {
73167
+ const closeResult = await new Promise((resolve5, reject) => {
72882
73168
  child.once("error", reject);
72883
- child.once("close", (code2, signal) => resolve4({ code: code2, signal }));
73169
+ child.once("close", (code2, signal) => resolve5({ code: code2, signal }));
72884
73170
  });
72885
73171
  if (timeout) {
72886
73172
  clearTimeout(timeout);
@@ -72902,8 +73188,8 @@ var AiRunner = class {
72902
73188
  const sessionWriteMs = sessionWriteEndedAt - sessionWriteStartedAt;
72903
73189
  const logFileCloseStartedAt = Date.now();
72904
73190
  if (log) {
72905
- await new Promise((resolve4) => {
72906
- log.end(resolve4);
73191
+ await new Promise((resolve5) => {
73192
+ log.end(resolve5);
72907
73193
  });
72908
73194
  }
72909
73195
  const logFileCloseEndedAt = Date.now();
@@ -73109,10 +73395,10 @@ var AiRunner = class {
73109
73395
  const safeMessageId = encodeURIComponent(request.messageId);
73110
73396
  if (request.source === "job-dispatch") {
73111
73397
  const safeJobId = encodeURIComponent(request.jobId ?? "unknown");
73112
- return (0, import_node_path11.join)(this.logsDir, `ai-${safeJobId}-${safeMessageId}.log`);
73398
+ return (0, import_node_path12.join)(this.logsDir, `ai-${safeJobId}-${safeMessageId}.log`);
73113
73399
  }
73114
73400
  const safeSessionKey = encodeURIComponent(request.sessionKey);
73115
- return (0, import_node_path11.join)(this.logsDir, `ai-session-${safeSessionKey}-${safeMessageId}.log`);
73401
+ return (0, import_node_path12.join)(this.logsDir, `ai-session-${safeSessionKey}-${safeMessageId}.log`);
73116
73402
  }
73117
73403
  readRunAiSessionId(provider, request, file, sessionMeta) {
73118
73404
  if (request.source === "job-dispatch" && request.jobId) {
@@ -73424,7 +73710,7 @@ var AiRunner = class {
73424
73710
  async appendLlmLog(entry) {
73425
73711
  try {
73426
73712
  ensureTaskDir(this.logsDir);
73427
- await (0, import_promises5.appendFile)((0, import_node_path11.join)(this.logsDir, "llm.log"), formatLlmLogEntry(entry), "utf8");
73713
+ await (0, import_promises5.appendFile)((0, import_node_path12.join)(this.logsDir, "llm.log"), formatLlmLogEntry(entry), "utf8");
73428
73714
  } catch (err2) {
73429
73715
  errorWithTimestamp("[okx-agent-task] failed to append llm.log:", err2);
73430
73716
  }
@@ -73449,7 +73735,7 @@ function aiRunToolFailureSentryExtra(failure, context) {
73449
73735
  closeSignal: context.closeSignal ?? "",
73450
73736
  timedOut: String(context.timedOut),
73451
73737
  aiSessionId: context.aiSessionId ?? "",
73452
- aiLogFile: (0, import_node_path11.basename)(context.logPath)
73738
+ aiLogFile: (0, import_node_path12.basename)(context.logPath)
73453
73739
  }).filter(([, value]) => value !== "");
73454
73740
  return entries.reduce((out, [key, value]) => {
73455
73741
  out[key] = String(value);
@@ -73765,9 +74051,9 @@ function getPreferredCodexWritableRoot(target) {
73765
74051
  const expanded = expandHomePath2(target);
73766
74052
  const home = (0, import_node_os4.homedir)();
73767
74053
  const appRoots = [
73768
- (0, import_node_path11.join)(home, ".onchainos", "task"),
73769
- (0, import_node_path11.join)(home, ".onchainos", "deliverables"),
73770
- (0, import_node_path11.join)(home, ".okx-agent-task")
74054
+ (0, import_node_path12.join)(home, ".onchainos", "task"),
74055
+ (0, import_node_path12.join)(home, ".onchainos", "deliverables"),
74056
+ (0, import_node_path12.join)(home, ".okx-agent-task")
73771
74057
  ];
73772
74058
  for (const root of appRoots) {
73773
74059
  if (expanded === root || expanded.startsWith(`${root}/`)) {
@@ -73782,7 +74068,7 @@ function inferAppOwnedCodexWritableRoot(failure) {
73782
74068
  return void 0;
73783
74069
  }
73784
74070
  if (containsOnchainosCommand(command) && /\b0x[0-9a-fA-F]{16,}\b/.test(command)) {
73785
- return (0, import_node_path11.join)((0, import_node_os4.homedir)(), ".onchainos", "task");
74071
+ return (0, import_node_path12.join)((0, import_node_os4.homedir)(), ".onchainos", "task");
73786
74072
  }
73787
74073
  return void 0;
73788
74074
  }
@@ -73791,7 +74077,7 @@ function expandHomePath2(value) {
73791
74077
  return (0, import_node_os4.homedir)();
73792
74078
  }
73793
74079
  if (value.startsWith("~/")) {
73794
- return (0, import_node_path11.join)((0, import_node_os4.homedir)(), value.slice(2));
74080
+ return (0, import_node_path12.join)((0, import_node_os4.homedir)(), value.slice(2));
73795
74081
  }
73796
74082
  return value;
73797
74083
  }
@@ -74762,7 +75048,7 @@ function shortenJobId(jobId) {
74762
75048
  // src/command-store.ts
74763
75049
  var import_node_crypto4 = require("node:crypto");
74764
75050
  var import_node_fs8 = require("node:fs");
74765
- var import_node_path12 = require("node:path");
75051
+ var import_node_path13 = require("node:path");
74766
75052
  var { DatabaseSync: DatabaseSync2 } = loadSqlite2();
74767
75053
  var CommandStore = class {
74768
75054
  paths;
@@ -74770,8 +75056,8 @@ var CommandStore = class {
74770
75056
  dbPath;
74771
75057
  constructor(homeDir) {
74772
75058
  this.paths = resolveTaskPaths(homeDir);
74773
- this.dbPath = (0, import_node_path12.join)(this.paths.sqliteDir, "command-store.sqlite");
74774
- ensureTaskDir((0, import_node_path12.dirname)(this.dbPath));
75059
+ this.dbPath = (0, import_node_path13.join)(this.paths.sqliteDir, "command-store.sqlite");
75060
+ ensureTaskDir((0, import_node_path13.dirname)(this.dbPath));
74775
75061
  this.db = new DatabaseSync2(this.dbPath);
74776
75062
  this.ensureReady();
74777
75063
  }
@@ -74907,7 +75193,7 @@ var CommandStore = class {
74907
75193
  if (result) {
74908
75194
  return result;
74909
75195
  }
74910
- await new Promise((resolve4) => setTimeout(resolve4, 500));
75196
+ await new Promise((resolve5) => setTimeout(resolve5, 500));
74911
75197
  }
74912
75198
  return null;
74913
75199
  }
@@ -75000,7 +75286,7 @@ var CommandStore = class {
75000
75286
  throw err2;
75001
75287
  }
75002
75288
  for (const name2 of names.filter((item) => item.endsWith(".json")).sort()) {
75003
- const path = (0, import_node_path12.join)(dir, name2);
75289
+ const path = (0, import_node_path13.join)(dir, name2);
75004
75290
  try {
75005
75291
  const raw = (0, import_node_fs8.readFileSync)(path, "utf8");
75006
75292
  const parsed = JSON.parse(raw);
@@ -75113,15 +75399,15 @@ function isAiDispatchCommand(command) {
75113
75399
 
75114
75400
  // src/invalid-message-store.ts
75115
75401
  var import_node_fs9 = require("node:fs");
75116
- var import_node_path13 = require("node:path");
75402
+ var import_node_path14 = require("node:path");
75117
75403
  var { DatabaseSync: DatabaseSync3 } = loadSqlite3();
75118
75404
  var InvalidXmtpMessageStore = class {
75119
75405
  dbPath;
75120
75406
  db;
75121
75407
  constructor(homeDir) {
75122
75408
  const paths = resolveTaskPaths(homeDir);
75123
- this.dbPath = (0, import_node_path13.join)(paths.sqliteDir, "invalid-xmtp-messages.sqlite");
75124
- (0, import_node_fs9.mkdirSync)((0, import_node_path13.dirname)(this.dbPath), { recursive: true });
75409
+ this.dbPath = (0, import_node_path14.join)(paths.sqliteDir, "invalid-xmtp-messages.sqlite");
75410
+ (0, import_node_fs9.mkdirSync)((0, import_node_path14.dirname)(this.dbPath), { recursive: true });
75125
75411
  this.db = new DatabaseSync3(this.dbPath);
75126
75412
  this.ensureReady();
75127
75413
  }
@@ -75220,7 +75506,7 @@ function loadSqlite3() {
75220
75506
 
75221
75507
  // ../core/src/xmtp-sdk/index.ts
75222
75508
  var import_node_fs10 = require("node:fs");
75223
- var import_node_path15 = require("node:path");
75509
+ var import_node_path16 = require("node:path");
75224
75510
 
75225
75511
  // ../../node_modules/@xmtp/content-type-primitives/dist/index.js
75226
75512
  var ContentTypeId = class _ContentTypeId {
@@ -75324,7 +75610,7 @@ var TextCodec = class {
75324
75610
  var import_node_bindings = require("@xmtp/node-bindings");
75325
75611
  var import_node_bindings2 = require("@xmtp/node-bindings");
75326
75612
  var import_types = require("node:util/types");
75327
- var import_node_path14 = require("node:path");
75613
+ var import_node_path15 = require("node:path");
75328
75614
  var import_node_process = __toESM(require("node:process"), 1);
75329
75615
  var ApiUrls = {
75330
75616
  local: "http://localhost:5556",
@@ -75488,8 +75774,8 @@ var AsyncStream = class {
75488
75774
  value: this.#queue.shift()
75489
75775
  });
75490
75776
  }
75491
- return new Promise((resolve4) => {
75492
- this.#pendingResolves.push(resolve4);
75777
+ return new Promise((resolve5) => {
75778
+ this.#pendingResolves.push(resolve5);
75493
75779
  });
75494
75780
  };
75495
75781
  return = () => {
@@ -75543,7 +75829,7 @@ function createAsyncStreamProxy(stream) {
75543
75829
  }
75544
75830
  });
75545
75831
  }
75546
- var wait = (ms) => new Promise((resolve4) => setTimeout(resolve4, ms));
75832
+ var wait = (ms) => new Promise((resolve5) => setTimeout(resolve5, ms));
75547
75833
  var DEFAULT_RETRY_DELAY = 6e4;
75548
75834
  var DEFAULT_RETRY_ATTEMPTS = 10;
75549
75835
  var createStream = async (streamFunction, streamValueMutator, options) => {
@@ -76604,7 +76890,7 @@ var createClient = async (identifier, options) => {
76604
76890
  const inboxId = await getInboxIdForIdentifier(identifier, env, gatewayHost) || generateInboxId(identifier, options?.nonce);
76605
76891
  let dbPath;
76606
76892
  if (options?.dbPath === void 0) {
76607
- dbPath = (0, import_node_path14.join)(import_node_process.default.cwd(), `xmtp-${env}-${inboxId}.db3`);
76893
+ dbPath = (0, import_node_path15.join)(import_node_process.default.cwd(), `xmtp-${env}-${inboxId}.db3`);
76608
76894
  } else if (typeof options.dbPath === "function") {
76609
76895
  dbPath = options.dbPath(inboxId);
76610
76896
  } else {
@@ -78962,7 +79248,7 @@ async function wait2(time) {
78962
79248
 
78963
79249
  // ../../node_modules/viem/_esm/utils/promise/withRetry.js
78964
79250
  function withRetry(fn, { delay: delay_ = 100, retryCount = 2, shouldRetry: shouldRetry2 = () => true } = {}) {
78965
- return new Promise((resolve4, reject) => {
79251
+ return new Promise((resolve5, reject) => {
78966
79252
  const attemptRetry = async ({ count = 0 } = {}) => {
78967
79253
  const retry = async ({ error }) => {
78968
79254
  const delay = typeof delay_ === "function" ? delay_({ count, error }) : delay_;
@@ -78972,7 +79258,7 @@ function withRetry(fn, { delay: delay_ = 100, retryCount = 2, shouldRetry: shoul
78972
79258
  };
78973
79259
  try {
78974
79260
  const data = await fn();
78975
- resolve4(data);
79261
+ resolve5(data);
78976
79262
  } catch (err2) {
78977
79263
  if (count < retryCount && await shouldRetry2({ count, error: err2 }))
78978
79264
  return retry({ error: err2 });
@@ -79452,7 +79738,7 @@ init_request();
79452
79738
 
79453
79739
  // ../../node_modules/viem/_esm/utils/promise/withTimeout.js
79454
79740
  function withTimeout(fn, { errorInstance = new Error("timed out"), timeout, signal }) {
79455
- return new Promise((resolve4, reject) => {
79741
+ return new Promise((resolve5, reject) => {
79456
79742
  ;
79457
79743
  (async () => {
79458
79744
  let timeoutId;
@@ -79467,7 +79753,7 @@ function withTimeout(fn, { errorInstance = new Error("timed out"), timeout, sign
79467
79753
  }
79468
79754
  }, timeout);
79469
79755
  }
79470
- resolve4(await fn({ signal: controller?.signal || null }));
79756
+ resolve5(await fn({ signal: controller?.signal || null }));
79471
79757
  } catch (err2) {
79472
79758
  if (err2?.name === "AbortError")
79473
79759
  reject(errorInstance);
@@ -81720,7 +82006,7 @@ function observe(observerId, callbacks, fn) {
81720
82006
  function poll(fn, { emitOnBegin, initialWaitTime, interval }) {
81721
82007
  let active = true;
81722
82008
  const unwatch = () => active = false;
81723
- const watch = async () => {
82009
+ const watch2 = async () => {
81724
82010
  let data;
81725
82011
  if (emitOnBegin)
81726
82012
  data = await fn({ unpoll: unwatch });
@@ -81735,7 +82021,7 @@ function poll(fn, { emitOnBegin, initialWaitTime, interval }) {
81735
82021
  };
81736
82022
  poll2();
81737
82023
  };
81738
- watch();
82024
+ watch2();
81739
82025
  return unwatch;
81740
82026
  }
81741
82027
 
@@ -82134,7 +82420,7 @@ async function sendCalls(client, parameters) {
82134
82420
  });
82135
82421
  promises.push(promise);
82136
82422
  if (experimental_fallbackDelay > 0)
82137
- await new Promise((resolve4) => setTimeout(resolve4, experimental_fallbackDelay));
82423
+ await new Promise((resolve5) => setTimeout(resolve5, experimental_fallbackDelay));
82138
82424
  }
82139
82425
  const results = await Promise.allSettled(promises);
82140
82426
  if (results.every((r) => r.status === "rejected"))
@@ -82238,9 +82524,9 @@ async function waitForCallsStatus(client, parameters) {
82238
82524
  throwOnFailure = false
82239
82525
  } = parameters;
82240
82526
  const observerId = stringify(["waitForCallsStatus", client.uid, id]);
82241
- const { promise, resolve: resolve4, reject } = withResolvers();
82527
+ const { promise, resolve: resolve5, reject } = withResolvers();
82242
82528
  let timer;
82243
- const unobserve = observe(observerId, { resolve: resolve4, reject }, (emit) => {
82529
+ const unobserve = observe(observerId, { resolve: resolve5, reject }, (emit) => {
82244
82530
  const unpoll = poll(async () => {
82245
82531
  const done = (fn) => {
82246
82532
  clearTimeout(timer);
@@ -82540,13 +82826,13 @@ async function waitForTransactionReceipt(client, parameters) {
82540
82826
  let retrying = false;
82541
82827
  let _unobserve;
82542
82828
  let _unwatch;
82543
- const { promise, resolve: resolve4, reject } = withResolvers();
82829
+ const { promise, resolve: resolve5, reject } = withResolvers();
82544
82830
  const timer = timeout ? setTimeout(() => {
82545
82831
  _unwatch?.();
82546
82832
  _unobserve?.();
82547
82833
  reject(new WaitForTransactionReceiptTimeoutError({ hash: hash2 }));
82548
82834
  }, timeout) : void 0;
82549
- _unobserve = observe(observerId, { onReplaced, resolve: resolve4, reject }, async (emit) => {
82835
+ _unobserve = observe(observerId, { onReplaced, resolve: resolve5, reject }, async (emit) => {
82550
82836
  receipt = await getAction(client, getTransactionReceipt, "getTransactionReceipt")({ hash: hash2 }).catch(() => void 0);
82551
82837
  if (receipt && confirmations <= 1) {
82552
82838
  clearTimeout(timer);
@@ -83818,7 +84104,7 @@ function isAgentXmtpBlocked(agent) {
83818
84104
  // ../core/src/xmtp-sdk/index.ts
83819
84105
  var DEFAULT_DATA_DIR = resolveA2aTaskPaths().xmtpDir;
83820
84106
  function cachePath(dataDir, fileName) {
83821
- return (0, import_node_path15.join)(dataDir, fileName);
84107
+ return (0, import_node_path16.join)(dataDir, fileName);
83822
84108
  }
83823
84109
  function ensureCacheDir(dataDir) {
83824
84110
  ensureA2aTaskDir(dataDir);
@@ -85622,9 +85908,10 @@ async function withSharedPromise(registry, key, fn) {
85622
85908
 
85623
85909
  // ../core/src/xmtp-sdk/onchainos/bin.ts
85624
85910
  var import_node_fs11 = require("node:fs");
85625
- var import_node_child_process5 = require("node:child_process");
85911
+ var import_node_child_process4 = require("node:child_process");
85912
+ var import_node_path17 = require("node:path");
85626
85913
  var import_node_util = require("node:util");
85627
- var execFileAsync = (0, import_node_util.promisify)(import_node_child_process5.execFile);
85914
+ var execFileAsync = (0, import_node_util.promisify)(import_node_child_process4.execFile);
85628
85915
  var resolvedBin = null;
85629
85916
  var REDACTED_VALUE_FLAGS = /* @__PURE__ */ new Set(["--message"]);
85630
85917
  async function resolve2() {
@@ -85637,20 +85924,30 @@ async function resolve2() {
85637
85924
  resolvedBin = envBin;
85638
85925
  return resolvedBin;
85639
85926
  }
85640
- try {
85641
- const shell = process.env.SHELL || "/bin/bash";
85642
- const { stdout } = await execFileAsync(shell, ["-lc", "command -v onchainos"]);
85643
- const bin = extractExecutablePath(stdout);
85644
- if (bin) {
85645
- logWithTimestamp(`[onchainos] resolved binary via shell: ${bin}`);
85646
- resolvedBin = bin;
85927
+ if (process.platform === "win32") {
85928
+ const winBin = await resolveWin32();
85929
+ if (winBin) {
85930
+ resolvedBin = winBin;
85647
85931
  return resolvedBin;
85648
85932
  }
85649
- } catch (err2) {
85650
- logWithTimestamp(
85651
- "[onchainos] shell resolve failed, will fallback to bare 'onchainos':",
85652
- err2
85653
- );
85933
+ } else {
85934
+ try {
85935
+ const shell = process.env.SHELL || "/bin/bash";
85936
+ const { stdout } = await execFileAsync(shell, ["-lc", "command -v onchainos"], {
85937
+ windowsHide: true
85938
+ });
85939
+ const bin = extractExecutablePath(stdout);
85940
+ if (bin) {
85941
+ logWithTimestamp(`[onchainos] resolved binary via shell: ${bin}`);
85942
+ resolvedBin = bin;
85943
+ return resolvedBin;
85944
+ }
85945
+ } catch (err2) {
85946
+ logWithTimestamp(
85947
+ "[onchainos] shell resolve failed, will fallback to bare 'onchainos':",
85948
+ err2
85949
+ );
85950
+ }
85654
85951
  }
85655
85952
  logWithTimestamp(
85656
85953
  "[onchainos] could not resolve binary path, falling back to bare 'onchainos'"
@@ -85658,6 +85955,99 @@ async function resolve2() {
85658
85955
  resolvedBin = "onchainos";
85659
85956
  return resolvedBin;
85660
85957
  }
85958
+ async function resolveWin32() {
85959
+ try {
85960
+ const { stdout } = await execFileAsync("where.exe", ["onchainos"], {
85961
+ windowsHide: true
85962
+ });
85963
+ const lines = stdout.split(/\r?\n/);
85964
+ const nonEmptyLineCount = lines.filter((line) => {
85965
+ return line.trim().length > 0;
85966
+ }).length;
85967
+ logWithTimestamp(
85968
+ `${WIN_COMPAT_LOG_PREFIX} [onchainos] where.exe onchainos returned ${nonEmptyLineCount} candidate line(s)`
85969
+ );
85970
+ const picked = pickOnchainosWin32Candidate(lines);
85971
+ if (picked) {
85972
+ logWithTimestamp(
85973
+ `${WIN_COMPAT_LOG_PREFIX} [onchainos] resolved binary via where.exe: ${picked}`
85974
+ );
85975
+ return picked;
85976
+ }
85977
+ logWithTimestamp(
85978
+ `${WIN_COMPAT_LOG_PREFIX} [onchainos] where.exe returned no usable candidate, falling back to bare 'onchainos'`
85979
+ );
85980
+ } catch (err2) {
85981
+ errorWithTimestamp(
85982
+ `${WIN_COMPAT_LOG_PREFIX} [onchainos] where.exe resolve failed (errorCode=${err2?.code ?? ""}), falling back to bare 'onchainos':`,
85983
+ err2
85984
+ );
85985
+ }
85986
+ return null;
85987
+ }
85988
+ var WINDOWS_APPS_ALIAS_MARKER = "\\microsoft\\windowsapps\\";
85989
+ function win32CandidatePriority(candidate) {
85990
+ const extension = (0, import_node_path17.extname)(candidate).toLowerCase();
85991
+ if (extension === ".exe") {
85992
+ return 0;
85993
+ }
85994
+ if (extension === ".cmd") {
85995
+ return 1;
85996
+ }
85997
+ if (extension === ".bat") {
85998
+ return 2;
85999
+ }
86000
+ return 3;
86001
+ }
86002
+ function isWindowsAppsAlias(candidate) {
86003
+ return candidate.toLowerCase().includes(WINDOWS_APPS_ALIAS_MARKER);
86004
+ }
86005
+ function win32FileExists(path) {
86006
+ return (0, import_node_fs11.existsSync)(path);
86007
+ }
86008
+ function pickOnchainosWin32Candidate(lines, fileExists2 = win32FileExists) {
86009
+ const candidates = lines.map((line) => {
86010
+ return line.trim();
86011
+ }).filter((line) => {
86012
+ return line.length > 0;
86013
+ });
86014
+ if (candidates.length === 0) {
86015
+ logWithTimestamp(`${WIN_COMPAT_LOG_PREFIX} [onchainos] no candidate lines to rank`);
86016
+ return null;
86017
+ }
86018
+ const ranked = [];
86019
+ candidates.forEach((candidate, order) => {
86020
+ if (!fileExists2(candidate)) {
86021
+ logWithTimestamp(
86022
+ `${WIN_COMPAT_LOG_PREFIX} [onchainos] candidate rejected (file not found): ${candidate}`
86023
+ );
86024
+ return;
86025
+ }
86026
+ const priority = win32CandidatePriority(candidate);
86027
+ const windowsAppsAlias = isWindowsAppsAlias(candidate);
86028
+ logWithTimestamp(
86029
+ `${WIN_COMPAT_LOG_PREFIX} [onchainos] candidate accepted: ${candidate} (extPriority=${priority}, windowsAppsAlias=${windowsAppsAlias})`
86030
+ );
86031
+ ranked.push({ candidate, order, priority, windowsAppsAlias });
86032
+ });
86033
+ ranked.sort((a, b) => {
86034
+ if (a.windowsAppsAlias !== b.windowsAppsAlias) {
86035
+ return a.windowsAppsAlias ? 1 : -1;
86036
+ }
86037
+ if (a.priority !== b.priority) {
86038
+ return a.priority - b.priority;
86039
+ }
86040
+ return a.order - b.order;
86041
+ });
86042
+ const winner = ranked[0];
86043
+ if (!winner) {
86044
+ return null;
86045
+ }
86046
+ logWithTimestamp(
86047
+ `${WIN_COMPAT_LOG_PREFIX} [onchainos] candidate selected: ${winner.candidate}`
86048
+ );
86049
+ return winner.candidate;
86050
+ }
85661
86051
  function extractExecutablePath(stdout) {
85662
86052
  const candidates = stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean).reverse();
85663
86053
  for (const candidate of candidates) {
@@ -85703,14 +86093,25 @@ async function exec(args) {
85703
86093
  const bin = await resolve2();
85704
86094
  const cmd = commandForLog(bin, args);
85705
86095
  logWithTimestamp(`[onchainos] exec: ${cmd}`);
86096
+ const invocation = toWindowsInvocation(bin, args);
86097
+ if (invocation.routedThroughWindowsShell) {
86098
+ logWithTimestamp(
86099
+ `${WIN_COMPAT_LOG_PREFIX} [onchainos] exec routed through ${invocation.command} /d /s /c: ${cmd}`
86100
+ );
86101
+ }
85706
86102
  const t0 = Date.now();
85707
86103
  try {
85708
- const result = await execFileAsync(bin, args);
86104
+ const result = await execFileAsync(invocation.command, invocation.args, { windowsHide: true });
85709
86105
  logWithTimestamp(
85710
86106
  `[onchainos] exec done: ${cmd} (${Date.now() - t0}ms, stdout=${result.stdout.length}B, stderr=${result.stderr.length}B)`
85711
86107
  );
85712
86108
  return result;
85713
86109
  } catch (err2) {
86110
+ if (invocation.routedThroughWindowsShell) {
86111
+ errorWithTimestamp(
86112
+ `${WIN_COMPAT_LOG_PREFIX} [onchainos] routed exec failed via ${invocation.command}: ${cmd} errorCode=${err2?.code ?? ""} signal=${err2?.signal ?? ""}`
86113
+ );
86114
+ }
85714
86115
  logWithTimestamp(
85715
86116
  `[onchainos] exec error: ${cmd} (${Date.now() - t0}ms) code=${err2.code} signal=${err2.signal} killed=${err2.killed} message=${err2.message}`
85716
86117
  );
@@ -86348,9 +86749,9 @@ var import_node_crypto6 = require("node:crypto");
86348
86749
 
86349
86750
  // ../core/src/openclaw-gateway-config.ts
86350
86751
  var import_node_fs12 = require("node:fs");
86351
- var import_node_path16 = require("node:path");
86752
+ var import_node_path18 = require("node:path");
86352
86753
  function resolveOpenClawGatewayConfigPath(homeDir = resolveA2aTaskHome()) {
86353
- return (0, import_node_path16.join)(homeDir, "openclaw-gateway.json");
86754
+ return (0, import_node_path18.join)(homeDir, "openclaw-gateway.json");
86354
86755
  }
86355
86756
  function readSyncedOpenClawGatewayConfig(homeDir = resolveA2aTaskHome()) {
86356
86757
  const filePath = resolveOpenClawGatewayConfigPath(homeDir);
@@ -86610,7 +87011,7 @@ function isGatewayStartingError(err2) {
86610
87011
  return String(e?.details?.reason ?? "") === "startup-sidecars" || String(e?.message ?? "").toLowerCase().includes("gateway starting");
86611
87012
  }
86612
87013
  async function sleep2(ms) {
86613
- await new Promise((resolve4) => setTimeout(resolve4, ms));
87014
+ await new Promise((resolve5) => setTimeout(resolve5, ms));
86614
87015
  }
86615
87016
  var MinimalGatewayClient = class {
86616
87017
  config;
@@ -86634,7 +87035,7 @@ var MinimalGatewayClient = class {
86634
87035
  );
86635
87036
  const ws = wsFactory(this.config.url);
86636
87037
  this.ws = ws;
86637
- await new Promise((resolve4, reject) => {
87038
+ await new Promise((resolve5, reject) => {
86638
87039
  let settled = false;
86639
87040
  const timer = setTimeout(() => {
86640
87041
  if (settled) {
@@ -86653,7 +87054,7 @@ var MinimalGatewayClient = class {
86653
87054
  }
86654
87055
  settled = true;
86655
87056
  clearTimeout(timer);
86656
- resolve4();
87057
+ resolve5();
86657
87058
  },
86658
87059
  (err2) => {
86659
87060
  if (settled) {
@@ -86705,7 +87106,7 @@ var MinimalGatewayClient = class {
86705
87106
  const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
86706
87107
  const id = `okx-a2a-${++this.requestSeq}-${(0, import_node_crypto6.randomUUID)()}`;
86707
87108
  const frame = { type: "req", id, method, params };
86708
- return new Promise((resolve4, reject) => {
87109
+ return new Promise((resolve5, reject) => {
86709
87110
  const timer = setTimeout(() => {
86710
87111
  this.pending.delete(id);
86711
87112
  reject(Object.assign(new Error(`OpenClaw gateway request timed out method=${method}`), {
@@ -86714,7 +87115,7 @@ var MinimalGatewayClient = class {
86714
87115
  }));
86715
87116
  }, timeoutMs);
86716
87117
  timer.unref?.();
86717
- this.pending.set(id, { method, resolve: resolve4, reject, timer });
87118
+ this.pending.set(id, { method, resolve: resolve5, reject, timer });
86718
87119
  try {
86719
87120
  this.ws.send(JSON.stringify(frame));
86720
87121
  } catch (err2) {
@@ -86819,7 +87220,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
86819
87220
  client: {
86820
87221
  id: "gateway-client",
86821
87222
  displayName: "okx-a2a-node",
86822
- version: "0.1.3",
87223
+ version: "0.1.4-beta-520175e226-260702152522",
86823
87224
  platform: "node",
86824
87225
  mode: "backend",
86825
87226
  instanceId
@@ -86830,7 +87231,7 @@ function buildConnectParams(config, instanceId, protocolVersion) {
86830
87231
  commands: [],
86831
87232
  permissions: {},
86832
87233
  locale: Intl.DateTimeFormat().resolvedOptions().locale || "en-US",
86833
- userAgent: `okx-a2a-node/${"0.1.3"}`,
87234
+ userAgent: `okx-a2a-node/${"0.1.4-beta-520175e226-260702152522"}`,
86834
87235
  auth: {
86835
87236
  ...config.token ? { token: config.token } : {},
86836
87237
  ...config.password ? { password: config.password } : {}
@@ -86958,7 +87359,7 @@ function safeDecode(value) {
86958
87359
  // src/openclaw-route.ts
86959
87360
  var import_node_fs13 = require("node:fs");
86960
87361
  var import_node_os5 = require("node:os");
86961
- var import_node_path17 = require("node:path");
87362
+ var import_node_path19 = require("node:path");
86962
87363
  var OPENCLAW_GATEWAY_ROUTE_GROUP_ID = "__openclaw_gateway_route__";
86963
87364
  var CURRENT_GATEWAY_SESSION_KEYS_ENV = "OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS";
86964
87365
  var NON_DELIVERY_CHANNELS = /* @__PURE__ */ new Set(["heartbeat", "cron", "webhook", "voice"]);
@@ -87276,7 +87677,7 @@ function readGatewaySessionKeysEnv(env) {
87276
87677
  return raw.split(",").map((item) => item.trim()).filter(Boolean);
87277
87678
  }
87278
87679
  function readSingleActiveOriginSessionKey(env) {
87279
- const path = (0, import_node_path17.join)(resolveTaskHome2(env), "run", "gateway-route-origins.json");
87680
+ const path = (0, import_node_path19.join)(resolveTaskHome2(env), "run", "gateway-route-origins.json");
87280
87681
  if (!(0, import_node_fs13.existsSync)(path)) {
87281
87682
  return [];
87282
87683
  }
@@ -87306,7 +87707,7 @@ function readSingleActiveOriginSessionKey(env) {
87306
87707
  }
87307
87708
  }
87308
87709
  function resolveTaskHome2(env) {
87309
- return env.OKX_AGENT_TASK_HOME?.trim() || (0, import_node_path17.join)((0, import_node_os5.homedir)(), ".okx-agent-task");
87710
+ return env.OKX_AGENT_TASK_HOME?.trim() || (0, import_node_path19.join)((0, import_node_os5.homedir)(), ".okx-agent-task");
87310
87711
  }
87311
87712
  function logOpenClawRouteSkip(reason, input) {
87312
87713
  if (reason === "missing_gateway_session_key") {
@@ -91027,7 +91428,7 @@ function isA2AEnvelope(payload) {
91027
91428
  var import_node_fs14 = require("node:fs");
91028
91429
  var import_promises6 = require("node:fs/promises");
91029
91430
  var import_node_os6 = require("node:os");
91030
- var import_node_path18 = require("node:path");
91431
+ var import_node_path20 = require("node:path");
91031
91432
 
91032
91433
  // ../core/src/xmtp-sdk/onchainos/signer.ts
91033
91434
  async function onchainosSign(agentId, keyUuid, walletAddress, message) {
@@ -91255,7 +91656,7 @@ function userWatchEventDeliveredSentryExtra(event) {
91255
91656
  var environment = process.env.SENTRY_ENV === "dev" ? "dev" : "prod";
91256
91657
  var SENTRY_CONFIG = {
91257
91658
  projectName: "okx/openclaw-okx-a2a-extension",
91258
- release: "0.1.3",
91659
+ release: "0.1.4-beta-520175e226-260702152522",
91259
91660
  environment
91260
91661
  };
91261
91662
 
@@ -91300,12 +91701,12 @@ async function isHermesGatewayPluginEnabled(options = {}) {
91300
91701
  if (options.requireGatewayRuntime && detectGatewayInvocation(env) !== "hermes") {
91301
91702
  return false;
91302
91703
  }
91303
- const hermesHome = env.HERMES_HOME?.trim() || (0, import_node_path18.join)((0, import_node_os6.homedir)(), ".hermes");
91304
- if (!(0, import_node_fs14.existsSync)((0, import_node_path18.join)(hermesHome, "plugins", "platforms", "okx-a2a", "plugin.yaml"))) {
91704
+ const hermesHome = env.HERMES_HOME?.trim() || (0, import_node_path20.join)((0, import_node_os6.homedir)(), ".hermes");
91705
+ if (!(0, import_node_fs14.existsSync)((0, import_node_path20.join)(hermesHome, "plugins", "platforms", "okx-a2a", "plugin.yaml"))) {
91305
91706
  return false;
91306
91707
  }
91307
91708
  try {
91308
- return hermesConfigEnablesOkxA2a(await (0, import_promises6.readFile)((0, import_node_path18.join)(hermesHome, "config.yaml"), "utf8"));
91709
+ return hermesConfigEnablesOkxA2a(await (0, import_promises6.readFile)((0, import_node_path20.join)(hermesHome, "config.yaml"), "utf8"));
91309
91710
  } catch {
91310
91711
  return false;
91311
91712
  }
@@ -91482,12 +91883,12 @@ async function runListenerWithLock(options, paths) {
91482
91883
  }));
91483
91884
  }
91484
91885
  });
91485
- service.setPluginVersion("0.1.3");
91886
+ service.setPluginVersion("0.1.4-beta-520175e226-260702152522");
91486
91887
  await service.init();
91487
91888
  const pluginVersionStatus = service.pluginVersionStatus;
91488
91889
  if (pluginVersionStatus.unavailable) {
91489
91890
  throw new Error(
91490
- `@okxweb3/a2a-node v${"0.1.3"} is below the required minimum v${pluginVersionStatus.minVersion}`
91891
+ `@okxweb3/a2a-node v${"0.1.4-beta-520175e226-260702152522"} is below the required minimum v${pluginVersionStatus.minVersion}`
91491
91892
  );
91492
91893
  }
91493
91894
  const systemConfig = service.getSystemConfig();
@@ -91505,7 +91906,7 @@ async function runListenerWithLock(options, paths) {
91505
91906
  onchainosAgentId: "*",
91506
91907
  reason: "system-config missing sentryDsn",
91507
91908
  pluginId: "@okxweb3/a2a-node",
91508
- pluginVersion: "0.1.3"
91909
+ pluginVersion: "0.1.4-beta-520175e226-260702152522"
91509
91910
  });
91510
91911
  }
91511
91912
  logWithTimestamp(
@@ -91804,7 +92205,7 @@ async function runListenerWithLock(options, paths) {
91804
92205
  });
91805
92206
  await markDaemonReady(paths.daemonLockPath);
91806
92207
  logWithTimestamp(`[okx-agent-task] daemon ready lock=${paths.daemonLockPath}`);
91807
- await new Promise((resolve4) => {
92208
+ await new Promise((resolve5) => {
91808
92209
  const shutdown = (signal) => {
91809
92210
  if (stopping) {
91810
92211
  return;
@@ -91813,7 +92214,7 @@ async function runListenerWithLock(options, paths) {
91813
92214
  logWithTimestamp(`[okx-agent-task] received ${signal}, stopping listener`);
91814
92215
  const forceResolve = setTimeout(() => {
91815
92216
  logWithTimestamp("[okx-agent-task] listener shutdown timed out; forcing process exit");
91816
- resolve4();
92217
+ resolve5();
91817
92218
  }, SHUTDOWN_FORCE_RESOLVE_MS);
91818
92219
  void (async () => {
91819
92220
  if (timer) {
@@ -91841,7 +92242,7 @@ async function runListenerWithLock(options, paths) {
91841
92242
  stopClients(service);
91842
92243
  sessionStore.close();
91843
92244
  clearTimeout(forceResolve);
91844
- resolve4();
92245
+ resolve5();
91845
92246
  })();
91846
92247
  };
91847
92248
  process.once("SIGTERM", shutdown);
@@ -91859,10 +92260,10 @@ async function timeSettled(fn) {
91859
92260
  }
91860
92261
 
91861
92262
  // src/update-cli.ts
91862
- var import_node_child_process6 = require("node:child_process");
92263
+ var import_node_child_process5 = require("node:child_process");
91863
92264
  var import_promises7 = require("node:fs/promises");
91864
92265
  var import_node_os7 = require("node:os");
91865
- var import_node_path19 = require("node:path");
92266
+ var import_node_path21 = require("node:path");
91866
92267
  var OKX_A2A_PLUGIN_ID = "okx-a2a";
91867
92268
  var OPENCLAW_SESSION_DM_SCOPE_CONFIG_PATH = "session.dmScope";
91868
92269
  var OPENCLAW_SESSION_DM_SCOPE_CONFIG_VALUE = "per-channel-peer";
@@ -91940,6 +92341,17 @@ function normalizeOpenClawPluginAllowValue(allow) {
91940
92341
  }
91941
92342
  return { value: nextAllow, changed: allowChanged };
91942
92343
  }
92344
+ function assertHermesSetupSupportedOnPlatform(platform = process.platform) {
92345
+ if (platform !== "win32") {
92346
+ return;
92347
+ }
92348
+ errorWithTimestamp(
92349
+ `${WIN_COMPAT_LOG_PREFIX} hermes setup/update blocked: platform=${platform}; installer chain (tar -xzf + bash install-or-upgrade.sh) requires bash, unavailable on Windows`
92350
+ );
92351
+ throw new Error(
92352
+ "Hermes setup/update is not supported on Windows yet. The Hermes gateway installer requires bash. Use WSL, or run setup on macOS/Linux, or choose the codex/claude provider on Windows."
92353
+ );
92354
+ }
91943
92355
  async function normalizeHermesOkxA2aPluginConfig(configFile = resolveHermesConfigPath()) {
91944
92356
  let content3;
91945
92357
  try {
@@ -91960,10 +92372,9 @@ async function normalizeHermesOkxA2aPluginConfig(configFile = resolveHermesConfi
91960
92372
  }
91961
92373
  function normalizeHermesPluginConfigContent(content3) {
91962
92374
  const trailingNewline = content3.endsWith("\n");
91963
- const indentRepair = normalizeEnabledListItemIndents(content3.replace(/\n$/, "").split(/\n/));
91964
- const duplicateRepair = removeDuplicateInlineEnabledHeaders(indentRepair.lines);
92375
+ const duplicateRepair = removeDuplicateInlineEnabledHeaders(content3.replace(/\n$/, "").split(/\n/));
91965
92376
  const lines = duplicateRepair.lines;
91966
- let changed = indentRepair.changed || duplicateRepair.changed;
92377
+ let changed = duplicateRepair.changed;
91967
92378
  let hasOkxA2a = false;
91968
92379
  let inPlugins = false;
91969
92380
  let pluginsIndent = -1;
@@ -92022,7 +92433,9 @@ function normalizeHermesPluginConfigContent(content3) {
92022
92433
  }
92023
92434
  output.push(line);
92024
92435
  }
92025
- return { content: `${output.join("\n")}${trailingNewline ? "\n" : ""}`, changed, hasOkxA2a };
92436
+ const indentRepair = normalizeEnabledListItemIndents(output);
92437
+ changed ||= indentRepair.changed;
92438
+ return { content: `${indentRepair.lines.join("\n")}${trailingNewline ? "\n" : ""}`, changed, hasOkxA2a };
92026
92439
  }
92027
92440
  function normalizeEnabledListItemIndents(lines) {
92028
92441
  const output = [...lines];
@@ -92121,7 +92534,7 @@ function isEmptyInlineEnabledList(line) {
92121
92534
  return !!inline && inline.values.length === 0;
92122
92535
  }
92123
92536
  function resolveHermesConfigPath() {
92124
- return (0, import_node_path19.join)(process.env.HERMES_HOME ?? (0, import_node_path19.join)((0, import_node_os7.homedir)(), ".hermes"), "config.yaml");
92537
+ return (0, import_node_path21.join)(process.env.HERMES_HOME ?? (0, import_node_path21.join)((0, import_node_os7.homedir)(), ".hermes"), "config.yaml");
92125
92538
  }
92126
92539
  function lineIndent(line) {
92127
92540
  const match = line.match(/^\s*/);
@@ -92188,7 +92601,8 @@ async function runCommand(command, args, options = {}) {
92188
92601
  await mkdir4(options.ensureDir, { recursive: true });
92189
92602
  }
92190
92603
  await new Promise((resolvePromise, reject) => {
92191
- const child = (0, import_node_child_process6.spawn)(command, args, {
92604
+ const invocation = buildExternalCommandInvocation(command, args);
92605
+ const child = (0, import_node_child_process5.spawn)(invocation.command, invocation.args, {
92192
92606
  cwd: options.cwd,
92193
92607
  stdio: redirectCommandStdoutToStderr ? [options.inheritStdin ? "inherit" : "ignore", "pipe", "pipe"] : "inherit"
92194
92608
  });
@@ -92217,20 +92631,21 @@ async function runCommand(command, args, options = {}) {
92217
92631
  child.stderr.pipe(process.stderr);
92218
92632
  }
92219
92633
  child.on("error", (error) => {
92220
- finish(() => reject(error));
92634
+ finish(() => reject(new Error(`${formatExternalCommand(command, args)} failed to start: ${error.message}`)));
92221
92635
  });
92222
92636
  child.on("close", (code2, signal) => {
92223
92637
  if (code2 === 0) {
92224
92638
  finish(() => resolvePromise());
92225
92639
  return;
92226
92640
  }
92227
- finish(() => reject(new Error(`${command} ${args.join(" ")} failed with ${signal ? `signal=${signal}` : `code=${code2}`}`)));
92641
+ finish(() => reject(new Error(`${formatExternalCommand(command, args)} failed with ${signal ? `signal=${signal}` : `code=${code2}`}`)));
92228
92642
  });
92229
92643
  });
92230
92644
  }
92231
92645
  async function runCommandCaptureOptional(command, args) {
92232
92646
  return await new Promise((resolvePromise) => {
92233
- const child = (0, import_node_child_process6.spawn)(command, args, { stdio: ["ignore", "pipe", "ignore"] });
92647
+ const invocation = buildExternalCommandInvocation(command, args);
92648
+ const child = (0, import_node_child_process5.spawn)(invocation.command, invocation.args, { stdio: ["ignore", "pipe", "ignore"] });
92234
92649
  let stdout = "";
92235
92650
  child.stdout.setEncoding("utf8");
92236
92651
  child.stdout.on("data", (chunk) => {
@@ -92244,6 +92659,267 @@ async function runCommandCaptureOptional(command, args) {
92244
92659
  });
92245
92660
  });
92246
92661
  }
92662
+ function buildExternalCommandInvocation(command, args, platform = process.platform, comSpec = process.env.ComSpec ?? process.env.COMSPEC) {
92663
+ return toWindowsInvocation(command, args, platform, comSpec);
92664
+ }
92665
+ function formatExternalCommand(command, args) {
92666
+ return [command, ...args].join(" ");
92667
+ }
92668
+
92669
+ // src/log-tail.ts
92670
+ var import_node_fs15 = require("node:fs");
92671
+ var import_promises8 = require("node:fs/promises");
92672
+ var import_node_string_decoder = require("node:string_decoder");
92673
+ var READ_CHUNK_SIZE = 64 * 1024;
92674
+ var NEWLINE_BYTE = 10;
92675
+ async function readLastLines(filePath, maxLines) {
92676
+ if (!Number.isFinite(maxLines) || maxLines <= 0) {
92677
+ return "";
92678
+ }
92679
+ let handle;
92680
+ try {
92681
+ handle = await (0, import_promises8.open)(filePath, "r");
92682
+ } catch (error) {
92683
+ if (error.code === "ENOENT") {
92684
+ return "";
92685
+ }
92686
+ errorWithTimestamp(
92687
+ `${WIN_COMPAT_LOG_PREFIX} readLastLines open failed path=${filePath} errorCode=${error.code ?? "unknown"}: ${error.message}`
92688
+ );
92689
+ throw error;
92690
+ }
92691
+ try {
92692
+ const stats = await handle.stat();
92693
+ const size3 = stats.size;
92694
+ if (size3 === 0) {
92695
+ return "";
92696
+ }
92697
+ const chunks = [];
92698
+ let position = size3;
92699
+ let newlineCount = 0;
92700
+ let startOffset = 0;
92701
+ outer: while (position > 0) {
92702
+ const readLength = Math.min(READ_CHUNK_SIZE, position);
92703
+ position -= readLength;
92704
+ const buffer2 = Buffer.alloc(readLength);
92705
+ await readFully(handle, buffer2, position);
92706
+ chunks.unshift(buffer2);
92707
+ for (let i = readLength - 1; i >= 0; i--) {
92708
+ if (buffer2[i] !== NEWLINE_BYTE) {
92709
+ continue;
92710
+ }
92711
+ const absolute = position + i;
92712
+ if (absolute === size3 - 1) {
92713
+ continue;
92714
+ }
92715
+ newlineCount++;
92716
+ if (newlineCount === maxLines) {
92717
+ startOffset = absolute + 1;
92718
+ break outer;
92719
+ }
92720
+ }
92721
+ }
92722
+ const joined = Buffer.concat(chunks);
92723
+ return joined.subarray(startOffset - position).toString("utf8");
92724
+ } finally {
92725
+ await handle.close();
92726
+ }
92727
+ }
92728
+ async function followFile(filePath, onData, options = {}) {
92729
+ const pollIntervalMs = options.pollIntervalMs ?? 1e3;
92730
+ const signal = options.signal;
92731
+ if (signal?.aborted) {
92732
+ return;
92733
+ }
92734
+ let offset = await currentSizeOrZero(filePath);
92735
+ let decoder = new import_node_string_decoder.StringDecoder("utf8");
92736
+ let checking = false;
92737
+ let done = false;
92738
+ await new Promise((resolvePromise) => {
92739
+ let watcher;
92740
+ let timer;
92741
+ const finish = () => {
92742
+ if (done) {
92743
+ return;
92744
+ }
92745
+ done = true;
92746
+ if (timer !== void 0) {
92747
+ clearInterval(timer);
92748
+ }
92749
+ if (watcher !== void 0) {
92750
+ watcher.close();
92751
+ }
92752
+ signal?.removeEventListener("abort", finish);
92753
+ resolvePromise();
92754
+ };
92755
+ const check = async () => {
92756
+ if (checking || done) {
92757
+ return;
92758
+ }
92759
+ checking = true;
92760
+ try {
92761
+ const size3 = await currentSizeOrZero(filePath);
92762
+ if (size3 < offset) {
92763
+ logWithTimestamp(
92764
+ `${WIN_COMPAT_LOG_PREFIX} followFile detected truncation path=${filePath} previousOffset=${offset} newSize=${size3}; re-reading from 0`
92765
+ );
92766
+ offset = 0;
92767
+ decoder = new import_node_string_decoder.StringDecoder("utf8");
92768
+ }
92769
+ if (size3 > offset) {
92770
+ const buffer2 = await readRange(filePath, offset, size3);
92771
+ offset += buffer2.length;
92772
+ if (buffer2.length > 0 && !done) {
92773
+ const text = decoder.write(buffer2);
92774
+ if (text.length > 0) {
92775
+ onData(text);
92776
+ }
92777
+ }
92778
+ }
92779
+ } catch (error) {
92780
+ if (error.code !== "ENOENT") {
92781
+ errorWithTimestamp(
92782
+ `${WIN_COMPAT_LOG_PREFIX} followFile poll failed path=${filePath} errorCode=${error.code ?? "unknown"}: ${error.message}`
92783
+ );
92784
+ }
92785
+ } finally {
92786
+ checking = false;
92787
+ }
92788
+ };
92789
+ timer = setInterval(() => {
92790
+ void check();
92791
+ }, pollIntervalMs);
92792
+ try {
92793
+ watcher = (0, import_node_fs15.watch)(filePath, () => {
92794
+ void check();
92795
+ });
92796
+ watcher.on("error", (error) => {
92797
+ errorWithTimestamp(
92798
+ `${WIN_COMPAT_LOG_PREFIX} followFile fs.watch error path=${filePath}: ${error.message}; polling continues`
92799
+ );
92800
+ });
92801
+ } catch (error) {
92802
+ errorWithTimestamp(
92803
+ `${WIN_COMPAT_LOG_PREFIX} followFile fs.watch unavailable path=${filePath} errorCode=${error.code ?? "unknown"}: ${error.message}; falling back to polling only`
92804
+ );
92805
+ }
92806
+ signal?.addEventListener("abort", finish);
92807
+ if (signal?.aborted) {
92808
+ finish();
92809
+ return;
92810
+ }
92811
+ void check();
92812
+ });
92813
+ }
92814
+ async function currentSizeOrZero(filePath) {
92815
+ try {
92816
+ const stats = await (0, import_promises8.stat)(filePath);
92817
+ return stats.size;
92818
+ } catch (error) {
92819
+ if (error.code === "ENOENT") {
92820
+ return 0;
92821
+ }
92822
+ throw error;
92823
+ }
92824
+ }
92825
+ async function readRange(filePath, start, end) {
92826
+ const handle = await (0, import_promises8.open)(filePath, "r");
92827
+ try {
92828
+ const length2 = end - start;
92829
+ const buffer2 = Buffer.alloc(length2);
92830
+ let totalRead = 0;
92831
+ while (totalRead < length2) {
92832
+ const { bytesRead } = await handle.read(buffer2, totalRead, length2 - totalRead, start + totalRead);
92833
+ if (bytesRead === 0) {
92834
+ break;
92835
+ }
92836
+ totalRead += bytesRead;
92837
+ }
92838
+ return buffer2.subarray(0, totalRead);
92839
+ } finally {
92840
+ await handle.close();
92841
+ }
92842
+ }
92843
+ async function readFully(handle, buffer2, position) {
92844
+ let totalRead = 0;
92845
+ while (totalRead < buffer2.length) {
92846
+ const { bytesRead } = await handle.read(buffer2, totalRead, buffer2.length - totalRead, position + totalRead);
92847
+ if (bytesRead === 0) {
92848
+ return;
92849
+ }
92850
+ totalRead += bytesRead;
92851
+ }
92852
+ }
92853
+
92854
+ // src/autostart-windows.ts
92855
+ var import_node_path22 = require("node:path");
92856
+ var TASK_NAME = "OKX A2A Daemon";
92857
+ var VBS_FILE_NAME = "launch-okx-a2a-daemon.vbs";
92858
+ var CMD_FILE_NAME = "launch-okx-a2a-daemon.cmd";
92859
+ function resolveWindowsAutostartPaths(homeDir) {
92860
+ const resolvedHome = homeDir ?? resolveTaskPaths().homeDir;
92861
+ const autostartDir = (0, import_node_path22.join)(resolvedHome, "autostart");
92862
+ return {
92863
+ autostartDir,
92864
+ vbsPath: (0, import_node_path22.join)(autostartDir, VBS_FILE_NAME),
92865
+ cmdPath: (0, import_node_path22.join)(autostartDir, CMD_FILE_NAME)
92866
+ };
92867
+ }
92868
+ function escapeVbsString(value) {
92869
+ return value.replace(/"/g, '""');
92870
+ }
92871
+ function escapeCmdBatchValue(value) {
92872
+ return value.replace(/%/g, "%%");
92873
+ }
92874
+ function buildAutostartVbs(cmdPath) {
92875
+ const commandLine = `cmd.exe /d /s /c ""${cmdPath}""`;
92876
+ const lines = [
92877
+ "' OKX A2A daemon autostart wrapper: run the launcher .cmd fully hidden.",
92878
+ "Option Explicit",
92879
+ "Dim okxA2aShell",
92880
+ 'Set okxA2aShell = CreateObject("WScript.Shell")',
92881
+ `okxA2aShell.Run "${escapeVbsString(commandLine)}", 0, False`
92882
+ ];
92883
+ return `${lines.join("\r\n")}\r
92884
+ `;
92885
+ }
92886
+ function buildAutostartCmd(options) {
92887
+ const lines = ["@echo off", "chcp 65001 >nul"];
92888
+ const pathValue = options.pathValue?.trim();
92889
+ if (pathValue) {
92890
+ lines.push(`set "PATH=${escapeCmdBatchValue(pathValue)}"`);
92891
+ }
92892
+ lines.push(`set "OKX_AGENT_TASK_HOME=${escapeCmdBatchValue(options.taskHome)}"`);
92893
+ lines.push(
92894
+ `"${escapeCmdBatchValue(options.execPath)}" "${escapeCmdBatchValue(options.cliPath)}" run >> "${escapeCmdBatchValue(options.logPath)}" 2>&1`
92895
+ );
92896
+ return `${lines.join("\r\n")}\r
92897
+ `;
92898
+ }
92899
+ function buildSchtasksCreateArgs(vbsPath, taskName = TASK_NAME) {
92900
+ return [
92901
+ "/Create",
92902
+ "/SC",
92903
+ "ONLOGON",
92904
+ "/TN",
92905
+ taskName,
92906
+ "/TR",
92907
+ `wscript.exe "${vbsPath}"`,
92908
+ "/F"
92909
+ ];
92910
+ }
92911
+ function buildSchtasksDeleteArgs(taskName = TASK_NAME) {
92912
+ return ["/Delete", "/TN", taskName, "/F"];
92913
+ }
92914
+ function buildSchtasksEndArgs(taskName = TASK_NAME) {
92915
+ return ["/End", "/TN", taskName];
92916
+ }
92917
+ function buildSchtasksRunArgs(taskName = TASK_NAME) {
92918
+ return ["/Run", "/TN", taskName];
92919
+ }
92920
+ function buildSchtasksQueryArgs(taskName = TASK_NAME) {
92921
+ return ["/Query", "/TN", taskName, "/FO", "LIST"];
92922
+ }
92247
92923
  // Annotate the CommonJS export names for ESM import in node:
92248
92924
  0 && (module.exports = {
92249
92925
  AI_PROVIDERS,
@@ -92261,6 +92937,7 @@ async function runCommandCaptureOptional(command, args) {
92261
92937
  SYSTEM_NOTIFICATION_SESSION_KEY,
92262
92938
  SessionStore,
92263
92939
  SqliteOutboundBehavior,
92940
+ TASK_NAME,
92264
92941
  TaskMessageStore,
92265
92942
  USER_ATTENTION_CHANGED,
92266
92943
  USER_ATTENTION_WATCHER_SCAN_MS,
@@ -92269,6 +92946,7 @@ async function runCommandCaptureOptional(command, args) {
92269
92946
  USER_ATTENTION_WATCH_REPLACED_MESSAGE,
92270
92947
  UserCancelledAiProviderSelectionError,
92271
92948
  XMTP_CLIENT_RECYCLE_INTERVAL_ENV,
92949
+ assertHermesSetupSupportedOnPlatform,
92272
92950
  bindJobProviderToCurrentDefaultIfMissing,
92273
92951
  bindJobProviderToCurrentRuntimeIfMissing,
92274
92952
  bindMessageJobProviderToCurrentDefault,
@@ -92276,18 +92954,28 @@ async function runCommandCaptureOptional(command, args) {
92276
92954
  buildAgentMessageNotice,
92277
92955
  buildAiAdapterCommand,
92278
92956
  buildAiProviderEnv,
92957
+ buildAutostartCmd,
92958
+ buildAutostartVbs,
92279
92959
  buildBackupJobSessionKey,
92280
92960
  buildDispatchSessionKey,
92961
+ buildExternalCommandInvocation,
92281
92962
  buildPendingConversationBackupDispatch,
92963
+ buildSchtasksCreateArgs,
92964
+ buildSchtasksDeleteArgs,
92965
+ buildSchtasksEndArgs,
92966
+ buildSchtasksQueryArgs,
92967
+ buildSchtasksRunArgs,
92282
92968
  buildSessionKey,
92283
92969
  buildSystemMessageNotice,
92284
92970
  buildSystemStoredMessage,
92971
+ buildWindowsParentProcessProbe,
92285
92972
  callChatInject,
92286
92973
  callDeleteSessions,
92287
92974
  callOpenClawGateway,
92288
92975
  callSessionsCreate,
92289
92976
  callSessionsDelete,
92290
92977
  callSessionsSend,
92978
+ collectCodexCommandCandidates,
92291
92979
  commandExists,
92292
92980
  createAiToolFailureTracker,
92293
92981
  createFileMessageHandler,
@@ -92303,6 +92991,7 @@ async function runCommandCaptureOptional(command, args) {
92303
92991
  ensureOpenClawOkxA2aPluginConfig,
92304
92992
  extractAiSessionId,
92305
92993
  extractXmtpSentAtMs,
92994
+ followFile,
92306
92995
  getDaemonStatus,
92307
92996
  handleXmtpSendCommand,
92308
92997
  hasAiRuntimeMarker,
@@ -92315,20 +93004,26 @@ async function runCommandCaptureOptional(command, args) {
92315
93004
  isOriginalParentProcessAlive,
92316
93005
  isPrereleaseVersion,
92317
93006
  isRetryableOpenClawGatewayError,
93007
+ killProcessTree,
92318
93008
  normalizeAiProvider,
92319
93009
  normalizeHermesOkxA2aPluginConfig,
92320
93010
  notifyAgentMessageToUserAttention,
92321
93011
  notifySystemMessageToUser,
92322
93012
  notifyUserAttentionChanged,
92323
93013
  parsePluginYamlVersion,
93014
+ parseWindowsParentProcessJson,
93015
+ pickOnchainosWin32Candidate,
92324
93016
  processFileMessage,
92325
93017
  readAiProviderTimeoutMs,
93018
+ readLastLines,
93019
+ readParentProcessCommandForPlatform,
92326
93020
  readUserAttentionWatcherEvent,
92327
93021
  registerUserAttentionWatcher,
92328
93022
  removeUserAttentionWatcher,
92329
93023
  resolveAiPermissionPreset,
92330
93024
  resolveAiProviderCommand,
92331
93025
  resolveAiProviderForDispatch,
93026
+ resolveCodexCommandPath,
92332
93027
  resolveConfiguredAiProvider,
92333
93028
  resolveConfiguredAiProviderForJob,
92334
93029
  resolveDirectCommunicationSessionTarget,
@@ -92342,12 +93037,16 @@ async function runCommandCaptureOptional(command, args) {
92342
93037
  resolveTaskHome,
92343
93038
  resolveTaskPaths,
92344
93039
  resolveUserAttentionIpcPath,
93040
+ resolveWindowsAutostartPaths,
92345
93041
  resolveXmtpClientRecycleIntervalSec,
92346
93042
  runAiAdapter,
92347
93043
  runListener,
92348
93044
  scanUserAttentionWatchers,
92349
93045
  setOpenClawWebSocketFactoryForTests,
92350
93046
  shouldKeepInboundGroupPendingForBuyer,
93047
+ shouldRouteThroughWindowsShell,
93048
+ spawnCompat,
93049
+ spawnSyncCompat,
92351
93050
  startCommandProcessor,
92352
93051
  startDaemon,
92353
93052
  startUserAttentionEventServer,
@@ -92357,6 +93056,7 @@ async function runCommandCaptureOptional(command, args) {
92357
93056
  subscribeUserAttentionEvents,
92358
93057
  switchProvider,
92359
93058
  toOpenClawGatewaySessionKey,
93059
+ toWindowsInvocation,
92360
93060
  writeAiPermissionPresetToConfig
92361
93061
  });
92362
93062
  /*! Bundled license information: