@rubytech/create-maxy-code 0.1.33 → 0.1.35

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 (519) hide show
  1. package/dist/__tests__/account-id-env.test.js +1 -1
  2. package/dist/__tests__/apt-resolve.test.js +7 -7
  3. package/dist/__tests__/brew-install.test.js +1 -1
  4. package/dist/__tests__/brew-resolve.test.js +1 -1
  5. package/dist/__tests__/cdp-port-no-silent-fallback.test.js +4 -4
  6. package/dist/__tests__/init-logging.test.js +1 -1
  7. package/dist/__tests__/launchd-plist.test.js +1 -1
  8. package/dist/__tests__/macos-version.test.js +1 -1
  9. package/dist/__tests__/peer-brand-detect.test.js +1 -1
  10. package/dist/__tests__/platform-detect.test.js +2 -2
  11. package/dist/__tests__/port-canonicalisation.test.js +1 -1
  12. package/dist/__tests__/preflight-port-classifier.test.js +6 -6
  13. package/dist/__tests__/samba-provision.test.js +1 -1
  14. package/dist/__tests__/snap-chromium.test.js +1 -1
  15. package/dist/apt-resolve.js +5 -5
  16. package/dist/brew-install.js +1 -1
  17. package/dist/brew-resolve.js +3 -3
  18. package/dist/index.js +146 -122
  19. package/dist/init-logging.js +1 -1
  20. package/dist/launchd-plist.js +1 -1
  21. package/dist/macos-version.js +2 -2
  22. package/dist/peer-brand-detect.js +1 -1
  23. package/dist/pinned-binaries.js +1 -1
  24. package/dist/platform-detect.js +1 -1
  25. package/dist/port-resolution.js +2 -2
  26. package/dist/preflight-port-classifier.js +3 -3
  27. package/dist/samba-provision.js +1 -1
  28. package/dist/snap-chromium.js +3 -3
  29. package/dist/uninstall.js +28 -28
  30. package/package.json +4 -1
  31. package/payload/platform/lib/account-enumeration/dist/__tests__/validate-env.test.js +1 -1
  32. package/payload/platform/lib/account-enumeration/dist/__tests__/validate-env.test.js.map +1 -1
  33. package/payload/platform/lib/account-enumeration/dist/index.d.ts +1 -1
  34. package/payload/platform/lib/account-enumeration/src/__tests__/validate-env.test.ts +1 -1
  35. package/payload/platform/lib/account-enumeration/src/index.ts +1 -1
  36. package/payload/platform/lib/admins-write/dist/index.js +3 -3
  37. package/payload/platform/lib/admins-write/dist/index.js.map +1 -1
  38. package/payload/platform/lib/admins-write/src/index.ts +4 -4
  39. package/payload/platform/lib/entitlement/dist/index.d.ts +1 -1
  40. package/payload/platform/lib/entitlement/dist/index.js +2 -2
  41. package/payload/platform/lib/entitlement/dist/index.js.map +1 -1
  42. package/payload/platform/lib/graph-mcp/dist/__tests__/warnings-envelope.test.js +1 -1
  43. package/payload/platform/lib/graph-mcp/dist/__tests__/warnings-envelope.test.js.map +1 -1
  44. package/payload/platform/lib/graph-mcp/dist/cypher-rewrite-stamp.d.ts +3 -3
  45. package/payload/platform/lib/graph-mcp/dist/cypher-rewrite-stamp.js +3 -3
  46. package/payload/platform/lib/graph-mcp/dist/cypher-shim-read.d.ts +1 -1
  47. package/payload/platform/lib/graph-mcp/dist/cypher-shim-read.js +1 -1
  48. package/payload/platform/lib/graph-mcp/dist/cypher-shim-write.d.ts +1 -1
  49. package/payload/platform/lib/graph-mcp/dist/cypher-shim-write.js +1 -1
  50. package/payload/platform/lib/graph-mcp/dist/cypher-validate.d.ts +1 -1
  51. package/payload/platform/lib/graph-mcp/dist/cypher-validate.js +1 -1
  52. package/payload/platform/lib/graph-mcp/dist/index.d.ts +1 -1
  53. package/payload/platform/lib/graph-mcp/dist/index.js +24 -24
  54. package/payload/platform/lib/graph-mcp/dist/index.js.map +1 -1
  55. package/payload/platform/lib/graph-mcp/dist/schema-cache.d.ts +1 -1
  56. package/payload/platform/lib/graph-mcp/dist/schema-cache.js +2 -2
  57. package/payload/platform/lib/graph-mcp/dist/schema-cypher-parser.d.ts +3 -3
  58. package/payload/platform/lib/graph-mcp/dist/schema-cypher-parser.js +3 -3
  59. package/payload/platform/lib/graph-mcp/src/__tests__/warnings-envelope.test.ts +1 -1
  60. package/payload/platform/lib/graph-mcp/src/cypher-rewrite-stamp.ts +3 -3
  61. package/payload/platform/lib/graph-mcp/src/cypher-shim-read.ts +1 -1
  62. package/payload/platform/lib/graph-mcp/src/cypher-shim-write.ts +1 -1
  63. package/payload/platform/lib/graph-mcp/src/cypher-validate.ts +1 -1
  64. package/payload/platform/lib/graph-mcp/src/index.ts +29 -29
  65. package/payload/platform/lib/graph-mcp/src/schema-cache.ts +2 -2
  66. package/payload/platform/lib/graph-mcp/src/schema-cypher-parser.ts +3 -3
  67. package/payload/platform/lib/graph-search/dist/index.d.ts +12 -12
  68. package/payload/platform/lib/graph-search/dist/index.js +11 -11
  69. package/payload/platform/lib/graph-search/dist/index.js.map +1 -1
  70. package/payload/platform/lib/graph-search/src/__tests__/bm25-label-gate.test.ts +2 -2
  71. package/payload/platform/lib/graph-search/src/__tests__/bm25-strong-bypass-threshold.test.ts +2 -2
  72. package/payload/platform/lib/graph-search/src/__tests__/brochure-threshold.test.ts +3 -3
  73. package/payload/platform/lib/graph-search/src/__tests__/expand-batch.test.ts +2 -2
  74. package/payload/platform/lib/graph-search/src/__tests__/fulltext-coverage.test.ts +6 -6
  75. package/payload/platform/lib/graph-search/src/__tests__/hybrid.test.ts +5 -5
  76. package/payload/platform/lib/graph-search/src/__tests__/vector-threshold.test.ts +2 -2
  77. package/payload/platform/lib/graph-search/src/index.ts +18 -18
  78. package/payload/platform/lib/graph-trash/dist/index.d.ts +3 -3
  79. package/payload/platform/lib/graph-trash/dist/index.js +3 -3
  80. package/payload/platform/lib/graph-trash/src/index.ts +3 -3
  81. package/payload/platform/lib/graph-write/dist/__tests__/action-provenance-gate.test.js +4 -4
  82. package/payload/platform/lib/graph-write/dist/__tests__/action-provenance-gate.test.js.map +1 -1
  83. package/payload/platform/lib/graph-write/dist/audit.d.ts +2 -2
  84. package/payload/platform/lib/graph-write/dist/audit.js +2 -2
  85. package/payload/platform/lib/graph-write/dist/conversation-provenance.js +1 -1
  86. package/payload/platform/lib/graph-write/dist/conversation-provenance.js.map +1 -1
  87. package/payload/platform/lib/graph-write/dist/index.d.ts +5 -5
  88. package/payload/platform/lib/graph-write/dist/index.js +12 -12
  89. package/payload/platform/lib/graph-write/dist/index.js.map +1 -1
  90. package/payload/platform/lib/graph-write/src/__tests__/action-provenance-gate.test.ts +4 -4
  91. package/payload/platform/lib/graph-write/src/audit.ts +2 -2
  92. package/payload/platform/lib/graph-write/src/conversation-provenance.ts +1 -1
  93. package/payload/platform/lib/graph-write/src/index.ts +13 -13
  94. package/payload/platform/lib/mcp-eager/dist/index.d.ts +2 -2
  95. package/payload/platform/lib/mcp-eager/dist/index.js +2 -2
  96. package/payload/platform/lib/mcp-eager/src/index.ts +2 -2
  97. package/payload/platform/lib/mcp-spawn-tee/dist/index.d.ts +2 -2
  98. package/payload/platform/lib/mcp-spawn-tee/dist/index.js +2 -2
  99. package/payload/platform/lib/mcp-spawn-tee/src/index.ts +2 -2
  100. package/payload/platform/lib/mcp-stderr-tee/dist/index.d.ts +1 -1
  101. package/payload/platform/lib/mcp-stderr-tee/dist/index.js +4 -4
  102. package/payload/platform/lib/mcp-stderr-tee/dist/index.js.map +1 -1
  103. package/payload/platform/lib/mcp-stderr-tee/src/index.ts +4 -4
  104. package/payload/platform/lib/oauth-llm/dist/index.d.ts +4 -4
  105. package/payload/platform/lib/oauth-llm/dist/index.js +3 -3
  106. package/payload/platform/lib/oauth-llm/dist/index.js.map +1 -1
  107. package/payload/platform/lib/oauth-llm/src/index.ts +6 -6
  108. package/payload/platform/lib/persistent-components/dist/index.d.ts +1 -1
  109. package/payload/platform/lib/persistent-components/dist/index.js +1 -1
  110. package/payload/platform/lib/persistent-components/src/index.ts +1 -1
  111. package/payload/platform/lib/task-secrets/dist/index.js +1 -1
  112. package/payload/platform/lib/task-secrets/dist/index.js.map +1 -1
  113. package/payload/platform/lib/task-secrets/src/__tests__/redact-secrets.test.ts +1 -1
  114. package/payload/platform/lib/task-secrets/src/index.ts +1 -1
  115. package/payload/platform/neo4j/edge-annotations.json +9 -9
  116. package/payload/platform/neo4j/schema.cypher +32 -33
  117. package/payload/platform/package.json +2 -2
  118. package/payload/platform/plugins/admin/PLUGIN.md +0 -2
  119. package/payload/platform/plugins/admin/hooks/__tests__/archive-ingest-surface-gate.test.sh +4 -4
  120. package/payload/platform/plugins/admin/hooks/__tests__/playwright-file-guard.test.sh +1 -1
  121. package/payload/platform/plugins/admin/hooks/__tests__/pre-tool-use-base64-guard.test.sh +1 -1
  122. package/payload/platform/plugins/admin/hooks/archive-ingest-surface-gate.sh +13 -13
  123. package/payload/platform/plugins/admin/hooks/pre-tool-use.sh +7 -7
  124. package/payload/platform/plugins/admin/mcp/dist/__tests__/plugin-read-skill-resolution.test.js +2 -2
  125. package/payload/platform/plugins/admin/mcp/dist/__tests__/plugin-read-skill-resolution.test.js.map +1 -1
  126. package/payload/platform/plugins/admin/mcp/dist/__tests__/public-hostname.test.js +1 -1
  127. package/payload/platform/plugins/admin/mcp/dist/__tests__/public-hostname.test.js.map +1 -1
  128. package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load-required-inputs.test.js +2 -2
  129. package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load-required-inputs.test.js.map +1 -1
  130. package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load.test.js +1 -1
  131. package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load.test.js.map +1 -1
  132. package/payload/platform/plugins/admin/mcp/dist/index.js +38 -65
  133. package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
  134. package/payload/platform/plugins/admin/mcp/dist/lib/neo4j.js +2 -2
  135. package/payload/platform/plugins/admin/mcp/dist/lib/neo4j.js.map +1 -1
  136. package/payload/platform/plugins/admin/mcp/dist/lib/public-hostname.js +2 -2
  137. package/payload/platform/plugins/admin/mcp/dist/lib/public-hostname.js.map +1 -1
  138. package/payload/platform/plugins/admin/mcp/dist/skill-resolution.js +5 -5
  139. package/payload/platform/plugins/admin/mcp/dist/skill-resolution.js.map +1 -1
  140. package/payload/platform/plugins/admin/skills/plugin-management/SKILL.md +1 -1
  141. package/payload/platform/plugins/admin/skills/public-agent-manager/SKILL.md +0 -1
  142. package/payload/platform/plugins/admin/skills/publish-site/SKILL.md +1 -1
  143. package/payload/platform/plugins/admin/skills/unzip-attachment/SKILL.md +2 -2
  144. package/payload/platform/plugins/cloudflare/mcp/dist/index.js +1 -1
  145. package/payload/platform/plugins/cloudflare/mcp/dist/index.js.map +1 -1
  146. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.d.ts +1 -1
  147. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.js +6 -6
  148. package/payload/platform/plugins/cloudflare/mcp/dist/lib/cloudflared.js.map +1 -1
  149. package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.d.ts +2 -2
  150. package/payload/platform/plugins/cloudflare/mcp/dist/lib/setup-orchestrator.js +2 -2
  151. package/payload/platform/plugins/cloudflare/references/dashboard-guide.md +1 -1
  152. package/payload/platform/plugins/cloudflare/references/manual-setup.md +4 -4
  153. package/payload/platform/plugins/cloudflare/scripts/__tests__/tunnel-ingress.test.ts +1 -1
  154. package/payload/platform/plugins/cloudflare/scripts/_stream-log.sh +8 -8
  155. package/payload/platform/plugins/cloudflare/scripts/list-cf-domains.sh +2 -2
  156. package/payload/platform/plugins/cloudflare/scripts/list-cf-domains.ts +16 -16
  157. package/payload/platform/plugins/cloudflare/scripts/reset-tunnel.sh +1 -1
  158. package/payload/platform/plugins/cloudflare/scripts/setup-tunnel.sh +28 -28
  159. package/payload/platform/plugins/cloudflare/scripts/tunnel-ingress.ts +5 -5
  160. package/payload/platform/plugins/cloudflare/skills/setup-tunnel/SKILL.md +3 -3
  161. package/payload/platform/plugins/contacts/mcp/dist/lib/neo4j.js +2 -2
  162. package/payload/platform/plugins/contacts/mcp/dist/lib/neo4j.js.map +1 -1
  163. package/payload/platform/plugins/contacts/mcp/dist/lib/resolve-person.d.ts +1 -1
  164. package/payload/platform/plugins/contacts/mcp/dist/lib/resolve-person.js +1 -1
  165. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-create.js +2 -2
  166. package/payload/platform/plugins/contacts/mcp/dist/tools/contact-create.js.map +1 -1
  167. package/payload/platform/plugins/contacts/mcp/dist/tools/group-create.js +1 -1
  168. package/payload/platform/plugins/contacts/mcp/dist/tools/group-create.js.map +1 -1
  169. package/payload/platform/plugins/docs/references/deployment.md +30 -1
  170. package/payload/platform/plugins/docs/references/platform.md +1 -1
  171. package/payload/platform/plugins/docs/references/plugins-guide.md +2 -5
  172. package/payload/platform/plugins/docs/references/troubleshooting.md +3 -3
  173. package/payload/platform/plugins/email/mcp/dist/index.js +1 -1
  174. package/payload/platform/plugins/email/mcp/dist/index.js.map +1 -1
  175. package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js +2 -2
  176. package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js.map +1 -1
  177. package/payload/platform/plugins/email/mcp/dist/lib/credentials.d.ts +1 -1
  178. package/payload/platform/plugins/email/mcp/dist/lib/credentials.js +1 -1
  179. package/payload/platform/plugins/email/mcp/dist/lib/neo4j.js +2 -2
  180. package/payload/platform/plugins/email/mcp/dist/lib/neo4j.js.map +1 -1
  181. package/payload/platform/plugins/email/mcp/dist/lib/screening.d.ts +1 -1
  182. package/payload/platform/plugins/email/mcp/dist/lib/screening.js +1 -1
  183. package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js +6 -6
  184. package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js.map +1 -1
  185. package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.d.ts +1 -1
  186. package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.js +2 -2
  187. package/payload/platform/plugins/email/mcp/dist/scripts/email-fetch.js.map +1 -1
  188. package/payload/platform/plugins/email/references/email-reference.md +2 -2
  189. package/payload/platform/plugins/loop/mcp/dist/lib/neo4j.js +3 -3
  190. package/payload/platform/plugins/loop/mcp/dist/lib/neo4j.js.map +1 -1
  191. package/payload/platform/plugins/loop/mcp/src/lib/neo4j.ts +3 -3
  192. package/payload/platform/plugins/memory/bin/conversation-archive-ingest.mjs +24 -24
  193. package/payload/platform/plugins/memory/bin/conversation-archive-ingest.sh +6 -6
  194. package/payload/platform/plugins/memory/mcp/dist/index.js +8 -8
  195. package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
  196. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js +33 -33
  197. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js.map +1 -1
  198. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.js +12 -12
  199. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.js.map +1 -1
  200. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js +3 -3
  201. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js.map +1 -1
  202. package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/types.js +2 -2
  203. package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/types.js.map +1 -1
  204. package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/whatsapp-text.d.ts.map +1 -1
  205. package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/whatsapp-text.js +1 -1
  206. package/payload/platform/plugins/memory/mcp/dist/lib/conversation-normalisers/whatsapp-text.js.map +1 -1
  207. package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/derive-keys.d.ts.map +1 -1
  208. package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/derive-keys.js +1 -2
  209. package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/derive-keys.js.map +1 -1
  210. package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/sender-bind.js +2 -2
  211. package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/sender-bind.js.map +1 -1
  212. package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/to-turn-text.js +1 -1
  213. package/payload/platform/plugins/memory/mcp/dist/lib/conversation-pipeline/to-turn-text.js.map +1 -1
  214. package/payload/platform/plugins/memory/mcp/dist/lib/document-chunker.d.ts +2 -2
  215. package/payload/platform/plugins/memory/mcp/dist/lib/document-chunker.js +2 -2
  216. package/payload/platform/plugins/memory/mcp/dist/lib/document-hierarchy.js +6 -6
  217. package/payload/platform/plugins/memory/mcp/dist/lib/document-hierarchy.js.map +1 -1
  218. package/payload/platform/plugins/memory/mcp/dist/lib/graph-prune.d.ts +1 -1
  219. package/payload/platform/plugins/memory/mcp/dist/lib/graph-prune.js +1 -1
  220. package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.d.ts +2 -2
  221. package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.js +7 -7
  222. package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.js.map +1 -1
  223. package/payload/platform/plugins/memory/mcp/dist/lib/live-schema-source.d.ts +2 -2
  224. package/payload/platform/plugins/memory/mcp/dist/lib/live-schema-source.js +2 -2
  225. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts +9 -9
  226. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.d.ts.map +1 -1
  227. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js +25 -25
  228. package/payload/platform/plugins/memory/mcp/dist/lib/llm-classifier.js.map +1 -1
  229. package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.d.ts +1 -1
  230. package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js +5 -5
  231. package/payload/platform/plugins/memory/mcp/dist/lib/llm-ranker.js.map +1 -1
  232. package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.js +2 -2
  233. package/payload/platform/plugins/memory/mcp/dist/lib/neo4j.js.map +1 -1
  234. package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.d.ts +4 -4
  235. package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.js +3 -3
  236. package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.js.map +1 -1
  237. package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.d.ts +3 -3
  238. package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.js +5 -5
  239. package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.js.map +1 -1
  240. package/payload/platform/plugins/memory/mcp/dist/lib/uuid.js +1 -1
  241. package/payload/platform/plugins/memory/mcp/dist/lib/uuid.js.map +1 -1
  242. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights.test.js +5 -5
  243. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights.test.js.map +1 -1
  244. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-enrich-rejection.test.js +1 -1
  245. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-enrich-rejection.test.js.map +1 -1
  246. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-source-agnosticism.test.js +2 -2
  247. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-source-agnosticism.test.js.map +1 -1
  248. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-whatsapp-text.test.js +4 -4
  249. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-normalisers-whatsapp-text.test.js.map +1 -1
  250. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.js +6 -6
  251. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.js.map +1 -1
  252. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest.test.js +7 -7
  253. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest.test.js.map +1 -1
  254. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-not-applicable.test.js +2 -2
  255. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-not-applicable.test.js.map +1 -1
  256. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-open.test.js +3 -3
  257. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-open.test.js.map +1 -1
  258. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.d.ts +1 -1
  259. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.js +3 -3
  260. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.js.map +1 -1
  261. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-enrich-rejection.d.ts +1 -1
  262. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-enrich-rejection.js +1 -1
  263. package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.js +2 -2
  264. package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.js.map +1 -1
  265. package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.d.ts +1 -1
  266. package/payload/platform/plugins/memory/mcp/dist/tools/memory-classify.js +1 -1
  267. package/payload/platform/plugins/memory/mcp/dist/tools/memory-delete.d.ts +2 -2
  268. package/payload/platform/plugins/memory/mcp/dist/tools/memory-delete.js +1 -1
  269. package/payload/platform/plugins/memory/mcp/dist/tools/memory-delete.js.map +1 -1
  270. package/payload/platform/plugins/memory/mcp/dist/tools/memory-find-candidates.d.ts +3 -3
  271. package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest-extract.js +2 -2
  272. package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest-extract.js.map +1 -1
  273. package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.d.ts +9 -9
  274. package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.d.ts.map +1 -1
  275. package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.js +10 -11
  276. package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.js.map +1 -1
  277. package/payload/platform/plugins/memory/mcp/dist/tools/memory-list-attachments.js +1 -1
  278. package/payload/platform/plugins/memory/mcp/dist/tools/memory-list-attachments.js.map +1 -1
  279. package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.js +1 -1
  280. package/payload/platform/plugins/memory/mcp/dist/tools/memory-search.js.map +1 -1
  281. package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.js +1 -1
  282. package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.js.map +1 -1
  283. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts +1 -1
  284. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +3 -3
  285. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -1
  286. package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js +9 -9
  287. package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js.map +1 -1
  288. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts +5 -5
  289. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js +9 -9
  290. package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js.map +1 -1
  291. package/payload/platform/plugins/memory/mcp/scripts/boot-smoke.sh +1 -1
  292. package/payload/platform/plugins/memory/mcp/scripts/graph/fixture.cypher +1 -1
  293. package/payload/platform/plugins/memory/mcp/vitest.config.ts +2 -2
  294. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js +1 -1
  295. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js.map +1 -1
  296. package/payload/platform/plugins/outlook/mcp/scripts/verify-doc-impl.sh +1 -1
  297. package/payload/platform/plugins/scheduling/PLUGIN.md +1 -1
  298. package/payload/platform/plugins/scheduling/mcp/dist/__tests__/time-resolve-description.test.js +1 -1
  299. package/payload/platform/plugins/scheduling/mcp/dist/__tests__/time-resolve-description.test.js.map +1 -1
  300. package/payload/platform/plugins/scheduling/mcp/dist/index.js +1 -1
  301. package/payload/platform/plugins/scheduling/mcp/dist/index.js.map +1 -1
  302. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/getUserTimezone.test.js +3 -3
  303. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/getUserTimezone.test.js.map +1 -1
  304. package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.d.ts +2 -2
  305. package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.js +5 -5
  306. package/payload/platform/plugins/scheduling/mcp/dist/lib/neo4j.js.map +1 -1
  307. package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.d.ts +1 -1
  308. package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js +6 -6
  309. package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js.map +1 -1
  310. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.js +1 -1
  311. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.js.map +1 -1
  312. package/payload/platform/plugins/tasks/mcp/dist/index.js +1 -1
  313. package/payload/platform/plugins/tasks/mcp/dist/index.js.map +1 -1
  314. package/payload/platform/plugins/tasks/mcp/dist/lib/neo4j.js +2 -2
  315. package/payload/platform/plugins/tasks/mcp/dist/lib/neo4j.js.map +1 -1
  316. package/payload/platform/plugins/tasks/mcp/dist/tools/project-create.js +2 -2
  317. package/payload/platform/plugins/tasks/mcp/dist/tools/project-create.js.map +1 -1
  318. package/payload/platform/plugins/tasks/mcp/dist/tools/session-name.d.ts +1 -1
  319. package/payload/platform/plugins/tasks/mcp/dist/tools/session-name.d.ts.map +1 -1
  320. package/payload/platform/plugins/tasks/mcp/dist/tools/task-create.d.ts +5 -5
  321. package/payload/platform/plugins/tasks/mcp/dist/tools/task-create.js +3 -3
  322. package/payload/platform/plugins/tasks/mcp/dist/tools/task-create.js.map +1 -1
  323. package/payload/platform/plugins/tasks/mcp/dist/tools/task-update.d.ts +4 -4
  324. package/payload/platform/plugins/tasks/mcp/dist/tools/task-update.js +2 -2
  325. package/payload/platform/plugins/tasks/mcp/dist/tools/task-update.js.map +1 -1
  326. package/payload/platform/plugins/telegram/mcp/dist/tools/message-history.js +2 -2
  327. package/payload/platform/plugins/telegram/mcp/dist/tools/message-history.js.map +1 -1
  328. package/payload/platform/plugins/waitlist/mcp/dist/lib/neo4j.js +2 -2
  329. package/payload/platform/plugins/waitlist/mcp/dist/lib/neo4j.js.map +1 -1
  330. package/payload/platform/plugins/waitlist/mcp/dist/tools/__tests__/waitlist-persist.test.js +3 -3
  331. package/payload/platform/plugins/waitlist/mcp/dist/tools/__tests__/waitlist-persist.test.js.map +1 -1
  332. package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-persist.d.ts +1 -1
  333. package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-persist.js +3 -3
  334. package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-persist.js.map +1 -1
  335. package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-setup.js +5 -5
  336. package/payload/platform/plugins/waitlist/mcp/dist/tools/waitlist-setup.js.map +1 -1
  337. package/payload/platform/plugins/whatsapp/mcp/dist/call-api.d.ts +1 -1
  338. package/payload/platform/plugins/whatsapp/mcp/dist/call-api.js +1 -1
  339. package/payload/platform/plugins/workflows/mcp/dist/index.js +1 -1
  340. package/payload/platform/plugins/workflows/mcp/dist/index.js.map +1 -1
  341. package/payload/platform/plugins/workflows/mcp/dist/lib/active-runs.d.ts +1 -1
  342. package/payload/platform/plugins/workflows/mcp/dist/lib/active-runs.js +1 -1
  343. package/payload/platform/plugins/workflows/mcp/dist/lib/llm-call.d.ts +1 -1
  344. package/payload/platform/plugins/workflows/mcp/dist/lib/neo4j.js +2 -2
  345. package/payload/platform/plugins/workflows/mcp/dist/lib/neo4j.js.map +1 -1
  346. package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-create.js +1 -1
  347. package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-create.js.map +1 -1
  348. package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-execute.js +4 -4
  349. package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-execute.js.map +1 -1
  350. package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-update.js +1 -1
  351. package/payload/platform/plugins/workflows/mcp/dist/tools/workflow-update.js.map +1 -1
  352. package/payload/platform/plugins/workflows/mcp/test-workflows.sh +2 -2
  353. package/payload/platform/scripts/__tests__/first-token-creates-stream-log.test.sh +1 -1
  354. package/payload/platform/scripts/__tests__/logs-read-prefix.sh +6 -6
  355. package/payload/platform/scripts/admin-conversation-recover.mjs +5 -5
  356. package/payload/platform/scripts/admin-persist-audit.ts +4 -4
  357. package/payload/platform/scripts/check-no-conversation-id-leaks.mjs +1 -1
  358. package/payload/platform/scripts/check-no-direct-clipboard.mjs +1 -1
  359. package/payload/platform/scripts/check-no-task-id-leaks.mjs +2 -2
  360. package/payload/platform/scripts/check-skill-load-coverage.mjs +1 -1
  361. package/payload/platform/scripts/component-knowledgedoc-backfill.ts +1 -1
  362. package/payload/platform/scripts/dedupe-userprofile-ghosts.sh +2 -2
  363. package/payload/platform/scripts/generate-entitlement-fixture.mjs +1 -1
  364. package/payload/platform/scripts/installer-device-verify.sh +6 -6
  365. package/payload/platform/scripts/lib/resolve-account-dir.sh +6 -6
  366. package/payload/platform/scripts/log-adherence-check.sh +3 -3
  367. package/payload/platform/scripts/logs-read.sh +13 -13
  368. package/payload/platform/scripts/logs-read.test.sh +1 -1
  369. package/payload/platform/scripts/migrate-import.sh +4 -4
  370. package/payload/platform/scripts/redact-install-logs.sh +1 -1
  371. package/payload/platform/scripts/seed-neo4j.sh +26 -32
  372. package/payload/platform/scripts/test-laptop-vnc-boot.sh +3 -3
  373. package/payload/platform/scripts/verify-skill-tool-surface.sh +17 -2
  374. package/payload/platform/scripts/vnc.sh +9 -9
  375. package/payload/platform/services/claude-session-manager/dist/config.d.ts +7 -2
  376. package/payload/platform/services/claude-session-manager/dist/config.d.ts.map +1 -1
  377. package/payload/platform/services/claude-session-manager/dist/config.js +3 -1
  378. package/payload/platform/services/claude-session-manager/dist/config.js.map +1 -1
  379. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts +2 -2
  380. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  381. package/payload/platform/services/claude-session-manager/dist/http-server.js +145 -90
  382. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  383. package/payload/platform/services/claude-session-manager/dist/index.js +17 -4
  384. package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
  385. package/payload/platform/services/claude-session-manager/dist/jsonl-enumerator.d.ts +2 -2
  386. package/payload/platform/services/claude-session-manager/dist/jsonl-enumerator.d.ts.map +1 -1
  387. package/payload/platform/services/claude-session-manager/dist/jsonl-enumerator.js +4 -4
  388. package/payload/platform/services/claude-session-manager/dist/jsonl-enumerator.js.map +1 -1
  389. package/payload/platform/services/claude-session-manager/dist/jsonl-observer.d.ts.map +1 -1
  390. package/payload/platform/services/claude-session-manager/dist/jsonl-observer.js +39 -10
  391. package/payload/platform/services/claude-session-manager/dist/jsonl-observer.js.map +1 -1
  392. package/payload/platform/services/claude-session-manager/dist/jsonl-path.js +2 -2
  393. package/payload/platform/services/claude-session-manager/dist/jsonl-path.js.map +1 -1
  394. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +37 -18
  395. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  396. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +176 -49
  397. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  398. package/payload/platform/services/claude-session-manager/dist/public-tool-audit.js +1 -1
  399. package/payload/platform/services/claude-session-manager/dist/public-tool-audit.js.map +1 -1
  400. package/payload/platform/services/claude-session-manager/dist/session-store.d.ts +36 -11
  401. package/payload/platform/services/claude-session-manager/dist/session-store.d.ts.map +1 -1
  402. package/payload/platform/services/claude-session-manager/dist/session-store.js +53 -2
  403. package/payload/platform/services/claude-session-manager/dist/session-store.js.map +1 -1
  404. package/payload/platform/services/claude-session-manager/dist/spawn-rate-limiter.js +2 -2
  405. package/payload/platform/services/claude-session-manager/dist/spawn-rate-limiter.js.map +1 -1
  406. package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts +46 -1
  407. package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts.map +1 -1
  408. package/payload/platform/services/claude-session-manager/dist/system-prompt.js +131 -24
  409. package/payload/platform/services/claude-session-manager/dist/system-prompt.js.map +1 -1
  410. package/payload/platform/services/claude-session-manager/dist/tool-surface.js +1 -1
  411. package/payload/platform/services/claude-session-manager/dist/tool-surface.js.map +1 -1
  412. package/payload/platform/services/claude-session-manager/dist/types.d.ts +8 -1
  413. package/payload/platform/services/claude-session-manager/dist/types.d.ts.map +1 -1
  414. package/payload/platform/services/claude-session-manager/dist/url-capture.js +1 -1
  415. package/payload/platform/services/claude-session-manager/dist/url-capture.js.map +1 -1
  416. package/payload/platform/templates/agents/admin/IDENTITY.md +14 -0
  417. package/payload/platform/templates/agents/admin/SOUL.md +1 -3
  418. package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -3
  419. package/payload/platform/templates/specialists/agents/project-manager.md +1 -1
  420. package/payload/platform/templates/systemd/edge.service.template +3 -3
  421. package/payload/premium-plugins/real-agent/BUNDLE.md +2 -4
  422. package/payload/premium-plugins/real-agent/plugins/.claude-plugin/marketplace.json +0 -5
  423. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/neo4j.js +3 -3
  424. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/neo4j.js.map +1 -1
  425. package/payload/premium-plugins/real-agent/plugins/loop/mcp/src/lib/neo4j.ts +3 -3
  426. package/payload/server/{chunk-ZGJ6CUU2.js → chunk-3G6JMV7N.js} +1 -1
  427. package/payload/server/{chunk-KVGTWNKQ.js → chunk-NNHHGQJL.js} +314 -5
  428. package/payload/server/{chunk-RZQMYJVY.js → chunk-QC5LHYPH.js} +3 -3
  429. package/payload/server/{cloudflare-task-tracker-4PKOLE4H.js → cloudflare-task-tracker-NEB3X6O2.js} +2 -2
  430. package/payload/server/maxy-edge.js +2 -2
  431. package/payload/server/public/assets/{Checkbox-C6zXApx_.js → Checkbox-8mOR8-gV.js} +1 -1
  432. package/payload/server/public/assets/{admin-Cuu1QdAA.js → admin-CK4V-B9A.js} +24 -24
  433. package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-BYXgFii5.js → architectureDiagram-Q4EWVU46-2DgPtOot.js} +1 -1
  434. package/payload/server/public/assets/{blockDiagram-DXYQGD6D-GIQ0eO13.js → blockDiagram-DXYQGD6D-BilycXVZ.js} +1 -1
  435. package/payload/server/public/assets/{brand-DdhkC994.css → brand-1_DraUIv.css} +1 -1
  436. package/payload/server/public/assets/{c4Diagram-AHTNJAMY-BmyWfG-l.js → c4Diagram-AHTNJAMY-CGiIFO5U.js} +1 -1
  437. package/payload/server/public/assets/channel-DYpIZW3Q.js +1 -0
  438. package/payload/server/public/assets/{chunk-336JU56O-DcWl0MQo.js → chunk-336JU56O-DxTg1h50.js} +2 -2
  439. package/payload/server/public/assets/{chunk-426QAEUC-BIW6kq6y.js → chunk-426QAEUC-DkGPjs0P.js} +1 -1
  440. package/payload/server/public/assets/{chunk-4TB4RGXK-CdoHpV4X.js → chunk-4TB4RGXK-D2JaxD6r.js} +1 -1
  441. package/payload/server/public/assets/{chunk-5FUZZQ4R-bn_a4sfU.js → chunk-5FUZZQ4R-Do3pbAGo.js} +1 -1
  442. package/payload/server/public/assets/{chunk-5PVQY5BW-C_Rq8j_M.js → chunk-5PVQY5BW-np5moZSl.js} +1 -1
  443. package/payload/server/public/assets/{chunk-EDXVE4YY-CWQvoVKV.js → chunk-EDXVE4YY-BUFLWwRP.js} +1 -1
  444. package/payload/server/public/assets/{chunk-ENJZ2VHE-DBHn1kSk.js → chunk-ENJZ2VHE-BE7Gt41s.js} +1 -1
  445. package/payload/server/public/assets/{chunk-ICPOFSXX-SW2Qx11O.js → chunk-ICPOFSXX-gOBkROMP.js} +1 -1
  446. package/payload/server/public/assets/{chunk-OYMX7WX6-BvIG7tVW.js → chunk-OYMX7WX6-DR-BkNZa.js} +1 -1
  447. package/payload/server/public/assets/{chunk-U2HBQHQK-BiBUb0cF.js → chunk-U2HBQHQK-qLp-uSVE.js} +1 -1
  448. package/payload/server/public/assets/{chunk-X2U36JSP-Y0MKZCCh.js → chunk-X2U36JSP-DQiKti0J.js} +1 -1
  449. package/payload/server/public/assets/{chunk-YZCP3GAM-DKPh06GH.js → chunk-YZCP3GAM-Cd0JhpTo.js} +1 -1
  450. package/payload/server/public/assets/{chunk-ZZ45TVLE-C2WNo-fK.js → chunk-ZZ45TVLE-8u01H3Hy.js} +1 -1
  451. package/payload/server/public/assets/classDiagram-6PBFFD2Q-nkfy9gg7.js +1 -0
  452. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-B-pMmeCC.js +1 -0
  453. package/payload/server/public/assets/clone-jiTzIER6.js +1 -0
  454. package/payload/server/public/assets/{dagre-CrK8E9ee.js → dagre-BfVsOYOv.js} +1 -1
  455. package/payload/server/public/assets/{dagre-KV5264BT-_o6uXcH8.js → dagre-KV5264BT-BBF_zxbi.js} +1 -1
  456. package/payload/server/public/assets/data-BIOaDoqe.js +1 -0
  457. package/payload/server/public/assets/{device-url-actions-BcHerWqJ.js → device-url-actions-CJBD3ecO.js} +1 -1
  458. package/payload/server/public/assets/{diagram-5BDNPKRD-FFP9DKhc.js → diagram-5BDNPKRD-BFHk2a7t.js} +1 -1
  459. package/payload/server/public/assets/{diagram-G4DWMVQ6-DpwD1jBP.js → diagram-G4DWMVQ6-Be3_qYl2.js} +1 -1
  460. package/payload/server/public/assets/{diagram-MMDJMWI5-C3K5agdK.js → diagram-MMDJMWI5-B3r4XVcu.js} +1 -1
  461. package/payload/server/public/assets/{diagram-TYMM5635-CbeDipbC.js → diagram-TYMM5635-BW5EIT4D.js} +1 -1
  462. package/payload/server/public/assets/{erDiagram-SMLLAGMA-XBIFndNy.js → erDiagram-SMLLAGMA-DTu4_1Kb.js} +1 -1
  463. package/payload/server/public/assets/{flowDiagram-DWJPFMVM-BvEgySyn.js → flowDiagram-DWJPFMVM-CadrjLcA.js} +1 -1
  464. package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-D7gIRKJf.js → ganttDiagram-T4ZO3ILL-Cn0npD0L.js} +1 -1
  465. package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-vJu_hcri.js → gitGraphDiagram-UUTBAWPF-CK3gG5Qm.js} +1 -1
  466. package/payload/server/public/assets/graph-ClfU7t1k.js +1 -0
  467. package/payload/server/public/assets/graph-labels-CPzF6Gbk.js +1 -0
  468. package/payload/server/public/assets/{graphlib-Dp0mN6JW.js → graphlib-DFIOO59N.js} +1 -1
  469. package/payload/server/public/assets/{infoDiagram-42DDH7IO-g4Dlc5Cr.js → infoDiagram-42DDH7IO-BohUsXnN.js} +1 -1
  470. package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-D_45LXOe.js → ishikawaDiagram-UXIWVN3A-tjmA4BU8.js} +1 -1
  471. package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-CggbHl6N.js → journeyDiagram-VCZTEJTY-DzBlFESM.js} +1 -1
  472. package/payload/server/public/assets/{kanban-definition-6JOO6SKY-CysAe-Ab.js → kanban-definition-6JOO6SKY-BTw9BxK8.js} +1 -1
  473. package/payload/server/public/assets/{line-BAxq_DSY.js → line-BYPL6wAj.js} +1 -1
  474. package/payload/server/public/assets/{mermaid-parser.core-DbFuvkjL.js → mermaid-parser.core-Dmu4fWCS.js} +1 -1
  475. package/payload/server/public/assets/{mermaid.core-CehvJn5b.js → mermaid.core-Z9vvieC2.js} +3 -3
  476. package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-DbPbBJ9h.js → mindmap-definition-QFDTVHPH-BccAnfJ4.js} +1 -1
  477. package/payload/server/public/assets/page-CBTlFm3b.js +1 -0
  478. package/payload/server/public/assets/{page-Co7KCRV8.js → page-CDrsNrDO.js} +1 -1
  479. package/payload/server/public/assets/{pieDiagram-DEJITSTG-cagLL9ng.js → pieDiagram-DEJITSTG-CZwxH1nJ.js} +1 -1
  480. package/payload/server/public/assets/{public-B6TEcDLx.js → public-MKWxjwiF.js} +3 -3
  481. package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-Keaa1jDh.js → quadrantDiagram-34T5L4WZ-BWT4DItX.js} +1 -1
  482. package/payload/server/public/assets/{requirementDiagram-MS252O5E-BcYRyn5z.js → requirementDiagram-MS252O5E-CHYkWUEy.js} +1 -1
  483. package/payload/server/public/assets/{sankeyDiagram-XADWPNL6--fKoG9NR.js → sankeyDiagram-XADWPNL6-km7p45Ng.js} +1 -1
  484. package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-lKG36-Di.js → sequenceDiagram-FGHM5R23-BT1C0Dw-.js} +1 -1
  485. package/payload/server/public/assets/{stateDiagram-FHFEXIEX-BuVsrlig.js → stateDiagram-FHFEXIEX-hibC19DY.js} +1 -1
  486. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-MuJZxjmU.js +1 -0
  487. package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-D6X6uq17.js → timeline-definition-GMOUNBTQ-Cnm86NfE.js} +1 -1
  488. package/payload/server/public/assets/{vennDiagram-DHZGUBPP-BgvcfRVf.js → vennDiagram-DHZGUBPP-ByjQPLzS.js} +1 -1
  489. package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-Cpd1xsrt.js → wardleyDiagram-NUSXRM2D-CMVrWw7l.js} +1 -1
  490. package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-CDF5ZVFv.js → xychartDiagram-5P7HB3ND-Mpc1u3FV.js} +1 -1
  491. package/payload/server/public/data.html +5 -5
  492. package/payload/server/public/graph.html +6 -6
  493. package/payload/server/public/index.html +8 -8
  494. package/payload/server/public/public.html +5 -5
  495. package/payload/server/server.js +288 -412
  496. package/payload/docs/desktop-code-controls.md +0 -63
  497. package/payload/platform/plugins/anthropic/.claude-plugin/plugin.json +0 -8
  498. package/payload/platform/plugins/anthropic/PLUGIN.md +0 -40
  499. package/payload/platform/plugins/anthropic/references/console-api.md +0 -186
  500. package/payload/platform/plugins/anthropic/references/setup-guide.md +0 -36
  501. package/payload/platform/plugins/anthropic/skills/get-api-key/SKILL.md +0 -136
  502. package/payload/platform/plugins/estate-onboarding/.claude-plugin/plugin.json +0 -8
  503. package/payload/platform/plugins/estate-onboarding/PLUGIN.md +0 -30
  504. package/payload/platform/plugins/estate-onboarding/skills/bootstrap/SKILL.md +0 -26
  505. package/payload/platform/plugins/estate-onboarding/skills/bootstrap/references/onboarding-flow.md +0 -63
  506. package/payload/premium-plugins/real-agent/plugins/estate-onboarding/.claude-plugin/plugin.json +0 -8
  507. package/payload/premium-plugins/real-agent/plugins/estate-onboarding/PLUGIN.md +0 -30
  508. package/payload/premium-plugins/real-agent/plugins/estate-onboarding/skills/bootstrap/SKILL.md +0 -26
  509. package/payload/premium-plugins/real-agent/plugins/estate-onboarding/skills/bootstrap/references/onboarding-flow.md +0 -63
  510. package/payload/server/public/assets/channel-C76knBRO.js +0 -1
  511. package/payload/server/public/assets/classDiagram-6PBFFD2Q-Bohexn7P.js +0 -1
  512. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DVsmsAu7.js +0 -1
  513. package/payload/server/public/assets/clone-DUrXF4sO.js +0 -1
  514. package/payload/server/public/assets/data-j1WNhF8t.js +0 -1
  515. package/payload/server/public/assets/graph-C_f_9L_7.js +0 -1
  516. package/payload/server/public/assets/graph-labels-BSQJHlgf.js +0 -1
  517. package/payload/server/public/assets/page-B0BPrSE3.js +0 -1
  518. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-DSt88_xL.js +0 -1
  519. /package/payload/server/public/assets/{brand-B-bNrpwc.js → brand-CENN2zdq.js} +0 -0
@@ -60,7 +60,7 @@ import {
60
60
  vncLog,
61
61
  waitForExit,
62
62
  walkPremiumBundles
63
- } from "./chunk-ZGJ6CUU2.js";
63
+ } from "./chunk-3G6JMV7N.js";
64
64
  import {
65
65
  CLOUDFLARE_TASK_DIAGNOSTICS,
66
66
  appendCloudflareSteps,
@@ -69,7 +69,7 @@ import {
69
69
  openCloudflareTask,
70
70
  readTunnelState,
71
71
  resolveUnitGoneVerdict
72
- } from "./chunk-RZQMYJVY.js";
72
+ } from "./chunk-QC5LHYPH.js";
73
73
  import {
74
74
  GREETING_DIRECTIVE,
75
75
  HAIKU_MODEL,
@@ -85,6 +85,7 @@ import {
85
85
  getUserTimezone,
86
86
  listAdminSessions,
87
87
  loadAdminUserName,
88
+ loadUserProfile,
88
89
  persistMessage,
89
90
  projectAgent,
90
91
  renameConversation,
@@ -92,35 +93,14 @@ import {
92
93
  verifyAndGetConversationUpdatedAt,
93
94
  verifyConversationOwnership,
94
95
  writeAdminUserAndPerson
95
- } from "./chunk-KVGTWNKQ.js";
96
+ } from "./chunk-NNHHGQJL.js";
96
97
  import {
97
98
  __commonJS,
98
99
  __toESM
99
100
  } from "./chunk-JSBRDJBE.js";
100
101
 
101
- // ../lib/models/dist/index.js
102
- var require_dist = __commonJS({
103
- "../lib/models/dist/index.js"(exports) {
104
- "use strict";
105
- Object.defineProperty(exports, "__esModule", { value: true });
106
- exports.MODEL_CONTEXT_WINDOW = exports.HAIKU_MODEL = exports.SONNET_MODEL = exports.OPUS_MODEL = void 0;
107
- exports.contextWindow = contextWindow;
108
- exports.OPUS_MODEL = "claude-opus-4-7";
109
- exports.SONNET_MODEL = "claude-sonnet-4-6";
110
- exports.HAIKU_MODEL = "claude-haiku-4-5";
111
- exports.MODEL_CONTEXT_WINDOW = {
112
- [exports.OPUS_MODEL]: 2e5,
113
- [exports.SONNET_MODEL]: 2e5,
114
- [exports.HAIKU_MODEL]: 2e5
115
- };
116
- function contextWindow(model) {
117
- return exports.MODEL_CONTEXT_WINDOW[model] ?? 2e5;
118
- }
119
- }
120
- });
121
-
122
102
  // ../lib/graph-trash/dist/index.js
123
- var require_dist2 = __commonJS({
103
+ var require_dist = __commonJS({
124
104
  "../lib/graph-trash/dist/index.js"(exports) {
125
105
  "use strict";
126
106
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -616,14 +596,14 @@ var serveStatic = (options = { root: "" }) => {
616
596
 
617
597
  // server/index.ts
618
598
  import { readFileSync as readFileSync19, existsSync as existsSync22, watchFile } from "fs";
619
- import { resolve as resolve22, join as join13, basename as basename5 } from "path";
620
- import { homedir as homedir5 } from "os";
599
+ import { resolve as resolve22, join as join12, basename as basename5 } from "path";
600
+ import { homedir as homedir4 } from "os";
621
601
 
622
602
  // app/lib/agent-slug-pattern.ts
623
603
  var AGENT_SLUG_PATTERN = /^\/([a-z][a-z0-9-]{2,49})$/;
624
604
 
625
605
  // server/routes/health.ts
626
- import { existsSync as existsSync4, readFileSync as readFileSync6 } from "fs";
606
+ import { existsSync as existsSync3, readFileSync as readFileSync5 } from "fs";
627
607
  import { createConnection as createConnection2 } from "net";
628
608
 
629
609
  // app/lib/claude-auth.ts
@@ -820,168 +800,6 @@ function getLanIp() {
820
800
  return fallback;
821
801
  }
822
802
 
823
- // ../lib/anthropic-key/src/index.ts
824
- var import_dist = __toESM(require_dist());
825
- import {
826
- existsSync as existsSync2,
827
- mkdirSync,
828
- readFileSync as readFileSync2,
829
- unlinkSync,
830
- writeFileSync as writeFileSync2
831
- } from "fs";
832
- import { resolve, join as join2, dirname } from "path";
833
- import { homedir } from "os";
834
- var cachedKeyFilePath = null;
835
- function resolveKeyFilePath() {
836
- if (cachedKeyFilePath) return cachedKeyFilePath;
837
- let configDirName = ".maxy";
838
- const platformRoot = process.env.PLATFORM_ROOT ?? process.env.MAXY_PLATFORM_ROOT;
839
- if (platformRoot) {
840
- const brandPath = join2(platformRoot, "config", "brand.json");
841
- if (!existsSync2(brandPath)) {
842
- throw new Error(
843
- `brand.json not found at ${brandPath} \u2014 platform not properly installed`
844
- );
845
- }
846
- try {
847
- const brand = JSON.parse(readFileSync2(brandPath, "utf-8"));
848
- if (!brand.configDir) {
849
- throw new Error(
850
- `brand.json at ${brandPath} is missing the configDir field`
851
- );
852
- }
853
- configDirName = brand.configDir;
854
- } catch (err) {
855
- if (err instanceof SyntaxError) {
856
- throw new Error(
857
- `brand.json at ${brandPath} is not valid JSON: ${err.message}`
858
- );
859
- }
860
- throw err;
861
- }
862
- }
863
- cachedKeyFilePath = resolve(homedir(), configDirName, ".anthropic-api-key");
864
- return cachedKeyFilePath;
865
- }
866
- function readKey() {
867
- const envKey = process.env.ANTHROPIC_API_KEY;
868
- if (envKey && envKey.trim()) {
869
- return envKey.trim();
870
- }
871
- let keyFilePath2;
872
- try {
873
- keyFilePath2 = resolveKeyFilePath();
874
- } catch (err) {
875
- const msg = err instanceof Error ? err.message : String(err);
876
- console.error(`[anthropic-key] path resolution failed: ${msg}`);
877
- return null;
878
- }
879
- if (envKey !== void 0) {
880
- console.error(
881
- `[anthropic-key] ANTHROPIC_API_KEY env var is set but empty, falling back to file`
882
- );
883
- }
884
- try {
885
- const raw = readFileSync2(keyFilePath2, "utf-8").trim();
886
- if (!raw) {
887
- console.error(
888
- `[anthropic-key] key file exists but is empty: ${keyFilePath2}`
889
- );
890
- return null;
891
- }
892
- return raw;
893
- } catch (err) {
894
- const code = err instanceof Error && "code" in err ? err.code : void 0;
895
- if (code === "ENOENT") {
896
- console.error(
897
- `[anthropic-key] no key available (env var unset, file not found: ${keyFilePath2})`
898
- );
899
- } else {
900
- const msg = err instanceof Error ? err.message : String(err);
901
- console.error(
902
- `[anthropic-key] failed to read key file ${keyFilePath2}: ${msg}`
903
- );
904
- }
905
- return null;
906
- }
907
- }
908
- async function validateKey(key) {
909
- const effectiveKey = key ?? readKey();
910
- if (!effectiveKey) {
911
- return {
912
- status: "missing",
913
- message: "No API key available (env var unset, file missing or empty)."
914
- };
915
- }
916
- const start = Date.now();
917
- try {
918
- const res = await fetch("https://api.anthropic.com/v1/messages", {
919
- method: "POST",
920
- headers: {
921
- "Content-Type": "application/json",
922
- "x-api-key": effectiveKey,
923
- "anthropic-version": "2023-06-01"
924
- },
925
- body: JSON.stringify({
926
- model: import_dist.HAIKU_MODEL,
927
- max_tokens: 1,
928
- messages: [{ role: "user", content: "hi" }]
929
- }),
930
- signal: AbortSignal.timeout(1e4)
931
- });
932
- const latency = Date.now() - start;
933
- if (res.ok || res.status === 429) {
934
- await res.text();
935
- console.error(
936
- `[anthropic-key] validate: valid (${res.status}, ${latency}ms)`
937
- );
938
- return {
939
- status: "valid",
940
- message: "API key is working. Credits available."
941
- };
942
- }
943
- const body = await res.text();
944
- if (/credit balance|billing|purchase credits/i.test(body)) {
945
- console.error(
946
- `[anthropic-key] validate: billing (${res.status}, ${latency}ms)`
947
- );
948
- return {
949
- status: "billing",
950
- message: "API key is valid but credit balance is too low. The user must add credits at console.anthropic.com under Plans & Billing, or enable auto-top-up."
951
- };
952
- }
953
- if (res.status === 401 || res.status === 403 || /authentication_error|permission_error/i.test(body)) {
954
- console.error(
955
- `[anthropic-key] validate: auth_error (${res.status}, ${latency}ms)`
956
- );
957
- return {
958
- status: "auth_error",
959
- message: "API key was rejected. It may be invalid, revoked, or expired. The user should create a new key at console.anthropic.com/settings/keys."
960
- };
961
- }
962
- console.error(
963
- `[anthropic-key] validate: error (${res.status}, ${latency}ms)`
964
- );
965
- return {
966
- status: "error",
967
- message: `Could not verify API key. Anthropic returned ${res.status}. This may be a temporary outage \u2014 try again later.`
968
- };
969
- } catch (err) {
970
- const latency = Date.now() - start;
971
- const msg = err instanceof Error ? err.message : String(err);
972
- console.error(
973
- `[anthropic-key] validate: error (network failure, ${latency}ms): ${msg}`
974
- );
975
- return {
976
- status: "error",
977
- message: `Could not reach the Anthropic API: ${msg}. Check network connectivity.`
978
- };
979
- }
980
- }
981
- function keyFilePath() {
982
- return resolveKeyFilePath();
983
- }
984
-
985
803
  // app/lib/whatsapp/schema.ts
986
804
  import { z } from "zod";
987
805
  var DmPolicySchema = z.enum(["open", "allowlist", "disabled"]);
@@ -1046,20 +864,20 @@ var WhatsAppConfigSchema = z.object({
1046
864
  });
1047
865
 
1048
866
  // app/lib/whatsapp/config-persist.ts
1049
- import { readFileSync as readFileSync3, writeFileSync as writeFileSync3, existsSync as existsSync3 } from "fs";
1050
- import { resolve as resolve2, join as join3 } from "path";
867
+ import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, existsSync as existsSync2 } from "fs";
868
+ import { resolve, join as join2 } from "path";
1051
869
  var TAG = "[whatsapp:config]";
1052
870
  function configPath(accountDir) {
1053
- return resolve2(accountDir, "account.json");
871
+ return resolve(accountDir, "account.json");
1054
872
  }
1055
873
  function readConfig(accountDir) {
1056
874
  const path2 = configPath(accountDir);
1057
- if (!existsSync3(path2)) throw new Error(`account.json not found at ${path2}`);
1058
- return JSON.parse(readFileSync3(path2, "utf-8"));
875
+ if (!existsSync2(path2)) throw new Error(`account.json not found at ${path2}`);
876
+ return JSON.parse(readFileSync2(path2, "utf-8"));
1059
877
  }
1060
878
  function writeConfig(accountDir, config) {
1061
879
  const path2 = configPath(accountDir);
1062
- writeFileSync3(path2, JSON.stringify(config, null, 2) + "\n", "utf-8");
880
+ writeFileSync2(path2, JSON.stringify(config, null, 2) + "\n", "utf-8");
1063
881
  }
1064
882
  function reloadManagerConfig(accountDir) {
1065
883
  try {
@@ -1229,8 +1047,8 @@ function setPublicAgent(accountDir, slug) {
1229
1047
  if (!trimmed) {
1230
1048
  return { ok: false, error: "Agent slug cannot be empty." };
1231
1049
  }
1232
- const agentConfigPath = join3(accountDir, "agents", trimmed, "config.json");
1233
- if (!existsSync3(agentConfigPath)) {
1050
+ const agentConfigPath = join2(accountDir, "agents", trimmed, "config.json");
1051
+ if (!existsSync2(agentConfigPath)) {
1234
1052
  return { ok: false, error: `Agent "${trimmed}" not found \u2014 no config.json at ${agentConfigPath}. Check the agent slug and try again.` };
1235
1053
  }
1236
1054
  try {
@@ -1293,8 +1111,8 @@ function setGroupPublicAgent(accountDir, accountId, groupJid, slug) {
1293
1111
  if (!trimmedSlug) return { ok: false, error: "Agent slug cannot be empty." };
1294
1112
  if (!trimmedGroup) return { ok: false, error: "Group JID cannot be empty." };
1295
1113
  if (!trimmedAccount) return { ok: false, error: "Account ID cannot be empty." };
1296
- const agentConfigPath = join3(accountDir, "agents", trimmedSlug, "config.json");
1297
- if (!existsSync3(agentConfigPath)) {
1114
+ const agentConfigPath = join2(accountDir, "agents", trimmedSlug, "config.json");
1115
+ if (!existsSync2(agentConfigPath)) {
1298
1116
  return { ok: false, error: `Agent "${trimmedSlug}" not found \u2014 no config.json at ${agentConfigPath}. Check the agent slug and try again.` };
1299
1117
  }
1300
1118
  try {
@@ -2572,8 +2390,8 @@ async function ensureWhatsAppConversation(input) {
2572
2390
  }
2573
2391
 
2574
2392
  // ../lib/account-enumeration/src/index.ts
2575
- import { readdirSync, readFileSync as readFileSync4 } from "fs";
2576
- import { resolve as resolve3 } from "path";
2393
+ import { readdirSync, readFileSync as readFileSync3 } from "fs";
2394
+ import { resolve as resolve2 } from "path";
2577
2395
  var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
2578
2396
  var cache = /* @__PURE__ */ new Map();
2579
2397
  function enumerateValidAccountIds(accountsDir) {
@@ -2592,9 +2410,9 @@ function enumerateValidAccountIds(accountsDir) {
2592
2410
  const valid = [];
2593
2411
  for (const name of names) {
2594
2412
  if (!UUID_RE.test(name)) continue;
2595
- const configPath2 = resolve3(accountsDir, name, "account.json");
2413
+ const configPath2 = resolve2(accountsDir, name, "account.json");
2596
2414
  try {
2597
- JSON.parse(readFileSync4(configPath2, "utf-8"));
2415
+ JSON.parse(readFileSync3(configPath2, "utf-8"));
2598
2416
  valid.push(name);
2599
2417
  } catch (err) {
2600
2418
  const code = err.code;
@@ -2611,7 +2429,7 @@ function getAccountsDirFromEnv() {
2611
2429
  "[graph-write] MAXY_PLATFORM_ROOT not set \u2014 cannot enforce accountId gate. Set MAXY_PLATFORM_ROOT in the spawning process or pass `accountsDir` explicitly."
2612
2430
  );
2613
2431
  }
2614
- return resolve3(root, "..", "data/accounts");
2432
+ return resolve2(root, "..", "data/accounts");
2615
2433
  }
2616
2434
  function validateAccountIdEnv(envValue, diskIds) {
2617
2435
  if (!envValue) {
@@ -2650,7 +2468,7 @@ function resolvePlatformAccountId(accountsDir = ACCOUNTS_DIR) {
2650
2468
  // app/lib/whatsapp/inbound/media.ts
2651
2469
  import { randomUUID as randomUUID2 } from "crypto";
2652
2470
  import { writeFile, mkdir } from "fs/promises";
2653
- import { join as join4 } from "path";
2471
+ import { join as join3 } from "path";
2654
2472
  import {
2655
2473
  downloadMediaMessage,
2656
2474
  downloadContentFromMessage,
@@ -2736,7 +2554,7 @@ async function downloadInboundMedia(msg, sock, opts) {
2736
2554
  await mkdir(MEDIA_DIR, { recursive: true });
2737
2555
  const ext = mimeToExt(mimetype ?? "application/octet-stream");
2738
2556
  const filename = `${randomUUID2()}.${ext}`;
2739
- const filePath = join4(MEDIA_DIR, filename);
2557
+ const filePath = join3(MEDIA_DIR, filename);
2740
2558
  await writeFile(filePath, buffer);
2741
2559
  const sizeKB = (buffer.length / 1024).toFixed(0);
2742
2560
  console.error(`${TAG9} media downloaded type=${mimetype ?? "unknown"} size=${sizeKB}KB path=${filePath}`);
@@ -3817,10 +3635,10 @@ async function handleInboundMessage(conn, msg) {
3817
3635
  // app/lib/vnc.ts
3818
3636
  import { spawnSync, execFileSync } from "child_process";
3819
3637
  import { createConnection } from "net";
3820
- import { mkdirSync as mkdirSync2, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
3821
- import { resolve as resolve4 } from "path";
3822
- var PLATFORM_ROOT2 = process.env.MAXY_PLATFORM_ROOT ?? resolve4(process.cwd(), "..");
3823
- var VNC_SCRIPT = resolve4(PLATFORM_ROOT2, "scripts/vnc.sh");
3638
+ import { mkdirSync, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
3639
+ import { resolve as resolve3 } from "path";
3640
+ var PLATFORM_ROOT2 = process.env.MAXY_PLATFORM_ROOT ?? resolve3(process.cwd(), "..");
3641
+ var VNC_SCRIPT = resolve3(PLATFORM_ROOT2, "scripts/vnc.sh");
3824
3642
  var displayMode = process.env.DISPLAY_MODE ?? "virtual";
3825
3643
  if (displayMode === "native") {
3826
3644
  console.log(`[vnc] DISPLAY_MODE=native \u2014 local requests use desktop display, remote requests use VNC`);
@@ -3875,7 +3693,7 @@ function discoverNativeDisplay() {
3875
3693
  const leaderPid = leaderResult.stdout?.trim();
3876
3694
  if (leaderPid) {
3877
3695
  try {
3878
- const environ = readFileSync5(`/proc/${leaderPid}/environ`, "utf8");
3696
+ const environ = readFileSync4(`/proc/${leaderPid}/environ`, "utf8");
3879
3697
  const match = environ.split("\0").find((e) => e.startsWith("WAYLAND_DISPLAY="));
3880
3698
  if (match) waylandDisplay = match.split("=")[1];
3881
3699
  } catch {
@@ -3930,10 +3748,10 @@ async function waitForPort(port2, timeoutMs = 12e3) {
3930
3748
  return false;
3931
3749
  }
3932
3750
  function ensureLogDir() {
3933
- mkdirSync2(LOG_DIR, { recursive: true });
3751
+ mkdirSync(LOG_DIR, { recursive: true });
3934
3752
  }
3935
3753
  function logPath(name) {
3936
- return resolve4(LOG_DIR, `${name}.log`);
3754
+ return resolve3(LOG_DIR, `${name}.log`);
3937
3755
  }
3938
3756
  async function ensureVnc() {
3939
3757
  const up = await waitForPort(RFB_PORT, 1e3);
@@ -4011,9 +3829,9 @@ function killChromium() {
4011
3829
  spawnSync("pkill", ["-f", "chromium"], { stdio: "pipe" });
4012
3830
  }
4013
3831
  function writeChromiumWrapper() {
4014
- mkdirSync2(BIN_DIR, { recursive: true });
4015
- const wrapperPath = resolve4(BIN_DIR, "chromium");
4016
- writeFileSync4(wrapperPath, `#!/bin/bash
3832
+ mkdirSync(BIN_DIR, { recursive: true });
3833
+ const wrapperPath = resolve3(BIN_DIR, "chromium");
3834
+ writeFileSync3(wrapperPath, `#!/bin/bash
4017
3835
  LOG="${LOG_DIR}/chromium.log"
4018
3836
  echo "==== [$(date)] chromium wrapper ====" >> "$LOG"
4019
3837
  echo " DISPLAY=$DISPLAY WAYLAND=$WAYLAND_DISPLAY XDG_SESSION_TYPE=$XDG_SESSION_TYPE" >> "$LOG"
@@ -4027,13 +3845,13 @@ else
4027
3845
  echo " xdpyinfo ${VNC_DISPLAY} FAILED \u2014 display not ready" >> "$LOG"
4028
3846
  fi
4029
3847
 
4030
- # Task 929 \u2014 read the install-time-resolved non-snap Chromium binary path.
3848
+ # read the install-time-resolved non-snap Chromium binary path.
4031
3849
  # The installer (ensureNonSnapChromium + writeChromiumBinaryPathFile) writes
4032
3850
  # this file with the absolute path to either /usr/bin/chromium (Pi Bookworm:
4033
3851
  # real .deb) or /usr/bin/google-chrome-stable (Ubuntu Noble laptop: snap
4034
3852
  # replaced). Refusing the legacy probe loop closes the silent-fallback path
4035
3853
  # where /snap/bin/chromium would re-introduce the AppArmor SingletonLock
4036
- # denial that triggered Task 929.
3854
+ # denial that triggered.
4037
3855
  PATH_FILE="${PLATFORM_ROOT2}/config/chromium-binary.path"
4038
3856
  if [ ! -r "$PATH_FILE" ]; then
4039
3857
  echo " ERROR: $PATH_FILE missing \u2014 re-run installer" >> "$LOG"
@@ -4055,7 +3873,7 @@ echo " launching $BIN (realpath=$RESOLVED)" >> "$LOG"
4055
3873
 
4056
3874
  # nohup detaches chromium from this wrapper's process group so it outlives
4057
3875
  # claude auth login exiting (e.g. on timeout). --user-data-dir is brand-scoped
4058
- # (Task 553) so a wrapper-spawned chromium attaches to the same per-brand
3876
+ # so a wrapper-spawned chromium attaches to the same per-brand
4059
3877
  # profile that vnc.sh's start_chrome targets \u2014 no shared cookies across brands.
4060
3878
  nohup "$BIN" \\
4061
3879
  --user-data-dir=${CHROMIUM_PROFILE_DIR} \\
@@ -4111,19 +3929,6 @@ function buildX11Env(chromiumWrapperPath, transport = "vnc") {
4111
3929
  }
4112
3930
 
4113
3931
  // server/routes/health.ts
4114
- var cachedApiKeyStatus = null;
4115
- var API_KEY_CACHE_TTL_MS = 5 * 60 * 1e3;
4116
- async function probeApiKey() {
4117
- if (cachedApiKeyStatus) {
4118
- const ttl = cachedApiKeyStatus.status === "valid" ? API_KEY_CACHE_TTL_MS : 3e4;
4119
- if (Date.now() - cachedApiKeyStatus.checkedAt < ttl) {
4120
- return cachedApiKeyStatus.status;
4121
- }
4122
- }
4123
- const result = await validateKey();
4124
- cachedApiKeyStatus = { status: result.status, checkedAt: Date.now() };
4125
- return result.status;
4126
- }
4127
3932
  function checkPort(port2, timeoutMs = 500) {
4128
3933
  return new Promise((resolve23) => {
4129
3934
  const socket = createConnection2(port2, "127.0.0.1");
@@ -4147,8 +3952,8 @@ app.get("/", async (c) => {
4147
3952
  const browserTransport = resolveBrowserTransport(c.req.raw, c.env?.incoming?.socket?.remoteAddress);
4148
3953
  let pinConfigured = false;
4149
3954
  try {
4150
- if (existsSync4(USERS_FILE)) {
4151
- const raw = readFileSync6(USERS_FILE, "utf-8").trim();
3955
+ if (existsSync3(USERS_FILE)) {
3956
+ const raw = readFileSync5(USERS_FILE, "utf-8").trim();
4152
3957
  if (raw) {
4153
3958
  const users = JSON.parse(raw);
4154
3959
  pinConfigured = Array.isArray(users) && users.length > 0;
@@ -4165,19 +3970,6 @@ app.get("/", async (c) => {
4165
3970
  }
4166
3971
  const claudeAuthenticated = authHealth.status === "ok" || authHealth.status === "expiring";
4167
3972
  const vncRunning = await checkPort(WEBSOCKIFY_PORT);
4168
- let apiKeyConfigured = false;
4169
- try {
4170
- apiKeyConfigured = existsSync4(keyFilePath());
4171
- } catch {
4172
- }
4173
- let apiKeyStatus = "missing";
4174
- if (apiKeyConfigured) {
4175
- try {
4176
- apiKeyStatus = await probeApiKey();
4177
- } catch {
4178
- apiKeyStatus = "error";
4179
- }
4180
- }
4181
3973
  let whatsappAccounts = [];
4182
3974
  try {
4183
3975
  whatsappAccounts = getStatus().map((a) => ({
@@ -4203,8 +3995,6 @@ app.get("/", async (c) => {
4203
3995
  browser_transport: browserTransport,
4204
3996
  auth_status: authHealth.status,
4205
3997
  auth_expires_at: authHealth.expiresAt ?? null,
4206
- api_key_configured: apiKeyConfigured,
4207
- api_key_status: apiKeyStatus,
4208
3998
  server_ip: getLanIp(),
4209
3999
  missingPlugins,
4210
4000
  whatsapp: {
@@ -4220,9 +4010,9 @@ var health_default = app;
4220
4010
  import { randomUUID as randomUUID3 } from "crypto";
4221
4011
  import { mkdir as mkdir2, readFile, stat as stat2, writeFile as writeFile2 } from "fs/promises";
4222
4012
  import { realpathSync } from "fs";
4223
- import { resolve as resolve5, extname, basename } from "path";
4224
- var PLATFORM_ROOT3 = process.env.MAXY_PLATFORM_ROOT ?? resolve5(process.cwd(), "../platform");
4225
- var ATTACHMENTS_ROOT = resolve5(PLATFORM_ROOT3, "..", "data/uploads");
4013
+ import { resolve as resolve4, extname, basename } from "path";
4014
+ var PLATFORM_ROOT3 = process.env.MAXY_PLATFORM_ROOT ?? resolve4(process.cwd(), "../platform");
4015
+ var ATTACHMENTS_ROOT = resolve4(PLATFORM_ROOT3, "..", "data/uploads");
4226
4016
  var SUPPORTED_MIME_TYPES = /* @__PURE__ */ new Set([
4227
4017
  "image/jpeg",
4228
4018
  "image/png",
@@ -4249,11 +4039,11 @@ function assertSupportedMime(mimeType) {
4249
4039
  }
4250
4040
  async function writeAttachment(scope, filename, mimeType, sizeBytes, buffer) {
4251
4041
  const attachmentId = randomUUID3();
4252
- const dir = resolve5(ATTACHMENTS_ROOT, scope, attachmentId);
4042
+ const dir = resolve4(ATTACHMENTS_ROOT, scope, attachmentId);
4253
4043
  await mkdir2(dir, { recursive: true });
4254
4044
  const ext = extname(filename) || "";
4255
- const storagePath = resolve5(dir, `${attachmentId}${ext}`);
4256
- const metaPath = resolve5(dir, `${attachmentId}.meta.json`);
4045
+ const storagePath = resolve4(dir, `${attachmentId}${ext}`);
4046
+ const metaPath = resolve4(dir, `${attachmentId}.meta.json`);
4257
4047
  const meta = {
4258
4048
  attachmentId,
4259
4049
  scope,
@@ -4329,11 +4119,11 @@ async function storeComponentArtefact(accountId, attachmentId, mimeType, content
4329
4119
  `Component artefact exceeds the 50 MB limit (${(buffer.byteLength / 1024 / 1024).toFixed(1)} MB).`
4330
4120
  );
4331
4121
  }
4332
- const dir = resolve5(ATTACHMENTS_ROOT, accountId, attachmentId);
4122
+ const dir = resolve4(ATTACHMENTS_ROOT, accountId, attachmentId);
4333
4123
  await mkdir2(dir, { recursive: true });
4334
4124
  const ext = extname(filename) || (mimeType === "text/html" ? ".html" : ".md");
4335
- const storagePath = resolve5(dir, `${attachmentId}${ext}`);
4336
- const metaPath = resolve5(dir, `${attachmentId}.meta.json`);
4125
+ const storagePath = resolve4(dir, `${attachmentId}${ext}`);
4126
+ const metaPath = resolve4(dir, `${attachmentId}.meta.json`);
4337
4127
  const meta = {
4338
4128
  attachmentId,
4339
4129
  scope: accountId,
@@ -4350,7 +4140,7 @@ async function storeComponentArtefact(accountId, attachmentId, mimeType, content
4350
4140
  // app/lib/stt/voice-note.ts
4351
4141
  import { writeFile as writeFile3, mkdtemp, rm } from "fs/promises";
4352
4142
  import { tmpdir } from "os";
4353
- import { join as join5 } from "path";
4143
+ import { join as join4 } from "path";
4354
4144
  var TAG14 = "[voice]";
4355
4145
  var AUDIO_MIME_TYPES = /* @__PURE__ */ new Set([
4356
4146
  "audio/ogg",
@@ -4394,9 +4184,9 @@ async function transcribeVoiceNote(file, source) {
4394
4184
  let tempDir;
4395
4185
  let tempPath;
4396
4186
  try {
4397
- tempDir = await mkdtemp(join5(tmpdir(), "voice-"));
4187
+ tempDir = await mkdtemp(join4(tmpdir(), "voice-"));
4398
4188
  const ext = audioExtension(mimeType);
4399
- tempPath = join5(tempDir, `recording${ext}`);
4189
+ tempPath = join4(tempDir, `recording${ext}`);
4400
4190
  const buffer = Buffer.from(await file.arrayBuffer());
4401
4191
  await writeFile3(tempPath, buffer);
4402
4192
  } catch (err) {
@@ -4437,10 +4227,10 @@ async function transcribeVoiceNote(file, source) {
4437
4227
  }
4438
4228
 
4439
4229
  // ../lib/oauth-llm/src/index.ts
4440
- import { readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
4441
- import { resolve as resolve6 } from "path";
4442
- import { homedir as homedir2 } from "os";
4443
- var CREDENTIALS_FILE = process.env.CLAUDE_CONFIG_DIR ? resolve6(process.env.CLAUDE_CONFIG_DIR, ".credentials.json") : resolve6(homedir2(), ".claude", ".credentials.json");
4230
+ import { readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "fs";
4231
+ import { resolve as resolve5 } from "path";
4232
+ import { homedir } from "os";
4233
+ var CREDENTIALS_FILE = process.env.CLAUDE_CONFIG_DIR ? resolve5(process.env.CLAUDE_CONFIG_DIR, ".credentials.json") : resolve5(homedir(), ".claude", ".credentials.json");
4444
4234
  var TOKEN_ENDPOINT2 = "https://platform.claude.com/v1/oauth/token";
4445
4235
  var ANTHROPIC_MESSAGES_ENDPOINT = "https://api.anthropic.com/v1/messages";
4446
4236
  var ANTHROPIC_VERSION = "2023-06-01";
@@ -4459,7 +4249,7 @@ function isInputTooLargeBody(body) {
4459
4249
  function readCredentials2() {
4460
4250
  let raw;
4461
4251
  try {
4462
- raw = readFileSync7(CREDENTIALS_FILE, "utf-8");
4252
+ raw = readFileSync6(CREDENTIALS_FILE, "utf-8");
4463
4253
  } catch {
4464
4254
  return null;
4465
4255
  }
@@ -4488,7 +4278,7 @@ function writeCredentials(tokens) {
4488
4278
  const newExpiresAt = typeof tokens.expiresIn === "number" && tokens.expiresIn > 0 ? Date.now() + tokens.expiresIn * 1e3 : Date.now() + 3600 * 1e3;
4489
4279
  let fileData = {};
4490
4280
  try {
4491
- fileData = JSON.parse(readFileSync7(CREDENTIALS_FILE, "utf-8"));
4281
+ fileData = JSON.parse(readFileSync6(CREDENTIALS_FILE, "utf-8"));
4492
4282
  } catch {
4493
4283
  }
4494
4284
  const existing = fileData.claudeAiOauth;
@@ -4498,7 +4288,7 @@ function writeCredentials(tokens) {
4498
4288
  ...tokens.refreshToken != null ? { refreshToken: tokens.refreshToken } : {},
4499
4289
  expiresAt: newExpiresAt
4500
4290
  };
4501
- writeFileSync5(CREDENTIALS_FILE, JSON.stringify(fileData, null, 2), "utf-8");
4291
+ writeFileSync4(CREDENTIALS_FILE, JSON.stringify(fileData, null, 2), "utf-8");
4502
4292
  return newExpiresAt;
4503
4293
  }
4504
4294
  var refreshLock2 = null;
@@ -4972,7 +4762,7 @@ async function processInbound(rawText, channel) {
4972
4762
  }
4973
4763
 
4974
4764
  // app/lib/channel-pty-bridge/bridge.ts
4975
- import { resolve as resolve7 } from "path";
4765
+ import { resolve as resolve6 } from "path";
4976
4766
 
4977
4767
  // app/lib/channel-pty-bridge/manager-client.ts
4978
4768
  function managerBase() {
@@ -4988,7 +4778,9 @@ async function managerSpawn(opts) {
4988
4778
  role: opts.role,
4989
4779
  channel: opts.channel,
4990
4780
  accountId: opts.accountId,
4991
- attachmentDir: opts.attachmentDir
4781
+ attachmentDir: opts.attachmentDir,
4782
+ aboutOwner: opts.aboutOwner,
4783
+ dormantPlugins: opts.dormantPlugins
4992
4784
  })
4993
4785
  }).catch((err) => ({ __throw: err instanceof Error ? err.message : String(err) }));
4994
4786
  if ("__throw" in res) {
@@ -5130,7 +4922,7 @@ async function ensureEntry(input) {
5130
4922
  }
5131
4923
  return existing;
5132
4924
  }
5133
- const attachmentDir = input.role === "public" ? resolve7(ATTACHMENTS_ROOT, "public", input.senderId) : void 0;
4925
+ const attachmentDir = input.role === "public" ? resolve6(ATTACHMENTS_ROOT, "public", input.senderId) : void 0;
5134
4926
  const spawned = await managerSpawn({
5135
4927
  senderId: input.senderId,
5136
4928
  role: input.role,
@@ -5487,9 +5279,9 @@ ${lines}]`;
5487
5279
  var chat_default = app2;
5488
5280
 
5489
5281
  // server/routes/whatsapp.ts
5490
- import { join as join6, resolve as resolve8, basename as basename2 } from "path";
5282
+ import { join as join5, resolve as resolve7, basename as basename2 } from "path";
5491
5283
  import { readFile as readFile2, stat as stat3 } from "fs/promises";
5492
- import { realpathSync as realpathSync2, readdirSync as readdirSync2, readFileSync as readFileSync8, existsSync as existsSync5 } from "fs";
5284
+ import { realpathSync as realpathSync2, readdirSync as readdirSync2, readFileSync as readFileSync7, existsSync as existsSync4 } from "fs";
5493
5285
 
5494
5286
  // app/lib/whatsapp/login.ts
5495
5287
  import { randomUUID as randomUUID4 } from "crypto";
@@ -5830,7 +5622,7 @@ app3.post("/login/start", async (c) => {
5830
5622
  const body = await c.req.json().catch(() => ({}));
5831
5623
  const accountId = validateAccountId(body.accountId);
5832
5624
  const force = body.force ?? false;
5833
- const authDir = join6(MAXY_DIR, "credentials", "whatsapp", accountId);
5625
+ const authDir = join5(MAXY_DIR, "credentials", "whatsapp", accountId);
5834
5626
  const result = await startLogin({ accountId, authDir, force });
5835
5627
  console.error(`${TAG17} login/start result account=${accountId} hasQr=${!!result.qrRaw}${result.selfPhone ? ` phone=${result.selfPhone}` : ""}`);
5836
5628
  return c.json(result);
@@ -5990,17 +5782,17 @@ app3.post("/config", async (c) => {
5990
5782
  return c.json(result, result.ok ? 200 : 400);
5991
5783
  }
5992
5784
  case "list-public-agents": {
5993
- const agentsDir = resolve8(account.accountDir, "agents");
5785
+ const agentsDir = resolve7(account.accountDir, "agents");
5994
5786
  const agents = [];
5995
- if (existsSync5(agentsDir)) {
5787
+ if (existsSync4(agentsDir)) {
5996
5788
  try {
5997
5789
  const entries = readdirSync2(agentsDir, { withFileTypes: true });
5998
5790
  for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
5999
5791
  if (!entry.isDirectory() || entry.name === "admin") continue;
6000
- const configPath2 = resolve8(agentsDir, entry.name, "config.json");
6001
- if (!existsSync5(configPath2)) continue;
5792
+ const configPath2 = resolve7(agentsDir, entry.name, "config.json");
5793
+ if (!existsSync4(configPath2)) continue;
6002
5794
  try {
6003
- const config = JSON.parse(readFileSync8(configPath2, "utf-8"));
5795
+ const config = JSON.parse(readFileSync7(configPath2, "utf-8"));
6004
5796
  agents.push({ slug: entry.name, displayName: config.displayName ?? entry.name });
6005
5797
  } catch {
6006
5798
  console.error(`${TAG17} config action=list-public-agents error="failed to parse config.json for agent ${entry.name}" \u2014 skipping`);
@@ -6075,7 +5867,7 @@ app3.post("/send-document", async (c) => {
6075
5867
  if (!maxyAccountId || !PLATFORM_ROOT4) {
6076
5868
  return c.json({ error: "Cannot validate file path: missing account or platform context" }, 400);
6077
5869
  }
6078
- const accountDir = resolve8(PLATFORM_ROOT4, "..", "data/accounts", maxyAccountId);
5870
+ const accountDir = resolve7(PLATFORM_ROOT4, "..", "data/accounts", maxyAccountId);
6079
5871
  let resolvedPath;
6080
5872
  try {
6081
5873
  resolvedPath = realpathSync2(filePath);
@@ -6306,12 +6098,12 @@ var whatsapp_default = app3;
6306
6098
 
6307
6099
  // server/routes/onboarding.ts
6308
6100
  import { spawn, spawnSync as spawnSync2, execFileSync as execFileSync2 } from "child_process";
6309
- import { openSync, closeSync, writeFileSync as writeFileSync7, writeSync, existsSync as existsSync7, readFileSync as readFileSync10, unlinkSync as unlinkSync2 } from "fs";
6101
+ import { openSync, closeSync, writeFileSync as writeFileSync6, writeSync, existsSync as existsSync6, readFileSync as readFileSync9, unlinkSync } from "fs";
6310
6102
  import { createHash, randomUUID as randomUUID5 } from "crypto";
6311
6103
 
6312
6104
  // ../lib/admins-write/src/index.ts
6313
- import { existsSync as existsSync6, readFileSync as readFileSync9, writeFileSync as writeFileSync6, renameSync, mkdirSync as mkdirSync3, readdirSync as readdirSync3, statSync as statSync2 } from "fs";
6314
- import { dirname as dirname2, join as join7 } from "path";
6105
+ import { existsSync as existsSync5, readFileSync as readFileSync8, writeFileSync as writeFileSync5, renameSync, mkdirSync as mkdirSync2, readdirSync as readdirSync3, statSync as statSync2 } from "fs";
6106
+ import { dirname, join as join6 } from "path";
6315
6107
  function logLine(input, result) {
6316
6108
  const userIdShort = input.userId.slice(0, 8);
6317
6109
  console.error(
@@ -6319,17 +6111,17 @@ function logLine(input, result) {
6319
6111
  );
6320
6112
  }
6321
6113
  function writeFileAtomic(filePath, contents, mode) {
6322
- mkdirSync3(dirname2(filePath), { recursive: true });
6114
+ mkdirSync2(dirname(filePath), { recursive: true });
6323
6115
  const tempPath = `${filePath}.tmp-${process.pid}-${Date.now()}`;
6324
- writeFileSync6(tempPath, contents, mode !== void 0 ? { mode } : void 0);
6116
+ writeFileSync5(tempPath, contents, mode !== void 0 ? { mode } : void 0);
6325
6117
  renameSync(tempPath, filePath);
6326
6118
  }
6327
6119
  function writeAdminEntry(input) {
6328
6120
  const result = { usersJsonResult: "noop", accountJsonResult: "noop" };
6329
6121
  try {
6330
6122
  let users = [];
6331
- if (existsSync6(input.usersFile)) {
6332
- const raw = readFileSync9(input.usersFile, "utf-8").trim();
6123
+ if (existsSync5(input.usersFile)) {
6124
+ const raw = readFileSync8(input.usersFile, "utf-8").trim();
6333
6125
  if (raw) {
6334
6126
  const parsed = JSON.parse(raw);
6335
6127
  if (!Array.isArray(parsed)) {
@@ -6355,11 +6147,11 @@ function writeAdminEntry(input) {
6355
6147
  return result;
6356
6148
  }
6357
6149
  try {
6358
- const accountJsonPath = join7(input.accountDir, "account.json");
6359
- if (!existsSync6(accountJsonPath)) {
6150
+ const accountJsonPath = join6(input.accountDir, "account.json");
6151
+ if (!existsSync5(accountJsonPath)) {
6360
6152
  throw new Error(`account.json not found at ${accountJsonPath}`);
6361
6153
  }
6362
- const config = JSON.parse(readFileSync9(accountJsonPath, "utf-8"));
6154
+ const config = JSON.parse(readFileSync8(accountJsonPath, "utf-8"));
6363
6155
  const admins = config.admins ?? [];
6364
6156
  if (admins.some((a) => a.userId === input.userId)) {
6365
6157
  result.accountJsonResult = "noop";
@@ -6383,9 +6175,9 @@ function checkAdminAuthInvariant(input) {
6383
6175
  usersWithoutAccount: []
6384
6176
  };
6385
6177
  const usersUserIds = /* @__PURE__ */ new Set();
6386
- if (existsSync6(input.usersFile)) {
6178
+ if (existsSync5(input.usersFile)) {
6387
6179
  try {
6388
- const raw = readFileSync9(input.usersFile, "utf-8").trim();
6180
+ const raw = readFileSync8(input.usersFile, "utf-8").trim();
6389
6181
  if (raw) {
6390
6182
  const users = JSON.parse(raw);
6391
6183
  for (const u of users) {
@@ -6398,7 +6190,7 @@ function checkAdminAuthInvariant(input) {
6398
6190
  }
6399
6191
  }
6400
6192
  const accountUserIds = /* @__PURE__ */ new Set();
6401
- if (existsSync6(input.accountsDir)) {
6193
+ if (existsSync5(input.accountsDir)) {
6402
6194
  let entries;
6403
6195
  try {
6404
6196
  entries = readdirSync3(input.accountsDir);
@@ -6410,17 +6202,17 @@ function checkAdminAuthInvariant(input) {
6410
6202
  }
6411
6203
  for (const entry of entries) {
6412
6204
  if (entry.startsWith(".")) continue;
6413
- const accountDir = join7(input.accountsDir, entry);
6205
+ const accountDir = join6(input.accountsDir, entry);
6414
6206
  try {
6415
6207
  if (!statSync2(accountDir).isDirectory()) continue;
6416
6208
  } catch {
6417
6209
  continue;
6418
6210
  }
6419
- const accountJsonPath = join7(accountDir, "account.json");
6420
- if (!existsSync6(accountJsonPath)) continue;
6211
+ const accountJsonPath = join6(accountDir, "account.json");
6212
+ if (!existsSync5(accountJsonPath)) continue;
6421
6213
  let admins = [];
6422
6214
  try {
6423
- const config = JSON.parse(readFileSync9(accountJsonPath, "utf-8"));
6215
+ const config = JSON.parse(readFileSync8(accountJsonPath, "utf-8"));
6424
6216
  admins = config.admins ?? [];
6425
6217
  } catch (err) {
6426
6218
  const msg = err instanceof Error ? err.message : String(err);
@@ -6460,8 +6252,8 @@ function hashPin(pin) {
6460
6252
  return createHash("sha256").update(pin).digest("hex");
6461
6253
  }
6462
6254
  function readUsersFile() {
6463
- if (!existsSync7(USERS_FILE)) return null;
6464
- const raw = readFileSync10(USERS_FILE, "utf-8").trim();
6255
+ if (!existsSync6(USERS_FILE)) return null;
6256
+ const raw = readFileSync9(USERS_FILE, "utf-8").trim();
6465
6257
  if (!raw) return [];
6466
6258
  return JSON.parse(raw);
6467
6259
  }
@@ -6527,7 +6319,7 @@ app4.post("/claude-auth", async (c) => {
6527
6319
  if (!vncReady) return c.json({ error: "VNC display failed to start" }, 500);
6528
6320
  }
6529
6321
  await ensureCdp(transport);
6530
- writeFileSync7(logPath("claude-auth"), "");
6322
+ writeFileSync6(logPath("claude-auth"), "");
6531
6323
  const chromiumWrapper = writeChromiumWrapper();
6532
6324
  const x11Env = buildX11Env(chromiumWrapper, transport);
6533
6325
  vncLog("claude-auth", { action: "start", transport });
@@ -6659,10 +6451,10 @@ app4.delete("/set-pin", async (c) => {
6659
6451
  }
6660
6452
  const remaining = users.filter((u) => u.userId !== matchedUser.userId);
6661
6453
  if (remaining.length === 0) {
6662
- unlinkSync2(USERS_FILE);
6454
+ unlinkSync(USERS_FILE);
6663
6455
  console.log(`[set-pin] cleared users.json (last entry removed): userId=${matchedUser.userId.slice(0, 8)}\u2026`);
6664
6456
  } else {
6665
- writeFileSync7(USERS_FILE, JSON.stringify(remaining), { mode: 384 });
6457
+ writeFileSync6(USERS_FILE, JSON.stringify(remaining), { mode: 384 });
6666
6458
  console.log(`[set-pin] removed entry from users.json: userId=${matchedUser.userId.slice(0, 8)}\u2026 remaining=${remaining.length}`);
6667
6459
  }
6668
6460
  return c.json({ ok: true });
@@ -6670,9 +6462,9 @@ app4.delete("/set-pin", async (c) => {
6670
6462
  var onboarding_default = app4;
6671
6463
 
6672
6464
  // server/routes/client-error.ts
6673
- import { appendFileSync, existsSync as existsSync8, renameSync as renameSync2, statSync as statSync3 } from "fs";
6674
- import { join as join8 } from "path";
6675
- var CLIENT_ERRORS_LOG = join8(LOG_DIR, "client-errors.log");
6465
+ import { appendFileSync, existsSync as existsSync7, renameSync as renameSync2, statSync as statSync3 } from "fs";
6466
+ import { join as join7 } from "path";
6467
+ var CLIENT_ERRORS_LOG = join7(LOG_DIR, "client-errors.log");
6676
6468
  var MAX_LOG_SIZE = 10 * 1024 * 1024;
6677
6469
  var MAX_BODY_SIZE = 8 * 1024;
6678
6470
  var MAX_STACK_LEN = 2e3;
@@ -6715,7 +6507,7 @@ function stackHead(stack) {
6715
6507
  }
6716
6508
  function rotateIfNeeded() {
6717
6509
  try {
6718
- if (!existsSync8(CLIENT_ERRORS_LOG)) return;
6510
+ if (!existsSync7(CLIENT_ERRORS_LOG)) return;
6719
6511
  const stats = statSync3(CLIENT_ERRORS_LOG);
6720
6512
  if (stats.size < MAX_LOG_SIZE) return;
6721
6513
  renameSync2(CLIENT_ERRORS_LOG, CLIENT_ERRORS_LOG + ".1");
@@ -6829,8 +6621,8 @@ app5.post("/", async (c) => {
6829
6621
  var client_error_default = app5;
6830
6622
 
6831
6623
  // server/routes/admin/session.ts
6832
- import { readFileSync as readFileSync11, readdirSync as readdirSync4, statSync as statSync4, writeFileSync as writeFileSync8, existsSync as existsSync9 } from "fs";
6833
- import { join as join9 } from "path";
6624
+ import { readFileSync as readFileSync10, readdirSync as readdirSync4, statSync as statSync4, writeFileSync as writeFileSync7, existsSync as existsSync8 } from "fs";
6625
+ import { join as join8 } from "path";
6834
6626
  import { createHash as createHash2 } from "crypto";
6835
6627
  import { randomUUID as randomUUID6 } from "crypto";
6836
6628
  var deprecationLogged = /* @__PURE__ */ new Set();
@@ -6838,15 +6630,15 @@ function hashPin2(pin) {
6838
6630
  return createHash2("sha256").update(pin).digest("hex");
6839
6631
  }
6840
6632
  function readUsersFile2() {
6841
- if (!existsSync9(USERS_FILE)) return null;
6842
- const raw = readFileSync11(USERS_FILE, "utf-8").trim();
6633
+ if (!existsSync8(USERS_FILE)) return null;
6634
+ const raw = readFileSync10(USERS_FILE, "utf-8").trim();
6843
6635
  if (!raw) return [];
6844
6636
  return JSON.parse(raw);
6845
6637
  }
6846
6638
  function scanForOrphanedAccountAdmins(users) {
6847
6639
  const usersUserIds = new Set(users.map((u) => u.userId));
6848
6640
  const orphans = [];
6849
- if (!existsSync9(ACCOUNTS_DIR)) return orphans;
6641
+ if (!existsSync8(ACCOUNTS_DIR)) return orphans;
6850
6642
  let entries;
6851
6643
  try {
6852
6644
  entries = readdirSync4(ACCOUNTS_DIR);
@@ -6855,16 +6647,16 @@ function scanForOrphanedAccountAdmins(users) {
6855
6647
  }
6856
6648
  for (const entry of entries) {
6857
6649
  if (entry.startsWith(".")) continue;
6858
- const accountDir = join9(ACCOUNTS_DIR, entry);
6650
+ const accountDir = join8(ACCOUNTS_DIR, entry);
6859
6651
  try {
6860
6652
  if (!statSync4(accountDir).isDirectory()) continue;
6861
6653
  } catch {
6862
6654
  continue;
6863
6655
  }
6864
- const accountJsonPath = join9(accountDir, "account.json");
6865
- if (!existsSync9(accountJsonPath)) continue;
6656
+ const accountJsonPath = join8(accountDir, "account.json");
6657
+ if (!existsSync8(accountJsonPath)) continue;
6866
6658
  try {
6867
- const config = JSON.parse(readFileSync11(accountJsonPath, "utf-8"));
6659
+ const config = JSON.parse(readFileSync10(accountJsonPath, "utf-8"));
6868
6660
  const admins = config.admins ?? [];
6869
6661
  for (const a of admins) {
6870
6662
  if (typeof a.userId === "string" && !usersUserIds.has(a.userId)) {
@@ -6890,7 +6682,7 @@ function stripLegacyNameField(users) {
6890
6682
  }
6891
6683
  }
6892
6684
  try {
6893
- writeFileSync8(USERS_FILE, JSON.stringify(users), { mode: 384 });
6685
+ writeFileSync7(USERS_FILE, JSON.stringify(users), { mode: 384 });
6894
6686
  } catch (err) {
6895
6687
  console.error(`[admin-identity] users-json strip failed: ${err instanceof Error ? err.message : String(err)}`);
6896
6688
  }
@@ -7185,18 +6977,18 @@ app9.post("/", requireAdminSession, async (c) => {
7185
6977
  var failure_report_default = app9;
7186
6978
 
7187
6979
  // server/routes/admin/logs.ts
7188
- import { existsSync as existsSync11, readdirSync as readdirSync5, readFileSync as readFileSync12, statSync as statSync5 } from "fs";
7189
- import { resolve as resolve9, basename as basename3 } from "path";
6980
+ import { existsSync as existsSync10, readdirSync as readdirSync5, readFileSync as readFileSync11, statSync as statSync5 } from "fs";
6981
+ import { resolve as resolve8, basename as basename3 } from "path";
7190
6982
 
7191
6983
  // app/lib/logs-read-resolve.ts
7192
- import { existsSync as existsSync10 } from "fs";
7193
- import { join as join10 } from "path";
6984
+ import { existsSync as existsSync9 } from "fs";
6985
+ import { join as join9 } from "path";
7194
6986
  function resolveSessionLogPaths(filename, logDirs) {
7195
6987
  const tried = [filename];
7196
6988
  const hits = [];
7197
6989
  for (const dir of logDirs) {
7198
- const fullPath = join10(dir, filename);
7199
- if (existsSync10(fullPath)) {
6990
+ const fullPath = join9(dir, filename);
6991
+ if (existsSync9(fullPath)) {
7200
6992
  hits.push({ path: fullPath, dir });
7201
6993
  }
7202
6994
  }
@@ -7213,7 +7005,7 @@ app10.get("/", async (c) => {
7213
7005
  const cacheKeyParam = c.req.query("cacheKey");
7214
7006
  const download = c.req.query("download") === "1";
7215
7007
  const account = resolveAccount();
7216
- const accountLogDir = account ? resolve9(account.accountDir, "logs") : null;
7008
+ const accountLogDir = account ? resolve8(account.accountDir, "logs") : null;
7217
7009
  const logDirs = [];
7218
7010
  if (accountLogDir) logDirs.push(accountLogDir);
7219
7011
  logDirs.push(LOG_DIR);
@@ -7221,10 +7013,10 @@ app10.get("/", async (c) => {
7221
7013
  const safe = basename3(fileParam);
7222
7014
  const searched = [];
7223
7015
  for (const dir of logDirs) {
7224
- const filePath = resolve9(dir, safe);
7016
+ const filePath = resolve8(dir, safe);
7225
7017
  searched.push(filePath);
7226
7018
  try {
7227
- const buffer = readFileSync12(filePath);
7019
+ const buffer = readFileSync11(filePath);
7228
7020
  const onDiskBytes = statSync5(filePath).size;
7229
7021
  const headers = {
7230
7022
  "Content-Type": "text/plain; charset=utf-8",
@@ -7289,7 +7081,7 @@ app10.get("/", async (c) => {
7289
7081
  console.info(`[admin/logs] resolved cacheKey=${cacheKeySlice} conversationId=${conversationIdSlice} via=${primaryId === cacheKey ? "cacheKey" : primaryId === sessionKeyFromConv ? "reverse-lookup" : "conversationId-fallback"}`);
7290
7082
  try {
7291
7083
  const filename = basename3(hit.path);
7292
- const buffer = readFileSync12(hit.path);
7084
+ const buffer = readFileSync11(hit.path);
7293
7085
  const onDiskBytes = statSync5(hit.path).size;
7294
7086
  const headers = {
7295
7087
  "Content-Type": "text/plain; charset=utf-8",
@@ -7324,7 +7116,7 @@ app10.get("/", async (c) => {
7324
7116
  const seen = /* @__PURE__ */ new Set();
7325
7117
  const logs = {};
7326
7118
  for (const dir of logDirs) {
7327
- if (!existsSync11(dir)) continue;
7119
+ if (!existsSync10(dir)) continue;
7328
7120
  let files;
7329
7121
  try {
7330
7122
  files = readdirSync5(dir).filter((f) => f.endsWith(".log"));
@@ -7333,10 +7125,10 @@ app10.get("/", async (c) => {
7333
7125
  console.warn(`[admin/logs] readdir-fail dir=${dir} reason=${reason}`);
7334
7126
  continue;
7335
7127
  }
7336
- files.filter((f) => !seen.has(f)).map((f) => ({ name: f, mtime: statSync5(resolve9(dir, f)).mtimeMs })).sort((a, b) => b.mtime - a.mtime).forEach(({ name }) => {
7128
+ files.filter((f) => !seen.has(f)).map((f) => ({ name: f, mtime: statSync5(resolve8(dir, f)).mtimeMs })).sort((a, b) => b.mtime - a.mtime).forEach(({ name }) => {
7337
7129
  seen.add(name);
7338
7130
  try {
7339
- const content = readFileSync12(resolve9(dir, name));
7131
+ const content = readFileSync11(resolve8(dir, name));
7340
7132
  const tail = content.length > TAIL_BYTES ? content.subarray(content.length - TAIL_BYTES).toString("utf-8") : content.toString("utf-8");
7341
7133
  logs[name] = tail.trim() || "(empty)";
7342
7134
  } catch (err) {
@@ -7375,8 +7167,8 @@ var claude_info_default = app11;
7375
7167
 
7376
7168
  // server/routes/admin/attachment.ts
7377
7169
  import { readFile as readFile3, readdir } from "fs/promises";
7378
- import { existsSync as existsSync12 } from "fs";
7379
- import { resolve as resolve10 } from "path";
7170
+ import { existsSync as existsSync11 } from "fs";
7171
+ import { resolve as resolve9 } from "path";
7380
7172
  var app12 = new Hono();
7381
7173
  app12.get("/:attachmentId", requireAdminSession, async (c) => {
7382
7174
  const attachmentId = c.req.param("attachmentId");
@@ -7388,12 +7180,12 @@ app12.get("/:attachmentId", requireAdminSession, async (c) => {
7388
7180
  if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(attachmentId)) {
7389
7181
  return new Response("Not found", { status: 404 });
7390
7182
  }
7391
- const dir = resolve10(ATTACHMENTS_ROOT, accountId, attachmentId);
7392
- if (!existsSync12(dir)) {
7183
+ const dir = resolve9(ATTACHMENTS_ROOT, accountId, attachmentId);
7184
+ if (!existsSync11(dir)) {
7393
7185
  return new Response("Not found", { status: 404 });
7394
7186
  }
7395
- const metaPath = resolve10(dir, `${attachmentId}.meta.json`);
7396
- if (!existsSync12(metaPath)) {
7187
+ const metaPath = resolve9(dir, `${attachmentId}.meta.json`);
7188
+ if (!existsSync11(metaPath)) {
7397
7189
  return new Response("Not found", { status: 404 });
7398
7190
  }
7399
7191
  let meta;
@@ -7407,7 +7199,7 @@ app12.get("/:attachmentId", requireAdminSession, async (c) => {
7407
7199
  if (!dataFile) {
7408
7200
  return new Response("Not found", { status: 404 });
7409
7201
  }
7410
- const filePath = resolve10(dir, dataFile);
7202
+ const filePath = resolve9(dir, dataFile);
7411
7203
  const buffer = await readFile3(filePath);
7412
7204
  return new Response(new Uint8Array(buffer), {
7413
7205
  headers: {
@@ -7420,24 +7212,24 @@ app12.get("/:attachmentId", requireAdminSession, async (c) => {
7420
7212
  var attachment_default = app12;
7421
7213
 
7422
7214
  // server/routes/admin/agents.ts
7423
- import { resolve as resolve11 } from "path";
7424
- import { readdirSync as readdirSync6, readFileSync as readFileSync13, existsSync as existsSync13, rmSync } from "fs";
7215
+ import { resolve as resolve10 } from "path";
7216
+ import { readdirSync as readdirSync6, readFileSync as readFileSync12, existsSync as existsSync12, rmSync } from "fs";
7425
7217
  var app13 = new Hono();
7426
7218
  app13.get("/", (c) => {
7427
7219
  const account = resolveAccount();
7428
7220
  if (!account) return c.json({ agents: [] });
7429
- const agentsDir = resolve11(account.accountDir, "agents");
7430
- if (!existsSync13(agentsDir)) return c.json({ agents: [] });
7221
+ const agentsDir = resolve10(account.accountDir, "agents");
7222
+ if (!existsSync12(agentsDir)) return c.json({ agents: [] });
7431
7223
  const agents = [];
7432
7224
  try {
7433
7225
  const entries = readdirSync6(agentsDir, { withFileTypes: true });
7434
7226
  for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
7435
7227
  if (!entry.isDirectory()) continue;
7436
7228
  if (entry.name === "admin") continue;
7437
- const configPath2 = resolve11(agentsDir, entry.name, "config.json");
7438
- if (!existsSync13(configPath2)) continue;
7229
+ const configPath2 = resolve10(agentsDir, entry.name, "config.json");
7230
+ if (!existsSync12(configPath2)) continue;
7439
7231
  try {
7440
- const config = JSON.parse(readFileSync13(configPath2, "utf-8"));
7232
+ const config = JSON.parse(readFileSync12(configPath2, "utf-8"));
7441
7233
  agents.push({
7442
7234
  slug: entry.name,
7443
7235
  displayName: config.displayName ?? entry.name,
@@ -7463,8 +7255,8 @@ app13.delete("/:slug", async (c) => {
7463
7255
  if (slug.includes("/") || slug.includes("..") || slug.includes("\\")) {
7464
7256
  return c.json({ error: "Invalid agent slug" }, 400);
7465
7257
  }
7466
- const agentDir = resolve11(account.accountDir, "agents", slug);
7467
- if (!existsSync13(agentDir)) {
7258
+ const agentDir = resolve10(account.accountDir, "agents", slug);
7259
+ if (!existsSync12(agentDir)) {
7468
7260
  return c.json({ error: "Agent not found" }, 404);
7469
7261
  }
7470
7262
  try {
@@ -7493,8 +7285,8 @@ app13.post("/:slug/project", async (c) => {
7493
7285
  if (slug.includes("/") || slug.includes("..") || slug.includes("\\")) {
7494
7286
  return c.json({ error: "Invalid agent slug" }, 400);
7495
7287
  }
7496
- const agentDir = resolve11(account.accountDir, "agents", slug);
7497
- if (!existsSync13(agentDir)) {
7288
+ const agentDir = resolve10(account.accountDir, "agents", slug);
7289
+ if (!existsSync12(agentDir)) {
7498
7290
  return c.json({ error: "Agent not found on disk" }, 404);
7499
7291
  }
7500
7292
  try {
@@ -7510,7 +7302,7 @@ var agents_default = app13;
7510
7302
  // server/routes/admin/sessions.ts
7511
7303
  import crypto from "crypto";
7512
7304
  import { resolve as resolvePath } from "path";
7513
- import { existsSync as existsSync14, mkdirSync as mkdirSync4, createWriteStream } from "fs";
7305
+ import { existsSync as existsSync13, mkdirSync as mkdirSync3, createWriteStream } from "fs";
7514
7306
 
7515
7307
  // app/lib/synthetic-marker.ts
7516
7308
  var CLOUDFLARE_MARKER_PREFIX = "Cloudflare setup completed (actionId: ";
@@ -7527,7 +7319,7 @@ var replayJsonl = (..._args) => null;
7527
7319
  var resolveJsonlPath = (..._args) => null;
7528
7320
 
7529
7321
  // server/routes/admin/sessions.ts
7530
- import { homedir as homedir3 } from "os";
7322
+ import { homedir as homedir2 } from "os";
7531
7323
 
7532
7324
  // app/lib/claude-agent/component-attachment.ts
7533
7325
  var pickComponentBytes = (..._args) => null;
@@ -7536,7 +7328,7 @@ var pickComponentBytes = (..._args) => null;
7536
7328
  function openResumeStreamLog(accountId, conversationId) {
7537
7329
  const dir = resolvePath(ACCOUNTS_DIR, accountId, "resume-logs");
7538
7330
  try {
7539
- mkdirSync4(dir, { recursive: true });
7331
+ mkdirSync3(dir, { recursive: true });
7540
7332
  } catch {
7541
7333
  }
7542
7334
  return createWriteStream(resolvePath(dir, `${conversationId}.log`), { flags: "a" });
@@ -7567,7 +7359,7 @@ function validateAndShapeAttachments(raws, conversationAccountId, conversationId
7567
7359
  let reason = null;
7568
7360
  if (!a.attachmentId || !a.filename || !a.mimeType || !a.storagePath) reason = "schema-fail";
7569
7361
  else if (a.accountId !== conversationAccountId) reason = "account-mismatch";
7570
- else if (!existsSync14(a.storagePath)) reason = "missing-file";
7362
+ else if (!existsSync13(a.storagePath)) reason = "missing-file";
7571
7363
  if (reason) {
7572
7364
  invalid++;
7573
7365
  try {
@@ -7830,7 +7622,7 @@ app14.post("/:id/resume", async (c) => {
7830
7622
  return c.json({ error: "Failed to load conversation messages" }, 500);
7831
7623
  }
7832
7624
  if (persistedAgentSessionId) {
7833
- const jsonlPath = resolveJsonlPath(homedir3(), resolvePath(ACCOUNTS_DIR, accountId), persistedAgentSessionId);
7625
+ const jsonlPath = resolveJsonlPath(homedir2(), resolvePath(ACCOUNTS_DIR, accountId), persistedAgentSessionId);
7834
7626
  const replay = replayJsonl(jsonlPath);
7835
7627
  jsonlMissing = replay.jsonlMissing;
7836
7628
  jsonlMalformedLines = replay.malformedLines;
@@ -7884,7 +7676,7 @@ app14.post("/:id/resume", async (c) => {
7884
7676
  ordinal: c2.ordinal,
7885
7677
  textOffset: c2.textOffset,
7886
7678
  submitted: false,
7887
- // Task 989 — JSONL has artefactAttachmentId for persistent components.
7679
+ // JSONL has artefactAttachmentId for persistent components.
7888
7680
  ...c2.artefactAttachmentId ? { attachmentId: c2.artefactAttachmentId } : {}
7889
7681
  })),
7890
7682
  attachments: []
@@ -8093,6 +7885,77 @@ app14.put("/:id/label", requireAdminSession, async (c) => {
8093
7885
  });
8094
7886
  var sessions_default = app14;
8095
7887
 
7888
+ // app/lib/claude-agent/spawn-context.ts
7889
+ import { existsSync as existsSync14, readFileSync as readFileSync13, readdirSync as readdirSync7 } from "fs";
7890
+ import { resolve as resolve11 } from "path";
7891
+ async function resolveOwnerProfileBlock(accountId, userId) {
7892
+ if (!userId) return { ok: false, reason: "missing-user-id" };
7893
+ try {
7894
+ const body = await loadUserProfile(accountId, userId);
7895
+ if (body === null) return { ok: false, reason: "profile-not-found" };
7896
+ return { ok: true, body };
7897
+ } catch (err) {
7898
+ console.error(
7899
+ `[spawn-context] neo4j-unreachable: ${err instanceof Error ? err.message : String(err)}`
7900
+ );
7901
+ return { ok: false, reason: "neo4j-unreachable" };
7902
+ }
7903
+ }
7904
+ function frontmatterField(manifest, field) {
7905
+ const fm = manifest.match(/^---\r?\n([\s\S]*?)\r?\n---/);
7906
+ if (!fm) return null;
7907
+ const re = new RegExp(`^${field}:\\s*(.*?)\\r?$`, "m");
7908
+ const m = fm[1].match(re);
7909
+ if (!m) return null;
7910
+ let value = m[1].trim();
7911
+ if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
7912
+ value = value.slice(1, -1);
7913
+ }
7914
+ return value || null;
7915
+ }
7916
+ function computeDormantPlugins(accountId) {
7917
+ const accountFile = resolve11(PLATFORM_ROOT, "..", "data/accounts", accountId, "account.json");
7918
+ if (!existsSync14(accountFile)) return [];
7919
+ let enabled;
7920
+ try {
7921
+ const raw = readFileSync13(accountFile, "utf-8");
7922
+ const parsed = JSON.parse(raw);
7923
+ enabled = new Set(
7924
+ Array.isArray(parsed.enabledPlugins) ? parsed.enabledPlugins.filter((p) => typeof p === "string") : []
7925
+ );
7926
+ } catch (err) {
7927
+ console.error(
7928
+ `[spawn-context] account.json read failed for ${accountId.slice(0, 8)}\u2026: ${err instanceof Error ? err.message : String(err)}`
7929
+ );
7930
+ return [];
7931
+ }
7932
+ const pluginsDir = resolve11(PLATFORM_ROOT, "plugins");
7933
+ if (!existsSync14(pluginsDir)) return [];
7934
+ let entries;
7935
+ try {
7936
+ entries = readdirSync7(pluginsDir);
7937
+ } catch {
7938
+ return [];
7939
+ }
7940
+ const out = [];
7941
+ for (const name of entries) {
7942
+ if (enabled.has(name)) continue;
7943
+ const manifestPath = resolve11(pluginsDir, name, "PLUGIN.md");
7944
+ if (!existsSync14(manifestPath)) continue;
7945
+ let manifest;
7946
+ try {
7947
+ manifest = readFileSync13(manifestPath, "utf-8");
7948
+ } catch {
7949
+ continue;
7950
+ }
7951
+ const description = frontmatterField(manifest, "description");
7952
+ if (!description) continue;
7953
+ out.push({ name, description });
7954
+ }
7955
+ out.sort((a, b) => a.name.localeCompare(b.name));
7956
+ return out;
7957
+ }
7958
+
8096
7959
  // server/routes/admin/claude-sessions.ts
8097
7960
  var TAG18 = "[claude-session-manager:wrapper]";
8098
7961
  function managerBase2() {
@@ -8102,12 +7965,14 @@ function managerBase2() {
8102
7965
  var app15 = new Hono();
8103
7966
  app15.use("*", requireAdminSession);
8104
7967
  app15.post("/", async (c) => {
7968
+ const routeStart = Date.now();
8105
7969
  const cacheKey = c.get("cacheKey") ?? "";
8106
7970
  const senderId = getAccountIdForSession(cacheKey) ?? "";
8107
7971
  if (!senderId) {
8108
- console.error(`${TAG18} reject reason=no-account-id`);
7972
+ console.error(`${TAG18} reject reason=no-account-id cacheKey-prefix=${cacheKey.slice(0, 8)}`);
8109
7973
  return c.json({ error: "admin-account-not-resolved" }, 500);
8110
7974
  }
7975
+ const userId = getUserIdForSession(cacheKey);
8111
7976
  let body = {};
8112
7977
  try {
8113
7978
  body = await c.req.json();
@@ -8116,15 +7981,35 @@ app15.post("/", async (c) => {
8116
7981
  const channel = typeof body.channel === "string" ? body.channel : "browser";
8117
7982
  const initialMessage = typeof body.initialMessage === "string" && body.initialMessage.trim() ? body.initialMessage : null;
8118
7983
  const permissionMode = typeof body.permissionMode === "string" ? body.permissionMode : void 0;
7984
+ console.log(`${TAG18} spawn-request-in cacheKey-prefix=${cacheKey.slice(0, 8)} senderId=${senderId.slice(0, 8)} userId=${userId ? userId.slice(0, 8) : "absent"} channel=${channel} permissionMode=${permissionMode ?? "default"} initialMessage=${initialMessage ? "yes" : "no"}`);
7985
+ const ownerStart = Date.now();
7986
+ const aboutOwner = await resolveOwnerProfileBlock(senderId, userId);
7987
+ const ownerMs = Date.now() - ownerStart;
7988
+ const aboutOwnerStatus = aboutOwner == null ? "absent" : "ok" in aboutOwner && aboutOwner.ok === false ? `unresolved:${aboutOwner.reason}` : "ok";
7989
+ console.log(`${TAG18} about-owner-resolved status=${aboutOwnerStatus} ms=${ownerMs}`);
7990
+ const dormantStart = Date.now();
7991
+ const dormantPlugins = computeDormantPlugins(senderId);
7992
+ console.log(`${TAG18} dormant-plugins-computed count=${Array.isArray(dormantPlugins) ? dormantPlugins.length : 0} ms=${Date.now() - dormantStart}`);
7993
+ const forwardStart = Date.now();
7994
+ const upstreamPayload = JSON.stringify({
7995
+ senderId,
7996
+ role: "admin",
7997
+ channel,
7998
+ permissionMode,
7999
+ aboutOwner,
8000
+ dormantPlugins
8001
+ });
8002
+ console.log(`${TAG18} forward-spawn-start managerBase=${managerBase2()} bytes=${upstreamPayload.length}`);
8119
8003
  const upstream = await fetch(`${managerBase2()}/spawn`, {
8120
8004
  method: "POST",
8121
8005
  headers: { "content-type": "application/json" },
8122
- body: JSON.stringify({ senderId, role: "admin", channel, permissionMode })
8006
+ body: upstreamPayload
8123
8007
  }).catch((err) => {
8124
- console.error(`${TAG18} fetch-failed op=spawn message=${err instanceof Error ? err.message : String(err)}`);
8008
+ console.error(`${TAG18} fetch-failed op=spawn message=${err instanceof Error ? err.message : String(err)} ms=${Date.now() - forwardStart}`);
8125
8009
  return null;
8126
8010
  });
8127
8011
  if (!upstream) return c.json({ error: "manager-unreachable" }, 503);
8012
+ console.log(`${TAG18} forward-spawn-done status=${upstream.status} ms=${Date.now() - forwardStart} route-ms=${Date.now() - routeStart}`);
8128
8013
  let spawnedSessionId = null;
8129
8014
  if (upstream.ok && initialMessage) {
8130
8015
  const buffered = await upstream.clone().json().catch(() => null);
@@ -8160,6 +8045,7 @@ app15.post("/resume", async (c) => {
8160
8045
  const cacheKey = c.get("cacheKey") ?? "";
8161
8046
  const senderId = getAccountIdForSession(cacheKey) ?? "";
8162
8047
  if (!senderId) return c.json({ error: "admin-account-not-resolved" }, 500);
8048
+ const userId = getUserIdForSession(cacheKey);
8163
8049
  let body = {};
8164
8050
  try {
8165
8051
  body = await c.req.json();
@@ -8170,6 +8056,8 @@ app15.post("/resume", async (c) => {
8170
8056
  return c.json({ error: "claudeSessionId-required" }, 400);
8171
8057
  }
8172
8058
  const channel = typeof body.channel === "string" ? body.channel : "browser";
8059
+ const aboutOwner = await resolveOwnerProfileBlock(senderId, userId);
8060
+ const dormantPlugins = computeDormantPlugins(senderId);
8173
8061
  const upstream = await fetch(`${managerBase2()}/resume`, {
8174
8062
  method: "POST",
8175
8063
  headers: { "content-type": "application/json" },
@@ -8177,7 +8065,9 @@ app15.post("/resume", async (c) => {
8177
8065
  senderId,
8178
8066
  role: "admin",
8179
8067
  channel,
8180
- claudeSessionId: body.claudeSessionId
8068
+ claudeSessionId: body.claudeSessionId,
8069
+ aboutOwner,
8070
+ dormantPlugins
8181
8071
  })
8182
8072
  }).catch((err) => {
8183
8073
  console.error(`${TAG18} fetch-failed op=resume message=${err instanceof Error ? err.message : String(err)}`);
@@ -8513,7 +8403,7 @@ app19.post("/", async (c) => {
8513
8403
  var events_default = app19;
8514
8404
 
8515
8405
  // server/routes/admin/cloudflare.ts
8516
- import { homedir as homedir4 } from "os";
8406
+ import { homedir as homedir3 } from "os";
8517
8407
  import { resolve as resolve13 } from "path";
8518
8408
  import { readFileSync as readFileSync15 } from "fs";
8519
8409
 
@@ -8531,8 +8421,8 @@ function isValidDomain(value) {
8531
8421
  }
8532
8422
 
8533
8423
  // app/lib/alias-domains.ts
8534
- import { existsSync as existsSync15, mkdirSync as mkdirSync5, readFileSync as readFileSync14, writeFileSync as writeFileSync9 } from "fs";
8535
- import { dirname as dirname3 } from "path";
8424
+ import { existsSync as existsSync15, mkdirSync as mkdirSync4, readFileSync as readFileSync14, writeFileSync as writeFileSync8 } from "fs";
8425
+ import { dirname as dirname2 } from "path";
8536
8426
  import { resolve as resolve12 } from "path";
8537
8427
  var ALIAS_DOMAINS_PATH = resolve12(MAXY_DIR, "alias-domains.json");
8538
8428
  function readExisting() {
@@ -8549,14 +8439,14 @@ function addAliasDomain(hostname2) {
8549
8439
  const existing = readExisting();
8550
8440
  if (existing.has(hostname2)) return;
8551
8441
  existing.add(hostname2);
8552
- mkdirSync5(dirname3(ALIAS_DOMAINS_PATH), { recursive: true });
8553
- writeFileSync9(ALIAS_DOMAINS_PATH, JSON.stringify([...existing], null, 2) + "\n", "utf-8");
8442
+ mkdirSync4(dirname2(ALIAS_DOMAINS_PATH), { recursive: true });
8443
+ writeFileSync8(ALIAS_DOMAINS_PATH, JSON.stringify([...existing], null, 2) + "\n", "utf-8");
8554
8444
  }
8555
8445
 
8556
8446
  // app/lib/script-stream-tailer.ts
8557
8447
  import * as childProcess from "child_process";
8558
- import { appendFileSync as appendFileSync2, createReadStream as createReadStream2, mkdirSync as mkdirSync6, statSync as statSync6 } from "fs";
8559
- import { dirname as dirname4 } from "path";
8448
+ import { appendFileSync as appendFileSync2, createReadStream as createReadStream2, mkdirSync as mkdirSync5, statSync as statSync6 } from "fs";
8449
+ import { dirname as dirname3 } from "path";
8560
8450
  import { StringDecoder } from "string_decoder";
8561
8451
  var SCRIPT_STREAM_RE = /^\[([^\]]+)\] \[script:([a-z][a-z0-9-]*)((?::[a-z0-9:_-]+)?)\] (.*)$/;
8562
8452
  function parseLine(line) {
@@ -8665,7 +8555,7 @@ function writeRouteMilestone(streamLogPath, scope, line) {
8665
8555
  }
8666
8556
  const ts = (/* @__PURE__ */ new Date()).toISOString();
8667
8557
  try {
8668
- mkdirSync6(dirname4(streamLogPath), { recursive: true });
8558
+ mkdirSync5(dirname3(streamLogPath), { recursive: true });
8669
8559
  appendFileSync2(streamLogPath, `[${ts}] [script:${scope}] ${line}
8670
8560
  `);
8671
8561
  } catch (err) {
@@ -8966,7 +8856,7 @@ app20.get("/domains", requireAdminSession, async (c) => {
8966
8856
  streamLogPath = cloudflareStreamLogPath(accountId, correlationId);
8967
8857
  log(`phase=stream-log-resolved path=${streamLogPath}`);
8968
8858
  const brand = loadBrandInfo();
8969
- const scriptPath = resolve13(homedir4(), "list-cf-domains.sh");
8859
+ const scriptPath = resolve13(homedir3(), "list-cf-domains.sh");
8970
8860
  const result = await runFormSpawn({
8971
8861
  scriptPath,
8972
8862
  args: [brand.hostname],
@@ -9057,7 +8947,7 @@ app20.get("/tunnels", requireAdminSession, async (c) => {
9057
8947
  if (!accountId) return err("session", "No account bound to session \u2014 refresh chat.");
9058
8948
  if (!correlationId) return err("session", "No active conversation for session \u2014 refresh chat.");
9059
8949
  streamLogPath = cloudflareStreamLogPath(accountId, correlationId);
9060
- const certPath = resolve13(homedir4(), brand.configDir, "cloudflared", "cert.pem");
8950
+ const certPath = resolve13(homedir3(), brand.configDir, "cloudflared", "cert.pem");
9061
8951
  const { existsSync: existsSync23 } = await import("fs");
9062
8952
  if (!existsSync23(certPath)) {
9063
8953
  return err("cert", `Cloudflare origin certificate is not on disk yet (${certPath}). Complete the Cloudflare login first by submitting the form once \u2014 the OAuth flow writes cert.pem.`);
@@ -9383,7 +9273,7 @@ var cloudflare_default = app20;
9383
9273
  import { createReadStream as createReadStream3 } from "fs";
9384
9274
  import { readdir as readdir2, readFile as readFile4, stat as stat4, mkdir as mkdir3, writeFile as writeFile4, unlink as unlink2 } from "fs/promises";
9385
9275
  import { realpathSync as realpathSync4 } from "fs";
9386
- import { basename as basename4, dirname as dirname5, join as join11, resolve as resolve15, sep as sep3 } from "path";
9276
+ import { basename as basename4, dirname as dirname4, join as join10, resolve as resolve15, sep as sep3 } from "path";
9387
9277
  import { Readable as Readable2 } from "stream";
9388
9278
 
9389
9279
  // app/lib/data-path.ts
@@ -9740,7 +9630,7 @@ async function cascadeDeleteDocument(params) {
9740
9630
  var UUID_RE4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
9741
9631
  async function readMeta(absDir, baseName) {
9742
9632
  try {
9743
- const raw = await readFile4(join11(absDir, `${baseName}.meta.json`), "utf8");
9633
+ const raw = await readFile4(join10(absDir, `${baseName}.meta.json`), "utf8");
9744
9634
  const parsed = JSON.parse(raw);
9745
9635
  if (typeof parsed?.filename === "string") {
9746
9636
  return { filename: parsed.filename, mimeType: typeof parsed.mimeType === "string" ? parsed.mimeType : void 0 };
@@ -9778,7 +9668,7 @@ async function readAccountNames() {
9778
9668
  }
9779
9669
  async function enrich(absolute, entry, accountNames) {
9780
9670
  if (entry.kind === "directory" && UUID_RE4.test(entry.name)) {
9781
- const meta = await readMeta(join11(absolute, entry.name), entry.name);
9671
+ const meta = await readMeta(join10(absolute, entry.name), entry.name);
9782
9672
  if (meta?.filename) {
9783
9673
  entry.displayName = meta.filename;
9784
9674
  entry.mimeType = meta.mimeType;
@@ -9837,7 +9727,7 @@ app21.get("/", requireAdminSession, async (c) => {
9837
9727
  continue;
9838
9728
  }
9839
9729
  try {
9840
- const entryPath = join11(absolute, name);
9730
+ const entryPath = join10(absolute, name);
9841
9731
  const s = await stat4(entryPath);
9842
9732
  entries.push({
9843
9733
  name,
@@ -10010,7 +9900,7 @@ app21.delete("/", requireAdminSession, async (c) => {
10010
9900
  }
10011
9901
  const dot = base.lastIndexOf(".");
10012
9902
  const stem = dot === -1 ? base : base.slice(0, dot);
10013
- const sidecarPath = UUID_RE4.test(stem) && base !== `${stem}.meta.json` ? join11(dirname5(absolute), `${stem}.meta.json`) : null;
9903
+ const sidecarPath = UUID_RE4.test(stem) && base !== `${stem}.meta.json` ? join10(dirname4(absolute), `${stem}.meta.json`) : null;
10014
9904
  await unlink2(absolute);
10015
9905
  if (sidecarPath) {
10016
9906
  try {
@@ -10047,7 +9937,7 @@ app21.delete("/", requireAdminSession, async (c) => {
10047
9937
  var files_default = app21;
10048
9938
 
10049
9939
  // ../lib/graph-search/src/index.ts
10050
- var import_dist2 = __toESM(require_dist2());
9940
+ var import_dist = __toESM(require_dist());
10051
9941
  import { int } from "neo4j-driver";
10052
9942
  var VECTOR_WEIGHT = 0.7;
10053
9943
  var BM25_WEIGHT = 0.3;
@@ -10102,7 +9992,7 @@ async function bm25Only(session, params) {
10102
9992
  ${scopeClause}
10103
9993
  ${agentClause}
10104
9994
  ${labelClause}
10105
- AND ${(0, import_dist2.notTrashed)("node")}
9995
+ AND ${(0, import_dist.notTrashed)("node")}
10106
9996
  ${kwClause}
10107
9997
  RETURN node, score, labels(node) AS nodeLabels, elementId(node) AS nodeId
10108
9998
  ORDER BY score DESC
@@ -10209,7 +10099,7 @@ async function hybrid(session, embed2, params) {
10209
10099
  WHERE node.accountId = $accountId
10210
10100
  ${scopeClause}
10211
10101
  ${agentClause}
10212
- AND ${(0, import_dist2.notTrashed)("node")}
10102
+ AND ${(0, import_dist.notTrashed)("node")}
10213
10103
  ${keywordClause}
10214
10104
  RETURN node, score, labels(node) AS nodeLabels, elementId(node) AS nodeId
10215
10105
  ORDER BY score DESC
@@ -10271,7 +10161,7 @@ async function hybrid(session, embed2, params) {
10271
10161
  const propResult = await session.run(
10272
10162
  `MATCH (node)
10273
10163
  WHERE node.accountId = $accountId
10274
- AND ${(0, import_dist2.notTrashed)("node")}
10164
+ AND ${(0, import_dist.notTrashed)("node")}
10275
10165
  AND node.keywords IS NOT NULL
10276
10166
  AND ANY(kw IN $kwSubs WHERE ANY(nk IN node.keywords WHERE toLower(nk) = kw))
10277
10167
  ${propScopeClause}
@@ -10329,7 +10219,7 @@ async function hybrid(session, embed2, params) {
10329
10219
  labels: node.labels,
10330
10220
  properties: node.properties,
10331
10221
  score: node.combinedScore,
10332
- // Task 878 — carry the per-half components so the /data UI can render
10222
+ // carry the per-half components so the /data UI can render
10333
10223
  // a per-row breakdown. These are already computed on `ScoredNode` from
10334
10224
  // the vector half (raw cosine) and the bm25 half (post-merge normalised
10335
10225
  // value, NOT raw Lucene). Memory MCP ignores both; admin route forwards
@@ -10347,7 +10237,7 @@ async function hybrid(session, embed2, params) {
10347
10237
  `UNWIND $nodeIds AS nid
10348
10238
  MATCH (n)-[r]-(related)
10349
10239
  WHERE elementId(n) = nid
10350
- AND ${(0, import_dist2.notTrashed)("related")}
10240
+ AND ${(0, import_dist.notTrashed)("related")}
10351
10241
  ${expandScopeClause}
10352
10242
  ${expandAgentClause}
10353
10243
  WITH nid, n, r, related
@@ -10537,7 +10427,7 @@ app22.get("/", requireAdminSession, async (c) => {
10537
10427
  mode: res.mode,
10538
10428
  embedError: res.embedError,
10539
10429
  elapsedMs: total,
10540
- // Task 967 — UI surfaces ("N suppressed — show all" affordance on
10430
+ // UI surfaces ("N suppressed — show all" affordance on
10541
10431
  // /graph and /data). `suppressed` is the count of rows the lib
10542
10432
  // dropped via the vector-cosine floor; `threshold` echoes the value
10543
10433
  // applied (null when no filter ran). `bm25Bypass` is operator-only
@@ -10581,7 +10471,7 @@ var GRAPH_LABEL_COLOURS = {
10581
10471
  AccessGrant: "#66381F",
10582
10472
  // Knowledge — moss family (organic)
10583
10473
  KnowledgeDocument: "#6E8A5A",
10584
- // Task 891 — chunked WhatsApp/messaging archive parent. Sits in the
10474
+ // chunked WhatsApp/messaging archive parent. Sits in the
10585
10475
  // knowledge moss family because it's structurally a document parent
10586
10476
  // (HAS_SECTION → :Section:Conversation chunks); the conversational
10587
10477
  // plum family is reserved for the live Conversation/Message labels.
@@ -10597,7 +10487,7 @@ var GRAPH_LABEL_COLOURS = {
10597
10487
  ImageObject: "#A0BB8C",
10598
10488
  // Conversational — muted plum/lavender family
10599
10489
  //
10600
- // Pairwise-distinctness invariants (carried forward from the Task 649
10490
+ // Pairwise-distinctness invariants (carried forward
10601
10491
  // palette):
10602
10492
  // - Four sublabelled conversation/message labels (AdminConversation,
10603
10493
  // PublicConversation, UserMessage, AssistantMessage) are pairwise
@@ -10632,7 +10522,7 @@ var GRAPH_LABEL_COLOURS = {
10632
10522
  // confusion doesn't apply, but kept distinguishable for the legend)
10633
10523
  Email: "#6F7F4A",
10634
10524
  EmailAccount: "#91A063",
10635
- // Public-agent projection (Task 837) — burnished bronze sits between
10525
+ // Public-agent projection — burnished bronze sits between
10636
10526
  // people-terracotta and email-moss but shares neither hue, signalling
10637
10527
  // "operator-defined persona that traverses to KnowledgeDocuments,
10638
10528
  // Conversations, and other entities" without colliding with any existing
@@ -10884,7 +10774,7 @@ async function handleNeighbourhood(c, accountId) {
10884
10774
  // bare JS `number` works on Pi 4 today but errors on driver versions
10885
10775
  // that strictly type-check LIMIT clauses against Long.
10886
10776
  neighbourhoodLimit: neo4j.int(NEIGHBOURHOOD_LIMIT),
10887
- // Task 886 §C — same Long-int discipline for the cluster-expand cap.
10777
+ // same Long-int discipline for the cluster-expand cap.
10888
10778
  // Used by NEIGHBOURHOOD_CYPHER's `siblingMessages[0..$clusterMessagesCap]`
10889
10779
  // slice. The search-intersect variant ignores it (cluster-expand
10890
10780
  // does not apply when search is narrowing the canvas).
@@ -11620,7 +11510,7 @@ function validateBody2(body) {
11620
11510
  ok: false,
11621
11511
  code: "not-eligible-chip",
11622
11512
  label: lbl,
11623
- reason: `label "${lbl}" is not eligible for default view \u2014 outside the chip allowlist (FILTER_TOP_LEVEL_LABELS, Task 753)`
11513
+ reason: `label "${lbl}" is not eligible for default view \u2014 outside the chip allowlist (FILTER_TOP_LEVEL_LABELS)`
11624
11514
  };
11625
11515
  }
11626
11516
  seen.add(lbl);
@@ -12057,10 +11947,10 @@ var sidebar_artefact_content_default = app31;
12057
11947
 
12058
11948
  // server/routes/admin/health.ts
12059
11949
  import { existsSync as existsSync19, readFileSync as readFileSync16 } from "fs";
12060
- import { resolve as resolve19, join as join12 } from "path";
11950
+ import { resolve as resolve19, join as join11 } from "path";
12061
11951
  var PLATFORM_ROOT6 = process.env.MAXY_PLATFORM_ROOT ?? resolve19(process.cwd(), "..");
12062
11952
  var brandHostname = "maxy";
12063
- var brandJsonPath = join12(PLATFORM_ROOT6, "config", "brand.json");
11953
+ var brandJsonPath = join11(PLATFORM_ROOT6, "config", "brand.json");
12064
11954
  if (existsSync19(brandJsonPath)) {
12065
11955
  try {
12066
11956
  const brand = JSON.parse(readFileSync16(brandJsonPath, "utf-8"));
@@ -12644,7 +12534,7 @@ function clientFrom(c) {
12644
12534
  );
12645
12535
  }
12646
12536
  var PLATFORM_ROOT7 = process.env.MAXY_PLATFORM_ROOT || "";
12647
- var BRAND_JSON_PATH = PLATFORM_ROOT7 ? join13(PLATFORM_ROOT7, "config", "brand.json") : "";
12537
+ var BRAND_JSON_PATH = PLATFORM_ROOT7 ? join12(PLATFORM_ROOT7, "config", "brand.json") : "";
12648
12538
  var BRAND = { productName: "Maxy", hostname: "maxy", configDir: ".maxy", domain: "getmaxy.com" };
12649
12539
  if (BRAND_JSON_PATH && !existsSync22(BRAND_JSON_PATH)) {
12650
12540
  console.error(`[brand] WARNING: brand.json not found at ${BRAND_JSON_PATH} \u2014 using Maxy defaults`);
@@ -12670,7 +12560,7 @@ var brandLoginOpts = {
12670
12560
  bodyFont: BRAND.defaultFonts?.body,
12671
12561
  logoContainsName: !!BRAND.logoContainsName
12672
12562
  };
12673
- var ALIAS_DOMAINS_PATH2 = join13(homedir5(), BRAND.configDir, "alias-domains.json");
12563
+ var ALIAS_DOMAINS_PATH2 = join12(homedir4(), BRAND.configDir, "alias-domains.json");
12674
12564
  function loadAliasDomains() {
12675
12565
  try {
12676
12566
  if (!existsSync22(ALIAS_DOMAINS_PATH2)) return null;
@@ -13116,7 +13006,7 @@ var brandScript = `<script>window.__BRAND__=${JSON.stringify({
13116
13006
  function readInstalledVersion() {
13117
13007
  try {
13118
13008
  if (!PLATFORM_ROOT7) return "unknown";
13119
- const versionFile = join13(PLATFORM_ROOT7, "config", `.${BRAND.hostname}-version`);
13009
+ const versionFile = join12(PLATFORM_ROOT7, "config", `.${BRAND.hostname}-version`);
13120
13010
  if (!existsSync22(versionFile)) return "unknown";
13121
13011
  const content = readFileSync19(versionFile, "utf-8").trim();
13122
13012
  return content || "unknown";
@@ -13175,14 +13065,14 @@ ${clientErrorReporterScript}
13175
13065
  }
13176
13066
  var brandedHtmlCache = /* @__PURE__ */ new Map();
13177
13067
  function loadBrandingCache(agentSlug) {
13178
- const configDir2 = join13(homedir5(), BRAND.configDir);
13068
+ const configDir2 = join12(homedir4(), BRAND.configDir);
13179
13069
  try {
13180
- const accountJsonPath = join13(configDir2, "account.json");
13070
+ const accountJsonPath = join12(configDir2, "account.json");
13181
13071
  if (!existsSync22(accountJsonPath)) return null;
13182
13072
  const account = JSON.parse(readFileSync19(accountJsonPath, "utf-8"));
13183
13073
  const accountId = account.accountId;
13184
13074
  if (!accountId) return null;
13185
- const cachePath = join13(configDir2, "branding-cache", accountId, `${agentSlug}.json`);
13075
+ const cachePath = join12(configDir2, "branding-cache", accountId, `${agentSlug}.json`);
13186
13076
  if (!existsSync22(cachePath)) return null;
13187
13077
  return JSON.parse(readFileSync19(cachePath, "utf-8"));
13188
13078
  } catch {
@@ -13191,8 +13081,8 @@ function loadBrandingCache(agentSlug) {
13191
13081
  }
13192
13082
  function resolveDefaultSlug() {
13193
13083
  try {
13194
- const configDir2 = join13(homedir5(), BRAND.configDir);
13195
- const accountJsonPath = join13(configDir2, "account.json");
13084
+ const configDir2 = join12(homedir4(), BRAND.configDir);
13085
+ const accountJsonPath = join12(configDir2, "account.json");
13196
13086
  if (!existsSync22(accountJsonPath)) return null;
13197
13087
  const account = JSON.parse(readFileSync19(accountJsonPath, "utf-8"));
13198
13088
  return account.defaultAgent || null;
@@ -13316,20 +13206,6 @@ app35.get("/data", (c) => {
13316
13206
  if (isPublicHost(host)) return c.text("Not found", 404);
13317
13207
  return c.html(cachedHtml("data.html"));
13318
13208
  });
13319
- app35.get("/docs/desktop-code-controls", (c) => {
13320
- const host = (c.req.header("host") ?? "").split(":")[0];
13321
- if (isPublicHost(host)) return c.text("Not found", 404);
13322
- const docsPath = PLATFORM_ROOT7 ? resolve22(PLATFORM_ROOT7, "..", "docs", "desktop-code-controls.md") : resolve22(process.cwd(), "docs", "desktop-code-controls.md");
13323
- if (!existsSync22(docsPath)) {
13324
- console.error(`[docs] desktop-code-controls.md missing at ${docsPath}`);
13325
- return c.text(`docs/desktop-code-controls.md not found at ${docsPath}`, 404);
13326
- }
13327
- const md = readFileSync19(docsPath, "utf-8");
13328
- const escaped = md.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
13329
- return c.html(
13330
- `<!doctype html><meta charset="utf-8"><title>Desktop Code-tab controls</title><style>body{font:14px/1.55 -apple-system,system-ui,sans-serif;max-width:760px;margin:2rem auto;padding:0 1rem;color:#111}pre{white-space:pre-wrap;font:inherit}</style><pre>${escaped}</pre>`
13331
- );
13332
- });
13333
13209
  app35.get("/:slug", async (c, next) => {
13334
13210
  const slug = c.req.param("slug");
13335
13211
  if (AGENT_SLUG_PATTERN.test(`/${slug}`)) {
@@ -13454,11 +13330,11 @@ reconcileEnabledPlugins(bootAccount?.accountDir, bootAccount?.config);
13454
13330
  (async () => {
13455
13331
  if (!bootAccount) return;
13456
13332
  try {
13457
- const { recoverRunningCloudflareTasks } = await import("./cloudflare-task-tracker-4PKOLE4H.js");
13333
+ const { recoverRunningCloudflareTasks } = await import("./cloudflare-task-tracker-NEB3X6O2.js");
13458
13334
  const result = await recoverRunningCloudflareTasks(
13459
13335
  bootAccount.accountId,
13460
13336
  configDirForWhatsApp,
13461
- // Task 985 — no conversationId at boot. The reconciler operates on
13337
+ // no conversationId at boot. The reconciler operates on
13462
13338
  // Tasks whose Conversation is already linked via RAISED_DURING; the
13463
13339
  // tracker resolves the conversationId off that edge when present.
13464
13340
  // Pass null and let the recovery path pick it up.
@@ -13514,7 +13390,7 @@ if (bootAccountConfig?.whatsapp) {
13514
13390
  }
13515
13391
  init({
13516
13392
  configDir: configDirForWhatsApp,
13517
- platformRoot: resolve22(process.env.MAXY_PLATFORM_ROOT ?? join13(__dirname, "..")),
13393
+ platformRoot: resolve22(process.env.MAXY_PLATFORM_ROOT ?? join12(__dirname, "..")),
13518
13394
  accountConfig: bootAccountConfig,
13519
13395
  onMessage: async (msg) => {
13520
13396
  if (process.env.WHATSAPP_PTY_BRIDGE_ENABLED === "true" && msg.text && !msg.isOwnerMirror) {