Changesets · Branches · Tags · Compare
| Changeset | 7605f2052544a474ccd7b75430d79d814859cd30758e22f080ba6c8e1c37eae0 |
|---|---|
| Author | Patrick Erichsen <patrick.a.erichsen@gmail.com> · 2025-06-25 11:19 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-06-25 11:19 -07:00 |
| Parents | 354acc983ff4, a7b738cad2c7 |
10 files changed
modified core/config/yaml/loadYaml.ts +2 −2
| @@ -39,7 +39,7 @@ | ||
| 39 | 39 | import { modifyAnyConfigWithSharedConfig } from "../sharedConfig"; |
| 40 | 40 | |
| 41 | 41 | import { getControlPlaneEnvSync } from "../../control-plane/env"; |
| 42 | -import { baseToolDefinitions } from "../../tools"; | |
| 42 | +import { getToolsForIde } from "../../tools"; | |
| 43 | 43 | import { getCleanUriPath } from "../../util/uri"; |
| 44 | 44 | import { getAllDotContinueDefinitionFiles } from "../loadLocalAssistants"; |
| 45 | 45 | import { LocalPlatformClient } from "./LocalPlatformClient"; |
| @@ -187,7 +187,7 @@ | ||
| 187 | 187 | |
| 188 | 188 | const continueConfig: ContinueConfig = { |
| 189 | 189 | slashCommands: [], |
| 190 | - tools: [...baseToolDefinitions], | |
| 190 | + tools: await getToolsForIde(ide), | |
| 191 | 191 | mcpServerStatuses: [], |
| 192 | 192 | contextProviders: [], |
| 193 | 193 | modelsByRole: { |
modified core/index.d.ts +2 −0
| @@ -731,6 +731,8 @@ | ||
| 731 | 731 | |
| 732 | 732 | isTelemetryEnabled(): Promise<boolean>; |
| 733 | 733 | |
| 734 | + isWorkspaceRemote(): Promise<boolean>; | |
| 735 | + | |
| 734 | 736 | getUniqueId(): Promise<string>; |
| 735 | 737 | |
| 736 | 738 | getTerminalContents(): Promise<string>; |
modified core/protocol/ide.ts +1 −0
| @@ -70,6 +70,7 @@ | ||
| 70 | 70 | ]; |
| 71 | 71 | getAvailableThreads: [undefined, Thread[]]; |
| 72 | 72 | isTelemetryEnabled: [undefined, boolean]; |
| 73 | + isWorkspaceRemote: [undefined, boolean]; | |
| 73 | 74 | getUniqueId: [undefined, string]; |
| 74 | 75 | getTags: [string, IndexTag[]]; |
| 75 | 76 | readSecrets: [{ keys: string[] }, Record<string, string>]; |
modified core/protocol/messenger/messageIde.ts +4 −0
| @@ -106,6 +106,10 @@ | ||
| 106 | 106 | return this.request("isTelemetryEnabled", undefined); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | + isWorkspaceRemote(): Promise<boolean> { | |
| 110 | + return this.request("isWorkspaceRemote", undefined); | |
| 111 | + } | |
| 112 | + | |
| 109 | 113 | getUniqueId(): Promise<string> { |
| 110 | 114 | return this.request("getUniqueId", undefined); |
| 111 | 115 | } |
modified core/tools/index.ts +9 −2
| @@ -1,4 +1,4 @@ | ||
| 1 | -import { ConfigDependentToolParams, Tool } from ".."; | |
| 1 | +import { ConfigDependentToolParams, IDE, Tool } from ".."; | |
| 2 | 2 | import { createNewFileTool } from "./definitions/createNewFile"; |
| 3 | 3 | import { createRuleBlock } from "./definitions/createRuleBlock"; |
| 4 | 4 | import { editFileTool } from "./definitions/editFile"; |
| @@ -13,12 +13,14 @@ | ||
| 13 | 13 | import { searchWebTool } from "./definitions/searchWeb"; |
| 14 | 14 | import { viewDiffTool } from "./definitions/viewDiff"; |
| 15 | 15 | |
| 16 | +// missing support for remote os calls: https://github.com/microsoft/vscode/issues/252269 | |
| 17 | +export const localOnlyToolDefinitions = [grepSearchTool]; | |
| 18 | + | |
| 16 | 19 | export const baseToolDefinitions = [ |
| 17 | 20 | readFileTool, |
| 18 | 21 | editFileTool, |
| 19 | 22 | createNewFileTool, |
| 20 | 23 | runTerminalCommandTool, |
| 21 | - grepSearchTool, | |
| 22 | 24 | globSearchTool, |
| 23 | 25 | searchWebTool, |
| 24 | 26 | viewDiffTool, |
| @@ -34,3 +36,8 @@ | ||
| 34 | 36 | export const getConfigDependentToolDefinitions = ( |
| 35 | 37 | params: ConfigDependentToolParams, |
| 36 | 38 | ): Tool[] => [requestRuleTool(params)]; |
| 39 | + | |
| 40 | +export const getToolsForIde = async (ide: IDE) => | |
| 41 | + (await ide.isWorkspaceRemote()) | |
| 42 | + ? baseToolDefinitions | |
| 43 | + : [...baseToolDefinitions, ...localOnlyToolDefinitions]; |
modified core/util/filesystem.ts +4 −0
| @@ -48,6 +48,10 @@ | ||
| 48 | 48 | return; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | + isWorkspaceRemote(): Promise<boolean> { | |
| 52 | + return Promise.resolve(false); | |
| 53 | + } | |
| 54 | + | |
| 51 | 55 | async getIdeSettings(): Promise<IdeSettings> { |
| 52 | 56 | return { |
| 53 | 57 | remoteConfigServerUrl: undefined, |
modified extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/IntelliJIde.kt +4 −0
| @@ -126,6 +126,10 @@ | ||
| 126 | 126 | return true |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | + override suspend fun isWorkspaceRemote(): Boolean { | |
| 130 | + return this.getIdeInfo().remoteName != "local" | |
| 131 | + } | |
| 132 | + | |
| 129 | 133 | override suspend fun getUniqueId(): String { |
| 130 | 134 | return getMachineUniqueID() |
| 131 | 135 | } |
modified extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/types.kt +2 −0
| @@ -102,6 +102,8 @@ | ||
| 102 | 102 | |
| 103 | 103 | suspend fun isTelemetryEnabled(): Boolean |
| 104 | 104 | |
| 105 | + suspend fun isWorkspaceRemote(): Boolean | |
| 106 | + | |
| 105 | 107 | suspend fun getUniqueId(): String |
| 106 | 108 | |
| 107 | 109 | suspend fun getTerminalContents(): String |
modified extensions/vscode/src/VsCodeIde.ts +4 −0
| @@ -200,6 +200,10 @@ | ||
| 200 | 200 | return globalEnabled && continueEnabled; |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | + isWorkspaceRemote(): Promise<boolean> { | |
| 204 | + return Promise.resolve(vscode.env.remoteName !== undefined); | |
| 205 | + } | |
| 206 | + | |
| 203 | 207 | getUniqueId(): Promise<string> { |
| 204 | 208 | return Promise.resolve(vscode.env.machineId); |
| 205 | 209 | } |
added scripts/create-docker-ssh-container.sh +35 −0
| @@ -0,0 +1,35 @@ | ||
| 1 | +# create the docker file | |
| 2 | + | |
| 3 | +cat > Dockerfile << 'EOF' | |
| 4 | +FROM ubuntu:latest | |
| 5 | +ENV DEBIAN_FRONTEND=noninteractive | |
| 6 | +# Install SSH server | |
| 7 | +RUN apt-get update && apt-get install -y openssh-server | |
| 8 | +# Configure SSH | |
| 9 | +RUN mkdir /var/run/sshd | |
| 10 | +RUN echo 'root:my_password' | chpasswd | |
| 11 | +# Allow root login | |
| 12 | +RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config | |
| 13 | +# SSH login fix | |
| 14 | +RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd | |
| 15 | +EXPOSE 22 | |
| 16 | +CMD ["/usr/sbin/sshd", "-D"] | |
| 17 | +EOF | |
| 18 | + | |
| 19 | +docker build -t continue-ubuntu-ssh . # build the image | |
| 20 | + | |
| 21 | +rm Dockerfile # remove the created Dockerfile | |
| 22 | + | |
| 23 | +container_name="continue-ssh-container" | |
| 24 | + | |
| 25 | +docker run -d -p 2222:22 --name $container_name continue-ubuntu-ssh # run the container | |
| 26 | + | |
| 27 | +echo "docker container ${container_name} running on port 2222" | |
| 28 | + | |
| 29 | +# add the instructions | |
| 30 | +bold=$(tput bold) | |
| 31 | +normal=$(tput sgr0) | |
| 32 | + | |
| 33 | +echo "\n--------------------------------------" | |
| 34 | +echo "now ssh into vscode (using remote explorer) with the following command: ${bold}ssh root@localhost -p 2222${normal}" | |
| 35 | +echo "use the following password - \"${bold}my_password${normal}\"" |