@adhdev/daemon-standalone 1.0.18-rc.5 → 1.0.18-rc.7

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": "1.0.18-rc.5",
3
+ "version": "1.0.18-rc.7",
4
4
  "description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -37,7 +37,7 @@
37
37
  "license": "AGPL-3.0-or-later",
38
38
  "dependencies": {
39
39
  "@adhdev/ghostty-vt-node": "*",
40
- "@adhdev/session-host-core": "1.0.18-rc.5",
40
+ "@adhdev/session-host-core": "1.0.18-rc.7",
41
41
  "@xterm/addon-serialize": "^0.14.0",
42
42
  "@xterm/xterm": "^6.0.0",
43
43
  "chalk": "^5.3.0",
@@ -1171,7 +1171,15 @@ var MESH_RECORD_NOTE_TOOL = {
1171
1171
  category: {
1172
1172
  type: "string",
1173
1173
  enum: ["provider_quirk", "pattern_to_avoid", "recovery_lesson"],
1174
- 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)."
1174
+ 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). Category also governs default read-side retention: recovery_lesson ages out of the injected prompt after ~14 days, pattern_to_avoid after ~30, provider_quirk and uncategorized are durable (never age out). The ledger entry is always kept for audit regardless."
1175
+ },
1176
+ pinned: {
1177
+ type: "boolean",
1178
+ description: "Pin this note so it ALWAYS rides into every coordinator prompt: never dropped by TTL expiry and kept ahead of unpinned notes when the injection cap is hit. Use for durable, high-value operating knowledge you never want to lose from the prompt."
1179
+ },
1180
+ ttl_days: {
1181
+ type: "number",
1182
+ description: "Optional explicit read-side lifespan in days. Resolved to an absolute expiry at record time; after it passes an UNPINNED note is hidden from the injected prompt (but retained in the ledger for audit). Overrides the category default TTL. Ignored when pinned is true."
1175
1183
  }
1176
1184
  },
1177
1185
  required: ["text"]
@@ -4353,6 +4361,13 @@ async function meshRecordNote(ctx, args) {
4353
4361
  }
4354
4362
  const category = args.category === "provider_quirk" || args.category === "pattern_to_avoid" || args.category === "recovery_lesson" ? args.category : void 0;
4355
4363
  const createdAt = (/* @__PURE__ */ new Date()).toISOString();
4364
+ const pinned = args.pinned === true ? true : void 0;
4365
+ let expiresAt;
4366
+ if (typeof args.expiresAt === "string" && !Number.isNaN(new Date(args.expiresAt).getTime())) {
4367
+ expiresAt = new Date(args.expiresAt).toISOString();
4368
+ } else if (typeof args.ttl_days === "number" && Number.isFinite(args.ttl_days) && args.ttl_days > 0) {
4369
+ expiresAt = new Date(new Date(createdAt).getTime() + args.ttl_days * 24 * 60 * 60 * 1e3).toISOString();
4370
+ }
4356
4371
  const sourceCoordinator = ctx.coordinatorSessionId || ctx.localDaemonId || ctx.coordinatorHostname || void 0;
4357
4372
  const entry = (0, import_daemon_core4.appendLedgerEntry)(mesh.id, {
4358
4373
  kind: "coordinator_operating_note",
@@ -4361,14 +4376,16 @@ async function meshRecordNote(ctx, args) {
4361
4376
  text,
4362
4377
  ...category ? { category } : {},
4363
4378
  createdAt,
4364
- ...sourceCoordinator ? { sourceCoordinator } : {}
4379
+ ...sourceCoordinator ? { sourceCoordinator } : {},
4380
+ ...pinned ? { pinned } : {},
4381
+ ...expiresAt ? { expiresAt } : {}
4365
4382
  }
4366
4383
  });
4367
4384
  return JSON.stringify({
4368
4385
  success: true,
4369
4386
  meshId: mesh.id,
4370
4387
  noteId: entry.id,
4371
- recorded: { text, category: category ?? null, createdAt },
4388
+ recorded: { text, category: category ?? null, createdAt, pinned: pinned ?? false, expiresAt: expiresAt ?? null },
4372
4389
  note: 'Recorded to the mesh ledger. Future coordinators on this mesh will see it under "## Operating Notes" at launch.'
4373
4390
  }, null, 2);
4374
4391
  }