From 8b12596cace6ca243c29e9c5baf01e6a91835207 Mon Sep 17 00:00:00 2001 From: Sam Rolfe Date: Sun, 6 Sep 2026 16:39:29 +1000 Subject: [PATCH] nixos-workflow: replace pi-langfuse worked example with generic npm-extension example; note removal procedure --- skills/nixos-workflow/SKILL.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/skills/nixos-workflow/SKILL.md b/skills/nixos-workflow/SKILL.md index 240bf13..9c9687e 100644 --- a/skills/nixos-workflow/SKILL.md +++ b/skills/nixos-workflow/SKILL.md @@ -47,17 +47,17 @@ When the user asks for a new tool or skill, you MUST follow these steps exactly: - Project settings **replace** (not merge) global settings — each folder loads only what it needs, keeping the LLM context lean. This is the point of the whole workflow: no clutter. - **Global-only packages** (e.g. pi-memctx, @tintinweb/*) are NOT per-project assets — they live in the home-manager-managed global `~/.pi/agent/settings.json` (`/etc/nixos/home/sam/home.nix`) and are out of scope for `/config-add`. -## ✅ WORKED EXAMPLE — adding `pi-langfuse` (2026-08-03) +## ✅ WORKED EXAMPLE — adding an external npm extension -External npm extension (Langfuse LLM observability for pi) vendored + activated: +External npm extension vendored + activated (standard path for any published pi extension): -1. `npm pack pi-langfuse@1.5.8` → extracted into `~/.agents/extensions/pi-langfuse/` (contains `package.json` with `pi.extensions: ["./index.ts"]`) +1. `npm pack @` → extract into `~/.agents/extensions//` (a pi-aware package contains `package.json` with `"pi": { "extensions": ["./index.ts"] }`) 2. `npm install` inside the folder (deps gitignored; pi reinstalls on pull) -3. `vet scan -D .` → clean (242 packages) -4. `git add . && git commit && git push` → Gitea `pi-config` (commit `bc91a15`) -5. Project activation: `/config-add ext pi-langfuse` → writes `"extensions/pi-langfuse/index.ts"` to the project's `.pi/settings.json`, then `/reload` +3. `vet scan -D .` → clean +4. `git add . && git commit && git push` → Gitea `pi-config` +5. Project activation: `/config-add ext ` → writes `"extensions//index.ts"` to the project's `.pi/settings.json`, then `/reload` -The extension's own config lives at `~/.pi/agent/pi-langfuse/config.json` (`publicKey`/`secretKey`/`host` → `http://192.168.20.13:3001`). Commands: `/langfuse-setup`, `/langfuse-status`. Full documentation: `/home/sam/obsidian/300 areas/350 AI/Pi Agent Extensions & Skills.md` (section "pi-langfuse — LLM Observability for Pi"). +⚠️ Removing an unwanted extension: delete the directory, push the removal to Gitea, and run `/config-remove ext ` on any project that still lists it (a stale path in settings is harmless — pi just reports it missing). ## ⚠️ VENDORING PITFALL — vscode-languageserver-protocol subpath `pi-lsp-extension` (and possibly other extensions) imports `vscode-languageserver-protocol/node.js`. npm resolves `^3.17.5` to 3.18.x whose `exports` map exposes `./node` but **not** `./node.js` — the import throws at load and the ENTIRE extension silently fails (no `/lsp` commands appear, while other extensions still load — confusing). Fix: change the import to `vscode-languageserver-protocol/node` (no `.js`); re-apply whenever re-vendoring from npm (our fix = commit `57c5cd2`).