Skip to content

Commit 281b506

Browse files
authored
Add Cline memory bank (#122)
* Initialize memory bank * Analyze repository and update memory bank * Fix diagram * Try fixing diagram again
1 parent 9fd73f7 commit 281b506

File tree

7 files changed

+495
-0
lines changed

7 files changed

+495
-0
lines changed

.clinerules/memory-bank.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Cline's Memory Bank
2+
3+
I am Cline, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.
4+
5+
## Memory Bank Structure
6+
7+
The Memory Bank consists of core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:
8+
9+
flowchart TD
10+
PB[projectbrief.md] --> PC[productContext.md]
11+
PB --> SP[systemPatterns.md]
12+
PB --> TC[techContext.md]
13+
14+
PC --> AC[activeContext.md]
15+
SP --> AC
16+
TC --> AC
17+
18+
AC --> P[progress.md]
19+
20+
### Core Files (Required)
21+
1. `projectbrief.md`
22+
- Foundation document that shapes all other files
23+
- Created at project start if it doesn't exist
24+
- Defines core requirements and goals
25+
- Source of truth for project scope
26+
27+
2. `productContext.md`
28+
- Why this project exists
29+
- Problems it solves
30+
- How it should work
31+
- User experience goals
32+
33+
3. `activeContext.md`
34+
- Current work focus
35+
- Recent changes
36+
- Next steps
37+
- Active decisions and considerations
38+
- Important patterns and preferences
39+
- Learnings and project insights
40+
41+
4. `systemPatterns.md`
42+
- System architecture
43+
- Key technical decisions
44+
- Design patterns in use
45+
- Component relationships
46+
- Critical implementation paths
47+
48+
5. `techContext.md`
49+
- Technologies used
50+
- Development setup
51+
- Technical constraints
52+
- Dependencies
53+
- Tool usage patterns
54+
55+
6. `progress.md`
56+
- What works
57+
- What's left to build
58+
- Current status
59+
- Known issues
60+
- Evolution of project decisions
61+
62+
### Additional Context
63+
Create additional files/folders within memory-bank/ when they help organize:
64+
- Complex feature documentation
65+
- Integration specifications
66+
- API documentation
67+
- Testing strategies
68+
- Deployment procedures
69+
70+
## Core Workflows
71+
72+
### Plan Mode
73+
flowchart TD
74+
Start[Start] --> ReadFiles[Read Memory Bank]
75+
ReadFiles --> CheckFiles{Files Complete?}
76+
77+
CheckFiles -->|No| Plan[Create Plan]
78+
Plan --> Document[Document in Chat]
79+
80+
CheckFiles -->|Yes| Verify[Verify Context]
81+
Verify --> Strategy[Develop Strategy]
82+
Strategy --> Present[Present Approach]
83+
84+
### Act Mode
85+
flowchart TD
86+
Start[Start] --> Context[Check Memory Bank]
87+
Context --> Update[Update Documentation]
88+
Update --> Execute[Execute Task]
89+
Execute --> Document[Document Changes]
90+
91+
## Documentation Updates
92+
93+
Memory Bank updates occur when:
94+
1. Discovering new project patterns
95+
2. After implementing significant changes
96+
3. When user requests with **update memory bank** (MUST review ALL files)
97+
4. When context needs clarification
98+
99+
flowchart TD
100+
Start[Update Process]
101+
102+
subgraph Process
103+
P1[Review ALL Files]
104+
P2[Document Current State]
105+
P3[Clarify Next Steps]
106+
P4[Document Insights & Patterns]
107+
108+
P1 --> P2 --> P3 --> P4
109+
end
110+
111+
Start --> Process
112+
113+
Note: When triggered by **update memory bank**, I MUST review every memory bank file, even if some don't require updates. Focus particularly on activeContext.md and progress.md as they track current state.
114+
115+
REMEMBER: After every memory reset, I begin completely fresh. The Memory Bank is my only link to previous work. It must be maintained with precision and clarity, as my effectiveness depends entirely on its accuracy.

memory-bank/activeContext.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Active Context
2+
3+
*This file tracks the current work focus, recent changes, next steps, active decisions, important patterns, and project insights.*
4+
5+
## Current Focus
6+
7+
- **Initial Repository Analysis:** Analyzing the existing codebase (`gitpod-vscode-desktop`) to understand its structure, functionality, and integration points.
8+
- **Memory Bank Population:** Updating the Cline Memory Bank files (`projectbrief.md`, `productContext.md`, `systemPatterns.md`, `techContext.md`, `activeContext.md`, `progress.md`) with the findings from the analysis.
9+
10+
## Recent Changes
11+
12+
- **Memory Bank Updates (In Progress):**
13+
- Updated `projectbrief.md` with core requirements, goals, and scope based on code analysis.
14+
- Updated `productContext.md` with problem statement, target audience, high-level workflow, and UX goals.
15+
- Updated `systemPatterns.md` with architecture overview, key decisions, design patterns, component relationships, and critical paths.
16+
- Updated `techContext.md` with technologies, setup, constraints, dependencies, and tool usage.
17+
18+
## Next Steps
19+
20+
- Update `progress.md` to reflect the current state of the project based on the analysis.
21+
- Complete the initial Memory Bank population task.
22+
- Await further instructions or tasks from the user.
23+
24+
## Active Decisions & Considerations
25+
26+
- **Connection Methods:** The extension supports two distinct SSH connection methods (Local Proxy via IPC/Supervisor API keys, and SSH Gateway via user keys/owner token). Understanding the trade-offs and configuration for each is important.
27+
- **External Dependencies:** The reliance on `ms-vscode-remote.remote-ssh` for the final connection step and the requirement for the companion `gitpod.gitpod-remote-ssh` extension remotely are key architectural points.
28+
- **SSH Configuration:** The local proxy method actively modifies the user's SSH configuration, which is a significant side effect.
29+
30+
## Important Patterns & Preferences
31+
32+
- **Service-Oriented Architecture:** Code is organized into distinct services for different concerns (Session, Host, Remote, Telemetry, etc.).
33+
- **Dual Connection Strategy:** Explicit implementation of two connection paths (Local Proxy, Gateway).
34+
- **IPC for Secure Data Transfer:** Using gRPC/ConnectRPC for IPC between the extension and the proxy script to handle sensitive data like temporary SSH keys.
35+
- **Leveraging VS Code APIs:** Strong preference for using built-in VS Code APIs (Authentication, Remote Development, UI) where possible.
36+
37+
## Learnings & Insights
38+
39+
- The extension acts primarily as a sophisticated orchestrator and configuration manager, setting up the parameters and environment for the `ms-vscode-remote.remote-ssh` extension to perform the actual connection.
40+
- The Local SSH Proxy method is complex, involving SSH config modification, helper scripts, IPC, and interaction with the Gitpod Supervisor API for temporary keys.
41+
- The extension does *not* manage the VS Code Server binary on the remote host.
42+
- Authentication relies on VS Code's built-in provider and Gitpod's Public/Supervisor APIs.

memory-bank/productContext.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Product Context
2+
3+
*This file describes why this project exists, the problems it solves, how it should work, and the user experience goals.*
4+
5+
## Problem Statement
6+
7+
- Gitpod Classic users need a way to connect their local VS Code Desktop application to their remote Gitpod workspaces.
8+
- Standard SSH connections might be blocked by firewalls or require complex setup (key management, host configuration).
9+
- Users need a streamlined way to authenticate with Gitpod and manage their workspace connections directly within VS Code.
10+
11+
## Target Audience
12+
13+
- Developers using Gitpod Classic who prefer using their local VS Code Desktop installation over the web-based IDE (Gitpod Theia or VS Code in Browser).
14+
- Users in environments where direct SSH access (port 22) might be restricted.
15+
16+
## How it Works
17+
18+
1. **Authentication:** The extension integrates with VS Code's Authentication API, allowing users to sign into their Gitpod account.
19+
2. **Workspace Discovery:** It uses the Gitpod Public API to fetch a list of the user's workspaces.
20+
3. **UI Integration:** Presents workspaces in a dedicated Activity Bar view and provides commands for actions like connecting, stopping, and deleting.
21+
4. **Connection Initiation:** When a user chooses to connect:
22+
* The extension determines the connection method (Local SSH Proxy or SSH Gateway).
23+
* **Local Proxy:** It ensures the local SSH client is configured with a `ProxyCommand` pointing to a helper script (`proxy.js`). This script communicates via IPC with the extension to get authentication details (including a temporary SSH key from the Supervisor API) and likely establishes a WebSocket tunnel.
24+
* **SSH Gateway:** It fetches necessary details (host keys, owner token) and checks for user-provided SSH keys registered with Gitpod. If no key exists, it prompts the user with the temporary owner token to use as a password.
25+
* It verifies host keys and adds them to `known_hosts`.
26+
5. **Hand-off to Remote-SSH:** The extension constructs a `vscode-remote://ssh-remote+...` URI and uses the `vscode.openFolder` command to delegate the actual SSH connection and remote session management to the built-in `ms-vscode-remote.remote-ssh` extension.
27+
6. **Remote Setup:** Ensures a companion extension (`gitpod.gitpod-remote-ssh`) is installed in the remote environment.
28+
29+
## User Experience Goals
30+
31+
- **Seamless Integration:** Feel like a natural part of VS Code's remote development workflow.
32+
- **Simplified Connection:** Abstract away the complexities of SSH configuration and authentication where possible.
33+
- **Reliability:** Provide robust connection methods that work in various network environments.
34+
- **Clear Feedback:** Inform the user about connection status, errors, and necessary actions (e.g., installing Remote-SSH, handling passwords).
35+
- **Convenient Management:** Allow users to manage their workspaces (view status, connect, stop) without leaving VS Code.

memory-bank/progress.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Progress
2+
3+
*This file tracks what works, what's left to build, the current status, known issues, and the evolution of project decisions.*
4+
5+
## What Works
6+
7+
Based on the code structure and implementation details observed:
8+
9+
- **Authentication:** Integration with VS Code's Authentication API for Gitpod login appears functional.
10+
- **Workspace Listing & Management:** Commands and UI elements for listing, refreshing, stopping, and deleting workspaces via the Gitpod Public API seem implemented.
11+
- **SSH Gateway Connection:** The logic for connecting via the SSH gateway (fetching host keys, checking user keys, falling back to owner token password) is present and appears to be the primary, stable connection method.
12+
- **Local SSH Proxy Connection (Experimental):** The infrastructure for the local proxy method (SSH config modification, helper scripts, IPC server, Supervisor API interaction for temp keys) is implemented, but likely marked as experimental or behind a feature flag.
13+
- **Integration with Remote-SSH:** Hand-off to `ms-vscode-remote.remote-ssh` via `vscode.openFolder` is implemented.
14+
- **UI:** Activity Bar view, commands, and status bar elements are defined in `package.json` and likely functional.
15+
- **Basic Configuration:** Handling of `gitpod.host` and other extension settings is implemented.
16+
- **Telemetry & Logging:** Basic infrastructure for telemetry (`@segment/analytics-node`) and logging (`vscode.LogOutputChannel`) is in place.
17+
- **Companion Extension Setup:** Logic exists to ensure `gitpod.gitpod-remote-ssh` is added to default remote extensions.
18+
19+
## What's Left to Build
20+
21+
- Based on this initial analysis, the core features seem implemented. Further work might involve:
22+
- Bug fixes and stability improvements.
23+
- Enhancements to existing features (e.g., more detailed workspace information, improved error handling).
24+
- Maturing the Local SSH Proxy connection method if it's still experimental.
25+
- Addressing any TODOs or planned features not evident from this high-level review.
26+
- Keeping dependencies (APIs, libraries, VS Code version) up-to-date.
27+
28+
## Current Status
29+
30+
- **Initial Analysis Complete:** The codebase has been analyzed at a high level to understand its structure and core functionality.
31+
- **Memory Bank Populated:** The core Memory Bank files have been updated with the findings of this analysis.
32+
- **Functionality:** The extension appears to be functional for its primary purpose: connecting VS Code Desktop to Gitpod Classic workspaces, primarily via the SSH Gateway method, with an experimental Local Proxy option.
33+
34+
## Known Issues
35+
36+
- No specific bugs were identified during this high-level analysis. Potential areas for issues could include:
37+
- Edge cases in SSH configuration parsing or modification (Local Proxy).
38+
- Network reliability issues affecting API calls or connections.
39+
- Compatibility problems with specific SSH client versions or configurations.
40+
- Errors during the IPC communication for the Local Proxy.
41+
- Issues related to the companion extension (`gitpod.gitpod-remote-ssh`).
42+
43+
## Evolution of Decisions
44+
45+
- **Introduction of Local SSH Proxy:** The addition of the complex Local SSH Proxy method alongside the more straightforward SSH Gateway method represents a significant evolution, likely aimed at improving connection reliability in restricted network environments and potentially enhancing security by using temporary, session-specific SSH keys obtained from the Supervisor API instead of relying solely on long-lived user keys or tokens passed as passwords.
46+
- **Dependency on `ms-vscode-remote.remote-ssh`:** The decision to leverage the existing Remote-SSH extension instead of building a custom remote file system and terminal backend was likely an early, foundational decision to reduce complexity and benefit from VS Code's mature remote infrastructure.
47+
- **Companion Remote Extension:** The requirement for `gitpod.gitpod-remote-ssh` suggests a shift towards handling some logic within the remote environment itself after the connection is established.

memory-bank/projectbrief.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Project Brief
2+
3+
*This file is the foundation document that shapes all other Memory Bank files. It defines the core requirements and goals of the project and serves as the source of truth for the project scope.*
4+
5+
## Core Requirements
6+
7+
- Provide VS Code integration for connecting to Gitpod Classic workspaces.
8+
- Manage authentication with the Gitpod service using VS Code's Authentication API.
9+
- Facilitate SSH connections to workspaces using either a local proxy mechanism or a direct SSH gateway.
10+
- Integrate seamlessly with VS Code's Remote Development features, specifically Remote - SSH (`ms-vscode-remote.remote-ssh`).
11+
- Provide UI elements (Activity Bar view, commands, status bar indicators) for managing Gitpod workspaces (listing, connecting, stopping, etc.).
12+
- Handle URI schemes for initiating connections.
13+
- Configure local SSH settings (`~/.ssh/config`) to support the local proxy connection method.
14+
- Ensure a companion extension (`gitpod.gitpod-remote-ssh`) is installed in the remote workspace.
15+
16+
## Project Goals
17+
18+
- **Primary Goal:** Enable VS Code Desktop users to connect to and work within Gitpod Classic workspaces reliably and efficiently.
19+
- **Connection Strategy:** Implement two primary SSH connection methods:
20+
1. **Local SSH Proxy (Preferred/Experimental):** Configure the local SSH client (`~/.ssh/config`) to use a proxy script (`proxy.js` via `proxylauncher.sh/bat`). This script communicates via IPC with the main extension (`ExtensionServiceServer`) to obtain authentication details (including a temporary SSH key generated via the Supervisor API) and likely establishes a WebSocket tunnel for the SSH connection.
21+
2. **SSH Gateway (Fallback):** Connect directly to Gitpod's SSH gateway using standard SSH keys registered in the user's Gitpod account (verified via API) or a temporary `ownerToken` obtained via API as a password if no suitable key is found.
22+
- **Integration:** Leverage VS Code's native Remote - SSH extension (`ms-vscode-remote.remote-ssh`) for the final connection step, providing it with the necessary configuration (SSH destination, host platform settings).
23+
- **Authentication:** Use VS Code's built-in Authentication API to manage Gitpod credentials securely.
24+
- **User Experience:** Provide clear feedback during connection attempts, handle errors gracefully, and offer relevant commands and views for workspace management.
25+
26+
## Scope
27+
28+
### In Scope
29+
30+
- Authentication with Gitpod (via VS Code Auth Provider).
31+
- Listing, starting, stopping, and deleting Gitpod Classic workspaces via API calls.
32+
- Implementing both Local SSH Proxy and SSH Gateway connection methods.
33+
- Configuring the user's local SSH client settings (`~/.ssh/config`) for the Local Proxy method.
34+
- Integrating with `ms-vscode-remote.remote-ssh` to initiate connections.
35+
- Providing UI elements (Activity Bar, Commands, Status Bar).
36+
- Handling `vscode://gitpod.gitpod-desktop/...` URIs.
37+
- Basic telemetry and logging.
38+
- Ensuring the `gitpod.gitpod-remote-ssh` companion extension is installed remotely.
39+
- Managing SSH host keys in `known_hosts`.
40+
41+
### Out of Scope
42+
43+
- Managing the VS Code Server binary installation/update within the Gitpod workspace (assumed handled by Gitpod infrastructure).
44+
- Direct integration with Gitpod Flex (extension detects and disables itself in Flex environments).
45+
- Features beyond connecting to and managing Classic workspaces (e.g., creating new workspaces from VS Code).
46+
- Deep file synchronization or complex remote environment management beyond SSH connection.

0 commit comments

Comments
 (0)