@openclaw/matrix 2026.7.2-beta.7 → 2026.8.1-beta.2

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 (83) hide show
  1. package/dist/{account-selection-kqquRzCf.js → account-selection-CWuhuFn1.js} +7 -8
  2. package/dist/{accounts-DfngqebB.js → accounts-BCzyubQt.js} +3 -3
  3. package/dist/api.js +7 -10
  4. package/dist/{approval-handler.runtime-DSeaIsGa.js → approval-handler.runtime-CJXCUdRg.js} +5 -5
  5. package/dist/{approval-ids-BdJGPAJT.js → approval-ids-7rf7etWE.js} +1 -1
  6. package/dist/{approval-reaction-auth-BjOpELxu.js → approval-reaction-auth-wBwbEDpZ.js} +2 -2
  7. package/dist/{approval-reactions-D-BxBK_L.js → approval-reactions-tXh9KYrW.js} +2 -8
  8. package/dist/auth-presence.js +2 -2
  9. package/dist/{channel-vj788dNZ.js → channel-VSrHgTON.js} +156 -136
  10. package/dist/channel-plugin-api.js +1 -1
  11. package/dist/{channel.runtime-CLoF2S9T.js → channel.runtime-pOOL0uT_.js} +70 -56
  12. package/dist/{config-schema-Djxw3C6b.js → channel.setup-PpxRP9Du.js} +50 -3
  13. package/dist/{cli-DMqfDE-q.js → cli-CkTfKC_c.js} +16 -16
  14. package/dist/{cli-metadata-C7D53SND.js → cli-metadata-B1d1aGM5.js} +1 -1
  15. package/dist/cli-metadata.js +1 -1
  16. package/dist/client-CeGw0G5S.js +784 -0
  17. package/dist/{client-bootstrap-XsIkHNt0.js → client-bootstrap-BFwT_2VT.js} +25 -61
  18. package/dist/{client-6eRENr7k.js → client-sJesKQmp.js} +4 -4
  19. package/dist/client-support-DLj4vDeu.js +93 -0
  20. package/dist/config-update-Bor_Pjsv.js +150 -0
  21. package/dist/contract-api.js +2 -2
  22. package/dist/{credentials-W2EmwRhu.js → credentials-BdAaWuiR.js} +2 -1
  23. package/dist/credentials-read-B37cQknZ.js +51 -0
  24. package/dist/credentials-state-B3cuUFwZ.js +27 -0
  25. package/dist/{credentials-write.runtime-Be9zNSUw.js → credentials-write.runtime-nAV2-5uR.js} +1 -1
  26. package/dist/{crypto-runtime-D9_6J5tZ.js → crypto-runtime-Bnz3zEcS.js} +55 -32
  27. package/dist/direct-room-RinHjtqX.js +71 -0
  28. package/dist/{directory-live-C8dVBiCc.js → directory-live-Bvg2wAnR.js} +1 -2
  29. package/dist/{doctor-CM8ijNpW.js → doctor-EWf9CDso.js} +2 -2
  30. package/dist/{doctor-contract-BMSJkkAE.js → doctor-contract-DEt4O4Zt.js} +2 -3
  31. package/dist/doctor-contract-api.js +202 -90
  32. package/dist/{draft-stream-CtvOXq0Z.js → draft-stream-BRi7PRRS.js} +20 -23
  33. package/dist/{encryption-guidance-CbEFe38F.js → encryption-guidance-DmLY8NiO.js} +1 -1
  34. package/dist/{env-auth-CQsYbz-p.js → env-auth-MVS-Vv41.js} +4 -3
  35. package/dist/{env-vars-B0NxQnPk.js → env-vars-dGqak9dN.js} +1 -1
  36. package/dist/{errors-C47hvAF8.js → errors-DKVS3_DO.js} +2 -5
  37. package/dist/{file-sync-store-DiiFsayX.js → file-sync-store-DjskBX2o.js} +24 -3
  38. package/dist/helper-api.js +2 -2
  39. package/dist/{idb-persistence-B6x7dMsF.js → idb-persistence-BM0P27Zg.js} +3 -2
  40. package/dist/{inbound-dedupe-CaBLblef.js → inbound-dedupe-RvSLqdsz.js} +2 -2
  41. package/dist/index.js +1 -1
  42. package/dist/{logger-D0GCSDQq.js → logger-B_71hN6W.js} +1 -1
  43. package/dist/{logging-DV-p52N0.js → logging-DRjvUOIh.js} +1 -1
  44. package/dist/{media-text-BTwzADS_.js → media-text-JudlYOSc.js} +1 -1
  45. package/dist/{messages-DxQJkhxs.js → messages-BW0s-6Y9.js} +7 -7
  46. package/dist/{monitor-VyWlSLwo.js → monitor-Ddfc-vjX.js} +394 -384
  47. package/dist/plugin-entry.handlers.runtime.js +3 -3
  48. package/dist/probe.runtime-Dr91B_X3.js +2 -0
  49. package/dist/profile-D-Wubo0A.js +108 -0
  50. package/dist/{profile-update-CffmyW_4.js → profile-update-BkgWYDIp.js} +3 -2
  51. package/dist/{reaction-events-B00WSi98.js → reaction-events-nfUbFLdV.js} +9 -6
  52. package/dist/{recovery-key-store-BNnHvXdk.js → recovery-key-store-CognuDys.js} +5 -4
  53. package/dist/{resolve-targets-nm2L48sh.js → resolve-targets-BJAPY4Vb.js} +1 -1
  54. package/dist/{resolver.runtime-DS6uPaEe.js → resolver.runtime-LWJELYq5.js} +1 -1
  55. package/dist/{room-info-CAFZ3Z9J.js → room-info-BXQA7y10.js} +12 -3
  56. package/dist/runtime-api.js +6 -3
  57. package/dist/{sdk-bUytQHx7.js → sdk-DjaQFCHc.js} +229 -120
  58. package/dist/{secret-contract-M3hRmGO-.js → secret-contract-CufozuyJ.js} +1 -1
  59. package/dist/secret-contract-api.js +1 -1
  60. package/dist/{send-BldGYG8g.js → send-ZDLU4JTk.js} +1462 -1196
  61. package/dist/session-binding-contract-api.js +1 -1
  62. package/dist/{setup-bootstrap-Deleiibz.js → setup-bootstrap-BaXkhgJg.js} +4 -4
  63. package/dist/{setup-core-BVfBv2ai.js → setup-core-DQn6b5vi.js} +17 -266
  64. package/dist/setup-plugin-api.js +1 -44
  65. package/dist/{setup-surface-BBq3WeqX.js → setup-surface-DlhJdrNI.js} +9 -11
  66. package/dist/{startup-verification-wm3_i88s.js → startup-verification-Cs08ca8u.js} +3 -3
  67. package/dist/{storage-BvAkgzvT.js → storage-BsGuHngK.js} +3 -3
  68. package/dist/{thread-bindings-DGbl3vDW.js → thread-bindings-CcHZP3w2.js} +7 -4
  69. package/dist/{tool-actions.runtime-uu9blSqO.js → tool-actions.runtime-DmdRL0bN.js} +35 -18
  70. package/dist/{verification-DYMQ1QpI.js → verification-C7ig-bQE.js} +2 -2
  71. package/openclaw.plugin.json +54 -1
  72. package/package.json +4 -4
  73. package/dist/active-client-DXvz2gCo.js +0 -20
  74. package/dist/client-Dbso3-0V.js +0 -30
  75. package/dist/create-client-BmSU-q-D.js +0 -61
  76. package/dist/credentials-read-DVmFCm7X.js +0 -77
  77. package/dist/exec-approval-resolver-BCgqRtZS.js +0 -16
  78. package/dist/preflight-audio.runtime-BZxxQsxY.js +0 -11
  79. package/dist/probe.runtime-BuieqmS3.js +0 -3
  80. package/dist/record-shared-CWWx6fvI.js +0 -2
  81. package/dist/shared-CUMWxcMz.js +0 -673
  82. package/dist/sync-state-CWbp0QSY.js +0 -12
  83. package/dist/{runtime-api-D1xI_cvh.js → runtime-api-BGO16Fu8.js} +3 -3
@@ -1,10 +1,10 @@
1
- import { t as formatMatrixErrorMessage } from "./errors-C47hvAF8.js";
2
1
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
3
2
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
+ import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
4
4
  //#region extensions/matrix/src/plugin-entry.runtime.ts
5
- const loadMatrixVerificationRuntime = createLazyRuntimeModule(() => import("./verification-DYMQ1QpI.js").then((n) => n.y));
5
+ const loadMatrixVerificationRuntime = createLazyRuntimeModule(() => import("./verification-C7ig-bQE.js").then((n) => n.y));
6
6
  function sendError(respond, err) {
7
- respond(false, { error: formatMatrixErrorMessage(err) });
7
+ respond(false, { error: formatErrorMessage(err) });
8
8
  }
9
9
  async function handleVerifyRecoveryKey({ params, respond }) {
10
10
  try {
@@ -0,0 +1,2 @@
1
+ import { o as createMatrixClient } from "./client-CeGw0G5S.js";
2
+ export { createMatrixClient };
@@ -0,0 +1,108 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
+ import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
+ //#region extensions/matrix/src/matrix/profile.ts
4
+ var profile_exports = /* @__PURE__ */ __exportAll({
5
+ isSupportedMatrixAvatarSource: () => isSupportedMatrixAvatarSource,
6
+ syncMatrixOwnProfile: () => syncMatrixOwnProfile
7
+ });
8
+ const MATRIX_PROFILE_AVATAR_MAX_BYTES = 10 * 1024 * 1024;
9
+ function isMatrixMxcUri(value) {
10
+ return normalizeLowercaseStringOrEmpty(normalizeOptionalString(value)).startsWith("mxc://");
11
+ }
12
+ function isMatrixHttpAvatarUri(value) {
13
+ const normalized = normalizeLowercaseStringOrEmpty(normalizeOptionalString(value));
14
+ return normalized.startsWith("https://") || normalized.startsWith("http://");
15
+ }
16
+ function isSupportedMatrixAvatarSource(value) {
17
+ return isMatrixMxcUri(value) || isMatrixHttpAvatarUri(value);
18
+ }
19
+ async function uploadAvatarMedia(params) {
20
+ const media = await params.loadAvatar(params.avatarSource, params.avatarMaxBytes);
21
+ return await params.client.uploadContent(media.buffer, media.contentType, media.fileName || "avatar");
22
+ }
23
+ async function resolveAvatarUrl(params) {
24
+ const avatarPath = normalizeOptionalString(params.avatarPath) ?? null;
25
+ if (avatarPath) {
26
+ if (!params.loadAvatarFromPath) throw new Error("Matrix avatar path upload requires a media loader.");
27
+ return {
28
+ resolvedAvatarUrl: await uploadAvatarMedia({
29
+ client: params.client,
30
+ avatarSource: avatarPath,
31
+ avatarMaxBytes: params.avatarMaxBytes,
32
+ loadAvatar: params.loadAvatarFromPath
33
+ }),
34
+ uploadedAvatarSource: "path",
35
+ convertedAvatarFromHttp: false
36
+ };
37
+ }
38
+ const avatarUrl = normalizeOptionalString(params.avatarUrl) ?? null;
39
+ if (!avatarUrl) return {
40
+ resolvedAvatarUrl: null,
41
+ uploadedAvatarSource: null,
42
+ convertedAvatarFromHttp: false
43
+ };
44
+ if (isMatrixMxcUri(avatarUrl)) return {
45
+ resolvedAvatarUrl: avatarUrl,
46
+ uploadedAvatarSource: null,
47
+ convertedAvatarFromHttp: false
48
+ };
49
+ if (!isMatrixHttpAvatarUri(avatarUrl)) throw new Error("Matrix avatar URL must be an mxc:// URI or an http(s) URL.");
50
+ if (!params.loadAvatarFromUrl) throw new Error("Matrix avatar URL conversion requires a media loader.");
51
+ return {
52
+ resolvedAvatarUrl: await uploadAvatarMedia({
53
+ client: params.client,
54
+ avatarSource: avatarUrl,
55
+ avatarMaxBytes: params.avatarMaxBytes,
56
+ loadAvatar: params.loadAvatarFromUrl
57
+ }),
58
+ uploadedAvatarSource: "http",
59
+ convertedAvatarFromHttp: true
60
+ };
61
+ }
62
+ async function syncMatrixOwnProfile(params) {
63
+ const desiredDisplayName = normalizeOptionalString(params.displayName) ?? null;
64
+ const avatar = await resolveAvatarUrl({
65
+ client: params.client,
66
+ avatarUrl: params.avatarUrl ?? null,
67
+ avatarPath: params.avatarPath ?? null,
68
+ avatarMaxBytes: params.avatarMaxBytes ?? MATRIX_PROFILE_AVATAR_MAX_BYTES,
69
+ loadAvatarFromUrl: params.loadAvatarFromUrl,
70
+ loadAvatarFromPath: params.loadAvatarFromPath
71
+ });
72
+ const desiredAvatarUrl = avatar.resolvedAvatarUrl;
73
+ if (!desiredDisplayName && !desiredAvatarUrl) return {
74
+ skipped: true,
75
+ displayNameUpdated: false,
76
+ avatarUpdated: false,
77
+ resolvedAvatarUrl: null,
78
+ uploadedAvatarSource: avatar.uploadedAvatarSource,
79
+ convertedAvatarFromHttp: avatar.convertedAvatarFromHttp
80
+ };
81
+ let currentDisplayName;
82
+ let currentAvatarUrl;
83
+ try {
84
+ const currentProfile = await params.client.getUserProfile(params.userId);
85
+ currentDisplayName = normalizeOptionalString(currentProfile.displayname);
86
+ currentAvatarUrl = normalizeOptionalString(currentProfile.avatar_url);
87
+ } catch {}
88
+ let displayNameUpdated = false;
89
+ let avatarUpdated = false;
90
+ if (desiredDisplayName && currentDisplayName !== desiredDisplayName) {
91
+ await params.client.setDisplayName(desiredDisplayName);
92
+ displayNameUpdated = true;
93
+ }
94
+ if (desiredAvatarUrl && currentAvatarUrl !== desiredAvatarUrl) {
95
+ await params.client.setAvatarUrl(desiredAvatarUrl);
96
+ avatarUpdated = true;
97
+ }
98
+ return {
99
+ skipped: false,
100
+ displayNameUpdated,
101
+ avatarUpdated,
102
+ resolvedAvatarUrl: desiredAvatarUrl,
103
+ uploadedAvatarSource: avatar.uploadedAvatarSource,
104
+ convertedAvatarFromHttp: avatar.convertedAvatarFromHttp
105
+ };
106
+ }
107
+ //#endregion
108
+ export { profile_exports as n, syncMatrixOwnProfile as r, isSupportedMatrixAvatarSource as t };
@@ -1,6 +1,7 @@
1
1
  import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
2
- import { l as resolveMatrixConfigPath, s as syncMatrixOwnProfile, u as updateMatrixAccountConfig } from "./setup-core-BVfBv2ai.js";
3
- import { n as withResolvedActionClient } from "./client-6eRENr7k.js";
2
+ import { n as resolveMatrixConfigPath, r as updateMatrixAccountConfig } from "./config-update-Bor_Pjsv.js";
3
+ import { r as syncMatrixOwnProfile } from "./profile-D-Wubo0A.js";
4
+ import { n as withResolvedActionClient } from "./client-sJesKQmp.js";
4
5
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
5
6
  //#region extensions/matrix/src/matrix/actions/profile.ts
6
7
  async function updateMatrixOwnProfile(opts = {}) {
@@ -1,14 +1,15 @@
1
1
  import { a as resolveMatrixAccountConfig } from "./account-config-BZWN9tGS.js";
2
2
  import { a as extractMatrixReactionAnnotation } from "./reaction-common-DkrQdBSZ.js";
3
- import { i as resolveMatrixApprovalReactionTargetWithPersistence, o as unregisterMatrixApprovalReactionTargetsForApproval } from "./approval-reactions-D-BxBK_L.js";
3
+ import { i as resolveMatrixApprovalReactionTargetWithPersistence, o as unregisterMatrixApprovalReactionTargetsForApproval } from "./approval-reactions-tXh9KYrW.js";
4
4
  import { i as resolveMatrixThreadRouting, r as resolveMatrixThreadRootId, t as resolveMatrixInboundRoute } from "./route-DY6at4qJ.js";
5
5
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
6
+ import { isApprovalNotFoundError } from "openclaw/plugin-sdk/error-runtime";
6
7
  import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
7
8
  import { getSessionBindingService } from "openclaw/plugin-sdk/session-binding-runtime";
8
9
  //#region extensions/matrix/src/matrix/monitor/reaction-events.ts
9
- const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./approval-reaction-auth-BjOpELxu.js"));
10
- const loadExecApprovalResolver = createLazyRuntimeModule(() => import("./exec-approval-resolver-BCgqRtZS.js"));
11
- const loadMatrixSend = createLazyRuntimeModule(() => import("./send-BldGYG8g.js").then((n) => n.s));
10
+ const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./approval-reaction-auth-wBwbEDpZ.js"));
11
+ const loadExecApprovalResolver = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/approval-gateway-runtime"));
12
+ const loadMatrixSend = createLazyRuntimeModule(() => import("./send-ZDLU4JTk.js").then((n) => n.s));
12
13
  function buildMatrixApprovalTerminalText(result) {
13
14
  const approval = result.approval;
14
15
  const terminalLabel = approval.status === "allowed" ? approval.decision === "allow-always" ? "Allowed always" : "Allowed once" : approval.status === "denied" ? "Denied" : approval.status === "expired" ? "Expired" : "Cancelled";
@@ -56,13 +57,15 @@ async function maybeResolveMatrixApprovalReaction(params) {
56
57
  ...params,
57
58
  approvalKind: params.target.approvalKind
58
59
  })) return false;
59
- const { isApprovalNotFoundError, resolveMatrixApproval } = await loadExecApprovalResolver();
60
+ const { resolveApprovalOverGateway } = await loadExecApprovalResolver();
60
61
  try {
61
- const result = await resolveMatrixApproval({
62
+ const result = await resolveApprovalOverGateway({
62
63
  cfg: params.cfg,
63
64
  approvalId: params.target.approvalId,
64
65
  approvalKind: params.target.approvalKind,
65
66
  decision: params.target.decision,
67
+ channel: "matrix",
68
+ accountId: params.accountId,
66
69
  senderId: params.senderId
67
70
  });
68
71
  await retireMatrixApprovalReactionTargets({
@@ -1,7 +1,8 @@
1
- import { n as formatMatrixErrorReason, t as formatMatrixErrorMessage } from "./errors-C47hvAF8.js";
2
- import { A as writeMatrixRecoveryKeyStateForPath, E as readMatrixRecoveryKeyStateForPath, S as readLegacyMatrixRecoveryKeyFile, _ as migrateLegacyMatrixRecoveryKeyFilePathToStore } from "./storage-BvAkgzvT.js";
3
- import { n as LogService } from "./logger-D0GCSDQq.js";
1
+ import { A as writeMatrixRecoveryKeyStateForPath, E as readMatrixRecoveryKeyStateForPath, S as readLegacyMatrixRecoveryKeyFile, _ as migrateLegacyMatrixRecoveryKeyFilePathToStore } from "./storage-BsGuHngK.js";
2
+ import { n as LogService } from "./logger-B_71hN6W.js";
3
+ import { t as formatMatrixErrorReason } from "./errors-DKVS3_DO.js";
4
4
  import path from "node:path";
5
+ import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
5
6
  import { decodeRecoveryKey } from "matrix-js-sdk/lib/crypto-api/recovery-key.js";
6
7
  //#region extensions/matrix/src/matrix/sdk/recovery-key-store.ts
7
8
  function isRepairableSecretStorageAccessError(err) {
@@ -95,7 +96,7 @@ var MatrixRecoveryKeyStore = class {
95
96
  try {
96
97
  privateKey = decodeRecoveryKey(encodedPrivateKey);
97
98
  } catch (err) {
98
- throw new Error(`Invalid Matrix recovery key: ${formatMatrixErrorMessage(err)}`, { cause: err });
99
+ throw new Error(`Invalid Matrix recovery key: ${formatErrorMessage(err)}`, { cause: err });
99
100
  }
100
101
  const keyId = typeof params.keyId === "string" && params.keyId.trim() ? params.keyId.trim() : null;
101
102
  return {
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
2
  import { n as normalizeMatrixMessagingTarget, t as isMatrixQualifiedUserId } from "./target-ids-B-5aQxwn.js";
3
- import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-C8dVBiCc.js";
3
+ import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-Bvg2wAnR.js";
4
4
  import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  //#region extensions/matrix/src/resolve-targets.ts
6
6
  var resolve_targets_exports = /* @__PURE__ */ __exportAll({ resolveMatrixTargets: () => resolveMatrixTargets });
@@ -1,4 +1,4 @@
1
- import { t as resolveMatrixTargets } from "./resolve-targets-nm2L48sh.js";
1
+ import { t as resolveMatrixTargets } from "./resolve-targets-BJAPY4Vb.js";
2
2
  //#region extensions/matrix/src/resolver.runtime.ts
3
3
  const matrixResolverRuntime = { resolveMatrixTargets };
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { r as isMatrixNotFoundError } from "./errors-C47hvAF8.js";
1
+ import { n as isMatrixNotFoundError } from "./errors-DKVS3_DO.js";
2
2
  //#region extensions/matrix/src/matrix/monitor/bounded-cache.ts
3
3
  function setBoundedMap(map, key, value, maxEntries) {
4
4
  map.set(key, value);
@@ -72,15 +72,24 @@ function createMatrixRoomInfoResolver(client) {
72
72
  const getMemberDisplayName = async (roomId, userId) => {
73
73
  const cacheKey = `${roomId}:${userId}`;
74
74
  if (memberDisplayNameCache.has(cacheKey)) return memberDisplayNameCache.get(cacheKey) ?? userId;
75
- const memberState = await client.getRoomStateEvent(roomId, "m.room.member", userId).catch(() => null);
75
+ let memberState;
76
+ try {
77
+ memberState = await client.getRoomStateEvent(roomId, "m.room.member", userId);
78
+ } catch {
79
+ return userId;
80
+ }
76
81
  const displayName = memberState && typeof memberState.displayname === "string" ? memberState.displayname : userId;
77
82
  setBoundedMap(memberDisplayNameCache, cacheKey, displayName, MAX_MEMBER_DISPLAY_NAMES);
78
83
  return displayName;
79
84
  };
85
+ const invalidateMemberDisplayName = (roomId, userId) => {
86
+ memberDisplayNameCache.delete(`${roomId}:${userId}`);
87
+ };
80
88
  return {
81
89
  getRoomAliases,
82
90
  getRoomInfo,
83
- getMemberDisplayName
91
+ getMemberDisplayName,
92
+ invalidateMemberDisplayName
84
93
  };
85
94
  }
86
95
  //#endregion
@@ -1,14 +1,17 @@
1
- import { a as resolveMatrixDefaultOrOnlyAccountId, i as resolveMatrixChannelConfig, n as requiresExplicitMatrixDefaultAccount, o as resolveMatrixAccountStringValues, r as resolveConfiguredMatrixAccountIds, t as findMatrixAccountEntry } from "./account-selection-kqquRzCf.js";
2
- import { n as listMatrixEnvAccountIds, r as resolveMatrixEnvAccountToken, t as getMatrixScopedEnvVarNames } from "./env-vars-B0NxQnPk.js";
1
+ import { a as resolveMatrixDefaultOrOnlyAccountId, i as resolveMatrixChannelConfig, n as requiresExplicitMatrixDefaultAccount, o as resolveMatrixAccountStringValues, r as resolveConfiguredMatrixAccountIds, t as findMatrixAccountEntry } from "./account-selection-CWuhuFn1.js";
2
+ import { n as listMatrixEnvAccountIds, r as resolveMatrixEnvAccountToken, t as getMatrixScopedEnvVarNames } from "./env-vars-dGqak9dN.js";
3
3
  import { r as setMatrixRuntime } from "./runtime-6S3DNFNv.js";
4
4
  import { a as resolveMatrixCredentialsPath, i as resolveMatrixCredentialsFilename, n as resolveMatrixAccountStorageRoot, o as resolveMatrixHomeserverKey, r as resolveMatrixCredentialsDir, s as sanitizeMatrixPathSegment, t as hashMatrixAccessToken } from "./storage-paths-gUmSydsW.js";
5
5
  import { d as setMatrixThreadBindingIdleTimeoutBySessionKey, p as setMatrixThreadBindingMaxAgeBySessionKey } from "./thread-bindings-shared-CKnY4LSd.js";
6
6
  import { n as ensureMatrixSdkInstalled, r as isMatrixSdkAvailable } from "./deps-CcVJfvRM.js";
7
+ import { chunkTextForOutbound as chunkTextForOutbound$1 } from "openclaw/plugin-sdk/text-chunking";
7
8
  import { assertHttpUrlTargetsPrivateNetwork, closeDispatcher, createPinnedDispatcher, resolvePinnedHostnameWithPolicy, ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "openclaw/plugin-sdk/ssrf-runtime";
8
9
  import { writeJsonFileAtomically } from "openclaw/plugin-sdk/json-store";
9
10
  import { formatZonedTimestamp } from "openclaw/plugin-sdk/time-runtime";
10
11
  //#region extensions/matrix/runtime-api.ts
11
12
  function chunkTextForOutbound(text, limit) {
13
+ if (text.length === 0) return [""];
14
+ if (Number.isFinite(limit) && limit > 0 && !Number.isInteger(limit)) return chunkTextForOutbound$1(text, limit);
12
15
  const chunks = [];
13
16
  let remaining = text;
14
17
  while (remaining.length > limit) {
@@ -18,7 +21,7 @@ function chunkTextForOutbound(text, limit) {
18
21
  chunks.push(remaining.slice(0, breakAt).trimEnd());
19
22
  remaining = remaining.slice(breakAt).trimStart();
20
23
  }
21
- if (remaining.length > 0 || text.length === 0) chunks.push(remaining);
24
+ if (remaining.length > 0) chunks.push(remaining);
22
25
  return chunks;
23
26
  }
24
27
  //#endregion