Skip to main content

Crate subspace_core

Crate subspace_core 

Source
Expand description

Subspace core: the config file (REQ-20), credential sources (REQ-21 to REQ-24, REQ-31), the shared HTTP agent, the state file (REQ-08), the item search index and the palette’s command scoring. No GPUI and no service requests: the clients/* crates build on this.

Modules§

config
The config file (REQ-20): config.json in the platform config directory. The file is optional. Parsing never fails: an invalid value is reported as a Notice and replaced by its default. Tokens in a file that other users can read or write are ignored (REQ-23).
copilot_agent_tasks
Private subject-to-task references. Prompts and credentials are never stored.
credentials
Credential sources and precedence (REQ-21 to REQ-24, REQ-31, D-3).
diagnostics
Explicit diagnostics profiles. Local copy owns sanitized debugging context; issue reports default to registered identities and can opt into sanitized paths.
features
Registered feature policy shared by configuration, settings and runtimes.
file_id
The identity of an open file, independent of its path and timestamps.
http
The shared HTTP agent (REQ-31), the error type the clients return, and the retry after HTTP 401 (REQ-22).
keychain
The system credential store: the macOS Keychain, Windows Credential Manager or the Secret Service. Never a file fallback, and no error carries the provider’s details.
keyed_request
Identity checks for asynchronous results. This does not stop remote work; the owner keeps its tasks and decides when to discard an old result.
log
Structured logging for every app built from the Framework: a level, a target (a board id, http, app), a message and named fields. Records go to a rotating JSON Lines file under the state directory and to an in-memory ring buffer the log viewer reads. Every message and field value passes through redact first, so a token or an Authorization header never reaches a file.
mcp_token
MCP bearer tokens live outside config.json and never appear in diagnostics.
palette
Command palette logic: command matching, match highlighting and the recent items list.
path
Tool and PATH resolution for every Subspace app.
private_file
Owner-only file permissions shared by token and credential stores.
run_day_log
Bounded JSON Lines chunks for the most recent local dates with writes. The dated file is canonical; the stable live file mirrors its current chunk.
search
Item search over a dashboard’s loaded documents (BM25F). Fields are scored separately and weighted; the last query word matches as a prefix while typing; documents that match more query words rank higher; a numeric query matches document numbers by prefix. No network and no dependency on the UI.
settings
state
The state file (REQ-08): UI choices kept between runs. Keys are namespaced <dashboard>.<name>, such as board.layout. Values are strings; structured values are JSON text.
task_state
Pure cloud-agent task-state rules: which states keep a task alive, which end it, which transitions deserve an alert, and how often a watcher polls. No requests and no GPUI, so dashboards and background watchers share them.
vault
Where Subspace keeps its saved secrets. Release builds use the system keychain (Keychain). Debug builds use an owner-only JSON file beside the state file instead, unless USE_KEYCHAIN_ENV is set: a debug build is ad hoc signed, so each rebuild is a new app to the keychain, which asks for access again or, when the running build no longer matches its bundle on disk, refuses without asking. Capture and test builds never touch the real keychain either.

Structs§

Secret
A credential value. Debug and Display print ***, so a secret cannot reach a log, an error message or the UI by formatting. It has no Serialize, so it cannot reach the state file either.