Skip to content

Commit cb1d5aa

Browse files
committed
feat: CLI shows last session context + auto-detect Supabase for paid tiers
- Restored Supabase auto-detection (paid tiers auto-detect credentials) - CLI banner now shows: - ✓ Loaded N TODOs, N keywords - 📋 Last: <session summary> (truncated to 120 chars) - 📌 TODOs: bullet list (max 3, with +N more) - No explicit PRISM_STORAGE=supabase needed for paid users
1 parent 82fcf0f commit cb1d5aa

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

src/cli.ts

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,17 @@ program
10481048
const { printBanner, buildPromptStr, printActionBar, formatToolCall, formatToolResult, formatResponse, formatError, formatWarning, printHelp, formatMcpConnect, formatContextLoaded, printThinking, clearThinking, c } = await import('./agent/terminalUI.js');
10491049

10501050
// ─── Load project context ───────────────────────────────
1051-
// Uses local SQLite by default (same backend as the MCP server).
1052-
// Only uses Supabase if PRISM_STORAGE=supabase is explicitly set.
1051+
// Auto-detect Supabase for paid tiers — no explicit PRISM_STORAGE needed.
1052+
// If credentials exist (env or dashboard config), use cloud storage.
1053+
if (!process.env.PRISM_STORAGE) {
1054+
const supaUrl = process.env.SUPABASE_URL || await getSetting('SUPABASE_URL');
1055+
const supaKey = process.env.SUPABASE_KEY || await getSetting('SUPABASE_KEY');
1056+
if (supaUrl && supaKey) {
1057+
process.env.PRISM_STORAGE = 'supabase';
1058+
if (!process.env.SUPABASE_URL) process.env.SUPABASE_URL = supaUrl;
1059+
if (!process.env.SUPABASE_KEY) process.env.SUPABASE_KEY = supaKey;
1060+
}
1061+
}
10531062
const storage = await getStorage();
10541063
let contextData: any = null;
10551064
try {
@@ -1141,6 +1150,23 @@ Guidelines:
11411150

11421151
if (contextData) {
11431152
console.log(` ${formatContextLoaded(contextData.pending_todo?.length || 0, contextData.keywords?.length || 0)}`);
1153+
if (contextData.last_summary) {
1154+
// Show last session summary (truncated to 120 chars)
1155+
const summary = contextData.last_summary.length > 120
1156+
? contextData.last_summary.substring(0, 117) + '...'
1157+
: contextData.last_summary;
1158+
console.log(` ${c.dim}📋 Last: ${summary}${c.reset}`);
1159+
}
1160+
if (contextData.pending_todo?.length > 0) {
1161+
console.log(` ${c.dim}📌 TODOs:${c.reset}`);
1162+
contextData.pending_todo.slice(0, 3).forEach((t: string) => {
1163+
const todo = t.length > 80 ? t.substring(0, 77) + '...' : t;
1164+
console.log(` ${c.dim}${todo}${c.reset}`);
1165+
});
1166+
if (contextData.pending_todo.length > 3) {
1167+
console.log(` ${c.dim} + ${contextData.pending_todo.length - 3} more${c.reset}`);
1168+
}
1169+
}
11441170
} else {
11451171
console.log(` ${formatWarning('No session context found — starting fresh')}`);
11461172
}

0 commit comments

Comments
 (0)