omo-memory 0.1.4 → 0.1.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 CHANGED
@@ -9,7 +9,7 @@ It gives lazycodex, omo-on-opencode, lfg, and future OMO adapters a shared local
9
9
 
10
10
  ## Product shape
11
11
 
12
- - Global local DB: `~/.omo/memory/state.sqlite`
12
+ - Project-local DB: `<project-root>/.omo/memory/state.sqlite`
13
13
  - Project namespacing: by git remote + project root hash
14
14
  - Privacy default: local-only, no network sync, no secrets by design
15
15
  - Intended adapters: Codex/lazycodex, OpenCode/OMO, GrokBuild/lfg
@@ -49,7 +49,7 @@ omo-memory init
49
49
 
50
50
  ## MCP registration
51
51
 
52
- Register the same MCP server in every host that should read/write the shared local memory DB.
52
+ Register the same MCP server in every host that should read/write the current project's memory DB.
53
53
 
54
54
  Codex:
55
55
 
@@ -63,11 +63,11 @@ Grok:
63
63
  grok mcp add omo-memory -- npx -y omo-memory mcp
64
64
  ```
65
65
 
66
- Both hosts use `~/.omo/memory/state.sqlite` by default. The `host` value is recorded when an adapter calls `memory_start_session`, not by installing separate servers.
66
+ Both hosts use the current project ledger at `<project-root>/.omo/memory/state.sqlite` by default. The `host` value is recorded when an adapter calls `memory_start_session`, not by installing separate servers.
67
67
 
68
68
  ## Passive setup
69
69
 
70
- Install passive skills/rules/hooks with:
70
+ Install the host plugin-style bundles with:
71
71
 
72
72
  ```sh
73
73
  npx -y omo-memory hooks install --host all
@@ -75,10 +75,10 @@ npx -y omo-memory hooks install --host all
75
75
 
76
76
  This installs:
77
77
 
78
- - Codex: `~/.codex/skills/omo-memory/SKILL.md` plus a global `~/.codex/AGENTS.md` lifecycle rule.
79
- - Grok: `~/.grok/skills/omo-memory/SKILL.md`, a global `~/.grok/AGENTS.md` lifecycle rule, and a `~/.grok/hooks/` SessionStart hook.
78
+ - Codex: `~/.codex/skills/omo-memory/SKILL.md`, a global `~/.codex/AGENTS.md` lifecycle rule, and a local Codex plugin with a `SessionStart` hook.
79
+ - Grok: `~/.grok/plugins/omo-memory` with `plugin.json`, skill, `SessionStart` hook, and `.mcp.json`, plus compatibility copies in `~/.grok/skills` and `~/.grok/hooks`.
80
80
 
81
- Codex currently exposes MCP and global instruction surfaces, but not a standalone user hook add command like Grok. The Codex passive behavior is therefore rule/skill-driven; Grok additionally gets an executable SessionStart hook.
81
+ The installer is idempotent. For Codex it also runs `codex plugin add omo-memory@islee23520 --json` when installing into the real home directory.
82
82
 
83
83
  ## Session bootstrap
84
84
 
@@ -82,9 +82,32 @@ try {
82
82
  }
83
83
  `;
84
84
  export const GROK_HOOK_SCRIPT = SESSION_BOOTSTRAP_SCRIPT.replace('?? "codex"', '?? "grok"').replace('?? "lazycodex"', '?? "lfg"');
85
+ export const GROK_PLUGIN_JSON = `{
86
+ "name": "omo-memory",
87
+ "version": "0.1.6",
88
+ "description": "Project-local OMO Memory bootstrap hook and MCP server for Grok.",
89
+ "author": "islee23520",
90
+ "repository": "https://github.com/islee23520/omo-memory",
91
+ "homepage": "https://github.com/islee23520/omo-memory",
92
+ "license": "MIT",
93
+ "keywords": ["grok", "hooks", "memory", "mcp"],
94
+ "skills": "./skills/",
95
+ "hooks": "./hooks/hooks.json",
96
+ "mcpServers": "./.mcp.json"
97
+ }
98
+ `;
99
+ export const GROK_MCP_JSON = `{
100
+ "mcpServers": {
101
+ "omo-memory": {
102
+ "command": "npx",
103
+ "args": ["-y", "omo-memory", "mcp"]
104
+ }
105
+ }
106
+ }
107
+ `;
85
108
  export const CODEX_PLUGIN_JSON = `{
86
109
  "name": "omo-memory",
87
- "version": "0.1.4",
110
+ "version": "0.1.6",
88
111
  "description": "Session-start OMO Memory bootstrap hook for Codex.",
89
112
  "author": "islee23520",
90
113
  "homepage": "https://github.com/islee23520/omo-memory",
package/dist/hooks.js CHANGED
@@ -2,7 +2,7 @@ import { spawnSync } from "node:child_process";
2
2
  import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
3
  import { homedir } from "node:os";
4
4
  import { dirname, join } from "node:path";
5
- import { CODEX_AGENTS_BLOCK, CODEX_HOOKS_JSON, CODEX_MARKETPLACE, CODEX_PLUGIN, CODEX_PLUGIN_JSON, CODEX_SKILL, GROK_AGENTS_BLOCK, GROK_HOOK_SCRIPT, GROK_HOOKS_JSON, GROK_SKILL, SESSION_BOOTSTRAP_SCRIPT, } from "./hookTemplates.js";
5
+ import { CODEX_AGENTS_BLOCK, CODEX_HOOKS_JSON, CODEX_MARKETPLACE, CODEX_PLUGIN, CODEX_PLUGIN_JSON, CODEX_SKILL, GROK_AGENTS_BLOCK, GROK_HOOK_SCRIPT, GROK_HOOKS_JSON, GROK_MCP_JSON, GROK_PLUGIN_JSON, GROK_SKILL, SESSION_BOOTSTRAP_SCRIPT, } from "./hookTemplates.js";
6
6
  const BLOCK_START = "<!-- omo-memory:start -->";
7
7
  const BLOCK_END = "<!-- omo-memory:end -->";
8
8
  export function installHooks(input) {
@@ -58,15 +58,27 @@ function installGrok(home) {
58
58
  const agentsPath = join(home, ".grok", "AGENTS.md");
59
59
  const hookScriptPath = join(home, ".grok", "hooks", "omo-memory-session.mjs");
60
60
  const hookJsonPath = join(home, ".grok", "hooks", "omo-memory-hooks.json");
61
+ const pluginRoot = join(home, ".grok", "plugins", "omo-memory");
62
+ const pluginJsonPath = join(pluginRoot, "plugin.json");
63
+ const pluginSkillPath = join(pluginRoot, "skills", "omo-memory", "SKILL.md");
64
+ const pluginHookJsonPath = join(pluginRoot, "hooks", "hooks.json");
65
+ const pluginHookScriptPath = join(pluginRoot, "scripts", "omo-memory-session.mjs");
66
+ const pluginMcpPath = join(pluginRoot, ".mcp.json");
61
67
  writeText(skillPath, GROK_SKILL);
62
68
  upsertAgentsBlock(agentsPath, GROK_AGENTS_BLOCK);
63
69
  writeText(hookScriptPath, GROK_HOOK_SCRIPT);
64
70
  chmodSync(hookScriptPath, 0o755);
65
71
  writeText(hookJsonPath, GROK_HOOKS_JSON.replace("{{HOME}}", home));
72
+ writeText(pluginJsonPath, GROK_PLUGIN_JSON);
73
+ writeText(pluginSkillPath, GROK_SKILL);
74
+ writeText(pluginHookJsonPath, GROK_HOOKS_JSON.replace(`node \\"{{HOME}}/.grok/hooks/omo-memory-session.mjs\\"`, `node \\"${pluginHookScriptPath}\\"`));
75
+ writeText(pluginHookScriptPath, GROK_HOOK_SCRIPT);
76
+ chmodSync(pluginHookScriptPath, 0o755);
77
+ writeText(pluginMcpPath, GROK_MCP_JSON);
66
78
  return {
67
79
  host: "grok",
68
- files: [skillPath, agentsPath, hookScriptPath, hookJsonPath],
69
- notes: ["Grok discovers ~/.grok/skills and ~/.grok/hooks; run grok inspect to verify discovery."],
80
+ files: [skillPath, agentsPath, hookScriptPath, hookJsonPath, pluginJsonPath, pluginSkillPath, pluginHookJsonPath, pluginHookScriptPath, pluginMcpPath],
81
+ notes: ["Grok plugin bundle installed at ~/.grok/plugins/omo-memory; run `grok plugin list` or `grok inspect` to verify discovery."],
70
82
  };
71
83
  }
72
84
  function writeText(path, text) {
package/dist/memory.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import Database from "better-sqlite3";
2
2
  import { createHash, randomUUID } from "node:crypto";
3
3
  import { mkdirSync } from "node:fs";
4
- import { homedir } from "node:os";
5
4
  import { dirname, join, resolve } from "node:path";
6
5
  import { execFileSync } from "node:child_process";
7
6
  import { redactSecrets, sanitizeGitRemote } from "./privacy.js";
@@ -13,7 +12,7 @@ export class PurgeConfirmationError extends Error {
13
12
  }
14
13
  const SCHEMA_VERSION = 1;
15
14
  export function defaultDbPath() {
16
- return process.env["OMO_MEMORY_DB"] ?? join(homedir(), ".omo", "memory", "state.sqlite");
15
+ return process.env["OMO_MEMORY_DB"] ?? join(resolveProjectContext().repoRoot, ".omo", "memory", "state.sqlite");
17
16
  }
18
17
  export function memoryPaths() {
19
18
  return { dbPath: defaultDbPath() };
@@ -1,6 +1,6 @@
1
1
  # Adapter Integration
2
2
 
3
- OMO Memory is the shared local work ledger for OMO adapters. It is host-neutral: lazycodex, omo-on-opencode, lfg, and future adapters all write summaries, decisions, QA evidence, task state, and handoffs to the same local SQLite database at `~/.omo/memory/state.sqlite` by default.
3
+ OMO Memory is the shared local work ledger for OMO adapters. It is host-neutral: lazycodex, omo-on-opencode, lfg, and future adapters all write summaries, decisions, QA evidence, task state, and handoffs to the same project-local SQLite database at `<project-root>/.omo/memory/state.sqlite` by default.
4
4
 
5
5
  No full transcript capture by default. Do not store API keys, tokens, `.env` contents, auth files, raw tool logs, auth headers, cookies, or any other secret-bearing material.
6
6
 
@@ -83,7 +83,7 @@ grok mcp add omo-memory -- npx -y omo-memory mcp
83
83
 
84
84
  Register the same MCP server in every host that needs memory access. Do not create separate Codex/Grok schemas or databases; host identity belongs in `memory_start_session` metadata.
85
85
 
86
- ## Passive Hook Install
86
+ ## Plugin-Style Host Install
87
87
 
88
88
  Install host-side passive behavior with:
89
89
 
@@ -93,11 +93,11 @@ npx -y omo-memory hooks install --host all
93
93
 
94
94
  Supported `--host` values:
95
95
 
96
- - `codex`: installs `~/.codex/skills/omo-memory/SKILL.md` and an idempotent OMO Memory block in `~/.codex/AGENTS.md`.
97
- - `grok`: installs `~/.grok/skills/omo-memory/SKILL.md`, an idempotent OMO Memory block in `~/.grok/AGENTS.md`, and `~/.grok/hooks/omo-memory-hooks.json` plus its SessionStart script.
96
+ - `codex`: installs `~/.codex/skills/omo-memory/SKILL.md`, an idempotent OMO Memory block in `~/.codex/AGENTS.md`, and a local Codex plugin with a `SessionStart` hook.
97
+ - `grok`: installs `~/.grok/plugins/omo-memory` with `plugin.json`, a bundled skill, `hooks/hooks.json`, `.mcp.json`, and a SessionStart script. It also writes compatibility copies to `~/.grok/skills` and `~/.grok/hooks`.
98
98
  - `all`: installs both.
99
99
 
100
- The installer is idempotent and replaces only the marked `omo-memory` block in AGENTS files.
100
+ The installer is idempotent and replaces only the marked `omo-memory` block in AGENTS files. For Codex it also registers the local plugin with `codex plugin add omo-memory@islee23520 --json` when installing into the real home directory. For Grok, `~/.grok/plugins/omo-memory` is a user plugin and is trusted automatically by Grok.
101
101
 
102
102
  ## Session Bootstrap Flow
103
103
 
@@ -17,7 +17,7 @@ Codegraph solves code intelligence, not work/session memory. OMO needs a separat
17
17
 
18
18
  ## Product direction
19
19
 
20
- - Global local DB: `~/.omo/memory/state.sqlite`
20
+ - Project-local DB: `<project-root>/.omo/memory/state.sqlite`
21
21
  - Project namespace: derive from git remote + repo root hash, with branch/head metadata
22
22
  - Local-first privacy: no cloud sync and no secret storage by default
23
23
  - Adapter-neutral schema: `host` and `adapter` are metadata, not separate products
@@ -58,7 +58,7 @@ Codegraph solves code intelligence, not work/session memory. OMO needs a separat
58
58
 
59
59
  ### CLI
60
60
 
61
- - `omo-memory init` creates or migrates `~/.omo/memory/state.sqlite`.
61
+ - `omo-memory init` creates or migrates `<project-root>/.omo/memory/state.sqlite`.
62
62
  - `omo-memory session start --host grok --adapter lfg` records a session for the current project.
63
63
  - `omo-memory event record --type decision --summary "..."` appends a project/session event.
64
64
  - `omo-memory recent` lists recent project events.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omo-memory",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Host-neutral local SQLite memory and session ledger for OMO adapters, exposed through CLI and MCP.",
5
5
  "type": "module",
6
6
  "files": [