#!/usr/bin/env node
import { SupabaseConversationStore } from './dist/core/supabase-conversation-store.js';
const store = new SupabaseConversationStore();
// Check if we have any conversations
console.log('Checking Supabase for persisted conversations...\n');
// We can't easily list all conversations without the proper API
// but we can check if the "default" conversation exists
try {
const conv = await store.getConversation('default');
const state = conv.getState();
console.log('✅ Found conversation: default');
console.log(` Intent history: ${state.intentHistory.length} actions`);
console.log(` Tool permissions:`, JSON.stringify(state.toolPermissions, null, 2));
console.log(` Resources: ${state.sharedContext.resources.length}`);
if (state.sharedContext.resources.length > 0) {
console.log('\n Resources:');
state.sharedContext.resources.forEach(r => {
console.log(` - ${r.name} (created by ${r.createdBy})`);
});
}
console.log('\n✅ Act 9 VERIFIED: State persisted to Supabase!');
} catch (err) {
console.log('Conversation "default" not found or error:', err.message);
}