@eleboucher/opencode-memini 0.6.4 → 0.6.6
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 +2 -1
- package/memini.js +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,7 +46,8 @@ Pass options inline via the `[name, options]` form:
|
|
|
46
46
|
| Option | Env var | Default | Purpose |
|
|
47
47
|
| ------------------- | -------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
48
48
|
| `base_url` | `MEMINI_BASE_URL` | `http://localhost:8080` | memini REST base URL (alias: `MEMINI_URL`) |
|
|
49
|
-
| `namespace` | `MEMINI_NAMESPACE` | git repo basename |
|
|
49
|
+
| `namespace` | `MEMINI_NAMESPACE` | git repo basename | project the memory is scoped to (`X-Memini-Namespace`) |
|
|
50
|
+
| `home` | `MEMINI_HOME` | unset | caller's personal namespace, sent as `X-Memini-Home`; unset = no home leg |
|
|
50
51
|
| `recall` | `MEMINI_RECALL` | on | `false` disables recall-before-turn |
|
|
51
52
|
| `capture` | `MEMINI_CAPTURE` | on | `false` disables capture-after-turn |
|
|
52
53
|
| `recall_limit` | `MEMINI_RECALL_LIMIT` | `3` | max memories injected per turn |
|
package/memini.js
CHANGED
|
@@ -165,12 +165,19 @@ export function resolveConfig(env, options, worktree) {
|
|
|
165
165
|
}
|
|
166
166
|
return DEFAULT_RECALL_LIMIT;
|
|
167
167
|
})();
|
|
168
|
+
// home: the caller's personal namespace, sent as X-Memini-Home. Same
|
|
169
|
+
// env-only resolution style as namespace's MEMINI_NAMESPACE (option wins
|
|
170
|
+
// over env), but no config-file/derivation fallback — unset means "no home
|
|
171
|
+
// leg", not a guess.
|
|
172
|
+
const homeRaw = o.home !== undefined ? o.home : e.MEMINI_HOME;
|
|
173
|
+
const home = homeRaw && String(homeRaw).trim() ? String(homeRaw).trim() : undefined;
|
|
168
174
|
return {
|
|
169
175
|
base_url: o.base_url || e.MEMINI_BASE_URL || e.MEMINI_URL || DEFAULT_BASE_URL,
|
|
170
176
|
// namespace is already resolved above (explicit raw-trimmed, or a
|
|
171
177
|
// per-segment-sanitized config/derived value); re-sanitizing here would
|
|
172
178
|
// flatten tenant "/" separators.
|
|
173
179
|
namespace: namespace || DEFAULT_NAMESPACE,
|
|
180
|
+
home,
|
|
174
181
|
recall: o.recall !== undefined ? o.recall !== false : envBool(e.MEMINI_RECALL, true),
|
|
175
182
|
capture: o.capture !== undefined ? o.capture !== false : envBool(e.MEMINI_CAPTURE, true),
|
|
176
183
|
recall_limit,
|
|
@@ -387,6 +394,7 @@ function createClient(cfg, log) {
|
|
|
387
394
|
guardPlaintextBearerAuth(baseUrl, secret);
|
|
388
395
|
const headers = { "Content-Type": "application/json", "X-Memini-Namespace": cfg.namespace };
|
|
389
396
|
if (secret) headers.Authorization = `Bearer ${secret}`;
|
|
397
|
+
if (cfg.home) headers["X-Memini-Home"] = cfg.home;
|
|
390
398
|
try {
|
|
391
399
|
const res = await fetch(`${baseUrl}${path}`, {
|
|
392
400
|
method: "POST",
|