From 2e9b8669d748579505df10e1827f2759785abe0a Mon Sep 17 00:00:00 2001 From: Amp Date: Tue, 11 Aug 2026 10:59:10 +0000 Subject: [PATCH 1/2] Configure JupyterLab for Amp orbs Amp-Thread-ID: https://ampcode.com/threads/T-019ff043-9260-76ed-9a14-2deac5c214bf Co-authored-by: Stefan Amberger --- .agents/setup | 35 +++++++++++++++++++++++++++++++++++ .amp/services.yaml | 16 ++++++++++++++++ .gitignore | 4 +++- 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100755 .agents/setup create mode 100644 .amp/services.yaml diff --git a/.agents/setup b/.agents/setup new file mode 100755 index 0000000..e238c02 --- /dev/null +++ b/.agents/setup @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -euo pipefail + +if ! command -v uv >/dev/null 2>&1; then + python -m pip install --user uv + export PATH="$HOME/.local/bin:$PATH" +fi + +uv sync --all-packages --frozen + +mkdir -p \ + "$HOME/.jupyter/jupyter_server_config.d" \ + "$HOME/.jupyter/lab/user-settings/@jupyterlab/completer-extension" + +cat > "$HOME/.jupyter/jupyter_server_config.d/ty-language-server.json" <<'EOF' +{ + "LanguageServerManager": { + "language_servers": { + "ty": { + "version": 2, + "argv": ["ty", "server"], + "languages": ["python"], + "mime_types": ["text/python", "text/x-python", "text/x-ipython"], + "display_name": "ty" + } + } + } +} +EOF + +cat > "$HOME/.jupyter/lab/user-settings/@jupyterlab/completer-extension/manager.jupyterlab-settings" <<'EOF' +{ + "autoCompletion": true +} +EOF diff --git a/.amp/services.yaml b/.amp/services.yaml new file mode 100644 index 0000000..a4709f9 --- /dev/null +++ b/.amp/services.yaml @@ -0,0 +1,16 @@ +services: + jupyter: + command: >- + uv run --with jupyterlab --with jupyterlab-lsp + jupyter lab + --ip=0.0.0.0 + --port=$PORT + --no-browser + --IdentityProvider.token= + --ServerApp.password= + --ServerApp.allow_remote_access=True + --ServerApp.allow_origin_pat=^https://[A-Za-z0-9-]+[.]onamp[.]dev$ + --ServerApp.root_dir=. + portal: + title: JupyterLab + description: JupyterLab with ty language-server completion for the Tilebox workspace. diff --git a/.gitignore b/.gitignore index e134a5c..749190d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ __pycache__/ .ipynb_checkpoints/ +.virtual_documents/ .idea/ @@ -18,4 +19,5 @@ test-report.xml *.egg-info/ -.amp/ +.amp/* +!.amp/services.yaml From 7756b7bda1083851cc5418a68143a058a515b6c4 Mon Sep 17 00:00:00 2001 From: Amp Date: Tue, 11 Aug 2026 12:30:34 +0000 Subject: [PATCH 2/2] Add widgets and collaboration to JupyterLab Amp-Thread-ID: https://ampcode.com/threads/T-019ff043-9260-76ed-9a14-2deac5c214bf Co-authored-by: Stefan Amberger --- .amp/services.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.amp/services.yaml b/.amp/services.yaml index a4709f9..77736c8 100644 --- a/.amp/services.yaml +++ b/.amp/services.yaml @@ -1,7 +1,11 @@ services: jupyter: command: >- - uv run --with jupyterlab --with jupyterlab-lsp + uv run + --with jupyterlab + --with jupyterlab-lsp + --with ipywidgets + --with jupyter-collaboration jupyter lab --ip=0.0.0.0 --port=$PORT