@shardflux/cli 0.15.2 → 0.17.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.
- package/CHANGELOG.md +144 -14
- package/README.md +92 -7
- package/dist/acp-models.js +5 -1
- package/dist/agent-commands.d.ts +15 -1
- package/dist/agent-commands.js +84 -23
- package/dist/agent-models.d.ts +61 -0
- package/dist/agent-models.js +79 -0
- package/dist/agent-state.d.ts +10 -0
- package/dist/agent-state.js +13 -0
- package/dist/agent-target-commands.d.ts +13 -3
- package/dist/agent-target-commands.js +129 -23
- package/dist/agent-targets.d.ts +5 -0
- package/dist/agent-targets.js +14 -5
- package/dist/agent-terminal.d.ts +8 -0
- package/dist/agent-terminal.js +35 -2
- package/dist/args.d.ts +5 -1
- package/dist/args.js +74 -11
- package/dist/cli-proxy-forward.d.ts +45 -0
- package/dist/cli-proxy-forward.js +432 -0
- package/dist/cli-proxy-hub.d.ts +273 -0
- package/dist/cli-proxy-hub.js +749 -0
- package/dist/cli-proxy.d.ts +325 -0
- package/dist/cli-proxy.js +1016 -0
- package/dist/codex-cloud.d.ts +3 -0
- package/dist/codex-cloud.js +17 -5
- package/dist/command-center-actions.js +25 -1
- package/dist/commands.d.ts +22 -0
- package/dist/commands.js +54 -14
- package/dist/conversation-commands.js +6 -0
- package/dist/conversation-local.js +2 -2
- package/dist/conversation-stash.js +4 -3
- package/dist/conversation-terminal.d.ts +5 -0
- package/dist/conversation-terminal.js +54 -6
- package/dist/conversations.d.ts +31 -3
- package/dist/conversations.js +53 -10
- package/dist/device-approvals.d.ts +12 -0
- package/dist/device-approvals.js +73 -0
- package/dist/device-helper.d.ts +3 -1
- package/dist/device-helper.js +14 -4
- package/dist/errors.d.ts +7 -0
- package/dist/errors.js +12 -2
- package/dist/files-mirror.d.ts +164 -0
- package/dist/files-mirror.js +761 -0
- package/dist/handlers.js +5 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/linux-helper.d.ts +12 -0
- package/dist/linux-helper.js +88 -0
- package/dist/linux-terminal.d.ts +11 -0
- package/dist/linux-terminal.js +42 -0
- package/dist/main.js +38 -8
- package/dist/onboarding.d.ts +2 -0
- package/dist/onboarding.js +53 -5
- package/dist/registry.d.ts +2 -42
- package/dist/registry.js +6 -90
- package/dist/t3-launch.d.ts +37 -0
- package/dist/t3-launch.js +133 -0
- package/dist/t3-mode.d.ts +121 -0
- package/dist/t3-mode.js +654 -0
- package/dist/t3-phone.d.ts +17 -0
- package/dist/t3-phone.js +15 -0
- package/dist/t3-thread-script.d.ts +18 -0
- package/dist/t3-thread-script.js +245 -0
- package/dist/terminal-onboarding.d.ts +11 -0
- package/dist/terminal-onboarding.js +75 -0
- package/dist/thread-on-computer.d.ts +35 -0
- package/dist/thread-on-computer.js +206 -0
- package/dist/update.d.ts +1 -1
- package/dist/update.js +12 -1
- package/dist/wait-status.d.ts +22 -0
- package/dist/wait-status.js +59 -0
- package/dist/worktree-twin-engine.d.ts +125 -0
- package/dist/worktree-twin-engine.js +615 -0
- package/dist/worktree-twin-land.py +331 -0
- package/dist/worktree-twin.d.ts +313 -0
- package/dist/worktree-twin.js +843 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,149 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
## 0.17.0 (not yet published)
|
|
4
|
+
|
|
5
|
+
- Linux (Ubuntu 24.04, x64 and arm64): bare `shard` signs in and connects Claude/Codex in the terminal. The
|
|
6
|
+
systemd user helper keeps the live twin, files and conversation mirrors running; `shard device requests`,
|
|
7
|
+
`shard device approve <id>` and `shard device deny <id>` handle local approvals. Desktop launches open a terminal;
|
|
8
|
+
macOS keeps its extra menu bar app.
|
|
9
|
+
|
|
10
|
+
- A Codex project opens in T3 Code without a Claude sign-in (T3 shows Claude as signed out, and says how to sign in), and `--json` names the T3 Connect sign-in `shard` started for the phone (`t3_link.sign_in`, or `t3_link.needs_login` when this computer has no session).
|
|
11
|
+
- A conversation settles when its turn ends (`done` or `unresolved` right away) and its VM takes the next message.
|
|
12
|
+
`shard agents open`, `shard ./ --resume` and ACP reattach to that VM instead of resuming the conversation into a new
|
|
13
|
+
one, `shard agents computers` and `--on` offer its computer for new threads, Try locally keeps syncing across turns,
|
|
14
|
+
and the transcript mirror reads it once per change. A conversation has ended once its VM is removed, or it is
|
|
15
|
+
archived or discarded.
|
|
16
|
+
- The menu bar keeps running and updating your global install: running `shard` from a source checkout, a project's
|
|
17
|
+
`node_modules` or `npx` no longer replaces the install it records (`SHARDFLUX_RECORD_INSTALL=1` records any run).
|
|
18
|
+
- `--model <model>` and `--effort <level>` on `shard ./` and `shard agents new` (also with `--on` and `--in t3`)
|
|
19
|
+
(0.17.0+): a new Claude or Codex thread starts with that model and reasoning effort, such as `--model opus --effort
|
|
20
|
+
xhigh` or `--model gpt-6-astra --effort high`. The conversation keeps them across resumes and moves. `--json` adds
|
|
21
|
+
`model_choice: {model, effort, applied}`; a computer whose platform predates the choice starts the thread with the
|
|
22
|
+
agent's defaults and says so once. Unknown values are refused before anything starts.
|
|
23
|
+
- `shard agents targets --json` adds `models` (0.17.0+): for `claude` and `codex`, the `models` (`id`, `label`, `short`,
|
|
24
|
+
`description`), the `efforts` (`id`, `label`) and the agent's own `default` (`model`, `effort`; `null` where the
|
|
25
|
+
agent decides at start), so the menu bar and other apps show the same choices without hardcoding them.
|
|
26
|
+
- T3 Code mode: `shard agents new --in t3 --prompt-file <file>` (or `--prompt`) starts the first message as a thread in
|
|
27
|
+
T3 Code and brings T3 to the front. With T3's Shardflux provider (T3 builds with ACP providers) the thread is launched
|
|
28
|
+
on the running T3 and gets its own cloud VM; with T3 Code 0.0.45 it starts on the T3 server in the project VM, or with
|
|
29
|
+
`--on <conversation|computer>` on that computer's. `--image` attaches images to the first message; `--model` and
|
|
30
|
+
`--effort` take the same choices as every new thread. `--json` returns `{ target: "t3", mode, project, t3_thread_id,
|
|
31
|
+
conversation_id, workspace, opened: true, focused: false, model, effort }` with the model and effort T3 got. A
|
|
32
|
+
requested effort that T3 did not get is `effort: null` with `effort_reason`: `not_offered` (the model has no such
|
|
33
|
+
level) or `models_not_known` (with the Shardflux provider, before this project's first conversation on this computer
|
|
34
|
+
has shown its levels). Refusals have their own codes: `t3_not_installed`, `t3_not_connected`, `t3_server_unreachable`,
|
|
35
|
+
`t3_version_unsupported`, `t3_on_not_supported`, `t3_model_unavailable`, `t3_thread_failed`, and `t3_open_failed` for
|
|
36
|
+
a thread that started while T3 Code did not open; once the workspace, conversation or thread exists their `details`
|
|
37
|
+
name its `workspace_key`, `conversation_id` and `t3_thread_id`, so a client opens it instead of starting it again.
|
|
38
|
+
- `shard agents targets --json` reports T3 Code (`t3: { installed, mode, connected, version, last_used_at }`) and where
|
|
39
|
+
each app's new conversations open (`open_in: { claude, codex }`). `--open-in claude=t3,codex=t3` saves the choice
|
|
40
|
+
(Claude: terminal, claude-desktop, web or t3; Codex: codex-app or t3). Without one, T3 is the default when it is
|
|
41
|
+
connected (the Shardflux provider registered and this computer signed in; with T3 Code 0.0.45, this project set up
|
|
42
|
+
as a T3 environment from this computer) and the most recently used of the installed apps. `shard ./` and `--in auto`
|
|
43
|
+
open new conversations there, a conversation as itself. `--path <folder>` reports them for that project (as
|
|
44
|
+
`agents new --path` names it); an agent argument wins over it.
|
|
45
|
+
- `shard agents open t3 <conversation>` brings the conversation's T3 thread back (`t3_thread_id`) and, like
|
|
46
|
+
`agents open t3 <workspace>`, opens T3 with `--json` too (`opened: true`).
|
|
47
|
+
- JSON errors that come with a next step carry it as `error.fix`.
|
|
48
|
+
- T3 Code on your phone: `shard agents new --in t3` and `shard agents open t3` also add the project to the T3 app as **Shardflux · <project>**. The first time, open the link it prints and confirm the code once; every later project appears by itself. A message from the app wakes the VM.
|
|
49
|
+
- `shard cli-proxy import` moves CLIProxyAPI from this computer into your account: one hosted copy holds your Claude, Codex and other subscription logins, sleeps between requests and wakes on the next one. This computer and every new VM reach it at `http://127.0.0.1:8317`, so Claude Code (`ANTHROPIC_BASE_URL`), Codex (`base_url …/v1`) and T3 Code's usage view keep their settings; streaming responses and WebSockets pass through.
|
|
50
|
+
- The hosted copy is made from your own config: client API keys, routing, retries, model aliases and upstream keys carry over, and your management key keeps working.
|
|
51
|
+
- Your local CLIProxyAPI stops for good on the port its config names: a Homebrew service with `brew services stop`; after you confirm (`--yes` for scripts), a launchd agent (stopped, disabled, its plist set aside), a Docker container (`docker stop`) or a process. Only a program recognized as CLIProxyAPI is ever stopped; anything else on the port is named with the command to run.
|
|
52
|
+
- Your auth files move to the hub, and the local copies move to `<auth folder>.moved-to-shardflux` (0700), where no CLIProxyAPI reads them.
|
|
53
|
+
- Run it on a second computer to connect that one too: it adds only the accounts that are new to the hub, names them, and keeps the hub's settings. Every project of your account uses the same hosted copy. `--config <path>` names the config when it is somewhere else.
|
|
54
|
+
- VMs receive only the address of the hub's VM port, which serves the model routes (OpenAI, Claude, Gemini and Codex, WebSockets included) and nothing else; the hub's logins and settings are managed from the computers that set it up. A second computer's logins are matched to the hub's by account (provider plus every account, organization, workspace and project id and email the auth file names), whatever the file names, so two accounts of one email both move.
|
|
55
|
+
- `shard cli-proxy export` brings your logins back to this computer: the hosted copy stops first, the logins it last refreshed are written to your auth folder (0600), this computer stops forwarding, and the command that starts your local CLIProxyAPI is shown. `shard cli-proxy import` moves them back.
|
|
56
|
+
- `shard cli-proxy` shows the hosted copy: its accounts (provider and email), whether it is running or sleeping, and where it is reachable, in a VM too. It starts CLIProxyAPI again when the hub answers that nothing listens. `--json` for scripts.
|
|
57
|
+
- Revoking an API key keeps the hub reachable: when its address was created with that key, the next request through this computer, `shard cli-proxy` or an import gives the hub a new address, uses it at once and passes it to every new VM.
|
|
58
|
+
- On macOS the forwarder runs as the launchd agent `dev.shardflux.cli-proxy-forward` (at login, kept running, restarted when `shard` is updated). A request the hub did not receive (while it wakes or CLIProxyAPI starts again) is sent again, POST bodies included up to 32 MiB; a client that disconnects ends its request to the hub.
|
|
59
|
+
- For onboarding: `detectLocalCliProxy()` and `importCliProxy(ctx)` are exported.
|
|
60
|
+
|
|
61
|
+
- A finished conversation lands in your checkout as soon as its turn ends: the menu bar's helper keeps one wait per
|
|
62
|
+
active conversation and hears the finished turn the moment the conversation reports it (no polling every second).
|
|
63
|
+
Conversations that finish together for the same branch land in one go, in the order they finished.
|
|
64
|
+
|
|
65
|
+
## 0.16.0 (not yet published)
|
|
66
|
+
|
|
67
|
+
- Cloud sessions are named for the work: `shard ./` starts the agent with the repository or folder name and the first
|
|
68
|
+
line of your prompt, so claude.ai, the Claude app and its notifications show `Add CSV export · todo-app`
|
|
69
|
+
(`New conversation · todo-app` until the first prompt arrives) instead of the project slug and conversation id.
|
|
70
|
+
Claude Desktop and Codex app targets are listed as `main · acme`, without the `[SF] ` tag.
|
|
71
|
+
|
|
72
|
+
- Updates show up the moment they are published (also in 0.15.2): the latest version comes from npm's `latest` tag
|
|
73
|
+
(what `npm i -g shardflux` installs), checked at most every 12 hours with its ETag. The API still says which
|
|
74
|
+
versions it supports, and can hold back a release. Offline, nothing is printed. `shard update --check` and the menu
|
|
75
|
+
bar's update check use the same versions.
|
|
76
|
+
- The menu bar keeps up with npm by itself (also in 0.15.2): after `npm i -g shardflux`, every `shard` command compares
|
|
77
|
+
the installed app with the one the package carries (two Info.plist reads, no network) and, when that one is newer,
|
|
78
|
+
brings it in in the background: a stopped app is replaced on disk, a running one is left to update itself (menu bar
|
|
79
|
+
0.3.2+) or, for earlier apps, restarted on the new version when none of its windows is open. `shard update` swaps in
|
|
80
|
+
an app the package already carries without another install. App versions compare as semver (0.3.10 after 0.3.9).
|
|
81
|
+
|
|
82
|
+
- A new thread on an existing computer: `shard agents new --app claude|codex --on <ref>` and `shard ./ --on <ref>`
|
|
83
|
+
start Claude or Codex on the computer (VM) of an existing conversation instead of a new one. The thread works on its
|
|
84
|
+
own branch and worktree there, starting from that conversation's committed `HEAD`, and shares the computer's
|
|
85
|
+
installed packages, caches, running services, ports and files. `<ref>` is a conversation id, key or name, or the
|
|
86
|
+
computer's workspace key or id; a parked computer wakes for it. Codex threads are genuine Codex Cloud threads.
|
|
87
|
+
`--review` starts a read-only Claude reviewer of that conversation's worktree instead. `--prompt`, `--prompt-file`
|
|
88
|
+
and `--image` work as for a new conversation.
|
|
89
|
+
- `shard agents computers [--path <folder>]` lists the project's computers a thread can start on and the threads on
|
|
90
|
+
each (`--json`: `{computers: [{workspace_id, workspace_key, state, conversations: [...]}]}`).
|
|
91
|
+
- `shard agents list` shows each session's CONVERSATION and COMPUTER; `--json` rows add `conversation_id` and
|
|
92
|
+
`conversation_key`. `agents open <conversation> --in auto` opens that conversation's own Claude session when its
|
|
93
|
+
computer runs several, and the `--json` of a started Claude conversation names its `conversation.id`.
|
|
94
|
+
- A conversation's files folder starts from its own seed, also when several threads share one computer.
|
|
95
|
+
|
|
96
|
+
- Waits show where a queued start stands: while a command waits on an operation whose start is queued for capacity,
|
|
97
|
+
one line on stderr gives its place, the host being started for it and until when it holds its place
|
|
98
|
+
(`queued for capacity (position 3): a new host is starting, ready by 21:40Z; it holds its place until 21:51Z`),
|
|
99
|
+
again whenever that changes. Dim on a terminal, plain when piped, never with `--json`. A command waiting for room on
|
|
100
|
+
the workspace's host or for a free working slot of the plan says so the same way.
|
|
101
|
+
|
|
102
|
+
- **Breaking:** queued starts are seen through: without `--timeout` (or `--wake-timeout`), a wait whose start is queued for capacity
|
|
103
|
+
keeps waiting until the start's deadline instead of exiting at the default 5 minutes (or 2 minutes for a wake). An
|
|
104
|
+
explicit `--timeout`, `--wake-timeout` or `SHARDFLUX_WAKE_TIMEOUT_MS` is kept as given; its timeout error (exit 5)
|
|
105
|
+
names the queue position, and `--json` adds `last_reason`, `deadline_at` and `queue_position`.
|
|
106
|
+
|
|
107
|
+
- Commands wait for room instead of failing (SDK 0.22.0): a call refused before it ran while the workspace's host makes
|
|
108
|
+
room (503 `host_capacity`) or while every workspace the plan lets work at once is busy (429 `quota_exceeded`) is sent
|
|
109
|
+
again after each `Retry-After` for up to 2 minutes, `ws exec` starts and `ws open` included.
|
|
110
|
+
|
|
111
|
+
- The agent terminal (`shard ./`, `shard agents open --in terminal`) waits `Retry-After` when the workspace's host is
|
|
112
|
+
making room, says `waiting for room on the workspace's host (position N)` once, and after a drop that follows a
|
|
113
|
+
working attach reconnects from the shortest backoff again.
|
|
114
|
+
|
|
115
|
+
- Every conversation's committed files on your Mac: while the menu bar app runs, its device helper keeps
|
|
116
|
+
`~/Shardflux/<repository>/<base branch>/<conversation>/` in step with what each conversation of your account
|
|
117
|
+
committed, read-only and without prompts. A folder holds the files that conversation changed or added since it
|
|
118
|
+
started (`.shardflux-manifest.json` lists them, deletions included); the base branch moving, a rebase, and the
|
|
119
|
+
uncommitted edits your worktree had when the conversation started are left out. All worktrees of one repository are
|
|
120
|
+
one `<repository>` folder. Files above 50 MB, and files past 2 GB per conversation, are listed as
|
|
121
|
+
`<file>.placeholder.txt`; set `max_file_mb` and `max_conversation_mb` in the repository's `.shardflux/files.yaml`.
|
|
122
|
+
A landed conversation's folder is marked `landed` and stops updating; a discarded one is removed. Your own
|
|
123
|
+
checkouts are never written.
|
|
124
|
+
|
|
125
|
+
- `shard files pull <conversation> <path>` downloads one listed file in place of its placeholder, whatever its size.
|
|
126
|
+
|
|
127
|
+
- New conversations record the working tree they start from (a seed snapshot made in the conversation's VM, never on
|
|
128
|
+
your Mac) and the base branch they start on.
|
|
129
|
+
|
|
130
|
+
- Finished conversations land in your local checkout with no input: while the menu bar app runs, a conversation
|
|
131
|
+
whose turn ends with its work committed lands into the branch it started from. The branch moves to its commits
|
|
132
|
+
(fast-forward, or its commits replayed onto your newer ones) and the files it changed are written atomically in the
|
|
133
|
+
worktree where that branch is checked out, three-way merged with your uncommitted edits (your text wins where both
|
|
134
|
+
changed the same lines). The index follows, so `git status` shows only your own edits. A file is written only after
|
|
135
|
+
2 seconds without a change, never while your own merge, rebase, cherry-pick or bisect runs, and every rewritten file
|
|
136
|
+
is backed up first (`shard conversations landing backups`, `restore <backup>`; kept 14 days, up to 1 GiB). When the
|
|
137
|
+
conversation's commits conflict with your newer commits, its agent is asked in that conversation to merge your
|
|
138
|
+
branch and resolve; the result lands when it finishes. `shard conversations landing pr` opens a pull request
|
|
139
|
+
instead; `off` keeps conversations in the cloud. Conversations that finish while your computer is offline or asleep
|
|
140
|
+
land the moment it is back, one after another in the order they finished, also when their VM has been reclaimed.
|
|
141
|
+
|
|
142
|
+
- A conversation started from a checkout with uncommitted edits starts from them: its base is a snapshot commit of
|
|
143
|
+
your working tree (kept as `refs/shard/twin/<id>` in your repository; your index, HEAD and branches are not
|
|
144
|
+
touched), so its own commits hold only its work and your edits stay yours.
|
|
145
|
+
|
|
146
|
+
- Includes SDK 0.22.0.
|
|
15
147
|
|
|
16
148
|
## 0.15.1
|
|
17
149
|
|
|
@@ -238,7 +370,6 @@
|
|
|
238
370
|
|
|
239
371
|
## 0.12.0 (not yet published)
|
|
240
372
|
|
|
241
|
-
|
|
242
373
|
- Add `cpu-service-fresh-inputs-v1` with `fresh_env_names`: fresh owned startup hooks/children consume allowed task values while immutable CPU initialization stays credential-free. Relevant or secret inputs retain ordinary startup.
|
|
243
374
|
|
|
244
375
|
- Add explicit `pasteText` clipboard replacement with an application paste chord, LF-to-Return typing repair and unchanged screenshot settling.
|
|
@@ -246,7 +377,6 @@
|
|
|
246
377
|
Every command and option the README shows is available from the version named here. Breaking changes ship in minor
|
|
247
378
|
releases and are marked **Breaking**.
|
|
248
379
|
|
|
249
|
-
|
|
250
380
|
- Accept caller-supplied exact desktop pixel predicates without an environment gate. Completion uses the same frozen full frame encoded as PNG; pre-satisfied refusal and timeout return no success image. Omitted predicates retain 250 ms settling.
|
|
251
381
|
- Preserve explicit `initialized_cpu` service declarations through template YAML build/export/edit transport, matching SDK0.17.0.
|
|
252
382
|
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ See the [support guide](https://github.com/shardfluxdev/community/blob/main/SUPP
|
|
|
26
26
|
|
|
27
27
|
## Command center (0.15.0+)
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
On macOS, run `shard` in a terminal to see live conversations. Press **Enter** to open the selected one, **/** to search,
|
|
30
30
|
**D** to expand or collapse finished conversations, and **?** for targets, logs, fork, park and Git actions.
|
|
31
31
|
Press **n** to start a conversation: describe the task, confirm a local project folder, then choose Claude or Codex.
|
|
32
32
|
Both the task and project are required, and the task becomes the first user-authored message. **Esc** cancels;
|
|
@@ -50,6 +50,18 @@ Bulk transfers batch writes automatically. Active transfers retain their byte po
|
|
|
50
50
|
|
|
51
51
|
## Install
|
|
52
52
|
|
|
53
|
+
Linux (Ubuntu 24.04, x64 and arm64) and macOS are supported. On Linux, run `shard` to sign in and
|
|
54
|
+
connect Claude, Codex or both (0.17.0+), then run `shard ./` in your project to attach Claude Code or Codex in place. Sign-in opens your browser;
|
|
55
|
+
on a headless terminal, follow the displayed URL and device code. `--accept-terms` accepts the terms notice.
|
|
56
|
+
|
|
57
|
+
The Linux helper starts automatically after setup as `~/.config/systemd/user/shardflux-helper.service`
|
|
58
|
+
and restarts after a CLI update. It keeps the live twin, `~/Shardflux` files and conversation history in sync.
|
|
59
|
+
Use `shard device requests`, `shard device approve <id>` or `shard device deny <id>` for local approvals;
|
|
60
|
+
desktop notifications point to pending requests. On systems without a systemd user session, the helper runs
|
|
61
|
+
while your `shard` commands are open. `shard agents open` opens a terminal when launched outside one, using
|
|
62
|
+
`$TERMINAL`, `x-terminal-emulator` or `gnome-terminal`, or prints the attach command. The Mac app adds a menu
|
|
63
|
+
bar, launcher and Settings window.
|
|
64
|
+
|
|
53
65
|
```sh
|
|
54
66
|
npm i -g shardflux
|
|
55
67
|
shard --help
|
|
@@ -70,7 +82,7 @@ shard ./
|
|
|
70
82
|
|
|
71
83
|
Choose Claude Code or Codex. Claude asks for one cloud sign-in per Shardflux account; Codex uses your copied login.
|
|
72
84
|
Each `shard ./` starts its own conversation VM and opens your agent’s native terminal. Later turns stay in that
|
|
73
|
-
VM; `shard ./ --resume` selects a saved project conversation. Native terminal and ACP sessions receive the conversation tools for their own conversation, so the agent can fork, ask for a review, and report to its parent (0.14.0+). You can open conversations in separate terminals at the same time; each stays in the project's local history. `shard` opens the optional command center. On macOS the menu bar starts automatically the first
|
|
85
|
+
VM; `shard ./ --resume` selects a saved project conversation. Native terminal and ACP sessions receive the conversation tools for their own conversation, so the agent can fork, ask for a review, and report to its parent (0.14.0+). You can open conversations in separate terminals at the same time; each stays in the project's local history. On macOS, `shard` opens the optional command center. On macOS the menu bar starts automatically the first
|
|
74
86
|
time `shard` runs, with launch at login enabled; `shard menubar stop` turns it off. See [Cloud agents](https://docs.shardflux.dev/guides/cloud-agents).
|
|
75
87
|
|
|
76
88
|
T3 Code uses one **Shardflux** provider; choose a Claude Code or Codex model to start that agent in the cloud.
|
|
@@ -80,6 +92,46 @@ settings: T3 runs `shard acp --login` in its own terminal, which creates or sign
|
|
|
80
92
|
Codex login, or your email) and connects Claude Code and Codex, skipping every step that is already done (0.15.0+).
|
|
81
93
|
With T3 Code 0.0.45, `shard agents new --in t3` adds the project as an SSH environment instead.
|
|
82
94
|
|
|
95
|
+
Start another thread on a computer that is already set up (0.16.0+): it shares that conversation's installed
|
|
96
|
+
packages, caches, running services, ports and files, and works on its own branch and worktree.
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
shard agents computers # the project's computers and the threads on each
|
|
100
|
+
shard ./ --on fix-login # Claude (or Codex) joins the computer of conversation fix-login
|
|
101
|
+
shard agents new --app codex --on fix-login --prompt "Load-test the API it is running"
|
|
102
|
+
shard ./ --on fix-login --review # a read-only Claude reviewer of its worktree
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`--on` takes a conversation's id, key or name, or the computer's workspace key or id. A parked computer wakes for
|
|
106
|
+
the new thread. Codex threads are Codex Cloud threads, on the web and your phone too. `shard agents list` shows each
|
|
107
|
+
thread's conversation and computer.
|
|
108
|
+
|
|
109
|
+
Choose the model and reasoning effort a new thread starts with (0.17.0+):
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
shard ./ --model opus --effort xhigh # Claude Opus at extra-high effort
|
|
113
|
+
shard ./ codex --model gpt-6-astra --effort high
|
|
114
|
+
shard agents new --app claude --path ./ --model sonnet --prompt "Tidy the README" --json
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Claude takes `fable`, `opus`, `sonnet` or `haiku` and `low`, `medium`, `high`, `xhigh` or `max`; Codex takes
|
|
118
|
+
`gpt-6.1-sol`, `gpt-6-astra` or `gpt-6-luna` and the same levels plus `ultra`. `default`, or leaving the flag out,
|
|
119
|
+
keeps the agent's own choice. The conversation keeps its model and effort when it is resumed or moved, and `--json`
|
|
120
|
+
adds `model_choice: {model, effort, applied}`. `shard agents targets --json` lists the choices as `models`, with menu
|
|
121
|
+
and pill text and the agent's own default, so apps never hardcode them. `--in t3` passes them to T3 Code.
|
|
122
|
+
|
|
123
|
+
Start a thread in T3 Code from the command line (0.17.0+):
|
|
124
|
+
|
|
125
|
+
```sh
|
|
126
|
+
shard agents new --path . --app claude --in t3 --prompt-file task.md
|
|
127
|
+
shard agents targets --open-in claude=t3,codex=t3 # shard ./ starts new conversations in T3 Code
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The first message becomes a T3 thread and T3 comes to the front. With the Shardflux provider the thread runs in its own
|
|
131
|
+
cloud VM; with T3 Code 0.0.45 it runs on the T3 server in the project's VM, or with `--on` on that computer's.
|
|
132
|
+
`--image` attaches images. `shard agents targets --json` shows T3 Code's mode and where each app's new conversations
|
|
133
|
+
open; `shard agents open t3 <conversation>` brings its thread back.
|
|
134
|
+
|
|
83
135
|
Git fetch and push use the coding guest’s platform transport when available, preserving Git’s binary packets (0.14.0+). Older guests retain their existing transport.
|
|
84
136
|
|
|
85
137
|
To try a conversation on your Mac:
|
|
@@ -90,10 +142,30 @@ shard conversations try <conversation>
|
|
|
90
142
|
|
|
91
143
|
Your branch opens in `.shard/worktrees/<name>`, syncs both ways, and its dev servers appear at localhost.
|
|
92
144
|
Ctrl-C stops local sync. Your main checkout stays available for your own work.
|
|
93
|
-
Device tools ask for approval on your
|
|
145
|
+
Device tools ask for approval on your computer before preparing the conversation’s local worktree. With CLI 0.15.0 and menu bar 0.3.0, Review shows the exact command, file direction, paths or port mapping; access outside the conversation folder only offers Allow once. Live transcripts stay in
|
|
94
146
|
`~/.config/shardflux/conversations/`; ended sessions enter Claude Code’s or Codex’s native history. Transcript files up to 64 MiB are supported (0.14.0+).
|
|
95
147
|
From 0.14.3, transcript copying runs independently of device approvals. Unknown entries are skipped, and failed copies retry with backoff; diagnostics name the conversation and affected entry.
|
|
96
148
|
|
|
149
|
+
Every conversation's committed files are on your computer too (with the helper running; macOS 0.16.0+, Linux 0.17.0+):
|
|
150
|
+
`~/Shardflux/<repository>/<base branch>/<conversation>/` holds what each conversation changed or added, read-only,
|
|
151
|
+
and updates when its branch moves. Large files are listed as `<file>.placeholder.txt`; download one with the menu
|
|
152
|
+
bar's **Download** or:
|
|
153
|
+
|
|
154
|
+
```sh
|
|
155
|
+
shard files pull hype-video out/hype.mp4
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Finished conversations land in your checkout by themselves (0.16.0+, with the menu bar app running). When a
|
|
159
|
+
conversation's turn ends with its work committed, the branch it started from moves to its commits and the changed
|
|
160
|
+
files are written in place, next to your own uncommitted edits, which stay as they are (where both touched the same
|
|
161
|
+
lines, your text is kept). `git status` keeps showing only your edits. A conversation started from a checkout with
|
|
162
|
+
uncommitted edits starts from them too. Every rewritten file is backed up first:
|
|
163
|
+
|
|
164
|
+
```sh
|
|
165
|
+
shard conversations landing # auto (default), pr or off for this project
|
|
166
|
+
shard conversations landing backups # then: shard conversations landing restore <backup>
|
|
167
|
+
```
|
|
168
|
+
|
|
97
169
|
For application workspace commands, `shard signup` creates an account and saves a project key, or set
|
|
98
170
|
`SHARDFLUX_API_KEY` to a key from the console and run `shard login`. `shard --help` lists every command.
|
|
99
171
|
|
|
@@ -692,7 +764,11 @@ without waking it (the state at suspension); `files search` then notes it on std
|
|
|
692
764
|
- `--wake-timeout <ms>` (or `SHARDFLUX_WAKE_TIMEOUT_MS`, default `120000`) bounds the wait. Past
|
|
693
765
|
it, `shard` exits 5 and names the operation and its state (for example `Operation <id> (open)
|
|
694
766
|
is still queued after 120000 ms`). The operation continues server side:
|
|
695
|
-
`shard operations wait <id>` keeps waiting.
|
|
767
|
+
`shard operations wait <id>` keeps waiting. Without either (0.16.0+), a resume queued for capacity is waited for
|
|
768
|
+
until its deadline, its place shown on stderr (see [Start deadlines](#start-deadlines)).
|
|
769
|
+
- A call refused while the workspace's host makes room to wake it (503 `host_capacity`) or while every workspace the
|
|
770
|
+
plan lets work at once is busy (429 `quota_exceeded`) did not run: `shard` sends it again after each `Retry-After`,
|
|
771
|
+
for up to 2 minutes (0.16.0+), and stderr says `waiting for room on the workspace's host (position 2)` once.
|
|
696
772
|
- A resume or open that fails exits 6.
|
|
697
773
|
- `--no-wake` (or `SHARDFLUX_NO_WAKE=1`) turns this off. A workspace that is not running is then
|
|
698
774
|
refused at once (exit 1, `workspace_not_running`).
|
|
@@ -875,7 +951,16 @@ that screenshot, default 250) and `--format jpeg --quality N` for smaller images
|
|
|
875
951
|
## Start deadlines
|
|
876
952
|
|
|
877
953
|
A queued open, resume or fork (`capacity_pending`) has a deadline 15 minutes after it was created.
|
|
878
|
-
|
|
954
|
+
While `shard` waits for it, stderr says where it stands (0.16.0+), again whenever that changes (dim on a terminal,
|
|
955
|
+
never with `--json`):
|
|
956
|
+
|
|
957
|
+
```text
|
|
958
|
+
queued for capacity (position 3): a new host is starting, ready by 21:40Z; it holds its place until 21:51Z
|
|
959
|
+
```
|
|
960
|
+
|
|
961
|
+
Without `--timeout`, a queued start is waited for until its deadline (0.16.0+). An explicit `--timeout` is kept: if it
|
|
962
|
+
ends first, `shard` exits 5 and the timeout error names the deadline and the queue position (`--json`:
|
|
963
|
+
`deadline_at`, `queue_position`, `last_reason`). A start still pending at the
|
|
879
964
|
deadline fails with `capacity_unavailable`: nothing was started, and a suspended workspace stays
|
|
880
965
|
suspended. `shard` exits 6 as for any failed operation, and the error says `retryable=true` (with
|
|
881
966
|
`--json`, `"retryable": true`) with a hint to retry:
|
|
@@ -1047,7 +1132,7 @@ printf %s "$NEW_KEY" | shard secrets rotate OPENAI_API_KEY
|
|
|
1047
1132
|
| 2 | usage error: bad arguments, or input the API rejected as `validation_failed` |
|
|
1048
1133
|
| 3 | not found: workspace, operation or route |
|
|
1049
1134
|
| 4 | authentication or authorization: missing, malformed, revoked or insufficient key or session; `step_up_required` (run `shard auth step-up`), `mfa_required` (a sign-in waiting for its code), `email_unverified`, `invalid_credentials`; `access_denied` or `expired_token` from `auth login --browser` (0.15.0+) |
|
|
1050
|
-
| 5 | timeout: waiting gave up (`--timeout`, or `--wake-timeout` while waking a workspace); the operation continues server side (`shard operations wait <id>`), up to a queued start's
|
|
1135
|
+
| 5 | timeout: waiting gave up (`--timeout`, or `--wake-timeout` while waking a workspace); the operation continues server side (`shard operations wait <id>`), up to a queued start's deadline (`deadline_at`). Without `--timeout`, a wait on a start queued for capacity lasts until that deadline (0.16.0+). `executions get` (0.5.0+): the execution is still queued or running. `ws exec-read` (0.8.0+): the background command still runs. `billing upgrade --wait` (0.5.0+): nobody paid in time (the checkout stays open) |
|
|
1051
1136
|
| 6 | the awaited operation ended `failed` or `canceled` (also a resume or open that failed while waking a workspace). `retryable=true` in the error means a retry can succeed (`capacity_unavailable`). Also a file-first execution that ended `failed` or `lost` (0.5.0+): nothing was published. `exec` (0.5.1+): the command could not start (`exec_failed_to_start`). `billing upgrade --wait` (0.5.0+): the checkout expired or was canceled (`checkout_ended`) |
|
|
1052
1137
|
| 130 | interrupted (Ctrl-C). Waits stop at once, and exec sends a cancel to the session. A file-first execution runs to completion, and the error names the `shard executions get` command for its result. |
|
|
1053
1138
|
| exec, executions get, ws exec-read | the command's own code: 124 if it timed out, 128+N if killed by signal N. Failures before the command ran use the codes above; use `--json` to tell them apart. |
|
|
@@ -1205,7 +1290,7 @@ connection it configured and the file it is in (0.13.3+).
|
|
|
1205
1290
|
|
|
1206
1291
|
`shard agents fork` or `f` in the command center copies the whole running state into an independent workspace and
|
|
1207
1292
|
conversation. Open in your terminal, Claude Desktop or the Codex app, and the terminal Claude conversation in
|
|
1208
|
-
claude.ai or mobile.
|
|
1293
|
+
claude.ai or mobile. Sessions are titled with their task and repository, like `Add CSV export · todo-app`. Waiting agents stay reachable on their own connections;
|
|
1209
1294
|
see the [settings and billing reference](https://docs.shardflux.dev/limits#cloud-agent-reachability).
|
|
1210
1295
|
Claude needs one cloud sign-in per account; Codex uses your copied login.
|
|
1211
1296
|
|
package/dist/acp-models.js
CHANGED
|
@@ -7,6 +7,8 @@ import { createConversationRecord, conversationWorkspace } from "./conversations
|
|
|
7
7
|
import { AgentStateStore } from "./agent-state.js";
|
|
8
8
|
import { objectValue } from "./acp-rpc.js";
|
|
9
9
|
import { nativeCurrentModel, nativeModelOptions } from "./acp-catalog.js";
|
|
10
|
+
import { recordSeedSnapshot } from "./files-mirror.js";
|
|
11
|
+
import { sendTwinSeed, twinCheckoutArgv } from "./worktree-twin.js";
|
|
10
12
|
/** No prompts, login, logout or credential writes. Every child process group is
|
|
11
13
|
* terminated, including initialization failures and interrupted clients. */
|
|
12
14
|
export const ACP_MODELS_SCRIPT = String.raw `
|
|
@@ -143,9 +145,11 @@ export const ACP_LIFECYCLE = { async prepare(ctx, folder, name, callbacks) {
|
|
|
143
145
|
const seeded = (async () => {
|
|
144
146
|
await seedAgentRepository(ctx, ws, folder, { root: c.worktree_path, populate: true,
|
|
145
147
|
initialFiles: ['.claude/settings.json', '.claude/settings.local.json', '.codex/config.toml', '.mcp.json'], onInitialFiles: initialReady });
|
|
146
|
-
|
|
148
|
+
await sendTwinSeed(ctx.store.dir, ws.cell(), c, folder, ctx.signal);
|
|
149
|
+
const result = await ws.cell().exec.run(twinCheckoutArgv(ctx.store.dir, c), { timeoutMs: 30_000, signal: ctx.signal });
|
|
147
150
|
if (result.exitCode !== 0)
|
|
148
151
|
throw new Error(`Conversation branch could not be prepared: ${result.stderr.trim()}`);
|
|
152
|
+
await recordSeedSnapshot(ws, c, ctx.signal);
|
|
149
153
|
callbacks.prepared();
|
|
150
154
|
})();
|
|
151
155
|
void seeded.catch(initialFailed);
|
package/dist/agent-commands.d.ts
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
import type { CellClient, PtySession, Workspace } from '@shardflux/sdk';
|
|
2
2
|
import type { Ctx, Handler } from './commands.js';
|
|
3
3
|
import type { Values } from './args.js';
|
|
4
|
+
import type { T3Install, T3ThreadRequest } from './t3-mode.js';
|
|
5
|
+
import type { ModelChoice } from './agent-models.js';
|
|
4
6
|
/** `<slug>-<6 hex of sha256(identity)>`: the same repository gets the same key on every machine. */
|
|
5
7
|
export declare function disambiguatedSlug(slug: string, identity: string): string;
|
|
6
8
|
export declare function projectTemplate(ctx: Ctx, remote: string | null): Promise<string>;
|
|
7
|
-
|
|
9
|
+
/** `place` is the repository or folder name session titles end with ("todo-app"), `task` what a new session is titled
|
|
10
|
+
* with before the guest names it from its first prompt (a first prompt line or the conversation's title). */
|
|
11
|
+
export declare function agentPty(cell: CellClient, app: 'claude' | 'codex', agent: string, approvals: boolean, term: string, signal?: AbortSignal, place?: string, setupHash?: string, cwd?: string, ptyName?: string, onLaunch?: () => void, deferSetup?: boolean, conversation?: {
|
|
8
12
|
id: string;
|
|
9
13
|
session: string | null;
|
|
14
|
+
}, task?: string, launch?: {
|
|
15
|
+
choice?: ModelChoice;
|
|
16
|
+
help?: () => Promise<string>;
|
|
10
17
|
}): Promise<PtySession>;
|
|
18
|
+
/** The first non-empty line of a prompt or title, bounded; the guest makes it the task part of the session title. */
|
|
19
|
+
export declare function sessionTask(text: string | undefined): string | undefined;
|
|
11
20
|
export declare function terminal(ctx: Ctx, ws: Workspace, app: 'claude' | 'codex', agent: string, project: string, values: Values, setupHash?: string, cwd?: string, conversation?: {
|
|
12
21
|
id: string;
|
|
13
22
|
session: string | null;
|
|
23
|
+
pty?: string;
|
|
24
|
+
title?: string;
|
|
25
|
+
choice?: ModelChoice;
|
|
14
26
|
}): Promise<number>;
|
|
15
27
|
export declare const launchProject: Handler;
|
|
28
|
+
/** The project VM launch; with `--in t3` a first message becomes a thread on the T3 server in it (SSH mode, 0.17.0+). */
|
|
29
|
+
export declare function launchProjectWith(ctx: Ctx, values: Values, [path, explicitApp]: string[], thread?: T3ThreadRequest, install?: T3Install): Promise<number>;
|
|
16
30
|
export declare const AGENT_HANDLERS: Record<string, Handler>;
|