@adhdev/daemon-core 1.0.7-rc.1 → 1.0.8-rc.1
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 +69 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +69 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/commands/low-family/mesh-ledger.ts +72 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adhdev/daemon-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8-rc.1",
|
|
4
4
|
"description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"author": "vilmire",
|
|
48
48
|
"license": "AGPL-3.0-or-later",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@adhdev/mesh-shared": "1.0.
|
|
51
|
-
"@adhdev/session-host-core": "1.0.
|
|
50
|
+
"@adhdev/mesh-shared": "1.0.8-rc.1",
|
|
51
|
+
"@adhdev/session-host-core": "1.0.8-rc.1",
|
|
52
52
|
"@agentclientprotocol/sdk": "^0.16.1",
|
|
53
53
|
"ajv": "^8.20.0",
|
|
54
54
|
"ajv-formats": "^3.0.1",
|
|
@@ -43,6 +43,78 @@ export const meshLedgerHandlers: Record<string, LowFamilyHandler> = {
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
|
|
46
|
+
// Coordinator operating-note CRUD, exposed over P2P so the dashboard mesh
|
|
47
|
+
// graph dialog can list / record / forget notes (previously stdio-MCP only).
|
|
48
|
+
list_mesh_notes: async (_ctx: LowFamilyContext, args: any) => {
|
|
49
|
+
const meshId = typeof args?.meshId === 'string' ? args.meshId.trim() : '';
|
|
50
|
+
if (!meshId) return { success: false, error: 'meshId required' };
|
|
51
|
+
try {
|
|
52
|
+
const { readOperatingNotes } = await import('../../mesh/mesh-ledger.js');
|
|
53
|
+
const tail = typeof args?.tail === 'number' ? args.tail : 100;
|
|
54
|
+
const entries = readOperatingNotes(meshId, { tail });
|
|
55
|
+
// Flatten to the shape the notes tab renders: id + note payload fields.
|
|
56
|
+
const notes = entries.map(e => {
|
|
57
|
+
const p = (e.payload || {}) as Record<string, unknown>;
|
|
58
|
+
return {
|
|
59
|
+
id: e.id,
|
|
60
|
+
text: typeof p.text === 'string' ? p.text : '',
|
|
61
|
+
category: typeof p.category === 'string' ? p.category : undefined,
|
|
62
|
+
createdAt: typeof p.createdAt === 'string' ? p.createdAt : e.timestamp,
|
|
63
|
+
sourceCoordinator: typeof p.sourceCoordinator === 'string' ? p.sourceCoordinator : undefined,
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
return { success: true, notes };
|
|
67
|
+
} catch (e: any) {
|
|
68
|
+
return { success: false, error: e.message };
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
record_mesh_note: async (_ctx: LowFamilyContext, args: any) => {
|
|
73
|
+
const meshId = typeof args?.meshId === 'string' ? args.meshId.trim() : '';
|
|
74
|
+
if (!meshId) return { success: false, error: 'meshId required' };
|
|
75
|
+
const text = typeof args?.text === 'string' ? args.text.trim() : '';
|
|
76
|
+
if (!text) return { success: false, error: 'text required' };
|
|
77
|
+
try {
|
|
78
|
+
const { appendLedgerEntry } = await import('../../mesh/mesh-ledger.js');
|
|
79
|
+
const category = typeof args?.category === 'string' ? args.category : undefined;
|
|
80
|
+
// appendLedgerEntry de-dupes identical note text within its recent window.
|
|
81
|
+
const entry = appendLedgerEntry(meshId, {
|
|
82
|
+
kind: 'coordinator_operating_note',
|
|
83
|
+
payload: {
|
|
84
|
+
text,
|
|
85
|
+
...(category ? { category } : {}),
|
|
86
|
+
createdAt: new Date().toISOString(),
|
|
87
|
+
sourceCoordinator: 'dashboard',
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
return { success: true, id: entry.id };
|
|
91
|
+
} catch (e: any) {
|
|
92
|
+
return { success: false, error: e.message };
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
forget_mesh_note: async (_ctx: LowFamilyContext, args: any) => {
|
|
97
|
+
const meshId = typeof args?.meshId === 'string' ? args.meshId.trim() : '';
|
|
98
|
+
if (!meshId) return { success: false, error: 'meshId required' };
|
|
99
|
+
const noteId = typeof args?.noteId === 'string' ? args.noteId.trim() : '';
|
|
100
|
+
const text = typeof args?.text === 'string' ? args.text.trim() : '';
|
|
101
|
+
if (!noteId && !text) return { success: false, error: 'noteId or text required' };
|
|
102
|
+
try {
|
|
103
|
+
const { tombstoneOperatingNote } = await import('../../mesh/mesh-ledger.js');
|
|
104
|
+
const reason = typeof args?.reason === 'string' && args.reason.trim()
|
|
105
|
+
? args.reason.trim()
|
|
106
|
+
: 'dashboard_manual';
|
|
107
|
+
const result = tombstoneOperatingNote(meshId, {
|
|
108
|
+
...(noteId ? { noteId } : {}),
|
|
109
|
+
...(text ? { text } : {}),
|
|
110
|
+
reason,
|
|
111
|
+
});
|
|
112
|
+
return { success: true, matched: result.matched };
|
|
113
|
+
} catch (e: any) {
|
|
114
|
+
return { success: false, error: e.message };
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
|
|
46
118
|
import_mesh_ledger_slice: async (_ctx: LowFamilyContext, args: any) => {
|
|
47
119
|
const meshId = typeof args?.meshId === 'string' ? args.meshId.trim() : '';
|
|
48
120
|
if (!meshId) return { success: false, error: 'meshId required' };
|