@esparkman/pensieve 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +59 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -515,10 +515,68 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
515
515
|
};
|
|
516
516
|
}
|
|
517
517
|
});
|
|
518
|
+
// Output prior context on startup
|
|
519
|
+
function outputPriorContext() {
|
|
520
|
+
const lastSession = db.getLastSession();
|
|
521
|
+
const decisions = db.getRecentDecisions(5);
|
|
522
|
+
const prefs = db.getAllPreferences();
|
|
523
|
+
const questions = db.getOpenQuestions();
|
|
524
|
+
const hasContent = lastSession?.summary || decisions.length > 0 || prefs.length > 0 || questions.length > 0;
|
|
525
|
+
if (!hasContent) {
|
|
526
|
+
console.error('🧙 Pensieve ready (no prior context yet)');
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
console.error('');
|
|
530
|
+
console.error('═══════════════════════════════════════════════════════════════');
|
|
531
|
+
console.error('🧙 PENSIEVE — Prior Context Loaded');
|
|
532
|
+
console.error('═══════════════════════════════════════════════════════════════');
|
|
533
|
+
if (lastSession?.ended_at) {
|
|
534
|
+
console.error('');
|
|
535
|
+
console.error('📋 LAST SESSION:');
|
|
536
|
+
if (lastSession.summary)
|
|
537
|
+
console.error(` ${lastSession.summary}`);
|
|
538
|
+
if (lastSession.work_in_progress) {
|
|
539
|
+
console.error('');
|
|
540
|
+
console.error('🚧 WORK IN PROGRESS:');
|
|
541
|
+
console.error(` ${lastSession.work_in_progress}`);
|
|
542
|
+
}
|
|
543
|
+
if (lastSession.next_steps) {
|
|
544
|
+
console.error('');
|
|
545
|
+
console.error('➡️ NEXT STEPS:');
|
|
546
|
+
console.error(` ${lastSession.next_steps}`);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
if (decisions.length > 0) {
|
|
550
|
+
console.error('');
|
|
551
|
+
console.error('🎯 KEY DECISIONS:');
|
|
552
|
+
decisions.forEach(d => {
|
|
553
|
+
console.error(` • [${d.topic}] ${d.decision}`);
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
if (prefs.length > 0) {
|
|
557
|
+
console.error('');
|
|
558
|
+
console.error('⚙️ PREFERENCES:');
|
|
559
|
+
prefs.forEach(p => {
|
|
560
|
+
console.error(` • ${p.category}/${p.key}: ${p.value}`);
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
if (questions.length > 0) {
|
|
564
|
+
console.error('');
|
|
565
|
+
console.error('❓ OPEN QUESTIONS:');
|
|
566
|
+
questions.forEach(q => {
|
|
567
|
+
console.error(` • [#${q.id}] ${q.question}`);
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
console.error('');
|
|
571
|
+
console.error('═══════════════════════════════════════════════════════════════');
|
|
572
|
+
console.error(`Database: ${db.getPath()}`);
|
|
573
|
+
console.error('═══════════════════════════════════════════════════════════════');
|
|
574
|
+
}
|
|
518
575
|
// Start server
|
|
519
576
|
async function main() {
|
|
520
577
|
const transport = new StdioServerTransport();
|
|
521
578
|
await server.connect(transport);
|
|
522
|
-
|
|
579
|
+
// Output prior context so Claude sees it automatically
|
|
580
|
+
outputPriorContext();
|
|
523
581
|
}
|
|
524
582
|
main().catch(console.error);
|
package/package.json
CHANGED