-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCargo.toml
More file actions
139 lines (129 loc) · 5.67 KB
/
Copy pathCargo.toml
File metadata and controls
139 lines (129 loc) · 5.67 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
[workspace]
members = [".", "api", "core", "adapters/tinycortex", "adapters/remote"]
default-members = [".", "api", "core", "adapters/tinycortex", "adapters/remote"]
# `vendor/` holds engine submodules (tinycortex, tinybus, tinyagents), each of
# which is its own workspace with its own lockfile. Same exclusion
# `vendor/tinycortex` uses for its own nested vendor directory.
#
# `crates/tinymemory-module` is excluded for a harder reason than tidiness, and
# it is worth writing down because the obvious arrangement does not work.
#
# That crate depends on `vendor/tinybus/crates/tinybus`, whose manifest inherits
# `edition`/`version` from `vendor/tinybus`'s own `[workspace.package]`. If the
# module is a member here, cargo resolves that inheritance against **this** root
# instead of the nested one and fails with `workspace.package.edition was not
# defined`. `exclude` does not prevent it: exclusion governs membership, not the
# root cargo picks when resolving a dependency's inherited fields. Verified by
# defining `[workspace.package]` here temporarily, which moved the error from
# `edition` to `version` rather than fixing it.
#
# So the module is its own workspace root with its own `Cargo.lock` — which is
# also what tinybus's module documentation prescribes ("integrations themselves
# remain separate repositories and are never workspace members") and what a
# separately released artifact wants anyway. Build it with
# `--manifest-path crates/tinymemory-module/Cargo.toml`.
exclude = ["vendor", "crates/tinymemory-module"]
[package]
name = "tinymemory"
# Not published: `tinymemory-core` depends on `tinycortex-api`, which is
# consumed by path and is not on crates.io, so `cargo package` cannot resolve
# the graph. Every consumer takes this repo by path or git.
publish = false
version = "1.0.1"
edition = "2021"
rust-version = "1.96"
license = "MIT"
description = "Engine-neutral memory contract, driver registry, and engine adapters"
repository = "https://github.com/tinyhumansai/tinymemory"
documentation = "https://docs.rs/tinymemory"
readme = "README.md"
keywords = ["memory", "agent", "llm", "retrieval"]
categories = ["database"]
# Keep the published package to what a consumer actually needs.
exclude = [
".github/",
".gitmodules",
"docs/",
"vendor/",
"worktrees/",
".env.example",
"deny.toml",
]
[dependencies]
# The contract itself. Re-exported wholesale from `src/lib.rs` so a host takes
# one dependency rather than two, and so `tinymemory::MemoryProvider` and
# `tinymemory_api::provider::MemoryProvider` are the same type.
tinymemory-api = { path = "api" }
# The mandatory capability families are `async fn`s on object-safe traits.
async-trait = "0.1"
# `Memory` is anyhow-typed; `mandatory::engine_error` maps it onto `MemoryError`.
anyhow = "1"
# Diagnostics on the shared store/recall/export paths.
log = "0.4"
# `ExportRecord::payload` is a `serde_json::Value`.
serde_json = "1"
# `DriverClass` is read out of a host's config file, so its serde form is the
# config form and is pinned by a test.
serde = { version = "1", features = ["derive"] }
[dev-dependencies]
# The mandatory-family tests are async.
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
[features]
default = []
# Lints apply to this package only, deliberately. `api/` is contract code moved
# verbatim from `tinycortex-api` and is held byte-identical; subjecting it to a
# stricter lint set than it was written under would force cosmetic edits through
# a surface whose serde representations and enum wire strings are persisted on
# disk. Adapter crates opt in individually.
[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"
# The engine adapters name their engines by version requirement, not by path,
# so a host that already pins its own engine checkout unifies onto one copy
# through its own patch table. These entries are what make a *standalone* build
# of this workspace resolve them to the nested `vendor/` submodules.
[patch.crates-io]
tinycortex = { path = "vendor/tinycortex" }
tinycortex-api = { path = "vendor/tinycortex/api" }
# `tinymemory-core`'s summariser and embedder factory name tinyagents' chat and
# embedding model traits. It is not published, so a standalone build of this
# workspace has to be told where it is — hence its own submodule alongside
# tinycortex and tinybus.
#
# Deliberately NOT `vendor/tinycortex/vendor/tinyagents`: the engine pins v2.1.0
# there, which predates `RECOMMENDED_OLLAMA_CONTEXT_TOKENS` that the embedder
# factory needs. Reaching through another submodule's pin also makes this
# crate's dependency an accident of the engine's, which is not a relationship
# worth having.
#
# A host that embeds this crate patches tinyagents itself — patch tables only
# apply from the workspace root being built — so this entry affects standalone
# builds and `cargo test` here, and nothing downstream.
tinyagents = { path = "vendor/tinyagents" }
[profile.release]
# Cross-crate optimization and smaller, faster binaries for release builds.
lto = "thin"
codegen-units = 1
strip = "debuginfo"