-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
162 lines (145 loc) · 6.96 KB
/
Copy pathCargo.toml
File metadata and controls
162 lines (145 loc) · 6.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
[package]
name = "attn"
version = "0.10.0"
edition = "2024"
description = "A beautiful markdown viewer that launches from the CLI"
license = "MIT"
repository = "https://github.com/lightsofapollo/attn"
homepage = "https://github.com/lightsofapollo/attn"
readme = "README.md"
include = [
"/Cargo.toml",
"/Cargo.lock",
"/build.rs",
"/README.md",
"/LICENSE",
"/src/**",
"/icons/attn.icns",
"/icons/attn.png",
"/web/**",
"!/web/dist/**",
"!/web/node_modules/**",
"!/web/src/lib/icons/vscode-generated/**",
"!/web/src/lib/vscode-icon-map.generated.ts",
"!/site/**",
]
[package.metadata.bundle]
name = "attn"
identifier = "dev.jameslal.attn"
icon = ["icons/attn.icns", "icons/attn.png"]
category = "DeveloperTool"
short_description = "A beautiful markdown viewer that launches from the CLI"
# Register the `attn://` URL scheme on macOS so the OS routes clicks on
# `attn://review/<roomId>#key=...` invite links into a running daemon
# (which boots if none is up). Without this, the invite URLs in the
# Share dialog cannot be one-click joined — the reviewer has to paste
# them into the CLI. cargo-bundle emits this as a CFBundleURLTypes
# entry in the `.app/Contents/Info.plist`.
osx_url_schemes = ["attn"]
[[bin]]
name = "attn"
path = "src/main.rs"
[dependencies]
flate2 = "1"
wry = "0.49"
tao = "0.32"
clap = { version = "4", features = ["derive"] }
notify = "7"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
open = "5"
anyhow = "1"
dirs = "6"
nix = { version = "0.29", features = ["process", "signal", "fs"] }
percent-encoding = "2.3.2"
image = { version = "0.25", default-features = false, features = ["png"] }
nucleo-matcher = "0.3.1"
# Markdown AST parser used by the canonical AnchorIndex builder
# (attn-nnj.3.1 — see planning/collab/data-model.md §Anchor Index). We disable
# the default `cli` + `syntect` features because we only need the parser; the
# webview rendering pipeline lives in TypeScript.
comrak = { version = "0.52", default-features = false }
# NFC/NFD normalization for the suggestion apply flow (attn-nnj.8.2). Already
# pulled in transitively via comrak → caseless; declaring it as a direct dep
# adds zero binary size and lets us call .nfc() / .nfd() on iterators of chars
# in `src/review/apply.rs`'s expected-text classifier.
unicode-normalization = "0.1"
# Crypto foundations (attn-nnj.1.1 — per planning/collab/crypto-spec.md §Rust crates
# and planning/collab/amendments.md §Codebase Corrections). No code uses these yet;
# wrappers land in attn-nnj.1.3-1.8.
sha2 = "0.10"
hkdf = "0.12"
hmac = "0.12"
chacha20poly1305 = "0.10"
ed25519-dalek = "2"
base64 = "0.22"
getrandom = "0.2"
zeroize = { version = "1", features = ["derive"] }
thiserror = "2"
# Structured, leveled, timestamped logging for the daemon (debugging relay /
# remote sync issues). `env-filter` enables RUST_LOG/ATTN_LOG directives
# (e.g. `attn=debug`); `time` gives wall-clock RFC3339 timestamps. Default
# level is INFO. Output goes to stderr, which the daemon redirects to attn.log.
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "time"] }
time = { version = "0.3", features = ["formatting", "macros"] }
# HTTP client for mailbox transport (attn-nnj.6.2). rustls-tls keeps the
# binary self-contained without dragging in OpenSSL; default-features=false
# strips the cookie/url-encoding-from-form bits we don't need. We do NOT
# enable the `json` feature because every call site serialises via
# `serde_json::to_vec(&body)` + `.body(bytes)` directly — see
# `src/review/bootstrap.rs` and `src/review/transport/mailbox/mod.rs`. Dropping
# this feature saves ~70 KiB of `serde_json`-via-reqwest glue from the binary
# (see planning/collab/binary-size-baseline.md §11.9 investigation).
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] }
# Async runtime — narrowest possible feature set for now. PoW token pool
# (attn-nnj.1.7) needs `sync` (Mutex) and `rt` (spawn_blocking). Phase 4
# (attn-nnj.6.x/7.x) will widen these as transports / outbox land.
# WebSocket client (attn-nnj.6.3) needs `net` (TCP) and `io-util` (split/AsyncReadExt).
# Bootstrap flow (attn-nnj.6.6) needs `rt-multi-thread` for the manager's blocking runtime.
tokio = { version = "1", features = ["sync", "rt", "rt-multi-thread", "macros", "time", "net", "io-util"] }
# WebSocket client used by the mailbox transport (attn-nnj.6.3). rustls-tls
# keeps the binary self-contained without OpenSSL; webpki-roots provides the
# Mozilla CA bundle baked into the binary so we don't depend on the OS trust
# store at runtime. default-features=false drops the connect helpers we don't
# need — the client builds its own Request to attach the admission subprotocol
# (per relay-spec.md §WebSocket Protocol).
tokio-tungstenite = { version = "0.24", default-features = false, features = ["rustls-tls-webpki-roots", "connect"] }
futures-util = { version = "0.3", default-features = false, features = ["std", "sink"] }
# Async-fn-in-trait shim for the Transport trait (attn-nnj.6.1). Stable
# Rust's native `async fn` in traits is gaining ground but still lacks
# trait-object support, which the daemon needs to swap Mailbox/WebRTC
# transports behind a `Box<dyn Transport>`. Drop once `dyn` support lands.
async-trait = "0.1"
# WebRTC transport (attn-nnj.7.x — per planning/collab/amendments.md §Decision #1).
# Pulls in the full webrtc-rs sub-crate set (data channels, dtls, sctp, ice,
# srtp, etc.) needed for a peer-to-peer DataChannel. This is the headline
# binary-size risk to the 25 MiB target — measurement captured in
# planning/collab/binary-size-baseline.md "After webrtc-rs". No code consumes
# this yet; the Rust transport implementation lands in attn-nnj.7.2+.
webrtc = "0.11"
[dev-dependencies]
tempfile = "3"
# Mock HTTP for outbox processor tests (attn-nnj.6.2). wiremock spins up an
# in-process server we can program with response stubs, then point reqwest at.
wiremock = "0.6"
[features]
devtools = ["wry/devtools"]
[target.'cfg(target_os = "linux")'.dependencies]
webkit2gtk = "2.0"
[target.'cfg(target_os = "macos")'.dependencies]
objc2 = "0.6"
objc2-app-kit = { version = "0.3", features = ["NSApplication", "NSWindow", "NSImage", "NSImageRep", "NSBitmapImageRep", "NSMenu", "NSMenuItem", "NSStatusBar", "NSStatusItem", "objc2-core-foundation"] }
objc2-foundation = "0.3"
objc2-web-kit = { version = "0.3", features = ["WKWebView", "WKSnapshotConfiguration", "block2"] }
objc2-user-notifications = { version = "=0.3.1", default-features = false, features = ["block2", "UNNotification", "UNNotificationContent", "UNNotificationRequest", "UNNotificationResponse", "UNNotificationTrigger", "UNUserNotificationCenter"] }
block2 = "0.6"
# Release profile tuned for the 40 MiB binary-size budget (scripts/
# check-binary-size.sh; webrtc-rs + tokio + rustls + comrak are the weight).
# panic = "unwind" is kept (the default): a panic in a background tokio task
# must not abort the whole desktop app.
[profile.release]
opt-level = "s"
lto = "fat"
codegen-units = 1
strip = true