@adhdev/daemon-standalone 0.9.82-rc.374 → 0.9.82-rc.375

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-standalone",
3
- "version": "0.9.82-rc.374",
3
+ "version": "0.9.82-rc.375",
4
4
  "description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -1410,6 +1410,22 @@ var MESH_TASK_HISTORY_TOOL = {
1410
1410
  }
1411
1411
  }
1412
1412
  };
1413
+ var MESH_RECORD_NOTE_TOOL = {
1414
+ name: "mesh_record_note",
1415
+ description: "Record a durable operating note for this mesh \u2014 a runtime-accumulated lesson that future coordinators inherit. Unlike Claude-only memory/CLAUDE.md, this is provider-neutral: it persists in the mesh ledger and is injected into every coordinator's system prompt at launch (codex, hermes, antigravity, claude alike). Use it when you learn something durable: a provider quirk, a pattern to avoid, or a recovery lesson. Keep each note to one concrete, reusable fact. Not for transient task status \u2014 use missions/checkpoints for that.",
1416
+ inputSchema: {
1417
+ type: "object",
1418
+ properties: {
1419
+ text: { type: "string", description: "The note \u2014 one concrete, reusable operating fact/lesson. Phrase it so a future coordinator can act on it without this conversation's context." },
1420
+ category: {
1421
+ type: "string",
1422
+ enum: ["provider_quirk", "pattern_to_avoid", "recovery_lesson"],
1423
+ description: "Optional classification: provider_quirk (a provider/runtime behaves unexpectedly), pattern_to_avoid (an approach that caused problems), recovery_lesson (how a failure was recovered)."
1424
+ }
1425
+ },
1426
+ required: ["text"]
1427
+ }
1428
+ };
1413
1429
  var MESH_RECONCILE_LEDGER_TOOL = {
1414
1430
  name: "mesh_reconcile_ledger",
1415
1431
  description: "Reconcile daemon-local mesh ledgers by querying bounded ledger slices over P2P/DataChannel and importing missing entries into the coordinator local JSONL ledger. Cloud/D1 is not used as a ledger source of truth.",
@@ -1584,6 +1600,7 @@ var ALL_MESH_TOOLS = [
1584
1600
  MESH_CLEANUP_SESSIONS_TOOL,
1585
1601
  MESH_PRUNE_STALE_DIRECT_TOOL,
1586
1602
  MESH_TASK_HISTORY_TOOL,
1603
+ MESH_RECORD_NOTE_TOOL,
1587
1604
  MESH_RECONCILE_LEDGER_TOOL,
1588
1605
  MESH_MISSION_UPSERT_TOOL,
1589
1606
  MESH_MISSION_LIST_TOOL,
@@ -3267,6 +3284,33 @@ async function meshTaskHistory(ctx, args) {
3267
3284
  ...pendingEvents.length > 0 ? { pendingCoordinatorEvents: pendingEvents } : {}
3268
3285
  }, null, 2);
3269
3286
  }
3287
+ async function meshRecordNote(ctx, args) {
3288
+ const { mesh } = ctx;
3289
+ const text = typeof args.text === "string" ? args.text.trim() : "";
3290
+ if (!text) {
3291
+ return JSON.stringify({ success: false, error: "text required" }, null, 2);
3292
+ }
3293
+ const category = args.category === "provider_quirk" || args.category === "pattern_to_avoid" || args.category === "recovery_lesson" ? args.category : void 0;
3294
+ const createdAt = (/* @__PURE__ */ new Date()).toISOString();
3295
+ const sourceCoordinator = ctx.coordinatorSessionId || ctx.localDaemonId || ctx.coordinatorHostname || void 0;
3296
+ const entry = (0, import_daemon_core2.appendLedgerEntry)(mesh.id, {
3297
+ kind: "coordinator_operating_note",
3298
+ ...sourceCoordinator ? { sessionId: sourceCoordinator } : {},
3299
+ payload: {
3300
+ text,
3301
+ ...category ? { category } : {},
3302
+ createdAt,
3303
+ ...sourceCoordinator ? { sourceCoordinator } : {}
3304
+ }
3305
+ });
3306
+ return JSON.stringify({
3307
+ success: true,
3308
+ meshId: mesh.id,
3309
+ noteId: entry.id,
3310
+ recorded: { text, category: category ?? null, createdAt },
3311
+ note: 'Recorded to the mesh ledger. Future coordinators on this mesh will see it under "## Operating Notes" at launch.'
3312
+ }, null, 2);
3313
+ }
3270
3314
  async function meshReconcileLedger(ctx, args) {
3271
3315
  await refreshMeshFromDaemon(ctx);
3272
3316
  const requestedNodeIds = Array.isArray(args.node_ids) ? new Set(args.node_ids.map((id) => typeof id === "string" ? id.trim() : "").filter(Boolean)) : null;
@@ -5973,6 +6017,9 @@ async function startMcpServer(opts) {
5973
6017
  case "mesh_task_history":
5974
6018
  text = await meshTaskHistory(meshCtx, a);
5975
6019
  break;
6020
+ case "mesh_record_note":
6021
+ text = await meshRecordNote(meshCtx, a);
6022
+ break;
5976
6023
  case "mesh_reconcile_ledger":
5977
6024
  text = await meshReconcileLedger(meshCtx, a);
5978
6025
  break;