@rubytech/create-maxy-code 0.1.163 → 0.1.164

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.
Files changed (85) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/neo4j/edge-annotations.json +4 -0
  3. package/payload/platform/plugins/admin/.claude-plugin/plugin.json +1 -1
  4. package/payload/platform/plugins/admin/PLUGIN.md +1 -6
  5. package/payload/platform/plugins/admin/hooks/lib/admin-graph-pass-common.sh +12 -15
  6. package/payload/platform/plugins/admin/mcp/dist/index.js +0 -41
  7. package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
  8. package/payload/platform/plugins/docs/references/platform.md +1 -1
  9. package/payload/platform/plugins/email/.claude-plugin/plugin.json +1 -1
  10. package/payload/platform/plugins/email/PLUGIN.md +8 -12
  11. package/payload/platform/plugins/email/mcp/dist/index.js +8 -34
  12. package/payload/platform/plugins/email/mcp/dist/index.js.map +1 -1
  13. package/payload/platform/plugins/email/mcp/dist/lib/attachment-archive.d.ts +39 -0
  14. package/payload/platform/plugins/email/mcp/dist/lib/attachment-archive.d.ts.map +1 -0
  15. package/payload/platform/plugins/email/mcp/dist/lib/attachment-archive.js +0 -0
  16. package/payload/platform/plugins/email/mcp/dist/lib/attachment-archive.js.map +1 -0
  17. package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-dispatch.d.ts +23 -1
  18. package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-dispatch.d.ts.map +1 -1
  19. package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-dispatch.js +131 -3
  20. package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-dispatch.js.map +1 -1
  21. package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-lookup.d.ts +19 -0
  22. package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-lookup.d.ts.map +1 -0
  23. package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-lookup.js +51 -0
  24. package/payload/platform/plugins/email/mcp/dist/lib/conversation-archive-lookup.js.map +1 -0
  25. package/payload/platform/plugins/email/mcp/dist/lib/graph.d.ts +0 -18
  26. package/payload/platform/plugins/email/mcp/dist/lib/graph.d.ts.map +1 -1
  27. package/payload/platform/plugins/email/mcp/dist/lib/graph.js +0 -12
  28. package/payload/platform/plugins/email/mcp/dist/lib/graph.js.map +1 -1
  29. package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts +88 -0
  30. package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts.map +1 -1
  31. package/payload/platform/plugins/email/mcp/dist/lib/imap.js +189 -1
  32. package/payload/platform/plugins/email/mcp/dist/lib/imap.js.map +1 -1
  33. package/payload/platform/plugins/email/mcp/dist/tools/email-fetch.d.ts.map +1 -1
  34. package/payload/platform/plugins/email/mcp/dist/tools/email-fetch.js +6 -1
  35. package/payload/platform/plugins/email/mcp/dist/tools/email-fetch.js.map +1 -1
  36. package/payload/platform/plugins/email/mcp/dist/tools/email-graph-query.d.ts +7 -15
  37. package/payload/platform/plugins/email/mcp/dist/tools/email-graph-query.d.ts.map +1 -1
  38. package/payload/platform/plugins/email/mcp/dist/tools/email-graph-query.js +206 -86
  39. package/payload/platform/plugins/email/mcp/dist/tools/email-graph-query.js.map +1 -1
  40. package/payload/platform/plugins/email/mcp/dist/tools/email-ingest.d.ts.map +1 -1
  41. package/payload/platform/plugins/email/mcp/dist/tools/email-ingest.js +104 -4
  42. package/payload/platform/plugins/email/mcp/dist/tools/email-ingest.js.map +1 -1
  43. package/payload/platform/plugins/email/mcp/dist/tools/email-read.d.ts.map +1 -1
  44. package/payload/platform/plugins/email/mcp/dist/tools/email-read.js +18 -12
  45. package/payload/platform/plugins/email/mcp/dist/tools/email-read.js.map +1 -1
  46. package/payload/platform/plugins/email/mcp/dist/tools/email-reply.d.ts.map +1 -1
  47. package/payload/platform/plugins/email/mcp/dist/tools/email-reply.js +5 -4
  48. package/payload/platform/plugins/email/mcp/dist/tools/email-reply.js.map +1 -1
  49. package/payload/platform/plugins/email/mcp/dist/tools/email-search.d.ts.map +1 -1
  50. package/payload/platform/plugins/email/mcp/dist/tools/email-search.js +13 -12
  51. package/payload/platform/plugins/email/mcp/dist/tools/email-search.js.map +1 -1
  52. package/payload/platform/plugins/email/references/email-reference.md +8 -8
  53. package/payload/platform/plugins/memory/.claude-plugin/plugin.json +1 -1
  54. package/payload/platform/plugins/memory/PLUGIN.md +2 -2
  55. package/payload/platform/plugins/memory/mcp/dist/index.js +4 -3
  56. package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
  57. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/label-origin-gate.test.js +1 -13
  58. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/label-origin-gate.test.js.map +1 -1
  59. package/payload/platform/plugins/memory/mcp/dist/lib/kd-classify-gate.d.ts.map +1 -1
  60. package/payload/platform/plugins/memory/mcp/dist/lib/kd-classify-gate.js +3 -5
  61. package/payload/platform/plugins/memory/mcp/dist/lib/kd-classify-gate.js.map +1 -1
  62. package/payload/platform/plugins/memory/mcp/dist/lib/label-origin-gate.d.ts +1 -1
  63. package/payload/platform/plugins/memory/mcp/dist/lib/label-origin-gate.d.ts.map +1 -1
  64. package/payload/platform/plugins/memory/mcp/dist/lib/label-origin-gate.js +10 -4
  65. package/payload/platform/plugins/memory/mcp/dist/lib/label-origin-gate.js.map +1 -1
  66. package/payload/platform/plugins/memory/mcp/dist/tools/memory-brain-capture-recent.d.ts.map +1 -1
  67. package/payload/platform/plugins/memory/mcp/dist/tools/memory-brain-capture-recent.js +5 -6
  68. package/payload/platform/plugins/memory/mcp/dist/tools/memory-brain-capture-recent.js.map +1 -1
  69. package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.js +21 -4
  70. package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.js.map +1 -1
  71. package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.d.ts.map +1 -1
  72. package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.js +6 -8
  73. package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.js.map +1 -1
  74. package/payload/platform/plugins/memory/references/schema-base.md +2 -1
  75. package/payload/platform/plugins/memory/references/transcript-formats/circleback.md +49 -0
  76. package/payload/platform/plugins/memory/references/transcript-formats/granola.md +50 -0
  77. package/payload/platform/plugins/memory/references/transcript-formats/otter.md +50 -0
  78. package/payload/platform/plugins/memory/skills/conversation-archive/SKILL.md +1 -0
  79. package/payload/platform/plugins/memory/skills/conversation-archive-mcp/SKILL.md +170 -0
  80. package/payload/platform/scripts/seed-neo4j.sh +1 -3
  81. package/payload/platform/templates/specialists/agents/librarian.md +1 -0
  82. package/payload/platform/plugins/admin/hooks/__tests__/per-turn-graph-pass-gate.test.sh +0 -387
  83. package/payload/platform/plugins/admin/hooks/__tests__/pre-turn-graph-pass.test.sh +0 -441
  84. package/payload/platform/plugins/admin/hooks/per-turn-graph-pass-gate.sh +0 -111
  85. package/payload/platform/plugins/admin/hooks/pre-turn-graph-pass.sh +0 -171
@@ -1 +1 @@
1
- {"version":3,"file":"email-read.js","sourceRoot":"","sources":["../../src/tools/email-read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAcpE,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,MAAkB;IAChD,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACvD,IAAI,OAAO,IAAI,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC;IAEhD,+CAA+C;IAC/C,MAAM,cAAc,GAAG,IAAI,CA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C,CAiErE"}
1
+ {"version":3,"file":"email-reply.d.ts","sourceRoot":"","sources":["../../src/tools/email-reply.ts"],"names":[],"mappings":"AAIA,UAAU,WAAW;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAUD,wBAAsB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAkErE"}
@@ -1,6 +1,6 @@
1
1
  import { loadCredentials } from "../lib/credentials.js";
2
2
  import { sendEmail } from "../lib/smtp.js";
3
- import { getMessageEnvelope } from "../lib/graph.js";
3
+ import { fetchEnvelopeByMessageId } from "../lib/imap.js";
4
4
  /**
5
5
  * Strip duplicate Re:/RE:/re: prefixes and prepend a single Re:.
6
6
  */
@@ -13,10 +13,11 @@ export async function emailReply(params) {
13
13
  if ("error" in result)
14
14
  throw new Error(result.error);
15
15
  const { config, password } = result.credentials;
16
- // Look up the original message inside its thread KD by messageId.
17
- const envelope = await getMessageEnvelope(params.messageId, params.accountId);
16
+ // Resolve the original message via IMAP (the graph no longer stores
17
+ // per-message envelopes see Task 445).
18
+ const envelope = await fetchEnvelopeByMessageId(config, password, params.messageId);
18
19
  if (!envelope) {
19
- throw new Error(`No email found with Message-ID ${params.messageId}. The thread may not have been fetched yet emails are ingested by the background polling job.`);
20
+ throw new Error(`No email found with Message-ID ${params.messageId} on the IMAP server. The message may have been deleted, moved out of INBOX/Sent, or never delivered.`);
20
21
  }
21
22
  const originalMessageId = envelope.messageId;
22
23
  const originalFrom = envelope.fromAddress;
@@ -1 +1 @@
1
- {"version":3,"file":"email-reply.js","sourceRoot":"","sources":["../../src/tools/email-reply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MA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,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CA8DvE"}
1
+ {"version":3,"file":"email-search.d.ts","sourceRoot":"","sources":["../../src/tools/email-search.ts"],"names":[],"mappings":"AAIA,UAAU,YAAY;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CA+DvE"}
@@ -1,6 +1,6 @@
1
1
  import { loadCredentials } from "../lib/credentials.js";
2
2
  import { searchMessages, MAX_LIMIT } from "../lib/imap.js";
3
- import { getThreadInfo, stripAngleBrackets } from "../lib/graph.js";
3
+ import { getMessageArchiveHints } from "../lib/conversation-archive-lookup.js";
4
4
  export async function emailSearch(params) {
5
5
  const result = await loadCredentials(params.accountId);
6
6
  if ("error" in result)
@@ -26,14 +26,16 @@ export async function emailSearch(params) {
26
26
  if (messages.length === 0) {
27
27
  return "No messages match the search criteria.";
28
28
  }
29
- // Enrich with thread info from the graph (best-effort failures return empty map)
30
- const messageIds = messages.map((m) => m.messageId).filter((id) => !!id);
31
- let threadMap = new Map();
29
+ // Per-archive enrichment see email-read.ts for semantics. Task 445.
30
+ const hintInput = messages
31
+ .filter((m) => m.messageId)
32
+ .map((m) => ({ messageId: m.messageId, receivedAt: m.date }));
33
+ let hints = new Map();
32
34
  try {
33
- threadMap = await getThreadInfo(messageIds, params.accountId);
35
+ hints = await getMessageArchiveHints(hintInput, params.accountId);
34
36
  }
35
37
  catch {
36
- // Thread enrichment is optional — continue without it
38
+ // Enrichment is optional — continue without it
37
39
  }
38
40
  const lines = messages
39
41
  .map((m) => {
@@ -42,12 +44,11 @@ export async function emailSearch(params) {
42
44
  entry += `\nMessage-ID: ${m.messageId}`;
43
45
  if (m.inReplyTo)
44
46
  entry += `\nIn-Reply-To: ${m.inReplyTo}`;
45
- const normalisedMid = stripAngleBrackets(m.messageId);
46
- if (normalisedMid) {
47
- const thread = threadMap.get(normalisedMid);
48
- if (thread) {
49
- entry += `\nThread-Depth: ${thread.threadDepth}`;
50
- entry += `\nThread-ID: ${thread.threadId}`;
47
+ if (m.messageId) {
48
+ const hint = hints.get(m.messageId);
49
+ if (hint) {
50
+ entry += `\nArchive: ${hint.archiveTitle}`;
51
+ entry += `\nArchive-Section: ${hint.sectionIndex}`;
51
52
  }
52
53
  }
53
54
  if (m.bodyPreview)
@@ -1 +1 @@
1
- {"version":3,"file":"email-search.js","sourceRoot":"","sources":["../../src/tools/email-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAepE,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAoB;IACpD,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACvD,IAAI,OAAO,IAAI,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAErD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC;IAEhD,+CAA+C;IAC/C,MAAM,cAAc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,SAAS,EAAE,CAAC;YAChB,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACpC,IAAI,IAAI,EAAE,CAAC;gBACT,KAAK,IAAI,cAAc,IAAI,CAAC,YAAY,EAAE,CAAC;gBAC3C,KAAK,IAAI,sBAAsB,IAAI,CAAC,YAAY,EAAE,CAAC;YACrD,CAAC;QACH,CAAC;QACD,IAAI,CAAC,CAAC,WAAW;YAAE,KAAK,IAAI,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;QACnD,OAAO,KAAK,GAAG,OAAO,CAAC;IACzB,CAAC,CAAC;SACD,IAAI,CAAC,MAAM,CAAC,CAAC;IAEhB,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,GAAG,KAAK,mCAAmC,aAAa,6CAA6C,CAAC;IAC/G,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -71,7 +71,7 @@ When `agentAddress` is not set or matches the auth email, all tools behave as be
71
71
 
72
72
  ## Email Persistence
73
73
 
74
- Emails enter the graph as `:KnowledgeDocument {source:'email'}` thread documents via the **operator-initiated ingestion flow** (see `skills/email-ingest/SKILL.md`). There is no background poll, cron, or auto-classifier — new messages are written only when the operator says "check my emails" and approves each one.
74
+ Emails enter the graph as `:ConversationArchive {source:'email'}` thread archives (with `:Section` chunks bounded by gap-hour sessionisation) via the **operator-initiated ingestion flow** (see `skills/email-ingest/SKILL.md`). There is no background poll, cron, or auto-classifier — new messages are written only when the operator says "check my emails" and approves each one.
75
75
 
76
76
  The two ingestion tools:
77
77
 
@@ -81,18 +81,18 @@ The two ingestion tools:
81
81
  Properties of the persistence layer:
82
82
 
83
83
  - **Operator-initiated only.** No `setInterval`, cron, or systemd timer ever invokes `email-fetch`. The operator drives every cycle.
84
- - **Deduplication:** Each message is identified by Message-ID. Re-ingesting the same message MERGEs without duplicating; a composite unique constraint on `(messageId, accountId)` provides database-level enforcement.
84
+ - **Deduplication:** Each archive is keyed by `conversationIdentity` (sha256 over `accountId + sortedParticipantElementIds`). Re-ingesting the same thread delta-appends new sections rather than duplicating.
85
85
  - **Alias filtering:** Only emails addressed TO the agent's `agentAddress` are listed and ingested.
86
- - **Semantic search:** Ingested threads are vector-indexed (subject + body preview), enabling natural-language search via `email-graph-query`.
87
- - **Isolation:** Each agent sees only emails addressed to its own bound email address, even when sharing a catchall mailbox.
86
+ - **Semantic search:** Sections are vector-indexed via `section_embedding`, enabling natural-language search via `email-graph-query` that ranks parent archives by their best-matching section.
87
+ - **Isolation:** Each agent sees only archives whose participants resolve to its own account scope, even when sharing a catchall mailbox.
88
88
 
89
89
  ## Email Threading
90
90
 
91
- Ingested messages are linked into conversation threads as one `:KnowledgeDocument {source:'email'}` per thread, with `:Person` `FROM`/`TO`/`CC` edges. Threading is resolved by `In-Reply-To`/`References` headers at ingest time.
91
+ Ingested messages are grouped into one `:ConversationArchive {source:'email'}` per thread, with operator-confirmed `:Person`/`:AdminUser` participants attached via `:PARTICIPANT_IN` edges. Thread grouping (`In-Reply-To`/`References` walk to the root Message-ID) happens in the email-plugin dispatcher before the conversation-archive pipeline sees the batch.
92
92
 
93
- - **Out-of-order arrival:** If a reply is ingested before its parent, the reply lives in its own thread until the parent is ingested, at which point future ingests fold them together via the shared root.
94
- - **Thread context:** `email-read` and `email-search` include `Thread-Depth` (number of hops to the thread root) and `Thread-ID` (emailId of the root message) for any message already in the graph. Root emails (no parent) have no thread fields.
95
- - **Scope:** Thread linkage never crosses account boundaries — parent lookups are always scoped to the same `accountId`.
93
+ - **Out-of-order arrival:** If a reply is ingested before its parent, the dispatcher treats the reply as its own thread root; once the parent arrives the dispatcher re-groups under the older root and the conversation-archive writer delta-appends into the shared archive.
94
+ - **Per-message context:** Per-message envelopes are not stored in the graph. `email-read` and `email-search` surface a best-effort `Archive` / `Archive-Section` hint when the IMAP message's `receivedAt` falls inside a stored section's `firstMessageAt..lastMessageAt` window; this is a UI hint, not a primary key.
95
+ - **Scope:** Thread linkage never crosses account boundaries — every archive carries `accountId` and the writer refuses cross-account participants.
96
96
 
97
97
  ### Agent-Email Binding
98
98
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memory",
3
- "description": "Graph memory plugin. Provides memory-search (with optional `fields` projection for known-shape lookups), memory-write, memory-update, and the :Report surface (memory-report-write / memory-report-read-latest / memory-report-list) for reading from, writing to, and updating the Neo4j knowledge graph. Includes conversational memory — organic preference learning, evidence-backed recall, and transparent 'what do you know about me?' responses. Document ingestion goes through memory-ingest; the dispatched specialist produces typed-section JSON in-turn from the loaded ontology. Operator-solicited reclassify of an already-stored thread-shaped KD (today: email-thread KDs) is exposed as `kd-classify <attachmentId>` — runs a body-growth gate (proceed iff body grew ≥25% since the last classify, or first-ever classify), stages the body to a temp file under `$ACCOUNT_DIR/tmp/`, and returns a dispatch envelope for the `librarian`; on success `memory-ingest` replaces the prior :Section children and stamps `lastClassifiedAt` + `lastClassifiedBodyLength` on the parent KD. Two modes: `document` (default) for unstructured PDF/web content → :KnowledgeDocument (keyed on `attachmentId`) + :Section, and `chat` for conversation transcripts → :ConversationArchive (keyed on `conversationIdentity`) + :Section chunks; two parent labels, two writer paths chosen by which identity property is set. Conversation-archive Phase 2 splits across two read-only tools (Task 433): `conversation-archive-list-chunks` pages chunk bodies for the dispatched specialist to read in-turn; `conversation-archive-derive-insights` converts the specialist's per-chunk claims into operator-facing proposals with per-kind cypher. `conversation-archive-enrich-rejection` records (or undoes) durable per-row rejections so already-triaged claims do not re-surface on re-runs. Ships four skills: `conversational-memory`, `document-ingest`, `conversation-archive` (source-agnostic transcript ingest for WhatsApp, Telegram, Signal, LinkedIn DMs, Zoom, meeting minutes, iMessage, Slack), and `conversation-archive-enrich` (per-row operator-gated insight derivation over a named archive's chunks).",
3
+ "description": "Graph memory plugin. Provides memory-search (with optional `fields` projection for known-shape lookups), memory-write, memory-update, and the :Report surface (memory-report-write / memory-report-read-latest / memory-report-list) for reading from, writing to, and updating the Neo4j knowledge graph. Includes conversational memory — organic preference learning, evidence-backed recall, and transparent 'what do you know about me?' responses. Document ingestion goes through memory-ingest; the dispatched specialist produces typed-section JSON in-turn from the loaded ontology. Operator-solicited reclassify of an already-stored thread-shaped KD (today: email-thread KDs) is exposed as `kd-classify <attachmentId>` — runs a body-growth gate (proceed iff body grew ≥25% since the last classify, or first-ever classify), stages the body to a temp file under `$ACCOUNT_DIR/tmp/`, and returns a dispatch envelope for the `librarian`; on success `memory-ingest` replaces the prior :Section children and stamps `lastClassifiedAt` + `lastClassifiedBodyLength` on the parent KD. Two modes: `document` (default) for unstructured PDF/web content → :KnowledgeDocument (keyed on `attachmentId`) + :Section, and `chat` for conversation transcripts → :ConversationArchive (keyed on `conversationIdentity`) + :Section chunks; two parent labels, two writer paths chosen by which identity property is set. Conversation-archive Phase 2 splits across two read-only tools (Task 433): `conversation-archive-list-chunks` pages chunk bodies for the dispatched specialist to read in-turn; `conversation-archive-derive-insights` converts the specialist's per-chunk claims into operator-facing proposals with per-kind cypher. `conversation-archive-enrich-rejection` records (or undoes) durable per-row rejections so already-triaged claims do not re-surface on re-runs. Ships five skills: `conversational-memory`, `document-ingest`, `conversation-archive` (source-agnostic transcript ingest for WhatsApp, Telegram, Signal, LinkedIn DMs, Zoom, meeting minutes, iMessage, Slack), `conversation-archive-mcp` (operator-initiated MCP-driven ingest for Granola, Otter, Circleback meetings — sibling of `conversation-archive` sharing the same writer surface and identity formula), and `conversation-archive-enrich` (per-row operator-gated insight derivation over a named archive's chunks).",
4
4
  "version": "0.1.0",
5
5
  "author": {
6
6
  "name": "Rubytech LLC"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: memory
3
- description: "Graph memory plugin. Provides memory-search (with optional `fields` projection for known-shape lookups), memory-write, memory-update, and the :Report surface (memory-report-write / memory-report-read-latest / memory-report-list) for reading from, writing to, and updating the Neo4j knowledge graph. Includes conversational memory — organic preference learning, evidence-backed recall, and transparent 'what do you know about me?' responses. Document ingestion goes through memory-ingest; the dispatched specialist produces typed-section JSON in-turn from the loaded ontology. Operator-solicited reclassify of an already-stored thread-shaped KD (today: email-thread KDs) is exposed as `kd-classify <attachmentId>` — runs a body-growth gate (proceed iff body grew ≥25% since the last classify, or first-ever classify), stages the body to a temp file under `$ACCOUNT_DIR/tmp/`, and returns a dispatch envelope for the `librarian`; on success `memory-ingest` replaces the prior :Section children and stamps `lastClassifiedAt` + `lastClassifiedBodyLength` on the parent KD. Two modes: `document` (default) for unstructured PDF/web content → :KnowledgeDocument (keyed on `attachmentId`) + :Section, and `chat` for conversation transcripts → :ConversationArchive (keyed on `conversationIdentity`) + :Section chunks; two parent labels, two writer paths chosen by which identity property is set. Conversation-archive Phase 2 splits across two read-only tools (Task 433): `conversation-archive-list-chunks` pages chunk bodies for the dispatched specialist to read in-turn; `conversation-archive-derive-insights` converts the specialist's per-chunk claims into operator-facing proposals with per-kind cypher. `conversation-archive-enrich-rejection` records (or undoes) durable per-row rejections so already-triaged claims do not re-surface on re-runs. Ships four skills: `conversational-memory`, `document-ingest`, `conversation-archive` (source-agnostic transcript ingest for WhatsApp, Telegram, Signal, LinkedIn DMs, Zoom, meeting minutes, iMessage, Slack), and `conversation-archive-enrich` (per-row operator-gated insight derivation over a named archive's chunks)."
3
+ description: "Graph memory plugin. Provides memory-search (with optional `fields` projection for known-shape lookups), memory-write, memory-update, and the :Report surface (memory-report-write / memory-report-read-latest / memory-report-list) for reading from, writing to, and updating the Neo4j knowledge graph. Includes conversational memory — organic preference learning, evidence-backed recall, and transparent 'what do you know about me?' responses. Document ingestion goes through memory-ingest; the dispatched specialist produces typed-section JSON in-turn from the loaded ontology. Operator-solicited reclassify of an already-stored thread-shaped KD (today: email-thread KDs) is exposed as `kd-classify <attachmentId>` — runs a body-growth gate (proceed iff body grew ≥25% since the last classify, or first-ever classify), stages the body to a temp file under `$ACCOUNT_DIR/tmp/`, and returns a dispatch envelope for the `librarian`; on success `memory-ingest` replaces the prior :Section children and stamps `lastClassifiedAt` + `lastClassifiedBodyLength` on the parent KD. Two modes: `document` (default) for unstructured PDF/web content → :KnowledgeDocument (keyed on `attachmentId`) + :Section, and `chat` for conversation transcripts → :ConversationArchive (keyed on `conversationIdentity`) + :Section chunks; two parent labels, two writer paths chosen by which identity property is set. Conversation-archive Phase 2 splits across two read-only tools (Task 433): `conversation-archive-list-chunks` pages chunk bodies for the dispatched specialist to read in-turn; `conversation-archive-derive-insights` converts the specialist's per-chunk claims into operator-facing proposals with per-kind cypher. `conversation-archive-enrich-rejection` records (or undoes) durable per-row rejections so already-triaged claims do not re-surface on re-runs. Ships five skills: `conversational-memory`, `document-ingest`, `conversation-archive` (source-agnostic transcript ingest for WhatsApp, Telegram, Signal, LinkedIn DMs, Zoom, meeting minutes, iMessage, Slack), `conversation-archive-mcp` (operator-initiated MCP-driven ingest for Granola, Otter, Circleback meetings — sibling of `conversation-archive` sharing the same writer surface and identity formula), and `conversation-archive-enrich` (per-row operator-gated insight derivation over a named archive's chunks)."
4
4
  tools:
5
5
  - name: memory-search
6
6
  publicAllowlist: true
@@ -193,7 +193,7 @@ Graph hygiene is **agent-directed, case by case** — no autonomous rule engine,
193
193
 
194
194
  ## Brain-capture diagnostic — `memory-brain-capture-recent`
195
195
 
196
- Read-only window into the extractive graph writes produced under this account. Returns recent `:MENTIONS` edges (`:Message-[:MENTIONS]->Entity`) and `:Idea` nodes interleaved by `observedAt`. Default window is 24 hours; pass `windowHours` (max 720) and `limit` (max 200) to scan a longer arc. Use this when the operator asks "what has the brain captured today?", "show me recent mentions of X", or "what ideas did I leave on the table this week?". Writes are produced by `database-operator` per-write briefs admin dispatches — either inline mid-turn, or as part of the once-per-operator-prompt pre-turn graph pass orchestrated by admin (`platform/plugins/admin/hooks/pre-turn-graph-pass.sh`, Tasks 425 + 430 + 439 — 430 reshaped the hook so admin walks the turn and dispatches per-write, 439 converged the hook's shared plumbing with `session-end-retrospective.sh`).
196
+ Read-only window into the extractive graph writes produced under this account. Returns recent `:MENTIONS` edges (`:Message-[:MENTIONS]->Entity`) and `:Idea` nodes interleaved by `observedAt`. Default window is 24 hours; pass `windowHours` (max 720) and `limit` (max 200) to scan a longer arc. Use this when the operator asks "what has the brain captured today?", "show me recent mentions of X", or "what ideas did I leave on the table this week?". Writes are produced by `database-operator` per-write briefs admin dispatches — either inline mid-turn, or as part of the session-end retrospective graph-completeness sweep (`platform/plugins/admin/hooks/session-end-retrospective.sh`).
197
197
 
198
198
  ## Conversational Memory
199
199
 
@@ -1089,7 +1089,7 @@ if (!readOnly) {
1089
1089
  }
1090
1090
  });
1091
1091
  eagerTool(server, "kd-classify", "Operator-solicited reclassify for any :KnowledgeDocument that carries a `body` property (today: email-thread KDs; future: any thread-shaped source). Reads the KD by attachmentId, decides via a body-growth gate (proceed iff body grew ≥25% since the last classify, or first-ever classify), stages the body to a temp file under $ACCOUNT_DIR/tmp/, and returns a dispatch envelope the admin agent hands to the `librarian` specialist. Librarian runs the document-ingest skill against the temp file; memory-ingest MERGEs by attachmentId, replacing any prior :Section children, and stamps lastClassifiedAt + lastClassifiedBodyLength on the KD so the next gate call has a baseline. Bodyless attachment KDs (PDFs etc.) are not supported here — they have no growth signal.", {
1092
- attachmentId: z.string().describe("attachmentId of the :KnowledgeDocument to classify. For email threads, this is sha256(`email:<accountId>:<rootMessageId>`); use the email-classify tool when you only have the root Message-ID."),
1092
+ attachmentId: z.string().describe("attachmentId of the :KnowledgeDocument to classify. For email threads, this is sha256(`email:<accountId>:<rootMessageId>`)."),
1093
1093
  }, async ({ attachmentId }) => {
1094
1094
  if (!accountId)
1095
1095
  return refuseNoAccount("kd-classify");
@@ -1940,8 +1940,9 @@ if (!readOnly) {
1940
1940
  };
1941
1941
  }
1942
1942
  });
1943
- // memory-brain-capture-recent: read-only diagnostic for the per-turn
1944
- // pre-turn-graph-pass writes that admin dispatches to `database-operator`.
1943
+ // memory-brain-capture-recent: read-only diagnostic for the graph writes
1944
+ // admin dispatches to `database-operator` (inline mid-turn, plus the
1945
+ // session-end retrospective graph-completeness sweep).
1945
1946
  // Returns recent :MENTIONS edges (:Message-[:MENTIONS]->Entity) and
1946
1947
  // :Idea nodes filtered by r.createdByAgent='database-operator'. The
1947
1948
  // admin agent uses this to answer "what has the brain captured today?"