@memorax/memorax-code 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -4
- package/bin/memorax-code-setup.mjs +136 -34
- package/bin/memorax-code-trae.mjs +4 -0
- package/docs/configuration.md +111 -54
- package/docs/troubleshooting.md +50 -8
- package/lib/memorax-code-backend/dist/clients/claude/transcript-turn.js +2 -2
- package/lib/memorax-code-backend/dist/clients/codex/rollout-turn.js +1 -1
- package/lib/memorax-code-backend/dist/clients/trae/lifecycle.js +53 -0
- package/lib/memorax-code-backend/dist/clients/trae/memory-hook-runtime.js +302 -0
- package/lib/memorax-code-backend/dist/clients/trae/turn-id.js +16 -0
- package/lib/memorax-code-backend/dist/config/memorax-code.js +14 -1
- package/lib/memorax-code-backend/dist/entrypoints/backend-cli.js +22 -4
- package/lib/memorax-code-backend/dist/lifecycle/active-clients.js +3 -0
- package/lib/memorax-code-backend/dist/lifecycle/client-plugin-removal.js +14 -2
- package/lib/memorax-code-backend/dist/lifecycle/client-selection.js +5 -3
- package/lib/memorax-code-backend/dist/lifecycle/orchestrator.js +62 -9
- package/lib/memorax-code-backend/dist/memory/hook-command.js +34 -2
- package/lib/memorax-code-backend/dist/memory/reminder-trace-recorder.js +5 -1
- package/lib/memorax-code-backend/dist/memory/service.js +12 -0
- package/lib/memorax-code-backend/dist/trace/config.js +12 -1
- package/lib/memorax-code-backend/dist/trace/context.js +26 -1
- package/lib/memorax-code-backend/package.json +1 -1
- package/lib/memorax-code-claude-adapter/.claude-plugin/plugin.json +1 -1
- package/lib/memorax-code-claude-adapter/hooks/runtime-shell.json +1 -1
- package/lib/memorax-code-claude-adapter/package.json +1 -1
- package/lib/memorax-code-claude-adapter/skills/memorax-code/SKILL.md +3 -1
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/memorax-add.md +16 -3
- package/lib/memorax-code-claude-adapter/skills/memorax-code/references/memorax-search.md +15 -2
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/.claude-plugin/plugin.json +1 -1
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/hooks/runtime-shell.json +1 -1
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/package.json +1 -1
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/SKILL.md +3 -1
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/memorax-add.md +16 -3
- package/lib/memorax-code-claude-marketplace/plugins/memorax-code-claude-adapter/skills/memorax-code/references/memorax-search.md +15 -2
- package/lib/memorax-code-codebuddy-adapter/.codebuddy-plugin/plugin.json +1 -1
- package/lib/memorax-code-codebuddy-adapter/hooks/runtime-hook.mjs +11 -1
- package/lib/memorax-code-codebuddy-adapter/package.json +1 -1
- package/lib/memorax-code-codebuddy-adapter/skills/memorax-code/SKILL.md +3 -1
- package/lib/memorax-code-codebuddy-adapter/skills/memorax-code/references/memorax-add.md +16 -3
- package/lib/memorax-code-codebuddy-adapter/skills/memorax-code/references/memorax-search.md +15 -2
- package/lib/memorax-code-codebuddy-adapter/src/config.mjs +86 -23
- package/lib/memorax-code-codex-adapter/.codex-plugin/plugin.json +1 -1
- package/lib/memorax-code-codex-adapter/hooks/runtime-shell.json +1 -1
- package/lib/memorax-code-codex-adapter/package.json +1 -1
- package/lib/memorax-code-codex-adapter/skills/memorax-code/SKILL.md +3 -1
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/memorax-add.md +16 -3
- package/lib/memorax-code-codex-adapter/skills/memorax-code/references/memorax-search.md +15 -2
- package/lib/memorax-code-dsh-adapter/package.json +1 -1
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/SKILL.md +3 -1
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/memorax-add.md +16 -3
- package/lib/memorax-code-dsh-adapter/skills/memorax-code/references/memorax-search.md +15 -2
- package/lib/memorax-code-opencode-adapter/package.json +1 -1
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/SKILL.md +3 -1
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/memorax-add.md +16 -3
- package/lib/memorax-code-opencode-adapter/skills/memorax-code/references/memorax-search.md +15 -2
- package/lib/memorax-code-trae-adapter/hooks/runtime-hook.mjs +340 -0
- package/lib/memorax-code-trae-adapter/package.json +9 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/SKILL.md +87 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/agents/claude.yaml +10 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/agents/openai.yaml +7 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/defaults.json +12 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/references/memorax-add.md +101 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/references/memorax-search.md +106 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/references/personal-read.md +46 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/references/personal-write.md +120 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/references/repo-build.md +319 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/references/repo-read.md +103 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/references/repo-templates.md +390 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/references/repo-update.md +127 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/scripts/collect_all.py +579 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/scripts/detect_updates.py +919 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/scripts/git_commit_facets.py +222 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/scripts/github_resource_facets.py +512 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/scripts/gitlab_resource_facets.py +517 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/scripts/prepare_repo_memory.py +411 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/scripts/user_profile_memory.py +528 -0
- package/lib/memorax-code-trae-adapter/skills/memorax-code/scripts/validate_memory.py +248 -0
- package/lib/memorax-code-trae-adapter/src/adapter-paths.mjs +69 -0
- package/lib/memorax-code-trae-adapter/src/cli.mjs +59 -0
- package/lib/memorax-code-trae-adapter/src/config.mjs +630 -0
- package/lib/memorax-code-trae-adapter/src/runtime-observation.mjs +55 -0
- package/lib/resolve-codebuddy-command.mjs +15 -4
- package/lib/run-entrypoint.mjs +6 -0
- package/package.json +5 -3
package/docs/configuration.md
CHANGED
|
@@ -39,13 +39,13 @@ are not a compatibility contract.
|
|
|
39
39
|
|
|
40
40
|
## New configuration
|
|
41
41
|
|
|
42
|
-
The generated template selects the existing client integrations, including the
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
clients detected on the host. The tables below
|
|
48
|
-
tuning fields omitted from the generated file.
|
|
42
|
+
The generated template selects the existing client integrations, including the
|
|
43
|
+
optional CodeBuddy/WorkBuddy and Trae adapters, disables automatic retrieval,
|
|
44
|
+
enables automatic writeback, sets the preferred language to Chinese (`zh`),
|
|
45
|
+
uses a five-turn skill reminder and the adaptive repository-update policy, and
|
|
46
|
+
enables content-bearing local traces for every supported client. Foreground
|
|
47
|
+
setup may narrow `[clients]` to clients detected on the host. The tables below
|
|
48
|
+
list all fallbacks, including tuning fields omitted from the generated file.
|
|
49
49
|
|
|
50
50
|
On POSIX systems MemoraX Code creates `$MEMORAX_CODE_HOME` with mode `0700`
|
|
51
51
|
and a new `config.toml` with mode `0600`. Windows relies on the current user's
|
|
@@ -54,15 +54,19 @@ filesystem ACLs.
|
|
|
54
54
|
## Client selection
|
|
55
55
|
|
|
56
56
|
If `[clients]` is absent, lifecycle commands select Codex, Claude Code, DSH,
|
|
57
|
-
and OpenCode; CodeBuddy
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
and OpenCode; CodeBuddy/WorkBuddy and Trae are opt-in unless detected during
|
|
58
|
+
foreground setup. If the table is present, `codex`, `claude`, `dsh`,
|
|
59
|
+
`opencode`, `codebuddy`, and `trae` are boolean fields. Direct lifecycle
|
|
60
|
+
commands treat omitted `codex`, `claude`, `opencode`, `codebuddy`, or `trae`
|
|
61
|
+
values as disabled. Setup and update reconciliation retain an omitted field as
|
|
62
|
+
an undecided choice for client support added after the configuration was
|
|
63
|
+
written. An omitted `dsh` value remains enabled so configurations written
|
|
64
|
+
before DSH support can discover an existing local Harness. Set `dsh = false`
|
|
65
|
+
explicitly to disable that integration. The command-line override accepts a
|
|
62
66
|
comma-separated subset:
|
|
63
67
|
|
|
64
68
|
```text
|
|
65
|
-
--clients codex|claude|dsh|opencode|codebuddy|<comma-separated subset>|all|none
|
|
69
|
+
--clients codex|claude|dsh|opencode|codebuddy|trae|<comma-separated subset>|all|none
|
|
66
70
|
```
|
|
67
71
|
|
|
68
72
|
Foreground `memorax-code setup` refreshes `[clients]` from the clients
|
|
@@ -70,18 +74,23 @@ available at that time. OpenCode is available when its explicit, XDG, or
|
|
|
70
74
|
default configuration directory exists, or when `opencode` is on `PATH`.
|
|
71
75
|
DSH is available when at least one valid Profile exists under
|
|
72
76
|
`$DSH_HOME/profiles`; `DSH_HOME` defaults to `~/.dsh`. An explicit
|
|
73
|
-
`[clients].dsh = false` is preserved.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
`[clients].dsh = false` is preserved. Trae is available when its data home or
|
|
78
|
+
application is detected. `TRAE_CN_HOME`, then `TRAE_HOME`, overrides its
|
|
79
|
+
default `~/.trae-cn` data home.
|
|
80
|
+
|
|
81
|
+
On later setup runs, explicit `true` and `false` client choices are preserved.
|
|
82
|
+
A detected client whose field is absent is offered for activation with a
|
|
83
|
+
default of yes; declining records `false`. An absent client that is not
|
|
84
|
+
detected remains absent, while a selected client that is temporarily
|
|
85
|
+
unavailable remains selected. Direct npm installation does not detect clients
|
|
86
|
+
or modify `[clients]`.
|
|
87
|
+
Automatic update reconciliation preserves explicit choices and silently
|
|
88
|
+
enables a detected client whose field is absent. This lets configurations
|
|
89
|
+
written before an adapter was supported adopt it when its runtime is already
|
|
90
|
+
installed, without overriding an explicit `false`.
|
|
82
91
|
|
|
83
92
|
Client selection controls managed client-integration lifecycle only. It does
|
|
84
|
-
not change
|
|
93
|
+
not change any coding agent's provider settings.
|
|
85
94
|
`--clients none` runs the Backend without managing a client integration.
|
|
86
95
|
|
|
87
96
|
## Setup, automatic update, and package-transition state
|
|
@@ -89,8 +98,10 @@ not change Codex, Claude Code, DSH, or OpenCode provider settings.
|
|
|
89
98
|
npm installation and foreground setup are separate operations.
|
|
90
99
|
`npm install -g @memorax/memorax-code` installs or replaces package files
|
|
91
100
|
without reading terminal input. `memorax-code setup` owns client detection,
|
|
92
|
-
connection setup, configuration writes,
|
|
93
|
-
final readiness checks.
|
|
101
|
+
connection setup, configuration writes, client integration activation or
|
|
102
|
+
review, and final readiness checks. Trae setup installs the managed Hook
|
|
103
|
+
entries but cannot turn on Trae's application-level Global Hooks setting; the
|
|
104
|
+
user must enable that setting once in Trae Settings.
|
|
94
105
|
|
|
95
106
|
Default setup reuses a complete effective connection. Otherwise it detects the
|
|
96
107
|
logged-in operating-system username and maps the system language to `zh` or
|
|
@@ -127,13 +138,14 @@ Backend to disable the scheduler. Client startup Hooks only recover an
|
|
|
127
138
|
unavailable Backend and do not schedule updates.
|
|
128
139
|
|
|
129
140
|
The updater installs an exact published version and runs an internal
|
|
130
|
-
non-interactive setup mode. That mode preserves `[clients]
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
141
|
+
non-interactive setup mode. That mode preserves explicit `[clients]` choices,
|
|
142
|
+
enables detected clients missing from an older configuration, and preserves
|
|
143
|
+
connection data and memory preferences. For Codex, only new or changed Hooks
|
|
144
|
+
returned by the incremental check are trusted silently, and the exact Hook
|
|
145
|
+
selection is validated again before and after the config write. A changed
|
|
146
|
+
marketplace identity or unverifiable Hook set prevents reconciliation from
|
|
147
|
+
completing. The standalone `memorax-code codex-plugin trust-hooks` command
|
|
148
|
+
still performs explicit review.
|
|
137
149
|
|
|
138
150
|
The installed version and next check deadline are stored in another private
|
|
139
151
|
record:
|
|
@@ -209,8 +221,11 @@ native plugin layout:
|
|
|
209
221
|
└── skills/memorax-code/
|
|
210
222
|
```
|
|
211
223
|
|
|
212
|
-
`CODEBUDDY_HOME` or `WORKBUDDY_HOME` overrides the default root. Windows
|
|
213
|
-
`%USERPROFILE%\.
|
|
224
|
+
`CODEBUDDY_HOME` or `WORKBUDDY_HOME` overrides the default root. Windows prefers
|
|
225
|
+
`%USERPROFILE%\.workbuddy` and falls back to an existing `%USERPROFILE%\.codebuddy`
|
|
226
|
+
for legacy CodeBuddy installations. When both homes exist, setup removes only the
|
|
227
|
+
legacy MemoraX-managed plugin state from `.codebuddy`; other platforms use
|
|
228
|
+
`~/.workbuddy`. The Skill is
|
|
214
229
|
materialized from the canonical MemoraX Code Skill and is owned by the managed
|
|
215
230
|
marketplace plugin; user files outside that plugin are not modified.
|
|
216
231
|
|
|
@@ -220,6 +235,38 @@ does not receive a `/c/Users/...` plugin path. `memorax-code-codebuddy status
|
|
|
220
235
|
Hook executes, `observed` afterward, and `invalid` when the installed Hook
|
|
221
236
|
manifest or runtime is incomplete. Restart or refresh WorkBuddy after setup.
|
|
222
237
|
|
|
238
|
+
## Trae integration paths
|
|
239
|
+
|
|
240
|
+
The managed Trae Global Hooks and shared Skill use Trae's data home:
|
|
241
|
+
|
|
242
|
+
```text
|
|
243
|
+
~/.trae-cn/hooks.json
|
|
244
|
+
~/.trae-cn/skills/memorax-code/
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
`TRAE_CN_HOME`, then `TRAE_HOME`, overrides the default root; lifecycle
|
|
248
|
+
commands can override it for one invocation with `--trae-home`. The ownership
|
|
249
|
+
record and content-addressed Hook runtime live under
|
|
250
|
+
`$MEMORAX_CODE_HOME/adapters/trae/`. Setup merges one marked MemoraX Code Hook
|
|
251
|
+
into each of `SessionStart`, `UserPromptSubmit`, and `Stop`, preserves other
|
|
252
|
+
Trae Hooks and settings, and refuses to replace an unmanaged
|
|
253
|
+
`skills/memorax-code` directory. Disable and uninstall remove only entries
|
|
254
|
+
marked as MemoraX Code-owned and the managed Skill.
|
|
255
|
+
|
|
256
|
+
Trae does not expose a reliable programmatic switch for application-level
|
|
257
|
+
Global Hooks. After the first setup, enable **Global Hooks** once in Trae
|
|
258
|
+
Settings and start a new session. `memorax-code-trae status --json` reports the
|
|
259
|
+
Hook runtime as `unverified` until Trae executes a managed Hook, then as
|
|
260
|
+
`observed`; it also reports when this one-time activation may still be needed.
|
|
261
|
+
|
|
262
|
+
Trae does not currently expose a stable raw Session or a headless CLI. The
|
|
263
|
+
adapter therefore correlates the prompt from `UserPromptSubmit` with the final
|
|
264
|
+
assistant message from `Stop` and uses that closed, validated Hook pair as
|
|
265
|
+
Trae's automatic-writeback content authority. It does not guess from another
|
|
266
|
+
Turn or maintain a pending queue. The Skill can still perform explicit Repo
|
|
267
|
+
Memory work, but automatic background Repo Memory jobs are unavailable in
|
|
268
|
+
Trae until the client provides a suitable headless worker.
|
|
269
|
+
|
|
223
270
|
The managed loader records the exact MemoraX Code home, OpenCode configuration
|
|
224
271
|
directory, installed Node runtime, and `memorax-code` entrypoint. When the
|
|
225
272
|
enabled plugin loads, it performs a best-effort Backend health check and uses
|
|
@@ -370,12 +417,14 @@ Supported policies are `every-commit`, `commit-count`, `daily`,
|
|
|
370
417
|
`pull-request`, `pull-request-or-daily`, and `adaptive`. Invalid policy values
|
|
371
418
|
fall back to `adaptive`.
|
|
372
419
|
|
|
373
|
-
In Codex, Claude Code, CodeBuddy/WorkBuddy, DSH, and OpenCode, the first
|
|
374
|
-
background build only when the Backend has authorized
|
|
375
|
-
worktree has no `.repo_memory/PROFILE.md`. If the
|
|
376
|
-
authority is unavailable, the client integration skips
|
|
377
|
-
of falling back to its local workspace path. DSH schedules
|
|
378
|
-
its native pre-step integration rather than a Hook.
|
|
420
|
+
In Codex, Claude Code, CodeBuddy/WorkBuddy, DSH, and OpenCode, the first
|
|
421
|
+
eligible prompt starts a background build only when the Backend has authorized
|
|
422
|
+
a Git worktree and that worktree has no `.repo_memory/PROFILE.md`. If the
|
|
423
|
+
Backend or workspace authority is unavailable, the client integration skips
|
|
424
|
+
that attempt instead of falling back to its local workspace path. DSH schedules
|
|
425
|
+
this work through its native pre-step integration rather than a Hook. Trae
|
|
426
|
+
receives the shared Skill, User Profile, and Procedure reminders, but does not
|
|
427
|
+
start this background build because Trae has no supported headless worker.
|
|
379
428
|
|
|
380
429
|
CodeBuddy/WorkBuddy repository jobs run the headless client under a bounded
|
|
381
430
|
worker. `MEMORAX_CODE_REPO_MEMORY_JOB_TIMEOUT_MS` sets the client execution
|
|
@@ -385,24 +434,26 @@ the grace period before the worker force-terminates a client that ignores
|
|
|
385
434
|
`codebuddy_timeout` (or `<runner>_timeout`) in the job state, so a stalled
|
|
386
435
|
headless client cannot leave an active job and repository marker indefinitely.
|
|
387
436
|
|
|
388
|
-
A relevant repo-read runs supervised maintenance in
|
|
389
|
-
configured policy may select a build, update, or
|
|
390
|
-
requires an enabled, managed Profile that includes
|
|
391
|
-
OpenCode executes the job through its active local
|
|
392
|
-
installations do not require a standalone `opencode`
|
|
437
|
+
A relevant repo-read runs supervised maintenance in the five headless-capable
|
|
438
|
+
client integrations. The configured policy may select a build, update, or
|
|
439
|
+
no-op. DSH maintenance requires an enabled, managed Profile that includes
|
|
440
|
+
`@deepseek-ai/dsh-headless`. OpenCode executes the job through its active local
|
|
441
|
+
server. Desktop-only installations do not require a standalone `opencode`
|
|
442
|
+
executable in `PATH`. Trae users can invoke the Skill explicitly, but Trae is
|
|
443
|
+
not an automatic maintenance runner.
|
|
393
444
|
|
|
394
445
|
## Local traces
|
|
395
446
|
|
|
396
|
-
`[trace.codex]`, `[trace.claude]`, `[trace.dsh]`, `[trace.opencode]`,
|
|
397
|
-
support the same fields:
|
|
447
|
+
`[trace.codex]`, `[trace.claude]`, `[trace.dsh]`, `[trace.opencode]`,
|
|
448
|
+
`[trace.codebuddy]`, and `[trace.trae]` support the same fields:
|
|
398
449
|
|
|
399
|
-
| Field | Codex environment | Claude environment | DSH environment | OpenCode environment | CodeBuddy/WorkBuddy environment | Fallback |
|
|
400
|
-
| --- | --- | --- | --- | --- | --- | --- |
|
|
401
|
-
| `enabled` | `MEMORAX_CODE_CODEX_TRACE_ENABLED` | `MEMORAX_CODE_CLAUDE_TRACE_ENABLED` | `MEMORAX_CODE_DSH_TRACE_ENABLED` | `MEMORAX_CODE_OPENCODE_TRACE_ENABLED` | `MEMORAX_CODE_CODEBUDDY_TRACE_ENABLED` | `true` |
|
|
402
|
-
| `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` | `MEMORAX_CODE_CODEBUDDY_TRACE_CAPTURE_CONTENT` | `true` |
|
|
403
|
-
| `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` | `MEMORAX_CODE_CODEBUDDY_TRACE_RETENTION_DAYS` | `7` |
|
|
404
|
-
| `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` | `MEMORAX_CODE_CODEBUDDY_TRACE_MAX_EVENT_CHARS` | `20000` |
|
|
405
|
-
| `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` | `MEMORAX_CODE_CODEBUDDY_TRACE_MAX_FILE_BYTES` | `52428800` |
|
|
450
|
+
| Field | Codex environment | Claude environment | DSH environment | OpenCode environment | CodeBuddy/WorkBuddy environment | Trae environment | Fallback |
|
|
451
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
452
|
+
| `enabled` | `MEMORAX_CODE_CODEX_TRACE_ENABLED` | `MEMORAX_CODE_CLAUDE_TRACE_ENABLED` | `MEMORAX_CODE_DSH_TRACE_ENABLED` | `MEMORAX_CODE_OPENCODE_TRACE_ENABLED` | `MEMORAX_CODE_CODEBUDDY_TRACE_ENABLED` | `MEMORAX_CODE_TRAE_TRACE_ENABLED` | `true` |
|
|
453
|
+
| `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` | `MEMORAX_CODE_CODEBUDDY_TRACE_CAPTURE_CONTENT` | `MEMORAX_CODE_TRAE_TRACE_CAPTURE_CONTENT` | `true` |
|
|
454
|
+
| `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` | `MEMORAX_CODE_CODEBUDDY_TRACE_RETENTION_DAYS` | `MEMORAX_CODE_TRAE_TRACE_RETENTION_DAYS` | `7` |
|
|
455
|
+
| `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` | `MEMORAX_CODE_CODEBUDDY_TRACE_MAX_EVENT_CHARS` | `MEMORAX_CODE_TRAE_TRACE_MAX_EVENT_CHARS` | `20000` |
|
|
456
|
+
| `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` | `MEMORAX_CODE_CODEBUDDY_TRACE_MAX_FILE_BYTES` | `MEMORAX_CODE_TRAE_TRACE_MAX_FILE_BYTES` | `52428800` |
|
|
406
457
|
|
|
407
458
|
Depending on the enabled client capabilities, content capture can include
|
|
408
459
|
prompts, responses, recalled memory, writeback content, reminder text, and
|
|
@@ -415,6 +466,10 @@ DSH trace contains only normalized lifecycle and memory-operation events. Its
|
|
|
415
466
|
native Session Event Log and raw events remain local to DSH; MemoraX Code does
|
|
416
467
|
not copy that log into trace.
|
|
417
468
|
|
|
469
|
+
Trae trace contains only normalized lifecycle and memory-operation events from
|
|
470
|
+
the validated Hook pair. Trae does not expose a raw Session authority for
|
|
471
|
+
MemoraX Code to copy.
|
|
472
|
+
|
|
418
473
|
## Backend runtime settings
|
|
419
474
|
|
|
420
475
|
Backend connection and process authority is not stored in `config.toml`.
|
|
@@ -462,6 +517,8 @@ memorax-code-codex doctor
|
|
|
462
517
|
memorax-code-claude doctor
|
|
463
518
|
memorax-code status --clients dsh
|
|
464
519
|
memorax-code-opencode doctor
|
|
520
|
+
memorax-code-codebuddy status --json
|
|
521
|
+
memorax-code-trae status --json
|
|
465
522
|
```
|
|
466
523
|
|
|
467
524
|
The status commands do not print the MemoraX API key or Backend token.
|
package/docs/troubleshooting.md
CHANGED
|
@@ -9,14 +9,23 @@ memorax-code-codex doctor
|
|
|
9
9
|
memorax-code-claude doctor
|
|
10
10
|
memorax-code status --clients dsh
|
|
11
11
|
memorax-code-opencode doctor
|
|
12
|
+
memorax-code-codebuddy status --json
|
|
13
|
+
memorax-code-trae status --json
|
|
12
14
|
memorax-code logs
|
|
13
15
|
```
|
|
14
16
|
|
|
17
|
+
In Windows PowerShell, use `memorax-cli.cmd` everywhere this guide shows
|
|
18
|
+
`memorax-cli`. If an unqualified command fails with `UnauthorizedAccess` or
|
|
19
|
+
`PSSecurityException` because PowerShell selected `memorax-cli.ps1`, rerun the
|
|
20
|
+
same command once with `memorax-cli.cmd`, preserving its arguments and working
|
|
21
|
+
directory. Do not run `Set-ExecutionPolicy` for MemoraX commands.
|
|
22
|
+
|
|
15
23
|
`memorax-code status` checks the Backend and selected client integrations,
|
|
16
|
-
including DSH and
|
|
17
|
-
memory switches without printing secrets.
|
|
18
|
-
|
|
19
|
-
status
|
|
24
|
+
including DSH, OpenCode, CodeBuddy/WorkBuddy, and Trae. `memorax-cli status`
|
|
25
|
+
checks credentials, scope, and memory switches without printing secrets.
|
|
26
|
+
Codex, Claude Code, and OpenCode provide client-specific `doctor` commands;
|
|
27
|
+
CodeBuddy/WorkBuddy and Trae provide adapter status commands, and DSH uses the
|
|
28
|
+
shared lifecycle status.
|
|
20
29
|
|
|
21
30
|
## Package installed, but setup did not start
|
|
22
31
|
|
|
@@ -176,8 +185,9 @@ Memory write and memory search reminders are tracked independently. A reminder
|
|
|
176
185
|
is emitted when the corresponding remaining quota reaches 10% or less and
|
|
177
186
|
again at 0%; raw quota counts are not shown.
|
|
178
187
|
|
|
179
|
-
Automatic quota reminders are currently supported in Codex, Claude Code,
|
|
180
|
-
OpenCode. DeepSeek Harness does not currently
|
|
188
|
+
Automatic quota reminders are currently supported in Codex, Claude Code,
|
|
189
|
+
CodeBuddy/WorkBuddy, OpenCode, and Trae. DeepSeek Harness does not currently
|
|
190
|
+
surface these reminders.
|
|
181
191
|
|
|
182
192
|
A guest reminder displays the complete Mark ID when the ready local trial
|
|
183
193
|
identity matches the active API key. Registered-account reminders do not
|
|
@@ -268,8 +278,11 @@ memorax-code start --clients codebuddy
|
|
|
268
278
|
memorax-code-codebuddy status --json
|
|
269
279
|
```
|
|
270
280
|
|
|
271
|
-
On Windows, the managed plugin
|
|
272
|
-
|
|
281
|
+
On Windows, the managed plugin prefers `%USERPROFILE%\.workbuddy` and falls back
|
|
282
|
+
to an existing `%USERPROFILE%\.codebuddy` for legacy CodeBuddy installations,
|
|
283
|
+
while `CODEBUDDY_HOME` or `WORKBUDDY_HOME` remains an explicit override. If both
|
|
284
|
+
homes exist, setup removes only the MemoraX-managed plugin registration,
|
|
285
|
+
marketplace, and cache from `.codebuddy`; unrelated data remains untouched. A
|
|
273
286
|
`codebuddyHooks.status` value of `unverified` means the files are configured but
|
|
274
287
|
the current plugin version has not yet produced a real Hook event. Restart or
|
|
275
288
|
refresh WorkBuddy, submit one prompt, and check status again. `observed` means
|
|
@@ -280,6 +293,33 @@ If WorkBuddy still reports a Hook command containing `/c/Users/...`, it is
|
|
|
280
293
|
loading a stale plugin manifest. Rerun the start command above and fully
|
|
281
294
|
restart WorkBuddy. Do not manually edit the installed Hook command.
|
|
282
295
|
|
|
296
|
+
## Trae Global Hooks or Skill is inactive
|
|
297
|
+
|
|
298
|
+
```sh
|
|
299
|
+
memorax-code start --clients trae
|
|
300
|
+
memorax-code-trae status --json
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Trae uses `TRAE_CN_HOME`, then `TRAE_HOME`, and otherwise defaults to
|
|
304
|
+
`~/.trae-cn`. Setup merges the managed `SessionStart`, `UserPromptSubmit`, and
|
|
305
|
+
`Stop` entries into `hooks.json` and installs the shared Skill without
|
|
306
|
+
replacing unrelated Hooks. If status reports `globalHooksActivationRequired`
|
|
307
|
+
or a Hook status of `unverified`, open Trae Settings, enable **Global Hooks**
|
|
308
|
+
once, fully restart or refresh Trae, start a new session, and submit one
|
|
309
|
+
prompt. A subsequent status should report `observed`.
|
|
310
|
+
|
|
311
|
+
If status reports `hooks_invalid`, repair the existing Trae `hooks.json`
|
|
312
|
+
syntax before rerunning the start command. If it reports `skill_conflict`, an
|
|
313
|
+
unmanaged `skills/memorax-code` directory already exists; preserve or move that
|
|
314
|
+
directory deliberately before asking MemoraX Code to manage the Skill. Do not
|
|
315
|
+
copy generated runtime files or edit entries containing
|
|
316
|
+
`--memorax-code-trae-hook-v1` by hand.
|
|
317
|
+
|
|
318
|
+
Trae currently provides no stable raw Session or headless CLI. Automatic
|
|
319
|
+
writeback therefore requires a matching `UserPromptSubmit` and `Stop` Hook
|
|
320
|
+
pair, and automatic background Repo Memory jobs are not available. Explicit
|
|
321
|
+
Search/Add and Skill-driven Repo Memory remain available.
|
|
322
|
+
|
|
283
323
|
## DeepSeek Harness Profile integration is inactive
|
|
284
324
|
|
|
285
325
|
```sh
|
|
@@ -352,6 +392,7 @@ memorax-code-codex doctor
|
|
|
352
392
|
memorax-code-claude doctor
|
|
353
393
|
memorax-code status --clients dsh
|
|
354
394
|
memorax-code-opencode doctor
|
|
395
|
+
memorax-code-trae status --json
|
|
355
396
|
/usr/sbin/scutil --proxy
|
|
356
397
|
/bin/launchctl getenv NO_PROXY
|
|
357
398
|
/bin/launchctl getenv no_proxy
|
|
@@ -370,6 +411,7 @@ memorax-code-codex doctor
|
|
|
370
411
|
memorax-code-claude doctor
|
|
371
412
|
memorax-code status --clients dsh
|
|
372
413
|
memorax-code-opencode doctor
|
|
414
|
+
memorax-code-trae status --json
|
|
373
415
|
```
|
|
374
416
|
|
|
375
417
|
Common causes are:
|
|
@@ -488,13 +488,13 @@ function isNamedExecutable(word, name) {
|
|
|
488
488
|
if (!word)
|
|
489
489
|
return false;
|
|
490
490
|
const normalized = word.replaceAll("\\", "/");
|
|
491
|
-
if (normalized === name || normalized === `${name}.mjs`)
|
|
491
|
+
if (normalized === name || normalized === `${name}.cmd` || normalized === `${name}.mjs`)
|
|
492
492
|
return true;
|
|
493
493
|
const absolute = normalized.startsWith("/") || /^[A-Za-z]:\//u.test(normalized);
|
|
494
494
|
if (!absolute)
|
|
495
495
|
return false;
|
|
496
496
|
const basename = normalized.slice(normalized.lastIndexOf("/") + 1);
|
|
497
|
-
return basename === name || basename === `${name}.mjs`;
|
|
497
|
+
return basename === name || basename === `${name}.cmd` || basename === `${name}.mjs`;
|
|
498
498
|
}
|
|
499
499
|
function claudeMemoryActivities(assistantMessages) {
|
|
500
500
|
const activities = [];
|
|
@@ -349,7 +349,7 @@ function activityCandidatesFromResponseItem(payload) {
|
|
|
349
349
|
operation: match[1] === "build" ? "repo-build" : "repo-update",
|
|
350
350
|
});
|
|
351
351
|
}
|
|
352
|
-
const memoryCliPattern = /(?:["']?cmd["']?\s*:\s*\\?["'`]|&&|\|\||;)\s*memorax-cli
|
|
352
|
+
const memoryCliPattern = /(?:["']?cmd["']?\s*:\s*\\?["'`]|&&|\|\||;)\s*memorax-cli(?:\.cmd)?\s+(search|add)\b/giu;
|
|
353
353
|
for (const match of input.matchAll(memoryCliPattern)) {
|
|
354
354
|
candidates.push({
|
|
355
355
|
offset: match.index,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export const traeAdapterLifecycle = {
|
|
2
|
+
async status({ argv, serviceOptions }) {
|
|
3
|
+
try {
|
|
4
|
+
return await (await load()).readTraeAdapterStatus(options(argv, serviceOptions));
|
|
5
|
+
}
|
|
6
|
+
catch (error) {
|
|
7
|
+
return { ok: false, action: "status", error: error instanceof Error ? error.message : String(error) };
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
async prepareEnable({ argv, serviceOptions }) {
|
|
11
|
+
try {
|
|
12
|
+
return await (await load()).enableTraeAdapter(options(argv, serviceOptions));
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
return { ok: false, action: "enable", error: error instanceof Error ? error.message : String(error) };
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
async disable({ argv, serviceOptions }) {
|
|
19
|
+
try {
|
|
20
|
+
return await (await load()).disableTraeAdapter(options(argv, serviceOptions));
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
return { ok: false, action: "disable", error: error instanceof Error ? error.message : String(error) };
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
async remove({ argv, serviceOptions }) {
|
|
27
|
+
try {
|
|
28
|
+
return await (await load()).removeTraeAdapterInstallation(options(argv, serviceOptions));
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
return {
|
|
32
|
+
ok: false,
|
|
33
|
+
action: "trae-adapter-remove",
|
|
34
|
+
reason: "adapter_remove_failed",
|
|
35
|
+
message: error instanceof Error ? error.message : String(error),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
function options(argv, serviceOptions) {
|
|
41
|
+
const traeHome = argValue(argv, "--trae-home");
|
|
42
|
+
return {
|
|
43
|
+
...(traeHome ? { traeHome } : {}),
|
|
44
|
+
memoraxCodeHome: serviceOptions.home,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
async function load() {
|
|
48
|
+
return await import(new URL("../../../../memorax-code-trae-adapter/src/config.mjs", import.meta.url).href);
|
|
49
|
+
}
|
|
50
|
+
function argValue(argv, name) {
|
|
51
|
+
const index = argv.indexOf(name);
|
|
52
|
+
return index >= 0 ? argv[index + 1] : undefined;
|
|
53
|
+
}
|