@zergai/ztc 0.21.1-dev.202611121750 → 0.23.0-beta.1
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/README.md +166 -35
- package/bin/zmux-darwin-arm64 +0 -0
- package/bin/ztc-audio-darwin-arm64 +0 -0
- package/bin/ztc-capture-darwin-arm64 +0 -0
- package/bin/ztc-computer-darwin-arm64 +0 -0
- package/bin/ztc-llm-darwin-arm64 +0 -0
- package/bin/ztc-tts-darwin-arm64 +0 -0
- package/bin/ztc-tui-darwin-arm64 +0 -0
- package/bin/zterm-darwin-arm64 +2 -2
- package/dist/App.js +2 -2
- package/dist/agent/agent.d.ts +18 -3
- package/dist/agent/agent.js +208 -96
- package/dist/agent/backends/codex_app_server.d.ts +1 -0
- package/dist/agent/backends/codex_app_server.js +3 -1
- package/dist/agent/backends/host_effort_policy.d.ts +12 -0
- package/dist/agent/backends/host_effort_policy.js +132 -0
- package/dist/agent/backends/index.d.ts +3 -2
- package/dist/agent/backends/index.js +4 -0
- package/dist/agent/backends/router_gate.d.ts +11 -0
- package/dist/agent/backends/router_gate.js +27 -2
- package/dist/agent/backends/router_keys.d.ts +63 -0
- package/dist/agent/backends/router_keys.js +94 -0
- package/dist/agent/backends/router_refusal.d.ts +12 -15
- package/dist/agent/backends/router_refusal.js +29 -5
- package/dist/agent/backends/types.d.ts +10 -0
- package/dist/agent/backends/zrouter_stream.d.ts +48 -1
- package/dist/agent/backends/zrouter_stream.js +215 -24
- package/dist/agent/commands/agent_cli.js +11 -3
- package/dist/agent/commands/config.js +12 -0
- package/dist/agent/commands/index.js +2 -1
- package/dist/agent/commands/mirror.js +15 -5
- package/dist/agent/commands/provider.js +4 -2
- package/dist/agent/commands/provider_selection.js +16 -2
- package/dist/agent/commands/router_availability.d.ts +15 -0
- package/dist/agent/commands/router_availability.js +45 -0
- package/dist/agent/commands/settings.js +38 -5
- package/dist/agent/commands/subs.d.ts +4 -1
- package/dist/agent/commands/subs.js +15 -5
- package/dist/agent/commands/types.d.ts +10 -0
- package/dist/agent/commands/ztc_pane.d.ts +20 -0
- package/dist/agent/commands/ztc_pane.js +239 -0
- package/dist/agent/factory.js +10 -2
- package/dist/agent/host_model_context.d.ts +9 -0
- package/dist/agent/host_model_context.js +40 -0
- package/dist/agent/request_encoder.d.ts +3 -0
- package/dist/agent/request_encoder.js +11 -4
- package/dist/agent/runtime/tool_runtime.js +8 -2
- package/dist/agent/subagent.d.ts +9 -0
- package/dist/agent/subagent.js +65 -46
- package/dist/agent/tools/file.js +10 -6
- package/dist/agent/tools/pane.d.ts +15 -0
- package/dist/agent/tools/pane.js +78 -18
- package/dist/agent/tools/supervision.js +6 -2
- package/dist/agent/tools/ztc_command.d.ts +12 -0
- package/dist/agent/tools/ztc_command.js +21 -6
- package/dist/app/agent_runner.js +5 -2
- package/dist/app/command_context.js +10 -4
- package/dist/app/mirror_startup.d.ts +16 -0
- package/dist/app/mirror_startup.js +10 -0
- package/dist/app/runtime_choices.d.ts +2 -0
- package/dist/app/runtime_choices.js +1 -1
- package/dist/app/runtime_choices_source.js +2 -1
- package/dist/app/session_messages.d.ts +4 -1
- package/dist/app/session_messages.js +6 -2
- package/dist/app/tool_callbacks.js +1 -0
- package/dist/cli_args.d.ts +2 -0
- package/dist/cli_args.js +5 -0
- package/dist/cli_ratatui.d.ts +25 -1
- package/dist/cli_ratatui.js +179 -37
- package/dist/config/permissions.d.ts +13 -0
- package/dist/config/permissions.js +63 -1
- package/dist/config/retired_routes.d.ts +23 -3
- package/dist/config/retired_routes.js +62 -11
- package/dist/config/types.d.ts +18 -1
- package/dist/config.d.ts +42 -0
- package/dist/config.js +102 -3
- package/dist/desktop/daily/desktop_wiring.js +9 -0
- package/dist/desktop/daily/recipes.js +7 -1
- package/dist/headless.d.ts +1 -0
- package/dist/headless.js +55 -3
- package/dist/library.js +2 -2
- package/dist/mcp/client.js +6 -3
- package/dist/mcp/workspace_server.d.ts +6 -1
- package/dist/mcp/workspace_server.js +61 -11
- package/dist/onboarding/first_run.d.ts +3 -1
- package/dist/onboarding/first_run.js +21 -6
- package/dist/onboarding/router_tips.js +10 -7
- package/dist/panes/agent_cli.d.ts +48 -0
- package/dist/panes/agent_cli.js +145 -0
- package/dist/panes/agent_panes.d.ts +11 -0
- package/dist/panes/agent_panes.js +25 -4
- package/dist/panes/initial_input.d.ts +7 -0
- package/dist/panes/initial_input.js +7 -0
- package/dist/panes/motsi.d.ts +22 -7
- package/dist/panes/motsi.js +36 -9
- package/dist/panes/worker_route.d.ts +133 -0
- package/dist/panes/worker_route.js +506 -0
- package/dist/panes/ztc_launch.d.ts +9 -0
- package/dist/panes/ztc_launch.js +58 -2
- package/dist/router_auth.d.ts +18 -0
- package/dist/router_auth.js +78 -2
- package/dist/types.d.ts +5 -0
- package/dist/ui/ratatui/headless_pane_manager.d.ts +2 -0
- package/dist/ui/ratatui/headless_pane_manager.js +6 -3
- package/dist/ui/ratatui/pane_relay.d.ts +11 -1
- package/dist/ui/ratatui/pane_relay.js +14 -2
- package/dist/ui/ratatui/protocol.d.ts +9 -1
- package/dist/utils/atomic_write.js +26 -1
- package/dist/utils/docker_target.js +4 -1
- package/dist/utils/subprocess_env.d.ts +18 -0
- package/dist/utils/subprocess_env.js +45 -0
- package/dist/web/mirror_authenticator.d.ts +6 -0
- package/dist/web/mirror_authenticator.js +15 -12
- package/dist/web/mirror_client.d.ts +1 -0
- package/dist/web/mirror_client.js +3 -0
- package/dist/web/mirror_stream.d.ts +70 -2
- package/dist/web/mirror_stream.js +179 -50
- package/dist/worker/worker_models.d.ts +11 -0
- package/dist/worker/worker_models.js +19 -7
- package/dist/zlm-embed.mjs +1396 -434
- package/dist/zlm.js +1 -1
- package/package.json +17 -7
package/README.md
CHANGED
|
@@ -72,6 +72,17 @@ For browser login at **zergrouter.com**, run `ztc auth login` in your shell or
|
|
|
72
72
|
Claude Code/Codex emulation, and `ztc "prompt"` or `ztc -p "prompt"` usage, and
|
|
73
73
|
[Zerg Router limits](#zerg-router-limits) for what ZTC does when Router refuses a request.
|
|
74
74
|
|
|
75
|
+
Every ZTC pane on a profile, and the splits, workers and `/ztc` panes it opens, shares the
|
|
76
|
+
profile's one Router sign-in. Router replaces this computer's sign-in at every login, so a
|
|
77
|
+
login in any pane, or `ztc auth login`, is the one every pane uses from its next message,
|
|
78
|
+
with no restart. With no sign-in, or an expired one, a message on a Zerg Router model
|
|
79
|
+
isn't sent and `/ztc` opens nothing on one: ZTC says to run `/auth login`, and what you
|
|
80
|
+
typed goes with your next message once you sign in. If Router turns the sign-in away,
|
|
81
|
+
ZTC says so, and `/auth status` shows which Router account this ZTC uses. The launch
|
|
82
|
+
card shows your ZergAI login on its own line ("ZergAI login: …"), which can be another
|
|
83
|
+
account than Router's, and a "Zerg Router:" line saying whether Router is signed in,
|
|
84
|
+
with the name Router gave this device, or that `/auth login` signs it in.
|
|
85
|
+
|
|
75
86
|
Use `/model openai [model]` or `/model deepseek [model]` for direct API calls with your
|
|
76
87
|
local keys. Use `/model zergrouter <upstream-provider> [model]` to route through your
|
|
77
88
|
Router login, or `/model modal [model]` for Modal shared endpoints. For Ollama,
|
|
@@ -109,9 +120,17 @@ link to your limits. It doesn't retry: the refusal holds that route, account and
|
|
|
109
120
|
the whole ZTC process, so subagents, workers, heartbeats, `/loop` routines, goal loops and
|
|
110
121
|
messages from other panes get the same message without contacting Router. One real request
|
|
111
122
|
every five minutes still goes through, so a raised limit works within minutes, and a
|
|
112
|
-
successful answer for that model lifts the hold.
|
|
113
|
-
|
|
114
|
-
|
|
123
|
+
successful answer for that model lifts the hold. When Router had no key for the model's
|
|
124
|
+
provider, `/provider refresh` lifts it too once Router's list shows the key you added.
|
|
125
|
+
Some providers' keys are personal in Router: Router uses such a key only for the logins of
|
|
126
|
+
the Router account that holds it, so it has to be in the account ZTC is signed in to,
|
|
127
|
+
which the refusal says. `/auth status` names that account and this device ("Zerg Router:
|
|
128
|
+
signed in · personal account 1a2b3c4d… · device ZTC on <computer>"); the ZergAI login line
|
|
129
|
+
at launch is your ZergAI platform login, which can be another account. To use a key held
|
|
130
|
+
in another Router account, run `/auth logout`, then `/auth login` to that account. A
|
|
131
|
+
message you send yourself (typed, dictated, from the browser mirror, or given on the
|
|
132
|
+
command line) gets one real attempt, unless you type it into a ZTC pane or a colony cell,
|
|
133
|
+
which the overseer can type into too.
|
|
115
134
|
A full concurrency limit is retried a few times, and a provider cooldown is waited out;
|
|
116
135
|
one longer than a minute ends the turn with the time it clears, and nothing, not even
|
|
117
136
|
your own message, is sent to that model before then.
|
|
@@ -205,8 +224,8 @@ curl -fsSL https://zergai.com/install/ztc.sh | sh -s -- --preview
|
|
|
205
224
|
The app carries its own Node and matching ZTC agent, so it starts from the
|
|
206
225
|
icon without a global Node or ZTC install, and it uses the same accounts,
|
|
207
226
|
configuration and saved sessions as the CLI. Its title bar names the project and branch, then
|
|
208
|
-
the delegated
|
|
209
|
-
another), the queue, Stop and Updates. Releases are signed, notarized and published in
|
|
227
|
+
the delegated workers' Router login when native panes are up, and holds the model (click it to
|
|
228
|
+
choose another), the queue, Stop and Updates. Releases are signed, notarized and published in
|
|
210
229
|
[`Epoch-ML/ztc-releases`](https://github.com/Epoch-ML/ztc-releases).
|
|
211
230
|
|
|
212
231
|
From a terminal you can also open the desktop surface explicitly:
|
|
@@ -280,14 +299,14 @@ An unrelated shell cannot use these commands without that authority. The channel
|
|
|
280
299
|
has no terminal-input operation. Results currently use the registered
|
|
281
300
|
`fixture-count-v1` numeric schema; arbitrary child-supplied schemas are refused.
|
|
282
301
|
|
|
283
|
-
After the project and branch, the title bar shows the delegated Router
|
|
284
|
-
**
|
|
285
|
-
`desktop-delegated` profile's login is signed in, then its funding, such as
|
|
302
|
+
After the project and branch, the title bar shows the delegated workers' Router
|
|
303
|
+
login: **Workers' Router: signed out** (or expired, rejected, unavailable) until
|
|
304
|
+
the `desktop-delegated` profile's login is signed in, then its funding, such as
|
|
286
305
|
**ready** or **needs payment**. It describes that profile, not the model chip's
|
|
287
|
-
route, nor Claude or Codex subscriptions. Status shows structured
|
|
288
|
-
rows alongside ordinary ZTC workers. Use Up/Down and Enter (or a
|
|
289
|
-
in. Unmodified Escape or Backspace collapses that drill-in and
|
|
290
|
-
Status. Interactive zooms keep those keys in their terminal.
|
|
306
|
+
route or a pane's, nor Claude or Codex subscriptions. Status shows structured
|
|
307
|
+
enrolled-child rows alongside ordinary ZTC workers. Use Up/Down and Enter (or a
|
|
308
|
+
click) to drill in. Unmodified Escape or Backspace collapses that drill-in and
|
|
309
|
+
returns focus to Status. Interactive zooms keep those keys in their terminal.
|
|
291
310
|
|
|
292
311
|
Use `/pane stop <pane-id>` or **Stop native pane** in the picker.
|
|
293
312
|
Stop validates process identity before signaling. SIGKILL requires human desktop
|
|
@@ -649,6 +668,15 @@ For a mirror served below a reverse-proxy prefix, set
|
|
|
649
668
|
`ZTC_MIRROR_BASE_PATH=/your/prefix`; the browser client applies the prefix to
|
|
650
669
|
its REST, SSE, asset, and media URLs while the proxy strips it upstream.
|
|
651
670
|
|
|
671
|
+
Who can connect: with sign-in off (the default outside production), the mirror
|
|
672
|
+
listens on `127.0.0.1` and answers only this computer, whatever a request's
|
|
673
|
+
`Host` or `X-Forwarded-For` says. To open it from another machine, start ZTC
|
|
674
|
+
with `ZTC_MIRROR_REQUIRE_AUTH=1` and open the link it prints; `ZTC_MIRROR_HOST`
|
|
675
|
+
sets the address it listens on. The desktop app's mirror, and the one a zmux
|
|
676
|
+
session starts by itself, open panes and take typing only from a caller with a
|
|
677
|
+
credential: its own panes, and the browser opened with the link from
|
|
678
|
+
`/mirror open`.
|
|
679
|
+
|
|
652
680
|
In `zmux` mode the browser mirror can now focus panes, switch layout presets, toggle zoom, create ZTC or shell panes, close panes, and drive pane scroll position through the same mux state machine as the terminal client.
|
|
653
681
|
|
|
654
682
|
### Human Attention
|
|
@@ -1218,6 +1246,7 @@ Optional App Server config:
|
|
|
1218
1246
|
### zmux & Orchestration
|
|
1219
1247
|
| Command | Description |
|
|
1220
1248
|
|---------|-------------|
|
|
1249
|
+
| `/ztc [task]` | Open ZTC in a new pane next to this one, on this pane's route or one you name ([details](#claude-code-and-codex-in-panes)) |
|
|
1221
1250
|
| `/swarm` | Enter conductor mode |
|
|
1222
1251
|
| `/swarm-status` | Check agent progress |
|
|
1223
1252
|
| `/swarm-stop` | Exit conductor mode |
|
|
@@ -1283,7 +1312,7 @@ Argument syntax appears as one short usage line instead of selectable chips.
|
|
|
1283
1312
|
|
|
1284
1313
|
### File System
|
|
1285
1314
|
- **read_file** — Read file contents
|
|
1286
|
-
- **write_file** — Write/modify files (with diff display)
|
|
1315
|
+
- **write_file** — Write/modify files (with diff display); a file it, `edit_file` or `apply_patch` rewrites keeps its permission mode
|
|
1287
1316
|
- **list_directory** — List directory contents
|
|
1288
1317
|
- **search** — Regex code search (ripgrep-style)
|
|
1289
1318
|
|
|
@@ -1339,7 +1368,17 @@ seconds. The retry fields in `/settings` → Behavior can cap the recovery windo
|
|
|
1339
1368
|
`0` for the previous attempt limit, or set Request attempts to `1` to disable
|
|
1340
1369
|
Agent-level retries and sustained recovery. Backend transport reconnects retain
|
|
1341
1370
|
their separate policy. Permanent errors and inactivity timeouts still stop the request.
|
|
1342
|
-
|
|
1371
|
+
Dispatched native harness turns are not regenerated. A stream that breaks after answer
|
|
1372
|
+
text is asked for again, and the new try's answer replaces the cut one in the pane and
|
|
1373
|
+
the browser mirror. When Zerg Router loses a model's stream partway through, ZTC asks
|
|
1374
|
+
again in the same turn as a fresh Router turn, up to the attempt limit. If every try is
|
|
1375
|
+
cut off, the pane keeps what arrived (what the last try showed or, when it was cut off
|
|
1376
|
+
before any text, what the latest try before it showed) and says a message continues from
|
|
1377
|
+
there: your next message carries it as the model's answer so far, and the saved session
|
|
1378
|
+
keeps it. A `--headless` run reports such a turn as `status: interrupted` with
|
|
1379
|
+
`resumable: true` and its known usage, sends the same answer as its message and to
|
|
1380
|
+
`--output`, and ends with error code `ROUTER_STREAM_LOST` and a non-zero exit, with the
|
|
1381
|
+
session saved without that answer, so another message has the model answer again.
|
|
1343
1382
|
The activity line shows when ZTC is waiting for the endpoint; request diagnostics
|
|
1344
1383
|
include HTTP status and bounded, redacted response details.
|
|
1345
1384
|
|
|
@@ -1623,6 +1662,21 @@ credentials. Panes need zmux (plain `ztc`) or the desktop app.
|
|
|
1623
1662
|
pane's directory. Plain text is the opening prompt (`/claude fix the failing
|
|
1624
1663
|
test`); text that starts with a flag goes to the CLI as its arguments
|
|
1625
1664
|
(`/claude --continue`, `/codex -m gpt-5 "review the diff"`).
|
|
1665
|
+
- `/ztc [--provider <id>] [--model <id>] [--effort <level>] [task]` opens ZTC
|
|
1666
|
+
itself the same way, next to this pane and in its directory, on the route
|
|
1667
|
+
this pane runs on now: its provider, model, auth mode and reasoning effort,
|
|
1668
|
+
as a split of it starts, so a pane on a route of its own passes that route
|
|
1669
|
+
rather than the default for new panes. The flags (or `--model=…`) start it
|
|
1670
|
+
on another route, checked against Zerg Router's list as an agent's
|
|
1671
|
+
`open_pane` worker is; a model alone finds its provider, and a route that
|
|
1672
|
+
can't run is refused before anything opens, this pane's own included: a Zerg
|
|
1673
|
+
Router model with no Router sign-in (run `/auth login`) or with Routing set to
|
|
1674
|
+
direct, where a model or provider named alone stays on your own keys
|
|
1675
|
+
(`--provider zergrouter:<provider>` chooses Router). The new pane runs at the
|
|
1676
|
+
effort `/ztc` names, and with `--effort default` at the one the profile saves
|
|
1677
|
+
for its model. Nothing is saved. Text after the flags is the pane's first task
|
|
1678
|
+
(`/ztc --model gpt-5.4 run the tests`); `--` ends the flags, so a task can
|
|
1679
|
+
start with a dash.
|
|
1626
1680
|
- Ctrl+B c offers Claude Code and Codex next to bash and ZTC when they are
|
|
1627
1681
|
installed. In the desktop app, the tab strip's + opens a ZTC tab, as Cmd+T
|
|
1628
1682
|
does. The ▾ beside it, or a right-click or Ctrl-click on +, opens New tab and
|
|
@@ -1633,6 +1687,43 @@ credentials. Panes need zmux (plain `ztc`) or the desktop app.
|
|
|
1633
1687
|
(Ctrl+Cmd+Z with ZTC, Cmd+D with a shell; Shift splits down), and Ctrl+Cmd+N
|
|
1634
1688
|
opens the menu at the focused pane.
|
|
1635
1689
|
|
|
1690
|
+
Claude Code and Codex panes you open start without their permission prompts:
|
|
1691
|
+
ZTC passes Claude Code `--dangerously-skip-permissions` and Codex
|
|
1692
|
+
`--dangerously-bypass-approvals-and-sandbox`, ahead of your own arguments, in
|
|
1693
|
+
the panes you open with `/claude`, `/codex`, the menus and splits, Ctrl+B c and
|
|
1694
|
+
native interactive panes, so they run commands without asking, and Codex runs
|
|
1695
|
+
them outside its sandbox. The "Opened …" line shows the flag. The first time
|
|
1696
|
+
in each Claude Code config directory (`~/.claude`, and each profile's), Claude
|
|
1697
|
+
Code asks you to accept that mode. A permission choice of your own wins and ZTC
|
|
1698
|
+
adds nothing: `/claude --permission-mode plan`,
|
|
1699
|
+
`--allow-dangerously-skip-permissions`, `--permission-prompts …` or
|
|
1700
|
+
`--settings …`; `/codex -s read-only`, `-a on-request`, `--approve-for-me`,
|
|
1701
|
+
`--yolo`, `-p <profile>` or `-c approval_policy=…`. Run as root outside a
|
|
1702
|
+
sandbox, Claude Code refuses its flag, so ZTC leaves it out and says so. To
|
|
1703
|
+
have both ask as their own settings say, set Claude Code and Codex permissions
|
|
1704
|
+
to ask in `/settings` → Panes (`panes.agentPermissions: "ask"`).
|
|
1705
|
+
|
|
1706
|
+
Panes an agent opens ask before running commands, whatever that setting says:
|
|
1707
|
+
an agent's `/claude` or `/codex` (through `ztc_command`) and workspace-mcp's
|
|
1708
|
+
`open_pane` get no flag from ZTC, and an agent's own
|
|
1709
|
+
`--dangerously-skip-permissions`, `bypassPermissions` mode,
|
|
1710
|
+
`--dangerously-bypass-approvals-and-sandbox`, `--yolo` or `danger-full-access`
|
|
1711
|
+
sandbox is refused. Opening one starts a program that runs commands, so the
|
|
1712
|
+
agent's permission profile governs it as it governs a shell: a profile without
|
|
1713
|
+
`shell_exec` refuses it, and one that asks before shell commands asks before it
|
|
1714
|
+
opens. The delegated Codex and ZTC workers of the New pane chooser never
|
|
1715
|
+
bypass: they stay read-only.
|
|
1716
|
+
|
|
1717
|
+
An agent's `/ztc` follows the same rule, as ZTC's own `create_ztc_pane` does: a
|
|
1718
|
+
ZTC pane runs an agent that runs commands. A new ZTC pane runs under the
|
|
1719
|
+
profile's saved permissions, so an agent whose pane runs under narrower ones
|
|
1720
|
+
for this session (`/config scope session`, then `/permissions use …`) can't
|
|
1721
|
+
open one, and the refusal says what the new pane would allow beyond its own.
|
|
1722
|
+
An agent's task reaches the new pane as a message to that pane's agent, never as
|
|
1723
|
+
a command the pane runs, so a task such as `/permissions use trusted` changes
|
|
1724
|
+
nothing. Your own `/ztc` opens as your other new panes do, under the saved
|
|
1725
|
+
permissions, and a command in your task runs as one.
|
|
1726
|
+
|
|
1636
1727
|
Each of these panes starts with ZTC's workspace MCP server (`ztc
|
|
1637
1728
|
workspace-mcp`) attached for that session only, through Claude Code's
|
|
1638
1729
|
`--mcp-config` or Codex's `-c mcp_servers.ztc.*`, so your own CLI configuration
|
|
@@ -1641,7 +1732,7 @@ is never edited. Its tools give the agent the workspace:
|
|
|
1641
1732
|
| Tool | What it does |
|
|
1642
1733
|
|------|--------------|
|
|
1643
1734
|
| `list_panes` | Each pane's id, name and kind, and which pane is the agent's own |
|
|
1644
|
-
| `open_pane` | Open a ZTC agent, Claude Code, Codex or a shell, optionally with a first task |
|
|
1735
|
+
| `open_pane` | Open a ZTC agent, Claude Code, Codex or a shell, optionally with a first task; a ZTC agent on a provider, model and effort you name |
|
|
1645
1736
|
| `read_pane` | Read a pane's scrollback, or what is on screen |
|
|
1646
1737
|
| `type_into_pane` | Type into a pane, then press Enter |
|
|
1647
1738
|
| `send_message` | Message another agent over ZTC's bus |
|
|
@@ -1655,7 +1746,31 @@ Broadcasts to `all` reach ZTC agents only.
|
|
|
1655
1746
|
A pane the agent opens with `open_pane` starts as one you open yourself, by
|
|
1656
1747
|
ZTC's settings as saved at that moment: the profile new Claude Code and Codex
|
|
1657
1748
|
panes start on, MotSi's remote view, the route a ZTC pane starts on and, in
|
|
1658
|
-
the desktop app, Claude Code badges.
|
|
1749
|
+
the desktop app, Claude Code badges. Only the permission prompts differ: a
|
|
1750
|
+
Claude Code or Codex pane an agent opens asks before running commands. A ZTC
|
|
1751
|
+
pane an agent opens gets the agent's task as a message to its own agent, never
|
|
1752
|
+
as a command it runs as yours, whether the task comes from `open_pane` or as
|
|
1753
|
+
words among the pane's arguments to ZTC's own `create_ztc_pane`,
|
|
1754
|
+
`create_supervised_ztc_pane` or `create_terminal_pane`, after a `--` there or
|
|
1755
|
+
not. Words after a `--` are only the task, which follows every flag of the
|
|
1756
|
+
pane's launch.
|
|
1757
|
+
|
|
1758
|
+
A ZTC agent can be given its own route: `open_pane` with `kind: "ztc"` takes
|
|
1759
|
+
`provider` (a name `/provider` lists, or `zergrouter:openai` for Zerg Router
|
|
1760
|
+
rather than your own key), `model` and `effort`. ZTC checks them against Zerg
|
|
1761
|
+
Router's list first, asking Router again before it believes a key is missing,
|
|
1762
|
+
and opens nothing when the route can't run: a model Router doesn't list for
|
|
1763
|
+
that provider, one Router has no key for on your account (with where the key
|
|
1764
|
+
goes), a provider with no key here, a local subscription login, a model id that
|
|
1765
|
+
starts with `-`, or an effort the model doesn't take. The worker starts on that
|
|
1766
|
+
route through its own launch flags; the default for new panes doesn't change.
|
|
1767
|
+
Named alone, a provider starts on the model you last used with it, else its
|
|
1768
|
+
default. ZTC's own `create_ztc_pane` refuses a Router route with no key the
|
|
1769
|
+
same way. On the route new panes start on, both check Router's list for the
|
|
1770
|
+
sign-in ZTC uses now: after a login in another pane, they read it once first,
|
|
1771
|
+
as `/ztc` does, so a model the new account has no key for opens nothing. With
|
|
1772
|
+
this ZTC's Router sign-in expired, or none, a ZTC worker on a Router route
|
|
1773
|
+
opens nothing, and both say to run `/auth login`.
|
|
1659
1774
|
|
|
1660
1775
|
In the desktop app, `Shift+Enter` and `Option+Enter` start a new line in
|
|
1661
1776
|
Claude Code's and Codex's prompts: the panes speak the kitty keyboard
|
|
@@ -1693,23 +1808,34 @@ it keeps that sign-in in the profile, so the CLI's sign-in in iTerm or Ghostty
|
|
|
1693
1808
|
doesn't change. Codex panes on a profile keep their sign-in in the profile's
|
|
1694
1809
|
files (`cli_auth_credentials_store="file"`). `/subs` lists your profiles, and
|
|
1695
1810
|
`/subs use claude|codex [profile]` sets the one new panes start on (no profile:
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1811
|
+
this computer's normal sign-in, the one the CLI uses in any other terminal). A
|
|
1812
|
+
pane on a profile is named after it (`Claude Code @work`). ZTC never reads what
|
|
1813
|
+
a CLI stores in a profile and never moves a pane to another profile on its own.
|
|
1814
|
+
A profile starts without your usual CLI settings, MCP servers or plugins, since
|
|
1815
|
+
those live in the CLI's default config directory.
|
|
1700
1816
|
|
|
1701
1817
|
#### In Zerg Router's Command Central
|
|
1702
1818
|
|
|
1703
|
-
With MotSi installed and its remote view on (`motsi remote view on`),
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1819
|
+
With MotSi installed and its remote view on (`motsi remote view on`), the
|
|
1820
|
+
panes you open from ZTC's menus and commands (ZTC agents, Claude Code, Codex,
|
|
1821
|
+
shells and custom panes, including those an agent opens through `ztc
|
|
1822
|
+
workspace-mcp`) start through `motsi run --title=<pane name> --`. Zerg
|
|
1823
|
+
Router's Command Central then lists each pane under its name and shows it live
|
|
1824
|
+
as a real terminal. MotSi redacts likely secrets on this computer before
|
|
1825
|
+
anything leaves it. Viewers can type into Claude Code and Codex panes, never
|
|
1826
|
+
into a shell; ZTC panes are watch-only there for now. Nothing leaves the
|
|
1827
|
+
computer while MotSi's remote view is off. To start panes without MotSi, set
|
|
1828
|
+
`panes.remoteView` to `false` in ZTC's config.
|
|
1829
|
+
|
|
1830
|
+
Some panes start without MotSi, so Command Central doesn't list them: Main
|
|
1831
|
+
(pane 0), native and delegated workers, panes ZTC's own agent opens with its
|
|
1832
|
+
pane tools, ZTC panes the web mirror creates, and saved ZTC sessions resumed
|
|
1833
|
+
into panes. Shells and command panes opened from the web mirror's + menu start
|
|
1834
|
+
through MotSi like the ones you open in ZTC. A custom pane whose program is
|
|
1835
|
+
MotSi itself (`motsi`, or `zrouter motsi`) starts without it too, so MotSi's
|
|
1836
|
+
account details stay on this computer. In a terminal, you can share the pane
|
|
1837
|
+
ZTC itself runs in by starting ZTC as `motsi run -- ztc`; the desktop app's
|
|
1838
|
+
Main isn't a terminal, so that doesn't apply there.
|
|
1713
1839
|
|
|
1714
1840
|
ZTC's own agent loop uses an Anthropic API key for Claude models (`/config key`
|
|
1715
1841
|
or `ANTHROPIC_API_KEY`). Anthropic's [legal and compliance
|
|
@@ -1820,11 +1946,16 @@ adjusted (`Work Account` becomes `Work-Account`) and one whose name is taken
|
|
|
1820
1946
|
gets a number (`personal-2`); the notice gives each profile's name. `~` in a saved path is read as
|
|
1821
1947
|
your home directory; an account saved with a relative path gets no profile, and
|
|
1822
1948
|
the notice says how to add it (`/accounts add claude_code <name> --path <dir>`).
|
|
1823
|
-
A directory that no longer exists is named, to sign in there again.
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1949
|
+
A directory that no longer exists is named, to sign in there again. Plain
|
|
1950
|
+
`/claude` stays on this computer's own Claude Code sign-in (the one MotSi or you
|
|
1951
|
+
keep in `~/.claude`); `/subs use claude <name>` makes a profile the default. An
|
|
1952
|
+
earlier release made the account you were using the default, so `/claude` asked
|
|
1953
|
+
to sign in again on a computer signed in normally: that default is cleared once,
|
|
1954
|
+
and Main says how to choose it again. A default you choose with `/subs use` from
|
|
1955
|
+
this release on stays; one chosen before it can't be told from the earlier
|
|
1956
|
+
release's, so it is cleared once too, and Main says so. An account on
|
|
1957
|
+
`~/.claude` is Claude Code's own sign-in, which `/claude` uses anyway.
|
|
1958
|
+
`/accounts use <old id>` still finds the profile an account became.
|
|
1828
1959
|
|
|
1829
1960
|
A run nobody watches (`--headless`, `-p`, `--json`, `--json-stream` or
|
|
1830
1961
|
`zerg-ztc-headless`) that asks for a retired route with `--provider claude_code`,
|
package/bin/zmux-darwin-arm64
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/ztc-llm-darwin-arm64
CHANGED
|
Binary file
|
package/bin/ztc-tts-darwin-arm64
CHANGED
|
Binary file
|
package/bin/ztc-tui-darwin-arm64
CHANGED
|
Binary file
|
package/bin/zterm-darwin-arm64
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/bin/zterm-darwin-arm64
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 33976912 bytes
|
|
4
|
+
sha256: 4a355af139ce60e357cd23ca97500c8c0a69c1689b56dc9a19f1c2a4d1a5017c
|
package/dist/App.js
CHANGED
|
@@ -1319,7 +1319,7 @@ export const App = () => {
|
|
|
1319
1319
|
metadata: (result.usage || result.reasoning)
|
|
1320
1320
|
? {
|
|
1321
1321
|
...(result.usage ? { usage: result.usage } : {}),
|
|
1322
|
-
...(result.reasoning ? { reasoningContent: result.reasoning } : {}),
|
|
1322
|
+
...(result.reasoning ? { reasoningContent: result.reasoning, reasoningModel: result.reasoningModel } : {}),
|
|
1323
1323
|
}
|
|
1324
1324
|
: undefined
|
|
1325
1325
|
});
|
|
@@ -1336,7 +1336,7 @@ export const App = () => {
|
|
|
1336
1336
|
return prev;
|
|
1337
1337
|
return prev.map((m, i) => i === lastIdx
|
|
1338
1338
|
? { ...m, ...(result.nativeContent ? { nativeContent: result.nativeContent, nativeModel: result.nativeModel, nativeContextId: result.nativeContextId } : {}),
|
|
1339
|
-
metadata: { ...m.metadata, ...(result.reasoning ? { reasoningContent: result.reasoning } : {}) } }
|
|
1339
|
+
metadata: { ...m.metadata, ...(result.reasoning ? { reasoningContent: result.reasoning, reasoningModel: result.reasoningModel } : {}) } }
|
|
1340
1340
|
: m);
|
|
1341
1341
|
});
|
|
1342
1342
|
}
|
package/dist/agent/agent.d.ts
CHANGED
|
@@ -186,6 +186,7 @@ export interface AgentRunResult {
|
|
|
186
186
|
usage?: TokenUsage;
|
|
187
187
|
stopReason: 'complete' | 'interactive' | 'max_iterations';
|
|
188
188
|
reasoning?: string;
|
|
189
|
+
reasoningModel?: string;
|
|
189
190
|
responseItems?: Array<Record<string, unknown>>;
|
|
190
191
|
nativeContent?: ContentBlock[];
|
|
191
192
|
nativeModel?: string;
|
|
@@ -207,6 +208,11 @@ export declare class AgentError extends Error {
|
|
|
207
208
|
code?: string | undefined;
|
|
208
209
|
constructor(message: string, code?: string | undefined, options?: ErrorOptions);
|
|
209
210
|
}
|
|
211
|
+
export declare const ROUTER_STREAM_LOST_CODE = "ROUTER_STREAM_LOST";
|
|
212
|
+
export declare class StreamLostError extends AgentError {
|
|
213
|
+
readonly partialMessage: string;
|
|
214
|
+
constructor(message: string, partialMessage: string, options?: ErrorOptions);
|
|
215
|
+
}
|
|
210
216
|
export declare class ContextOverflowError extends AgentError {
|
|
211
217
|
request: BackendRequest;
|
|
212
218
|
originalMessage: string;
|
|
@@ -224,9 +230,6 @@ export declare class Agent {
|
|
|
224
230
|
private midTurnCompactTokenBudget?;
|
|
225
231
|
/** Codex/GPT reasoning effort override; undefined = provider default. */
|
|
226
232
|
private _codexEffort?;
|
|
227
|
-
/** One-shot: the next request carries the output-limit note at this effort. */
|
|
228
|
-
/** The next request retries a discarded response: a note for the model, and lower effort when offered. */
|
|
229
|
-
private responseRetry;
|
|
230
233
|
/** The person's attempt (admitPersonRequest), waiting for the run that takes it: the next to start, or the one whose
|
|
231
234
|
* steering admitted it. */
|
|
232
235
|
private personRequestPending;
|
|
@@ -235,6 +238,13 @@ export declare class Agent {
|
|
|
235
238
|
private eventHandlers;
|
|
236
239
|
private toolEventSequence;
|
|
237
240
|
private backend;
|
|
241
|
+
/** The run that started last and is still running: what the handoff summary, steering and the execution facts asked
|
|
242
|
+
* for outside a run's own loop go by. Its loop passes its own RunTurn everywhere. */
|
|
243
|
+
private activeRun?;
|
|
244
|
+
/** The backend, model and output limit RUN's request goes with: its host policy's snapshot, else the agent's own. */
|
|
245
|
+
private turnBackend;
|
|
246
|
+
private turnModel;
|
|
247
|
+
private turnMaxTokens;
|
|
238
248
|
private policy;
|
|
239
249
|
private tracer;
|
|
240
250
|
private diagnostics;
|
|
@@ -249,6 +259,7 @@ export declare class Agent {
|
|
|
249
259
|
private _lastResponseStreamed;
|
|
250
260
|
private _cwd;
|
|
251
261
|
private _autoContinue;
|
|
262
|
+
private modelSupportsTools;
|
|
252
263
|
/** Auto-continues spent since the last tool run; reset per turn and per tool. */
|
|
253
264
|
private _consecutiveAutoContinues;
|
|
254
265
|
private _turnAutoContinues;
|
|
@@ -298,6 +309,8 @@ export declare class Agent {
|
|
|
298
309
|
private readonly approvalContext?;
|
|
299
310
|
private _hasCustomSystemPrompt;
|
|
300
311
|
private readonly _authenticationManagedByBackend;
|
|
312
|
+
/** The provider the caller named, whose own key this Agent sends; none for a credential a host brokers. */
|
|
313
|
+
private readonly keyProvider?;
|
|
301
314
|
constructor(config?: AgentConfig);
|
|
302
315
|
private questionHandler;
|
|
303
316
|
setAutoContinue(enabled: boolean): void;
|
|
@@ -430,6 +443,8 @@ export declare class Agent {
|
|
|
430
443
|
setPinnedTask(task: string): void;
|
|
431
444
|
/** Append the pinned task header (R7) to the static system prompt. */
|
|
432
445
|
getExecutionContext(): ExecutionContext;
|
|
446
|
+
/** The execution facts RUN's requests go with: its host policy's output limit, when one chose the model. */
|
|
447
|
+
private executionContext;
|
|
433
448
|
private systemWithTaskHeader;
|
|
434
449
|
private persistToolCheckpoint;
|
|
435
450
|
private checkpointPersistenceError;
|