@each1024/pi-mini-mode 1.0.2 → 1.0.3
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 +8 -0
- package/README.zh-CN.md +8 -0
- package/lib/settings-web.ts +7 -2
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -27,6 +27,14 @@ In an open Pi session, run Pi's built-in `/reload` command. On first use, choose
|
|
|
27
27
|
|
|
28
28
|
**Pi ≥ 0.84.0.** Input enhancements and minimal output are on by default. Minimal mode uses a private **Pi 0.85.x** layout adapter—see [compatibility](#compatibility) before enabling it.
|
|
29
29
|
|
|
30
|
+
### Update an existing npm installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pi update npm:@each1024/pi-mini-mode
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Then run `/reload` in Pi and reopen `/pi-mini-mode-settings` (or restart Pi). The HTML settings page ships with the extension; no separate npm command or development server is needed. Publishing does not update users' installed copies or already-open browser tabs automatically. Pinned versions must first be replaced with the unversioned install command above; local development installs continue to use local files.
|
|
37
|
+
|
|
30
38
|
<details>
|
|
31
39
|
<summary>Install from GitHub instead</summary>
|
|
32
40
|
|
package/README.zh-CN.md
CHANGED
|
@@ -27,6 +27,14 @@ pi install npm:@each1024/pi-mini-mode
|
|
|
27
27
|
|
|
28
28
|
**需要 Pi ≥ 0.84.0。** 输入增强和极简输出默认开启。极简模式使用私有 **Pi 0.85.x** 布局适配器,启用前请查看[兼容性](#兼容性)。
|
|
29
29
|
|
|
30
|
+
### 更新已安装的 npm 版本
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pi update npm:@each1024/pi-mini-mode
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
然后在 Pi 中运行 `/reload`,重新打开 `/pi-mini-mode-settings`(或重启 Pi)。HTML 设置页随扩展一起更新,不需要另外执行 npm 命令或启动开发服务器。发布本身不会自动更新用户已安装的副本或已打开的浏览器标签页。固定版本用户需先用上面的不带版本号安装命令替换安装;本地开发安装仍读取本地文件。
|
|
37
|
+
|
|
30
38
|
<details>
|
|
31
39
|
<summary>也可以从 GitHub 安装</summary>
|
|
32
40
|
|
package/lib/settings-web.ts
CHANGED
|
@@ -26,7 +26,6 @@ function configuredIdleTimeout(override: number | undefined): number {
|
|
|
26
26
|
/** On-demand, loopback-only settings bridge; no polling or third-party runtime. */
|
|
27
27
|
export async function startSettingsWeb(snapshot: () => unknown, update: (value: unknown) => Promise<void>, options: SettingsWebOptions = {}) {
|
|
28
28
|
const token = randomBytes(24).toString("hex");
|
|
29
|
-
const html = await readFile(new URL("./settings.html", import.meta.url));
|
|
30
29
|
const idleTimeoutMs = configuredIdleTimeout(options.idleTimeoutMs);
|
|
31
30
|
let origin = "";
|
|
32
31
|
let queue = Promise.resolve();
|
|
@@ -63,7 +62,13 @@ export async function startSettingsWeb(snapshot: () => unknown, update: (value:
|
|
|
63
62
|
res.writeHead(403).end(); return;
|
|
64
63
|
}
|
|
65
64
|
if (req.url === "/" && req.method === "GET") {
|
|
66
|
-
|
|
65
|
+
try {
|
|
66
|
+
const html = await readFile(new URL("./settings.html", import.meta.url));
|
|
67
|
+
res.setHeader("Content-Type", "text/html; charset=utf-8"); res.end(html);
|
|
68
|
+
} catch {
|
|
69
|
+
res.writeHead(503).end("Settings page unavailable. Reload Pi and reopen settings.");
|
|
70
|
+
}
|
|
71
|
+
return;
|
|
67
72
|
}
|
|
68
73
|
if (req.url !== "/settings" || req.headers.authorization !== `Bearer ${token}`) {
|
|
69
74
|
res.writeHead(403).end(); return;
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@each1024/pi-mini-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "A compact Pi footer with live usage metrics, theme-aware settings previews, and configurable progress bars.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"check": "tsc --noEmit -p tsconfig.json",
|
|
8
|
-
"test": "node test/settings-web.mjs && node test/footer-tidy.mjs && node test/footer-status-self-check.mjs && node test/settings-interaction.mjs && node test/transcript-adapter.mjs && node test/prompt-folding.mjs && node test/tool-folding.mjs && node test/sticky-tool.mjs && node test/minimal-markdown.mjs && node test/agent-view.mjs && node test/publish-self-check.mjs && node test/compaction-transcript.mjs && node test/input-enhancements.mjs && node test/user-message-surface.mjs"
|
|
8
|
+
"test": "node test/settings-web.mjs && node test/footer-tidy.mjs && node test/footer-status-self-check.mjs && node test/settings-interaction.mjs && node test/transcript-adapter.mjs && node test/prompt-folding.mjs && node test/tool-folding.mjs && node test/sticky-tool.mjs && node test/minimal-markdown.mjs && node test/agent-view.mjs && node test/publish-self-check.mjs && node test/compaction-transcript.mjs && node test/input-enhancements.mjs && node test/user-message-surface.mjs && node test/settings-package.mjs",
|
|
9
|
+
"prepublishOnly": "npm run check && npm test"
|
|
9
10
|
},
|
|
10
11
|
"license": "MIT",
|
|
11
12
|
"author": "eachann1024",
|