@memorax/memorax-code 0.1.2 → 0.1.4

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 (242) hide show
  1. package/README.md +16 -12
  2. package/bin/memorax-code-npm-preinstall.mjs +7 -2
  3. package/bin/memorax-code-opencode.mjs +4 -0
  4. package/bin/memorax-code-plugin-postinstall.mjs +342 -93
  5. package/docs/configuration.md +148 -35
  6. package/docs/troubleshooting.md +73 -13
  7. package/lib/dsh-plugin-install.mjs +22 -0
  8. package/lib/memorax-code-adapter-common/src/hooks/capture-cwd-hook.mjs +21 -14
  9. package/lib/memorax-code-adapter-common/src/hooks/ensure-backend-runner.mjs +26 -7
  10. package/lib/memorax-code-adapter-common/src/hooks/memory-skill-reminder-hook.mjs +86 -95
  11. package/lib/memorax-code-adapter-common/src/hooks/memory-skill-reminder-policy.mjs +58 -0
  12. package/lib/memorax-code-adapter-common/src/repo-memory/repo-memory-auto-build.mjs +2 -2
  13. package/lib/memorax-code-adapter-common/src/repo-memory/repo-memory-job-supervisor.mjs +1 -1
  14. package/lib/memorax-code-adapter-common/src/windows-cli-invocation.mjs +13 -1
  15. package/lib/memorax-code-backend/dist/app/backend-server.js +210 -0
  16. package/lib/memorax-code-backend/dist/{server-observability.js → app/memory-observability.js} +4 -4
  17. package/lib/memorax-code-backend/dist/{backend-state.js → app/state.js} +1 -1
  18. package/lib/memorax-code-backend/dist/{claude-adapter-lifecycle.js → clients/claude/lifecycle.js} +2 -2
  19. package/lib/memorax-code-backend/dist/{claude-memory-hook-runtime.js → clients/claude/memory-hook-runtime.js} +7 -7
  20. package/lib/memorax-code-backend/dist/clients/codex/lifecycle.js +131 -0
  21. package/lib/memorax-code-backend/dist/{codex-memory-hook-runtime.js → clients/codex/memory-hook-runtime.js} +9 -9
  22. package/lib/memorax-code-backend/dist/{codex-plugin-hooks.js → clients/codex/plugin-hooks.js} +1 -1
  23. package/lib/memorax-code-backend/dist/{codex-plugin-install.js → clients/codex/plugin-install.js} +6 -6
  24. package/lib/memorax-code-backend/dist/clients/dsh/lifecycle.js +75 -0
  25. package/lib/memorax-code-backend/dist/clients/dsh/memory-hook-runtime.js +258 -0
  26. package/lib/memorax-code-backend/dist/clients/dsh/session-turn.js +249 -0
  27. package/lib/memorax-code-backend/dist/clients/opencode/lifecycle.js +54 -0
  28. package/lib/memorax-code-backend/dist/clients/opencode/memory-hook-runtime.js +277 -0
  29. package/lib/memorax-code-backend/dist/clients/opencode/message-turn.js +78 -0
  30. package/lib/memorax-code-backend/dist/codex-adapter-lifecycle.js +1 -131
  31. package/lib/memorax-code-backend/dist/{memorax-code-config.js → config/memorax-code.js} +32 -4
  32. package/lib/memorax-code-backend/dist/{server-cli.js → entrypoints/backend-cli.js} +137 -37
  33. package/lib/memorax-code-backend/dist/jsonl-append.js +1 -75
  34. package/lib/memorax-code-backend/dist/{active-client-selection.js → lifecycle/active-clients.js} +12 -1
  35. package/lib/memorax-code-backend/dist/{backend-service-cleanup.js → lifecycle/backend/cleanup.js} +1 -1
  36. package/lib/memorax-code-backend/dist/{backend-service-record.js → lifecycle/backend/record.js} +1 -1
  37. package/lib/memorax-code-backend/dist/{backend-service-result.js → lifecycle/backend/result.js} +2 -2
  38. package/lib/memorax-code-backend/dist/{service.js → lifecycle/backend/service.js} +16 -16
  39. package/lib/memorax-code-backend/dist/{backend-token-record.js → lifecycle/backend/token-record.js} +1 -1
  40. package/lib/memorax-code-backend/dist/{backend-service-token.js → lifecycle/backend/token.js} +2 -2
  41. package/lib/memorax-code-backend/dist/lifecycle/client-plugin-removal.js +109 -0
  42. package/lib/memorax-code-backend/dist/{client-selection.js → lifecycle/client-selection.js} +11 -5
  43. package/lib/memorax-code-backend/dist/{backend-lifecycle-lock.js → lifecycle/lock.js} +1 -1
  44. package/lib/memorax-code-backend/dist/{memorax-code-lifecycle.js → lifecycle/orchestrator.js} +325 -39
  45. package/lib/memorax-code-backend/dist/memorax-cli.js +1 -1
  46. package/lib/memorax-code-backend/dist/memorax-code.js +1 -1
  47. package/lib/memorax-code-backend/dist/{automatic-memory-retrieval.js → memory/automatic-retrieval.js} +3 -3
  48. package/lib/memorax-code-backend/dist/{automatic-memory-writeback.js → memory/automatic-writeback.js} +75 -21
  49. package/lib/memorax-code-backend/dist/{memory-cli.js → memory/cli.js} +23 -10
  50. package/lib/memorax-code-backend/dist/{memory-hook-command.js → memory/hook-command.js} +156 -9
  51. package/lib/memorax-code-backend/dist/memory/observability.js +1 -0
  52. package/lib/memorax-code-backend/dist/memory/payload-redaction.js +212 -0
  53. package/lib/memorax-code-backend/dist/{memory-reminder-trace-recorder.js → memory/reminder-trace-recorder.js} +20 -7
  54. package/lib/memorax-code-backend/dist/{repository-memory-context.js → memory/repository-session.js} +2 -2
  55. package/lib/memorax-code-backend/dist/{memory-service.js → memory/service.js} +27 -5
  56. package/lib/memorax-code-backend/dist/{memory-turn-coordinator.js → memory/turn-coordinator.js} +2 -1
  57. package/lib/memorax-code-backend/dist/{memory-writeback-buffer.js → memory/writeback-buffer.js} +3 -3
  58. package/lib/memorax-code-backend/dist/{memory-writeback-chunk.js → memory/writeback-chunk.js} +1 -1
  59. package/lib/memorax-code-backend/dist/{memory-writeback-reconciler.js → memory/writeback-reconciler.js} +6 -6
  60. package/lib/memorax-code-backend/dist/{memory-writeback-task-projection.js → memory/writeback-task-projection.js} +4 -4
  61. package/lib/memorax-code-backend/dist/{memorax-adapter.js → provider/memorax/adapter.js} +5 -5
  62. package/lib/memorax-code-backend/dist/{memorax-config.js → provider/memorax/config.js} +4 -4
  63. package/lib/memorax-code-backend/dist/{memorax-http.js → provider/memorax/http.js} +1 -1
  64. package/lib/memorax-code-backend/dist/{repo-memory-readiness.js → repository/readiness.js} +3 -3
  65. package/lib/memorax-code-backend/dist/server.js +3 -212
  66. package/lib/memorax-code-backend/dist/service-entrypoint.js +1 -1
  67. package/lib/memorax-code-backend/dist/{debug-log.js → shared/debug-log.js} +1 -1
  68. package/lib/memorax-code-backend/dist/shared/jsonl-append.js +75 -0
  69. package/lib/memorax-code-backend/dist/shared/windows-cli-invocation.js +148 -0
  70. package/lib/memorax-code-backend/dist/{trace-config.js → trace/config.js} +43 -5
  71. package/lib/memorax-code-backend/dist/{trace-context.js → trace/context.js} +53 -2
  72. package/lib/memorax-code-backend/dist/{trace-store.js → trace/store.js} +3 -3
  73. package/lib/memorax-code-backend/dist/{server-health.js → transport/http/health.js} +1 -1
  74. package/lib/memorax-code-backend/dist/{server-memory-hook.js → transport/http/memory-hook.js} +3 -3
  75. package/lib/memorax-code-backend/dist/{server-http.js → transport/http/request.js} +1 -1
  76. package/lib/memorax-code-backend/dist/{claude-local-transcript.js → viewer/history/claude-transcript.js} +3 -3
  77. package/lib/memorax-code-backend/dist/{memory-viewer-session-title.js → viewer/history/session-title.js} +1 -1
  78. package/lib/memorax-code-backend/dist/{server-memory-viewer.js → viewer/http/public-routes.js} +15 -15
  79. package/lib/memorax-code-backend/dist/viewer/model.js +1 -0
  80. package/lib/memorax-code-backend/dist/{memory-viewer-activity.js → viewer/projection/activity.js} +2 -2
  81. package/lib/memorax-code-backend/dist/{memory-viewer-history-projection.js → viewer/projection/history.js} +1 -1
  82. package/lib/memorax-code-backend/dist/{memory-viewer-observability.js → viewer/projection/observability.js} +1 -1
  83. package/lib/memorax-code-backend/dist/{memory-viewer-user-projection.js → viewer/projection/user.js} +1 -1
  84. package/lib/memorax-code-backend/dist/{memory-viewer-writeback-status.js → viewer/projection/writeback-status.js} +1 -1
  85. package/lib/memorax-code-backend/dist/{memory-viewer-store.js → viewer/store.js} +59 -32
  86. package/lib/memorax-code-backend/dist/{memory-viewer-user-html.js → viewer/ui/user-html.js} +11 -10
  87. package/lib/memorax-code-backend/dist/windows-cli-invocation.js +1 -148
  88. package/lib/memorax-code-backend/package.json +3 -3
  89. package/lib/memorax-code-claude-adapter/.claude-plugin/plugin.json +1 -1
  90. package/lib/memorax-code-claude-adapter/hooks/runtime-shell.json +1 -1
  91. package/lib/memorax-code-claude-adapter/package.json +1 -1
  92. package/lib/memorax-code-claude-adapter/skills/memorax-code/SKILL.md +11 -2
  93. package/lib/memorax-code-claude-adapter/skills/memorax-code/defaults.json +8 -5
  94. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/memorax-add.md +1 -1
  95. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/memorax-search.md +37 -9
  96. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/personal-read.md +1 -1
  97. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/personal-write.md +33 -13
  98. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-build.md +62 -13
  99. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-read.md +11 -4
  100. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-templates.md +179 -59
  101. package/lib/memorax-code-claude-adapter/skills/memorax-code/references/repo-update.md +18 -7
  102. package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/collect_all.py +122 -39
  103. package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/detect_updates.py +73 -10
  104. package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/github_resource_facets.py +9 -1
  105. package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +9 -1
  106. package/lib/memorax-code-claude-adapter/skills/memorax-code/scripts/validate_memory.py +23 -1
  107. package/lib/memorax-code-claude-adapter/src/plugin-install.mjs +1 -0
  108. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/.claude-plugin/plugin.json +1 -1
  109. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/hooks/runtime-shell.json +1 -1
  110. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/capture-cwd-hook.mjs +21 -14
  111. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/ensure-backend-runner.mjs +26 -7
  112. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/memory-skill-reminder-hook.mjs +86 -95
  113. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/hooks/memory-skill-reminder-policy.mjs +58 -0
  114. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/repo-memory/repo-memory-auto-build.mjs +2 -2
  115. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/repo-memory/repo-memory-job-supervisor.mjs +1 -1
  116. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/memorax-code-adapter-common/src/windows-cli-invocation.mjs +13 -1
  117. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/package.json +1 -1
  118. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/SKILL.md +11 -2
  119. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/defaults.json +8 -5
  120. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/memorax-add.md +1 -1
  121. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/memorax-search.md +37 -9
  122. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/personal-read.md +1 -1
  123. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/personal-write.md +33 -13
  124. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-build.md +62 -13
  125. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-read.md +11 -4
  126. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-templates.md +179 -59
  127. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/repo-update.md +18 -7
  128. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/collect_all.py +122 -39
  129. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/detect_updates.py +73 -10
  130. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/github_resource_facets.py +9 -1
  131. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +9 -1
  132. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/scripts/validate_memory.py +23 -1
  133. package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/src/plugin-install.mjs +1 -0
  134. package/lib/memorax-code-codex-adapter/.codex-plugin/plugin.json +1 -1
  135. package/lib/memorax-code-codex-adapter/hooks/runtime-shell.json +1 -1
  136. package/lib/memorax-code-codex-adapter/package.json +1 -1
  137. package/lib/memorax-code-codex-adapter/runtime-hooks/memory-skill-reminder.mjs +10 -2
  138. package/lib/memorax-code-codex-adapter/skills/memorax-code/SKILL.md +11 -2
  139. package/lib/memorax-code-codex-adapter/skills/memorax-code/defaults.json +8 -5
  140. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/memorax-add.md +1 -1
  141. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/memorax-search.md +37 -9
  142. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/personal-read.md +1 -1
  143. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/personal-write.md +33 -13
  144. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-build.md +62 -13
  145. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-read.md +11 -4
  146. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-templates.md +179 -59
  147. package/lib/memorax-code-codex-adapter/skills/memorax-code/references/repo-update.md +18 -7
  148. package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/collect_all.py +122 -39
  149. package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/detect_updates.py +73 -10
  150. package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/github_resource_facets.py +9 -1
  151. package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +9 -1
  152. package/lib/memorax-code-codex-adapter/skills/memorax-code/scripts/validate_memory.py +23 -1
  153. package/lib/memorax-code-dsh-adapter/cordis.patch.yml +10 -0
  154. package/lib/memorax-code-dsh-adapter/hooks/repo-memory-job.mjs +68 -0
  155. package/lib/memorax-code-dsh-adapter/package.json +69 -0
  156. package/lib/memorax-code-dsh-adapter/skills/memorax-code/SKILL.md +91 -0
  157. package/lib/memorax-code-dsh-adapter/skills/memorax-code/agents/claude.yaml +10 -0
  158. package/lib/memorax-code-dsh-adapter/skills/memorax-code/agents/openai.yaml +7 -0
  159. package/lib/memorax-code-dsh-adapter/skills/memorax-code/defaults.json +12 -0
  160. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/memorax-add.md +86 -0
  161. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/memorax-search.md +91 -0
  162. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/personal-read.md +46 -0
  163. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/personal-write.md +120 -0
  164. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/repo-build.md +319 -0
  165. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/repo-read.md +103 -0
  166. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/repo-templates.md +390 -0
  167. package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/repo-update.md +127 -0
  168. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/collect_all.py +579 -0
  169. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/detect_updates.py +919 -0
  170. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/git_commit_facets.py +222 -0
  171. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/github_resource_facets.py +512 -0
  172. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +517 -0
  173. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/prepare_repo_memory.py +411 -0
  174. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/user_profile_memory.py +528 -0
  175. package/lib/memorax-code-dsh-adapter/skills/memorax-code/scripts/validate_memory.py +248 -0
  176. package/lib/memorax-code-dsh-adapter/src/backend-client.mjs +119 -0
  177. package/lib/memorax-code-dsh-adapter/src/dsh-message.mjs +32 -0
  178. package/lib/memorax-code-dsh-adapter/src/dsh-version.mjs +18 -0
  179. package/lib/memorax-code-dsh-adapter/src/http-client.mjs +55 -0
  180. package/lib/memorax-code-dsh-adapter/src/index.mjs +72 -0
  181. package/lib/memorax-code-dsh-adapter/src/personal-context-worker.mjs +48 -0
  182. package/lib/memorax-code-dsh-adapter/src/personal-context.mjs +114 -0
  183. package/lib/memorax-code-dsh-adapter/src/plugin.mjs +724 -0
  184. package/lib/memorax-code-dsh-adapter/src/profile-lifecycle.mjs +1358 -0
  185. package/lib/memorax-code-dsh-adapter/src/protocol.mjs +145 -0
  186. package/lib/memorax-code-dsh-adapter/src/runtime-state.mjs +132 -0
  187. package/lib/memorax-code-opencode-adapter/hooks/repo-memory-job.mjs +37 -0
  188. package/lib/memorax-code-opencode-adapter/package.json +10 -0
  189. package/lib/memorax-code-opencode-adapter/skills/memorax-code/SKILL.md +91 -0
  190. package/lib/memorax-code-opencode-adapter/skills/memorax-code/agents/claude.yaml +10 -0
  191. package/lib/memorax-code-opencode-adapter/skills/memorax-code/agents/openai.yaml +7 -0
  192. package/lib/memorax-code-opencode-adapter/skills/memorax-code/defaults.json +12 -0
  193. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/memorax-add.md +86 -0
  194. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/memorax-search.md +91 -0
  195. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/personal-read.md +46 -0
  196. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/personal-write.md +120 -0
  197. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/repo-build.md +319 -0
  198. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/repo-read.md +103 -0
  199. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/repo-templates.md +390 -0
  200. package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/repo-update.md +127 -0
  201. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/collect_all.py +579 -0
  202. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/detect_updates.py +919 -0
  203. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/git_commit_facets.py +222 -0
  204. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/github_resource_facets.py +512 -0
  205. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +517 -0
  206. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/prepare_repo_memory.py +411 -0
  207. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/user_profile_memory.py +528 -0
  208. package/lib/memorax-code-opencode-adapter/skills/memorax-code/scripts/validate_memory.py +248 -0
  209. package/lib/memorax-code-opencode-adapter/src/adapter-paths.mjs +37 -0
  210. package/lib/memorax-code-opencode-adapter/src/cli.mjs +260 -0
  211. package/lib/memorax-code-opencode-adapter/src/diagnostics.mjs +31 -0
  212. package/lib/memorax-code-opencode-adapter/src/plugin-install.mjs +673 -0
  213. package/lib/memorax-code-opencode-adapter/src/plugin.mjs +539 -0
  214. package/lib/memorax-code-opencode-adapter/src/repo-memory-server-runner.mjs +442 -0
  215. package/lib/run-entrypoint.mjs +6 -0
  216. package/package.json +7 -3
  217. package/lib/memorax-code-backend/dist/client-plugin-removal.js +0 -67
  218. /package/lib/memorax-code-backend/dist/{claude-transcript-turn.js → clients/claude/transcript-turn.js} +0 -0
  219. /package/lib/memorax-code-backend/dist/{codex-effective-prompt.js → clients/codex/effective-prompt.js} +0 -0
  220. /package/lib/memorax-code-backend/dist/{codex-rollout-turn.js → clients/codex/rollout-turn.js} +0 -0
  221. /package/lib/memorax-code-backend/dist/{codex-session-turn-index.js → clients/codex/session-turn-index.js} +0 -0
  222. /package/lib/memorax-code-backend/dist/{codex-workspace-links.js → clients/codex/workspace-links.js} +0 -0
  223. /package/lib/memorax-code-backend/dist/{backend-env.js → config/backend-env.js} +0 -0
  224. /package/lib/memorax-code-backend/dist/{proxy-env.js → config/proxy-env.js} +0 -0
  225. /package/lib/memorax-code-backend/dist/{entrypoint.js → entrypoints/main.js} +0 -0
  226. /package/lib/memorax-code-backend/dist/{backend-process.js → lifecycle/backend/process.js} +0 -0
  227. /package/lib/memorax-code-backend/dist/{backend-shutdown-request.js → lifecycle/backend/shutdown-request.js} +0 -0
  228. /package/lib/memorax-code-backend/dist/{backend-status.js → lifecycle/backend/status.js} +0 -0
  229. /package/lib/memorax-code-backend/dist/{adapter-lifecycle-participant.js → lifecycle/contracts.js} +0 -0
  230. /package/lib/memorax-code-backend/dist/{install-watchdog.js → lifecycle/install-watchdog.js} +0 -0
  231. /package/lib/memorax-code-backend/dist/{memory-observability.js → lifecycle/participant.js} +0 -0
  232. /package/lib/memorax-code-backend/dist/{memory-project.js → memory/project.js} +0 -0
  233. /package/lib/memorax-code-backend/dist/{repository-memory-scope.js → repository/scope.js} +0 -0
  234. /package/lib/memorax-code-backend/dist/{incremental-jsonl-projection.js → shared/incremental-jsonl-projection.js} +0 -0
  235. /package/lib/memorax-code-backend/dist/{utils.js → shared/record.js} +0 -0
  236. /package/lib/memorax-code-backend/dist/{server-json.js → transport/http/json.js} +0 -0
  237. /package/lib/memorax-code-backend/dist/{memory-viewer-data-projection-cache.js → viewer/projection/cache.js} +0 -0
  238. /package/lib/memorax-code-backend/dist/{memory-viewer-event-identity.js → viewer/projection/event-identity.js} +0 -0
  239. /package/lib/memorax-code-backend/dist/{memory-viewer-redaction.js → viewer/projection/redaction.js} +0 -0
  240. /package/lib/memorax-code-backend/dist/{memory-viewer-turn-reference.js → viewer/projection/turn-reference.js} +0 -0
  241. /package/lib/memorax-code-backend/dist/{memory-viewer-icon.js → viewer/ui/icon.js} +0 -0
  242. /package/lib/memorax-code-backend/dist/{memory-viewer-logo.js → viewer/ui/logo.js} +0 -0
@@ -38,12 +38,13 @@ are not a compatibility contract.
38
38
 
39
39
  ## New configuration
40
40
 
41
- The generated template selects both clients, disables automatic retrieval,
42
- enables automatic writeback, sets the preferred language to Chinese (`zh`),
43
- uses a five-turn skill reminder and the adaptive repository-update policy, and
44
- enables content-bearing local traces for both clients. npm installation may
45
- narrow `[clients]` to clients detected on the host. The tables below list all
46
- fallbacks, including tuning fields omitted from the generated file.
41
+ The generated template selects all four client integrations, disables automatic
42
+ retrieval, enables automatic writeback, sets the preferred language to Chinese
43
+ (`zh`), uses a five-turn skill reminder and the adaptive repository-update
44
+ policy, and enables content-bearing local traces for Codex, Claude Code, and
45
+ OpenCode. npm installation may narrow `[clients]` to clients detected on the
46
+ host. The tables below list all fallbacks, including tuning fields omitted from
47
+ the generated file.
47
48
 
48
49
  On POSIX systems MemoraX Code creates `$MEMORAX_CODE_HOME` with mode `0700`
49
50
  and a new `config.toml` with mode `0600`. Windows relies on the current user's
@@ -51,16 +52,25 @@ filesystem ACLs.
51
52
 
52
53
  ## Client selection
53
54
 
54
- If `[clients]` is absent, lifecycle commands select both clients. If it is
55
- present, `codex` and `claude` are boolean fields and an omitted client is
56
- disabled. The command-line override is:
55
+ If `[clients]` is absent, lifecycle commands select Codex, Claude Code, DSH,
56
+ and OpenCode. If it is present, `codex`, `claude`, `dsh`, and `opencode` are
57
+ boolean fields. Omitted `codex`, `claude`, or `opencode` values are disabled;
58
+ an omitted `dsh` value remains enabled so configurations written before DSH
59
+ support can discover an existing local Harness. Set `dsh = false` explicitly
60
+ to disable that integration. The command-line override accepts a
61
+ comma-separated subset:
57
62
 
58
63
  ```text
59
- --clients codex|claude|codex,claude|all|none
64
+ --clients codex|claude|dsh|opencode|<comma-separated subset>|all|none
60
65
  ```
61
66
 
62
- A normal npm install or reinstall refreshes `[clients]` from the runnable
63
- clients detected at that time. Update-mode postinstall runs preserve enabled
67
+ A normal npm install or reinstall refreshes `[clients]` from the available
68
+ clients detected at that time. OpenCode is available when its explicit, XDG,
69
+ or default configuration directory exists, or when `opencode` is on `PATH`.
70
+ DSH is available when at least one valid Profile exists under
71
+ `$DSH_HOME/profiles`; `DSH_HOME` defaults to `~/.dsh`. An explicit
72
+ `[clients].dsh = false` is preserved.
73
+ Update-mode postinstall runs preserve enabled
64
74
  clients and also probe each disabled client. An interactive update offers each
65
75
  runnable disabled integration for activation with a default of yes. Declining
66
76
  the prompt, or running non-interactively, keeps that integration disabled. A
@@ -69,9 +79,64 @@ configuration instead of being permanently disabled. When an update newly
69
79
  enables Codex, it requests initial Hook activation after the client-selection
70
80
  prompt.
71
81
 
72
- Client selection controls plugin and Hook lifecycle only. It does not change
73
- Codex or Claude Code provider settings. `--clients none` runs the Backend
74
- without managing either client integration.
82
+ Client selection controls managed client-integration lifecycle only. It does
83
+ not change Codex, Claude Code, DSH, or OpenCode provider settings.
84
+ `--clients none` runs the Backend without managing a client integration.
85
+
86
+ ## DeepSeek Harness integration paths
87
+
88
+ DSH Profiles are discovered under:
89
+
90
+ ```text
91
+ $DSH_HOME/profiles/<profile-name>/
92
+ ```
93
+
94
+ `DSH_HOME` defaults to `~/.dsh`. The managed ownership record lives at
95
+ `$MEMORAX_CODE_HOME/adapters/dsh/state.json`. Runtime packages are materialized
96
+ under `$MEMORAX_CODE_HOME/adapters/dsh/runtime/generations/` and installed into
97
+ Profiles through DSH's native plugin command. The globally installed npm
98
+ package remains immutable; do not copy or edit the generated state or runtime
99
+ directories by hand. When at least one valid Profile exists but none provides
100
+ a loadable `@deepseek-ai/dsh-headless` bundle, MemoraX Code asks the same native
101
+ plugin command to initialize the standard `headless` Profile when that name is
102
+ available. Stop and uninstall remove the MemoraX Code adapter from this Profile
103
+ but preserve the Profile and its native data.
104
+
105
+ MemoraX Code is tested with DSH `0.1.0-rc.6`. Other valid semantic versions are
106
+ accepted but appear as untested in status output; compatibility is not
107
+ guaranteed. An unavailable or malformed `dsh --version` result fails Profile
108
+ reconciliation when a Profile exists. Run `memorax-code start --clients dsh`
109
+ after changing `DSH_HOME`, DSH, or its Profiles.
110
+
111
+ ## OpenCode integration paths
112
+
113
+ The managed OpenCode plugin loader and shared skill use OpenCode's automatic
114
+ discovery directories:
115
+
116
+ ```text
117
+ ~/.config/opencode/plugins/memorax-code.js
118
+ ~/.config/opencode/skills/memorax-code/
119
+ ```
120
+
121
+ Set `OPENCODE_CONFIG_DIR` to override the complete OpenCode configuration root.
122
+ Otherwise, `XDG_CONFIG_HOME` replaces `~/.config` when set. The managed adapter
123
+ record lives at `$MEMORAX_CODE_HOME/adapters/opencode/state.json`. Content-free
124
+ plugin runtime evidence lives beside it in `workspaces.json` and records only
125
+ the observed event, workspace, optional session identifier, and timestamp.
126
+
127
+ MemoraX Code does not add entries to or otherwise modify `opencode.json` or
128
+ `opencode.jsonc`. Restart or refresh OpenCode after installation or after these
129
+ managed assets change.
130
+
131
+ The managed loader records the exact MemoraX Code home, OpenCode configuration
132
+ directory, installed Node runtime, and `memorax-code` entrypoint. When the
133
+ enabled plugin loads, it performs a best-effort Backend health check and uses
134
+ those installed package paths to restore an unavailable loopback Backend. A
135
+ prompt waits no more than the plugin instance's single five-second recovery
136
+ budget; if that budget expires, automatic memory handling for that turn is
137
+ skipped while recovery continues in the background. This preserves the
138
+ configured client selection. Remote Backend URLs, invalid connection
139
+ authority, and a removed package command are not recovered automatically.
75
140
 
76
141
  ## MemoraX connection
77
142
 
@@ -120,20 +185,20 @@ Automatic prompt retrieval is disabled by default.
120
185
  | `memory_type_order` | `MEMORAX_CODE_MEMORAX_MEMORY_TYPE_ORDER` | `core,episodic,semantic,procedural,unclassified` |
121
186
 
122
187
  The TOML form of `memory_type_order` is an array of strings; the environment
123
- form is comma-separated. `enabled` controls automatic `UserPromptSubmit`
124
- retrieval only. Explicit `memorax-cli search` remains available when
188
+ form is comma-separated. `enabled` controls automatic prompt retrieval only.
189
+ Explicit `memorax-cli search` remains available when
125
190
  credentials and a trusted workspace scope resolve.
126
191
 
127
192
  ## Writeback and explicit add
128
193
 
129
- New configurations explicitly set automatic transcript writeback to enabled.
194
+ New configurations explicitly set automatic completed-turn writeback to enabled.
130
195
  An existing configuration without `enabled` remains disabled.
131
196
 
132
197
  | Field | Environment override | Fallback |
133
198
  | --- | --- | --- |
134
199
  | `enabled` | `MEMORAX_CODE_MEMORY_WRITEBACK_ENABLED` | `false` when absent |
135
200
  | `buffer_enabled` | `MEMORAX_CODE_MEMORY_WRITEBACK_BUFFER_ENABLED` | `true` |
136
- | `buffer_max_turns` | `MEMORAX_CODE_MEMORY_WRITEBACK_BUFFER_MAX_TURNS` | `8`; `-1` disables automatic Hook writeback |
201
+ | `buffer_max_turns` | `MEMORAX_CODE_MEMORY_WRITEBACK_BUFFER_MAX_TURNS` | `8`; `-1` disables automatic writeback |
137
202
  | `buffer_max_age_ms` | `MEMORAX_CODE_MEMORY_WRITEBACK_BUFFER_MAX_AGE_MS` | `600000` |
138
203
  | `buffer_max_chars` | `MEMORAX_CODE_MEMORY_WRITEBACK_BUFFER_MAX_CHARS` | `128000` |
139
204
  | `max_message_chars` | `MEMORAX_CODE_MEMORY_WRITEBACK_MAX_MESSAGE_CHARS` | `64000` |
@@ -160,12 +225,42 @@ selecting another language. The setting affects newly generated content;
160
225
  `raw` input and client-supplied `pre_summarized` text are not translated.
161
226
  Command arguments override the other add defaults.
162
227
 
228
+ ### Automatic writeback redaction
229
+
230
+ Automatic writeback first bounds each user or assistant message with
231
+ `max_message_chars`, discarding an incomplete token at the cutoff, and then
232
+ runs a local best-effort detector before hashing, buffering, chunking, or
233
+ sending the content. The detector replaces these categories with typed
234
+ placeholders:
235
+
236
+ | Category | Placeholder |
237
+ | --- | --- |
238
+ | Private keys | `[REDACTED:PRIVATE_KEY]` |
239
+ | Authorization tokens and JWTs | `[REDACTED:AUTH_TOKEN]` |
240
+ | Cookie values | `[REDACTED:COOKIE]` |
241
+ | Common API key formats | `[REDACTED:API_KEY]` |
242
+ | Credential assignments, CLI arguments, URL query values, and URL passwords | `[REDACTED:CREDENTIAL]` |
243
+ | Email addresses | `[REDACTED:EMAIL]` |
244
+ | Long numbers, including common spaces, hyphens, and parentheses | `[REDACTED:LONG_NUMBER]` |
245
+ | UUIDs, fixed-length hexadecimal strings, and high-entropy alphanumeric identifiers | `[REDACTED:OPAQUE_ID]` |
246
+
247
+ If either bounded message has no meaningful content after replacement, the
248
+ automatic writeback is skipped before network dispatch. The detector is
249
+ always active for automatic writeback, but it is not a complete
250
+ data-loss-prevention system and may miss unknown or weak-context sensitive
251
+ formats. Explicit `memorax-cli add` content and Search queries are sent as
252
+ entered and do not pass through this detector.
253
+
163
254
  ## Skill reminder and repository maintenance
164
255
 
165
256
  `[memory.skill_reminder].interval_turns` defaults to `5`; its environment
166
257
  override is `MEMORAX_CODE_MEMORY_SKILL_REMINDER_INTERVAL_TURNS`. A positive
167
- value controls the reminder cadence for both clients, beginning with the first
168
- eligible prompt.
258
+ value controls the native skill reminder cadence for supported client
259
+ sessions, beginning with the first eligible prompt or Turn. The same interval
260
+ controls trusted repo-scoped Procedure Memory. User Profile preferences are
261
+ applied on first observation and restored with a personal-memory reminder
262
+ after successful context compaction. These local contexts remain separate
263
+ from automatic writeback content.
169
264
 
170
265
  | Field | Environment override | Fallback |
171
266
  | --- | --- | --- |
@@ -177,29 +272,45 @@ Supported policies are `every-commit`, `commit-count`, `daily`,
177
272
  `pull-request`, `pull-request-or-daily`, and `adaptive`. Invalid policy values
178
273
  fall back to `adaptive`.
179
274
 
180
- The first eligible prompt starts a background build only when the Backend has
181
- authorized a Git worktree and that worktree has no `.repo_memory/PROFILE.md`.
182
- If the Backend or workspace authority is unavailable, the Hook skips the
183
- initial build instead of falling back to its local `cwd`.
275
+ In Codex, Claude Code, DSH, and OpenCode, the first eligible prompt starts a
276
+ background build only when the Backend has authorized a Git worktree and that
277
+ worktree has no `.repo_memory/PROFILE.md`. If the Backend or workspace
278
+ authority is unavailable, the client integration skips that attempt instead
279
+ of falling back to its local workspace path. DSH schedules this work through
280
+ its native pre-step integration rather than a Hook.
281
+
282
+ A relevant repo-read runs supervised maintenance in all four clients. The
283
+ configured policy may select a build, update, or no-op. DSH maintenance
284
+ requires an enabled, managed Profile that includes `@deepseek-ai/dsh-headless`.
285
+ OpenCode executes the job through its active local server. Desktop-only
286
+ installations do not require a standalone `opencode` executable in `PATH`.
184
287
 
185
288
  ## Local traces
186
289
 
187
- `[trace.codex]` and `[trace.claude]` support the same fields:
290
+ `[trace.codex]`, `[trace.claude]`, `[trace.dsh]`, and `[trace.opencode]`
291
+ support the same fields:
188
292
 
189
- | Field | Codex environment | Claude environment | Fallback |
190
- | --- | --- | --- | --- |
191
- | `enabled` | `MEMORAX_CODE_CODEX_TRACE_ENABLED` | `MEMORAX_CODE_CLAUDE_TRACE_ENABLED` | `true` |
192
- | `capture_content` | `MEMORAX_CODE_CODEX_TRACE_CAPTURE_CONTENT` | `MEMORAX_CODE_CLAUDE_TRACE_CAPTURE_CONTENT` | `true` |
193
- | `retention_days` | `MEMORAX_CODE_CODEX_TRACE_RETENTION_DAYS` | `MEMORAX_CODE_CLAUDE_TRACE_RETENTION_DAYS` | `7` |
194
- | `max_event_chars` | `MEMORAX_CODE_CODEX_TRACE_MAX_EVENT_CHARS` | `MEMORAX_CODE_CLAUDE_TRACE_MAX_EVENT_CHARS` | `20000` |
195
- | `max_file_bytes` | `MEMORAX_CODE_CODEX_TRACE_MAX_FILE_BYTES` | `MEMORAX_CODE_CLAUDE_TRACE_MAX_FILE_BYTES` | `52428800` |
293
+ | Field | Codex environment | Claude environment | DSH environment | OpenCode environment | Fallback |
294
+ | --- | --- | --- | --- | --- | --- |
295
+ | `enabled` | `MEMORAX_CODE_CODEX_TRACE_ENABLED` | `MEMORAX_CODE_CLAUDE_TRACE_ENABLED` | `MEMORAX_CODE_DSH_TRACE_ENABLED` | `MEMORAX_CODE_OPENCODE_TRACE_ENABLED` | `true` |
296
+ | `capture_content` | `MEMORAX_CODE_CODEX_TRACE_CAPTURE_CONTENT` | `MEMORAX_CODE_CLAUDE_TRACE_CAPTURE_CONTENT` | `MEMORAX_CODE_DSH_TRACE_CAPTURE_CONTENT` | `MEMORAX_CODE_OPENCODE_TRACE_CAPTURE_CONTENT` | `true` |
297
+ | `retention_days` | `MEMORAX_CODE_CODEX_TRACE_RETENTION_DAYS` | `MEMORAX_CODE_CLAUDE_TRACE_RETENTION_DAYS` | `MEMORAX_CODE_DSH_TRACE_RETENTION_DAYS` | `MEMORAX_CODE_OPENCODE_TRACE_RETENTION_DAYS` | `7` |
298
+ | `max_event_chars` | `MEMORAX_CODE_CODEX_TRACE_MAX_EVENT_CHARS` | `MEMORAX_CODE_CLAUDE_TRACE_MAX_EVENT_CHARS` | `MEMORAX_CODE_DSH_TRACE_MAX_EVENT_CHARS` | `MEMORAX_CODE_OPENCODE_TRACE_MAX_EVENT_CHARS` | `20000` |
299
+ | `max_file_bytes` | `MEMORAX_CODE_CODEX_TRACE_MAX_FILE_BYTES` | `MEMORAX_CODE_CLAUDE_TRACE_MAX_FILE_BYTES` | `MEMORAX_CODE_DSH_TRACE_MAX_FILE_BYTES` | `MEMORAX_CODE_OPENCODE_TRACE_MAX_FILE_BYTES` | `52428800` |
196
300
 
197
- Content capture can include prompts, responses, recalled memory, writeback
198
- content, reminder text, and local paths. Set `capture_content=false` for
301
+ Depending on the enabled client capabilities, content capture can include
302
+ prompts, responses, recalled memory, writeback content, reminder text, and
303
+ local paths. Set `capture_content=false` for
199
304
  metadata-only local traces, or `enabled=false` to disable a client's trace.
200
305
  Trace files stay under `$MEMORAX_CODE_HOME`; MemoraX Code has no trace upload,
201
306
  export, or public collector.
202
307
 
308
+ DSH trace contains only normalized lifecycle and memory-operation events. Its
309
+ native Session Event Log and raw events remain local to DSH; MemoraX Code does
310
+ not copy that log into trace. Memory Viewer includes DSH activity from
311
+ normalized operational events and retained trace, and never reads the native
312
+ Session Event Log.
313
+
203
314
  ## Backend runtime settings
204
315
 
205
316
  Backend connection and process authority is not stored in `config.toml`.
@@ -242,6 +353,8 @@ memorax-cli status
242
353
  memorax-cli status --json
243
354
  memorax-code-codex doctor
244
355
  memorax-code-claude doctor
356
+ memorax-code status --clients dsh
357
+ memorax-code-opencode doctor
245
358
  ```
246
359
 
247
360
  The status commands do not print the MemoraX API key or Backend token.
@@ -7,12 +7,16 @@ memorax-code status
7
7
  memorax-cli status
8
8
  memorax-code-codex doctor
9
9
  memorax-code-claude doctor
10
+ memorax-code status --clients dsh
11
+ memorax-code-opencode doctor
10
12
  memorax-code logs
11
13
  ```
12
14
 
13
- `status` checks the Backend and client integrations. `memory status` checks
14
- credentials, scope, and memory switches without printing secrets. Each client
15
- `doctor` checks its plugin, skill, workspace, and Backend connection.
15
+ `memorax-code status` checks the Backend and selected client integrations,
16
+ including DSH and OpenCode. `memorax-cli status` checks credentials, scope, and
17
+ memory switches without printing secrets. Codex, Claude Code, and OpenCode
18
+ also provide client-specific `doctor` commands; DSH uses the shared lifecycle
19
+ status.
16
20
 
17
21
  ## Installed, but memory is unavailable
18
22
 
@@ -103,6 +107,55 @@ This reconciles the Claude Code marketplace plugin and Hooks. If the plugin is
103
107
  still missing or stale, restart or refresh Claude Code. Do not manually copy
104
108
  Hooks into Claude settings.
105
109
 
110
+ ## DeepSeek Harness Profile integration is inactive
111
+
112
+ ```sh
113
+ dsh --version
114
+ pnpm --version
115
+ memorax-code start --clients dsh
116
+ memorax-code status --clients dsh
117
+ ```
118
+
119
+ MemoraX Code discovers existing Profiles under `$DSH_HOME/profiles`;
120
+ `DSH_HOME` defaults to `~/.dsh`. A `no_existing_profiles` result means DSH has
121
+ not created a valid Profile in that home. A `dsh_version_unavailable` result
122
+ means the selected `dsh` command did not return a valid semantic version. The
123
+ tested baseline is `0.1.0-rc.6`; another valid version is allowed but marked
124
+ untested. A `pnpm_not_found` result means DSH's native Profile plugin manager
125
+ could not find `pnpm` on `PATH`; install `pnpm`, then rerun the start command.
126
+
127
+ After repairing the command, Profile manifest, or home selection, rerun the
128
+ start command and restart or refresh DSH. `profile_drift`,
129
+ `profile_manifest_unreadable`, and `runtime_authority_invalid` are managed-state
130
+ failures rather than reasons to edit the Profile or
131
+ `$MEMORAX_CODE_HOME/adapters/dsh/state.json` manually. The lifecycle command
132
+ uses DSH's plugin manager to reconcile the integration. Stop and uninstall
133
+ remove the managed MemoraX Code plugin, not the DSH Profile or its session
134
+ data.
135
+
136
+ ## OpenCode plugin or skill is inactive
137
+
138
+ ```sh
139
+ memorax-code start --clients opencode
140
+ memorax-code status --clients opencode
141
+ memorax-code-opencode doctor
142
+ ```
143
+
144
+ Rerun the start command to reconcile the managed plugin and skill, then restart
145
+ or refresh OpenCode. The configuration root follows `OPENCODE_CONFIG_DIR`, then
146
+ `XDG_CONFIG_HOME`, and otherwise defaults to `~/.config/opencode`. MemoraX Code
147
+ does not add plugin entries to `opencode.json` or `opencode.jsonc`.
148
+
149
+ An enabled managed plugin normally attempts to restore an unavailable local
150
+ loopback Backend when OpenCode loads it. A prompt stops waiting after the
151
+ plugin instance's single five-second recovery budget and skips automatic
152
+ memory handling for that turn, but the Backend start continues in the
153
+ background. If that recovery is skipped or fails, use `memorax-code status` and
154
+ `memorax-code logs`, then run the start command above. If doctor reports no
155
+ plugin runtime evidence, restart or refresh OpenCode and rerun it. Automatic
156
+ recovery intentionally skips remote URLs, invalid connection authority, and
157
+ stale loaders whose recorded package command no longer exists.
158
+
106
159
  An already-open client may keep its loaded plugin shell while a later prompt
107
160
  uses the updated Hook runtime. Restart or refresh the client to load a changed
108
161
  plugin manifest, icon, or bundled skill.
@@ -116,6 +169,8 @@ environment may be intercepting `127.0.0.1` or `localhost`.
116
169
  memorax-code start
117
170
  memorax-code-codex doctor
118
171
  memorax-code-claude doctor
172
+ memorax-code status --clients dsh
173
+ memorax-code-opencode doctor
119
174
  /usr/sbin/scutil --proxy
120
175
  /bin/launchctl getenv NO_PROXY
121
176
  /bin/launchctl getenv no_proxy
@@ -132,6 +187,8 @@ memorax-cli status
132
187
  memorax-cli search --query 'test'
133
188
  memorax-code-codex doctor
134
189
  memorax-code-claude doctor
190
+ memorax-code status --clients dsh
191
+ memorax-code-opencode doctor
135
192
  ```
136
193
 
137
194
  Common causes are:
@@ -147,12 +204,13 @@ MemoraX Code reads filesystem Git metadata without executing Git. Linked
147
204
  worktrees share the remote repository identity; non-Git workspaces use the
148
205
  normalized folder name. Resolution never falls back to the bare base user ID.
149
206
 
150
- A live Codex or Claude Code session remains pinned to the repository or local
151
- workspace resolved at the start of the session. Starting the client from a
152
- parent workspace and then entering a nested Git repository does not rebind the
153
- session. The only in-session scope upgrade is from a direct `.git` directory
154
- whose internal metadata was malformed or incomplete to a verified Git
155
- repository at the same canonical workspace root and for the same Base User ID.
207
+ A live Codex, Claude Code, DSH, or OpenCode session remains pinned to the
208
+ repository or local workspace resolved at the start of the session. Starting
209
+ the client from a parent workspace and then entering a nested Git repository
210
+ does not rebind the session. The only in-session scope upgrade is from a direct
211
+ `.git` directory whose internal metadata was malformed or incomplete to a
212
+ verified Git repository at the same canonical workspace root and for the same
213
+ Base User ID.
156
214
 
157
215
  During that degraded state, MemoraX Code reports
158
216
  `workspaceScopeFallbackReason: git_metadata_invalid` for manual CLI operations
@@ -179,10 +237,10 @@ when repository isolation matters.
179
237
 
180
238
  ## Model-provider requests fail while MemoraX Code is healthy
181
239
 
182
- MemoraX Code does not proxy Codex or Claude Code model requests. If
183
- `memorax-code status` and the relevant client doctor are healthy, inspect the
184
- provider URL, credentials, model selection, and network settings owned by that
185
- client. Do not copy model-provider credentials into
240
+ MemoraX Code does not proxy Codex, Claude Code, DSH, or OpenCode model
241
+ requests. If `memorax-code status` and the available client-specific doctor
242
+ are healthy, inspect the provider URL, credentials, model selection, and
243
+ network settings owned by that client. Do not copy model-provider credentials into
186
244
  `$MEMORAX_CODE_HOME`.
187
245
 
188
246
  ## Safe issue reports
@@ -194,6 +252,8 @@ memorax-code status --json
194
252
  memorax-cli status --json
195
253
  memorax-code-codex doctor --json
196
254
  memorax-code-claude doctor --json
255
+ memorax-code status --clients dsh --json
256
+ memorax-code-opencode doctor --json
197
257
  ```
198
258
 
199
259
  Include the MemoraX Code version, operating system, affected client,
@@ -0,0 +1,22 @@
1
+ import { existsSync } from "node:fs";
2
+ import { dirname, join, resolve } from "node:path";
3
+ import { fileURLToPath, pathToFileURL } from "node:url";
4
+
5
+ const packageLib = dirname(fileURLToPath(import.meta.url));
6
+ const stagedLifecycle = join(
7
+ packageLib,
8
+ "memorax-code-dsh-adapter",
9
+ "src",
10
+ "profile-lifecycle.mjs",
11
+ );
12
+ const sourceLifecycle = resolve(
13
+ packageLib,
14
+ "../../../ts/memorax-code-dsh-adapter/src/profile-lifecycle.mjs",
15
+ );
16
+ const lifecycle = await import(
17
+ pathToFileURL(existsSync(stagedLifecycle) ? stagedLifecycle : sourceLifecycle).href
18
+ );
19
+
20
+ export const collectDshAdapterStatus = lifecycle.collectDshAdapterStatus;
21
+ export const discoverDshProfiles = lifecycle.discoverDshProfiles;
22
+ export const withDshPluginLifecycleLock = lifecycle.withDshPluginLifecycleLock;
@@ -10,6 +10,18 @@ import {
10
10
 
11
11
  export async function runCaptureCwdHook(options) {
12
12
  const input = await readStdinJson();
13
+ const record = recordWorkspaceEvidence(options, input);
14
+ if (!record) return;
15
+
16
+ if (record.cwd) {
17
+ const pluginDataPath = pluginDataWorkspacePath();
18
+ if (pluginDataPath) writeWorkspaceState(pluginDataPath, record, options);
19
+ }
20
+ writeSessionRegistry(memoraxCodeSessionRegistryPath(options), record, options);
21
+ return input;
22
+ }
23
+
24
+ export function recordWorkspaceEvidence(options, input) {
13
25
  const transcriptPath = stringOption(input.transcript_path) ?? stringOption(input.transcriptPath);
14
26
  if (options.requireTranscriptPathForTurnEvents && isTurnScopedEvent(input) && !transcriptPath) return;
15
27
  const cwd = typeof input.cwd === "string" && input.cwd.trim()
@@ -24,19 +36,12 @@ export async function runCaptureCwdHook(options) {
24
36
  capturedAt: new Date().toISOString(),
25
37
  };
26
38
 
27
- const registryPath = memoraxCodeSessionRegistryPath(options);
28
-
29
39
  if (cwd) {
30
- const targets = [
31
- memoraxCodeWorkspacePath(options),
32
- pluginDataWorkspacePath(),
33
- ].filter(Boolean);
34
-
35
- for (const target of targets) writeWorkspaceState(target, record, options);
40
+ const workspacePath = memoraxCodeWorkspacePath(options);
41
+ if (workspacePath) writeWorkspaceState(workspacePath, record, options);
36
42
  }
37
43
 
38
- writeSessionRegistry(registryPath, record, options);
39
- return input;
44
+ return record;
40
45
  }
41
46
 
42
47
  function isTurnScopedEvent(input) {
@@ -45,17 +50,19 @@ function isTurnScopedEvent(input) {
45
50
  }
46
51
 
47
52
  function memoraxCodeWorkspacePath(options) {
48
- const home = memoraxCodeHome();
53
+ const home = memoraxCodeHome(options);
49
54
  return home ? join(home, "adapters", options.adapterDir, "workspaces.json") : undefined;
50
55
  }
51
56
 
52
57
  function memoraxCodeSessionRegistryPath(options) {
53
- const home = memoraxCodeHome();
58
+ const home = memoraxCodeHome(options);
54
59
  return home ? join(home, "adapters", options.adapterDir, "session-registry.json") : undefined;
55
60
  }
56
61
 
57
- function memoraxCodeHome() {
58
- return process.env.MEMORAX_CODE_HOME || (process.env.HOME ? join(process.env.HOME, ".memorax-code") : undefined);
62
+ function memoraxCodeHome(options) {
63
+ return stringOption(options.memoraxCodeHome)
64
+ ?? stringOption(process.env.MEMORAX_CODE_HOME)
65
+ ?? (process.env.HOME ? join(process.env.HOME, ".memorax-code") : undefined);
59
66
  }
60
67
 
61
68
  function pluginDataWorkspacePath() {
@@ -5,19 +5,23 @@ import {
5
5
  localBackendRecoveryArguments,
6
6
  resolveBackendConnection,
7
7
  } from "../backend-connection.mjs";
8
- import { readStdinJson } from "../config-utils.mjs";
9
8
  import { isRepoMemoryJobWorker } from "../repo-memory/repo-memory-job-context.mjs";
10
9
 
11
10
  export const DEFAULT_ENSURE_BACKEND_START_TIMEOUT_MS = 90000;
11
+ const HOOK_INPUT_SYMBOL = Symbol.for("memorax-code.client-hook.input.v1");
12
12
 
13
13
  export async function runEnsureBackendHook(options) {
14
- if (isRepoMemoryJobWorker() || ensureDisabled(options.ensureBackendValue)) return;
15
-
16
14
  const input = await readStdinJson();
15
+ await ensureBackendAvailable(options, input);
16
+ }
17
+
18
+ export async function ensureBackendAvailable(options, input = {}) {
19
+ if (isRepoMemoryJobWorker() || ensureDisabled(options.ensureBackendValue)) return;
17
20
  const homes = options.resolveHomes(input);
18
21
  let connection;
19
22
  try {
20
- connection = resolveBackendConnection({ memoraxCodeHome: homes.memoraxCodeHome });
23
+ connection = options.backendConnection
24
+ ?? resolveBackendConnection({ memoraxCodeHome: homes.memoraxCodeHome });
21
25
  } catch (error) {
22
26
  options.debug?.(error instanceof Error ? error.message : String(error));
23
27
  return;
@@ -36,6 +40,8 @@ export async function runEnsureBackendHook(options) {
36
40
  command.value,
37
41
  options.buildStartArgs(homes, recoveryArguments),
38
42
  parsePositiveInt(options.startTimeoutValue, DEFAULT_ENSURE_BACKEND_START_TIMEOUT_MS),
43
+ options.nodePath,
44
+ options.recoveryEnv,
39
45
  );
40
46
  if (result.code !== 0) {
41
47
  options.debug?.(
@@ -105,14 +111,14 @@ function memoraxCodeCommandAvailable(command) {
105
111
  return path.split(delimiter).some((dir) => dir && existsSync(join(dir, command)));
106
112
  }
107
113
 
108
- function runMemoraxCode(command, args, timeoutMs) {
114
+ function runMemoraxCode(command, args, timeoutMs, nodePath, recoveryEnv) {
109
115
  return new Promise((resolve) => {
110
116
  const childArgs = nodeEntrypoint(command) ? [command, ...args] : args;
111
- const childCommand = nodeEntrypoint(command) ? process.execPath : command;
117
+ const childCommand = nodeEntrypoint(command) ? (stringValue(nodePath) ?? process.execPath) : command;
112
118
  let stderr = "";
113
119
  let settled = false;
114
120
  const child = spawn(childCommand, childArgs, {
115
- env: process.env,
121
+ env: recoveryEnv === undefined ? process.env : { ...process.env, ...recoveryEnv },
116
122
  stdio: ["ignore", "ignore", "pipe"],
117
123
  });
118
124
  const finish = (result) => {
@@ -140,3 +146,16 @@ function parsePositiveInt(value, fallback) {
140
146
  const parsed = Number(value);
141
147
  return Number.isInteger(parsed) && parsed > 0 ? parsed : fallback;
142
148
  }
149
+
150
+ async function readStdinJson() {
151
+ const injected = globalThis[HOOK_INPUT_SYMBOL];
152
+ if (injected && typeof injected === "object" && !Array.isArray(injected)) return injected;
153
+ let text = "";
154
+ for await (const chunk of process.stdin) text += chunk;
155
+ if (!text.trim()) return {};
156
+ try {
157
+ return JSON.parse(text);
158
+ } catch {
159
+ return {};
160
+ }
161
+ }