Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

feat: add open_in_chat option for pipe notification actions

Louis Beaumont483370ba2f94
diff --git a/apps/screenpipe-app-tauri/app/notification-panel/page.tsx b/apps/screenpipe-app-tauri/app/notification-panel/page.tsx
index 0a7a4d82b..13eb459b8 100644
--- a/apps/screenpipe-app-tauri/app/notification-panel/page.tsx
+++ b/apps/screenpipe-app-tauri/app/notification-panel/page.tsx
@@ -25,6 +25,7 @@ interface NotificationAction {
method?: string;
body?: Record<string, unknown>;
toast?: string;
+ open_in_chat?: boolean;
}
interface NotificationPayload {
@@ -89,11 +90,25 @@ export default function NotificationPanelPage() {
case "pipe": {
const pipeName = actionObj.pipe || payload?.pipe_name;
if (pipeName) {
- await fetch(`http://localhost:3030/pipes/${pipeName}/run`, {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ notification_context: actionObj.context }),
- });
+ if (actionObj.open_in_chat) {
+ // Open in chat UI so user sees the output live
+ const contextStr = actionObj.context
+ ? JSON.stringify(actionObj.context, null, 2)
+ : "";
+ await showChatWithPrefill({
+ context: `run pipe "${pipeName}" with this context:\n${contextStr}`,
+ prompt: `run the ${pipeName} pipe${actionObj.context ? " with the provided context" : ""}`,
+ autoSend: true,
+ source: `notification-${payload?.id}`,
+ });
+ } else {
+ // Run in background
+ await fetch(`http://localhost:3030/pipes/${pipeName}/run`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ notification_context: actionObj.context }),
+ });
+ }
}
break;
}
@@ -109,7 +124,21 @@ export default function NotificationPanelPage() {
}
case "deeplink": {
if (actionObj.url) {
- window.location.href = actionObj.url;
+ // Use Tauri shell open for custom schemes, invoke for internal navigation
+ if (actionObj.url.startsWith("screenpipe://")) {
+ try {
+ await invoke("show_window", { window: "Main" });
+ } catch {
+ // fallback
+ }
+ } else {
+ try {
+ const { open } = await import("@tauri-apps/plugin-shell");
+ await open(actionObj.url);
+ } catch {
+ window.open(actionObj.url, "_blank");
+ }
+ }
}
break;
}
diff --git a/apps/screenpipe-app-tauri/components/notification-handler.tsx b/apps/screenpipe-app-tauri/components/notification-handler.tsx
index c1f73bcb0..6d39296b1 100644
--- a/apps/screenpipe-app-tauri/components/notification-handler.tsx
+++ b/apps/screenpipe-app-tauri/components/notification-handler.tsx
@@ -103,7 +103,7 @@ const NotificationHandler: React.FC = () => {
if (n.pipe_name && prefs.mutedPipes.includes(n.pipe_name)) continue;
// Convert pipe notification actions to the format the panel expects
- const actions = (n.actions || []).map((a: { id?: string; label: string; type?: string; pipe?: string; context?: Record<string, unknown>; url?: string; method?: string; body?: Record<string, unknown>; toast?: string; primary?: boolean }) => ({
+ const actions = (n.actions || []).map((a: { id?: string; label: string; type?: string; pipe?: string; context?: Record<string, unknown>; url?: string; method?: string; body?: Record<string, unknown>; toast?: string; primary?: boolean; open_in_chat?: boolean }) => ({
id: a.id,
label: a.label,
action: a.id || a.label,
@@ -115,6 +115,7 @@ const NotificationHandler: React.FC = () => {
body: a.body,
toast: a.toast,
primary: a.primary || false,
+ open_in_chat: a.open_in_chat || false,
}));
await showNotificationPanel({
diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-notification-panel.ts b/apps/screenpipe-app-tauri/lib/hooks/use-notification-panel.ts
index ef0b08f0f..631db86c5 100644
--- a/apps/screenpipe-app-tauri/lib/hooks/use-notification-panel.ts
+++ b/apps/screenpipe-app-tauri/lib/hooks/use-notification-panel.ts
@@ -17,6 +17,7 @@ export interface NotificationAction {
method?: string;
body?: Record<string, unknown>;
toast?: string;
+ open_in_chat?: boolean;
}
export interface NotificationPayload {
diff --git a/crates/screenpipe-connect/screenpipe-mcp/src/index.ts b/crates/screenpipe-connect/screenpipe-mcp/src/index.ts
index a5e4068e2..482501776 100644
--- a/crates/screenpipe-connect/screenpipe-mcp/src/index.ts
+++ b/crates/screenpipe-connect/screenpipe-mcp/src/index.ts
@@ -217,6 +217,7 @@ const TOOLS: Tool[] = [
type: { type: "string", enum: ["pipe", "api", "deeplink", "dismiss"], description: "Action type" },
pipe: { type: "string", description: "Pipe name to run (type=pipe)" },
context: { type: "object", description: "Context passed to pipe (type=pipe)" },
+ open_in_chat: { type: "boolean", description: "Open pipe run in chat UI instead of background (type=pipe)" },
url: { type: "string", description: "URL for api/deeplink actions" },
},
required: ["id", "label", "type"],
diff --git a/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.md b/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.md
index 5ab1ba6af..6916e8057 100644
--- a/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.md
+++ b/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.md
@@ -393,6 +393,11 @@ curl -X POST http://localhost:3030/notify \
{"id": "transcribe", "label": "transcribe all", "type": "pipe", "pipe": "voice-memos", "context": {"files": ["a.m4a"]}}
```
+Add `"open_in_chat": true` to show the pipe output in the chat UI instead of running silently in the background:
+```json
+{"id": "summarize", "label": "view summary", "type": "pipe", "pipe": "meeting-summary", "context": {"action": "summarize_last"}, "open_in_chat": true}
+```
+
Returns `{"id": "pipe-my-pipe-1710000000000"}`.
---
diff --git a/crates/screenpipe-engine/src/notifications_api.rs b/crates/screenpipe-engine/src/notifications_api.rs
index 1e2bc4dba..42a310a80 100644
--- a/crates/screenpipe-engine/src/notifications_api.rs
+++ b/crates/screenpipe-engine/src/notifications_api.rs
@@ -51,6 +51,10 @@ pub struct NotificationAction {
pub toast: Option<String>,
#[serde(default)]
pub primary: bool,
+ /// When true for type=pipe, opens the pipe run in the chat UI instead of background.
+ #[serde(default)]
+ #[serde(skip_serializing_if = "std::ops::Not::not")]
+ pub open_in_chat: bool,
}
/// Incoming notification request from a pipe.