TSDR TRADING99 downloadsOne-way sync of this vault's markdown notes into your UCT Intelligence Notebook (Journal 2.0).
One-way sync of an Obsidian vault's markdown notes into your UCT Intelligence Notebook (Journal 2.0). The plugin only ever pushes — it never writes anything back into your vault.
crypto, which Obsidian's mobile runtime does not expose to
plugins (isDesktopOnly: true).Disconnecting from the dashboard revokes the device token immediately; the plugin's next sync will report that it is no longer connected, and you can reconnect with a fresh code at any time.
https://uctintelligence.com).POST /obsidian/redeem).final manifest so the
server can detect deletions..obsidian/) never resolves at
all. Per-file and per-member limits come from the server (25 MB per file
today). A run uploads for about a minute (or 100 MB) and then pushes the
note text; remaining files follow on later syncs, and the Notebook shows
them as "retrying" until they arrive. A file that cannot come over (too
large, missing from the vault, storage full) is shown as a notice in the
note and listed in Settings. An older UCT server without this feature is
detected automatically, and the plugin then behaves exactly as 0.1.x did..obsidian/, where this plugin's
own token lives) can be. With Sync images and files turned off, no
file contents are sent at all (see "Privacy" for what is still sent).isDesktopOnly: true in manifest.json). The plugin
hashes notes and files synchronously with Node's crypto module, which
Obsidian's mobile (Capacitor) runtime does not provide to plugins.vault_path (there is no stable per-note id this
plugin can read from the vault and forward). Renaming or moving a file
therefore looks, to the server, exactly like the old path disappearing
(garbage-collected out of data.files here, then delete-detected
server-side after a couple of missed passes) and a genuinely new path
appearing (pushed as a brand-new note). Content is never lost — the old
server-side copy survives until delete-detection catches up, and the new
path syncs immediately — but a member who has already started editing that
note inside the Notebook should expect the rename to surface as two
notes for a short window, not an in-place rename. Fixing this needs a
stable note id on the wire, which is a two-repo (plugin + server) change
and out of scope for this release.sync-manager.ts's auth-failure section for the
one exception — a 401 clears the token deliberately, rather than retrying
a dead credential). Nothing is lost: notes already durably staged by an
earlier batch in the same run are simply re-pushed next time (the server
no-ops an unchanged content_hash), and no manifest is ever sent for a
run that didn't finish pushing every batch — so a mid-run failure can
never mark a real note deleted. Recovery today is a member clicking "Sync
now" again. An automatic retry (with backoff) is the natural v1.1 on top
of this, deliberately deferred for the same reason as background sync:
keeping this first release small enough to review honestly.The server has a hard ceiling on how large a note's converted body may be
(obsidian_staging.MAX_BODY_MD_LEN, currently derived as roughly 212,765
characters of markdown — measured markdown→TipTap blowup is 3.4–4.7×, up to
~9× for a many-short-headings shape). A note over that ceiling will never
store, no matter how many times it's re-pushed.
This plugin therefore:
tooLarge.final manifest — the server's
own manifest-integrity check (obsidian_staging.py's I3 finding) treats
a manifest entry as a claim "this vault has staged body content for this
path," which is false for a note that was always rejected as too large.See src/sync-plan.ts's module docstring for the full reasoning and
src/test/sync-plan.test.ts / src/test/sync-manager.test.ts for the
tests that pin this behavior.
src/
types.ts Wire shapes + persisted-settings shape. No obsidian import.
hashing.ts sha256Hex() / sha256HexBytes() — note and file hashing.
batching.ts Splits changed notes into batches under the server's
note-count and byte-size ceilings; the 2 MB request check.
sync-plan.ts Pure decision logic: what to push, what to manifest,
too-large tracking, delete detection. No obsidian import.
server-url.ts Server URL validation and normalization.
api-client.ts Transport interface + ObsidianHttpTransport (the one
file that makes network requests, via requestUrl):
redeem, ingest, attachment check and upload.
attachment-refs.ts Which of a note's links are attachments (classifyRef),
MIME types, and the attachment-aware content hash.
attachment-sync.ts Phase 0 of a sync: build each note's refs, check which
files the server lacks, upload them within the budget.
sync-manager.ts Orchestrates attachments -> scan -> plan -> batch ->
push -> manifest -> persist, over the Transport and
VaultSource interfaces.
vault-source.ts ObsidianVaultSource — thin adapter over app.vault and
app.metadataCache (Obsidian's own link resolver).
settings.ts The settings tab UI.
main.ts Plugin entry point; wires everything above together.
styles.css The one class settings.ts needs (a themed error color)
— per Obsidian's guidelines, a CSS class instead of an
inline style. Everything else uses Obsidian's own
built-in Setting/`setting-item-description` styling.
test/
hashing.test.ts, batching.test.ts, sync-plan.test.ts Pure-function unit tests.
sync-manager.test.ts Stubbed-transport, stubbed-vault integration tests
covering batching, the two-phase push, tooLarge
exclusion/retry, delete detection, and 401 handling.
api-client.test.ts Exercises the real HTTP-shaping logic against a
stubbed requestUrl (obsidian-stub.ts).
attachment-refs.test.ts, attachment-sync.test.ts, vault-source.test.ts
Attachment classification, phase 0 against a fake
vault and a fake server, and the Obsidian adapter.
fixtures/server-parity/ Copies of the server's parity fixtures: the refs this
plugin builds must equal the refs the server expects.
sync-plan.ts, batching.ts and hashing.ts have zero dependency on
the obsidian module. sync-manager.ts and attachment-sync.ts depend only
on the Transport/VaultSource interfaces, plus parseLinktext through
attachment-refs.ts; the tests alias obsidian to src/test/obsidian-stub.ts,
so every decision the plugin makes is unit-testable in plain Node, with no
live vault and no live server.
This plugin is one half of a contract whose other half lives in the closed-source UCT Intelligence server. The server-side names below are recorded so a future change on either side is made deliberately aware of the other:
api/routers/note_sync.py — POST /obsidian/redeem,
POST /obsidian/ingest, ObsidianRedeemBody, ObsidianIngestBody.
OBSIDIAN_INGEST_NOTES_FIELD ("notes") is pinned — do not rename the
top-level notes-array key.api/services/journal_two/note_connectors/obsidian_staging.py —
ingest_batch's caps, the too-large isolation logic, and the manifest
integrity check (a final manifest may only name paths already staged
for this vault — either in the same call or an earlier one).api/services/journal_two/note_connectors/obsidian_link.py — connect-code
mint/redeem and device-token semantics (reconnecting the same
vaultId rotates the device token rather than refusing).api/routers/note_sync.py (0.2.0) — POST /obsidian/attachments/check
(protocol, missing, maxBytes, remainingBytes, maxRefsPerNote),
PUT /obsidian/attachments/{sha256}, the per-note attachments list on
ingest (ObsidianAttachmentRef), and the X-UCT-Plugin-Version header.
providers/obsidian.py turns each ref's original into the image, file chip
or notice. A 404/405 on the check route means "no attachment support".If the server-side contract changes, this plugin needs a matching update — there is no shared type-checking across the two repositories, so changes on either side must be made deliberately aware of the other.
npm install
npm run dev # esbuild watch mode -> main.js
npm run build # tsc typecheck + production esbuild bundle
npm test # vitest — all unit/integration tests, no live server
To try the plugin in a real vault during development, symlink (or copy)
this repository into <vault>/.obsidian/plugins/uct-notebook-sync/ after
running npm run build, then enable it in Obsidian's Community Plugins
settings (with Restricted Mode turned off for that vault).
Once connected, this plugin sends to the configured server, and only to the server the device token was issued by:
X-UCT-Plugin-Version header with this plugin's
version.Nothing is ever written back into the vault. The device token is stored in
this vault's plugin data (.obsidian/plugins/uct-notebook-sync/data.json);
if you sync your vault folder with another tool, that file travels with it.
Consent is captured on the dashboard side, before a connect code can even be minted. Members who connected under 0.1.x (note text only) see a one-time notice on the first sync that would send files, and that sync sends nothing about files at all (no file contents, no file lists: only note text, as 0.1.x did). File lists and uploads start on the next sync, unless file sync has been turned off in Settings by then.