Repository navigation
feat(workspace): make a saved Space shareable across machines - #1194
Closed
Rushikeshiitb wants to merge 1 commit into
Closed
Rushikeshiitb wants to merge 1 commit into
Rushikeshiitb wants to merge 1 commit into
Conversation
A materialised Space records the absolute project path of the machine it was
built on - in its projectPath and in every tab's workingDirectory / filePath /
url, and shell-quoted in initialCommand - so exported verbatim it points at a
directory that exists on no other machine.
- WorkspacePortability.toPortable rewrites the Space's own project path to the
{projectPath} placeholder (the same token PredefinedWorkspaces templates use),
clearing projectPath; fromPortable substitutes a chosen project path back in,
reusing WorkspacePlaceholders.substituteProjectPath so the substitution - raw
for path fields, shell-quoted for commands - is exactly the one the host uses
when materialising a template, making a round trip faithful. Import mints a
fresh id so a shared Space cannot collide with or overwrite a local one.
- WorkspacePortabilityMcpToolProvider exposes workspace_make_portable and
workspace_resolve_portable, both readOnly = true pure transforms over the
serialized Space JSON (no host state), so an agent can produce a shareable
Space or bind a shared one to a local project; saving/opening stays with the
existing create_workspace / open_workspace tools.
- Registered beside WorkspaceMcpToolProvider in McpToolRegistryImpl.
Covered by WorkspacePortabilityTest (round-trip to the same and to a new project
path, placeholder replacement, no-project passthrough, invalid JSON) and
WorkspacePortabilityMcpToolProviderTest (each tool through its handler).
Contributor
|
Thank you @Rushikeshiitb — this feature is legitimate and the implementation/tests passed focused validation. I reviewed it together with #1195 against current ; the only shared integration point was , and both registrations were retained.\n\nTo keep integration dev-targeted and preserve your authorship, I carried your original commit into consolidated PR #1506 (the commit remains separately authored by Rushikesh): https://github.com/risa-labs-inc/BossConsole/pull/1506\n\nI’m closing #1194 as superseded by #1506. No code credit is being dropped. |
Contributor
|
Superseded by consolidated dev-targeted PR #1506; contributor credit is preserved in the carried commit. |
15 of 16 tasks
Contributor
This was referenced Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Makes a saved Space shareable across machines. A materialised Space records the absolute project path of the machine it was built on - in
projectPathand in every tab'sworkingDirectory/filePath/url, and shell-quoted insideinitialCommand- so exported verbatim it points at a directory that exists on no one else's machine. This adds a project-relative form (using the same{projectPath}placeholderPredefinedWorkspacestemplates already use) and exposes the transform through the MCP registry.🔄 Type of Change
📦 Version Impact
x.+1.0✅ Testing Checklist
🧪 Local Testing
🖥️ Platform Testing
🏗️ Build Verification
:composeApp:compileKotlinDesktop,:composeApp:desktopTest)./gradlew :composeApp:ktlintCheck :composeApp:detektpass🔍 Code Quality
📝 Additional Context
🎯 Motivation and Context
exportWorkspace/importWorkspacealready round-trip a Space through JSON, but the JSON carries machine-specific absolute paths, so a Space shared with a teammate (or moved to another machine) opens tabs and terminals pointed at paths that do not exist. This adds the missing project-relative form so a Space can actually be shared, without changing the existing export/import behaviour.🧠 Implementation Details
WorkspacePortability.toPortablewalks the split tree and replaces the Space's own project path with{projectPath}inurl/filePath/workingDirectory(raw) and ininitialCommand(matching the shell-quoted form first, then the raw form - the exact inverse ofWorkspacePlaceholders.substituteProjectPathwithquote = true), and clearsprojectPath. A Space with no project path is already portable and is returned unchanged.WorkspacePortability.fromPortablesubstitutes a chosen project path back in through the very sameWorkspacePlaceholders.substituteProjectPaththe host uses when materialising a template - raw for path fields, shell-quoted for commands - so a round trip to the same path reproduces the original tabs. It mints a fresh id (LayoutWorkspace.generateId()) so importing a shared Space cannot collide with, or overwrite, a Space already on this machine.copy).WorkspacePortabilityMcpToolProviderexposesworkspace_make_portableandworkspace_resolve_portable, bothreadOnly = truepure transforms over the serialized Space JSON that touch no host state. Saving or opening the result stays with the existingcreate_workspace/open_workspacetools, so this is a transform surface rather than a second write path.WorkspaceMcpToolProviderinMcpToolRegistryImpl.None. The existing
exportWorkspace/importWorkspaceand theLayoutWorkspacetype are unchanged; this is a new, additive utility plus two read-only MCP tools.👀 Review Focus Areas
CommandProcessor.quotePath(POSIX/PowerShell), same as the template pathTest coverage
WorkspacePortabilityTest(6 tests): placeholder replacement +projectPathcleared, faithful round trip to the same path, binding to a new path with a fresh id, no-project passthrough (same instance), invalid-JSON returns null, serialize/deserialize round trip.WorkspacePortabilityMcpToolProviderTest(4 tests): both tools read-only, make-then-resolve across machines, invalid/missing input errors for each tool.