@@ -12,7 +12,10 @@ import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path";
1212import { appendIMessageCliStderrTail , appendIMessageCliStdout } from "./cli-output.js" ;
1313import { createIMessageRpcClient } from "./client.js" ;
1414import { extractMarkdownFormatRuns } from "./markdown-format.js" ;
15- import { resolveIMessageMessageId as resolveIMessageMessageIdImpl } from "./monitor-reply-cache.js" ;
15+ import {
16+ normalizeDirectChatIdentifier ,
17+ resolveIMessageMessageId as resolveIMessageMessageIdImpl ,
18+ } from "./monitor-reply-cache.js" ;
1619import type { IMessageTarget } from "./targets.js" ;
1720
1821type CliRunOptions = {
@@ -115,7 +118,7 @@ function chatListCacheSet(
115118 * forms — the action surface synthesizes `iMessage;-;<phone>` from a
116119 * handle target, while imsg's chats.list returns `identifier: <phone>`
117120 * and `guid: any;-;<phone>`. Comparing the raw strings would falsely
118- * miss the match. Mirror of the same helper in monitor-reply-cache.ts.
121+ * miss the match.
119122 */
120123export function normalizeDirectChatIdentifierForTest ( raw : string ) : string {
121124 return normalizeDirectChatIdentifier ( raw ) ;
@@ -128,17 +131,6 @@ export function findChatGuidForTest(
128131 return findChatGuid ( chats , target ) ;
129132}
130133
131- function normalizeDirectChatIdentifier ( raw : string ) : string {
132- const trimmed = raw . trim ( ) ;
133- const lowered = trimmed . toLowerCase ( ) ;
134- for ( const prefix of [ "imessage;-;" , "sms;-;" , "any;-;" ] ) {
135- if ( lowered . startsWith ( prefix ) ) {
136- return trimmed . slice ( prefix . length ) ;
137- }
138- }
139- return trimmed ;
140- }
141-
142134function findChatGuid (
143135 chats : readonly Record < string , unknown > [ ] ,
144136 target : Extract < IMessageTarget , { kind : "chat_id" | "chat_identifier" } > ,
0 commit comments