ccdeck 3.34.0 → 3.34.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 +36 -8
- package/dist/web/assets/{BrowserWatchModal-C9xCXMz4.js → BrowserWatchModal-C42m7ewG.js} +1 -1
- package/dist/web/assets/{UsageHistoryModal-B-v-iUY5.js → UsageHistoryModal-N-p7OGkW.js} +1 -1
- package/dist/web/assets/{index-CgHJ_aHk.js → index-CSDSEC1Q.js} +3 -3
- package/dist/web/index.html +1 -1
- package/package.json +12 -7
- package/release-notes.json +6 -0
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# ccdeck — a live dashboard for Claude Code and Codex
|
|
4
4
|
|
|
5
|
+
ccdeck is a free, open-source (AGPL-3.0) dashboard that runs on your machine and shows every Claude Code and OpenAI Codex CLI session, including ones started in a plain terminal: which Claude Code session needs input, each Claude Code subagent and every tool call as it runs, cost and quota left. Start it with `npx ccdeck` or the desktop app.
|
|
6
|
+
|
|
7
|
+
Step-by-step guides: [ccdeck.dev/guides](https://ccdeck.dev/guides/)
|
|
8
|
+
|
|
5
9
|
**Know which agent is waiting on you, and for how long.**
|
|
6
10
|
|
|
7
11
|
**ccdeck keeps them in one queue** — every session stopped on a human, longest wait first, and the count in the topbar is one click to the oldest. That queue is Claude Code's, because the deck reads Codex from its rollout log and a rollout carries no such signal; the canvas under it is both, with every Claude Code subagent on a node of its own.
|
|
@@ -18,13 +22,13 @@ npx ccdeck
|
|
|
18
22
|
|
|
19
23
|
Or the desktop app, with the waiting count in your menu bar: **[macOS](https://github.com/BarganConstantin/ccdeck/releases/latest/download/ccdeck-mac-arm64.dmg)** · **[Windows](https://github.com/BarganConstantin/ccdeck/releases/latest/download/ccdeck-win-x64.exe)** · **[Linux](https://github.com/BarganConstantin/ccdeck/releases/latest/download/ccdeck-linux-x86_64.AppImage)** — [every download](#desktop-app)
|
|
20
24
|
|
|
21
|
-
[](assets/canvas.png)
|
|
22
26
|
|
|
23
27
|
*A generated session, drawn by the deck itself — see `assets/canvas-demo.mjs`. Click through for full size.*
|
|
24
28
|
|
|
25
29
|
who is blocked on you · tool calls · one canvas · cost · quota · local · sessions never leave
|
|
26
30
|
|
|
27
|
-
[ccdeck.dev](https://ccdeck.dev) · [What you get](#what-you-get) · [Quick start](#quick-start) · [How it works](#how-it-works) · [What it touches](#what-it-touches) · [Accounts](#accounts) · [Local network](#local-network) · [Options](#options) · [FAQ](#questions-people-ask)
|
|
31
|
+
[ccdeck.dev](https://ccdeck.dev) · [Guides](https://ccdeck.dev/guides/) · [What you get](#what-you-get) · [Quick start](#quick-start) · [How it works](#how-it-works) · [What it touches](#what-it-touches) · [Accounts](#accounts) · [Local network](#local-network) · [Options](#options) · [FAQ](#questions-people-ask)
|
|
28
32
|
|
|
29
33
|
|
|
30
34
|
</div>
|
|
@@ -86,7 +90,7 @@ The deck opens on these eight pictures the first time it runs — they are the w
|
|
|
86
90
|
|---|---|
|
|
87
91
|
| **Blocked on you** | A permission prompt, or a finished turn waiting for your next instruction, sorts that session to the top of the sidebar with how long it has been stuck — longest wait first, so the oldest block is the first row. A permission prompt also puts a count in the topbar that jumps straight to it. Claude Code only — the deck reads Codex from its rollout log, and a rollout carries no such signal. |
|
|
88
92
|
| **Live DAG** | Nodes are agents and edges are spawns; each agent's latest tool calls sit beside its node and light up while they run. In-flight edges animate, settled ones dim. |
|
|
89
|
-
| **Both providers, one canvas** | Claude Code through hooks, Codex through its rollout log. The model chip (`Opus 5`, `GPT-5.5`) tells them apart. |
|
|
93
|
+
| **Both providers, one canvas** | Claude Code through hooks, Codex through its rollout log. The model chip (`Opus 5`, `GPT-5.5`) tells them apart. Subagent cards are Claude Code only: a Codex session is one node with its tool calls. |
|
|
90
94
|
| **Cost and quota, live** | Spend per model and per session, plus Claude and Codex quota windows as they refill. |
|
|
91
95
|
| **Double-click to inspect** | Any node opens its prompt, tool calls, token usage and timing in the side panel. A single click selects it and frames its session. |
|
|
92
96
|
| **Survives restarts** | Events are appended to this platform's log directory (see `--history` below) and replayed on open. |
|
|
@@ -95,6 +99,8 @@ The deck opens on these eight pictures the first time it runs — they are the w
|
|
|
95
99
|
| **Knows when it is stale** | Node caches modules at startup, so an upgraded-while-running deck keeps executing old code. This one says so, and can restart itself when nothing is running. |
|
|
96
100
|
| **Workspace scoping** | `--scope` for the current directory, `--workspace <path>` for any subtree — for Claude Code and Codex alike. |
|
|
97
101
|
|
|
102
|
+
Step by step: [See which Claude Code session is waiting for input](https://ccdeck.dev/guides/waiting-on-you/) · [See Claude Code subagents and tool calls live](https://ccdeck.dev/guides/read-a-session/)
|
|
103
|
+
|
|
98
104
|
## Quick start
|
|
99
105
|
|
|
100
106
|
```bash
|
|
@@ -114,6 +120,8 @@ No config file. No account. Nothing about your sessions is reported anywhere —
|
|
|
114
120
|
|
|
115
121
|
What the deck does write, and the short list of what does leave the machine, is in [What it touches](#what-it-touches).
|
|
116
122
|
|
|
123
|
+
Step by step: [Install ccdeck with npx and see your first session](https://ccdeck.dev/guides/first-run/). When a session does not show up: [Troubleshoot ccdeck: status, logs, port and hooks](https://ccdeck.dev/guides/troubleshooting/)
|
|
124
|
+
|
|
117
125
|
### Desktop app
|
|
118
126
|
|
|
119
127
|
The same deck as an app: it starts the deck itself and puts an icon in the menu bar (the tray on Windows and Linux) that counts the Claude Code sessions stopped on a permission prompt or a question — the number sits beside the icon on macOS, and in the icon's tooltip and menu on Windows and Linux. With **Notifications while closed** ticked in that menu, which starts off, it also sends a notification while the window is closed wherever an open page would have played a sound, with the deck's own tone on macOS. It needs no Node.js. If a deck from `npx ccdeck` is already running, the app uses that one rather than starting a second, and replaces it only when it is older than the one the app carries.
|
|
@@ -131,11 +139,13 @@ The same deck as an app: it starts the deck itself and puts an icon in the menu
|
|
|
131
139
|
|
|
132
140
|
The app keeps itself current from this repository's releases, and installs an update only if it carries ccdeck's own signature. It installs on Quit, or by itself once the app has been left alone for a minute — its window closed or not in focus, and no deck starting — and restarts into the new version. That does not wait for your agents to go idle: the deck is gone for a second or two, which can leave a gap in the drawing of a turn, and the agents carry on. On the .deb, where installing asks for your password, it installs only when you choose Restart to update.
|
|
133
141
|
|
|
142
|
+
Step by step: [Install the ccdeck app on Mac, Windows or Linux](https://ccdeck.dev/guides/desktop-app/)
|
|
143
|
+
|
|
134
144
|
## Requirements
|
|
135
145
|
|
|
136
146
|
- Node.js ≥ 18 — macOS, Linux and Windows. The floor is checked on every run: CI installs the packed release on Node 18 and boots it, so the badge is a measurement rather than a claim
|
|
137
147
|
- Claude Code CLI or OpenAI Codex CLI (or both)
|
|
138
|
-
- Optional: [claude-swap](https://
|
|
148
|
+
- Optional: [claude-swap](https://github.com/realiti4/claude-swap) for the Accounts panel; the deck can install it for you
|
|
139
149
|
- Nothing else. On Apple Silicon the deck fetches [`macmon`](https://github.com/vladkens/macmon) itself for the temperature rows; see below.
|
|
140
150
|
|
|
141
151
|
### Temperature, per machine
|
|
@@ -155,6 +165,8 @@ You do not have to install it. The deck downloads the published binary into `~/.
|
|
|
155
165
|
|
|
156
166
|
It is skipped entirely on a machine that already answers, on an Intel Mac — the release publishes an arm64 build and only that, so the architecture is checked before anything is fetched — and on one where you have `macmon` yourself, which is looked for on PATH and on either Homebrew prefix before the download is considered. `AGENTS_DECK_NO_DOWNLOAD=1` turns it off on its own; `AGENTS_DECK_NO_INSTALL=1` turns it off along with everything else.
|
|
157
167
|
|
|
168
|
+
Step by step: [See CPU, memory and heat while your agents run](https://ccdeck.dev/guides/machine-panel/)
|
|
169
|
+
|
|
158
170
|
#### Windows, and why it is often blank
|
|
159
171
|
|
|
160
172
|
Windows is the platform where this most often shows nothing, and that is not a defect in the deck. Measured on a physical Windows 11 laptop — a Lenovo IdeaPad L340, Intel i5-9300H, English install, checked both as an ordinary user and as an administrator:
|
|
@@ -203,9 +215,11 @@ To answer it the deck reads the browsers' own history. That means, on each poll:
|
|
|
203
215
|
|
|
204
216
|
Only visits **after this deck started** are ever considered. Your existing history is not swept, not archived and not shown.
|
|
205
217
|
|
|
218
|
+
Step by step: [Detect browser automation while you were away](https://ccdeck.dev/guides/browser-watch/)
|
|
219
|
+
|
|
206
220
|
## Accounts
|
|
207
221
|
|
|
208
|
-
The Accounts panel reads the store [claude-swap](https://
|
|
222
|
+
The Accounts panel reads the store [claude-swap](https://github.com/realiti4/claude-swap) keeps, and can drive it.
|
|
209
223
|
|
|
210
224
|
The deck installs that package itself, so it installs it **bounded**: `claude-swap~=0.26`, which is `>= 0.26, == 0.*`, and when PyPI can be reached the exact version it resolved rather than the range. What `cswap --version` reports afterwards has to be that version, or the deck says so and leaves the panel dark rather than driving a copy it cannot account for — this is the tool that holds your Claude logins. The daily upgrade is bounded by the same specifier, and what it left behind is written to `~/.agents-deck/cswap-upgrade.json`.
|
|
211
225
|
|
|
@@ -224,6 +238,8 @@ An import adds what is missing and leaves a working account exactly as it is. Th
|
|
|
224
238
|
|
|
225
239
|
**Rename**, **Move to slot…** and **Remove** are on the same row menu. Removal takes two clicks and cannot be undone.
|
|
226
240
|
|
|
241
|
+
Step by step: [Switch between multiple Claude Code accounts](https://ccdeck.dev/guides/claude-accounts/) · [Copy your Claude Code login to another machine](https://ccdeck.dev/guides/move-an-account/)
|
|
242
|
+
|
|
227
243
|
## Local network
|
|
228
244
|
|
|
229
245
|
A Claude login expires on the machine that has not used it for a while, and stays alive on the one that has. With two or three machines that is a `claude login` a week, each time on the machine you are not sitting at. **Local network** is the last section of the Claude accounts panel, and it is that chore done for you: decks on one network find each other, pair, and a login that has expired on one is copied back from another that still has it.
|
|
@@ -257,6 +273,8 @@ Four pictures, which are also the guide the section opens from `See how it works
|
|
|
257
273
|
|
|
258
274
|
On a Mac, **cannot share here** is different from **expired here**. It means this ccdeck process cannot read the Keychain copy, so that machine is not used as a credential source and another deck does not keep trying to “repair” the same healthy slot every minute. A LAN import is checked after it lands too; if the receiving Mac still cannot read the Keychain, the round reports that problem instead of claiming the login was repaired.
|
|
259
275
|
|
|
276
|
+
Step by step: [Repair expired Claude Code logins across machines](https://ccdeck.dev/guides/local-network/)
|
|
277
|
+
|
|
260
278
|
## Options
|
|
261
279
|
|
|
262
280
|
```
|
|
@@ -372,6 +390,8 @@ override it if the guess is wrong.
|
|
|
372
390
|
|
|
373
391
|
That one events log is also the reason Clear is not quite the per-deck button it looks like. The decks elect a single writer for each log file, and only that deck may empty it: Clear on any other deck wipes its own canvas and leaves the file to the deck that writes it. The confirmation says which of the two you are about to do, and how many decks share the log when it is yours to empty — so `--history` or `--no-persist` gives a deck a log of its own if you want Clear to answer to nobody else.
|
|
374
392
|
|
|
393
|
+
Step by step: [Show one project's Claude Code and Codex sessions](https://ccdeck.dev/guides/one-project/)
|
|
394
|
+
|
|
375
395
|
Environment:
|
|
376
396
|
|
|
377
397
|
| Variable | Effect |
|
|
@@ -396,6 +416,8 @@ Environment:
|
|
|
396
416
|
|
|
397
417
|
Usage history is read with `ccusage`, and the deck takes the first of these that answers: `AGENTS_DECK_CCUSAGE` if you set it, then the copy it installed for itself under `~/.agents-deck/ccusage`, then a `ccusage` on your PATH, then `npx -y ccusage@latest`. So installing ccusage yourself is enough — the deck will not fetch a second copy, and it works under `AGENTS_DECK_NO_INSTALL=1`, which is the combination that variable is for. When something fails, the modal names which of those four it was.
|
|
398
418
|
|
|
419
|
+
Step by step: [See Claude Code and Codex cost and quota left](https://ccdeck.dev/guides/cost-and-quota/)
|
|
420
|
+
|
|
399
421
|
Being told to restart after an upgrade is local only — no network involved — and cannot be turned off, because a deck running superseded code is a bug you cannot see any other way.
|
|
400
422
|
|
|
401
423
|
## Uninstall
|
|
@@ -447,6 +469,8 @@ That takes your ccdeck settings — pairings, aliases, which accounts this deck
|
|
|
447
469
|
offered — with the key, which is the point: after an uninstall there is nothing
|
|
448
470
|
left for them to configure.
|
|
449
471
|
|
|
472
|
+
Step by step: [Uninstall ccdeck and remove its Claude Code hook](https://ccdeck.dev/guides/uninstall/)
|
|
473
|
+
|
|
450
474
|
## Updating
|
|
451
475
|
|
|
452
476
|
The deck checks npm for a newer release at most once an hour, plus once when it starts — a ~20-byte GET to `registry.npmjs.org`, asking about the package this copy would actually install (a deck started with `npx ccdeck` asks about `ccdeck`). When that names a version it has not seen before, one more request confirms the version is really there: npm moves the dist-tag before the version itself has propagated, and a banner shown inside that window ends in `ETARGET` instead of an upgrade. So a check is one request, or two when there is something new to confirm — and a version that is tagged but not yet installable is looked at again in five minutes rather than in an hour. Click the version chip in the topbar to ask immediately.
|
|
@@ -469,6 +493,8 @@ ccdeck runs as a two-process pair: a supervisor that owns nothing but the lifecy
|
|
|
469
493
|
|
|
470
494
|
It restarts on its own only after 30 seconds with nothing running, because hook events are fire-and-forget and anything fired during the gap is lost. The toggle in the banner turns that off; the preference is per-browser. Under `--no-persist` a restart is refused outright — with no event log there is nothing to replay, and the canvas would be gone.
|
|
471
495
|
|
|
496
|
+
Step by step: [Update ccdeck to the latest version](https://ccdeck.dev/guides/update-and-restart/)
|
|
497
|
+
|
|
472
498
|
## Design
|
|
473
499
|
|
|
474
500
|
- Node = agent (root session or subagent)
|
|
@@ -498,11 +524,13 @@ so existing clones, links and bookmarks keep working.
|
|
|
498
524
|
|
|
499
525
|
**Does it work with Codex, or only Claude Code?**
|
|
500
526
|
Both, on one canvas. Claude Code arrives through a hook, Codex through its
|
|
501
|
-
rollout log, and the model chip tells them apart.
|
|
502
|
-
|
|
527
|
+
rollout log, and the model chip tells them apart. Subagent cards are Claude
|
|
528
|
+
Code only: a Codex session is one node with its tool calls. So is the *blocked
|
|
529
|
+
on you* queue, because a rollout log is a record of what happened and the
|
|
503
530
|
queue needs to know what is happening now. Codex does report it — its
|
|
504
531
|
`app-server` pushes a thread status carrying `waitingOnApproval` — and reading
|
|
505
|
-
that is open work, not a wall.
|
|
532
|
+
that is open work, not a wall. Step by step:
|
|
533
|
+
[Set up ccdeck for Codex CLI](https://ccdeck.dev/guides/codex/)
|
|
506
534
|
|
|
507
535
|
**Does anything leave my machine?**
|
|
508
536
|
Your sessions, never. The deck binds `127.0.0.1`. It does send anonymous usage
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,r as c,k as _,l as V,m as Y,n as z,s as X,u as Z,g as ee}from"./index-CgHJ_aHk.js";function se({snap:s}){return e.jsxs("section",{className:"bw-feed",children:[e.jsxs("h4",{className:"bw-sec-head bw-head-row",children:["Live activity",e.jsxs("span",{className:"bw-feed-count",children:[s.log.length," ",s.log.length===1?"event":"events"]})]}),e.jsx("p",{className:"bw-since bw-feed-note",children:"Pages you opened yourself — counted to run the rule, never written down. Addresses appear under Findings, and only for pages a program opened."}),e.jsx("div",{className:"bw-log","aria-live":"polite","aria-relevant":"additions",children:s.log.length===0?e.jsx("p",{className:"bw-note",children:"The deck writes a line here each time it looks at a profile."}):s.log.map(t=>e.jsxs("div",{className:`bw-log-line ${t.level}${t.parts?"":" sys"}`,children:[e.jsx("span",{className:"bw-log-time",children:new Date(t.atMs).toLocaleTimeString("en-GB",{hour12:!1})}),t.parts?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"bw-log-browser",children:t.parts.browser}),e.jsx("span",{className:"bw-log-profile",title:t.parts.profile,children:t.parts.profile}),e.jsxs("span",{className:"bw-log-value",children:[t.parts.value,t.parts.flagged>0&&e.jsxs("span",{className:"bw-log-flag",children:[" · ",t.parts.flagged," flagged"]})]})]}):e.jsx("span",{className:"bw-log-sys",children:t.text})]},`${t.atMs}-${t.level}-${t.text}`))})]})}const E=s=>`${s.host}-${s.startMs}`;function te(s){const t=l=>new Date(l).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1});return s.count===1||s.endMs-s.startMs<6e4?t(s.startMs):`${t(s.startMs)} → ${t(s.endMs)}`}function ne(s){return new Date(s).toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})}function U(s){const t=Math.round((s.endMs-s.startMs)/6e4);return t<1?"":`${t} min`}function ae({snap:s,dismiss:t,refreshRef:l}){const[r,h]=c.useState(null),o=c.useRef(new Map),a=c.useRef(null);c.useEffect(()=>{var i,w;const d=a.current;!d||s.episodes.some(m=>E(m)===d.id)||(a.current=null,_(((i=document.activeElement)==null?void 0:i.tagName)??null)&&((w=(d.next?o.current.get(d.next):void 0)??l.current)==null||w.focus()))},[s]);const n=d=>{a.current={id:E(d),next:V(s.episodes.map(E),E(d))},t(d)},u=c.useMemo(()=>{const d=[];for(const i of s.episodes){const w=ne(i.startMs),m=d[d.length-1];m&&m.label===w?m.episodes.push(i):d.push({label:w,episodes:[i]})}return d},[s]);return e.jsxs("section",{className:"bw-findings",children:[e.jsxs("h4",{className:"bw-sec-head bw-head-row",children:["Findings",s.episodes.length>0&&e.jsxs("span",{className:"bw-feed-count",children:[s.episodes.length," ",s.episodes.length===1?"episode":"episodes"]})]}),e.jsx("div",{className:"bw-eps",children:u.length===0?e.jsxs("div",{className:"bw-empty",children:[e.jsx("p",{className:"bw-empty-head",children:"Nothing found yet"}),e.jsxs("p",{className:"bw-empty-note",children:["An episode lands here when a program opens pages in a browser nobody has touched for"," ",s.settings.quietMinutes," ",s.settings.quietMinutes===1?"minute":"minutes",". On most machines that is rare, so an empty list is the ordinary result rather than a sign something is wrong."]}),!s.settings.enabled&&e.jsx("p",{className:"bw-empty-note",children:"Watching is off, so this shows only what this deck has seen since it started. Anything an earlier run recorded comes back when you switch it on."})]}):u.map(d=>e.jsxs("div",{className:"bw-day",children:[e.jsx("h4",{className:"bw-sec-head",children:d.label}),d.episodes.map(i=>{const w=E(i),m=r===w;return e.jsxs("div",{className:`bw-ep${m?" open":""}`,children:[e.jsxs("div",{className:"bw-ep-row",children:[e.jsxs("button",{className:"bw-ep-head",ref:b=>{b?o.current.set(w,b):o.current.delete(w)},onClick:()=>h(m?null:w),"aria-expanded":m,children:[e.jsx("span",{className:"bw-chev","aria-hidden":!0,children:m?"▾":"▸"}),e.jsx("span",{className:"bw-ep-host",children:i.host}),e.jsxs("span",{className:"bw-ep-meta",children:[te(i),U(i)&&e.jsxs(e.Fragment,{children:[" · ",U(i)]}),i.provisional&&e.jsxs(e.Fragment,{children:[" · ",e.jsx("span",{title:"Its quiet window has not closed yet. If somebody used the browser in the minutes after it, it is withdrawn; until then it is not written down and no reaction runs.",children:"provisional"})]})]}),e.jsxs("span",{className:"bw-ep-count",children:[i.count," ",i.count===1?"page":"pages"]})]}),e.jsx("button",{className:"glyph-btn bw-ep-x",onClick:()=>n(i),"aria-label":`Dismiss ${i.host}`,title:"Dismiss — it leaves this list for good, and stays in the log file",children:"×"})]}),m&&e.jsx("ul",{className:"bw-urls",children:i.urls.map((b,y)=>e.jsxs("li",{children:[e.jsx("span",{className:"bw-url-time",children:new Date(b.timeMs).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1})}),e.jsx("span",{className:"bw-url",children:b.url})]},`${b.url}-${b.timeMs}-${y}`))})]},w)})]},d.label))})]})}function re(s){const t=/^#?([0-9a-f]{6})$/i.exec((s??"").trim());if(!t)return!1;const l=parseInt(t[1],16),r=[l>>16&255,l>>8&255,l&255].map(h=>{const o=h/255;return o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4)});return .2126*r[0]+.7152*r[1]+.0722*r[2]>.5}const G=1e4,ie=12e3;function oe({browsers:s,findings:t,watching:l,palette:r}){const h=c.useRef(null),o=c.useRef(null);return o.current={browsers:s,findings:t,watching:l},c.useEffect(()=>{var m;const a=h.current;if(!a)return;const n=a.getContext("2d");if(!n)return;const u=((m=window.matchMedia)==null?void 0:m.call(window,"(prefers-reduced-motion: reduce)").matches)??!1;let d=0,i=!1;const w=()=>{var q;if(i)return;const b=o.current;if(!b)return;const{browsers:y,findings:p,watching:P}=b,R=r["--accent"]||"#7dd3fc",f=r["--line"]||"#1f2229",j=r["--text-dim"]||"#6e727c",C=re(r["--bg"]),N=C?42:26,v=C?.85:.65,I=Date.now(),$=Math.min(window.devicePixelRatio||1,2),W=a.clientWidth,k=a.clientHeight;(a.width!==W*$||a.height!==k*$)&&(a.width=W*$,a.height=k*$),n.setTransform($,0,0,$,0,0),n.clearRect(0,0,W,k);const x=W/2,M=k/2,S=Math.min(W,k)/2-6;n.strokeStyle=f,n.lineWidth=1,n.globalAlpha=C?1:.9;for(const g of[.4,.7,1])n.beginPath(),n.arc(x,M,S*g,0,Math.PI*2),n.stroke();n.beginPath(),n.moveTo(x-S,M),n.lineTo(x+S,M),n.moveTo(x,M-S),n.lineTo(x,M+S),n.stroke(),n.globalAlpha=1;const A=(P&&!u?I%G/G:0)*Math.PI*2-Math.PI/2;if(P){const g=(q=n.createConicGradient)==null?void 0:q.call(n,A-.85,x,M);g&&(g.addColorStop(0,"transparent"),g.addColorStop(.85/(Math.PI*2),`color-mix(in srgb, ${R} ${N}%, transparent)`),g.addColorStop(1,"transparent"),n.fillStyle=g,n.beginPath(),n.moveTo(x,M),n.arc(x,M,S,A-.85,A),n.closePath(),n.fill()),n.strokeStyle=R,n.globalAlpha=v,n.beginPath(),n.moveTo(x,M),n.lineTo(x+Math.cos(A)*S,M+Math.sin(A)*S),n.stroke(),n.globalAlpha=1}y.forEach((g,T)=>{const B=T/Math.max(y.length,1)*Math.PI*2-Math.PI/2,D=g.lastReadMs===null?1:Math.min(1,(I-g.lastReadMs)/12e4),O=S*(.42+D*.5),F=x+Math.cos(B)*O,L=M+Math.sin(B)*O,Q=Math.abs((A-B+Math.PI*3)%(Math.PI*2)-Math.PI),K=P?Math.max(0,1-Q/.55):0;n.beginPath(),n.arc(F,L,3+K*1.6,0,Math.PI*2),n.fillStyle=g.running?R:j,n.globalAlpha=g.running?.55+K*.45:.35,n.fill(),n.globalAlpha=1});for(const g of p){const T=(I-g.atMs)/ie;if(T<0||T>1)continue;const D=Math.max(0,y.findIndex(L=>L.key===g.browser))/Math.max(y.length,1)*Math.PI*2-Math.PI/2,O=x+Math.cos(D)*S*.6,F=M+Math.sin(D)*S*.6;n.beginPath(),n.arc(O,F,4+T*22,0,Math.PI*2),n.strokeStyle=R,n.globalAlpha=(1-T)*.8,n.lineWidth=1.5,n.stroke(),n.globalAlpha=1}d=requestAnimationFrame(w)};return w(),()=>{i=!0,cancelAnimationFrame(d)}},[r]),e.jsx("canvas",{ref:h,className:"bw-radar",role:"img","aria-label":l?`Watching ${s.length} browser${s.length===1?"":"s"}`:"Not watching"})}function le(s,t,l){if(s===null)return null;const r=s+t-l;return r>0?r:null}function ce(s){const t=Math.ceil(s/1e3),l=Math.floor(t/60),r=t%60;return l>0?`${l}m ${r}s`:`${r}s`}function J(s){return(s??[]).filter(t=>t.installed&&t.profiles>0)}function de(s){return!Number.isFinite(s)||s<=0?"empty":Y(s)}function he(s,t){return s.map(l=>({key:l.key,name:l.name,running:l.running,visits:t.filter(r=>r.browser===l.key).reduce((r,h)=>r+h.programVisits,0)}))}function ue(s,t){if(s===null)return null;const l=Math.max(0,Math.round((t-s)/1e3));if(l<5)return"just now";if(l<60)return`${l} sec ago`;const r=Math.round(l/60);return r<60?`${r} min ago`:`${Math.round(r/60)} hr ago`}function we(s){const t=s.profiles.filter(r=>r.degraded);if(t.length>0){const r=t[0],h=t.length-1;return{kind:"unreadable",text:`${r.name}/${r.profile} could not be read — ${r.reason??"no reason given"}`+(h>0?`, and ${h} more`:"")+". The watch continues on the profiles it can read."}}const l=J(s.browsers);return l.length===0?{kind:"no-profiles",text:"No browser on this machine has a profile to read. Open one of the browsers below once and it will be watched from then on."}:l.some(r=>r.running)?null:{kind:"none-running",text:"No watched browser is running, so nothing can be navigated right now. Their history is still read, and anything found while they were open is still here."}}function me({snap:s,watching:t,palette:l}){const[r,h]=c.useState(!1),[o,a]=c.useState(()=>Date.now());c.useEffect(()=>{const u=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(u)},[]);const n=le(s.coverage.lastHumanMs,s.coverage.quietMs,o);return e.jsxs("section",{className:"bw-sec",children:[e.jsxs("h4",{className:"bw-sec-head",children:["Activity overview",e.jsx("button",{className:"bw-help",onClick:()=>h(u=>!u),"aria-expanded":r,"aria-label":"What the sweep and the dots mean",children:"?"})]}),e.jsxs("div",{className:"bw-glance",children:[e.jsx(oe,{browsers:t.map(u=>{var d;return{key:u.key,name:u.name,running:u.running,lastReadMs:((d=s.profiles.find(i=>i.browser===u.key))==null?void 0:d.lastWrittenMs)??null}}),findings:s.episodes.slice(0,6).map(u=>({browser:u.browser??null,atMs:u.endMs})),watching:s.settings.enabled,palette:l}),e.jsx("ul",{className:"bw-counts",children:he(t,s.profiles).map(u=>e.jsxs("li",{children:[e.jsx("span",{className:"bw-count-n",children:u.visits.toLocaleString("en-US")}),e.jsx("span",{className:"bw-count-of",children:u.name})]},u.key))})]}),e.jsx("p",{className:"bw-since",children:"Pages a program opened, since this deck started"}),s.coverage.checkedMs>0&&e.jsxs("p",{className:"bw-since",children:["Last checked ",ue(s.coverage.checkedMs,o),s.coverage.checks>0&&e.jsxs(e.Fragment,{children:[" · ",s.coverage.checks.toLocaleString("en-US")," ",s.coverage.checks===1?"check":"checks"]})]}),n!==null&&e.jsxs("p",{className:"bw-gate",children:["You are browsing — a program page would count in ",ce(n)]}),r&&e.jsxs("dl",{className:"bw-key",children:[e.jsx("dt",{children:"Sweep"}),e.jsx("dd",{children:"one poll of every watched profile"}),e.jsx("dt",{children:"Dot"}),e.jsx("dd",{children:"a browser, further out the longer since it last wrote history"}),e.jsx("dt",{children:"Ring"}),e.jsx("dd",{children:"a finding, leaving the browser it came from"})]})]})}function be({watching:s,rest:t}){const[l,r]=c.useState(!1),[h,o]=c.useState(!1);return e.jsxs("section",{className:"bw-sec",children:[e.jsxs("h4",{className:"bw-sec-head",children:["Watched profiles",e.jsx("button",{className:"bw-help",onClick:()=>r(a=>!a),"aria-expanded":l,"aria-label":"What running, idle and connected to Anthropic mean",children:"?"})]}),l&&e.jsxs("dl",{className:"bw-key",children:[e.jsx("dt",{children:"Running"}),e.jsx("dd",{children:"the browser has a process on this machine right now"}),e.jsx("dt",{children:"Connected"}),e.jsx("dd",{children:"an open connection to an address Anthropic's relay uses — which it shares with claude.ai, so an open tab looks the same as an agent channel"})]}),e.jsx("ul",{className:"bw-profiles",children:s.map(a=>e.jsxs("li",{children:[e.jsx("span",{className:`bw-prof-dot${a.running?" on":""}`,"aria-hidden":!0}),e.jsx("span",{className:"bw-prof-name",children:a.name}),e.jsx("span",{className:"bw-prof-state",children:a.running?"running":"idle"}),a.running&&a.relay.state==="live"&&e.jsx("span",{className:"bw-relay",children:"connected to Anthropic"})]},a.key))}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"bw-why bw-rest-head",onClick:()=>o(a=>!a),"aria-expanded":h,children:[e.jsx("span",{className:"bw-chev","aria-hidden":!0,children:h?"▾":"▸"})," ",t.length," not watched"]}),h&&e.jsxs("p",{className:"bw-rest",children:[t.map(a=>a.name).join(", ")," — not installed, or installed and never opened, so there is no history to read."]})]})]})}function fe({snap:s,quiet:t,setQuiet:l,save:r,access:h,setAccess:o}){return e.jsxs("div",{className:"bw-settings",children:[e.jsxs("label",{title:"A program opening a page counts as a finding only if nobody had touched the browser for this long. Shorter catches more and reports more of your own work; longer is quieter.",children:[e.jsx("span",{children:"Nobody browsing for"}),e.jsxs("select",{value:t??s.settings.quietMinutes,onChange:a=>{l(Number(a.target.value)),r({quietMinutes:Number(a.target.value)})},children:[e.jsx("option",{value:1,children:"1 min"}),e.jsx("option",{value:5,children:"5 min"}),e.jsx("option",{value:15,children:"15 min"}),e.jsx("option",{value:30,children:"30 min"}),e.jsx("option",{value:60,children:"60 min"})]})]}),e.jsxs("label",{children:[e.jsx("span",{children:"When it finds one"}),e.jsx("select",{value:s.settings.reaction,onChange:a=>void r({reaction:a.target.value}),disabled:!s.settings.enabled,title:s.settings.enabled?"What to do besides writing it down.":"Turn watching on to arm a reaction.",children:(s.reactions??["notify"]).map(a=>e.jsx("option",{value:a,children:a==="notify"?"notify me":a==="close-tab"?"close the tab":"quit the browser"},a))})]}),e.jsxs("div",{className:"bw-settings-note",children:[e.jsxs("p",{children:["Chrome marks a navigation that came from an extension or a command rather than from a click. These are the ones that happened while nobody had touched the browser for the time above. ",e.jsx("strong",{children:"Usually that is your own agent doing what you asked."})]}),e.jsxs("button",{className:"bw-why",onClick:()=>o(a=>!a),"aria-expanded":h,children:[e.jsx("span",{className:"bw-chev","aria-hidden":!0,children:h?"▾":"▸"})," What Browser Watch can access"]}),h&&e.jsxs("dl",{className:"bw-access",children:[e.jsx("dt",{children:"Reads"}),e.jsxs("dd",{children:["A copy of each browser's own history database — the live file is locked while the browser holds it. Only rows newer than the moment this deck started:"," ",new Date(s.coverage.startedMs).toLocaleString(),"."]}),e.jsx("dt",{children:"Keeps"}),e.jsxs("dd",{children:["Only while the switch is on, and only the episodes it flagged — never your ordinary browsing. In ",e.jsx("code",{className:"bw-path",children:s.coverage.logPath}),typeof s.coverage.logBytes=="number"?` (${de(s.coverage.logBytes)})`:"",", with every address written in full so you can check it yourself."]}),e.jsx("dt",{children:"Sends"}),e.jsx("dd",{children:"Nothing. No part of this reads or writes over the network; the deck serves on 127.0.0.1 and this panel talks only to it."}),e.jsx("dt",{children:"Never reads"}),e.jsx("dd",{children:"Anything from before this deck started, cookies, saved passwords, page contents, or any browser profile with no history file."})]})]})]})}function H(s,t){return t?{kind:"saving",word:"Saving"}:s.settings.enabled?{kind:"on",word:"Watching"}:{kind:"off",word:"Paused"}}function ge({snap:s,saving:t,save:l,why:r,setWhy:h}){return e.jsxs("footer",{className:"bw-status",children:[e.jsx("span",{className:`bw-mode-dot${s.settings.enabled?" on":""}`,"aria-hidden":!0}),e.jsx("span",{className:"bw-mode-word",children:H(s,t).word},H(s,t).kind),e.jsx("span",{className:"bw-status-text",children:s.coverage.archived===0?s.settings.enabled?"No episodes recorded yet":"No episodes on disk":`${s.coverage.archived} ${s.coverage.archived===1?"episode":"episodes"} on disk`}),e.jsx("button",{className:`glyph-btn bw-gear${r?" on":""}`,onClick:()=>h(o=>!o),"aria-expanded":r,"aria-label":"Settings",title:"Settings",children:e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.3","aria-hidden":!0,children:[e.jsx("circle",{cx:"7",cy:"7",r:"2.1"}),e.jsx("path",{d:"M7 1.2v1.6M7 11.2v1.6M1.2 7h1.6M11.2 7h1.6M2.9 2.9l1.1 1.1M10 10l1.1 1.1M11.1 2.9L10 4M4 10l-1.1 1.1"})]})}),e.jsxs("label",{className:"bw-switch",htmlFor:"bw-enabled",children:[e.jsx("span",{className:"bw-switch-label",id:"bw-enabled-label",children:"Watch browser activity"}),e.jsx("button",{id:"bw-enabled",type:"button",role:"switch","aria-checked":s.settings.enabled,"aria-labelledby":"bw-enabled-label",className:"switch",onClick:()=>void l({enabled:!s.settings.enabled}),title:s.settings.enabled?"On — every episode it finds is written down, so the list outlives the browsing history being cleared":"Off — showing only what this deck has seen since it started. Anything an earlier run archived is hidden until you switch back on, and nothing new is kept",children:e.jsx("span",{className:"switch-knob"})})]})]})}function pe({relay:s}){const[t,l]=c.useState(!1),[r,h]=c.useState(!1),o=s.killswitch.blocked?"unblock":"block",a=s.command[o],n=c.useCallback(async()=>{await z(a.command)&&(h(!0),window.setTimeout(()=>h(!1),1600))},[a.command]),u=s.profiles.filter(i=>{var w;return(w=i.report)==null?void 0:w.present}),d=s.profiles.filter(i=>i.report===null);return e.jsxs("section",{className:"bw-sec",children:[e.jsx("h4",{className:"bw-sec-head",children:"Remote control"}),e.jsx("p",{className:`bw-rc-verdict ${s.verdict}`,role:"status",children:s.verdict==="exposed"?"Claude in Chrome is live here, so any Claude Code session signed in to your Anthropic account can drive this browser — from any machine, with no prompt on this one.":s.verdict==="protected"?`The relay is black-holed in ${s.hostsPath}, so no new connection to it can be made from this machine.`:"Claude in Chrome is not installed and enabled in any profile here, so there is nothing for the relay to drive."}),s.killswitch.foreign.length>0&&e.jsxs("p",{className:"bw-rc-foreign",children:["Another entry for this host is already in ",s.hostsPath,", and ccdeck will not touch it:",s.killswitch.foreign.map(i=>e.jsx("code",{className:"bw-path",children:i},i))]}),e.jsxs("button",{className:"bw-why",onClick:()=>l(i=>!i),"aria-expanded":t,children:[e.jsx("span",{className:"bw-chev","aria-hidden":!0,children:t?"▾":"▸"})," ",s.verdict==="protected"?"How to undo the block":"What it can reach, and how to stop it"]}),t&&e.jsxs("div",{className:"bw-rc-body",children:[u.length>0&&e.jsx("dl",{className:"bw-key",children:u.map(i=>e.jsxs(c.Fragment,{children:[e.jsxs("dt",{children:[i.name,i.profile==="Default"?"":` · ${i.profile}`]}),e.jsxs("dd",{children:[i.report.enabled?"enabled":"installed but switched off",i.report.allUrls?", can act on every site":", limited to the sites it was granted",i.report.sensitiveApis.length>0&&e.jsxs(e.Fragment,{children:[" — ",i.report.sensitiveApis.join(", ")]})]})]},`${i.browser}/${i.profile}`))}),d.length>0&&e.jsxs("p",{className:"bw-rc-note",children:[d.map(i=>i.name).join(", ")," — its settings file could not be read, so nothing is claimed about it either way."]}),!s.hostsRead&&e.jsxs("p",{className:"bw-rc-note",children:[s.hostsPath," could not be read, so whether the relay is already blocked is unknown."]}),u.some(i=>i.report.allUrls)&&e.jsxs("p",{className:"bw-rc-note",children:["Narrowing the sites in ",e.jsx("code",{className:"bw-path",children:"chrome://extensions"})," does not change this: the grant is held at the browser level and the per-site list is enforced inside the extension, by the extension."]}),e.jsxs("div",{className:"bw-rc-cmd",children:[e.jsx("code",{children:a.command}),e.jsx("button",{className:"btn bw-rc-copy",onClick:n,children:r?"Copied":"Copy"})]}),e.jsx("p",{className:"bw-rc-note",children:a.note})]})]})}function xe(s){const[t,l]=c.useState(null),[r,h]=c.useState(null),[o,a]=c.useState(null),[n,u]=c.useState(!1),d=c.useRef(!1),[i,w]=c.useState(null),[m,b]=c.useState(!1),y=c.useRef(!1),p=c.useCallback(async f=>{var j,C;if(!(f&&!X(d.current))){f&&(d.current=!0,u(!0));try{const N=await fetch(`/api/browser-watch${f?"?refresh=1":""}`);if(!N.ok)throw new Error(`the deck answered ${N.status}`);const v=await N.json();l(v),y.current||w(((j=v==null?void 0:v.settings)==null?void 0:j.quietMinutes)??15),s(((C=v==null?void 0:v.settings)==null?void 0:C.enabled)===!0),h(null)}catch(N){h(N instanceof Error?N.message:String(N))}finally{f&&(d.current=!1,u(!1))}}},[s]);c.useEffect(()=>{p(!1)},[p]),c.useEffect(()=>{const f=setInterval(()=>{p(!1)},1e4);return()=>clearInterval(f)},[p]);const P=c.useCallback(async f=>{try{await fetch("/api/browser-watch/dismiss",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({host:f.host,startMs:f.startMs})})}finally{await p(!1)}},[p]),R=c.useCallback(async f=>{y.current=!0,b(!0);try{const j=await fetch("/api/browser-watch",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(f)});if(!j.ok)throw new Error(`the deck answered ${j.status}`);await p(!1),a(null)}catch(j){a(j instanceof Error?j.message:String(j))}finally{y.current=!1,b(!1)}},[p]);return{snap:t,error:r,writeError:o,setWriteError:a,busy:n,quiet:i,setQuiet:w,saving:m,load:p,dismiss:P,save:R}}function ye({onClose:s,onSeen:t,onWatching:l,palette:r}){const h=Z(s),{snap:o,error:a,writeError:n,setWriteError:u,busy:d,quiet:i,setQuiet:w,saving:m,load:b,dismiss:y,save:p}=xe(l),[P,R]=c.useState(!1),[f,j]=c.useState(!1),C=c.useRef(null),N=c.useRef(t);N.current=t,c.useEffect(()=>()=>N.current(Date.now()),[]);const v=J(o==null?void 0:o.browsers),I=((o==null?void 0:o.browsers)??[]).filter(k=>!(k.installed&&k.profiles>0)),$=o?we(o):null,W=v.reduce((k,x)=>k+x.profiles,0);return e.jsx("div",{className:"modal-backdrop",onClick:s,role:"presentation",children:e.jsxs("div",{ref:h,className:"modal bw-modal",onClick:k=>k.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"bw-title",children:[e.jsxs("header",{className:"modal-head",children:[e.jsxs("div",{className:"modal-title",children:[e.jsx("span",{className:"modal-tool-name",id:"bw-title",children:"Browser watch"}),e.jsx("span",{className:"modal-tool-id",children:o?`${W} ${W===1?"profile":"profiles"} · local only`:"local only"})]}),e.jsxs("div",{className:"modal-actions",children:[e.jsx("button",{ref:C,className:"glyph-btn",onClick:()=>void b(!0),...ee(d),"aria-label":"Re-read every profile now",title:"Re-read every profile now",children:d?"…":"↻"}),e.jsx("button",{className:"glyph-btn",onClick:s,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]})]}),e.jsxs("div",{className:"modal-body bw-body",children:[!o&&!a&&e.jsxs("div",{className:"bw-loading",children:[e.jsx("span",{className:"bw-loading-bar","aria-hidden":!0}),e.jsx("p",{children:"Reading each browser's history. The first look copies the file, which takes a moment."})]}),a&&e.jsx("div",{className:"bw-state",children:e.jsxs("div",{className:"bw-row err",children:[e.jsx("span",{className:"bw-dot","aria-hidden":!0}),e.jsx("span",{className:"bw-row-label",children:"Could not read"}),e.jsx("span",{className:"bw-row-detail",children:a})]})}),o&&$&&e.jsx("p",{className:`bw-trouble ${$.kind}`,role:"status",children:$.text}),o&&e.jsxs("div",{className:"bw-work",children:[e.jsxs("aside",{className:"bw-side",children:[e.jsx(me,{snap:o,watching:v,palette:r}),e.jsx(be,{watching:v,rest:I}),o.relay&&e.jsx(pe,{relay:o.relay})]}),e.jsxs("div",{className:"bw-main",children:[e.jsx(ae,{snap:o,dismiss:y,refreshRef:C}),e.jsx(se,{snap:o})]})]}),o&&P&&e.jsx(fe,{snap:o,quiet:i,setQuiet:w,save:p,access:f,setAccess:j}),n&&e.jsx("div",{className:"bw-state bw-write-err",role:"alert",children:e.jsxs("div",{className:"bw-row err",children:[e.jsx("span",{className:"bw-dot","aria-hidden":!0}),e.jsx("span",{className:"bw-row-label",children:"Could not save that setting"}),e.jsxs("span",{className:"bw-row-detail",children:[n," — the switches below show what is stored, not what you pressed."]}),e.jsx("button",{className:"glyph-btn bw-write-err-x",onClick:()=>u(null),"aria-label":"Dismiss",title:"Dismiss",children:"×"})]})}),o&&e.jsx(ge,{snap:o,saving:m,save:p,why:P,setWhy:R})]})]})})}export{ye as default};
|
|
1
|
+
import{j as e,r as c,k as _,l as V,m as Y,n as z,s as X,u as Z,g as ee}from"./index-CSDSEC1Q.js";function se({snap:s}){return e.jsxs("section",{className:"bw-feed",children:[e.jsxs("h4",{className:"bw-sec-head bw-head-row",children:["Live activity",e.jsxs("span",{className:"bw-feed-count",children:[s.log.length," ",s.log.length===1?"event":"events"]})]}),e.jsx("p",{className:"bw-since bw-feed-note",children:"Pages you opened yourself — counted to run the rule, never written down. Addresses appear under Findings, and only for pages a program opened."}),e.jsx("div",{className:"bw-log","aria-live":"polite","aria-relevant":"additions",children:s.log.length===0?e.jsx("p",{className:"bw-note",children:"The deck writes a line here each time it looks at a profile."}):s.log.map(t=>e.jsxs("div",{className:`bw-log-line ${t.level}${t.parts?"":" sys"}`,children:[e.jsx("span",{className:"bw-log-time",children:new Date(t.atMs).toLocaleTimeString("en-GB",{hour12:!1})}),t.parts?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"bw-log-browser",children:t.parts.browser}),e.jsx("span",{className:"bw-log-profile",title:t.parts.profile,children:t.parts.profile}),e.jsxs("span",{className:"bw-log-value",children:[t.parts.value,t.parts.flagged>0&&e.jsxs("span",{className:"bw-log-flag",children:[" · ",t.parts.flagged," flagged"]})]})]}):e.jsx("span",{className:"bw-log-sys",children:t.text})]},`${t.atMs}-${t.level}-${t.text}`))})]})}const E=s=>`${s.host}-${s.startMs}`;function te(s){const t=l=>new Date(l).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1});return s.count===1||s.endMs-s.startMs<6e4?t(s.startMs):`${t(s.startMs)} → ${t(s.endMs)}`}function ne(s){return new Date(s).toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})}function U(s){const t=Math.round((s.endMs-s.startMs)/6e4);return t<1?"":`${t} min`}function ae({snap:s,dismiss:t,refreshRef:l}){const[r,h]=c.useState(null),o=c.useRef(new Map),a=c.useRef(null);c.useEffect(()=>{var i,w;const d=a.current;!d||s.episodes.some(m=>E(m)===d.id)||(a.current=null,_(((i=document.activeElement)==null?void 0:i.tagName)??null)&&((w=(d.next?o.current.get(d.next):void 0)??l.current)==null||w.focus()))},[s]);const n=d=>{a.current={id:E(d),next:V(s.episodes.map(E),E(d))},t(d)},u=c.useMemo(()=>{const d=[];for(const i of s.episodes){const w=ne(i.startMs),m=d[d.length-1];m&&m.label===w?m.episodes.push(i):d.push({label:w,episodes:[i]})}return d},[s]);return e.jsxs("section",{className:"bw-findings",children:[e.jsxs("h4",{className:"bw-sec-head bw-head-row",children:["Findings",s.episodes.length>0&&e.jsxs("span",{className:"bw-feed-count",children:[s.episodes.length," ",s.episodes.length===1?"episode":"episodes"]})]}),e.jsx("div",{className:"bw-eps",children:u.length===0?e.jsxs("div",{className:"bw-empty",children:[e.jsx("p",{className:"bw-empty-head",children:"Nothing found yet"}),e.jsxs("p",{className:"bw-empty-note",children:["An episode lands here when a program opens pages in a browser nobody has touched for"," ",s.settings.quietMinutes," ",s.settings.quietMinutes===1?"minute":"minutes",". On most machines that is rare, so an empty list is the ordinary result rather than a sign something is wrong."]}),!s.settings.enabled&&e.jsx("p",{className:"bw-empty-note",children:"Watching is off, so this shows only what this deck has seen since it started. Anything an earlier run recorded comes back when you switch it on."})]}):u.map(d=>e.jsxs("div",{className:"bw-day",children:[e.jsx("h4",{className:"bw-sec-head",children:d.label}),d.episodes.map(i=>{const w=E(i),m=r===w;return e.jsxs("div",{className:`bw-ep${m?" open":""}`,children:[e.jsxs("div",{className:"bw-ep-row",children:[e.jsxs("button",{className:"bw-ep-head",ref:b=>{b?o.current.set(w,b):o.current.delete(w)},onClick:()=>h(m?null:w),"aria-expanded":m,children:[e.jsx("span",{className:"bw-chev","aria-hidden":!0,children:m?"▾":"▸"}),e.jsx("span",{className:"bw-ep-host",children:i.host}),e.jsxs("span",{className:"bw-ep-meta",children:[te(i),U(i)&&e.jsxs(e.Fragment,{children:[" · ",U(i)]}),i.provisional&&e.jsxs(e.Fragment,{children:[" · ",e.jsx("span",{title:"Its quiet window has not closed yet. If somebody used the browser in the minutes after it, it is withdrawn; until then it is not written down and no reaction runs.",children:"provisional"})]})]}),e.jsxs("span",{className:"bw-ep-count",children:[i.count," ",i.count===1?"page":"pages"]})]}),e.jsx("button",{className:"glyph-btn bw-ep-x",onClick:()=>n(i),"aria-label":`Dismiss ${i.host}`,title:"Dismiss — it leaves this list for good, and stays in the log file",children:"×"})]}),m&&e.jsx("ul",{className:"bw-urls",children:i.urls.map((b,y)=>e.jsxs("li",{children:[e.jsx("span",{className:"bw-url-time",children:new Date(b.timeMs).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1})}),e.jsx("span",{className:"bw-url",children:b.url})]},`${b.url}-${b.timeMs}-${y}`))})]},w)})]},d.label))})]})}function re(s){const t=/^#?([0-9a-f]{6})$/i.exec((s??"").trim());if(!t)return!1;const l=parseInt(t[1],16),r=[l>>16&255,l>>8&255,l&255].map(h=>{const o=h/255;return o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4)});return .2126*r[0]+.7152*r[1]+.0722*r[2]>.5}const G=1e4,ie=12e3;function oe({browsers:s,findings:t,watching:l,palette:r}){const h=c.useRef(null),o=c.useRef(null);return o.current={browsers:s,findings:t,watching:l},c.useEffect(()=>{var m;const a=h.current;if(!a)return;const n=a.getContext("2d");if(!n)return;const u=((m=window.matchMedia)==null?void 0:m.call(window,"(prefers-reduced-motion: reduce)").matches)??!1;let d=0,i=!1;const w=()=>{var q;if(i)return;const b=o.current;if(!b)return;const{browsers:y,findings:p,watching:P}=b,R=r["--accent"]||"#7dd3fc",f=r["--line"]||"#1f2229",j=r["--text-dim"]||"#6e727c",C=re(r["--bg"]),N=C?42:26,v=C?.85:.65,I=Date.now(),$=Math.min(window.devicePixelRatio||1,2),W=a.clientWidth,k=a.clientHeight;(a.width!==W*$||a.height!==k*$)&&(a.width=W*$,a.height=k*$),n.setTransform($,0,0,$,0,0),n.clearRect(0,0,W,k);const x=W/2,M=k/2,S=Math.min(W,k)/2-6;n.strokeStyle=f,n.lineWidth=1,n.globalAlpha=C?1:.9;for(const g of[.4,.7,1])n.beginPath(),n.arc(x,M,S*g,0,Math.PI*2),n.stroke();n.beginPath(),n.moveTo(x-S,M),n.lineTo(x+S,M),n.moveTo(x,M-S),n.lineTo(x,M+S),n.stroke(),n.globalAlpha=1;const A=(P&&!u?I%G/G:0)*Math.PI*2-Math.PI/2;if(P){const g=(q=n.createConicGradient)==null?void 0:q.call(n,A-.85,x,M);g&&(g.addColorStop(0,"transparent"),g.addColorStop(.85/(Math.PI*2),`color-mix(in srgb, ${R} ${N}%, transparent)`),g.addColorStop(1,"transparent"),n.fillStyle=g,n.beginPath(),n.moveTo(x,M),n.arc(x,M,S,A-.85,A),n.closePath(),n.fill()),n.strokeStyle=R,n.globalAlpha=v,n.beginPath(),n.moveTo(x,M),n.lineTo(x+Math.cos(A)*S,M+Math.sin(A)*S),n.stroke(),n.globalAlpha=1}y.forEach((g,T)=>{const B=T/Math.max(y.length,1)*Math.PI*2-Math.PI/2,D=g.lastReadMs===null?1:Math.min(1,(I-g.lastReadMs)/12e4),O=S*(.42+D*.5),F=x+Math.cos(B)*O,L=M+Math.sin(B)*O,Q=Math.abs((A-B+Math.PI*3)%(Math.PI*2)-Math.PI),K=P?Math.max(0,1-Q/.55):0;n.beginPath(),n.arc(F,L,3+K*1.6,0,Math.PI*2),n.fillStyle=g.running?R:j,n.globalAlpha=g.running?.55+K*.45:.35,n.fill(),n.globalAlpha=1});for(const g of p){const T=(I-g.atMs)/ie;if(T<0||T>1)continue;const D=Math.max(0,y.findIndex(L=>L.key===g.browser))/Math.max(y.length,1)*Math.PI*2-Math.PI/2,O=x+Math.cos(D)*S*.6,F=M+Math.sin(D)*S*.6;n.beginPath(),n.arc(O,F,4+T*22,0,Math.PI*2),n.strokeStyle=R,n.globalAlpha=(1-T)*.8,n.lineWidth=1.5,n.stroke(),n.globalAlpha=1}d=requestAnimationFrame(w)};return w(),()=>{i=!0,cancelAnimationFrame(d)}},[r]),e.jsx("canvas",{ref:h,className:"bw-radar",role:"img","aria-label":l?`Watching ${s.length} browser${s.length===1?"":"s"}`:"Not watching"})}function le(s,t,l){if(s===null)return null;const r=s+t-l;return r>0?r:null}function ce(s){const t=Math.ceil(s/1e3),l=Math.floor(t/60),r=t%60;return l>0?`${l}m ${r}s`:`${r}s`}function J(s){return(s??[]).filter(t=>t.installed&&t.profiles>0)}function de(s){return!Number.isFinite(s)||s<=0?"empty":Y(s)}function he(s,t){return s.map(l=>({key:l.key,name:l.name,running:l.running,visits:t.filter(r=>r.browser===l.key).reduce((r,h)=>r+h.programVisits,0)}))}function ue(s,t){if(s===null)return null;const l=Math.max(0,Math.round((t-s)/1e3));if(l<5)return"just now";if(l<60)return`${l} sec ago`;const r=Math.round(l/60);return r<60?`${r} min ago`:`${Math.round(r/60)} hr ago`}function we(s){const t=s.profiles.filter(r=>r.degraded);if(t.length>0){const r=t[0],h=t.length-1;return{kind:"unreadable",text:`${r.name}/${r.profile} could not be read — ${r.reason??"no reason given"}`+(h>0?`, and ${h} more`:"")+". The watch continues on the profiles it can read."}}const l=J(s.browsers);return l.length===0?{kind:"no-profiles",text:"No browser on this machine has a profile to read. Open one of the browsers below once and it will be watched from then on."}:l.some(r=>r.running)?null:{kind:"none-running",text:"No watched browser is running, so nothing can be navigated right now. Their history is still read, and anything found while they were open is still here."}}function me({snap:s,watching:t,palette:l}){const[r,h]=c.useState(!1),[o,a]=c.useState(()=>Date.now());c.useEffect(()=>{const u=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(u)},[]);const n=le(s.coverage.lastHumanMs,s.coverage.quietMs,o);return e.jsxs("section",{className:"bw-sec",children:[e.jsxs("h4",{className:"bw-sec-head",children:["Activity overview",e.jsx("button",{className:"bw-help",onClick:()=>h(u=>!u),"aria-expanded":r,"aria-label":"What the sweep and the dots mean",children:"?"})]}),e.jsxs("div",{className:"bw-glance",children:[e.jsx(oe,{browsers:t.map(u=>{var d;return{key:u.key,name:u.name,running:u.running,lastReadMs:((d=s.profiles.find(i=>i.browser===u.key))==null?void 0:d.lastWrittenMs)??null}}),findings:s.episodes.slice(0,6).map(u=>({browser:u.browser??null,atMs:u.endMs})),watching:s.settings.enabled,palette:l}),e.jsx("ul",{className:"bw-counts",children:he(t,s.profiles).map(u=>e.jsxs("li",{children:[e.jsx("span",{className:"bw-count-n",children:u.visits.toLocaleString("en-US")}),e.jsx("span",{className:"bw-count-of",children:u.name})]},u.key))})]}),e.jsx("p",{className:"bw-since",children:"Pages a program opened, since this deck started"}),s.coverage.checkedMs>0&&e.jsxs("p",{className:"bw-since",children:["Last checked ",ue(s.coverage.checkedMs,o),s.coverage.checks>0&&e.jsxs(e.Fragment,{children:[" · ",s.coverage.checks.toLocaleString("en-US")," ",s.coverage.checks===1?"check":"checks"]})]}),n!==null&&e.jsxs("p",{className:"bw-gate",children:["You are browsing — a program page would count in ",ce(n)]}),r&&e.jsxs("dl",{className:"bw-key",children:[e.jsx("dt",{children:"Sweep"}),e.jsx("dd",{children:"one poll of every watched profile"}),e.jsx("dt",{children:"Dot"}),e.jsx("dd",{children:"a browser, further out the longer since it last wrote history"}),e.jsx("dt",{children:"Ring"}),e.jsx("dd",{children:"a finding, leaving the browser it came from"})]})]})}function be({watching:s,rest:t}){const[l,r]=c.useState(!1),[h,o]=c.useState(!1);return e.jsxs("section",{className:"bw-sec",children:[e.jsxs("h4",{className:"bw-sec-head",children:["Watched profiles",e.jsx("button",{className:"bw-help",onClick:()=>r(a=>!a),"aria-expanded":l,"aria-label":"What running, idle and connected to Anthropic mean",children:"?"})]}),l&&e.jsxs("dl",{className:"bw-key",children:[e.jsx("dt",{children:"Running"}),e.jsx("dd",{children:"the browser has a process on this machine right now"}),e.jsx("dt",{children:"Connected"}),e.jsx("dd",{children:"an open connection to an address Anthropic's relay uses — which it shares with claude.ai, so an open tab looks the same as an agent channel"})]}),e.jsx("ul",{className:"bw-profiles",children:s.map(a=>e.jsxs("li",{children:[e.jsx("span",{className:`bw-prof-dot${a.running?" on":""}`,"aria-hidden":!0}),e.jsx("span",{className:"bw-prof-name",children:a.name}),e.jsx("span",{className:"bw-prof-state",children:a.running?"running":"idle"}),a.running&&a.relay.state==="live"&&e.jsx("span",{className:"bw-relay",children:"connected to Anthropic"})]},a.key))}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{className:"bw-why bw-rest-head",onClick:()=>o(a=>!a),"aria-expanded":h,children:[e.jsx("span",{className:"bw-chev","aria-hidden":!0,children:h?"▾":"▸"})," ",t.length," not watched"]}),h&&e.jsxs("p",{className:"bw-rest",children:[t.map(a=>a.name).join(", ")," — not installed, or installed and never opened, so there is no history to read."]})]})]})}function fe({snap:s,quiet:t,setQuiet:l,save:r,access:h,setAccess:o}){return e.jsxs("div",{className:"bw-settings",children:[e.jsxs("label",{title:"A program opening a page counts as a finding only if nobody had touched the browser for this long. Shorter catches more and reports more of your own work; longer is quieter.",children:[e.jsx("span",{children:"Nobody browsing for"}),e.jsxs("select",{value:t??s.settings.quietMinutes,onChange:a=>{l(Number(a.target.value)),r({quietMinutes:Number(a.target.value)})},children:[e.jsx("option",{value:1,children:"1 min"}),e.jsx("option",{value:5,children:"5 min"}),e.jsx("option",{value:15,children:"15 min"}),e.jsx("option",{value:30,children:"30 min"}),e.jsx("option",{value:60,children:"60 min"})]})]}),e.jsxs("label",{children:[e.jsx("span",{children:"When it finds one"}),e.jsx("select",{value:s.settings.reaction,onChange:a=>void r({reaction:a.target.value}),disabled:!s.settings.enabled,title:s.settings.enabled?"What to do besides writing it down.":"Turn watching on to arm a reaction.",children:(s.reactions??["notify"]).map(a=>e.jsx("option",{value:a,children:a==="notify"?"notify me":a==="close-tab"?"close the tab":"quit the browser"},a))})]}),e.jsxs("div",{className:"bw-settings-note",children:[e.jsxs("p",{children:["Chrome marks a navigation that came from an extension or a command rather than from a click. These are the ones that happened while nobody had touched the browser for the time above. ",e.jsx("strong",{children:"Usually that is your own agent doing what you asked."})]}),e.jsxs("button",{className:"bw-why",onClick:()=>o(a=>!a),"aria-expanded":h,children:[e.jsx("span",{className:"bw-chev","aria-hidden":!0,children:h?"▾":"▸"})," What Browser Watch can access"]}),h&&e.jsxs("dl",{className:"bw-access",children:[e.jsx("dt",{children:"Reads"}),e.jsxs("dd",{children:["A copy of each browser's own history database — the live file is locked while the browser holds it. Only rows newer than the moment this deck started:"," ",new Date(s.coverage.startedMs).toLocaleString(),"."]}),e.jsx("dt",{children:"Keeps"}),e.jsxs("dd",{children:["Only while the switch is on, and only the episodes it flagged — never your ordinary browsing. In ",e.jsx("code",{className:"bw-path",children:s.coverage.logPath}),typeof s.coverage.logBytes=="number"?` (${de(s.coverage.logBytes)})`:"",", with every address written in full so you can check it yourself."]}),e.jsx("dt",{children:"Sends"}),e.jsx("dd",{children:"Nothing. No part of this reads or writes over the network; the deck serves on 127.0.0.1 and this panel talks only to it."}),e.jsx("dt",{children:"Never reads"}),e.jsx("dd",{children:"Anything from before this deck started, cookies, saved passwords, page contents, or any browser profile with no history file."})]})]})]})}function H(s,t){return t?{kind:"saving",word:"Saving"}:s.settings.enabled?{kind:"on",word:"Watching"}:{kind:"off",word:"Paused"}}function ge({snap:s,saving:t,save:l,why:r,setWhy:h}){return e.jsxs("footer",{className:"bw-status",children:[e.jsx("span",{className:`bw-mode-dot${s.settings.enabled?" on":""}`,"aria-hidden":!0}),e.jsx("span",{className:"bw-mode-word",children:H(s,t).word},H(s,t).kind),e.jsx("span",{className:"bw-status-text",children:s.coverage.archived===0?s.settings.enabled?"No episodes recorded yet":"No episodes on disk":`${s.coverage.archived} ${s.coverage.archived===1?"episode":"episodes"} on disk`}),e.jsx("button",{className:`glyph-btn bw-gear${r?" on":""}`,onClick:()=>h(o=>!o),"aria-expanded":r,"aria-label":"Settings",title:"Settings",children:e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.3","aria-hidden":!0,children:[e.jsx("circle",{cx:"7",cy:"7",r:"2.1"}),e.jsx("path",{d:"M7 1.2v1.6M7 11.2v1.6M1.2 7h1.6M11.2 7h1.6M2.9 2.9l1.1 1.1M10 10l1.1 1.1M11.1 2.9L10 4M4 10l-1.1 1.1"})]})}),e.jsxs("label",{className:"bw-switch",htmlFor:"bw-enabled",children:[e.jsx("span",{className:"bw-switch-label",id:"bw-enabled-label",children:"Watch browser activity"}),e.jsx("button",{id:"bw-enabled",type:"button",role:"switch","aria-checked":s.settings.enabled,"aria-labelledby":"bw-enabled-label",className:"switch",onClick:()=>void l({enabled:!s.settings.enabled}),title:s.settings.enabled?"On — every episode it finds is written down, so the list outlives the browsing history being cleared":"Off — showing only what this deck has seen since it started. Anything an earlier run archived is hidden until you switch back on, and nothing new is kept",children:e.jsx("span",{className:"switch-knob"})})]})]})}function pe({relay:s}){const[t,l]=c.useState(!1),[r,h]=c.useState(!1),o=s.killswitch.blocked?"unblock":"block",a=s.command[o],n=c.useCallback(async()=>{await z(a.command)&&(h(!0),window.setTimeout(()=>h(!1),1600))},[a.command]),u=s.profiles.filter(i=>{var w;return(w=i.report)==null?void 0:w.present}),d=s.profiles.filter(i=>i.report===null);return e.jsxs("section",{className:"bw-sec",children:[e.jsx("h4",{className:"bw-sec-head",children:"Remote control"}),e.jsx("p",{className:`bw-rc-verdict ${s.verdict}`,role:"status",children:s.verdict==="exposed"?"Claude in Chrome is live here, so any Claude Code session signed in to your Anthropic account can drive this browser — from any machine, with no prompt on this one.":s.verdict==="protected"?`The relay is black-holed in ${s.hostsPath}, so no new connection to it can be made from this machine.`:"Claude in Chrome is not installed and enabled in any profile here, so there is nothing for the relay to drive."}),s.killswitch.foreign.length>0&&e.jsxs("p",{className:"bw-rc-foreign",children:["Another entry for this host is already in ",s.hostsPath,", and ccdeck will not touch it:",s.killswitch.foreign.map(i=>e.jsx("code",{className:"bw-path",children:i},i))]}),e.jsxs("button",{className:"bw-why",onClick:()=>l(i=>!i),"aria-expanded":t,children:[e.jsx("span",{className:"bw-chev","aria-hidden":!0,children:t?"▾":"▸"})," ",s.verdict==="protected"?"How to undo the block":"What it can reach, and how to stop it"]}),t&&e.jsxs("div",{className:"bw-rc-body",children:[u.length>0&&e.jsx("dl",{className:"bw-key",children:u.map(i=>e.jsxs(c.Fragment,{children:[e.jsxs("dt",{children:[i.name,i.profile==="Default"?"":` · ${i.profile}`]}),e.jsxs("dd",{children:[i.report.enabled?"enabled":"installed but switched off",i.report.allUrls?", can act on every site":", limited to the sites it was granted",i.report.sensitiveApis.length>0&&e.jsxs(e.Fragment,{children:[" — ",i.report.sensitiveApis.join(", ")]})]})]},`${i.browser}/${i.profile}`))}),d.length>0&&e.jsxs("p",{className:"bw-rc-note",children:[d.map(i=>i.name).join(", ")," — its settings file could not be read, so nothing is claimed about it either way."]}),!s.hostsRead&&e.jsxs("p",{className:"bw-rc-note",children:[s.hostsPath," could not be read, so whether the relay is already blocked is unknown."]}),u.some(i=>i.report.allUrls)&&e.jsxs("p",{className:"bw-rc-note",children:["Narrowing the sites in ",e.jsx("code",{className:"bw-path",children:"chrome://extensions"})," does not change this: the grant is held at the browser level and the per-site list is enforced inside the extension, by the extension."]}),e.jsxs("div",{className:"bw-rc-cmd",children:[e.jsx("code",{children:a.command}),e.jsx("button",{className:"btn bw-rc-copy",onClick:n,children:r?"Copied":"Copy"})]}),e.jsx("p",{className:"bw-rc-note",children:a.note})]})]})}function xe(s){const[t,l]=c.useState(null),[r,h]=c.useState(null),[o,a]=c.useState(null),[n,u]=c.useState(!1),d=c.useRef(!1),[i,w]=c.useState(null),[m,b]=c.useState(!1),y=c.useRef(!1),p=c.useCallback(async f=>{var j,C;if(!(f&&!X(d.current))){f&&(d.current=!0,u(!0));try{const N=await fetch(`/api/browser-watch${f?"?refresh=1":""}`);if(!N.ok)throw new Error(`the deck answered ${N.status}`);const v=await N.json();l(v),y.current||w(((j=v==null?void 0:v.settings)==null?void 0:j.quietMinutes)??15),s(((C=v==null?void 0:v.settings)==null?void 0:C.enabled)===!0),h(null)}catch(N){h(N instanceof Error?N.message:String(N))}finally{f&&(d.current=!1,u(!1))}}},[s]);c.useEffect(()=>{p(!1)},[p]),c.useEffect(()=>{const f=setInterval(()=>{p(!1)},1e4);return()=>clearInterval(f)},[p]);const P=c.useCallback(async f=>{try{await fetch("/api/browser-watch/dismiss",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({host:f.host,startMs:f.startMs})})}finally{await p(!1)}},[p]),R=c.useCallback(async f=>{y.current=!0,b(!0);try{const j=await fetch("/api/browser-watch",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(f)});if(!j.ok)throw new Error(`the deck answered ${j.status}`);await p(!1),a(null)}catch(j){a(j instanceof Error?j.message:String(j))}finally{y.current=!1,b(!1)}},[p]);return{snap:t,error:r,writeError:o,setWriteError:a,busy:n,quiet:i,setQuiet:w,saving:m,load:p,dismiss:P,save:R}}function ye({onClose:s,onSeen:t,onWatching:l,palette:r}){const h=Z(s),{snap:o,error:a,writeError:n,setWriteError:u,busy:d,quiet:i,setQuiet:w,saving:m,load:b,dismiss:y,save:p}=xe(l),[P,R]=c.useState(!1),[f,j]=c.useState(!1),C=c.useRef(null),N=c.useRef(t);N.current=t,c.useEffect(()=>()=>N.current(Date.now()),[]);const v=J(o==null?void 0:o.browsers),I=((o==null?void 0:o.browsers)??[]).filter(k=>!(k.installed&&k.profiles>0)),$=o?we(o):null,W=v.reduce((k,x)=>k+x.profiles,0);return e.jsx("div",{className:"modal-backdrop",onClick:s,role:"presentation",children:e.jsxs("div",{ref:h,className:"modal bw-modal",onClick:k=>k.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"bw-title",children:[e.jsxs("header",{className:"modal-head",children:[e.jsxs("div",{className:"modal-title",children:[e.jsx("span",{className:"modal-tool-name",id:"bw-title",children:"Browser watch"}),e.jsx("span",{className:"modal-tool-id",children:o?`${W} ${W===1?"profile":"profiles"} · local only`:"local only"})]}),e.jsxs("div",{className:"modal-actions",children:[e.jsx("button",{ref:C,className:"glyph-btn",onClick:()=>void b(!0),...ee(d),"aria-label":"Re-read every profile now",title:"Re-read every profile now",children:d?"…":"↻"}),e.jsx("button",{className:"glyph-btn",onClick:s,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]})]}),e.jsxs("div",{className:"modal-body bw-body",children:[!o&&!a&&e.jsxs("div",{className:"bw-loading",children:[e.jsx("span",{className:"bw-loading-bar","aria-hidden":!0}),e.jsx("p",{children:"Reading each browser's history. The first look copies the file, which takes a moment."})]}),a&&e.jsx("div",{className:"bw-state",children:e.jsxs("div",{className:"bw-row err",children:[e.jsx("span",{className:"bw-dot","aria-hidden":!0}),e.jsx("span",{className:"bw-row-label",children:"Could not read"}),e.jsx("span",{className:"bw-row-detail",children:a})]})}),o&&$&&e.jsx("p",{className:`bw-trouble ${$.kind}`,role:"status",children:$.text}),o&&e.jsxs("div",{className:"bw-work",children:[e.jsxs("aside",{className:"bw-side",children:[e.jsx(me,{snap:o,watching:v,palette:r}),e.jsx(be,{watching:v,rest:I}),o.relay&&e.jsx(pe,{relay:o.relay})]}),e.jsxs("div",{className:"bw-main",children:[e.jsx(ae,{snap:o,dismiss:y,refreshRef:C}),e.jsx(se,{snap:o})]})]}),o&&P&&e.jsx(fe,{snap:o,quiet:i,setQuiet:w,save:p,access:f,setAccess:j}),n&&e.jsx("div",{className:"bw-state bw-write-err",role:"alert",children:e.jsxs("div",{className:"bw-row err",children:[e.jsx("span",{className:"bw-dot","aria-hidden":!0}),e.jsx("span",{className:"bw-row-label",children:"Could not save that setting"}),e.jsxs("span",{className:"bw-row-detail",children:[n," — the switches below show what is stored, not what you pressed."]}),e.jsx("button",{className:"glyph-btn bw-write-err-x",onClick:()=>u(null),"aria-label":"Dismiss",title:"Dismiss",children:"×"})]})}),o&&e.jsx(ge,{snap:o,saving:m,save:p,why:P,setWhy:R})]})]})})}export{ye as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as U,f as p,r as c,s as Z,p as _,j as a,b as g,c as O,u as D,d as ee,e as se,g as E,h as ae,i as te}from"./index-
|
|
1
|
+
import{a as U,f as p,r as c,s as Z,p as _,j as a,b as g,c as O,u as D,d as ee,e as se,g as E,h as ae,i as te}from"./index-CSDSEC1Q.js";function ne(s){return!s.answer||s.answer.range!==s.want?{phase:"busy",stale:!1}:s.answer.ok?{phase:s.answer.days>0?"chart":"empty",stale:s.loading}:{phase:"error",stale:s.loading}}function I(s){const e=new Map;for(const n of s)for(const o of n.agents??[]){if(!o||typeof o.agent!="string"||o.agent==="")continue;const r=e.get(o.agent)??{id:o.agent,cost:0,tokens:0};r.cost+=Number.isFinite(o.totalCost)?o.totalCost:0,r.tokens+=Number.isFinite(o.totalTokens)?o.totalTokens:0,e.set(o.agent,r)}return[...e.values()].sort((n,o)=>o.cost-n.cost||n.id.localeCompare(o.id))}function oe(s){const e=I([{agents:s}]);return e.length<2?null:e.map(n=>`${U(n.id)} ${p(n.cost)}`).join(" · ")}function F(s){switch(s.toLowerCase()){case"claude":return"var(--model-opus)";case"codex":return"var(--model-codex)";case"gemini":return"var(--model-gemini)";case"copilot":return"var(--model-haiku)";default:return"var(--model-other)"}}function le(s,e){if(!(e>0)||!(s>0))return"0%";const n=s/e*100;return n<.1?"<0.1%":`${n.toFixed(1)}%`}const u=s=>typeof s=="number"&&Number.isFinite(s)?s:0,M=s=>typeof s=="string"?s:"",P=s=>Array.isArray(s)?s.filter(e=>typeof e=="string"):[];function re(s){const e=s??{};return{modelName:M(e.modelName),cost:u(e.cost),inputTokens:u(e.inputTokens),outputTokens:u(e.outputTokens),cacheCreationTokens:u(e.cacheCreationTokens),cacheReadTokens:u(e.cacheReadTokens)}}function ce(s){const e=s??{},n=Array.isArray(e.agents)?e.agents.map(o=>{const r=o??{};return{agent:M(r.agent),totalCost:u(r.totalCost),totalTokens:u(r.totalTokens)}}):void 0;return{period:M(e.period),totalCost:u(e.totalCost),totalTokens:u(e.totalTokens),inputTokens:u(e.inputTokens),outputTokens:u(e.outputTokens),cacheCreationTokens:u(e.cacheCreationTokens),cacheReadTokens:u(e.cacheReadTokens),modelsUsed:P(e.modelsUsed),modelBreakdowns:Array.isArray(e.modelBreakdowns)?e.modelBreakdowns.map(re):[],...n?{agents:n}:{},...e.metadata&&typeof e.metadata=="object"?{metadata:{agents:P(e.metadata.agents)}}:{}}}function ie(s){const e=s??{};return{...e,ok:e.ok===!0,days:Array.isArray(e.days)?e.days.map(ce):void 0}}function T(s){const e=s.toLowerCase();return e.includes("opus")?"var(--model-opus)":e.includes("sonnet")?"var(--model-sonnet)":e.includes("haiku")?"var(--model-haiku)":e.includes("gpt-5")||e.includes("gpt5")?"var(--model-gpt5)":e.includes("gpt")?"var(--model-gpt)":e.includes("gemini")?"var(--model-gemini)":e.includes("codex")?"var(--model-codex)":e.includes("fable")||e.includes("mythos")?"var(--model-fable)":"var(--model-other)"}function ue(s){let e=0,n=0,o=0,r=0;const m=new Map;for(const l of s){e+=l.totalCost,n+=l.totalTokens,o+=l.inputTokens+l.outputTokens,r+=l.cacheReadTokens;for(const d of l.modelBreakdowns)m.set(d.modelName,(m.get(d.modelName)??0)+d.cost)}return{totalCost:e,totalTok:n,inOut:o,cacheRead:r,modelCosts:m}}function de(s){return Array.from(s.entries()).sort((e,n)=>n[1]-e[1])}function q(s){return s.slice().sort((e,n)=>n.cost-e.cost)}function C(s,e){return e>0?s/e*100:0}function he(s){var n,o;return oe(s.agents)??((o=(n=s.metadata)==null?void 0:n.agents)!=null&&o.length?s.metadata.agents.join(" · "):null)}function me(){let s=0;return{begin(){const e=++s;return()=>e===s},cancel(){s++}}}function pe(s){const[e,n]=c.useState(null),[o,r]=c.useState(!1),m=c.useState(me)[0],l=c.useRef(!1),d=(f=!1)=>{if(f&&!Z(l.current))return;const x=m.begin();l.current=f;const k=s;r(!0);const i=`/api/ccusage?since=${_(k)}${f?"&refresh=1":""}`;fetch(i).then(j=>j.json()).then(j=>{x()&&n({range:k,resp:ie(j)})}).catch(()=>{x()&&n({range:k,resp:{ok:!1,reason:"unreachable"}})}).finally(()=>{x()&&(l.current=!1,r(!1))})};return c.useEffect(()=>(d(!1),()=>m.cancel()),[s]),{landed:e,loading:o,reload:()=>d(!0)}}function ge({selectedDay:s}){const e=he(s);return a.jsxs("div",{className:"uh-detail",children:[a.jsxs("div",{className:"uh-detail-head",children:[a.jsx("span",{className:"uh-detail-date",children:s.period}),a.jsx("span",{className:"uh-detail-cost",children:p(s.totalCost)}),e&&a.jsx("span",{className:"uh-detail-agents",title:e,children:e})]}),a.jsxs("div",{className:"uh-detail-mini",children:[a.jsx(y,{label:"input",val:g(s.inputTokens)}),a.jsx(y,{label:"output",val:g(s.outputTokens)}),a.jsx(y,{label:"cache write",val:g(s.cacheCreationTokens)}),a.jsx(y,{label:"cache read",val:g(s.cacheReadTokens)})]}),a.jsx("div",{className:"uh-detail-models",children:q(s.modelBreakdowns).map(n=>{const o=C(n.cost,s.totalCost);return a.jsxs("div",{className:"uh-model-row",title:n.modelName,children:[a.jsxs("span",{className:"uh-model-name",children:[a.jsx("span",{className:"uh-legend-dot",style:{background:T(n.modelName)}}),a.jsx("span",{className:"uh-model-label",children:O(n.modelName)})]}),a.jsx("span",{className:"uh-model-bar",children:a.jsx("span",{className:"uh-model-bar-fill",style:{width:`${o}%`,background:T(n.modelName)}})}),a.jsx("span",{className:"uh-model-cost",children:p(n.cost)})]},n.modelName)})})]})}function y({label:s,val:e}){return a.jsxs("div",{className:"uh-ministat",children:[a.jsx("span",{className:"uh-ministat-val",children:e}),a.jsx("span",{className:"uh-ministat-label",children:s})]})}const fe=[7,14,30,90];function je({onClose:s,providers:e}){var B;const[n,o]=c.useState(30),[r,m]=c.useState(null),{landed:l,loading:d,reload:f}=pe(n),x=c.useRef(null),k=D(s,{focusRef:x}),h=ne({loading:d,want:n,answer:l&&{range:l.range,ok:l.resp.ok===!0,days:((B=l.resp.days)==null?void 0:B.length)??0}}),i=h.phase==="chart"?l.resp.days??[]:[],j=c.useRef(null),G=ee(h.phase!=="error",j),H=c.useMemo(()=>i.reduce((t,N)=>Math.max(t,N.totalCost),0),[i]),S=c.useRef(null);c.useLayoutEffect(()=>{const t=S.current;t&&(t.scrollLeft=t.scrollWidth)},[i]);const{totalCost:w,totalTok:V,inOut:W,cacheRead:z,modelCosts:A}=c.useMemo(()=>ue(i),[i]),J=c.useMemo(()=>de(A),[A]),b=c.useMemo(()=>I(i),[i]),K=b.length>1,L=r?i.find(t=>t.period===r)??null:null;return a.jsx("div",{className:"modal-backdrop",onClick:s,role:"presentation",children:a.jsxs("div",{ref:k,className:"modal uh-modal",onClick:t=>t.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":"Usage history",children:[a.jsxs("header",{className:"uh-head",children:[a.jsxs("div",{className:"uh-titlewrap",children:[a.jsx("div",{className:"uh-title",children:"Usage history"}),a.jsx("div",{className:"uh-sub",children:h.stale?"running ccusage…":se(e,b.map(t=>t.id))})]}),a.jsx("div",{className:"uh-range",role:"group","aria-label":"Range",children:fe.map(t=>a.jsxs("button",{type:"button","aria-pressed":n===t,className:"uh-range-btn",onClick:()=>{o(t),m(null)},children:[t,"d"]},t))}),a.jsx("button",{ref:j,className:"glyph-btn uh-reload",onClick:f,...E(d),title:"Re-run ccusage","aria-label":"Reload",children:d?"…":"↻"}),a.jsx("button",{ref:x,className:"glyph-btn uh-close",onClick:s,"aria-label":"Close",children:"×"})]}),h.phase==="busy"?a.jsxs("div",{className:"uh-status uh-status-wait","aria-busy":"true",children:[a.jsx("span",{className:"uh-wait-word",children:l?"running ccusage…":"running ccusage… (first run downloads the package)"}),a.jsx("span",{className:"uh-wait-axis","aria-hidden":!0})]}):h.phase==="error"?a.jsxs("div",{className:"uh-status uh-err",title:te(l.resp)||void 0,children:[ae(l.resp,"ccusage did not report usage"),a.jsx("div",{children:a.jsx("button",{className:"btn uh-retry",onClick:()=>{G(),f()},...E(d),children:d?"trying…":"Try again"})})]}):h.phase==="empty"?a.jsx("div",{className:`uh-status${h.stale?" uh-stale":""}`,"aria-busy":h.stale||void 0,children:"no usage in this range"}):a.jsxs("div",{className:h.stale?"uh-stale":void 0,"aria-busy":h.stale||void 0,children:[a.jsxs("div",{className:"uh-totals",children:[a.jsx(v,{label:"total cost",val:p(w),accent:!0}),a.jsx(v,{label:"tokens",val:g(V)}),a.jsx(v,{label:"input+output",val:g(W)}),a.jsx(v,{label:"cache reads",val:g(z)})]}),K&&a.jsxs("div",{className:"uh-agents",role:"group","aria-label":"Cost by CLI",children:[a.jsx("div",{className:"uh-agent-bar","aria-hidden":"true",children:b.map(t=>a.jsx("span",{className:"uh-agent-seg",style:{width:`${C(t.cost,w)}%`,background:F(t.id)}},t.id))}),a.jsx("div",{className:"uh-agent-keys",children:b.map(t=>a.jsxs("span",{className:"uh-agent-key",title:`${t.id} · ${g(t.tokens)} tokens`,children:[a.jsx("span",{className:"uh-legend-dot",style:{background:F(t.id)}}),U(t.id),a.jsx("span",{className:"uh-agent-cost",children:p(t.cost)}),a.jsx("span",{className:"uh-agent-share",children:le(t.cost,w)})]},t.id))})]}),a.jsx("div",{ref:S,className:"uh-chart",role:"group","aria-label":"Daily cost by model",children:i.map((t,N)=>{const Q=C(t.totalCost,H),R=t.period===r,X=`${t.period}, ${p(t.totalCost)}`;return a.jsxs("button",{className:`uh-bar-col${R?" sel":""}`,onClick:()=>m(R?null:t.period),"aria-pressed":R,"aria-label":X,title:`${t.period} · ${p(t.totalCost)}`,style:{flexBasis:`${100/i.length}%`,"--uh-i":N,"--uh-step":`${Math.min(10,200/Math.max(i.length,1))}ms`},children:[a.jsx("div",{className:"uh-bar",style:{height:`${Math.max(Q,t.totalCost>0?2:0)}%`},children:q(t.modelBreakdowns).map($=>{const Y=C($.cost,t.totalCost);return a.jsx("div",{className:"uh-bar-seg",style:{height:`${Y}%`,background:T($.modelName)}},$.modelName)})}),a.jsx("span",{className:"uh-bar-label",children:t.period.slice(5)})]},t.period)})}),a.jsx("div",{className:"uh-legend",children:J.map(([t,N])=>a.jsxs("span",{className:"uh-legend-item",title:t,children:[a.jsx("span",{className:"uh-legend-dot",style:{background:T(t)}}),O(t)," ",a.jsx("span",{className:"uh-legend-cost",children:p(N)})]},t))}),L&&a.jsx(ge,{selectedDay:L})]})]})})}function v({label:s,val:e,accent:n}){return a.jsxs("div",{className:"uh-stat",children:[a.jsx("span",{className:`uh-stat-val${n?" accent":""}`,children:e}),a.jsx("span",{className:"uh-stat-label",children:s})]})}export{je as default};
|
|
@@ -95,7 +95,7 @@ ${e.map(s=>` ${s.label}: ${ti(s.waiting)} (${ad(r-s.waiting.since)})`).join(`
|
|
|
95
95
|
`)}`,"aria-label":`${e.length} session${e.length===1?"":"s"} waiting for you`,children:[a.jsx("span",{className:"ap-pulse","aria-hidden":!0}),a.jsx("b",{children:e.length})," ",a.jsx("span",{className:"ws-word",children:"waiting"})]})}const Hx={on:"The deck will raise a system notification when a session blocks on you and this tab is in the background",blocked:"Notifications are blocked for this page. Only your browser can undo that — its site settings for this address"};function Yte(e){return e==="on"?`Notifications on. ${Hx.on}.`:e==="blocked"?`${Hx.blocked}.`:""}function Xte({notifySaid:e}){return a.jsx("span",{className:e==="on"?"notify-said":"notify-said notify-said-blocked","aria-hidden":!0,title:Hx[e],children:e==="on"?"notifications on":"notifications blocked"})}function Zte({versionCheck:e,welcome:t,desktopUpdate:n,pause:r,monthly:s,announcements:i,notify:l,waitingSessions:u,waitingCursorRef:d,focusSession:f,live:h,now:p,incidents:g}){const{version:v,notice:k,noticeOpen:b,showNotice:x,versionChecking:N,loadVersion:S}=e,{chipVersion:_,openReleaseNotes:E}=t,{readyAppUpdate:T}=n,{paused:R,pauseGate:A}=r,{monthlyUsage:B,monthlyUsageUnavailable:L,monthUsageRef:F}=s,{blockedSaid:I,watchSaid:O,incidentSaid:z}=i,{notifySaid:M}=l;return a.jsxs("div",{className:"readout",children:[a.jsxs("div",{className:"brand",children:[a.jsx("span",{className:"logo"}),a.jsx("h1",{children:kt}),a.jsx(Vte,{readyAppUpdate:T,notice:k,noticeOpen:b,version:v,chipVersion:_,versionChecking:N,now:p,openReleaseNotes:E,showNotice:x,loadVersion:S})]}),a.jsx(Gte,{live:h,paused:R,pauseGate:A,monthUsageRef:F,monthlyUsage:B,monthlyUsageUnavailable:L}),a.jsx("div",{className:"vis-hidden",role:"status","aria-atomic":"true",children:I}),a.jsx("div",{className:"vis-hidden",role:"status","aria-atomic":"true",children:O}),a.jsx("div",{className:"vis-hidden",role:"status","aria-atomic":"true",children:z}),a.jsx("div",{className:"vis-hidden",role:"status","aria-atomic":"true",children:Yte(M)}),a.jsx(Kz,{incidents:g}),u.length>0&&a.jsx(Kte,{waitingSessions:u,waitingCursorRef:d,focusSession:f,now:p}),M&&a.jsx(Xte,{notifySaid:M})]})}function Jte({selected:e,now:t,selectedIds:n,focusAgent:r,clearSelection:s}){const i=hn(e),l=Math.max(0,((e.endedAt??t)-e.startedAt)/1e3),u=e.state==="active"?w0(i.total,l):null,d=n.size-1;return a.jsxs("button",{type:"button",className:"selected-ribbon",title:`Zoom to ${e.label} and its session (Z)${i.total>0?`
|
|
96
96
|
${Be(i.total)} spent${u?` · ${u}`:""}`:""}`,onClick:()=>{try{r(e.id)}catch{}},children:[a.jsx("span",{className:`state-pill state-${e.state}`,children:e.state==="active"?"live":e.state}),a.jsx("span",{className:"selected-label",children:e.label}),i.total>0&&a.jsxs("span",{className:"selected-cost",children:[Be(i.total),u?a.jsxs("span",{className:"selected-rate",children:[" · ",u]}):null]}),d>0&&a.jsxs("span",{className:"selected-extra",children:["+",d]}),a.jsx("span",{"aria-hidden":!0,className:"selected-close",onClick:f=>{f.stopPropagation(),s()},children:"×"})]})}function Qte({catBarRef:e,catBarOccluded:t,presentCats:n,hiddenCats:r,toggleCat:s}){return a.jsx("div",{ref:e,className:`cat-filter-bar${t?" occluded":""}`,role:"group","aria-label":"Filter tools by category",children:n.map(i=>{const l=r.has(i);return a.jsxs("button",{type:"button",className:`cat-filter${l?" off":""}`,onClick:()=>s(i),"aria-pressed":!l,title:`${l?"Show":"Hide"} ${xd[i]} tools`,children:[a.jsx(Kee,{cat:i}),a.jsx("span",{className:"cat-name",children:xd[i]})]},i)})})}const ene=["a[href]","button:not(:disabled)","input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)","summary","[tabindex]"].join(",");function tne(e){var n,r;const t=e.target;!(t!=null&&t.closest)||t.closest(ene)!==e.currentTarget||(e.preventDefault(),(r=(n=document.activeElement)==null?void 0:n.blur)==null||r.call(n))}function nne({trashZoneRef:e,trashState:t,trashPhase:n,trashLabel:r}){return a.jsxs("div",{ref:e,className:`drag-trash-zone ${t}${n==="leaving"?" leaving":""}`,role:"status",children:[a.jsx("svg",{className:"drag-trash-icon",viewBox:"0 0 24 24","aria-hidden":"true",children:a.jsx("path",{d:"M8 7V5.8C8 4.8 8.8 4 9.8 4h4.4c1 0 1.8.8 1.8 1.8V7m-10 0h12M8 10v8m4-8v8m4-8v8M7 7l.7 13h8.6L17 7"})}),a.jsxs("span",{className:"drag-trash-copy",children:[a.jsx("span",{className:"drag-trash-text",children:t==="over"?a.jsxs(a.Fragment,{children:["Release to remove ",a.jsx("strong",{className:"drag-trash-name",children:r||"this card"})]}):"Drop here to remove from the board"}),a.jsx("span",{className:"drag-trash-hint",children:t==="over"?"The session list (L) brings it back":"The session keeps running"})]})]})}function rne({canvasRef:e,bubbling:t,dragging:n,trash:r,zoom:s,viewport:i,stateRef:l,peek:u,children:d}){const{trashDragging:f,trashState:h,trashPhase:p,trashZoneRef:g,trashLabel:v}=r,{lod:k,lodRef:b}=s,{markCanvasInput:x}=i,{peekAgent:N,peekLabel:S,peekRecap:_,peekBounds:E}=u;return a.jsxs("main",{id:"canvas",tabIndex:-1,className:`canvas-wrap${t?" bubbling":""}${n?" dragging-any":""}${f&&h==="over"?" trash-hover":""}`,"data-lod":k,ref:e,onMouseDownCapture:tne,onPointerDownCapture:x,onPointerUpCapture:x,onWheelCapture:x,onFocusCapture:T=>{const R=T.target;if(!hb(R)||b.current==null||b.current==="detail")return;const A=R.getAttribute("data-id");A&&l.current.agents.has(A)&&R.matches(":focus-visible")&&dO(A,R,"focus")},onBlurCapture:T=>{var A,B;const R=(B=(A=T.target).getAttribute)==null?void 0:B.call(A,"data-id");R&&Xs(R)},children:[d,Lu(p)&&a.jsx(nne,{trashZoneRef:g,trashState:h,trashPhase:p,trashLabel:v}),a.jsx(TQ,{agentFor:N,recapFor:_,labelFor:S,bounds:E})]})}function sne({restarting:e,restartMode:t,live:n,paused:r}){return a.jsxs("div",{className:"conn-banner",role:"alert",children:[a.jsx("span",{className:"conn-dot"}),e?t==="npx"?"Fetching the new version with npx — this can take a minute…":`Restarting ${kt}…`:(()=>{const s=RB({connected:n,paused:r});return a.jsxs(a.Fragment,{children:[`Lost connection to the ${kt} server. Reconnecting…`,s&&a.jsx("span",{className:"conn-sub",children:s})]})})()]})}function ane({oldName:e,version:t,dismissOldName:n}){return a.jsxs("div",{className:"ver-banner",role:"status",children:[a.jsx("span",{className:"ver-dot"}),a.jsxs("strong",{children:[e," still works — the deck is called ",kt," now."]}),t!=null&&t.renameFix?a.jsx("span",{className:"ver-sub",children:t.renameFix}):null,a.jsx("button",{type:"button","aria-label":"Dismiss",className:"ver-close",onClick:n,children:"×"})]})}const one=3e4;function ine({bundle:e,running:t,lastTried:n}){return!t||e===t?!1:n!==t}function lne({bundle:e,running:t,pending:n,lastTried:r}){return t?ine({bundle:e,running:t,lastTried:r})?"reload":n==null||n&&n!==t?"wait":"confirm":"wait"}function cne(e){return!e||e.state!=="failed"?null:`${typeof e.at=="number"?e.at:0}:${e.error??""}`}function une({asked:e,reported:t}){return t?t!==e:!1}function _O(e){const t=e.thresholdMs??one;return!e.enabled||e.kind!=="restart"||!e.canRestart||!e.noticeOpen||!e.visible||e.busy?null:e.idleSince==null||e.now<e.idleSince?t:Math.max(0,t-(e.now-e.idleSince))}function dne(e){const t=Math.max(0,Math.ceil(e/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function hne(e,t){return e?t==null?"auto when idle":`auto in ${dne(t)}`:"auto-restart off"}function QR(e){let t=0;for(const n of e)n.state==="active"&&t++;return t}function fne(e,t=!1){return e<=0&&t?{label:"Restart anyway",clause:"the canvas is paused — running agents cannot be seen"}:e<=0?{label:"Restart now",clause:"nothing is running"}:{label:"Restart anyway",clause:`${e===1?"1 agent is running":`${e} agents are running`} — their events during the restart are lost`}}function pne(e){const t=_O(e);return t==null?{idleSince:null,restart:!1,remainingMs:null}:e.idleSince==null||e.now<e.idleSince?{idleSince:e.now,restart:!1,remainingMs:t}:{idleSince:e.idleSince,restart:t===0,remainingMs:t}}const eA={git_checkout:"this deck runs from a git checkout — pull instead:",npx:"npx runs from a cache that cannot be upgraded in place — run:",not_writable:"the install directory is not writable by this user — run:",opted_out:"installs are off (AGENTS_DECK_NO_INSTALL=1) — run:",retired_name:"this install came from a name that is no longer published — run:"};function mne({notice:e,version:t,dismissNotice:n,upgradeState:r,startUpgrade:s,copyCommand:i,cmdCopied:l,autoRestart:u,toggleAutoRestart:d,askRestart:f,restartCopy:h,restartFuseMs:p,restarting:g}){var v,k,b;return a.jsxs("div",{className:`ver-banner ${e.kind}`,role:"status",children:[a.jsx("span",{className:`ver-dot${p==null?"":" armed"}`}),e.kind==="restart"?a.jsxs(a.Fragment,{children:[a.jsxs("strong",{children:["v",e.to," is installed — this deck still runs v",e.from,"."]}),t!=null&&t.canRestart?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"ver-act",onClick:()=>f(),...as(g),title:`Stop this process and bring it back on the same port. The canvas replays from the event log.
|
|
97
97
|
|
|
98
|
-
Node loads every module once, at startup. An upgrade replaces the files on disk but not the code already in memory, so this process keeps running the old version until it is restarted.`,children:g?"restarting…":h.label}),!g&&a.jsx("span",{className:"ver-sub",children:h.clause}),a.jsxs("label",{className:"ver-auto",children:[a.jsx("button",{type:"button",className:"switch",role:"switch","aria-checked":u,onClick:d,"aria-label":"Auto-restart when idle",title:u?"Updates on its own. While you are here it restarts once nothing has been running for 30 seconds; while you are away it also installs the new version first. Click to require a click instead.":"Only updates when you click. Click to let it update itself when idle or while you are away.",children:a.jsx("span",{className:"switch-knob"})}),a.jsx("span",{"aria-hidden":!0,children:hne(u,p)})]})]}):a.jsx("span",{className:"ver-sub",title:"Node loads every module once, at startup. An upgrade replaces the files on disk but not the code already in memory, so this process keeps running the old version until it is restarted.",children:"Restart it to pick up the new code."})]}):a.jsxs(a.Fragment,{children:[a.jsxs("strong",{children:[kt," v",e.to," is out — you are on v",e.from,"."]}),(t==null?void 0:t.upgradeMode)==="install"&&r!=="failed"&&a.jsx("button",{type:"button",className:"ver-act",onClick:s,...as(r==="running",r==="done"),title:`Runs ${((v=t==null?void 0:t.upgrade)==null?void 0:v.command)??(t==null?void 0:t.command)??"npm i -g"} here, then restarts once nothing is running.`,children:r==="running"?"installing…":r==="done"?"installed":"Update now"}),(t==null?void 0:t.upgradeMode)==="npx"&&(t==null?void 0:t.canRestart)&&a.jsx("button",{type:"button",className:"ver-act",onClick:()=>f({upgrade:!0}),...as(g),title:`Runs ${t==null?void 0:t.command} and hands it this port. Nothing is installed globally — npx unpacks its own copy.`,children:g?"fetching…":r==="failed"?"Retry update":"Update & restart"}),r==="failed"?a.jsxs("span",{className:"ver-sub fail",title:((k=t==null?void 0:t.upgrade)==null?void 0:k.error)??"",children:[(t==null?void 0:t.upgradeMode)==="npx"?"update failed":"install failed",": ",((b=t==null?void 0:t.upgrade)==null?void 0:b.error)??"unknown error"," — run it yourself:"]}):(t==null?void 0:t.upgradeMode)==="npx"?a.jsx("span",{className:"ver-sub",children:t!=null&&t.canRestart?"npx cannot upgrade in place, so the deck re-runs:":eA.npx}):t!=null&&t.upgradeBlocked?a.jsx("span",{className:"ver-sub",children:It(eA,t.upgradeBlocked)??"cannot install from here"}):null,a.jsxs("button",{type:"button",className:"ver-cmd",onClick:i,title:"Copy to clipboard",children:[a.jsx("code",{children:t==null?void 0:t.command}),a.jsx("span",{className:"ver-cmd-hint",children:l?"copied":"copy"})]})]}),a.jsx("button",{type:"button","aria-label":"Dismiss",className:"ver-close",onClick:n,children:"×"})]})}function gne({restart:e,versionCheck:t,upgrade:n,oldNameNotice:r,everConnected:s,live:i,paused:l}){const{autoRestart:u,toggleAutoRestart:d,restarting:f,restartMode:h,restartedTo:p,askRestart:g,restartCopy:v,restartFuseMs:k}=e,{version:b,notice:x,noticeOpen:N,dismissNotice:S}=t,{upgradeState:_,startUpgrade:E,copyCommand:T,cmdCopied:R}=n,{oldName:A,oldNameOpen:B,dismissOldName:L}=r;return p?a.jsxs("div",{className:"ver-banner done",role:"status",children:[a.jsx("span",{className:"ver-dot"}),a.jsxs("strong",{children:["Restarted — now running v",p,"."]}),a.jsx("span",{className:"ver-sub",children:"The canvas replayed from the event log."})]}):s&&!i?a.jsx(sne,{restarting:f,restartMode:h,live:i,paused:l}):N&&x?a.jsx(mne,{notice:x,version:b,dismissNotice:S,upgradeState:_,startUpgrade:E,copyCommand:T,cmdCopied:R,autoRestart:u,toggleAutoRestart:d,askRestart:g,restartCopy:v,restartFuseMs:k,restarting:f}):B&&A?a.jsx(ane,{oldName:A,version:b,dismissOldName:L}):null}function yne(e,t){return e==="confirmation"?t.confirmOpen?"clear":"ignore":t.modalOpen||t.confirmOpen?"ignore":"confirm"}function wne(e){if(!e||typeof e!="object")return null;const t=e;if(typeof t.decks!="number"||typeof t.mine!="boolean")return null;const n=t.owner&&typeof t.owner=="object"?t.owner.port:null;return{path:typeof t.path=="string"&&t.path!==""?t.path:null,decks:t.decks,mine:t.mine,ownerPort:typeof n=="number"?n:null}}function vne(e){return e<=0?null:e===1?"the one agent":`all ${e} agents`}function xne(e,t){const n=vne(e),r=(...l)=>[n?`${n} on the canvas`:null,...l,"layout, pins and selection"].filter(u=>u!==null),s="This cannot be undone.";if(!t)return{goes:r("the event log on disk — the file a restarted deck replays to rebuild what you see, and the file every deck on this machine shares unless one was told otherwise"),stays:[],final:s,confirm:"Clear everything"};if(!t.path)return{goes:r(),stays:[],final:`This deck keeps no event log, so nothing on disk changes — and nothing can bring the canvas back. ${s}`,confirm:"Clear everything"};if(!t.mine){const l=t.ownerPort===null?"another running deck owns that file":`the deck on port ${t.ownerPort} owns that file`,u=t.decks>2?`, one of ${t.decks} decks sharing it`:"";return{goes:r(),stays:[`the event log — ${l}${u}`,"restart this deck and the log replays back onto it"],final:null,confirm:"Clear this canvas"}}if(t.decks<=1)return{goes:r("this deck's event log — the file a restarted deck replays to rebuild what you see"),stays:[],final:s,confirm:"Clear everything"};const i=t.decks-1;return{goes:r(`the event log ${i===1?"1 other running deck shares":`${i} other running decks share`} with this one — every session recorded in it, not just the ones drawn here`),stays:[i===1?"what that deck shows, until it restarts — then it is gone there too":"what those decks show, until they restart — then it is gone there too"],final:s,confirm:"Clear everything"}}function bne({agentCount:e,onConfirm:t,onCancel:n}){const r=w.useRef(null),s=gt(n,{focusRef:r,layer:o8}),[i,l]=w.useState(null);w.useEffect(()=>{let p=!1;return fetch("/api/clear").then(g=>g.ok?g.json():null).then(g=>{p||l(wne(g))}).catch(()=>{}),()=>{p=!0}},[]);const{goes:u,stays:d,final:f,confirm:h}=xne(e,i);return a.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:a.jsxs("div",{ref:s,className:"modal clear-confirm",onClick:p=>p.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"clear-confirm-title",children:[a.jsxs("header",{className:"modal-head",children:[a.jsxs("div",{className:"modal-title",children:[a.jsx("span",{className:"status-dot err","aria-hidden":!0}),a.jsx("span",{id:"clear-confirm-title",className:"modal-tool-name",children:"Clear the deck?"})]}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:n,"aria-label":"Cancel (Esc)",title:"Cancel (Esc)",children:"×"})})]}),a.jsxs("section",{className:"modal-body",children:[a.jsxs("dl",{className:"cc-plan",children:[a.jsx("dt",{children:"Goes"}),a.jsx("dd",{children:u.map(p=>a.jsx("span",{children:p},p))}),a.jsx("dt",{children:"Stays"}),a.jsx("dd",{children:d.length>0?d.map(p=>a.jsx("span",{children:p},p)):a.jsx("span",{children:"nothing"})})]}),f&&a.jsx("p",{className:"cc-final",children:f}),a.jsxs("div",{className:"cc-actions",children:[a.jsx("button",{type:"button",ref:r,className:"btn",onClick:n,children:"Cancel"}),a.jsx("button",{type:"button",className:"btn danger",onClick:t,children:h})]})]})]})})}const kne=[{value:"bug",label:"Something is wrong"},{value:"idea",label:"An idea"},{value:"other",label:"Something else"}],Nne=120,jne=1e4,Sne=200;function tA(e,t){return t==="vetoed"?"This deck was started with AGENTS_DECK_NO_INSTALL=1, which keeps it off the network, so nothing was sent.":e===429||t==="too_many"?"Too much feedback from this network in the last hour. Try again later; your text is still here.":e===400?"The server did not accept this. Check that the title and the text are filled in.":"ccdeck's server could not be reached. Nothing was sent; your text is still here, so try again in a moment."}function _ne({onClose:e}){const t=w.useRef(null),n=gt(e,{focusRef:t}),[r,s]=w.useState("bug"),[i,l]=w.useState(""),[u,d]=w.useState(""),[f,h]=w.useState(""),[p,g]=w.useState({state:"idle"}),v=i.trim().length>=3&&u.trim().length>0&&p.state!=="sending";async function k(b){if(b.preventDefault(),!!v){g({state:"sending"});try{const x=await fetch("/api/feedback",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:r,title:i.trim(),body:u.trim(),contact:f.trim()||void 0})}),N=await x.json().catch(()=>null);g(x.ok&&(N!=null&&N.ok)?{state:"sent"}:{state:"failed",message:tA(x.status,N==null?void 0:N.reason)})}catch{g({state:"failed",message:tA(0,null)})}}}return a.jsx("div",{className:"modal-backdrop",onClick:e,role:"presentation",children:a.jsxs("div",{ref:n,className:"modal feedback-dialog",onClick:b=>b.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"feedback-title",children:[a.jsxs("header",{className:"modal-head",children:[a.jsx("div",{className:"modal-title",children:a.jsx("span",{id:"feedback-title",className:"modal-tool-name",children:"Send feedback"})}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:e,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),a.jsx("section",{className:"modal-body",children:p.state==="sent"?a.jsxs("div",{className:"fb-done",role:"status",children:[a.jsx("p",{children:"Thank you. It reached the people who make ccdeck."}),a.jsx("div",{className:"fb-actions",children:a.jsx("button",{type:"button",className:"btn primary",onClick:e,children:"Close"})})]}):a.jsxs("form",{className:"fb-form",onSubmit:k,noValidate:!0,children:[a.jsxs("fieldset",{className:"fb-kinds",children:[a.jsx("legend",{className:"vis-hidden",children:"What is it about"}),kne.map(b=>a.jsxs("label",{className:"fb-kind",children:[a.jsx("input",{type:"radio",name:"feedback-kind",value:b.value,checked:r===b.value,onChange:()=>s(b.value)}),a.jsx("span",{children:b.label})]},b.value))]}),a.jsxs("label",{className:"fb-field",children:[a.jsx("span",{children:"Title"}),a.jsx("input",{ref:t,className:"ap-manage-input",type:"text",value:i,maxLength:Nne,onChange:b=>l(b.target.value),required:!0})]}),a.jsxs("label",{className:"fb-field",children:[a.jsx("span",{children:"What happened, or what you would like"}),a.jsx("textarea",{className:"ap-manage-input",value:u,maxLength:jne,rows:6,onChange:b=>d(b.target.value),required:!0})]}),a.jsxs("label",{className:"fb-field",children:[a.jsx("span",{children:"How to reach you, if you want an answer (optional)"}),a.jsx("input",{className:"ap-manage-input",type:"text",value:f,maxLength:Sne,autoComplete:"email",onChange:b=>h(b.target.value)})]}),a.jsx("p",{className:"fb-note",children:"This goes to the people who make ccdeck, with your ccdeck version and system. They may open a public GitHub issue from it; how to reach you is never put there."}),p.state==="failed"&&a.jsx("p",{className:"fb-error",role:"alert",children:p.message}),a.jsxs("div",{className:"fb-actions",children:[a.jsx("button",{type:"button",className:"btn",onClick:e,children:"Cancel"}),a.jsx("button",{type:"submit",className:"btn primary",disabled:!v,children:p.state==="sending"?"Sending…":"Send"})]})]})})]})})}const Ene="Press Esc first if a key does nothing.",Cne=[{title:"Canvas",rows:[{cap:"Space",action:"pause or resume the stream",binds:[" "]},{cap:"J",action:"next agent",binds:["j","J"]},{cap:"K",action:"previous agent",binds:["k","K"]},{cap:"W",action:"the session waiting on you — oldest first, again for the next",binds:["w","W"]},{cap:"F",action:"fit every agent on screen",binds:["f","F"]},{cap:"Z",action:"zoom to the selected agent and its session",binds:["z","Z"]},{cap:"Delete",action:"take the selected card off the board — Undo brings it back",binds:["Delete"]},{cap:"R",action:"re-arrange the canvas and drop the pins",binds:["r","R"]},{cap:"C",action:"clear the canvas and the event log — asks first",binds:["c","C"]}]},{title:"Panels and dialogs",rows:[{cap:"U",action:"usage panel",binds:["u","U"]},{cap:"L",action:"session list",binds:["l","L"]},{cap:"D",action:"detail panel",binds:["d","D"]},{cap:"H",action:"usage history",binds:["h","H"]},{cap:"A",action:"Claude accounts, where Claude Code is installed",binds:["a","A"]},{cap:"S",action:"this machine — cores, memory, temperature",binds:["s","S"]},{cap:"B",action:"Browser Watch",binds:["b","B"]},{cap:"V",action:"the sound menu — volume, tones, notifications",binds:["v","V"]},{cap:"?",action:"this sheet",binds:["?"]}]},{title:"Settings",rows:[{cap:"M",action:"sound on or off",binds:["m","M"]},{cap:"T",action:"light or dark theme",binds:["t","T"]}]},{title:"Focus and selection",rows:[{cap:"Tab",action:"reach the agent cards",binds:[]},{cap:"Enter",action:"select the focused card",binds:["Enter"]},{cap:"Shift + Enter",action:"add the focused card to the selection",binds:["Enter"]},{cap:"Esc",action:"close what is open, deselect, release focus",binds:["Escape"]}]},{title:"Mouse",rows:[{cap:"drag",action:"move a node, and pin it where you dropped it",binds:[]},{cap:"shift-click",action:"add an agent to the selection",binds:[]},{cap:"click",action:"a card: go to it and its session",binds:[]},{cap:"double-click",action:"a card: its prompt, every tool call, tokens and timing",binds:[]},{cap:"hover",action:"zoomed out, a card's name, state and numbers",binds:[]},{cap:"click",action:"the topbar speaker opens volume and sound settings",binds:[]}]}];function Tne({onClose:e,onTour:t}){const n=gt(e);return a.jsx("div",{className:"modal-backdrop",onClick:e,role:"presentation",children:a.jsxs("div",{ref:n,className:"modal key-help",onClick:r=>r.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"key-help-title",children:[a.jsxs("header",{className:"modal-head",children:[a.jsx("div",{className:"modal-title",children:a.jsx("span",{id:"key-help-title",className:"modal-tool-name",children:"Keyboard shortcuts"})}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:e,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),a.jsxs("section",{className:"modal-body",children:[t&&a.jsxs("div",{className:"guide-door",children:[a.jsx("span",{children:"Eight pictures of what the deck shows."}),a.jsx("button",{type:"button",className:"btn",onClick:t,children:"Take the tour"})]}),a.jsx("div",{className:"shortcuts",children:Cne.map(r=>a.jsxs(w.Fragment,{children:[a.jsx("h3",{className:"kh-group",children:r.title}),r.rows.map(s=>a.jsxs("div",{className:"sc",children:[a.jsx("kbd",{children:s.cap}),a.jsx("span",{children:s.action})]},`${r.title}:${s.cap}:${s.action}`))]},r.title))}),a.jsx("p",{className:"kh-foot",children:Ene})]})]})})}function Rne(e,t){const n=(e??[]).filter(s=>s&&typeof s.fp=="string"&&!t.has(s.fp));if(!n.length)return{request:null,waiting:0};const r=[...n].sort((s,i)=>(s.at??0)-(i.at??0));return{request:r[0],waiting:r.length-1}}function Ane({request:e,waiting:t,busy:n,now:r,onAccept:s,onDecline:i,onLater:l}){const u=w.useRef(null),d=gt(l,{focusRef:u}),f=Ys(n,"accept"),h=Ys(n,"dismiss");return a.jsx("div",{className:"modal-backdrop",onClick:l,role:"presentation",children:a.jsxs("div",{ref:d,className:"modal lan-ask",onClick:p=>p.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"lan-ask-title","aria-describedby":"lan-ask-who",children:[a.jsxs("header",{className:"modal-head",children:[a.jsxs("div",{className:"modal-title",children:[a.jsx("i",{className:"ap-pulse","aria-hidden":!0}),a.jsx("span",{id:"lan-ask-title",className:"modal-tool-name",children:"A deck wants to pair"})]}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:l,"aria-label":"Answer later (Esc)",title:"Answer later (Esc)",children:"×"})})]}),a.jsxs("section",{className:"modal-body",children:[a.jsxs("p",{id:"lan-ask-who",className:"lan-ask-who",children:[a.jsx("strong",{className:"lan-ask-name",children:e.name})," at ",a.jsx("code",{className:"ap-lan-code",children:e.addr})," · asked ",q0(e.at,r)]}),a.jsx("p",{className:"modal-note",children:"Paired decks repair each other's expired logins. Accept only if you know this machine — what it shares is an account, not a screen."}),a.jsxs("p",{className:"lan-ask-fp",children:["Its fingerprint is ",a.jsx("code",{className:"ap-lan-code",children:e.fp})," — that machine shows its own under This deck on the network; the two should match."]}),t>0&&a.jsx("p",{className:"lan-ask-more",children:t===1?"One more deck is waiting behind this one.":`${t} more decks are waiting behind this one.`}),a.jsxs("div",{className:"lan-ask-acts",children:[a.jsx("button",{type:"button",ref:u,className:"btn",disabled:h.disabled,"aria-busy":h.busy,onClick:i,title:"Nothing is shared. If that deck asks again, this comes back.",children:n==="dismiss"?"declining…":"Decline"}),a.jsx("button",{type:"button",className:"btn primary",disabled:f.disabled,"aria-busy":f.busy,onClick:s,title:"Talk to this deck from now on, and repair its expired logins with this deck's own.",children:n==="accept"?"accepting…":"Accept"})]})]})]})})}function Mne({lanPending:e,lanDeferred:t,lanBusy:n,answerLanPair:r,deferLanPair:s}){const{request:i,waiting:l}=Rne(e,t.current);return i?a.jsx(Ane,{request:i,waiting:l,busy:n,now:Date.now(),onAccept:()=>void r("accept",i.fp),onDecline:()=>void r("dismiss",i.fp),onLater:()=>s(i.fp)},i.fp):null}const $ne={"//":["What a user would NOTICE. One key per version that has something to say,","and no key at all for a version that has nothing — which is most of them.","","The rule this file exists to serve: before every release, ask 'what would a","user notice?' and write the answer here. 'Nothing user-visible' is a valid","and expected answer, and it is spelled by adding no key. A release with no","key shows no modal, and that silence is what keeps the modal worth reading","on the day it is not silent.","","What belongs here: something that changed on the user's machine or under","their hands — a hook written to or removed from settings.json, a default","that flipped, a control that moved or went away, a stored preference that","changed meaning. What does not: bounds, races, assertions that could not","fire, anything that is invisible when it is correct.","","Write it for the person running the deck, not for the person reading the","diff. `title` is the sentence they scan; `body` is what they need in order","to act on it, or to stop worrying about it.","","Keys are versions exactly as package.json spells them. A key that is not a","version, or an entry missing either field, fails the suite rather than","being quietly dropped — see src/web/__tests__/release-notes-file.test.ts.","Ordering here is for humans; the deck sorts by version itself.","","A title may open with an emoji, and if it does, put exactly ONE space after","it. Not two: the dialog gives a leading emoji its own optical gap, because","a colour glyph is drawn edge to edge inside its advance and one word space","after one reads as none. A second space here would be a lie in the data","about a defect in the type, and the suite refuses both it and no space at","all.","","A release that genuinely has nothing to say is spelled TWICE: no key here,",'and its version written into "//nothing-to-say" below. One spelling on its',"own is ambiguous — a missing key reads the same whether it was a decision","or a forgotten step, and five releases in a row were once forgotten. The list","is what tells the two apart, and release-notes-current-version.test.ts fails","the release whose version is in neither place. Any key opening with // is a","note to the author and never a release."],"//nothing-to-say":["3.23.1","3.23.2","3.23.3","3.23.4","3.26.0","3.26.1","3.26.3","3.26.4","3.26.5","3.27.6","3.27.7","3.28.0","3.28.1","3.29.3","3.29.4","3.29.6","3.29.7","3.29.9","3.33.1"],"3.34.0":[{title:"🗺️ The network map shows who you are connected to",body:"Paired decks that are on stand closest to this one, and a light runs along their wires. Paired decks that are away come next, in a colour of their own, with how long they have been gone, and machines that are not paired stand outside in grey. Decks reached over Tailscale sit together in their own shaded slice instead of on dashed wires. Pointing at a deck opens its details beside the map: whether it is there, what to do next if anything, its address and what it runs, and every login the two share, the ones that need a look first."},{title:"🔑 A login that expired everywhere says so",body:`When a shared login expired on this deck and every paired deck that is on held an expired copy too, the row said "Login expired" and waited for a repair that could never come. It now says "Login expired on all online decks". Claude retires a login's other copies each time one machine refreshes it, so shared copies expire together: sign in again on any one machine and the others repair from it on their next round.`},{title:"💬 Send feedback from inside the deck",body:'Appearance settings has a "Send feedback…" button: pick what kind it is, write a title and a few lines, and add a way to reach you if you want an answer. It goes to the people who make ccdeck, who may open a public issue from it, never with your contact in it. If it cannot be sent, the form stays filled in and says why.'}],"3.33.0":[{title:"🪝 Hooks you add in Claude Code are no longer removed",body:"Claude Code's hook editor often files a new hook into the same group as the deck's own. Starting the deck, or uninstalling it, then removed the whole group, and your hook went with it without a word. The deck now takes out only its own command and leaves yours where it was, and the same goes for the old finish-sound hook. `ccdeck --uninstall` also stops the decks that are running, so an update in the background cannot put the hooks back."},{title:"🧵 Resumed Codex sessions show up again",body:"A Codex session picked up with `codex resume`, or one that ran for days, could go dark on the canvas and drop out of the 5-hour and 7-day usage, because the deck only looked in the two newest day folders. It now follows those sessions and counts their tokens. Two Codex sessions in the same folder get different id suffixes, and a `bash -lc` call shows the command it runs."},{title:"🤝 A deck paired by the accept switch brings in less",body:'A deck that paired through the automatic accept switch, and not through an invite, now brings in only the logins you have ticked on this deck, and nothing from it is ticked for sharing onward. Its dialog says "paired automatically — pair by invite to take it". Pairing by invite works as before. A typed address is no longer dropped after one failed round, and the sync port stays the same after a rename.'},{title:"⬆️ Desktop updates install when you expect them",body:'On Windows and Linux a downloaded update now installs when you quit. On a Mac, Quit installs it and the app stays closed. The Linux .deb needs an administrator password to install, so it no longer does that by itself: it waits for "Restart to update" and says a password is coming. "Start at login" now works on Linux, and "Restart ccdeck" stops a deck that has hung.'},{title:"🕵️ Browser Watch waits before it acts, and quits only its own browser",body:"A program's visit is now logged and reacted to once its quiet window has closed, about 16 minutes after it, and not on the first poll, so a visit that is withdrawn no longer quits the browser. On Linux the quit reaction ends only the browser that holds the watched profile; other Chrome channels and headless browsers keep running. When it cannot tell which process that is, it does nothing and says so, which includes a Flatpak Brave."},{title:"🧮 Figures that were off are right",body:`Spend by labelled and workflow subagents counts toward a session's tokens and cost. The Projects report prices 1-hour cache writes the way ccusage does, so its dollars match the Usage panel. After a restart the deck rebuilds its whole event history, where it used to rebuild about a third. On Linux the process list shows what each process is using now, not its lifetime average. A count near a boundary reads "1.00M", and a full quota window says "used up".`},{title:"🔑 The Usage panel's reads answer the deck's own page only",body:"The routes behind the Usage panel (/api/quota, /api/ccusage, /api/codex-usage, /api/codex-quota and /api/cswap-auto) now answer the deck's own page, or a client that sends the deck's token. A script that read them with a plain request gets 401 from this version on. The hook, the desktop app and the `ccdeck` command are not affected."},{title:"🛠️ Smaller fixes you may notice",body:"With the canvas paused, an update no longer restarts the server while an agent is working: it waits until no turn is open. `ccdeck --stop -p4317` stops that one deck. A deck started at login can update itself on Homebrew and nvm setups. Dialogs keep keyboard focus after a button goes away, screen readers hear pairing requests by deck name and the machine panel's readings, dim text is readable in both themes, Windows High Contrast shows what is selected, and below 640px the detail panel opens over the canvas."}],"3.32.2":[{title:"🔒 Self-updates wait until your screen is unlocked",body:"On Linux with GNOME, the app installs an update by itself when you leave it alone, which is often while your screen is locked. GNOME switches the panel's tray off under the lock screen, and a version that started then never showed its icon. The app now waits until you are back before restarting by itself, so its icon comes back with it."}],"3.32.1":[{title:"🔔 The tray icon comes back on Linux",body:"On Linux the app could lose its icon in the panel, after it updated itself or when the panel restarted, and stay without it until it was quit. It now notices within a minute and restarts by itself the next time you are away from its window, the way it installs an update. It does this at most once every six hours, and not again if a restart did not help."},{title:"🔕 A window you closed stays closed after a self-update",body:"When the app restarted by itself to install an update, it opened its window again even if you had closed it, and while that window was open the deck held back its notifications. A window you closed now stays closed."},{title:"🪟 No empty icon when ccdeck is already open",body:'Opening ccdeck again while it was running flashed an empty "…" icon in the Linux panel before bringing the window forward. It now only brings the window forward.'}],"3.32.0":[{title:"🗺️ A map of your network",body:"A new button on the Local network row, and in its view's header, opens a map of every deck around this one. This deck is at the centre and the paired decks that are on stand around it. Further out are the quiet ones, the machines nearby and any deck asking to pair. Wires are solid on your local network and dashed over Tailscale. Pointing at a deck says how it is reached, what it runs and which logins the two share, and pressing it opens that deck's own dialog."}],"3.31.0":[{title:"📊 Account capacity",body:"A gauge button in the accounts panel's header opens Account capacity: how many of your Claude accounts are ready now, what the 5-hour and 7-day windows have left across all of them, and a row for each account with its use, its state (Ready, Limited, Exhausted or Stale) and when it was last read. Each window also says whose reset comes next."},{title:"🚦 Claude and Codex incidents",body:"When Anthropic's or OpenAI's status page reports an incident on something your sessions use, the deck says so in the topbar, the Usage panel and the tray, and every mark links to the status page. A provider with nothing wrong draws nothing."},{title:"↕️ Order your other accounts",body:"The Other accounts row can sort the list by slot, by how full a window is, or by most room, and open every account at once. Both stay as you left them after a reload."},{title:"🔐 A settings folder left by sudo can be given back",body:'On a Mac, running ccdeck once with sudo left its settings folder owned by another user, and every settings change was refused, sharing an account included. The message now offers "give it back": macOS asks for your password, the folder is yours again, and the deck reads its settings back without a restart.'}],"3.30.0":[{title:"🧮 Token counts and costs are no longer doubled",body:"Claude Code writes a reply that has thinking, text and tool calls as several transcript lines, each carrying the whole request's usage. The deck added up every line, so a session's tokens and cost on its card came out close to twice what it was billed, and the context panel counted each part of a reply as its own message. Each request is now counted once. Expect the totals on your cards to come down."},{title:"⏳ Claude's saved limit resets on the Usage panel",body:`When your Claude account has free limit resets to spend ("Reset for free" in Claude's Settings → Usage), the Claude card now says how many there are and when the first one expires, the way the Codex card already did. The deck only reports them; you spend them in Claude's own settings.`},{title:"🔑 LAN invites need the other deck updated",body:`An invite's code is now a long random secret instead of six digits, so nobody else on the network can work it out and pair in your place, and a wrong code is refused by name. An invite made on this version can only be joined from a deck on this version or later: an older deck answers "That is not an invite". Update that deck, or make the invite on the older one and join it here.`},{title:"🔕 AGENTS_DECK_NO_NOTIFY keeps Browser Watch quiet too",body:"A deck started with AGENTS_DECK_NO_NOTIFY=1 still raised a desktop notification for every new Browser Watch finding. It no longer does. The finding is still in the Browser Watch panel and its log, which says why no notification came."},{title:"🛠️ Smaller fixes",body:'Delete removes the card you just clicked. A LAN address you typed stays in the list when a round cannot reach it, and the status line under the LAN switch now agrees with the rows below it. In the desktop app, a dismissed "update is ready" notice stays dismissed after you answer the first-launch question. Sizes read the same in every panel ("1.1 KB"). Faded text stays readable, a keyboard can see the scrollbar, and numbers use a monospaced font on Windows and Linux as well.'}],"3.29.11":[{title:"💲 Claude Sonnet 5.5 has a price",body:`Sessions on Claude Sonnet 5.5 showed "not priced" on the board, and the Projects report could only show a minimum for them. They are now priced at Anthropic's published rate, the same as Sonnet 5: $2 per million input tokens and $10 per million output tokens.`}],"3.29.10":[{title:"💲 Claude Opus 5.5 has a price",body:`Sessions on Claude Opus 5.5 showed "not priced" on the board, and the Projects report counted them as costing nothing, so its totals read far too low. They are now priced at Anthropic's published rate. If a model still has no price, Projects shows its total as a minimum, like $11.19+, and names the model, instead of a total that looks complete.`}],"3.29.8":[{title:"🔁 Removed cards come back when their agent works again",body:"Remove from board is for finished work. If the agent behind a card you removed starts a tool call, gets a new prompt or starts a subagent, the card returns on its own, together with the card it hangs from, and it stays back after a reload. Cards whose agents stay idle stay removed."}],"3.29.1":[{title:"🗂️ One row per project in Projects",body:"The Projects report now counts a session's work under the folder you started it in, the same name its card has on the canvas, instead of adding a row for every folder the agent moved into. The first start after updating re-reads your transcripts once to regroup the report."},{title:"🔔 Tidier custom sounds",body:"Importing a sound, recording one and choosing a spoken voice now sit in compact cards that respond to clicks and focus like the rest of the deck."}],"3.29.0":[{title:"🎵 Your own stations in Claude FM",body:"Add any YouTube live link or radio stream as a station in Appearance, next to the built-in ones, and mute the music without losing your volume. When a station is not live, the picker now says so instead of staying silent."},{title:"🔔 Notification sounds and voices of your own",body:"Pick a local audio file or a spoken voice for each alert, so the sound that means an agent is waiting is one you will recognise."},{title:"🗑️ Drag a card off the board to remove it",body:"Drag a card to the target at the bottom of the canvas to take it off the board, or use Remove from board in the detail panel (Delete). The session keeps running, and the session list (L) brings it back."},{title:"🔐 Optional invite-only pairing",body:"Pairing works as before, with or without an invite. If you want, Local network can now be set to accept only decks that join with an invite you created, so a nearby machine cannot ask to pair on its own."},{title:"🌐 Account sharing between your machines is more reliable",body:"A locked macOS Keychain is explained instead of failing silently, a login that is broken or belongs to another account is never shared, and a sync that stops partway keeps what already arrived."},{title:"📅 Projects opens on Today",body:"The Projects report per account starts with today's work, and an empty window offers the next wider one. The topbar also shows this month's usage, and the desktop app can restart into an update from its own window."}],"3.27.0":[{title:"📊 Projects: where each account spent its work",body:"Each account card's ⋯ menu now breaks its cost down by project, over 7d / 30d / all."}],"3.27.1":[{title:"🎨 Make Appearance easier to tune",body:"The Appearance dialog now has clearer sections, stronger selection states, and a calmer layout for choosing a theme and configuring music. Your existing settings and keyboard shortcuts continue to work."}],"3.27.2":[{title:"💰 Project costs now match Usage",body:"Project cost totals no longer count the same Claude request once for every content block. Existing project history is rebuilt automatically so the totals align with the Usage panel."}],"3.27.3":[{title:"🎵 Station selection works in the desktop app",body:"The music station picker now opens inside ccdeck instead of relying on the operating system popup, so choosing a station works reliably in the Electron app."}],"3.27.4":[{title:"✅ Desktop picker release checks are green",body:"The station picker now keeps the same keyboard, motion, focus, and layout behavior as the rest of ccdeck across desktop and browser builds."}],"3.27.5":[{title:"🧭 The welcome tour stays dismissed",body:"Electron now remembers that you completed the onboarding tour at the deck level, so an update or loopback port change no longer shows the same tour again."},{title:"🎵 The station picker has a clearer finish",body:"The music selector has a tighter trigger, a purposeful chevron, and more deliberate option spacing so it reads like a native part of Appearance."}],"3.25.0":[{title:"🖱️ A click goes to the session, a double-click opens the details",body:"Clicking a card frames it with the rest of its session and leaves the detail panel shut. Double-click a card to open its details; `j`/`k`, the session list, Enter and `D` still open them too."},{title:"🔭 Cards stay readable when you zoom out",body:"At every zoom a card shows its name, its state and anything waiting on you, instead of shrinking to a coloured pill. Hover or focus a card to see it whole. Recap notes read at a distance too, and show the full recap on hover."},{title:"🌐 The Machine panel shows your network",body:"A new Network section shows download, upload and the round trip to Claude's API, and names the route when traffic goes through a VPN or a Tailscale exit node. Those checks run only while the panel is open. The panel is regrouped into CPU, Memory, Network and Thermal, with a flag at the top when something needs attention."},{title:"🎨 See each theme before you pick it",body:"The Appearance menu shows a small preview of the deck in Light and in Dark. Claude FM also keeps its volume when a notification chime plays, instead of dipping under it."}],"3.24.1":[{title:"🎛️ Appearance is one small menu now",body:"The topbar's appearance control opens a compact menu where you can choose Light or Dark and show or hide the character. The character stays on by default, and your choice is remembered."}],"3.24.0":[{title:"🎧 Claude FM plays from the minimap",body:"A small character stands on the minimap's top edge. Press it and the Claude channel's live stream plays; press it again and it stops. It only turns up when the channel is actually broadcasting, so a deck with no network never shows it at all."},{title:"🤠 And it gets on with its day",body:"It walks that edge, tidies up what it finds, kicks a ball along it, sits with its legs over the side, and watches the board through a scope. Now and then it drops onto the canvas and ropes its way back up. Headphones on while the music plays, a hat when it does not."}],"3.23.5":[{title:"🧭 The accounts panel opens on the account you are on",body:"Its windows, its resets and how old the numbers are — whole, at the top of the column. Every other account stands behind one row that says how many of them a switch could actually reach; press it to see them, or rest on it to be shown their names and how much room each has left."},{title:"⚙️ Auto-switch moved in there with them",body:"It is behind that same row now, after the accounts it switches between, rather than at the foot of the panel. The row says `auto 90%` or `auto off` so you can tell what the policy is doing without opening it — and says so in amber when it is armed with nowhere left to go."}],"3.23.0":[{title:"🧭 The accounts column leads with accounts",body:`The live account is the open row: its windows as bars, when each one resets, and how old the numbers are. Every other account rests on the two figures a switch is decided by, and opens with a click when you want the rest.
|
|
98
|
+
Node loads every module once, at startup. An upgrade replaces the files on disk but not the code already in memory, so this process keeps running the old version until it is restarted.`,children:g?"restarting…":h.label}),!g&&a.jsx("span",{className:"ver-sub",children:h.clause}),a.jsxs("label",{className:"ver-auto",children:[a.jsx("button",{type:"button",className:"switch",role:"switch","aria-checked":u,onClick:d,"aria-label":"Auto-restart when idle",title:u?"Updates on its own. While you are here it restarts once nothing has been running for 30 seconds; while you are away it also installs the new version first. Click to require a click instead.":"Only updates when you click. Click to let it update itself when idle or while you are away.",children:a.jsx("span",{className:"switch-knob"})}),a.jsx("span",{"aria-hidden":!0,children:hne(u,p)})]})]}):a.jsx("span",{className:"ver-sub",title:"Node loads every module once, at startup. An upgrade replaces the files on disk but not the code already in memory, so this process keeps running the old version until it is restarted.",children:"Restart it to pick up the new code."})]}):a.jsxs(a.Fragment,{children:[a.jsxs("strong",{children:[kt," v",e.to," is out — you are on v",e.from,"."]}),(t==null?void 0:t.upgradeMode)==="install"&&r!=="failed"&&a.jsx("button",{type:"button",className:"ver-act",onClick:s,...as(r==="running",r==="done"),title:`Runs ${((v=t==null?void 0:t.upgrade)==null?void 0:v.command)??(t==null?void 0:t.command)??"npm i -g"} here, then restarts once nothing is running.`,children:r==="running"?"installing…":r==="done"?"installed":"Update now"}),(t==null?void 0:t.upgradeMode)==="npx"&&(t==null?void 0:t.canRestart)&&a.jsx("button",{type:"button",className:"ver-act",onClick:()=>f({upgrade:!0}),...as(g),title:`Runs ${t==null?void 0:t.command} and hands it this port. Nothing is installed globally — npx unpacks its own copy.`,children:g?"fetching…":r==="failed"?"Retry update":"Update & restart"}),r==="failed"?a.jsxs("span",{className:"ver-sub fail",title:((k=t==null?void 0:t.upgrade)==null?void 0:k.error)??"",children:[(t==null?void 0:t.upgradeMode)==="npx"?"update failed":"install failed",": ",((b=t==null?void 0:t.upgrade)==null?void 0:b.error)??"unknown error"," — run it yourself:"]}):(t==null?void 0:t.upgradeMode)==="npx"?a.jsx("span",{className:"ver-sub",children:t!=null&&t.canRestart?"npx cannot upgrade in place, so the deck re-runs:":eA.npx}):t!=null&&t.upgradeBlocked?a.jsx("span",{className:"ver-sub",children:It(eA,t.upgradeBlocked)??"cannot install from here"}):null,a.jsxs("button",{type:"button",className:"ver-cmd",onClick:i,title:"Copy to clipboard",children:[a.jsx("code",{children:t==null?void 0:t.command}),a.jsx("span",{className:"ver-cmd-hint",children:l?"copied":"copy"})]})]}),a.jsx("button",{type:"button","aria-label":"Dismiss",className:"ver-close",onClick:n,children:"×"})]})}function gne({restart:e,versionCheck:t,upgrade:n,oldNameNotice:r,everConnected:s,live:i,paused:l}){const{autoRestart:u,toggleAutoRestart:d,restarting:f,restartMode:h,restartedTo:p,askRestart:g,restartCopy:v,restartFuseMs:k}=e,{version:b,notice:x,noticeOpen:N,dismissNotice:S}=t,{upgradeState:_,startUpgrade:E,copyCommand:T,cmdCopied:R}=n,{oldName:A,oldNameOpen:B,dismissOldName:L}=r;return p?a.jsxs("div",{className:"ver-banner done",role:"status",children:[a.jsx("span",{className:"ver-dot"}),a.jsxs("strong",{children:["Restarted — now running v",p,"."]}),a.jsx("span",{className:"ver-sub",children:"The canvas replayed from the event log."})]}):s&&!i?a.jsx(sne,{restarting:f,restartMode:h,live:i,paused:l}):N&&x?a.jsx(mne,{notice:x,version:b,dismissNotice:S,upgradeState:_,startUpgrade:E,copyCommand:T,cmdCopied:R,autoRestart:u,toggleAutoRestart:d,askRestart:g,restartCopy:v,restartFuseMs:k,restarting:f}):B&&A?a.jsx(ane,{oldName:A,version:b,dismissOldName:L}):null}function yne(e,t){return e==="confirmation"?t.confirmOpen?"clear":"ignore":t.modalOpen||t.confirmOpen?"ignore":"confirm"}function wne(e){if(!e||typeof e!="object")return null;const t=e;if(typeof t.decks!="number"||typeof t.mine!="boolean")return null;const n=t.owner&&typeof t.owner=="object"?t.owner.port:null;return{path:typeof t.path=="string"&&t.path!==""?t.path:null,decks:t.decks,mine:t.mine,ownerPort:typeof n=="number"?n:null}}function vne(e){return e<=0?null:e===1?"the one agent":`all ${e} agents`}function xne(e,t){const n=vne(e),r=(...l)=>[n?`${n} on the canvas`:null,...l,"layout, pins and selection"].filter(u=>u!==null),s="This cannot be undone.";if(!t)return{goes:r("the event log on disk — the file a restarted deck replays to rebuild what you see, and the file every deck on this machine shares unless one was told otherwise"),stays:[],final:s,confirm:"Clear everything"};if(!t.path)return{goes:r(),stays:[],final:`This deck keeps no event log, so nothing on disk changes — and nothing can bring the canvas back. ${s}`,confirm:"Clear everything"};if(!t.mine){const l=t.ownerPort===null?"another running deck owns that file":`the deck on port ${t.ownerPort} owns that file`,u=t.decks>2?`, one of ${t.decks} decks sharing it`:"";return{goes:r(),stays:[`the event log — ${l}${u}`,"restart this deck and the log replays back onto it"],final:null,confirm:"Clear this canvas"}}if(t.decks<=1)return{goes:r("this deck's event log — the file a restarted deck replays to rebuild what you see"),stays:[],final:s,confirm:"Clear everything"};const i=t.decks-1;return{goes:r(`the event log ${i===1?"1 other running deck shares":`${i} other running decks share`} with this one — every session recorded in it, not just the ones drawn here`),stays:[i===1?"what that deck shows, until it restarts — then it is gone there too":"what those decks show, until they restart — then it is gone there too"],final:s,confirm:"Clear everything"}}function bne({agentCount:e,onConfirm:t,onCancel:n}){const r=w.useRef(null),s=gt(n,{focusRef:r,layer:o8}),[i,l]=w.useState(null);w.useEffect(()=>{let p=!1;return fetch("/api/clear").then(g=>g.ok?g.json():null).then(g=>{p||l(wne(g))}).catch(()=>{}),()=>{p=!0}},[]);const{goes:u,stays:d,final:f,confirm:h}=xne(e,i);return a.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:a.jsxs("div",{ref:s,className:"modal clear-confirm",onClick:p=>p.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"clear-confirm-title",children:[a.jsxs("header",{className:"modal-head",children:[a.jsxs("div",{className:"modal-title",children:[a.jsx("span",{className:"status-dot err","aria-hidden":!0}),a.jsx("span",{id:"clear-confirm-title",className:"modal-tool-name",children:"Clear the deck?"})]}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:n,"aria-label":"Cancel (Esc)",title:"Cancel (Esc)",children:"×"})})]}),a.jsxs("section",{className:"modal-body",children:[a.jsxs("dl",{className:"cc-plan",children:[a.jsx("dt",{children:"Goes"}),a.jsx("dd",{children:u.map(p=>a.jsx("span",{children:p},p))}),a.jsx("dt",{children:"Stays"}),a.jsx("dd",{children:d.length>0?d.map(p=>a.jsx("span",{children:p},p)):a.jsx("span",{children:"nothing"})})]}),f&&a.jsx("p",{className:"cc-final",children:f}),a.jsxs("div",{className:"cc-actions",children:[a.jsx("button",{type:"button",ref:r,className:"btn",onClick:n,children:"Cancel"}),a.jsx("button",{type:"button",className:"btn danger",onClick:t,children:h})]})]})]})})}const kne=[{value:"bug",label:"Something is wrong"},{value:"idea",label:"An idea"},{value:"other",label:"Something else"}],Nne=120,jne=1e4,Sne=200;function tA(e,t){return t==="vetoed"?"This deck was started with AGENTS_DECK_NO_INSTALL=1, which keeps it off the network, so nothing was sent.":e===429||t==="too_many"?"Too much feedback from this network in the last hour. Try again later; your text is still here.":e===400?"The server did not accept this. Check that the title and the text are filled in.":"ccdeck's server could not be reached. Nothing was sent; your text is still here, so try again in a moment."}function _ne({onClose:e}){const t=w.useRef(null),n=gt(e,{focusRef:t}),[r,s]=w.useState("bug"),[i,l]=w.useState(""),[u,d]=w.useState(""),[f,h]=w.useState(""),[p,g]=w.useState({state:"idle"}),v=i.trim().length>=3&&u.trim().length>0&&p.state!=="sending";async function k(b){if(b.preventDefault(),!!v){g({state:"sending"});try{const x=await fetch("/api/feedback",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({kind:r,title:i.trim(),body:u.trim(),contact:f.trim()||void 0})}),N=await x.json().catch(()=>null);g(x.ok&&(N!=null&&N.ok)?{state:"sent"}:{state:"failed",message:tA(x.status,N==null?void 0:N.reason)})}catch{g({state:"failed",message:tA(0,null)})}}}return a.jsx("div",{className:"modal-backdrop",onClick:e,role:"presentation",children:a.jsxs("div",{ref:n,className:"modal feedback-dialog",onClick:b=>b.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"feedback-title",children:[a.jsxs("header",{className:"modal-head",children:[a.jsx("div",{className:"modal-title",children:a.jsx("span",{id:"feedback-title",className:"modal-tool-name",children:"Send feedback"})}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:e,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),a.jsx("section",{className:"modal-body",children:p.state==="sent"?a.jsxs("div",{className:"fb-done",role:"status",children:[a.jsx("p",{children:"Thank you. It reached the people who make ccdeck."}),a.jsx("div",{className:"fb-actions",children:a.jsx("button",{type:"button",className:"btn primary",onClick:e,children:"Close"})})]}):a.jsxs("form",{className:"fb-form",onSubmit:k,noValidate:!0,children:[a.jsxs("fieldset",{className:"fb-kinds",children:[a.jsx("legend",{className:"vis-hidden",children:"What is it about"}),kne.map(b=>a.jsxs("label",{className:"fb-kind",children:[a.jsx("input",{type:"radio",name:"feedback-kind",value:b.value,checked:r===b.value,onChange:()=>s(b.value)}),a.jsx("span",{children:b.label})]},b.value))]}),a.jsxs("label",{className:"fb-field",children:[a.jsx("span",{children:"Title"}),a.jsx("input",{ref:t,className:"ap-manage-input",type:"text",value:i,maxLength:Nne,onChange:b=>l(b.target.value),required:!0})]}),a.jsxs("label",{className:"fb-field",children:[a.jsx("span",{children:"What happened, or what you would like"}),a.jsx("textarea",{className:"ap-manage-input",value:u,maxLength:jne,rows:6,onChange:b=>d(b.target.value),required:!0})]}),a.jsxs("label",{className:"fb-field",children:[a.jsx("span",{children:"How to reach you, if you want an answer (optional)"}),a.jsx("input",{className:"ap-manage-input",type:"text",value:f,maxLength:Sne,autoComplete:"email",onChange:b=>h(b.target.value)})]}),a.jsx("p",{className:"fb-note",children:"This goes to the people who make ccdeck, with your ccdeck version and system. They may open a public GitHub issue from it; how to reach you is never put there."}),p.state==="failed"&&a.jsx("p",{className:"fb-error",role:"alert",children:p.message}),a.jsxs("div",{className:"fb-actions",children:[a.jsx("button",{type:"button",className:"btn",onClick:e,children:"Cancel"}),a.jsx("button",{type:"submit",className:"btn primary",disabled:!v,children:p.state==="sending"?"Sending…":"Send"})]})]})})]})})}const Ene="Press Esc first if a key does nothing.",Cne=[{title:"Canvas",rows:[{cap:"Space",action:"pause or resume the stream",binds:[" "]},{cap:"J",action:"next agent",binds:["j","J"]},{cap:"K",action:"previous agent",binds:["k","K"]},{cap:"W",action:"the session waiting on you — oldest first, again for the next",binds:["w","W"]},{cap:"F",action:"fit every agent on screen",binds:["f","F"]},{cap:"Z",action:"zoom to the selected agent and its session",binds:["z","Z"]},{cap:"Delete",action:"take the selected card off the board — Undo brings it back",binds:["Delete"]},{cap:"R",action:"re-arrange the canvas and drop the pins",binds:["r","R"]},{cap:"C",action:"clear the canvas and the event log — asks first",binds:["c","C"]}]},{title:"Panels and dialogs",rows:[{cap:"U",action:"usage panel",binds:["u","U"]},{cap:"L",action:"session list",binds:["l","L"]},{cap:"D",action:"detail panel",binds:["d","D"]},{cap:"H",action:"usage history",binds:["h","H"]},{cap:"A",action:"Claude accounts, where Claude Code is installed",binds:["a","A"]},{cap:"S",action:"this machine — cores, memory, temperature",binds:["s","S"]},{cap:"B",action:"Browser Watch",binds:["b","B"]},{cap:"V",action:"the sound menu — volume, tones, notifications",binds:["v","V"]},{cap:"?",action:"this sheet",binds:["?"]}]},{title:"Settings",rows:[{cap:"M",action:"sound on or off",binds:["m","M"]},{cap:"T",action:"light or dark theme",binds:["t","T"]}]},{title:"Focus and selection",rows:[{cap:"Tab",action:"reach the agent cards",binds:[]},{cap:"Enter",action:"select the focused card",binds:["Enter"]},{cap:"Shift + Enter",action:"add the focused card to the selection",binds:["Enter"]},{cap:"Esc",action:"close what is open, deselect, release focus",binds:["Escape"]}]},{title:"Mouse",rows:[{cap:"drag",action:"move a node, and pin it where you dropped it",binds:[]},{cap:"shift-click",action:"add an agent to the selection",binds:[]},{cap:"click",action:"a card: go to it and its session",binds:[]},{cap:"double-click",action:"a card: its prompt, every tool call, tokens and timing",binds:[]},{cap:"hover",action:"zoomed out, a card's name, state and numbers",binds:[]},{cap:"click",action:"the topbar speaker opens volume and sound settings",binds:[]}]}];function Tne({onClose:e,onTour:t}){const n=gt(e);return a.jsx("div",{className:"modal-backdrop",onClick:e,role:"presentation",children:a.jsxs("div",{ref:n,className:"modal key-help",onClick:r=>r.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"key-help-title",children:[a.jsxs("header",{className:"modal-head",children:[a.jsx("div",{className:"modal-title",children:a.jsx("span",{id:"key-help-title",className:"modal-tool-name",children:"Keyboard shortcuts"})}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:e,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),a.jsxs("section",{className:"modal-body",children:[t&&a.jsxs("div",{className:"guide-door",children:[a.jsx("span",{children:"Eight pictures of what the deck shows."}),a.jsx("button",{type:"button",className:"btn",onClick:t,children:"Take the tour"})]}),a.jsx("div",{className:"shortcuts",children:Cne.map(r=>a.jsxs(w.Fragment,{children:[a.jsx("h3",{className:"kh-group",children:r.title}),r.rows.map(s=>a.jsxs("div",{className:"sc",children:[a.jsx("kbd",{children:s.cap}),a.jsx("span",{children:s.action})]},`${r.title}:${s.cap}:${s.action}`))]},r.title))}),a.jsx("p",{className:"kh-foot",children:Ene})]})]})})}function Rne(e,t){const n=(e??[]).filter(s=>s&&typeof s.fp=="string"&&!t.has(s.fp));if(!n.length)return{request:null,waiting:0};const r=[...n].sort((s,i)=>(s.at??0)-(i.at??0));return{request:r[0],waiting:r.length-1}}function Ane({request:e,waiting:t,busy:n,now:r,onAccept:s,onDecline:i,onLater:l}){const u=w.useRef(null),d=gt(l,{focusRef:u}),f=Ys(n,"accept"),h=Ys(n,"dismiss");return a.jsx("div",{className:"modal-backdrop",onClick:l,role:"presentation",children:a.jsxs("div",{ref:d,className:"modal lan-ask",onClick:p=>p.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"lan-ask-title","aria-describedby":"lan-ask-who",children:[a.jsxs("header",{className:"modal-head",children:[a.jsxs("div",{className:"modal-title",children:[a.jsx("i",{className:"ap-pulse","aria-hidden":!0}),a.jsx("span",{id:"lan-ask-title",className:"modal-tool-name",children:"A deck wants to pair"})]}),a.jsx("div",{className:"modal-actions",children:a.jsx("button",{type:"button",className:"glyph-btn",onClick:l,"aria-label":"Answer later (Esc)",title:"Answer later (Esc)",children:"×"})})]}),a.jsxs("section",{className:"modal-body",children:[a.jsxs("p",{id:"lan-ask-who",className:"lan-ask-who",children:[a.jsx("strong",{className:"lan-ask-name",children:e.name})," at ",a.jsx("code",{className:"ap-lan-code",children:e.addr})," · asked ",q0(e.at,r)]}),a.jsx("p",{className:"modal-note",children:"Paired decks repair each other's expired logins. Accept only if you know this machine — what it shares is an account, not a screen."}),a.jsxs("p",{className:"lan-ask-fp",children:["Its fingerprint is ",a.jsx("code",{className:"ap-lan-code",children:e.fp})," — that machine shows its own under This deck on the network; the two should match."]}),t>0&&a.jsx("p",{className:"lan-ask-more",children:t===1?"One more deck is waiting behind this one.":`${t} more decks are waiting behind this one.`}),a.jsxs("div",{className:"lan-ask-acts",children:[a.jsx("button",{type:"button",ref:u,className:"btn",disabled:h.disabled,"aria-busy":h.busy,onClick:i,title:"Nothing is shared. If that deck asks again, this comes back.",children:n==="dismiss"?"declining…":"Decline"}),a.jsx("button",{type:"button",className:"btn primary",disabled:f.disabled,"aria-busy":f.busy,onClick:s,title:"Talk to this deck from now on, and repair its expired logins with this deck's own.",children:n==="accept"?"accepting…":"Accept"})]})]})]})})}function Mne({lanPending:e,lanDeferred:t,lanBusy:n,answerLanPair:r,deferLanPair:s}){const{request:i,waiting:l}=Rne(e,t.current);return i?a.jsx(Ane,{request:i,waiting:l,busy:n,now:Date.now(),onAccept:()=>void r("accept",i.fp),onDecline:()=>void r("dismiss",i.fp),onLater:()=>s(i.fp)},i.fp):null}const $ne={"//":["What a user would NOTICE. One key per version that has something to say,","and no key at all for a version that has nothing — which is most of them.","","The rule this file exists to serve: before every release, ask 'what would a","user notice?' and write the answer here. 'Nothing user-visible' is a valid","and expected answer, and it is spelled by adding no key. A release with no","key shows no modal, and that silence is what keeps the modal worth reading","on the day it is not silent.","","What belongs here: something that changed on the user's machine or under","their hands — a hook written to or removed from settings.json, a default","that flipped, a control that moved or went away, a stored preference that","changed meaning. What does not: bounds, races, assertions that could not","fire, anything that is invisible when it is correct.","","Write it for the person running the deck, not for the person reading the","diff. `title` is the sentence they scan; `body` is what they need in order","to act on it, or to stop worrying about it.","","Keys are versions exactly as package.json spells them. A key that is not a","version, or an entry missing either field, fails the suite rather than","being quietly dropped — see src/web/__tests__/release-notes-file.test.ts.","Ordering here is for humans; the deck sorts by version itself.","","A title may open with an emoji, and if it does, put exactly ONE space after","it. Not two: the dialog gives a leading emoji its own optical gap, because","a colour glyph is drawn edge to edge inside its advance and one word space","after one reads as none. A second space here would be a lie in the data","about a defect in the type, and the suite refuses both it and no space at","all.","","A release that genuinely has nothing to say is spelled TWICE: no key here,",'and its version written into "//nothing-to-say" below. One spelling on its',"own is ambiguous — a missing key reads the same whether it was a decision","or a forgotten step, and five releases in a row were once forgotten. The list","is what tells the two apart, and release-notes-current-version.test.ts fails","the release whose version is in neither place. Any key opening with // is a","note to the author and never a release."],"//nothing-to-say":["3.23.1","3.23.2","3.23.3","3.23.4","3.26.0","3.26.1","3.26.3","3.26.4","3.26.5","3.27.6","3.27.7","3.28.0","3.28.1","3.29.3","3.29.4","3.29.6","3.29.7","3.29.9","3.33.1"],"3.34.1":[{title:"🗂️ The tray menu stays open while you read it",body:"On Linux the menu behind the tray icon could close by itself while agents were working, often before the row you pressed took the click, so it had to be opened and pressed again. It now changes only when something it says has changed, and stays open while you choose."}],"3.34.0":[{title:"🗺️ The network map shows who you are connected to",body:"Paired decks that are on stand closest to this one, and a light runs along their wires. Paired decks that are away come next, in a colour of their own, with how long they have been gone, and machines that are not paired stand outside in grey. Decks reached over Tailscale sit together in their own shaded slice instead of on dashed wires. Pointing at a deck opens its details beside the map: whether it is there, what to do next if anything, its address and what it runs, and every login the two share, the ones that need a look first."},{title:"🔑 A login that expired everywhere says so",body:`When a shared login expired on this deck and every paired deck that is on held an expired copy too, the row said "Login expired" and waited for a repair that could never come. It now says "Login expired on all online decks". Claude retires a login's other copies each time one machine refreshes it, so shared copies expire together: sign in again on any one machine and the others repair from it on their next round.`},{title:"💬 Send feedback from inside the deck",body:'Appearance settings has a "Send feedback…" button: pick what kind it is, write a title and a few lines, and add a way to reach you if you want an answer. It goes to the people who make ccdeck, who may open a public issue from it, never with your contact in it. If it cannot be sent, the form stays filled in and says why.'}],"3.33.0":[{title:"🪝 Hooks you add in Claude Code are no longer removed",body:"Claude Code's hook editor often files a new hook into the same group as the deck's own. Starting the deck, or uninstalling it, then removed the whole group, and your hook went with it without a word. The deck now takes out only its own command and leaves yours where it was, and the same goes for the old finish-sound hook. `ccdeck --uninstall` also stops the decks that are running, so an update in the background cannot put the hooks back."},{title:"🧵 Resumed Codex sessions show up again",body:"A Codex session picked up with `codex resume`, or one that ran for days, could go dark on the canvas and drop out of the 5-hour and 7-day usage, because the deck only looked in the two newest day folders. It now follows those sessions and counts their tokens. Two Codex sessions in the same folder get different id suffixes, and a `bash -lc` call shows the command it runs."},{title:"🤝 A deck paired by the accept switch brings in less",body:'A deck that paired through the automatic accept switch, and not through an invite, now brings in only the logins you have ticked on this deck, and nothing from it is ticked for sharing onward. Its dialog says "paired automatically — pair by invite to take it". Pairing by invite works as before. A typed address is no longer dropped after one failed round, and the sync port stays the same after a rename.'},{title:"⬆️ Desktop updates install when you expect them",body:'On Windows and Linux a downloaded update now installs when you quit. On a Mac, Quit installs it and the app stays closed. The Linux .deb needs an administrator password to install, so it no longer does that by itself: it waits for "Restart to update" and says a password is coming. "Start at login" now works on Linux, and "Restart ccdeck" stops a deck that has hung.'},{title:"🕵️ Browser Watch waits before it acts, and quits only its own browser",body:"A program's visit is now logged and reacted to once its quiet window has closed, about 16 minutes after it, and not on the first poll, so a visit that is withdrawn no longer quits the browser. On Linux the quit reaction ends only the browser that holds the watched profile; other Chrome channels and headless browsers keep running. When it cannot tell which process that is, it does nothing and says so, which includes a Flatpak Brave."},{title:"🧮 Figures that were off are right",body:`Spend by labelled and workflow subagents counts toward a session's tokens and cost. The Projects report prices 1-hour cache writes the way ccusage does, so its dollars match the Usage panel. After a restart the deck rebuilds its whole event history, where it used to rebuild about a third. On Linux the process list shows what each process is using now, not its lifetime average. A count near a boundary reads "1.00M", and a full quota window says "used up".`},{title:"🔑 The Usage panel's reads answer the deck's own page only",body:"The routes behind the Usage panel (/api/quota, /api/ccusage, /api/codex-usage, /api/codex-quota and /api/cswap-auto) now answer the deck's own page, or a client that sends the deck's token. A script that read them with a plain request gets 401 from this version on. The hook, the desktop app and the `ccdeck` command are not affected."},{title:"🛠️ Smaller fixes you may notice",body:"With the canvas paused, an update no longer restarts the server while an agent is working: it waits until no turn is open. `ccdeck --stop -p4317` stops that one deck. A deck started at login can update itself on Homebrew and nvm setups. Dialogs keep keyboard focus after a button goes away, screen readers hear pairing requests by deck name and the machine panel's readings, dim text is readable in both themes, Windows High Contrast shows what is selected, and below 640px the detail panel opens over the canvas."}],"3.32.2":[{title:"🔒 Self-updates wait until your screen is unlocked",body:"On Linux with GNOME, the app installs an update by itself when you leave it alone, which is often while your screen is locked. GNOME switches the panel's tray off under the lock screen, and a version that started then never showed its icon. The app now waits until you are back before restarting by itself, so its icon comes back with it."}],"3.32.1":[{title:"🔔 The tray icon comes back on Linux",body:"On Linux the app could lose its icon in the panel, after it updated itself or when the panel restarted, and stay without it until it was quit. It now notices within a minute and restarts by itself the next time you are away from its window, the way it installs an update. It does this at most once every six hours, and not again if a restart did not help."},{title:"🔕 A window you closed stays closed after a self-update",body:"When the app restarted by itself to install an update, it opened its window again even if you had closed it, and while that window was open the deck held back its notifications. A window you closed now stays closed."},{title:"🪟 No empty icon when ccdeck is already open",body:'Opening ccdeck again while it was running flashed an empty "…" icon in the Linux panel before bringing the window forward. It now only brings the window forward.'}],"3.32.0":[{title:"🗺️ A map of your network",body:"A new button on the Local network row, and in its view's header, opens a map of every deck around this one. This deck is at the centre and the paired decks that are on stand around it. Further out are the quiet ones, the machines nearby and any deck asking to pair. Wires are solid on your local network and dashed over Tailscale. Pointing at a deck says how it is reached, what it runs and which logins the two share, and pressing it opens that deck's own dialog."}],"3.31.0":[{title:"📊 Account capacity",body:"A gauge button in the accounts panel's header opens Account capacity: how many of your Claude accounts are ready now, what the 5-hour and 7-day windows have left across all of them, and a row for each account with its use, its state (Ready, Limited, Exhausted or Stale) and when it was last read. Each window also says whose reset comes next."},{title:"🚦 Claude and Codex incidents",body:"When Anthropic's or OpenAI's status page reports an incident on something your sessions use, the deck says so in the topbar, the Usage panel and the tray, and every mark links to the status page. A provider with nothing wrong draws nothing."},{title:"↕️ Order your other accounts",body:"The Other accounts row can sort the list by slot, by how full a window is, or by most room, and open every account at once. Both stay as you left them after a reload."},{title:"🔐 A settings folder left by sudo can be given back",body:'On a Mac, running ccdeck once with sudo left its settings folder owned by another user, and every settings change was refused, sharing an account included. The message now offers "give it back": macOS asks for your password, the folder is yours again, and the deck reads its settings back without a restart.'}],"3.30.0":[{title:"🧮 Token counts and costs are no longer doubled",body:"Claude Code writes a reply that has thinking, text and tool calls as several transcript lines, each carrying the whole request's usage. The deck added up every line, so a session's tokens and cost on its card came out close to twice what it was billed, and the context panel counted each part of a reply as its own message. Each request is now counted once. Expect the totals on your cards to come down."},{title:"⏳ Claude's saved limit resets on the Usage panel",body:`When your Claude account has free limit resets to spend ("Reset for free" in Claude's Settings → Usage), the Claude card now says how many there are and when the first one expires, the way the Codex card already did. The deck only reports them; you spend them in Claude's own settings.`},{title:"🔑 LAN invites need the other deck updated",body:`An invite's code is now a long random secret instead of six digits, so nobody else on the network can work it out and pair in your place, and a wrong code is refused by name. An invite made on this version can only be joined from a deck on this version or later: an older deck answers "That is not an invite". Update that deck, or make the invite on the older one and join it here.`},{title:"🔕 AGENTS_DECK_NO_NOTIFY keeps Browser Watch quiet too",body:"A deck started with AGENTS_DECK_NO_NOTIFY=1 still raised a desktop notification for every new Browser Watch finding. It no longer does. The finding is still in the Browser Watch panel and its log, which says why no notification came."},{title:"🛠️ Smaller fixes",body:'Delete removes the card you just clicked. A LAN address you typed stays in the list when a round cannot reach it, and the status line under the LAN switch now agrees with the rows below it. In the desktop app, a dismissed "update is ready" notice stays dismissed after you answer the first-launch question. Sizes read the same in every panel ("1.1 KB"). Faded text stays readable, a keyboard can see the scrollbar, and numbers use a monospaced font on Windows and Linux as well.'}],"3.29.11":[{title:"💲 Claude Sonnet 5.5 has a price",body:`Sessions on Claude Sonnet 5.5 showed "not priced" on the board, and the Projects report could only show a minimum for them. They are now priced at Anthropic's published rate, the same as Sonnet 5: $2 per million input tokens and $10 per million output tokens.`}],"3.29.10":[{title:"💲 Claude Opus 5.5 has a price",body:`Sessions on Claude Opus 5.5 showed "not priced" on the board, and the Projects report counted them as costing nothing, so its totals read far too low. They are now priced at Anthropic's published rate. If a model still has no price, Projects shows its total as a minimum, like $11.19+, and names the model, instead of a total that looks complete.`}],"3.29.8":[{title:"🔁 Removed cards come back when their agent works again",body:"Remove from board is for finished work. If the agent behind a card you removed starts a tool call, gets a new prompt or starts a subagent, the card returns on its own, together with the card it hangs from, and it stays back after a reload. Cards whose agents stay idle stay removed."}],"3.29.1":[{title:"🗂️ One row per project in Projects",body:"The Projects report now counts a session's work under the folder you started it in, the same name its card has on the canvas, instead of adding a row for every folder the agent moved into. The first start after updating re-reads your transcripts once to regroup the report."},{title:"🔔 Tidier custom sounds",body:"Importing a sound, recording one and choosing a spoken voice now sit in compact cards that respond to clicks and focus like the rest of the deck."}],"3.29.0":[{title:"🎵 Your own stations in Claude FM",body:"Add any YouTube live link or radio stream as a station in Appearance, next to the built-in ones, and mute the music without losing your volume. When a station is not live, the picker now says so instead of staying silent."},{title:"🔔 Notification sounds and voices of your own",body:"Pick a local audio file or a spoken voice for each alert, so the sound that means an agent is waiting is one you will recognise."},{title:"🗑️ Drag a card off the board to remove it",body:"Drag a card to the target at the bottom of the canvas to take it off the board, or use Remove from board in the detail panel (Delete). The session keeps running, and the session list (L) brings it back."},{title:"🔐 Optional invite-only pairing",body:"Pairing works as before, with or without an invite. If you want, Local network can now be set to accept only decks that join with an invite you created, so a nearby machine cannot ask to pair on its own."},{title:"🌐 Account sharing between your machines is more reliable",body:"A locked macOS Keychain is explained instead of failing silently, a login that is broken or belongs to another account is never shared, and a sync that stops partway keeps what already arrived."},{title:"📅 Projects opens on Today",body:"The Projects report per account starts with today's work, and an empty window offers the next wider one. The topbar also shows this month's usage, and the desktop app can restart into an update from its own window."}],"3.27.0":[{title:"📊 Projects: where each account spent its work",body:"Each account card's ⋯ menu now breaks its cost down by project, over 7d / 30d / all."}],"3.27.1":[{title:"🎨 Make Appearance easier to tune",body:"The Appearance dialog now has clearer sections, stronger selection states, and a calmer layout for choosing a theme and configuring music. Your existing settings and keyboard shortcuts continue to work."}],"3.27.2":[{title:"💰 Project costs now match Usage",body:"Project cost totals no longer count the same Claude request once for every content block. Existing project history is rebuilt automatically so the totals align with the Usage panel."}],"3.27.3":[{title:"🎵 Station selection works in the desktop app",body:"The music station picker now opens inside ccdeck instead of relying on the operating system popup, so choosing a station works reliably in the Electron app."}],"3.27.4":[{title:"✅ Desktop picker release checks are green",body:"The station picker now keeps the same keyboard, motion, focus, and layout behavior as the rest of ccdeck across desktop and browser builds."}],"3.27.5":[{title:"🧭 The welcome tour stays dismissed",body:"Electron now remembers that you completed the onboarding tour at the deck level, so an update or loopback port change no longer shows the same tour again."},{title:"🎵 The station picker has a clearer finish",body:"The music selector has a tighter trigger, a purposeful chevron, and more deliberate option spacing so it reads like a native part of Appearance."}],"3.25.0":[{title:"🖱️ A click goes to the session, a double-click opens the details",body:"Clicking a card frames it with the rest of its session and leaves the detail panel shut. Double-click a card to open its details; `j`/`k`, the session list, Enter and `D` still open them too."},{title:"🔭 Cards stay readable when you zoom out",body:"At every zoom a card shows its name, its state and anything waiting on you, instead of shrinking to a coloured pill. Hover or focus a card to see it whole. Recap notes read at a distance too, and show the full recap on hover."},{title:"🌐 The Machine panel shows your network",body:"A new Network section shows download, upload and the round trip to Claude's API, and names the route when traffic goes through a VPN or a Tailscale exit node. Those checks run only while the panel is open. The panel is regrouped into CPU, Memory, Network and Thermal, with a flag at the top when something needs attention."},{title:"🎨 See each theme before you pick it",body:"The Appearance menu shows a small preview of the deck in Light and in Dark. Claude FM also keeps its volume when a notification chime plays, instead of dipping under it."}],"3.24.1":[{title:"🎛️ Appearance is one small menu now",body:"The topbar's appearance control opens a compact menu where you can choose Light or Dark and show or hide the character. The character stays on by default, and your choice is remembered."}],"3.24.0":[{title:"🎧 Claude FM plays from the minimap",body:"A small character stands on the minimap's top edge. Press it and the Claude channel's live stream plays; press it again and it stops. It only turns up when the channel is actually broadcasting, so a deck with no network never shows it at all."},{title:"🤠 And it gets on with its day",body:"It walks that edge, tidies up what it finds, kicks a ball along it, sits with its legs over the side, and watches the board through a scope. Now and then it drops onto the canvas and ropes its way back up. Headphones on while the music plays, a hat when it does not."}],"3.23.5":[{title:"🧭 The accounts panel opens on the account you are on",body:"Its windows, its resets and how old the numbers are — whole, at the top of the column. Every other account stands behind one row that says how many of them a switch could actually reach; press it to see them, or rest on it to be shown their names and how much room each has left."},{title:"⚙️ Auto-switch moved in there with them",body:"It is behind that same row now, after the accounts it switches between, rather than at the foot of the panel. The row says `auto 90%` or `auto off` so you can tell what the policy is doing without opening it — and says so in amber when it is armed with nowhere left to go."}],"3.23.0":[{title:"🧭 The accounts column leads with accounts",body:`The live account is the open row: its windows as bars, when each one resets, and how old the numbers are. Every other account rests on the two figures a switch is decided by, and opens with a click when you want the rest.
|
|
99
99
|
|
|
100
100
|
A problem stays on the row — an expired login, one that was never stored, a keychain the deck cannot open — with the reason and the sign-in one press away. Auto-switch is one row now: its threshold and its switch. Local network moved out of the column into a view of its own, reached from a row at the foot that says how many of the paired machines are on right now, and shows which ones when you hover it.`},{title:"💬 A resting session shows Claude Code's recap beside its card",body:"When a session stops, Claude Code's own recap of what it did is drawn beside the card — so a board you come back to says what happened without opening anything."},{title:"🪟 The chrome went quiet",body:`The topbar is borderless, one set of corners runs through the app, the canvas ground is flat, and the minimap, the zoom controls, the type filter and the Machine and Usage panels read as tooling rather than as cards.
|
|
101
101
|
|
|
@@ -297,5 +297,5 @@ Nothing was added to the card and nothing new is polled. The deck already reads
|
|
|
297
297
|
`).map(n=>({text:`+ ${n}`,tone:"add"}))]}function rre(e){if(!Array.isArray(e)||e.length===0)return null;const t=[];for(const n of e){if(!Or(n)||!Array.isArray(n.lines))return null;t.push({text:`@@ -${n.oldStart},${n.oldLines} +${n.newStart},${n.newLines} @@`,tone:"ctx"});for(const r of n.lines){const s=String(r);t.push(s.startsWith("+")?{text:s,tone:"add"}:s.startsWith("-")?{text:s,tone:"del"}:{text:s})}}return t}function sA(e){if(typeof e=="string")return[Zt(void 0,e)];if(!Or(e))return[Zt(void 0,Pa(e))];const t=[],n=yn(e.type);n==="create"&&t.push(wn("result","created the file"));const r=rre(e.structuredPatch);return r&&t.push(MO("applied",r)),e.userModified===!0&&t.push(wn("note","the user changed it before it was applied")),t.length?t:[wn("result",n==="update"?"updated the file":"done")]}function sre(e){const t=typeof e.offset=="number"?e.offset:null,n=typeof e.limit=="number"?e.limit:null;if(t==null&&n==null)return null;const r=t??1;return n!=null?`${r}–${r+n-1}`:`from ${r}`}function are(e){if(typeof e=="string")return[Zt(void 0,e)];const t=Or(e)&&Or(e.file)?e.file:null,n=yn(t==null?void 0:t.content);if(t&&n!=null){const s=[],i=Number(t.numLines),l=Number(t.totalLines),u=Number(t.startLine);return Number.isFinite(i)&&Number.isFinite(l)&&l>0&&s.push(wn("lines",i>=l?`all ${l}`:Number.isFinite(u)?`${u}–${u+i-1} of ${l}`:`${i} of ${l}`)),s.push(Zt("content",n)),s}const r=Or(e)?yn(e.type):null;return r&&r!=="text"?[wn("result",`${/^[aeiou]/i.test(r)?"an":"a"} ${r} file`)]:[Zt(void 0,Pa(e))]}function ore(e){if(typeof e=="string")return[Zt("output",e)];if(!Or(e))return[Zt(void 0,Pa(e))];const t=yn(e.stdout),n=yn(e.stderr);if(t==null&&n==null)return[Zt(void 0,Pa(e))];const r=[];return t&&r.push(Zt("output",t.replace(/\n$/,""))),n&&r.push(Zt("errors",n.replace(/\n$/,""),!0)),e.interrupted===!0&&r.push(wn("note","interrupted before it finished")),r.length?r:[wn("output","none")]}function ire(e,t,n){const r=Or(t)?t:null;if(r&&(e==="Edit"||e==="MultiEdit")){const s=yn(r.file_path),i=(e==="MultiEdit"?Array.isArray(r.edits)?r.edits:[]:[r]).filter(Or).filter(l=>yn(l.old_string)!=null&&yn(l.new_string)!=null);if(s&&i.length){const l=[wn("file",s)];return i.forEach((u,d)=>{const f=u.replace_all===!0?", every occurrence":"";l.push(MO(i.length>1?`change ${d+1}${f}`:`change${f}`,nre(u.old_string,u.new_string)))}),{input:l,response:sA(n)}}}if(r&&e==="Write"){const s=yn(r.file_path),i=yn(r.content);if(s&&i!=null)return{input:[wn("file",s),Zt("content",i)],response:sA(n)}}if(r&&e==="Read"){const s=yn(r.file_path);if(s){const i=sre(r);return{input:i?[wn("file",s),wn("lines",i)]:[wn("file",s)],response:are(n)}}}if(r&&e==="Bash"){const s=yn(r.command);if(s!=null){const i=yn(r.description);return{input:i?[Zt("command",s),wn("why",i)]:[Zt("command",s)],response:ore(n)}}}return{input:[Zt(void 0,Pa(t))],response:[Zt(void 0,Pa(n))]}}function aA(e,t,n){if(n==null)return"";if(typeof n=="string")return n;if(Or(n)){if(e==="Bash"&&t==="input"&&typeof n.command=="string")return n.command;if(e==="Bash"&&t==="response"&&(typeof n.stdout=="string"||typeof n.stderr=="string"))return[n.stdout,n.stderr].filter(r=>typeof r=="string"&&r!=="").join(`
|
|
298
298
|
`);if(e==="Read"&&t==="response"&&Or(n.file)&&typeof n.file.content=="string")return n.file.content}try{return JSON.stringify(n,null,2)??String(n)}catch{return String(n)}}function lre({tool:e,onClose:t}){const n=gt(t),r=e.endedAt==null?"inflight":e.ok===!1?"err":"done",s=e.input??e.inputPreview,i=e.response??e.errorPreview,l=ire(e.name,s,i);return a.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:a.jsxs("div",{ref:n,className:"modal",onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"tool-modal-title",children:[a.jsxs("header",{className:"modal-head",children:[a.jsxs("div",{className:"modal-title",children:[a.jsx("span",{className:`status-dot ${r}`,"aria-hidden":!0}),a.jsx("span",{id:"tool-modal-title",className:"modal-tool-name",children:e.name}),a.jsxs("span",{className:"modal-tool-id",title:e.id,children:[e.id.slice(0,12),"…"]})]}),a.jsxs("div",{className:"modal-actions",children:[a.jsx("span",{className:"modal-dur",children:cM(e,"in-flight…")}),a.jsx("button",{className:"glyph-btn",onClick:t,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]})]}),a.jsxs("section",{className:"modal-body",children:[e.trimmed&&a.jsx("div",{className:"modal-section",children:a.jsx("p",{className:"modal-note",children:"Full payloads for this call were released to keep memory bounded — only the previews below are still held."})}),a.jsxs("div",{className:"modal-section",children:[a.jsxs("div",{className:"tm-head",children:[a.jsx("h4",{children:"Input"}),a.jsx(iA,{text:aA(e.name,"input",s),what:"input"})]}),l.input.map((u,d)=>a.jsx(oA,{block:u},d))]}),a.jsxs("div",{className:"modal-section",children:[a.jsxs("div",{className:"tm-head",children:[a.jsxs("h4",{children:["Response ",r==="err"&&a.jsx("span",{className:"err-tag",children:"error"})]}),e.endedAt!=null&&a.jsx(iA,{text:aA(e.name,"response",i),what:"response"})]}),e.endedAt==null?a.jsx("pre",{children:"(waiting…)"}):l.response.map((u,d)=>a.jsx(oA,{block:u},d))]})]})]})})}const cre={del:"tm-del",add:"tm-add",ctx:"tm-ctx"};function oA({block:e}){const[t,n]=w.useState(!1);if(e.inline)return a.jsxs("p",{className:"tm-inline",children:[e.label&&a.jsx("span",{className:"tm-label",children:e.label}),a.jsx("code",{children:e.text})]});const r=ere(e),{shown:s}=AO(r,t),i=tre(r,t);return a.jsxs("div",{className:"tm-block",children:[e.label&&a.jsx("span",{className:"tm-label",children:e.label}),a.jsx("pre",{className:e.err?"tm-err":void 0,children:e.lines?s.map((l,u)=>a.jsxs("span",{className:l.tone?cre[l.tone]:void 0,children:[l.text,u<s.length-1?`
|
|
299
299
|
`:""]},u)):s.map(l=>l.text).join(`
|
|
300
|
-
`)}),i&&a.jsx("button",{type:"button",className:"btn tm-more","aria-expanded":i.expanded,onClick:()=>n(l=>!l),children:i.label})]})}function iA({text:e,what:t}){const[n,r]=w.useState(!1),s=w.useRef(!0);return w.useEffect(()=>()=>{s.current=!1},[]),a.jsx("button",{type:"button",className:"btn tm-copy",disabled:!e,"aria-label":n?`The ${t} was copied`:`Copy the ${t}`,onClick:()=>void Fa(e).then(i=>{!i||!s.current||(r(!0),window.setTimeout(()=>{s.current&&r(!1)},1600))}),children:n?"copied":"copy"})}const ure=w.lazy(()=>_0(()=>import("./UsageHistoryModal-
|
|
301
|
-
`)}}function Mre(e,t){return!(e!=null&&e.ok)||e.disabled||!Array.isArray(e.providers)?[]:e.providers.map(n=>Are(n,t)).filter(n=>n!==null)}function $re(e){return e.map(t=>`${t.name}'s status page reports ${t.state.endsWith("outage")?`a ${t.words}`:t.words}.`).join(" ")}const Ire="The providers' status pages report no incident.";function Ore({version:e,loadVersion:t}){var f;const[n,r]=w.useState(!1),s=((f=e==null?void 0:e.upgrade)==null?void 0:f.state)??"idle",i=cne(e==null?void 0:e.upgrade),l=w.useRef(!1),u=w.useCallback(async()=>{if(Ar(l.current||s==="running")){l.current=!0;try{await fetch("/api/upgrade",{method:"POST"})}catch{}await t(),l.current=!1}},[s,t]);w.useEffect(()=>{if(s!=="running")return;const h=window.setInterval(t,3e3);return()=>window.clearInterval(h)},[s,t]);const d=w.useCallback(async()=>{const h=e==null?void 0:e.command;!h||!await Fa(h)||(r(!0),window.setTimeout(()=>r(!1),1600))},[e==null?void 0:e.command]);return{upgradeState:s,upgradeFailure:i,startUpgrade:u,copyCommand:d,cmdCopied:n}}const cA="agent-dag.browserWatch.seenMs";function Lre(e,t){return e.filter(n=>n.startMs>t)}function Pre(){const[e,t]=w.useState(()=>Number(Qe(cA))||0),[n,r]=w.useState([]),[s,i]=w.useState(!1);w.useEffect(()=>{let d=!0;const f=()=>{fetch("/api/browser-watch?live=0").then(p=>p.ok?p.json():null).then(p=>{var g;!d||!(p!=null&&p.ok)||(r(p.episodes??[]),i(((g=p.settings)==null?void 0:g.enabled)===!0))}).catch(()=>{})};f();const h=setInterval(f,5*6e4);return()=>{d=!1,clearInterval(h)}},[]);const l=w.useMemo(()=>Lre(n,e).length,[n,e]),u=w.useCallback(d=>{t(d),Ze(cA,String(d))},[]);return{watchOn:s,setWatchOn:i,watchUnseen:l,markWatchSeen:u}}const IO=["--err","--inflight","--ok","--grid-line","--minimap-mask","--panel","--line","--accent","--text-dim","--bg"];function uA(e){const t={};for(const n of IO)t[n]=e(n);return t}function Dre(e){return t=>e[t]??""}function Fre(e,t){return IO.every(n=>e[n]===t[n])}const OO="agent-dag.theme";function qre(e,t=!1){return e==="light"||e==="dark"?e:t?"light":"dark"}function Bre(){try{return window.matchMedia("(prefers-color-scheme: light)").matches}catch{return!1}}function Ure(){return qre(Qe(OO),Bre())}function dA(e){return typeof window>"u"?"":getComputedStyle(document.documentElement).getPropertyValue(e).trim()||""}function zre(){const[e,t]=w.useState(Ure),[n,r]=w.useState(ste),[s,i]=w.useState(()=>uA(dA)),l=w.useMemo(()=>Dre(s),[s]),u=w.useCallback(d=>cee(d,l),[l]);return w.useEffect(()=>{document.documentElement.dataset.theme=e,Ze(OO,e),i(d=>{const f=uA(dA);return Fre(d,f)?d:f})},[e]),w.useEffect(()=>{Ze(kO,n?"1":"0")},[n]),w.useEffect(()=>{const d=document.querySelector('meta[name="theme-color"]'),f=s["--panel"];d&&f&&d.setAttribute("content",f)},[s]),{theme:e,setTheme:t,characterEnabled:n,setCharacterEnabled:r,palette:s,minimapNodeFill:u}}function Wre(e){const t=w.useRef(null),[n,r]=w.useState(!1),[s,i]=w.useState(()=>new Set),l=w.useMemo(()=>{const d=new Set;for(const f of e.current.agents.values())for(const h of f.tools)d.add(xO(h.name));return Object.keys(vO).filter(f=>d.has(f))},[e.current,e.current.revision]);w.useEffect(()=>{if(l.length<=1){r(!1);return}let d=0;const f=()=>{const h=t.current;if(h&&!document.hidden){const p=h.getBoundingClientRect(),g=Array.from(document.querySelectorAll(".react-flow__node, .tool-burst")).map(k=>k.getBoundingClientRect()),v=QQ(p,g,8);r(k=>k===v?k:v)}d=window.setTimeout(f,300)};return f(),()=>window.clearTimeout(d)},[l.length]);const u=w.useCallback(d=>{i(f=>{const h=new Set(f);return h.has(d)?h.delete(d):h.add(d),h})},[]);return{presentCats:l,hiddenCats:s,toggleCat:u,catBarRef:t,catBarOccluded:n}}function Hre(e={enabled:()=>!0}){const t=e.ctor??(typeof window<"u"?window.AudioContext??window.webkitAudioContext??null:null);let n=null;const r=()=>e.enabled()?(n==null?void 0:n.state)==="running"?"ready":"locked":"off",s=()=>{var h;return(h=e.onState)==null?void 0:h.call(e,r())};function i(){var h,p;if(!(!t||(n==null?void 0:n.state)==="running"))try{n||(n=new t,(h=n.addEventListener)==null||h.call(n,"statechange",s)),(p=n.resume)==null||p.call(n).then(s,()=>{}),s()}catch{}}function l(h,p,g=p.figure){if(!n||n.state!=="running")return!1;const v=Ox(h,g),k=uY(p.level,v),b=n.currentTime;for(const x of v.notes){const N=n.createOscillator(),S=n.createGain();N.type=v.type??"sine",N.frequency.value=x.hz;const _=b+x.at,E=_+x.ms/1e3;S.gain.setValueAtTime(yS,_),S.gain.exponentialRampToValueAtTime(k,_+dY),S.gain.exponentialRampToValueAtTime(yS,E),N.connect(S).connect(n.destination),N.start(_),N.stop(E+.02)}return!0}async function u(h,p){if(!e.loadCustom)return"unavailable";let g;try{g=await e.loadCustom(h)}catch{return"unavailable"}if(!g)return"missing";if(g.kind==="tts"){if(typeof window>"u"||!("speechSynthesis"in window)||typeof SpeechSynthesisUtterance>"u")return"unavailable";const k=new SpeechSynthesisUtterance(g.text),b=window.speechSynthesis.getVoices();k.voice=b.find(x=>x.voiceURI===g.voiceURI)??null,k.rate=g.rate,k.pitch=g.pitch,k.volume=hY(p.level);try{return window.speechSynthesis.cancel(),window.speechSynthesis.speak(k),"played"}catch{return"unavailable"}}if(!n||n.state!=="running")return"locked";let v;try{v=await n.decodeAudioData(g.bytes.slice(0))}catch{return"broken"}try{const k=n.createBufferSource(),b=n.createGain();return k.buffer=v,b.gain.setValueAtTime(fY(g.normalizationGain,p.level),n.currentTime),k.connect(b).connect(n.destination),k.start(n.currentTime),"played"}catch{return"unavailable"}}function d(h,p=!1){var k,b;if(!p&&!e.enabled())return!1;const g=xY((k=e.prefs)==null?void 0:k.call(e),h),v=((b=e.customSelection)==null?void 0:b.call(e)[h])??null;return v&&e.loadCustom?(u(v,g).then(x=>{var N;x==="played"||x==="locked"||((x==="missing"||x==="broken")&&((N=e.onCustomFailure)==null||N.call(e,h,v)),l(h,{...g,figure:vn},vn))}),!0):!n||n.state!=="running"?!1:l(h,g)}function f(h,p=La){return u(h,{level:oi(p),figure:vn}),!0}return{unlock:i,play:d,previewCustom:f,state:r,get context(){return n}}}function Vre({chimesRef:e,soundOnRef:t,tonePrefsRef:n,customSelectionsRef:r,fallbackCustomRef:s}){const[i,l]=w.useState("locked");return w.useEffect(()=>{const u=Hre({enabled:()=>t.current===!0,prefs:()=>n.current,customSelection:()=>r.current,loadCustom:aY,onCustomFailure:(p,g)=>s.current(p,g),onState:l});e.current=u,l(u.state());const d=["pointerdown","pointerup","keydown"],f=()=>{for(const p of d)window.removeEventListener(p,h,{capture:!0})},h=()=>{var p;u.unlock(),((p=u.context)==null?void 0:p.state)==="running"&&f()};for(const p of d)window.addEventListener(p,h,{capture:!0});return f},[]),{chimeState:i}}function Gre(){const[e,t]=w.useState(ote),[n,r]=w.useState(()=>T6(Qe(MN))),[s,i]=w.useState(()=>C6(Qe($N))),[l,u]=w.useState(()=>R6(Qe(HR),n,nte)),[d,f]=w.useState(()=>new Set),[h,p]=w.useState(0);w.useEffect(()=>{Ze(NO,String(e))},[e]),w.useEffect(()=>{Ze($N,s?"1":"0")},[s]),w.useEffect(()=>{Ze(MN,JSON.stringify(n))},[n]),w.useEffect(()=>{Ze(HR,l)},[l]);const g=w.useCallback(N=>{r(S=>S.some(_=>_.id===N.id)?S:[...S,N]),f(S=>{if(!S.has(N.id))return S;const _=new Set(S);return _.delete(N.id),_})},[]),v=w.useCallback((N,S)=>{const _=S.trim();!_||_.length>Cl||r(E=>E.map(T=>T.id===N?{...T,name:_}:T))},[]),k=w.useCallback(N=>{r(S=>S.filter(_=>_.id!==N)),u(S=>A6(S,N)),f(S=>{if(!S.has(N))return S;const _=new Set(S);return _.delete(N),_})},[]),b=w.useCallback(N=>{const S=IN(N),_=d.has(S);N===l&&!_||(_&&f(E=>{const T=new Set(E);return T.delete(S),T}),u(N),p(E=>E+1))},[l,d]),x=w.useCallback((N,S)=>{const _=IN(N);f(E=>{if(E.has(_)===S)return E;const R=new Set(E);return S?R.add(_):R.delete(_),R})},[]);return{fmVolume:e,setFmVolume:t,fmMuted:s,setFmMuted:i,fmSource:l,customFmStations:n,unavailableFmStations:d,fmPlayRequest:h,addFmStation:g,renameFmStation:v,removeFmStation:k,pickFmSource:b,markFmStationAvailability:x}}function Kre(e){const[t,n]=w.useState(null),[r,s]=w.useState(!1),[i,l]=w.useState(null),u=w.useRef(0);w.useEffect(()=>{if(!e||!Bl())return;let k=!1;const b=u.current;return fetch("/api/desktop-update").then(x=>x.ok?x.json():null).then(x=>{if(k||u.current!==b)return;const N=JR(x);N&&n(N)}).catch(()=>{}),()=>{k=!0}},[e]);const d=Ote(t),f=w.useRef(!1),h=w.useRef(0),p=w.useRef(0);w.useEffect(()=>()=>window.clearTimeout(h.current),[]);const g=w.useCallback(async k=>{if(!Ar(f.current))return;const b=++p.current;window.clearTimeout(h.current),f.current=!0,s(!0),l(null);const x=N=>{b===p.current&&(window.clearTimeout(h.current),f.current=!1,s(!1),l({failure:N,version:k}))};try{const N=await fetch("/api/desktop-update/restart",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({version:k})});if(!N.ok)return x(Fte(await N.json().catch(()=>null)))}catch{return x("unreachable")}b===p.current&&(h.current=window.setTimeout(()=>x("timeout"),jO))},[]),v=w.useCallback(k=>{if(Bl())try{const b=JR(JSON.parse(k));b&&(u.current++,n(b),b.status!=="ready"&&(p.current++,window.clearTimeout(h.current),f.current=!1,s(!1)))}catch{}},[]);return{desktopUpdateRestarting:r,desktopUpdateFailure:i,readyAppUpdate:d,askDesktopUpdateRestart:g,onDesktopUpdateEvent:v}}const Au="agent-dag.autoRestart",hA="agent-dag.bundleReloadedFor";function Yre({now:e,stateRef:t,version:n,notice:r,noticeOpen:s,upgradeFailure:i,paused:l}){const[u,d]=w.useState(()=>Qe(Au)!=="0"),f=w.useRef(!1),h=w.useCallback(()=>{const F=!u;f.current=!0,ss(Au),d(F),fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({autoUpdate:F})}).then(I=>I.ok?I.json():null).then(I=>{var O;I!=null&&I.ok&&d(((O=I.prefs)==null?void 0:O.autoUpdate)!==!1)}).catch(()=>{})},[u]),[p,g]=w.useState(!1),[v,k]=w.useState("restart"),[b,x]=w.useState(null),N=w.useRef(!1),S=w.useRef(null),_=w.useRef(0),E=w.useRef(null),T=w.useCallback(async F=>{if(!Ar(N.current))return;const I=(F==null?void 0:F.upgrade)===!0,O=(F==null?void 0:F.whenIdle)===!0;N.current=!0,S.current=i;const z=++_.current,M=()=>{k(I?"npx":"restart"),g(!0)};O||M();try{window.sessionStorage.setItem("agent-dag.restartPending",(r==null?void 0:r.to)??"")}catch{}let $=!1;try{const P=await fetch("/api/restart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O?{upgrade:I,whenIdle:O}:{upgrade:I})});$=O&&P.status===409}catch{}if($){N.current=!1,E.current=null;try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}return}O&&M(),window.setTimeout(()=>{if(_.current===z&&N.current){N.current=!1,g(!1);try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}}},I?18e4:3e4)},[r==null?void 0:r.to,i]);w.useEffect(()=>{const F=QR(t.current.agents.values())>0,I=pne({enabled:u,kind:r==null?void 0:r.kind,canRestart:(n==null?void 0:n.canRestart)===!0,noticeOpen:s,visible:document.visibilityState==="visible",busy:F,idleSince:E.current,now:e});E.current=I.idleSince,I.restart&&T({whenIdle:!0})},[u,r==null?void 0:r.kind,n==null?void 0:n.canRestart,s,e,T]);const R=QR(t.current.agents.values()),A=fne(R,l),B=_O({enabled:u,kind:r==null?void 0:r.kind,canRestart:(n==null?void 0:n.canRestart)===!0,noticeOpen:s,visible:document.visibilityState==="visible",busy:R>0,idleSince:E.current,now:e});w.useEffect(()=>{const F=n==null?void 0:n.running;let I=null,O=null;try{I=window.sessionStorage.getItem("agent-dag.restartPending"),O=window.sessionStorage.getItem(hA)}catch{return}const z=lne({bundle:"3.34.0",running:F,pending:I,lastTried:O});if(z==="reload"){try{window.sessionStorage.setItem(hA,F??"")}catch{return}window.location.reload();return}if(z!=="confirm")return;try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}N.current=!1,g(!1),x(F??null);const M=window.setTimeout(()=>x(null),6e3);return()=>window.clearTimeout(M)},[n==null?void 0:n.running]),w.useEffect(()=>{if(p&&une({asked:S.current,reported:i})){try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}N.current=!1,g(!1)}},[p,i]);const L=w.useCallback(F=>{var I,O;if(!f.current){const z=Qe(Au)==="0";ss(Au),z&&((I=F.prefs)==null?void 0:I.autoUpdate)!==!1?(d(!1),fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({autoUpdate:!1})}).catch(()=>{})):d(((O=F.prefs)==null?void 0:O.autoUpdate)!==!1)}},[]);return{autoRestart:u,toggleAutoRestart:h,restarting:p,restartMode:v,restartedTo:b,askRestart:T,restartCopy:A,restartFuseMs:B,loadAutoRestartPrefs:L}}function Xre(){const[e,t]=w.useState([]),n=w.useRef(new Set),[r,s]=w.useState(null);w.useEffect(()=>{let u=!0,d=0;const f=()=>{fetch("/api/lan").then(h=>h.ok?h.json():null).then(h=>u?(h!=null&&h.ok&&t(Wj(Array.isArray(h.pending)?h.pending:[],h.aliases)),h):null).catch(()=>null).then(h=>{u&&(d=window.setTimeout(f,(h==null?void 0:h.enabled)===!0?Cx:_$))})};return f(),()=>{u=!1,window.clearTimeout(d)}},[]);const i=w.useCallback(async(u,d)=>{if(!r){s(u);try{const h=await(await fetch("/api/lan/peer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:u,fp:d})})).json().catch(()=>null);h&&Array.isArray(h.pending)?t(Wj(h.pending,h.aliases)):t(p=>p.filter(g=>g.fp!==d))}catch{}finally{s(null)}}},[r]),l=w.useCallback(u=>{r||(n.current.add(u),t(d=>[...d]))},[r]);return{lanPending:e,lanDeferred:n,lanBusy:r,answerLanPair:i,deferLanPair:l}}const LO="agent-dag.sessionListOpen",PO="agent-dag.accountsPanelOpen";function Zre(){return Qe(LO)==="1"}function Jre(e){Ze(LO,e?"1":"0")}function Qre(){const e=Qe(PO);return e===null?!0:e==="1"}function ese(){const[e,t]=w.useState(Zre);w.useEffect(()=>{Jre(e)},[e]);const n=w.useRef(!1),[r,s]=w.useState(()=>{const f=Qre();return f&&e?(n.current=!0,!1):f});w.useEffect(()=>{!r&&n.current||Ze(PO,r?"1":"0")},[r]),w.useEffect(()=>{!e&&n.current&&(n.current=!1,s(!0))},[e]);const i=w.useCallback(()=>{t(f=>(f||s(h=>(h&&(n.current=!0),!1)),!f))},[]),l=w.useCallback(()=>{n.current=!1,s(f=>(f||t(!1),!f))},[]),u=w.useCallback(()=>t(!1),[]),d=w.useCallback(()=>s(!1),[]);return{sessionListOpen:e,accountsPanelOpen:r,toggleSessionList:i,toggleAccountsPanel:l,closeSessionList:u,closeAccountsPanel:d}}const DO="agent-dag.detailOpen",FO="agent-dag.usagePanelOpen",qO="agent-dag.systemPanelOpen";function tse(){return Qe(DO)==="1"}function nse(e){Ze(DO,e?"1":"0")}function rse(){const e=Qe(FO);return e===null?!0:e==="1"}function sse(e){Ze(FO,e?"1":"0")}function ase(){const e=Qe(qO);return e===null?!0:e==="1"}function ose(e){Ze(qO,e?"1":"0")}function ise(){const[e,t]=w.useState(tse);w.useEffect(()=>{nse(e)},[e]);const[n,r]=w.useState(rse);w.useEffect(()=>{sse(n)},[n]);const[s,i]=w.useState(ase);return w.useEffect(()=>{ose(s)},[s]),{detailOpen:e,setDetailOpen:t,usagePanelOpen:n,setUsagePanelOpen:r,machinePanelOpen:s,setMachinePanelOpen:i}}const lse={permission:"your permission",asked:"your answer"},cse="No sessions are waiting for you.";function use(e){if(e.length===0)return"";const[t,...n]=e,r=t.waiting.kind,s=n.every(l=>l.waiting.kind===r)?lse[r]??"you":"you";if(n.length===0)return`${t.label} is waiting for ${s}.`;const i=`${n.length} more session${n.length===1?"":"s"}`;return`${t.label} and ${i} are waiting for ${s}.`}function Fv(e,t,n=cse){return t!==""?t:e===""?"":n}function dse({waitingSessions:e,watchUnseen:t,incidents:n=[]}){const[r,s]=w.useState(""),i=use(e);w.useEffect(()=>{s(g=>Fv(g,i))},[i]);const[l,u]=w.useState(""),d=t>0?`Browser watch has ${t} unread ${t===1?"finding":"findings"}.`:"";w.useEffect(()=>{u(g=>Fv(g,d,"Browser watch has no unread findings."))},[d]);const[f,h]=w.useState(""),p=$re(n);return w.useEffect(()=>{h(g=>Fv(g,p,Ire))},[p]),{blockedSaid:r,watchSaid:l,setWatchSaid:u,incidentSaid:f}}function hse({waitingSessions:e,liveSince:t,focusSession:n}){const[r,s]=w.useState(()=>typeof Notification>"u"?"denied":Notification.permission),[i,l]=w.useState(null),[u,d]=w.useState(!1),[f,h]=w.useState(!1),p=w.useRef(()=>{}),g=w.useRef(new Set),v=xn(e),k=w.useCallback(()=>{const T=!u;d(T),T&&(g.current=gu(v.current)),T&&typeof Notification<"u"&&Notification.permission==="default"&&p.current(),fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({notifications:T})}).then(R=>R.ok?R.json():null).then(R=>{var A;R!=null&&R.ok&&(d(((A=R.prefs)==null?void 0:A.notifications)===!0),h(R.notificationsVetoed===!0))}).catch(()=>{})},[u]),b=typeof Notification<"u";w.useEffect(()=>{if(!i)return;const R=setTimeout(()=>l(null),i==="blocked"?8e3:4e3);return()=>clearTimeout(R)},[i]);const x=w.useCallback(()=>{typeof Notification>"u"||Notification.requestPermission().then(T=>{const R=T;s(R),R==="granted"?l("on"):R==="denied"&&l("blocked")})},[]);p.current=x;const N=w.useRef(null),S=e.map(T=>Rd(T.id,T.waiting)).join("|");w.useEffect(()=>{Xq(N.current,r)&&(N.current=r,g.current=gu(e))},[r]);const _=w.useRef(!1);w.useEffect(()=>{Zq(_.current,t)&&(_.current=!0,g.current=gu(e))},[t]),w.useEffect(()=>{if(typeof Notification>"u"||Notification.permission!=="granted"||!Jq(N.current,t))return;const T=typeof document>"u"||!document.hidden,R=Kq(e,g.current,T,u);for(const A of R)try{const B=new Notification(A.title,{body:A.body,tag:A.key});B.onclick=()=>{window.focus(),n(A.sessionId),B.close()}}catch{}g.current=T?gu(e):Yq(e,R,g.current)},[S,t]);const E=w.useCallback(T=>{var R;d(((R=T.prefs)==null?void 0:R.notifications)===!0),h(T.notificationsVetoed===!0)},[]);return{notifyPermission:r,notifySaid:i,notifyOn:u,notifyVetoed:f,toggleNotify:k,notifySupported:b,askForNotifications:x,loadNotifyPrefs:E}}function fse({openedTool:e,usageHistoryOpen:t,contextFor:n,tourOpen:r,summaryFor:s,browserWatchOpen:i,keyHelpOpen:l,releaseNotes:u,feedbackOpen:d}){const f=xn(l),h=w.useRef(!1);return h.current=e!=null||t||n!=null||r||s!=null||i||l||u!=null||d,{keyHelpOpenRef:f,modalOpenRef:h}}function pse({stateRef:e,tourOpen:t,releaseNotes:n}){const[r,s]=w.useState(null),i=w.useCallback((A,B)=>s({agentId:A,toolId:B}),[]),[l,u]=w.useState(null),[d,f]=w.useState(null),h=w.useCallback(A=>f(A),[]),[p,g]=w.useState(!1),[v,k]=w.useState(!1),[b,x]=w.useState(!1),[N,S]=w.useState(!1),_=r?J6(e.current.agents,r.agentId,r.toolId):null,E=d?e.current.agents.get(d):void 0,{keyHelpOpenRef:T,modalOpenRef:R}=fse({openedTool:_,usageHistoryOpen:v,contextFor:d,tourOpen:t,summaryFor:l,browserWatchOpen:b,keyHelpOpen:p,releaseNotes:n,feedbackOpen:N});return{setOpenedToolKey:s,openTool:i,openedTool:_,summaryFor:l,setSummaryFor:u,contextFor:d,setContextFor:f,openContext:h,contextAgent:E,keyHelpOpen:p,setKeyHelpOpen:g,usageHistoryOpen:v,setUsageHistoryOpen:k,browserWatchOpen:b,setBrowserWatchOpen:x,feedbackOpen:N,setFeedbackOpen:S,keyHelpOpenRef:T,modalOpenRef:R}}function mse({stateRef:e,pinnedRef:t,measuredRef:n,positionsRef:r,lastLayoutSigRef:s,forgetRemovals:i,clearSelection:l,rerender:u,modalOpenRef:d}){const[f,h]=w.useState(!1),p=w.useCallback(async()=>{try{await fetch("/api/clear",{method:"POST"})}catch{}e.current=p0(),t.current.clear(),n.current.clear(),r.current.clear(),s.current="",gO(),i(),l(),u()},[u,l,i]),g=xn(f),v=w.useCallback(k=>{const b=yne(k,{confirmOpen:g.current,modalOpen:d.current});b==="confirm"?h(!0):b==="clear"&&(h(!1),p())},[p]);return{clearConfirmOpen:f,setClearConfirmOpen:h,requestClear:v}}const fA="agent-dag.oldNameNoticeDismissed";function gse(e){const[t,n]=w.useState(()=>Qe(fA)??""),r=e!=null&&e.invokedAs&&e.invokedAs!==kt?e.invokedAs:null,s=r!=null&&t!==r,i=w.useCallback(()=>{r&&(n(r),Ze(fA,r))},[r]);return{oldName:r,oldNameOpen:s,dismissOldName:i}}function yse({chimesRef:e,setTonePrefs:t,tonePrefsRef:n,previewTone:r}){const[s,i]=w.useState(()=>GK(Qe)),l=xn(s),[u,d]=w.useState([]),f=w.useCallback(S=>{i(_=>{const E={..._,[S]:null};return l.current=E,E}),ss(vl[S])},[]),h=w.useCallback((S,_)=>{const E=l.current[S];_&&E!==_||(f(S),t(T=>{const R={...T,[S]:{...T[S],figure:vn}};return n.current=R,R}),Ze(pd[S],vn))},[f]),p=xn(h);w.useEffect(()=>{let S=!0;return sY().then(_=>{if(!S)return;d(_);const E=new Set(_.map(T=>T.id));for(const T of Bu){const R=l.current[T];R&&!E.has(R)&&p.current(T,R)}},()=>{}),()=>{S=!1}},[]);const g=w.useCallback((S,_)=>{if(!u.some(T=>T.id===_))return;const E={...l.current,[S]:_};l.current=E,i(E),Ze(vl[S],_),r(S,!0)},[u,r]),v=w.useCallback(async S=>{var R;const _=Ix(u.length);if(_)throw new Error(_);const E=window.AudioContext??window.webkitAudioContext;if(!E)throw new Error("This browser cannot decode audio files.");const T=new E;try{const A=await QK(S,L=>T.decodeAudioData(L));await mS(A);const B=Dl(A);d(L=>[...L.filter(F=>F.id!==B.id),B])}finally{(R=T.close)==null||R.call(T)}},[u.length]),k=w.useCallback(async S=>{const _=Ix(u.length);if(_)throw new Error(_);const E=eY(S);await mS(E);const T=Dl(E);d(R=>[...R.filter(A=>A.id!==T.id),T])},[u.length]),b=w.useCallback(async(S,_)=>{const E=u.find(R=>R.id===S),T=_.trim().slice(0,80);!E||!T||T===E.name||(await oY(S,T),d(R=>R.map(A=>A.id===S?{...A,name:T}:A)))},[u]),x=w.useCallback(async S=>{await iY(S),d(R=>R.filter(A=>A.id!==S));const _=l.current,E=KK(_,S);l.current=E,i(E);const T=Bu.filter(R=>_[R]===S);for(const R of T)ss(vl[R]),Ze(pd[R],vn);T.length>0&&t(R=>{const A={...R};for(const B of T)A[B]={...A[B],figure:vn};return n.current=A,A})},[]),N=w.useCallback(S=>{var T,R;const _=Bu.find(A=>l.current[A]===S),E=_?n.current[_].level:La;(T=e.current)==null||T.unlock(),(R=e.current)==null||R.previewCustom(S,E)},[]);return{customSelections:s,customSelectionsRef:l,customAssets:u,clearCustomOnly:f,fallbackCustomRef:p,selectCustomTone:g,importNotificationAudio:v,createNotificationVoice:k,renameCustomAsset:b,deleteCustomAsset:x,previewCustomAsset:N}}function wse(e){const[t,n]=w.useState(()=>vY(Qe)),r=xn(t),s=w.useRef(null),i=w.useCallback((u,d=!1)=>{var f,h;if((f=e.current)==null||f.unlock(),s.current!==null&&clearTimeout(s.current),s.current=null,!d){(h=e.current)==null||h.play(u,!0);return}s.current=setTimeout(()=>{var p;s.current=null,(p=e.current)==null||p.play(u,!0)},pY)},[]),l=w.useCallback((u,d)=>{n(f=>{const h={level:oi(d.level??f[u].level),figure:eI(u,d.figure??f[u].figure)};return Ze(rI[u],String(h.level)),Ze(pd[u],h.figure),{...f,[u]:h}}),i(u,!0)},[i]);return w.useEffect(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]),{tonePrefs:t,setTonePrefs:n,tonePrefsRef:r,previewTone:i,changeTone:l}}const vse=15e3;function xse(e){return e.visibilityState==="visible"&&e.hasFocus()}function bse(e,t){return t||e===!0}function kse(){try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{}return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Nse(){w.useEffect(()=>{const e=kse();let t=null;const n=l=>{fetch("/api/presence",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tab:e,looking:l}),keepalive:!0}).catch(()=>{})},r=()=>{const l=xse(document);bse(t,l)&&n(l),t=l},s=()=>{t&&n(!1),t=!1};r();const i=window.setInterval(r,vse);return window.addEventListener("focus",r),window.addEventListener("blur",r),document.addEventListener("visibilitychange",r),window.addEventListener("pagehide",s),()=>{window.clearInterval(i),window.removeEventListener("focus",r),window.removeEventListener("blur",r),document.removeEventListener("visibilitychange",r),window.removeEventListener("pagehide",s),s()}},[])}function jse({loadAutoRestartPrefs:e,loadNotifyPrefs:t,loadReportsPrefs:n}){w.useEffect(()=>{let r=!0;return fetch("/api/prefs").then(s=>s.ok?s.json():null).then(s=>{!r||!(s!=null&&s.ok)||(e(s),t(s),n(s))}).catch(()=>{}),()=>{r=!1}},[])}const qv="agent-dag.versionNoticeDismissed",Sse=15*6e4;function _se(e){const[t,n]=w.useState(null),[r,s]=w.useState(()=>Qe(qv)??""),i=w.useRef(0),[l,u]=w.useState(!1),d=w.useCallback((b=!1)=>(b&&(i.current=Date.now(),u(!0)),fetch(b?"/api/version?refresh=1":"/api/version").then(x=>x.ok?x.json():null).then(x=>{x&&n(x)}).catch(()=>{}).finally(()=>{b&&u(!1)})),[]),f=w.useCallback(()=>{d(Date.now()-i.current>=Sse)},[d]);w.useEffect(()=>{d();const b=window.setInterval(f,5*6e4),x=()=>{document.visibilityState==="visible"&&f()};return document.addEventListener("visibilitychange",x),()=>{window.clearInterval(b),document.removeEventListener("visibilitychange",x)}},[d,f]),w.useEffect(()=>{e&&d()},[e,d]);const h=(t==null?void 0:t.notice)??null,p=SO(h),g=Hte(h,r),v=w.useCallback(()=>{s(""),Ze(qv,"")},[]),k=w.useCallback(()=>{h&&(s(p),Ze(qv,p))},[h,p]);return{version:t,notice:h,noticeOpen:g,showNotice:v,dismissNotice:k,versionChecking:l,loadVersion:d}}function Ese({version:e,readyAppUpdate:t}){const[n,r]=w.useState(!1),s=w.useRef(null),[i,l]=w.useState(null),u=i&&t?t.version:null,d=w.useRef(null);w.useEffect(()=>{!u||d.current===u||(d.current=u,fetch("/api/desktop-update/seen",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({version:u})}).catch(()=>{}))},[u]);const f=w.useRef(!1);w.useEffect(()=>{if(f.current)return;const x=yl(),N=Bne(x),S=Gne({stored:N,running:(e==null?void 0:e.running)??null,notes:rA,remembers:Une(x)});if(S.reason==="no-version")return;f.current=!0,S.record&&zne(x,S.record);let _=!0;return(async()=>{var B;let T=Wne(x);if(Bl())try{const L=await fetch("/api/prefs");if(!L.ok)throw new Error("desktop tour preferences unavailable");const F=await L.json();if(!(F!=null&&F.ok))throw new Error("desktop tour preferences unavailable");const I=((B=F.prefs)==null?void 0:B.tourSeen)===!0;T&&!I&&fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tourSeen:!0}),keepalive:!0}).catch(()=>{}),T=T||I}catch{T=!0}if(!_)return;const R=Vne({tourSeen:T,decision:S}),A=S.show.length?{entries:S.show,since:N,firstRun:!1}:null;R.tour&&r(!0),R.notes==="now"?l(A):R.notes==="after"&&(s.current=A)})(),()=>{_=!1}},[e==null?void 0:e.running]);const h=(e==null?void 0:e.running)??"3.34.0",p=w.useMemo(()=>EO(rA,null,h),[h]),g=w.useCallback(()=>{l({entries:p,since:null,firstRun:!1})},[p]),v=w.useCallback(()=>r(!0),[]),k=w.useCallback(()=>l(null),[]),b=w.useCallback(()=>{r(!1),Hne(yl()),Bl()&&fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tourSeen:!0}),keepalive:!0}).catch(()=>{});const x=s.current;s.current=null,x&&l(x)},[]);return{tourOpen:n,openTour:v,closeTour:b,releaseNotes:i,closeReleaseNotes:k,chipVersion:h,openReleaseNotes:g}}const Cse=10,Tse=500,Rse=4e3,Ase=[/ResizeObserver loop/i,/^Script error\.?$/i],Mse=e=>{fetch("/api/client-error",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e),keepalive:!0}).catch(()=>{})};function $se(e,t=window,n=Mse){let r=0;const s=new Set,i=(d,f)=>{const h=String(d??"").slice(0,Tse).trim();!e()||!h||r>=Cse||s.has(h)||Ase.some(p=>p.test(h))||(s.add(h),r++,n({message:h,stack:typeof f=="string"?f.slice(0,Rse):void 0}))},l=d=>{var f,h;return i(((f=d.error)==null?void 0:f.message)??d.message,(h=d.error)==null?void 0:h.stack)},u=d=>typeof d.reason=="object"&&d.reason!==null?i(d.reason.message,d.reason.stack):i(d.reason,void 0);return t.addEventListener("error",l),t.addEventListener("unhandledrejection",u),()=>{t.removeEventListener("error",l),t.removeEventListener("unhandledrejection",u)}}function Ise(){const[e,t]=w.useState(void 0),[n,r]=w.useState(!1),s=w.useRef(!1);s.current=e===!0&&!n,w.useEffect(()=>$se(()=>s.current),[]);const i=w.useCallback(u=>{var d;t(((d=u.prefs)==null?void 0:d.reports)!==!1),r(u.reportsVetoed===!0)},[]),l=w.useCallback(async u=>{t(u);try{const f=await(await fetch("/api/reports",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({on:u})})).json();f!=null&&f.ok&&(t(f.reports!==!1),r(f.reportsVetoed===!0))}catch{}},[]);return{reportsOn:e,reportsVetoed:n,loadReportsPrefs:i,answerReports:l}}function Ose(){const[e,t]=w.useState(null),[n,r]=w.useState(!1),s=w.useRef(null);return w.useEffect(()=>{let i=!0,l=!1,u=null,d=null,f="";const h=b=>{i&&(r(!0),b!==f&&t(null))},p=()=>{if(l)return;l=!0,u=Date.now();const b=XR();d=b,fetch(`/api/ccusage?since=${b}`).then(x=>x.ok?x.json():null).then(x=>{if(i){if(!(x!=null&&x.ok)){h(b);return}f=b,t($te(x)),r(!1)}}).catch(()=>h(b)).finally(()=>{l=!1})},g=()=>{const b=s.current;Mte({shown:!!b&&b.getClientRects().length>0,tabVisible:document.visibilityState==="visible",lastSince:d,since:XR(),lastReadAt:u,now:Date.now()})&&p()};g();const v=window.setInterval(g,Ate);document.addEventListener("visibilitychange",g);let k=null;return s.current&&typeof ResizeObserver<"u"&&(k=new ResizeObserver(g),k.observe(s.current)),()=>{i=!1,window.clearInterval(v),document.removeEventListener("visibilitychange",g),k==null||k.disconnect()}},[]),{monthlyUsage:e,monthlyUsageUnavailable:n,monthUsageRef:s}}function Lse(e){const[t,n]=w.useState(null);w.useEffect(()=>{const u=Qe("agent-dag.sound");n(u===null?!0:u==="on")},[]);const r=w.useCallback(()=>{n(u=>{var f;const d=u!==!0;return Ze("agent-dag.sound",d?"on":"off"),d&&((f=e.current)==null||f.unlock()),d})},[]),s=w.useCallback(u=>{r()},[r]),i=xn(s),l=xn(t);return{soundOn:t,toggleSound:r,activateSoundRef:i,soundOnRef:l}}function Pse(){const[e,t]=w.useState(!1),n=w.useRef(null),[r,s]=w.useState(!1),i=w.useRef(null);return w.useEffect(()=>{e&&s(!1)},[e]),{soundMenuOpen:e,setSoundMenuOpen:t,soundButtonRef:n,appearanceMenuOpen:r,setAppearanceMenuOpen:s,appearanceButtonRef:i}}const Dse="agent-dag.autoFitDisabled";function Fse(e){const t=w.useRef(!1),[n,r]=w.useState(!1);w.useEffect(()=>{ss(Dse)},[]);const s=w.useCallback(()=>{t.current||(t.current=!0,r(!0))},[]),i=w.useCallback(()=>{t.current=!1,r(!1),e(400)},[e]);return{autoFitDisabled:n,autoFitDisabledRef:t,disableAutoFit:s,enableAutoFitAndRefit:i}}function qse(){return a.jsx(d0,{children:a.jsx(Bse,{})})}function Bse(){const e=ci(),t=w.useState(p0)[0],n=w.useRef(t),[,r]=w.useState(0),s=w.useCallback(()=>r(Kn=>Kn+1),[]),{detailOpen:i,setDetailOpen:l,usagePanelOpen:u,setUsagePanelOpen:d,machinePanelOpen:f,setMachinePanelOpen:h}=ise(),{selectedIds:p,primarySelectedId:g,selectAgent:v,clearSelection:k,pruneSelectionToBoard:b}=PY(n,l),{sessionListOpen:x,accountsPanelOpen:N,toggleSessionList:S,toggleAccountsPanel:_,closeSessionList:E,closeAccountsPanel:T}=ese(),R=Ose(),A=Pu(N,200),B=Pu(u,130),L=Pu(f,130),F=w.useRef(null),I=Lse(F),{activateSoundRef:O,soundOnRef:z}=I,M=wse(F),{setTonePrefs:$,tonePrefsRef:P,previewTone:K}=M,H=yse({chimesRef:F,setTonePrefs:$,tonePrefsRef:P,previewTone:K}),{customSelectionsRef:D,fallbackCustomRef:W}=H,q=Pse(),{setSoundMenuOpen:Y}=q,{chimeState:J}=Vre({chimesRef:F,soundOnRef:z,tonePrefsRef:P,customSelectionsRef:D,fallbackCustomRef:W}),V=mre(n),{pauseGate:G,paused:X,togglePause:Z}=V,ee=w.useRef(()=>{}),{live:se,tabCapped:ue,everConnected:oe,liveSince:re}=EY({stateRef:n,rerender:s,pauseGate:G,chimesRef:F,desktopUpdateRef:ee}),de=_se(se),{version:ge,notice:pe,noticeOpen:Ne,loadVersion:xe}=de,fe=Kre(se),{readyAppUpdate:Te,onDesktopUpdateEvent:Fe}=fe;ee.current=Fe,Nse();const Oe=Ese({version:ge,readyAppUpdate:Te}),{tourOpen:We,openTour:le,releaseNotes:ke}=Oe,{workspace:$e,providers:Le,providersRef:et}=yre(se),Je=gse(ge),Ke=Ore({version:ge,loadVersion:xe}),{upgradeFailure:yt}=Ke,Ue=pse({stateRef:n,tourOpen:We,releaseNotes:ke}),{openTool:Xe,setSummaryFor:ot,setContextFor:it,openContext:ut,setKeyHelpOpen:wt,setUsageHistoryOpen:ft,setBrowserWatchOpen:Ft,keyHelpOpenRef:Jt,modalOpenRef:Ht}=Ue,Vt=Ise(),qt=Pre(),{watchOn:Gt,watchUnseen:pr}=qt,Fr=Xre(),[hs,fs]=w.useState(0),{presentCats:mr,hiddenCats:qn,toggleCat:Bn,catBarRef:gr,catBarOccluded:Un}=Wre(n),ps=w.useRef(null),[kn,zn]=w.useState(0),xt=DY({stateRef:n,rerender:s,pruneSelectionToBoard:b,setContextFor:it,setSummaryFor:ot}),yr=bre(Le.claude||Le.codex),wr=Mre(yr,xt),vr=Yre({now:xt,stateRef:n,version:ge,notice:pe,noticeOpen:Ne,upgradeFailure:yt,paused:V.paused}),{askRestart:ms,loadAutoRestartPrefs:me}=vr,qe=zre(),{setTheme:Ye,palette:Wn}=qe,qr=Gre(),Hn=OQ(),{applyViewport:gs,moveCamera:ys,fitLeft:Qt,cameraEpochRef:vi,lastFitTimeRef:tt}=Hn,Br=GQ(Qt),{pinnedRef:xr,positionsRef:Ur,lastLayoutSigRef:ws,handleRelayout:Wa}=Br,Qs=w.useRef(null),zr=w.useRef(()=>{}),en=re!==null,vs=w.useRef(0),tn=w.useCallback(()=>{vs.current=Date.now()},[]),{canvasRef:Wr,canvasSize:dh,paneSizeRef:hh}=Eee(),ea=Fse(Qt),{autoFitDisabledRef:ta,disableAutoFit:Hr}=ea,xs=w.useRef(!1),{measuredRef:Vr,measuredVersionRef:fh,sizeVersion:xi,domSizeVersion:nc}=Cee(xs),{removedNodes:Ha,removedAgentIds:Nn,removeNode:ph,removeSelectedNode:Va,removalNotice:He,bringBack:Ga,bringBackAll:rc,forgetRemovals:bi}=wee({stateRef:n,pinnedRef:xr,positionsRef:Ur,canvasRef:Wr,clearSelection:k,primarySelectedId:g}),Ka=fee({stateRef:n,now:xt,removedAgentIds:Nn,sizeVersion:xi,domSizeVersion:nc});KQ(Ka,Br),yee({layoutSig:Ka,rf:e,stateRef:n,measuredRef:Vr,pinnedRef:xr,positionsRef:Ur,paneSizeRef:hh,lastInteractRef:vs,autoFitDisabledRef:ta,lastFitTimeRef:tt,fitLeft:Qt});const ki=Tee(),{bubbling:sc,endBubble:Ni,onBubble:Ya}=AK(),[jn,br]=w.useState(!1),Vn=TK(),{beginTrashDrag:na,trackTrashDrag:ra,endTrashDrag:kr}=Vn,ac=qK({stateRef:n,measuredRef:Vr,measuredVersionRef:fh,canvasRef:Wr}),{lodRef:oc,applyZoom:sa}=ac,ic=See({applyViewport:gs,lastFitTimeRef:tt,cameraEpochRef:vi,disableAutoFit:Hr,markInteract:tn,canvasRef:Wr,applyZoom:sa}),bs=g?n.current.agents.get(g):null,aa=i&&bs!=null,{railInsetRef:ji,availableWidth:lc,availableHeight:ks}=IQ({canvasRef:Wr,canvasSize:dh,machinePhase:L,usagePhase:B,usagePanelOpen:u,detailShown:aa}),Ns=pee({stateRef:n,now:xt,availableWidth:lc,availableHeight:ks,layout:Br,measuredRef:Vr,onBubble:Ya,settled:ki,dragging:jn,layoutSig:Ka,selectedIds:p,openContext:ut,historyReplayed:en,removedNodes:Ha,removedAgentIds:Nn,dragTick:hs,dragPatchRef:ps,dragMoveTick:kn}),{nodes:Nr,edges:Xa}=Ns,Si=xn(g);YQ({nodes:Nr,edges:Xa,settled:ki,dragging:jn,availableWidth:lc,availableHeight:ks,layout:Br,camera:Hn,rf:e,measuredRef:Vr,stateRef:n,lastFocusRef:Qs,primarySelectedIdRef:Si,focusAgentRef:zr,autoFitDisabledRef:ta});const cc=mse({stateRef:n,pinnedRef:xr,measuredRef:Vr,positionsRef:Ur,lastLayoutSigRef:ws,forgetRemovals:bi,clearSelection:k,rerender:s,modalOpenRef:Ht}),{requestClear:Za}=cc,Ja=Mee({nodes:Nr,stateRef:n,pinnedRef:xr,positionsRef:Ur,draggingRef:xs,dragPatchRef:ps,setDragging:br,setDragMoveTick:zn,setDragTick:fs,endBubble:Ni,markInteract:tn,disableAutoFit:Hr,beginTrashDrag:na,trackTrashDrag:ra,endTrashDrag:kr,removeNode:ph}),_i=w.useCallback(()=>Qt(500),[Qt]),Qa=xn(Nr),{focusAgent:fn,stepAgent:Ei,focusSession:jr}=PQ({canvasRef:Wr,stateRef:n,measuredRef:Vr,nodesRef:Qa,railInsetRef:ji,moveCamera:ys,disableAutoFit:Hr,lastFocusRef:Qs,focusAgentRef:zr,selectAgent:v,primarySelectedIdRef:Si}),uc=_ee({clearSelection:k,selectAgent:v,detailOpen:i,setDetailOpen:l,detailShown:aa,focusAgent:fn,draggingRef:xs,lodRef:oc}),eo=DQ({nodesRef:Qa,stateRef:n,canvasRef:Wr,railInsetRef:ji}),to=xn(Va),Ci=w.useRef(null),Kt=w.useCallback(Kn=>{Nn.has(Kn)&&Ga([Kn]),jr(Kn)},[Nn,Ga,jr]),js=Ree();Aee({pointerFocusRef:js,nodesRef:Qa,stateRef:n,primarySelectedIdRef:Si,providersRef:et,soundOnRef:z,keyHelpOpenRef:Jt,modalOpenRef:Ht,waitingCursorRef:Ci,removeSelectedRef:to,activateSoundRef:O,clearSelection:k,selectAgent:v,focusAgent:fn,stepAgent:Ei,focusSession:jr,requestClear:Za,handleRelayout:Wa,handleFit:_i,togglePause:Z,toggleSessionList:S,toggleAccountsPanel:_,setDetailOpen:l,setUsageHistoryOpen:ft,setUsagePanelOpen:d,setMachinePanelOpen:h,setBrowserWatchOpen:Ft,setSoundMenuOpen:Y,setKeyHelpOpen:wt,setTheme:Ye});const no=n.current.agents.size,Gn=w.useMemo(()=>ax(n.current.agents.values()),[n.current,n.current.revision]);vee({stateRef:n,waitingSessions:Gn,removedAgentIds:Nn,removedNodes:Ha,bringBack:Ga}),kee({stateRef:n,waitingSessions:Gn,live:se});const dc=dse({waitingSessions:Gn,watchUnseen:pr,incidents:wr}),oa=hse({waitingSessions:Gn,liveSince:re,focusSession:jr}),{loadNotifyPrefs:Ti}=oa;return jse({loadAutoRestartPrefs:me,loadNotifyPrefs:Ti,loadReportsPrefs:Vt.loadReportsPrefs}),a.jsxs("div",{className:"app",children:[a.jsx("a",{className:"skip-link",href:"#canvas",children:"Skip to the canvas"}),a.jsxs("header",{className:"topbar",children:[a.jsx(Zte,{versionCheck:de,welcome:Oe,desktopUpdate:fe,pause:V,monthly:R,announcements:dc,notify:oa,waitingSessions:Gn,waitingCursorRef:Ci,focusSession:jr,live:se,now:xt,incidents:wr}),bs&&a.jsx(Jte,{selected:bs,now:xt,selectedIds:p,focusAgent:fn,clearSelection:k}),a.jsxs("div",{className:"actions",children:[a.jsx(Ete,{sessionListOpen:x,toggleSessionList:S,usagePanelOpen:u,setUsagePanelOpen:d,setUsageHistoryOpen:ft}),a.jsx(Cte,{providers:Le,accountsPanelOpen:N,toggleAccountsPanel:_,machinePanelOpen:f,setMachinePanelOpen:h,watchOn:Gt,watchUnseen:pr,setBrowserWatchOpen:Ft}),a.jsx(Tte,{providers:Le,sound:I,tones:M,customTones:H,notify:oa,chimeState:J,menus:q,appearance:qe,fm:qr,reports:Vt,onFeedback:()=>Ue.setFeedbackOpen(!0)})]})]}),a.jsx("div",{className:"vis-hidden",role:"status","aria-atomic":"true",children:He?`${He.label} removed from the board.`:""}),a.jsx(gne,{restart:vr,versionCheck:de,upgrade:Ke,oldNameNotice:Je,everConnected:oe,live:se,paused:X}),Lu(A)&&Le.claude&&a.jsx(kK,{leaving:A==="leaving",onClose:T}),x&&a.jsx($z,{state:n.current,now:xt,selectedIds:p,onSelect:Kt,onClose:E,removedIds:Nn,onBringBackAll:rc}),a.jsxs(rne,{canvasRef:Wr,bubbling:sc,dragging:jn,trash:Vn,zoom:ac,viewport:ic,stateRef:n,peek:eo,children:[no===0&&(!se&&ue?a.jsx(qee,{}):a.jsx(Bee,{live:se,everConnected:oe,providers:Le,workspace:$e,onTour:le})),(mr.length>1||qn.size>0)&&a.jsx(Qte,{catBarRef:gr,catBarOccluded:Un,presentCats:mr,hiddenCats:qn,toggleCat:Bn}),a.jsx(Sz,{graph:Ns,layout:Br,viewport:ic,clicks:uc,drag:Ja,appearance:qe,fm:qr,autoFit:ea,pause:V,stateRef:n,measuredRef:Vr,hiddenCats:qn,now:xt,openTool:Xe,focusAgent:fn,requestClear:Za,setKeyHelpOpen:wt})]}),Lu(B)&&a.jsx(SW,{state:n.current,now:xt,providers:Le,incidents:wr,liveSince:re,leaving:B==="leaving",onClose:()=>d(!1)}),Lu(L)&&a.jsx(cH,{usageOpen:u,leaving:L==="leaving",onClose:()=>h(!1)}),i&&bs?a.jsx(ete,{selected:bs,now:xt,openTool:Xe,setSummaryFor:ot,setDetailOpen:l,stateRef:n,removeSelectedNode:Va}):null,a.jsx(hre,{dialogs:Ue,welcome:Oe,desktopUpdate:fe,versionCheck:de,restart:vr,lanPairs:Fr,clearFlow:cc,watchBadge:qt,announcements:dc,appearance:qe,providers:Le,stateRef:n,agentCount:no})]})}try{A8(window.localStorage)}catch{}const Use=xP.createRoot(document.getElementById("root"));Use.render(a.jsx(qse,{}));export{Oee as a,at as b,Ks as c,hd as d,Wse as e,Be as f,as as g,zse as h,Ll as i,a as j,cs as k,ZK as l,ba as m,Fa as n,yx as p,w as r,Ar as s,gt as u};
|
|
300
|
+
`)}),i&&a.jsx("button",{type:"button",className:"btn tm-more","aria-expanded":i.expanded,onClick:()=>n(l=>!l),children:i.label})]})}function iA({text:e,what:t}){const[n,r]=w.useState(!1),s=w.useRef(!0);return w.useEffect(()=>()=>{s.current=!1},[]),a.jsx("button",{type:"button",className:"btn tm-copy",disabled:!e,"aria-label":n?`The ${t} was copied`:`Copy the ${t}`,onClick:()=>void Fa(e).then(i=>{!i||!s.current||(r(!0),window.setTimeout(()=>{s.current&&r(!1)},1600))}),children:n?"copied":"copy"})}const ure=w.lazy(()=>_0(()=>import("./UsageHistoryModal-N-p7OGkW.js"),[])),dre=w.lazy(()=>_0(()=>import("./BrowserWatchModal-C42m7ewG.js"),[]));function hre({dialogs:e,welcome:t,desktopUpdate:n,versionCheck:r,restart:s,lanPairs:i,clearFlow:l,watchBadge:u,announcements:d,appearance:f,providers:h,stateRef:p,agentCount:g}){const{openedTool:v,setOpenedToolKey:k,usageHistoryOpen:b,setUsageHistoryOpen:x,browserWatchOpen:N,setBrowserWatchOpen:S,contextAgent:_,setContextFor:E,summaryFor:T,setSummaryFor:R,keyHelpOpen:A,setKeyHelpOpen:B,feedbackOpen:L,setFeedbackOpen:F}=e,{tourOpen:I,openTour:O,closeTour:z,releaseNotes:M,closeReleaseNotes:$,chipVersion:P}=t,{desktopUpdateRestarting:K,desktopUpdateFailure:H,readyAppUpdate:D,askDesktopUpdateRestart:W}=n,{version:q}=r,{askRestart:Y}=s,{clearConfirmOpen:J,setClearConfirmOpen:V,requestClear:G}=l,{setWatchOn:X,markWatchSeen:Z}=u,{setWatchSaid:ee}=d,{palette:se}=f;return a.jsxs(a.Fragment,{children:[v&&a.jsx(lre,{tool:v,onClose:()=>k(null)}),b&&a.jsx(w.Suspense,{fallback:null,children:a.jsx(ure,{providers:h,onClose:()=>x(!1)})}),N&&a.jsx(w.Suspense,{fallback:null,children:a.jsx(dre,{onClose:()=>S(!1),onSeen:ue=>{ee(""),Z(ue)},onWatching:X,palette:se})}),_&&a.jsx(S8,{agent:_,onClose:()=>E(null)}),L&&a.jsx(_ne,{onClose:()=>F(!1)}),T&&a.jsx(Xne,{state:p.current,sessionId:T,onClose:()=>R(null)}),M&&a.jsx(Yne,{entries:M.entries,since:M.since,firstRun:M.firstRun,running:P,onClose:$,onTour:()=>{$(),O()},updateVersion:D==null?void 0:D.version,updateBusy:K,updateFailure:H&&(!D||D.version===H.version)?qte(H.failure,H.version):void 0,onUpdateRestart:D?()=>{W(D.version)}:void 0,onRestart:!D&&(q!=null&&q.canRestart)?()=>{$(),Y()}:void 0}),a.jsx(Mne,{...i}),A&&a.jsx(Tne,{onClose:()=>B(!1),onTour:()=>{B(!1),O()}}),I&&a.jsx(E$,{title:"What the deck shows you",steps:rV,onClose:z}),J&&a.jsx(bne,{agentCount:g,onConfirm:()=>G("confirmation"),onCancel:()=>V(!1)})]})}const fre=1e3;function pre(e={}){const t=Math.max(1,Math.floor(e.limit??fre)),n=e.protect;let r=!1,s=[],i=new Set,l=0,u=0,d=null;return{get paused(){return r},get size(){return s.length},get dropped(){return l},get overflowed(){return l>0},get through(){return u},accept(f){const h=typeof(f==null?void 0:f.seq)=="number"?f.seq:null,p=(f==null?void 0:f.epoch)??null,g=p!==null&&p!==d;g&&(d=p,u=0);const v=h!==null&&!g&&h<=u;if(h!==null&&h>u&&(u=h),!r)return!0;if(v)return!1;if(s.push(f),n!=null&&n(f)&&i.add(f),s.length>t){let k=0;if(i.size<s.length)for(;i.has(s[k]);)k++;const[b]=s.splice(k,1);i.delete(b),l++}return!1},setPaused(f){if(r=f,f)return[];const h=s;return s=[],i=new Set,l=0,h}}}function mre(e){const t=w.useState(()=>pre({protect:i=>rq(e.current,i)}))[0],[n,r]=w.useState(!1),s=w.useCallback(()=>{const i=t.paused&&t.dropped>0,l=t.setPaused(!t.paused);i&&$q(e.current);for(const u of l)e.current=rM(e.current,u);r(t.paused)},[t,e]);return{pauseGate:t,paused:n,togglePause:s}}const Vx={kind:"assumed",claude:!0,codex:!0};function gre(e){if(!e||typeof e!="object")return Vx;const t=e.providers;if(!t||typeof t!="object")return Vx;const n=t;return{kind:"reported",claude:n.claude!==!1,codex:n.codex!==!1}}function yre(e){const[t,n]=w.useState(null),[r,s]=w.useState(Vx);w.useEffect(()=>{let l=!1;return fetch("/api/health").then(u=>u.ok?u.json():null).then(u=>{l||(s(gre(u)),!(!u||typeof u.workspace!="string")&&n(u.workspace))}).catch(()=>{}),()=>{l=!0}},[e]);const i=xn(r);return{workspace:t,providers:r,providersRef:i}}const $O=3*6e4,wre=2e4;function vre({fetchReport:e,visible:t,now:n,onReport:r}){let s=0,i=!0;const l=async()=>{if(!t())return;const u=await e();!i||!u||(s=n(),r(u))};return{tick:l,wake:async()=>{t()&&n()-s>=$O&&await l()},stop:()=>{i=!1}}}async function xre(){try{const e=await fetch("/api/provider-status",{signal:AbortSignal.timeout(wre)});return e.ok?await e.json():null}catch{return null}}function bre(e){const[t,n]=w.useState(null);return w.useEffect(()=>{if(!e){n(null);return}const r=vre({fetchReport:xre,visible:()=>document.visibilityState==="visible",now:()=>Date.now(),onReport:n});r.tick();const s=window.setInterval(r.tick,$O),i=()=>{r.wake()};return document.addEventListener("visibilitychange",i),()=>{r.stop(),window.clearInterval(s),document.removeEventListener("visibilitychange",i)}},[e]),t}const kre={degraded:"degraded performance",partial_outage:"partial outage",major_outage:"major outage",maintenance:"maintenance"},Nre={degraded:"degraded",partial_outage:"partial outage",major_outage:"major outage",maintenance:"maintenance"},jre={degraded:"degraded",partial_outage:"outage",major_outage:"outage",maintenance:"maint."},Sre={claude:"Claude",codex:"Codex"},_re=new Set(["status.claude.com","status.openai.com"]),Ere=30*6e4,Cre=10*6e4;function Tre(e){if(typeof e!="string")return null;try{const t=new URL(e);return t.protocol==="https:"&&_re.has(t.hostname)?t:null}catch{return null}}function lA(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hourCycle:"h23"})}function Rre(e){const t=Math.floor(e/6e4);return t<1?"just now":t<60?`${t} min ago`:`${Math.floor(t/60)} h ago`}function Are(e,t){if(!e||typeof e!="object")return null;const n=It(kre,e.state),r=It(Sre,e.provider);if(!n||!r||typeof e.checkedAt!="number"||t-e.checkedAt>Ere)return null;const s=Tre(e.statusPageUrl);if(!s)return null;const i=Array.isArray(e.components)?e.components:[],l=e.stale===!0||t-e.checkedAt>Cre,u=[`${r}: ${n}${e.summary?` — ${e.summary}`:""}`,i.length>0?`Affected: ${i.join(", ")}`:null,e.scope==="page"?`The page's overall status: it names none of ${r}'s components`:null,l?`Last read from ${s.hostname} at ${lA(e.checkedAt)}; this is the last thing it said`:`Reported by ${s.hostname}, checked ${Rre(t-e.checkedAt)}`,"Opens the status page"],d=l?lA(e.checkedAt):null;return{provider:e.provider,state:e.state,name:r,label:`${r} · ${n}${d?` · as of ${d}`:""}`,words:n,chipWords:It(Nre,e.state)??n,shortWords:It(jre,e.state)??n,asOf:d,what:e.summary||(i.length>0?i.join(", "):null),href:s.href,host:s.hostname,stale:l,detail:u.filter(Boolean).join(`
|
|
301
|
+
`)}}function Mre(e,t){return!(e!=null&&e.ok)||e.disabled||!Array.isArray(e.providers)?[]:e.providers.map(n=>Are(n,t)).filter(n=>n!==null)}function $re(e){return e.map(t=>`${t.name}'s status page reports ${t.state.endsWith("outage")?`a ${t.words}`:t.words}.`).join(" ")}const Ire="The providers' status pages report no incident.";function Ore({version:e,loadVersion:t}){var f;const[n,r]=w.useState(!1),s=((f=e==null?void 0:e.upgrade)==null?void 0:f.state)??"idle",i=cne(e==null?void 0:e.upgrade),l=w.useRef(!1),u=w.useCallback(async()=>{if(Ar(l.current||s==="running")){l.current=!0;try{await fetch("/api/upgrade",{method:"POST"})}catch{}await t(),l.current=!1}},[s,t]);w.useEffect(()=>{if(s!=="running")return;const h=window.setInterval(t,3e3);return()=>window.clearInterval(h)},[s,t]);const d=w.useCallback(async()=>{const h=e==null?void 0:e.command;!h||!await Fa(h)||(r(!0),window.setTimeout(()=>r(!1),1600))},[e==null?void 0:e.command]);return{upgradeState:s,upgradeFailure:i,startUpgrade:u,copyCommand:d,cmdCopied:n}}const cA="agent-dag.browserWatch.seenMs";function Lre(e,t){return e.filter(n=>n.startMs>t)}function Pre(){const[e,t]=w.useState(()=>Number(Qe(cA))||0),[n,r]=w.useState([]),[s,i]=w.useState(!1);w.useEffect(()=>{let d=!0;const f=()=>{fetch("/api/browser-watch?live=0").then(p=>p.ok?p.json():null).then(p=>{var g;!d||!(p!=null&&p.ok)||(r(p.episodes??[]),i(((g=p.settings)==null?void 0:g.enabled)===!0))}).catch(()=>{})};f();const h=setInterval(f,5*6e4);return()=>{d=!1,clearInterval(h)}},[]);const l=w.useMemo(()=>Lre(n,e).length,[n,e]),u=w.useCallback(d=>{t(d),Ze(cA,String(d))},[]);return{watchOn:s,setWatchOn:i,watchUnseen:l,markWatchSeen:u}}const IO=["--err","--inflight","--ok","--grid-line","--minimap-mask","--panel","--line","--accent","--text-dim","--bg"];function uA(e){const t={};for(const n of IO)t[n]=e(n);return t}function Dre(e){return t=>e[t]??""}function Fre(e,t){return IO.every(n=>e[n]===t[n])}const OO="agent-dag.theme";function qre(e,t=!1){return e==="light"||e==="dark"?e:t?"light":"dark"}function Bre(){try{return window.matchMedia("(prefers-color-scheme: light)").matches}catch{return!1}}function Ure(){return qre(Qe(OO),Bre())}function dA(e){return typeof window>"u"?"":getComputedStyle(document.documentElement).getPropertyValue(e).trim()||""}function zre(){const[e,t]=w.useState(Ure),[n,r]=w.useState(ste),[s,i]=w.useState(()=>uA(dA)),l=w.useMemo(()=>Dre(s),[s]),u=w.useCallback(d=>cee(d,l),[l]);return w.useEffect(()=>{document.documentElement.dataset.theme=e,Ze(OO,e),i(d=>{const f=uA(dA);return Fre(d,f)?d:f})},[e]),w.useEffect(()=>{Ze(kO,n?"1":"0")},[n]),w.useEffect(()=>{const d=document.querySelector('meta[name="theme-color"]'),f=s["--panel"];d&&f&&d.setAttribute("content",f)},[s]),{theme:e,setTheme:t,characterEnabled:n,setCharacterEnabled:r,palette:s,minimapNodeFill:u}}function Wre(e){const t=w.useRef(null),[n,r]=w.useState(!1),[s,i]=w.useState(()=>new Set),l=w.useMemo(()=>{const d=new Set;for(const f of e.current.agents.values())for(const h of f.tools)d.add(xO(h.name));return Object.keys(vO).filter(f=>d.has(f))},[e.current,e.current.revision]);w.useEffect(()=>{if(l.length<=1){r(!1);return}let d=0;const f=()=>{const h=t.current;if(h&&!document.hidden){const p=h.getBoundingClientRect(),g=Array.from(document.querySelectorAll(".react-flow__node, .tool-burst")).map(k=>k.getBoundingClientRect()),v=QQ(p,g,8);r(k=>k===v?k:v)}d=window.setTimeout(f,300)};return f(),()=>window.clearTimeout(d)},[l.length]);const u=w.useCallback(d=>{i(f=>{const h=new Set(f);return h.has(d)?h.delete(d):h.add(d),h})},[]);return{presentCats:l,hiddenCats:s,toggleCat:u,catBarRef:t,catBarOccluded:n}}function Hre(e={enabled:()=>!0}){const t=e.ctor??(typeof window<"u"?window.AudioContext??window.webkitAudioContext??null:null);let n=null;const r=()=>e.enabled()?(n==null?void 0:n.state)==="running"?"ready":"locked":"off",s=()=>{var h;return(h=e.onState)==null?void 0:h.call(e,r())};function i(){var h,p;if(!(!t||(n==null?void 0:n.state)==="running"))try{n||(n=new t,(h=n.addEventListener)==null||h.call(n,"statechange",s)),(p=n.resume)==null||p.call(n).then(s,()=>{}),s()}catch{}}function l(h,p,g=p.figure){if(!n||n.state!=="running")return!1;const v=Ox(h,g),k=uY(p.level,v),b=n.currentTime;for(const x of v.notes){const N=n.createOscillator(),S=n.createGain();N.type=v.type??"sine",N.frequency.value=x.hz;const _=b+x.at,E=_+x.ms/1e3;S.gain.setValueAtTime(yS,_),S.gain.exponentialRampToValueAtTime(k,_+dY),S.gain.exponentialRampToValueAtTime(yS,E),N.connect(S).connect(n.destination),N.start(_),N.stop(E+.02)}return!0}async function u(h,p){if(!e.loadCustom)return"unavailable";let g;try{g=await e.loadCustom(h)}catch{return"unavailable"}if(!g)return"missing";if(g.kind==="tts"){if(typeof window>"u"||!("speechSynthesis"in window)||typeof SpeechSynthesisUtterance>"u")return"unavailable";const k=new SpeechSynthesisUtterance(g.text),b=window.speechSynthesis.getVoices();k.voice=b.find(x=>x.voiceURI===g.voiceURI)??null,k.rate=g.rate,k.pitch=g.pitch,k.volume=hY(p.level);try{return window.speechSynthesis.cancel(),window.speechSynthesis.speak(k),"played"}catch{return"unavailable"}}if(!n||n.state!=="running")return"locked";let v;try{v=await n.decodeAudioData(g.bytes.slice(0))}catch{return"broken"}try{const k=n.createBufferSource(),b=n.createGain();return k.buffer=v,b.gain.setValueAtTime(fY(g.normalizationGain,p.level),n.currentTime),k.connect(b).connect(n.destination),k.start(n.currentTime),"played"}catch{return"unavailable"}}function d(h,p=!1){var k,b;if(!p&&!e.enabled())return!1;const g=xY((k=e.prefs)==null?void 0:k.call(e),h),v=((b=e.customSelection)==null?void 0:b.call(e)[h])??null;return v&&e.loadCustom?(u(v,g).then(x=>{var N;x==="played"||x==="locked"||((x==="missing"||x==="broken")&&((N=e.onCustomFailure)==null||N.call(e,h,v)),l(h,{...g,figure:vn},vn))}),!0):!n||n.state!=="running"?!1:l(h,g)}function f(h,p=La){return u(h,{level:oi(p),figure:vn}),!0}return{unlock:i,play:d,previewCustom:f,state:r,get context(){return n}}}function Vre({chimesRef:e,soundOnRef:t,tonePrefsRef:n,customSelectionsRef:r,fallbackCustomRef:s}){const[i,l]=w.useState("locked");return w.useEffect(()=>{const u=Hre({enabled:()=>t.current===!0,prefs:()=>n.current,customSelection:()=>r.current,loadCustom:aY,onCustomFailure:(p,g)=>s.current(p,g),onState:l});e.current=u,l(u.state());const d=["pointerdown","pointerup","keydown"],f=()=>{for(const p of d)window.removeEventListener(p,h,{capture:!0})},h=()=>{var p;u.unlock(),((p=u.context)==null?void 0:p.state)==="running"&&f()};for(const p of d)window.addEventListener(p,h,{capture:!0});return f},[]),{chimeState:i}}function Gre(){const[e,t]=w.useState(ote),[n,r]=w.useState(()=>T6(Qe(MN))),[s,i]=w.useState(()=>C6(Qe($N))),[l,u]=w.useState(()=>R6(Qe(HR),n,nte)),[d,f]=w.useState(()=>new Set),[h,p]=w.useState(0);w.useEffect(()=>{Ze(NO,String(e))},[e]),w.useEffect(()=>{Ze($N,s?"1":"0")},[s]),w.useEffect(()=>{Ze(MN,JSON.stringify(n))},[n]),w.useEffect(()=>{Ze(HR,l)},[l]);const g=w.useCallback(N=>{r(S=>S.some(_=>_.id===N.id)?S:[...S,N]),f(S=>{if(!S.has(N.id))return S;const _=new Set(S);return _.delete(N.id),_})},[]),v=w.useCallback((N,S)=>{const _=S.trim();!_||_.length>Cl||r(E=>E.map(T=>T.id===N?{...T,name:_}:T))},[]),k=w.useCallback(N=>{r(S=>S.filter(_=>_.id!==N)),u(S=>A6(S,N)),f(S=>{if(!S.has(N))return S;const _=new Set(S);return _.delete(N),_})},[]),b=w.useCallback(N=>{const S=IN(N),_=d.has(S);N===l&&!_||(_&&f(E=>{const T=new Set(E);return T.delete(S),T}),u(N),p(E=>E+1))},[l,d]),x=w.useCallback((N,S)=>{const _=IN(N);f(E=>{if(E.has(_)===S)return E;const R=new Set(E);return S?R.add(_):R.delete(_),R})},[]);return{fmVolume:e,setFmVolume:t,fmMuted:s,setFmMuted:i,fmSource:l,customFmStations:n,unavailableFmStations:d,fmPlayRequest:h,addFmStation:g,renameFmStation:v,removeFmStation:k,pickFmSource:b,markFmStationAvailability:x}}function Kre(e){const[t,n]=w.useState(null),[r,s]=w.useState(!1),[i,l]=w.useState(null),u=w.useRef(0);w.useEffect(()=>{if(!e||!Bl())return;let k=!1;const b=u.current;return fetch("/api/desktop-update").then(x=>x.ok?x.json():null).then(x=>{if(k||u.current!==b)return;const N=JR(x);N&&n(N)}).catch(()=>{}),()=>{k=!0}},[e]);const d=Ote(t),f=w.useRef(!1),h=w.useRef(0),p=w.useRef(0);w.useEffect(()=>()=>window.clearTimeout(h.current),[]);const g=w.useCallback(async k=>{if(!Ar(f.current))return;const b=++p.current;window.clearTimeout(h.current),f.current=!0,s(!0),l(null);const x=N=>{b===p.current&&(window.clearTimeout(h.current),f.current=!1,s(!1),l({failure:N,version:k}))};try{const N=await fetch("/api/desktop-update/restart",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({version:k})});if(!N.ok)return x(Fte(await N.json().catch(()=>null)))}catch{return x("unreachable")}b===p.current&&(h.current=window.setTimeout(()=>x("timeout"),jO))},[]),v=w.useCallback(k=>{if(Bl())try{const b=JR(JSON.parse(k));b&&(u.current++,n(b),b.status!=="ready"&&(p.current++,window.clearTimeout(h.current),f.current=!1,s(!1)))}catch{}},[]);return{desktopUpdateRestarting:r,desktopUpdateFailure:i,readyAppUpdate:d,askDesktopUpdateRestart:g,onDesktopUpdateEvent:v}}const Au="agent-dag.autoRestart",hA="agent-dag.bundleReloadedFor";function Yre({now:e,stateRef:t,version:n,notice:r,noticeOpen:s,upgradeFailure:i,paused:l}){const[u,d]=w.useState(()=>Qe(Au)!=="0"),f=w.useRef(!1),h=w.useCallback(()=>{const F=!u;f.current=!0,ss(Au),d(F),fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({autoUpdate:F})}).then(I=>I.ok?I.json():null).then(I=>{var O;I!=null&&I.ok&&d(((O=I.prefs)==null?void 0:O.autoUpdate)!==!1)}).catch(()=>{})},[u]),[p,g]=w.useState(!1),[v,k]=w.useState("restart"),[b,x]=w.useState(null),N=w.useRef(!1),S=w.useRef(null),_=w.useRef(0),E=w.useRef(null),T=w.useCallback(async F=>{if(!Ar(N.current))return;const I=(F==null?void 0:F.upgrade)===!0,O=(F==null?void 0:F.whenIdle)===!0;N.current=!0,S.current=i;const z=++_.current,M=()=>{k(I?"npx":"restart"),g(!0)};O||M();try{window.sessionStorage.setItem("agent-dag.restartPending",(r==null?void 0:r.to)??"")}catch{}let $=!1;try{const P=await fetch("/api/restart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O?{upgrade:I,whenIdle:O}:{upgrade:I})});$=O&&P.status===409}catch{}if($){N.current=!1,E.current=null;try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}return}O&&M(),window.setTimeout(()=>{if(_.current===z&&N.current){N.current=!1,g(!1);try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}}},I?18e4:3e4)},[r==null?void 0:r.to,i]);w.useEffect(()=>{const F=QR(t.current.agents.values())>0,I=pne({enabled:u,kind:r==null?void 0:r.kind,canRestart:(n==null?void 0:n.canRestart)===!0,noticeOpen:s,visible:document.visibilityState==="visible",busy:F,idleSince:E.current,now:e});E.current=I.idleSince,I.restart&&T({whenIdle:!0})},[u,r==null?void 0:r.kind,n==null?void 0:n.canRestart,s,e,T]);const R=QR(t.current.agents.values()),A=fne(R,l),B=_O({enabled:u,kind:r==null?void 0:r.kind,canRestart:(n==null?void 0:n.canRestart)===!0,noticeOpen:s,visible:document.visibilityState==="visible",busy:R>0,idleSince:E.current,now:e});w.useEffect(()=>{const F=n==null?void 0:n.running;let I=null,O=null;try{I=window.sessionStorage.getItem("agent-dag.restartPending"),O=window.sessionStorage.getItem(hA)}catch{return}const z=lne({bundle:"3.34.1",running:F,pending:I,lastTried:O});if(z==="reload"){try{window.sessionStorage.setItem(hA,F??"")}catch{return}window.location.reload();return}if(z!=="confirm")return;try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}N.current=!1,g(!1),x(F??null);const M=window.setTimeout(()=>x(null),6e3);return()=>window.clearTimeout(M)},[n==null?void 0:n.running]),w.useEffect(()=>{if(p&&une({asked:S.current,reported:i})){try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}N.current=!1,g(!1)}},[p,i]);const L=w.useCallback(F=>{var I,O;if(!f.current){const z=Qe(Au)==="0";ss(Au),z&&((I=F.prefs)==null?void 0:I.autoUpdate)!==!1?(d(!1),fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({autoUpdate:!1})}).catch(()=>{})):d(((O=F.prefs)==null?void 0:O.autoUpdate)!==!1)}},[]);return{autoRestart:u,toggleAutoRestart:h,restarting:p,restartMode:v,restartedTo:b,askRestart:T,restartCopy:A,restartFuseMs:B,loadAutoRestartPrefs:L}}function Xre(){const[e,t]=w.useState([]),n=w.useRef(new Set),[r,s]=w.useState(null);w.useEffect(()=>{let u=!0,d=0;const f=()=>{fetch("/api/lan").then(h=>h.ok?h.json():null).then(h=>u?(h!=null&&h.ok&&t(Wj(Array.isArray(h.pending)?h.pending:[],h.aliases)),h):null).catch(()=>null).then(h=>{u&&(d=window.setTimeout(f,(h==null?void 0:h.enabled)===!0?Cx:_$))})};return f(),()=>{u=!1,window.clearTimeout(d)}},[]);const i=w.useCallback(async(u,d)=>{if(!r){s(u);try{const h=await(await fetch("/api/lan/peer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:u,fp:d})})).json().catch(()=>null);h&&Array.isArray(h.pending)?t(Wj(h.pending,h.aliases)):t(p=>p.filter(g=>g.fp!==d))}catch{}finally{s(null)}}},[r]),l=w.useCallback(u=>{r||(n.current.add(u),t(d=>[...d]))},[r]);return{lanPending:e,lanDeferred:n,lanBusy:r,answerLanPair:i,deferLanPair:l}}const LO="agent-dag.sessionListOpen",PO="agent-dag.accountsPanelOpen";function Zre(){return Qe(LO)==="1"}function Jre(e){Ze(LO,e?"1":"0")}function Qre(){const e=Qe(PO);return e===null?!0:e==="1"}function ese(){const[e,t]=w.useState(Zre);w.useEffect(()=>{Jre(e)},[e]);const n=w.useRef(!1),[r,s]=w.useState(()=>{const f=Qre();return f&&e?(n.current=!0,!1):f});w.useEffect(()=>{!r&&n.current||Ze(PO,r?"1":"0")},[r]),w.useEffect(()=>{!e&&n.current&&(n.current=!1,s(!0))},[e]);const i=w.useCallback(()=>{t(f=>(f||s(h=>(h&&(n.current=!0),!1)),!f))},[]),l=w.useCallback(()=>{n.current=!1,s(f=>(f||t(!1),!f))},[]),u=w.useCallback(()=>t(!1),[]),d=w.useCallback(()=>s(!1),[]);return{sessionListOpen:e,accountsPanelOpen:r,toggleSessionList:i,toggleAccountsPanel:l,closeSessionList:u,closeAccountsPanel:d}}const DO="agent-dag.detailOpen",FO="agent-dag.usagePanelOpen",qO="agent-dag.systemPanelOpen";function tse(){return Qe(DO)==="1"}function nse(e){Ze(DO,e?"1":"0")}function rse(){const e=Qe(FO);return e===null?!0:e==="1"}function sse(e){Ze(FO,e?"1":"0")}function ase(){const e=Qe(qO);return e===null?!0:e==="1"}function ose(e){Ze(qO,e?"1":"0")}function ise(){const[e,t]=w.useState(tse);w.useEffect(()=>{nse(e)},[e]);const[n,r]=w.useState(rse);w.useEffect(()=>{sse(n)},[n]);const[s,i]=w.useState(ase);return w.useEffect(()=>{ose(s)},[s]),{detailOpen:e,setDetailOpen:t,usagePanelOpen:n,setUsagePanelOpen:r,machinePanelOpen:s,setMachinePanelOpen:i}}const lse={permission:"your permission",asked:"your answer"},cse="No sessions are waiting for you.";function use(e){if(e.length===0)return"";const[t,...n]=e,r=t.waiting.kind,s=n.every(l=>l.waiting.kind===r)?lse[r]??"you":"you";if(n.length===0)return`${t.label} is waiting for ${s}.`;const i=`${n.length} more session${n.length===1?"":"s"}`;return`${t.label} and ${i} are waiting for ${s}.`}function Fv(e,t,n=cse){return t!==""?t:e===""?"":n}function dse({waitingSessions:e,watchUnseen:t,incidents:n=[]}){const[r,s]=w.useState(""),i=use(e);w.useEffect(()=>{s(g=>Fv(g,i))},[i]);const[l,u]=w.useState(""),d=t>0?`Browser watch has ${t} unread ${t===1?"finding":"findings"}.`:"";w.useEffect(()=>{u(g=>Fv(g,d,"Browser watch has no unread findings."))},[d]);const[f,h]=w.useState(""),p=$re(n);return w.useEffect(()=>{h(g=>Fv(g,p,Ire))},[p]),{blockedSaid:r,watchSaid:l,setWatchSaid:u,incidentSaid:f}}function hse({waitingSessions:e,liveSince:t,focusSession:n}){const[r,s]=w.useState(()=>typeof Notification>"u"?"denied":Notification.permission),[i,l]=w.useState(null),[u,d]=w.useState(!1),[f,h]=w.useState(!1),p=w.useRef(()=>{}),g=w.useRef(new Set),v=xn(e),k=w.useCallback(()=>{const T=!u;d(T),T&&(g.current=gu(v.current)),T&&typeof Notification<"u"&&Notification.permission==="default"&&p.current(),fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({notifications:T})}).then(R=>R.ok?R.json():null).then(R=>{var A;R!=null&&R.ok&&(d(((A=R.prefs)==null?void 0:A.notifications)===!0),h(R.notificationsVetoed===!0))}).catch(()=>{})},[u]),b=typeof Notification<"u";w.useEffect(()=>{if(!i)return;const R=setTimeout(()=>l(null),i==="blocked"?8e3:4e3);return()=>clearTimeout(R)},[i]);const x=w.useCallback(()=>{typeof Notification>"u"||Notification.requestPermission().then(T=>{const R=T;s(R),R==="granted"?l("on"):R==="denied"&&l("blocked")})},[]);p.current=x;const N=w.useRef(null),S=e.map(T=>Rd(T.id,T.waiting)).join("|");w.useEffect(()=>{Xq(N.current,r)&&(N.current=r,g.current=gu(e))},[r]);const _=w.useRef(!1);w.useEffect(()=>{Zq(_.current,t)&&(_.current=!0,g.current=gu(e))},[t]),w.useEffect(()=>{if(typeof Notification>"u"||Notification.permission!=="granted"||!Jq(N.current,t))return;const T=typeof document>"u"||!document.hidden,R=Kq(e,g.current,T,u);for(const A of R)try{const B=new Notification(A.title,{body:A.body,tag:A.key});B.onclick=()=>{window.focus(),n(A.sessionId),B.close()}}catch{}g.current=T?gu(e):Yq(e,R,g.current)},[S,t]);const E=w.useCallback(T=>{var R;d(((R=T.prefs)==null?void 0:R.notifications)===!0),h(T.notificationsVetoed===!0)},[]);return{notifyPermission:r,notifySaid:i,notifyOn:u,notifyVetoed:f,toggleNotify:k,notifySupported:b,askForNotifications:x,loadNotifyPrefs:E}}function fse({openedTool:e,usageHistoryOpen:t,contextFor:n,tourOpen:r,summaryFor:s,browserWatchOpen:i,keyHelpOpen:l,releaseNotes:u,feedbackOpen:d}){const f=xn(l),h=w.useRef(!1);return h.current=e!=null||t||n!=null||r||s!=null||i||l||u!=null||d,{keyHelpOpenRef:f,modalOpenRef:h}}function pse({stateRef:e,tourOpen:t,releaseNotes:n}){const[r,s]=w.useState(null),i=w.useCallback((A,B)=>s({agentId:A,toolId:B}),[]),[l,u]=w.useState(null),[d,f]=w.useState(null),h=w.useCallback(A=>f(A),[]),[p,g]=w.useState(!1),[v,k]=w.useState(!1),[b,x]=w.useState(!1),[N,S]=w.useState(!1),_=r?J6(e.current.agents,r.agentId,r.toolId):null,E=d?e.current.agents.get(d):void 0,{keyHelpOpenRef:T,modalOpenRef:R}=fse({openedTool:_,usageHistoryOpen:v,contextFor:d,tourOpen:t,summaryFor:l,browserWatchOpen:b,keyHelpOpen:p,releaseNotes:n,feedbackOpen:N});return{setOpenedToolKey:s,openTool:i,openedTool:_,summaryFor:l,setSummaryFor:u,contextFor:d,setContextFor:f,openContext:h,contextAgent:E,keyHelpOpen:p,setKeyHelpOpen:g,usageHistoryOpen:v,setUsageHistoryOpen:k,browserWatchOpen:b,setBrowserWatchOpen:x,feedbackOpen:N,setFeedbackOpen:S,keyHelpOpenRef:T,modalOpenRef:R}}function mse({stateRef:e,pinnedRef:t,measuredRef:n,positionsRef:r,lastLayoutSigRef:s,forgetRemovals:i,clearSelection:l,rerender:u,modalOpenRef:d}){const[f,h]=w.useState(!1),p=w.useCallback(async()=>{try{await fetch("/api/clear",{method:"POST"})}catch{}e.current=p0(),t.current.clear(),n.current.clear(),r.current.clear(),s.current="",gO(),i(),l(),u()},[u,l,i]),g=xn(f),v=w.useCallback(k=>{const b=yne(k,{confirmOpen:g.current,modalOpen:d.current});b==="confirm"?h(!0):b==="clear"&&(h(!1),p())},[p]);return{clearConfirmOpen:f,setClearConfirmOpen:h,requestClear:v}}const fA="agent-dag.oldNameNoticeDismissed";function gse(e){const[t,n]=w.useState(()=>Qe(fA)??""),r=e!=null&&e.invokedAs&&e.invokedAs!==kt?e.invokedAs:null,s=r!=null&&t!==r,i=w.useCallback(()=>{r&&(n(r),Ze(fA,r))},[r]);return{oldName:r,oldNameOpen:s,dismissOldName:i}}function yse({chimesRef:e,setTonePrefs:t,tonePrefsRef:n,previewTone:r}){const[s,i]=w.useState(()=>GK(Qe)),l=xn(s),[u,d]=w.useState([]),f=w.useCallback(S=>{i(_=>{const E={..._,[S]:null};return l.current=E,E}),ss(vl[S])},[]),h=w.useCallback((S,_)=>{const E=l.current[S];_&&E!==_||(f(S),t(T=>{const R={...T,[S]:{...T[S],figure:vn}};return n.current=R,R}),Ze(pd[S],vn))},[f]),p=xn(h);w.useEffect(()=>{let S=!0;return sY().then(_=>{if(!S)return;d(_);const E=new Set(_.map(T=>T.id));for(const T of Bu){const R=l.current[T];R&&!E.has(R)&&p.current(T,R)}},()=>{}),()=>{S=!1}},[]);const g=w.useCallback((S,_)=>{if(!u.some(T=>T.id===_))return;const E={...l.current,[S]:_};l.current=E,i(E),Ze(vl[S],_),r(S,!0)},[u,r]),v=w.useCallback(async S=>{var R;const _=Ix(u.length);if(_)throw new Error(_);const E=window.AudioContext??window.webkitAudioContext;if(!E)throw new Error("This browser cannot decode audio files.");const T=new E;try{const A=await QK(S,L=>T.decodeAudioData(L));await mS(A);const B=Dl(A);d(L=>[...L.filter(F=>F.id!==B.id),B])}finally{(R=T.close)==null||R.call(T)}},[u.length]),k=w.useCallback(async S=>{const _=Ix(u.length);if(_)throw new Error(_);const E=eY(S);await mS(E);const T=Dl(E);d(R=>[...R.filter(A=>A.id!==T.id),T])},[u.length]),b=w.useCallback(async(S,_)=>{const E=u.find(R=>R.id===S),T=_.trim().slice(0,80);!E||!T||T===E.name||(await oY(S,T),d(R=>R.map(A=>A.id===S?{...A,name:T}:A)))},[u]),x=w.useCallback(async S=>{await iY(S),d(R=>R.filter(A=>A.id!==S));const _=l.current,E=KK(_,S);l.current=E,i(E);const T=Bu.filter(R=>_[R]===S);for(const R of T)ss(vl[R]),Ze(pd[R],vn);T.length>0&&t(R=>{const A={...R};for(const B of T)A[B]={...A[B],figure:vn};return n.current=A,A})},[]),N=w.useCallback(S=>{var T,R;const _=Bu.find(A=>l.current[A]===S),E=_?n.current[_].level:La;(T=e.current)==null||T.unlock(),(R=e.current)==null||R.previewCustom(S,E)},[]);return{customSelections:s,customSelectionsRef:l,customAssets:u,clearCustomOnly:f,fallbackCustomRef:p,selectCustomTone:g,importNotificationAudio:v,createNotificationVoice:k,renameCustomAsset:b,deleteCustomAsset:x,previewCustomAsset:N}}function wse(e){const[t,n]=w.useState(()=>vY(Qe)),r=xn(t),s=w.useRef(null),i=w.useCallback((u,d=!1)=>{var f,h;if((f=e.current)==null||f.unlock(),s.current!==null&&clearTimeout(s.current),s.current=null,!d){(h=e.current)==null||h.play(u,!0);return}s.current=setTimeout(()=>{var p;s.current=null,(p=e.current)==null||p.play(u,!0)},pY)},[]),l=w.useCallback((u,d)=>{n(f=>{const h={level:oi(d.level??f[u].level),figure:eI(u,d.figure??f[u].figure)};return Ze(rI[u],String(h.level)),Ze(pd[u],h.figure),{...f,[u]:h}}),i(u,!0)},[i]);return w.useEffect(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]),{tonePrefs:t,setTonePrefs:n,tonePrefsRef:r,previewTone:i,changeTone:l}}const vse=15e3;function xse(e){return e.visibilityState==="visible"&&e.hasFocus()}function bse(e,t){return t||e===!0}function kse(){try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{}return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Nse(){w.useEffect(()=>{const e=kse();let t=null;const n=l=>{fetch("/api/presence",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tab:e,looking:l}),keepalive:!0}).catch(()=>{})},r=()=>{const l=xse(document);bse(t,l)&&n(l),t=l},s=()=>{t&&n(!1),t=!1};r();const i=window.setInterval(r,vse);return window.addEventListener("focus",r),window.addEventListener("blur",r),document.addEventListener("visibilitychange",r),window.addEventListener("pagehide",s),()=>{window.clearInterval(i),window.removeEventListener("focus",r),window.removeEventListener("blur",r),document.removeEventListener("visibilitychange",r),window.removeEventListener("pagehide",s),s()}},[])}function jse({loadAutoRestartPrefs:e,loadNotifyPrefs:t,loadReportsPrefs:n}){w.useEffect(()=>{let r=!0;return fetch("/api/prefs").then(s=>s.ok?s.json():null).then(s=>{!r||!(s!=null&&s.ok)||(e(s),t(s),n(s))}).catch(()=>{}),()=>{r=!1}},[])}const qv="agent-dag.versionNoticeDismissed",Sse=15*6e4;function _se(e){const[t,n]=w.useState(null),[r,s]=w.useState(()=>Qe(qv)??""),i=w.useRef(0),[l,u]=w.useState(!1),d=w.useCallback((b=!1)=>(b&&(i.current=Date.now(),u(!0)),fetch(b?"/api/version?refresh=1":"/api/version").then(x=>x.ok?x.json():null).then(x=>{x&&n(x)}).catch(()=>{}).finally(()=>{b&&u(!1)})),[]),f=w.useCallback(()=>{d(Date.now()-i.current>=Sse)},[d]);w.useEffect(()=>{d();const b=window.setInterval(f,5*6e4),x=()=>{document.visibilityState==="visible"&&f()};return document.addEventListener("visibilitychange",x),()=>{window.clearInterval(b),document.removeEventListener("visibilitychange",x)}},[d,f]),w.useEffect(()=>{e&&d()},[e,d]);const h=(t==null?void 0:t.notice)??null,p=SO(h),g=Hte(h,r),v=w.useCallback(()=>{s(""),Ze(qv,"")},[]),k=w.useCallback(()=>{h&&(s(p),Ze(qv,p))},[h,p]);return{version:t,notice:h,noticeOpen:g,showNotice:v,dismissNotice:k,versionChecking:l,loadVersion:d}}function Ese({version:e,readyAppUpdate:t}){const[n,r]=w.useState(!1),s=w.useRef(null),[i,l]=w.useState(null),u=i&&t?t.version:null,d=w.useRef(null);w.useEffect(()=>{!u||d.current===u||(d.current=u,fetch("/api/desktop-update/seen",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({version:u})}).catch(()=>{}))},[u]);const f=w.useRef(!1);w.useEffect(()=>{if(f.current)return;const x=yl(),N=Bne(x),S=Gne({stored:N,running:(e==null?void 0:e.running)??null,notes:rA,remembers:Une(x)});if(S.reason==="no-version")return;f.current=!0,S.record&&zne(x,S.record);let _=!0;return(async()=>{var B;let T=Wne(x);if(Bl())try{const L=await fetch("/api/prefs");if(!L.ok)throw new Error("desktop tour preferences unavailable");const F=await L.json();if(!(F!=null&&F.ok))throw new Error("desktop tour preferences unavailable");const I=((B=F.prefs)==null?void 0:B.tourSeen)===!0;T&&!I&&fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tourSeen:!0}),keepalive:!0}).catch(()=>{}),T=T||I}catch{T=!0}if(!_)return;const R=Vne({tourSeen:T,decision:S}),A=S.show.length?{entries:S.show,since:N,firstRun:!1}:null;R.tour&&r(!0),R.notes==="now"?l(A):R.notes==="after"&&(s.current=A)})(),()=>{_=!1}},[e==null?void 0:e.running]);const h=(e==null?void 0:e.running)??"3.34.1",p=w.useMemo(()=>EO(rA,null,h),[h]),g=w.useCallback(()=>{l({entries:p,since:null,firstRun:!1})},[p]),v=w.useCallback(()=>r(!0),[]),k=w.useCallback(()=>l(null),[]),b=w.useCallback(()=>{r(!1),Hne(yl()),Bl()&&fetch("/api/prefs",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tourSeen:!0}),keepalive:!0}).catch(()=>{});const x=s.current;s.current=null,x&&l(x)},[]);return{tourOpen:n,openTour:v,closeTour:b,releaseNotes:i,closeReleaseNotes:k,chipVersion:h,openReleaseNotes:g}}const Cse=10,Tse=500,Rse=4e3,Ase=[/ResizeObserver loop/i,/^Script error\.?$/i],Mse=e=>{fetch("/api/client-error",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e),keepalive:!0}).catch(()=>{})};function $se(e,t=window,n=Mse){let r=0;const s=new Set,i=(d,f)=>{const h=String(d??"").slice(0,Tse).trim();!e()||!h||r>=Cse||s.has(h)||Ase.some(p=>p.test(h))||(s.add(h),r++,n({message:h,stack:typeof f=="string"?f.slice(0,Rse):void 0}))},l=d=>{var f,h;return i(((f=d.error)==null?void 0:f.message)??d.message,(h=d.error)==null?void 0:h.stack)},u=d=>typeof d.reason=="object"&&d.reason!==null?i(d.reason.message,d.reason.stack):i(d.reason,void 0);return t.addEventListener("error",l),t.addEventListener("unhandledrejection",u),()=>{t.removeEventListener("error",l),t.removeEventListener("unhandledrejection",u)}}function Ise(){const[e,t]=w.useState(void 0),[n,r]=w.useState(!1),s=w.useRef(!1);s.current=e===!0&&!n,w.useEffect(()=>$se(()=>s.current),[]);const i=w.useCallback(u=>{var d;t(((d=u.prefs)==null?void 0:d.reports)!==!1),r(u.reportsVetoed===!0)},[]),l=w.useCallback(async u=>{t(u);try{const f=await(await fetch("/api/reports",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({on:u})})).json();f!=null&&f.ok&&(t(f.reports!==!1),r(f.reportsVetoed===!0))}catch{}},[]);return{reportsOn:e,reportsVetoed:n,loadReportsPrefs:i,answerReports:l}}function Ose(){const[e,t]=w.useState(null),[n,r]=w.useState(!1),s=w.useRef(null);return w.useEffect(()=>{let i=!0,l=!1,u=null,d=null,f="";const h=b=>{i&&(r(!0),b!==f&&t(null))},p=()=>{if(l)return;l=!0,u=Date.now();const b=XR();d=b,fetch(`/api/ccusage?since=${b}`).then(x=>x.ok?x.json():null).then(x=>{if(i){if(!(x!=null&&x.ok)){h(b);return}f=b,t($te(x)),r(!1)}}).catch(()=>h(b)).finally(()=>{l=!1})},g=()=>{const b=s.current;Mte({shown:!!b&&b.getClientRects().length>0,tabVisible:document.visibilityState==="visible",lastSince:d,since:XR(),lastReadAt:u,now:Date.now()})&&p()};g();const v=window.setInterval(g,Ate);document.addEventListener("visibilitychange",g);let k=null;return s.current&&typeof ResizeObserver<"u"&&(k=new ResizeObserver(g),k.observe(s.current)),()=>{i=!1,window.clearInterval(v),document.removeEventListener("visibilitychange",g),k==null||k.disconnect()}},[]),{monthlyUsage:e,monthlyUsageUnavailable:n,monthUsageRef:s}}function Lse(e){const[t,n]=w.useState(null);w.useEffect(()=>{const u=Qe("agent-dag.sound");n(u===null?!0:u==="on")},[]);const r=w.useCallback(()=>{n(u=>{var f;const d=u!==!0;return Ze("agent-dag.sound",d?"on":"off"),d&&((f=e.current)==null||f.unlock()),d})},[]),s=w.useCallback(u=>{r()},[r]),i=xn(s),l=xn(t);return{soundOn:t,toggleSound:r,activateSoundRef:i,soundOnRef:l}}function Pse(){const[e,t]=w.useState(!1),n=w.useRef(null),[r,s]=w.useState(!1),i=w.useRef(null);return w.useEffect(()=>{e&&s(!1)},[e]),{soundMenuOpen:e,setSoundMenuOpen:t,soundButtonRef:n,appearanceMenuOpen:r,setAppearanceMenuOpen:s,appearanceButtonRef:i}}const Dse="agent-dag.autoFitDisabled";function Fse(e){const t=w.useRef(!1),[n,r]=w.useState(!1);w.useEffect(()=>{ss(Dse)},[]);const s=w.useCallback(()=>{t.current||(t.current=!0,r(!0))},[]),i=w.useCallback(()=>{t.current=!1,r(!1),e(400)},[e]);return{autoFitDisabled:n,autoFitDisabledRef:t,disableAutoFit:s,enableAutoFitAndRefit:i}}function qse(){return a.jsx(d0,{children:a.jsx(Bse,{})})}function Bse(){const e=ci(),t=w.useState(p0)[0],n=w.useRef(t),[,r]=w.useState(0),s=w.useCallback(()=>r(Kn=>Kn+1),[]),{detailOpen:i,setDetailOpen:l,usagePanelOpen:u,setUsagePanelOpen:d,machinePanelOpen:f,setMachinePanelOpen:h}=ise(),{selectedIds:p,primarySelectedId:g,selectAgent:v,clearSelection:k,pruneSelectionToBoard:b}=PY(n,l),{sessionListOpen:x,accountsPanelOpen:N,toggleSessionList:S,toggleAccountsPanel:_,closeSessionList:E,closeAccountsPanel:T}=ese(),R=Ose(),A=Pu(N,200),B=Pu(u,130),L=Pu(f,130),F=w.useRef(null),I=Lse(F),{activateSoundRef:O,soundOnRef:z}=I,M=wse(F),{setTonePrefs:$,tonePrefsRef:P,previewTone:K}=M,H=yse({chimesRef:F,setTonePrefs:$,tonePrefsRef:P,previewTone:K}),{customSelectionsRef:D,fallbackCustomRef:W}=H,q=Pse(),{setSoundMenuOpen:Y}=q,{chimeState:J}=Vre({chimesRef:F,soundOnRef:z,tonePrefsRef:P,customSelectionsRef:D,fallbackCustomRef:W}),V=mre(n),{pauseGate:G,paused:X,togglePause:Z}=V,ee=w.useRef(()=>{}),{live:se,tabCapped:ue,everConnected:oe,liveSince:re}=EY({stateRef:n,rerender:s,pauseGate:G,chimesRef:F,desktopUpdateRef:ee}),de=_se(se),{version:ge,notice:pe,noticeOpen:Ne,loadVersion:xe}=de,fe=Kre(se),{readyAppUpdate:Te,onDesktopUpdateEvent:Fe}=fe;ee.current=Fe,Nse();const Oe=Ese({version:ge,readyAppUpdate:Te}),{tourOpen:We,openTour:le,releaseNotes:ke}=Oe,{workspace:$e,providers:Le,providersRef:et}=yre(se),Je=gse(ge),Ke=Ore({version:ge,loadVersion:xe}),{upgradeFailure:yt}=Ke,Ue=pse({stateRef:n,tourOpen:We,releaseNotes:ke}),{openTool:Xe,setSummaryFor:ot,setContextFor:it,openContext:ut,setKeyHelpOpen:wt,setUsageHistoryOpen:ft,setBrowserWatchOpen:Ft,keyHelpOpenRef:Jt,modalOpenRef:Ht}=Ue,Vt=Ise(),qt=Pre(),{watchOn:Gt,watchUnseen:pr}=qt,Fr=Xre(),[hs,fs]=w.useState(0),{presentCats:mr,hiddenCats:qn,toggleCat:Bn,catBarRef:gr,catBarOccluded:Un}=Wre(n),ps=w.useRef(null),[kn,zn]=w.useState(0),xt=DY({stateRef:n,rerender:s,pruneSelectionToBoard:b,setContextFor:it,setSummaryFor:ot}),yr=bre(Le.claude||Le.codex),wr=Mre(yr,xt),vr=Yre({now:xt,stateRef:n,version:ge,notice:pe,noticeOpen:Ne,upgradeFailure:yt,paused:V.paused}),{askRestart:ms,loadAutoRestartPrefs:me}=vr,qe=zre(),{setTheme:Ye,palette:Wn}=qe,qr=Gre(),Hn=OQ(),{applyViewport:gs,moveCamera:ys,fitLeft:Qt,cameraEpochRef:vi,lastFitTimeRef:tt}=Hn,Br=GQ(Qt),{pinnedRef:xr,positionsRef:Ur,lastLayoutSigRef:ws,handleRelayout:Wa}=Br,Qs=w.useRef(null),zr=w.useRef(()=>{}),en=re!==null,vs=w.useRef(0),tn=w.useCallback(()=>{vs.current=Date.now()},[]),{canvasRef:Wr,canvasSize:dh,paneSizeRef:hh}=Eee(),ea=Fse(Qt),{autoFitDisabledRef:ta,disableAutoFit:Hr}=ea,xs=w.useRef(!1),{measuredRef:Vr,measuredVersionRef:fh,sizeVersion:xi,domSizeVersion:nc}=Cee(xs),{removedNodes:Ha,removedAgentIds:Nn,removeNode:ph,removeSelectedNode:Va,removalNotice:He,bringBack:Ga,bringBackAll:rc,forgetRemovals:bi}=wee({stateRef:n,pinnedRef:xr,positionsRef:Ur,canvasRef:Wr,clearSelection:k,primarySelectedId:g}),Ka=fee({stateRef:n,now:xt,removedAgentIds:Nn,sizeVersion:xi,domSizeVersion:nc});KQ(Ka,Br),yee({layoutSig:Ka,rf:e,stateRef:n,measuredRef:Vr,pinnedRef:xr,positionsRef:Ur,paneSizeRef:hh,lastInteractRef:vs,autoFitDisabledRef:ta,lastFitTimeRef:tt,fitLeft:Qt});const ki=Tee(),{bubbling:sc,endBubble:Ni,onBubble:Ya}=AK(),[jn,br]=w.useState(!1),Vn=TK(),{beginTrashDrag:na,trackTrashDrag:ra,endTrashDrag:kr}=Vn,ac=qK({stateRef:n,measuredRef:Vr,measuredVersionRef:fh,canvasRef:Wr}),{lodRef:oc,applyZoom:sa}=ac,ic=See({applyViewport:gs,lastFitTimeRef:tt,cameraEpochRef:vi,disableAutoFit:Hr,markInteract:tn,canvasRef:Wr,applyZoom:sa}),bs=g?n.current.agents.get(g):null,aa=i&&bs!=null,{railInsetRef:ji,availableWidth:lc,availableHeight:ks}=IQ({canvasRef:Wr,canvasSize:dh,machinePhase:L,usagePhase:B,usagePanelOpen:u,detailShown:aa}),Ns=pee({stateRef:n,now:xt,availableWidth:lc,availableHeight:ks,layout:Br,measuredRef:Vr,onBubble:Ya,settled:ki,dragging:jn,layoutSig:Ka,selectedIds:p,openContext:ut,historyReplayed:en,removedNodes:Ha,removedAgentIds:Nn,dragTick:hs,dragPatchRef:ps,dragMoveTick:kn}),{nodes:Nr,edges:Xa}=Ns,Si=xn(g);YQ({nodes:Nr,edges:Xa,settled:ki,dragging:jn,availableWidth:lc,availableHeight:ks,layout:Br,camera:Hn,rf:e,measuredRef:Vr,stateRef:n,lastFocusRef:Qs,primarySelectedIdRef:Si,focusAgentRef:zr,autoFitDisabledRef:ta});const cc=mse({stateRef:n,pinnedRef:xr,measuredRef:Vr,positionsRef:Ur,lastLayoutSigRef:ws,forgetRemovals:bi,clearSelection:k,rerender:s,modalOpenRef:Ht}),{requestClear:Za}=cc,Ja=Mee({nodes:Nr,stateRef:n,pinnedRef:xr,positionsRef:Ur,draggingRef:xs,dragPatchRef:ps,setDragging:br,setDragMoveTick:zn,setDragTick:fs,endBubble:Ni,markInteract:tn,disableAutoFit:Hr,beginTrashDrag:na,trackTrashDrag:ra,endTrashDrag:kr,removeNode:ph}),_i=w.useCallback(()=>Qt(500),[Qt]),Qa=xn(Nr),{focusAgent:fn,stepAgent:Ei,focusSession:jr}=PQ({canvasRef:Wr,stateRef:n,measuredRef:Vr,nodesRef:Qa,railInsetRef:ji,moveCamera:ys,disableAutoFit:Hr,lastFocusRef:Qs,focusAgentRef:zr,selectAgent:v,primarySelectedIdRef:Si}),uc=_ee({clearSelection:k,selectAgent:v,detailOpen:i,setDetailOpen:l,detailShown:aa,focusAgent:fn,draggingRef:xs,lodRef:oc}),eo=DQ({nodesRef:Qa,stateRef:n,canvasRef:Wr,railInsetRef:ji}),to=xn(Va),Ci=w.useRef(null),Kt=w.useCallback(Kn=>{Nn.has(Kn)&&Ga([Kn]),jr(Kn)},[Nn,Ga,jr]),js=Ree();Aee({pointerFocusRef:js,nodesRef:Qa,stateRef:n,primarySelectedIdRef:Si,providersRef:et,soundOnRef:z,keyHelpOpenRef:Jt,modalOpenRef:Ht,waitingCursorRef:Ci,removeSelectedRef:to,activateSoundRef:O,clearSelection:k,selectAgent:v,focusAgent:fn,stepAgent:Ei,focusSession:jr,requestClear:Za,handleRelayout:Wa,handleFit:_i,togglePause:Z,toggleSessionList:S,toggleAccountsPanel:_,setDetailOpen:l,setUsageHistoryOpen:ft,setUsagePanelOpen:d,setMachinePanelOpen:h,setBrowserWatchOpen:Ft,setSoundMenuOpen:Y,setKeyHelpOpen:wt,setTheme:Ye});const no=n.current.agents.size,Gn=w.useMemo(()=>ax(n.current.agents.values()),[n.current,n.current.revision]);vee({stateRef:n,waitingSessions:Gn,removedAgentIds:Nn,removedNodes:Ha,bringBack:Ga}),kee({stateRef:n,waitingSessions:Gn,live:se});const dc=dse({waitingSessions:Gn,watchUnseen:pr,incidents:wr}),oa=hse({waitingSessions:Gn,liveSince:re,focusSession:jr}),{loadNotifyPrefs:Ti}=oa;return jse({loadAutoRestartPrefs:me,loadNotifyPrefs:Ti,loadReportsPrefs:Vt.loadReportsPrefs}),a.jsxs("div",{className:"app",children:[a.jsx("a",{className:"skip-link",href:"#canvas",children:"Skip to the canvas"}),a.jsxs("header",{className:"topbar",children:[a.jsx(Zte,{versionCheck:de,welcome:Oe,desktopUpdate:fe,pause:V,monthly:R,announcements:dc,notify:oa,waitingSessions:Gn,waitingCursorRef:Ci,focusSession:jr,live:se,now:xt,incidents:wr}),bs&&a.jsx(Jte,{selected:bs,now:xt,selectedIds:p,focusAgent:fn,clearSelection:k}),a.jsxs("div",{className:"actions",children:[a.jsx(Ete,{sessionListOpen:x,toggleSessionList:S,usagePanelOpen:u,setUsagePanelOpen:d,setUsageHistoryOpen:ft}),a.jsx(Cte,{providers:Le,accountsPanelOpen:N,toggleAccountsPanel:_,machinePanelOpen:f,setMachinePanelOpen:h,watchOn:Gt,watchUnseen:pr,setBrowserWatchOpen:Ft}),a.jsx(Tte,{providers:Le,sound:I,tones:M,customTones:H,notify:oa,chimeState:J,menus:q,appearance:qe,fm:qr,reports:Vt,onFeedback:()=>Ue.setFeedbackOpen(!0)})]})]}),a.jsx("div",{className:"vis-hidden",role:"status","aria-atomic":"true",children:He?`${He.label} removed from the board.`:""}),a.jsx(gne,{restart:vr,versionCheck:de,upgrade:Ke,oldNameNotice:Je,everConnected:oe,live:se,paused:X}),Lu(A)&&Le.claude&&a.jsx(kK,{leaving:A==="leaving",onClose:T}),x&&a.jsx($z,{state:n.current,now:xt,selectedIds:p,onSelect:Kt,onClose:E,removedIds:Nn,onBringBackAll:rc}),a.jsxs(rne,{canvasRef:Wr,bubbling:sc,dragging:jn,trash:Vn,zoom:ac,viewport:ic,stateRef:n,peek:eo,children:[no===0&&(!se&&ue?a.jsx(qee,{}):a.jsx(Bee,{live:se,everConnected:oe,providers:Le,workspace:$e,onTour:le})),(mr.length>1||qn.size>0)&&a.jsx(Qte,{catBarRef:gr,catBarOccluded:Un,presentCats:mr,hiddenCats:qn,toggleCat:Bn}),a.jsx(Sz,{graph:Ns,layout:Br,viewport:ic,clicks:uc,drag:Ja,appearance:qe,fm:qr,autoFit:ea,pause:V,stateRef:n,measuredRef:Vr,hiddenCats:qn,now:xt,openTool:Xe,focusAgent:fn,requestClear:Za,setKeyHelpOpen:wt})]}),Lu(B)&&a.jsx(SW,{state:n.current,now:xt,providers:Le,incidents:wr,liveSince:re,leaving:B==="leaving",onClose:()=>d(!1)}),Lu(L)&&a.jsx(cH,{usageOpen:u,leaving:L==="leaving",onClose:()=>h(!1)}),i&&bs?a.jsx(ete,{selected:bs,now:xt,openTool:Xe,setSummaryFor:ot,setDetailOpen:l,stateRef:n,removeSelectedNode:Va}):null,a.jsx(hre,{dialogs:Ue,welcome:Oe,desktopUpdate:fe,versionCheck:de,restart:vr,lanPairs:Fr,clearFlow:cc,watchBadge:qt,announcements:dc,appearance:qe,providers:Le,stateRef:n,agentCount:no})]})}try{A8(window.localStorage)}catch{}const Use=xP.createRoot(document.getElementById("root"));Use.render(a.jsx(qse,{}));export{Oee as a,at as b,Ks as c,hd as d,Wse as e,Be as f,as as g,zse as h,Ll as i,a as j,cs as k,ZK as l,ba as m,Fa as n,yx as p,w as r,Ar as s,gt as u};
|
package/dist/web/index.html
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
stored === "light" || (stored !== "dark" && light) ? "light" : "dark");
|
|
63
63
|
})();
|
|
64
64
|
</script>
|
|
65
|
-
<script type="module" crossorigin src="/assets/index-
|
|
65
|
+
<script type="module" crossorigin src="/assets/index-CSDSEC1Q.js"></script>
|
|
66
66
|
<link rel="stylesheet" crossorigin href="/assets/index-DglpEGvW.css">
|
|
67
67
|
</head>
|
|
68
68
|
<body>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccdeck",
|
|
3
|
-
"version": "3.34.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.34.1",
|
|
4
|
+
"description": "Local dashboard for Claude Code and Codex CLI sessions: which Claude Code session needs input, every tool call and Claude Code subagent live, token cost and quota, several Claude accounts. Run npx ccdeck.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"ccdeck": "bin/agent-dag.js"
|
|
@@ -44,16 +44,21 @@
|
|
|
44
44
|
"dashboard",
|
|
45
45
|
"monitor",
|
|
46
46
|
"monitoring",
|
|
47
|
-
"observability",
|
|
48
|
-
"usage",
|
|
49
47
|
"cost",
|
|
50
|
-
"tokens",
|
|
51
48
|
"quota",
|
|
52
49
|
"hooks",
|
|
53
50
|
"dag",
|
|
54
51
|
"visualization",
|
|
55
|
-
"
|
|
56
|
-
"
|
|
52
|
+
"claude-code-monitor",
|
|
53
|
+
"claude-code-sessions",
|
|
54
|
+
"session-monitor",
|
|
55
|
+
"codex-dashboard",
|
|
56
|
+
"claude-code-subagents",
|
|
57
|
+
"parallel-sessions",
|
|
58
|
+
"desktop-app",
|
|
59
|
+
"ccusage",
|
|
60
|
+
"claude-swap",
|
|
61
|
+
"local-first"
|
|
57
62
|
],
|
|
58
63
|
"author": "Bargan Constantin",
|
|
59
64
|
"license": "AGPL-3.0-only",
|
package/release-notes.json
CHANGED
|
@@ -60,6 +60,12 @@
|
|
|
60
60
|
"3.29.9",
|
|
61
61
|
"3.33.1"
|
|
62
62
|
],
|
|
63
|
+
"3.34.1": [
|
|
64
|
+
{
|
|
65
|
+
"title": "🗂️ The tray menu stays open while you read it",
|
|
66
|
+
"body": "On Linux the menu behind the tray icon could close by itself while agents were working, often before the row you pressed took the click, so it had to be opened and pressed again. It now changes only when something it says has changed, and stays open while you choose."
|
|
67
|
+
}
|
|
68
|
+
],
|
|
63
69
|
"3.34.0": [
|
|
64
70
|
{
|
|
65
71
|
"title": "🗺️ The network map shows who you are connected to",
|