@rubytech/create-realagent 1.0.839 → 1.0.842

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 (84) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/lib/account-enumeration/dist/__tests__/enumerate.test.d.ts +2 -0
  3. package/payload/platform/lib/account-enumeration/dist/__tests__/enumerate.test.d.ts.map +1 -0
  4. package/payload/platform/lib/account-enumeration/dist/__tests__/enumerate.test.js +88 -0
  5. package/payload/platform/lib/account-enumeration/dist/__tests__/enumerate.test.js.map +1 -0
  6. package/payload/platform/lib/account-enumeration/dist/index.d.ts +23 -0
  7. package/payload/platform/lib/account-enumeration/dist/index.d.ts.map +1 -0
  8. package/payload/platform/lib/account-enumeration/dist/index.js +96 -0
  9. package/payload/platform/lib/account-enumeration/dist/index.js.map +1 -0
  10. package/payload/platform/lib/account-enumeration/src/__tests__/enumerate.test.ts +94 -0
  11. package/payload/platform/lib/account-enumeration/src/index.ts +96 -0
  12. package/payload/platform/lib/account-enumeration/tsconfig.json +8 -0
  13. package/payload/platform/lib/graph-write/dist/__tests__/account-id-gate.test.d.ts +2 -0
  14. package/payload/platform/lib/graph-write/dist/__tests__/account-id-gate.test.d.ts.map +1 -0
  15. package/payload/platform/lib/graph-write/dist/__tests__/account-id-gate.test.js +165 -0
  16. package/payload/platform/lib/graph-write/dist/__tests__/account-id-gate.test.js.map +1 -0
  17. package/payload/platform/lib/graph-write/dist/__tests__/action-provenance-gate.test.js +15 -5
  18. package/payload/platform/lib/graph-write/dist/__tests__/action-provenance-gate.test.js.map +1 -1
  19. package/payload/platform/lib/graph-write/dist/index.d.ts +12 -0
  20. package/payload/platform/lib/graph-write/dist/index.d.ts.map +1 -1
  21. package/payload/platform/lib/graph-write/dist/index.js +25 -0
  22. package/payload/platform/lib/graph-write/dist/index.js.map +1 -1
  23. package/payload/platform/lib/graph-write/src/__tests__/account-id-gate.test.ts +189 -0
  24. package/payload/platform/lib/graph-write/src/__tests__/action-provenance-gate.test.ts +16 -5
  25. package/payload/platform/lib/graph-write/src/index.ts +45 -1
  26. package/payload/platform/package.json +2 -2
  27. package/payload/platform/plugins/docs/references/attachments.md +2 -2
  28. package/payload/platform/plugins/docs/references/internals.md +1 -1
  29. package/payload/platform/plugins/docs/references/platform.md +1 -1
  30. package/payload/platform/plugins/docs/references/troubleshooting.md +1 -1
  31. package/payload/platform/plugins/memory/mcp/dist/lib/uuid.js +7 -7
  32. package/payload/platform/plugins/memory/mcp/dist/lib/uuid.js.map +1 -1
  33. package/payload/platform/plugins/whatsapp/PLUGIN.md +1 -1
  34. package/payload/platform/templates/agents/admin/IDENTITY.md +4 -0
  35. package/payload/server/adminuser-self-heal-RY4NFCI7.js +45 -0
  36. package/payload/server/chunk-2YG3AYAH.js +1508 -0
  37. package/payload/server/chunk-7DFOKDNM.js +2098 -0
  38. package/payload/server/chunk-CJWFM3WX.js +2098 -0
  39. package/payload/server/chunk-D5U4XQ66.js +656 -0
  40. package/payload/server/chunk-DJXPAH7T.js +1480 -0
  41. package/payload/server/chunk-DTWW35TK.js +667 -0
  42. package/payload/server/chunk-HTYXRFT6.js +727 -0
  43. package/payload/server/chunk-NPVEOM3D.js +1508 -0
  44. package/payload/server/chunk-QGM4M3NI.js +37 -0
  45. package/payload/server/chunk-S27QCBFQ.js +10071 -0
  46. package/payload/server/chunk-T2MQIKBT.js +10001 -0
  47. package/payload/server/chunk-TS6CKCGU.js +727 -0
  48. package/payload/server/chunk-XECKT3YB.js +10071 -0
  49. package/payload/server/client-pool-2WQ2Q3TF.js +32 -0
  50. package/payload/server/client-pool-M25CGILI.js +32 -0
  51. package/payload/server/client-pool-SMWCZMZG.js +32 -0
  52. package/payload/server/cloudflare-task-tracker-GQFKLY62.js +20 -0
  53. package/payload/server/cloudflare-task-tracker-NQK7A2EQ.js +20 -0
  54. package/payload/server/cloudflare-task-tracker-O4ZA4TAS.js +20 -0
  55. package/payload/server/cloudflare-task-tracker-XFGXO7ZV.js +20 -0
  56. package/payload/server/maxy-edge.js +3 -4
  57. package/payload/server/public/assets/{Checkbox-Bq6ORjz2.js → Checkbox-aCc0UGp3.js} +1 -1
  58. package/payload/server/public/assets/{admin-CstEkw-G.js → admin-CvwOOG4D.js} +2 -2
  59. package/payload/server/public/assets/data-DsItQm8c.js +1 -0
  60. package/payload/server/public/assets/graph-C-HOmfmU.js +1 -0
  61. package/payload/server/public/assets/{jsx-runtime-DidQeNoZ.css → jsx-runtime-BKoartnM.css} +1 -1
  62. package/payload/server/public/assets/{page-CFWoVkgV.js → page-D7LchjvY.js} +1 -1
  63. package/payload/server/public/assets/{page-Bpi_jPw6.js → page-DTmTvkNo.js} +1 -1
  64. package/payload/server/public/assets/{public-BWMwq5Jj.js → public-Br9YjNs_.js} +2 -2
  65. package/payload/server/public/assets/{useAdminFetch-B93ig7ef.js → useAdminFetch-BgDL3JGd.js} +1 -1
  66. package/payload/server/public/assets/{useVoiceRecorder-Cb0nAtOo.js → useVoiceRecorder-Bx903Mk1.js} +1 -1
  67. package/payload/server/public/data.html +5 -5
  68. package/payload/server/public/graph.html +6 -6
  69. package/payload/server/public/index.html +8 -8
  70. package/payload/server/public/public.html +5 -5
  71. package/payload/server/server.js +81 -67
  72. package/payload/platform/neo4j/migrations/001-backfill-scope.cypher +0 -30
  73. package/payload/platform/neo4j/migrations/002-project-public-agents.ts +0 -191
  74. package/payload/platform/neo4j/migrations/003-person-name-eradicate.cypher +0 -24
  75. package/payload/platform/neo4j/migrations/004-project-admin-agent.ts +0 -348
  76. package/payload/platform/neo4j/migrations/004-prune-alien-accounts.ts +0 -133
  77. package/payload/platform/neo4j/migrations/005-removed-review-feature.ts +0 -102
  78. package/payload/platform/neo4j/migrations/006-prune-bogus-whatsapp-persons.ts +0 -132
  79. package/payload/platform/neo4j/migrations/007-conversation-archive-source.ts +0 -116
  80. package/payload/platform/neo4j/migrations/008-adminuser-accountid-backfill.ts +0 -85
  81. package/payload/platform/neo4j/migrations/009-conversation-archive-title.ts +0 -197
  82. package/payload/server/public/assets/data-DwZZ7qbH.js +0 -1
  83. package/payload/server/public/assets/graph-DceEv42K.js +0 -1
  84. /package/payload/server/public/assets/{jsx-runtime-DH5S-MwB.js → jsx-runtime-WW3O7tSz.js} +0 -0
@@ -53,7 +53,7 @@ When per-group activation is `mention`, the agent fires only if the inbound mess
53
53
 
54
54
  Every `messages.upsert` event (both `notify` and `append`, both `fromMe` directions) writes a `:Message:WhatsAppMessage` row to Neo4j attached to the sessionKey-keyed `:Conversation`. A single capture site at `platform/ui/app/lib/whatsapp/manager.ts` covers inbound, outbound (Baileys echoes agent-sent messages back through `messages.upsert` with `fromMe=true`), and owner-mirror — without touching `outbound/send.ts`. `messageId` namespace is `whatsapp-live:<waName>:<remoteJid>:<msg.key.id>` where `<waName>` is the Baileys credential dirname (e.g. `default`); distinct from the `:Section:Conversation` chunks written by the source-agnostic `conversation-archive` skill — live and archive live in disjoint label spaces. Persist failures are loud (`[whatsapp-persist] FAIL …`) and never block dispatch — silent loss is the worse failure mode.
55
55
 
56
- **`accountId` contract.** `n.accountId` on every `:Conversation`, `:Person`, and `:Message:WhatsAppMessage` row stamped by this plugin is the **platform-side UUID** resolved by [`resolvePlatformAccountId()`](../../ui/app/lib/whatsapp/platform-account-id.ts) from `data/accounts/<uuid>/account.json` — NOT the Baileys credential dirname (which is only used as the `messageId`/`sessionKey` namespace token). The boot-time line `[whatsapp-persist] resolved-account-id waname=<dir> uuid=<uuid>` records the resolution. Doctrine: see `.docs/neo4j.md` "Account isolation invariant" — migration 004 `pruneAlienAccounts` `DETACH DELETE`s any node whose `accountId` is not a UUID dir on every boot. The helper loud-throws on zero or multi accounts (Phase 0 single-account invariant), aborting the WhatsApp connection start before any write can occur.
56
+ **`accountId` contract.** `n.accountId` on every `:Conversation`, `:Person`, and `:Message:WhatsAppMessage` row stamped by this plugin is the **platform-side UUID** resolved by [`resolvePlatformAccountId()`](../../ui/app/lib/whatsapp/platform-account-id.ts) from `data/accounts/<uuid>/account.json` — NOT the Baileys credential dirname (which is only used as the `messageId`/`sessionKey` namespace token). The boot-time line `[whatsapp-persist] resolved-account-id waname=<dir> uuid=<uuid>` records the resolution. Doctrine: see `.docs/neo4j.md` "Account isolation invariant" — every writer that stamps `n.accountId` must verify the value against `${DATA_ROOT}/accounts/<id>/account.json` before write. The helper loud-throws on zero or multi accounts (Phase 0 single-account invariant), aborting the WhatsApp connection start before any write can occur. The same boot-validated identity (`process.env.ACCOUNT_ID`) backs the central live floor at [`writeNodeWithEdges`](../../lib/graph-write/src/index.ts) — any write whose `accountId` differs from the spawning process's `ACCOUNT_ID` is rejected by the gate; the WhatsApp helper is the writer-side discipline, the gate is the universal floor.
57
57
 
58
58
  ## Skills
59
59
 
@@ -121,6 +121,8 @@ Operationalises the CONCISE prerogative for clarification. Three rules:
121
121
 
122
122
  ## Tool Routing
123
123
 
124
+ **Bundled-SKILL access contract.** Plugin skills and references live in the bundled npm package, not on disk under `<accountDir>/agents/admin/plugins/`. Load them with `mcp__admin__plugin-read` only — the `<plugin-manifest>` `Skills:` and `References:` lines name the exact `pluginName` and file path to pass. `Read`, `Glob`, and `Bash` against those paths will fail with `File does not exist`, and the runtime agent-loop-stop interceptor cannot distinguish a generic-error retry from a tool-routing mistake. Subagents inherit this contract via the parent system prompt — never dispatch an `Agent` subagent with a `Read` directive against a bundled SKILL path.
125
+
124
126
  Plugins provide domain-specific tools that query their own data stores directly. `memory-search` is a general-purpose semantic search across the entire knowledge graph — it finds nodes by vector similarity, which means results are ranked by semantic closeness to the query, not by domain relevance. A query containing the word "email" will surface product documentation *about* email features before it surfaces actual Email nodes whose content is unrelated to the query wording.
125
127
 
126
128
  When the user's intent maps to a specific plugin's domain, use that plugin's tools — not `memory-search`. The `<plugin-manifest>` groups tools by plugin and describes each plugin's purpose and retrieval paths. The `<specialist-domains>` block within it lists every specialist-owned tool by name. Match user intent to a tool in these registries first; fall back to `memory-search` only when the query genuinely spans multiple domains or no tool in the manifest matches the intent.
@@ -245,6 +247,8 @@ When `<previous-context>` is present:
245
247
 
246
248
  When `<previous-context>` is absent, Neo4j was unreachable or no prior context exists — proceed normally, using tool calls to establish state.
247
249
 
250
+ A separate `<recovery-context>` block on the user-message side appears only when the previous turn was aborted by `agent-loop-stop` or `main-stream-stalled` and the platform persisted a continuation briefing. Treat it as the authoritative description of what failed and what was incomplete — do not re-execute the failed work, do not call `session-list` to figure out what was happening, and do not re-research the blocker. The block coexists with `<previous-context>` (system-prompt session summary) on the recovery turn; the two are not duplicates — `<previous-context>` orients you to the session, `<recovery-context>` orients you to the specific failed turn.
251
+
248
252
  In managed context mode, conversation history is provided within `<conversation-history>` tags. Use `session-compact-status` to retrieve older archived context if needed.
249
253
 
250
254
  ## Tasks
@@ -0,0 +1,45 @@
1
+ import "./chunk-QGM4M3NI.js";
2
+
3
+ // app/lib/adminuser-self-heal.ts
4
+ var UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
5
+ async function selfHealAdminUser(args) {
6
+ const { driver, userId, accountId } = args;
7
+ if (!UUID_REGEX.test(accountId)) {
8
+ throw new Error(
9
+ `[adminuser-self-heal] refusing to run: accountId is not a UUID (got: '${accountId.slice(0, 12)}\u2026')`
10
+ );
11
+ }
12
+ if (!UUID_REGEX.test(userId)) {
13
+ throw new Error(
14
+ `[adminuser-self-heal] refusing to run: userId is not a UUID (got: '${userId.slice(0, 12)}\u2026')`
15
+ );
16
+ }
17
+ const session = driver.session();
18
+ try {
19
+ const result = await session.run(
20
+ `MATCH (au:AdminUser {userId: $userId})
21
+ WHERE au.accountId IS NULL OR au.role IS NULL
22
+ SET au.accountId = COALESCE(au.accountId, $accountId),
23
+ au.role = COALESCE(au.role, 'owner'),
24
+ au.updatedAt = $now
25
+ RETURN count(au) AS healed`,
26
+ { userId, accountId, now: (/* @__PURE__ */ new Date()).toISOString() }
27
+ );
28
+ const raw = result.records[0]?.get("healed");
29
+ let healed = 0;
30
+ if (typeof raw === "number") {
31
+ healed = raw;
32
+ } else if (raw && typeof raw.toNumber === "function") {
33
+ healed = raw.toNumber();
34
+ }
35
+ console.error(
36
+ `[adminuser-self-heal] healed=${healed} userId=${userId.slice(0, 8)} accountId=${accountId.slice(0, 8)}`
37
+ );
38
+ return { healed };
39
+ } finally {
40
+ await session.close();
41
+ }
42
+ }
43
+ export {
44
+ selfHealAdminUser
45
+ };