@rubytech/create-realagent-code 0.1.253 → 0.1.255

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 (161) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/.docs/search-surface-contract.md +58 -0
  3. package/payload/platform/lib/embed-client/dist/index.d.ts +4 -0
  4. package/payload/platform/lib/embed-client/dist/index.d.ts.map +1 -0
  5. package/payload/platform/lib/embed-client/dist/index.js +53 -0
  6. package/payload/platform/lib/embed-client/dist/index.js.map +1 -0
  7. package/payload/platform/lib/embed-client/src/index.ts +53 -0
  8. package/payload/platform/lib/embed-client/tsconfig.json +8 -0
  9. package/payload/platform/lib/graph-search/dist/index.d.ts +27 -6
  10. package/payload/platform/lib/graph-search/dist/index.d.ts.map +1 -1
  11. package/payload/platform/lib/graph-search/dist/index.js +19 -1
  12. package/payload/platform/lib/graph-search/dist/index.js.map +1 -1
  13. package/payload/platform/lib/graph-search/src/index.ts +28 -6
  14. package/payload/platform/lib/graph-write/dist/index.d.ts +25 -0
  15. package/payload/platform/lib/graph-write/dist/index.d.ts.map +1 -1
  16. package/payload/platform/lib/graph-write/dist/index.js +78 -2
  17. package/payload/platform/lib/graph-write/dist/index.js.map +1 -1
  18. package/payload/platform/lib/graph-write/src/index.ts +96 -1
  19. package/payload/platform/package.json +2 -2
  20. package/payload/platform/plugins/admin/.claude-plugin/plugin.json +1 -1
  21. package/payload/platform/plugins/admin/PLUGIN.md +3 -3
  22. package/payload/platform/plugins/admin/hooks/__tests__/{session-end-retrospective.test.sh → insight.test.sh} +152 -153
  23. package/payload/platform/plugins/admin/hooks/insight.sh +219 -0
  24. package/payload/platform/plugins/admin/hooks/lib/admin-graph-pass-common.sh +5 -5
  25. package/payload/platform/plugins/admin/mcp/dist/index.js +33 -19
  26. package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
  27. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +23 -23
  28. package/payload/platform/plugins/docs/references/graph.md +2 -0
  29. package/payload/platform/plugins/docs/references/internals.md +12 -1
  30. package/payload/platform/plugins/docs/references/neo4j.md +2 -2
  31. package/payload/platform/plugins/docs/references/platform.md +1 -1
  32. package/payload/platform/plugins/docs/references/session-retrospective.md +5 -18
  33. package/payload/platform/plugins/email/PLUGIN.md +2 -2
  34. package/payload/platform/plugins/email/mcp/dist/index.js +8 -0
  35. package/payload/platform/plugins/email/mcp/dist/index.js.map +1 -1
  36. package/payload/platform/plugins/email/mcp/dist/lib/attachment-resolve.d.ts +19 -0
  37. package/payload/platform/plugins/email/mcp/dist/lib/attachment-resolve.d.ts.map +1 -0
  38. package/payload/platform/plugins/email/mcp/dist/lib/attachment-resolve.js +64 -0
  39. package/payload/platform/plugins/email/mcp/dist/lib/attachment-resolve.js.map +1 -0
  40. package/payload/platform/plugins/email/mcp/dist/lib/smtp.d.ts +4 -0
  41. package/payload/platform/plugins/email/mcp/dist/lib/smtp.d.ts.map +1 -1
  42. package/payload/platform/plugins/email/mcp/dist/lib/smtp.js +1 -0
  43. package/payload/platform/plugins/email/mcp/dist/lib/smtp.js.map +1 -1
  44. package/payload/platform/plugins/email/mcp/dist/tools/email-reply.d.ts +1 -0
  45. package/payload/platform/plugins/email/mcp/dist/tools/email-reply.d.ts.map +1 -1
  46. package/payload/platform/plugins/email/mcp/dist/tools/email-reply.js +6 -1
  47. package/payload/platform/plugins/email/mcp/dist/tools/email-reply.js.map +1 -1
  48. package/payload/platform/plugins/email/mcp/dist/tools/email-send.d.ts +1 -0
  49. package/payload/platform/plugins/email/mcp/dist/tools/email-send.d.ts.map +1 -1
  50. package/payload/platform/plugins/email/mcp/dist/tools/email-send.js +7 -1
  51. package/payload/platform/plugins/email/mcp/dist/tools/email-send.js.map +1 -1
  52. package/payload/platform/plugins/email/references/email-reference.md +4 -0
  53. package/payload/platform/plugins/memory/PLUGIN.md +1 -2
  54. package/payload/platform/plugins/memory/mcp/dist/index.js +5 -43
  55. package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
  56. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/document-sectioniser.test.d.ts +2 -0
  57. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/document-sectioniser.test.d.ts.map +1 -0
  58. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/document-sectioniser.test.js +41 -0
  59. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/document-sectioniser.test.js.map +1 -0
  60. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-embed-net.test.d.ts +2 -0
  61. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-embed-net.test.d.ts.map +1 -0
  62. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-embed-net.test.js +90 -0
  63. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/graph-write-embed-net.test.js.map +1 -0
  64. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/vector-indexed-labels-drift.test.d.ts +2 -0
  65. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/vector-indexed-labels-drift.test.d.ts.map +1 -0
  66. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/vector-indexed-labels-drift.test.js +27 -0
  67. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/vector-indexed-labels-drift.test.js.map +1 -0
  68. package/payload/platform/plugins/memory/mcp/dist/lib/document-sectioniser.d.ts +10 -0
  69. package/payload/platform/plugins/memory/mcp/dist/lib/document-sectioniser.d.ts.map +1 -0
  70. package/payload/platform/plugins/memory/mcp/dist/lib/document-sectioniser.js +47 -0
  71. package/payload/platform/plugins/memory/mcp/dist/lib/document-sectioniser.js.map +1 -0
  72. package/payload/platform/plugins/memory/mcp/dist/lib/embeddings.d.ts +1 -2
  73. package/payload/platform/plugins/memory/mcp/dist/lib/embeddings.d.ts.map +1 -1
  74. package/payload/platform/plugins/memory/mcp/dist/lib/embeddings.js +5 -28
  75. package/payload/platform/plugins/memory/mcp/dist/lib/embeddings.js.map +1 -1
  76. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/build-text-representation-bound.test.d.ts +2 -0
  77. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/build-text-representation-bound.test.d.ts.map +1 -0
  78. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/build-text-representation-bound.test.js +20 -0
  79. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/build-text-representation-bound.test.js.map +1 -0
  80. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-preference-embed.test.d.ts +2 -0
  81. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-preference-embed.test.d.ts.map +1 -0
  82. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-preference-embed.test.js +67 -0
  83. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-preference-embed.test.js.map +1 -0
  84. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/embeddings-cap.test.d.ts +2 -0
  85. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/embeddings-cap.test.d.ts.map +1 -0
  86. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/embeddings-cap.test.js +34 -0
  87. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/embeddings-cap.test.js.map +1 -0
  88. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-section-writer.test.d.ts +2 -0
  89. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-section-writer.test.d.ts.map +1 -0
  90. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-section-writer.test.js +61 -0
  91. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-section-writer.test.js.map +1 -0
  92. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.js +23 -1
  93. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.js.map +1 -1
  94. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex.test.d.ts +2 -0
  95. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex.test.d.ts.map +1 -0
  96. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex.test.js +87 -0
  97. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-reindex.test.js.map +1 -0
  98. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-fields.test.js +3 -0
  99. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-fields.test.js.map +1 -1
  100. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-threshold.test.d.ts +2 -0
  101. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-threshold.test.d.ts.map +1 -0
  102. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-threshold.test.js +34 -0
  103. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-search-threshold.test.js.map +1 -0
  104. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.d.ts.map +1 -1
  105. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.js +19 -4
  106. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.js.map +1 -1
  107. package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.d.ts +33 -6
  108. package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.d.ts.map +1 -1
  109. package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.js +280 -10
  110. package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.js.map +1 -1
  111. package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.d.ts.map +1 -1
  112. package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.js +76 -37
  113. package/payload/platform/plugins/memory/mcp/dist/tools/memory-reindex.js.map +1 -1
  114. package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.d.ts.map +1 -1
  115. package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.js +11 -2
  116. package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.js.map +1 -1
  117. package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.d.ts +3 -3
  118. package/payload/platform/plugins/memory/mcp/dist/tools/memory-typed-edge-pass.js +2 -2
  119. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts.map +1 -1
  120. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +10 -2
  121. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -1
  122. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js +6 -3
  123. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js.map +1 -1
  124. package/payload/platform/plugins/memory/mcp/vitest.config.ts +5 -0
  125. package/payload/platform/plugins/memory/references/schema-base.md +1 -1
  126. package/payload/platform/plugins/scheduling/mcp/dist/lib/ics-graph-ingest.d.ts.map +1 -1
  127. package/payload/platform/plugins/scheduling/mcp/dist/lib/ics-graph-ingest.js +15 -0
  128. package/payload/platform/plugins/scheduling/mcp/dist/lib/ics-graph-ingest.js.map +1 -1
  129. package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-execute.js +4 -0
  130. package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-execute.js.map +1 -1
  131. package/payload/platform/scripts/identity-forbidden-token-check.mjs +0 -1
  132. package/payload/platform/scripts/setup-account.sh +2 -8
  133. package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.d.ts +23 -0
  134. package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.d.ts.map +1 -0
  135. package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.js +29 -0
  136. package/payload/platform/services/claude-session-manager/dist/agent-identity-locator.js.map +1 -0
  137. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
  138. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +0 -1
  139. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
  140. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  141. package/payload/platform/services/claude-session-manager/dist/http-server.js +14 -0
  142. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  143. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  144. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +8 -1
  145. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  146. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts +13 -1
  147. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts.map +1 -1
  148. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js +26 -2
  149. package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js.map +1 -1
  150. package/payload/platform/services/claude-session-manager/dist/rc-daemon.js +1 -1
  151. package/payload/platform/services/claude-session-manager/dist/rc-daemon.js.map +1 -1
  152. package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts +12 -3
  153. package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts.map +1 -1
  154. package/payload/platform/services/claude-session-manager/dist/system-prompt.js +3 -2
  155. package/payload/platform/services/claude-session-manager/dist/system-prompt.js.map +1 -1
  156. package/payload/platform/templates/agents/admin/IDENTITY.md +2 -2
  157. package/payload/platform/templates/specialists/agents/database-operator.md +2 -6
  158. package/payload/server/{chunk-M6A6EZD4.js → chunk-76HRO7NX.js} +16 -2
  159. package/payload/server/maxy-edge.js +1 -1
  160. package/payload/server/server.js +534 -35
  161. package/payload/platform/plugins/admin/hooks/session-end-retrospective.sh +0 -214
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: platform-architecture
3
3
  description: Use when grounding any documented-surface claim about what Real Agent ships — plugins, skills, specialists, install/deploy flows, internals. This is the install catalogue, not evidence of what is enabled on the current account. For install state on this account, call `capabilities-here`; for documented surface, cite the `Source:` URL inline.
4
- content-hash: sha256:ed2f59c02dd5393d928ba9525ad6839091e0468a6fa2cca088fe52b4eb649729
4
+ content-hash: sha256:9881631eab81d0c53b93d876d777d4514a0639ea7262c661cc6e2110e1505140
5
5
  brand: realagent-code
6
6
  product-name: Real Agent
7
7
  ---
@@ -174,7 +174,7 @@ Roles are installed during setup and listed when Maxy introduces itself. Some pr
174
174
 
175
175
  Maxy maintains a graph database (Neo4j) of everything you've told it. People, conversations, preferences, and context are stored as connected nodes. When you ask Maxy something, it searches this graph to retrieve relevant context before responding.
176
176
 
177
- **The recording loop.** Maxy dispatches `database-operator` inline at its own discretion when a write must complete before the assistant response ends. The full graph-completeness sweep runs at session end: when you type `/end`, the `session-end-retrospective.sh` Stop hook blocks the close until Maxy walks the session for any node, edge, or commitment that was discussed but not written in-flight, then dispatches one `database-operator` Task per candidate write.
177
+ **The recording loop.** Maxy dispatches `database-operator` inline at its own discretion when a write must complete before the assistant response ends. The full graph-completeness sweep runs on demand: when you type `/insight`, the `insight.sh` UserPromptSubmit hook injects a four-pass instruction and Maxy walks the session for any node, edge, or commitment that was discussed but not written in-flight, dispatches one `database-operator` Task per candidate write, then carries on in the same session.
178
178
 
179
179
  The memory graph is stored on your Pi. It never leaves your network.
180
180
 
@@ -1992,33 +1992,20 @@ Diagnostic path: `grep -E '^\[aeo-' platform-logs/*.log | grep <urlOrEntityId>`.
1992
1992
  # Session Retrospective
1993
1993
  Source: https://docs.getmaxy.com/session-retrospective.md
1994
1994
 
1995
- # Session-end retrospective
1995
+ # Insight pass
1996
1996
 
1997
- When you end an admin session by typing `/end`, `/archive`, `end session`, or `archive this session`, the admin agent runs one extra turn before the session closes. It walks the session and writes down four kinds of thing that would otherwise be lost:
1997
+ When you type `/insight` on its own in an admin session, the admin agent runs one extra review over the session so far, then carries on. It walks the conversation and writes down four kinds of thing that would otherwise be lost:
1998
1998
 
1999
1999
  - corrections and learnings you gave the agent during the session,
2000
2000
  - tonal and working-style preferences worth carrying forward,
2001
2001
  - people, decisions, commitments, or business facts that came up but were not yet saved to the graph,
2002
2002
  - typed edges between any new prose-bearing nodes (messages, meetings, notes, pages) and the entities they mention — the auto-extraction pass that "wires the graph" so future questions can hop from a person to the companies they founded to the events they attended.
2003
2003
 
2004
- The next session starts against an up-to-date picture of you and your business not just the parts that got recorded mid-flow.
2004
+ You can run it whenever you want the brain brought up to date for example before you open a second session that needs the first session's learnings, preferences, or graph writes.
2005
2005
 
2006
- The extra turn is one or two messages from the agent, then a short summary of what was written. It runs inside the same session you were already in; nothing happens in the background, no second session is spawned. The typed-edge pass itself is delegated to the `database-operator` specialist so the writes land where graph writes are supposed to live.
2006
+ The pass is one or two messages from the agent, then a short summary of what was written. It runs inside the session you are already in: nothing happens in the background, no second session is spawned, and the session is not closed, reset, or cleared — the conversation continues straight afterward against the same live state. The typed-edge pass itself is delegated to the `database-operator` specialist so the writes land where graph writes are supposed to live.
2007
2007
 
2008
- ## When the retrospective is skipped
2009
-
2010
- - Clicking the Archive button in the Sidebar closes the session directly and skips the retrospective. The four typed phrases above are the only signals that trigger it.
2011
- - Closing the browser tab or losing power closes the session without the retrospective. The mid-session recording route (the agent writes facts as they come up) is the primary safety net; the retrospective is the catch-net for what slips through.
2012
-
2013
- Skipped sessions do not lose typed-edge work. The next session's retrospective picks up any prose nodes the previous session wrote, because the pass is scoped by "what changed since the last completed retrospective" — not by which session wrote it. The cost of skipping is one session of delay, not lost extraction.
2014
-
2015
- ## Skip-rate visibility
2016
-
2017
- At the start of every admin session, the agent checks how many of your recent sessions closed without firing the retrospective. If any did, it surfaces one line — for example, "the last 10 sessions: 4 ended without a retrospective; their typed edges land at the next `/end`." This is informational, not nagging — it lets you choose to end the next session properly so the deferred extraction lands sooner.
2018
-
2019
- ## What you see if the agent tries to skip it
2020
-
2021
- If the agent replies with a prose summary of "what it learned" without actually performing the retrospective, the session does not close — the Stop gate blocks until the agent calls the deterministic completion tool. You can tell it happened correctly by the final reply naming the five counts (learnings, tonal observations, graph updates, typed edges accepted, prose nodes scanned); the absence of those counts is the signal that something went wrong.
2008
+ You can tell the pass ran correctly by the final reply naming the five counts (learnings, tonal observations, graph updates, typed edges accepted, prose nodes scanned). The typed-edge pass is scoped by "what changed since the last completed insight pass," so two passes in a row never re-process the same nodes, and a session that never runs one simply defers its extraction to the next time you type `/insight`.
2022
2009
 
2023
2010
  ---
2024
2011
  # Visitor Graph
@@ -2466,6 +2453,8 @@ When a search is active and you click a node, the neighbourhood you pivot into i
2466
2453
 
2467
2454
  Searches reach **every textual property** of every operator-meaningful label, including denormalised fields the platform writes specifically so search can reach them — for example, the current job title of each LinkedIn connection (originally stored on the connection edge, copied to the Person node so the fulltext index can match it).
2468
2455
 
2456
+ Search behaves the same here, in the agent's own memory recall, and on the `/data` page: with **no filter chips selected** a search reaches **all** labels — the same scope the agent sees — and every surface applies the **same default relevance floor**, so the same query returns the same nodes everywhere. There is no longer a "select a chip first" gate; an empty chip set means "search everything". Selecting chips narrows the result to those labels.
2457
+
2469
2458
  ## Conversation label tiers
2470
2459
 
2471
2460
  Conversation nodes carry the most operator-meaningful identity in the
@@ -2624,9 +2613,9 @@ How Maxy's graph wires itself.
2624
2613
 
2625
2614
  ## Typed-edge auto-extraction
2626
2615
 
2627
- At the end of every admin session (`/end`, `/archive`, `end session`, `archive this session`), the admin agent delegates one final pass to the `database-operator` specialist. That pass reads every prose-bearing node your account wrote since the last completed retrospective — messages, meetings, notes, pages, posts, reports, emails, ideas — and asks Claude Haiku to propose typed edges from the text. Only edges that match a closed allowlist of `(sourceLabel, EDGE_TYPE, targetLabel)` shapes are MERGEd into the graph. The graph wires itself; you do not have to ask for it.
2616
+ When the operator types `/insight`, the admin agent delegates one pass to the `database-operator` specialist. That pass reads every prose-bearing node your account wrote since the last completed insight pass — messages, meetings, notes, pages, posts, reports, emails, ideas — and asks Claude Haiku to propose typed edges from the text. Only edges that match a closed allowlist of `(sourceLabel, EDGE_TYPE, targetLabel)` shapes are MERGEd into the graph. The graph wires itself; you do not have to ask for it.
2628
2617
 
2629
- If a session closes without one of the four typed end-intent tokens (Sidebar Archive, tab-close, power loss), the pass for that session is deferred its prose nodes land at the next `/end`. Nothing is lost, just delayed by one session.
2618
+ If a session never runs an insight pass, its prose nodes are not lost — the next `/insight`, in that session or a later one, picks them up, because the pass is scoped by what changed since the last completed one rather than by which session wrote it. The cost of skipping is a delay, not lost extraction.
2630
2619
 
2631
2620
  ## Typed-edge allowlist
2632
2621
 
@@ -2777,7 +2766,11 @@ Indexed labels: `Question`, `DefinedTerm`, `Review`, `Service`, `Person`, `Local
2777
2766
 
2778
2767
  ### Embedding lifecycle
2779
2768
 
2780
- Embeddings are computed when nodes are created or updated (via `memory-write`, `memory-ingest`, or any tool that persists to Neo4j). If Ollama is unavailable at write time, nodes are stored without embeddings. The `memory-reindex` tool backfills missing embeddings by iterating nodes where `embedding IS NULL`, calling Ollama's `/api/embed` endpoint, and storing the resulting vector. Batch embedding is supported for efficiency.
2769
+ Embeddings are computed at write time for **every** node of a vector-indexed label, on every write path — the per-node tools (`memory-write`, `memory-ingest`, `profile-update`, `project-create`), the bulk archive ingest (`memory-archive-write`: LinkedIn / Obsidian / Notion), the conversation-insight emitters, and the raw-Cypher admin/scheduling/UI paths. Small entities embed a bounded props representation; document/archive labels embed a bounded `summary` plus per-`:Section` body embeddings (the archive path uses a deterministic sectioniser since it has no LLM classifier). The authoritative indexed-label set is `VECTOR_INDEXED_LABELS` in `platform/lib/graph-write`, pinned to `schema.cypher` by a drift test.
2770
+
2771
+ If Ollama is unavailable at write time, the node is stored without an embedding (property-searchable, not vector-searchable) and a `[graph-write] warn reason=embed-failed` line is emitted — a failed embed never aborts the write. The two standing audits in the UI server's `graph-health` timer surface any backlog: `[embed-audit] null-embedding labels=… count=N` and `[account-audit] null-account labels=… count=N` (both healthy at 0).
2772
+
2773
+ The `memory-reindex` tool backfills missing embeddings by iterating nodes where `embedding IS NULL`. It uses the bounded representation (the `summary` for document/archive labels, never the raw body), embeds in batches with a per-node fallback on batch error, and **skips and continues** past a failing node — keeping skipped nodes out of the re-fetch via an exclude set — instead of aborting the whole run. `embed()`/`embedBatch()` cap oversized input (`EMBED_INPUT_MAX_CHARS`) before the Ollama POST, so a large body embeds truncated rather than throwing. Per-node `[reindex] op=embedded|skip-error` lines and a terminal `[reindex] op=done processed=N skipped=M`.
2781
2774
 
2782
2775
  ---
2783
2776
 
@@ -2913,6 +2906,13 @@ When `search` is true and `query` is non-null, the rewritten query replaces the
2913
2906
 
2914
2907
  The public agent is toolless by construction (Task 615): it has no `memory-search`, no graph access mid-turn, and no tools of any kind. KNOWLEDGE.md (when present) plus SOUL are assembled into the agent's system prompt at spawn time and are the entire knowledge surface. Every `role=public` spawn (webchat, whatsapp, telegram) resolves an empty allowlist and runs in `dontAsk` (Task 506) with a per-spawn `permissions.deny` covering every native, harness, and memory-MCP tool (Task 612). The spawner anchors the empty allowlist with a single non-native deny-basis token (`mcp__none__deny-basis`) so `--allowed-tools` is always present and native-excluding (Task 609) — without it, `dontAsk` would have nothing to deny against and the brand `allow:["*"]` would re-open native tools.
2915
2908
 
2909
+ ### The canonical public-agent locator (Task 638)
2910
+
2911
+ There is exactly one place each datum is read from, and every subsystem reads it the same way:
2912
+
2913
+ - **Default agent + account id** come from the canonical account config `data/accounts/<id>/account.json`, resolved via `resolveAccount` / `resolveDefaultAgentSlug` / `getDefaultAccountId` (`app/lib/claude-agent/account.ts`). The UI server's bare-root handler and branding loader read it through these helpers — never from `~/.<brand>/account.json`, which nothing writes. A `null` default means a genuinely unset `defaultAgent`; the root logs `[public-root] op=serve-default slug=<s>` on success and `op=no-default` only when the canonical default is truly empty.
2914
+ - **Identity files** (IDENTITY.md, SOUL.md, KNOWLEDGE.md) come from `agents/<slug>/` — keyed on the agent's slug, never the literal role. A public agent renamed to a slug `≠ "public"` (e.g. `maxy-info`) spawns from `agents/maxy-info/`. Admin reads `agents/admin/`. The spawn composer and the standing reachability audit resolve this directory through one shared function, `resolveAgentIdentityDir(accountDir, role, slug)` (`claude-session-manager/src/agent-identity-locator.ts`), so the path the audit vouches for is byte-identical to the path the spawn reads — the audit's `reachable=true` implies the spawn will find the files, and a slug whose files are misplaced is reported `reachable=false reason=files-missing file=<path>` without a visitor request.
2915
+
2916
2916
  ### Observability
2917
2917
 
2918
2918
  Admin: `[admin-query-classifier]` log line with `topicChange`, `topicChangeConfidence`, `existingTopic`, `latencyMs`.
@@ -12,6 +12,8 @@ When a search is active and you click a node, the neighbourhood you pivot into i
12
12
 
13
13
  Searches reach **every textual property** of every operator-meaningful label, including denormalised fields the platform writes specifically so search can reach them — for example, the current job title of each LinkedIn connection (originally stored on the connection edge, copied to the Person node so the fulltext index can match it).
14
14
 
15
+ Search behaves the same here, in the agent's own memory recall, and on the `/data` page: with **no filter chips selected** a search reaches **all** labels — the same scope the agent sees — and every surface applies the **same default relevance floor**, so the same query returns the same nodes everywhere. There is no longer a "select a chip first" gate; an empty chip set means "search everything". Selecting chips narrows the result to those labels.
16
+
15
17
  ## Conversation label tiers
16
18
 
17
19
  Conversation nodes carry the most operator-meaningful identity in the
@@ -89,7 +89,11 @@ Indexed labels: `Question`, `DefinedTerm`, `Review`, `Service`, `Person`, `Local
89
89
 
90
90
  ### Embedding lifecycle
91
91
 
92
- Embeddings are computed when nodes are created or updated (via `memory-write`, `memory-ingest`, or any tool that persists to Neo4j). If Ollama is unavailable at write time, nodes are stored without embeddings. The `memory-reindex` tool backfills missing embeddings by iterating nodes where `embedding IS NULL`, calling Ollama's `/api/embed` endpoint, and storing the resulting vector. Batch embedding is supported for efficiency.
92
+ Embeddings are computed at write time for **every** node of a vector-indexed label, on every write path — the per-node tools (`memory-write`, `memory-ingest`, `profile-update`, `project-create`), the bulk archive ingest (`memory-archive-write`: LinkedIn / Obsidian / Notion), the conversation-insight emitters, and the raw-Cypher admin/scheduling/UI paths. Small entities embed a bounded props representation; document/archive labels embed a bounded `summary` plus per-`:Section` body embeddings (the archive path uses a deterministic sectioniser since it has no LLM classifier). The authoritative indexed-label set is `VECTOR_INDEXED_LABELS` in `platform/lib/graph-write`, pinned to `schema.cypher` by a drift test.
93
+
94
+ If Ollama is unavailable at write time, the node is stored without an embedding (property-searchable, not vector-searchable) and a `[graph-write] warn reason=embed-failed` line is emitted — a failed embed never aborts the write. The two standing audits in the UI server's `graph-health` timer surface any backlog: `[embed-audit] null-embedding labels=… count=N` and `[account-audit] null-account labels=… count=N` (both healthy at 0).
95
+
96
+ The `memory-reindex` tool backfills missing embeddings by iterating nodes where `embedding IS NULL`. It uses the bounded representation (the `summary` for document/archive labels, never the raw body), embeds in batches with a per-node fallback on batch error, and **skips and continues** past a failing node — keeping skipped nodes out of the re-fetch via an exclude set — instead of aborting the whole run. `embed()`/`embedBatch()` cap oversized input (`EMBED_INPUT_MAX_CHARS`) before the Ollama POST, so a large body embeds truncated rather than throwing. Per-node `[reindex] op=embedded|skip-error` lines and a terminal `[reindex] op=done processed=N skipped=M`.
93
97
 
94
98
  ---
95
99
 
@@ -225,6 +229,13 @@ When `search` is true and `query` is non-null, the rewritten query replaces the
225
229
 
226
230
  The public agent is toolless by construction (Task 615): it has no `memory-search`, no graph access mid-turn, and no tools of any kind. KNOWLEDGE.md (when present) plus SOUL are assembled into the agent's system prompt at spawn time and are the entire knowledge surface. Every `role=public` spawn (webchat, whatsapp, telegram) resolves an empty allowlist and runs in `dontAsk` (Task 506) with a per-spawn `permissions.deny` covering every native, harness, and memory-MCP tool (Task 612). The spawner anchors the empty allowlist with a single non-native deny-basis token (`mcp__none__deny-basis`) so `--allowed-tools` is always present and native-excluding (Task 609) — without it, `dontAsk` would have nothing to deny against and the brand `allow:["*"]` would re-open native tools.
227
231
 
232
+ ### The canonical public-agent locator (Task 638)
233
+
234
+ There is exactly one place each datum is read from, and every subsystem reads it the same way:
235
+
236
+ - **Default agent + account id** come from the canonical account config `data/accounts/<id>/account.json`, resolved via `resolveAccount` / `resolveDefaultAgentSlug` / `getDefaultAccountId` (`app/lib/claude-agent/account.ts`). The UI server's bare-root handler and branding loader read it through these helpers — never from `~/.<brand>/account.json`, which nothing writes. A `null` default means a genuinely unset `defaultAgent`; the root logs `[public-root] op=serve-default slug=<s>` on success and `op=no-default` only when the canonical default is truly empty.
237
+ - **Identity files** (IDENTITY.md, SOUL.md, KNOWLEDGE.md) come from `agents/<slug>/` — keyed on the agent's slug, never the literal role. A public agent renamed to a slug `≠ "public"` (e.g. `maxy-info`) spawns from `agents/maxy-info/`. Admin reads `agents/admin/`. The spawn composer and the standing reachability audit resolve this directory through one shared function, `resolveAgentIdentityDir(accountDir, role, slug)` (`claude-session-manager/src/agent-identity-locator.ts`), so the path the audit vouches for is byte-identical to the path the spawn reads — the audit's `reachable=true` implies the spawn will find the files, and a slug whose files are misplaced is reported `reachable=false reason=files-missing file=<path>` without a visitor request.
238
+
228
239
  ### Observability
229
240
 
230
241
  Admin: `[admin-query-classifier]` log line with `topicChange`, `topicChangeConfidence`, `existingTopic`, `latencyMs`.
@@ -4,9 +4,9 @@ How Maxy's graph wires itself.
4
4
 
5
5
  ## Typed-edge auto-extraction
6
6
 
7
- At the end of every admin session (`/end`, `/archive`, `end session`, `archive this session`), the admin agent delegates one final pass to the `database-operator` specialist. That pass reads every prose-bearing node your account wrote since the last completed retrospective — messages, meetings, notes, pages, posts, reports, emails, ideas — and asks Claude Haiku to propose typed edges from the text. Only edges that match a closed allowlist of `(sourceLabel, EDGE_TYPE, targetLabel)` shapes are MERGEd into the graph. The graph wires itself; you do not have to ask for it.
7
+ When the operator types `/insight`, the admin agent delegates one pass to the `database-operator` specialist. That pass reads every prose-bearing node your account wrote since the last completed insight pass — messages, meetings, notes, pages, posts, reports, emails, ideas — and asks Claude Haiku to propose typed edges from the text. Only edges that match a closed allowlist of `(sourceLabel, EDGE_TYPE, targetLabel)` shapes are MERGEd into the graph. The graph wires itself; you do not have to ask for it.
8
8
 
9
- If a session closes without one of the four typed end-intent tokens (Sidebar Archive, tab-close, power loss), the pass for that session is deferred its prose nodes land at the next `/end`. Nothing is lost, just delayed by one session.
9
+ If a session never runs an insight pass, its prose nodes are not lost — the next `/insight`, in that session or a later one, picks them up, because the pass is scoped by what changed since the last completed one rather than by which session wrote it. The cost of skipping is a delay, not lost extraction.
10
10
 
11
11
  ## Typed-edge allowlist
12
12
 
@@ -62,7 +62,7 @@ Roles are installed during setup and listed when {{productName}} introduces itse
62
62
 
63
63
  {{productName}} maintains a graph database (Neo4j) of everything you've told it. People, conversations, preferences, and context are stored as connected nodes. When you ask {{productName}} something, it searches this graph to retrieve relevant context before responding.
64
64
 
65
- **The recording loop.** {{productName}} dispatches `database-operator` inline at its own discretion when a write must complete before the assistant response ends. The full graph-completeness sweep runs at session end: when you type `/end`, the `session-end-retrospective.sh` Stop hook blocks the close until {{productName}} walks the session for any node, edge, or commitment that was discussed but not written in-flight, then dispatches one `database-operator` Task per candidate write.
65
+ **The recording loop.** {{productName}} dispatches `database-operator` inline at its own discretion when a write must complete before the assistant response ends. The full graph-completeness sweep runs on demand: when you type `/insight`, the `insight.sh` UserPromptSubmit hook injects a four-pass instruction and {{productName}} walks the session for any node, edge, or commitment that was discussed but not written in-flight, dispatches one `database-operator` Task per candidate write, then carries on in the same session.
66
66
 
67
67
  The memory graph is stored on your Pi. It never leaves your network.
68
68
 
@@ -1,27 +1,14 @@
1
- # Session-end retrospective
1
+ # Insight pass
2
2
 
3
- When you end an admin session by typing `/end`, `/archive`, `end session`, or `archive this session`, the admin agent runs one extra turn before the session closes. It walks the session and writes down four kinds of thing that would otherwise be lost:
3
+ When you type `/insight` on its own in an admin session, the admin agent runs one extra review over the session so far, then carries on. It walks the conversation and writes down four kinds of thing that would otherwise be lost:
4
4
 
5
5
  - corrections and learnings you gave the agent during the session,
6
6
  - tonal and working-style preferences worth carrying forward,
7
7
  - people, decisions, commitments, or business facts that came up but were not yet saved to the graph,
8
8
  - typed edges between any new prose-bearing nodes (messages, meetings, notes, pages) and the entities they mention — the auto-extraction pass that "wires the graph" so future questions can hop from a person to the companies they founded to the events they attended.
9
9
 
10
- The next session starts against an up-to-date picture of you and your business not just the parts that got recorded mid-flow.
10
+ You can run it whenever you want the brain brought up to date for example before you open a second session that needs the first session's learnings, preferences, or graph writes.
11
11
 
12
- The extra turn is one or two messages from the agent, then a short summary of what was written. It runs inside the same session you were already in; nothing happens in the background, no second session is spawned. The typed-edge pass itself is delegated to the `database-operator` specialist so the writes land where graph writes are supposed to live.
12
+ The pass is one or two messages from the agent, then a short summary of what was written. It runs inside the session you are already in: nothing happens in the background, no second session is spawned, and the session is not closed, reset, or cleared — the conversation continues straight afterward against the same live state. The typed-edge pass itself is delegated to the `database-operator` specialist so the writes land where graph writes are supposed to live.
13
13
 
14
- ## When the retrospective is skipped
15
-
16
- - Clicking the Archive button in the Sidebar closes the session directly and skips the retrospective. The four typed phrases above are the only signals that trigger it.
17
- - Closing the browser tab or losing power closes the session without the retrospective. The mid-session recording route (the agent writes facts as they come up) is the primary safety net; the retrospective is the catch-net for what slips through.
18
-
19
- Skipped sessions do not lose typed-edge work. The next session's retrospective picks up any prose nodes the previous session wrote, because the pass is scoped by "what changed since the last completed retrospective" — not by which session wrote it. The cost of skipping is one session of delay, not lost extraction.
20
-
21
- ## Skip-rate visibility
22
-
23
- At the start of every admin session, the agent checks how many of your recent sessions closed without firing the retrospective. If any did, it surfaces one line — for example, "the last 10 sessions: 4 ended without a retrospective; their typed edges land at the next `/end`." This is informational, not nagging — it lets you choose to end the next session properly so the deferred extraction lands sooner.
24
-
25
- ## What you see if the agent tries to skip it
26
-
27
- If the agent replies with a prose summary of "what it learned" without actually performing the retrospective, the session does not close — the Stop gate blocks until the agent calls the deterministic completion tool. You can tell it happened correctly by the final reply naming the five counts (learnings, tonal observations, graph updates, typed edges accepted, prose nodes scanned); the absence of those counts is the signal that something went wrong.
14
+ You can tell the pass ran correctly by the final reply naming the five counts (learnings, tonal observations, graph updates, typed edges accepted, prose nodes scanned). The typed-edge pass is scoped by "what changed since the last completed insight pass," so two passes in a row never re-process the same nodes, and a session that never runs one simply defers its extraction to the next time you type `/insight`.
@@ -64,8 +64,8 @@ Manages the agent's own dedicated email account — IMAP for reading, SMTP for s
64
64
  - **Setup:** `email-setup` — collect credentials in plain chat and connect IMAP/SMTP. Hosts are auto-inferred for known providers; supports alias addresses (`agentAddress`).
65
65
  - **Read inbox:** `email-read` — metadata only (UID, sender, subject, date), plus a best-effort `Archive`/`Archive-Section` hint when the IMAP message's `receivedAt` falls inside a stored `:ConversationArchive {source:'email'}` section, plus an `Attachments (N): filename (mime, size); …` footer when the message carries enclosures. Supports pagination (`before_uid`), folders (`inbox`/`sent`), filtering by sender/date/subject. Metadata is derived from IMAP `bodyStructure` — no bytes downloaded.
66
66
  - **Search inbox:** `email-search` — live IMAP search by sender, subject, body keyword, date range. Same per-archive hint and attachment footer as `email-read`.
67
- - **Send:** `email-send` — new outbound email.
68
- - **Reply:** `email-reply` — threaded reply to an existing email by `messageId`. Resolves the original envelope via IMAP `SEARCH HEADER Message-ID` (INBOX then `\Sent`), so threading works for any message still present on the server even if the graph never ingested it. Supports `replyAll`.
67
+ - **Send:** `email-send` — new outbound email. Pass `attachments` (absolute file paths under the account directory, ≤25 MB each) to attach files as SMTP attachments; an invalid path fails the send with no email dispatched.
68
+ - **Reply:** `email-reply` — threaded reply to an existing email by `messageId`. Resolves the original envelope via IMAP `SEARCH HEADER Message-ID` (INBOX then `\Sent`), so threading works for any message still present on the server even if the graph never ingested it. Supports `replyAll` and `attachments` (same path rules as `email-send`).
69
69
  - **Ingestion — fetch:** `email-fetch` — list new IMAP messages since the stored high-water mark. Metadata + body preview only — including attachment names, mimetypes, and sizes so the operator sees what's attached before approving (Task 402). No bytes downloaded, no graph writes. Stages the batch in-memory for `email-ingest`.
70
70
  - **Ingestion — apply:** `email-ingest` — apply the operator's per-message decisions to the staged batch. Each Message-ID must carry a disposition (`ingest` or `discard`). Approved messages land on `:ConversationArchive {source:'email'}` via the source-agnostic conversation-archive pipeline (one archive per thread, sessionised into `:Section` chunks). Attachment bytes are fetched, archived to `{accountDir}/archive/email/<uidValidity>-<uid>/<sha256>-<filename>` (0o600, 25 MB cap), and each attachment lands as a content-addressed `:DigitalDocument` keyed on `attachmentId = sha256(bytes)`; the `:HAS_ENCLOSURE` edge from the parent `:ConversationArchive` is wired by `memory-ingest` on its next pass via the `pendingArchiveEdges` queue (Task 402). Advances the inbox high-water mark only after a successful write.
71
71
  - **Recall/history:** `email-graph-query` — search stored email archives in Neo4j by natural language, participant address, or date range. Each thread is one `:ConversationArchive {source:'email'}` with `:Section` chunks; operator participants attach via `:PARTICIPANT_IN` edges from `:Person`/`:AdminUser`. List mode surfaces a per-archive summary built from concatenated `:Section.summary` values; query mode runs vector search over the `section_embedding` index and dedups to the parent archive.
@@ -152,6 +152,10 @@ eagerTool(server, "email-send", "Send an email from the agent's email account vi
152
152
  subject: z.string().describe("Email subject line"),
153
153
  body: z.string().describe("Plain text email body"),
154
154
  html: z.string().optional().describe("Optional HTML email body"),
155
+ attachments: z
156
+ .array(z.string())
157
+ .optional()
158
+ .describe("Absolute local file paths to attach as SMTP attachments. Each must be a regular file inside the account directory and ≤25 MB. Omit for a text-only message."),
155
159
  }, async (params) => {
156
160
  if (!accountId)
157
161
  return refuseNoAccount("email-send");
@@ -262,6 +266,10 @@ eagerTool(server, "email-reply", "Reply to an email in-thread. Looks up the orig
262
266
  body: z.string().min(1).describe("Plain text reply body"),
263
267
  html: z.string().optional().describe("Optional HTML reply body"),
264
268
  replyAll: z.boolean().optional().describe("If true, reply to all original recipients (To + CC). Default: false (reply to sender only)."),
269
+ attachments: z
270
+ .array(z.string())
271
+ .optional()
272
+ .describe("Absolute local file paths to attach as SMTP attachments. Each must be a regular file inside the account directory and ≤25 MB. Omit for a text-only reply."),
265
273
  }, async (params) => {
266
274
  if (!accountId)
267
275
  return refuseNoAccount("email-reply");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,aAAa,CAAC,OAAO,CAAC,CAAC;AAEvB,OAAO,EAAE,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AG,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;QACzD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IACxD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,wBAAwB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;iBACjF;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,sEAAsE;AACtE,YAAY;AACZ,sEAAsE;AAEtE,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,MAAM,WAAW,EAAE,CAAC;IACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ export declare const OUTBOUND_ATTACHMENT_MAX_BYTES: number;
2
+ export interface OutboundAttachment {
3
+ filename: string;
4
+ path: string;
5
+ }
6
+ /**
7
+ * Validate agent-supplied attachment paths and map them to nodemailer's
8
+ * { filename, path } shape. Mirrors the WhatsApp send-document account-scope
9
+ * check: each path must realpath to a regular file under the account directory
10
+ * and be within the size cap. Any violation throws a precise error naming the
11
+ * offending path, so the caller sends no mail rather than a reply that silently
12
+ * omits the file. Absent/empty input returns [] (a text-only message).
13
+ */
14
+ export declare function resolveOutboundAttachments(accountDir: string | undefined, paths: string[] | undefined): OutboundAttachment[];
15
+ /** The " with N attachment(s): a, b" suffix appended to an email-send/-reply
16
+ * success message. Empty string when nothing was attached. Lives here so both
17
+ * sender tools render the attachment list identically. */
18
+ export declare function formatAttachNote(attachments: OutboundAttachment[]): string;
19
+ //# sourceMappingURL=attachment-resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-resolve.d.ts","sourceRoot":"","sources":["../../src/lib/attachment-resolve.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,6BAA6B,QAAmB,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,GAC1B,kBAAkB,EAAE,CA2CtB;AAED;;2DAE2D;AAC3D,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,kBAAkB,EAAE,GAAG,MAAM,CAK1E"}
@@ -0,0 +1,64 @@
1
+ import { realpathSync, statSync } from "node:fs";
2
+ import { basename } from "node:path";
3
+ // Matches the documented inbound email-attachment cap (PLUGIN.md) so inbound and
4
+ // outbound use one number, and over-cap fails loudly here instead of as an
5
+ // opaque SMTP rejection downstream.
6
+ export const OUTBOUND_ATTACHMENT_MAX_BYTES = 25 * 1024 * 1024;
7
+ /**
8
+ * Validate agent-supplied attachment paths and map them to nodemailer's
9
+ * { filename, path } shape. Mirrors the WhatsApp send-document account-scope
10
+ * check: each path must realpath to a regular file under the account directory
11
+ * and be within the size cap. Any violation throws a precise error naming the
12
+ * offending path, so the caller sends no mail rather than a reply that silently
13
+ * omits the file. Absent/empty input returns [] (a text-only message).
14
+ */
15
+ export function resolveOutboundAttachments(accountDir, paths) {
16
+ if (!paths || paths.length === 0)
17
+ return [];
18
+ if (!accountDir) {
19
+ throw new Error("Cannot attach files: ACCOUNT_DIR is not set (no account context to validate paths against).");
20
+ }
21
+ let accountResolved;
22
+ try {
23
+ accountResolved = realpathSync(accountDir);
24
+ }
25
+ catch (err) {
26
+ throw new Error(`Cannot attach files: account directory ${accountDir} is not accessible (${err instanceof Error ? err.message : String(err)}).`);
27
+ }
28
+ const out = [];
29
+ for (const p of paths) {
30
+ let resolvedPath;
31
+ try {
32
+ resolvedPath = realpathSync(p);
33
+ }
34
+ catch (err) {
35
+ if (err.code === "ENOENT") {
36
+ throw new Error(`Attachment not found: ${p}`);
37
+ }
38
+ throw new Error(`Cannot read attachment ${p}: ${err instanceof Error ? err.message : String(err)}`);
39
+ }
40
+ if (!resolvedPath.startsWith(accountResolved + "/")) {
41
+ throw new Error(`Attachment ${p} is outside the account directory and cannot be sent.`);
42
+ }
43
+ const st = statSync(resolvedPath);
44
+ if (!st.isFile()) {
45
+ throw new Error(`Attachment ${p} is not a regular file.`);
46
+ }
47
+ if (st.size > OUTBOUND_ATTACHMENT_MAX_BYTES) {
48
+ throw new Error(`Attachment ${basename(resolvedPath)} exceeds the 25 MB email limit (${(st.size / 1024 / 1024).toFixed(1)} MB).`);
49
+ }
50
+ out.push({ filename: basename(resolvedPath), path: resolvedPath });
51
+ }
52
+ return out;
53
+ }
54
+ /** The " with N attachment(s): a, b" suffix appended to an email-send/-reply
55
+ * success message. Empty string when nothing was attached. Lives here so both
56
+ * sender tools render the attachment list identically. */
57
+ export function formatAttachNote(attachments) {
58
+ if (attachments.length === 0)
59
+ return "";
60
+ return ` with ${attachments.length} attachment(s): ${attachments
61
+ .map((a) => a.filename)
62
+ .join(", ")}`;
63
+ }
64
+ //# sourceMappingURL=attachment-resolve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-resolve.js","sourceRoot":"","sources":["../../src/lib/attachment-resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,iFAAiF;AACjF,2EAA2E;AAC3E,oCAAoC;AACpC,MAAM,CAAC,MAAM,6BAA6B,G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,CAAC,cAAc,CAAC,uDAAuD,CAAC,CAAC;QAC1F,CAAC;QACD,MAAM,EAAE,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;QAClC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,yBAAyB,CAAC,CAAC;QAC5D,CAAC;QACD,IAAI,EAAE,CAAC,IAAI,GAAG,6BAA6B,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,CACb,cAAc,QAAQ,CAAC,YAAY,CAAC,mCAAmC,CAAC,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CACjH,CAAC;QACJ,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;2DAE2D;AAC3D,MAAM,UAAU,gBAAgB,CAAC,WAAiC;IAChE,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACxC,OAAO,SAAS,WAAW,CAAC,MAAM,mBAAmB,WAAW;SAC7D,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;SACtB,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAClB,CAAC"}
@@ -15,6 +15,10 @@ export declare function sendEmail(config: EmailConfig, password: string, options
15
15
  inReplyTo?: string;
16
16
  references?: string;
17
17
  headers?: Record<string, string>;
18
+ attachments?: Array<{
19
+ filename: string;
20
+ path: string;
21
+ }>;
18
22
  }): Promise<{
19
23
  messageId: string;
20
24
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"smtp.d.ts","sourceRoot":"","sources":["../../src/lib/smtp.ts"],"names":[],"mappings":"AACA,OAAO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AAC,CAAC;IACjC,WAAW,CAAC,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACzD,GACA,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAkBhC"}
@@ -67,6 +67,7 @@ export async function sendEmail(config, password, options) {
67
67
  inReplyTo: options.inReplyTo,
68
68
  references: options.references,
69
69
  headers: options.headers,
70
+ attachments: options.attachments,
70
71
  });
71
72
  return { messageId: info.messageId };
72
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"smtp.js","sourceRoot":"","sources":["../../src/lib/smtp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAoB,MAAM,YAAY,CAAC;AAG/D,MAAM,eAAe,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,SAAS,mBAAmB,CAAC,MAAmB,EAAE,QAAgB;IAChE,OAAO,eAAe,CAAC;QACrB,IAAI,EAAE,MAAM,CAAC,QAAQ;QACrB,IAAI,EAAE,MAAM,CAAC,QAAQ;QACrB,MAAM,EAAE,MAAM,CAAC,YAAY,KAAK,KAAK;QACrC,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC,KAAK;YAClB,IAAI,EAAE,QAAQ;SACf;QACD,GAAG,EAAE;YACH,kBAAkB,EAAE,IAAI;SACzB;QACD,iBAAiB,EAAE,eAAe;QAClC,eAAe,EAAE,eAAe;KACjC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAmB,EAAE,QAAgB;IACxE,MAAM,SAAS,GAAG,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACxD,IAAI,CAAC;QACH,MAAM,SAAS,CAAC,MAAM,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,GAAG,GA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,CAAC,SAAS,CAAC,EAAE,CAAC;YACzD,OAAO,gCAAgC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,4BAA4B,CAAC;QACxG,CAAC;QACD,OAAO,2BAA2B,GAAG,EAAE,CAAC;IAC1C,CAAC;YAAS,CAAC;QACT,SAAS,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,MAAmB,EACnB,QAAgB,EAChB,OASC;IAED,MAAM,SAAS,GAAG,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACxD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC;YACpC,IAAI,EAAE,MAAM,CAAC,YAAY;YACzB,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,WAAW,EAAE,OAAO,CAAC,WAAW;SACjC,CAAC,CAAC;QACH,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;IACvC,CAAC;YAAS,CAAC;QACT,SAAS,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;AACH,CAAC"}
@@ -4,6 +4,7 @@ interface ReplyParams {
4
4
  body: string;
5
5
  html?: string;
6
6
  replyAll?: boolean;
7
+ attachments?: string[];
7
8
  }
8
9
  export declare function emailReply(params: ReplyParams): Promise<string>;
9
10
  export {};
@@ -1 +1 @@
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
+ {"version":3,"file":"email-reply.d.ts","sourceRoot":"","sources":["../../src/tools/email-reply.ts"],"names":[],"mappings":"AAKA,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;IACnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAUD,wBAAsB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAuErE"}
@@ -1,6 +1,7 @@
1
1
  import { loadCredentials } from "../lib/credentials.js";
2
2
  import { sendEmail } from "../lib/smtp.js";
3
3
  import { fetchEnvelopeByMessageId } from "../lib/imap.js";
4
+ import { resolveOutboundAttachments, formatAttachNote } from "../lib/attachment-resolve.js";
4
5
  /**
5
6
  * Strip duplicate Re:/RE:/re: prefixes and prepend a single Re:.
6
7
  */
@@ -13,6 +14,9 @@ export async function emailReply(params) {
13
14
  if ("error" in result)
14
15
  throw new Error(result.error);
15
16
  const { config, password } = result.credentials;
17
+ // Validate attachment paths before any IMAP work so a bad path fails fast
18
+ // with a clean error and no envelope lookup or send is attempted.
19
+ const attachments = resolveOutboundAttachments(process.env.ACCOUNT_DIR, params.attachments);
16
20
  // Resolve the original message via IMAP (the graph no longer stores
17
21
  // per-message envelopes — see Task 445).
18
22
  const envelope = await fetchEnvelopeByMessageId(config, password, params.messageId);
@@ -53,6 +57,7 @@ export async function emailReply(params) {
53
57
  html: params.html,
54
58
  inReplyTo: originalMessageId,
55
59
  references: originalMessageId,
60
+ attachments,
56
61
  }));
57
62
  }
58
63
  catch (smtpErr) {
@@ -64,6 +69,6 @@ export async function emailReply(params) {
64
69
  throw smtpErr;
65
70
  }
66
71
  const replyType = params.replyAll ? "Reply-all" : "Reply";
67
- return `${replyType} sent to ${to} (Message-ID: ${sentMessageId})`;
72
+ return `${replyType} sent to ${to}${formatAttachNote(attachments)} (Message-ID: ${sentMessageId})`;
68
73
  }
69
74
  //# sourceMappingURL=email-reply.js.map
@@ -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,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAU1D;;GAEG;AACH,SAAS,YAAY,CAAC,OAAe;IACnC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3D,OAAO,OAAO,QAAQ,IAAI,cAAc,EAAE,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,MAAmB;IAClD,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,oEAAoE;IACpE,yCAAyC;IACzC,MAAM,QAAQ,GAAG,MAAM,wBAAwB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IACpF,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAA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O,uBAAuB,MAAM,CAAC,YAAY,sBAAsB,MAAM,CAAC,KAAK,iGAAiG,CACxL,CAAC;QACJ,CAAC;QACD,MAAM,OAAO,CAAC;IAChB,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC;IAC1D,OAAO,GAAG,SAAS,YAAY,EAAE,GAAG,gBAAgB,CAAC,WAAW,CAAC,iBAAiB,aAAa,GAAG,CAAC;AACrG,CAAC"}
@@ -4,6 +4,7 @@ interface SendParams {
4
4
  subject: string;
5
5
  body: string;
6
6
  html?: string;
7
+ attachments?: string[];
7
8
  }
8
9
  export declare function emailSend(params: SendParams): Promise<string>;
9
10
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"email-send.d.ts","sourceRoot":"","sources":["../../src/tools/email-send.ts"],"names":[],"mappings":"AAGA,UAAU,UAAU;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BnE"}
1
+ {"version":3,"file":"email-send.d.ts","sourceRoot":"","sources":["../../src/tools/email-send.ts"],"names":[],"mappings":"AAIA,UAAU,UAAU;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,wBAAsB,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAoCnE"}
@@ -1,10 +1,15 @@
1
1
  import { loadCredentials } from "../lib/credentials.js";
2
2
  import { sendEmail } from "../lib/smtp.js";
3
+ import { resolveOutboundAttachments, formatAttachNote } from "../lib/attachment-resolve.js";
3
4
  export async function emailSend(params) {
4
5
  const result = await loadCredentials(params.accountId);
5
6
  if ("error" in result)
6
7
  throw new Error(result.error);
7
8
  const { config, password } = result.credentials;
9
+ // Validate attachment paths before the SMTP try so a bad path surfaces as a
10
+ // clean validation error (no email sent) rather than picking up the alias
11
+ // diagnostic below.
12
+ const attachments = resolveOutboundAttachments(process.env.ACCOUNT_DIR, params.attachments);
8
13
  try {
9
14
  // Append AI provenance disclosure (EU AI Act Code of Practice)
10
15
  const bodyWithDisclosure = params.body + "\n\n---\nThis message was generated by AI.";
@@ -17,8 +22,9 @@ export async function emailSend(params) {
17
22
  body: bodyWithDisclosure,
18
23
  html: htmlWithDisclosure,
19
24
  headers: { "X-AI-Generated": "true" },
25
+ attachments,
20
26
  });
21
- return `Email sent to ${params.to} (Message-ID: ${messageId})`;
27
+ return `Email sent to ${params.to}${formatAttachNote(attachments)} (Message-ID: ${messageId})`;
22
28
  }
23
29
  catch (err) {
24
30
  const msg = err instanceof Error ? err.message : String(err);
@@ -1 +1 @@
1
- {"version":3,"file":"email-send.js","sourceRoot":"","sources":["../../src/tools/email-send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAU3C,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,IAAI,CAAC;QACH,+DAA+D;QAC/D,MAA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