@@ -8,7 +8,7 @@ import museLogo from "./logos/muse.png";
88import openClawLogo from "./logos/openclaw.png" ;
99import pokeLogo from "./logos/poke.png" ;
1010
11- /** How the Connect step hands T3 Code's MCP URL to an app. Every link is https. */
11+ /** How the Connect step hands T3 Code's MCP URL to an app. Every ` link` is https. */
1212export type McpAppHandoff =
1313 /** Opens the app's add form with T3 Code filled in. */
1414 | { readonly kind : "open" ; readonly link : ( mcpUrl : string ) => string }
@@ -18,6 +18,11 @@ export type McpAppHandoff =
1818 | {
1919 readonly kind : "copy-message" ;
2020 readonly link : string ;
21+ /**
22+ * Opens the installed app first, given the message; `link` is the fallback. The desktop
23+ * app opens only the link shapes `APP_LAUNCH_URLS` in ElectronShell lists.
24+ */
25+ readonly appLink ?: ( message : string ) => string ;
2126 readonly message : ( mcpUrl : string ) => string ;
2227 }
2328 /** Commands to run where the app runs. */
@@ -83,10 +88,12 @@ export const MCP_APPS: readonly McpApp[] = [
8388 id : "grok-bot" ,
8489 name : "Grok Bot" ,
8590 logo : grokBotLogo ,
86- // The app has no web chat, and its prompt links need a Bot id.
91+ // No web chat, and no link that prefills a message yet (Grok Bot plans one), so the app
92+ // opens bare and the copied message is pasted in.
8793 handoff : {
8894 kind : "copy-message" ,
8995 link : "https://x.ai/bot" ,
96+ appLink : ( ) => "grokbot://app" ,
9097 message : ( url ) => `Add the MCP server ${ url } and connect it.` ,
9198 } ,
9299 steps : [ "Send this message to any of your Grok Bots." ] ,
@@ -182,19 +189,28 @@ export function mcpHandoffAction(app: McpApp, mcpUrl: string) {
182189 const { handoff } = app ;
183190 switch ( handoff . kind ) {
184191 case "open" :
185- return { label : `Open in ${ app . name } ` , link : handoff . link ( mcpUrl ) , copy : null } ;
192+ return {
193+ label : `Open in ${ app . name } ` ,
194+ link : handoff . link ( mcpUrl ) ,
195+ appLink : null ,
196+ copy : null ,
197+ } ;
186198 case "copy-url" :
187199 return {
188200 label : `Copy URL and open ${ app . name } ` ,
189201 link : handoff . link ,
202+ appLink : null ,
190203 copy : { text : mcpUrl , title : "URL copied" } ,
191204 } ;
192- case "copy-message" :
205+ case "copy-message" : {
206+ const message = handoff . message ( mcpUrl ) ;
193207 return {
194208 label : `Copy message and open ${ app . name } ` ,
195209 link : handoff . link ,
196- copy : { text : handoff . message ( mcpUrl ) , title : "Message copied" } ,
210+ appLink : handoff . appLink ?.( message ) ?? null ,
211+ copy : { text : message , title : "Message copied" } ,
197212 } ;
213+ }
198214 case "commands" :
199215 return null ;
200216 }
0 commit comments