@divergeai/cli 0.1.26 → 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 +60 -18
  2. package/dist/diverge.mjs +1089 -936
  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
@@ -157,8 +187,13 @@ The set is derived from the login, never chosen on the machine: who is
157
187
  signed in, where they may act, and what they can run there. A skill's
158
188
  identity is its organization and its name, so every organization's skills
159
189
  sit side by side in one folder, each under the organization's prefix — its
160
- short code, lowercased, or a slug of its name: `dvx-consultar-inventario`,
161
- `red-team-triage-cloud-run`. Each SKILL.md is rendered from the skill's
190
+ handle, the same lowercase slug that prefixes its case numbers, or a slug of
191
+ its name when it chose none: `acme-consultar-inventario`,
192
+ `red-team-triage-cloud-run`. A folder longer than the 64 characters a
193
+ harness accepts as a skill name is cut and ended with a short stable hash,
194
+ and its SKILL.md names the skill; a served folder that is not a skill name is
195
+ skipped with a warning naming it, and the folder that skill was installed
196
+ under before stays. Each SKILL.md is rendered from the skill's
162
197
  record on every install, named after its folder, and opens with the
163
198
  organization its tools run in, so an agent passes `--organization-id` on
164
199
  every call instead of depending on the machine's default organization.
@@ -166,7 +201,7 @@ every call instead of depending on the machine's default organization.
166
201
  Nobody runs the install by hand after the first time: `diverge login`
167
202
  installs, and a session start refreshes — `agents setup claude` writes a
168
203
  SessionStart hook into Claude Code's user settings, a Divergent checkout
169
- refreshes from its worktree setup for every harness, and `agents run dsh`
204
+ refreshes from its worktree setup for every harness, and `diverge dsh`
170
205
  refreshes before dsh starts. A refresh is per organization: it
171
206
  replaces that organization's folders, retires the ones it stopped serving,
172
207
  and never touches another organization's or a skill you authored beside
@@ -196,7 +231,7 @@ resource inside a project, `--project-id` (or `DIVERGENT_PROJECT_ID`).
196
231
 
197
232
  ```bash
198
233
  diverge tools list --filter rbac # find candidates by name or description
199
- diverge tools describe rbac_assign_role # one schema, on demand
234
+ diverge tools describe rbac_update_role # one schema, on demand
200
235
  diverge tools call rbac_list_roles --args-json '{}'
201
236
  diverge tools call rbac_list_roles --json # exactly one JSON outcome on stdout, errors included
202
237
  diverge tools call inventory_lookup_stock --args-file args.json # or --args-json - to read stdin
@@ -248,13 +283,19 @@ reaches it through your bridge binding. See
248
283
  [RFC: Tenant Plugins](../../docs/rfcs/rfc-tenant-plugins.md).
249
284
 
250
285
  ```bash
251
- diverge plugins validate manifest.json # dry run: every problem the platform would refuse, at once
252
- diverge plugins publish manifest.json # forge_plugins:create in the login's organization
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
253
288
  diverge plugins list
254
- 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
255
290
  ```
256
291
 
257
- Tools are pinned to the manifest: a change is a new version published again.
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.
258
299
  After publishing, enable the plugin with `forge_set_plugin_state` (or the
259
300
  Forge Routing page) and bind the runtime with a bridge binding whose
260
301
  `runtimeType` equals the manifest's `runtime.type`; declare `networkPolicy`
@@ -268,6 +309,7 @@ version in the background and caches the answer under `$DIVERGE_HOME`; the
268
309
  next command prints one line on stderr when a newer release exists. Nothing
269
310
  waits on the network for it, and it stays quiet in the bridge, in
270
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.
271
313
 
272
314
  ## Environment
273
315
 
@@ -279,7 +321,7 @@ non-interactive shells, under `CI`, and with `DIVERGE_NO_UPDATE_CHECK=1`.
279
321
  | `DIVERGENT_CLIENT_ID`, `DIVERGENT_CLIENT_SECRET`, `DIVERGENT_USER_ID` | unattended tool execution with service credentials, delegated to that person |
280
322
  | `DIVERGENT_TOKEN_FILE` | a file holding the token this session runs on, in place of any login (see Session token) |
281
323
  | `DSH_HOME` | where dsh keeps its files, default `~/.dsh` |
282
- | `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 |
283
325
 
284
326
  ## Security
285
327