Skip to content

Commit a0f3bec

Browse files
committed
Upgrade Theia (except arm/v7) to v1.56.0 including yarn.lock
Include new modules: @theia/ai-chat @theia/ai-chat-ui @theia/ai-code-completion @theia/ai-core @theia/ai-history @theia/ai-huggingface @theia/ai-llamafile @theia/ai-ollama @theia/ai-openai @theia/ai-terminal @theia/ai-workspace-agent @theia/plugin-ext-headless @theia/remote
1 parent 4b7017a commit a0f3bec

9 files changed

+9383
-2
lines changed

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ ENV BASH_ENV=/tmp/theia-bash-env
2626
# obtain wstunnel binaries from the Dockside Google Cloud Storage bucket. wstunnel is published
2727
# under https://github.com/erebe/wstunnel/blob/master/LICENSE.
2828
RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
29-
THEIA_VERSION=1.53.2; \
29+
THEIA_VERSION=1.56.0; \
3030
WSTUNNEL_BINARY="https://storage.googleapis.com/dockside/wstunnel/v6.0/wstunnel-v6.0-linux-x64"; \
3131
elif [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
32-
THEIA_VERSION=1.53.2; \
32+
THEIA_VERSION=1.56.0; \
3333
WSTUNNEL_BINARY="https://storage.googleapis.com/dockside/wstunnel/v6.0/wstunnel-v6.0-linux-arm64"; \
3434
elif [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \
3535
THEIA_VERSION=1.35.0; \

ide/theia/1.56.0/bin/dummysh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
3+
# Read the shell from /etc/passwd, using the root shell as a default.
4+
SHELL=$(getent passwd "${USER:-root}" | cut -d: -f7)
5+
6+
# Failover, in case SHELL is parsed incorrectly.
7+
[ -x "$SHELL" ] || SHELL="/bin/sh"
8+
9+
# Restore our original PATH from _PATH and delete _PATH
10+
[ -n "$_PATH" ] && PATH="$_PATH" && unset _PATH
11+
12+
# Delete other env vars set only to override default paths
13+
unset XDG_CACHE_HOME XDG_CONFIG_HOME npm_config_cache THEIA_WEBVIEW_EXTERNAL_ENDPOINT THEIA_MINI_BROWSER_HOST_PATTERN VSCODE_NLS_CONFIG
14+
15+
# Make shell env clean
16+
unset SHLVL OLDPWD
17+
18+
[ -n "$_HOME" ] && HOME="$_HOME" && unset _HOME
19+
20+
cd "$HOME"
21+
22+
exec $SHELL -l "$@"

ide/theia/1.56.0/bin/launch-ide.sh

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/opt/dockside/theia/bin/sh -l
2+
3+
# Expects:
4+
# - IDE_PATH
5+
#
6+
7+
log() {
8+
local PID="$$"
9+
local S=$(printf "%s|%15s|%5d|" "$(date +%Y-%m-%d.%H:%M:%S)" "theia" "$PID")
10+
echo "$S$1" >&2
11+
}
12+
13+
which() {
14+
local cmd="$1"
15+
for p in $(echo $PATH | tr ':' '\012'); do [ -x "$p/$cmd" ] && echo "$p/$cmd" && break; done
16+
}
17+
18+
LOG=/tmp/dockside/theia.log
19+
20+
log "Creating logfile '$LOG' ..."
21+
touch $LOG && chmod 666 $LOG
22+
23+
exec 1>>$LOG
24+
exec 2>>$LOG
25+
26+
log "Evaling arguments $@ ..."
27+
eval "$@"
28+
29+
log "Launching IDE from IDE_PATH='$IDE_PATH' ..."
30+
31+
log "Backing up and overriding PATH=$PATH ..."
32+
export _PATH="$PATH"
33+
export PATH="$IDE_PATH/bin:$PATH"
34+
35+
# Run ssh-agent if available, but not already running.
36+
log "Checking for ssh-agent ..."
37+
if [ -x $(which ssh-agent) ] && ! pgrep ssh-agent >/dev/null; then
38+
log "Found ssh-agent binary but no running agent, so launching it ..."
39+
eval $($(which ssh-agent))
40+
fi
41+
42+
# See https://github.com/eclipse-theia/theia/blob/master/CHANGELOG.md under v0.13.0
43+
#
44+
# Webview origin pattern can be configured with THEIA_WEBVIEW_EXTERNAL_ENDPOINT env variable.
45+
# The default value is {{uuid}}.webview.{{hostname}}.
46+
# Here {{uuid}} and {{hostname}} are placeholders which get replaced at runtime with proper webview uuid and hostname correspondingly.
47+
#
48+
# To switch to un-secure mode as before configure THEIA_WEBVIEW_EXTERNAL_ENDPOINT with {{hostname}} as a value.
49+
# You can also drop {{uuid}}. prefix, in this case, webviews still will be able to access each other but not the main window.
50+
#export THEIA_WEBVIEW_EXTERNAL_ENDPOINT='{{uuid}}-webview-{{hostname}}'
51+
#export THEIA_MINI_BROWSER_HOST_PATTERN='{{uuid}}-minibrowser-{{hostname}}'
52+
export THEIA_WEBVIEW_EXTERNAL_ENDPOINT='{{uuid}}-wv-{{hostname}}'
53+
export THEIA_MINI_BROWSER_HOST_PATTERN='{{uuid}}-mb-{{hostname}}'
54+
export SHELL="$IDE_PATH/bin/dummysh"
55+
56+
THEIA_PATH=$IDE_PATH
57+
log "Launching IDE using: $THEIA_PATH/bin/node $THEIA_PATH/theia/src-gen/backend/main.js $HOME --hostname 0.0.0.0 --port 3131 ..."
58+
59+
unset IDE_PATH
60+
cd $THEIA_PATH/theia || exit 1
61+
62+
log "Listing launch environment variables ..."
63+
env | sed -r 's/^/ /' >&2
64+
65+
exec $THEIA_PATH/bin/node $THEIA_PATH/theia/src-gen/backend/main.js $HOME --hostname 0.0.0.0 --port 3131 --plugins=local-dir:$HOME/theia-plugins

ide/theia/1.56.0/build/package.json

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
"private": true,
3+
"name": "@theia/Dockside",
4+
"version": "1.56.0",
5+
"license": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0",
6+
"theia": {
7+
"frontend": {
8+
"config": {
9+
"applicationName": "Theia for Dockside from NewsNow Labs",
10+
"warnOnPotentiallyInsecureHostPattern": false,
11+
"preferences": {
12+
"files.enableTrash": false,
13+
"security.workspace.trust.enabled": false
14+
},
15+
"reloadOnReconnect": true
16+
}
17+
},
18+
"backend": {
19+
"config": {
20+
"resolveSystemPlugins": false,
21+
"frontendConnectionTimeout": 3000
22+
}
23+
}
24+
},
25+
"dependencies": {
26+
"@theia/ai-chat": "1.56.0",
27+
"@theia/ai-chat-ui": "1.56.0",
28+
"@theia/ai-code-completion": "1.56.0",
29+
"@theia/ai-core": "1.56.0",
30+
"@theia/ai-history": "1.56.0",
31+
"@theia/ai-huggingface": "1.56.0",
32+
"@theia/ai-llamafile": "1.56.0",
33+
"@theia/ai-ollama": "1.56.0",
34+
"@theia/ai-openai": "1.56.0",
35+
"@theia/ai-terminal": "1.56.0",
36+
"@theia/ai-workspace-agent": "1.56.0",
37+
"@theia/bulk-edit": "1.56.0",
38+
"@theia/callhierarchy": "1.56.0",
39+
"@theia/collaboration": "1.56.0",
40+
"@theia/console": "1.56.0",
41+
"@theia/core": "1.56.0",
42+
"@theia/debug": "1.56.0",
43+
"@theia/editor": "1.56.0",
44+
"@theia/editor-preview": "1.56.0",
45+
"@theia/file-search": "1.56.0",
46+
"@theia/filesystem": "1.56.0",
47+
"@theia/getting-started": "1.56.0",
48+
"@theia/git": "1.56.0",
49+
"@theia/keymaps": "1.56.0",
50+
"@theia/markers": "1.56.0",
51+
"@theia/messages": "1.56.0",
52+
"@theia/metrics": "1.56.0",
53+
"@theia/mini-browser": "1.56.0",
54+
"@theia/monaco": "1.56.0",
55+
"@theia/navigator": "1.56.0",
56+
"@theia/notebook": "1.56.0",
57+
"@theia/outline-view": "1.56.0",
58+
"@theia/output": "1.56.0",
59+
"@theia/plugin-dev": "1.56.0",
60+
"@theia/plugin-ext": "1.56.0",
61+
"@theia/plugin-ext-headless": "1.56.0",
62+
"@theia/plugin-ext-vscode": "1.56.0",
63+
"@theia/plugin-metrics": "1.56.0",
64+
"@theia/preferences": "1.56.0",
65+
"@theia/preview": "1.56.0",
66+
"@theia/process": "1.56.0",
67+
"@theia/property-view": "1.56.0",
68+
"@theia/remote": "1.56.0",
69+
"@theia/scm": "1.56.0",
70+
"@theia/scm-extra": "1.56.0",
71+
"@theia/search-in-workspace": "1.56.0",
72+
"@theia/secondary-window": "1.56.0",
73+
"@theia/task": "1.56.0",
74+
"@theia/terminal": "1.56.0",
75+
"@theia/timeline": "1.56.0",
76+
"@theia/toolbar": "1.56.0",
77+
"@theia/typehierarchy": "1.56.0",
78+
"@theia/userstorage": "1.56.0",
79+
"@theia/variable-resolver": "1.56.0",
80+
"@theia/vsx-registry": "1.56.0",
81+
"@theia/workspace": "1.56.0"
82+
},
83+
"scripts": {
84+
"clean": "theia clean",
85+
"build": "yarn compile && yarn bundle",
86+
"bundle": "theia build --mode development",
87+
"compile": "tsc -b",
88+
"coverage": "yarn test --test-coverage && yarn coverage:report",
89+
"coverage:clean": "rimraf .nyc_output && rimraf coverage",
90+
"coverage:report": "nyc report --reporter=html",
91+
"rebuild": "theia rebuild:browser --cacheRoot ../..",
92+
"prepare": "yarn run clean && yarn production",
93+
"production": "theia build --mode production",
94+
"start": "yarn rebuild && theia start --plugins=local-dir:../../plugins",
95+
"start:debug": "yarn start --log-level=debug",
96+
"start:watch": "concurrently --kill-others -n tsc,bundle,run -c red,yellow,green \"tsc -b -w --preserveWatchOutput\" \"yarn watch:bundle\" \"yarn start\"",
97+
"test": "yarn rebuild && theia test . --plugins=local-dir:../../plugins --test-spec=../api-tests/**/*.spec.js",
98+
"test:debug": "yarn test --test-inspect",
99+
"watch": "concurrently --kill-others -n tsc,bundle -c red,yellow \"tsc -b -w --preserveWatchOutput\" \"yarn watch:bundle\"",
100+
"watch:bundle": "theia build --watch --mode development",
101+
"watch:compile": "tsc -b -w",
102+
"postinstall": "patch-package --error-on-fail"
103+
},
104+
"devDependencies": {
105+
"@theia/cli": "1.56.0",
106+
"patch-package": "^6.2.2",
107+
"postinstall-postinstall": "^2.1.0"
108+
}
109+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/node_modules/@theia/application-manager/lib/generator/frontend-generator.js b/node_modules/@theia/application-manager/lib/generator/frontend-generator.js
2+
index 042b37f..879dfb2 100644
3+
--- a/node_modules/@theia/application-manager/lib/generator/frontend-generator.js
4+
+++ b/node_modules/@theia/application-manager/lib/generator/frontend-generator.js
5+
@@ -75,7 +75,13 @@ require('setimmediate');
6+
const { Container } = require('inversify');
7+
const { FrontendApplicationConfigProvider } = require('@theia/core/lib/browser/frontend-application-config-provider');
8+
9+
-FrontendApplicationConfigProvider.set(${this.prettyStringify(this.pck.props.frontend.config)});
10+
+// Determine Dockside devtainer name from document href hostname,
11+
+// and write the value to the in-memory frontend config
12+
+// (technically, package.json's theia.frontend.config.devtainerName)
13+
+// It will be read by our patched window-title-service.js
14+
+let config = ${this.prettyStringify(this.pck.props.frontend.config)};
15+
+try { config.devtainerName=document.location.href.split('/')[2].split('.')[0].split('--')[0].split('-').slice(1).join('-'); } catch {};
16+
+FrontendApplicationConfigProvider.set(config);
17+
18+
${this.ifMonaco(() => `
19+
self.MonacoEnvironment = {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git a/node_modules/@theia/core/lib/browser/core-preferences.js b/node_modules/@theia/core/lib/browser/core-preferences.js
2+
index 23b07eb..526d133 100644
3+
--- a/node_modules/@theia/core/lib/browser/core-preferences.js
4+
+++ b/node_modules/@theia/core/lib/browser/core-preferences.js
5+
@@ -95,7 +95,7 @@ exports.corePreferenceSchema = {
6+
'window.title': {
7+
type: 'string',
8+
default: os_1.isOSX
9+
- ? '${activeEditorShort}${separator}${rootName}'
10+
+ ? '${activeEditorShort}${separator}${rootName}${separator}${appName}'
11+
: '${dirty} ${activeEditorShort}${separator}${rootName}${separator}${appName}',
12+
scope: 'application',
13+
markdownDescription: windowTitleDescription
14+
diff --git a/node_modules/@theia/core/lib/browser/window/window-title-service.js b/node_modules/@theia/core/lib/browser/window/window-title-service.js
15+
index 11cc54c..49dbb8d 100644
16+
--- a/node_modules/@theia/core/lib/browser/window/window-title-service.js
17+
+++ b/node_modules/@theia/core/lib/browser/window/window-title-service.js
18+
@@ -44,7 +44,11 @@ exports.InitialWindowTitleParts = {
19+
appName: frontend_application_config_provider_1.FrontendApplicationConfigProvider.get().applicationName,
20+
remoteName: undefined,
21+
dirty: undefined,
22+
- developmentHost: undefined
23+
+ // Obtain this value from the in-memory frontend config
24+
+ // (technically, package.json's theia.frontend.config.devtainerName, which is set
25+
+ // not in our package.json file, but dynamically during app load by our patched
26+
+ // frontend-generator.js)
27+
+ developmentHost: frontend_application_config_provider_1.FrontendApplicationConfigProvider.get().devtainerName || '[devtainer]'
28+
};
29+
let WindowTitleService = class WindowTitleService {
30+
constructor() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/node_modules/@theia/plugin-ext/lib/main/browser/webview/webview-environment.js b/node_modules/@theia/plugin-ext/lib/main/browser/webview/webview-environment.js
2+
index 7c58dce..3aa490b 100644
3+
--- a/node_modules/@theia/plugin-ext/lib/main/browser/webview/webview-environment.js
4+
+++ b/node_modules/@theia/plugin-ext/lib/main/browser/webview/webview-environment.js
5+
@@ -68,7 +68,12 @@ let WebviewEnvironment = class WebviewEnvironment {
6+
return (await this.externalEndpointUrl()).resolve('theia-resource/{{scheme}}//{{authority}}/{{path}}').toString(true);
7+
}
8+
async cspSource() {
9+
- return (await this.externalEndpointUrl()).withPath('').withQuery('').withFragment('').toString(true).replace('{{uuid}}', '*');
10+
+ // In Dockside, webviews deployed by VSX extensions are launched on variant subdomains
11+
+ // of the devtainer's IDE FQDN, as specified by the values of
12+
+ // THEIA_WEBVIEW_EXTERNAL_ENDPOINT and THEIA_MINI_BROWSER_HOST_PATTERN in launch-ide.sh.
13+
+ // The value of cspSource() must be adjusted accordingly.
14+
+ // See: https://github.com/eclipse-theia/theia/issues/8857
15+
+ return (await this.externalEndpointUrl()).withPath('').withQuery('').withFragment('').toString(true).replace('{{uuid}}\.', '*.');
16+
}
17+
async getHostPattern() {
18+
return environment_1.environment.electron.is()

ide/theia/1.56.0/build/patches/README

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Patch to fix invalid cspSource:
2+
- @theia+plugin-ext+<version>.patch
3+
- https://github.com/eclipse-theia/theia/issues/8857
4+
5+
Patches to modify browser title to incorporate devtainer name:
6+
- @theia+application-manager+<version>.patch
7+
- @theia+core+<version>.patch

0 commit comments

Comments
 (0)