neotoma 0.4.2 → 0.4.5
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 +43 -0
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +332 -150
- package/dist/actions.js.map +1 -1
- package/dist/cli/commands/mirror.d.ts +52 -0
- package/dist/cli/commands/mirror.d.ts.map +1 -0
- package/dist/cli/commands/mirror.js +147 -0
- package/dist/cli/commands/mirror.js.map +1 -0
- package/dist/cli/config.d.ts +8 -0
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/doctor.d.ts +76 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +345 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/hooks.d.ts +45 -0
- package/dist/cli/hooks.d.ts.map +1 -0
- package/dist/cli/hooks.js +273 -0
- package/dist/cli/hooks.js.map +1 -0
- package/dist/cli/hooks_detect.d.ts +53 -0
- package/dist/cli/hooks_detect.d.ts.map +1 -0
- package/dist/cli/hooks_detect.js +220 -0
- package/dist/cli/hooks_detect.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +595 -49
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/permissions.d.ts +46 -0
- package/dist/cli/permissions.d.ts.map +1 -0
- package/dist/cli/permissions.js +191 -0
- package/dist/cli/permissions.js.map +1 -0
- package/dist/cli/setup.d.ts +46 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +105 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/core/operations.d.ts +145 -0
- package/dist/core/operations.d.ts.map +1 -0
- package/dist/core/operations.js +106 -0
- package/dist/core/operations.js.map +1 -0
- package/dist/openclaw_entry.d.ts +45 -0
- package/dist/openclaw_entry.d.ts.map +1 -0
- package/dist/openclaw_entry.js +75 -0
- package/dist/openclaw_entry.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +107 -748
- package/dist/server.js.map +1 -1
- package/dist/services/batch_correction.d.ts +129 -0
- package/dist/services/batch_correction.d.ts.map +1 -0
- package/dist/services/batch_correction.js +231 -0
- package/dist/services/batch_correction.js.map +1 -0
- package/dist/services/canonical_markdown.d.ts +145 -0
- package/dist/services/canonical_markdown.d.ts.map +1 -0
- package/dist/services/canonical_markdown.js +425 -0
- package/dist/services/canonical_markdown.js.map +1 -0
- package/dist/services/canonical_mirror.d.ts +127 -0
- package/dist/services/canonical_mirror.d.ts.map +1 -0
- package/dist/services/canonical_mirror.js +1047 -0
- package/dist/services/canonical_mirror.js.map +1 -0
- package/dist/services/canonical_mirror_git.d.ts +71 -0
- package/dist/services/canonical_mirror_git.d.ts.map +1 -0
- package/dist/services/canonical_mirror_git.js +211 -0
- package/dist/services/canonical_mirror_git.js.map +1 -0
- package/dist/services/entity_resolution.d.ts +17 -1
- package/dist/services/entity_resolution.d.ts.map +1 -1
- package/dist/services/entity_resolution.js +97 -24
- package/dist/services/entity_resolution.js.map +1 -1
- package/dist/services/entity_type_equivalence.d.ts +40 -0
- package/dist/services/entity_type_equivalence.d.ts.map +1 -0
- package/dist/services/entity_type_equivalence.js +109 -0
- package/dist/services/entity_type_equivalence.js.map +1 -0
- package/dist/services/entity_type_guard.d.ts +52 -0
- package/dist/services/entity_type_guard.d.ts.map +1 -0
- package/dist/services/entity_type_guard.js +204 -0
- package/dist/services/entity_type_guard.js.map +1 -0
- package/dist/services/file_text_extraction.d.ts.map +1 -1
- package/dist/services/file_text_extraction.js +5 -0
- package/dist/services/file_text_extraction.js.map +1 -1
- package/dist/services/flat_packed_detection.d.ts +32 -0
- package/dist/services/flat_packed_detection.d.ts.map +1 -0
- package/dist/services/flat_packed_detection.js +96 -0
- package/dist/services/flat_packed_detection.js.map +1 -0
- package/dist/services/interpretation.d.ts.map +1 -1
- package/dist/services/interpretation.js +9 -0
- package/dist/services/interpretation.js.map +1 -1
- package/dist/services/memory_export.d.ts +56 -0
- package/dist/services/memory_export.d.ts.map +1 -0
- package/dist/services/memory_export.js +295 -0
- package/dist/services/memory_export.js.map +1 -0
- package/dist/services/raw_fragments.js +1 -1
- package/dist/services/raw_fragments.js.map +1 -1
- package/dist/services/raw_storage.d.ts +6 -0
- package/dist/services/raw_storage.d.ts.map +1 -1
- package/dist/services/raw_storage.js +26 -0
- package/dist/services/raw_storage.js.map +1 -1
- package/dist/services/schema_definitions.d.ts.map +1 -1
- package/dist/services/schema_definitions.js +37 -0
- package/dist/services/schema_definitions.js.map +1 -1
- package/dist/services/schema_reference_linking.d.ts +38 -0
- package/dist/services/schema_reference_linking.d.ts.map +1 -0
- package/dist/services/schema_reference_linking.js +130 -0
- package/dist/services/schema_reference_linking.js.map +1 -0
- package/dist/services/schema_registry.d.ts +39 -0
- package/dist/services/schema_registry.d.ts.map +1 -1
- package/dist/services/schema_registry.js +91 -2
- package/dist/services/schema_registry.js.map +1 -1
- package/dist/services/snapshot_computation.d.ts.map +1 -1
- package/dist/services/snapshot_computation.js +10 -0
- package/dist/services/snapshot_computation.js.map +1 -1
- package/dist/services/timeline_events.d.ts +24 -5
- package/dist/services/timeline_events.d.ts.map +1 -1
- package/dist/services/timeline_events.js +89 -13
- package/dist/services/timeline_events.js.map +1 -1
- package/dist/shared/action_schemas.d.ts +18 -2
- package/dist/shared/action_schemas.d.ts.map +1 -1
- package/dist/shared/action_schemas.js +8 -0
- package/dist/shared/action_schemas.js.map +1 -1
- package/dist/shared/local_transport.d.ts +13 -0
- package/dist/shared/local_transport.d.ts.map +1 -1
- package/dist/shared/local_transport.js +89 -6
- package/dist/shared/local_transport.js.map +1 -1
- package/dist/tool_definitions.d.ts +22 -0
- package/dist/tool_definitions.d.ts.map +1 -0
- package/dist/tool_definitions.js +747 -0
- package/dist/tool_definitions.js.map +1 -0
- package/openapi.yaml +13 -0
- package/openclaw.plugin.json +87 -0
- package/package.json +31 -1
- package/skills/query-memory/SKILL.md +67 -0
- package/skills/recover-sqlite-database/SKILL.md +46 -0
- package/skills/store-data/SKILL.md +58 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `neotoma hooks` — install / uninstall / status for lifecycle hooks.
|
|
3
|
+
*
|
|
4
|
+
* This command intentionally does *not* ship as part of `neotoma setup`.
|
|
5
|
+
* Hooks are offered separately during activation (see install.md step 6.5)
|
|
6
|
+
* so the user sees Neotoma's MCP-driven value before we add a second write
|
|
7
|
+
* path into their tool configuration.
|
|
8
|
+
*
|
|
9
|
+
* The command itself is a thin wrapper that delegates to each package's own
|
|
10
|
+
* installer script:
|
|
11
|
+
* - cursor → packages/cursor-hooks/scripts/install.mjs
|
|
12
|
+
* - codex → packages/codex-hooks/scripts/install.mjs
|
|
13
|
+
* - claude-code / opencode / claude-agent-sdk → print a snippet and exit
|
|
14
|
+
*
|
|
15
|
+
* Guardrails (enforced before any write):
|
|
16
|
+
* - `data.initialized === false` → refuse; instruct user to `neotoma init`.
|
|
17
|
+
* - `hooks.installed[tool].other_hook_plugins.length > 0` → refuse unless
|
|
18
|
+
* `--force` is set; surface the detected plugin names.
|
|
19
|
+
* - Non-interactive prompt by default; `--yes` bypasses confirmation.
|
|
20
|
+
*/
|
|
21
|
+
import { existsSync } from "node:fs";
|
|
22
|
+
import path from "node:path";
|
|
23
|
+
import { spawnSync } from "node:child_process";
|
|
24
|
+
import { fileURLToPath } from "node:url";
|
|
25
|
+
import readline from "node:readline";
|
|
26
|
+
import { runDoctor } from "./doctor.js";
|
|
27
|
+
import { HOOK_HARNESSES } from "./hooks_detect.js";
|
|
28
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
29
|
+
const __dirname = path.dirname(__filename);
|
|
30
|
+
/** Locate the repo root containing `packages/<pkg>/scripts/install.mjs`.
|
|
31
|
+
*
|
|
32
|
+
* Covers three layouts:
|
|
33
|
+
* 1. Local checkout: dist/cli/hooks.js → ../.. → repo root
|
|
34
|
+
* 2. Global npm install: the neotoma package keeps `packages/` alongside
|
|
35
|
+
* `dist/`, so the same traversal works.
|
|
36
|
+
* 3. Development where the caller runs `tsx src/cli/hooks.ts` directly.
|
|
37
|
+
*
|
|
38
|
+
* Returns null when the repo root cannot be located.
|
|
39
|
+
*/
|
|
40
|
+
function locateRepoRoot() {
|
|
41
|
+
const candidates = [
|
|
42
|
+
path.resolve(__dirname, "..", ".."),
|
|
43
|
+
path.resolve(__dirname, "..", "..", ".."),
|
|
44
|
+
];
|
|
45
|
+
for (const candidate of candidates) {
|
|
46
|
+
if (existsSync(path.join(candidate, "packages")))
|
|
47
|
+
return candidate;
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
function packageInstallerPath(tool, repoRoot) {
|
|
52
|
+
const map = {
|
|
53
|
+
cursor: path.join(repoRoot, "packages", "cursor-hooks", "scripts", "install.mjs"),
|
|
54
|
+
codex: path.join(repoRoot, "packages", "codex-hooks", "scripts", "install.mjs"),
|
|
55
|
+
};
|
|
56
|
+
const candidate = map[tool];
|
|
57
|
+
if (!candidate)
|
|
58
|
+
return null;
|
|
59
|
+
return existsSync(candidate) ? candidate : null;
|
|
60
|
+
}
|
|
61
|
+
async function confirm(question) {
|
|
62
|
+
if (!process.stdin.isTTY)
|
|
63
|
+
return false;
|
|
64
|
+
return new Promise((resolve) => {
|
|
65
|
+
const rl = readline.createInterface({
|
|
66
|
+
input: process.stdin,
|
|
67
|
+
output: process.stdout,
|
|
68
|
+
});
|
|
69
|
+
rl.question(`${question} [y/N] `, (answer) => {
|
|
70
|
+
rl.close();
|
|
71
|
+
resolve(/^y(es)?$/i.test(answer.trim()));
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function printSnippetOnly(tool) {
|
|
76
|
+
if (tool === "claude-code") {
|
|
77
|
+
return [
|
|
78
|
+
"Claude Code plugin: install from the plugin marketplace or add to",
|
|
79
|
+
" .claude/plugins.json:",
|
|
80
|
+
' { "plugins": [{ "name": "neotoma", "source": "@neotoma/claude-code-plugin" }] }',
|
|
81
|
+
"See docs/integrations/hooks/claude_code.md.",
|
|
82
|
+
].join("\n");
|
|
83
|
+
}
|
|
84
|
+
if (tool === "opencode") {
|
|
85
|
+
return [
|
|
86
|
+
"OpenCode plugin: add to your OpenCode plugin config, e.g.:",
|
|
87
|
+
' import neotoma from "@neotoma/opencode-plugin";',
|
|
88
|
+
" export default { plugins: [neotoma()] };",
|
|
89
|
+
"See docs/integrations/hooks/opencode.md.",
|
|
90
|
+
].join("\n");
|
|
91
|
+
}
|
|
92
|
+
if (tool === "claude-agent-sdk") {
|
|
93
|
+
return [
|
|
94
|
+
"Claude Agent SDK: add hooks in your own code:",
|
|
95
|
+
' import { createNeotomaHooks } from "@neotoma/claude-agent-sdk-adapter";',
|
|
96
|
+
" const hooks = createNeotomaHooks();",
|
|
97
|
+
"See docs/integrations/hooks/claude_agent_sdk.md.",
|
|
98
|
+
].join("\n");
|
|
99
|
+
}
|
|
100
|
+
return "No installer available for this harness.";
|
|
101
|
+
}
|
|
102
|
+
function checkGuardrails(report, status, tool, force) {
|
|
103
|
+
if (!report.data.initialized) {
|
|
104
|
+
return "Neotoma has no initialized data directory. Run `neotoma init` before installing hooks.";
|
|
105
|
+
}
|
|
106
|
+
if (!force && status.other_hook_plugins.length > 0) {
|
|
107
|
+
return (`Detected other hook plugins in ${status.path ?? "the target config"}: ` +
|
|
108
|
+
status.other_hook_plugins.join(", ") +
|
|
109
|
+
". Re-run with --force after reviewing for compatibility.");
|
|
110
|
+
}
|
|
111
|
+
if (!HOOK_HARNESSES.includes(tool)) {
|
|
112
|
+
return `Unsupported tool: ${tool}`;
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
async function doInstall(opts, report) {
|
|
117
|
+
const status = report.hooks.installed[opts.tool];
|
|
118
|
+
const guardrail = checkGuardrails(report, status, opts.tool, Boolean(opts.force));
|
|
119
|
+
if (guardrail) {
|
|
120
|
+
return {
|
|
121
|
+
ok: false,
|
|
122
|
+
tool: opts.tool,
|
|
123
|
+
action: "install",
|
|
124
|
+
message: guardrail,
|
|
125
|
+
delegated_to: null,
|
|
126
|
+
status: report.hooks,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
if (status.present && !opts.force) {
|
|
130
|
+
return {
|
|
131
|
+
ok: true,
|
|
132
|
+
tool: opts.tool,
|
|
133
|
+
action: "install",
|
|
134
|
+
message: `Neotoma hooks already installed for ${opts.tool} at ${status.path ?? "<unknown>"}.`,
|
|
135
|
+
delegated_to: null,
|
|
136
|
+
status: report.hooks,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
const repoRoot = locateRepoRoot();
|
|
140
|
+
if (!repoRoot) {
|
|
141
|
+
return {
|
|
142
|
+
ok: false,
|
|
143
|
+
tool: opts.tool,
|
|
144
|
+
action: "install",
|
|
145
|
+
message: "Could not locate the Neotoma package root. This typically means the hook packages were not published with this install. Run from a local checkout, or run `npm install -g neotoma@latest` once the hook packages are published.",
|
|
146
|
+
delegated_to: null,
|
|
147
|
+
status: report.hooks,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
const installerPath = packageInstallerPath(opts.tool, repoRoot);
|
|
151
|
+
if (!installerPath) {
|
|
152
|
+
const snippet = printSnippetOnly(opts.tool);
|
|
153
|
+
return {
|
|
154
|
+
ok: true,
|
|
155
|
+
tool: opts.tool,
|
|
156
|
+
action: "install",
|
|
157
|
+
message: `No auto-installer for ${opts.tool}. Copy-paste the following:\n${snippet}`,
|
|
158
|
+
delegated_to: null,
|
|
159
|
+
status: report.hooks,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
if (!opts.yes) {
|
|
163
|
+
const ok = await confirm(`Install Neotoma hooks for ${opts.tool}? This will edit ${status.path ?? "the tool config"}.`);
|
|
164
|
+
if (!ok) {
|
|
165
|
+
return {
|
|
166
|
+
ok: false,
|
|
167
|
+
tool: opts.tool,
|
|
168
|
+
action: "install",
|
|
169
|
+
message: "Declined by user.",
|
|
170
|
+
delegated_to: null,
|
|
171
|
+
status: report.hooks,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (opts.dryRun) {
|
|
176
|
+
return {
|
|
177
|
+
ok: true,
|
|
178
|
+
tool: opts.tool,
|
|
179
|
+
action: "install",
|
|
180
|
+
message: `[dry-run] would run: node ${installerPath} install`,
|
|
181
|
+
delegated_to: installerPath,
|
|
182
|
+
status: report.hooks,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
const res = spawnSync("node", [installerPath, "install"], {
|
|
186
|
+
cwd: opts.cwd ?? process.cwd(),
|
|
187
|
+
stdio: "inherit",
|
|
188
|
+
});
|
|
189
|
+
const ok = res.status === 0;
|
|
190
|
+
return {
|
|
191
|
+
ok,
|
|
192
|
+
tool: opts.tool,
|
|
193
|
+
action: "install",
|
|
194
|
+
message: ok
|
|
195
|
+
? `Installed Neotoma hooks for ${opts.tool}.`
|
|
196
|
+
: `Installer exited with status ${res.status ?? "unknown"}.`,
|
|
197
|
+
delegated_to: installerPath,
|
|
198
|
+
status: report.hooks,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
async function doUninstall(opts, report) {
|
|
202
|
+
const status = report.hooks.installed[opts.tool];
|
|
203
|
+
if (!status.present) {
|
|
204
|
+
return {
|
|
205
|
+
ok: true,
|
|
206
|
+
tool: opts.tool,
|
|
207
|
+
action: "uninstall",
|
|
208
|
+
message: `No Neotoma hooks installed for ${opts.tool}.`,
|
|
209
|
+
delegated_to: null,
|
|
210
|
+
status: report.hooks,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
const repoRoot = locateRepoRoot();
|
|
214
|
+
if (!repoRoot) {
|
|
215
|
+
return {
|
|
216
|
+
ok: false,
|
|
217
|
+
tool: opts.tool,
|
|
218
|
+
action: "uninstall",
|
|
219
|
+
message: "Could not locate the Neotoma package root.",
|
|
220
|
+
delegated_to: null,
|
|
221
|
+
status: report.hooks,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
const installerPath = packageInstallerPath(opts.tool, repoRoot);
|
|
225
|
+
if (!installerPath) {
|
|
226
|
+
return {
|
|
227
|
+
ok: false,
|
|
228
|
+
tool: opts.tool,
|
|
229
|
+
action: "uninstall",
|
|
230
|
+
message: `No auto-uninstaller for ${opts.tool}. Remove the plugin manually.`,
|
|
231
|
+
delegated_to: null,
|
|
232
|
+
status: report.hooks,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
if (opts.dryRun) {
|
|
236
|
+
return {
|
|
237
|
+
ok: true,
|
|
238
|
+
tool: opts.tool,
|
|
239
|
+
action: "uninstall",
|
|
240
|
+
message: `[dry-run] would run: node ${installerPath} --uninstall`,
|
|
241
|
+
delegated_to: installerPath,
|
|
242
|
+
status: report.hooks,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
const res = spawnSync("node", [installerPath, "--uninstall"], {
|
|
246
|
+
cwd: opts.cwd ?? process.cwd(),
|
|
247
|
+
stdio: "inherit",
|
|
248
|
+
});
|
|
249
|
+
const ok = res.status === 0;
|
|
250
|
+
return {
|
|
251
|
+
ok,
|
|
252
|
+
tool: opts.tool,
|
|
253
|
+
action: "uninstall",
|
|
254
|
+
message: ok
|
|
255
|
+
? `Uninstalled Neotoma hooks for ${opts.tool}.`
|
|
256
|
+
: `Uninstaller exited with status ${res.status ?? "unknown"}.`,
|
|
257
|
+
delegated_to: installerPath,
|
|
258
|
+
status: report.hooks,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
export async function runHooksInstall(opts) {
|
|
262
|
+
const report = await runDoctor({ cwd: opts.cwd });
|
|
263
|
+
return doInstall(opts, report);
|
|
264
|
+
}
|
|
265
|
+
export async function runHooksUninstall(opts) {
|
|
266
|
+
const report = await runDoctor({ cwd: opts.cwd });
|
|
267
|
+
return doUninstall(opts, report);
|
|
268
|
+
}
|
|
269
|
+
export async function runHooksStatus(opts = {}) {
|
|
270
|
+
const report = await runDoctor({ cwd: opts.cwd });
|
|
271
|
+
return report.hooks;
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/cli/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,QAAQ,MAAM,eAAe,CAAC;AAErC,OAAO,EAAE,SAAS,EAAqB,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAqB3C;;;;;;;;;GASG;AACH,SAAS,cAAc;IACrB,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC;QACnC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;KAC1C,CAAC;IACF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;YAAE,OAAO,SAAS,CAAC;IACrE,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,oBAAoB,CAC3B,IAAmB,EACnB,QAAgB;IAEhB,MAAM,GAAG,GAA2C;QAClD,MAAM,EAAE,IAAI,CAAC,IAAI,CACf,QAAQ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
* Detection helpers for `neotoma doctor` and `neotoma hooks`.
|
|
3
|
+
*
|
|
4
|
+
* Returns a consolidated `HooksReport` describing, per hook-capable harness,
|
|
5
|
+
* whether Neotoma's lifecycle hooks are already installed and whether any
|
|
6
|
+
* non-Neotoma hook plugin is registered in the same file. This is the state
|
|
7
|
+
* the activation flow in install.md reads before offering `neotoma hooks
|
|
8
|
+
* install`.
|
|
9
|
+
*
|
|
10
|
+
* The module re-implements the small amount of "is this entry Neotoma's?"
|
|
11
|
+
* logic that the per-package installers already own, intentionally duplicated
|
|
12
|
+
* (rather than imported) so the CLI does not pay the cost of loading
|
|
13
|
+
* `@neotoma/client` and its transitive deps just to read a JSON/TOML file.
|
|
14
|
+
*/
|
|
15
|
+
/** Hook-capable harness identifiers. Broader than `ToolId` since it includes
|
|
16
|
+
* surfaces (opencode, claude-agent-sdk) that don't install the `neotoma`
|
|
17
|
+
* binary but can still consume the hook packages. */
|
|
18
|
+
export type HookHarnessId = "cursor" | "claude-code" | "codex" | "opencode" | "claude-agent-sdk";
|
|
19
|
+
export declare const HOOK_HARNESSES: readonly HookHarnessId[];
|
|
20
|
+
export interface HookStatus {
|
|
21
|
+
/** Neotoma hook entries are present in this harness's config. */
|
|
22
|
+
present: boolean;
|
|
23
|
+
/** Path to the config file consulted (absolute), or null if the harness
|
|
24
|
+
* does not have a filesystem-resident config (e.g. claude-agent-sdk). */
|
|
25
|
+
path: string | null;
|
|
26
|
+
/** Names of non-Neotoma hook plugins/entries detected alongside Neotoma
|
|
27
|
+
* entries. Empty array when no other plugins are present. */
|
|
28
|
+
other_hook_plugins: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface HooksReport {
|
|
31
|
+
/** True iff the current tool (via hint) supports hooks. */
|
|
32
|
+
supported_by_tool: boolean;
|
|
33
|
+
/** Per-harness installation state. */
|
|
34
|
+
installed: Record<HookHarnessId, HookStatus>;
|
|
35
|
+
/** Activation may offer hooks iff supported_by_tool and the current tool
|
|
36
|
+
* is not already installed and MCP is configured (caller enforces the MCP
|
|
37
|
+
* check since doctor computes that separately). */
|
|
38
|
+
eligible_for_offer: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface DetectHooksOptions {
|
|
41
|
+
cwd?: string;
|
|
42
|
+
/** The currently-detected harness (from doctor.current_tool_hint). When
|
|
43
|
+
* set, eligibility uses its installation status. */
|
|
44
|
+
currentTool?: HookHarnessId | null;
|
|
45
|
+
/** Whether MCP is already configured for the current tool. Activation
|
|
46
|
+
* requires this so hooks only layer on top of a working MCP setup. */
|
|
47
|
+
mcpConfigured?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** Collect per-harness installation state for activation / `neotoma hooks`. */
|
|
50
|
+
export declare function detectHooks(opts?: DetectHooksOptions): Promise<HooksReport>;
|
|
51
|
+
/** Narrow an arbitrary string to a `HookHarnessId` or `null`. */
|
|
52
|
+
export declare function toHookHarness(value: unknown): HookHarnessId | null;
|
|
53
|
+
//# sourceMappingURL=hooks_detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks_detect.d.ts","sourceRoot":"","sources":["../../src/cli/hooks_detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH;;qDAEqD;AACrD,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,aAAa,GACb,OAAO,GACP,UAAU,GACV,kBAAkB,CAAC;AAEvB,eAAO,MAAM,cAAc,EAAE,SAAS,aAAa,EAMlD,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,iEAAiE;IACjE,OAAO,EAAE,OAAO,CAAC;IACjB;6EACyE;IACzE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB;iEAC6D;IAC7D,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,2DAA2D;IAC3D,iBAAiB,EAAE,OAAO,CAAC;IAC3B,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAC7C;;uDAEmD;IACnD,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAkKD,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;wDACoD;IACpD,WAAW,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACnC;0EACsE;IACtE,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,+EAA+E;AAC/E,wBAAsB,WAAW,CAC/B,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC,WAAW,CAAC,CA2BtB;AAED,iEAAiE;AACjE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAKlE"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detection helpers for `neotoma doctor` and `neotoma hooks`.
|
|
3
|
+
*
|
|
4
|
+
* Returns a consolidated `HooksReport` describing, per hook-capable harness,
|
|
5
|
+
* whether Neotoma's lifecycle hooks are already installed and whether any
|
|
6
|
+
* non-Neotoma hook plugin is registered in the same file. This is the state
|
|
7
|
+
* the activation flow in install.md reads before offering `neotoma hooks
|
|
8
|
+
* install`.
|
|
9
|
+
*
|
|
10
|
+
* The module re-implements the small amount of "is this entry Neotoma's?"
|
|
11
|
+
* logic that the per-package installers already own, intentionally duplicated
|
|
12
|
+
* (rather than imported) so the CLI does not pay the cost of loading
|
|
13
|
+
* `@neotoma/client` and its transitive deps just to read a JSON/TOML file.
|
|
14
|
+
*/
|
|
15
|
+
import fs from "node:fs/promises";
|
|
16
|
+
import { existsSync } from "node:fs";
|
|
17
|
+
import os from "node:os";
|
|
18
|
+
import path from "node:path";
|
|
19
|
+
export const HOOK_HARNESSES = [
|
|
20
|
+
"cursor",
|
|
21
|
+
"claude-code",
|
|
22
|
+
"codex",
|
|
23
|
+
"opencode",
|
|
24
|
+
"claude-agent-sdk",
|
|
25
|
+
];
|
|
26
|
+
/** Neotoma's Cursor hook scripts, emitted by packages/cursor-hooks. */
|
|
27
|
+
const CURSOR_HOOK_SCRIPTS = [
|
|
28
|
+
"before_submit_prompt.js",
|
|
29
|
+
"after_tool_use.js",
|
|
30
|
+
"stop.js",
|
|
31
|
+
];
|
|
32
|
+
function isNeotomaCursorEntry(entry) {
|
|
33
|
+
if (!entry || typeof entry !== "object")
|
|
34
|
+
return false;
|
|
35
|
+
const args = entry.args;
|
|
36
|
+
if (!Array.isArray(args))
|
|
37
|
+
return false;
|
|
38
|
+
return args.some((a) => {
|
|
39
|
+
if (typeof a !== "string")
|
|
40
|
+
return false;
|
|
41
|
+
if (a.includes("@neotoma/cursor-hooks"))
|
|
42
|
+
return true;
|
|
43
|
+
if (!a.includes("cursor-hooks"))
|
|
44
|
+
return false;
|
|
45
|
+
return CURSOR_HOOK_SCRIPTS.some((name) => a.endsWith(name) || a.includes(`dist/${name}`));
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function entryLabel(entry) {
|
|
49
|
+
if (!entry || typeof entry !== "object")
|
|
50
|
+
return "unknown";
|
|
51
|
+
const obj = entry;
|
|
52
|
+
if (typeof obj.name === "string" && obj.name.trim())
|
|
53
|
+
return obj.name;
|
|
54
|
+
if (typeof obj.command === "string" && obj.command.trim())
|
|
55
|
+
return obj.command;
|
|
56
|
+
if (Array.isArray(obj.args) && obj.args.length > 0) {
|
|
57
|
+
const first = obj.args.find((a) => typeof a === "string" && a.trim());
|
|
58
|
+
if (typeof first === "string") {
|
|
59
|
+
const base = path.basename(first);
|
|
60
|
+
return base || first;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return "unknown";
|
|
64
|
+
}
|
|
65
|
+
async function readJson(filePath) {
|
|
66
|
+
try {
|
|
67
|
+
const raw = await fs.readFile(filePath, "utf8");
|
|
68
|
+
return JSON.parse(raw);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async function detectCursor(cwd) {
|
|
75
|
+
const file = path.join(cwd, ".cursor", "hooks.json");
|
|
76
|
+
const parsed = await readJson(file);
|
|
77
|
+
if (!parsed || !existsSync(file)) {
|
|
78
|
+
return { present: false, path: file, other_hook_plugins: [] };
|
|
79
|
+
}
|
|
80
|
+
let present = false;
|
|
81
|
+
const others = new Set();
|
|
82
|
+
const hooks = parsed.hooks ?? {};
|
|
83
|
+
for (const entries of Object.values(hooks)) {
|
|
84
|
+
if (!Array.isArray(entries))
|
|
85
|
+
continue;
|
|
86
|
+
for (const entry of entries) {
|
|
87
|
+
if (isNeotomaCursorEntry(entry)) {
|
|
88
|
+
present = true;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
others.add(entryLabel(entry));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return { present, path: file, other_hook_plugins: [...others] };
|
|
96
|
+
}
|
|
97
|
+
async function detectClaudeCode(cwd) {
|
|
98
|
+
// Claude Code plugins can live at project scope (.claude/plugins.json) or
|
|
99
|
+
// user scope (~/.claude/plugins.json). We check both; `present` is true iff
|
|
100
|
+
// either references the neotoma plugin id.
|
|
101
|
+
const candidates = [
|
|
102
|
+
path.join(cwd, ".claude", "plugins.json"),
|
|
103
|
+
path.join(os.homedir(), ".claude", "plugins.json"),
|
|
104
|
+
];
|
|
105
|
+
const others = new Set();
|
|
106
|
+
let present = false;
|
|
107
|
+
let pathUsed = null;
|
|
108
|
+
for (const candidate of candidates) {
|
|
109
|
+
if (!existsSync(candidate))
|
|
110
|
+
continue;
|
|
111
|
+
pathUsed = pathUsed ?? candidate;
|
|
112
|
+
const parsed = await readJson(candidate);
|
|
113
|
+
if (!parsed)
|
|
114
|
+
continue;
|
|
115
|
+
const list = [
|
|
116
|
+
...(parsed.plugins ?? []),
|
|
117
|
+
...(parsed.installed ?? []),
|
|
118
|
+
];
|
|
119
|
+
for (const plugin of list) {
|
|
120
|
+
const name = (plugin.name ?? plugin.id ?? "").toString();
|
|
121
|
+
if (!name)
|
|
122
|
+
continue;
|
|
123
|
+
if (name === "neotoma" || name.startsWith("neotoma/") || name.includes("neotoma-")) {
|
|
124
|
+
present = true;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
others.add(name);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return { present, path: pathUsed, other_hook_plugins: [...others] };
|
|
132
|
+
}
|
|
133
|
+
async function detectCodex() {
|
|
134
|
+
const file = path.join(os.homedir(), ".codex", "config.toml");
|
|
135
|
+
let raw;
|
|
136
|
+
try {
|
|
137
|
+
raw = await fs.readFile(file, "utf8");
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
return { present: false, path: file, other_hook_plugins: [] };
|
|
141
|
+
}
|
|
142
|
+
const present = raw.includes("# BEGIN neotoma-codex-hooks");
|
|
143
|
+
// Best-effort: identify non-Neotoma hook entries by looking for [notify] /
|
|
144
|
+
// [history] sections that do not fall inside the Neotoma-marked block.
|
|
145
|
+
const others = new Set();
|
|
146
|
+
const withoutBlock = raw.replace(/# BEGIN neotoma-codex-hooks[\s\S]*?# END neotoma-codex-hooks/, "");
|
|
147
|
+
const sectionRe = /^\s*\[(notify|history)\]/gm;
|
|
148
|
+
let match;
|
|
149
|
+
while ((match = sectionRe.exec(withoutBlock)) !== null) {
|
|
150
|
+
others.add(`[${match[1]}] (external)`);
|
|
151
|
+
}
|
|
152
|
+
return { present, path: file, other_hook_plugins: [...others] };
|
|
153
|
+
}
|
|
154
|
+
async function detectOpenCode() {
|
|
155
|
+
// OpenCode plugins are user-code imports, not a config file, so the best
|
|
156
|
+
// we can do is look for a plugin module with "neotoma" in its name under
|
|
157
|
+
// the standard plugin directories.
|
|
158
|
+
const candidates = [
|
|
159
|
+
path.join(os.homedir(), ".config", "opencode", "plugins"),
|
|
160
|
+
path.join(os.homedir(), ".opencode", "plugins"),
|
|
161
|
+
];
|
|
162
|
+
let present = false;
|
|
163
|
+
let pathUsed = null;
|
|
164
|
+
for (const dir of candidates) {
|
|
165
|
+
if (!existsSync(dir))
|
|
166
|
+
continue;
|
|
167
|
+
pathUsed = pathUsed ?? dir;
|
|
168
|
+
try {
|
|
169
|
+
const entries = await fs.readdir(dir);
|
|
170
|
+
if (entries.some((e) => /neotoma/i.test(e))) {
|
|
171
|
+
present = true;
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
// ignore
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return { present, path: pathUsed, other_hook_plugins: [] };
|
|
180
|
+
}
|
|
181
|
+
async function detectClaudeAgentSdk() {
|
|
182
|
+
// The SDK adapter is always a user-code import; there is no installable
|
|
183
|
+
// state file to inspect. We surface `present: false` and `path: null` so
|
|
184
|
+
// activation does not offer auto-install for this surface.
|
|
185
|
+
return { present: false, path: null, other_hook_plugins: [] };
|
|
186
|
+
}
|
|
187
|
+
/** Collect per-harness installation state for activation / `neotoma hooks`. */
|
|
188
|
+
export async function detectHooks(opts = {}) {
|
|
189
|
+
const cwd = opts.cwd ?? process.cwd();
|
|
190
|
+
const [cursor, claudeCode, codex, opencode, claudeAgentSdk] = await Promise.all([
|
|
191
|
+
detectCursor(cwd),
|
|
192
|
+
detectClaudeCode(cwd),
|
|
193
|
+
detectCodex(),
|
|
194
|
+
detectOpenCode(),
|
|
195
|
+
detectClaudeAgentSdk(),
|
|
196
|
+
]);
|
|
197
|
+
const installed = {
|
|
198
|
+
cursor,
|
|
199
|
+
"claude-code": claudeCode,
|
|
200
|
+
codex,
|
|
201
|
+
opencode,
|
|
202
|
+
"claude-agent-sdk": claudeAgentSdk,
|
|
203
|
+
};
|
|
204
|
+
const currentTool = opts.currentTool ?? null;
|
|
205
|
+
const supported_by_tool = Boolean(currentTool && HOOK_HARNESSES.includes(currentTool));
|
|
206
|
+
const currentInstalled = currentTool && installed[currentTool]
|
|
207
|
+
? installed[currentTool].present
|
|
208
|
+
: false;
|
|
209
|
+
const eligible_for_offer = supported_by_tool && !currentInstalled && Boolean(opts.mcpConfigured);
|
|
210
|
+
return { supported_by_tool, installed, eligible_for_offer };
|
|
211
|
+
}
|
|
212
|
+
/** Narrow an arbitrary string to a `HookHarnessId` or `null`. */
|
|
213
|
+
export function toHookHarness(value) {
|
|
214
|
+
if (typeof value !== "string")
|
|
215
|
+
return null;
|
|
216
|
+
return HOOK_HARNESSES.includes(value)
|
|
217
|
+
? value
|
|
218
|
+
: null;
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=hooks_detect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks_detect.js","sourceRoot":"","sources":["../../src/cli/hooks_detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAY7B,MAAM,CAAC,MAAM,cAAc,GAA6B;IACtD,QAAQ;IACR,aAAa;IACb,OAAO;IACP,UAAU;IACV,kBAAkB;CACnB,CAAC;AAwBF,uEAAuE;AACvE,MAAM,mBAAmB,GAAG;IAC1B,yBAAyB;IACzB,mBAAmB;IACnB,SAAS;CACV,CAAC;AAEF,SAAS,oBAAoB,CAAC,KAAc;IAC1C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,IAAI,GAAI,KAA4B,CAAC,IAAI,CAAC;IAChD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACvC,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QACrB,IAAI,OAAO,CAAC,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QACxC,IAAI,CAAC,CAAC,QAAQ,CAAC,uB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