@pasko70/pibo 3.1.4 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/README.md +2 -2
  2. package/dist/apps/chat-ui/assets/{dist-BcUbdOKJ.js → dist-BAXv9edD.js} +1 -1
  3. package/dist/apps/chat-ui/assets/{dist-BOqsX6_s.js → dist-CiwafO2k.js} +1 -1
  4. package/dist/apps/chat-ui/assets/{dist-qDZ-CdlK.js → dist-DD2HRAgt.js} +1 -1
  5. package/dist/apps/chat-ui/assets/{dist-DkpIJ_Pp.js → dist-NsHPx2KS.js} +1 -1
  6. package/dist/apps/chat-ui/assets/{dist-a0mykCz7.js → dist-jgYATWSF.js} +1 -1
  7. package/dist/apps/chat-ui/assets/index-BTzIdlcK.css +1 -0
  8. package/dist/apps/chat-ui/assets/index-C-s68zrN.js +228 -0
  9. package/dist/apps/chat-ui/index.html +2 -2
  10. package/dist/apps/chat-vscode-web/assets/{index-SluZr_-r.css → index-b18ZkEo0.css} +1 -1
  11. package/dist/apps/chat-vscode-web/assets/index-nHYofa-e.js +43 -0
  12. package/dist/apps/chat-vscode-web/index.html +2 -2
  13. package/dist/setup/cli.js +5 -5
  14. package/docs/project/guides/pibo-on-windows-via-wsl.md +292 -0
  15. package/docs/project/guides/pibo-vscode-ext-quickstart.md +287 -0
  16. package/docs/project/installation-profiles.md +134 -0
  17. package/docs/project/operations/index.md +10 -0
  18. package/docs/{ops → project/operations}/install-developer-host.md +19 -0
  19. package/docs/{ops → project/operations}/install-user-host.md +19 -0
  20. package/docs/{ops → project/operations}/upgrade-user-to-developer-host.md +19 -0
  21. package/docs/{ops → project/operations}/vscode-extension-release.md +19 -0
  22. package/npm-shrinkwrap.json +4 -3
  23. package/package.json +17 -3
  24. package/skills/builtin/pibo-agent-runtime-adapter/references/testing-migration-and-validation.md +3 -1
  25. package/skills/builtin/pibo-spec-writing/SKILL.md +110 -168
  26. package/skills/builtin/prd/SKILL.md +18 -0
  27. package/dist/apps/chat-ui/assets/index-CmqRSbBU.css +0 -1
  28. package/dist/apps/chat-ui/assets/index-G2ic-FSG.js +0 -228
  29. package/dist/apps/chat-vscode-web/assets/index-zQ1fNz5K.js +0 -43
  30. package/docs/README.md +0 -34
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <meta name="theme-color" content="#101d22" />
7
7
  <title>Pibo</title>
8
- <script type="module" crossorigin src="/apps/chat-vscode/assets/index-zQ1fNz5K.js"></script>
9
- <link rel="stylesheet" crossorigin href="/apps/chat-vscode/assets/index-SluZr_-r.css">
8
+ <script type="module" crossorigin src="/apps/chat-vscode/assets/index-nHYofa-e.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/apps/chat-vscode/assets/index-b18ZkEo0.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
package/dist/setup/cli.js CHANGED
@@ -128,7 +128,7 @@ export function createUserHostSetupPlan(options = {}) {
128
128
  if (!options.domain)
129
129
  warnings.push("No production domain was provided; generated Caddy/Auth examples use placeholders.");
130
130
  if (process.platform === "win32" && !isWsl()) {
131
- warnings.push("Pibo host setup targets Linux. Native Windows is not supported. Install WSL2 (https://aka.ms/wsl) and run setup inside the WSL distribution. See docs/guides/pibo-on-windows-via-wsl.md.");
131
+ warnings.push("Pibo host setup targets Linux. Native Windows is not supported. Install WSL2 (https://aka.ms/wsl) and run setup inside the WSL distribution. See docs/project/guides/pibo-on-windows-via-wsl.md.");
132
132
  }
133
133
  const generatedFiles = [
134
134
  {
@@ -201,7 +201,7 @@ export function createDeveloperHostSetupPlan(options = {}) {
201
201
  if (!options.prodDomain || !options.devDomain)
202
202
  warnings.push("Production and dev domains should both be configured before requesting HTTPS certificates.");
203
203
  if (process.platform === "win32" && !isWsl()) {
204
- warnings.push("Pibo developer-host setup targets Linux. Native Windows is not supported. Install WSL2 (https://aka.ms/wsl) and run setup inside the WSL distribution. See docs/guides/pibo-on-windows-via-wsl.md.");
204
+ warnings.push("Pibo developer-host setup targets Linux. Native Windows is not supported. Install WSL2 (https://aka.ms/wsl) and run setup inside the WSL distribution. See docs/project/guides/pibo-on-windows-via-wsl.md.");
205
205
  }
206
206
  const generatedFiles = [
207
207
  {
@@ -496,13 +496,13 @@ async function createDoctorStatus(options) {
496
496
  if (wslInfo.isWsl) {
497
497
  const versionLabel = wslInfo.version ? `WSL${wslInfo.version}` : "WSL";
498
498
  const distroLabel = wslInfo.distro ? ` (${wslInfo.distro})` : "";
499
- checks.push({ name: "platform.wsl", status: "ok", detail: `Running inside ${versionLabel}${distroLabel}; Pibo is fully supported here. See docs/guides/pibo-on-windows-via-wsl.md.` });
499
+ checks.push({ name: "platform.wsl", status: "ok", detail: `Running inside ${versionLabel}${distroLabel}; Pibo is fully supported here. See docs/project/guides/pibo-on-windows-via-wsl.md.` });
500
500
  }
501
501
  else if (process.platform === "win32") {
502
502
  checks.push({
503
503
  name: "platform.wsl",
504
504
  status: "fail",
505
- detail: "Native Windows is not supported. Install WSL2 (https://aka.ms/wsl) and run Pibo inside the WSL distribution. See docs/guides/pibo-on-windows-via-wsl.md.",
505
+ detail: "Native Windows is not supported. Install WSL2 (https://aka.ms/wsl) and run Pibo inside the WSL distribution. See docs/project/guides/pibo-on-windows-via-wsl.md.",
506
506
  });
507
507
  }
508
508
  checks.push(...swapCheck(options.minSwapGb));
@@ -610,7 +610,7 @@ async function createDoctorStatus(options) {
610
610
  recommendations.push("Browser-Use and Agent-Browser work directly under WSLg on Windows 11. On Windows 10, install an X server (e.g. VcXsrv) and export DISPLAY=:0 inside WSL.");
611
611
  }
612
612
  else if (process.platform === "win32") {
613
- recommendations.push("Pibo does not run natively on Windows. Install WSL2 with `wsl --install` and follow docs/guides/pibo-on-windows-via-wsl.md.");
613
+ recommendations.push("Pibo does not run natively on Windows. Install WSL2 with `wsl --install` and follow docs/project/guides/pibo-on-windows-via-wsl.md.");
614
614
  }
615
615
  return {
616
616
  node: process.versions.node,
@@ -0,0 +1,292 @@
1
+ ---
2
+ type: "Guide"
3
+ title: "Pibo on Windows via WSL"
4
+ description: "Guides Windows users through installing Pibo and the VS Code extension inside WSL2."
5
+ tags: ["installation", "windows", "wsl", "vscode"]
6
+ status: "draft"
7
+ authority: "directive"
8
+ generated:
9
+ by: "openai/codex"
10
+ at: "2026-08-30T15:47:50Z"
11
+ sources:
12
+ - id: "foundation-relocation-source"
13
+ resource: "https://github.com/Pascapone/pibo/blob/2aef244301f5d181624662fdad53e18e83e80bd9/docs/guides/pibo-on-windows-via-wsl.md"
14
+ title: "Original byte-preserved Pibo on Windows via WSL guide"
15
+ commit: "2aef244301f5d181624662fdad53e18e83e80bd9"
16
+ path: "docs/guides/pibo-on-windows-via-wsl.md"
17
+ sha256: "132f00469edcfa8915525bff4d0c9d82573ae53868a74db81d5224d354ce1d25"
18
+ relation: "Byte-identical body lineage before Foundation relocation."
19
+ ---
20
+ # Pibo on Windows via WSL
21
+
22
+ Pibo is a Linux-first tool. Native Windows is **not** supported, but Pibo runs unmodified inside **WSL2** because WSL2 is a real Linux kernel with full filesystem, symlink, and process semantics. This guide walks a Windows user from a fresh machine to a working `pibo` install, including the Pibo VSCode extension.
23
+
24
+ Total setup time: **15–25 minutes** on Windows 11 with WSLg enabled.
25
+
26
+ ## Why WSL and not native Windows?
27
+
28
+ | | Native Windows | WSL2 |
29
+ |---|---|---|
30
+ | **Code changes** | 12+ POSIX assumptions would need workarounds | 0 — Pibo already runs on Linux |
31
+ | **Docker workers** | Docker Desktop only, paths are awkward | Docker Desktop integrates with WSL2, no friction |
32
+ | **Browser-Use / Agent-Browser** | Need WSL or WSLg anyway | Works directly under WSLg |
33
+ | **`pibo setup` (systemd, caddy)** | Would need a Windows port | Works as on Linux |
34
+ | **Symlinks, file modes, line endings** | Pain | Native |
35
+ | **Long-term maintenance** | Two code paths | One code path |
36
+
37
+ Microsoft itself recommends WSL for Linux-style development on Windows. The VSCode "WSL" extension, Docker Desktop's WSL2 backend, and Windows 11's WSLg GUI integration make WSL a first-class dev environment.
38
+
39
+ ## Prerequisites
40
+
41
+ - **Windows 10 version 2004+** or **Windows 11** (any edition)
42
+ - Administrator access for the WSL install
43
+ - About 5 GB free disk space (WSL image + Pibo + node_modules)
44
+
45
+ ## Step 1 — Install WSL (5 min, one-time)
46
+
47
+ Open **PowerShell as Administrator** and run:
48
+
49
+ ```powershell
50
+ wsl --install
51
+ ```
52
+
53
+ Default settings install Ubuntu. Reboot when prompted. On first boot, Ubuntu sets a username and password.
54
+
55
+ Verify the install:
56
+
57
+ ```powershell
58
+ wsl --status
59
+ # Default Distribution: Ubuntu
60
+ # Default Version: 2
61
+ ```
62
+
63
+ > **Tip:** If you want a different distro (Debian, openSUSE, Alpine…), run `wsl --install -d <DistroName>`. The rest of this guide works for any of them.
64
+
65
+ ## Step 2 — Verify the WSL version (1 min)
66
+
67
+ Inside the WSL shell (run `wsl` in PowerShell to enter it), confirm WSL2:
68
+
69
+ ```bash
70
+ cat /proc/sys/kernel/osrelease
71
+ # Look for "microsoft-standard-WSL2" or "WSL2" in the output.
72
+ ```
73
+
74
+ If you see "Microsoft" without the WSL2 marker, your distro is on WSL1. Convert it:
75
+
76
+ ```powershell
77
+ # PowerShell
78
+ wsl --set-version Ubuntu 2
79
+ ```
80
+
81
+ WSL1 cannot run Docker well and lacks the full Linux kernel Pibo expects. Use WSL2.
82
+
83
+ ## Step 3 — Install Node.js 24+ inside WSL (3 min)
84
+
85
+ The Ubuntu default Node is often too old. Use NodeSource:
86
+
87
+ ```bash
88
+ # Inside WSL
89
+ sudo apt update
90
+ sudo apt install -y ca-certificates curl gnupg
91
+ curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
92
+ sudo apt install -y nodejs build-essential
93
+ node --version # must print v24.x.x or higher
94
+ npm --version
95
+ ```
96
+
97
+ ## Step 4 — Install Pibo inside WSL (1 min)
98
+
99
+ ```bash
100
+ # Inside WSL
101
+ npm install -g @pasko70/pibo
102
+ pibo --version
103
+ ```
104
+
105
+ Pibo's data lives in `~/.pibo` inside the WSL filesystem. This is intentional: WSL-native paths are fast, while `/mnt/c/...` mounts are slow. Keep Pibo's working data inside WSL.
106
+
107
+ ## Step 5 — Install VSCode and the WSL extension (3 min)
108
+
109
+ 1. Install **VSCode for Windows** from <https://code.visualstudio.com/> (the standard Windows .exe, not the .deb).
110
+ 2. In VSCode, open the **Extensions** panel (Ctrl+Shift+X) and install **WSL** by Microsoft.
111
+ 3. **Open your project folder inside WSL.** In the WSL terminal:
112
+ ```bash
113
+ cd ~/projects/my-app # or wherever your project lives
114
+ code .
115
+ ```
116
+ VSCode opens a second VSCode window. Title bar shows the distro name in green (`[WSL: Ubuntu]`). File editing, terminal, and extensions all run inside WSL.
117
+
118
+ > **Why this step matters:** when you run `code .` from inside WSL, VSCode installs its Linux server binary inside the WSL distro, the integrated terminal becomes a WSL bash, and `code` is added to WSL's `PATH`. That is what makes `pibo vscode install` work seamlessly.
119
+
120
+ ## Step 6 — Configure Pibo auth (3 min)
121
+
122
+ Pibo uses [Better Auth](https://www.better-auth.com/) with Google OAuth. Set the keys once:
123
+
124
+ ```bash
125
+ # Inside WSL
126
+ pibo config set auth.baseURL http://127.0.0.1:4788
127
+ pibo config set auth.secret "$(openssl rand -hex 32)"
128
+ pibo config set auth.googleClientId <your-google-oauth-client-id>
129
+ pibo config set auth.googleClientSecret <your-google-oauth-client-secret>
130
+ pibo config set auth.allowedEmails you@example.com
131
+ ```
132
+
133
+ To get Google OAuth credentials, create a Web Application client at <https://console.cloud.google.com/apis/credentials>. The redirect URI is `http://127.0.0.1:4788/api/auth/callback/google`. See the [Quick Start Guide](./pibo-vscode-ext-quickstart.md) for the full walkthrough.
134
+
135
+ ## Step 7 — Start the Pibo gateway (1 min)
136
+
137
+ ```bash
138
+ # Inside WSL, leave this running in a terminal
139
+ pibo gateway:web
140
+ ```
141
+
142
+ The gateway listens on `127.0.0.1:4788` **inside WSL**. Windows can reach this URL because WSL2 forwards localhost from Windows to the WSL2 VM by default.
143
+
144
+ Open a **second** WSL terminal and verify:
145
+
146
+ ```bash
147
+ curl -s http://127.0.0.1:4788/api/health
148
+ # or open in your Windows browser:
149
+ # http://127.0.0.1:4788/apps/chat
150
+ ```
151
+
152
+ > **If localhost does not work in the Windows browser:** the WSL2 localhost forwarder is disabled or blocked. See [Troubleshooting](#localhost-forwarding-not-working) below.
153
+
154
+ ## Step 8 — Install the Pibo VSCode extension (2 min)
155
+
156
+ ### Option A — from the WSL terminal (recommended)
157
+
158
+ ```bash
159
+ # Inside the WSL VSCode terminal (Ctrl+`)
160
+ pibo vscode install
161
+ ```
162
+
163
+ This downloads the latest VSIX from GitHub Releases and runs `code --install-extension` against the WSL `code` binary.
164
+
165
+ ### Option B — from the Marketplace
166
+
167
+ Search **Pibo** by publisher `pibo` in the Extensions panel. Install the one named **Pibo** by `pibo`.
168
+
169
+ ### Verify
170
+
171
+ ```bash
172
+ pibo vscode status
173
+ # Should print the installed extension ID and the gateway URL.
174
+ ```
175
+
176
+ Click the **Pibo** icon in the VSCode sidebar (left rail). A web view opens. Sign in with Google. The status bar at the bottom should show the room you are in.
177
+
178
+ ## Step 9 — Optional — Docker workers
179
+
180
+ Pibo's compute workers run as Docker containers. To enable them on WSL:
181
+
182
+ 1. Install **Docker Desktop for Windows**: <https://www.docker.com/products/docker-desktop/>
183
+ 2. Open Docker Desktop → **Settings** → **Resources** → **WSL Integration**.
184
+ 3. Enable the toggle for **Ubuntu** (or whichever distro you use).
185
+ 4. Click **Apply & Restart**.
186
+
187
+ Test from WSL:
188
+
189
+ ```bash
190
+ docker run --rm hello-world
191
+ # Should print "Hello from Docker!"
192
+ ```
193
+
194
+ Pibo will detect Docker automatically. `pibo compute dev spawn --worktree <name>` now works.
195
+
196
+ ## Step 10 — Optional — Browser-Use and Agent-Browser
197
+
198
+ Both tools need a graphical browser under the hood.
199
+
200
+ - **Windows 11 with WSLg** (default on fresh installs): no extra setup. Browser windows appear as regular Windows windows.
201
+ - **Windows 10 or older Windows 11 without WSLg**: install an X server in Windows (e.g. [VcXsrv](https://sourceforge.net/projects/vcxsrv/)) and export the display in WSL:
202
+ ```bash
203
+ # Inside WSL ~/.bashrc
204
+ export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
205
+ ```
206
+ Launch VcXsrv in Windows with "Disable access control" ticked.
207
+
208
+ To install the tools:
209
+
210
+ ```bash
211
+ pibo tools install browser-use
212
+ pibo tools install agent-browser
213
+ pibo tools env browser-use
214
+ ```
215
+
216
+ ## Where Pibo stores things on WSL
217
+
218
+ | Path (inside WSL) | What |
219
+ |---|---|
220
+ | `~/.pibo/config.json` | Pibo configuration (auth, ports, etc.) |
221
+ | `~/.pibo/pibo.sqlite` | Sessions, rooms, signals |
222
+ | `~/.pibo/vscode/cache/` | VSIX cache for `pibo vscode install` |
223
+ | `<workspace>/.pibo/` | Per-workspace room state |
224
+
225
+ > Keep these inside the WSL filesystem (not under `/mnt/c/...`). Cross-FS access is slow and breaks symlinks.
226
+
227
+ ## Troubleshooting
228
+
229
+ ### Localhost forwarding not working
230
+
231
+ WSL2 forwards `localhost` from Windows to the WSL VM by default. If the gateway at `http://127.0.0.1:4788` is unreachable from a Windows browser:
232
+
233
+ 1. **Check Windows version.** Localhost forwarding works on Windows 11 and on Windows 10 22H2+. Older builds had bugs.
234
+ 2. **Check the WSL version.** Run `wsl --status` — `Default Version: 2`.
235
+ 3. **Check Windows Firewall.** Allow inbound to WSL. Run in PowerShell as Admin:
236
+ ```powershell
237
+ New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
238
+ ```
239
+ 4. **Fallback:** use the WSL2 VM's IP. Inside WSL run:
240
+ ```bash
241
+ hostname -I
242
+ # e.g. prints 172.21.123.45
243
+ ```
244
+ Then in your Windows browser use `http://172.21.123.45:4788`. The IP changes on each WSL boot, so this is a workaround, not a permanent solution.
245
+ 5. **Last resort:** set up `netsh interface portproxy`:
246
+ ```powershell
247
+ # PowerShell as Admin
248
+ $wslIp = wsl hostname -I
249
+ netsh interface portproxy add v4tov4 listenport=4788 listenaddress=0.0.0.0 connectport=4788 connectaddress=$wslIp
250
+ ```
251
+
252
+ ### `pibo setup doctor` warns about native Windows
253
+
254
+ You are running Pibo from a Windows PowerShell or `cmd.exe`, not from inside WSL. Open the **WSL** terminal (or run `wsl` from PowerShell) and try again.
255
+
256
+ ### Browser-Use opens a blank window
257
+
258
+ The DISPLAY is not set or the X server is not running. On Windows 11 with WSLg, `echo $DISPLAY` should print something like `:0` or `wayland-0`. On Windows 10, start VcXsrv and export `DISPLAY` as shown above.
259
+
260
+ ### `pibo vscode install` cannot find `code`
261
+
262
+ This means VSCode's WSL server is not active in the current VSCode window. Run `code .` from inside WSL once, restart VSCode, then try again. If you opened VSCode directly from the Start Menu (not via `code .` in WSL), you are in the Windows VSCode instance, not the WSL one.
263
+
264
+ ### File edits are slow
265
+
266
+ You are editing files on `/mnt/c/...` (the Windows drive). Move the project into the WSL filesystem (`/home/<you>/projects/...`). NTFS access from WSL is slow because of `metadata` and `umask` differences.
267
+
268
+ ### Docker commands fail inside WSL
269
+
270
+ Open Docker Desktop → Settings → Resources → WSL Integration → enable your distro → **Apply & Restart**. Verify with `docker run --rm hello-world`.
271
+
272
+ ## Verifying everything works
273
+
274
+ Run the following inside WSL:
275
+
276
+ ```bash
277
+ pibo --version # 1.3.0 or higher
278
+ pibo setup doctor # all checks should be OK or WARN
279
+ pibo vscode status # extension should be installed
280
+ pibo tools list # should list browser-use, agent-browser, etc.
281
+ ```
282
+
283
+ Open the VSCode sidebar → Pibo icon → web view loads → sign in with Google → create a new session → send a message. The status bar at the bottom should show a green dot and your room name.
284
+
285
+ If all of that works, you are fully set up.
286
+
287
+ ## What we deliberately do not support
288
+
289
+ - **Native Windows** (no WSL). Pibo will print a clear error pointing you back to this guide.
290
+ - **WSL1.** WSL1 lacks the full Linux kernel Pibo expects. Use WSL2.
291
+ - **Cygwin, MSYS2, Git Bash.** These are POSIX shims, not real Linux. Pibo will not work; use WSL2.
292
+ - **Windows Containers in Docker.** Pibo compute workers target Linux containers.
@@ -0,0 +1,287 @@
1
+ ---
2
+ type: "Guide"
3
+ title: "Pibo Quick Start — CLI + VS Code Extension"
4
+ description: "Provides a German-language quick start for installing Pibo and using its VS Code extension."
5
+ tags: ["cli", "installation", "quickstart", "vscode"]
6
+ status: "draft"
7
+ authority: "directive"
8
+ generated:
9
+ by: "openai/codex"
10
+ at: "2026-08-30T15:47:50Z"
11
+ sources:
12
+ - id: "foundation-relocation-source"
13
+ resource: "https://github.com/Pascapone/pibo/blob/2aef244301f5d181624662fdad53e18e83e80bd9/docs/guides/pibo-vscode-ext-quickstart.md"
14
+ title: "Original byte-preserved Pibo VS Code extension quick start"
15
+ commit: "2aef244301f5d181624662fdad53e18e83e80bd9"
16
+ path: "docs/guides/pibo-vscode-ext-quickstart.md"
17
+ sha256: "ff1b33edf70c89ce9b128382d05d5fa28735ede3fc3ba40429bece172fc2d716"
18
+ relation: "Byte-identical body lineage before Foundation relocation."
19
+ ---
20
+ # Pibo Quick Start — CLI + VS Code Extension
21
+
22
+ Diese Anleitung bringt dich in ungefähr 15 Minuten vom frischen Laptop zur
23
+ laufenden Pibo-VSCode-Extension.
24
+
25
+ ## Was du am Ende hast
26
+
27
+ - `pibo` CLI global installiert
28
+ - Ein laufendes `pibo gateway:web` (Auth-Gateway) auf `http://127.0.0.1:4788`
29
+ - Die Pibo VS Code Extension in deinem Editor
30
+ - Eine erste Session in deinem aktuellen Projekt-Workspace
31
+
32
+ ## 0. Voraussetzungen
33
+
34
+ | Was | Warum | Wie prüfen |
35
+ |---|---|---|
36
+ | **Node.js 24+** | Pibo läuft auf Node 24 (steht so in `package.json#engines`) | `node --version` |
37
+ | **VS Code** (oder Insiders / VSCodium) | Ziel der Extension | `code --version` |
38
+ | **Internet** | npm + GitHub Releases | ping `registry.npmjs.org` |
39
+ | Optional: **Google OAuth Client** | Echter Login via Google | Console holen: <https://console.cloud.google.com/apis/credentials> |
40
+
41
+ Falls dein `apt`-Node zu alt ist: <https://nodejs.org/en/download> oder `fnm`/`nvm` benutzen.
42
+
43
+ ## 1. Pibo CLI installieren
44
+
45
+ ```bash
46
+ npm install -g @pasko70/pibo
47
+ pibo --version # soll 1.3.0 (oder neuer) zeigen
48
+ pibo --help # zeigt die Top-Level-Commands
49
+ ```
50
+
51
+ Falls du eine Permission-Fehlermeldung bekommst (Linux/macOS):
52
+
53
+ ```bash
54
+ mkdir -p ~/.local
55
+ npm config set prefix ~/.local
56
+ export PATH="$HOME/.local/bin:$PATH"
57
+ npm install -g @pasko70/pibo
58
+ ```
59
+
60
+ Diese PATH-Zeile am besten in deine `~/.bashrc` / `~/.zshrc` schreiben.
61
+
62
+ ## 2. Auth einrichten (einmalig)
63
+
64
+ Pibo nutzt Better Auth + Google OAuth. Die Werte landen in `~/.pibo/config.json`.
65
+
66
+ ```bash
67
+ pibo config set auth.baseURL http://127.0.0.1:4788
68
+ pibo config set auth.secret "$(openssl rand -hex 32)" # beliebiger 32+ Zeichen-String
69
+ pibo config set auth.googleClientId <aus-google-console>
70
+ pibo config set auth.googleClientSecret <aus-google-console>
71
+ pibo config set auth.allowedEmails deine@email.com
72
+ ```
73
+
74
+ **Woher bekomme ich die Google-Werte?**
75
+ 1. <https://console.cloud.google.com/apis/credentials> öffnen
76
+ 2. "OAuth 2.0 Client IDs" → "Create OAuth client ID" → Typ "Web application"
77
+ 3. Authorized redirect URIs: `http://127.0.0.1:4788/api/auth/callback/google` eintragen
78
+ 4. Client ID und Client Secret in die Config setzen
79
+ 5. In deiner Google-Console unter "OAuth consent screen" die gewünschten Test-User hinzufügen
80
+
81
+ **Lokal ohne Google testen?** Setze `auth.baseURL=http://localhost:4788` und melde dich ohne externe Auth an (Pibo akzeptiert auf Loopback auch direkten Zugriff). Für die VSCode-Extension reicht das zum Ausprobieren.
82
+
83
+ Verify:
84
+
85
+ ```bash
86
+ pibo config show
87
+ ```
88
+
89
+ ## 3. Gateway starten
90
+
91
+ In einem Terminal (das Terminal offen lassen):
92
+
93
+ ```bash
94
+ pibo gateway:web
95
+ ```
96
+
97
+ Erwartete Ausgabe (ungefähr):
98
+
99
+ ```text
100
+ [gateway:web] listening on http://127.0.0.1:4788
101
+ [gateway:web] auth baseURL = http://127.0.0.1:4788
102
+ ```
103
+
104
+ Im Browser öffnen: <http://127.0.0.1:4788>. Du solltest die Pibo-Web-Oberfläche sehen und dich einloggen können.
105
+
106
+ > Tipp: Wenn du das Gateway dauerhaft laufen lassen willst (z.B. auf einem
107
+ > Server), schau dir `pibo gateway web status/start/restart` an — das ist
108
+ > der produktive Pfad mit `pibo-web.service` dahinter.
109
+
110
+ ## 4. VS Code Extension installieren
111
+
112
+ Du hast zwei Wege.
113
+
114
+ ### Weg A: Über die CLI (empfohlen)
115
+
116
+ ```bash
117
+ pibo vscode install
118
+ ```
119
+
120
+ Das Script:
121
+
122
+ 1. Findet deine `code` (oder `code-insiders` / `codium`) Binary im PATH
123
+ 2. Lädt die neueste VSIX aus dem GitHub Release von `Pascapone/pibo`
124
+ 3. Installiert sie via `code --install-extension <vsix>`
125
+ 4. Verifiziert mit `code --list-extensions --show-versions`
126
+
127
+ Verify:
128
+
129
+ ```bash
130
+ pibo vscode status
131
+ ```
132
+
133
+ Erwartete Ausgabe:
134
+
135
+ ```text
136
+ extension: pibo.pibo-vscode@1.3.0 installed
137
+ binary: code (at /usr/bin/code)
138
+ latest: v1.3.0
139
+ cache: /home/<du>/.pibo/vscode/cache/v1.3.0/pibo.vsix
140
+ ```
141
+
142
+ ### Weg B: Über den VS Code Marketplace
143
+
144
+ 1. VS Code öffnen
145
+ 2. Sidebar → Extensions (`Ctrl+Shift+X` / `Cmd+Shift+X`)
146
+ 3. Suchen nach "Pibo" (Publisher: `pibo`)
147
+ 4. "Install" klicken
148
+
149
+ Falls die Extension noch nicht im Marketplace sichtbar ist, nimm Weg A — der lädt direkt aus dem GitHub Release.
150
+
151
+ ## 5. Erste Session in VS Code
152
+
153
+ 1. **VS Code öffnen**, einen Projektordner als Workspace laden
154
+ (z.B. `File → Open Folder` → irgendein Repo)
155
+ 2. **Pibo-Sidebar** öffnen: Klick auf das Pibo-Icon in der linken
156
+ Activity Bar (es heißt einfach "Pibo")
157
+ 3. Beim ersten Öffnen passiert automatisch:
158
+ - Die Extension mappt deinen Workspace-Folder auf einen Pibo-Room
159
+ - Falls noch kein Room existiert: einer wird angelegt
160
+ - Falls genau ein Room existiert: direkt rein
161
+ - Falls mehrere existieren: ein Room-Picker erscheint
162
+ 4. **Neue Session starten**: in der Sidebar auf "New Session" klicken
163
+ (oder Command Palette → `Pibo: New Session`)
164
+ 5. **Chatten**: im Composer Loss tippen, Enter
165
+
166
+ Die Session erscheint automatisch auch in der Web App unter
167
+ <http://127.0.0.1:4788> — und umgekehrt.
168
+
169
+ ## 6. Nützliche Kommandos
170
+
171
+ In der **Command Palette** (`Ctrl+Shift+P` / `Cmd+Shift+P`):
172
+
173
+ | Kommando | Was es tut |
174
+ |---|---|
175
+ | `Pibo: New Session` | Neue Session im aktuellen Room |
176
+ | `Pibo: Delete Current Session` | Aktuelle Session löschen |
177
+ | `Pibo: Rename Current Session` | Session umbenennen |
178
+ | `Pibo: Open in Chat Web` | Springt zur aktuellen Session im Browser |
179
+ | `Pibo: Sign In` | Login mit openai/anthropic/google Provider |
180
+
181
+ In der **CLI**:
182
+
183
+ | Kommando | Was es tut |
184
+ |---|---|
185
+ | `pibo vscode install` | Extension installieren / upgraden |
186
+ | `pibo vscode status` | Installations-Status prüfen |
187
+ | `pibo vscode uninstall` | Extension entfernen |
188
+ | `pibo vscode install --vsix <pfad>` | Lokale VSIX installieren (z.B. selbst gebaute) |
189
+ | `pibo vscode install --from-url <url>` | VSIX von beliebiger URL (z.B. internem Mirror) |
190
+ | `pibo vscode install --version v1.4.0` | Bestimmte Version installieren |
191
+ | `pibo config show` | Config anzeigen (Werte sind redacted) |
192
+ | `pibo data rooms` | Rooms / Workspaces anzeigen |
193
+ | `pibo debug session <id>` | Session-Details inspizieren |
194
+
195
+ ## 7. Konfiguration
196
+
197
+ Die Extension kennt folgende Einstellungen:
198
+
199
+ - **`pibo.chatWebUrl`** (default: `http://127.0.0.1:4788`)
200
+ → URL des laufenden Gateway. Anpassen, wenn dein Gateway woanders läuft
201
+ (anderer Port, LAN-IP, Tunnel, etc.). Per-Workspace oder global setzen.
202
+ - **`pibo.sidecar.port`** (default: `4789`)
203
+ → Loopback-Port für den eingebetteten Sidecar, der ab VS Code 1.117.0
204
+ die Web-App im Sidebar hostet. Wird automatisch auf einen freien
205
+ Loopback-Port umgestellt, wenn der Default belegt ist.
206
+ - **`pibo.sidecar.gatewayProbeTimeoutMs`** (default: `1500`)
207
+ → Timeout für die Erreichbarkeits-Probe des Gateway. Wenn die Probe
208
+ fehlschlägt, fällt die Sidebar auf den Empty-State-Shell zurück.
209
+
210
+ Ändern via:
211
+
212
+ - VS Code: Settings → "Pibo"
213
+ - JSON: `"pibo.chatWebUrl": "http://192.168.1.50:4788"` in `.vscode/settings.json`
214
+ - Env: `PIBO_CHAT_WEB_URL=http://...` (überschreibt alles)
215
+
216
+ ## 7a. Architektur (ab 1.4.0): Sidecar + Inlined SPA
217
+
218
+ VS Code ab 1.117.0 hat die Workbench-CSP für Webviews verschärft
219
+ (`frame-src 'self'`). Die ältere Sidebar-Implementierung hat das
220
+ Chat-vscode-SPA über `window.location.replace('http://127.0.0.1:4788/...')`
221
+ geladen — das wird seit 1.117.0 von der Workbench blockiert.
222
+
223
+ Die neue Architektur umgeht die Sperre, ohne die Workbench-CSP zu lockern:
224
+
225
+ 1. **Sidecar** — eine kleine Node.js HTTP-Server-Instanz im Extension-Host,
226
+ gebunden an `127.0.0.1:<port>` (Default 4789). Proxied `/api/...`-Calls
227
+ vom Webview zum Gateway, hält die dev-auth-Cookie-Session im Speicher
228
+ und streamt Antworten 1:1 (wichtig für SSE). Bindet ausschließlich auf
229
+ Loopback, erzwingt `vscode-webview://`-CORS, niemals extern erreichbar.
230
+ 2. **Port-Mapping** — VS Code routet Anfragen an
231
+ `https://<webviewId>.vscode-resource.vscode-cdn.net:<port>` intern
232
+ auf `http://127.0.0.1:<port>` weiter. Diese Origin ist in der
233
+ Workbench-`connect-src` whitelisted.
234
+ 3. **Inlined Bundle** — der gebaute Vite-Output (`assets/index-*.js`,
235
+ `assets/index-*.css`) wird in den Webview-HTML als `<script nonce=...>`
236
+ und `<style nonce=...>` inlined. Dadurch umgehen wir die strikte
237
+ `script-src`-Direktive der Workbench.
238
+ 4. **Health-Probe** — beim Webview-Setup prüft der Sidecar, ob das
239
+ Gateway erreichbar ist. Wenn ja, inlined SPA. Wenn nein, klassische
240
+ Empty-State-Shell mit `pibo gateway:web`-Hinweis.
241
+
242
+ Trade-offs und Sicherheitsanalyse stehen im Implementierungs-Plan
243
+ `docs/plans/vscode-webview-sidecar-implementation-plan-2026-06-15.md`.
244
+
245
+ ## 8. Troubleshooting
246
+
247
+ **"Gateway not available" / Sidebar zeigt Fehler**
248
+ → Ist `pibo gateway:web` gestartet? Auf `curl http://127.0.0.1:4788/api/chat/bootstrap` testen.
249
+
250
+ **Sidebar zeigt "Swap fehlgeschlagen: dev-auth handshake did not complete"**
251
+ → Du betreibst das Production-Gateway (Better Auth / Google OAuth). Die VS-Code-Extension hat keinen Browser, kann den OAuth-Flow nicht durchlaufen, und braucht den lokalen Dev-Auth-Flow. Lösung: `pibo gateway:web --auth=local` starten oder `pibo config set auth.mode local && pibo gateway:web`. Die Sidebar swapt dann automatisch von der Shell zur inlined SPA.
252
+
253
+ **Login funktioniert nicht**
254
+ → Google OAuth Client korrekt? Redirect-URI `http://127.0.0.1:4788/api/auth/callback/google` eingetragen? `pibo config show` zeigt deine Werte (redacted)?
255
+
256
+ **Extension findet das Gateway nicht**
257
+ → Andere URL? `pibo.chatWebUrl` Setting prüfen. Für andere Maschine: `--web-host 0.0.0.0` beim Start, dann `pibo.chatWebUrl=http://<lan-ip>:4788` setzen.
258
+
259
+ **Sidebar bleibt leer nach Workspace-Öffnen**
260
+ → In der Output-Panel → "Pibo" schauen. Steht dort der Grund? Meist: fehlender `code`-Binary auf PATH (Extension kann sich dann nicht installieren) oder Auth-Bridge-Problem.
261
+
262
+ **Updates installieren**
263
+ → `pibo vscode install` zieht die neueste GitHub-Release-VSIX. So upgrade-st du.
264
+
265
+ **Komplett zurücksetzen**
266
+ ```bash
267
+ pibo vscode uninstall
268
+ pibo vscode install
269
+ ```
270
+ Plus VS Code: `Developer: Reload Window`.
271
+
272
+ ## 9. Wo die Daten liegen
273
+
274
+ ```text
275
+ ~/.pibo/ Pibo-User-State
276
+ ├── config.json deine `pibo config set` Werte
277
+ ├── pibo.sqlite Sessions, Rooms, Events (geteilt mit Web)
278
+ └── vscode/cache/ VSIX-Cache pro Release-Tag
279
+ ├── v1.3.0/pibo.vsix
280
+ └── last-installed.json
281
+
282
+ <dein-workspace>/.pibo/ Workspace-scoped State
283
+ ├── PROMPTS.md Custom Prompts
284
+ └── pi-package.json Pi-Package-Registrierung
285
+ ```
286
+
287
+ Mehr Details: <https://github.com/Pascapone/pibo>