@antondanv/brainyard 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/CHANGELOG.md +128 -0
  2. package/README.md +334 -105
  3. package/dist/ask.d.ts.map +1 -1
  4. package/dist/ask.js +23 -0
  5. package/dist/ask.js.map +1 -1
  6. package/dist/brains/adapter.d.ts +16 -2
  7. package/dist/brains/adapter.d.ts.map +1 -1
  8. package/dist/brains/adapter.js.map +1 -1
  9. package/dist/brains/index.d.ts.map +1 -1
  10. package/dist/brains/index.js +2 -1
  11. package/dist/brains/index.js.map +1 -1
  12. package/dist/brains/info.d.ts.map +1 -1
  13. package/dist/brains/info.js +22 -0
  14. package/dist/brains/info.js.map +1 -1
  15. package/dist/brains/opencode-bridge.d.ts +2 -0
  16. package/dist/brains/opencode-bridge.d.ts.map +1 -0
  17. package/dist/brains/opencode-bridge.js +332 -0
  18. package/dist/brains/opencode-bridge.js.map +1 -0
  19. package/dist/brains/opencode.d.ts +25 -0
  20. package/dist/brains/opencode.d.ts.map +1 -0
  21. package/dist/brains/opencode.js +491 -0
  22. package/dist/brains/opencode.js.map +1 -0
  23. package/dist/catalog.d.ts +8 -1
  24. package/dist/catalog.d.ts.map +1 -1
  25. package/dist/catalog.js +100 -1
  26. package/dist/catalog.js.map +1 -1
  27. package/dist/codex-live.d.ts +12 -0
  28. package/dist/codex-live.d.ts.map +1 -0
  29. package/dist/codex-live.js +188 -0
  30. package/dist/codex-live.js.map +1 -0
  31. package/dist/errors.d.ts.map +1 -1
  32. package/dist/errors.js +2 -0
  33. package/dist/errors.js.map +1 -1
  34. package/dist/flags.d.ts.map +1 -1
  35. package/dist/flags.js +7 -5
  36. package/dist/flags.js.map +1 -1
  37. package/dist/humanize.d.ts.map +1 -1
  38. package/dist/humanize.js +19 -2
  39. package/dist/humanize.js.map +1 -1
  40. package/dist/index.d.ts +8 -4
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +8 -4
  43. package/dist/index.js.map +1 -1
  44. package/dist/open.d.ts +109 -0
  45. package/dist/open.d.ts.map +1 -0
  46. package/dist/open.js +338 -0
  47. package/dist/open.js.map +1 -0
  48. package/dist/options.d.ts.map +1 -1
  49. package/dist/options.js +4 -2
  50. package/dist/options.js.map +1 -1
  51. package/dist/panes.d.ts +118 -0
  52. package/dist/panes.d.ts.map +1 -0
  53. package/dist/panes.js +480 -0
  54. package/dist/panes.js.map +1 -0
  55. package/dist/process.d.ts +36 -0
  56. package/dist/process.d.ts.map +1 -1
  57. package/dist/process.js +120 -2
  58. package/dist/process.js.map +1 -1
  59. package/dist/run.d.ts +1 -1
  60. package/dist/run.d.ts.map +1 -1
  61. package/dist/run.js +13 -5
  62. package/dist/run.js.map +1 -1
  63. package/dist/sessions.d.ts +137 -0
  64. package/dist/sessions.d.ts.map +1 -0
  65. package/dist/sessions.js +1023 -0
  66. package/dist/sessions.js.map +1 -0
  67. package/dist/status.d.ts +1 -1
  68. package/dist/status.d.ts.map +1 -1
  69. package/dist/status.js +28 -7
  70. package/dist/status.js.map +1 -1
  71. package/dist/subscription-limits.d.ts +12 -0
  72. package/dist/subscription-limits.d.ts.map +1 -0
  73. package/dist/subscription-limits.js +281 -0
  74. package/dist/subscription-limits.js.map +1 -0
  75. package/dist/types.d.ts +25 -11
  76. package/dist/types.d.ts.map +1 -1
  77. package/dist/types.js +2 -2
  78. package/dist/types.js.map +1 -1
  79. package/dist/usage-readers.d.ts +16 -0
  80. package/dist/usage-readers.d.ts.map +1 -0
  81. package/dist/usage-readers.js +194 -0
  82. package/dist/usage-readers.js.map +1 -0
  83. package/dist/usage.d.ts +71 -0
  84. package/dist/usage.d.ts.map +1 -0
  85. package/dist/usage.js +403 -0
  86. package/dist/usage.js.map +1 -0
  87. package/package.json +7 -23
  88. package/README.ru.md +0 -334
  89. package/dist/cli/main.d.ts +0 -3
  90. package/dist/cli/main.d.ts.map +0 -1
  91. package/dist/cli/main.js +0 -520
  92. package/dist/cli/main.js.map +0 -1
  93. package/dist/cli/term.d.ts +0 -20
  94. package/dist/cli/term.d.ts.map +0 -1
  95. package/dist/cli/term.js +0 -87
  96. package/dist/cli/term.js.map +0 -1
  97. package/dist/ui/dashboard.html +0 -693
  98. package/dist/ui/page.d.ts +0 -9
  99. package/dist/ui/page.d.ts.map +0 -1
  100. package/dist/ui/page.js +0 -12
  101. package/dist/ui/page.js.map +0 -1
  102. package/dist/ui/server.d.ts +0 -20
  103. package/dist/ui/server.d.ts.map +0 -1
  104. package/dist/ui/server.js +0 -409
  105. package/dist/ui/server.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,132 @@ All notable changes to this project are documented here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
5
5
  [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [0.3.0] - 2026-10-07
8
+
9
+ ### Added
10
+
11
+ - `env` of `run()`, `ask()`, `open()` and `startPane()` can remove an inherited variable: a value
12
+ of `undefined` (or `null`) drops it from the environment of the CLI (`EnvOverrides`). A host that
13
+ runs with `NODE_ENV=production` no longer passes it on to every agent, where `npm install` skips
14
+ devDependencies. In a pane it is an `unset` in the pane's script, so it works on a tmux server
15
+ that was started with the variable, and a server started by the call does not get it at all.
16
+
17
+ ### Changed
18
+
19
+ - `open()` and `startPane()` give `system` a real slot where the CLI has one, instead of the first
20
+ user message: Codex gets `-c developer_instructions=…`, OpenCode gets the system prompt of its
21
+ `build` and `plan` agents through `OPENCODE_CONFIG_CONTENT` (it replaces OpenCode's own base
22
+ prompt for them). A `system` without a `prompt` now opens Codex and OpenCode with no first
23
+ message. Antigravity has no such slot and keeps the instructions in front of its first message.
24
+ `OpenPlan.env` carries what the plan needs in the CLI's environment.
25
+
26
+ ## [0.2.0] - 2026-10-05
27
+
28
+ ### Added
29
+
30
+ - OpenCode as the fourth CLI, through `opencode run --format json`: `status()`, `models()`,
31
+ `ask()`, `start()` / `run()`, `sessions()` and `liveSessions()`, `open()` and panes.
32
+ Permissions, MCP servers and the one-shot answer agent go in through the environment;
33
+ nothing is written to the project or the user's config.
34
+ - `parseOpencodeModels()` and `opencodeHome()`.
35
+ - `Catalog.complete`: the CLI runs no model outside its list (OpenCode), so an unknown name is
36
+ refused before the start.
37
+ - `ask()` with OpenCode deletes its session afterwards: OpenCode cannot be told not to keep one.
38
+ - `hint()` reaches a working OpenCode agent: such a run goes through `opencode serve` instead of
39
+ `opencode run`, which exits before it answers a message sent mid-turn.
40
+ - `usage()` and its public report types: saved session tokens and model-aware cost
41
+ estimates for Claude Code, Codex and Antigravity, plus persisted tokens and reported
42
+ or estimated cost for OpenCode.
43
+ - Codex subscription windows from rollout snapshots, with duration, reset time and
44
+ separate limit buckets; opt-in live Claude subscription windows, including rejected
45
+ calls. Unavailable data carries a reason and is never presented as zero usage.
46
+ - Claude Code's subscription windows without a call: the ones it fetched last (its `/usage`)
47
+ from `~/.claude.json`, with the time they were fetched; `limitsSource: 'cache'`. A cache of
48
+ another account than the one signed in is left out. `live: true` still asks with a real call.
49
+ - Antigravity grouped subscription quotas through its structured `/usage` command
50
+ (CLI 1.1.11+), and OpenCode Go rolling, weekly and monthly quotas through its usage
51
+ API. Both are metadata requests without inference, with timeouts and cancellation.
52
+ `usage({ offline: true })` reads saved stores only. `LimitWindow` includes optional
53
+ `group` and `label` for Antigravity's model pools. `usage({ limits: false })` reads the
54
+ sessions alone, every CLI's windows `not_requested`. A Claude Code cache of another account is
55
+ `limitsUnavailable: 'other_account'`.
56
+ - The `brainyard` command covers the whole API: `panes` and `pane start|attach|show|send|close`
57
+ for CLI sessions in tmux panes, `sessions --live` (`--all` adds finished background sessions)
58
+ for what runs on the machine right now, `stop` for a Claude Code background session, and
59
+ `usage` for subscription limits and the tokens and cost of a folder's sessions. A pane is
60
+ named by its name or the start of its name or session id; `pane send` presses Enter as a key
61
+ of its own, so a CLI that reads a fast burst as a paste still sends the message.
62
+ - `brainyard` in a terminal opens the app: one full screen with the agents and their
63
+ subscription limits, the panes (what each CLI does, its memory, how long it has been quiet),
64
+ sessions running in other folders, and the folder's sessions with their tokens and cost. Enter
65
+ goes into a pane and Ctrl+Q comes back; `n` starts a new pane, `x` closes one, `s` stops a
66
+ Claude Code background session, `r` continues a saved session in a pane, `q` quits and the
67
+ panes keep running. The screen is a pure function of the app's state, so a browser can draw
68
+ the same frames. Its pages: the wall — several panes' live screens as tiles (a grid, main and
69
+ stack, columns, zoom), each pane sized to its tile, with typing into the tile in focus; sessions
70
+ with a filter and a card; usage with a bar for every subscription window; settings — a theme,
71
+ an accent, the wall's layout, the bell, the first page and the language (English, or
72
+ Russian), kept in
73
+ `~/.config/brainyard/app.json` with your own colours. The header counts who waits for you, and
74
+ the terminal rings when someone starts to.
75
+ - `brainyard web`: the app in a browser on `127.0.0.1`, the same screen as in a terminal. The
76
+ server sends the frames as server-sent events (`GET /api/app/frames`, only the rows that
77
+ changed); keys go back as the bytes a terminal sends, clicks and the wheel by cell, and the
78
+ page's size (`POST /api/app/input`, `/mouse`, `/resize`), under the API's token, `Host` and
79
+ `Origin` guard. A click opens a tab, selects a row, focuses a tile or picks a setting; a double
80
+ click is Enter; the wheel moves the selection. Enter on a pane shows its CLI full screen with
81
+ every key going to it and the wheel scrolling through its history, until Ctrl+Q; a paste
82
+ reaches it as one paste. `q` quits the app and the command; the panes keep running. The
83
+ dashboard and its playground are on the same server, at `/dashboard`.
84
+ - `npm run demo`: the app on a made-up machine, in a browser or with `--terminal` in this
85
+ terminal, and the dashboard with the same made-up CLIs; `npm run screenshots` takes the
86
+ README's pictures of it again, page by page, in English and in Russian (with Google Chrome), and
87
+ with `--windows` on a Mac the app in a Terminal window and in a Chrome window.
88
+ - `brainyard serve`: the HTTP API alone, with no browser. Its token can come from
89
+ `$BRAINYARD_TOKEN`, and `--json` prints `{url, port, token}` for the program that starts it.
90
+ The API adds `GET /api/sessions`, `GET /api/sessions/live`, `POST /api/sessions/:id/stop`,
91
+ `POST /api/usage` and panes: list, start, screen, send, resize and close.
92
+
93
+ ### Changed
94
+
95
+ - npm shows the English README, with its links and pictures pointing into the repository at the
96
+ release's tag: the Russian one is no longer packed, as npm showed it in place of the English.
97
+
98
+ - `BrainId` and `BRAIN_IDS` include `'opencode'`. Code with an exhaustive
99
+ `Record<BrainId, …>` needs an entry for it.
100
+ - `sessions()` leaves out headless runs that are working right now unless `headless: true`, as
101
+ it already did with saved ones.
102
+ - A session id may contain `_` (OpenCode's ids are `ses_…`).
103
+ - `brainyard` without arguments prints the status table only without a terminal (piped, in a
104
+ script); in a terminal it opens the app. `brainyard status` prints the table anywhere.
105
+ - A pane taken full screen from the wall gets its tile's size back afterwards; it kept the
106
+ terminal's size.
107
+ - Keys typed into a tile just started from the wall go to it, not to the first tile, before a
108
+ read lists the new pane; a read begun earlier no longer stops the typing.
109
+ - A paste where nothing takes text (the overview, a page) is left out instead of being read as
110
+ shortcuts: pasting "fix query" no longer quits. In the browser, AltGr and a Mac's Option type
111
+ their characters (`@` on a German keyboard), and one failed look at a pane does not end it.
112
+ - `brainyard web` with its port taken ends with the error instead of hanging.
113
+ - Resizing the terminal while a pane has it no longer clears tmux's screen; the app takes the
114
+ new size on the way back.
115
+ - Claude Code's cache is read from `$CLAUDE_CONFIG_DIR/.claude.json` whenever that is set, and
116
+ `~/.claude.json` follows `HOME` from the options' `env`. The app reads the folder's usage
117
+ every minute without the windows, which it reads on their own.
118
+ - One accent everywhere: the app's is bright blue — Brainyard's indigo in most terminals, and in
119
+ the browser exactly the dashboard's — no longer cyan, which also means "working".
120
+ - `brainyard serve` is no longer another name for `brainyard ui`: it opens no browser. Without
121
+ `--port`, both take 4747 or the next free port, and both stop on `SIGTERM` as on Ctrl+C.
122
+
123
+ ### Fixed
124
+
125
+ - Text selected with the mouse in a full-screen pane goes to the system clipboard (`pbcopy`,
126
+ `wl-copy`, `xclip` or `xsel`; `BRAINYARD_COPY_COMMAND` names another), not only to tmux's own
127
+ buffer, where nothing outside could paste it. A server started by an older version gets it on
128
+ the next attach.
129
+ - Every CLI starts with `PWD` set to the folder it works in. A CLI that takes its folder from
130
+ `PWD` (OpenCode) otherwise worked in the caller's folder.
131
+ - "Cannot connect to API" and "Unable to connect" are `network` failures.
132
+
7
133
  ## [0.1.0] - 2026-09-30
8
134
 
9
135
  First public release.
@@ -25,4 +151,6 @@ First public release.
25
151
  token-guarded HTTP API with server-sent events.
26
152
  - Tests against fake CLIs, and `npm run live` for checks against the real ones.
27
153
 
154
+ [0.3.0]: https://github.com/antondanv/brainyard/releases/tag/v0.3.0
155
+ [0.2.0]: https://github.com/antondanv/brainyard/releases/tag/v0.2.0
28
156
  [0.1.0]: https://github.com/antondanv/brainyard/releases/tag/v0.1.0