@firstpick/pi-package-webui 0.7.9 → 0.8.1
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 +32 -9
- package/bin/pi-webui.mjs +750 -113
- package/lib/git-workflow-preferences.mjs +16 -0
- package/lib/git-worktrees.mjs +43 -4
- package/lib/npm-command.mjs +81 -0
- package/lib/queue-mutation.mjs +6 -0
- package/lib/workspace-files-live-watcher.mjs +138 -0
- package/package.json +11 -4
- package/public/app.js +3397 -380
- package/public/index.html +119 -20
- package/public/mobile-shell-state.mjs +166 -0
- package/public/service-worker.js +60 -13
- package/public/styles.css +1066 -362
- package/public/subagent-gate-visibility.mjs +16 -0
- package/public/subagent-launch-slot-state.mjs +16 -0
- package/public/transcript-renderer.mjs +433 -0
- package/tests/boot-failure-diagnostics.test.mjs +3 -3
- package/tests/browser/interaction-continuity.spec.mjs +739 -0
- package/tests/browser/mobile-foundation.spec.mjs +352 -0
- package/tests/browser/optimistic-prompt.spec.mjs +130 -0
- package/tests/chat-scroll-intent-static.test.mjs +6 -1
- package/tests/codex-fast-mode-static.test.mjs +59 -0
- package/tests/compact-sections-static.test.mjs +20 -2
- package/tests/compaction-mutation-contract.test.mjs +18 -4
- package/tests/compaction-static.test.mjs +1 -0
- package/tests/completion-signal-contract.test.mjs +13 -2
- package/tests/composer-skill-tag-layout.test.mjs +70 -0
- package/tests/fast-mode-client-static.test.mjs +14 -11
- package/tests/fixtures/fake-pi.mjs +222 -2
- package/tests/git-panel-gitignore-static.test.mjs +104 -0
- package/tests/git-workflow-preferences.test.mjs +8 -0
- package/tests/guided-git-publication-backend-static.test.mjs +40 -0
- package/tests/http-endpoints-harness.test.mjs +490 -3
- package/tests/interaction-state-stability-static.test.mjs +254 -0
- package/tests/mobile-continuity-tablet-static.test.mjs +55 -0
- package/tests/mobile-foundation-static.test.mjs +69 -0
- package/tests/mobile-phone-experience-static.test.mjs +65 -0
- package/tests/mobile-shell-state.test.mjs +69 -0
- package/tests/mobile-static.test.mjs +300 -43
- package/tests/mobile-transcript-cache-characterization.test.mjs +34 -0
- package/tests/npm-command.test.mjs +64 -1
- package/tests/open-issue-wizard-static.test.mjs +2 -1
- package/tests/queue-edit-reorder-static.test.mjs +9 -1
- package/tests/queue-mutation-contract.test.mjs +22 -0
- package/tests/service-worker-lifecycle.test.mjs +120 -0
- package/tests/side-panel-resize-static.test.mjs +8 -1
- package/tests/sse-backpressure-harness.test.mjs +98 -0
- package/tests/streaming-ui-coupling.test.mjs +7 -1
- package/tests/subagent-gate-visibility.test.mjs +18 -2
- package/tests/subagent-launch-slot-state.test.mjs +32 -0
- package/tests/subagent-launch-slots-static.test.mjs +8 -2
- package/tests/subagents-helper.test.mjs +90 -0
- package/tests/terminal-tab-workspace-static.test.mjs +1 -1
- package/tests/update-commands.test.mjs +4 -0
- package/tests/workspace-files-live-updates-static.test.mjs +76 -0
- package/tests/workspace-files-live-watcher.test.mjs +95 -0
- package/webui-rpc-helper.mjs +175 -3
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
GIT_WORKFLOW_SETUP_VERSION,
|
|
7
7
|
gitWorkflowPreferencesSummary,
|
|
8
8
|
isGitWorkflowSetupComplete,
|
|
9
|
+
normalizeInterfacePreferences,
|
|
9
10
|
readGitWorkflowPreferences,
|
|
10
11
|
readWebuiSettings,
|
|
11
12
|
supportedGitWorkflowThinkingLevels,
|
|
@@ -24,6 +25,10 @@ assert.deepEqual(
|
|
|
24
25
|
["off", "low", "medium", "high", "max"],
|
|
25
26
|
"null map entries should be hidden while explicit extended levels remain available",
|
|
26
27
|
);
|
|
28
|
+
assert.deepEqual(normalizeInterfacePreferences({}), { sidePanelWidth: null });
|
|
29
|
+
assert.deepEqual(normalizeInterfacePreferences({ sidePanelWidth: 617.6 }), { sidePanelWidth: 618 });
|
|
30
|
+
assert.deepEqual(normalizeInterfacePreferences({ sidePanelWidth: 10 }), { sidePanelWidth: 320 });
|
|
31
|
+
assert.deepEqual(normalizeInterfacePreferences({ sidePanelWidth: 9000 }), { sidePanelWidth: 4096 });
|
|
27
32
|
|
|
28
33
|
const root = await mkdtemp(path.join(tmpdir(), "pi-webui-git-preferences-"));
|
|
29
34
|
const settingsFile = path.join(root, "settings.json");
|
|
@@ -62,6 +67,7 @@ try {
|
|
|
62
67
|
tools: { enabledTools: ["read", " write ", "read", ""] },
|
|
63
68
|
skills: { enabledSkills: ["repo-explorer", "code-security"] },
|
|
64
69
|
},
|
|
70
|
+
interfacePreferences: { sidePanelWidth: 612 },
|
|
65
71
|
}, settingsFile);
|
|
66
72
|
|
|
67
73
|
const partiallyUpdated = await writeGitWorkflowPreferences({ deliveryMode: "current" }, settingsFile);
|
|
@@ -76,6 +82,8 @@ try {
|
|
|
76
82
|
assert.equal(persisted.gitWorkflow.generation.provider, "fake");
|
|
77
83
|
assert.deepEqual(persisted.resourceDefaults.tools.enabledTools, ["read", "write"], "global tool defaults should be normalized and deduplicated");
|
|
78
84
|
assert.deepEqual(persisted.resourceDefaults.skills.enabledSkills, ["repo-explorer", "code-security"], "global skill defaults should persist beside other Web UI settings");
|
|
85
|
+
assert.equal(persisted.interfacePreferences.sidePanelWidth, 612, "the user-scoped Control Deck width should persist beside other Web UI settings");
|
|
86
|
+
assert.equal((await readWebuiSettings(settingsFile)).interfacePreferences.sidePanelWidth, 612);
|
|
79
87
|
assert.match(gitWorkflowPreferencesSummary(await readGitWorkflowPreferences(settingsFile)), /fake\/fake-model/);
|
|
80
88
|
if (process.platform !== "win32") assert.equal((await stat(settingsFile)).mode & 0o777, 0o600);
|
|
81
89
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
|
|
4
|
+
const server = await readFile(new URL("../bin/pi-webui.mjs", import.meta.url), "utf8");
|
|
5
|
+
|
|
6
|
+
assert.match(
|
|
7
|
+
server,
|
|
8
|
+
/if \(push && \/fatal:\\s\+no configured push destination\\\.\/\.test\(text\)\) \{\s*return \{ code: "NO_REMOTE", hint: NO_REMOTE_HINT \};/,
|
|
9
|
+
"only Git's explicit no-push-destination failure should receive NO_REMOTE classification",
|
|
10
|
+
);
|
|
11
|
+
assert.doesNotMatch(
|
|
12
|
+
server,
|
|
13
|
+
/does not appear to be a git repository[\s\S]{0,160}NO_REMOTE|NO_REMOTE[\s\S]{0,160}does not appear to be a git repository/,
|
|
14
|
+
"an invalid configured remote must not be reclassified as remote-less",
|
|
15
|
+
);
|
|
16
|
+
assert.match(
|
|
17
|
+
server,
|
|
18
|
+
/const GIT_WORKFLOW_MUTATING_PATHS = new Set\(\[[\s\S]*"\/api\/git-workflow\/publish"[\s\S]*\]\);/,
|
|
19
|
+
"publication must use the POST-only mutating workflow allowlist",
|
|
20
|
+
);
|
|
21
|
+
assert.match(
|
|
22
|
+
server,
|
|
23
|
+
/case "\/api\/git-workflow\/publish": \{[\s\S]*cleanGitHubRepoName\(body\.repoName\)[\s\S]*visibility !== "public" && visibility !== "private"[\s\S]*requireConfirmed\(body,[\s\S]*getGitRoot\(cwd\)[\s\S]*gitRemoteNames\(root\)[\s\S]*remotes\.length[\s\S]*currentGitBranch\(root\)/,
|
|
24
|
+
"the server must validate name/visibility/confirmation and refuse existing-remote repair before publication",
|
|
25
|
+
);
|
|
26
|
+
assert.match(
|
|
27
|
+
server,
|
|
28
|
+
/runGitHubWorkflowCommand\(\s*\["repo", "create", repoName, `--\$\{visibility\}`, "--source", root, "--remote", "origin", "--push"\],[\s\S]*timeoutMs: 15 \* 60 \* 1000/,
|
|
29
|
+
"publication must run the approved non-interactive gh repo create command through the bounded workflow runner",
|
|
30
|
+
);
|
|
31
|
+
assert.match(
|
|
32
|
+
server,
|
|
33
|
+
/if \(payload\.ok\) Object\.assign\(payload\.data, \{ repoName, visibility, remote: "origin", branch, protectedBranch \}\);/,
|
|
34
|
+
"successful publication must extend the process envelope with the approved metadata",
|
|
35
|
+
);
|
|
36
|
+
assert.match(server, /payload\.code = "AUTH";[\s\S]*gh auth login/, "gh authentication failures should receive an actionable AUTH hint");
|
|
37
|
+
assert.match(server, /name already exists on this account\|repository \.\+ already exists[\s\S]*Choose another repository name/, "safe name-conflict output should receive a retry hint");
|
|
38
|
+
assert.match(server, /GH_PROMPT_DISABLED: process\.env\.GH_PROMPT_DISABLED \|\| "1"/, "gh publication must inherit disabled interactive prompts");
|
|
39
|
+
|
|
40
|
+
console.log("guided git publication backend static tests passed");
|