@firstpick/pi-package-webui 0.4.3 → 0.4.5
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.
- package/README.md +4 -2
- package/bin/pi-webui.mjs +28 -8
- package/package.json +6 -4
- package/public/app.js +528 -4
- package/public/index.html +11 -2
- package/public/styles.css +146 -1
- package/tests/fixtures/fake-pi.mjs +0 -0
- package/tests/mobile-static.test.mjs +34 -9
- package/tests/native-parity-harness.test.mjs +1 -1
- package/tests/native-parity.test.mjs +2 -2
- package/start-webui.ps1 +0 -368
- package/start-webui.sh +0 -472
- /package/{WEBUI_TUI_NATIVE_PARITY.json → dev/docs/WEBUI_TUI_NATIVE_PARITY.json} +0 -0
package/README.md
CHANGED
|
@@ -139,7 +139,7 @@ Environment variables:
|
|
|
139
139
|
- Side-panel theme picker backed by optional `@firstpick/pi-themes-bundle` themes when loaded.
|
|
140
140
|
- Per-tab cwd changes, a clickable footer cwd picker, saved path fast picks, server-persisted fast picks, and restart-safe restoration of open tabs.
|
|
141
141
|
- Detected app runner dropdown for the active tab cwd, including Cargo, Bun, npm/npx/pnpm, Python/uv, Go/Golang, Zig, C/C++, Docker Compose, root/dev/scripts shell scripts, and other common project runners with live output pinned at the top of the terminal. Projects can add browseable custom runners in `.pi-webui-runners.json` with a command (default `./`) plus a relative path to the file to run.
|
|
142
|
-
- Browser support for Pi extension UI prompts, widgets, status updates, browser notifications when a tab needs an extension UI response and an optional side-panel toggle for agent-done notifications.
|
|
142
|
+
- Browser support for Pi extension UI prompts, widgets, status updates, `/btw` side-question output widgets with optional context transfer/live steering, browser notifications when a tab needs an extension UI response, and an optional side-panel toggle for agent-done notifications.
|
|
143
143
|
- Localhost-only Pi/Web UI update checks with a top-right update notification and a confirmed **Update & restart** action that runs `pi update` plus all detected local/global Web UI and Pi package-manager updates, then restarts the Web UI server.
|
|
144
144
|
- Feedback reactions (`👍`, `👎`, `?`) on final assistant output plus tool/bash action cards, which can ask Pi to create or update a LEARNING.
|
|
145
145
|
- Mobile-friendly layout and PWA install support where the browser allows it.
|
|
@@ -156,7 +156,7 @@ Useful browser endpoints exposed by the local server include:
|
|
|
156
156
|
For local development, run the checkout helper directly, for example:
|
|
157
157
|
|
|
158
158
|
```bash
|
|
159
|
-
./start-webui.sh --dev --cwd /path/to/project
|
|
159
|
+
./dev/scripts/start-webui.sh --dev --cwd /path/to/project
|
|
160
160
|
```
|
|
161
161
|
|
|
162
162
|
Run `../dev/scripts/sync-pi-package-symlinks.sh` first when developing companion packages from this workspace. The Web UI manifest loads companions through `node_modules/` paths, and the sync script links those paths to the top-level dev packages so only one copy is loaded.
|
|
@@ -169,9 +169,11 @@ When the standalone global `pi-webui` launcher is used, optional companion insta
|
|
|
169
169
|
|
|
170
170
|
Optional companions:
|
|
171
171
|
|
|
172
|
+
- `@firstpick/pi-extension-btw` — ephemeral `/btw` side-question command with a TUI overlay, Web UI live output widget, and Transfer Context action.
|
|
172
173
|
- `@firstpick/pi-prompts-git-pr` — guided Git commit/push workflow.
|
|
173
174
|
- `@firstpick/pi-extension-release-npm` — NPM publish menu and release widgets.
|
|
174
175
|
- `@firstpick/pi-extension-release-aur` — AUR publish menu and release widgets.
|
|
176
|
+
- `@firstpick/pi-extension-workflows` — `/workflow` runtime with non-blocking Web UI subprocess-output widgets.
|
|
175
177
|
- `@firstpick/pi-extension-safety-guard` — interactive guardrails for dangerous bash commands and protected file edits.
|
|
176
178
|
- `@firstpick/pi-extension-setup-skills` — TUI `/skills` setup command alongside WebUI-native skill toggles.
|
|
177
179
|
- `@firstpick/pi-extension-todo-progress` — todo-progress rendering.
|
package/bin/pi-webui.mjs
CHANGED
|
@@ -52,7 +52,7 @@ try {
|
|
|
52
52
|
} catch {
|
|
53
53
|
piPackageJson = {};
|
|
54
54
|
}
|
|
55
|
-
const nativeParityMatrix = JSON.parse(await readFile(path.join(packageRoot, "WEBUI_TUI_NATIVE_PARITY.json"), "utf8"));
|
|
55
|
+
const nativeParityMatrix = JSON.parse(await readFile(path.join(packageRoot, "dev", "docs", "WEBUI_TUI_NATIVE_PARITY.json"), "utf8"));
|
|
56
56
|
const webuiDevServer = isTruthyEnv(process.env.PI_WEBUI_DEV) || isSourceCheckout(packageRoot);
|
|
57
57
|
|
|
58
58
|
const DEFAULT_HOST = "127.0.0.1";
|
|
@@ -221,9 +221,11 @@ function parseSlashCommand(message) {
|
|
|
221
221
|
return parseNativeSlashCommand(message, NATIVE_SLASH_COMMAND_NAMES);
|
|
222
222
|
}
|
|
223
223
|
const OPTIONAL_FEATURE_PACKAGES = new Map([
|
|
224
|
+
["btwCommand", "@firstpick/pi-extension-btw"],
|
|
224
225
|
["gitWorkflow", "@firstpick/pi-prompts-git-pr"],
|
|
225
226
|
["releaseNpm", "@firstpick/pi-extension-release-npm"],
|
|
226
227
|
["releaseAur", "@firstpick/pi-extension-release-aur"],
|
|
228
|
+
["workflows", "@firstpick/pi-extension-workflows"],
|
|
227
229
|
["safetyGuard", "@firstpick/pi-extension-safety-guard"],
|
|
228
230
|
["tuiSkillsCommand", "@firstpick/pi-extension-setup-skills"],
|
|
229
231
|
["todoProgressWidget", "@firstpick/pi-extension-todo-progress"],
|
|
@@ -4367,6 +4369,22 @@ function isNodeScriptCommand(command) {
|
|
|
4367
4369
|
return [".cjs", ".js", ".mjs"].includes(path.extname(String(command || "")).toLowerCase());
|
|
4368
4370
|
}
|
|
4369
4371
|
|
|
4372
|
+
async function resolvedPiCliScript() {
|
|
4373
|
+
const packagePathParts = PI_CODING_AGENT_PACKAGE.split("/").filter(Boolean);
|
|
4374
|
+
const searchRoots = require.resolve.paths(PI_CODING_AGENT_PACKAGE) || [];
|
|
4375
|
+
for (const nodeModulesRoot of searchRoots) {
|
|
4376
|
+
const cliPath = path.join(nodeModulesRoot, ...packagePathParts, "dist", "cli.js");
|
|
4377
|
+
try {
|
|
4378
|
+
await access(cliPath);
|
|
4379
|
+
return cliPath;
|
|
4380
|
+
} catch {
|
|
4381
|
+
// Continue through Node's resolution roots; global npm installs can hoist
|
|
4382
|
+
// pi-coding-agent beside pi-package-webui instead of nesting it.
|
|
4383
|
+
}
|
|
4384
|
+
}
|
|
4385
|
+
return "";
|
|
4386
|
+
}
|
|
4387
|
+
|
|
4370
4388
|
async function resolvePiCommand(piArgs) {
|
|
4371
4389
|
if (options.piBinExplicit) {
|
|
4372
4390
|
if (isNodeScriptCommand(options.piBin)) {
|
|
@@ -4379,17 +4397,16 @@ async function resolvePiCommand(piArgs) {
|
|
|
4379
4397
|
return { command: options.piBin, args: piArgs, displayCommand: `${options.piBin} ${piArgs.join(" ")}` };
|
|
4380
4398
|
}
|
|
4381
4399
|
|
|
4382
|
-
const bundledCli =
|
|
4383
|
-
|
|
4384
|
-
await access(bundledCli);
|
|
4400
|
+
const bundledCli = await resolvedPiCliScript();
|
|
4401
|
+
if (bundledCli) {
|
|
4385
4402
|
return {
|
|
4386
4403
|
command: process.execPath,
|
|
4387
4404
|
args: [bundledCli, ...piArgs],
|
|
4388
4405
|
displayCommand: `${process.execPath} ${bundledCli} ${piArgs.join(" ")}`,
|
|
4389
4406
|
};
|
|
4390
|
-
} catch {
|
|
4391
|
-
return { command: options.piBin, args: piArgs, displayCommand: `${options.piBin} ${piArgs.join(" ")}` };
|
|
4392
4407
|
}
|
|
4408
|
+
|
|
4409
|
+
return { command: options.piBin, args: piArgs, displayCommand: `${options.piBin} ${piArgs.join(" ")}` };
|
|
4393
4410
|
}
|
|
4394
4411
|
|
|
4395
4412
|
const tabs = new Map();
|
|
@@ -5077,7 +5094,8 @@ async function getUpdateStatus({ force = false } = {}) {
|
|
|
5077
5094
|
|
|
5078
5095
|
async function resolvePiUpdateCommand() {
|
|
5079
5096
|
if (options.piBinExplicit) {
|
|
5080
|
-
|
|
5097
|
+
const command = await resolvePiCommand(["update"]);
|
|
5098
|
+
return { ...command, label: "Pi CLI and configured packages" };
|
|
5081
5099
|
}
|
|
5082
5100
|
|
|
5083
5101
|
const pathPi = await runCommand(options.piBin, ["--version"], { timeoutMs: 3000, maxOutputLength: 4000 });
|
|
@@ -5380,8 +5398,10 @@ function renameTab(tab, title, { source = "explicit", maxLength, unique = source
|
|
|
5380
5398
|
}
|
|
5381
5399
|
|
|
5382
5400
|
function maybeNameTabForConversation(tab, command) {
|
|
5383
|
-
if (!tab || !commandStartsConversation(command)
|
|
5401
|
+
if (!tab || !commandStartsConversation(command)) return false;
|
|
5402
|
+
const shouldRename = !tab.conversationStarted && tab.titleSource !== "explicit";
|
|
5384
5403
|
tab.conversationStarted = true;
|
|
5404
|
+
if (!shouldRename) return false;
|
|
5385
5405
|
const title = generatedTabTitleFromPrompt(command.message) || `Conversation ${tab.index}`;
|
|
5386
5406
|
return renameTab(tab, title, { source: "auto", maxLength: AUTO_TAB_TITLE_MAX_LENGTH });
|
|
5387
5407
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firstpick/pi-package-webui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "Pi Web UI companion package with a local browser UI CLI plus /webui-start and /webui-status commands.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/Firstp1ck/npm-packages/tree/main/pi-package-webui#readme",
|
|
@@ -23,9 +23,11 @@
|
|
|
23
23
|
"image": "https://unpkg.com/@firstpick/pi-package-webui/images/WebUI_v0.3.7.png",
|
|
24
24
|
"extensions": [
|
|
25
25
|
"./index.ts",
|
|
26
|
+
"node_modules/@firstpick/pi-extension-btw/index.ts",
|
|
26
27
|
"node_modules/@firstpick/pi-extension-git-footer-status/index.ts",
|
|
27
28
|
"node_modules/@firstpick/pi-extension-release-aur/index.ts",
|
|
28
29
|
"node_modules/@firstpick/pi-extension-release-npm/index.ts",
|
|
30
|
+
"node_modules/@firstpick/pi-extension-workflows/index.ts",
|
|
29
31
|
"node_modules/@firstpick/pi-extension-safety-guard/index.ts",
|
|
30
32
|
"node_modules/@firstpick/pi-extension-setup-skills/index.ts",
|
|
31
33
|
"node_modules/@firstpick/pi-extension-stats/index.ts",
|
|
@@ -54,6 +56,7 @@
|
|
|
54
56
|
"@earendil-works/pi-coding-agent": "^0.79.3"
|
|
55
57
|
},
|
|
56
58
|
"optionalDependencies": {
|
|
59
|
+
"@firstpick/pi-extension-btw": "^0.1.0",
|
|
57
60
|
"@firstpick/pi-extension-git-footer-status": "^0.3.3",
|
|
58
61
|
"@firstpick/pi-extension-release-aur": "^0.1.6",
|
|
59
62
|
"@firstpick/pi-extension-release-npm": "^0.4.0",
|
|
@@ -62,6 +65,7 @@
|
|
|
62
65
|
"@firstpick/pi-extension-stats": "^0.2.6",
|
|
63
66
|
"@firstpick/pi-extension-todo-progress": "^0.2.4",
|
|
64
67
|
"@firstpick/pi-extension-tools": "^0.1.6",
|
|
68
|
+
"@firstpick/pi-extension-workflows": "^0.1.0",
|
|
65
69
|
"@firstpick/pi-package-remote-webui": "^0.1.0",
|
|
66
70
|
"@firstpick/pi-prompts-git-pr": "^0.1.2",
|
|
67
71
|
"@firstpick/pi-themes-bundle": "^0.1.4"
|
|
@@ -74,9 +78,7 @@
|
|
|
74
78
|
"public",
|
|
75
79
|
"images",
|
|
76
80
|
"tests",
|
|
77
|
-
"
|
|
78
|
-
"start-webui.ps1",
|
|
79
|
-
"WEBUI_TUI_NATIVE_PARITY.json",
|
|
81
|
+
"dev/docs/WEBUI_TUI_NATIVE_PARITY.json",
|
|
80
82
|
"README.md",
|
|
81
83
|
"LICENSE"
|
|
82
84
|
],
|