@divergeai/cli 0.1.27 → 0.1.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.
Files changed (3) hide show
  1. package/README.md +53 -21
  2. package/dist/diverge.mjs +1025 -944
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -6,8 +6,8 @@ model gateway, and call platform tools as yourself.
6
6
  ```bash
7
7
  npm install -g @divergeai/cli
8
8
  diverge login # browser sign-in; the organization is chosen afterwards in the CLI
9
+ diverge dsh # DeepSeek Harness on the gateway, up to date, with your skills
9
10
  diverge agents setup claude # Claude Code on the gateway
10
- diverge agents run dsh -- --profile web --port 3131 --no-open
11
11
  diverge tools list --organization-id <id>
12
12
  ```
13
13
 
@@ -50,11 +50,16 @@ platform grants it only where your roles back the login's scopes.
50
50
  `status`, `Acting as:` before every `tools` request — because a token
51
51
  names only a user id and the wrong account is invisible without the email:
52
52
  use the operator account for operator work, and the break-glass account
53
- only knowingly.
53
+ only knowingly. The `Organization:` and `Acting as:` lines go to stderr, so
54
+ a pipe receives only the command's output and `--json` is the document
55
+ alone.
54
56
  - A login is for one account. `diverge login --as <email>` tells the platform
55
57
  which one; it signs that account in instead of reusing whatever session the
56
58
  browser holds and issues nothing to any other. Without `--as` the account
57
- of the last login is kept, so switching accounts is always explicit.
59
+ of the last login is kept, so switching accounts is always explicit: a
60
+ browser that signs in any other account is refused and the login, shared
61
+ by every session on the machine, is left as it was. A second identity
62
+ beside it gets its own `DIVERGE_HOME`.
58
63
  - Without `--scopes` a login asks for the scopes the platform registers for
59
64
  this CLI — everything it and Forge use — and holds what your roles grant,
60
65
  so a routine re-login never narrows what another session relies on. The
@@ -96,13 +101,38 @@ the gateway, keeping everything else in the file:
96
101
  | `claude` | `~/.claude/settings.json` (or `./.claude/settings.local.json` with `--scope project`): the gateway base URL and `diverge token` as the key helper; `--project-id` adds the project header, `--model-discovery` lets Claude Code list the gateway's models |
97
102
  | `opencode` | `~/.config/opencode/opencode.json`: a `divergent-<surface>` provider reading `DIVERGENT_TOKEN` |
98
103
  | `codex` | `~/.codex/config.toml`: a `divergent` provider block with `diverge token` as its auth command; `--print` shows it instead |
99
- | `dsh` | `$DSH_HOME/divergent-<surface>.yml`: a patch overlay with the models the gateway serves, each with the input, context window and output cap the gateway lists for it, dsh's DeepSeek adapter, telemetry upload and vendor search turned off, a shell command budget raised from dsh's 60 s to the CLI's own request ceiling so a platform tool call is never cut off before the platform answers, and Chrome DevTools MCP on port 9222; the Divergent agent preset; and your skills in `$DSH_HOME/skills`, through which the agent reaches every platform tool, web search included, from dsh's shell with `diverge tools` |
100
104
 
101
- `diverge agents run dsh` launches DeepSeek Harness on the overlay and keeps
102
- its token fresh in dsh's own credentials file until it exits. With nothing
103
- else it starts dsh's web UI and prints the URL; `diverge agents run dsh --
104
- "<task>"` answers one task headless and exits; anything after `--` goes to
105
- dsh as given.
105
+ ### dsh
106
+
107
+ `diverge dsh` is the one command for DeepSeek Harness; dsh needs no setup and
108
+ no install of its own. With nothing else it starts dsh's web UI and prints the
109
+ URL; `diverge dsh -- "<task>"` answers one task headless and exits; anything
110
+ after `--` goes to dsh as given. Each launch, in order:
111
+
112
+ 1. updates the CLI when a newer release exists and restarts on it. A registry
113
+ that does not answer or an install that fails warns and goes on;
114
+ `DIVERGE_NO_UPDATE_CHECK=1` skips this.
115
+ 2. signs in if the login does not serve the gateway.
116
+ 3. installs the dsh release this CLI is tested with, once per release, under
117
+ `$DIVERGE_HOME/harness/dsh/<version>`: about a minute and nearly 1 GB, and
118
+ Node 24.9 or later. A dsh you installed yourself is neither used nor touched.
119
+ A version no launch has used for a week is deleted.
120
+ 4. brings your skills up to date in `$DSH_HOME/skills`.
121
+ 5. writes the overlay `$DSH_HOME/divergent-<surface>.yml`: the models the
122
+ gateway serves, each with the input, context window and output cap the
123
+ gateway lists for it; dsh's DeepSeek adapter, telemetry upload and vendor
124
+ search turned off, in the shipped agent presets too; a shell command budget
125
+ raised from dsh's 60 s to the CLI's own request ceiling so a platform tool
126
+ call is never cut off before the platform answers; and Chrome DevTools MCP
127
+ on port 9222. The agent reaches every platform tool, web search included,
128
+ from dsh's shell with `diverge tools`.
129
+ 6. starts dsh, keeps its token fresh in dsh's own credentials file until it
130
+ exits, and records the session as the organization's own (ADR 0121).
131
+
132
+ The CLI runs only the dsh release it is tested with, because dsh's configuration
133
+ and session log change between its pre-releases. A weekly job proposes the next
134
+ release, CI runs it for real on the overlay, and the merged change reaches you
135
+ as a CLI update on your next launch.
106
136
 
107
137
  The session runs on its own token, not on your login. The CLI keeps
108
138
  `$DSH_HOME/session-token` fresh beside the credentials file, and writes
@@ -171,7 +201,7 @@ every call instead of depending on the machine's default organization.
171
201
  Nobody runs the install by hand after the first time: `diverge login`
172
202
  installs, and a session start refreshes — `agents setup claude` writes a
173
203
  SessionStart hook into Claude Code's user settings, a Divergent checkout
174
- refreshes from its worktree setup for every harness, and `agents run dsh`
204
+ refreshes from its worktree setup for every harness, and `diverge dsh`
175
205
  refreshes before dsh starts. A refresh is per organization: it
176
206
  replaces that organization's folders, retires the ones it stopped serving,
177
207
  and never touches another organization's or a skill you authored beside
@@ -201,7 +231,7 @@ resource inside a project, `--project-id` (or `DIVERGENT_PROJECT_ID`).
201
231
 
202
232
  ```bash
203
233
  diverge tools list --filter rbac # find candidates by name or description
204
- diverge tools describe rbac_assign_role # one schema, on demand
234
+ diverge tools describe rbac_update_role # one schema, on demand
205
235
  diverge tools call rbac_list_roles --args-json '{}'
206
236
  diverge tools call rbac_list_roles --json # exactly one JSON outcome on stdout, errors included
207
237
  diverge tools call inventory_lookup_stock --args-file args.json # or --args-json - to read stdin
@@ -253,18 +283,19 @@ reaches it through your bridge binding. See
253
283
  [RFC: Tenant Plugins](../../docs/rfcs/rfc-tenant-plugins.md).
254
284
 
255
285
  ```bash
256
- diverge plugins validate manifest.json # dry run: every problem the platform would refuse, at once
257
- diverge plugins publish manifest.json # forge_plugins:create in the login's organization; exits 3 when it waits on a decision
286
+ diverge plugins validate manifest.json # forge_validate_plugin: every problem at once, and whether publishing needs a decision
287
+ diverge plugins publish manifest.json # forge_publish_plugin, raised as you; a person decides in Compass; exits 3 while it waits
258
288
  diverge plugins list
259
- diverge plugins retire <pluginId> # the descriptor and its tools go; installations stay
289
+ diverge plugins retire <pluginId> # forge_retire_plugin, raised as you; the descriptor and its tools go, installations stay
260
290
  ```
261
291
 
262
- Tools are pinned to the manifest: a change is a new version published again.
263
- A version that only reshapes or removes the tools already served is stored at
264
- once. Anything else changes authority and is stored only once a person decides
265
- it: `publish` raises it as `forge_publish_plugin`, prints the invocation and
266
- its Compass link, and exits 3; read the outcome with
267
- `diverge tools invocation <id>`.
292
+ Every write is a tool invocation decided by the organization's policy
293
+ (ADR 0124): `publish` and `retire` print the invocation and its Compass link
294
+ and exit 3 while they wait; read the outcome with
295
+ `diverge tools invocation <id>`. Tools are pinned to the manifest: a change
296
+ is a new version published again. A version that only reshapes or removes
297
+ the tools already served is what the deploy pipeline stores unattended with
298
+ `forge_reshape_plugin`; `validate` says which publish a version needs.
268
299
  After publishing, enable the plugin with `forge_set_plugin_state` (or the
269
300
  Forge Routing page) and bind the runtime with a bridge binding whose
270
301
  `runtimeType` equals the manifest's `runtime.type`; declare `networkPolicy`
@@ -278,6 +309,7 @@ version in the background and caches the answer under `$DIVERGE_HOME`; the
278
309
  next command prints one line on stderr when a newer release exists. Nothing
279
310
  waits on the network for it, and it stays quiet in the bridge, in
280
311
  non-interactive shells, under `CI`, and with `DIVERGE_NO_UPDATE_CHECK=1`.
312
+ `diverge dsh` does not wait for the notice: it updates before it launches.
281
313
 
282
314
  ## Environment
283
315
 
@@ -289,7 +321,7 @@ non-interactive shells, under `CI`, and with `DIVERGE_NO_UPDATE_CHECK=1`.
289
321
  | `DIVERGENT_CLIENT_ID`, `DIVERGENT_CLIENT_SECRET`, `DIVERGENT_USER_ID` | unattended tool execution with service credentials, delegated to that person |
290
322
  | `DIVERGENT_TOKEN_FILE` | a file holding the token this session runs on, in place of any login (see Session token) |
291
323
  | `DSH_HOME` | where dsh keeps its files, default `~/.dsh` |
292
- | `DIVERGE_NO_UPDATE_CHECK` | set to skip the once-a-day check for a newer release |
324
+ | `DIVERGE_NO_UPDATE_CHECK` | set to skip the once-a-day check for a newer release, and the update at a `diverge dsh` launch |
293
325
 
294
326
  ## Security
295
327