qdk_chemistry.ui.workspace module
Bind a plugin MCP process to one explicit workspace.
- qdk_chemistry.ui.workspace.current_workspace_root()[source]
Return the immutable workspace binding for this MCP process.
- qdk_chemistry.ui.workspace.configure_workspace(path)[source]
Bind this process to one workspace for relative file resolution.
- Parameters:
path (
Path) – Absolute path to the workspace directory.- Return type:
- Returns:
A mapping that confirms the binding and gives the resolved workspace root.
- Raises:
OSError – If workspace storage directories cannot be created.
ValueError – If
pathis relative or does not identify a directory.RuntimeError – If this process is already bound to a different workspace.
- async qdk_chemistry.ui.workspace.bind_workspace(ctx, workspace_root=None)[source]
Bind this MCP process to the active workspace before other QDK tools.
- Parameters:
- Return type:
- Returns:
A mapping that reports whether binding succeeded. Successful results include the resolved workspace root and binding source; failed results include an error message.
- async qdk_chemistry.ui.workspace.workspace_binding_middleware(context, call_next)[source]
Require a workspace binding before plugin tools resolve relative paths.
- Parameters:
- Return type:
- Returns:
The downstream handler result.
- Raises:
RuntimeError – If binding is required but neither an existing binding nor a single client workspace root is available.