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