diff --git a/src/components/layout/ChatWorkspace/DbInlineCard.tsx b/src/components/layout/ChatWorkspace/DbInlineCard.tsx
index 54b4c58..e093e01 100644
--- a/src/components/layout/ChatWorkspace/DbInlineCard.tsx
+++ b/src/components/layout/ChatWorkspace/DbInlineCard.tsx
@@ -106,6 +106,12 @@ export function DbInlineCard({
if (path) navigate(path)
return { ok: true }
},
+ openUrl: (params) => {
+ const url = typeof params.url === 'string' ? params.url : ''
+ const target = typeof params.target === 'string' ? params.target : '_blank'
+ if (url) window.open(url, target)
+ return { ok: true }
+ },
sendMessage: (params) => {
const text = typeof params.text === 'string' ? params.text : ''
if (text) onSendMessage?.(text)
@@ -144,10 +150,11 @@ export function DbInlineCard({
diff --git a/src/lib/pluginBridgeSdk.ts b/src/lib/pluginBridgeSdk.ts
index 879cec0..edc35e9 100644
--- a/src/lib/pluginBridgeSdk.ts
+++ b/src/lib/pluginBridgeSdk.ts
@@ -48,6 +48,7 @@ export const PLUGIN_BRIDGE_SDK = `(function(){
params:function(){return launchParams;},
navigate:function(path){return send('navigate',{path:path});},
openSurface:function(opts){return send('openSurface',opts||{});},
+ openUrl:function(url,target){return send('openUrl',{url:url,target:target||'_blank'});},
sendMessage:function(text){return send('sendMessage',{text:text});},
requestFullscreen:function(){return send('requestFullscreen',{});},
setMaximized:function(v){return send('setMaximized',{maximized:!!v});},
diff --git a/src/lib/pluginHostBridge.ts b/src/lib/pluginHostBridge.ts
index 6f32d49..0cefde8 100644
--- a/src/lib/pluginHostBridge.ts
+++ b/src/lib/pluginHostBridge.ts
@@ -33,6 +33,7 @@ export const BRIDGE_PROTOCOL_VERSION = 1 as const
export type PluginCapability =
| 'host.navigate'
| 'host.openSurface'
+ | 'host.openUrl'
| 'host.sendMessage'
| 'host.fullscreen'
| 'host.close'
@@ -41,6 +42,7 @@ export type PluginCapability =
export type PluginActionType =
| 'navigate'
| 'openSurface'
+ | 'openUrl'
| 'sendMessage'
| 'requestFullscreen'
| 'setMaximized'
@@ -49,6 +51,7 @@ export type PluginActionType =
const ACTION_CAPABILITY: Record = {
navigate: 'host.navigate',
openSurface: 'host.openSurface',
+ openUrl: 'host.openUrl',
sendMessage: 'host.sendMessage',
requestFullscreen: 'host.fullscreen',
setMaximized: 'host.fullscreen',