@imunitic/synapse 0.0.1-test.0 → 0.1.0-experimental
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/bin/synapse-setup.cjs
CHANGED
|
@@ -356,7 +356,13 @@ function configureOpencode() {
|
|
|
356
356
|
const pluginDestDir = path.join(os.homedir(), ".config", "opencode", "plugin");
|
|
357
357
|
const pluginDest = path.join(pluginDestDir, "synapse.js");
|
|
358
358
|
fs.mkdirSync(pluginDestDir, { recursive: true });
|
|
359
|
-
|
|
359
|
+
// synapse.js as shipped is a template -- it has no way to compute its own
|
|
360
|
+
// binary's install path at import time (no CLAUDE_PLUGIN_ROOT-equivalent
|
|
361
|
+
// for OpenCode plugins), so this bakes the real resolved path in as a
|
|
362
|
+
// literal, the same absolute path resolveHookBin() already gave the
|
|
363
|
+
// Claude/Codex hooks.json rendering above.
|
|
364
|
+
const pluginSource = fs.readFileSync(pluginSrc, "utf8").replace('"__SYNAPSE_HOOK_BIN__"', JSON.stringify(hookBin));
|
|
365
|
+
fs.writeFileSync(pluginDest, pluginSource);
|
|
360
366
|
console.log(`installed ${pluginDest}`);
|
|
361
367
|
|
|
362
368
|
const skillCount = copySkills(path.join(os.homedir(), ".config", "opencode", "skill"), opencodeToolNameTransform);
|
|
@@ -36,23 +36,18 @@
|
|
|
36
36
|
//
|
|
37
37
|
// `synapse-hook`'s own binary path isn't resolved here the usual way --
|
|
38
38
|
// OpenCode plugins get no `${CLAUDE_PLUGIN_ROOT}`-equivalent "where am I
|
|
39
|
-
// installed" value, unlike Claude Code/Codex
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
39
|
+
// installed" value, unlike Claude Code/Codex, and an npm install's binary
|
|
40
|
+
// lives inside a per-platform optionalDependency package
|
|
41
|
+
// (node_modules/@imunitic/synapse-{platform}-{arch}/bin/), a path with no
|
|
42
|
+
// fixed location this file could hardcode or compute at import time.
|
|
43
|
+
// `synapse-setup configure opencode` resolves it once, at configure time,
|
|
44
|
+
// and rewrites the literal string below to the real absolute path -- this
|
|
45
|
+
// file as shipped in the npm package is a template, not the copy that
|
|
46
|
+
// actually runs. `SYNAPSE_HOOK_BIN` overrides it if ever needed.
|
|
45
47
|
|
|
46
48
|
import { spawnSync } from "child_process"
|
|
47
|
-
import { homedir } from "os"
|
|
48
|
-
import { join } from "path"
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
const cacheHome = process.env.XDG_CACHE_HOME || join(homedir(), ".cache")
|
|
52
|
-
return join(cacheHome, "synapse", "bin", "synapse-hook")
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const HOOK_BIN = process.env.SYNAPSE_HOOK_BIN || defaultHookBin()
|
|
50
|
+
const HOOK_BIN = process.env.SYNAPSE_HOOK_BIN || "__SYNAPSE_HOOK_BIN__"
|
|
56
51
|
const SESSION_START_MARKER = "[SYNAPSE-SESSION-START]"
|
|
57
52
|
|
|
58
53
|
function runHook(subcommand, payload) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imunitic/synapse",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.0-experimental",
|
|
4
4
|
"description": "Memory for Claude Code, Codex CLI, and OpenCode: a durable Obsidian vault plus a per-repo code graph.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/imunitic/synapse"
|
|
8
|
+
},
|
|
5
9
|
"bin": {
|
|
6
10
|
"synapse-setup": "bin/synapse-setup.cjs",
|
|
7
11
|
"synapse": "bin/synapse.cjs",
|
|
@@ -18,9 +22,9 @@
|
|
|
18
22
|
"*.conf.template"
|
|
19
23
|
],
|
|
20
24
|
"optionalDependencies": {
|
|
21
|
-
"@imunitic/synapse-darwin-arm64": "0.
|
|
22
|
-
"@imunitic/synapse-linux-x64": "0.
|
|
23
|
-
"@imunitic/synapse-linux-arm64": "0.
|
|
25
|
+
"@imunitic/synapse-darwin-arm64": "0.1.0-experimental",
|
|
26
|
+
"@imunitic/synapse-linux-x64": "0.1.0-experimental",
|
|
27
|
+
"@imunitic/synapse-linux-arm64": "0.1.0-experimental"
|
|
24
28
|
},
|
|
25
29
|
"license": "SEE LICENSE IN LICENSE"
|
|
26
30
|
}
|