Repository navigation
Give a room a shared working folder #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
78a3d67
Give rooms a working folder — a shared desk for every member turn
milind-soni 63af991
Merge remote-tracking branch 'gh/main' into feat/room-working-folder
milind-soni 55d85ee
Merge main and keep DM rooms folderless
milind-soni 413ca5f
Merge remote-tracking branch 'origin/main' into feat/room-working-folder
milind-soni d79931d
Merge remote-tracking branch 'origin/main' into feat/room-working-folder
milind-soni 63ba672
Keep room folder pinning host-only and immutable
milind-soni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { describe, expect, it } from "vitest"; | ||
|
|
||
| import { groupTurnCwd } from "./room-cwd.ts"; | ||
|
|
||
| describe("groupTurnCwd", () => { | ||
| it("the room's pinned folder overrides the member's own default", () => { | ||
| expect(groupTurnCwd("/tmp/room", "/workspaces/bot-a")).toBe("/tmp/room"); | ||
| }); | ||
|
|
||
| it("a room with no folder keeps each member's own default", () => { | ||
| expect(groupTurnCwd(null, "/workspaces/bot-a")).toBe("/workspaces/bot-a"); | ||
| }); | ||
|
|
||
| it("an off-host member (cloud box, API engine) gets no folder even when the room has one", () => { | ||
| expect(groupTurnCwd("/tmp/room", undefined)).toBeUndefined(); | ||
| expect(groupTurnCwd(null, undefined)).toBeUndefined(); | ||
| }); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // How a room member's turn picks its working folder. The room's pinned | ||
| // folder is a shared desk — it overrides the member's own default so every | ||
| // member works on the same files — except for a member whose engine runs | ||
| // with no host filesystem (Grok API, cloud box): its turn happens | ||
| // elsewhere, so handing it a host path would point it at a folder it | ||
| // cannot reach. Lives outside the dispatch path so the rule is testable | ||
| // without booting the server. | ||
|
|
||
| /** `memberDefault` is the folder the member would use on its own (its | ||
| * private workspace); undefined = the engine runs off-host. */ | ||
| export function groupTurnCwd(pinnedRoomCwd: string | null, memberDefault: string | undefined): string | undefined { | ||
| if (memberDefault === undefined) return undefined; | ||
| return pinnedRoomCwd ?? memberDefault; | ||
| } |
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.