@rubytech/create-maxy-code 0.1.459 → 0.1.460

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 (145) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/lib/storage-broker/dist/__tests__/cf-exec.test.js +116 -6
  3. package/payload/platform/lib/storage-broker/dist/__tests__/cf-exec.test.js.map +1 -1
  4. package/payload/platform/lib/storage-broker/dist/__tests__/object-limits.test.js +20 -0
  5. package/payload/platform/lib/storage-broker/dist/__tests__/object-limits.test.js.map +1 -1
  6. package/payload/platform/lib/storage-broker/dist/__tests__/resource-limits.test.d.ts +2 -0
  7. package/payload/platform/lib/storage-broker/dist/__tests__/resource-limits.test.d.ts.map +1 -0
  8. package/payload/platform/lib/storage-broker/dist/__tests__/resource-limits.test.js +41 -0
  9. package/payload/platform/lib/storage-broker/dist/__tests__/resource-limits.test.js.map +1 -0
  10. package/payload/platform/lib/storage-broker/dist/cf-exec.d.ts +1 -0
  11. package/payload/platform/lib/storage-broker/dist/cf-exec.d.ts.map +1 -1
  12. package/payload/platform/lib/storage-broker/dist/cf-exec.js +116 -48
  13. package/payload/platform/lib/storage-broker/dist/cf-exec.js.map +1 -1
  14. package/payload/platform/lib/storage-broker/dist/index.d.ts +1 -0
  15. package/payload/platform/lib/storage-broker/dist/index.d.ts.map +1 -1
  16. package/payload/platform/lib/storage-broker/dist/index.js +1 -0
  17. package/payload/platform/lib/storage-broker/dist/index.js.map +1 -1
  18. package/payload/platform/lib/storage-broker/dist/object-limits.d.ts +27 -0
  19. package/payload/platform/lib/storage-broker/dist/object-limits.d.ts.map +1 -1
  20. package/payload/platform/lib/storage-broker/dist/object-limits.js +27 -7
  21. package/payload/platform/lib/storage-broker/dist/object-limits.js.map +1 -1
  22. package/payload/platform/lib/storage-broker/dist/resource-limits.d.ts +102 -0
  23. package/payload/platform/lib/storage-broker/dist/resource-limits.d.ts.map +1 -0
  24. package/payload/platform/lib/storage-broker/dist/resource-limits.js +105 -0
  25. package/payload/platform/lib/storage-broker/dist/resource-limits.js.map +1 -0
  26. package/payload/platform/lib/storage-broker/src/__tests__/cf-exec.test.ts +130 -7
  27. package/payload/platform/lib/storage-broker/src/__tests__/object-limits.test.ts +30 -0
  28. package/payload/platform/lib/storage-broker/src/__tests__/resource-limits.test.ts +49 -0
  29. package/payload/platform/lib/storage-broker/src/cf-exec.ts +129 -56
  30. package/payload/platform/lib/storage-broker/src/index.ts +1 -0
  31. package/payload/platform/lib/storage-broker/src/object-limits.ts +26 -6
  32. package/payload/platform/lib/storage-broker/src/resource-limits.ts +105 -0
  33. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +5 -4
  34. package/payload/platform/plugins/cloudflare/PLUGIN.md +3 -1
  35. package/payload/platform/plugins/cloudflare/mcp/__tests__/auth-route.test.ts +206 -0
  36. package/payload/platform/plugins/cloudflare/mcp/__tests__/authorize.test.ts +201 -0
  37. package/payload/platform/plugins/cloudflare/mcp/__tests__/file-routes.test.ts +178 -0
  38. package/payload/platform/plugins/cloudflare/mcp/__tests__/harness.test.ts +32 -0
  39. package/payload/platform/plugins/cloudflare/mcp/__tests__/passcode.test.ts +74 -0
  40. package/payload/platform/plugins/cloudflare/mcp/__tests__/ratelimit.test.ts +77 -0
  41. package/payload/platform/plugins/cloudflare/mcp/__tests__/skill-contract.test.ts +46 -0
  42. package/payload/platform/plugins/cloudflare/mcp/__tests__/template-config.test.ts +55 -0
  43. package/payload/platform/plugins/cloudflare/mcp/__tests__/upload-route.test.ts +255 -0
  44. package/payload/platform/plugins/cloudflare/mcp/package.json +5 -2
  45. package/payload/platform/plugins/cloudflare/references/r2-object-storage.md +46 -0
  46. package/payload/platform/plugins/cloudflare/skills/data-portal/SKILL.md +123 -0
  47. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/_lib/authorize.ts +32 -0
  48. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/_lib/log.ts +12 -0
  49. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/_lib/passcode.ts +73 -0
  50. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/_lib/ratelimit.ts +55 -0
  51. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/_lib/session.ts +85 -0
  52. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/_lib/types.ts +44 -0
  53. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/auth.ts +113 -0
  54. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/delete.ts +89 -0
  55. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/download.ts +70 -0
  56. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/files.ts +41 -0
  57. package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/upload.ts +151 -0
  58. package/payload/platform/plugins/cloudflare/skills/data-portal/template/public/index.html +42 -0
  59. package/payload/platform/plugins/cloudflare/skills/data-portal/template/public/portal.css +113 -0
  60. package/payload/platform/plugins/cloudflare/skills/data-portal/template/public/portal.js +155 -0
  61. package/payload/platform/plugins/cloudflare/skills/data-portal/template/schema.sql +64 -0
  62. package/payload/platform/plugins/cloudflare/skills/data-portal/template/wrangler.toml +21 -0
  63. package/payload/platform/plugins/cloudflare/skills/site-deploy/SKILL.md +8 -0
  64. package/payload/platform/plugins/docs/references/outlook-guide.md +3 -3
  65. package/payload/platform/plugins/docs/references/voice-mirror-guide.md +1 -0
  66. package/payload/platform/plugins/filesystem/PLUGIN.md +0 -1
  67. package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.d.ts +14 -10
  68. package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.d.ts.map +1 -1
  69. package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.js +14 -10
  70. package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.js.map +1 -1
  71. package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +1 -1
  72. package/payload/platform/plugins/outlook/PLUGIN.md +3 -5
  73. package/payload/platform/plugins/outlook/mcp/dist/__tests__/detach.test.d.ts +2 -0
  74. package/payload/platform/plugins/outlook/mcp/dist/__tests__/detach.test.d.ts.map +1 -0
  75. package/payload/platform/plugins/outlook/mcp/dist/__tests__/detach.test.js +75 -0
  76. package/payload/platform/plugins/outlook/mcp/dist/__tests__/detach.test.js.map +1 -0
  77. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-edit-removal.test.d.ts +2 -0
  78. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-edit-removal.test.d.ts.map +1 -0
  79. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-edit-removal.test.js +187 -0
  80. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-edit-removal.test.js.map +1 -0
  81. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-edit.test.js +1 -1
  82. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-edit.test.js.map +1 -1
  83. package/payload/platform/plugins/outlook/mcp/dist/index.js +3 -2
  84. package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
  85. package/payload/platform/plugins/outlook/mcp/dist/lib/attachment-list.d.ts +43 -0
  86. package/payload/platform/plugins/outlook/mcp/dist/lib/attachment-list.d.ts.map +1 -0
  87. package/payload/platform/plugins/outlook/mcp/dist/lib/attachment-list.js +65 -0
  88. package/payload/platform/plugins/outlook/mcp/dist/lib/attachment-list.js.map +1 -0
  89. package/payload/platform/plugins/outlook/mcp/dist/lib/detach.d.ts +65 -0
  90. package/payload/platform/plugins/outlook/mcp/dist/lib/detach.d.ts.map +1 -0
  91. package/payload/platform/plugins/outlook/mcp/dist/lib/detach.js +99 -0
  92. package/payload/platform/plugins/outlook/mcp/dist/lib/detach.js.map +1 -0
  93. package/payload/platform/plugins/outlook/mcp/dist/lib/outbound-attachments.d.ts +6 -1
  94. package/payload/platform/plugins/outlook/mcp/dist/lib/outbound-attachments.d.ts.map +1 -1
  95. package/payload/platform/plugins/outlook/mcp/dist/lib/outbound-attachments.js.map +1 -1
  96. package/payload/platform/plugins/outlook/mcp/dist/tools/draft-edit.d.ts +42 -22
  97. package/payload/platform/plugins/outlook/mcp/dist/tools/draft-edit.d.ts.map +1 -1
  98. package/payload/platform/plugins/outlook/mcp/dist/tools/draft-edit.js +59 -23
  99. package/payload/platform/plugins/outlook/mcp/dist/tools/draft-edit.js.map +1 -1
  100. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-attachment.d.ts +15 -16
  101. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-attachment.d.ts.map +1 -1
  102. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-attachment.js +8 -41
  103. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-attachment.js.map +1 -1
  104. package/payload/platform/plugins/outlook/references/auth.md +1 -1
  105. package/payload/platform/plugins/outlook/references/graph-surfaces.md +7 -3
  106. package/payload/platform/plugins/outlook/skills/outlook/SKILL.md +1 -1
  107. package/payload/platform/plugins/storage-broker/PLUGIN.md +1 -1
  108. package/payload/platform/plugins/voice-mirror/PLUGIN.md +19 -7
  109. package/payload/platform/plugins/voice-mirror/mcp/dist/index.d.ts.map +1 -1
  110. package/payload/platform/plugins/voice-mirror/mcp/dist/index.js +35 -16
  111. package/payload/platform/plugins/voice-mirror/mcp/dist/index.js.map +1 -1
  112. package/payload/platform/plugins/voice-mirror/mcp/dist/lib/admin-user.d.ts +31 -0
  113. package/payload/platform/plugins/voice-mirror/mcp/dist/lib/admin-user.d.ts.map +1 -0
  114. package/payload/platform/plugins/voice-mirror/mcp/dist/lib/admin-user.js +87 -0
  115. package/payload/platform/plugins/voice-mirror/mcp/dist/lib/admin-user.js.map +1 -0
  116. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-distil-profile.d.ts.map +1 -1
  117. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-distil-profile.js +13 -3
  118. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-distil-profile.js.map +1 -1
  119. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-ingest-session-text.d.ts.map +1 -1
  120. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-ingest-session-text.js +2 -1
  121. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-ingest-session-text.js.map +1 -1
  122. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-record-feedback.d.ts.map +1 -1
  123. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-record-feedback.js +2 -1
  124. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-record-feedback.js.map +1 -1
  125. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-tag-content.d.ts +2 -2
  126. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-tag-content.d.ts.map +1 -1
  127. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-tag-content.js +12 -3
  128. package/payload/platform/plugins/voice-mirror/mcp/dist/tools/voice-tag-content.js.map +1 -1
  129. package/payload/platform/plugins/voice-mirror/mcp/scripts/smoke.mjs +334 -0
  130. package/payload/platform/plugins/voice-mirror/skills/voice-mirror/SKILL.md +13 -0
  131. package/payload/platform/scripts/voice-author-key-audit.sh +155 -0
  132. package/payload/platform/services/claude-session-manager/dist/mcp-descriptor-resolve.d.ts +17 -0
  133. package/payload/platform/services/claude-session-manager/dist/mcp-descriptor-resolve.d.ts.map +1 -0
  134. package/payload/platform/services/claude-session-manager/dist/mcp-descriptor-resolve.js +88 -0
  135. package/payload/platform/services/claude-session-manager/dist/mcp-descriptor-resolve.js.map +1 -0
  136. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +0 -1
  137. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  138. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +34 -23
  139. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  140. package/payload/server/{chunk-Q6W4U6HL.js → chunk-JXWFVE5X.js} +83 -39
  141. package/payload/server/server.js +213 -38
  142. package/payload/server/{src-3I2RYZFB.js → src-4F37OHLK.js} +11 -1
  143. package/payload/platform/plugins/outlook/mcp/dist/__tests__/pkce-flow.test.d.ts +0 -2
  144. package/payload/platform/plugins/outlook/mcp/dist/__tests__/pkce-flow.test.js +0 -215
  145. package/payload/platform/plugins/outlook/mcp/dist/__tests__/pkce-flow.test.js.map +0 -1
@@ -14,7 +14,7 @@ The **encrypted token store** (`token-store.ts`) is still adapted from [`nsakki5
14
14
 
15
15
  End users never register an Azure app. The `OUTLOOK_CLIENT_ID` is a **public, non-secret** value (a PKCE public-client app has no client secret), and the app is **multi-tenant** (`/common`), so **one vendor-owned Entra app per brand** serves every install and every mailbox on that brand. End users only complete the OAuth consent screen; per-mailbox tokens stay per-account and encrypted, so a shared client ID does not weaken isolation.
16
16
 
17
- The value ships as the brand default: `brands/<brand>/brand.json#outlookClientId`. The installer stamps it onto the `-claude-session-manager` unit env as `OUTLOOK_CLIENT_ID` (+ `OUTLOOK_TENANT_ID=common`), and the plugin resolves it through the PLUGIN.md `mcp.env` passthrough. A brand that ships the field empty has the plugin inert (register refuses) until its vendor app exists — no operator action makes it work.
17
+ The value ships as the brand default: `brands/<brand>/brand.json#outlookClientId`. The installer stamps it onto the `-claude-session-manager` unit env as `OUTLOOK_CLIENT_ID` (+ `OUTLOOK_TENANT_ID=common`), and the plugin's MCP server reads it from `process.env` — it arrives by inheritance down the spawn chain (manager unit env → PTY → MCP child), not through any PLUGIN.md declaration. Outlook is `mcp-manifest: auto`, whose generator branch discards the declared `mcp.env` block entirely and emits only `MCP_SPAWN_TEE_NAME` (the manifest contract). The plugin's inert `OUTLOOK_CLIENT_ID: ${OUTLOOK_CLIENT_ID}` declaration has been deleted; it reached no path. A brand that ships the field empty has the plugin inert (register refuses) until its vendor app exists — no operator action makes it work.
18
18
 
19
19
  **Per-install override (escape hatch, not required):** setting `OUTLOOK_CLIENT_ID` in the install's env overrides the brand default. This is only for a vendor testing a replacement app; normal installs need nothing.
20
20
 
@@ -134,13 +134,17 @@ Recoverable — moves to Deleted Items, never hard-deletes or expunges. An id al
134
134
 
135
135
  **Endpoints (in order):**
136
136
  1. `PATCH /me/messages/{draftId}` (`ResponseType.RAW`; success asserted on HTTP 200) with only the supplied fields (`subject`, `body` → `{ contentType, content }`, `toRecipients`, `ccRecipients`, `bccRecipients`). Graph drafts are mutable, so no delete-and-reappend. **Skipped entirely** when the call supplies attachments and no patchable field. A PATCH on a sent (non-draft) message returns a Graph error surfaced unchanged.
137
- 2. Per file, by size — identical to `outlook-mail-reply` step 3 (shared helper). Attachments are **additive**: files are added to whatever the draft already carries. Removing or replacing an existing attachment is not supported.
137
+ 2. Per file, by size — identical to `outlook-mail-reply` step 3 (shared helper). Attachments edit in place: `attachments` adds files to what the draft already carries, `removeAttachments` takes files off via `DELETE /me/messages/{draftId}/attachments/{attachmentId}`, and the two together replace a file.
138
138
 
139
- At least one patchable field **or** one attachment is required. Attachment paths are validated before step 1, so a bad path leaves the draft untouched rather than half-edited.
139
+ **Removal resolution.** Each `removeAttachments` entry is matched against `GET /me/messages/{draftId}/attachments` (the same paginated call `outlook-mail-attachment` uses — shared as `lib/attachment-list.ts`): an exact attachment-id match wins, otherwise an exact name match. Zero matches refuses `not-on-draft` and names what the draft carries; two or more name matches refuses `ambiguous-name` and names the ids that disambiguate. Both fire before the PATCH — the listing is a GET — so a bad removal leaves the draft untouched. Resolution completing before any write is what makes a same-name swap unambiguous: the old file's id is pinned before the new file exists. Two distinct targets addressing the same attachment (an id and a name for one file) are collapsed to one removal rather than refused, so each attachment is deleted at most once. The DELETEs and attaches target the id the PATCH reported, while the listing is necessarily read from the caller's id; see [Item id contract](#item-id-contract).
140
+
141
+ **Removal observability.** `op=resolve requested=<n> resolved=<m>` is emitted once every target has resolved (`m` below `n` means targets were deduped), then one `op=detach id=<name> attachmentId=<id>` per file **after** its DELETE returns. A detach count below `resolved` together with a terminal failure is the partial-removal signature: `draft-edit` is non-atomic across PATCH, DELETE and attach, so a DELETE failing on file 2 of 3 leaves the draft matching neither the before nor the requested after while the caller is told the edit failed.
142
+
143
+ At least one patchable field, **one attachment or one removal** is required. Attachment paths are validated, and removals resolved, before step 1 — so a bad path or an unresolvable removal leaves the draft untouched rather than half-edited.
140
144
 
141
145
  Step 2 targets the id step 1 **reported**, not the caller's `draftId`. Ids are immutable plugin-wide so the two normally match, but a rotated id means the caller's handle no longer addresses the draft — see [Item id contract](#item-id-contract).
142
146
 
143
- **Returned shape:** `{ draftId: string; updated: true; attachments: string[] }` — `draftId` is the id Graph reported for the updated draft, which is authoritative over the id passed in. The tool refuses rather than report `updated: true` for an id it has not read back. An attachments-only edit issues no PATCH, so it reports the caller's id.
147
+ **Returned shape:** `{ draftId: string; updated: true; attachments: string[]; removed: string[] }` — `attachments` names the files added, `removed` the files taken off. `draftId` is the id Graph reported for the updated draft, which is authoritative over the id passed in. The tool refuses rather than report `updated: true` for an id it has not read back. An attachments-only or removal-only edit issues no PATCH, so it reports the caller's id.
144
148
 
145
149
  ## outlook-mail-send
146
150
 
@@ -85,7 +85,7 @@ Every address is a **quoted string inside an array**, even when there is only on
85
85
  `"to": rob@example.com` (unquoted) and `"to": "rob@example.com"` (quoted but not an array) are both rejected before the call reaches Outlook. A rejection here means the arguments were malformed; it is not evidence that sending is broken. Check `outlook-mailbox-info` before reporting a send fault.
86
86
 
87
87
  - `outlook-draft` — create a draft in the Drafts folder (same fields, same array-of-quoted-strings shape as send, including `attachments`). Returns the draft's id, and the files are already on the draft, so it can be sent as-is.
88
- - `outlook-draft-edit draftId=<id>` — update an existing draft in place (Graph drafts are mutable, so no delete-and-reappend). Pass the draftId plus only the fields to change: `to`, `cc`, `bcc`, `subject`, `body`, `isHtml`, `attachments` (recipients and attachments take the same array-of-quoted-strings shape as send). Attachments are added to the draft, never removed. At least one field or attachment is required; a sent message cannot be edited.
88
+ - `outlook-draft-edit draftId=<id>` — update an existing draft in place (Graph drafts are mutable, so no delete-and-reappend). Pass the draftId plus only the fields to change: `to`, `cc`, `bcc`, `subject`, `body`, `isHtml`, `attachments`, `removeAttachments` (recipients and attachments take the same array-of-quoted-strings shape as send). `attachments` adds files to the draft. `removeAttachments` takes files off it, each entry either an attachment name or an attachment id. Pass both to replace a file in one call. To see what a draft carries, call `outlook-mail-attachment` with the draftId as its messageId. Removing a file the draft does not carry, or a name it carries twice, is refused and changes nothing. At least one field, attachment or removal is required; a sent message cannot be edited.
89
89
  - `outlook-draft-send draftId=<id>` — send a draft created earlier. Graph consumes the draft on send.
90
90
 
91
91
  If the mailbox was registered before send was available, the first send returns "re-register to grant send" — run `outlook-account-register` again and consent to the send scopes.
@@ -80,7 +80,7 @@ It is set independently of the email plugin's 25 MiB attachment cap. Both bound
80
80
  Both directions are checked before anything is buffered, in two places that are not redundant:
81
81
 
82
82
  - `put` is size-checked in this MCP process with `statSync` before the file is read. That is what produces the error naming the file and the limit.
83
- - The house routes enforce independently, because they are plain loopback HTTP and every agent holds `Bash`: a cap enforced only here is bypassed by one `curl`, and the house process is the one holding the account-wide credential. `/r2/object/put` rejects an over-cap body at Hono's `bodyLimit`, before the body is buffered. `get` is sized from `r2ObjectList`'s recorded `size` before any bytes move.
83
+ - The house routes enforce independently, because they are plain loopback HTTP and every agent holds `Bash`: a cap enforced only here is bypassed by one `curl`, and the house process is the one holding the account-wide credential. Every object route rejects an over-cap body at Hono's `bodyLimit`, before the body is buffered — `/r2/object/put` against a base64 object ceiling, and `list`, `get` and `delete` against a 64 KiB metadata envelope, since those three carry a bucket and a key or prefix and nothing else. `get` is additionally sized from `r2ObjectFind`'s recorded `size` before any bytes move, which stops at the page carrying the exact key rather than listing every object sharing it as a prefix.
84
84
 
85
85
  A `get` whose key has no recorded size in the listing is refused, not attempted. No recorded size means no bound, and a stale or lagging listing would otherwise transfer an unbounded object. The cost is that a genuinely missing object reports "no recorded size" rather than Cloudflare's 404.
86
86
 
@@ -29,11 +29,7 @@ mcp:
29
29
  LOG_DIR: ${LOG_DIR}
30
30
  PLATFORM_ROOT: ${PLATFORM_ROOT}
31
31
  ACCOUNT_ID: ${ACCOUNT_ID}
32
- ADMIN_USER_ID: ${ADMIN_USER_ID}
33
32
  SESSION_ID: ${SESSION_ID}
34
- NEO4J_URI: ${NEO4J_URI}
35
- NEO4J_USER: ${NEO4J_USER}
36
- NEO4J_PASSWORD: ${NEO4J_PASSWORD}
37
33
  ---
38
34
 
39
35
  # Voice Mirror
@@ -57,16 +53,32 @@ The operator is:
57
53
 
58
54
  ## Tools
59
55
 
60
- Voice mirror introduces five deterministic plugin tools. They route writes through `memory-write` so the graph-write gate stamps provenance on every node.
56
+ Voice mirror introduces five deterministic plugin tools. They write to the graph directly over an account-scoped Cypher session, not through `memory-write`: an authorship stamp does not need the re-embedding and re-validation `memory-write` performs on every call. Account scoping is enforced per query, and identity per write (see [Identity](#identity)).
61
57
 
62
58
  | Tool | Purpose |
63
59
  |------|---------|
64
- | `voice-tag-content` | Stamp `authorshipMode ∈ {human-only, human-led-agent-assisted, agent-led-human-reviewed, agent-only, unknown}`, `format ∈ {text, email, social-post, article, note, marketing-copy}`, and `voiceAuthor` on one or many `:KnowledgeDocument | :Message | :SocialPost` nodes (email threads live as `:KnowledgeDocument {source:'email'}`). Bulk-mode for backfill batches. `format` is required. `author` is optional — omit to attribute to the tagging operator. |
60
+ | `voice-tag-content` | Stamp `authorshipMode ∈ {human-only, human-led-agent-assisted, agent-led-human-reviewed, agent-only, unknown}`, `format ∈ {text, email, social-post, article, note, marketing-copy}`, and `voiceAuthor` on one or many `:KnowledgeDocument | :Message | :SocialPost` nodes (email threads live as `:KnowledgeDocument {source:'email'}`). Bulk-mode for backfill batches. `format` is required. `author` is optional — omit to attribute to the tagging operator. The resolved `voiceAuthor` must name an `:AdminUser` on the calling account or the tag is refused and nothing is written (see [Identity](#identity)). |
65
61
  | `voice-distil-profile` | Three modes, scope-aware (`scope='personal'` default walks one author; `scope='org'` walks the whole account onto the business). `mode='sample'` (default) walks the `human-only` corpus for the given `format`/`scope` and returns exemplars + recent edit intents for the agent to compose a style card; cadence-guarded (≥20% growth or ≥30 days). `mode='amend'` reads only `nodeIds` plus the existing `:VoiceProfile.styleCard` so the agent can decide whether named documents move the profile — operator-initiated, no cadence guard. `mode='write'` persists the YAML card; supply `amendedFromNodeIds` to attribute the write to specific documents (bypasses cadence + corpus walk). Trashed nodes are excluded from every walk. Omit `format` on `'sample'` to enumerate all formats in that scope's corpus and distil each. |
66
- | `voice-retrieve-conditioning` | Return `{styleCard, exemplars[], status}` for a drafting brief. Requires `brief.format` (one of the six corpus formats). `brief.scope` (default `personal`) picks personal vs org voice; a personal request with no personal profile falls back to the org profile (`status='fallback-org'`). K=5 short-form (`brief.length:'short'`), K=15 long-form (`brief.length:'long'`). Token-budget bounded. `status ∈ {ok, fallback-org, no-data, error}`. |
62
+ | `voice-retrieve-conditioning` | Return `{styleCard, exemplars[], status}` for a drafting brief. Requires `brief.format` (one of the six corpus formats). `brief.scope` (default `personal`) picks personal vs org voice; a personal request with no personal profile falls back to the org profile (`status='fallback-org'`). K=5 short-form (`brief.length:'short'`), K=15 long-form (`brief.length:'long'`). Token-budget bounded. `status ∈ {ok, fallback-org, no-data, error}`. Identity is not gated here: retrieval writes nothing, and a personal request that resolves no personal voice falls back to the org voice by design. |
67
63
  | `voice-record-feedback` | Capture an operator edit on an agent draft as a `:VoiceEdit {format, scope}` with a Haiku-summarised `intent`, linked back to the scoped per-format `:VoiceProfile` via `:FEEDBACK_FOR` (org edits → org profile; editor preserved via `:AUTHORED`). Requires `format`. |
68
64
  | `voice-ingest-session-text` | Write operator turns from the current session as `:Message {format:'text', authorshipMode:'human-only'}` corpus nodes. The agent reads its own operator turns from context and passes them as `turns`. Deduplicates via SHA256 `contentHash`. Invoked on demand by the voice-mirror skill when the operator asks to capture this session's voice. |
69
65
 
66
+ ## Identity
67
+
68
+ Every `userId` / `author` a tool accepts is an `:AdminUser` id that already exists on the calling account. It is never a person's name, nor a slug derived from one. A value naming no `:AdminUser` on the account is refused and nothing is written: a profile keyed on a non-existent admin is unreachable by any seat that resolves identity properly, and a `voiceAuthor` stamped with one attributes a corpus to an identity that does not exist.
69
+
70
+ The reserved org key `__org__` is exempt. It names no `:AdminUser` by design and anchors on `:LocalBusiness`. That is how the account-wide house voice works, including on a spawn that carries `ACCOUNT_ID` but no personal identity.
71
+
72
+ Each tool resolves its identity from `USER_ID` in the spawn env. A tool argument is only needed when attributing to someone other than the caller, on a multi-operator account.
73
+
74
+ A refusal names the rejected key and the account, and emits one line:
75
+
76
+ ```
77
+ [voice-identity] refuse tool=<tool> reason=unknown-admin-user userId=<key> accountId=<account>
78
+ ```
79
+
80
+ `platform/scripts/voice-author-key-audit.sh` is the standing per-install check for keys already in the graph. It is read-only and reports two distinct findings: `:VoiceProfile` keys and `voiceAuthor` stamps matching no `:AdminUser` on their account. Disposition of anything it finds is an operator decision.
81
+
70
82
  ## References
71
83
 
72
84
  No external references; the skill body defines the five tool contracts. Developer notes in `maxy-code/.docs/voice-mirror.md`.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAuC,gBAAgB,EAAuB,MAAM,8BAA8B,CAAC;AAic1H,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAuC,gBAAgB,EAAuB,MAAM,8BAA8B,CAAC;AAsd1H,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -19,7 +19,14 @@ const server = new McpServer({
19
19
  // refusal preserves account isolation. Mirrors the memory plugin's
20
20
  // pattern (Task 202).
21
21
  const accountId = process.env.ACCOUNT_ID ?? null;
22
- const userIdEnv = process.env.ADMIN_USER_ID ?? null;
22
+ // Task 1699 USER_ID is the identity the PTY spawn stamps; MCP children
23
+ // inherit it, which is how `memory` / `admin` / `scheduling` resolve the
24
+ // operator without declaring it in their env block. Empty is a legitimate
25
+ // state (silent-compaction / recorder / public spawns stamp empty), and it
26
+ // means "no identity" — normalise it to null so it can never reach a query
27
+ // as a profile key.
28
+ const userIdRaw = process.env.USER_ID ?? "";
29
+ const userIdEnv = userIdRaw.length > 0 ? userIdRaw : null;
23
30
  process.stderr.write(`[voice-mirror] boot accountId=${accountId ?? "null"} userId=${userIdEnv ?? "null"}\n`);
24
31
  function refuseNoAccount(toolName) {
25
32
  process.stderr.write(`[voice-mirror] tool=${toolName} refuse reason=no-account-context\n`);
@@ -34,9 +41,9 @@ function refuseNoAccount(toolName) {
34
41
  };
35
42
  }
36
43
  function resolveUserId() {
37
- // ADMIN_USER_ID is stamped by the admin session manager at spawn time.
38
- // When absent (e.g. specialist subagents), the operator must pass it as
39
- // a tool argument or the tools refuse rather than orphan a profile.
44
+ // USER_ID is stamped on the claude PTY at spawn time and inherited by this
45
+ // MCP child. When absent or empty, the operator must pass userId as a tool
46
+ // argument or the tools refuse rather than orphan a profile.
40
47
  return userIdEnv;
41
48
  }
42
49
  // Format enum schema — shared across tools that accept VoiceFormat.
@@ -61,11 +68,11 @@ lifelineTool(server, "voice-tag-content", "Stamp authorshipMode and format on on
61
68
  userId: z
62
69
  .string()
63
70
  .optional()
64
- .describe("Operator AdminUser id. Defaults to ADMIN_USER_ID env. Used as the default author when `author` is omitted."),
71
+ .describe("Operator AdminUser id. Defaults to USER_ID env. Used as the default author when `author` is omitted. Must name an :AdminUser that already exists on this account."),
65
72
  author: z
66
73
  .string()
67
74
  .optional()
68
- .describe("voiceAuthor userId to stamp on the nodes. Omit to attribute to the tagging operator single-operator accounts get personal attribution for free."),
75
+ .describe("voiceAuthor to stamp on the nodes — an existing :AdminUser id on this account, never a person's name or a slug derived from one. Omit to attribute to the tagging operator; single-operator accounts get personal attribution for free. Name an author only on a multi-operator account when tagging someone else's writing."),
69
76
  }, async ({ nodeIds, mode, format, userId, author }) => {
70
77
  if (!accountId)
71
78
  return refuseNoAccount("voice-tag-content");
@@ -117,7 +124,7 @@ lifelineTool(server, "voice-distil-profile", "Three-mode tool. mode='sample' (de
117
124
  userId: z
118
125
  .string()
119
126
  .optional()
120
- .describe("Operator AdminUser identifier. Defaults to ADMIN_USER_ID env from spawn context."),
127
+ .describe("Operator AdminUser identifier. Defaults to USER_ID env from spawn context."),
121
128
  format: zFormat.optional().describe("Writing format to distil. Required for mode='amend' and mode='write'. When omitted on 'sample', enumerates corpus formats and distils each that fires the cadence guard."),
122
129
  force: z
123
130
  .boolean()
@@ -149,7 +156,7 @@ lifelineTool(server, "voice-distil-profile", "Three-mode tool. mode='sample' (de
149
156
  content: [
150
157
  {
151
158
  type: "text",
152
- text: "voice-distil-profile: userId required (no ADMIN_USER_ID in spawn env).",
159
+ text: "voice-distil-profile: userId required (no USER_ID in spawn env).",
153
160
  },
154
161
  ],
155
162
  isError: true,
@@ -207,7 +214,7 @@ lifelineTool(server, "voice-retrieve-conditioning", "Return the operator's per-f
207
214
  userId: z
208
215
  .string()
209
216
  .optional()
210
- .describe("Operator AdminUser identifier. Defaults to ADMIN_USER_ID env."),
217
+ .describe("Operator AdminUser identifier. Defaults to USER_ID env."),
211
218
  format: zFormat.describe("Writing format for corpus and profile scoping."),
212
219
  topic: z
213
220
  .string()
@@ -225,12 +232,24 @@ lifelineTool(server, "voice-retrieve-conditioning", "Return the operator's per-f
225
232
  return refuseNoAccount("voice-retrieve-conditioning");
226
233
  const resolvedUserId = userId ?? resolveUserId();
227
234
  // org scope is account-wide (keyed on ORG_USER_ID + accountId) and never
228
- // reads a userId, so a specialist spawn that carries ACCOUNT_ID but no
229
- // ADMIN_USER_ID can still retrieve the house voice. Only personal scope
230
- // requires a resolved userId (Task 975).
235
+ // reads a userId, so a spawn that carries ACCOUNT_ID but no USER_ID can
236
+ // still retrieve the house voice. Only personal scope requires a resolved
237
+ // userId (Task 975).
231
238
  if ((scope ?? "personal") !== "org" && !resolvedUserId) {
232
239
  // Soft (no isError) so drafting degrades, but status:error keeps this
233
240
  // distinct from genuine no-data (Task 493).
241
+ //
242
+ // Task 1699 — this gate returns before voiceRetrieveConditioning, so the
243
+ // tool's own missing-identity line never fires and the payload's status
244
+ // lives only in the session JSONL. The shared lifeline reads isError,
245
+ // which a soft return never sets, so it logs outcome=ok. Without this
246
+ // line the failure is invisible in the logs: on the SiteDesk install,
247
+ // 93 voice-retrieve lifeline lines said outcome=ok and none carried the
248
+ // error while every retrieval on a client account was failing. Match the
249
+ // tool's own format so one grep for `[voice-retrieve] error:` finds both.
250
+ process.stderr.write(`[voice-retrieve] error: missing-identity scope=${scope ?? "personal"} ` +
251
+ `accountId=${Boolean(accountId)} userId=${Boolean(resolvedUserId)} ` +
252
+ `userId-source=${userId ? "arg" : "env"}\n`);
234
253
  return {
235
254
  content: [
236
255
  {
@@ -239,7 +258,7 @@ lifelineTool(server, "voice-retrieve-conditioning", "Return the operator's per-f
239
258
  styleCard: null,
240
259
  exemplars: [],
241
260
  status: "error",
242
- error: "no userId (no ADMIN_USER_ID in spawn env)",
261
+ error: "no userId (no USER_ID in spawn env)",
243
262
  }),
244
263
  },
245
264
  ],
@@ -307,7 +326,7 @@ lifelineTool(server, "voice-record-feedback", "Capture an operator's edit on an
307
326
  content: [
308
327
  {
309
328
  type: "text",
310
- text: "voice-record-feedback: userId required (no ADMIN_USER_ID in spawn env).",
329
+ text: "voice-record-feedback: userId required (no USER_ID in spawn env).",
311
330
  },
312
331
  ],
313
332
  isError: true,
@@ -348,7 +367,7 @@ lifelineTool(server, "voice-record-feedback", "Capture an operator's edit on an
348
367
  lifelineTool(server, "voice-ingest-session-text", "Write operator turns from the current session as :Message {format:'text', source:'admin-pty', authorshipMode:'human-only'} corpus nodes. The admin agent reads its own operator turns from the live conversation context and passes them as `turns`. Deduplication via SHA256 contentHash — re-running with the same turns is a no-op. Triggers voice-distil-profile {format:'text'} after ingest (cadence guard decides whether distillation runs). Invoked on demand by the voice-mirror skill when the operator asks to capture this session's voice.", {
349
368
  turns: z.array(z.string()).describe("Operator turns the agent read from its own session context (one string per operator message). Slash commands, harness injections, and large paste blocks are filtered out by the tool."),
350
369
  sessionId: z.string().optional().describe("Session ID for provenance."),
351
- userId: z.string().optional().describe("Operator AdminUser identifier. Defaults to ADMIN_USER_ID env."),
370
+ userId: z.string().optional().describe("Operator AdminUser identifier. Defaults to USER_ID env."),
352
371
  }, async ({ turns, sessionId, userId }) => {
353
372
  if (!accountId)
354
373
  return refuseNoAccount("voice-ingest-session-text");
@@ -358,7 +377,7 @@ lifelineTool(server, "voice-ingest-session-text", "Write operator turns from the
358
377
  content: [
359
378
  {
360
379
  type: "text",
361
- text: "voice-ingest-session-text: userId required (no ADMIN_USER_ID in spawn env).",
380
+ text: "voice-ingest-session-text: userId required (no USER_ID in spawn env).",
362
381
  },
363
382
  ],
364
383
  isError: true,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,aAAa,CAAC,cAAc,CAAC,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,gBAAgB,EAAuB,MAAM,8BAA8B,CAAC;AAE1H,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAA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,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,0DAA0D;AAC1D,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The single refusal wording, shared by every tool that enforces the rule so
3
+ * the refusal reads identically across all five.
4
+ *
5
+ * It names the rejected key and the account, and deliberately does not tell the
6
+ * caller to supply a `userId`. The tools' previous error text did exactly that,
7
+ * and an agent with no way to learn a real AdminUser id supplied a
8
+ * plausible-looking name instead — which is how the invented key `rob-mead`
9
+ * reached a live client account.
10
+ */
11
+ export declare function unknownAdminUserMessage(tool: string, userId: string, accountId: string): string;
12
+ /** Raised when a key names no `:AdminUser` on the calling account. */
13
+ export declare class VoiceIdentityError extends Error {
14
+ readonly userId: string;
15
+ readonly accountId: string;
16
+ constructor(tool: string, userId: string, accountId: string);
17
+ }
18
+ /**
19
+ * Throws `VoiceIdentityError` when `userId` names no `:AdminUser` on
20
+ * `accountId`.
21
+ *
22
+ * `ORG_USER_ID` returns immediately without a query: the reserved org key
23
+ * legitimately names no `:AdminUser` and anchors on `:LocalBusiness` instead
24
+ * (Task 676). Short-circuiting before the session also keeps org scope working
25
+ * on a spawn that carries `ACCOUNT_ID` but no personal identity (Task 975).
26
+ *
27
+ * A driver error propagates. The gate never reports valid on a failed lookup,
28
+ * so a Neo4j outage refuses writes rather than opening the gate.
29
+ */
30
+ export declare function assertAdminUserOnAccount(tool: string, userId: string, accountId: string): Promise<void>;
31
+ //# sourceMappingURL=admin-user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-user.d.ts","sourceRoot":"","sources":["../../src/lib/admin-user.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,MAAM,CAOR;AAED,sEAAsE;AACtE,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBACf,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAM5D;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Account-scoped identity gate for the voice-mirror tools (Task 1701).
3
+ *
4
+ * A `userId` that names no `:AdminUser` on the calling account must never
5
+ * become a `:VoiceProfile` key or a `voiceAuthor` stamp. Two distinct
6
+ * consequences, not one:
7
+ *
8
+ * 1. Write integrity. A profile keyed on a non-existent AdminUser is
9
+ * unreachable by any seat that resolves identity properly, so it is silent
10
+ * dead data that looks, in the graph, like a real operator profile.
11
+ * 2. Attribution. A `voiceAuthor` stamped with such a string attributes a
12
+ * corpus to an identity that does not exist.
13
+ *
14
+ * The match is `(au:AdminUser {accountId, userId})` — the platform's canonical
15
+ * account-scoped identity match, shared with the memory plugin's graph-write
16
+ * gate and `resolve-owner-userid`. `:AdminUser` is documented device-level in
17
+ * `schema.cypher`, but the platform stamps `au.accountId` at creation
18
+ * (Task 669, `neo4j-store.ts`) for exactly this lookup.
19
+ *
20
+ * `ADMIN_OF` is deliberately not traversed: Task 1594 found a `:LocalBusiness`
21
+ * carrying zero `ADMIN_OF` edges, so keying on that edge fails closed on
22
+ * legitimate admins.
23
+ */
24
+ import { getSession } from "./neo4j.js";
25
+ import { ORG_USER_ID } from "./voice-corpus.js";
26
+ /**
27
+ * The single refusal wording, shared by every tool that enforces the rule so
28
+ * the refusal reads identically across all five.
29
+ *
30
+ * It names the rejected key and the account, and deliberately does not tell the
31
+ * caller to supply a `userId`. The tools' previous error text did exactly that,
32
+ * and an agent with no way to learn a real AdminUser id supplied a
33
+ * plausible-looking name instead — which is how the invented key `rob-mead`
34
+ * reached a live client account.
35
+ */
36
+ export function unknownAdminUserMessage(tool, userId, accountId) {
37
+ return (`${tool}: '${userId}' is not an :AdminUser on account ${accountId}, so it cannot be used ` +
38
+ `as a voice profile key or an author stamp. Attribution requires an admin identity that ` +
39
+ `already exists on this account; a value naming none is never written. The account's real ` +
40
+ `admin identity is the operator's to resolve — do not substitute a name, a slug, or a guess.`);
41
+ }
42
+ /** Raised when a key names no `:AdminUser` on the calling account. */
43
+ export class VoiceIdentityError extends Error {
44
+ userId;
45
+ accountId;
46
+ constructor(tool, userId, accountId) {
47
+ super(unknownAdminUserMessage(tool, userId, accountId));
48
+ this.name = "VoiceIdentityError";
49
+ this.userId = userId;
50
+ this.accountId = accountId;
51
+ }
52
+ }
53
+ /**
54
+ * Throws `VoiceIdentityError` when `userId` names no `:AdminUser` on
55
+ * `accountId`.
56
+ *
57
+ * `ORG_USER_ID` returns immediately without a query: the reserved org key
58
+ * legitimately names no `:AdminUser` and anchors on `:LocalBusiness` instead
59
+ * (Task 676). Short-circuiting before the session also keeps org scope working
60
+ * on a spawn that carries `ACCOUNT_ID` but no personal identity (Task 975).
61
+ *
62
+ * A driver error propagates. The gate never reports valid on a failed lookup,
63
+ * so a Neo4j outage refuses writes rather than opening the gate.
64
+ */
65
+ export async function assertAdminUserOnAccount(tool, userId, accountId) {
66
+ if (userId === ORG_USER_ID)
67
+ return;
68
+ const session = getSession();
69
+ let found;
70
+ try {
71
+ const res = await session.run(`MATCH (au:AdminUser {accountId: $accountId, userId: $userId})
72
+ RETURN au.userId AS userId
73
+ LIMIT 1`, { accountId, userId });
74
+ found = res.records.length > 0;
75
+ }
76
+ finally {
77
+ await session.close();
78
+ }
79
+ if (!found) {
80
+ // The write path logged nothing that named the key it used, so `rob-mead`
81
+ // was only findable by reading the graph. One line per refusal closes that:
82
+ // a refusal names the rejected key and the account.
83
+ process.stderr.write(`[voice-identity] refuse tool=${tool} reason=unknown-admin-user userId=${userId} accountId=${accountId}\n`);
84
+ throw new VoiceIdentityError(tool, userId, accountId);
85
+ }
86
+ }
87
+ //# sourceMappingURL=admin-user.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-user.js","sourceRoot":"","sources":["../../src/lib/admin-user.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CACrC,IAAY,EACZ,MAAc,EACd,SAAiB;IAEjB,OAAO,CACL,GAAG,IAAI,MAAM,MAAM,qCAAqC,SAAS,yBAAyB;QAC1F,yFAAyF;QACzF,2FAA2F;QAC3F,6FAA6F,CAC9F,CAAC;AACJ,CAAC;AAED,sEAAsE;AACtE,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,MAAM,CAAS;IACf,SAAS,CAAS;IAC3B,YAAY,IAAY,EAAE,MAAc,EAAE,SAAiB;QACzD,KAAK,CAAC,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,IAAY,EACZ,MAAc,EACd,SAAiB;IAEjB,IAAI,MAAM,KAAK,WAAW;QAAE,OAAO;IAEnC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,IAAI,KAAc,CAAC;IACnB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,GAAG,CAC3B;;eAES,EACT,EAAE,SAAS,EAAE,MAAM,EAAE,CACtB,CAAC;QACF,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IACjC,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAED,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,0EAA0E;QAC1E,4EAA4E;QAC5E,oDAAoD;QACpD,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,gCAAgC,IAAI,qCAAqC,MAAM,cAAc,SAAS,IAAI,CAC3G,CAAC;QACF,MAAM,IAAI,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"voice-distil-profile.d.ts","sourceRoot":"","sources":["../../src/tools/voice-distil-profile.ts"],"names":[],"mappings":"AA4BA,OAAO,EAML,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,wBAAwB,CAAC;AA0BhC,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;IACpC,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,uFAAuF;IACvF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EACP,iBAAiB,GACjB,QAAQ,GACR,cAAc,GACd,oBAAoB,GACpB,0BAA0B,GAC1B,6BAA6B,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8FAA8F;IAC9F,SAAS,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAClC,yGAAyG;IACzG,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACnD;AA8jBD,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,wBAAwB,GAAG,wBAAwB,EAAE,CAAC,CAuGhE"}
1
+ {"version":3,"file":"voice-distil-profile.d.ts","sourceRoot":"","sources":["../../src/tools/voice-distil-profile.ts"],"names":[],"mappings":"AA4BA,OAAO,EAML,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,wBAAwB,CAAC;AA8BhC,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,MAAM,CA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wB,GAAG,wBAAwB,EAAE,CAAC,CAqHhE"}
@@ -27,6 +27,7 @@ import neo4j from "neo4j-driver";
27
27
  import { getSession } from "../lib/neo4j.js";
28
28
  import { notTrashed } from "../lib/voice-corpus.js";
29
29
  import { VOICE_CORPUS_WHERE, voiceCorpusWhereWithFormat, voiceCorpusWhereWithFormatAndAuthor, profileUserIdForScope, FORMAT_VALUES, } from "../lib/voice-corpus.js";
30
+ import { assertAdminUserOnAccount, unknownAdminUserMessage, } from "../lib/admin-user.js";
30
31
  /**
31
32
  * Coerce a neo4j cypher RETURN value to a plain JS number.
32
33
  *
@@ -257,7 +258,7 @@ async function distilForFormat(params) {
257
258
  if (writeResult.records.length === 0) {
258
259
  throw new Error(scope === "org"
259
260
  ? `voice-mirror: :LocalBusiness {accountId='${accountId}'} not found. The account org node must exist before an org distil (created at onboarding alongside :AdminUser).`
260
- : `voice-mirror: :AdminUser {accountId='${accountId}', userId='${userId}'} not found. Onboarding must promote the operator to :AdminUser before distillation.`);
261
+ : unknownAdminUserMessage("voice-distil-profile", profileUserId, accountId));
261
262
  }
262
263
  const profileId = writeResult.records[0].get("profileId");
263
264
  process.stderr.write(`[voice-distil] scope=${scope} userId=${profileUserId} anchor=${anchorLabel} format=${format} corpusSize=${corpusSize} generatedAt=${nowIso} feedbackEntries=${feedbackIntents.length}${scope === "org" ? " sentinel=__org__" : ""}\n`);
@@ -502,8 +503,7 @@ async function amendWriteForFormat(params) {
502
503
  if (result.records.length === 0) {
503
504
  throw new Error(scope === "org"
504
505
  ? `voice-mirror: :LocalBusiness {accountId='${accountId}'} not found. The account org node must exist before an org amend-write.`
505
- : `voice-mirror: :AdminUser {accountId='${accountId}', userId='${userId}'} not found. ` +
506
- `Onboarding must promote the operator to :AdminUser before distillation.`);
506
+ : unknownAdminUserMessage("voice-distil-profile", profileUserId, accountId));
507
507
  }
508
508
  const profileId = result.records[0].get("profileId");
509
509
  const corpusSize = toJsNumber(result.records[0].get("corpusSize")) ?? 0;
@@ -528,6 +528,16 @@ export async function voiceDistilProfile(params) {
528
528
  if (!accountId || !userId) {
529
529
  throw new Error("voice-distil-profile: accountId and userId required");
530
530
  }
531
+ // Task 1701 — gate the profile key once, here, before any corpus work. The
532
+ // write paths keep their own anchor MATCH (that binds the node for the
533
+ // HAS_VOICE_PROFILE merge), but mode='sample' and mode='amend' never reach a
534
+ // write: without this, a key naming no :AdminUser walks the corpus and comes
535
+ // back `skip reason=empty-corpus`, reporting a data condition for what is an
536
+ // identity error. Gating the single exported entry covers sample, amend,
537
+ // amend-write and multi-format enumeration with one lookup rather than one
538
+ // per format. ORG_USER_ID passes through — the org profile anchors on
539
+ // :LocalBusiness and names no :AdminUser by design (Tasks 676, 975).
540
+ await assertAdminUserOnAccount("voice-distil-profile", profileUserIdForScope(scope, userId), accountId);
531
541
  // Amend sample (Task 472): operator-initiated single-document update.
532
542
  if (params.mode === "amend") {
533
543
  if (!params.format) {
@@ -1 +1 @@
1
- {"version":3,"file":"voice-distil-profile.js","sourceRoot":"","sources":["../../src/tools/voice-distil-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,mCAAmC,EACnC,qBAAqB,EACrB,aAAa,GAGd,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;GAQG;AACH,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACvD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;QAAE,OAAQ,KAAoC,CAAC,QAAQ,EAAE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AAoB,EAAE,CAC7B,aAAmC,CAAC,QAAQ,CAAC,CAAC,CAAC,CACjD,CAAC;IACN,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,wBAAwB,KAAK,WAAW,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,yCAAyC,CACtH,CAAC;QACF,OAAO;YACL,SAAS,EAAE,IAAI;YACf,UAAU,EAAE,CAAC;YACb,WAAW,EAAE,IAAI;YACjB,eAAe,EAAE,CAAC;YAClB,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,0BAA0B;SACvC,CAAC;IACJ,CAAC;IAED,8CAA8C;IAC9C,MAAM,OAAO,GAA+B,EAAE,CAAC;IAC/C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QACnE,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
1
+ {"version":3,"file":"voice-distil-profile.js","sourceRoot":"","sources":["../../src/tools/voice-distil-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,mCAAmC,EACnC,qBAAqB,EACrB,aAAa,GAGd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,wBAAwB,EACxB,uB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AAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QACnE,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"voice-ingest-session-text.d.ts","sourceRoot":"","sources":["../../src/tools/voice-ingest-session-text.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,4BAA4B;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAQ/D;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,4BAA4B,CAAC,CAkGvC"}
1
+ {"version":3,"file":"voice-ingest-session-text.d.ts","sourceRoot":"","sources":["../../src/tools/voice-ingest-session-text.ts"],"names":[],"mappings":"AAyBA,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,4BAA4B;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAQ/D;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,4BAA4B,CAAC,CAkGvC"}
@@ -20,6 +20,7 @@
20
20
  */
21
21
  import { createHash } from "node:crypto";
22
22
  import { getSession } from "../lib/neo4j.js";
23
+ import { unknownAdminUserMessage } from "../lib/admin-user.js";
23
24
  import { voiceDistilProfile } from "./voice-distil-profile.js";
24
25
  /**
25
26
  * Applies the "real operator text" exclusions to a single supplied turn.
@@ -93,7 +94,7 @@ export async function voiceIngestSessionText(params) {
93
94
  });
94
95
  if (result.records.length === 0) {
95
96
  // :AdminUser not found — abort rather than orphan nodes.
96
- throw new Error(`voice-ingest-session-text: :AdminUser {accountId='${accountId}', userId='${userId}'} not found. Onboarding must promote the operator to :AdminUser before ingest.`);
97
+ throw new Error(unknownAdminUserMessage("voice-ingest-session-text", userId, accountId));
97
98
  }
98
99
  const isNew = result.records[0].get("isNew") === true;
99
100
  if (isNew) {