@imunitic/synapse 0.2.11 → 0.2.12
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/commands/synapse-vault-tidy.md +5 -5
- package/harness/claude/hooks.json +0 -9
- package/harness/codex/hooks.json +0 -9
- package/harness/codex/skills/synapse-vault-tidy/SKILL.md +5 -5
- package/harness/opencode/plugin/synapse.js +5 -24
- package/package.json +4 -4
- package/skills/synapse-vault/SKILL.md +4 -3
- package/synapse-claude.md +4 -2
|
@@ -101,11 +101,11 @@ findings for the Step 6 proposal instead of a silent edit:
|
|
|
101
101
|
|
|
102
102
|
- **Broken links** — every `vault-unresolved` row whose `source` is in scope. Before writing the
|
|
103
103
|
finding, check the vault's own local git history to say *why* it's broken instead of leaving that
|
|
104
|
-
to guesswork —
|
|
105
|
-
it
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
to guesswork — a `SYNAPSE_VAULT_STORE=git` vault has one, since every agent-driven edit commits
|
|
105
|
+
into it automatically. Resolve the vault's filesystem path the same way `synapse.conf` already does
|
|
106
|
+
(`SYNAPSE_VAULT_DIR`), skip this sub-step entirely if `{vault}/.git` doesn't exist, and never let a
|
|
107
|
+
missing/unreachable git repo block the rest of the finding — worst case it's reported with no
|
|
108
|
+
history context, same as today.
|
|
109
109
|
- `git -C {vault} log --all --diff-filter=A --name-only --pretty=format: -- "**/{target}.md"` — a
|
|
110
110
|
hit means a note by that exact title was created at some point (even if later renamed or
|
|
111
111
|
deleted): report it as *"used to be a note — find what it's called now, or was deleted"*.
|
package/harness/codex/hooks.json
CHANGED
|
@@ -101,11 +101,11 @@ findings for the Step 6 proposal instead of a silent edit:
|
|
|
101
101
|
|
|
102
102
|
- **Broken links** — every `vault-unresolved` row whose `source` is in scope. Before writing the
|
|
103
103
|
finding, check the vault's own local git history to say *why* it's broken instead of leaving that
|
|
104
|
-
to guesswork —
|
|
105
|
-
into it
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
to guesswork — a `SYNAPSE_VAULT_STORE=git` vault has one, since every agent-driven edit commits
|
|
105
|
+
into it automatically. Resolve the vault's filesystem path the same way its own conf file already
|
|
106
|
+
does (`SYNAPSE_VAULT_DIR`), skip this sub-step entirely if `{vault}/.git` doesn't exist, and never
|
|
107
|
+
let a missing/unreachable git repo block the rest of the finding — worst case it's reported with no
|
|
108
|
+
history context, same as today.
|
|
109
109
|
- `git -C {vault} log --all --diff-filter=A --name-only --pretty=format: -- "**/{target}.md"` — a
|
|
110
110
|
hit means a note by that exact title was created at some point (even if later renamed or
|
|
111
111
|
deleted): report it as *"used to be a note — find what it's called now, or was deleted"*.
|
|
@@ -18,18 +18,11 @@
|
|
|
18
18
|
// `tool.execute.after`'s real tool names/args, live-verified against a real
|
|
19
19
|
// edit: `write` (`args.filePath`, `args.content`) and `edit` (`args.filePath`,
|
|
20
20
|
// `args.oldString`, `args.newString`) -- both share `filePath`, matching
|
|
21
|
-
// Claude Code's `Write`/`Edit` sharing `tool_input.file_path`.
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
// `sst/opencode` source) when the command actually names `synapse
|
|
27
|
-
// vault-write`/`vault-patch` -- the CLI door skills use to reach the vault
|
|
28
|
-
// (see `sb — Vault store backend selection`). Unlike Claude Code's/Codex's
|
|
29
|
-
// `hooks.json`, which can only match a tool *name* and so must widen their
|
|
30
|
-
// own matcher to `Bash` and let `db_sync.zig` filter the command text itself,
|
|
31
|
-
// this plugin has the real args in hand before ever spawning the hook, so it
|
|
32
|
-
// filters right here instead -- no spawn at all for an unrelated `bash` call.
|
|
21
|
+
// Claude Code's `Write`/`Edit` sharing `tool_input.file_path`. Fired on
|
|
22
|
+
// write/edit tools for `staleness` -- the vault's own version control
|
|
23
|
+
// (`SYNAPSE_VAULT_STORE=git`) commits from inside `synapse`'s own CLI
|
|
24
|
+
// (`vault-write`/`vault-patch`) itself now, needing no `PostToolUse`-style
|
|
25
|
+
// hook here or on any other harness.
|
|
33
26
|
//
|
|
34
27
|
// `stop-nudge`'s Claude Code trigger (`Stop`, once per turn) maps to
|
|
35
28
|
// `session.idle` -- live-verified as firing exactly once, after every tool
|
|
@@ -108,15 +101,6 @@ async function alreadyInjected(client, sessionID) {
|
|
|
108
101
|
|
|
109
102
|
const EDIT_TOOLS = new Set(["write", "edit"])
|
|
110
103
|
|
|
111
|
-
// A `bash` call whose command names a `synapse vault-write`/`vault-patch`
|
|
112
|
-
// invocation -- the substring check a real shell quoting/path prefix can't
|
|
113
|
-
// evade in the cases that matter (`synapse vault-write ...`, `/path/to/synapse
|
|
114
|
-
// vault-patch ...`), matching `db_sync.zig`'s own `shouldSkipBash` filter for
|
|
115
|
-
// the harnesses that can't pre-filter on args the way this plugin can.
|
|
116
|
-
function isVaultWriteCommand(command) {
|
|
117
|
-
return typeof command === "string" && (command.includes("vault-write") || command.includes("vault-patch"))
|
|
118
|
-
}
|
|
119
|
-
|
|
120
104
|
// sessionID -> nudge text from a `stop-nudge` call that had nowhere to land
|
|
121
105
|
// yet -- delivered on that session's next `chat.message`.
|
|
122
106
|
const pendingNudge = new Map()
|
|
@@ -156,9 +140,6 @@ export const Synapse = async ({ directory, client }) => {
|
|
|
156
140
|
session_id: input.sessionID,
|
|
157
141
|
tool_input: { file_path: filePath },
|
|
158
142
|
})
|
|
159
|
-
runHook("db-sync", {});
|
|
160
|
-
} else if (input.tool === "bash" && isVaultWriteCommand(input.args?.command)) {
|
|
161
|
-
runHook("db-sync", {});
|
|
162
143
|
}
|
|
163
144
|
},
|
|
164
145
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imunitic/synapse",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "Memory for Claude Code, Codex CLI, and OpenCode: a durable Obsidian vault plus a per-repo code graph.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"*.conf.template"
|
|
23
23
|
],
|
|
24
24
|
"optionalDependencies": {
|
|
25
|
-
"@imunitic/synapse-darwin-arm64": "0.2.
|
|
26
|
-
"@imunitic/synapse-linux-x64": "0.2.
|
|
27
|
-
"@imunitic/synapse-linux-arm64": "0.2.
|
|
25
|
+
"@imunitic/synapse-darwin-arm64": "0.2.12",
|
|
26
|
+
"@imunitic/synapse-linux-x64": "0.2.12",
|
|
27
|
+
"@imunitic/synapse-linux-arm64": "0.2.12"
|
|
28
28
|
},
|
|
29
29
|
"license": "SEE LICENSE IN LICENSE"
|
|
30
30
|
}
|
|
@@ -90,9 +90,10 @@ verification that cannot fail in the direction you are worried about is not a ve
|
|
|
90
90
|
|
|
91
91
|
## If you do destroy something
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
`git show <sha>:<path>` away in the vault's own git history
|
|
95
|
-
|
|
93
|
+
On a `SYNAPSE_VAULT_STORE=git` vault, every edit commits automatically, so the intact version is one
|
|
94
|
+
`git show <sha>:<path>` away in the vault's own git history -- a vault-wide undo for destructive tool
|
|
95
|
+
calls, not merely a record of intentional edits. The default `disk` backend keeps no history at all,
|
|
96
|
+
so this safety net only exists once that backend is chosen.
|
|
96
97
|
|
|
97
98
|
## Tagging is part of writing a note, not a separate pass
|
|
98
99
|
|
package/synapse-claude.md
CHANGED
|
@@ -98,8 +98,10 @@ The vault is reached through the `synapse` CLI — `synapse vault-read`/`vault-w
|
|
|
98
98
|
`vault-search`/`vault-search-text`/`vault-doc-map`/`vault-patch`/`vault-backlinks`/`vault-links`/
|
|
99
99
|
`vault-unresolved`/`vault-orphans`/`vault-deadends`/`vault-ambiguous`/`vault-rename` — for reads
|
|
100
100
|
*and* for writes, never by resolving a vault path or calling an `mcp__obsidian__*` tool directly.
|
|
101
|
-
Which concrete store the CLI talks to (`SYNAPSE_VAULT_STORE=disk`, the default;
|
|
102
|
-
|
|
101
|
+
Which concrete store the CLI talks to (`SYNAPSE_VAULT_STORE=disk`, the default; `obsidian`, opted
|
|
102
|
+
into for a running Obsidian app's own live search relevance and graph data; or `git`, opted into for
|
|
103
|
+
the vault to own its own version control -- commit on every write, push/pull in the background) is
|
|
104
|
+
resolved once,
|
|
103
105
|
inside the compiled binary, from `SYNAPSE_VAULT_STORE`/`SYNAPSE_VAULT_DIR` — never something a skill
|
|
104
106
|
or an agent turn needs to know or branch on. By default that means no Obsidian dependency
|
|
105
107
|
whatsoever: `read`/`write`/`list`/`search`/the link graph/rename are all plain disk I/O and direct
|