@omgbase/sync 0.5.20 → 0.6.0
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 +5 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -39,14 +39,14 @@ What it does, in order: spawn `--server` (split on whitespace) as a stdio MCP se
|
|
|
39
39
|
|
|
40
40
|
All registered in `packages/core/src/mcp/server.ts`; every one takes an optional `repo` slug.
|
|
41
41
|
|
|
42
|
-
- **`observe_many({files:[{path,content}]})`** → one result per file: `{
|
|
43
|
-
- **`observe_delete({path})`** → `{
|
|
44
|
-
- **`changes_since({cursor?, origin?, limit?})`** → `{digests, cursor, truncated, head}`. The repo-wide commit feed after a commit `seq`; each digest is `{commit, seq, ts, origin, actor, summary, revisions:[{
|
|
45
|
-
- **`docs_read({
|
|
42
|
+
- **`observe_many({files:[{path,content}]})`** → one result per file: `{_id, _path, rev, commitId, converged, echo, conflicted, dispositions}` (surface 5.0 — "underscore = engine": a result key that carries a row attribute is spelled as the attribute; `{id, path, …}` through 4.11, `docId`/`path` before 3.0. The ARGUMENT keeps `path`: a file event's path is a role, not a row attribute). Bytes are committed as an **observed**-origin revision (a write *around* the engine, as a human edit is recorded) with block identity threaded by the reconciler. If `sha256(content)` already equals the doc's stored `file_hash`, it is an **echo**: `echo:true`, `rev:null`, no commit. Bytes containing git conflict markers are still ingested and flagged `conflicted:true`. The batch shares one timestamp and one resurrection-pool sweep. (`observe` is the single-file form; the coordinator uses the batch.)
|
|
43
|
+
- **`observe_delete({path})`** → `{_id, _path, deleted}`. Tombstones the live doc as an observed deletion (blocks pooled for resurrection, no file removed). Idempotent.
|
|
44
|
+
- **`changes_since({cursor?, origin?, limit?})`** → `{digests, cursor, truncated, head}`. The repo-wide commit feed after a commit `seq`; each digest is `{commit, seq, ts, origin, actor, summary, revisions:[{_id, _path, _hash}]}` (sync 3.0 / surface 5.0 — a revision is a row, so its keys are the row's engine names; `{id, path, hash}` in sync 2.0, `{doc, path, contentHash}` before; the digest's own keys — `commit`, `seq`, … — describe a commit, not a row, and stay bare) where `_hash` is the hex of that revision's rendered file hash — enough for a client to tell "changed vs echo" without a follow-up read. `head` is the repo's current max seq (cursor > head means the cursor came from another repo).
|
|
45
|
+
- **`docs_read({_path})`** → `{_id, _path, rev, properties, _raw, …}` — used by `readDoc()` in the export direction to get a doc's current byte-exact content (`_raw`). The argument is `_path` because it addresses the row's `_path` (5.0 has no tolerance: a bare `path` is `filter_invalid` with the corrected call in `data.fix`).
|
|
46
46
|
|
|
47
47
|
### Loop safety and echo suppression
|
|
48
48
|
|
|
49
|
-
A round-trip source → engine → source → engine terminates because the engine's echo gate makes ingest idempotent: re-observing bytes the engine already holds produces no commit. `syncOut()` adds a coarse filter on top — it **skips every `observed`-origin digest**, since those came from a source and there is nothing to push back — leaving only `api`/`import` (engine-authored) changes to write out. The `
|
|
49
|
+
A round-trip source → engine → source → engine terminates because the engine's echo gate makes ingest idempotent: re-observing bytes the engine already holds produces no commit. `syncOut()` adds a coarse filter on top — it **skips every `observed`-origin digest**, since those came from a source and there is nothing to push back — leaving only `api`/`import` (engine-authored) changes to write out. The `_hash` in the feed (and `contentHash` in `readDoc()`'s own `EngineClient` type) is carried for finer per-path suppression but the v1 coordinator does not yet compare it; the durable per-path hash store (`sync_state`) is the deferred piece below.
|
|
50
50
|
|
|
51
51
|
## The identity rule
|
|
52
52
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omgbase/sync",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Open Markdown Graph Base — standalone store-to-store synchronizer: a coordinator over an EngineClient seam (in-process or MCP-client) and source adapters",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
56
|
-
"@omgbase/core": "^0.
|
|
56
|
+
"@omgbase/core": "^0.28.0",
|
|
57
57
|
"@omgbase/fs-adapter": "^0.2.0"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|