You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pi/README.md
+23-13Lines changed: 23 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,12 @@
4
4
5
5
## What it does
6
6
7
-
Registers a `glance`**tool**and a `/glance`**command**:
7
+
Maintains a **persistent background session**on glance.sh. Paste an image anytime — the agent receives it instantly.
8
8
9
-
-**Tool** — the LLM calls it when it needs to see something visual (your screen, a UI, an error dialog). The agent creates a session, you paste a screenshot in your browser, the agent receives the image URL.
10
-
-**Command** — you type `/glance` in the pi prompt to proactively share a screenshot with the agent.
9
+
-**Background listener** — starts when pi launches, reconnects automatically, refreshes sessions before they expire.
10
+
-**`glance` tool** — the LLM calls it when it needs to see something visual. Surfaces the session URL and waits for the next paste.
11
+
-**`/glance` command** — type it to see the current session URL.
12
+
-**Multiple images** — paste as many images as you want. Each one is injected into the conversation as `Screenshot: <url>`.
user ──opens /s/<id>, pastes image──▶ agent receives URL
32
-
```
31
+
pi starts
32
+
└─▶ create session on glance.sh
33
+
└─▶ connect SSE (background, auto-reconnect)
33
34
34
-
1. Creates a live session on glance.sh.
35
-
2. Shows you the session URL (status bar + notification).
36
-
3. Connects via SSE and waits up to ~5 minutes.
37
-
4. When you paste an image, the URL is returned to the LLM.
35
+
user pastes image at /s/<id>
36
+
└─▶ SSE emits "image" event
37
+
└─▶ extension injects "Screenshot: <url>" into conversation
38
38
39
-
No API keys required — sessions are anonymous and ephemeral (10-minute TTL).
39
+
session expires (~10 min)
40
+
└─▶ extension creates new session, reconnects
41
+
```
42
+
43
+
The `glance` tool reuses the existing background session — it just surfaces the URL and waits for the next image rather than creating a new session each time.
0 commit comments