@@ -100,6 +100,18 @@ describe("thread links", () => {
100100 title ,
101101 ) ,
102102 ) . toBe ( "[There](t3-thread://v2/there/t1) and [Here](t3-thread://v2/local/t1)" ) ;
103+ const bare =
104+ "One agent is working: t3-thread://v2/there/thread:delegated-task:command%3Amcp%3A1" ;
105+ expect ( threadLinkRefs ( bare , local ) ) . toEqual ( [
106+ ref ( "there" , "thread:delegated-task:command%3Amcp%3A1" ) ,
107+ ref ( "there" , "thread:delegated-task:command:mcp:1" ) ,
108+ ] ) ;
109+ expect ( relabelThreadLinks ( bare , local , ( ) => "Convert settings to TypeScript" ) ) . toBe (
110+ "One agent is working: [Convert settings to TypeScript](t3-thread://v2/there/thread:delegated-task:command%3Amcp%3A1)" ,
111+ ) ;
112+ expect (
113+ relabelThreadLinks ( "See (t3-thread://v1/t1), then t3-thread://v2/there/t1." , local , title ) ,
114+ ) . toBe ( "See ([Here](t3-thread://v1/t1)), then [There](t3-thread://v2/there/t1)." ) ;
103115 } ) ;
104116
105117 it ( "turns a v2 link it cannot resolve into plain text, never the raw link" , ( ) => {
@@ -113,6 +125,9 @@ describe("thread links", () => {
113125 expect ( relabelThreadLinks ( "[Old](t3-thread://v1/t1)" , local , ( ) => undefined ) ) . toBe (
114126 "[Old](t3-thread://v1/t1)" ,
115127 ) ;
128+ expect ( relabelThreadLinks ( "t3-thread://v2/there/t1" , local , ( ) => undefined ) ) . toBe (
129+ "Thread on another machine" ,
130+ ) ;
116131 } ) ;
117132
118133 it ( "leaves links inside code spans and fences as written" , ( ) => {
@@ -122,6 +137,7 @@ describe("thread links", () => {
122137 "<t3-thread://v2/local/t1>" ,
123138 "```" ,
124139 "After <t3-thread://v2/local/t1>" ,
140+ "Literal `t3-thread://v2/local/t1`" ,
125141 ] . join ( "\n" ) ;
126142 expect ( relabelThreadLinks ( markdown , local , ( ) => "New" ) ) . toBe (
127143 [
@@ -130,6 +146,7 @@ describe("thread links", () => {
130146 "<t3-thread://v2/local/t1>" ,
131147 "```" ,
132148 "After [New](t3-thread://v2/local/t1)" ,
149+ "Literal `t3-thread://v2/local/t1`" ,
133150 ] . join ( "\n" ) ,
134151 ) ;
135152 } ) ;
0 commit comments