@openclaw/matrix 2026.7.2-beta.2 → 2026.7.2-beta.4

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.
Files changed (90) hide show
  1. package/dist/{account-selection-Bz00QTmQ.js → account-selection-kqquRzCf.js} +5 -5
  2. package/dist/api.js +6 -6
  3. package/dist/{approval-handler.runtime-BQZdg_dJ.js → approval-handler.runtime-AsawryfP.js} +4 -4
  4. package/dist/{approval-ids-De4IhOSN.js → approval-ids-XAMP8vN9.js} +1 -1
  5. package/dist/{approval-reaction-auth-BLJKPLku.js → approval-reaction-auth-DButmM13.js} +2 -2
  6. package/dist/auth-presence.js +13 -21
  7. package/dist/{channel-B1woOUgk.js → channel-MBtrY36B.js} +19 -13
  8. package/dist/channel-plugin-api.js +1 -1
  9. package/dist/{channel.runtime-BvJm9z0w.js → channel.runtime-Bi4Dgy2P.js} +15 -16
  10. package/dist/{cli-CLWOkMvw.js → cli-CcPuMyCk.js} +15 -12
  11. package/dist/{cli-metadata-9Naf7in0.js → cli-metadata-DAhDhbYX.js} +1 -1
  12. package/dist/cli-metadata.js +1 -1
  13. package/dist/{client-BUai6s29.js → client-BwX6rURh.js} +2 -2
  14. package/dist/{client-CPuYbNL8.js → client-Dg8dk8NW.js} +2 -2
  15. package/dist/{client-bootstrap-CNVF73sF.js → client-bootstrap-ZAaO9fZ-.js} +1 -1
  16. package/dist/{config-schema-BTSatSY3.js → config-schema-CggnuwnJ.js} +4 -5
  17. package/dist/contract-api.js +2 -2
  18. package/dist/{create-client-85ttAWDP.js → create-client-Und1YmJ2.js} +4 -4
  19. package/dist/credentials-W2EmwRhu.js +65 -0
  20. package/dist/credentials-read-DVmFCm7X.js +77 -0
  21. package/dist/{credentials-write.runtime-BDtpqvj0.js → credentials-write.runtime-Be9zNSUw.js} +1 -1
  22. package/dist/{crypto-runtime-DoEB5RpM.js → crypto-runtime-_j7TpS7k.js} +3 -3
  23. package/dist/{directory-live-0TyS9xep.js → directory-live-B6fbX6jf.js} +3 -3
  24. package/dist/{doctor-BGTs609f.js → doctor-C0LPJGTz.js} +1 -1
  25. package/dist/doctor-contract-CWVdlRQR.js +183 -0
  26. package/dist/doctor-contract-api.js +220 -73
  27. package/dist/{draft-stream-GOdPZMBm.js → draft-stream-BfibauH1.js} +1 -1
  28. package/dist/{encryption-guidance-BFfgq7c7.js → encryption-guidance-CbEFe38F.js} +1 -1
  29. package/dist/{file-sync-store-CUE9WwD2.js → file-sync-store-DUEWCEjb.js} +21 -4
  30. package/dist/helper-api.js +2 -2
  31. package/dist/{http-client-Jw5_bwQo.js → http-client-DOyTG9l2.js} +2 -2
  32. package/dist/{idb-persistence-BiHEEzD7.js → idb-persistence-C6zQfW2w.js} +73 -64
  33. package/dist/index.js +1 -1
  34. package/dist/{media-text-DPCtdFjk.js → media-text-Cv1VIHXW.js} +1 -1
  35. package/dist/{messages-DCRbGLMh.js → messages-ClTgfFl6.js} +3 -3
  36. package/dist/{monitor-C5EOF9et.js → monitor-2BjKS9RV.js} +93 -92
  37. package/dist/plugin-entry.handlers.runtime.js +1 -1
  38. package/dist/probe.runtime-BWkgfbiE.js +3 -0
  39. package/dist/{profile-update-DompcDyu.js → profile-update-C2My3TML.js} +2 -2
  40. package/dist/{reaction-events-QUgxkQKQ.js → reaction-events-Cj6thhmc.js} +2 -2
  41. package/dist/record-shared-CWWx6fvI.js +2 -0
  42. package/dist/{recovery-key-store-B2RglalK.js → recovery-key-store-0O8ARdT_.js} +1 -1
  43. package/dist/{resolve-targets-Cx1VVArA.js → resolve-targets-Dn11HT76.js} +1 -1
  44. package/dist/{resolver.runtime-PPrv3ZHu.js → resolver.runtime-Zguh0hH9.js} +1 -1
  45. package/dist/runtime-api.js +3 -3
  46. package/dist/{sdk-1TXuSiXZ.js → sdk-DiRXiRRf.js} +5 -5
  47. package/dist/{secret-contract-OZoQf0kI.js → secret-contract-M3hRmGO-.js} +21 -5
  48. package/dist/secret-contract-api.js +1 -1
  49. package/dist/{send-yre1krm8.js → send-CZCmDQu8.js} +4 -3
  50. package/dist/session-binding-contract-api.js +1 -1
  51. package/dist/{setup-bootstrap-DXVRCd4G.js → setup-bootstrap-C9w01xQK.js} +2 -2
  52. package/dist/{setup-core-CYQRY2oG.js → setup-core-D6gyoyeg.js} +109 -21
  53. package/dist/setup-plugin-api.js +4 -3
  54. package/dist/{setup-surface-BjvRQzK6.js → setup-surface-DZIEWtQC.js} +8 -6
  55. package/dist/{shared-BfW4lxGu.js → shared-C7Vm9RxI.js} +6 -6
  56. package/dist/{startup-verification-DSiyDKM5.js → startup-verification-D1nscMh8.js} +2 -2
  57. package/dist/{storage-DD-EnNJE.js → storage-BrkTJZov.js} +11 -44
  58. package/dist/{thread-bindings-U5ZroBeZ.js → thread-bindings-BcYBELC7.js} +3 -3
  59. package/dist/{tool-actions.runtime-BlfTr9b0.js → tool-actions.runtime-Dbco_Vwn.js} +7 -7
  60. package/dist/{verification-CGnI9k1O.js → verification-DhMBWxOJ.js} +2 -2
  61. package/node_modules/music-metadata/lib/common/Util.d.ts +1 -1
  62. package/node_modules/music-metadata/lib/common/Util.js +7 -1
  63. package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +23 -3
  64. package/node_modules/music-metadata/lib/id3v2/FrameParser.js +2 -2
  65. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +1 -1
  66. package/node_modules/music-metadata/lib/mp4/AtomToken.js +38 -13
  67. package/node_modules/music-metadata/lib/mpeg/MpegParser.js +1 -1
  68. package/node_modules/music-metadata/package.json +6 -6
  69. package/node_modules/typebox/build/compile/validator.d.mts +1 -4
  70. package/node_modules/typebox/build/guard/guard.d.mts +1 -1
  71. package/node_modules/typebox/build/guard/guard.mjs +5 -2
  72. package/node_modules/typebox/build/guard/string.mjs +16 -4
  73. package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
  74. package/node_modules/typebox/build/type/action/readonly_object.d.mts +5 -0
  75. package/node_modules/typebox/build/type/action/readonly_object.mjs +8 -0
  76. package/node_modules/typebox/build/typebox.d.mts +1 -1
  77. package/node_modules/typebox/build/typebox.mjs +1 -1
  78. package/node_modules/typebox/package.json +1 -1
  79. package/node_modules/typebox/readme.md +29 -32
  80. package/npm-shrinkwrap.json +11 -11
  81. package/openclaw.plugin.json +7 -20
  82. package/package.json +111 -28
  83. package/dist/async-lock-BcLS4KOc.js +0 -19
  84. package/dist/credentials-CncWUieb.js +0 -56
  85. package/dist/credentials-read-CwNJrmwu.js +0 -112
  86. package/dist/doctor-contract-D2qTLe-C.js +0 -312
  87. package/dist/probe.runtime-BBvciVfo.js +0 -3
  88. package/dist/record-shared-CvzjvHRn.js +0 -2
  89. package/dist/{deps-DDbghaZH.js → deps-CcVJfvRM.js} +1 -1
  90. package/dist/{storage-paths-B4_I9iqO.js → storage-paths-gUmSydsW.js} +1 -1
@@ -1,12 +1,12 @@
1
- import { t as isRecord } from "./record-shared-CvzjvHRn.js";
1
+ import { t as isRecord } from "./record-shared-CWWx6fvI.js";
2
2
  import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
3
- import { n as resolveMatrixAccountStorageRoot } from "./storage-paths-B4_I9iqO.js";
3
+ import { n as resolveMatrixAccountStorageRoot } from "./storage-paths-gUmSydsW.js";
4
4
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
5
- import fs from "node:fs";
6
- import os from "node:os";
7
- import path from "node:path";
8
5
  import { createHash, randomUUID } from "node:crypto";
6
+ import path from "node:path";
7
+ import fs from "node:fs";
9
8
  import { loadJsonFile } from "openclaw/plugin-sdk/json-store";
9
+ import os from "node:os";
10
10
  //#region extensions/matrix/src/matrix/sqlite-state.ts
11
11
  function resolveStateDirOverride(options) {
12
12
  if (!options) return;
@@ -123,8 +123,8 @@ function writeMatrixIdbSnapshotJson(params) {
123
123
  store: openSyncStore(openMatrixIdbSnapshotStoreOptions(params.storageRootDir))
124
124
  });
125
125
  }
126
- async function hasMatrixIdbSnapshotStateInStore(params) {
127
- return await readIdbSnapshotJsonFromAsyncStore(params.store) !== null;
126
+ async function readMatrixIdbSnapshotJsonFromStore(params) {
127
+ return await readIdbSnapshotJsonFromAsyncStore(params.store);
128
128
  }
129
129
  async function writeMatrixIdbSnapshotJsonToStore(params) {
130
130
  const rows = buildIdbSnapshotRows(params.snapshotJson, params.databaseCount);
@@ -526,12 +526,11 @@ function resolveMatrixStateFilePath(params) {
526
526
  }
527
527
  async function maybeMigrateLegacyStorage(params) {
528
528
  const hasAccountScopedLegacyStorageFile = fs.existsSync(params.storagePaths.storagePath);
529
- const syncCache = hasAccountScopedLegacyStorageFile ? await import("./file-sync-store-CUE9WwD2.js").then((n) => n.n) : null;
529
+ const syncCache = hasAccountScopedLegacyStorageFile ? await import("./file-sync-store-DUEWCEjb.js").then((n) => n.n) : null;
530
530
  const hasAccountScopedLegacyStorage = hasAccountScopedLegacyStorageFile && await syncCache?.readLegacyMatrixSyncCacheState(params.storagePaths.rootDir) !== null;
531
531
  const hasAccountScopedRecoveryKey = fs.existsSync(params.storagePaths.recoveryKeyPath);
532
- const hasAccountScopedIdbSnapshot = fs.existsSync(params.storagePaths.idbSnapshotPath);
533
532
  const hasAccountScopedLegacyCryptoMigration = fs.existsSync(path.join(params.storagePaths.rootDir, MATRIX_LEGACY_CRYPTO_MIGRATION_FILENAME));
534
- if (!hasAccountScopedLegacyStorage && !hasAccountScopedRecoveryKey && !hasAccountScopedIdbSnapshot && !hasAccountScopedLegacyCryptoMigration) return;
533
+ if (!hasAccountScopedLegacyStorage && !hasAccountScopedRecoveryKey && !hasAccountScopedLegacyCryptoMigration) return;
535
534
  const logger = getMatrixRuntime().logging.getChildLogger({ module: "matrix-storage" });
536
535
  fs.mkdirSync(params.storagePaths.rootDir, { recursive: true });
537
536
  const moved = [];
@@ -562,12 +561,6 @@ async function maybeMigrateLegacyStorage(params) {
562
561
  label: "legacy crypto migration"
563
562
  });
564
563
  }
565
- if (hasAccountScopedIdbSnapshot) await migrateLegacyIdbSnapshotToSqlite({
566
- storageRootDir: params.storagePaths.rootDir,
567
- snapshotPath: params.storagePaths.idbSnapshotPath,
568
- moved,
569
- pendingArchives
570
- });
571
564
  } catch (err) {
572
565
  const rollbackError = rollbackLegacyMoves(moved);
573
566
  throw new Error(rollbackError ? `Failed migrating legacy Matrix client storage: ${String(err)}. Rollback also failed: ${rollbackError}` : `Failed migrating legacy Matrix client storage: ${String(err)}`, { cause: err });
@@ -579,34 +572,8 @@ async function maybeMigrateLegacyStorage(params) {
579
572
  if (moved.length > 0) logger.info(`matrix: migrated legacy client storage into ${params.storagePaths.rootDir}\n${moved.map((entry) => `- ${entry.label}: ${entry.sourcePath} -> ${entry.targetPath}`).join("\n")}`);
580
573
  if (skippedExistingTargets.length > 0) logger.warn?.(`matrix: legacy client storage files were left in place because their migrated targets already existed.\n${skippedExistingTargets.join("\n")}`);
581
574
  }
582
- async function migrateLegacyIdbSnapshotToSqlite(params) {
583
- if (readMatrixIdbSnapshotJson(params.storageRootDir)) {
584
- params.pendingArchives.push({
585
- sourcePath: params.snapshotPath,
586
- label: "IndexedDB snapshot"
587
- });
588
- return;
589
- }
590
- const { readLegacyMatrixIdbSnapshotState } = await import("./idb-persistence-BiHEEzD7.js").then((n) => n.t);
591
- const snapshot = await readLegacyMatrixIdbSnapshotState(params.storageRootDir);
592
- if (!snapshot) return;
593
- writeMatrixIdbSnapshotJson({
594
- storageRootDir: params.storageRootDir,
595
- snapshotJson: JSON.stringify(snapshot),
596
- databaseCount: snapshot.length
597
- });
598
- params.moved.push({
599
- sourcePath: params.snapshotPath,
600
- targetPath: `${params.storageRootDir} SQLite IndexedDB snapshot state`,
601
- label: "IndexedDB snapshot"
602
- });
603
- params.pendingArchives.push({
604
- sourcePath: params.snapshotPath,
605
- label: "IndexedDB snapshot"
606
- });
607
- }
608
575
  async function migrateLegacySyncCacheToSqlite(params) {
609
- const syncCache = await import("./file-sync-store-CUE9WwD2.js").then((n) => n.n);
576
+ const syncCache = await import("./file-sync-store-DUEWCEjb.js").then((n) => n.n);
610
577
  const persisted = await syncCache.readLegacyMatrixSyncCacheState(params.sourceRootDir);
611
578
  if (!persisted) return;
612
579
  const store = getMatrixRuntime().state.openKeyedStore(syncCache.openMatrixSyncCacheStoreOptions(params.targetRootDir));
@@ -715,4 +682,4 @@ function repairCurrentTokenStorageMetaDeviceId(params) {
715
682
  });
716
683
  }
717
684
  //#endregion
718
- export { writeMatrixRecoveryKeyStateForPath as A, readLegacyMatrixRecoveryKeyFile as C, writeMatrixIdbSnapshotJson as D, readMatrixRecoveryKeyStateForPath as E, resolveMatrixSqliteStateEnv as M, resolveMatrixSqliteStateKey as N, writeMatrixIdbSnapshotJsonToStore as O, readLegacyMatrixLegacyCryptoMigrationState as S, readMatrixIdbSnapshotJson as T, hasMatrixRecoveryKeyStateInStore as _, openMatrixStorageMetaStoreOptions as a, openMatrixLegacyCryptoMigrationStoreOptions as b, resolveMatrixStateFilePath as c, writeStorageMeta as d, MATRIX_IDB_SNAPSHOT_FILENAME as f, hasMatrixLegacyCryptoMigrationStateInStore as g, hasMatrixIdbSnapshotStateInStore as h, normalizeMatrixStorageMetadata as i, writeMatrixRecoveryKeyStateToStore as j, writeMatrixLegacyCryptoMigrationStateToStore as k, resolveMatrixStoragePaths as l, MATRIX_RECOVERY_KEY_FILENAME as m, hasMatrixStorageMetaStateInStore as n, recordCurrentStorageMetaDeviceId as o, MATRIX_LEGACY_CRYPTO_MIGRATION_FILENAME as p, maybeMigrateLegacyStorage as r, repairCurrentTokenStorageMetaDeviceId as s, claimCurrentTokenStorageState as t, writeMatrixStorageMetaStateToStore as u, migrateLegacyMatrixRecoveryKeyFilePathToStore as v, readLegacyMatrixRecoveryKeyState as w, openMatrixRecoveryKeyStoreOptions as x, openMatrixIdbSnapshotStoreOptions as y };
685
+ export { writeMatrixRecoveryKeyStateForPath as A, readLegacyMatrixRecoveryKeyState as C, writeMatrixIdbSnapshotJson as D, readMatrixRecoveryKeyStateForPath as E, resolveMatrixSqliteStateEnv as M, resolveMatrixSqliteStateKey as N, writeMatrixIdbSnapshotJsonToStore as O, readLegacyMatrixRecoveryKeyFile as S, readMatrixIdbSnapshotJsonFromStore as T, migrateLegacyMatrixRecoveryKeyFilePathToStore as _, openMatrixStorageMetaStoreOptions as a, openMatrixRecoveryKeyStoreOptions as b, resolveMatrixStateFilePath as c, writeStorageMeta as d, MATRIX_IDB_SNAPSHOT_FILENAME as f, hasMatrixRecoveryKeyStateInStore as g, hasMatrixLegacyCryptoMigrationStateInStore as h, normalizeMatrixStorageMetadata as i, writeMatrixRecoveryKeyStateToStore as j, writeMatrixLegacyCryptoMigrationStateToStore as k, resolveMatrixStoragePaths as l, MATRIX_RECOVERY_KEY_FILENAME as m, hasMatrixStorageMetaStateInStore as n, recordCurrentStorageMetaDeviceId as o, MATRIX_LEGACY_CRYPTO_MIGRATION_FILENAME as p, maybeMigrateLegacyStorage as r, repairCurrentTokenStorageMetaDeviceId as s, claimCurrentTokenStorageState as t, writeMatrixStorageMetaStateToStore as u, openMatrixIdbSnapshotStoreOptions as v, readMatrixIdbSnapshotJson as w, readLegacyMatrixLegacyCryptoMigrationState as x, openMatrixLegacyCryptoMigrationStoreOptions as y };
@@ -1,10 +1,10 @@
1
1
  import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
2
2
  import { a as listBindingsForAccount, c as resolveBindingKey, f as setMatrixThreadBindingManagerEntry, h as toSessionBindingRecord, l as resolveEffectiveBindingExpiry, m as toMatrixBindingTargetKind, o as removeBindingRecord, r as getMatrixThreadBindingManagerEntry, t as deleteMatrixThreadBindingManagerEntry, u as setBindingRecord } from "./thread-bindings-shared-CKnY4LSd.js";
3
- import { M as resolveMatrixSqliteStateEnv, N as resolveMatrixSqliteStateKey, c as resolveMatrixStateFilePath, t as claimCurrentTokenStorageState } from "./storage-DD-EnNJE.js";
4
- import { a as sendMessageMatrix } from "./send-yre1krm8.js";
3
+ import { M as resolveMatrixSqliteStateEnv, N as resolveMatrixSqliteStateKey, c as resolveMatrixStateFilePath, t as claimCurrentTokenStorageState } from "./storage-BrkTJZov.js";
4
+ import { a as sendMessageMatrix } from "./send-CZCmDQu8.js";
5
5
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
- import path from "node:path";
7
6
  import { createHash } from "node:crypto";
7
+ import path from "node:path";
8
8
  import { registerSessionBindingAdapter, resolveThreadBindingFarewellText, unregisterSessionBindingAdapter } from "openclaw/plugin-sdk/thread-bindings-session-runtime";
9
9
  import fs from "node:fs/promises";
10
10
  import { readJsonFileWithFallback } from "openclaw/plugin-sdk/json-store";
@@ -1,14 +1,14 @@
1
1
  import { a as resolveMatrixAccountConfig, o as resolveMatrixBaseConfig } from "./account-config-BZWN9tGS.js";
2
- import { g as resolveMatrixAccount } from "./setup-core-CYQRY2oG.js";
3
- import { r as resolveMatrixRoomConfig } from "./channel-B1woOUgk.js";
2
+ import { _ as resolveMatrixAccount } from "./setup-core-D6gyoyeg.js";
3
+ import { r as resolveMatrixRoomConfig } from "./channel-MBtrY36B.js";
4
4
  import { r as normalizeMatrixResolvableTarget } from "./target-ids-B-5aQxwn.js";
5
- import { E as parsePollStart, T as isPollStartType, _ as readJoinedMatrixMembers, b as buildPollResponseContent, g as isStrictDirectMembership, h as hasDirectMatrixMemberFlag, i as reactMatrixMessage, u as resolveMatrixRoomId } from "./send-yre1krm8.js";
5
+ import { E as parsePollStart, T as isPollStartType, _ as readJoinedMatrixMembers, b as buildPollResponseContent, g as isStrictDirectMembership, h as hasDirectMatrixMemberFlag, i as reactMatrixMessage, u as resolveMatrixRoomId } from "./send-CZCmDQu8.js";
6
6
  import { i as buildMatrixReactionRelationsPath, o as selectOwnMatrixReactionEventIds, s as summarizeMatrixReactionEvents } from "./reaction-common-DkrQdBSZ.js";
7
- import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-BUai6s29.js";
8
- import { a as fetchEventSummary, c as resolveMatrixActionLimit, i as sendMatrixMessage, n as editMatrixMessage, o as readPinnedEvents, r as readMatrixMessages, s as EventType, t as deleteMatrixMessage } from "./messages-DCRbGLMh.js";
7
+ import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-BwX6rURh.js";
8
+ import { a as fetchEventSummary, c as resolveMatrixActionLimit, i as sendMatrixMessage, n as editMatrixMessage, o as readPinnedEvents, r as readMatrixMessages, s as EventType, t as deleteMatrixMessage } from "./messages-ClTgfFl6.js";
9
9
  import { c as readReactionParams, d as resolveAllowlistProviderRuntimeGroupPolicy, f as resolveDefaultGroupPolicy, i as createActionGate, l as readStringArrayParam, n as ToolAuthorizationError, o as jsonResult, s as readPositiveIntegerParam, u as readStringParam } from "./runtime-api-D1xI_cvh.js";
10
- import { t as applyMatrixProfileUpdate } from "./profile-update-DompcDyu.js";
11
- import { _ as scanMatrixVerificationQr, a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, h as restoreMatrixRoomKeyBackup, i as confirmMatrixVerificationReciprocateQr, l as getMatrixVerificationSas, n as bootstrapMatrixVerification, o as generateMatrixVerificationQr, p as requestMatrixVerification, r as cancelMatrixVerification, s as getMatrixEncryptionStatus, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-CGnI9k1O.js";
10
+ import { t as applyMatrixProfileUpdate } from "./profile-update-C2My3TML.js";
11
+ import { _ as scanMatrixVerificationQr, a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, h as restoreMatrixRoomKeyBackup, i as confirmMatrixVerificationReciprocateQr, l as getMatrixVerificationSas, n as bootstrapMatrixVerification, o as generateMatrixVerificationQr, p as requestMatrixVerification, r as cancelMatrixVerification, s as getMatrixEncryptionStatus, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-DhMBWxOJ.js";
12
12
  import { t as createMatrixRoomInfoResolver } from "./room-info-B6vKD5DF.js";
13
13
  import { normalizeOptionalLowercaseString, uniqueStrings, uniqueValues } from "openclaw/plugin-sdk/string-coerce-runtime";
14
14
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { i as withStartedActionClient, n as withResolvedActionClient } from "./client-BUai6s29.js";
3
- import { n as formatMatrixEncryptionUnavailableError } from "./encryption-guidance-BFfgq7c7.js";
2
+ import { i as withStartedActionClient, n as withResolvedActionClient } from "./client-BwX6rURh.js";
3
+ import { n as formatMatrixEncryptionUnavailableError } from "./encryption-guidance-CbEFe38F.js";
4
4
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
6
6
  import { setTimeout } from "node:timers/promises";
@@ -1,5 +1,5 @@
1
1
  import type { IRatio } from '../type.js';
2
- export type StringEncoding = 'ascii' | 'utf8' | 'utf-16le' | 'ucs2' | 'base64url' | 'latin1' | 'hex';
2
+ export type StringEncoding = 'ascii' | 'utf8' | 'utf-16le' | 'utf-16be' | 'ucs2' | 'base64url' | 'latin1' | 'hex';
3
3
  export declare function getBit(buf: Uint8Array, off: number, bit: number): boolean;
4
4
  /**
5
5
  * Find delimiting zero in uint8Array
@@ -12,7 +12,7 @@ export function getBit(buf, off, bit) {
12
12
  */
13
13
  export function findZero(uint8Array, encoding) {
14
14
  const len = uint8Array.length;
15
- if (encoding === 'utf-16le') {
15
+ if (encoding === 'utf-16le' || encoding === 'utf-16be') {
16
16
  // Look for 0x00 0x00 on 2-byte boundary
17
17
  for (let i = 0; i + 1 < len; i += 2) {
18
18
  if (uint8Array[i] === 0 && uint8Array[i + 1] === 0)
@@ -57,6 +57,12 @@ export function decodeString(uint8Array, encoding) {
57
57
  throw new FieldDecodingError('Expected even number of octets for 16-bit unicode string');
58
58
  return decodeString(swapBytes(uint8Array), encoding);
59
59
  }
60
+ if (encoding === 'utf-16be') {
61
+ // There is no native UTF-16BE decoder; swap to UTF-16LE and decode that.
62
+ if ((uint8Array.length & 1) !== 0)
63
+ throw new FieldDecodingError('Expected even number of octets for 16-bit unicode string');
64
+ return new StringType(uint8Array.length, 'utf-16le').get(swapBytes(Uint8Array.from(uint8Array)), 0);
65
+ }
60
66
  return new StringType(uint8Array.length, encoding).get(uint8Array, 0);
61
67
  }
62
68
  export function stripNulls(str) {
@@ -15,7 +15,27 @@ export function getFrameHeaderLength(majorVer) {
15
15
  default: throw makeUnexpectedMajorVersionError(majorVer);
16
16
  }
17
17
  }
18
- function readFrameFlags(b) {
18
+ function readFrameFlags(b, majorVer) {
19
+ // ID3v2.3 and ID3v2.4 use different bit layouts for the frame status and format flags.
20
+ if (majorVer === 3) {
21
+ // ID3v2.3: status `%abc00000`, format `%ijk00000` (https://id3.org/id3v2.3.0)
22
+ return {
23
+ status: {
24
+ tag_alter_preservation: util.getBit(b, 0, 7),
25
+ file_alter_preservation: util.getBit(b, 0, 6),
26
+ read_only: util.getBit(b, 0, 5)
27
+ },
28
+ format: {
29
+ compression: util.getBit(b, 1, 7),
30
+ encryption: util.getBit(b, 1, 6),
31
+ grouping_identity: util.getBit(b, 1, 5),
32
+ // Unsynchronisation and data-length-indicator do not exist as per-frame flags in ID3v2.3.
33
+ unsynchronisation: false,
34
+ data_length_indicator: false
35
+ }
36
+ };
37
+ }
38
+ // ID3v2.4: status `%0abc0000`, format `%0h00kmnp` (https://id3.org/id3v2.4.0-structure)
19
39
  return {
20
40
  status: {
21
41
  tag_alter_preservation: util.getBit(b, 0, 6),
@@ -23,7 +43,7 @@ function readFrameFlags(b) {
23
43
  read_only: util.getBit(b, 0, 4)
24
44
  },
25
45
  format: {
26
- grouping_identity: util.getBit(b, 1, 7),
46
+ grouping_identity: util.getBit(b, 1, 6),
27
47
  compression: util.getBit(b, 1, 3),
28
48
  encryption: util.getBit(b, 1, 2),
29
49
  unsynchronisation: util.getBit(b, 1, 1),
@@ -61,7 +81,7 @@ function parseFrameHeaderV23V24(uint8Array, majorVer, warningCollector) {
61
81
  const header = {
62
82
  id: textDecode(uint8Array.subarray(0, 4), 'ascii'),
63
83
  length: (majorVer === 4 ? UINT32SYNCSAFE : Token.UINT32_BE).get(uint8Array, 4),
64
- flags: readFrameFlags(uint8Array.subarray(8, 10))
84
+ flags: readFrameFlags(uint8Array.subarray(8, 10), majorVer)
65
85
  };
66
86
  if (!header.id.match(/^[A-Z0-9]{4}$/)) {
67
87
  warningCollector.addWarning(`Invalid ID3v2.${majorVer} frame-header-ID: ${header.id}`);
@@ -390,11 +390,11 @@ export class FrameParser {
390
390
  if (zeroIndex >= valueArray.length) {
391
391
  // No terminator found, decode full buffer remainder
392
392
  return {
393
- text: util.decodeString(valueArray, encoding.encoding),
393
+ text: util.decodeString(uint8Array, encoding.encoding),
394
394
  len: originalLen
395
395
  };
396
396
  }
397
- const txt = valueArray.subarray(0, zeroIndex);
397
+ const txt = uint8Array.subarray(0, bomSize + zeroIndex);
398
398
  return {
399
399
  text: util.decodeString(txt, encoding.encoding),
400
400
  len: bomSize + zeroIndex + FrameParser.getNullTerminatorLength(encoding.encoding)
@@ -109,7 +109,7 @@ export const TextEncodingToken = {
109
109
  case 0x01:
110
110
  return { encoding: 'utf-16le', bom: true };
111
111
  case 0x02:
112
- return { encoding: 'utf-16le', bom: false };
112
+ return { encoding: 'utf-16be', bom: false };
113
113
  case 0x03:
114
114
  return { encoding: 'utf8', bom: false };
115
115
  default:
@@ -226,19 +226,44 @@ export class TrackHeaderAtom {
226
226
  this.len = len;
227
227
  }
228
228
  get(buf, off) {
229
- return {
230
- version: Token.UINT8.get(buf, off),
231
- flags: Token.UINT24_BE.get(buf, off + 1),
232
- creationTime: SecondsSinceMacEpoch.get(buf, off + 4),
233
- modificationTime: SecondsSinceMacEpoch.get(buf, off + 8),
234
- trackId: Token.UINT32_BE.get(buf, off + 12),
235
- // reserved 4 bytes
236
- duration: Token.UINT32_BE.get(buf, off + 20),
237
- layer: Token.UINT16_BE.get(buf, off + 24),
238
- alternateGroup: Token.UINT16_BE.get(buf, off + 26),
239
- volume: Token.UINT16_BE.get(buf, off + 28) // ToDo: fixed point
240
- // ToDo: add remaining fields
241
- };
229
+ const version = Token.UINT8.get(buf, off);
230
+ const flags = Token.UINT24_BE.get(buf, off + 1);
231
+ switch (version) {
232
+ case 0:
233
+ // Version 0: 32-bit fields
234
+ return {
235
+ version,
236
+ flags,
237
+ creationTime: SecondsSinceMacEpoch.get(buf, off + 4),
238
+ modificationTime: SecondsSinceMacEpoch.get(buf, off + 8),
239
+ trackId: Token.UINT32_BE.get(buf, off + 12),
240
+ // reserved 4 bytes
241
+ duration: Token.UINT32_BE.get(buf, off + 20),
242
+ // reserved 8 bytes
243
+ layer: Token.UINT16_BE.get(buf, off + 32),
244
+ alternateGroup: Token.UINT16_BE.get(buf, off + 34),
245
+ volume: Token.UINT16_BE.get(buf, off + 36) // ToDo: fixed point
246
+ // ToDo: add remaining fields
247
+ };
248
+ case 1:
249
+ // Version 1: 64-bit creation/modification times and duration
250
+ return {
251
+ version,
252
+ flags,
253
+ creationTime: SecondsSinceMacEpoch64.get(buf, off + 4),
254
+ modificationTime: SecondsSinceMacEpoch64.get(buf, off + 12),
255
+ trackId: Token.UINT32_BE.get(buf, off + 20),
256
+ // reserved 4 bytes
257
+ duration: Number(Token.UINT64_BE.get(buf, off + 28)),
258
+ // reserved 8 bytes
259
+ layer: Token.UINT16_BE.get(buf, off + 44),
260
+ alternateGroup: Token.UINT16_BE.get(buf, off + 46),
261
+ volume: Token.UINT16_BE.get(buf, off + 48) // ToDo: fixed point
262
+ // ToDo: add remaining fields
263
+ };
264
+ default:
265
+ throw new FieldDecodingError('Invalid tkhd version header');
266
+ }
242
267
  }
243
268
  }
244
269
  /**
@@ -31,7 +31,7 @@ const MPEG4 = {
31
31
  * https://wiki.multimedia.cx/index.php/MPEG-4_Audio#Sampling_Frequencies
32
32
  */
33
33
  SamplingFrequencies: [
34
- 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350, null, null, -1
34
+ 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350, null, null, null
35
35
  ]
36
36
  /**
37
37
  * Channel Configurations
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "music-metadata",
3
3
  "description": "Music metadata parser for Node.js, supporting virtual any audio and tag format.",
4
- "version": "11.13.0",
4
+ "version": "11.14.0",
5
5
  "author": {
6
6
  "name": "Borewit",
7
7
  "url": "https://github.com/Borewit"
@@ -124,20 +124,20 @@
124
124
  "win-guid": "^0.2.1"
125
125
  },
126
126
  "devDependencies": {
127
- "@biomejs/biome": "2.4.6",
127
+ "@biomejs/biome": "2.5.3",
128
128
  "@types/chai": "^5.2.3",
129
129
  "@types/chai-as-promised": "^8.0.2",
130
- "@types/content-type": "^1.1.9",
131
- "@types/debug": "^4.1.12",
130
+ "@types/content-type": "^2.0.0",
131
+ "@types/debug": "^4.1.13",
132
132
  "@types/media-typer": "^1.1.3",
133
133
  "@types/mocha": "^10.0.10",
134
- "@types/node": "^25.2.0",
134
+ "@types/node": "^26.1.1",
135
135
  "c8": "^11.0.0",
136
136
  "chai": "^6.2.2",
137
137
  "chai-as-promised": "^8.0.2",
138
138
  "del-cli": "^7.0.0",
139
139
  "mime": "^4.1.0",
140
- "mocha": "^11.7.5",
140
+ "mocha": "^11.7.6",
141
141
  "node-readable-to-web-readable-stream": "^0.4.2",
142
142
  "remark-cli": "^12.0.1",
143
143
  "remark-preset-lint-consistent": "^6.0.1",
@@ -1,14 +1,11 @@
1
1
  import { type TLocalizedValidationError } from '../error/index.mjs';
2
2
  import { type StaticDecode, type StaticEncode, type TProperties, type TSchema } from '../type/index.mjs';
3
- import { BuildResult, EvaluateResult } from '../schema/index.mjs';
4
3
  export declare class Validator<Context extends TProperties = TProperties, Type extends TSchema = TSchema, Encode extends unknown = StaticEncode<Type, Context>, Decode extends unknown = StaticDecode<Type, Context>> {
5
4
  private readonly hasCodec;
6
5
  private readonly buildResult;
7
6
  private readonly evaluateResult;
8
- /** Constructs a Validator with the given Context and Type. */
7
+ /** Constructs a Validator. */
9
8
  constructor(context: Context, type: Type);
10
- /** Constructs a Validator with the given arguments. */
11
- constructor(hasCodec: boolean, buildResult: BuildResult, evaluateResult: EvaluateResult);
12
9
  /** Returns true if this Validator is using JIT acceleration. */
13
10
  IsAccelerated(): boolean;
14
11
  /** Returns the Context for this validator. */
@@ -61,5 +61,5 @@ export declare function Keys(value: Record<PropertyKey, unknown>): string[];
61
61
  export declare function Symbols(value: Record<PropertyKey, unknown>): symbol[];
62
62
  /** Returns the property values for the given object via `Object.values()` */
63
63
  export declare function Values(value: Record<PropertyKey, unknown>): unknown[];
64
- /** Tests values for deep equality */
64
+ /** Returns true if left and right values are structurally equal */
65
65
  export declare function IsDeepEqual(left: unknown, right: unknown): boolean;
@@ -1,3 +1,4 @@
1
+ // deno-fmt-ignore-file
1
2
  import * as String from './string.mjs';
2
3
  // --------------------------------------------------------------------------
3
4
  // Guards
@@ -203,7 +204,9 @@ function DeepEqualArray(left, right) {
203
204
  return IsArray(right) && IsEqual(left.length, right.length) &&
204
205
  left.every((_, index) => IsDeepEqual(left[index], right[index]));
205
206
  }
206
- /** Tests values for deep equality */
207
+ /** Returns true if left and right values are structurally equal */
207
208
  export function IsDeepEqual(left, right) {
208
- return (IsArray(left) ? DeepEqualArray(left, right) : IsObject(left) ? DeepEqualObject(left, right) : IsEqual(left, right));
209
+ return (IsArray(left) ? DeepEqualArray(left, right) :
210
+ IsObject(left) ? DeepEqualObject(left, right) :
211
+ IsEqual(left, right));
209
212
  }
@@ -5,6 +5,18 @@ function IsBetween(value, min, max) {
5
5
  return value >= min && value <= max;
6
6
  }
7
7
  // --------------------------------------------------------------------------
8
+ // IsZeroWidthJoiner
9
+ // --------------------------------------------------------------------------
10
+ function IsZeroWidthJoiner(value) {
11
+ return (value === 0x200D);
12
+ }
13
+ // --------------------------------------------------------------------------
14
+ // IsHighSurrogate
15
+ // --------------------------------------------------------------------------
16
+ function IsHighSurrogate(value) {
17
+ return IsBetween(value, 0xD800, 0xDBFF);
18
+ }
19
+ // --------------------------------------------------------------------------
8
20
  // IsRegionalIndicator
9
21
  // --------------------------------------------------------------------------
10
22
  function IsRegionalIndicator(value) {
@@ -72,10 +84,10 @@ function NextGraphemeClusterIndex(value, clusterStart) {
72
84
  // IsGraphemeCodePoint
73
85
  // --------------------------------------------------------------------------
74
86
  function IsGraphemeCodePoint(value) {
75
- return (IsBetween(value, 0xD800, 0xDBFF) || // High surrogate
76
- IsBetween(value, 0x0300, 0x036F) || // Combining diacritical marks
77
- (value === 0x200D) // Zero-width joiner
78
- );
87
+ return (IsHighSurrogate(value) ||
88
+ IsCombiningMark(value) ||
89
+ IsVariationSelector(value) ||
90
+ IsZeroWidthJoiner(value));
79
91
  }
80
92
  // --------------------------------------------------------------------------
81
93
  // GraphemeCount
@@ -1,47 +1,66 @@
1
1
  // deno-fmt-ignore-file
2
- import * as Schema from '../types/index.mjs';
3
2
  import { Hashing } from '../../system/hashing/index.mjs';
4
3
  import { EmitGuard as E } from '../../guard/index.mjs';
5
4
  import { BuildSchema } from './schema.mjs';
6
- const functions = new Map();
5
+ const index = [0];
6
+ const names = new Map;
7
+ const funcs = new Map();
8
+ // ------------------------------------------------------------------
9
+ // CreateName
10
+ // ------------------------------------------------------------------
11
+ function NextName() {
12
+ return Hashing.Hash(index[0]++);
13
+ }
14
+ function CreateName(schema, href) {
15
+ if (!names.has(schema))
16
+ names.set(schema, new Map());
17
+ const hrefs = names.get(schema);
18
+ if (hrefs.has(href))
19
+ return hrefs.get(href);
20
+ const name = NextName();
21
+ hrefs.set(href, name);
22
+ return name;
23
+ }
7
24
  // ------------------------------------------------------------------
8
25
  // CreateCallExpression
9
26
  // ------------------------------------------------------------------
10
- function CreateCallExpression(context, _schema, hash, value) {
27
+ function CreateCallExpression(context, _schema, name, value) {
11
28
  return context.UseUnevaluated()
12
- ? E.Call(`check_${hash}`, ['context', value])
13
- : E.Call(`check_${hash}`, [value]);
29
+ ? E.Call(`check_${name}`, ['context', value])
30
+ : E.Call(`check_${name}`, [value]);
14
31
  }
15
32
  // ------------------------------------------------------------------
16
33
  // CreateFunctionExpression
17
34
  // ------------------------------------------------------------------
18
- function CreateFunctionExpression(stack, context, schema, hash) {
35
+ function CreateFunctionExpression(stack, context, schema, name) {
19
36
  const expression = BuildSchema(stack, context, schema, 'value');
20
37
  return context.UseUnevaluated()
21
- ? E.ConstDeclaration(`check_${hash}`, E.ArrowFunction(['context', 'value'], expression))
22
- : E.ConstDeclaration(`check_${hash}`, E.ArrowFunction(['value'], expression));
38
+ ? E.ConstDeclaration(`check_${name}`, E.ArrowFunction(['context', 'value'], expression))
39
+ : E.ConstDeclaration(`check_${name}`, E.ArrowFunction(['value'], expression));
23
40
  }
24
41
  // ------------------------------------------------------------------
25
42
  // ResetFunctions
26
43
  // ------------------------------------------------------------------
27
44
  export function ResetFunctions() {
28
- functions.clear();
45
+ index[0] = 0;
46
+ names.clear();
47
+ funcs.clear();
29
48
  }
30
49
  // ------------------------------------------------------------------
31
50
  // GetFunctions
32
51
  // ------------------------------------------------------------------
33
52
  export function GetFunctions() {
34
- return [...functions.values()];
53
+ return [...funcs.values()];
35
54
  }
36
55
  // ------------------------------------------------------------------
37
56
  // CreateFunction
38
57
  // ------------------------------------------------------------------
39
58
  export function CreateFunction(stack, context, schema, value) {
40
- const hash = Schema.IsSchemaObject(schema) ? Hashing.Hash({ __baseURL: stack.BaseURL().href, ...schema }) : Hashing.Hash(schema);
41
- const call = CreateCallExpression(context, schema, hash, value);
42
- if (functions.has(hash))
59
+ const name = CreateName(schema, stack.BaseURL().href);
60
+ const call = CreateCallExpression(context, schema, name, value);
61
+ if (funcs.has(name))
43
62
  return call;
44
- functions.set(hash, '');
45
- functions.set(hash, CreateFunctionExpression(stack, context, schema, hash));
63
+ funcs.set(name, '');
64
+ funcs.set(name, CreateFunctionExpression(stack, context, schema, name));
46
65
  return call;
47
66
  }
@@ -9,3 +9,8 @@ export declare function ReadonlyObjectDeferred<Type extends TSchema>(type: Type,
9
9
  export type TReadonlyObject<Type extends TSchema> = (TReadonlyObjectAction<Type>);
10
10
  /** This type is an alias for TypeScript's `Readonly<T>` utility type. It will make all properties of a TObject readonly or marks an TArray or TTuple as immutable `readonly T[]`. */
11
11
  export declare function ReadonlyObject<Type extends TSchema>(type: Type, options?: TSchemaOptions): TReadonlyObject<Type>;
12
+ /**
13
+ * This type has been renamed to ReadonlyObject.
14
+ * @deprecated
15
+ */
16
+ export declare const ReadonlyType: typeof ReadonlyObject;
@@ -9,3 +9,11 @@ export function ReadonlyObjectDeferred(type, options = {}) {
9
9
  export function ReadonlyObject(type, options = {}) {
10
10
  return ReadonlyObjectAction(type, options);
11
11
  }
12
+ // ------------------------------------------------------------------
13
+ // Alias
14
+ // ------------------------------------------------------------------
15
+ /**
16
+ * This type has been renamed to ReadonlyObject.
17
+ * @deprecated
18
+ */
19
+ export const ReadonlyType = ReadonlyObject;
@@ -19,7 +19,7 @@ export { Omit, type TOmit, type TOmitDeferred } from './type/action/omit.mjs';
19
19
  export { Parameters, type TParameters, type TParametersDeferred } from './type/action/parameters.mjs';
20
20
  export { Partial, type TPartial, type TPartialDeferred } from './type/action/partial.mjs';
21
21
  export { Pick, type TPick, type TPickDeferred } from './type/action/pick.mjs';
22
- export { ReadonlyObject, type TReadonlyObject, type TReadonlyObjectDeferred } from './type/action/readonly_object.mjs';
22
+ export { ReadonlyObject, ReadonlyType, type TReadonlyObject, type TReadonlyObjectDeferred } from './type/action/readonly_object.mjs';
23
23
  export { Required, type TRequired, type TRequiredDeferred } from './type/action/required.mjs';
24
24
  export { ReturnType, type TReturnType, type TReturnTypeDeferred } from './type/action/return_type.mjs';
25
25
  export { type TUncapitalize, type TUncapitalizeDeferred, Uncapitalize } from './type/action/uncapitalize.mjs';
@@ -31,7 +31,7 @@ export { Omit } from './type/action/omit.mjs';
31
31
  export { Parameters } from './type/action/parameters.mjs';
32
32
  export { Partial } from './type/action/partial.mjs';
33
33
  export { Pick } from './type/action/pick.mjs';
34
- export { ReadonlyObject } from './type/action/readonly_object.mjs';
34
+ export { ReadonlyObject, ReadonlyType } from './type/action/readonly_object.mjs';
35
35
  export { Required } from './type/action/required.mjs';
36
36
  export { ReturnType } from './type/action/return_type.mjs';
37
37
  export { Uncapitalize } from './type/action/uncapitalize.mjs';
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typebox",
3
3
  "description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
4
- "version": "1.3.3",
4
+ "version": "1.3.6",
5
5
  "keywords": [
6
6
  "typescript",
7
7
  "jsonschema"