@zaferyalcin/agent-office 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +476 -2
- package/bin/agent-office.js +64 -0
- package/package.json +25 -4
- package/public/app.css +1035 -0
- package/public/app.js +2034 -0
- package/public/favicon.svg +1 -0
- package/public/i18n.js +1119 -0
- package/public/index.html +141 -0
- package/public/studio.js +1951 -0
- package/public/vendor/three/LICENSE +21 -0
- package/public/vendor/three/three.core.js +61162 -0
- package/public/vendor/three/three.module.js +19537 -0
- package/src/collector.js +501 -0
- package/src/history.js +161 -0
- package/src/open.js +57 -0
- package/src/providers/antigravity-core.js +743 -0
- package/src/providers/antigravity.js +136 -0
- package/src/providers/claude-code.js +465 -0
- package/src/providers/codex.js +168 -0
- package/src/providers/demo.js +1379 -0
- package/src/providers/gemini-cli.js +115 -0
- package/src/server.js +201 -0
- package/src/state.js +142 -0
- package/src/update.js +99 -0
- package/src/util.js +139 -0
- package/src/workspace.js +112 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 zaferyalcin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,477 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Agent Office
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A local, read-only dashboard that shows every coding agent running on your computer (Claude Code, Codex, Gemini CLI and Antigravity), what each one is doing, and how much of your plan's limits is left.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
### Videos
|
|
12
|
+
|
|
13
|
+
[](docs/tour.mp4)
|
|
14
|
+
|
|
15
|
+
- [**Full tour** (4.5 min, captioned)](docs/tour.mp4): installing it, then every feature with a caption that says what it does.
|
|
16
|
+
- [**Short demo** (40 s)](docs/demo.mp4): the key features only.
|
|
17
|
+
|
|
18
|
+
Both are silent, 1920x1080, and recorded in demo mode (`--demo`), so every project, person and number in them is made up.
|
|
19
|
+
|
|
20
|
+
## Quick start
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npx @zaferyalcin/agent-office # run the latest version from npm
|
|
24
|
+
npx @zaferyalcin/agent-office --demo # try it with generated fictional data first
|
|
25
|
+
npm install -g @zaferyalcin/agent-office # or install it once, then run: agent-office
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
When started with `npx`, Agent Office opens the dashboard in your browser automatically (`--no-open` turns that off).
|
|
29
|
+
|
|
30
|
+
## Contents
|
|
31
|
+
|
|
32
|
+
- [Quick start](#quick-start)
|
|
33
|
+
- [Why](#why)
|
|
34
|
+
- [Features](#features)
|
|
35
|
+
- [Supported tools](#supported-tools)
|
|
36
|
+
- [Requirements and install](#requirements-and-install)
|
|
37
|
+
- [Configuration](#configuration)
|
|
38
|
+
- [How it works](#how-it-works)
|
|
39
|
+
- [Privacy and cost](#privacy-and-cost)
|
|
40
|
+
- [Troubleshooting](#troubleshooting)
|
|
41
|
+
- [Development](#development)
|
|
42
|
+
- [License and contributing](#license-and-contributing)
|
|
43
|
+
|
|
44
|
+
## Why
|
|
45
|
+
|
|
46
|
+
Once you run more than one or two coding agents, it gets hard to keep track of them. Some run in a terminal, some start subagents of their own, and they are spread over several projects and git worktrees. Each tool keeps its own logs in its own format, and none of them shows the whole picture.
|
|
47
|
+
|
|
48
|
+
Agent Office answers the questions you would otherwise answer by switching between terminals:
|
|
49
|
+
|
|
50
|
+
- Which agents are working right now, and on which project and branch?
|
|
51
|
+
- Which one is stuck, waiting for my input or a permission prompt, or has quietly failed?
|
|
52
|
+
- Who started which subagent?
|
|
53
|
+
- How many tokens did each model use today and in the last 5 hours?
|
|
54
|
+
- How much of my 5-hour and weekly limits is left, and at exactly what time do they reset?
|
|
55
|
+
|
|
56
|
+
It does this by reading the log files the tools already write. It changes nothing, needs no account and uses no tokens.
|
|
57
|
+
|
|
58
|
+
## Features
|
|
59
|
+
|
|
60
|
+
**Office view**
|
|
61
|
+
|
|
62
|
+
- **Workspaces.** Agents are grouped by the project they work in: the git repository (all worktrees of one repository together) or the plain folder. Each workspace header shows its path, the branches in use, and how many agents are working or stalled.
|
|
63
|
+
- **Accordion rows.** Workspace headers fold and unfold, and the choice is remembered. Each agent is one row; click it (or press Enter) to expand it in place and open its details on the right. Subagents fold under the agent that started them behind an "N subagents" button. Finished agents are hidden behind "Show N finished" so the list stays short.
|
|
64
|
+
- **Each row** shows a short label for what the agent works on, its state, the tool and model, the account signed in to that tool, a one-bar-per-minute activity strip for the last 30 minutes, how long it has run, and its tokens including subagents.
|
|
65
|
+
- **Details panel.** The full task, state with the reason ("quiet for 14 min", "waiting on 2 subagents"), folder, branch, start time, model calls and tokens, plus three tabs: a live activity log (prompts, tool calls with arguments, results and durations), the files the agent created or edited, and its last answer.
|
|
66
|
+
- **Topology.** A map above the list with one band per workspace. Lines show who started whom, and moving dots mark subagents that are working right now. It can be hidden with one click.
|
|
67
|
+
- **Search and filters.** Search matches label, task, tool, model, folder, branch, account and last action. Tool chips (shown when more than one tool has sessions) filter by tool, a time window selector shows the last 1 h, 6 h, 24 h or 7 days, and "Show finished" lists finished agents in every workspace.
|
|
68
|
+
- **Header counters.** Agents working, waiting and stalled, tokens used today, and tokens per minute over the last 5 minutes.
|
|
69
|
+
- **Pause** stops all updates until you resume.
|
|
70
|
+
|
|
71
|
+
**Studio**
|
|
72
|
+
|
|
73
|
+
An optional 3D view of the same data: one floor of an office building where every workspace is a glass-walled room off a central corridor and every active agent sits at a desk. Arcs over the desks show who started whom. Click a room or a desk to fly the camera there and open the agent's details, drag to orbit, scroll to zoom, and press Esc for the overview. The Studio code and the bundled three.js library are downloaded only when you open the Studio, and everything is released again when you leave it.
|
|
74
|
+
|
|
75
|
+
**Usage per vendor and model**
|
|
76
|
+
|
|
77
|
+
One card per model vendor (Claude, GPT, Gemini, and any other vendor that appears, such as Grok, Mistral, DeepSeek, Qwen or Llama). Each card shows tokens used today and in the last 7 days, a sparkline of the last 6 hours in 10-minute steps, and a row per model with its tokens in the last 5 hours and today and the tools that used it.
|
|
78
|
+
|
|
79
|
+
**Limits with exact reset times**
|
|
80
|
+
|
|
81
|
+
Each plan's windows are shown separately and labelled ("5-hour window", "Weekly", and per-model weekly windows where the tool reports them). Every window shows how much is left and the exact local reset time, for example "Resets today 23:51 (in 2h 14m)". When a tool does not report a reset time, the card says so instead of guessing. Windows that drop below the warning threshold (`quota_warn_pct`, default `10%`) are flagged as low so you can see the reset time before hitting a cap. See [Supported tools](#supported-tools) for what each tool reports.
|
|
82
|
+
|
|
83
|
+
**Notifications**
|
|
84
|
+
|
|
85
|
+
Optional browser notifications alert you when an agent stalls, fails, finishes, or when a quota window drops below `quota_warn_pct`, so you do not have to keep watching the tab.
|
|
86
|
+
|
|
87
|
+
**Reports and weekly charts**
|
|
88
|
+
|
|
89
|
+
A Reports view summarises the last 7 local calendar days:
|
|
90
|
+
|
|
91
|
+
- **Weekly usage charts.** Daily token totals over the last 7 days broken down by workspace, by model vendor, and for the top 12 root agents (with subagent trees rolled up).
|
|
92
|
+
- **Quota history.** Tracks the percentage left on each quota window over time (recorded at most once every 10 minutes, kept for 8 days). Saved to `~/.config/agent-office/quota-history.json` so it survives restarts (override with `history_file`, or set `"history": false` to keep it in memory only; never written in `--demo` mode).
|
|
93
|
+
- **Daily summary.** Pick any of the last 7 days to inspect tokens, agent states and workspaces for that day, or copy a ready-to-paste English Markdown summary.
|
|
94
|
+
|
|
95
|
+
**Open folder or terminal**
|
|
96
|
+
|
|
97
|
+
Open any agent's working folder in your system file manager or launch a terminal in that folder directly from the dashboard. Enabled by default; set `"allow_open": false` in the config to turn it off (and hide the buttons).
|
|
98
|
+
|
|
99
|
+
**Day and night themes**
|
|
100
|
+
|
|
101
|
+
The theme follows your system setting until you pick one with the theme button; the choice is then remembered.
|
|
102
|
+
|
|
103
|
+
**11 languages**
|
|
104
|
+
|
|
105
|
+
English, Español, Türkçe, 日本èª, 한êµì–´, 䏿–‡, Deutsch, Français, Português, РуÑÑкий and العربية (with a right-to-left layout). Dates, times and reset times use the selected language's format.
|
|
106
|
+
|
|
107
|
+
**Keyboard shortcuts**
|
|
108
|
+
|
|
109
|
+
| Key | Action |
|
|
110
|
+
|---|---|
|
|
111
|
+
| `/` | Focus the search box |
|
|
112
|
+
| `j` / `k` | Select the next / previous agent (Office view) |
|
|
113
|
+
| `Enter` or `Space` | Expand or collapse the focused agent row or workspace header |
|
|
114
|
+
| `Esc` | Close the details panel; in a text field, leave the field; in the Studio, fly back to the overview |
|
|
115
|
+
| `v` | Switch between Office and Studio |
|
|
116
|
+
| `Arrow Up` / `Arrow Down` | Move through the language menu while it is open |
|
|
117
|
+
|
|
118
|
+
**"How it works" dialog**
|
|
119
|
+
|
|
120
|
+
The question-mark button opens a short in-app explanation of where the data comes from, what the states mean, how usage and limits are counted, and what the app does and does not do with your data.
|
|
121
|
+
|
|
122
|
+
**Demo mode**
|
|
123
|
+
|
|
124
|
+
`agent-office --demo` runs on generated fictional data and touches no real files. Use it to try the interface, take screenshots or record a video without showing your own projects.
|
|
125
|
+
|
|
126
|
+
Your choices (theme, language, time window, "Show finished", folded workspaces, topology on or off) are stored in the browser's `localStorage`.
|
|
127
|
+
|
|
128
|
+
## Supported tools
|
|
129
|
+
|
|
130
|
+
Agent Office looks for each tool under your home folder: `~` below means `C:\Users\<you>` on Windows, `/Users/<you>` on macOS and `/home/<you>` on Linux. The relative paths are the same on all three systems. A tool whose folder does not exist is simply skipped.
|
|
131
|
+
|
|
132
|
+
| Tool | Logs it reads (default) | Override |
|
|
133
|
+
|---|---|---|
|
|
134
|
+
| Claude Code | `~/.claude/projects/<project>/<session>.jsonl`, subagents in `~/.claude/projects/<project>/<session>/subagents/agent-*.jsonl` (with `.meta.json`) | `CLAUDE_CONFIG_DIR` env var, or `providers.claude-code.root` |
|
|
135
|
+
| Codex | `~/.codex/sessions/YYYY/MM/DD/*.jsonl` | `CODEX_HOME` env var, or `providers.codex.home` |
|
|
136
|
+
| Gemini CLI | `~/.gemini/tmp/<project>/chats/*.json`, project folder from `~/.gemini/tmp/<project>/.project_root` | `providers.gemini-cli.root` |
|
|
137
|
+
| Antigravity | `~/.gemini/antigravity-cli/brain/<conversation>/.system_generated/logs/transcript.jsonl`, plus `subagents/` and `messages/` next to it | `AGY_BRAIN` env var, or `providers.antigravity.brain` |
|
|
138
|
+
|
|
139
|
+
On Windows the defaults are therefore `C:\Users\<you>\.claude\projects`, `C:\Users\<you>\.codex\sessions`, `C:\Users\<you>\.gemini\tmp` and `C:\Users\<you>\.gemini\antigravity-cli\brain`.
|
|
140
|
+
|
|
141
|
+
What is shown for each tool:
|
|
142
|
+
|
|
143
|
+
| | Claude Code | Codex | Gemini CLI | Antigravity |
|
|
144
|
+
|---|---|---|---|---|
|
|
145
|
+
| Sessions | Yes, with folder and git branch from the log | Yes, with folder and git branch from the log | Yes, folder from `.project_root` | Yes; the folder is inferred from the paths the agent touched |
|
|
146
|
+
| Subagents | Yes (`subagents/`) | Yes (sessions with a parent thread) | No | Yes, including subagents of subagents and the messages between them |
|
|
147
|
+
| Tokens | Input, cache writes, cache reads and output per model | Input, cached input and output | Input, cached input, output and thinking tokens | Input, cache reads and output per step |
|
|
148
|
+
| Signed-in account | `~/.claude.json` (display name) | `~/.codex/auth.json` (email from the sign-in token, or "API key") | `~/.gemini/google_accounts.json` | `~/.gemini/google_accounts.json` |
|
|
149
|
+
| Limits | Off by default (see below) | 5-hour and weekly windows with exact reset times | Not reported by Gemini CLI | From `agy usage` |
|
|
150
|
+
| Files written | Yes | No | No | Yes, plus the commands it ran |
|
|
151
|
+
|
|
152
|
+
**Limits in detail**
|
|
153
|
+
|
|
154
|
+
- **Claude Code** does not store your plan's limits on disk. Without configuration, a limit is shown only when a request in the logs was rejected for reaching it; that window then shows "Limit reached" with its reset time, until later requests succeed again. To see both windows all the time, turn on the usage check with `"quota": "oauth"` (see [Configuration](#configuration) and [Privacy and cost](#privacy-and-cost)). It then also shows the separate weekly Opus and Sonnet windows when Anthropic reports them.
|
|
155
|
+
- **Codex** writes its own rate-limit report (both windows, percentage used and reset time) into every `token_count` event. Agent Office uses the newest one.
|
|
156
|
+
- **Gemini CLI** does not record limits, so none are shown.
|
|
157
|
+
- **Antigravity** limits come from running `agy usage` locally, at most once a minute, in the background. Each quota group (for example a pool shared by several model vendors) gets its own card.
|
|
158
|
+
|
|
159
|
+
**Antigravity job runners**
|
|
160
|
+
|
|
161
|
+
If you drive Antigravity through a job runner that writes one folder per job, Agent Office can list those jobs too, including jobs that have not produced a transcript yet. Point `providers.antigravity.runs` at the folder. Each job folder is named `<yyyymmdd>-<hhmmss>-<agent>` and may contain `status.json` (with a `state` of `running`, `done`, `failed` or `stalled`, and a `note`), `run.json` (with the `conversation_id`), `task.md`, `response.md`, `stderr.log` and `events.log`. The runner's reported state takes priority over the state derived from the log.
|
|
162
|
+
|
|
163
|
+
## Requirements and install
|
|
164
|
+
|
|
165
|
+
**Step by step**
|
|
166
|
+
|
|
167
|
+
1. Install [Node.js](https://nodejs.org/) 18 or newer, then check it in a terminal:
|
|
168
|
+
```sh
|
|
169
|
+
node -v # v18.0.0 or newer
|
|
170
|
+
```
|
|
171
|
+
2. Start Agent Office with one command (npm downloads it the first time and asks you to confirm):
|
|
172
|
+
```sh
|
|
173
|
+
npx @zaferyalcin/agent-office
|
|
174
|
+
```
|
|
175
|
+
or install it once and start it by name afterwards:
|
|
176
|
+
```sh
|
|
177
|
+
npm install -g @zaferyalcin/agent-office
|
|
178
|
+
agent-office --open
|
|
179
|
+
```
|
|
180
|
+
or clone the repository and run it from the checkout:
|
|
181
|
+
```sh
|
|
182
|
+
git clone https://github.com/zaferyalcin/agent-office.git
|
|
183
|
+
cd agent-office
|
|
184
|
+
node bin/agent-office.js --open
|
|
185
|
+
```
|
|
186
|
+
3. Your browser opens <http://127.0.0.1:4777/>. Agents you ran recently with Claude Code, Codex, Gemini CLI or Antigravity show up by themselves; there is nothing to sign in to or set up.
|
|
187
|
+
4. No agents yet, or just looking? Add `--demo` to either command to see it full of fictional data.
|
|
188
|
+
5. Optional: turn on the bell for notifications, and copy `agent-office.config.example.json` to `agent-office.config.json` to change the port, the quota warning level or which tools are read (see [Configuration](#configuration)).
|
|
189
|
+
6. Stop it with `Ctrl+C` in the terminal.
|
|
190
|
+
7. Updating: when a new version is out, a small notice at the top of the dashboard says so. `npx @zaferyalcin/agent-office@latest` always runs the newest version, `npm install -g @zaferyalcin/agent-office@latest` updates a global install, and `git pull` updates a checkout.
|
|
191
|
+
|
|
192
|
+
**Requirements**
|
|
193
|
+
|
|
194
|
+
- **Node.js 18 or newer** (`"engines": { "node": ">=18" }`).
|
|
195
|
+
- **No dependencies.** There is no `npm install` step and no build step. The only third-party code is three.js for the Studio, which is bundled in `public/vendor/three/` and loaded by the browser only when the Studio opens.
|
|
196
|
+
- A browser. The Studio additionally needs WebGL.
|
|
197
|
+
|
|
198
|
+
**Run without installing (npx)**
|
|
199
|
+
|
|
200
|
+
```sh
|
|
201
|
+
npx @zaferyalcin/agent-office # the latest version from npm
|
|
202
|
+
npx @zaferyalcin/agent-office --demo # fictional data, touches no real files
|
|
203
|
+
npx github:zaferyalcin/agent-office # straight from the main branch on GitHub
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
When invoked through `npx`, the browser opens automatically; pass `--no-open` to stay headless.
|
|
207
|
+
|
|
208
|
+
**Clone and run**
|
|
209
|
+
|
|
210
|
+
```sh
|
|
211
|
+
git clone https://github.com/zaferyalcin/agent-office.git
|
|
212
|
+
cd agent-office
|
|
213
|
+
node bin/agent-office.js --open
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
The dashboard is at <http://127.0.0.1:4777/>. `npm start` does the same as `node bin/agent-office.js`.
|
|
217
|
+
|
|
218
|
+
**Global install from the repository**
|
|
219
|
+
|
|
220
|
+
```sh
|
|
221
|
+
cd agent-office
|
|
222
|
+
npm install -g .
|
|
223
|
+
agent-office --open
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Windows helper**
|
|
227
|
+
|
|
228
|
+
```powershell
|
|
229
|
+
.\start.ps1 # start the server in a minimized window (if it is not already running), then open the browser
|
|
230
|
+
.\start.ps1 -NoBrowser # only make sure the server is running
|
|
231
|
+
.\start.ps1 -Restart # stop whatever listens on the port first, then start
|
|
232
|
+
.\start.ps1 -Port 4800 # use another port
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
`start.ps1` checks that `node` is on your `PATH`, waits until the server answers, and tells you where to look if it does not. Close the minimized window to stop the server.
|
|
236
|
+
|
|
237
|
+
**Command line options**
|
|
238
|
+
|
|
239
|
+
```text
|
|
240
|
+
Usage: agent-office [options]
|
|
241
|
+
--port N port to listen on (default 4777, or AO_PORT)
|
|
242
|
+
--host H address to bind (default 127.0.0.1)
|
|
243
|
+
--config FILE config file (default: ./agent-office.config.json, then ~/.config/agent-office/config.json)
|
|
244
|
+
--open open the dashboard in the browser (default when started via npx)
|
|
245
|
+
--no-open do not open the browser automatically
|
|
246
|
+
--once print what was found and exit
|
|
247
|
+
--demo run on generated fictional data; touches no real files
|
|
248
|
+
-v, --version print the version and exit
|
|
249
|
+
-h, --help show this help
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
`--once` is the quickest way to check your setup. It prints which tools were found and how many sessions each has, then every workspace with the agents active in the last 6 hours (state, tool, model and task), and exits.
|
|
253
|
+
|
|
254
|
+
## Configuration
|
|
255
|
+
|
|
256
|
+
Everything works without a config file. If you want one, Agent Office uses the first of these that exists:
|
|
257
|
+
|
|
258
|
+
1. The file given with `--config FILE`. It must exist and contain a JSON object, otherwise the program exits with an error.
|
|
259
|
+
2. `agent-office.config.json` in the current folder (this name is in `.gitignore`).
|
|
260
|
+
3. `~/.config/agent-office/config.json` (on Windows `C:\Users\<you>\.config\agent-office\config.json`).
|
|
261
|
+
|
|
262
|
+
A config file that exists but is not valid JSON stops the program with an error naming the file, so a typo never goes unnoticed. The file in use is printed at startup. [`agent-office.config.example.json`](agent-office.config.example.json) lists the common options with their defaults.
|
|
263
|
+
|
|
264
|
+
**Example**
|
|
265
|
+
|
|
266
|
+
```json
|
|
267
|
+
{
|
|
268
|
+
"port": 4777,
|
|
269
|
+
"host": "127.0.0.1",
|
|
270
|
+
"providers": {
|
|
271
|
+
"claude-code": { "quota": "oauth" },
|
|
272
|
+
"codex": { "home": "D:/tools/codex" },
|
|
273
|
+
"gemini-cli": { "enabled": false },
|
|
274
|
+
"antigravity": { "runs": "C:/work/agy-out" }
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
**Options**
|
|
280
|
+
|
|
281
|
+
| Option | Default | Meaning |
|
|
282
|
+
|---|---|---|
|
|
283
|
+
| `port` | `4777` | Port to listen on. Order: `--port`, then `AO_PORT`, then `port`, then 4777. |
|
|
284
|
+
| `host` | `127.0.0.1` | Address to bind. Order: `--host`, then `host`. Keep the default unless you know you need something else (see [Privacy and cost](#privacy-and-cost)). |
|
|
285
|
+
| `allow_open` | `true` | `false` disables `POST /api/open` (opening an agent's folder or terminal). |
|
|
286
|
+
| `history` | `true` | `false` disables writing quota history to disk (keeps it in memory only). |
|
|
287
|
+
| `history_file` | `~/.config/agent-office/quota-history.json` | Custom path for persisted 8-day quota history JSON. |
|
|
288
|
+
| `quota_warn_pct` | `10` | Percentage threshold below which a quota window is flagged as `low`. |
|
|
289
|
+
| `update_check` | `true` | `false` stops the check for new versions. Same as `AO_NO_UPDATE_CHECK=1`. Always off in `--demo` mode. |
|
|
290
|
+
| `providers.<id>.enabled` | `true` | `false` turns that tool's reader off completely. Ids: `claude-code`, `codex`, `gemini-cli`, `antigravity`. |
|
|
291
|
+
| `providers.claude-code.root` | `~/.claude/projects` | Folder with Claude Code's project logs. |
|
|
292
|
+
| `providers.claude-code.quota` | `"off"` | `"oauth"` turns on the Claude usage check (both windows with reset times). Same as `AO_CLAUDE_QUOTA=oauth`. |
|
|
293
|
+
| `providers.codex.home` | `$CODEX_HOME` or `~/.codex` | Codex home folder; sessions are read from its `sessions/` subfolder. |
|
|
294
|
+
| `providers.gemini-cli.root` | `~/.gemini/tmp` | Gemini CLI's per-project folder. |
|
|
295
|
+
| `providers.antigravity.brain` | `$AGY_BRAIN` or `~/.gemini/antigravity-cli/brain` | Antigravity's conversation folder. |
|
|
296
|
+
| `providers.antigravity.runs` | `$AO_AGY_RUNS`, else `$AGY_OUT`, else none | Folder of job-runner job folders. `""` turns runner scanning off even when one of the environment variables is set. |
|
|
297
|
+
| `providers.antigravity.quota` | on | `false` stops Agent Office from running `agy usage` (no Antigravity limits). Same as `AGY_NO_USAGE=1`. |
|
|
298
|
+
|
|
299
|
+
The command used for Antigravity limits is `agy usage`. It can be changed only with the `AGY_USAGE_CMD` environment variable, not in the config file. It must print one limit per line as tab-separated `group`, `limit name`, `percent left` and (optionally) `reset time`.
|
|
300
|
+
|
|
301
|
+
**Environment variables**
|
|
302
|
+
|
|
303
|
+
| Variable | Meaning |
|
|
304
|
+
|---|---|
|
|
305
|
+
| `AO_PORT` | Port, used when `--port` is not given. |
|
|
306
|
+
| `AO_CLAUDE_QUOTA=oauth` | Turns on the Claude usage check. |
|
|
307
|
+
| `AO_ABANDON_MIN` | Minutes of silence after which an unfinished one-shot agent counts as failed instead of stalled (default 90). Applies to Claude Code, Codex and Gemini CLI. |
|
|
308
|
+
| `CLAUDE_CONFIG_DIR` | Claude Code's config folder (instead of `~/.claude`). The account is then read from `$CLAUDE_CONFIG_DIR/.claude.json`. |
|
|
309
|
+
| `CODEX_HOME` | Codex home folder (instead of `~/.codex`). |
|
|
310
|
+
| `AGY_BRAIN` | Antigravity conversation folder. |
|
|
311
|
+
| `AO_AGY_RUNS`, `AGY_OUT` | Antigravity job-runner folder (the first one set wins). |
|
|
312
|
+
| `AGY_USAGE_CMD` | Command for Antigravity limits (default `agy usage`). |
|
|
313
|
+
| `AGY_NO_USAGE=1` | Never run the Antigravity usage command. |
|
|
314
|
+
| `AGY_ABANDON_MIN` | Same as `AO_ABANDON_MIN`, for Antigravity (default 90). |
|
|
315
|
+
|
|
316
|
+
## How it works
|
|
317
|
+
|
|
318
|
+
**Polling.** The page asks the local server for a fresh state every 3 seconds while the tab is visible, and for the open agent's activity log every 5 seconds. The server scans the logs when it is asked and reuses the result for 1.5 seconds, so several open tabs do not multiply the work. When no tab is open, or the tab is hidden or paused, nothing is scanned.
|
|
319
|
+
|
|
320
|
+
**Incremental reading.** Claude Code, Codex and Antigravity write append-only JSONL logs. Each file is opened once and then only the bytes added since the last read are parsed; a half-written last line is kept and finished on the next read. If a file shrinks (it was rewritten), it is read again from the start. Only compact facts are kept in memory: timestamps, the first prompt, the last action, token counts per model and a rolling list of token samples. For very large logs the first read covers only the end of the file (the last 24 MB for Claude Code and Codex; the first 256 KB plus the last 5 MB for Antigravity), and the details panel says so. Claude Code's large bookkeeping records and very long tool-result lines are skipped without being decoded. Gemini CLI rewrites one JSON file per chat, so a chat file is parsed again only when its size or modification time changes, and files over 32 MB are skipped. Sessions not touched in the last 8 days are not read at all.
|
|
321
|
+
|
|
322
|
+
**Workspaces.** Every agent's working folder is turned into a workspace:
|
|
323
|
+
|
|
324
|
+
- Agent Office walks up from the folder looking for `.git`. If it finds a repository, the workspace is that repository and the branch is read from its `HEAD`.
|
|
325
|
+
- A `.git` file that points into `<repo>/.git/worktrees/<name>` marks a worktree. Worktrees are grouped with their main repository, and each agent row keeps its own branch.
|
|
326
|
+
- A folder outside any repository is its own workspace, unless it is a subfolder of another workspace's folder; then it joins that one. Your home folder and drive roots never absorb other folders.
|
|
327
|
+
- A subagent without its own folder sits with the agent that started it.
|
|
328
|
+
- Antigravity does not log a working folder, so it is inferred from the absolute paths the agent read, wrote or mentioned in its first prompt. Folders inside a git repository count five times as much as loose folders, and the tools' own folders (`.gemini`, `.claude`, `.codex`, `.cursor`, `AppData`) are ignored.
|
|
329
|
+
- Agents with no folder at all are listed under "Unknown folder".
|
|
330
|
+
|
|
331
|
+
Workspaces with working agents come first, then the most recently active.
|
|
332
|
+
|
|
333
|
+
**States.** Each reader reports how the log ends: a final answer, a finished turn that waits for you, a tool call still running, an error, a stop by the user, or nothing special (mid-turn). That, plus the time since the last activity, gives the state. The first rule that matches wins:
|
|
334
|
+
|
|
335
|
+
| State | Rule |
|
|
336
|
+
|---|---|
|
|
337
|
+
| (job runner) | A runner's reported `failed`, `stalled` or `done` is used as is. |
|
|
338
|
+
| Finished | Stopped by the user, or gave its final answer. |
|
|
339
|
+
| Waiting / Finished | Finished its turn and waits for input: **Waiting** for up to 10 minutes, then **Finished**. |
|
|
340
|
+
| Failed | The last thing logged is an error and nothing happened for more than 2 minutes. |
|
|
341
|
+
| Working | Any activity in the last minute. |
|
|
342
|
+
| Working | A tool call is still running and is less than 30 minutes old. |
|
|
343
|
+
| Waiting | Quiet for 1 to 10 minutes. |
|
|
344
|
+
| Stalled | Quiet for 10 to 90 minutes (`AO_ABANDON_MIN`) without finishing. It may be stuck or waiting for a permission prompt. |
|
|
345
|
+
| Finished | An interactive session quiet for longer than that. |
|
|
346
|
+
| Failed | A one-shot agent (subagent or job) quiet for longer than that without a final answer: abandoned. |
|
|
347
|
+
|
|
348
|
+
A subagent that finishes its turn counts as having given its final answer. A parent that has already answered but still has working or waiting subagents is shown as working (or waiting) "on N subagents". Antigravity uses the same time thresholds, applied to its own step types (`AGY_ABANDON_MIN` instead of `AO_ABANDON_MIN`); an Antigravity agent that goes silent for longer than that without a final answer always counts as failed.
|
|
349
|
+
|
|
350
|
+
**Tokens.** All token numbers come from the usage each tool writes into its own log, so they cover this computer only. Claude Code usage is counted once per API message (one message can span several log lines). "Input" includes cache writes; cache reads are counted separately and are part of the totals. A row's token number includes its subagents. Tokens per minute are averaged over the last 5 minutes. The model shown for an agent is the one that produced most of its output tokens. Model names are sorted into vendors by name (`claude`, `opus`, `sonnet` and `haiku` are Claude; `gpt`, `o1`/`o3`/... and `codex` are GPT; `gemini` and `gemma` are Gemini; unknown names get an "Other models" card).
|
|
351
|
+
|
|
352
|
+
**Limits.** See [Limits in detail](#supported-tools). Reset times are converted to your local time zone in the browser.
|
|
353
|
+
|
|
354
|
+
**Labels.** The name on each row says what the agent works on, not which tool it is:
|
|
355
|
+
|
|
356
|
+
- A task that points to a task file such as `C:\work\agy-out\characters-ual\TASK.md` is named after the folder of that file (`characters-ual`). A suffix on the file name is added: `asset-library\TASK-GALLERY.md` becomes `asset-library gallery`. `TASK`, `TASKS`, `BRIEF`, `PLAN` and `SPEC` files are recognised.
|
|
357
|
+
- Subagents keep their own name or type (for example `gem-coder` or `Explore`).
|
|
358
|
+
- Anything else gets the first seven words of its task, with file paths and leading words like "please" or "read" removed.
|
|
359
|
+
- With no task text at all, the branch name or the tool name is used.
|
|
360
|
+
|
|
361
|
+
Claude Code sessions that have a title (set by you or generated by Claude Code) use it as their task.
|
|
362
|
+
|
|
363
|
+
## Privacy and cost
|
|
364
|
+
|
|
365
|
+
- **Read-only toward your tools.** Agent Office never modifies your projects or the tools' logs and settings. The only file it writes is `~/.config/agent-office/quota-history.json` (at most once every 10 minutes, skipped when `"history": false` or in `--demo` mode).
|
|
366
|
+
- **Guarded open action.** Every route except `POST /api/open` is `GET`/`HEAD` only (`405` otherwise). `POST /api/open` (opening a folder or terminal) is protected by the `Host`-header guard, requires `X-Agent-Office: 1` and `Content-Type: application/json` (4 KB max body), ignores any path sent by the client (it only resolves the session's own `cwd` or workspace path and verifies the folder exists), launches the OS command directly without a shell string, and can be disabled completely with `"allow_open": false`.
|
|
367
|
+
- **Local only.** The server binds to `127.0.0.1` by default, so nothing outside your computer can reach it.
|
|
368
|
+
- **Host-header guard.** When bound to `127.0.0.1`, the server rejects any request whose `Host` header is not `127.0.0.1:<port>` or `localhost:<port>`. This blocks DNS-rebinding attacks, where a web page you visit tries to reach local servers through its own domain name. Static files are served only from `public/`. If you bind to another address with `--host`, this guard is off and anyone who can reach that address can see your agents' tasks and logs, so do that only on a network you trust.
|
|
369
|
+
- **No telemetry, no tokens.** Agent Office sends no analytics and never calls a model.
|
|
370
|
+
- **Update check.** Shortly after start and then every 12 hours, Agent Office asks GitHub (`api.github.com/repos/zaferyalcin/agent-office/releases/latest`, falling back to `registry.npmjs.org/@zaferyalcin/agent-office/latest`) for the newest version number. It is an anonymous GET that sends nothing about you or your agents; when it fails it is silently skipped. Turn it off with `"update_check": false` or `AO_NO_UPDATE_CHECK=1`.
|
|
371
|
+
- **The Claude usage check is optional and off by default.** With `"quota": "oauth"` for Claude Code, Agent Office asks Anthropic's usage endpoint (`https://api.anthropic.com/api/oauth/usage`) about every 5 minutes, using the sign-in Claude Code saved in `~/.claude/.credentials.json`, to show Claude's 5-hour and weekly limits. The token is sent only to that endpoint and is never stored or shown. On macOS, Claude Code keeps the sign-in in the Keychain, which Agent Office does not read, so this check does not work there.
|
|
372
|
+
- **Antigravity limits** come from running `agy usage` on your computer. Agent Office makes no network request for them itself.
|
|
373
|
+
- **Small footprint.** The server keeps only compact facts per session, reads only what changed, skips sessions older than 8 days, and does no work while no visible tab is asking. The page uses no framework. The Studio, including three.js, is downloaded only when you open it and is fully released when you switch back to Office. While open it uses no shadows or post-processing, caps the pixel ratio at 1.25, and draws a frame only when something moves, at most 30 frames per second.
|
|
374
|
+
|
|
375
|
+
## Troubleshooting
|
|
376
|
+
|
|
377
|
+
**No agents found.** Run `node bin/agent-office.js --once`. It lists each tool as `+ found` or `- not found`.
|
|
378
|
+
|
|
379
|
+
- `- not found` means the default folder does not exist. If the tool keeps its data elsewhere, set the matching option or variable (`CLAUDE_CONFIG_DIR`, `CODEX_HOME`, `AGY_BRAIN`, or `root`/`home`/`brain` in the config).
|
|
380
|
+
- Found, but `0 sessions`: only sessions touched in the last 8 days are read. Start the tool, send a prompt, and the agent appears within a few seconds.
|
|
381
|
+
- An agent is listed in `--once` but not in the page: check the search box, the tool chips and the time window, or tick "Show finished".
|
|
382
|
+
- A reader that throws an error is shown in a notice above the workspaces and printed in the server console.
|
|
383
|
+
|
|
384
|
+
**Agents are grouped under the wrong folder.**
|
|
385
|
+
|
|
386
|
+
- Workspaces follow git: everything inside one repository, including its worktrees, is one workspace. If you want two projects apart, they need to be separate repositories (or separate folders outside any repository).
|
|
387
|
+
- A loose folder inside another workspace's folder joins that workspace. Your home folder and drive roots never absorb anything.
|
|
388
|
+
- Gemini CLI agents land under "Unknown folder" when Gemini CLI wrote no `.project_root` for the project.
|
|
389
|
+
- Antigravity's folder is a best guess from the paths it touched. An agent that only worked with files in several projects is put under the one it touched most, with git repositories weighted higher. Mentioning the project folder in the first prompt helps.
|
|
390
|
+
- Workspace lookups are cached for 15 seconds, so a freshly created repository or worktree may take a moment to be picked up.
|
|
391
|
+
|
|
392
|
+
**Limits are not shown.**
|
|
393
|
+
|
|
394
|
+
- Claude Code: the card says "Claude Code does not write this to its local files" until you set `"quota": "oauth"`. With it on, "no local sign-in found" means `~/.claude/.credentials.json` is missing (always the case on macOS); "usage check failed (401)" usually means the saved sign-in expired, so open Claude Code once to refresh it.
|
|
395
|
+
- Codex: limits appear after the first model response in a session from the last 8 days, because they come from Codex's own `token_count` events.
|
|
396
|
+
- Gemini CLI: Gemini CLI does not record limits.
|
|
397
|
+
- Antigravity: `agy` must be on the `PATH` of the process that runs Agent Office (or set `AGY_USAGE_CMD`). The card shows the error from the last attempt. Make sure `AGY_NO_USAGE` is not set and `providers.antigravity.quota` is not `false`. "Not started yet, full" means the window has not started counting.
|
|
398
|
+
|
|
399
|
+
**Port already in use.** The server prints `Port 4777 is busy. Agent Office may already be running at http://127.0.0.1:4777/` and exits. Open that address, or pick another port with `--port 4800` or `AO_PORT=4800`. On Windows, `.\start.ps1 -Restart` stops whatever listens on the port and starts a fresh server.
|
|
400
|
+
|
|
401
|
+
**The page says "Server not answering".** The server process stopped. Start it again; the page reconnects by itself.
|
|
402
|
+
|
|
403
|
+
**The Studio says it needs WebGL.** The browser has WebGL turned off or unavailable (some remote desktops, virtual machines, or hardware acceleration disabled in the browser settings). Turn on hardware acceleration or use another browser. The Office view shows the same data and does not need WebGL.
|
|
404
|
+
|
|
405
|
+
**`403 bad host` in the browser.** Open the dashboard as `http://127.0.0.1:<port>/` or `http://localhost:<port>/`. Other host names are rejected on purpose (see the host-header guard above).
|
|
406
|
+
|
|
407
|
+
## Development
|
|
408
|
+
|
|
409
|
+
**Project layout**
|
|
410
|
+
|
|
411
|
+
```text
|
|
412
|
+
bin/agent-office.js command line entry point (options, --once, starts the server)
|
|
413
|
+
src/server.js HTTP server, config loading, host guard, static files, JSON API
|
|
414
|
+
src/collector.js runs the providers, builds the shared state, history, reports, workspaces, usage and labels
|
|
415
|
+
src/history.js rolling 8-day quota history with throttled JSON persistence
|
|
416
|
+
src/open.js platform launcher for opening an agent's folder or terminal
|
|
417
|
+
src/state.js state rules shared by all tools
|
|
418
|
+
src/workspace.js folder -> git repository / worktree / branch, and folder guessing
|
|
419
|
+
src/util.js incremental JSONL reader, token samples, vendor detection, file helpers
|
|
420
|
+
src/providers/
|
|
421
|
+
claude-code.js Claude Code reader and the optional usage check
|
|
422
|
+
codex.js Codex reader
|
|
423
|
+
gemini-cli.js Gemini CLI reader
|
|
424
|
+
antigravity.js Antigravity adapter onto the shared session shape
|
|
425
|
+
antigravity-core.js Antigravity transcript, subagent, job-runner and `agy usage` reader
|
|
426
|
+
public/
|
|
427
|
+
index.html, app.css page and styles
|
|
428
|
+
app.js Office view (no framework, no build step)
|
|
429
|
+
i18n.js UI strings for all 11 languages
|
|
430
|
+
studio.js Studio view, loaded on demand
|
|
431
|
+
vendor/three/ bundled three.js (MIT)
|
|
432
|
+
test/ tests for node:test
|
|
433
|
+
start.ps1 Windows helper
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
The server exposes these endpoints, used by the page:
|
|
437
|
+
|
|
438
|
+
- `GET /api/state`: the whole state (providers, sessions, workspaces, usage, quotas with `low` warnings, totals, `can_open`, `quota_warn_pct`).
|
|
439
|
+
- `GET /api/history`: 7-day local-date usage breakdown (`by_workspace`, `by_vendor`, `top_agents`) and quota window history (`quota`).
|
|
440
|
+
- `GET /api/report?day=YYYY-MM-DD`: daily summary and Markdown export for today (default) or any of the last 7 local days (`400` otherwise).
|
|
441
|
+
- `GET /api/trace/<id>?limit=30`: the activity log, files and result for one agent (`limit=all` for everything).
|
|
442
|
+
- `GET /api/trace/<id>?expand=<step>`: the full text of one step (Antigravity).
|
|
443
|
+
- `POST /api/open`: open a session's folder or a terminal there (`X-Agent-Office: 1`, `Content-Type: application/json`, body `{ "id", "what": "folder" | "terminal" }`; disabled when `allow_open: false`).
|
|
444
|
+
|
|
445
|
+
**Running tests**
|
|
446
|
+
|
|
447
|
+
```sh
|
|
448
|
+
npm test
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
This runs `node --test test/` with Node's built-in test runner, so no install is needed. The server tests run against an empty temporary config and do not read your real logs; keep new tests the same way.
|
|
452
|
+
|
|
453
|
+
**Adding a provider**
|
|
454
|
+
|
|
455
|
+
Each tool is one file in `src/providers/` and is registered in the `PROVIDERS` map in `src/collector.js`. The constructor receives that tool's section of the config (`providers.<id>`) and sets `id` and `label`. Then implement:
|
|
456
|
+
|
|
457
|
+
| Method | Returns |
|
|
458
|
+
|---|---|
|
|
459
|
+
| `available()` | `true` when the tool's log folder exists. Called before every scan, so keep it cheap. |
|
|
460
|
+
| `scan(now, windowMs)` | An array of sessions touched since `now - windowMs`, in the shared shape below. Keep per-file state between calls and read incrementally (`JsonlTail` in `src/util.js` does this for JSONL). |
|
|
461
|
+
| `quotas(now)` | An array of limit cards, or `[]`. Each card: `{ id, tool, label, vendors, windows, checked }`, where each window is `{ window: '5h' \| 'week' \| 'day' \| 'other', label, left_pct, resets_at, note }`. Do slow work (network, commands) asynchronously and return the last result. |
|
|
462
|
+
| `trace(id, limit)` | Details for one session: `{ rows, total, task_full, result, files, commands, messages }`, or `null` if unknown. |
|
|
463
|
+
|
|
464
|
+
A session has at least: `id` (with a short provider prefix, for example `cx:`; add it to `prefixOf()` in `src/collector.js`), `provider`, `tool`, `kind` (`'session'` or `'subagent'`), `parent`, `name`, `role`, `task`, `cwd`, `branch`, `client`, `user`, `account`, `started`, `last`, `steps`, `model`, `models`, `tokens: { in, cache, out }`, `end` (`'final'`, `'turn'`, `'tool'`, `'error'`, `'canceled'` or `''`), `interactive`, `last_action` and `samples` (a `Samples` instance from `src/util.js`). The collector derives the state, workspace, label, activity strip and roll-ups. `src/providers/codex.js` is a compact example.
|
|
465
|
+
|
|
466
|
+
### Releasing a new version
|
|
467
|
+
|
|
468
|
+
1. Bump `version` in `package.json` (for example `npm version minor --no-git-tag-version`) and commit.
|
|
469
|
+
2. Tag it and push: `git tag v0.2.0 && git push origin main --tags`.
|
|
470
|
+
3. Publish to npm: `npm publish` (runs the tests first through `prepublishOnly`).
|
|
471
|
+
4. Create a GitHub release for the tag with short notes. Running dashboards compare their version with the latest release and show the update notice.
|
|
472
|
+
|
|
473
|
+
## License and contributing
|
|
474
|
+
|
|
475
|
+
MIT. See [LICENSE](LICENSE). The bundled three.js is also MIT licensed (`public/vendor/three/LICENSE`).
|
|
476
|
+
|
|
477
|
+
Contributions are welcome. Please keep the project's ground rules: no runtime dependencies and no build step, read-only access to the tools' files, no network requests unless the user opts in, and every new UI string added to all languages in `public/i18n.js`. Add or update tests in `test/` and run `npm test` before opening a pull request. For a new tool, a short description of where it keeps its logs and a small anonymised sample log help a lot.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
// agent-office [--port N] [--host H] [--config FILE] [--open] [--no-open] [--once] [--demo] [--version]
|
|
4
|
+
const argv = process.argv.slice(2);
|
|
5
|
+
const opt = (f) => { const i = argv.indexOf(f); return i >= 0 ? argv[i + 1] : undefined; };
|
|
6
|
+
|
|
7
|
+
if (argv.includes('--version') || argv.includes('-v')) {
|
|
8
|
+
console.log(require('../package.json').version);
|
|
9
|
+
process.exit(0);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (argv.includes('--help') || argv.includes('-h')) {
|
|
13
|
+
console.log(`Agent Office: a local dashboard for the coding agents running on this computer.
|
|
14
|
+
|
|
15
|
+
Usage: agent-office [options]
|
|
16
|
+
--port N port to listen on (default 4777, or AO_PORT)
|
|
17
|
+
--host H address to bind (default 127.0.0.1)
|
|
18
|
+
--config FILE config file (default: ./agent-office.config.json, then ~/.config/agent-office/config.json)
|
|
19
|
+
--open open the dashboard in the browser (default when started via npx)
|
|
20
|
+
--no-open do not open the browser automatically
|
|
21
|
+
--once print what was found and exit
|
|
22
|
+
--demo run with generated fictional data (or AO_DEMO=1)
|
|
23
|
+
-v, --version print the version and exit
|
|
24
|
+
-h, --help show this help`);
|
|
25
|
+
process.exit(0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const hasConfig = argv.includes('--config');
|
|
29
|
+
const configArg = opt('--config');
|
|
30
|
+
const demoFlag = argv.includes('--demo');
|
|
31
|
+
if (hasConfig && !configArg) {
|
|
32
|
+
console.error('Error: --config requires a file path');
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (argv.includes('--once')) {
|
|
37
|
+
const { Collector } = require('../src/collector');
|
|
38
|
+
const { loadConfig, isDemoEnv } = require('../src/server');
|
|
39
|
+
const demo = demoFlag || isDemoEnv();
|
|
40
|
+
let cfg;
|
|
41
|
+
try { cfg = demo && !hasConfig ? { demo: true } : loadConfig(configArg); }
|
|
42
|
+
catch (e) { console.error('Error: ' + ((e && e.message) || e)); process.exit(1); }
|
|
43
|
+
if (demo) cfg = { ...cfg, demo: true };
|
|
44
|
+
const s = new Collector(cfg).collect();
|
|
45
|
+
if (s.demo) console.log('[demo mode — fictional data]');
|
|
46
|
+
for (const p of s.providers) console.log((p.available ? '+ ' : '- ') + p.label + (p.available ? ' ' + p.sessions + ' sessions' : ' not found'));
|
|
47
|
+
for (const w of s.workspaces) {
|
|
48
|
+
console.log('\n' + w.name + (w.path ? ' ' + w.path : ''));
|
|
49
|
+
for (const a of s.sessions.filter((x) => (x.workspace || '~') === w.id && s.now - x.last < 6 * 3600e3)) {
|
|
50
|
+
console.log(' ' + a.state.padEnd(8) + ' ' + a.tool.padEnd(12) + ' ' + String(a.model || '').padEnd(22) + ' ' + String(a.task).slice(0, 70));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
process.exit(0);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const fromNpx = process.env.npm_command === 'exec';
|
|
57
|
+
const shouldOpen = !argv.includes('--no-open') && (argv.includes('--open') || fromNpx);
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
require('../src/server').serve({ port: opt('--port'), host: opt('--host'), config: configArg, open: shouldOpen, demo: demoFlag });
|
|
61
|
+
} catch (e) {
|
|
62
|
+
console.error('Error: ' + ((e && e.message) || e));
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zaferyalcin/agent-office",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A local dashboard for the coding agents running on your computer: Claude Code, Codex, Gemini CLI and Antigravity.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/zaferyalcin/agent-office.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/zaferyalcin/agent-office#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/zaferyalcin/agent-office/issues"
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"agent-office": "bin/agent-office.js"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": { "access": "public" },
|
|
18
|
+
"main": "src/collector.js",
|
|
19
|
+
"files": ["bin", "src", "public", "README.md", "LICENSE"],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"start": "node bin/agent-office.js",
|
|
22
|
+
"test": "node --test test/",
|
|
23
|
+
"prepublishOnly": "node --test test/"
|
|
24
|
+
},
|
|
25
|
+
"engines": { "node": ">=18" },
|
|
26
|
+
"keywords": ["claude-code", "codex", "gemini-cli", "antigravity", "agents", "dashboard", "monitor", "usage"]
|
|
27
|
+
}
|