@rubytech/create-maxy 1.0.830 → 1.0.832
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/payload/platform/lib/oauth-llm/dist/index.d.ts +8 -1
- package/payload/platform/lib/oauth-llm/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/oauth-llm/dist/index.js +5 -1
- package/payload/platform/lib/oauth-llm/dist/index.js.map +1 -1
- package/payload/platform/lib/oauth-llm/src/index.ts +19 -4
- package/payload/platform/neo4j/migrations/004-project-admin-agent.ts +36 -3
- package/payload/platform/neo4j/migrations/008-adminuser-accountid-backfill.ts +85 -0
- package/payload/platform/plugins/admin/mcp/dist/index.js +25 -3
- package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/docs/references/internals.md +1 -1
- package/payload/platform/plugins/memory/bin/conversation-archive-ingest.mjs +293 -127
- package/payload/platform/plugins/memory/bin/conversation-archive-ingest.sh +41 -14
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/timestamp-scanner.d.ts +49 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/timestamp-scanner.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/timestamp-scanner.js +35 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/timestamp-scanner.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/types.d.ts +6 -7
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/types.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/types.js +9 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/types.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/whatsapp-text.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/whatsapp-text.js +49 -131
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/whatsapp-text.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/delta-cursor.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/delta-cursor.js +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/delta-cursor.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/derive-keys.d.ts +0 -2
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/derive-keys.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/derive-keys.js +10 -11
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/derive-keys.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/sender-bind.d.ts +3 -4
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/sender-bind.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/sender-bind.js +11 -42
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/sender-bind.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/to-turn-text.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/to-turn-text.js +10 -8
- package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/to-turn-text.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts +10 -8
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js +118 -43
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts +3 -2
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js +40 -18
- package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/uuid.d.ts +3 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/uuid.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/uuid.js +12 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/uuid.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-source-agnosticism.test.js +4 -6
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-source-agnosticism.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-whatsapp-text.test.js +59 -17
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-whatsapp-text.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.d.ts +11 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.js +17 -9
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.js +2 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-rank.js.map +1 -1
- package/payload/platform/plugins/memory/skills/conversation-archive/SKILL.md +41 -9
- package/payload/platform/scripts/lib/resolve-account-dir.sh +19 -1
- package/payload/server/chunk-25QDCOE5.js +1116 -0
- package/payload/server/chunk-35YZS3KL.js +328 -0
- package/payload/server/chunk-7CBRZKZS.js +654 -0
- package/payload/server/chunk-BCFM2UPH.js +2305 -0
- package/payload/server/chunk-CV3HPX46.js +10097 -0
- package/payload/server/chunk-IXOPV36P.js +2305 -0
- package/payload/server/chunk-J6YWEJBN.js +1116 -0
- package/payload/server/chunk-OCPJGZ6S.js +654 -0
- package/payload/server/chunk-ZKGAYLAK.js +10097 -0
- package/payload/server/client-pool-NBVGONQL.js +32 -0
- package/payload/server/client-pool-ZNGN66GN.js +32 -0
- package/payload/server/cloudflare-task-tracker-MHALDN54.js +19 -0
- package/payload/server/cloudflare-task-tracker-R4FIORFL.js +19 -0
- package/payload/server/maxy-edge.js +4 -4
- package/payload/server/neo4j-migrations-3A6K2EB5.js +552 -0
- package/payload/server/neo4j-migrations-6RW423E2.js +530 -0
- package/payload/server/server.js +43 -20
|
@@ -40,32 +40,64 @@ The flow:
|
|
|
40
40
|
|
|
41
41
|
DM and group follow the identical flow. A 1:1 chat resolves 2 senders; a group resolves N senders. Identity (`conversationIdentity = sha256(accountId + ":" + sortedParticipantElementIds.join(","))`) is identical regardless of group size — DM and group use the same MERGE key. Source format (whatsapp / telegram / slack) does not affect identity.
|
|
42
42
|
|
|
43
|
-
## Step 2 — invoke the script
|
|
43
|
+
## Step 2 — invoke the script (background + heartbeat)
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
The Haiku classify loop on a multi-thousand-message archive can take minutes. The Claude Agent SDK closes the response stream after **180 seconds of model silence**, so issuing the bash in the foreground guarantees a stall. The script is invoked in the **background** and its progress file is polled on a heartbeat — the script writes one fsync'd progress line per Haiku iteration, and surfacing those lines as chat tokens keeps the SDK silence timer reset.
|
|
46
|
+
|
|
47
|
+
### Identity (Task 900)
|
|
48
|
+
|
|
49
|
+
`ACCOUNT_ID` and `USER_ID` come from the agent's process env (plumbed by `spawn-env.ts` into every Bash subprocess). The script LOUD-FAILs on missing or malformed values; the operator never passes them as flags. The owner `:AdminUser` elementId is derived from `(ACCOUNT_ID, USER_ID)` inside the script via Cypher — `--owner-element-id` is gone.
|
|
50
|
+
|
|
51
|
+
### Background invocation
|
|
46
52
|
|
|
47
53
|
```bash
|
|
48
54
|
bash platform/plugins/memory/bin/conversation-archive-ingest.sh <source-path> \
|
|
49
55
|
--source <whatsapp|telegram|signal|linkedin-messages|zoom-transcript|meeting-minutes|imessage|slack|other> \
|
|
50
|
-
--owner-element-id <id> \
|
|
51
56
|
--participant-person-ids <id1>,<id2>,... \
|
|
52
|
-
--scope <admin|public>
|
|
57
|
+
--scope <admin|public> \
|
|
58
|
+
--session-id <unique-id>
|
|
53
59
|
```
|
|
54
60
|
|
|
61
|
+
Issue with `run_in_background: true`. The script's first stdout line is:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
[conversation-archive] progress-file=<absolute-path-to-progress-file>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Capture that path. The progress file lives at `data/accounts/$ACCOUNT_ID/logs/conversation-archive-$SESSION_ID.log` and is opened with append + fsync per write, so every line is durable on disk before the script proceeds.
|
|
68
|
+
|
|
55
69
|
Optional flags:
|
|
56
|
-
- `--account-id <id>` — explicit account id when more than one exists under `data/accounts/` (Phase 0 has one).
|
|
57
70
|
- `--timezone <iana>` — IANA zone for timestamps (default `Europe/London`).
|
|
58
71
|
- `--date-format <DD/MM/YY|MM/DD/YY|DD/MM/YYYY|MM/DD/YYYY>` — WhatsApp only; override auto-detect for ambiguous locales.
|
|
59
|
-
- `--session-gap-hours <N>` — gap threshold (in hours) used to split parsed messages into sessions for chunking (default `12`).
|
|
72
|
+
- `--session-gap-hours <N>` — gap threshold (in hours) used to split parsed messages into sessions for chunking (default `12`).
|
|
73
|
+
|
|
74
|
+
### Heartbeat protocol
|
|
75
|
+
|
|
76
|
+
Every 30 s while the background bash is live:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
tail -n 100 <progress-file>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Surface fresh `[conversation-archive] classify-session sessionIndex=K/N ...` lines as chat tokens — one chat line per fresh progress line. The SDK silence timer resets on every output token; a 30 s poll cadence keeps the silence wall (180 s) untripped on a steady classify loop.
|
|
83
|
+
|
|
84
|
+
If the tail returns no NEW lines for 60 s while the bg pid is still live: surface the last progress line verbatim to the operator, and stop polling until they direct otherwise. **Do not blind-reissue the bash.**
|
|
85
|
+
|
|
86
|
+
### Resume after silent stall
|
|
87
|
+
|
|
88
|
+
If the SDK injects `"A background task (subagent) didn't finish"` or the `"180 seconds of silence"` banner, the **first action** is `tail -n 200 <progress-file>` for the prior `sessionId`. The progress file's last line names the session number, message count, and phase — that's the resume context. Every per-session commit is atomic (chunks + cursor advance happen in one Cypher transaction via `memory-ingest`'s `MERGE`/`CREATE`); a kill mid-loop leaves the cursor at session N-1's last message. Re-issuing the same bash with the same argv and same `--session-id` resumes from session N onward without re-classifying anything already written.
|
|
89
|
+
|
|
90
|
+
Forbidden: blind-reissue without reading the progress file first.
|
|
60
91
|
|
|
61
|
-
|
|
92
|
+
### What the script does
|
|
62
93
|
- Picks the normaliser for `--source`. WhatsApp: locates `_chat.txt` (zip / dir / direct file), parses deterministically, computes `archiveSha256`. Other sources interpret the path according to their own format.
|
|
63
94
|
- Validates every distinct parsed senderName against the closed set of `{owner, participants...}` candidate names. Any miss LOUD-FAILs `parser-miss reason="senderName=<verbatim> not in confirmed participant set ..."`.
|
|
64
95
|
- Computes `conversationIdentity` from accountId + sorted participant elementIds.
|
|
65
96
|
- Looks up any prior `:ConversationArchive` carrying that identity → reads `lastIngestedMessageHash`. If found, slices parsed lines after the cursor (delta-append). Cursor not found → `FAIL delta-cursor-missing`. Cursor at last line → empty-delta noop (exit 0, no writes).
|
|
66
97
|
- Sessionizes the delta lines at the operator-supplied gap-hours boundary.
|
|
67
|
-
- For each session: renders as turn-attributed text (`[ts] Sender: body\n…`) and calls `memory-classify` with `mode='chat'
|
|
68
|
-
-
|
|
98
|
+
- For each session: renders as turn-attributed text (`[ts] Sender: body\n…`) and calls `memory-classify` with `mode='chat'`. Returns one or more `:Section:Conversation` chunk specs.
|
|
99
|
+
- **Per-session checkpoint** (Task 900 sub-scope E): immediately after each successful classify, calls `memory-ingest` for THAT session's chunks AND advances `lastIngestedMessageHash` / `lastIngestedMessageAt` on the parent `:ConversationArchive` to the last message of that session — atomic (chunk writes + cursor advance happen inside one Cypher transaction). A kill mid-loop leaves the cursor at session N-1's last message; re-issuing with the same argv and `--session-id` resumes from session N onward without re-classifying prior sessions.
|
|
100
|
+
- Server MERGEs the parent on `conversationIdentity`, MERGEs `:PARTICIPANT_IN` edges, CREATEs new chunks, extends the `:NEXT` chain from its tail. The cleanup-by-`archiveSha256` step (drops THIS export's prior chunks) runs only on the FIRST per-session call of a run; subsequent sessions skip cleanup or they would delete chunks just written. Every node and edge stamps `source=<enum>` and `createdByAgent='conversation-archive'`.
|
|
69
101
|
|
|
70
102
|
NO insight pass runs. Phase 2 (operator-driven `:Observation` / `:Task` / `:Preference` derivation against chunks) is its own follow-up task — and applies uniformly to every source once chunks exist.
|
|
71
103
|
|
|
@@ -78,8 +78,26 @@ PY
|
|
|
78
78
|
|
|
79
79
|
local n=${#candidates[@]}
|
|
80
80
|
|
|
81
|
-
# Case 0: no candidates — fresh install, mint new UUID
|
|
81
|
+
# Case 0: no candidates — fresh install, mint new UUID.
|
|
82
|
+
# Task 900 sub-scope F — atomic-mint discipline: refuse to mint a new
|
|
83
|
+
# accountId if any stub dir (subdir present, account.json missing) exists
|
|
84
|
+
# under data/accounts/. The Task 900 root cause was install 1 minting
|
|
85
|
+
# accountId X then losing X/account.json (cron stamped X/logs/ first); the
|
|
86
|
+
# next install saw zero candidates and minted Y, orphaning X/logs/. The
|
|
87
|
+
# guard turns that silent regression into an operator-actionable abort.
|
|
82
88
|
if [ "$n" -eq 0 ]; then
|
|
89
|
+
local stub_dirs=()
|
|
90
|
+
for dir in "$ACCOUNTS_DIR"/*/; do
|
|
91
|
+
[ -d "$dir" ] || continue
|
|
92
|
+
base="$(basename "$dir")"
|
|
93
|
+
case "$base" in .*) continue ;; esac
|
|
94
|
+
[ -f "$dir/account.json" ] && continue
|
|
95
|
+
stub_dirs+=("$base")
|
|
96
|
+
done
|
|
97
|
+
if [ "${#stub_dirs[@]}" -gt 0 ]; then
|
|
98
|
+
echo "==> [seed] FAIL phase=mint reason=\"stub-account-dirs present (no account.json): ${stub_dirs[*]}\" — refusing to mint a fresh accountId; remove or repair the stub before re-running install" >&2
|
|
99
|
+
return 1
|
|
100
|
+
fi
|
|
83
101
|
ACCOUNT_ID="$(cat /proc/sys/kernel/random/uuid 2>/dev/null || python3 -c 'import uuid; print(uuid.uuid4())')"
|
|
84
102
|
ACCOUNT_DIR="$ACCOUNTS_DIR/$ACCOUNT_ID"
|
|
85
103
|
return 0
|