@bcmyguest/openmem 0.0.0-stage → 0.8.0
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/.agents/skills/openmem/SKILL.md +34 -0
- package/LICENSE +190 -0
- package/README.md +140 -2
- package/bin/hindsight-project-index +530 -0
- package/cli/coding-agent/access-policy.mjs +38 -0
- package/cli/coding-agent/agents.mjs +34 -0
- package/cli/coding-agent/bank-from-cwd.mjs +140 -0
- package/cli/coding-agent/capabilities.mjs +34 -0
- package/cli/coding-agent/context-store.mjs +81 -0
- package/cli/coding-agent/context-trim.mjs +897 -0
- package/cli/coding-agent/file-io.mjs +72 -0
- package/cli/coding-agent/hook-harnesses.mjs +88 -0
- package/cli/coding-agent/hook-runner.mjs +284 -0
- package/cli/coding-agent/install-access.mjs +119 -0
- package/cli/coding-agent/install-context-proxy.mjs +333 -0
- package/cli/coding-agent/install-rtk.mjs +60 -0
- package/cli/coding-agent/install-shim.mjs +201 -0
- package/cli/coding-agent/opencode-config.mjs +107 -0
- package/cli/coding-agent/opencode-plugin.mjs +132 -0
- package/cli/coding-agent/opencode2-plugin/index.js +299 -0
- package/cli/coding-agent/recall-frame.mjs +29 -0
- package/cli/coding-agent/remove-upstream-access.mjs +122 -0
- package/cli/coding-agent/runtime.mjs +40 -0
- package/cli/coding-agent/session-db.mjs +626 -0
- package/cli/coding-agent/session-facade.mjs +86 -0
- package/cli/coding-agent/toml-edit.mjs +161 -0
- package/cli/cognee-mcp.mjs +260 -0
- package/cli/context-management.mjs +254 -0
- package/cli/feed-sync.mjs +27 -0
- package/cli/install-coding-agent.mjs +298 -0
- package/cli/install-memory-mcp.mjs +426 -0
- package/cli/is-main.mjs +18 -0
- package/cli/mcp/context-sql-runner.mjs +58 -0
- package/cli/mcp/context-store.mjs +670 -0
- package/cli/mcp/context.mjs +61 -0
- package/cli/mcp/export/cognee-dataset-name.mjs +12 -0
- package/cli/mcp/export/cognee.mjs +119 -0
- package/cli/mcp/export/hindsight.mjs +48 -0
- package/cli/mcp/export/index.mjs +26 -0
- package/cli/mcp/export/mem0.mjs +31 -0
- package/cli/mcp/knowledge.mjs +333 -0
- package/cli/mcp/llm-synthesize.mjs +50 -0
- package/cli/mcp/mem0-scope-id.mjs +22 -0
- package/cli/mcp/memory-facade.mjs +521 -0
- package/cli/mcp/memory-reflect-consolidate.mjs +120 -0
- package/cli/mcp/notebooklm-banks.mjs +21 -0
- package/cli/mcp/notebooklm-hindsight-rest.mjs +45 -0
- package/cli/mcp/notebooklm-provider.mjs +225 -0
- package/cli/mcp/pmm-records.mjs +23 -0
- package/cli/mcp/portability.mjs +158 -0
- package/cli/mcp/stdio.mjs +65 -0
- package/cli/mcp/unified-mcp-install.mjs +65 -0
- package/cli/mem0-mcp.mjs +108 -0
- package/cli/notebooklm-mcp.mjs +236 -0
- package/cli/openmem-mcp.mjs +38 -0
- package/cli/openmem.mjs +222 -0
- package/cli/roots.mjs +85 -0
- package/cli/schedule.mjs +176 -0
- package/cli/stack.mjs +438 -0
- package/cli/switch-memory-provider.mjs +358 -0
- package/cli/wiring-report.mjs +125 -0
- package/compose.bench.yaml +12 -0
- package/compose.yaml +227 -0
- package/config/coding-agent.json +13 -0
- package/config/hindsight.env.example +26 -0
- package/config/index.yml +54 -0
- package/config/litellm.lemond.yaml +40 -0
- package/config/litellm.ollama.yaml +33 -0
- package/config/notebooklm.yml +33 -0
- package/config/openmem.toml.example +124 -0
- package/docs/OPENMEM.md +23 -0
- package/docs/architecture.md +245 -0
- package/docs/assets/README.md +10 -0
- package/docs/assets/setup-demo.gif +0 -0
- package/docs/coding-agent-hooks.md +75 -0
- package/docs/coding-agent-scopes.md +22 -0
- package/docs/coding-agents.md +71 -0
- package/docs/cognee.md +37 -0
- package/docs/compatibility.md +80 -0
- package/docs/concepts.md +135 -0
- package/docs/context-management.md +255 -0
- package/docs/context-proxy.md +115 -0
- package/docs/context-research.md +215 -0
- package/docs/context-store.md +277 -0
- package/docs/hindsight.md +77 -0
- package/docs/index-sources-roadmap.md +38 -0
- package/docs/index-sources.md +39 -0
- package/docs/indexer-sinks.md +122 -0
- package/docs/indexing.md +57 -0
- package/docs/manual-stack-setup.md +74 -0
- package/docs/mcp-install-guide.md +4 -0
- package/docs/mcp-setup.md +104 -0
- package/docs/mem0.md +141 -0
- package/docs/memory-portability.md +73 -0
- package/docs/memory-providers.md +246 -0
- package/docs/meridian-litellm.md +198 -0
- package/docs/model-configuration.md +106 -0
- package/docs/notebooklm.md +83 -0
- package/docs/npx-install.md +172 -0
- package/docs/openmem-config.md +194 -0
- package/docs/provider-wizard-hooks.md +222 -0
- package/docs/quickstart.md +107 -0
- package/docs/setup-wizard.md +117 -0
- package/docs/sources-feeds.md +39 -0
- package/docs/sources-readwise.md +23 -0
- package/docs/sources-zotero.md +22 -0
- package/glama.json +4 -0
- package/indexer/Dockerfile +38 -0
- package/indexer/code_outline.py +146 -0
- package/indexer/feed_sync.py +107 -0
- package/indexer/index_config.py +290 -0
- package/indexer/pytest.ini +5 -0
- package/indexer/sinks/__init__.py +148 -0
- package/indexer/sinks/_http.py +44 -0
- package/indexer/sinks/cognee.py +329 -0
- package/indexer/sinks/hindsight.py +107 -0
- package/indexer/sinks/mem0.py +247 -0
- package/indexer/watch.py +240 -0
- package/package.json +96 -4
- package/providers/_template/compose.yaml +52 -0
- package/providers/cognee/OPERATOR.md +82 -0
- package/providers/cognee/compose.yaml +89 -0
- package/providers/cognee/lib/clack.mjs +157 -0
- package/providers/cognee/lib/coding-agent.mjs +26 -0
- package/providers/cognee/lib/cognee-mcp-install.mjs +153 -0
- package/providers/cognee/lib/config.mjs +98 -0
- package/providers/cognee/lib/env-file.mjs +194 -0
- package/providers/cognee/lib/env-setup.mjs +83 -0
- package/providers/cognee/lib/llm-env.mjs +382 -0
- package/providers/cognee/lib/ports.mjs +25 -0
- package/providers/cognee/lib/smoke.mjs +246 -0
- package/providers/cognee/lib/stack-env.mjs +134 -0
- package/providers/cognee/lib/state.mjs +101 -0
- package/providers/cognee/lib/summary.mjs +56 -0
- package/providers/cognee/lib/validate.mjs +97 -0
- package/providers/cognee/manifest.json +56 -0
- package/providers/cognee/wizard.mjs +134 -0
- package/providers/graphiti/manifest.json +15 -0
- package/providers/hindsight/lib/clack.mjs +347 -0
- package/providers/hindsight/lib/coding-agent.mjs +204 -0
- package/providers/hindsight/lib/config.mjs +79 -0
- package/providers/hindsight/lib/env-setup.mjs +72 -0
- package/providers/hindsight/lib/litellm-routes.mjs +196 -0
- package/providers/hindsight/lib/meridian.mjs +307 -0
- package/providers/hindsight/lib/model-backend.mjs +243 -0
- package/providers/hindsight/lib/notebooklm-mcp-install.mjs +127 -0
- package/providers/hindsight/lib/ollama-compose.mjs +51 -0
- package/providers/hindsight/lib/ports.mjs +30 -0
- package/providers/hindsight/lib/probe.mjs +54 -0
- package/providers/hindsight/lib/stack-env.mjs +125 -0
- package/providers/hindsight/lib/state.mjs +80 -0
- package/providers/hindsight/lib/summary.mjs +57 -0
- package/providers/hindsight/lib/validate.mjs +81 -0
- package/providers/hindsight/manifest.json +58 -0
- package/providers/hindsight/wizard.mjs +150 -0
- package/providers/letta/manifest.json +29 -0
- package/providers/mem0/OPERATOR.md +143 -0
- package/providers/mem0/compose.yaml +79 -0
- package/providers/mem0/lib/coding-agent.mjs +58 -0
- package/providers/mem0/lib/config.mjs +45 -0
- package/providers/mem0/lib/configure.mjs +201 -0
- package/providers/mem0/lib/dotenv.mjs +71 -0
- package/providers/mem0/lib/env-file.mjs +110 -0
- package/providers/mem0/lib/http.mjs +69 -0
- package/providers/mem0/lib/litellm.mjs +457 -0
- package/providers/mem0/lib/mcp-install.mjs +165 -0
- package/providers/mem0/lib/secret.mjs +30 -0
- package/providers/mem0/lib/smoke.mjs +179 -0
- package/providers/mem0/lib/stack-env.mjs +255 -0
- package/providers/mem0/lib/state.mjs +67 -0
- package/providers/mem0/lib/summary.mjs +88 -0
- package/providers/mem0/lib/url.mjs +106 -0
- package/providers/mem0/lib/validate.mjs +158 -0
- package/providers/mem0/manifest.json +47 -0
- package/providers/mem0/wizard.mjs +146 -0
- package/providers/zep/manifest.json +29 -0
- package/proxy/config.yaml +33 -0
- package/proxy/openmem_context/__init__.py +6 -0
- package/proxy/openmem_context/adapters.py +504 -0
- package/proxy/openmem_context/compress.py +53 -0
- package/proxy/openmem_context/core.py +606 -0
- package/proxy/openmem_context/embed.py +212 -0
- package/proxy/openmem_context/recall.py +49 -0
- package/proxy/openmem_context/session.py +70 -0
- package/proxy/openmem_context/sessiondb.py +276 -0
- package/proxy/openmem_context/settings.py +134 -0
- package/proxy/openmem_context/store.py +129 -0
- package/proxy/openmem_context/tokens.py +123 -0
- package/proxy/openmem_context/ttl.py +78 -0
- package/proxy/openmem_context_hook.py +34 -0
- package/scripts/check-pack.mjs +219 -0
- package/scripts/gen-masks.mjs +83 -0
- package/scripts/gen-masks.sh +4 -0
- package/scripts/promotion-provider-smoke.mjs +34 -0
- package/scripts/run-setup.sh +30 -0
- package/scripts/setup.mjs +107 -0
- package/scripts/setup.sh +5 -0
- package/scripts/spin-up.sh +45 -0
- package/scripts/wizard.sh +5 -0
- package/server.json +34 -0
- package/sync/Dockerfile +27 -0
- package/sync/memory_backend.py +87 -0
- package/sync/notebooklm_sync.py +664 -0
- package/wizard/bin/pm.mjs +97 -0
- package/wizard/bin/setup.mjs +33 -0
- package/wizard/lib/compose-version.mjs +32 -0
- package/wizard/lib/compose.mjs +70 -0
- package/wizard/lib/context-step.mjs +140 -0
- package/wizard/lib/curl.mjs +103 -0
- package/wizard/lib/docker-build.mjs +148 -0
- package/wizard/lib/exec.mjs +41 -0
- package/wizard/lib/indexer.mjs +6 -0
- package/wizard/lib/litellm-env.mjs +55 -0
- package/wizard/lib/load-machine-env.mjs +4 -0
- package/wizard/lib/log.mjs +32 -0
- package/wizard/lib/notebooklm-agent-access.mjs +92 -0
- package/wizard/lib/notebooklm.mjs +214 -0
- package/wizard/lib/parse-args.mjs +87 -0
- package/wizard/lib/paths.mjs +39 -0
- package/wizard/lib/pm-config.mjs +371 -0
- package/wizard/lib/ports.mjs +94 -0
- package/wizard/lib/prompts.mjs +85 -0
- package/wizard/lib/provider-wizard/helpers.mjs +98 -0
- package/wizard/lib/provider-wizard/run-steps.mjs +129 -0
- package/wizard/lib/providers/registry.mjs +262 -0
- package/wizard/lib/run-clack.mjs +108 -0
- package/wizard/lib/run-wizard.mjs +750 -0
- package/wizard/lib/validate-setup.mjs +62 -0
- package/wizard/lib/wizard-action.mjs +34 -0
- package/wizard/lib/wizard-conf.mjs +71 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { envValue, indexerStateDir } from "./paths.mjs";
|
|
4
|
+
import { DEFAULT_PROVIDER_ID, listAllProviders, validateManifest } from "./providers/registry.mjs";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Provider-neutral checks: manifest validity, wizard.conf, the stack .env host ids,
|
|
8
|
+
* index.yml and the shared indexer state dir. Provider checks come from the provider's
|
|
9
|
+
* `extendValidation` hook, which appends to ctx.validationErrors / ctx.validationChecks.
|
|
10
|
+
*
|
|
11
|
+
* @param {import("./run-wizard.mjs").WizardContext} ctx
|
|
12
|
+
* @returns {{ ok: boolean, errors: string[], checks: string[] }}
|
|
13
|
+
*/
|
|
14
|
+
export function validateMemorySetup(ctx) {
|
|
15
|
+
const errors = [];
|
|
16
|
+
const checks = [];
|
|
17
|
+
|
|
18
|
+
if (ctx.memoryProvider) {
|
|
19
|
+
for (const e of validateManifest(ctx.memoryProvider)) {
|
|
20
|
+
errors.push(`manifest ${ctx.memoryProvider.id}: ${e}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (!fs.existsSync(ctx.wizardConf)) {
|
|
25
|
+
errors.push(`missing ${ctx.wizardConf}`);
|
|
26
|
+
} else {
|
|
27
|
+
const provider = envValue(ctx.wizardConf, "MEMORY_PROVIDER") || DEFAULT_PROVIDER_ID;
|
|
28
|
+
checks.push(`wizard.conf MEMORY_PROVIDER=${provider}`);
|
|
29
|
+
if (ctx.memoryProvider && provider !== ctx.memoryProvider.id) {
|
|
30
|
+
errors.push(
|
|
31
|
+
`wizard.conf MEMORY_PROVIDER=${provider} does not match active ${ctx.memoryProvider.id}`,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const stackEnv = path.join(ctx.repoRoot, ".env");
|
|
37
|
+
if (!fs.existsSync(stackEnv)) errors.push(`missing repo ${stackEnv}`);
|
|
38
|
+
else {
|
|
39
|
+
for (const key of ["HOST_UID", "HOST_GID"]) {
|
|
40
|
+
if (!envValue(stackEnv, key)) errors.push(`repo .env missing ${key}`);
|
|
41
|
+
}
|
|
42
|
+
checks.push("repo .env host ids");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (!fs.existsSync(ctx.indexFile)) errors.push(`missing ${ctx.indexFile}`);
|
|
46
|
+
else checks.push("index.yml present");
|
|
47
|
+
|
|
48
|
+
const stateDir = indexerStateDir(ctx);
|
|
49
|
+
if (!fs.existsSync(stateDir)) errors.push(`missing indexer state dir ${stateDir}`);
|
|
50
|
+
else checks.push("indexer state mount point");
|
|
51
|
+
|
|
52
|
+
return { ok: errors.length === 0, errors, checks };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** @returns {{ ok: boolean, errors: string[] }} */
|
|
56
|
+
export function validateAllProviderManifests() {
|
|
57
|
+
const errors = [];
|
|
58
|
+
for (const m of listAllProviders()) {
|
|
59
|
+
for (const e of validateManifest(m)) errors.push(`${m.id}: ${e}`);
|
|
60
|
+
}
|
|
61
|
+
return { ok: errors.length === 0, errors };
|
|
62
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** @typedef {"configure"|"up"|"down"} WizardAction */
|
|
2
|
+
|
|
3
|
+
/** @returns {WizardAction} */
|
|
4
|
+
export function actionDefault() {
|
|
5
|
+
const fromEnv = process.env.PM_WIZARD_ACTION || process.env.WIZARD_ACTION;
|
|
6
|
+
if (fromEnv === "up" || fromEnv === "down" || fromEnv === "configure") return fromEnv;
|
|
7
|
+
return "configure";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {string[]} argv
|
|
12
|
+
* @returns {WizardAction}
|
|
13
|
+
*/
|
|
14
|
+
export function parseActionFromArgv(argv) {
|
|
15
|
+
if (argv.includes("--down")) return "down";
|
|
16
|
+
if (argv.includes("--up")) return "up";
|
|
17
|
+
const fromEnv = process.env.PM_WIZARD_ACTION || process.env.WIZARD_ACTION;
|
|
18
|
+
if (fromEnv === "up" || fromEnv === "down") return fromEnv;
|
|
19
|
+
return "configure";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** @param {WizardAction} action */
|
|
23
|
+
export function actionLabel(action) {
|
|
24
|
+
switch (action) {
|
|
25
|
+
case "configure":
|
|
26
|
+
return "Configure and start (full setup)";
|
|
27
|
+
case "up":
|
|
28
|
+
return "Start stack (existing config)";
|
|
29
|
+
case "down":
|
|
30
|
+
return "Stop stack";
|
|
31
|
+
default:
|
|
32
|
+
return action;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { ensureHsDir, envValue } from "./paths.mjs";
|
|
3
|
+
import { syncPmConfig } from "./pm-config.mjs";
|
|
4
|
+
import { DEFAULT_PROVIDER_ID } from "./providers/registry.mjs";
|
|
5
|
+
|
|
6
|
+
/** Meta keys owned outside provider extras; rewrite keeps them unless `extra` overrides. */
|
|
7
|
+
const META_KEYS = ["NOTEBOOKLM_HOME"];
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Write wizard.conf (MEMORY_PROVIDER plus provider-owned keys) and the mise-like
|
|
11
|
+
* config.toml. Does nothing in a dry run; callers print their own dry-run line.
|
|
12
|
+
* Preserves meta keys already on disk (for example NOTEBOOKLM_HOME) when not in `extra`.
|
|
13
|
+
*
|
|
14
|
+
* @param {import("./run-wizard.mjs").WizardContext} ctx
|
|
15
|
+
* @param {Record<string, string>} [extra] provider keys, written after MEMORY_PROVIDER in order
|
|
16
|
+
* @param {{ pmSections?: Record<string, Record<string, unknown>> }} [opts]
|
|
17
|
+
*/
|
|
18
|
+
export function writeWizardConf(ctx, extra = {}, opts = {}) {
|
|
19
|
+
if (ctx.dry) return;
|
|
20
|
+
ensureHsDir(ctx);
|
|
21
|
+
/** @type {Record<string, string>} */
|
|
22
|
+
const preserved = {};
|
|
23
|
+
if (fs.existsSync(ctx.wizardConf)) {
|
|
24
|
+
for (const key of META_KEYS) {
|
|
25
|
+
if (key in extra) continue;
|
|
26
|
+
const v = envValue(ctx.wizardConf, key);
|
|
27
|
+
if (v) preserved[key] = v;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const providerId = ctx.memoryProvider?.id || DEFAULT_PROVIDER_ID;
|
|
31
|
+
let body = `MEMORY_PROVIDER=${providerId}\n`;
|
|
32
|
+
for (const [key, value] of Object.entries({ ...preserved, ...extra })) {
|
|
33
|
+
if (!/^[A-Z][A-Z0-9_]*$/.test(key)) throw new Error(`invalid wizard.conf key: ${key}`);
|
|
34
|
+
body += `${key}=${String(value ?? "").replace(/[\r\n]+/g, " ")}\n`;
|
|
35
|
+
}
|
|
36
|
+
fs.writeFileSync(ctx.wizardConf, body, { mode: 0o644 });
|
|
37
|
+
ctx.wizardConfWritten = true;
|
|
38
|
+
syncPmConfig(ctx, opts.pmSections || {});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Merge keys into the existing wizard.conf without dropping MEMORY_PROVIDER or other lines.
|
|
43
|
+
* Does nothing in a dry run.
|
|
44
|
+
*
|
|
45
|
+
* @param {import("./run-wizard.mjs").WizardContext} ctx
|
|
46
|
+
* @param {Record<string, string>} updates
|
|
47
|
+
*/
|
|
48
|
+
export function upsertWizardConf(ctx, updates) {
|
|
49
|
+
if (ctx.dry) return;
|
|
50
|
+
ensureHsDir(ctx);
|
|
51
|
+
/** @type {Record<string, string>} */
|
|
52
|
+
const keys = {};
|
|
53
|
+
if (fs.existsSync(ctx.wizardConf)) {
|
|
54
|
+
for (const line of fs.readFileSync(ctx.wizardConf, "utf8").split("\n")) {
|
|
55
|
+
const m = /^([A-Z][A-Z0-9_]*)=(.*)$/.exec(line);
|
|
56
|
+
if (m) keys[m[1]] = m[2];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const providerId = ctx.memoryProvider?.id || keys.MEMORY_PROVIDER || DEFAULT_PROVIDER_ID;
|
|
60
|
+
for (const [key, value] of Object.entries(updates)) {
|
|
61
|
+
if (!/^[A-Z][A-Z0-9_]*$/.test(key)) throw new Error(`invalid wizard.conf key: ${key}`);
|
|
62
|
+
keys[key] = String(value ?? "").replace(/[\r\n]+/g, " ");
|
|
63
|
+
}
|
|
64
|
+
keys.MEMORY_PROVIDER = providerId;
|
|
65
|
+
let body = `MEMORY_PROVIDER=${providerId}\n`;
|
|
66
|
+
for (const [key, value] of Object.entries(keys)) {
|
|
67
|
+
if (key === "MEMORY_PROVIDER") continue;
|
|
68
|
+
body += `${key}=${value}\n`;
|
|
69
|
+
}
|
|
70
|
+
fs.writeFileSync(ctx.wizardConf, body, { mode: 0o644 });
|
|
71
|
+
}
|