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

update: editable pipe config & prompt in settings, credits inline in account

Louis Beaumont5fae53b67313
diff --git a/apps/screenpipe-app-tauri/components/settings/account-section.tsx b/apps/screenpipe-app-tauri/components/settings/account-section.tsx
index 9632d9a1f..7105a5096 100644
--- a/apps/screenpipe-app-tauri/components/settings/account-section.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/account-section.tsx
@@ -194,34 +194,6 @@ export function AccountSection() {
</div>
</div>
- {/* Credits card — show for any logged-in user */}
- {settings.user?.token && (
- <Card className="p-5">
- <div className="flex items-center justify-between">
- <div className="flex items-center gap-3">
- <Coins className="h-5 w-5" />
- <div>
- <div className="flex items-baseline gap-2">
- <span className="text-2xl font-bold font-mono">{creditsBalance ?? 0}</span>
- <span className="text-sm text-muted-foreground">credits</span>
- </div>
- <p className="text-xs text-muted-foreground mt-0.5">
- each credit = 1 AI query after your free daily limit
- </p>
- </div>
- </div>
- <Button
- variant="outline"
- size="sm"
- onClick={() => setShowUpgrade(true)}
- >
- <Coins className="w-3.5 h-3.5 mr-1.5" />
- buy credits
- </Button>
- </div>
- </Card>
- )}
-
{/* Subscribed view */}
{settings.user?.cloud_subscribed ? (
<Card className="p-5">
@@ -252,10 +224,26 @@ export function AccountSection() {
<div className="flex items-center gap-2">
<span>✓</span> cloud transcription — higher quality
</div>
+ <div className="flex items-center gap-2">
+ <span>✓</span> 500 credits/mo for pipes & AI
+ </div>
<div className="flex items-center gap-2">
<span>✓</span> priority support
</div>
</div>
+ <div className="flex items-center gap-2 mt-4 pt-4 border-t border-border/50">
+ <Coins className="h-4 w-4 text-muted-foreground" />
+ <span className="text-sm font-mono font-medium">{creditsBalance ?? 0}</span>
+ <span className="text-sm text-muted-foreground">credits remaining</span>
+ <Button
+ variant="outline"
+ size="sm"
+ className="h-7 text-xs ml-auto"
+ onClick={() => setShowUpgrade(true)}
+ >
+ buy more
+ </Button>
+ </div>
</Card>
) : !settings.user?.token ? (
/* Not logged in: login-first layout */
@@ -315,6 +303,10 @@ export function AccountSection() {
<Zap className="h-3.5 w-3.5 shrink-0" />
cloud transcription — higher quality, saves 2-3GB RAM
</div>
+ <div className="flex items-center gap-2 text-foreground">
+ <Coins className="h-3.5 w-3.5 shrink-0" />
+ 500 credits/mo for pipes & AI
+ </div>
<div className="flex items-center gap-2 text-foreground">
<Sparkles className="h-3.5 w-3.5 shrink-0" />
priority support
@@ -377,6 +369,10 @@ export function AccountSection() {
<Zap className="h-3.5 w-3.5 shrink-0" />
cloud transcription — higher quality, saves 2-3GB RAM
</div>
+ <div className="flex items-center gap-2 text-foreground">
+ <Coins className="h-3.5 w-3.5 shrink-0" />
+ 500 credits/mo for pipes & AI
+ </div>
<div className="flex items-center gap-2 text-foreground">
<Sparkles className="h-3.5 w-3.5 shrink-0" />
priority support
@@ -391,6 +387,20 @@ export function AccountSection() {
upgrade to pro
<ExternalLinkIcon className="w-4 h-4 ml-2" />
</Button>
+
+ <div className="flex items-center gap-2 mt-4 pt-4 border-t border-border/50">
+ <Coins className="h-4 w-4 text-muted-foreground" />
+ <span className="text-sm font-mono font-medium">{creditsBalance ?? 0}</span>
+ <span className="text-sm text-muted-foreground">credits remaining</span>
+ <Button
+ variant="outline"
+ size="sm"
+ className="h-7 text-xs ml-auto"
+ onClick={() => setShowUpgrade(true)}
+ >
+ buy more
+ </Button>
+ </div>
</Card>
</div>
diff --git a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
index 498524d5f..8cc9648a6 100644
--- a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
@@ -13,6 +13,7 @@ import {
RefreshCw,
Loader2,
ExternalLink,
+ Check,
} from "lucide-react";
import { Textarea } from "@/components/ui/textarea";
import { Input } from "@/components/ui/input";
@@ -98,6 +99,9 @@ export function PipesSection() {
const [loading, setLoading] = useState(true);
const [runningPipe, setRunningPipe] = useState<string | null>(null);
const [showUpgrade, setShowUpgrade] = useState(false);
+ const [configDrafts, setConfigDrafts] = useState<Record<string, Record<string, string>>>({});
+ const [promptDrafts, setPromptDrafts] = useState<Record<string, string>>({});
+ const [savingConfig, setSavingConfig] = useState<string | null>(null);
const { settings } = useSettings();
const fetchPipes = useCallback(async () => {
@@ -171,6 +175,67 @@ export function PipesSection() {
}
};
+ const getConfigDraft = (pipeName: string, key: string, original: unknown): string => {
+ return configDrafts[pipeName]?.[key] ?? String(original ?? "");
+ };
+
+ const setConfigDraft = (pipeName: string, key: string, value: string) => {
+ setConfigDrafts((prev) => ({
+ ...prev,
+ [pipeName]: { ...prev[pipeName], [key]: value },
+ }));
+ };
+
+ const hasConfigChanges = (pipe: PipeStatus): boolean => {
+ const drafts = configDrafts[pipe.config.name];
+ const hasFieldChanges = drafts && Object.entries(drafts).some(
+ ([k, v]) => v !== String(pipe.config.config[k] ?? "")
+ );
+ const promptDraft = promptDrafts[pipe.config.name];
+ const hasPromptChange = promptDraft !== undefined && promptDraft !== pipe.prompt_body;
+ return hasFieldChanges || hasPromptChange;
+ };
+
+ const saveConfig = async (pipeName: string, config: Record<string, unknown>, promptBody: string) => {
+ setSavingConfig(pipeName);
+ try {
+ const payload: Record<string, unknown> = {};
+ // config field changes
+ const drafts = configDrafts[pipeName];
+ if (drafts) {
+ for (const [k, v] of Object.entries(drafts)) {
+ const original = config[k];
+ const strOriginal = String(original ?? "");
+ if (v === strOriginal) continue;
+ if (typeof original === "number") {
+ const n = Number(v);
+ payload[k] = !isNaN(n) ? n : v;
+ } else if (typeof original === "boolean") {
+ payload[k] = v === "true";
+ } else {
+ payload[k] = v;
+ }
+ }
+ }
+ // prompt body change
+ const promptDraft = promptDrafts[pipeName];
+ if (promptDraft !== undefined && promptDraft !== promptBody) {
+ payload["prompt_body"] = promptDraft;
+ }
+ if (Object.keys(payload).length === 0) return;
+ await fetch(`http://localhost:3030/pipes/${pipeName}/config`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(payload),
+ });
+ setConfigDrafts((prev) => { const next = { ...prev }; delete next[pipeName]; return next; });
+ setPromptDrafts((prev) => { const next = { ...prev }; delete next[pipeName]; return next; });
+ fetchPipes();
+ } finally {
+ setSavingConfig(null);
+ }
+ };
+
if (loading) {
return (
<div className="flex items-center justify-center py-8">
@@ -373,15 +438,53 @@ export function PipesSection() {
run <code>pi /login</code> in terminal to authenticate.
</p>
+ {/* Editable config fields */}
+ {Object.keys(pipe.config.config).length > 0 && (
+ <div className="space-y-2">
+ <Label className="text-xs">config</Label>
+ <div className="grid grid-cols-2 gap-2">
+ {Object.entries(pipe.config.config).map(([key, value]) => (
+ <div key={key}>
+ <Label className="text-[11px] text-muted-foreground">
+ {key.replace(/_/g, " ")}
+ </Label>
+ <Input
+ value={getConfigDraft(pipe.config.name, key, value)}
+ onChange={(e) => setConfigDraft(pipe.config.name, key, e.target.value)}
+ placeholder={String(value ?? "")}
+ className="h-8 text-xs font-mono"
+ />
+ </div>
+ ))}
+ </div>
+ </div>
+ )}
+
<div>
<Label className="text-xs">prompt</Label>
<Textarea
- value={pipe.prompt_body}
- readOnly
+ value={promptDrafts[pipe.config.name] ?? pipe.prompt_body}
+ onChange={(e) => setPromptDrafts((prev) => ({ ...prev, [pipe.config.name]: e.target.value }))}
className="text-xs font-mono h-32"
/>
</div>
+ {hasConfigChanges(pipe) && (
+ <Button
+ size="sm"
+ className="h-7 text-xs"
+ disabled={savingConfig === pipe.config.name}
+ onClick={() => saveConfig(pipe.config.name, pipe.config.config, pipe.prompt_body)}
+ >
+ {savingConfig === pipe.config.name ? (
+ <Loader2 className="h-3 w-3 animate-spin mr-1" />
+ ) : (
+ <Check className="h-3 w-3 mr-1" />
+ )}
+ save
+ </Button>
+ )}
+
{/* Logs */}
<div>
<Label className="text-xs">recent runs</Label>
diff --git a/crates/screenpipe-core/assets/pipes/obsidian-sync/pipe.md b/crates/screenpipe-core/assets/pipes/obsidian-sync/pipe.md
index 7ffcc706b..96f9cd644 100644
--- a/crates/screenpipe-core/assets/pipes/obsidian-sync/pipe.md
+++ b/crates/screenpipe-core/assets/pipes/obsidian-sync/pipe.md
@@ -10,7 +10,6 @@ config:
vault_path: ""
notes_path: screenpipe/logs
sync_hours: 8
- custom_prompt: ""
---
You are syncing screenpipe activity data to an Obsidian vault.
diff --git a/crates/screenpipe-core/src/pipes/mod.rs b/crates/screenpipe-core/src/pipes/mod.rs
index 5ce0a737f..50395c740 100644
--- a/crates/screenpipe-core/src/pipes/mod.rs
+++ b/crates/screenpipe-core/src/pipes/mod.rs
@@ -353,8 +353,14 @@ impl PipeManager {
let content = std::fs::read_to_string(&pipe_md)?;
let (mut config, body) = parse_frontmatter(&content)?;
+ let mut new_body = body.clone();
for (k, v) in &updates {
match k.as_str() {
+ "prompt_body" => {
+ if let Some(s) = v.as_str() {
+ new_body = s.to_string();
+ }
+ }
"schedule" => {
if let Some(s) = v.as_str() {
config.schedule = s.to_string();
@@ -391,13 +397,14 @@ impl PipeManager {
}
}
- let new_content = serialize_pipe(&config, &body)?;
+ let new_content = serialize_pipe(&config, &new_body)?;
std::fs::write(&pipe_md, new_content)?;
// Update in-memory
let mut pipes = self.pipes.lock().await;
if let Some(entry) = pipes.get_mut(name) {
entry.0 = config;
+ entry.1 = new_body;
}
Ok(())