6.7 KiB
Workspace Management
Consider The Architecture and the Socket Protocol.
Ignore details unrelated to the Chat Session view such as the Project Manager and Home views. We are focusing on getting a user's prompt from the IDE to gadget-drone, and into the Agentic Workflow Loop to be processed by a Large Language Model using configuration information from the work order such as the system prompt, user prompt, service provider/API specification, and which model id to request.
The Session Lock And Workspace Modes
The IDE first locks the selected drone to a project and chat session within it using requestSessionLock. At this point, the drone's workspace mode is set to: Idle. The drone has locked to the User's ChatSession within the Project, and has set it's workspace mode to Idle. The drone is now ready to begin doing work in the project directory within the workspace.
Workspace Modes
A drone's workspace can be in one of four modes:
- Idle - the workspace is available to enter any other mode
- Syncing - the workspace is performing a system operation
- User - the User is working within the workspace (locks out Agent)
- Agent - the Agent is working within the workspace (locks out User)
Workspace Mode Control
The User uses controls provided in the IDE (see below) to request workspace mode changes, and the drone either accepts or rejects them. The drone's current workspace mode controls the availability of features in the IDE, enabling and disabling them as needed to enforce the rules of the workspace mode.
Work can be done by either the User or the Agent. Work can't be done by both at the same time. Drone workspace modes are mutually exclusive.
The User will use controls in the IDE to request one of two different workspace modes at a time:
- User
- Agent
When the workspace is Idle, the User can request User or Agent mode to unlock that mode's associated features.
Usermode unlocks read/write in the File Editor, and allows the user to hand-edit files in the project, and change the project's state.Agentmode unlocks prompt input and the creation of work orders.
In User mode, the User may open files in read/write mode, make changes to file contents, save files back to the project, and otherwise change the project's state (run builds, perform git operations, etc.). We are NOT implementing those features or the Files panel at this time. We are only implementing mode management.
In Agent mode, the User can submit prompts to the Agent that become work orders submitted to the drone for processing in the project directory. The user can also open files to view them in read-only mode, but can't save them back to the project workspace on disk or change the project's state while the Agent is working. We are implementing the ability to submit a prompt. We are not implementing the Files panel or opening files in read-only mode. We're just focusing on workspace management, and submitting a prompt.
Chat Session View Changes
In the Chat Session view, we are adding flex-right justified interactive elements to the header area of the Session panel. There will be four square button indicators placed here:
- I - Idle
- S - Syncing
- U - User
- A - Agent
Workspace Mode Indicators
The indicator is a square with a thin dark gray border that contains the letter of that mode (I, S, U, A). When inactive, the letter matches the dark gray border. When active, the letter strobes green matching the status indicator's green and strobe behavior in the application status bar's online status indicator.
At a glance, the User sees which workspace mode is currently active by observing the strobing bright-green mode indicator.
As for styling, think of audio gear - like a modern mixing console - with indicators for mute, solo, etc. These should look and work exactly like those, and it would be great if they could appear "depressed" while active as if they were "pushed" into being active, and "pop up" when not active. This is their tactility. The User should feel like they are manipulating expensive studio equipment.
Changing Modes
When the workspace is Idle, the User can select/click the U or A mode indicator to request the drone to switch to that mode.
The system will send the requestWorkspaceMode message to the drone. If the drone can accomodate the request, it switches to the requested mode and acknowledges the switch. Or, it rejects the request with a reason.
If the drone accepts the mode switch request, the IDE updates as required by enabling the associated features and disabling the prohibited featured defined by the mode.
Mode switch requests can fail or be rejected. The response will explain why if so. That message should be displayed to the User as a toast so they understand why the drone can't satisfy the request and solve the problem.
IDE Workspace Mode Features
When the drone's workspace is in Agent mode:
- The Chat View enables the prompt input and the ability to submit prompts for processing by the Agentic Workflow Loop on the drone, and the drone will accept them for processing.
- The Files panel locks into read-only mode and updates to indicate this status in the header.
There should be no way at all to submit a prompt when the drone's workspace is NOT in Agent mode. The prompt input bar (text input, button, the whole panel) should be completely disabled and the placeholder for the text input should be, "Select Agent mode to enter a prompt." The User will have to select Agent mode to enable the controls and enter a prompt.
When the drone's workspace is in User mode:
- The chat input panel disables and changes the placeholder to read, "Select Agent mode to enter a prompt."
- The Files panel updates to indicate read-write mode
For now, this is effectively a dead mode and the User can't really do anything. We will be adding User-mode features later.
Files Panel
In the Chat Session view, in the right sidebar, below PROJECT, we are adding the FILES panel mockup. This is a placeholder for now.
We are adding two indicators to the FILES panel header: RW and RO.
The indicators are consistent with the workspace mode indicators added to the header of SESSION. And, when the Files panel is in read-only mode, the RO indicator becomes active. When the Files panel is in read-write mode, the RW indicator becomes active.
The User can then know at a glance whether their files are read-only, or whether they can open and edit a file.
We are not implementing file trees or displays. We are not adding the file editor. We are only adding the Files panel with a placeholder message in it's file tree display area (or mock content), and the header with the specified indicators that do react to workspace mode changes appropriately.