dispach 0.1.1 → 0.1.3
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 +188 -80
- package/dist/App-qfqvx9c7.js +11 -0
- package/dist/{App-5a35bjkt.js.map → App-qfqvx9c7.js.map} +6 -7
- package/dist/ConfigEditor-apcnj4nj.js +6 -0
- package/dist/{ConfigEditor-7nnc2ke6.js.map → ConfigEditor-apcnj4nj.js.map} +2 -2
- package/dist/KeyProbe-ya5t3v3v.js +5 -0
- package/dist/{KeyProbe-kbz0j6sm.js.map → KeyProbe-ya5t3v3v.js.map} +2 -2
- package/dist/Picker-b7mn0mjg.js +5 -0
- package/dist/{Picker-2zjjt17a.js.map → Picker-b7mn0mjg.js.map} +1 -1
- package/dist/SessionPicker-vacfwczg.js +5 -0
- package/dist/{SessionPicker-fyyvxy40.js.map → SessionPicker-vacfwczg.js.map} +2 -2
- package/dist/SkillBrowser-66ntwaa9.js +5 -0
- package/dist/{SkillBrowser-x7r51zy0.js.map → SkillBrowser-66ntwaa9.js.map} +1 -1
- package/dist/WizardApp-123998yh.js +5 -0
- package/dist/{WizardApp-v0dghsyw.js.map → WizardApp-123998yh.js.map} +3 -3
- package/dist/agents.d.ts +19 -3
- package/dist/agents.d.ts.map +1 -1
- package/dist/channels-q4fwqq87.js +31 -0
- package/dist/channels-q4fwqq87.js.map +10 -0
- package/dist/channels.d.ts +26 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/client.js +10 -10
- package/dist/client.js.map +5 -5
- package/dist/config-64q4mgxc.js +24 -0
- package/dist/{config-9cv76yrk.js.map → config-64q4mgxc.js.map} +2 -2
- package/dist/credential-2sj7vsmw.js +19 -0
- package/dist/{credential-yxqj8x1f.js.map → credential-2sj7vsmw.js.map} +2 -2
- package/dist/daemon.d.ts.map +1 -1
- package/dist/index-0k3w2mxf.js +6 -0
- package/dist/{index-5x4dn0gg.js.map → index-0k3w2mxf.js.map} +1 -1
- package/dist/index-1s81qstp.js +6 -0
- package/dist/{index-v8e92nfw.js.map → index-1s81qstp.js.map} +1 -1
- package/dist/index-2rycma8x.js +12 -0
- package/dist/{index-zxh0ntgf.js.map → index-2rycma8x.js.map} +4 -3
- package/dist/index-2zye08c4.js +6 -0
- package/dist/{index-2wmsmcbr.js.map → index-2zye08c4.js.map} +2 -2
- package/dist/{index-gme2egyq.js → index-3km1jwh7.js} +4 -4
- package/dist/{index-gme2egyq.js.map → index-3km1jwh7.js.map} +1 -1
- package/dist/index-3mtgcvkq.js +429 -0
- package/dist/index-3mtgcvkq.js.map +11 -0
- package/dist/index-4knb5vjm.js +90 -0
- package/dist/index-4knb5vjm.js.map +13 -0
- package/dist/{index-3g3ny01d.js → index-5nwwekk0.js} +4 -4
- package/dist/{index-3g3ny01d.js.map → index-5nwwekk0.js.map} +1 -1
- package/dist/index-5rm7dwq4.js +6 -0
- package/dist/index-5rm7dwq4.js.map +11 -0
- package/dist/index-79epttpm.js +6 -0
- package/dist/index-79epttpm.js.map +10 -0
- package/dist/{index-4cf6v9nb.js → index-7yk1zvds.js} +4 -4
- package/dist/{index-4cf6v9nb.js.map → index-7yk1zvds.js.map} +1 -1
- package/dist/index-81gb4ey4.js +6 -0
- package/dist/{index-4z7axw4r.js.map → index-81gb4ey4.js.map} +1 -1
- package/dist/index-8a5d8sfe.js +6 -0
- package/dist/{index-a4xqgdrm.js.map → index-8a5d8sfe.js.map} +1 -1
- package/dist/index-a21zyy54.js +6 -0
- package/dist/index-a21zyy54.js.map +9 -0
- package/dist/index-b6da6c16.js +92 -0
- package/dist/index-b6da6c16.js.map +15 -0
- package/dist/index-byxrc961.js +903 -0
- package/dist/{index-7z4sw2dm.js.map → index-byxrc961.js.map} +18 -17
- package/dist/{index-ammv5st7.js → index-cgfg6t5a.js} +6 -6
- package/dist/{index-ammv5st7.js.map → index-cgfg6t5a.js.map} +1 -1
- package/dist/{index-ez2mb28y.js → index-ehzwdnc3.js} +4 -4
- package/dist/{index-ez2mb28y.js.map → index-ehzwdnc3.js.map} +1 -1
- package/dist/index-fzmmhmk2.js +7 -0
- package/dist/index-fzmmhmk2.js.map +11 -0
- package/dist/index-g3pk0kc0.js +6 -0
- package/dist/{index-9r0wyj6w.js.map → index-g3pk0kc0.js.map} +2 -2
- package/dist/index-h828nk24.js +153 -0
- package/dist/index-h828nk24.js.map +20 -0
- package/dist/{index-zked16y4.js → index-jq999vcw.js} +5 -5
- package/dist/{index-zked16y4.js.map → index-jq999vcw.js.map} +2 -2
- package/dist/index-k2aq5bg0.js +9 -0
- package/dist/{index-nvm5hwe4.js.map → index-k2aq5bg0.js.map} +4 -6
- package/dist/{index-cqqb6gaq.js → index-k3y8y3wj.js} +5 -5
- package/dist/{index-cqqb6gaq.js.map → index-k3y8y3wj.js.map} +1 -1
- package/dist/index-k59wwdgz.js +9 -0
- package/dist/{index-83bqtze0.js.map → index-k59wwdgz.js.map} +3 -5
- package/dist/index-nmnnwa02.js +6 -0
- package/dist/{index-73jfw4jp.js.map → index-nmnnwa02.js.map} +1 -1
- package/dist/index-nn3tk25c.js +6 -0
- package/dist/{index-d4x6yvqh.js.map → index-nn3tk25c.js.map} +3 -4
- package/dist/index-q0hxh57v.js +126 -0
- package/dist/index-q0hxh57v.js.map +14 -0
- package/dist/index-srmhk9g5.js +11 -0
- package/dist/index-srmhk9g5.js.map +11 -0
- package/dist/index-swtyfhha.js +6 -0
- package/dist/{index-fex44816.js.map → index-swtyfhha.js.map} +2 -2
- package/dist/index-whq42sat.js +6 -0
- package/dist/{index-17an0jqq.js.map → index-whq42sat.js.map} +1 -1
- package/dist/{index-j7gyr5nx.js → index-wzsmh5j0.js} +7 -7
- package/dist/{index-j7gyr5nx.js.map → index-wzsmh5j0.js.map} +1 -1
- package/dist/{index-e0j1jafd.js → index-x7v1zq89.js} +7 -7
- package/dist/{index-e0j1jafd.js.map → index-x7v1zq89.js.map} +2 -2
- package/dist/index-xhzmv4dh.js +66 -0
- package/dist/index-xhzmv4dh.js.map +12 -0
- package/dist/index-xmv47vs0.js +6 -0
- package/dist/{index-gz9x25tz.js.map → index-xmv47vs0.js.map} +2 -2
- package/dist/index-y4c32wn7.js +6 -0
- package/dist/{index-dwyr2kdm.js.map → index-y4c32wn7.js.map} +2 -2
- package/dist/index-yjcdp72k.js +6 -0
- package/dist/{index-0b1hdwnm.js.map → index-yjcdp72k.js.map} +1 -1
- package/dist/index-zn24991r.js +6 -0
- package/dist/index-zn24991r.js.map +10 -0
- package/dist/index.js +374 -443
- package/dist/index.js.map +23 -27
- package/dist/init.d.ts.map +1 -1
- package/dist/lib/channel-actions.d.ts +103 -0
- package/dist/lib/channel-actions.d.ts.map +1 -0
- package/dist/lib/chat-frame.d.ts +12 -1
- package/dist/lib/chat-frame.d.ts.map +1 -1
- package/dist/lib/commands.d.ts +13 -0
- package/dist/lib/commands.d.ts.map +1 -1
- package/dist/lib/const.d.ts +1 -1
- package/dist/lib/host-actions.d.ts +121 -0
- package/dist/lib/host-actions.d.ts.map +1 -0
- package/dist/lib/init-flow.d.ts +49 -4
- package/dist/lib/init-flow.d.ts.map +1 -1
- package/dist/lib/init-whatsapp.d.ts +52 -0
- package/dist/lib/init-whatsapp.d.ts.map +1 -0
- package/dist/lib/plugin-install.d.ts +120 -0
- package/dist/lib/plugin-install.d.ts.map +1 -0
- package/dist/lib/providers.d.ts.map +1 -1
- package/dist/lib/provision.d.ts.map +1 -1
- package/dist/lib/readme-table.d.ts +15 -0
- package/dist/lib/readme-table.d.ts.map +1 -0
- package/dist/lib/sandbox.d.ts +15 -0
- package/dist/lib/sandbox.d.ts.map +1 -1
- package/dist/lib/schema.d.ts +34 -1
- package/dist/lib/schema.d.ts.map +1 -1
- package/dist/lib/subcommand.d.ts.map +1 -1
- package/dist/lib/web-url.d.ts +15 -0
- package/dist/lib/web-url.d.ts.map +1 -0
- package/dist/lib/wizard.d.ts.map +1 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/plugins.d.ts +27 -8
- package/dist/plugins.d.ts.map +1 -1
- package/dist/restart.d.ts +21 -0
- package/dist/restart.d.ts.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/schedules.d.ts.map +1 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/sessions.d.ts.map +1 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/status.d.ts +16 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/web-923c7f5e.js +14 -0
- package/dist/{web-x77y8w3v.js.map → web-923c7f5e.js.map} +3 -3
- package/dist/web.d.ts +2 -13
- package/dist/web.d.ts.map +1 -1
- package/dist/wire.js +10 -10
- package/dist/wire.js.map +4 -4
- package/dist/workspace.d.ts.map +1 -1
- package/dist/wrapper-0w9b3my0.js +11 -0
- package/dist/wrapper-0w9b3my0.js.map +23 -0
- package/package.json +6 -3
- package/dist/App-5a35bjkt.js +0 -11
- package/dist/ConfigEditor-7nnc2ke6.js +0 -6
- package/dist/KeyProbe-kbz0j6sm.js +0 -5
- package/dist/Picker-2zjjt17a.js +0 -5
- package/dist/SessionPicker-fyyvxy40.js +0 -5
- package/dist/SkillBrowser-x7r51zy0.js +0 -5
- package/dist/WizardApp-v0dghsyw.js +0 -5
- package/dist/config-9cv76yrk.js +0 -24
- package/dist/credential-yxqj8x1f.js +0 -19
- package/dist/index-000rxxy3.js +0 -7
- package/dist/index-000rxxy3.js.map +0 -11
- package/dist/index-0b1hdwnm.js +0 -6
- package/dist/index-17an0jqq.js +0 -6
- package/dist/index-2wmsmcbr.js +0 -6
- package/dist/index-4z7axw4r.js +0 -6
- package/dist/index-5t6wahx8.js +0 -66
- package/dist/index-5t6wahx8.js.map +0 -12
- package/dist/index-5x4dn0gg.js +0 -6
- package/dist/index-73jfw4jp.js +0 -6
- package/dist/index-7z4sw2dm.js +0 -903
- package/dist/index-83bqtze0.js +0 -14
- package/dist/index-9bkd0fdj.js +0 -427
- package/dist/index-9bkd0fdj.js.map +0 -11
- package/dist/index-9r0wyj6w.js +0 -6
- package/dist/index-a4xqgdrm.js +0 -6
- package/dist/index-d4x6yvqh.js +0 -6
- package/dist/index-d69d6pkm.js +0 -167
- package/dist/index-d69d6pkm.js.map +0 -19
- package/dist/index-dwyr2kdm.js +0 -6
- package/dist/index-fex44816.js +0 -6
- package/dist/index-gz9x25tz.js +0 -6
- package/dist/index-nvm5hwe4.js +0 -9
- package/dist/index-r3wwvqzb.js +0 -77
- package/dist/index-r3wwvqzb.js.map +0 -12
- package/dist/index-v8e92nfw.js +0 -6
- package/dist/index-xf178c4m.js +0 -6
- package/dist/index-xf178c4m.js.map +0 -10
- package/dist/index-zxh0ntgf.js +0 -12
- package/dist/web-x77y8w3v.js +0 -14
package/README.md
CHANGED
|
@@ -3,16 +3,17 @@
|
|
|
3
3
|
A lightweight, model-agnostic AI agent runtime.
|
|
4
4
|
|
|
5
5
|
Dispach turns a stateless OpenAI-compatible `/chat/completions` endpoint into an agent that
|
|
6
|
-
uses tools, remembers across sessions, acts on your machine under a policy you set,
|
|
7
|
-
messaging channels
|
|
8
|
-
|
|
6
|
+
uses tools, remembers across sessions, acts on your machine under a policy you set, lives in
|
|
7
|
+
messaging channels, runs on a schedule, and delegates to other agents. TypeScript, built with Bun
|
|
8
|
+
and shipped on Node, Apache-2.0.
|
|
9
9
|
|
|
10
10
|
> To dispatch is to send a thing on its way with the authority to see it done — to decide
|
|
11
11
|
> what handles it, hand it over, and answer for the result.
|
|
12
12
|
|
|
13
13
|
## Status
|
|
14
14
|
|
|
15
|
-
**Pre-release, and it runs.** Install
|
|
15
|
+
**Pre-release, and it runs.** Install from npm, Homebrew or the container image, or work from a
|
|
16
|
+
checkout (all below). Every install runs under Node.
|
|
16
17
|
|
|
17
18
|
Built and in use: the manifest and agent loop, the store and sessions, tools with the NLT and
|
|
18
19
|
native dialects, the tiered workspace, system and web tool providers with a policy engine, the
|
|
@@ -24,8 +25,26 @@ Also built since: the plugin API with all four middleware wrap points, superviso
|
|
|
24
25
|
typed handoffs, the Docker image and a compose front door, a typed client, operator keys, approvals
|
|
25
26
|
over the wire, and a browser UI on the same origin as the API.
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
And in 0.1.1: settings and schedules are editable from the browser as well as the terminal, and a
|
|
29
|
+
plugin-supplied channel loads under `serve` — `PluginContext.defineChannel` is documented API that
|
|
30
|
+
had never worked through the binary. In 0.1.2: creating an agent stopped being quietly wrong — a
|
|
31
|
+
model id that matches only a *family* row says so instead of budgeting against a third of its
|
|
32
|
+
window, four more endpoint presets, and the HTTP API on by default rather than asking a question
|
|
33
|
+
nobody answers no to.
|
|
34
|
+
|
|
35
|
+
Not built: **WhatsApp**, and **MCP as a tool provider**. Neither is a gap waiting on effort.
|
|
36
|
+
WhatsApp is a legal question rather than an engineering one — decision 8.4 records that Baileys
|
|
37
|
+
reverse-engineers WhatsApp Web with no appeal path, and that Meta's terms effective 15 Jan 2026
|
|
38
|
+
prohibit the Business Solution where a general-purpose AI assistant is the primary functionality,
|
|
39
|
+
which is this product. Anyone can now write that channel as a plugin; whether the first one is
|
|
40
|
+
WhatsApp is a separate decision.
|
|
41
|
+
|
|
42
|
+
**MCP** is planned rather than refused, and the distinction matters. Decision 4.7 keeps it as *one
|
|
43
|
+
tool provider among several, never the substrate* — Composio is called directly for that reason —
|
|
44
|
+
so a `tools-mcp` provider is a thing that could be written and has not been. `01-ARCHITECTURE.md`
|
|
45
|
+
listed the package in its tree for months anyway; it has never existed on any branch.
|
|
46
|
+
|
|
47
|
+
`docs/05-PLAN.md` has every phase with its acceptance criteria and what is ticked.
|
|
29
48
|
|
|
30
49
|
## Scope
|
|
31
50
|
|
|
@@ -69,7 +88,7 @@ Full rationale for every decision, including the negative ones, is in `docs/00-D
|
|
|
69
88
|
|
|
70
89
|
```bash
|
|
71
90
|
npm i -g dispach # the `dispach` command
|
|
72
|
-
dispach --version # 0.1.
|
|
91
|
+
dispach --version # 0.1.2
|
|
73
92
|
```
|
|
74
93
|
|
|
75
94
|
and in an application that talks to a running server:
|
|
@@ -88,17 +107,16 @@ so there is one thing to install, one thing to version and one thing to trust. `
|
|
|
88
107
|
pulls in no terminal UI — asserted by the package's own tests, because an HTTP client has no
|
|
89
108
|
business paying the ~170-210 ms that importing Ink and React costs.
|
|
90
109
|
|
|
91
|
-
### Or
|
|
92
|
-
|
|
93
|
-
One file, no Node and no `node_modules`. `bun build --compile` embeds the runtime, which is also
|
|
94
|
-
why it starts *faster* than a `node_modules` install — there is no module resolution left to do at
|
|
95
|
-
boot. Measured on an M-series mac, `validate --json`: **70–90 ms compiled against 90–110 ms through
|
|
96
|
-
Node**.
|
|
110
|
+
### Or with Homebrew
|
|
97
111
|
|
|
98
112
|
```bash
|
|
99
113
|
brew install moeen-mahmud/tap/dispach
|
|
100
114
|
```
|
|
101
115
|
|
|
116
|
+
The formula depends on `node` and installs the same npm tarball, so a brew install and an npm
|
|
117
|
+
install run identical code — one runtime, one artefact to checksum. (Until 0.1.3 the formula shipped
|
|
118
|
+
a Bun-compiled binary, and Bun cannot complete the WhatsApp handshake; see below.)
|
|
119
|
+
|
|
102
120
|
The name is fully qualified on purpose. Homebrew taps from it with no separate `brew tap`, and
|
|
103
121
|
naming a formula in full is *itself* what Homebrew accepts as consent to load a third-party tap —
|
|
104
122
|
`brew install dispach` after a plain `brew tap moeen-mahmud/tap` is the same install and refuses
|
|
@@ -106,30 +124,15 @@ until `brew trust moeen-mahmud/tap` is run, because a bare name carries no such
|
|
|
106
124
|
|
|
107
125
|
`brew services start dispach` then runs the always-on server; `brew info` prints the rest.
|
|
108
126
|
|
|
109
|
-
Or
|
|
110
|
-
`linux-arm64`, each with a `.sha256` beside it:
|
|
127
|
+
### Or the container
|
|
111
128
|
|
|
112
129
|
```bash
|
|
113
|
-
|
|
114
|
-
curl -fsSL -O "$base/dispach-darwin-arm64"
|
|
115
|
-
curl -fsSL -O "$base/dispach-darwin-arm64.sha256"
|
|
116
|
-
shasum -a 256 -c dispach-darwin-arm64.sha256 # must print "OK"
|
|
117
|
-
chmod +x dispach-darwin-arm64
|
|
118
|
-
sudo mv dispach-darwin-arm64 /usr/local/bin/dispach
|
|
130
|
+
docker pull ghcr.io/moeen-mahmud/dispach:0.1.3
|
|
119
131
|
```
|
|
120
132
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
Two things worth knowing about the macOS asset, because the failure has no error message:
|
|
125
|
-
|
|
126
|
-
- **The release binary is ad-hoc signed, and it has to be.** A compiled Bun binary arrives
|
|
127
|
-
*linker-signed*, which macOS refuses on exec — **exit 137 with no output at all**, which reads as
|
|
128
|
-
a crash rather than as a policy. `codesign -dv` reports such a file as signed, so the obvious
|
|
129
|
-
check passes on a binary that cannot run. The release re-signs every darwin asset, and
|
|
130
|
-
`scripts/build-binary.ts` refuses to produce an unsigned one.
|
|
131
|
-
- **Gatekeeper still applies to a downloaded file.** A binary fetched with a browser carries a
|
|
132
|
-
quarantine attribute; `xattr -d com.apple.quarantine dispach` clears it. `curl` does not set it.
|
|
133
|
+
The [Docker](#docker) and [Compose](#hosting-with-compose) sections below have the run lines and
|
|
134
|
+
the reasons behind them. The image is `node:24-trixie-slim` with `git`, `python3`, `uv` and `jq`,
|
|
135
|
+
because the agent has a shell.
|
|
133
136
|
|
|
134
137
|
### Or from a checkout
|
|
135
138
|
|
|
@@ -143,7 +146,7 @@ bun run build # builds every package the binary imports
|
|
|
143
146
|
cd packages/cli && bun link # puts `dispach` on your PATH
|
|
144
147
|
cd ../..
|
|
145
148
|
|
|
146
|
-
dispach --version # 0.1.
|
|
149
|
+
dispach --version # 0.1.2
|
|
147
150
|
dispach --help
|
|
148
151
|
```
|
|
149
152
|
|
|
@@ -157,8 +160,8 @@ Four things that are not obvious:
|
|
|
157
160
|
`tools-system`, `tools-web`, `tools-composio` and `channel-telegram` from their `dist`, so building
|
|
158
161
|
only `core` and `cli` leaves the binary running yesterday's provider code — and the symptom is the
|
|
159
162
|
worst kind: your change is correct, a test fails, and the stack trace points into a stale `dist`.
|
|
160
|
-
- **Node 24+ must be on your `PATH`.** The built
|
|
161
|
-
it and Node runs it.
|
|
163
|
+
- **Node 24+ must be on your `PATH`.** The built entry's shebang is `#!/usr/bin/env node`; Bun builds
|
|
164
|
+
it and Node runs it — the same runtime every install ships.
|
|
162
165
|
- **`DISPACH_HOME` relocates the whole sandbox.** Point it at a temporary directory and every agent,
|
|
163
166
|
the store and the logs go there instead of `~/.dispach` — which is how to try things out, and how
|
|
164
167
|
every test in this repo avoids touching a real one.
|
|
@@ -188,6 +191,24 @@ passed on the command line lands in shell history — so a scripted run
|
|
|
188
191
|
(`init --user Ada --name Scout --preset ollama --yes`) leaves the line blank and says where to fill
|
|
189
192
|
it in.
|
|
190
193
|
|
|
194
|
+
**`--preset` carries the endpoints worth not typing from memory** — OpenAI, Anthropic, DeepSeek,
|
|
195
|
+
OpenRouter, Groq, NVIDIA NIM, and Ollama both local and hosted — and `custom` is a first-class
|
|
196
|
+
answer for anything else. Any OpenAI-compatible `/chat/completions` endpoint works, because there is
|
|
197
|
+
no provider branch in the transport: one POST, one body builder. What a preset actually buys is
|
|
198
|
+
getting the base URL's *shape* right, which is the part that is easy to get wrong. It must end at
|
|
199
|
+
the version segment; the runtime appends `/chat/completions` itself, so a URL copied from a
|
|
200
|
+
provider's docs with the full path is refused.
|
|
201
|
+
|
|
202
|
+
Local Ollama and Ollama Cloud are **two presets on purpose.** Local needs no key, and the absent
|
|
203
|
+
`apiKeyEnv` is what makes the manifest omit the field and the provider send no `authorization`
|
|
204
|
+
header at all. The hosted endpoint needs one. With a single preset, choosing it and then editing the
|
|
205
|
+
base URL to the hosted endpoint — the obvious move — produced a keyless manifest with no route to a
|
|
206
|
+
key short of hand-editing the field back in.
|
|
207
|
+
|
|
208
|
+
**The HTTP API is on by default**, and there is no longer a question about it. It used to ask, and
|
|
209
|
+
default to *No*, which is asking whether you want the product: an always-on server is what this is,
|
|
210
|
+
and `run` and `dispach web run` are views that attach to it. `--server none` is the opt-out.
|
|
211
|
+
|
|
191
212
|
## Changing an agent afterwards
|
|
192
213
|
|
|
193
214
|
Nothing about an agent is fixed at `init`. `config` is the person's editor for it — the agent has its
|
|
@@ -202,6 +223,15 @@ dispach config env milo MODEL_API_KEY # prompted, masked, written
|
|
|
202
223
|
dispach config allow milo @your_handle # who a channel accepts messages from
|
|
203
224
|
```
|
|
204
225
|
|
|
226
|
+
Since 0.1.1 the **browser does the same job**, against a running server rather than a file on this
|
|
227
|
+
machine: `GET` and `PATCH /v1/agents/:id/config` are the same editor reached remotely, and the
|
|
228
|
+
Settings panel is generated from the one table in core that both surfaces read, so neither can offer
|
|
229
|
+
a field the other does not. It covers tools, policy, model, limits, channels, delivery, schedules and
|
|
230
|
+
the server block, asks the same two confirmations, and reports the write and whether it is *in force*
|
|
231
|
+
separately — an edit made while a turn is running is saved and applied at the next start rather than
|
|
232
|
+
being reported as a failure. Schedules are editable there too; one the manifest declares is shown and
|
|
233
|
+
refused, because reconciliation would restore it from the file at the next boot.
|
|
234
|
+
|
|
205
235
|
`config <agent>` with no action opens the editor, which covers the same fields plus one `allowFrom` row
|
|
206
236
|
per channel and every secret the manifest depends on — masked as you type, and never shown afterwards.
|
|
207
237
|
Each row is written when you confirm it, so there is no unsaved state to lose; a value the schema
|
|
@@ -261,13 +291,17 @@ connects a channel, because a REPL that quietly started answering Telegram while
|
|
|
261
291
|
would be a surprise — and because a messaging provider allows exactly one listener per token, so
|
|
262
292
|
the two would fight over your bot.
|
|
263
293
|
|
|
264
|
-
`serve` still dies with its terminal.
|
|
294
|
+
`serve` still dies with its terminal. So `init` asks whether to keep it running — the default is
|
|
295
|
+
yes — and puts the service up itself: one service hosts every agent in the sandbox, and the agent
|
|
296
|
+
just written is adopted by it before the wizard finishes. By hand, and afterwards:
|
|
265
297
|
|
|
266
298
|
```bash
|
|
267
|
-
dispach daemon install
|
|
268
|
-
dispach
|
|
269
|
-
dispach
|
|
270
|
-
dispach
|
|
299
|
+
dispach daemon install # one service for every agent; checks it will boot first
|
|
300
|
+
dispach status # the service, every agent, every channel — one screen
|
|
301
|
+
dispach restart milo # reload one agent in place, after editing agent.yaml or .env
|
|
302
|
+
dispach restart # the whole service
|
|
303
|
+
dispach logs -f # the server's stderr; the same as `daemon logs`
|
|
304
|
+
dispach agents # what the sandbox holds and who is serving it
|
|
271
305
|
```
|
|
272
306
|
|
|
273
307
|
If you want everything off — services *and* a `serve` you left in a tab three days ago — there is
|
|
@@ -293,12 +327,12 @@ plaintext to any local process, so the agent reads its credentials from the `.en
|
|
|
293
327
|
manifest — which `init` writes `0600` — and the plist carries only `HOME`, `PATH` and the two brand
|
|
294
328
|
variables.
|
|
295
329
|
|
|
296
|
-
**Linux and containers.**
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
in flight, and exits 0.
|
|
330
|
+
**Linux and containers.** On Linux `daemon install` writes a systemd **user** unit and prints the
|
|
331
|
+
two commands that start it — it does not run them, because nothing in this project's test
|
|
332
|
+
environment can execute `systemctl`, and a unit nobody has started is how a "supported" platform
|
|
333
|
+
turns out not to be. Mind `loginctl enable-linger`, or the unit stops with your last session. In a
|
|
334
|
+
container, the image's own `serve` is the process and the container runtime supervises it — it
|
|
335
|
+
handles SIGTERM, finishes the delivery in flight, and exits 0.
|
|
302
336
|
|
|
303
337
|
## Hosting with Compose
|
|
304
338
|
|
|
@@ -336,7 +370,9 @@ turned that into a crash loop that took the API and the page down with it. A hos
|
|
|
336
370
|
fail because one of N agents is misconfigured.
|
|
337
371
|
|
|
338
372
|
Then open `http://localhost:7420` and paste nothing: the claim link in the logs carries a one-time
|
|
339
|
-
token the page exchanges for a key it keeps.
|
|
373
|
+
token the page exchanges for a key it keeps. From there the page creates agents, holds a streaming
|
|
374
|
+
conversation with one, and — since 0.1.1 — changes its settings and schedules; the tool, channel and
|
|
375
|
+
key panels remain reports. Reading the container's own output is what confers
|
|
340
376
|
first ownership, which grants nothing new to anyone who could already run `docker compose logs`.
|
|
341
377
|
|
|
342
378
|
**`--build` is not optional after the first run.** `image: dispach:local` names a tag, and compose
|
|
@@ -430,8 +466,8 @@ fenced as untrusted. What the agent's shell can reach is `sh`, `bash`, `git`, `p
|
|
|
430
466
|
and `curl` — `git` because the skills catalogue is fetched with it and its absence *deletes* that
|
|
431
467
|
feature rather than degrading it, `python3` and `uv` because a skill shipping scripts needs them.
|
|
432
468
|
|
|
433
|
-
What is **absent on purpose**, and asserted as such: no Bun
|
|
434
|
-
|
|
469
|
+
What is **absent on purpose**, and asserted as such: no Bun — the application is the published npm
|
|
470
|
+
package running under Node, exactly what a laptop runs; no `wget`, so there is one obvious HTTP client rather than two; and no pager
|
|
435
471
|
and no editor, because `exec` hands a child a file descriptor and never a TTY — anything that pages
|
|
436
472
|
or prompts blocks until its deadline and reads as a hung agent. The CI `docker` job asserts both
|
|
437
473
|
lists, that the image is glibc, that a C-extension wheel installs with no compiler present, that a
|
|
@@ -458,13 +494,13 @@ consequence: run it on a laptop and the policy is the only boundary there is.
|
|
|
458
494
|
## Docker
|
|
459
495
|
|
|
460
496
|
```bash
|
|
461
|
-
docker build -f docker/Dockerfile -t dispach .
|
|
497
|
+
docker pull ghcr.io/moeen-mahmud/dispach:0.1.3 # or build it: docker build -f docker/Dockerfile -t dispach .
|
|
462
498
|
docker run --rm -p 7420:7420 \
|
|
463
499
|
--env-file examples/minimal/.env \
|
|
464
500
|
-e DISPACH_API_TOKEN=pick-something \
|
|
465
501
|
-v "$PWD/examples/minimal:/agent" \
|
|
466
502
|
-v dispach-home:/home/dispach \
|
|
467
|
-
dispach
|
|
503
|
+
ghcr.io/moeen-mahmud/dispach:0.1.3
|
|
468
504
|
```
|
|
469
505
|
|
|
470
506
|
The token is not optional and is not boilerplate. The image binds `0.0.0.0`, because a process
|
|
@@ -478,8 +514,10 @@ as anything `dispach init` creates inside the container. There is **one agents d
|
|
|
478
514
|
there was not before: the image used to set `DISPACH_HOME=/state`, so `init` wrote to `/state/agents`
|
|
479
515
|
while the CMD served `/agent`, and an agent created in the container was invisible to every listing.
|
|
480
516
|
|
|
481
|
-
The image is `
|
|
482
|
-
|
|
517
|
+
The image is `node:24-trixie-slim` and the runtime stage installs **the published npm tarball** with
|
|
518
|
+
`npm i -g` — the container runs byte-for-byte what `npm i -g dispach` runs on a laptop. No Bun: it
|
|
519
|
+
is the dev toolchain, and the runtime that cannot finish a WhatsApp pairing. glibc rather than musl
|
|
520
|
+
is deliberate and is about Python: PyPI's
|
|
483
521
|
C-extension wheels are `manylinux`, so on alpine anything without a `musllinux` build compiles from
|
|
484
522
|
source, and this image ships no compiler — a wheel would fail *inside a tool call*. Non-root as
|
|
485
523
|
`dispach` (uid 1000) — **a host directory bind-mounted at `/home/dispach` has to be writable by
|
|
@@ -491,13 +529,14 @@ deliberately. A Telegram outage must not read as an unhealthy container and get
|
|
|
491
529
|
the same outage, so the probe answers "can it serve a turn" rather than "is everything connected".
|
|
492
530
|
Channel state lives on the agent resource instead.
|
|
493
531
|
|
|
494
|
-
Measured on an arm64 Docker Desktop
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
packages (of which `git` alone is **92 MB**, because Debian's git
|
|
499
|
-
|
|
500
|
-
|
|
532
|
+
Measured on an arm64 Docker Desktop at 0.1.3: the image is **701 MB** against an 800 MB ceiling,
|
|
533
|
+
and `docker compose up -d --wait` reaches healthy in about six seconds — readiness is tens of
|
|
534
|
+
milliseconds in-process and almost all of that is waiting for the first healthcheck probe. Where the
|
|
535
|
+
size goes: 110 MB Debian, 160 MB of Node (with npm and corepack, kept so the agent's shell has a
|
|
536
|
+
Node toolchain), 158 MB of apt packages (of which `git` alone is **92 MB**, because Debian's git
|
|
537
|
+
pulls perl), 47 MB of `uv`, and 58 MB for the installed package with `ink` and `react`. Node costs
|
|
538
|
+
about 75 MB more than the compiled binary it replaced in 0.1.3, and buys the one thing the binary
|
|
539
|
+
could not do: pair WhatsApp. The healthcheck reports healthy, an
|
|
501
540
|
unauthenticated write is refused with 401, `store.db` lands on the home volume owned by uid 1000,
|
|
502
541
|
and a real streaming turn against DeepSeek reconstructs from 26 `model.chunk` frames. The CI
|
|
503
542
|
`docker` job rebuilds and re-measures on every push, because a figure nobody re-checks is a figure
|
|
@@ -585,36 +624,101 @@ Stated plainly, because the alternative is someone assuming otherwise:
|
|
|
585
624
|
> the startup time and simplicity this project exists to preserve. If you need to run
|
|
586
625
|
> untrusted plugin code, run the whole agent in a container and treat that as the boundary.
|
|
587
626
|
|
|
588
|
-
`dispach plugins <
|
|
627
|
+
`dispach plugins list <agent>` prints what each plugin registered and what it declared, with that
|
|
589
628
|
last sentence repeated above the list. Declaring accurately costs nothing today and is the only
|
|
590
629
|
thing that will distinguish a plugin from a scramble when enforcement lands.
|
|
591
630
|
|
|
631
|
+
### WhatsApp
|
|
632
|
+
|
|
633
|
+
Bundled, like Telegram — no `plugins add` step. But read this first: Baileys reverse-engineers
|
|
634
|
+
WhatsApp Web, WhatsApp's terms do not permit it, and there is no appeal path when a number is
|
|
635
|
+
banned — including during development. **Pair a spare number.**
|
|
636
|
+
|
|
637
|
+
`init --whatsapp connected --whatsapp-number <digits>` writes the channel with `pairWith` set to the
|
|
638
|
+
account's own number; pairing is then an eight-character code typed into the phone under *Linked
|
|
639
|
+
devices › Link with phone number*, offered where the number was typed. Afterwards:
|
|
640
|
+
|
|
641
|
+
```bash
|
|
642
|
+
dispach channels pair milo wa # start a host if none is up, adopt milo, show the code, wait
|
|
643
|
+
dispach channels list milo # what it is reachable on, and whether it is paired
|
|
644
|
+
dispach channels unpair milo wa # forget the session
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
`pairWith` is the account the agent *runs as*; `allowFrom` is who may message it, and the paired
|
|
648
|
+
account is always admitted — `allowFrom` means who *else*. Numbers take a `+` and separators
|
|
649
|
+
anywhere they are typed.
|
|
650
|
+
|
|
651
|
+
`deviceName: milo` on the channel shows as `Google Chrome (milo)` under Linked devices. The left
|
|
652
|
+
half is fixed by the protocol; the bracket is yours. Some accounts refuse a non-standard name under
|
|
653
|
+
pairing-by-code — the refusal says so, and removing the field fixes it. New pairings only.
|
|
654
|
+
|
|
655
|
+
**It pairs under Node and not under Bun**, measured against the same bundle, which is why every
|
|
656
|
+
install of `dispach` runs under Node since 0.1.3. From a checkout under `bun run` the channel says
|
|
657
|
+
so at start rather than connecting to nothing in silence.
|
|
658
|
+
|
|
659
|
+
### Installing one
|
|
660
|
+
|
|
661
|
+
```bash
|
|
662
|
+
dispach plugins add <agent> moeen-mahmud/some-plugin --ref v1.0.0
|
|
663
|
+
dispach plugins list <agent>
|
|
664
|
+
dispach plugins remove <agent> some-plugin
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
`add` clones with git into `~/.dispach/plugins/<name>/`, loads it there to read its declarations,
|
|
668
|
+
prints them, and only then writes the `plugins:` entry — because a manifest naming a plugin that
|
|
669
|
+
will not load *does not load*, so writing the entry first would brick the agent and report success.
|
|
670
|
+
The verification is the same `conformance()` suite the plugin's own author runs.
|
|
671
|
+
|
|
672
|
+
**A plugin is one self-contained bundle.** Nothing is installed while this runtime runs (hard rule
|
|
673
|
+
5), so a tree that declares runtime dependencies and ships no `node_modules` is refused by name
|
|
674
|
+
rather than half-loading at your next boot. That rule is what makes the npm install and the
|
|
675
|
+
container — whose `node_modules` holds only the two declared dependencies — resolve a plugin
|
|
676
|
+
exactly as a checkout does.
|
|
677
|
+
|
|
678
|
+
What git costs, said rather than discovered: no version resolution and no integrity check. `--ref`
|
|
679
|
+
pins a tag or a commit, the resolved commit is recorded beside the code and printed by `plugins
|
|
680
|
+
list`, and the `dispachApi` gate checks **compatibility, not authenticity** — nothing here verifies
|
|
681
|
+
who published what. A local path is accepted too, which is how you test a bundle before publishing
|
|
682
|
+
it.
|
|
683
|
+
|
|
592
684
|
## Commands
|
|
593
685
|
|
|
594
|
-
|
|
595
|
-
`
|
|
686
|
+
Generated from the same `CommandSpec` table the parser and `dispach --help` use — by
|
|
687
|
+
`bun scripts/readme-commands.ts`, and a test fails when this copy is stale. It used to be
|
|
688
|
+
hand-written, and was missing five commands at once. `dispach <command> --help` has the flags.
|
|
596
689
|
|
|
690
|
+
<!-- commands:begin — generated by scripts/readme-commands.ts; do not edit by hand -->
|
|
597
691
|
| Command | What it does |
|
|
598
692
|
| --- | --- |
|
|
599
|
-
| `init` | create
|
|
600
|
-
| `run` | an interactive session
|
|
601
|
-
| `
|
|
602
|
-
| `
|
|
603
|
-
| `
|
|
604
|
-
| `remove` | delete an agent: directory, sessions, memory, logs, service |
|
|
693
|
+
| `init` | create a new agent: manifest, workspace, and env files |
|
|
694
|
+
| `run` | start an interactive session — bare `run` picks from the sandbox |
|
|
695
|
+
| `schedules` | list schedules, when they next fire, and how the last run went |
|
|
696
|
+
| `sessions` | list stored sessions, or inspect one |
|
|
697
|
+
| `memory` | search what the agent remembers, or rebuild the index from the files |
|
|
605
698
|
| `config` | read and change an agent's settings, and fill in its secrets |
|
|
606
|
-
| `
|
|
607
|
-
| `memory` | search what an agent remembers, or rebuild the index |
|
|
608
|
-
| `skills` | browse the catalogues and install, or check one agent's skills |
|
|
609
|
-
| `sources` | the repositories skills come from: list, add, search |
|
|
610
|
-
| `tools` | the resolved tool catalogue, or warm a remote provider's cache |
|
|
611
|
-
| `validate` | load a manifest and report what it resolved to |
|
|
699
|
+
| `validate` | load and validate a manifest, then exit |
|
|
612
700
|
| `workspace` | check the workspace files against the authoring rules |
|
|
613
|
-
| `soul` | scaffold a compact identity
|
|
614
|
-
| `
|
|
701
|
+
| `soul` | scaffold a hand-edited compact identity from a long-form document |
|
|
702
|
+
| `skills` | browse the catalogue and install — or list, scaffold, check one agent's skills |
|
|
703
|
+
| `sources` | the repositories skills come from: list, add, search |
|
|
704
|
+
| `channels` | what an agent is reachable on: connect, disconnect, set a credential, unpair |
|
|
705
|
+
| `plugins` | install a plugin, list what an agent loaded, or remove one |
|
|
706
|
+
| `agents` | the agents in the sandbox, and whether anything is serving them |
|
|
707
|
+
| `restart` | reload one agent on the running host, or restart the whole service |
|
|
708
|
+
| `status` | the service, the hosts, every agent and its channels — one screen |
|
|
709
|
+
| `logs` | the server's stderr tail — the same as `daemon logs` |
|
|
710
|
+
| `tools` | show the resolved tool catalogue, or fetch a remote provider's schemas into the cache |
|
|
711
|
+
| `serve` | run the HTTP API and connect the agents' channels |
|
|
712
|
+
| `credential` | mint, list and revoke operator credentials, optionally scoped |
|
|
615
713
|
| `keys` | press a chord and see the bytes, Ink's reading of them, and the intent |
|
|
616
|
-
| `
|
|
617
|
-
| `
|
|
714
|
+
| `terminal-setup` | teach this terminal to send shift+enter as a new line |
|
|
715
|
+
| `remove` | delete a sandbox agent: its directory, sessions, memory, logs and service |
|
|
716
|
+
| `stop` | stop one agent for good, or everything — named, it stays stopped across restarts |
|
|
717
|
+
| `start` | switch an agent back on, and have a running host adopt it now |
|
|
718
|
+
| `model` | ask the endpoint what it can actually do — window, output cap, prompt caching |
|
|
719
|
+
| `web` | open the browser view of a running agent |
|
|
720
|
+
| `daemon` | keep an agent serving in the background — starts at login, restarts on crash |
|
|
721
|
+
<!-- commands:end -->
|
|
618
722
|
|
|
619
723
|
## Documentation
|
|
620
724
|
|
|
@@ -629,6 +733,10 @@ thing that will distinguish a plugin from a scramble when enforcement lands.
|
|
|
629
733
|
| `docs/09-API-GUIDE.md` | The agent server, walked through from `compose up` to a streamed reply |
|
|
630
734
|
| `packages/client/README.md` | The typed client — turns, streams, reattach, typed errors |
|
|
631
735
|
| `docs/07-SPEC-WORKSPACE.md` | Workspace file tiers, budgets, and prompt-style rendering |
|
|
736
|
+
| `docs/08-MEMORY.md` | How memory is stored, retrieved and injected, with the measured numbers |
|
|
737
|
+
| `docs/12-OPENCLAW-CUTOVER.md` | Moving off the runtime this one replaces |
|
|
738
|
+
| `RELEASING.md` | How a release is cut: the changelog, `bun run release`, and what the tag publishes |
|
|
739
|
+
| `CHANGELOG.md` | What changed in each release, in bullets |
|
|
632
740
|
| `CLAUDE.md` | The standing brief: hard rules and the hazards already paid for |
|
|
633
741
|
| `evals/` | Every performance claim, with the number and a script to reproduce it |
|
|
634
742
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{e,M}from"./index-byxrc961.js";import{o,Mi,ki,I,ce}from"./index-nn3tk25c.js";import{ft,EA,Et}from"./index-g3pk0kc0.js";import{Ce}from"./index-1s81qstp.js";import{_t}from"./index-k3y8y3wj.js";import{Yt,Jt}from"./index-jq999vcw.js";import{Qo,ho,nt,ot,TA,IA,ln,wo,xn,it,mo,Yn,So,Mo}from"./index-2rycma8x.js";import{ge}from"./index-8a5d8sfe.js";import"./index-3mtgcvkq.js";import{BA}from"./index-79epttpm.js";import{lA,tt}from"./index-k59wwdgz.js";import"./index-yjcdp72k.js";import"./index-srmhk9g5.js";import{ye}from"./index-ehzwdnc3.js";import{Ln,V}from"./index-whq42sat.js";import"./index-wzsmh5j0.js";import{K,XA,vA,te,Qi,qt,$A}from"./index-x7v1zq89.js";import{D,G}from"./index-zn24991r.js";import{J,en,An,on,Pi,xi,Yi,Ji,ji,Hn,At,qi}from"./index-2zye08c4.js";import{Box as H,Text as Q,useApp as Ft,useInput as Qn}from"ink";import{useCallback as Zn,useEffect as qn,useMemo as et,useRef as Ut,useState as _}from"react";import{Box as Be,Text as de}from"ink";import{jsx as xe,jsxs as le}from"react/jsx-runtime";function an({lines:n,label:t,offset:r,maxRows:i,code:a}){if(n===void 0)return xe(Be,{marginLeft:2,children:xe(Ce,{label:`running ${t}`})});if(n.length===0)return xe(Be,{marginLeft:2,children:le(de,{color:o.muted,children:[t," printed nothing"]})});let{from:s,to:l}=G(n.length,Math.min(r+Math.floor(i/2),n.length-1),i),u=n.slice(s,l).map((m,w)=>({row:s+w,text:m}));return le(Be,{flexDirection:"column",children:[a!==void 0&&a!==0?le(de,{color:o.error,wrap:"truncate",children:[I.error,t," exited ",a]}):null,s>0?le(de,{dimColor:!0,wrap:"truncate",children:[" ",I.ellipsis," ",s," line",s===1?"":"s"," above"]}):null,u.map((m)=>xe(de,{wrap:"truncate",children:m.text},m.row)),l<n.length?le(de,{dimColor:!0,wrap:"truncate",children:[" ",I.ellipsis," ",n.length-l," line",n.length-l===1?"":"s"," ","below"]}):null]})}import{Box as xt,Text as F}from"ink";import{jsx as ue,jsxs as we}from"react/jsx-runtime";function dn({editor:n,width:t,maxRows:r}){let i=n.search;if(i===void 0)return null;let a=XA(n),s=Math.min(i.index,Math.max(0,a.length-1)),{from:l,to:u}=G(a.length,s,r),m=Math.max(8,t-4);return we(xt,{flexDirection:"column",children:[a.length===0?we(F,{color:o.muted,wrap:"truncate",children:[" ","nothing you have sent matches that"]}):a.slice(l,u).map((w,E)=>{let h=l+E===s;return we(F,{wrap:"truncate",children:[ue(F,{color:o.accent,children:h?I.pointer:" "}),ue(F,{bold:h,dimColor:!h,children:D(w.replace(/\s+/g," "),m)})]},w)}),we(F,{wrap:"truncate",children:[ue(F,{color:o.muted,children:" search: "}),i.query,ue(F,{inverse:!0,children:" "}),a.length>1?ue(F,{color:o.muted,children:` ${s+1} of ${a.length}`}):null]})]})}import{Box as gt,Text as cn}from"ink";import{jsxs as $e}from"react/jsx-runtime";function un({live:n,showReasoning:t,columns:r}){let i=t&&n.reasoning!==""&&n.text==="",a=i?n.reasoning:n.text;if(a==="")return null;let s=i?"· reasoning · ":"",l=_t(a,r-[...s].length,en),u=l.lines.map((m,w)=>({at:w,text:m}));return $e(gt,{flexDirection:"column",children:[l.hidden>0?$e(cn,{dimColor:!0,wrap:"truncate",children:["… ",l.hidden," earlier row(s) hidden while streaming"]}):null,u.map((m)=>$e(cn,{dimColor:i,wrap:"truncate",children:[m.at===0?s:"",m.text]},`row-${m.at}`))]})}import{Box as wt,Text as U}from"ink";import{jsx as Ie,jsxs as ie}from"react/jsx-runtime";function bt(n){return n.matches.reduce((t,r)=>Math.max(t,r.word.length),0)}function mn({palette:n,index:t,width:r,maxRows:i}){if(n.matches.length===0)return ie(U,{color:o.muted,wrap:"truncate",children:[" ","no command starts with /",n.query]});let a=Math.min(t,n.matches.length-1),{from:s,to:l}=G(n.matches.length,a,i),u=bt(n),m=Math.max(8,r-(2+u+2));return ie(wt,{flexDirection:"column",children:[s>0?ie(U,{dimColor:!0,wrap:"truncate",children:[" ",I.ellipsis," ",s," above"]}):null,n.matches.slice(s,l).map((w,E)=>{let R=s+E===a;return ie(U,{wrap:"truncate",children:[Ie(U,{color:o.accent,children:R?I.pointer:" "}),Ie(U,{bold:R,...R?{color:o.accent}:{},children:w.word.padEnd(u)})," ",Ie(U,{dimColor:!0,children:D(w.summary,m)})]},w.word)}),l<n.matches.length?ie(U,{dimColor:!0,wrap:"truncate",children:[" ",I.ellipsis," ",n.matches.length-l," below"]}):null,ie(U,{dimColor:!0,wrap:"truncate",children:[" ","↑↓ move · tab complete · enter run · esc close"]})]})}import{Box as fn,Text as yt}from"ink";import{jsx as pn,jsxs as hn}from"react/jsx-runtime";function gn({editor:n,busy:t,placeholder:r,columns:i}){let a=n.value.split(`
|
|
3
|
+
`).length,s=Math.max(1,i-4);return hn(fn,{flexDirection:"column",children:[pn(fn,{borderStyle:ce,borderColor:t?o.border:o.borderActive,width:i,paddingX:1,children:pn(Jt,{editor:n,gutter:An,maxRows:on,columns:s,...r===void 0?{}:{placeholder:r}})}),a>1?hn(yt,{dimColor:!0,wrap:"truncate",children:[" ",Qo]}):null]})}import{Text as be}from"ink";import{jsx as yn,jsxs as bn}from"react/jsx-runtime";var Tt={idle:"ready",thinking:"thinking",streaming:"replying",working:"running a tool",cancelling:"cancelling"};function St(n){return`${(n/1000).toFixed(1)}s`}function wn(n,t){if(n!=="idle")return" · ^C cancels";return t?" · ^C again to leave":" · ^C twice to leave · /exit"}function kt(n){if(n!=="idle")return"";return" · ^O show reasoning"}var Rt=0.5,Mt=0.8;function Tn({status:n,model:t,sessionKey:r,elapsedMs:i,last:a,quiet:s,armed:l,pressure:u,phase:m}){return bn(be,{dimColor:!0,wrap:"truncate",children:[bn(be,{color:Mi[n],children:[I.dot,Tt[n]]}),n==="idle"?"":` ${St(i)}`,` · ${t} · ${r}`,m===void 0||s?"":` · ${m}`,u===void 0||u<Rt||s?"":yn(be,{...u>=Mt?{color:o.warning}:{},children:` · ctx ${Math.round(u*100)}%`}),a===void 0||s?"":` · last ${Yn(a)}`,kt(n),l===!0?yn(be,{color:o.warning,children:wn(n,!0)}):wn(n,!1)]})}import{Box as vt,Text as Te}from"ink";var z={offset:0,pinned:!0};function Sn(n,t){return Math.max(0,n-t)}function kn(n,t,r){let i=Sn(t,r);return n.pinned?i:Math.max(0,Math.min(n.offset,i))}function Rn(n,t,r,i){if(t==="bottom")return z;let a=Sn(r,i);if(a===0)return z;if(t==="top")return{offset:0,pinned:!1};let s=t==="pageUp"||t==="pageDown"?Math.max(1,i-1):1,l=t==="down"||t==="pageDown"?s:-s,u=kn(n,r,i)+l;if(u>=a)return z;return{offset:Math.max(0,u),pinned:!1}}function Mn(n,t,r){if(r<=0)return{from:0,to:0,above:t,below:0};let i=kn(n,t,r),a=Math.min(t,i+r);return{from:i,to:a,above:i,below:t-a}}function En(n,t){return Math.max(xi,n-t-1)}function Pn(n){let t=[];if(n.above>0)t.push(`↑ ${n.above} row${n.above===1?"":"s"} above`);if(n.below>0)t.push(`↓ ${n.below} row${n.below===1?"":"s"} below`,"esc returns");return t.length===0?"":` ${t.join(" · ")}`}function vn(n){return{anchor:n,focus:n,dragging:!0}}function De(n,t){if(!n.dragging)return n;return{...n,focus:t}}function Cn(n){return{...n,dragging:!1}}function _n(n,t){return{...n,focus:t,dragging:!1}}function Pt(n,t){return n.row<t.row||n.row===t.row&&n.column<=t.column}function Bn(n){if(n===void 0)return;let{anchor:t,focus:r}=n;if(t.row===r.row&&t.column===r.column)return;return Pt(t,r)?{start:t,end:r}:{start:r,end:t}}function He(n,t,r){let i=Bn(n);if(i===void 0)return;if(t<i.start.row||t>i.end.row)return;let a=t===i.start.row?Math.min(i.start.column,r):0,s=t===i.end.row?Math.min(i.end.column,r):r;return s<=a?void 0:{from:a,to:s}}function $n(n,t){let r=Bn(t);if(r===void 0)return"";let i=[];for(let a=r.start.row;a<=r.end.row;a+=1){let s=n[a];if(s===void 0)continue;let l=[...s.text],u=He(t,a,l.length),m=u===void 0?"":l.slice(Math.max(u.from,s.lead),u.to).join("");if(s.continuation&&i.length>0){i[i.length-1]+=m;continue}i.push(m)}return i.map((a)=>a.replace(/\s+$/,"")).join(`
|
|
4
|
+
`)}function Oe(n){return n!==void 0&&!/\s/.test(n)}function In(n,t){let r=n[t.row];if(r===void 0)return{anchor:t,focus:t,dragging:!1};let i=[...r.text];if(!Oe(i[t.column]))return Ne(n,t);let{column:a,column:s}=t;while(a>r.lead&&Oe(i[a-1]))a-=1;while(s<i.length&&Oe(i[s]))s+=1;return{anchor:{row:t.row,column:a},focus:{row:t.row,column:s},dragging:!1}}function Ne(n,t){let r=n[t.row],i=r===void 0?0:[...r.text].length;return{anchor:{row:t.row,column:r?.lead??0},focus:{row:t.row,column:i},dragging:!1}}import{jsx as We,jsxs as On}from"react/jsx-runtime";function Dn({rows:n,slice:t,selection:r}){let i=n.slice(t.from,t.to),a=Pn(t);return On(vt,{flexDirection:"column",children:[We(Te,{color:o.muted,wrap:"truncate",children:a===""?" ":a}),i.map((s,l)=>{let u=s.dim===!0?o.muted:ki[s.role],m=[...s.text],w=He(r,t.from+l,m.length);if(w===void 0)return We(Te,{wrap:"truncate",bold:s.bold===!0,...u===void 0?{}:{color:u},children:s.text===""?" ":s.text},s.key);let E=Math.max(w.from,s.lead);return On(Te,{wrap:"truncate",bold:s.bold===!0,...u===void 0?{}:{color:u},children:[m.slice(0,E).join(""),We(Te,{backgroundColor:o.selection,children:m.slice(E,w.to).join("")}),m.slice(w.to).join("")]},s.key)})]})}import{useEffect as Ct,useState as Lt}from"react";var Bt=100;function Nn(n){let[t,r]=Lt(0);return Ct(()=>{if(!n){r(0);return}let i=Date.now();r(0);let a=setInterval(()=>r(Date.now()-i),Bt);return()=>clearInterval(a)},[n]),t}import{useCallback as Se,useEffect as $t,useReducer as It,useRef as Wn}from"react";function Gn(n){let{source:t,sessionKey:r,initial:i}=n,[a,s]=It(mo,i),l=Wn(void 0),u=Wn(t.streamFilter());$t(()=>t.subscribe((h)=>{if(h.sessionKey!==void 0&&h.sessionKey!==r)return;if(h.type==="model.chunk"){let{delta:L,kind:B}=h.data;if(B==="reasoning"){s({kind:"delta",of:"reasoning",text:L});return}s({kind:"delta",of:"text",text:u.current.push(L)});return}if(h.type==="model.result"){s({kind:"delta",of:"text",text:u.current.endStep()});return}if(h.type==="turn.end")s({kind:"delta",of:"text",text:u.current.end()}),u.current=t.streamFilter();s({kind:"event",event:h})}),[t,r]);let m=Se((h)=>{s({kind:"user",text:h});let L=new AbortController;l.current=L,t.send(h,{sessionKey:r,signal:L.signal}).catch((B)=>{s({kind:"event",event:{v:1,ts:new Date().toISOString(),runtimeId:"cli",sessionKey:r,type:"error",data:{code:"cli_turn_failed",message:B instanceof Error?B.message:String(B),hint:"This escaped the turn loop's own error handling. Re-run with DEBUG=1 for a stack trace."}}})}).finally(()=>{if(l.current===L)l.current=void 0})},[t,r]),w=Se(()=>{let h=l.current;if(h===void 0||h.signal.aborted)return;s({kind:"cancelling"}),h.abort()},[]),E=Se((h)=>s({kind:"note",text:h}),[]),R=Se(()=>s({kind:"trim"}),[]);return{state:a,busy:a.status!=="idle",send:m,cancel:w,note:E,trim:R}}var Ge=1,Fe=1,Xe=1,Vn=2,Ue=4,Ve=2,Fn=14;function Ye(n,t){let{rows:r,caretRow:i}=Yt(n,Math.max(1,t-Ue-Ve)),a=r.length,{from:s,to:l}=G(a,i,Math.max(1,Math.min(a,on)));return Vn+(l-s)+(s>0?1:0)+(a-l>0?1:0)+(n.value.includes(`
|
|
5
|
+
`)?1:0)}var Ot=2;function Dt(n,t){if(n===void 0)return 0;if(n.matches.length===0)return 1;let r=Math.min(n.matches.length,t),i=n.matches.length>r?1:0;return r+i+1}function Un(n,t){if(n.search===void 0)return 0;let r=XA(n);return(r.length===0?1:Math.min(r.length,t))+1}function Xn(n){let t=n.live,r=t===void 0?"":n.showReasoning&&t.reasoning!==""&&t.text===""?t.reasoning:t.text,i=Ge+Fe+_t(r,n.columns-Fn,en).rows+Un(n.editor,n.searchMaxRows)+Ye(n.editor,n.columns)+(n.confirming?1:0)+(n.hint?1:0),a=Math.max(1,Math.min(n.paletteMaxRows,n.rows-i-Ot-1)),s=Ge+Fe+_t(r,n.columns-Fn,en).rows+Dt(n.palette,a)+Un(n.editor,n.searchMaxRows)+Ye(n.editor,n.columns)+(n.confirming?1:0)+(n.hint?1:0),l=En(n.rows,s),u=n.landing?Math.max(0,l-Ji-Hn):0;return{paletteRows:a,brand:u,body:l,transcript:Math.max(1,l-Xe),pane:Math.max(1,l-3)}}function Kn(n,t){let r=(t.brandLines===0?0:t.brandLines+Hn)+Ge+Xe,i=n.row-r;if(i<0)return;let a=t.from+i;if(a>=t.to)return;return{row:a,column:n.column}}function jn(n,t){let r=Yt(t.editor,Math.max(1,t.columns-Ue-Ve)),i=r.rows.length,{from:a,to:s}=G(i,r.caretRow,Math.max(1,Math.min(i,on))),l=a>0?1:0,u=Ye(t.editor,t.columns),w=t.rows-Fe-(t.hint?1:0)-u+Vn/2+l,E=n.row-w;if(E<0||E>=s-a)return;let R=r.rows[a+E];if(R===void 0)return;let h=n.column-Ue/2-Ve;if(h<0)return R.start;return Math.min(R.end,R.start+Math.max(0,h-R.lead))}function zn(n,t){let r=t===0?0:t+Hn;return Math.max(1,n.body-r-Xe)}var Ht=[{command:"pbcopy",args:[]},{command:"wl-copy",args:[]},{command:"xclip",args:["-selection","clipboard"]},{command:"xsel",args:["--clipboard","--input"]}];async function Ke(n){if(n==="")return{copied:!1,problem:"nothing selected"};let t=[];for(let r of Ht){let i=await ye({command:r.command,args:r.args,input:n,timeoutMs:2000});if(i.notFound){t.push(r.command);continue}if(i.code===0)return{copied:!0,using:r.command};return{copied:!1,using:r.command,problem:i.stderr.trim()||`${r.command} exited ${i.code}`}}return{copied:!1,problem:`no clipboard command found (tried ${t.join(", ")})`}}function Nt(n){return BA(n)?.args.findIndex((t)=>t.name==="manifest")??-1}function Wt(n){let t=n.rest.trim()===""?[]:n.rest.trim().split(/\s+/),r=Nt(n.name),i=r===-1||t.length<r?t:[...t.slice(0,r),n.manifestPath,...t.slice(r)];return[n.name,...i,"--plain"]}function Gt(n){let t=BA(n.name);if(t===void 0)return;let r=t.flags.find((s)=>s.name==="follow");if(r===void 0)return;if(!n.rest.trim().split(/\s+/).some((s)=>s==="--follow"||r.short!==void 0&&s===`-${r.short}`))return;return`--follow keeps printing until it is interrupted, and a pane has nothing to interrupt it with. Run it in its own terminal: ${n.name} ${n.rest.trim()}`}async function Jn(n){let t=Gt(n);if(t!==void 0)return{lines:[t],code:1};let r=n.interpreter??process.execPath,i=n.script??(n.interpreter!==void 0?"":process.argv[1]??""),a=await ye({command:r,args:[i,...Wt(n)],...n.env===void 0?{}:{env:n.env},timeoutMs:n.timeoutMs??30000}),s=[a.stdout,a.stderr].filter((u)=>u.trim()!=="").join(`
|
|
6
|
+
`),l=s===""?[]:s.replace(/\n+$/,"").split(`
|
|
7
|
+
`);if(a.notFound)return{lines:[`could not run ${r}`],code:1};if(a.signalled)return{lines:[...l,`${n.name} was stopped before it finished`],code:1};return{lines:l,code:a.code}}import{jsx as g,jsxs as Z,Fragment as Vt}from"react/jsx-runtime";function Dr({source:n,sessionKey:t,model:r,agentName:i,warnings:a,freshSession:s,initial:l,correctKeys:u,showReasoning:m,quiet:w,onRestart:E,onSwitch:R,onNew:h,sessions:L,initialDraft:B,manifestPath:N,catalogue:se,status:je,contextView:ze}){let{exit:q}=Ft(),ee=ge(),S=V(ee.columns,J),{state:P,busy:me,send:rt,cancel:st,note:x,trim:Je}=Gn({source:n,sessionKey:t,initial:l}),[A,O]=_(()=>B===void 0||B===""?K:{...K,value:B,cursor:[...B].length}),[T,C]=_({kind:"none"}),[Qe,at]=_(void 0),[Ze,dt]=_(void 0),[qe,lt]=_(void 0),[fe,ke]=_(z),[ae,Re]=_(!1),[Me,nn]=_(!1),[tn,ct]=_(!1),[ne,Y]=_(void 0),Ee=Ut(void 0),W=T.kind==="none"?wo(A.value):void 0,[Pe,pe]=_(0),ut=Nn(me),mt=et(()=>So(P.items),[P.items]),oe=et(()=>Mo(P.items,{showReasoning:m,quiet:w,columns:S,expandReasoning:tn}),[P.items,m,w,S,tn]),re=s===!0&&!P.items.some((p)=>p.role==="user"),ve=re?Yi:Pi,X=Xn({rows:ee.rows,columns:S,editor:A,live:P.live,showReasoning:m,palette:W,paletteMaxRows:ve,searchMaxRows:ve,confirming:Me,landing:re,hint:re}),he=X.brand>0?Et(e.name,{columns:S-EA,rows:X.brand}):void 0,Ae=Mn(fe,oe.length,zn(X,he?.lines.length??0));qn(()=>{if(!fe.pinned)return;Y(void 0),Je()},[fe.pinned,P.items.length,Je]),qn(()=>{if(!ae)return;let p=setTimeout(()=>Re(!1),qi);return()=>clearTimeout(p)},[ae]);let rn=(p,b)=>{let f=nt(p,it());if(f!==void 0)switch(f.kind){case"exit":nn(!0);return;case"restart":{let d=n.reload;if(d===void 0){E?.(b),q();return}x("asking the host to reload this agent…"),d().then((c)=>x(`reloaded ${c.join(", ")} — this conversation continues`)).catch((c)=>x(`could not reload: ${c instanceof Error?c.message:String(c)}`));return}case"new":h?.(b),q();return;case"help":x(ot());return;case"tools":n.tools().then((d)=>x(IA(d))).catch((d)=>x(`could not read the tools: ${d instanceof Error?d.message:String(d)}`));return;case"context":if(ze===void 0){x("context is unavailable in this session");return}ze().then(x).catch((d)=>x(`could not read the context: ${d instanceof Error?d.message:String(d)}`));return;case"status":if(je===void 0){x("status is unavailable in this session");return}je().then(x).catch((d)=>x(`could not read the status: ${d instanceof Error?d.message:String(d)}`));return;case"reset":n.clearSession(t).then(()=>x("session cleared — memory files on disk are untouched")).catch((d)=>x(`could not clear the session: ${d instanceof Error?d.message:String(d)}`));return;case"command":if(sn(`/${f.name}`,f.rest))return;x(TA({word:`/${f.name}`}));return;case"unknown":x(TA(f));return}if(me){x("a turn is still running — ^C cancels it, then send again");return}rt(p)},_e=Zn((p,b)=>{C({kind:"output",label:`/${p}`,lines:void 0,offset:0}),Jn({name:p,rest:b,manifestPath:N??""}).then((f)=>C({kind:"output",label:`/${p}`,lines:f.lines,code:f.code,offset:0})).catch((f)=>C({kind:"output",label:`/${p}`,lines:[f instanceof Error?f.message:String(f)],code:1,offset:0}))},[N]),sn=Zn((p,b)=>{let f=ln().find((d)=>d.word===p);if(f===void 0)return!1;if(f.kind==="view"){if(f.word==="/sessions"&&L!==void 0&&R!==void 0)return C({kind:"sessions",stored:void 0}),import("./SessionPicker-vacfwczg.js").then((d)=>lt(()=>d.SessionPicker)),L().then((d)=>C({kind:"sessions",stored:d})).catch((d)=>{C({kind:"none"}),x(`could not read the stored conversations: ${d instanceof Error?d.message:String(d)}`)}),!0;if(f.word==="/config"&&(b.trim()===""||b.trim()==="edit")){if(N===void 0)return x("this session has no manifest path, so there is nothing to edit"),!0;return C({kind:"config",rows:lA(N)}),import("./ConfigEditor-apcnj4nj.js").then((d)=>dt(()=>d.ConfigEditor)),!0}if(f.word==="/skills"&&se!==void 0)return C({kind:"skills"}),import("./SkillBrowser-66ntwaa9.js").then((d)=>at(()=>d.SkillBrowser)),!0;return _e(f.word.slice(1),b),!0}if(f.kind==="output")return _e(f.word.slice(1),b),!0;return!1},[_e,se,L,R,x,N]);if(Qn((p,b)=>{if(T.kind!=="output")return;if(b.escape||p==="q"){C({kind:"none"});return}let f=T.lines?.length??0,d=b.pageDown||b.pageUp?X.pane:1,c=b.downArrow||b.pageDown?d:b.upArrow||b.pageUp?-d:0;if(c!==0)C({...T,offset:Math.max(0,Math.min(T.offset+c,Math.max(0,f-1)))})},{isActive:T.kind==="output"}),Qn((p,b)=>{let f=u===void 0?b:u(b,p);if(Me){if(nn(!1),p.toLowerCase()==="y"||f.return)q();return}if(W!==void 0){if(f.escape){O((k)=>te(k,{kind:"killToStart"})),pe(0);return}if(f.upArrow||f.downArrow){pe((k)=>Math.max(0,Math.min(k+(f.downArrow?1:-1),W.matches.length-1)));return}if(f.tab){let k=xn(W,Pe);if(k!==void 0)O((v)=>te({...v,value:"",cursor:0},{kind:"insert",text:k.word}));return}let c=xn(W,Pe);if(f.return&&c!==void 0){let k=c;if(pe(0),O((v)=>({...v,value:"",cursor:0})),k.kind==="session")rn(k.word,"");else sn(k.word,"");return}}let d=$A(p,f,qt(A,me,{armed:ae,scrolled:!fe.pinned}));if(ae&&d.kind!=="exit")Re(!1);if(d.kind==="arm"){Re(!0);return}if(d.kind==="scroll"){let c=Math.max(1,d.times??1);ke((k)=>{let v=k;for(let y=0;y<c;y+=1)v=Rn(v,d.move,oe.length,X.transcript);return v});return}if(d.kind==="pointer"){let c=Kn({column:d.column,row:d.row},{brandLines:he?.lines.length??0,from:Ae.from,to:Ae.to});if(c===void 0){let y=jn({column:d.column,row:d.row},{editor:A,columns:S,rows:ee.rows,hint:re});if(y===void 0){if(d.gesture==="press")Y(void 0),O((j)=>({...j,anchor:void 0}));return}Y(void 0),O((j)=>d.gesture==="press"&&!d.shift?{...j,cursor:y,anchor:y}:{...j,cursor:y,anchor:j.anchor??j.cursor});return}if(d.gesture==="press"){if(d.shift&&ne!==void 0){Y(_n(ne,c)),Ee.current=void 0;return}let y=Ee.current,Le=y!==void 0&&Date.now()-y.when<=ji&&y.at.row===c.row&&y.at.column===c.column?y.clicks%3+1:1;Ee.current={at:c,when:Date.now(),clicks:Le},O((ht)=>({...ht,anchor:void 0})),Y(Le===3?Ne(oe,c):Le===2?In(oe,c):vn(c));return}if(d.gesture==="drag"){Y((y)=>y===void 0?void 0:De(y,c));return}let k=ne===void 0?void 0:Cn(De(ne,c));Y(k);let v=$n(oe,k);if(v!=="")Ke(v).then((y)=>{if(!y.copied&&y.problem!=="nothing selected")x(`could not copy: ${y.problem??"unknown"}`)});return}if(d.kind==="copySelection"||d.kind==="cutSelection"){let c=vA(A);if(c===void 0){x("nothing selected — hold shift with a motion, or drag in the box");return}let k=[...A.value].slice(c.start,c.end).join("");if(d.kind==="cutSelection")O((v)=>te(v,d));Ke(k).then((v)=>{if(!v.copied)x(`could not copy: ${v.problem??"unknown"}`)});return}if(d.kind==="reasoning"){if(!m){x("reasoning is off: either this model does not stream it, or --no-reasoning is set");return}if(!P.items.some((c)=>c.role==="reasoning")){x("no reasoning to show yet — this expands it once a turn has streamed some");return}ct((c)=>!c),ke(z);return}if(d.kind==="exit"){q();return}if(d.kind==="cancel"){st();return}if(d.kind==="submit"){let c=Qi(A);if(O(c.state),ke(z),c.text!=="")rn(c.text,c.state.value);return}if(d.kind==="paste"){O((c)=>te(c,{kind:"insert",text:d.lines.join(`
|
|
8
|
+
`)}));return}if(W!==void 0)pe(0);O((c)=>te(c,d))},{isActive:T.kind==="none"}),T.kind==="config")return Z(H,{flexDirection:"column",width:S,height:ee.rows,children:[g(Q,{color:o.accent,bold:!0,wrap:"truncate",children:Ln({title:`${e.name} ${M}`,summary:"settings"},S)}),Ze===void 0?g(H,{marginLeft:2,children:g(Ce,{label:"reading the settings"})}):g(Ze,{rows:T.rows,apply:(p,b)=>tt(N??"",p,b),reload:()=>lA(N??""),columns:S,window:At,onDone:(p)=>{if(C({kind:"none"}),p)E?.(A.value),q()}}),g(H,{flexGrow:1})]});if(T.kind==="sessions")return Z(H,{flexDirection:"column",width:S,height:ee.rows,children:[g(Q,{color:o.accent,bold:!0,wrap:"truncate",children:Ln({title:`${e.name} ${M}`,summary:"pick a conversation"},S)}),g(H,{flexGrow:1}),T.stored===void 0||qe===void 0?g(H,{marginLeft:2,children:g(Ce,{label:"reading the stored conversations"})}):g(qe,{sessions:T.stored,now:Date.now(),columns:S,maxRows:At,current:t,onDone:(p)=>{if(p===void 0||p===t){C({kind:"none"});return}R?.(p,A.value),q()}}),g(H,{flexGrow:1})]});if(T.kind==="skills"&&se!==void 0&&Qe!==void 0)return g(Qe,{title:`${e.name} ${M}`,agents:[],target:N??"",load:se.load,install:se.install,onDone:()=>C({kind:"none"})});let pt=Ln({title:`${e.name} ${M}`,summary:"",agent:{name:i,model:r},...a===void 0||a.length===0?{}:{warnings:a}},S);return Z(H,{flexDirection:"column",width:S,height:ee.rows,children:[he===void 0?null:Z(Vt,{children:[g(ft,{lines:he.lines}),g(Q,{children:" "})]}),g(Q,{color:o.accent,bold:!0,wrap:"truncate",children:pt}),T.kind==="output"?Z(H,{flexDirection:"column",children:[g(an,{lines:T.lines,label:T.label,offset:T.offset,maxRows:X.pane,...T.code===void 0?{}:{code:T.code}}),Z(Q,{dimColor:!0,wrap:"truncate",children:[" ","↑↓ scroll · esc back to the prompt"]})]}):g(Dn,{rows:oe,slice:Ae,...ne===void 0?{}:{selection:ne}}),g(H,{flexGrow:1}),P.live===void 0?null:g(un,{live:P.live,showReasoning:m,columns:S}),W===void 0?null:g(mn,{palette:W,index:Pe,width:S,maxRows:X.paletteRows}),g(dn,{editor:A,width:S,maxRows:ve}),Me?g(Q,{color:o.warning,wrap:"truncate",children:" leave this session? press y to confirm · any other key stays"}):null,g(gn,{editor:A,busy:me,columns:S,...re?{placeholder:"Ask anything…"}:{}}),re?Z(Q,{dimColor:!0,wrap:"truncate",children:[" ",ho]}):null,g(Tn,{status:P.status,model:r,sessionKey:t,elapsedMs:ut,last:mt,quiet:w,armed:ae,...P.pressure===void 0?{}:{pressure:P.pressure},...P.phase===void 0?{}:{phase:P.phase}})]})}export{Dr as App};
|
|
9
|
+
|
|
10
|
+
//# debugId=4DA58104C913BA1A64756E2164756E21
|
|
11
|
+
//# sourceMappingURL=App-qfqvx9c7.js.map
|