@openclaw/matrix 2026.2.2 → 2026.2.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026.2.6
4
+
5
+ ### Changes
6
+
7
+ - Version alignment with core OpenClaw release numbers.
8
+
9
+ ## 2026.2.4
10
+
11
+ ### Changes
12
+
13
+ - Version alignment with core OpenClaw release numbers.
14
+
3
15
  ## 2026.2.2
4
16
 
5
17
  ### Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/matrix",
3
- "version": "2026.2.2",
3
+ "version": "2026.2.6",
4
4
  "description": "OpenClaw Matrix channel plugin",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -51,6 +51,7 @@ export const MatrixConfigSchema = z.object({
51
51
  threadReplies: z.enum(["off", "inbound", "always"]).optional(),
52
52
  textChunkLimit: z.number().optional(),
53
53
  chunkMode: z.enum(["length", "newline"]).optional(),
54
+ responsePrefix: z.string().optional(),
54
55
  mediaMaxMb: z.number().optional(),
55
56
  autoJoin: z.enum(["always", "allowlist", "off"]).optional(),
56
57
  autoJoinAllowlist: z.array(allowFromEntry).optional(),
@@ -1,6 +1,6 @@
1
1
  import type { LocationMessageEventContent, MatrixClient } from "@vector-im/matrix-bot-sdk";
2
2
  import {
3
- createReplyPrefixContext,
3
+ createReplyPrefixOptions,
4
4
  createTypingCallbacks,
5
5
  formatAllowlistMatchMeta,
6
6
  logInboundDrop,
@@ -579,7 +579,12 @@ export function createMatrixRoomMessageHandler(params: MatrixMonitorHandlerParam
579
579
  channel: "matrix",
580
580
  accountId: route.accountId,
581
581
  });
582
- const prefixContext = createReplyPrefixContext({ cfg, agentId: route.agentId });
582
+ const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
583
+ cfg,
584
+ agentId: route.agentId,
585
+ channel: "matrix",
586
+ accountId: route.accountId,
587
+ });
583
588
  const typingCallbacks = createTypingCallbacks({
584
589
  start: () => sendTypingMatrix(roomId, true, undefined, client),
585
590
  stop: () => sendTypingMatrix(roomId, false, undefined, client),
@@ -604,8 +609,7 @@ export function createMatrixRoomMessageHandler(params: MatrixMonitorHandlerParam
604
609
  });
605
610
  const { dispatcher, replyOptions, markDispatchIdle } =
606
611
  core.channel.reply.createReplyDispatcherWithTyping({
607
- responsePrefix: prefixContext.responsePrefix,
608
- responsePrefixContextProvider: prefixContext.responsePrefixContextProvider,
612
+ ...prefixOptions,
609
613
  humanDelay: core.channel.reply.resolveHumanDelayConfig(cfg, route.agentId),
610
614
  deliver: async (payload) => {
611
615
  await deliverMatrixReplies({
@@ -635,7 +639,7 @@ export function createMatrixRoomMessageHandler(params: MatrixMonitorHandlerParam
635
639
  replyOptions: {
636
640
  ...replyOptions,
637
641
  skillFilter: roomConfig?.skills,
638
- onModelSelected: prefixContext.onModelSelected,
642
+ onModelSelected,
639
643
  },
640
644
  });
641
645
  markDispatchIdle();
package/src/onboarding.ts CHANGED
@@ -8,9 +8,9 @@ import {
8
8
  } from "openclaw/plugin-sdk";
9
9
  import type { CoreConfig, DmPolicy } from "./types.js";
10
10
  import { listMatrixDirectoryGroupsLive } from "./directory-live.js";
11
- import { listMatrixDirectoryPeersLive } from "./directory-live.js";
12
11
  import { resolveMatrixAccount } from "./matrix/accounts.js";
13
12
  import { ensureMatrixSdkInstalled, isMatrixSdkAvailable } from "./matrix/deps.js";
13
+ import { resolveMatrixTargets } from "./resolve-targets.js";
14
14
 
15
15
  const channel = "matrix" as const;
16
16
 
@@ -65,14 +65,16 @@ async function promptMatrixAllowFrom(params: {
65
65
 
66
66
  while (true) {
67
67
  const entry = await prompter.text({
68
- message: "Matrix allowFrom (username or user id)",
68
+ message: "Matrix allowFrom (full @user:server; display name only if unique)",
69
69
  placeholder: "@user:server",
70
70
  initialValue: existingAllowFrom[0] ? String(existingAllowFrom[0]) : undefined,
71
71
  validate: (value) => (String(value ?? "").trim() ? undefined : "Required"),
72
72
  });
73
73
  const parts = parseInput(String(entry));
74
74
  const resolvedIds: string[] = [];
75
- let unresolved: string[] = [];
75
+ const pending: string[] = [];
76
+ const unresolved: string[] = [];
77
+ const unresolvedNotes: string[] = [];
76
78
 
77
79
  for (const part of parts) {
78
80
  if (isFullUserId(part)) {
@@ -83,28 +85,33 @@ async function promptMatrixAllowFrom(params: {
83
85
  unresolved.push(part);
84
86
  continue;
85
87
  }
86
- const results = await listMatrixDirectoryPeersLive({
88
+ pending.push(part);
89
+ }
90
+
91
+ if (pending.length > 0) {
92
+ const results = await resolveMatrixTargets({
87
93
  cfg,
88
- query: part,
89
- limit: 5,
94
+ inputs: pending,
95
+ kind: "user",
90
96
  }).catch(() => []);
91
- const match = results.find((result) => result.id);
92
- if (match?.id) {
93
- resolvedIds.push(match.id);
94
- if (results.length > 1) {
95
- await prompter.note(
96
- `Multiple matches for "${part}", using ${match.id}.`,
97
- "Matrix allowlist",
98
- );
97
+ for (const result of results) {
98
+ if (result?.resolved && result.id) {
99
+ resolvedIds.push(result.id);
100
+ continue;
101
+ }
102
+ if (result?.input) {
103
+ unresolved.push(result.input);
104
+ if (result.note) {
105
+ unresolvedNotes.push(`${result.input}: ${result.note}`);
106
+ }
99
107
  }
100
- } else {
101
- unresolved.push(part);
102
108
  }
103
109
  }
104
110
 
105
111
  if (unresolved.length > 0) {
112
+ const details = unresolvedNotes.length > 0 ? unresolvedNotes : unresolved;
106
113
  await prompter.note(
107
- `Could not resolve: ${unresolved.join(", ")}. Use full @user:server IDs.`,
114
+ `Could not resolve:\n${details.join("\n")}\nUse full @user:server IDs.`,
108
115
  "Matrix allowlist",
109
116
  );
110
117
  continue;
package/src/types.ts CHANGED
@@ -71,6 +71,8 @@ export type MatrixConfig = {
71
71
  textChunkLimit?: number;
72
72
  /** Chunking mode: "length" (default) splits by size; "newline" splits on every newline. */
73
73
  chunkMode?: "length" | "newline";
74
+ /** Outbound response prefix override for this channel/account. */
75
+ responsePrefix?: string;
74
76
  /** Max outbound media size in MB. */
75
77
  mediaMaxMb?: number;
76
78
  /** Auto-join invites (always|allowlist|off). Default: always. */