Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
158 lines (146 loc) · 6.91 KB
/
Copy pathCargo.toml
File metadata and controls
158 lines (146 loc) · 6.91 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
[package]
name = "tinyhosts"
version = "0.3.0"
edition = "2024"
rust-version = "1.88"
license = "GPL-3.0-only"
description = "Unified hosting API for shipping Next.js applications, databases, domains and analytics to a real hosting provider."
repository = "https://github.com/tinyhumansai/tinyhosts"
documentation = "https://docs.rs/tinyhosts"
readme = "README.md"
keywords = ["hosting", "vercel", "nextjs", "deploy", "tinybus"]
categories = ["api-bindings", "web-programming"]
publish = false
# Keep the published package to what a consumer actually needs.
exclude = [
".github/",
".gitmodules",
"docs/",
"vendor/",
"worktrees/",
".env.example",
"deny.toml",
]
[lib]
# Keep the ordinary Rust library for tests and downstream reuse while also
# producing the native module artifact that TinyBus loads at runtime.
crate-type = ["rlib", "cdylib"]
[workspace]
members = ["crates/tinyhosts-bus"]
exclude = ["vendor/tinybus"]
[dependencies]
# Pure vocabulary shared with dynamically loaded module consumers.
tinyhosts-bus = { path = "crates/tinyhosts-bus", version = "0.3.0" }
# TinyBus defines the message types, interface macro, and frozen module ABI used
# by the generated integration. Socket and CLI features are unnecessary here.
tinybus = { path = "vendor/tinybus/crates/tinybus", version = "0.1.0", default-features = false, features = ["macros", "modules"], optional = true }
# The module-side SDK owns the isolated runtime and exports the ABI entrypoints
# required by TinyBus's dynamic loader.
tinybus-module = { path = "vendor/tinybus/crates/tinybus-module", version = "0.1.0", optional = true }
# Derive macros for the crate-wide error type in `src/error/mod.rs`.
thiserror = "2"
# `Host` is consumed as `dyn Host`, and every method performs network I/O, so
# the trait needs boxed async methods to stay object-safe on the MSRV.
async-trait = "0.1"
# The unified model crosses process boundaries twice: over TinyBus, and into the
# OpenCompany front end. Every public type in `host::types` is (de)serializable.
serde = { version = "1", features = ["derive"] }
# Request and response bodies for the provider REST APIs, and the JSON envelope
# the `rpc` module exchanges over the bus.
serde_json = "1"
# Directory preparation anchors traversal to an authorized directory descriptor.
# These safe capability APIs reject symlink following without platform-specific unsafe code.
cap-std = "4"
cap-fs-ext = "4"
# Bundle file contents travel as base64 in JSON: a byte array would triple the
# size of every deployment payload crossing the bus.
base64 = "0.23"
# Provider HTTP clients. rustls keeps the build free of a system OpenSSL, and
# `json` covers every request body except the raw file upload.
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"], optional = true }
# Vercel identifies uploaded deployment files by their SHA-1 digest
# (`x-vercel-digest`), so the digest algorithm is not a free choice.
sha1 = { version = "0.11", optional = true }
# Renders the SHA-1 digest as the lowercase hex string the upload header wants.
hex = { version = "0.4", optional = true }
# Percent-encodes an RPC-supplied identifier (site name, deployment id, domain)
# before it is interpolated into a Vercel API path, so `/`, `?` and `..` in one
# cannot redirect the request to a different route.
percent-encoding = { version = "2", optional = true }
# The agent tool vocabulary, for the optional `tools` feature (`tinyhosts::tools`).
# A git source rather than a path on purpose, the same arrangement as
# `tinymcp`'s `tools` feature: a host that already links tinytools through
# another checkout redirects this one with a `[patch]` entry so both resolve to
# one package and `tinytools::ToolResult` stays one type. Pinned to the revision
# tinyagents vendors, which is the copy OpenHuman links.
tinytools = { version = "0.5", git = "https://github.com/tinyhumansai/tinytools", rev = "bd60b9b52f1998b4483b9cf107a72d3338e672f8", optional = true }
# `tinytools::Tool::execute` returns `anyhow::Result`.
anyhow = { version = "1", optional = true }
# The launch and rollback tools log the one outward call each makes.
tracing = { version = "0.1", default-features = false, features = ["std"], optional = true }
# The two module-verification examples load a compiled `cdylib` through TinyBus's
# own loader, so they only build when the module is in the build.
[[example]]
name = "verify_module"
required-features = ["module"]
[[example]]
name = "verify_github_release"
required-features = ["module"]
[dev-dependencies]
# Module integration tests exercise the real asynchronous in-memory TinyBus.
tokio = { version = "1", features = ["macros", "rt-multi-thread", "time"] }
# Provider tests run against a local mock of the REST API rather than the live
# service, which keeps the suite deterministic and offline.
wiremock = "0.6"
# `Bundle::from_dir` is tested against a real directory tree.
tempfile = "3"
[features]
default = ["vercel", "module"]
# The Vercel provider and the HTTP stack it needs. Off, the crate is the
# provider-agnostic model alone: `Host`, its types, `Bundle`, and `launch`.
vercel = ["dep:reqwest", "dep:sha1", "dep:hex", "dep:percent-encoding"]
# The TinyBus module: the bus interface, the ABI exports, and the `cdylib` a
# TinyBus host loads. On by default, because the installable module is how this
# crate ships.
#
# A downstream that links the library directly — OpenHuman does — takes
# `default-features = false, features = ["vercel"]` and gets no TinyBus at all.
# That is not only a smaller graph: OpenHuman vendors its own TinyBus, and two
# path copies of one package cannot both be written to a lockfile.
module = ["dep:tinybus", "dep:tinybus-module"]
# The ten `hosting_*` agent tools as `tinytools::Tool`s over a `Host`
# (`tinyhosts::tools`). Off by default so the loadable module does not link the
# tool vocabulary; provider-independent, so it needs no `vercel`.
tools = ["dep:tinytools", "dep:anyhow", "dep:tracing"]
# Lints apply to the whole crate and to every target. CI runs clippy with
# `-D warnings`, so anything set to "warn" here fails the build in CI.
[lints.rust]
unsafe_code = "forbid"
missing_docs = "warn"
missing_debug_implementations = "warn"
unreachable_pub = "warn"
rust_2018_idioms = { level = "warn", priority = -1 }
[lints.clippy]
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
# Library code must not panic on its own; tests and examples may.
unwrap_used = "warn"
expect_used = "warn"
panic = "warn"
todo = "warn"
unimplemented = "warn"
# Public fallible/panicking APIs must document their failure modes.
missing_errors_doc = "warn"
missing_panics_doc = "warn"
# Documentation hygiene.
doc_markdown = "warn"
# `#[must_use]` on pure public functions.
must_use_candidate = "warn"
[lints.rustdoc]
broken_intra_doc_links = "warn"
private_intra_doc_links = "warn"
[profile.release]
# Cross-crate optimization and smaller, faster binaries for release builds.
lto = "thin"
codegen-units = 1
strip = "debuginfo"