@monster-orange/den 0.4.26 → 0.4.28
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/CHANGELOG.md +88 -0
- package/docs/distributions.md +145 -20
- package/package.json +1 -1
- package/src/shared/agents/claude-helpers.ts +623 -0
- package/src/shared/agents/den-claude.ts +54 -0
- package/src/shared/agents/helpers.ts +175 -0
- package/src/shared/agents/runtime.ts +15 -2
- package/src/shared/den-config.ts +42 -1
- package/src/shared/hub.ts +314 -82
- package/src/shared/secrets/onepassword.ts +52 -15
- package/src/ui/cli/agent-ops.ts +161 -3
- package/src/ui/cli/agents-command.ts +127 -1
- package/src/ui/cli/doctor-command.ts +11 -2
- package/src/ui/mcp/api.ts +8 -2
- package/src/ui/mcp/server.ts +13 -1
- package/src/ui/mcp/tools.ts +50 -0
- package/src/ui/server/agent-routes.ts +133 -1
- package/src/ui/server/hub-connect.ts +499 -0
- package/src/ui/server/index.ts +7 -1
- package/src/ui/server/public/agent-helpers.js +311 -0
- package/src/ui/server/public/agents-page.js +76 -9
- package/src/ui/server/public/i18n/es.js +41 -0
- package/src/ui/server/public/i18n/ja.js +39 -0
- package/src/ui/server/public/settings-registry.js +232 -33
- package/src/ui/server/public/settings.html +23 -0
- package/src/ui/server/public/shell.js +201 -0
- package/src/ui/server/public/topbar.js +5 -1
- package/src/ui/server/public/transcript-view.js +202 -0
- package/src/ui/server/request-guard.ts +3 -1
- package/src/ui/server/route-classes.ts +33 -0
- package/src/ui/server/session-routes.ts +71 -1
- package/src/ui/server/ui-assets.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,94 @@ All notable changes to Den are documented here. Each release lists the
|
|
|
4
4
|
config and manifest changes a distribution must make to move to it under
|
|
5
5
|
**Migrations**.
|
|
6
6
|
|
|
7
|
+
## [0.4.28] - 2026-11-10
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **An agent's helpers (D32).** When an agent starts helpers of its own
|
|
12
|
+
(Claude Code's Agent and Workflow subagents), Den shows them, read-only:
|
|
13
|
+
under the agent's row on the Agents tab, in a **Helpers (n)** list from
|
|
14
|
+
the pane's bar, and as a count on the rail's Agents item on every page.
|
|
15
|
+
Click one to read its transcript: what it was asked, its answers, and
|
|
16
|
+
its tool calls in a few words. Den can't stop or steer a helper, and
|
|
17
|
+
says so; to change what one does, tell the agent. Helpers from the
|
|
18
|
+
agent's earlier conversations are folded under "Earlier (n)". A
|
|
19
|
+
helper's own helpers sit under it, and a running one is listed first,
|
|
20
|
+
with the helper it belongs to. Also
|
|
21
|
+
`<cli> agents helpers <id> [<helper>]` (`--all`, `--limit`, `--json`),
|
|
22
|
+
the MCP tool `agent_helpers`, and the routes `GET
|
|
23
|
+
/api/workspaces/<ws>/agents/<id>/helpers[/<helper>]` and `GET
|
|
24
|
+
/api/sessions/helpers`.
|
|
25
|
+
- **Hub in the rail.** Once this install is connected, the rail has a
|
|
26
|
+
**Hub ↗** link above Settings: the company's page on Hub, in a new tab,
|
|
27
|
+
with a count of the threads waiting on you. When Hub rejects the token
|
|
28
|
+
or forbids the role, the link is greyed and goes to Settings › Hub.
|
|
29
|
+
- **Connect sends `den_url`:** this Den's edge address, when it has one
|
|
30
|
+
(https, else `http://<name>.localhost`), so Hub can link back to it.
|
|
31
|
+
- **`agents.helpers` settings:** `active_minutes` (default 10: no activity
|
|
32
|
+
this long and not known done shows idle) and `collapse_done_minutes`
|
|
33
|
+
(default 30: done helpers fold away after this).
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
|
|
37
|
+
- **Connect to Hub from a `.localhost` address.** An edge on this machine
|
|
38
|
+
reached over http (`http://<name>.localhost`) now counts as this
|
|
39
|
+
machine, like localhost.
|
|
40
|
+
- **Disconnect asks first,** saying it revokes this Den's Hub key on Hub
|
|
41
|
+
and that agents lose Hub until you Connect again.
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- The Agents list no longer drops keyboard focus every few seconds: its
|
|
46
|
+
refresh kept redrawing it. Focus stays on the row or button it was on.
|
|
47
|
+
|
|
48
|
+
### Migrations
|
|
49
|
+
|
|
50
|
+
- `helpers` under `agents:` is now a reserved key (D32's settings). A
|
|
51
|
+
distribution with an agent whose id is `helpers` must rename it.
|
|
52
|
+
Nothing else: `agents.helpers` is optional.
|
|
53
|
+
|
|
54
|
+
## [0.4.27] - 2026-11-10
|
|
55
|
+
|
|
56
|
+
### Added
|
|
57
|
+
|
|
58
|
+
- **Connect to Hub (HUB-1.7).** Settings › Agents › Hub has **Connect**:
|
|
59
|
+
type Hub's address, sign in on Hub, pick the company and approve this
|
|
60
|
+
install, and you come back connected. Nobody copies a token or edits
|
|
61
|
+
config. Den uses PKCE and a single-use state; the token goes to the
|
|
62
|
+
install's own secrets store (1Password or Doppler), else to a 0600
|
|
63
|
+
file in Den's state dir, and never to a page, log or command line.
|
|
64
|
+
**Disconnect** revokes it on Hub first. A token Hub no longer accepts
|
|
65
|
+
shows **Reconnect**; a role that may no longer connect says to ask a
|
|
66
|
+
Hub admin. The row shows the company (a link), your role, who signed
|
|
67
|
+
in and this install. Doctor's Hub row names the company and role.
|
|
68
|
+
- Agents' Hub MCP server uses Hub's own `mcp_url` from Connect, and
|
|
69
|
+
sends `X-Den-Agent-Id` (the agent's stable id) for attribution.
|
|
70
|
+
|
|
71
|
+
### Changed
|
|
72
|
+
|
|
73
|
+
- Hub status comes from Hub's `GET /connect/whoami` (it was the
|
|
74
|
+
`hub_whoami` MCP tool).
|
|
75
|
+
|
|
76
|
+
### Fixed
|
|
77
|
+
|
|
78
|
+
- **Saving to 1Password never makes a second item.** A save created a
|
|
79
|
+
new item whenever reading the old one failed, even for a timeout, so a
|
|
80
|
+
slow `op` could leave two items with one title (which `op` then
|
|
81
|
+
refuses). It now creates only when `op` says the item isn't there, and
|
|
82
|
+
otherwise shows `op`'s reason. A failed create shows create's own
|
|
83
|
+
reason (say, a vault that isn't available), not "isn't an item".
|
|
84
|
+
- `op`'s `[ERROR] <date> <time>` prefix is gone from the messages Den
|
|
85
|
+
shows.
|
|
86
|
+
- After the admin password is saved to the install's store, the note
|
|
87
|
+
says so: "Admin password kept for this session and saved to <store>".
|
|
88
|
+
|
|
89
|
+
### Migrations
|
|
90
|
+
|
|
91
|
+
- None. A `hub.token` set by hand keeps working. `hub.token` may now
|
|
92
|
+
also be a source (`file:`, `keychain:`, `env:`), and `hub.mcp_url` is
|
|
93
|
+
new and optional.
|
|
94
|
+
|
|
7
95
|
## [0.4.26] - 2026-11-10
|
|
8
96
|
|
|
9
97
|
### Security
|
package/docs/distributions.md
CHANGED
|
@@ -913,9 +913,63 @@ later plugins.
|
|
|
913
913
|
|
|
914
914
|
## Hub
|
|
915
915
|
|
|
916
|
-
|
|
917
|
-
it can search Hub and publish docs and mocks there.
|
|
918
|
-
|
|
916
|
+
Connect an install to your company's Hub and every agent Den launches
|
|
917
|
+
gets Hub's tools: it can search Hub and publish docs and mocks there.
|
|
918
|
+
Without it, nothing about agents changes.
|
|
919
|
+
|
|
920
|
+
### Connect to Hub (HUB-1.7)
|
|
921
|
+
|
|
922
|
+
Settings › Agents › Hub: type Hub's address (or keep the one the
|
|
923
|
+
distribution set in `hub.url`) and press **Connect**. Hub opens; sign
|
|
924
|
+
in, pick the company and approve this install. Hub sends you back to
|
|
925
|
+
Settings, connected. Nobody copies a token or edits config.
|
|
926
|
+
|
|
927
|
+
- Den makes a PKCE verifier (S256) and a single-use state and keeps both
|
|
928
|
+
in memory for 10 minutes. Hub's answer comes back to
|
|
929
|
+
`<this Den>/hub/callback`, which trades the one-time code for the
|
|
930
|
+
install's token server to server (`POST <hub>/connect/token`). A
|
|
931
|
+
replayed or old state changes nothing.
|
|
932
|
+
- `/hub/callback` needs no sign-in: the session cookie is SameSite
|
|
933
|
+
Strict, so Hub's redirect doesn't carry it. The state this server
|
|
934
|
+
issued to a signed-in Connect, and the verifier only it holds, are
|
|
935
|
+
what protect it. It then moves on to Settings by script, which carries
|
|
936
|
+
the cookie again.
|
|
937
|
+
- Hub can only send the person back to https or to this machine, so
|
|
938
|
+
open Den over https (its edge address), on localhost, or on a
|
|
939
|
+
`<name>.localhost` address (an edge on this machine over http; RFC 6761
|
|
940
|
+
keeps it on this machine) to Connect.
|
|
941
|
+
- When this Den has an edge address, Connect sends it as `den_url`:
|
|
942
|
+
its https one, else an `http://<name>.localhost` one. Hub links back to Den with it when the browser came over
|
|
943
|
+
loopback. A Reconnect sends it again.
|
|
944
|
+
- This install's label on Hub is `<cli> on <machine>`.
|
|
945
|
+
- The token is the install's (SEC-0), kept in the install's own secrets
|
|
946
|
+
store when it keeps secrets: a 1Password item `<Product> Hub token`
|
|
947
|
+
(field `token`), or a Doppler key `<PREFIX>_HUB_TOKEN`. Otherwise Den
|
|
948
|
+
keeps it in `<state dir>/hub/token` (mode 0600, folder 0700). It goes
|
|
949
|
+
to the store on stdin or into the file, never in a command line, and
|
|
950
|
+
never to a page, a log or an API answer. If it can't be kept, Den
|
|
951
|
+
revokes it on Hub at once.
|
|
952
|
+
- Connect writes `hub.url` (Hub's own address), `hub.token` (the store
|
|
953
|
+
ref, or `file:<path>`) and `hub.mcp_url` (Hub's MCP address, as given)
|
|
954
|
+
to `config/local/user.yml`.
|
|
955
|
+
- **Disconnect** asks first: "This revokes this Den's Hub key on Hub.
|
|
956
|
+
Agents lose Hub until you Connect again." Then it revokes the token on Hub (`POST <hub>/connect/revoke`),
|
|
957
|
+
then removes it here and clears `hub.token` and `hub.mcp_url`;
|
|
958
|
+
`hub.url` stays, so Connect is one click. If Hub can't be reached,
|
|
959
|
+
nothing is removed; **Remove it here anyway** removes it, and says the
|
|
960
|
+
token still works on Hub until an admin revokes the install.
|
|
961
|
+
- A token Hub no longer accepts (revoked, or replaced by a newer
|
|
962
|
+
connect) shows **Reconnect**. A role that may no longer connect Den
|
|
963
|
+
installs says to ask a Hub admin; Den never retries it.
|
|
964
|
+
- Once connected, the rail has a **Hub ↗** link above Settings. It opens
|
|
965
|
+
the company's page on Hub in a new tab, with the company in its tooltip
|
|
966
|
+
and a count of the threads waiting on you (Hub's `unread`). A token Hub
|
|
967
|
+
rejects, or a role it forbids, greys it, and it goes to Settings › Hub
|
|
968
|
+
instead. Den looks at Hub for it once a minute while a page shows.
|
|
969
|
+
|
|
970
|
+
### Config
|
|
971
|
+
|
|
972
|
+
A distribution can preset Hub's address, or set everything by hand:
|
|
919
973
|
|
|
920
974
|
```yaml
|
|
921
975
|
# config/local/user.yml (or the org config; user.yml wins)
|
|
@@ -923,20 +977,27 @@ hub:
|
|
|
923
977
|
url: https://hub.example.com
|
|
924
978
|
token: { vault: Private, item: Acme Hub, field: token }
|
|
925
979
|
# or the name of a secrets.refs entry: token: hub_install
|
|
980
|
+
# or a source: token: "file:/path/to/token" (also keychain:, env:)
|
|
981
|
+
mcp_url: https://hub.example.com/mcp # default: <url>/mcp
|
|
926
982
|
allow_tools: true # the default: agents use Hub's tools without asking
|
|
927
983
|
```
|
|
928
984
|
|
|
929
985
|
- `hub.url` must be https. Plain http works only to this machine
|
|
930
|
-
(`localhost`, `*.localhost`).
|
|
931
|
-
- `hub.token` is this install's Hub token (
|
|
932
|
-
|
|
933
|
-
|
|
986
|
+
(`localhost`, `127.0.0.1`, `*.localhost`).
|
|
987
|
+
- `hub.token` is this install's Hub token (one per install), as a ref in
|
|
988
|
+
this install's own secrets store (`secrets.provider`) or a source. Den
|
|
989
|
+
never assumes a vault, item or field for it.
|
|
990
|
+
|
|
991
|
+
### What agents get
|
|
992
|
+
|
|
934
993
|
- Each agent's MCP config gets a server named `hub`: Streamable HTTP at
|
|
935
|
-
`<hub.url>/mcp
|
|
936
|
-
headers naming the caller:
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
994
|
+
`hub.mcp_url` (default `<hub.url>/mcp`), with
|
|
995
|
+
`Authorization: Bearer <token>` and plain headers naming the caller:
|
|
996
|
+
`X-Den-Agent` (its name), `X-Den-Agent-Id` (its stable id, which Hub
|
|
997
|
+
keys attribution on), `X-Den-Session` (a new opaque id per launch),
|
|
998
|
+
`X-Den-Workspace` and `X-Den-Repos` (the workspace's repos,
|
|
999
|
+
`owner/repo`, comma-separated). Hub sets the company from the token
|
|
1000
|
+
and the project from the repos.
|
|
940
1001
|
- Its prompt gets one line: "You can search Hub and publish docs and
|
|
941
1002
|
mocks there with the hub\_\* tools; your team and project are set from
|
|
942
1003
|
this Den install."
|
|
@@ -944,18 +1005,22 @@ hub:
|
|
|
944
1005
|
in a command line, a record, a log, a page or an API answer.
|
|
945
1006
|
- `hub.allow_tools` (default `true`): agents use Hub's tools without
|
|
946
1007
|
asking (Den allows `mcp__hub` for every agent it launches). The token
|
|
947
|
-
limits writes to this install's
|
|
948
|
-
it to `false` and Hub's tools ask before they run, like any tool.
|
|
949
|
-
explicit deny in the install's own Claude Code permissions still
|
|
950
|
-
Settings › Agents › Hub has the checkbox (it saves to
|
|
1008
|
+
limits writes to this install's company, and Hub keeps every version.
|
|
1009
|
+
Set it to `false` and Hub's tools ask before they run, like any tool.
|
|
1010
|
+
An explicit deny in the install's own Claude Code permissions still
|
|
1011
|
+
wins. Settings › Agents › Hub has the checkbox (it saves to
|
|
951
1012
|
`config/local/user.yml`).
|
|
952
1013
|
- A Hub that is down, or a token that can't be read, never stops an
|
|
953
1014
|
agent: it starts without Hub.
|
|
954
1015
|
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
1016
|
+
### Status
|
|
1017
|
+
|
|
1018
|
+
Settings › Agents › Hub shows Hub's address, connected or not, the
|
|
1019
|
+
company (a link to it on Hub), your role, who signed in and this
|
|
1020
|
+
install's label (from `GET <hub>/connect/whoami`), or why it can't
|
|
1021
|
+
connect. `GET /api/hub` answers the same (never the token). `<cli>
|
|
1022
|
+
doctor` has a Hub row: ✓ when connected, ⚠ with the reason when not,
|
|
1023
|
+
and where to Connect or Reconnect. A Hub that is down never fails
|
|
959
1024
|
doctor.
|
|
960
1025
|
|
|
961
1026
|
## doctor
|
|
@@ -2966,6 +3031,66 @@ The pane's header and the workspace's heading in the list link to the
|
|
|
2966
3031
|
Workspaces page focused on that workspace (`/local-dev?ws=<ws>`), and ⌘K
|
|
2967
3032
|
has "Go to workspace <ws>" for each workspace with agents.
|
|
2968
3033
|
|
|
3034
|
+
### Helpers: what an agent started in its own session
|
|
3035
|
+
|
|
3036
|
+
An agent can start helpers of its own: Claude Code's Agent and Workflow
|
|
3037
|
+
subagents (D32). They run inside the agent's session, so Den shows them
|
|
3038
|
+
but can't stop or steer them. To change what they do, tell the agent.
|
|
3039
|
+
|
|
3040
|
+
Where they show:
|
|
3041
|
+
|
|
3042
|
+
- **The Agents tab.** Under a running or stopped agent's row, its recent
|
|
3043
|
+
helpers, running ones first, each with what it was asked to do, its
|
|
3044
|
+
state and when. "All helpers (n)" opens the full list. Done, failed and
|
|
3045
|
+
stopped helpers fold away after a while (`collapse_done_minutes`).
|
|
3046
|
+
- **A pane's bar.** **Helpers (n)** opens the list, with a count while any
|
|
3047
|
+
run. Helpers from the agent's earlier conversations (before a relaunch)
|
|
3048
|
+
are folded under "Earlier (n)".
|
|
3049
|
+
- **A helper's transcript.** Click a helper: what it was asked, its
|
|
3050
|
+
answers, and its tool calls in a few words, the newest at the bottom.
|
|
3051
|
+
Never its thinking.
|
|
3052
|
+
- **The rail.** The Agents item counts the helpers running now, on every
|
|
3053
|
+
page.
|
|
3054
|
+
|
|
3055
|
+
A helper's state comes from Claude Code's files, best evidence first: the
|
|
3056
|
+
person stopped it, its workflow said, the agent was told it ended, its
|
|
3057
|
+
result is in the agent's transcript, its own files say it finished, its
|
|
3058
|
+
last answer went quiet, or recent activity. A helper with no activity for
|
|
3059
|
+
`active_minutes` that isn't known to be done shows **idle**. When the
|
|
3060
|
+
agent isn't running, none of its helpers are. Hover a state to see which
|
|
3061
|
+
evidence it came from.
|
|
3062
|
+
|
|
3063
|
+
From the CLI and MCP:
|
|
3064
|
+
|
|
3065
|
+
```sh
|
|
3066
|
+
<cli> agents helpers <id> # this conversation's helpers
|
|
3067
|
+
<cli> agents helpers <id> --all # earlier conversations' too
|
|
3068
|
+
<cli> agents helpers <id> <helper> # one helper's transcript
|
|
3069
|
+
<cli> agents helpers <id> <helper> --limit 50 --json
|
|
3070
|
+
```
|
|
3071
|
+
|
|
3072
|
+
The MCP tool `agent_helpers` reads the same, in the agent's own workspace
|
|
3073
|
+
or one it is granted. The routes are `GET
|
|
3074
|
+
/api/workspaces/<ws>/agents/<id>/helpers[/<helper>]` and `GET
|
|
3075
|
+
/api/sessions/helpers` (the running count). All of them only read.
|
|
3076
|
+
|
|
3077
|
+
Settings, under `agents.helpers` in the org config:
|
|
3078
|
+
|
|
3079
|
+
```yaml
|
|
3080
|
+
agents:
|
|
3081
|
+
helpers:
|
|
3082
|
+
active_minutes: 10 # no activity this long, not known done: idle
|
|
3083
|
+
collapse_done_minutes: 30 # done helpers fold away after this
|
|
3084
|
+
```
|
|
3085
|
+
|
|
3086
|
+
| Key | Values | Default |
|
|
3087
|
+
| ----------------------- | -------------------------- | ------- |
|
|
3088
|
+
| `active_minutes` | minutes, above 0 to 100000 | 10 |
|
|
3089
|
+
| `collapse_done_minutes` | minutes, above 0 to 100000 | 30 |
|
|
3090
|
+
|
|
3091
|
+
A runtime other than Claude Code shows no helpers: Den says it can't tell
|
|
3092
|
+
which helpers that agent started.
|
|
3093
|
+
|
|
2969
3094
|
### Stopped agents: Resume, Start fresh, Remove
|
|
2970
3095
|
|
|
2971
3096
|
An agent that stops stays in the list, below the running ones (AG-14, the
|