services-core Agent Guide
July 6, 2026 ยท View on GitHub
Scope: this guide applies to src/crates/services/services-core.
bitfun-services-core owns cross-platform service DTOs and helpers that compile
without the full product runtime. This includes generic filesystem/search/JSON
IO helpers, LSP package/protocol/watch/process primitives, session metadata
storage helpers, and local OS action primitives such as command lookup,
clipboard, file/url opening, script execution, workspace runtime FS/shell
providers, and system facts. Product crates may layer routing, policy,
capability selection, event emission, or legacy error mapping outside this
crate.
Guardrails
- Do not depend on
bitfun-core, app crates, Tauri, tool runtime, or product runtime crates. - Prefer
bitfun-core-typesfor shared DTOs andbitfun-runtime-portsfor cross-layer traits. - Keep dependency features explicit. Non-LSP consumers should use
default-features = false; LSP consumers must enable thelspfeature. - LSP manifest and protocol DTOs belong in
bitfun-core-types; reusable LSP package, protocol, detection, debounce, watch, and process-manager helpers belong inservices-core; product workspace state, event emission, global singletons, and file-sync orchestration stay outside this crate. - Runtime call sites that touch agent execution, scheduler state, workspace
managers, filesystem orchestration, or product behavior stay outside this
crate.
workspace-runtimemay implement localbitfun-runtime-portsproviders, but not workspace selection or product orchestration. - Do not add remote SSH, MiniApp storage, tool-result persistence,
PathManagerglobals, or product runtime bindings tofilesystem; keep those in core or a reviewed adapter/provider. - Preserve legacy core imports with facade/re-export code when ownership moves.
Verification
cargo test -p bitfun-services-core --features lsp
cargo test -p bitfun-services-core --features workspace-runtime workspace
node scripts/check-core-boundaries.mjs
cargo check -p bitfun-core --features product-full