-
Notifications
You must be signed in to change notification settings - Fork 207
[Dev environments] Support windsurf IDE #3444
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -619,10 +619,17 @@ def check_image_or_commands_present(cls, values): | |
|
|
||
| class DevEnvironmentConfigurationParams(CoreModel): | ||
| ide: Annotated[ | ||
| Union[Literal["vscode"], Literal["cursor"]], | ||
| Field(description="The IDE to run. Supported values include `vscode` and `cursor`"), | ||
| Union[Literal["vscode"], Literal["cursor"], Literal["windsurf"]], | ||
| Field( | ||
| description="The IDE to run. Supported values include `vscode`, `cursor`, and `windsurf`" | ||
| ), | ||
| ] | ||
| version: Annotated[Optional[str], Field(description="The version of the IDE")] = None | ||
| version: Annotated[ | ||
| Optional[str], | ||
| Field( | ||
| description="The version of the IDE. For `windsurf`, the version is in the format `version@commit`" | ||
| ), | ||
| ] = None | ||
| init: Annotated[CommandsList, Field(description="The shell commands to run on startup")] = [] | ||
| inactivity_duration: Annotated[ | ||
| Optional[Union[Literal["off"], int, bool, str]], | ||
|
|
@@ -649,6 +656,19 @@ def parse_inactivity_duration( | |
| return v | ||
| return None | ||
|
|
||
| @root_validator | ||
| def validate_windsurf_version_format(cls, values): | ||
| ide = values.get("ide") | ||
| version = values.get("version") | ||
| if ide == "windsurf" and version: | ||
| # Validate format: version@commit | ||
| if not re.match(r"^.+@[a-f0-9]+$", version): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regex allows multiple
|
||
| raise ValueError( | ||
| f"Invalid Windsurf version format: `{version}`. " | ||
| "Expected format: `version@commit` (e.g., `1.106.0@8951cd3ad688e789573d7f51750d67ae4a0bea7d`)" | ||
| ) | ||
| return values | ||
|
|
||
|
|
||
| class DevEnvironmentConfigurationConfig( | ||
| ProfileParamsConfig, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| from typing import List, Optional | ||
|
|
||
|
|
||
| class WindsurfDesktop: | ||
| def __init__( | ||
| self, | ||
| run_name: Optional[str], | ||
| version: Optional[str], | ||
| extensions: List[str], | ||
| ): | ||
| self.run_name = run_name | ||
| self.version = version | ||
| self.extensions = extensions | ||
|
|
||
| def get_install_commands(self) -> List[str]: | ||
| commands = [] | ||
| if self.version is not None: | ||
| version, commit = self.version.split("@") | ||
| url = f"https://windsurf-stable.codeiumdata.com/linux-reh-$arch/stable/{commit}/windsurf-reh-linux-$arch-{version}.tar.gz" | ||
| archive = "windsurf-reh-linux-$arch.tar.gz" | ||
| target = f'~/.windsurf-server/bin/"{commit}"' | ||
| commands.extend( | ||
| [ | ||
| 'if [ $(uname -m) = "aarch64" ]; then arch="arm64"; else arch="x64"; fi', | ||
| "mkdir -p /tmp", | ||
| f'wget -q --show-progress "{url}" -O "/tmp/{archive}"', | ||
| f"mkdir -vp {target}", | ||
| f'tar --no-same-owner -xz --strip-components=1 -C {target} -f "/tmp/{archive}"', | ||
| f'rm "/tmp/{archive}"', | ||
| ] | ||
| ) | ||
| if self.extensions: | ||
| extensions = " ".join(f'--install-extension "{name}"' for name in self.extensions) | ||
| commands.append(f'PATH="$PATH":{target}/bin windsurf-server {extensions}') | ||
| return commands | ||
|
|
||
| def get_print_readme_commands(self) -> List[str]: | ||
| return [ | ||
| "echo To open in Windsurf, use link below:", | ||
| "echo", | ||
| f'echo " windsurf://vscode-remote/ssh-remote+{self.run_name}$DSTACK_WORKING_DIR"', | ||
| "echo", | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't find it in the Command Palette. Am I doing something wrong?
Also can't find it in VSCode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windsurf Version: 1.13.5
Same in VSCode (Version: 1.106.3):