@rubytech/create-maxy-code 0.1.163 → 0.1.165

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 (106) 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 +91 -40
  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 +204 -169
  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 +22 -13
  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 +17 -13
  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 +3 -2
  75. package/payload/platform/plugins/memory/references/schema-estate-agent.md +1 -1
  76. package/payload/platform/plugins/memory/references/transcript-formats/circleback.md +49 -0
  77. package/payload/platform/plugins/memory/references/transcript-formats/granola.md +50 -0
  78. package/payload/platform/plugins/memory/references/transcript-formats/otter.md +50 -0
  79. package/payload/platform/plugins/memory/skills/conversation-archive/SKILL.md +1 -0
  80. package/payload/platform/plugins/memory/skills/conversation-archive-mcp/SKILL.md +170 -0
  81. package/payload/platform/scripts/seed-neo4j.sh +1 -3
  82. package/payload/platform/services/claude-session-manager/dist/fs-watcher.d.ts +9 -1
  83. package/payload/platform/services/claude-session-manager/dist/fs-watcher.d.ts.map +1 -1
  84. package/payload/platform/services/claude-session-manager/dist/fs-watcher.js +74 -38
  85. package/payload/platform/services/claude-session-manager/dist/fs-watcher.js.map +1 -1
  86. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  87. package/payload/platform/services/claude-session-manager/dist/http-server.js +16 -0
  88. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  89. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +16 -1
  90. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  91. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +21 -7
  92. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  93. package/payload/platform/services/claude-session-manager/dist/session-sidecar.d.ts +7 -0
  94. package/payload/platform/services/claude-session-manager/dist/session-sidecar.d.ts.map +1 -1
  95. package/payload/platform/services/claude-session-manager/dist/session-sidecar.js +10 -0
  96. package/payload/platform/services/claude-session-manager/dist/session-sidecar.js.map +1 -1
  97. package/payload/platform/services/claude-session-manager/dist/systemd-scope.d.ts +52 -10
  98. package/payload/platform/services/claude-session-manager/dist/systemd-scope.d.ts.map +1 -1
  99. package/payload/platform/services/claude-session-manager/dist/systemd-scope.js +73 -13
  100. package/payload/platform/services/claude-session-manager/dist/systemd-scope.js.map +1 -1
  101. package/payload/platform/templates/agents/admin/IDENTITY.md +1 -1
  102. package/payload/platform/templates/specialists/agents/librarian.md +1 -0
  103. package/payload/platform/plugins/admin/hooks/__tests__/per-turn-graph-pass-gate.test.sh +0 -387
  104. package/payload/platform/plugins/admin/hooks/__tests__/pre-turn-graph-pass.test.sh +0 -441
  105. package/payload/platform/plugins/admin/hooks/per-turn-graph-pass-gate.sh +0 -111
  106. package/payload/platform/plugins/admin/hooks/pre-turn-graph-pass.sh +0 -171
@@ -1,171 +0,0 @@
1
- #!/usr/bin/env bash
2
- # UserPromptSubmit hook — pre-turn graph pass. Tasks 425, 430, 439.
3
- #
4
- # Fires once per admin-agent operator prompt submission. Emits a
5
- # directive into the admin agent's `additionalContext` that instructs
6
- # **admin** to scan the just-submitted operator turn for new candidate
7
- # graph rows (mentions, ideas, commitments, contacts, learnings — any
8
- # label the schema admits), then dispatch one `database-operator` Task
9
- # per candidate write. Admin is the session-walker; the specialist only
10
- # sees a narrowly-scoped per-write brief, never the conversation.
11
- #
12
- # Task 430 corrects the Task 425 orchestration shape (the Task 425 hook
13
- # packaged the full conversation blob into the specialist's prompt and
14
- # collapsed data and instruction channels into one context, so operator
15
- # prose pattern-matching as a writer-binding instruction was treated as
16
- # binding and the pass self-denied — same failure class as the writer-POV
17
- # schema doctrine read as binding the agent, Tasks 199 / 995).
18
- #
19
- # Task 439 converges the shared plumbing — stdin parse, role / specialist
20
- # / transcript guards, log-ingest envelope — with `session-end-retrospective.sh`
21
- # via `lib/admin-graph-pass-common.sh`. The only event-specific code in
22
- # this hook is the wrong-hook-event check, the post-turn-context fetch,
23
- # the directive-body composition, and the UserPromptSubmit JSON envelope
24
- # emission on stdout.
25
- #
26
- # Input: Claude Code's UserPromptSubmit hook stdin shape
27
- # { "session_id": "<intrinsic>", "transcript_path": "<jsonl path>",
28
- # "cwd": "<…>", "hook_event_name": "UserPromptSubmit",
29
- # "prompt": "<operator text>" }
30
- # `prompt` is ignored — the directive instructs admin to read the turn
31
- # it already has in context.
32
- #
33
- # Output: stdout JSON of the documented UserPromptSubmit shape:
34
- # { "hookSpecificOutput": { "hookEventName": "UserPromptSubmit",
35
- # "additionalContext": "<directive body>" } }
36
- # exit 0.
37
-
38
- set -uo pipefail
39
-
40
- AGP_LOG_TAG="pre-turn-graph-pass"
41
- AGP_LIB="$(dirname "$0")/lib/admin-graph-pass-common.sh"
42
- if [ ! -f "$AGP_LIB" ]; then
43
- echo "[${AGP_LOG_TAG}] trigger-skipped sessionId=unknown reason=missing-helper path=${AGP_LIB}" >&2
44
- exit 0
45
- fi
46
- # shellcheck source=lib/admin-graph-pass-common.sh
47
- source "$AGP_LIB"
48
-
49
- agp_setup_logging
50
- CONTEXT_URL="${UI_BASE}/api/admin/post-turn-context"
51
-
52
- agp_read_stdin
53
- agp_parse_stdin
54
-
55
- # Wrong-hook-event guard. Pre-turn-graph-pass is UserPromptSubmit-only;
56
- # reject stale Stop-shaped payloads before the role / transcript guards
57
- # run so the operator observes a `wrong-hook-event` skip line, not a
58
- # misleading `missing-transcript`.
59
- if [ -n "$HOOK_EVENT_NAME" ] && [ "$HOOK_EVENT_NAME" != "UserPromptSubmit" ]; then
60
- agp_emit_log "trigger-skipped sessionId=${SESSION_ID_REPORTED} reason=wrong-hook-event event=${HOOK_EVENT_NAME}"
61
- exit 0
62
- fi
63
-
64
- agp_guard_role_specialist
65
- agp_guard_transcript
66
-
67
- # Task 429 — the env var carries the graph `:Conversation.sessionId`.
68
- # Claude Code's own stdin `session_id` field (parsed into `SESSION_ID`
69
- # by `agp_parse_stdin`) is a distinct identifier (JSONL filename); one
70
- # graph sessionId can map to many Claude session ids. Shadow the lib's
71
- # `SESSION_ID` into `CLAUDE_SESSION_ID` so the rest of this hook can
72
- # refer to the graph identifier as `SESSION_ID` without collision.
73
- CLAUDE_SESSION_ID="$SESSION_ID"
74
- SESSION_ID="${SESSION_NODE_ID:-}"
75
-
76
- # Fetch the actual content of every node already written under this
77
- # conversation, account-scoped. The route runs loopback-only — the hook
78
- # is in-process on the device, same trust boundary as `/log-ingest`.
79
- # Admin reads this skip-list before deciding what new writes to
80
- # dispatch; the specialist never sees it (per-write briefs name the
81
- # elementId admin already resolved when attaching to an existing node).
82
- PRIOR_WRITES="(none)"
83
- PRIOR_WRITES_COUNT=0
84
- if [ -n "$SESSION_ID" ]; then
85
- CONTEXT_JSON=$(curl -sS --max-time 5 -G \
86
- --data-urlencode "sessionId=${SESSION_ID}" \
87
- --data-urlencode "accountId=${ACCOUNT_ID:-}" \
88
- "$CONTEXT_URL" 2>/dev/null || echo '')
89
- if [ -n "$CONTEXT_JSON" ]; then
90
- PARSED_CTX=$(printf '%s' "$CONTEXT_JSON" | python3 -c '
91
- import sys, json
92
- try:
93
- d = json.load(sys.stdin)
94
- except Exception:
95
- print("0\t")
96
- sys.exit(0)
97
- writes = d.get("writes") or []
98
- if not isinstance(writes, list):
99
- print("0\t")
100
- sys.exit(0)
101
- lines = []
102
- for w in writes:
103
- if not isinstance(w, dict):
104
- continue
105
- eid = w.get("elementId") or ""
106
- labels = w.get("labels") or []
107
- props = w.get("properties") or {}
108
- if isinstance(labels, list):
109
- labels_str = ":".join(str(x) for x in labels)
110
- else:
111
- labels_str = str(labels)
112
- try:
113
- props_str = json.dumps(props, ensure_ascii=False, sort_keys=True)
114
- except Exception:
115
- props_str = "{}"
116
- lines.append(f"- ({eid}) :{labels_str} {props_str}")
117
- print(f"{len(writes)}\t" + "\n".join(lines))
118
- ' 2>/dev/null)
119
- PRIOR_WRITES_COUNT="${PARSED_CTX%% *}"
120
- PRIOR_WRITES_BODY="${PARSED_CTX#* }"
121
- if [ -n "$PRIOR_WRITES_BODY" ]; then
122
- PRIOR_WRITES="$PRIOR_WRITES_BODY"
123
- fi
124
- fi
125
- fi
126
-
127
- # Compose the directive body before logging so contextBytes reflects
128
- # the actual payload size handed to admin (skip-list + directive prose).
129
- DIRECTIVE_BODY=$(ACCOUNT_ID_OUT="${ACCOUNT_ID:-<unset>}" \
130
- CLAUDE_SESSION_ID_OUT="${CLAUDE_SESSION_ID}" \
131
- SESSION_ID_OUT="${SESSION_ID:-<unset>}" \
132
- PRIOR_WRITES_OUT="${PRIOR_WRITES}" \
133
- python3 - <<'PY'
134
- import os
135
- body = (
136
- "[system: pre-turn-graph-pass-hook]\n"
137
- "Before responding to the operator, run the pre-turn graph pass. "
138
- "Scan the operator turn you just received for any new graph-worthy content not already covered by the prior-writes list below — "
139
- "mentions of named entities, ideas or learnings the operator stated, contacts named for the first time, tasks the operator committed to, decisions, anything the schema admits. "
140
- "For each candidate write, dispatch one Task to the `database-operator` specialist with a brief that names the label, the relevant properties, and (when attaching to an existing node) the elementId from the prior-writes list. "
141
- "Skip writes the prior-writes list already covers — a `:MENTIONS` edge that is already there does not need re-emitting; an existing `:Person` is attached to by elementId, not re-created. "
142
- "If the turn supports no new writes, dispatch nothing. "
143
- "Do not surface these dispatches in your reply to the operator. After the dispatches return, continue with your normal response to the operator's prompt.\n\n"
144
- f"accountId: {os.environ['ACCOUNT_ID_OUT']}\n"
145
- f"claudeSessionId: {os.environ['CLAUDE_SESSION_ID_OUT']}\n"
146
- f"sessionId: {os.environ['SESSION_ID_OUT']}\n\n"
147
- "<prior-writes>\n"
148
- f"{os.environ['PRIOR_WRITES_OUT']}\n"
149
- "</prior-writes>\n"
150
- )
151
- print(body, end="")
152
- PY
153
- )
154
- CONTEXT_BYTES=${#DIRECTIVE_BODY}
155
-
156
- agp_emit_log "dispatch claudeSessionId=${CLAUDE_SESSION_ID} sessionId=${SESSION_ID:-<unset>} directive-shape=admin-walks priorWritesCount=${PRIOR_WRITES_COUNT} contextBytes=${CONTEXT_BYTES} ms=0"
157
-
158
- # Emit the documented UserPromptSubmit JSON envelope on stdout. Python
159
- # handles JSON encoding so embedded newlines, quotes, and backslashes
160
- # in the prior-writes block are escaped correctly.
161
- DIRECTIVE_BODY_OUT="$DIRECTIVE_BODY" python3 - <<'PY'
162
- import os, json, sys
163
- sys.stdout.write(json.dumps({
164
- "hookSpecificOutput": {
165
- "hookEventName": "UserPromptSubmit",
166
- "additionalContext": os.environ["DIRECTIVE_BODY_OUT"],
167
- }
168
- }))
169
- PY
170
-
171
- exit 0