@yunazgr/pi-companion 0.3.1 → 0.3.2
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 +20 -2
- package/docs/automations.md +11 -4
- package/package.json +1 -1
- package/src/automation-mcp.ts +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Lightweight, local-first remote control for Pi sessions.
|
|
4
4
|
|
|
5
|
-
**New in 0.3.
|
|
5
|
+
**New in 0.3.2:** responsive automation and run-history tables, rounded status chips, matching clay-icon headers, and a single-column automation workspace with full-width mobile controls. **Edit automation** scrolls to and focuses the inline editor. Pull to refresh Overview, Sessions, Automations, or Settings—or use the Refresh button; unsaved settings stay intact. Camera-policy guidance now explains HTTPS proxy configuration. Existing rich results, staged job editing, optional retries, and answers-only automation sessions are retained. See [automations](docs/automations.md).
|
|
6
6
|
|
|
7
7
|
Pi Companion is deliberately not another agent runtime. Pi owns execution and conversation state. A single Rust daemon owns session discovery, pairing, temporary file exchange, browser fan-out, and the embedded web UI.
|
|
8
8
|
|
|
@@ -151,6 +151,12 @@ Pi's `companion_ask_user` tool asks one to four questions at once. Each question
|
|
|
151
151
|
|
|
152
152
|
Dialogs from other extensions (`ctx.ui.select`, `ctx.ui.confirm`, `ctx.ui.input`) are relayed to the same sheet while the terminal dialog stays open: whichever side answers first wins and the other closes. Question tools that draw their own `ctx.ui.custom` picker are relayed through a small adapter: pi-jar's `jar_ask` is supported, and a companion answer completes its terminal picker. Other `ctx.ui.custom` components and `ctx.ui.editor` stay terminal-only because they cannot be answered from outside. Pending questions are part of the session snapshot, so a browser that connects later still sees them.
|
|
153
153
|
|
|
154
|
+
## Refreshing your workspace
|
|
155
|
+
|
|
156
|
+
On Overview, Sessions, Automations, and Settings, pull down from the top of the page and release when prompted to refresh current data. Each page also provides a keyboard-accessible **Refresh** button with progress and error feedback. This refreshes data without reloading the app; Settings preserves unsaved edits. Gestures inside inputs and nested scrollable lists are left alone.
|
|
157
|
+
|
|
158
|
+
The Sessions, Devices, and Settings pages now share the automation page’s clay-icon header style. See [device management](docs/devices.webp), [settings](docs/settings.webp), and [mobile settings](docs/settings-mobile.webp).
|
|
159
|
+
|
|
154
160
|
## Notifications, camera and catching up
|
|
155
161
|
|
|
156
162
|
Settings → **Notifications and camera** (on every device, not just the console) asks the browser for both permissions from a tap, as browsers require, and shows whether each is allowed, blocked or unavailable. Overview also offers a one-time "Turn on notifications" banner.
|
|
@@ -254,6 +260,18 @@ which destroys one temporary file by opaque id.
|
|
|
254
260
|
|
|
255
261
|
This means the agent can consume uploaded artifacts using its normal file capabilities while Pi Companion retains ownership of upload placement and cleanup.
|
|
256
262
|
|
|
263
|
+
### Camera access through Cloudflare or another HTTPS proxy
|
|
264
|
+
|
|
265
|
+
Camera scanning works through an HTTPS tunnel; Companion serves `Permissions-Policy: camera=(self)`. A proxy response-header rule that replaces it with `camera=()` blocks the camera before the browser can ask permission. JavaScript cannot override that restriction.
|
|
266
|
+
|
|
267
|
+
For a Cloudflare **Modify Response Header** rule scoped to your Companion hostname (for example, `http.host eq "companion.readynaz.com"`), set `Permissions-Policy` to:
|
|
268
|
+
|
|
269
|
+
```text
|
|
270
|
+
geolocation=(), camera=(self), microphone=(), payment=(), usb=(), accelerometer=(), gyroscope=(), magnetometer=()
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Exclude the Companion hostname from any broader rule that still sets `camera=()`, and check Workers or other proxies for duplicate overrides. Keep Cloudflare Access authentication enabled and tunnel only the paired-device listener. Open Companion directly, not inside an iframe. After signing in, verify the final page response in browser DevTools → Network: its camera directive must be `camera=(self)`. The Access login redirect is not the app response. Reload the app (and restart an older daemon after upgrading), then allow Camera in browser site permissions. Manual pairing-code entry remains available.
|
|
274
|
+
|
|
257
275
|
## Workspace and tunnel connection errors
|
|
258
276
|
|
|
259
277
|
If a tunnel closes, the workspace stops, or your device loses its network, Companion shows an actionable **Workspace connection interrupted** notice with **Retry now** and reconnect instructions. On initial connection failure, it shows **Workspace unavailable**, not a misleading empty session list or “session not found.” Gateway errors (including HTTP 502/503/504 and tunnel-provider errors) are translated into readable messages rather than raw HTML or JSON parse errors. A browser cannot always distinguish a closed tunnel from a daemon, DNS or network failure, so these messages describe possible causes rather than claiming certainty.
|
|
@@ -354,7 +372,7 @@ Clone the repository, then:
|
|
|
354
372
|
|
|
355
373
|
`npm run serve` builds the embedded Svelte UI and starts the Rust daemon in the foreground. It prints:
|
|
356
374
|
|
|
357
|
-
Pi Companion v0.3.
|
|
375
|
+
Pi Companion v0.3.2
|
|
358
376
|
|
|
359
377
|
Console http://127.0.0.1:43721
|
|
360
378
|
Paired devices http://127.0.0.1:43722
|
package/docs/automations.md
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
# Automations (0.3.
|
|
1
|
+
# Automations (0.3.2)
|
|
2
2
|
|
|
3
3
|
Automations are persisted, named JSON scripts run by the Companion daemon. Open **Automations** in the navigation to view definitions, start/stop runs, and inspect timestamped run history. Click a run to view its captured output and Pi summary. Desktop console users can create, edit, delete, and enable/disable definitions; mobile and paired-device users can only inspect and start/stop them.
|
|
4
4
|
|
|
5
5
|
## Workspace & editor
|
|
6
6
|
|
|
7
|
-
The claymorphic automation collection
|
|
7
|
+
The claymorphic automation collection uses the same responsive tabular style as overview sessions, with rounded status chips, name search, segmented Enabled/Disabled filters, ten-item pagination, and a scrollable row region. Redundant statistic tiles are removed. On phones, rows stack their labelled fields without horizontal scrolling.
|
|
8
|
+
|
|
9
|
+
The detail workspace is a single-column bento layout with a clay back button and full-width run control below its title. **Summary** and **Run history** tabs fill the container. History is a newest-first responsive table with start time, duration, status filters, and ten-item pagination over each automation’s retained history (latest 30 finished runs by default, configurable 1–1000).
|
|
10
|
+
|
|
11
|
+
Choose **Edit automation** to reveal the editor at the top of Summary, automatically scroll it into view, and focus its name field. This keeps the routine context nearby without navigating to another page. Nothing changes until you save. Desktop console editing remains required.
|
|
12
|
+
|
|
13
|
+
Overview, Sessions, Automations, and Settings support pull-to-refresh from the top of the page and an accessible **Refresh** button. Pull down on non-interactive page content, then release when prompted. Nested scroll regions and form controls keep their own gestures. Settings refresh never discards unsaved edits.
|
|
8
14
|
|
|
9
15
|
The job editor separates name, enablement, UTC cron, optional retry policy, preconditions, actions, and post-actions. Each step is a reorderable JSON DSL object with Command/Pi templates. Saving validates the definition, cron ranges, action types, arguments, absolute directories, timeouts, step count, and retry bounds; the daemon validates again before persistence. Only computer desktop administrators can author definitions.
|
|
10
16
|
|
|
@@ -15,10 +21,11 @@ Run results have a formatted and raw view. Formatted results split daemon execut
|
|
|
15
21
|
Screenshots use only demo data. The same generator refreshes the existing overview, session, and mobile screenshots too.
|
|
16
22
|
|
|
17
23
|

|
|
18
|
-

|
|
25
|
+

|
|
20
26
|

|
|
21
27
|

|
|
28
|
+

|
|
22
29
|

|
|
23
30
|

|
|
24
31
|

|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yunazgr/pi-companion",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Local-first remote control for Pi sessions: live activity feed, steering, git diff, file drop and phone pairing from a single Rust daemon.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
package/src/automation-mcp.ts
CHANGED
|
@@ -31,7 +31,7 @@ async function receive(line: string) {
|
|
|
31
31
|
case "initialize": {
|
|
32
32
|
const versions = ["2025-06-18", "2025-03-26", "2024-11-05"];
|
|
33
33
|
const requested = message.params?.protocolVersion;
|
|
34
|
-
reply({ protocolVersion: versions.includes(String(requested)) ? requested : versions[0], capabilities: { tools: {} }, serverInfo: { name: "pi-companion-automations", version: "0.3.
|
|
34
|
+
reply({ protocolVersion: versions.includes(String(requested)) ? requested : versions[0], capabilities: { tools: {} }, serverInfo: { name: "pi-companion-automations", version: "0.3.2" } });
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
case "ping": reply({}); return;
|