Skip to content

v1.5.0 — Runtime workspace management

Latest

Choose a tag to compare

@wuwangzhang1216 wuwangzhang1216 released this 11 Apr 04:13
· 7 commits to main since this release

Highlights

Agents (and humans) can now list, add, switch, and remove workspaces at runtime with no server restart. Switching between already-opened workspaces is sub-millisecond — the storage registry keeps each workspace's SQLite connection warm, so switching is just a pointer flip plus a settings patch under an asyncio.Lock.

opendb_list_workspaces()                              # see what's registered
opendb_use_workspace(id_or_root="a3f2b1c8")           # switch by id
opendb_use_workspace(id_or_root="D:/work/openDB")     # …or by path
opendb_add_workspace(root="./new_project", switch=true)
opendb_current_workspace()
opendb_remove_workspace(id_or_root="e18a9f03")

Added

  • Global workspace registry persisted at ~/.opendb/workspaces.json (overridable via FILEDB_STATE_DIR). Entries carry id, name, root, backend, created_at, last_used_at.
  • Five new REST endpoints under /workspaces:
    • GET /workspaces — list all registered workspaces (active first)
    • POST /workspaces — register (optionally switch) a new workspace
    • GET /workspaces/active — current active workspace
    • PUT /workspaces/active — switch by id or root path
    • DELETE /workspaces/{id} — unregister (files untouched; ?force=true to drop the active one)
  • Five new MCP tools: opendb_list_workspaces, opendb_current_workspace, opendb_use_workspace, opendb_add_workspace, opendb_remove_workspace.
  • opendb_info / GET /info responses now embed a workspace block with the active workspace's identity so agents can answer "which workspace am I in?" in a single call.
  • New CLI subcommand group: opendb workspace list | add | use | current | remove.
  • CHANGELOG.md (Keep a Changelog format) and .github/pull_request_template.md.

Changed

  • Factored Workspace.init() — the settings-patching block and parser registration became reusable helpers (apply_workspace_config, _ensure_parsers_registered) so the runtime switch path and the embedded-mode Workspace class apply workspace config identically.
  • opendb serve (SQLite mode) auto-registers the startup workspace in the global registry during lifespan setup.
  • README: new workspace management section, tool count updated 7 → 12, REST table + FILEDB_STATE_DIR config entry.

Tests

13 new workspace tests. 225 total, all passing (up from 212).

Upgrade notes

  • No breaking changes. Existing opendb serve -w <path> and opendb serve-mcp -w <path> invocations continue to work — the startup workspace is now also registered in the global registry so you can switch away from it at runtime.
  • The registry file lives at ~/.opendb/workspaces.json by default. Set FILEDB_STATE_DIR if you want it elsewhere (also useful for CI / isolated tests).

Full Changelog: v1.4.0...v1.5.0