omo-memory 0.1.3 → 0.1.4

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.
@@ -84,7 +84,7 @@ try {
84
84
  export const GROK_HOOK_SCRIPT = SESSION_BOOTSTRAP_SCRIPT.replace('?? "codex"', '?? "grok"').replace('?? "lazycodex"', '?? "lfg"');
85
85
  export const CODEX_PLUGIN_JSON = `{
86
86
  "name": "omo-memory",
87
- "version": "0.1.3",
87
+ "version": "0.1.4",
88
88
  "description": "Session-start OMO Memory bootstrap hook for Codex.",
89
89
  "author": "islee23520",
90
90
  "homepage": "https://github.com/islee23520/omo-memory",
package/dist/hooks.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { spawnSync } from "node:child_process";
1
2
  import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
3
  import { homedir } from "node:os";
3
4
  import { dirname, join } from "node:path";
@@ -40,12 +41,14 @@ function installCodex(home) {
40
41
  upsertMarketplace(marketplaceJsonPath, { withInterface: false });
41
42
  upsertMarketplace(agentsMarketplaceJsonPath, { withInterface: true });
42
43
  upsertCodexConfig(configPath, marketplacePath);
44
+ const pluginAddNote = maybeInstallCodexPlugin(home);
43
45
  return {
44
46
  host: "codex",
45
47
  files: [skillPath, agentsPath, pluginJsonPath, pluginSkillPath, hookJsonPath, hookScriptPath, marketplaceJsonPath, agentsMarketplaceJsonPath, configPath],
46
48
  notes: [
47
49
  "Codex MCP still needs `codex mcp add omo-memory -- npx -y omo-memory mcp` if it is not already present.",
48
50
  "Codex plugin hooks are installed through the local islee23520 marketplace and enabled in ~/.codex/config.toml.",
51
+ pluginAddNote,
49
52
  "Codex may ask to trust the new hook command on first execution unless hook trust has already been granted.",
50
53
  ],
51
54
  };
@@ -119,6 +122,19 @@ function upsertCodexConfig(path, marketplacePath) {
119
122
  const withMarketplace = ensureTomlTable(withHooks, `[marketplaces.${CODEX_MARKETPLACE}]`, `source_type = "local"\nsource = "${escapeTomlString(marketplacePath)}"`);
120
123
  writeText(path, ensureTomlTable(withMarketplace, `[plugins."${CODEX_PLUGIN}@${CODEX_MARKETPLACE}"]`, "enabled = true"));
121
124
  }
125
+ function maybeInstallCodexPlugin(home) {
126
+ if (home !== homedir())
127
+ return "Skipped `codex plugin add` because OMO_MEMORY_INSTALL_HOME points at a test/alternate home.";
128
+ const result = spawnSync("codex", ["plugin", "add", `${CODEX_PLUGIN}@${CODEX_MARKETPLACE}`, "--json"], {
129
+ encoding: "utf8",
130
+ stdio: ["ignore", "pipe", "pipe"],
131
+ timeout: 15000,
132
+ });
133
+ if (result.status === 0)
134
+ return "`codex plugin add omo-memory@islee23520 --json` completed successfully.";
135
+ const detail = result.error instanceof Error ? result.error.message : result.stderr.trim();
136
+ return `Could not run \`codex plugin add omo-memory@islee23520 --json\`: ${detail || "unknown error"}. Run it manually if Codex still reports the plugin as not installed.`;
137
+ }
122
138
  function ensureTomlKey(text, table, keyValue) {
123
139
  if (text.includes(keyValue))
124
140
  return text;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omo-memory",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
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": [