@narumitw/pi-webui 0.22.0 โ†’ 0.28.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 (3) hide show
  1. package/README.md +17 -16
  2. package/package.json +2 -2
  3. package/src/index.ts +1 -0
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # ๐ŸŒ pi-webui โ€” Current-session Web Companion for Pi
2
2
 
3
- [![npm](https://img.shields.io/npm/v/@narumitw/pi-webui)](https://www.npmjs.com/package/@narumitw/pi-webui) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)
3
+ [![npm](https://img.shields.io/npm/v/@narumitw/pi-webui)](https://www.npmjs.com/package/@narumitw/pi-webui) [![Pi extension](https://img.shields.io/badge/Pi-extension-blue)](https://pi.dev) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)
4
4
 
5
5
  `@narumitw/pi-webui` adds a private, lightweight browser companion to the current terminal-owned [Pi Coding Agent](https://pi.dev) session. It displays Pi's semantic conversation and tool activity as they happen and can send text or sanitized images back into that same session.
6
6
 
7
7
  This package is intentionally different from the broader, separately maintained `@narumitw/pi-web` application. WebUI has one current-session chat page and no session manager, shell, file browser, git UI, control room, or task board.
8
8
 
9
- ## Features
9
+ ## โœจ Features
10
10
 
11
11
  - Streams current-branch user and assistant messages, assistant text updates, tool activity/results, errors, and busy/idle state over Server-Sent Events.
12
12
  - Renders a safe Markdown subset for headings, lists, emphasis, code, blockquotes, and HTTP(S) links without executing model-provided HTML.
@@ -18,7 +18,7 @@ This package is intentionally different from the broader, separately maintained
18
18
  - Keeps a failed browser draft and prevents rapid duplicate submission with request IDs.
19
19
  - Uses no frontend framework, build step, browser storage, remote service, or automatically launched browser.
20
20
 
21
- ## Install
21
+ ## ๐Ÿ“ฆ Install
22
22
 
23
23
  ```bash
24
24
  pi install npm:@narumitw/pi-webui
@@ -34,7 +34,7 @@ just try webui
34
34
 
35
35
  The package targets the latest Pi release.
36
36
 
37
- ## Usage
37
+ ## ๐Ÿš€ Usage
38
38
 
39
39
  1. Start Pi in a terminal and run `/webui`.
40
40
  2. Open the one-time `http://127.0.0.1:<port>/bootstrap?...` link shown by Pi. The extension does not open a browser itself.
@@ -44,7 +44,7 @@ The package targets the latest Pi release.
44
44
 
45
45
  If another installed extension also registers `/webui`, Pi assigns numeric command suffixes according to extension load order. Check Pi's command provenance and invoke the WebUI entry.
46
46
 
47
- ## Commands
47
+ ## ๐Ÿ’ฌ Commands
48
48
 
49
49
  | Command | Behavior |
50
50
  | --- | --- |
@@ -56,7 +56,7 @@ If another installed extension also registers `/webui`, Pi assigns numeric comma
56
56
 
57
57
  Argument completion is available for all subcommands. Bare `/webui` remains the direct browser-link action.
58
58
 
59
- ## Settings
59
+ ## โš™๏ธ Settings
60
60
 
61
61
  WebUI has one optional, **global-only** JSON settings file:
62
62
 
@@ -100,13 +100,13 @@ Settings are reloaded on every `session_start`. Changes made in `/webui settings
100
100
 
101
101
  In print, JSON, and RPC modes, `/webui settings` does not open custom TUI or write protocol-breaking output. Use `/webui status`, `/webui help`, or edit the reported path manually.
102
102
 
103
- ## What synchronization means
103
+ ## ๐Ÿ”„ What synchronization means
104
104
 
105
105
  WebUI mirrors Pi's semantic session events, not terminal pixels. It displays conversation content, streaming assistant state, tool calls/results, errors, and activity using browser-native presentation. It does not reproduce ANSI colors, terminal wrapping, footer/widgets, built-in dialogs, arbitrary custom TUI components, or unsent terminal editor text.
106
106
 
107
107
  The initial transcript comes from the active session branch. Unsent browser message text and ordered attachment references are authoritative in the live Pi process, so refresh, reconnect, and active-tab takeover restore the same draft without creating a second transcript or altering Pi's session tree. Text edits are revisioned and saved with bounded, deduplicated mutations; stale or delayed responses cannot overwrite newer typing.
108
108
 
109
- ## Images
109
+ ## ๐Ÿ–ผ๏ธ Images
110
110
 
111
111
  | Input | Provider-ready output |
112
112
  | --- | --- |
@@ -129,7 +129,7 @@ Pi's effective global and trusted-project `images.autoResize` and `images.blockI
129
129
 
130
130
  When `retainSentImages` is enabled, only provider-ready sanitized bytes transfer into a separate session-memory store after Pi accepts the matching browser message. Content-identical sanitized images share one opaque session reference. Oldest entries are evicted first when either retention ceiling is exceeded. WebUI also reconciles retained, current-draft, and conservative in-flight processing bytes against one aggregate resident-image budget (the larger of the configured retention byte ceiling and the staging store's maximum working set), evicting sent entries before that aggregate can grow. Eligible transcript image chips offer **Attach again** and **Forget**; evicted or forgotten references read **Expired**, and terminal-origin images never gain those actions. Attach again clones the retained bytes into the current authoritative draft, reuses normal count/byte admission, and never mutates the earlier message. Refresh and active-tab takeover recover eligibility from Pi-process state; session replacement, reload, shutdown, or process exit releases all retained bytes.
131
131
 
132
- ## Security and privacy
132
+ ## ๐Ÿ” Security and privacy
133
133
 
134
134
  - The server binds only to a random `127.0.0.1` port and is owned by one live Pi session.
135
135
  - A rotating bootstrap token is exchanged once for a per-server HttpOnly, `SameSite=Strict` cookie and removed from the URL.
@@ -141,11 +141,11 @@ When `retainSentImages` is enabled, only provider-ready sanitized bytes transfer
141
141
 
142
142
  A loopback page is local to the operating-system network namespace. WebUI does not support LAN/public binding or a cloud relay. For SSH, containers, or devcontainers, forward the exact printed port and preserve the `127.0.0.1:<port>` Host value.
143
143
 
144
- ## Accessibility and browsers
144
+ ## โ™ฟ Accessibility and browsers
145
145
 
146
146
  The page uses semantic headings, native disclosure/dialog controls, concise status/alert live regions, accessible labels, visible keyboard focus, at least 44 px controls, keyboard image preview/removal/reordering, `Ctrl/Command+Enter` submission, reduced-motion handling, dark mode, and responsive reflow. It targets current stable desktop Chrome, Edge, Firefox, and Safari.
147
147
 
148
- ## Limitations
148
+ ## ๐Ÿšง Limitations
149
149
 
150
150
  - One active Pi session and one active browser editing tab only.
151
151
  - No persistent browser transcript, permanent sent-image gallery, cross-session image history, remote access, PTY/terminal control, model/settings controls, or session switching.
@@ -153,10 +153,11 @@ The page uses semantic headings, native disclosure/dialog controls, concise stat
153
153
  - Browser acknowledgment means Pi accepted or queued the message. Provider failures follow Pi's normal session/retry behavior.
154
154
  - Built-in TUI commands and dialogs are not reimplemented in the browser.
155
155
 
156
- ## Package layout
156
+ ## ๐Ÿ—‚๏ธ Package layout
157
157
 
158
158
  ```text
159
- src/webui.ts Pi extension entrypoint
159
+ src/index.ts Pi package entrypoint
160
+ src/webui.ts extension registration and command orchestration
160
161
  src/runtime.ts Pi lifecycle, commands, event projection, and browser message routing
161
162
  src/settings.ts global WebUI settings validation and atomic persistence
162
163
  src/conversation.ts bounded transcript snapshot and ordered event replay
@@ -170,7 +171,7 @@ src/pi-settings.ts effective Pi image settings reader
170
171
  src/web/ framework-free browser page
171
172
  ```
172
173
 
173
- ## Development
174
+ ## ๐Ÿงช Development
174
175
 
175
176
  From the repository root:
176
177
 
@@ -183,10 +184,10 @@ just pack webui
183
184
 
184
185
  The package preview must contain its manifest, license, README, TypeScript source, and static web assets, but no tests, fixtures, cache, or `node_modules`.
185
186
 
186
- ## Keywords
187
+ ## ๐Ÿ”Ž Keywords
187
188
 
188
189
  Pi extension, Pi Coding Agent, browser companion, local web chat, terminal session sync, Server-Sent Events, image prompt, tool activity, local-first AI coding agent.
189
190
 
190
- ## License
191
+ ## ๐Ÿ“„ License
191
192
 
192
193
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-webui",
3
- "version": "0.22.0",
3
+ "version": "0.28.0",
4
4
  "description": "Lightweight local web companion for the current Pi terminal session.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -20,7 +20,7 @@
20
20
  ],
21
21
  "pi": {
22
22
  "extensions": [
23
- "./src/webui.ts"
23
+ "./src/index.ts"
24
24
  ]
25
25
  },
26
26
  "scripts": {
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { default } from "./webui.js";