Skip to content

Commit 0e848eb

Browse files
hyperpolymathclaude
andcommitted
feat: add formatrix-bridges crate and missing AST module
- Create ast.rs with Document, Block, Inline, SourceFormat types - Scaffold formatrix-bridges crate with KnowledgeStore trait - Implement TriliumBridge (ETAPI REST client) - Implement FsBridge (filesystem: Obsidian, Logseq, Zettlr) - Add crate to workspace - Add .gitignore entries for Zig build artifacts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b27c4ee commit 0e848eb

9 files changed

Lines changed: 1389 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ __pycache__/
1717

1818
# Crash recovery artifacts
1919
ai-cli-crash-capture/
20+
zig-out/
21+
.zig-cache/

Cargo.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ members = [
1010
"crates/formatrix-gui",
1111
"crates/formatrix-db",
1212
"crates/formatrix-pipeline",
13+
"crates/formatrix-bridges",
1314
]
1415

1516
[workspace.package]
@@ -64,6 +65,21 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
6465
# Utilities
6566
unicode-segmentation = "1.11"
6667

68+
# HTTP client (for bridges)
69+
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
70+
71+
# Async trait (for KnowledgeStore)
72+
async-trait = "0.1"
73+
74+
# URL encoding
75+
urlencoding = "2.1"
76+
77+
# File watching
78+
notify = "7.0"
79+
80+
# Base64
81+
base64 = "0.22"
82+
6783
[profile.release]
6884
lto = true
6985
codegen-units = 1
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
[package]
3+
name = "formatrix-bridges"
4+
description = "Knowledge tool bridges for Formatrix — Trilium, Obsidian, Joplin, Logseq interop"
5+
version.workspace = true
6+
edition.workspace = true
7+
authors.workspace = true
8+
license.workspace = true
9+
repository.workspace = true
10+
11+
[dependencies]
12+
# Formatrix core for AST, parsers, renderers
13+
formatrix-core = { path = "../formatrix-core" }
14+
15+
# HTTP client for REST API bridges (Trilium ETAPI, Joplin Data API)
16+
reqwest.workspace = true
17+
18+
# Serialization
19+
serde.workspace = true
20+
serde_json.workspace = true
21+
22+
# Error handling
23+
thiserror.workspace = true
24+
anyhow.workspace = true
25+
26+
# Async runtime
27+
tokio.workspace = true
28+
29+
# Logging
30+
tracing.workspace = true
31+
32+
# Async trait
33+
async-trait.workspace = true
34+
35+
# URL encoding
36+
urlencoding.workspace = true
37+
38+
# File watching for filesystem-based bridges (Obsidian, Logseq)
39+
notify.workspace = true
40+
41+
# Base64 for Trilium ETAPI auth
42+
base64.workspace = true
43+
44+
[dev-dependencies]
45+
tokio-test = "0.4"
46+
mockito = "1.6"
47+
tempfile = "3.14"
48+
49+
[features]
50+
default = ["trilium", "filesystem"]
51+
trilium = []
52+
joplin = []
53+
filesystem = [] # Obsidian, Logseq, Zettlr (folder-of-files)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// SPDX-License-Identifier: PMPL-1.0-or-later
2+
//! Knowledge tool bridge implementations
3+
4+
#[cfg(feature = "trilium")]
5+
pub mod trilium;
6+
7+
#[cfg(feature = "trilium")]
8+
pub use trilium::TriliumBridge;

0 commit comments

Comments
 (0)