@eleboucher/opencode-memini 0.4.10 → 0.4.14

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 (3) hide show
  1. package/README.md +2 -2
  2. package/memini.js +4 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -45,7 +45,7 @@ Pass options inline via the `[name, options]` form:
45
45
 
46
46
  | Option | Env var | Default | Purpose |
47
47
  | ------------------- | -------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
48
- | `base_url` | `MEMINI_BASE_URL` | `http://localhost:8080` | memini REST base URL |
48
+ | `base_url` | `MEMINI_BASE_URL` | `http://localhost:8080` | memini REST base URL (alias: `MEMINI_URL`) |
49
49
  | `namespace` | `MEMINI_NAMESPACE` | git repo basename | tenant the memory is scoped to (`X-Memini-Namespace`) |
50
50
  | `recall` | `MEMINI_RECALL` | on | `false` disables recall-before-turn |
51
51
  | `capture` | `MEMINI_CAPTURE` | on | `false` disables capture-after-turn |
@@ -55,7 +55,7 @@ Pass options inline via the `[name, options]` form:
55
55
  | `timeout_ms` | `MEMINI_TIMEOUT_MS` | `30000` | per-request timeout |
56
56
  | `fallback_on_error` | `MEMINI_FALLBACK` | on | `false` surfaces errors instead of degrading silently |
57
57
  | — | `MEMINI_INJECT_LABELS` | — | comma-separated label toggles for each bullet: `tier`, `confidence`, `age` |
58
- | — | `MEMINI_API_KEY` | — | bearer token, if memini needs auth (env only — secret) |
58
+ | — | `MEMINI_API_KEY` | — | bearer token, if memini needs auth (env only — secret; alias: `MEMINI_TOKEN`) |
59
59
  | — | `MEMINI_REQUIRE_HTTPS` | — | `1` refuses to send the token over plaintext HTTP |
60
60
 
61
61
  Inline options win over the env vars. Secrets stay in the environment: set
package/memini.js CHANGED
@@ -61,7 +61,7 @@ export function resolveConfig(env, options, worktree) {
61
61
  return DEFAULT_RECALL_LIMIT;
62
62
  })();
63
63
  return {
64
- base_url: o.base_url || e.MEMINI_BASE_URL || DEFAULT_BASE_URL,
64
+ base_url: o.base_url || e.MEMINI_BASE_URL || e.MEMINI_URL || DEFAULT_BASE_URL,
65
65
  namespace: sanitizeNamespace(namespace) || DEFAULT_NAMESPACE,
66
66
  recall: o.recall !== undefined ? o.recall !== false : envBool(e.MEMINI_RECALL, true),
67
67
  capture: o.capture !== undefined ? o.capture !== false : envBool(e.MEMINI_CAPTURE, true),
@@ -271,7 +271,7 @@ export function truncate(value, max) {
271
271
 
272
272
  function createClient(cfg, log) {
273
273
  const baseUrl = String(cfg.base_url).replace(/\/+$/, "");
274
- const secret = process.env.MEMINI_API_KEY;
274
+ const secret = process.env.MEMINI_API_KEY || process.env.MEMINI_TOKEN;
275
275
  const guardPlaintextBearerAuth = createPlaintextBearerAuthGuard((m) => log.warn(m));
276
276
  if (process.env.MEMINI_REQUIRE_HTTPS === "1") guardPlaintextBearerAuth(baseUrl, secret);
277
277
 
@@ -410,10 +410,10 @@ export const MeminiPlugin = async ({ client, worktree, directory }, options) =>
410
410
  if (!userText || !assistantText) return;
411
411
  if (assistantID && captured.has(assistantID)) return;
412
412
  const stored = await rest.postJson("/v1/memories", {
413
- content: `User: ${userText.slice(0, 1000)}\nAssistant: ${assistantText.slice(0, 3000)}`,
413
+ content: `${userText.slice(0, 1000)}\n\n${assistantText.slice(0, 3000)}`,
414
414
  tier: "episodic",
415
415
  tags: ["opencode"],
416
- metadata: { source: "opencode", session_id: sessionID },
416
+ metadata: { source: "opencode", session_id: sessionID, format: "turn" },
417
417
  });
418
418
  if (stored !== null && assistantID) captured.add(assistantID);
419
419
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleboucher/opencode-memini",
3
- "version": "0.4.10",
3
+ "version": "0.4.14",
4
4
  "description": "Automatic cross-session memory for opencode via memini — recall before each turn, capture after.",
5
5
  "keywords": [
6
6
  "memini",