@awareness-sdk/local 0.1.4 → 0.1.5
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/package.json +1 -1
- package/src/daemon.mjs +22 -0
- package/src/spec/awareness-spec.json +3 -2
package/package.json
CHANGED
package/src/daemon.mjs
CHANGED
|
@@ -647,6 +647,27 @@ export class AwarenessLocalDaemon {
|
|
|
647
647
|
const recentSessions = this.indexer.getRecentSessions(args.days ?? 7);
|
|
648
648
|
const spec = this._loadSpec();
|
|
649
649
|
|
|
650
|
+
// Compute attention_summary for LLM-side triage
|
|
651
|
+
const now = Date.now();
|
|
652
|
+
const staleDays = 3;
|
|
653
|
+
const staleCutoff = now - staleDays * 86400000;
|
|
654
|
+
const staleTasks = openTasks.filter(t => {
|
|
655
|
+
const created = t.created_at ? new Date(t.created_at).getTime() : now;
|
|
656
|
+
return created < staleCutoff;
|
|
657
|
+
}).length;
|
|
658
|
+
const riskCards = this.indexer.db
|
|
659
|
+
.prepare("SELECT COUNT(*) as cnt FROM knowledge_cards WHERE (category = 'risk' OR category = 'pitfall') AND status = 'active'")
|
|
660
|
+
.get();
|
|
661
|
+
const highRisks = riskCards?.cnt || 0;
|
|
662
|
+
|
|
663
|
+
const attentionSummary = {
|
|
664
|
+
stale_tasks: staleTasks,
|
|
665
|
+
high_risks: highRisks,
|
|
666
|
+
total_open_tasks: openTasks.length,
|
|
667
|
+
total_knowledge_cards: recentCards.length,
|
|
668
|
+
needs_attention: staleTasks > 0 || highRisks > 0,
|
|
669
|
+
};
|
|
670
|
+
|
|
650
671
|
return {
|
|
651
672
|
content: [{
|
|
652
673
|
type: 'text',
|
|
@@ -657,6 +678,7 @@ export class AwarenessLocalDaemon {
|
|
|
657
678
|
open_tasks: openTasks,
|
|
658
679
|
recent_sessions: recentSessions,
|
|
659
680
|
stats,
|
|
681
|
+
attention_summary: attentionSummary,
|
|
660
682
|
synthesized_rules: spec.core_lines?.join('\n') || '',
|
|
661
683
|
init_guides: spec.init_guides || {},
|
|
662
684
|
agent_profiles: [],
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
{
|
|
59
59
|
"name": "awareness_init",
|
|
60
60
|
"short_desc": "Load cross-session project memory and context",
|
|
61
|
-
"long_desc": "Load cross-session project memory. Returns session_id, context (narratives, tasks, knowledge, active_skills), and usage rules. Call ONCE at session start."
|
|
61
|
+
"long_desc": "Load cross-session project memory. Returns session_id, context (narratives, tasks, knowledge, active_skills, attention_summary), and usage rules. Call ONCE at session start. ATTENTION PROTOCOL: When context.attention_summary.needs_attention is true, review all attention items (stale tasks, high risks) and automatically: (1) remind the user about stale tasks, (2) warn about high risks before starting work, (3) update resolved items via awareness_record."
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
"name": "awareness_get_agent_prompt",
|
|
@@ -385,7 +385,8 @@
|
|
|
385
385
|
"notes_lines": [
|
|
386
386
|
"## OpenClaw Notes",
|
|
387
387
|
"- OpenClaw uses a plugin-based configuration via ~/.openclaw/openclaw.json.",
|
|
388
|
-
"- Install
|
|
388
|
+
"- Install as plugin: openclaw plugins install @awareness-sdk/openclaw-memory",
|
|
389
|
+
"- Or install as skill: npx clawhub@latest install awareness-memory",
|
|
389
390
|
"- MCP tools are exposed through the plugin system, no rules file needed."
|
|
390
391
|
]
|
|
391
392
|
}
|