@yoooclaw/cli 0.0.8 → 0.1.0

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/bin.cjs CHANGED
@@ -63,7 +63,7 @@ var __export = (target, all) => {
63
63
  };
64
64
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
65
65
 
66
- // ../../node_modules/ws/lib/constants.js
66
+ // node_modules/ws/lib/constants.js
67
67
  var require_constants = __commonJS((exports2, module2) => {
68
68
  var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
69
69
  var hasBlob = typeof Blob !== "undefined";
@@ -83,7 +83,7 @@ var require_constants = __commonJS((exports2, module2) => {
83
83
  };
84
84
  });
85
85
 
86
- // ../../node_modules/ws/lib/buffer-util.js
86
+ // node_modules/ws/lib/buffer-util.js
87
87
  var require_buffer_util = __commonJS((exports2, module2) => {
88
88
  var { EMPTY_BUFFER } = require_constants();
89
89
  var FastBuffer = Buffer[Symbol.species];
@@ -161,7 +161,7 @@ var require_buffer_util = __commonJS((exports2, module2) => {
161
161
  }
162
162
  });
163
163
 
164
- // ../../node_modules/ws/lib/limiter.js
164
+ // node_modules/ws/lib/limiter.js
165
165
  var require_limiter = __commonJS((exports2, module2) => {
166
166
  var kDone = Symbol("kDone");
167
167
  var kRun = Symbol("kRun");
@@ -193,7 +193,7 @@ var require_limiter = __commonJS((exports2, module2) => {
193
193
  module2.exports = Limiter;
194
194
  });
195
195
 
196
- // ../../node_modules/ws/lib/permessage-deflate.js
196
+ // node_modules/ws/lib/permessage-deflate.js
197
197
  var require_permessage_deflate = __commonJS((exports2, module2) => {
198
198
  var zlib = require("zlib");
199
199
  var bufferUtil = require_buffer_util();
@@ -457,7 +457,7 @@ var require_permessage_deflate = __commonJS((exports2, module2) => {
457
457
  }
458
458
  });
459
459
 
460
- // ../../node_modules/ws/lib/validation.js
460
+ // node_modules/ws/lib/validation.js
461
461
  var require_validation = __commonJS((exports2, module2) => {
462
462
  var { isUtf8 } = require("buffer");
463
463
  var { hasBlob } = require_constants();
@@ -644,7 +644,7 @@ var require_validation = __commonJS((exports2, module2) => {
644
644
  }
645
645
  });
646
646
 
647
- // ../../node_modules/ws/lib/receiver.js
647
+ // node_modules/ws/lib/receiver.js
648
648
  var require_receiver = __commonJS((exports2, module2) => {
649
649
  var { Writable } = require("stream");
650
650
  var PerMessageDeflate = require_permessage_deflate();
@@ -672,6 +672,8 @@ var require_receiver = __commonJS((exports2, module2) => {
672
672
  this._binaryType = options.binaryType || BINARY_TYPES[0];
673
673
  this._extensions = options.extensions || {};
674
674
  this._isServer = !!options.isServer;
675
+ this._maxBufferedChunks = options.maxBufferedChunks | 0;
676
+ this._maxFragments = options.maxFragments | 0;
675
677
  this._maxPayload = options.maxPayload | 0;
676
678
  this._skipUTF8Validation = !!options.skipUTF8Validation;
677
679
  this[kWebSocket] = undefined;
@@ -694,6 +696,10 @@ var require_receiver = __commonJS((exports2, module2) => {
694
696
  _write(chunk, encoding, cb) {
695
697
  if (this._opcode === 8 && this._state == GET_INFO)
696
698
  return cb();
699
+ if (this._maxBufferedChunks > 0 && this._buffers.length >= this._maxBufferedChunks) {
700
+ cb(this.createError(RangeError, "Too many buffered chunks", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS"));
701
+ return;
702
+ }
697
703
  this._bufferedBytes += chunk.length;
698
704
  this._buffers.push(chunk);
699
705
  this.startLoop(cb);
@@ -897,6 +903,11 @@ var require_receiver = __commonJS((exports2, module2) => {
897
903
  return;
898
904
  }
899
905
  if (data.length) {
906
+ if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
907
+ const error = this.createError(RangeError, "Too many message fragments", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS");
908
+ cb(error);
909
+ return;
910
+ }
900
911
  this._messageLength = this._totalPayloadLength;
901
912
  this._fragments.push(data);
902
913
  }
@@ -914,6 +925,11 @@ var require_receiver = __commonJS((exports2, module2) => {
914
925
  cb(error);
915
926
  return;
916
927
  }
928
+ if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
929
+ const error = this.createError(RangeError, "Too many message fragments", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS");
930
+ cb(error);
931
+ return;
932
+ }
917
933
  this._fragments.push(buf);
918
934
  }
919
935
  this.dataMessage(cb);
@@ -1025,7 +1041,7 @@ var require_receiver = __commonJS((exports2, module2) => {
1025
1041
  module2.exports = Receiver;
1026
1042
  });
1027
1043
 
1028
- // ../../node_modules/ws/lib/sender.js
1044
+ // node_modules/ws/lib/sender.js
1029
1045
  var require_sender = __commonJS((exports2, module2) => {
1030
1046
  var { Duplex } = require("stream");
1031
1047
  var { randomFillSync } = require("crypto");
@@ -1384,7 +1400,7 @@ var require_sender = __commonJS((exports2, module2) => {
1384
1400
  }
1385
1401
  });
1386
1402
 
1387
- // ../../node_modules/ws/lib/event-target.js
1403
+ // node_modules/ws/lib/event-target.js
1388
1404
  var require_event_target = __commonJS((exports2, module2) => {
1389
1405
  var { kForOnEventAttribute, kListener } = require_constants();
1390
1406
  var kCode = Symbol("kCode");
@@ -1535,7 +1551,7 @@ var require_event_target = __commonJS((exports2, module2) => {
1535
1551
  }
1536
1552
  });
1537
1553
 
1538
- // ../../node_modules/ws/lib/extension.js
1554
+ // node_modules/ws/lib/extension.js
1539
1555
  var require_extension = __commonJS((exports2, module2) => {
1540
1556
  var { tokenChars } = require_validation();
1541
1557
  function push(dest, name, elem) {
@@ -1700,7 +1716,7 @@ var require_extension = __commonJS((exports2, module2) => {
1700
1716
  module2.exports = { format, parse };
1701
1717
  });
1702
1718
 
1703
- // ../../node_modules/ws/lib/websocket.js
1719
+ // node_modules/ws/lib/websocket.js
1704
1720
  var require_websocket = __commonJS((exports2, module2) => {
1705
1721
  var EventEmitter = require("events");
1706
1722
  var https = require("https");
@@ -1821,6 +1837,8 @@ var require_websocket = __commonJS((exports2, module2) => {
1821
1837
  binaryType: this.binaryType,
1822
1838
  extensions: this._extensions,
1823
1839
  isServer: this._isServer,
1840
+ maxBufferedChunks: options.maxBufferedChunks,
1841
+ maxFragments: options.maxFragments,
1824
1842
  maxPayload: options.maxPayload,
1825
1843
  skipUTF8Validation: options.skipUTF8Validation
1826
1844
  });
@@ -2063,6 +2081,8 @@ var require_websocket = __commonJS((exports2, module2) => {
2063
2081
  autoPong: true,
2064
2082
  closeTimeout: CLOSE_TIMEOUT,
2065
2083
  protocolVersion: protocolVersions[1],
2084
+ maxBufferedChunks: 1024 * 1024,
2085
+ maxFragments: 128 * 1024,
2066
2086
  maxPayload: 100 * 1024 * 1024,
2067
2087
  skipUTF8Validation: false,
2068
2088
  perMessageDeflate: true,
@@ -2301,6 +2321,8 @@ var require_websocket = __commonJS((exports2, module2) => {
2301
2321
  websocket.setSocket(socket, head, {
2302
2322
  allowSynchronousEvents: opts.allowSynchronousEvents,
2303
2323
  generateMask: opts.generateMask,
2324
+ maxBufferedChunks: opts.maxBufferedChunks,
2325
+ maxFragments: opts.maxFragments,
2304
2326
  maxPayload: opts.maxPayload,
2305
2327
  skipUTF8Validation: opts.skipUTF8Validation
2306
2328
  });
@@ -2466,7 +2488,7 @@ var require_websocket = __commonJS((exports2, module2) => {
2466
2488
  }
2467
2489
  });
2468
2490
 
2469
- // ../../node_modules/ws/lib/stream.js
2491
+ // node_modules/ws/lib/stream.js
2470
2492
  var require_stream = __commonJS((exports2, module2) => {
2471
2493
  var WebSocket = require_websocket();
2472
2494
  var { Duplex } = require("stream");
@@ -2569,7 +2591,7 @@ var require_stream = __commonJS((exports2, module2) => {
2569
2591
  module2.exports = createWebSocketStream;
2570
2592
  });
2571
2593
 
2572
- // ../../node_modules/ws/lib/subprotocol.js
2594
+ // node_modules/ws/lib/subprotocol.js
2573
2595
  var require_subprotocol = __commonJS((exports2, module2) => {
2574
2596
  var { tokenChars } = require_validation();
2575
2597
  function parse(header) {
@@ -2614,7 +2636,7 @@ var require_subprotocol = __commonJS((exports2, module2) => {
2614
2636
  module2.exports = { parse };
2615
2637
  });
2616
2638
 
2617
- // ../../node_modules/ws/lib/websocket-server.js
2639
+ // node_modules/ws/lib/websocket-server.js
2618
2640
  var require_websocket_server = __commonJS((exports2, module2) => {
2619
2641
  var EventEmitter = require("events");
2620
2642
  var http = require("http");
@@ -2636,6 +2658,8 @@ var require_websocket_server = __commonJS((exports2, module2) => {
2636
2658
  options = {
2637
2659
  allowSynchronousEvents: true,
2638
2660
  autoPong: true,
2661
+ maxBufferedChunks: 1024 * 1024,
2662
+ maxFragments: 128 * 1024,
2639
2663
  maxPayload: 100 * 1024 * 1024,
2640
2664
  skipUTF8Validation: false,
2641
2665
  perMessageDeflate: false,
@@ -2862,6 +2886,8 @@ var require_websocket_server = __commonJS((exports2, module2) => {
2862
2886
  socket.removeListener("error", socketOnError);
2863
2887
  ws.setSocket(socket, head, {
2864
2888
  allowSynchronousEvents: this.options.allowSynchronousEvents,
2889
+ maxBufferedChunks: this.options.maxBufferedChunks,
2890
+ maxFragments: this.options.maxFragments,
2865
2891
  maxPayload: this.options.maxPayload,
2866
2892
  skipUTF8Validation: this.options.skipUTF8Validation
2867
2893
  });
@@ -2920,7 +2946,7 @@ var require_websocket_server = __commonJS((exports2, module2) => {
2920
2946
  }
2921
2947
  });
2922
2948
 
2923
- // ../../node_modules/openclaw/dist/json-files-DMrq2IfK.js
2949
+ // node_modules/openclaw/dist/json-files-DMrq2IfK.js
2924
2950
  async function readJsonFile2(filePath) {
2925
2951
  try {
2926
2952
  const raw = await import_promises4.default.readFile(filePath, "utf8");
@@ -3003,7 +3029,7 @@ var init_json_files_DMrq2IfK = __esm(() => {
3003
3029
  import_node_crypto5 = require("node:crypto");
3004
3030
  });
3005
3031
 
3006
- // ../../node_modules/openclaw/dist/home-dir-BnP38vVl.js
3032
+ // node_modules/openclaw/dist/home-dir-BnP38vVl.js
3007
3033
  function normalize(value) {
3008
3034
  const trimmed = value?.trim();
3009
3035
  if (!trimmed)
@@ -3076,7 +3102,7 @@ var init_home_dir_BnP38vVl = __esm(() => {
3076
3102
  import_node_os4 = __toESM(require("node:os"));
3077
3103
  });
3078
3104
 
3079
- // ../../node_modules/openclaw/dist/paths-Y4UT24Of.js
3105
+ // node_modules/openclaw/dist/paths-Y4UT24Of.js
3080
3106
  function resolveIsNixMode(env = process.env) {
3081
3107
  return env.OPENCLAW_NIX_MODE === "1";
3082
3108
  }
@@ -3172,7 +3198,7 @@ var init_paths_Y4UT24Of = __esm(() => {
3172
3198
  CONFIG_PATH = resolveConfigPathCandidate();
3173
3199
  });
3174
3200
 
3175
- // ../../node_modules/openclaw/dist/pairing-token-C5g4QivV.js
3201
+ // node_modules/openclaw/dist/pairing-token-C5g4QivV.js
3176
3202
  function normalizeScopeList(scopes) {
3177
3203
  const out = /* @__PURE__ */ new Set;
3178
3204
  for (const scope of scopes) {
@@ -3248,7 +3274,7 @@ var init_pairing_token_C5g4QivV = __esm(() => {
3248
3274
  import_node_crypto6 = require("node:crypto");
3249
3275
  });
3250
3276
 
3251
- // ../../node_modules/openclaw/dist/device-auth-BRUxebMD.js
3277
+ // node_modules/openclaw/dist/device-auth-BRUxebMD.js
3252
3278
  function normalizeDeviceAuthRole2(role) {
3253
3279
  return role.trim();
3254
3280
  }
@@ -3270,7 +3296,7 @@ function normalizeDeviceAuthScopes2(scopes) {
3270
3296
  }
3271
3297
  var init_device_auth_BRUxebMD = () => {};
3272
3298
 
3273
- // ../../node_modules/openclaw/dist/device-pairing-DeNkV6bj.js
3299
+ // node_modules/openclaw/dist/device-pairing-DeNkV6bj.js
3274
3300
  async function loadState(baseDir) {
3275
3301
  const { pendingPath, pairedPath } = resolvePairingPaths(baseDir, "devices");
3276
3302
  const [pending, paired] = await Promise.all([readJsonFile2(pendingPath), readJsonFile2(pairedPath)]);
@@ -3432,7 +3458,7 @@ var init_device_pairing_DeNkV6bj = __esm(() => {
3432
3458
  withLock = createAsyncLock();
3433
3459
  });
3434
3460
 
3435
- // ../../node_modules/openclaw/dist/device-bootstrap-DKsEcfsd.js
3461
+ // node_modules/openclaw/dist/device-bootstrap-DKsEcfsd.js
3436
3462
  function normalizeBootstrapRoles(roles) {
3437
3463
  if (!Array.isArray(roles))
3438
3464
  return [];
@@ -3550,13 +3576,13 @@ var init_device_bootstrap_DKsEcfsd = __esm(() => {
3550
3576
  withLock2 = createAsyncLock();
3551
3577
  });
3552
3578
 
3553
- // ../../node_modules/openclaw/dist/device-bootstrap-DTI1FU3A.js
3579
+ // node_modules/openclaw/dist/device-bootstrap-DTI1FU3A.js
3554
3580
  var init_device_bootstrap_DTI1FU3A = __esm(() => {
3555
3581
  init_device_pairing_DeNkV6bj();
3556
3582
  init_device_bootstrap_DKsEcfsd();
3557
3583
  });
3558
3584
 
3559
- // ../../node_modules/openclaw/dist/plugin-sdk/device-bootstrap.js
3585
+ // node_modules/openclaw/dist/plugin-sdk/device-bootstrap.js
3560
3586
  var exports_device_bootstrap = {};
3561
3587
  __export(exports_device_bootstrap, {
3562
3588
  sameDeviceBootstrapProfile: () => sameDeviceBootstrapProfile,
@@ -4245,12 +4271,12 @@ function buildContext(flags) {
4245
4271
  var import_node_fs3 = require("node:fs");
4246
4272
  function readBuildInjectedVersion() {
4247
4273
  if (false) {}
4248
- const version = "0.0.8".trim();
4274
+ const version = "0.1.0".trim();
4249
4275
  return version || undefined;
4250
4276
  }
4251
4277
  function readVersionFromPackageJson() {
4252
4278
  try {
4253
- const packageJsonUrl = new URL("../package.json", "file:///home/runner/work/openclaw-plugin/openclaw-plugin/packages/cli/src/version.ts");
4279
+ const packageJsonUrl = new URL("../package.json", "file:///home/runner/work/cli/cli/src/version.ts");
4254
4280
  const packageJson = JSON.parse(import_node_fs3.readFileSync(packageJsonUrl, "utf-8"));
4255
4281
  const version = packageJson.version?.trim();
4256
4282
  return version || undefined;
@@ -5409,7 +5435,7 @@ async function authCheck(ctx) {
5409
5435
  // src/notification/query.ts
5410
5436
  var import_node_fs20 = require("node:fs");
5411
5437
 
5412
- // ../phone-notifications/src/cli/helpers.ts
5438
+ // src/vendor/cli/helpers.ts
5413
5439
  var import_node_fs8 = require("node:fs");
5414
5440
  var import_promises2 = require("node:fs/promises");
5415
5441
  var import_node_path4 = require("node:path");
@@ -5495,7 +5521,7 @@ function readRecordingIndex(dir) {
5495
5521
  }
5496
5522
  }
5497
5523
 
5498
- // ../phone-notifications/src/cli/ntf-query.ts
5524
+ // src/vendor/cli/ntf-query.ts
5499
5525
  function matchesNotificationQuery(item, opts) {
5500
5526
  if (opts.client && opts.client !== "all") {
5501
5527
  const label = item.clientLabel ?? "legacy";
@@ -5552,12 +5578,12 @@ async function collectMatchingNotifications(dir, opts) {
5552
5578
  }
5553
5579
  return sortNotificationsByTimestampDesc(results).slice(0, opts.limit);
5554
5580
  }
5555
- // ../phone-notifications/src/notification/storage.ts
5581
+ // src/vendor/notification/storage.ts
5556
5582
  var import_node_fs9 = require("node:fs");
5557
5583
  var import_node_crypto2 = require("node:crypto");
5558
5584
  var import_node_path5 = require("node:path");
5559
5585
 
5560
- // ../phone-notifications/src/notification/feishu-normalize.ts
5586
+ // src/vendor/notification/feishu-normalize.ts
5561
5587
  function normalizeOptionalText(value) {
5562
5588
  if (typeof value !== "string") {
5563
5589
  return;
@@ -5682,7 +5708,7 @@ function normalizeFeishuFields(n) {
5682
5708
  };
5683
5709
  }
5684
5710
 
5685
- // ../phone-notifications/src/ingest-context.ts
5711
+ // src/vendor/ingest-context.ts
5686
5712
  var import_node_async_hooks = require("node:async_hooks");
5687
5713
  var storage = new import_node_async_hooks.AsyncLocalStorage;
5688
5714
  function runWithIngestContext(context, fn) {
@@ -5695,7 +5721,7 @@ function currentClientLabel(fallback = "legacy") {
5695
5721
  return getIngestContext().clientLabel?.trim() || fallback;
5696
5722
  }
5697
5723
 
5698
- // ../phone-notifications/src/notification/storage.ts
5724
+ // src/vendor/notification/storage.ts
5699
5725
  var ID_INDEX_DIR_NAME = ".ids";
5700
5726
  var CONTENT_KEY_INDEX_DIR_NAME = ".keys";
5701
5727
  function computeLagMs(timestamp) {
@@ -6017,10 +6043,10 @@ class NotificationStorage {
6017
6043
  this.dateWriteChains.clear();
6018
6044
  }
6019
6045
  }
6020
- // ../phone-notifications/src/plugin/notifications.ts
6046
+ // src/vendor/plugin/notifications.ts
6021
6047
  var import_node_crypto3 = require("node:crypto");
6022
6048
 
6023
- // ../phone-notifications/src/tunnel/utils.ts
6049
+ // src/vendor/tunnel/utils.ts
6024
6050
  function previewText(text, max = 200) {
6025
6051
  if (!text)
6026
6052
  return "";
@@ -6078,7 +6104,7 @@ function summarizeRequestHeaders(headers) {
6078
6104
  return parts.length ? `, ${parts.join(", ")}` : "";
6079
6105
  }
6080
6106
 
6081
- // ../phone-notifications/src/tunnel/http-proxy.ts
6107
+ // src/vendor/tunnel/http-proxy.ts
6082
6108
  var RELAY_INTERNAL_HTTP_HEADER = "x-openclaw-relay-internal";
6083
6109
  var PATH_MAP = {
6084
6110
  "/api/message/messageBridge/send": "/notifications"
@@ -6248,7 +6274,7 @@ async function streamResponse(opts, requestId, res, startedAtMs) {
6248
6274
  }
6249
6275
  }
6250
6276
 
6251
- // ../phone-notifications/src/plugin/shared.ts
6277
+ // src/vendor/plugin/shared.ts
6252
6278
  function readBody(req) {
6253
6279
  return new Promise((resolve, reject) => {
6254
6280
  const chunks = [];
@@ -6265,7 +6291,7 @@ function trimToUndefined(value) {
6265
6291
  return trimmed || undefined;
6266
6292
  }
6267
6293
 
6268
- // ../phone-notifications/src/plugin/notifications.ts
6294
+ // src/vendor/plugin/notifications.ts
6269
6295
  function newIngestId() {
6270
6296
  return `ing_${import_node_crypto3.randomBytes(4).toString("hex")}`;
6271
6297
  }
@@ -6410,11 +6436,11 @@ function registerNotificationInterfaces(deps) {
6410
6436
  logger.info("Gateway 通知方法已注册: notifications.push");
6411
6437
  logger.info("HTTP 通知端点已注册: POST /notifications");
6412
6438
  }
6413
- // ../phone-notifications/src/recording/storage.ts
6439
+ // src/vendor/recording/storage.ts
6414
6440
  var import_node_fs10 = require("node:fs");
6415
6441
  var import_node_path6 = require("node:path");
6416
6442
 
6417
- // ../phone-notifications/src/recording/state-machine.ts
6443
+ // src/vendor/recording/state-machine.ts
6418
6444
  var VALID_TRANSITIONS = new Map([
6419
6445
  ["receiving_failed", new Set(["receiving"])],
6420
6446
  ["receiving", new Set(["pending_oss_upload"])],
@@ -6452,7 +6478,7 @@ class TransitionError extends Error {
6452
6478
  }
6453
6479
  }
6454
6480
 
6455
- // ../phone-notifications/src/recording/transcript-document.ts
6481
+ // src/vendor/recording/transcript-document.ts
6456
6482
  var TRANSCRIPT_DOCUMENT_SCHEMA_VERSION = 1;
6457
6483
  function buildTranscriptDataFilename(recordingId) {
6458
6484
  return `${recordingId}.json`;
@@ -6650,7 +6676,7 @@ function normalizeOptionalInteger(value) {
6650
6676
  return Number.isInteger(value) ? Number(value) : undefined;
6651
6677
  }
6652
6678
 
6653
- // ../phone-notifications/src/recording/storage.ts
6679
+ // src/vendor/recording/storage.ts
6654
6680
  function extractAudioExt(ossUrl) {
6655
6681
  try {
6656
6682
  const pathname = new URL(ossUrl).pathname;
@@ -7133,7 +7159,7 @@ class RecordingStorage {
7133
7159
  }
7134
7160
  async close() {}
7135
7161
  }
7136
- // ../phone-notifications/src/recording/downloader.ts
7162
+ // src/vendor/recording/downloader.ts
7137
7163
  var import_node_fs11 = require("node:fs");
7138
7164
  var import_node_path7 = require("node:path");
7139
7165
  var import_promises3 = require("node:stream/promises");
@@ -7209,18 +7235,18 @@ function formatBytes(bytes) {
7209
7235
  function sleep(ms) {
7210
7236
  return new Promise((resolve) => setTimeout(resolve, ms));
7211
7237
  }
7212
- // ../phone-notifications/src/recording/asr.ts
7238
+ // src/vendor/recording/asr.ts
7213
7239
  var import_node_fs16 = require("node:fs");
7214
7240
  var import_node_path11 = require("node:path");
7215
7241
 
7216
- // ../phone-notifications/src/auth/credentials.ts
7242
+ // src/vendor/auth/credentials.ts
7217
7243
  var import_node_fs14 = require("node:fs");
7218
7244
 
7219
- // ../phone-notifications/src/profile/detect.ts
7245
+ // src/vendor/profile/detect.ts
7220
7246
  var import_node_fs13 = require("node:fs");
7221
7247
  var import_node_path9 = require("node:path");
7222
7248
 
7223
- // ../phone-notifications/src/profile/paths.ts
7249
+ // src/vendor/profile/paths.ts
7224
7250
  var import_node_fs12 = require("node:fs");
7225
7251
  var import_node_path8 = require("node:path");
7226
7252
  var DEFAULT_JVSCLAW_STATE_DIR = "/home/admin/.openclaw";
@@ -7324,7 +7350,7 @@ function resolvePersistedProfileStateDirs() {
7324
7350
  return dirs;
7325
7351
  }
7326
7352
 
7327
- // ../phone-notifications/src/profile/detect.ts
7353
+ // src/vendor/profile/detect.ts
7328
7354
  var VALID_CLAW_KINDS = new Set([
7329
7355
  "openclaw",
7330
7356
  "arkclaw",
@@ -7398,7 +7424,7 @@ function resolveClawKind() {
7398
7424
  }
7399
7425
  return "openclaw";
7400
7426
  }
7401
- // ../phone-notifications/src/profile/runtime-paths.ts
7427
+ // src/vendor/profile/runtime-paths.ts
7402
7428
  var import_node_path10 = require("node:path");
7403
7429
  function resolveStateDir(hostStateDir) {
7404
7430
  const override = resolvePluginStateDirOverrideFromEnv();
@@ -7413,7 +7439,7 @@ function resolveStateDir(hostStateDir) {
7413
7439
  function resolveStateFile(filename, hostStateDir) {
7414
7440
  return import_node_path10.join(resolveStateDir(hostStateDir), filename);
7415
7441
  }
7416
- // ../phone-notifications/src/auth/credentials.ts
7442
+ // src/vendor/auth/credentials.ts
7417
7443
  var API_KEY_ENV2 = "YOOOCLAW_API_KEY";
7418
7444
  function credentialsPath() {
7419
7445
  return resolveStateFile("credentials.json");
@@ -7458,7 +7484,7 @@ function requireApiKey() {
7458
7484
  return apiKey;
7459
7485
  }
7460
7486
 
7461
- // ../phone-notifications/src/env.ts
7487
+ // src/vendor/env.ts
7462
7488
  var import_node_fs15 = require("node:fs");
7463
7489
  function parseEnvContent(content) {
7464
7490
  const entries = new Map;
@@ -7512,7 +7538,6 @@ function buildEnvUrls(host) {
7512
7538
  appNameMapUrl: `${https}/api/application-config/app-package/config-all`,
7513
7539
  modelProxyLongRecordingSubmitTaskUrl: `${https}/api/model-proxy/long-recording/submit-task`,
7514
7540
  modelProxyLongRecordingQueryTaskResultBaseUrl: `${https}/api/model-proxy/long-recording/query-task-result`,
7515
- accountFileDeleteUrl: `${https}/api/account/file/delete`,
7516
7541
  gatewayConnectStatusUrl: `${https}/api/message/messageBridge/plugin/gateway-connect-status`,
7517
7542
  clawManagerInstanceReadyUrl: `${https}/claw-manager/internal/claw-manager/instance/ready`
7518
7543
  };
@@ -7550,7 +7575,7 @@ function getEnvUrls(env) {
7550
7575
  return buildEnvUrls(getEnvHost(env ?? loadEnvName()));
7551
7576
  }
7552
7577
 
7553
- // ../phone-notifications/src/recording/asr.ts
7578
+ // src/vendor/recording/asr.ts
7554
7579
  var DEFAULT_LONG_RECORDING_POLL_INTERVAL_MS = 2000;
7555
7580
  var DEFAULT_LONG_RECORDING_MAX_POLL_ATTEMPTS = 3600;
7556
7581
  var LONG_RECORDING_RUNNING_STATUSES = new Set(["PENDING", "RUNNING", "SUSPENDED"]);
@@ -8204,7 +8229,7 @@ function formatTranscriptSegmentText(segment) {
8204
8229
  }
8205
8230
  return text;
8206
8231
  }
8207
- // ../phone-notifications/src/recording/whisper-local.ts
8232
+ // src/vendor/recording/whisper-local.ts
8208
8233
  var MODEL_DISK_SIZES = {
8209
8234
  tiny: 75 * 1024 * 1024,
8210
8235
  base: 140 * 1024 * 1024,
@@ -8212,121 +8237,7 @@ var MODEL_DISK_SIZES = {
8212
8237
  medium: 1500 * 1024 * 1024,
8213
8238
  "large-v3": 3000 * 1024 * 1024
8214
8239
  };
8215
- // ../phone-notifications/src/recording/account-oss.ts
8216
- var DEFAULT_DELETE_MAX_ATTEMPTS = 3;
8217
- var DEFAULT_DELETE_BACKOFF_MS = 500;
8218
- function getDeleteMaxAttempts() {
8219
- const raw = process.env.OPENCLAW_OSS_DELETE_MAX_ATTEMPTS;
8220
- if (raw) {
8221
- const parsed = Number(raw);
8222
- if (Number.isFinite(parsed) && parsed >= 1)
8223
- return Math.floor(parsed);
8224
- }
8225
- return DEFAULT_DELETE_MAX_ATTEMPTS;
8226
- }
8227
- function getDeleteBackoffMs() {
8228
- const raw = process.env.OPENCLAW_OSS_DELETE_BACKOFF_MS;
8229
- if (raw) {
8230
- const parsed = Number(raw);
8231
- if (Number.isFinite(parsed) && parsed >= 0)
8232
- return parsed;
8233
- }
8234
- return DEFAULT_DELETE_BACKOFF_MS;
8235
- }
8236
- function sleep3(ms) {
8237
- return new Promise((resolve) => setTimeout(resolve, ms));
8238
- }
8239
- function isRetryableStatus(status) {
8240
- return status === 429 || status >= 500;
8241
- }
8242
- function parseBody(text) {
8243
- if (!text)
8244
- return;
8245
- try {
8246
- return JSON.parse(text);
8247
- } catch {
8248
- return "invalid-json";
8249
- }
8250
- }
8251
- function extractCode(payload) {
8252
- if (!payload)
8253
- return;
8254
- if (typeof payload.code === "number")
8255
- return String(payload.code);
8256
- return payload.code?.trim?.();
8257
- }
8258
- async function attemptDelete(endpoint, headerKey, logger) {
8259
- let res;
8260
- try {
8261
- res = await fetch(endpoint, {
8262
- method: "POST",
8263
- headers: { "X-Api-Key-Id": headerKey }
8264
- });
8265
- } catch (err) {
8266
- return { kind: "retryable", error: err?.message ?? String(err) };
8267
- }
8268
- const text = await res.text();
8269
- if (!res.ok) {
8270
- const error = `HTTP ${res.status} ${text.slice(0, 200)}`;
8271
- if (isRetryableStatus(res.status)) {
8272
- return { kind: "retryable", error };
8273
- }
8274
- logger.warn(`[account-oss-delete] HTTP 错误: status=${res.status}, body=${text.slice(0, 300)}`);
8275
- return { kind: "permanent", error };
8276
- }
8277
- const payload = parseBody(text);
8278
- if (payload === "invalid-json") {
8279
- logger.warn(`[account-oss-delete] 响应非 JSON: body=${text.slice(0, 300)}`);
8280
- return { kind: "permanent", error: "response is not JSON" };
8281
- }
8282
- const code = extractCode(payload);
8283
- if (code !== "000000") {
8284
- const msg = payload?.msg?.trim?.() || text.slice(0, 200);
8285
- logger.warn(`[account-oss-delete] 业务失败: code=${code ?? "n/a"}, msg=${msg}`);
8286
- return { kind: "permanent", error: `${code ?? "unknown"} ${msg}`.trim() };
8287
- }
8288
- return { kind: "ok" };
8289
- }
8290
- async function deleteAccountOssFile(fileUrl, logger, options) {
8291
- const trimmed = fileUrl?.trim();
8292
- if (!trimmed) {
8293
- return { ok: false, error: "fileUrl is empty" };
8294
- }
8295
- const apiKey = loadApiKey();
8296
- if (!apiKey) {
8297
- return { ok: false, error: "API Key 未设置,跳过 OSS 文件删除" };
8298
- }
8299
- const baseEndpoint = getEnvUrls().accountFileDeleteUrl;
8300
- const headerKey = apiKey.startsWith("Bearer ") ? apiKey.slice("Bearer ".length) : apiKey;
8301
- const url = new URL(baseEndpoint);
8302
- url.searchParams.set("fileUrl", trimmed);
8303
- const endpoint = url.toString();
8304
- const maxAttempts = Math.max(1, Math.floor(options?.maxAttempts ?? getDeleteMaxAttempts()));
8305
- const baseBackoff = Math.max(0, options?.backoffMs ?? getDeleteBackoffMs());
8306
- logger.info(`[account-oss-delete] 提交 OSS 文件删除: endpoint=${endpoint}, maxAttempts=${maxAttempts}`);
8307
- let lastError = "unknown error";
8308
- for (let attempt = 1;attempt <= maxAttempts; attempt++) {
8309
- const outcome = await attemptDelete(endpoint, headerKey, logger);
8310
- if (outcome.kind === "ok") {
8311
- logger.info(`[account-oss-delete] OSS 文件已删除: fileUrl=${trimmed}`);
8312
- return { ok: true };
8313
- }
8314
- if (outcome.kind === "permanent") {
8315
- return { ok: false, error: outcome.error };
8316
- }
8317
- lastError = outcome.error;
8318
- if (attempt < maxAttempts) {
8319
- const delay = baseBackoff * Math.pow(2, attempt - 1);
8320
- logger.warn(`[account-oss-delete] 临时失败 (attempt ${attempt}/${maxAttempts}): ${outcome.error}, ${delay}ms 后重试`);
8321
- await sleep3(delay);
8322
- } else {
8323
- logger.warn(`[account-oss-delete] 临时失败 (attempt ${attempt}/${maxAttempts}, 放弃): ${outcome.error}`);
8324
- }
8325
- }
8326
- return { ok: false, error: lastError };
8327
- }
8328
-
8329
- // ../phone-notifications/src/recording/handler.ts
8240
+ // src/vendor/recording/handler.ts
8330
8241
  function emitRecordingStatus(recordingId, storage2, logger, notifyStatus, error, extras) {
8331
8242
  if (!notifyStatus) {
8332
8243
  return;
@@ -8464,12 +8375,6 @@ async function triggerTranscription(recordingId, storage2, asrConfig, logger, op
8464
8375
  title: result.title ?? ""
8465
8376
  });
8466
8377
  logger.info(`[asr-trigger] 转写完成: ${recordingId}, summary="${result.summary}"`);
8467
- const ossAudioUrl = entry.metadata.oss_audio_url?.trim();
8468
- if (ossAudioUrl) {
8469
- deleteAccountOssFile(ossAudioUrl, logger).catch((err) => {
8470
- logger.warn(`[asr-trigger] OSS 音频清理异常 (非致命): ${recordingId}, ${err?.message ?? err}`);
8471
- });
8472
- }
8473
8378
  } else {
8474
8379
  const error = result.error ?? "ASR 转写失败";
8475
8380
  storage2.updateStatus(recordingId, "transcribe_failed");
@@ -8478,7 +8383,7 @@ async function triggerTranscription(recordingId, storage2, asrConfig, logger, op
8478
8383
  logger.error(`[asr-trigger] 转写失败: ${recordingId}, error=${error}`);
8479
8384
  }
8480
8385
  }
8481
- // ../phone-notifications/src/plugin/recordings.ts
8386
+ // src/vendor/plugin/recordings.ts
8482
8387
  var RECORDING_TRANSFER_STATUSES = new Set([
8483
8388
  "receiving_failed",
8484
8389
  "receiving",
@@ -8854,11 +8759,11 @@ function registerRecordingInterfaces(deps) {
8854
8759
  logger.info("Gateway 录音方法已注册: recordings.sync / recordings.list / recordings.status / recordings.rename / recordings.delete / recordings.retranscribe / recordings.asr.init");
8855
8760
  logger.info("HTTP 录音端点已注册: POST /recordings");
8856
8761
  }
8857
- // ../phone-notifications/src/light-rules/storage.ts
8762
+ // src/vendor/light-rules/storage.ts
8858
8763
  var import_node_fs17 = require("node:fs");
8859
8764
  var import_node_path12 = require("node:path");
8860
8765
 
8861
- // ../phone-notifications/src/light/repeat.ts
8766
+ // src/vendor/light/repeat.ts
8862
8767
  function normalizeRepeatTimes(input) {
8863
8768
  if (typeof input === "boolean") {
8864
8769
  return input ? 0 : 1;
@@ -8889,7 +8794,7 @@ function validateRepeatTimes(value) {
8889
8794
  return value;
8890
8795
  }
8891
8796
 
8892
- // ../phone-notifications/src/light-rules/storage.ts
8797
+ // src/vendor/light-rules/storage.ts
8893
8798
  function addUniquePath(paths, path) {
8894
8799
  if (!path)
8895
8800
  return;
@@ -9110,7 +9015,7 @@ class LightRuleError extends Error {
9110
9015
  }
9111
9016
  }
9112
9017
 
9113
- // ../phone-notifications/src/light-rules/registry.ts
9018
+ // src/vendor/light-rules/registry.ts
9114
9019
  class LightRuleRegistry {
9115
9020
  ctx;
9116
9021
  index = new Map;
@@ -9182,7 +9087,7 @@ class LightRuleRegistry {
9182
9087
  return next;
9183
9088
  }
9184
9089
  }
9185
- // ../phone-notifications/src/light/validators.ts
9090
+ // src/vendor/light/validators.ts
9186
9091
  var VALID_MODES = [
9187
9092
  "wave",
9188
9093
  "breath",
@@ -9426,7 +9331,7 @@ function isRecord(value) {
9426
9331
  return value !== null && typeof value === "object" && !Array.isArray(value);
9427
9332
  }
9428
9333
 
9429
- // ../phone-notifications/src/light-rules/names.ts
9334
+ // src/vendor/light-rules/names.ts
9430
9335
  var LIGHT_RULE_GATEWAY_METHODS = {
9431
9336
  list: "lightrules.list",
9432
9337
  create: "lightrules.create",
@@ -9452,7 +9357,7 @@ var LIGHT_RULE_TOOL_NAME_LIST = [
9452
9357
  LIGHT_RULE_TOOL_NAMES.delete
9453
9358
  ];
9454
9359
 
9455
- // ../phone-notifications/src/light-rules/gateway.ts
9360
+ // src/vendor/light-rules/gateway.ts
9456
9361
  function resolveRuleIdentifier(params) {
9457
9362
  if (!params || typeof params !== "object")
9458
9363
  return;
@@ -9659,10 +9564,10 @@ function registerLightRulesGateway(api, registry, logger, rememberBroadcast) {
9659
9564
  }
9660
9565
  });
9661
9566
  }
9662
- // ../phone-notifications/src/light/sender.ts
9567
+ // src/vendor/light/sender.ts
9663
9568
  var import_node_crypto4 = require("node:crypto");
9664
9569
 
9665
- // ../phone-notifications/src/light/protocol.ts
9570
+ // src/vendor/light/protocol.ts
9666
9571
  var MAX_LIGHT_SEGMENTS = 12;
9667
9572
  var PROTOCOL_DIGITS = [
9668
9573
  "€",
@@ -9876,7 +9781,7 @@ function quantizeWindow(value) {
9876
9781
  return value - 1;
9877
9782
  }
9878
9783
 
9879
- // ../phone-notifications/src/light/sender.ts
9784
+ // src/vendor/light/sender.ts
9880
9785
  async function sendLightEffect(apiKey, segments, logger, repeatInput, reason, title) {
9881
9786
  const apiUrl = getEnvUrls().lightApiUrl;
9882
9787
  const appKey = "";
@@ -9931,7 +9836,7 @@ function resolveLightTitle(title, reason, segments) {
9931
9836
  const modeDesc = segments.map((segment) => segment.mode).join("+");
9932
9837
  return `Effect: ${modeDesc || "custom"}`;
9933
9838
  }
9934
- // ../phone-notifications/src/light/presets-v1.json
9839
+ // src/vendor/light/presets-v1.json
9935
9840
  var presets_v1_default = {
9936
9841
  version: "v1",
9937
9842
  presets: [
@@ -10119,11 +10024,11 @@ var presets_v1_default = {
10119
10024
  ]
10120
10025
  };
10121
10026
 
10122
- // ../phone-notifications/src/tunnel/relay-client.ts
10027
+ // src/vendor/tunnel/relay-client.ts
10123
10028
  var import_node_fs18 = require("node:fs");
10124
10029
  var import_node_path13 = require("node:path");
10125
10030
 
10126
- // ../../node_modules/ws/wrapper.mjs
10031
+ // node_modules/ws/wrapper.mjs
10127
10032
  var import_stream = __toESM(require_stream(), 1);
10128
10033
  var import_extension = __toESM(require_extension(), 1);
10129
10034
  var import_permessage_deflate = __toESM(require_permessage_deflate(), 1);
@@ -10134,7 +10039,7 @@ var import_websocket = __toESM(require_websocket(), 1);
10134
10039
  var import_websocket_server = __toESM(require_websocket_server(), 1);
10135
10040
  var wrapper_default = import_websocket.default;
10136
10041
 
10137
- // ../phone-notifications/src/tunnel/relay-client.ts
10042
+ // src/vendor/tunnel/relay-client.ts
10138
10043
  function previewText2(text, max = 500) {
10139
10044
  return text.length <= max ? text : `${text.substring(0, max)}…`;
10140
10045
  }
@@ -10566,10 +10471,10 @@ class RelayClient {
10566
10471
  }, delayMs);
10567
10472
  }
10568
10473
  }
10569
- // ../phone-notifications/src/tunnel/proxy.ts
10474
+ // src/vendor/tunnel/proxy.ts
10570
10475
  var import_node_crypto7 = require("node:crypto");
10571
10476
 
10572
- // ../phone-notifications/src/tunnel/device-identity.ts
10477
+ // src/vendor/tunnel/device-identity.ts
10573
10478
  var crypto = __toESM(require("node:crypto"));
10574
10479
  var fs = __toESM(require("node:fs"));
10575
10480
  var path = __toESM(require("node:path"));
@@ -10744,7 +10649,7 @@ function loadOrCreateDeviceIdentity(stateDir) {
10744
10649
  return identity;
10745
10650
  }
10746
10651
 
10747
- // ../phone-notifications/src/tunnel/ws-proxy.ts
10652
+ // src/vendor/tunnel/ws-proxy.ts
10748
10653
  var GATEWAY_WS_HANDSHAKE_TIMEOUT_MS = 1e4;
10749
10654
 
10750
10655
  class WsProxy {
@@ -10902,7 +10807,7 @@ class WsProxy {
10902
10807
  }
10903
10808
  }
10904
10809
 
10905
- // ../phone-notifications/src/tunnel/proxy.ts
10810
+ // src/vendor/tunnel/proxy.ts
10906
10811
  var RELAY_TUNNEL_GATEWAY_CLIENT_INSTANCE_ID = "phone-notifications-relay-tunnel";
10907
10812
  var GATEWAY_OPERATOR_SCOPES = [
10908
10813
  "operator.admin",
@@ -12606,7 +12511,7 @@ function candidateAnchorDirs() {
12606
12511
  out.push(import_node_path24.dirname(import_node_fs27.realpathSync(argv1)));
12607
12512
  } catch {}
12608
12513
  try {
12609
- const url = "file:///home/runner/work/openclaw-plugin/openclaw-plugin/packages/cli/src/commands/skills.ts";
12514
+ const url = "file:///home/runner/work/cli/cli/src/commands/skills.ts";
12610
12515
  if (url)
12611
12516
  out.push(import_node_path24.dirname(import_node_url.fileURLToPath(url)));
12612
12517
  } catch {}
@@ -14776,5 +14681,5 @@ async function run(argv = process.argv) {
14776
14681
  // src/bin.ts
14777
14682
  run(process.argv);
14778
14683
 
14779
- //# debugId=107EA7975B32481364756E2164756E21
14684
+ //# debugId=C46C4D424C7DCB9064756E2164756E21
14780
14685
  //# sourceMappingURL=bin.cjs.map