dispach 0.1.0 → 0.1.2
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 +131 -31
- package/dist/App-b1yrwrcq.js +11 -0
- package/dist/{App-dxqm39zx.js.map → App-b1yrwrcq.js.map} +1 -1
- package/dist/{ConfigEditor-7v5nebvy.js → ConfigEditor-n8hdw6r7.js} +4 -4
- package/dist/{ConfigEditor-7v5nebvy.js.map → ConfigEditor-n8hdw6r7.js.map} +1 -1
- package/dist/{KeyProbe-vjhmdpx6.js → KeyProbe-9jjeze5r.js} +3 -3
- package/dist/{KeyProbe-vjhmdpx6.js.map → KeyProbe-9jjeze5r.js.map} +1 -1
- package/dist/{Picker-jxaesaxy.js → Picker-hfeh1g6m.js} +3 -3
- package/dist/{Picker-jxaesaxy.js.map → Picker-hfeh1g6m.js.map} +1 -1
- package/dist/{SessionPicker-z2t0p4b5.js → SessionPicker-zyqkg4dn.js} +3 -3
- package/dist/{SessionPicker-z2t0p4b5.js.map → SessionPicker-zyqkg4dn.js.map} +1 -1
- package/dist/{SkillBrowser-yyf2gy0q.js → SkillBrowser-3qdp8080.js} +3 -3
- package/dist/{SkillBrowser-yyf2gy0q.js.map → SkillBrowser-3qdp8080.js.map} +1 -1
- package/dist/WizardApp-vzpbydy3.js +5 -0
- package/dist/{WizardApp-12ndxgqv.js.map → WizardApp-vzpbydy3.js.map} +1 -1
- package/dist/client.js +10 -10
- package/dist/client.js.map +5 -5
- package/dist/{config-yz0nz51b.js → config-g7za9x13.js} +13 -13
- package/dist/{config-yz0nz51b.js.map → config-g7za9x13.js.map} +1 -1
- package/dist/credential-npr6z8c8.js +19 -0
- package/dist/{credential-wgt4gvcz.js.map → credential-npr6z8c8.js.map} +2 -2
- package/dist/index-02dn6m2j.js +7 -0
- package/dist/{index-h2yds678.js.map → index-02dn6m2j.js.map} +1 -1
- package/dist/index-0d93hyfc.js +6 -0
- package/dist/{index-rqbtm761.js.map → index-0d93hyfc.js.map} +1 -1
- package/dist/index-1c5113t4.js +66 -0
- package/dist/index-1c5113t4.js.map +12 -0
- package/dist/{index-3nwfz9jq.js → index-258d8bzg.js} +10 -10
- package/dist/{index-3nwfz9jq.js.map → index-258d8bzg.js.map} +1 -1
- package/dist/{index-9d011p3q.js → index-3g3ny01d.js} +4 -4
- package/dist/{index-9d011p3q.js.map → index-3g3ny01d.js.map} +1 -1
- package/dist/{index-8bmhd2hj.js → index-4cf6v9nb.js} +4 -4
- package/dist/{index-8bmhd2hj.js.map → index-4cf6v9nb.js.map} +1 -1
- package/dist/{index-bwckzbf8.js → index-4z7axw4r.js} +4 -4
- package/dist/{index-bwckzbf8.js.map → index-4z7axw4r.js.map} +1 -1
- package/dist/{index-xgqzk5cq.js → index-6p999cx4.js} +6 -6
- package/dist/{index-xgqzk5cq.js.map → index-6p999cx4.js.map} +1 -1
- package/dist/index-6q4wf8e3.js +6 -0
- package/dist/{index-jym27m75.js.map → index-6q4wf8e3.js.map} +1 -1
- package/dist/{index-cx3vz7sf.js → index-9r0wyj6w.js} +4 -4
- package/dist/{index-cx3vz7sf.js.map → index-9r0wyj6w.js.map} +1 -1
- package/dist/{index-j97vttdt.js → index-ammv5st7.js} +6 -6
- package/dist/{index-j97vttdt.js.map → index-ammv5st7.js.map} +1 -1
- package/dist/{index-qc2vrq9z.js → index-cqqb6gaq.js} +5 -5
- package/dist/{index-qc2vrq9z.js.map → index-cqqb6gaq.js.map} +1 -1
- package/dist/{index-jk0def33.js → index-d4x6yvqh.js} +4 -4
- package/dist/{index-jk0def33.js.map → index-d4x6yvqh.js.map} +1 -1
- package/dist/index-fecm8xe7.js +77 -0
- package/dist/index-fecm8xe7.js.map +12 -0
- package/dist/{index-e8n70sgj.js → index-fex44816.js} +4 -4
- package/dist/{index-e8n70sgj.js.map → index-fex44816.js.map} +1 -1
- package/dist/{index-gbnc99j8.js → index-ff514z3y.js} +9 -9
- package/dist/{index-gbnc99j8.js.map → index-ff514z3y.js.map} +1 -1
- package/dist/{index-t1xvacym.js → index-gme2egyq.js} +4 -4
- package/dist/{index-t1xvacym.js.map → index-gme2egyq.js.map} +1 -1
- package/dist/{index-mrtb5y08.js → index-gz9x25tz.js} +4 -4
- package/dist/{index-mrtb5y08.js.map → index-gz9x25tz.js.map} +1 -1
- package/dist/{index-9nsfs0vy.js → index-h9mw7b9d.js} +4 -4
- package/dist/{index-9nsfs0vy.js.map → index-h9mw7b9d.js.map} +1 -1
- package/dist/{index-6b7qvh1x.js → index-hwpvhaza.js} +4 -4
- package/dist/{index-6b7qvh1x.js.map → index-hwpvhaza.js.map} +1 -1
- package/dist/{index-6z0yr17z.js → index-j55s3ehk.js} +7 -7
- package/dist/{index-6z0yr17z.js.map → index-j55s3ehk.js.map} +1 -1
- package/dist/{index-mgdgx22q.js → index-j7gyr5nx.js} +6 -6
- package/dist/{index-mgdgx22q.js.map → index-j7gyr5nx.js.map} +1 -1
- package/dist/{index-7da4fqcr.js → index-mtn0g9vc.js} +5 -5
- package/dist/{index-7da4fqcr.js.map → index-mtn0g9vc.js.map} +1 -1
- package/dist/{index-rqzg861g.js → index-qdbq8crg.js} +4 -4
- package/dist/{index-rqzg861g.js.map → index-qdbq8crg.js.map} +1 -1
- package/dist/{index-xqyms08r.js → index-s9mbq7h6.js} +4 -4
- package/dist/{index-xqyms08r.js.map → index-s9mbq7h6.js.map} +1 -1
- package/dist/{index-9f9pp2ef.js → index-tf71ap9v.js} +4 -4
- package/dist/{index-9f9pp2ef.js.map → index-tf71ap9v.js.map} +1 -1
- package/dist/index-ttwyrdjs.js +427 -0
- package/dist/index-ttwyrdjs.js.map +11 -0
- package/dist/{index-2cvtz0fy.js → index-tv4yv7d2.js} +228 -228
- package/dist/{index-2cvtz0fy.js.map → index-tv4yv7d2.js.map} +9 -9
- package/dist/{index-fvhg0xyd.js → index-ty24n0jh.js} +79 -79
- package/dist/{index-fvhg0xyd.js.map → index-ty24n0jh.js.map} +1 -1
- package/dist/index-v8e92nfw.js +6 -0
- package/dist/{index-b8zwg8a3.js.map → index-v8e92nfw.js.map} +1 -1
- package/dist/index-vgc3y3rm.js +6 -0
- package/dist/{index-my5cjx00.js.map → index-vgc3y3rm.js.map} +1 -1
- package/dist/index-whaw4b18.js +6 -0
- package/dist/index-whaw4b18.js.map +10 -0
- package/dist/index.js +202 -198
- package/dist/index.js.map +6 -6
- package/dist/lib/bootstrap.d.ts +13 -0
- package/dist/lib/bootstrap.d.ts.map +1 -1
- package/dist/lib/commands.d.ts.map +1 -1
- package/dist/lib/init-flow.d.ts +17 -4
- package/dist/lib/init-flow.d.ts.map +1 -1
- package/dist/lib/provision.d.ts.map +1 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/{web-w7r68df1.js → web-vkb16r62.js} +5 -5
- package/dist/{web-w7r68df1.js.map → web-vkb16r62.js.map} +1 -1
- package/dist/wire.js +10 -10
- package/dist/wire.js.map +4 -4
- package/package.json +2 -2
- package/dist/App-dxqm39zx.js +0 -11
- package/dist/WizardApp-12ndxgqv.js +0 -5
- package/dist/credential-wgt4gvcz.js +0 -19
- package/dist/index-9pj1ws0p.js +0 -77
- package/dist/index-9pj1ws0p.js.map +0 -12
- package/dist/index-b5wwtxzk.js +0 -66
- package/dist/index-b5wwtxzk.js.map +0 -12
- package/dist/index-b8zwg8a3.js +0 -6
- package/dist/index-bry9bzt3.js +0 -427
- package/dist/index-bry9bzt3.js.map +0 -11
- package/dist/index-h2yds678.js +0 -7
- package/dist/index-jym27m75.js +0 -6
- package/dist/index-my5cjx00.js +0 -6
- package/dist/index-rqbtm761.js +0 -6
- package/dist/index-yr25dnf5.js +0 -6
- package/dist/index-yr25dnf5.js.map +0 -10
package/README.md
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
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. Bun-first TypeScript,
|
|
8
|
+
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.
|
|
@@ -24,8 +24,26 @@ Also built since: the plugin API with all four middleware wrap points, superviso
|
|
|
24
24
|
typed handoffs, the Docker image and a compose front door, a typed client, operator keys, approvals
|
|
25
25
|
over the wire, and a browser UI on the same origin as the API.
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
And in 0.1.1: settings and schedules are editable from the browser as well as the terminal, and a
|
|
28
|
+
plugin-supplied channel loads under `serve` — `PluginContext.defineChannel` is documented API that
|
|
29
|
+
had never worked through the binary. In 0.1.2: creating an agent stopped being quietly wrong — a
|
|
30
|
+
model id that matches only a *family* row says so instead of budgeting against a third of its
|
|
31
|
+
window, four more endpoint presets, and the HTTP API on by default rather than asking a question
|
|
32
|
+
nobody answers no to.
|
|
33
|
+
|
|
34
|
+
Not built: **WhatsApp**, and **MCP as a tool provider**. Neither is a gap waiting on effort.
|
|
35
|
+
WhatsApp is a legal question rather than an engineering one — decision 8.4 records that Baileys
|
|
36
|
+
reverse-engineers WhatsApp Web with no appeal path, and that Meta's terms effective 15 Jan 2026
|
|
37
|
+
prohibit the Business Solution where a general-purpose AI assistant is the primary functionality,
|
|
38
|
+
which is this product. Anyone can now write that channel as a plugin; whether the first one is
|
|
39
|
+
WhatsApp is a separate decision.
|
|
40
|
+
|
|
41
|
+
**MCP** is planned rather than refused, and the distinction matters. Decision 4.7 keeps it as *one
|
|
42
|
+
tool provider among several, never the substrate* — Composio is called directly for that reason —
|
|
43
|
+
so a `tools-mcp` provider is a thing that could be written and has not been. `01-ARCHITECTURE.md`
|
|
44
|
+
listed the package in its tree for months anyway; it has never existed on any branch.
|
|
45
|
+
|
|
46
|
+
`docs/05-PLAN.md` has every phase with its acceptance criteria and what is ticked.
|
|
29
47
|
|
|
30
48
|
## Scope
|
|
31
49
|
|
|
@@ -69,7 +87,7 @@ Full rationale for every decision, including the negative ones, is in `docs/00-D
|
|
|
69
87
|
|
|
70
88
|
```bash
|
|
71
89
|
npm i -g dispach # the `dispach` command
|
|
72
|
-
dispach --version # 0.1.
|
|
90
|
+
dispach --version # 0.1.2
|
|
73
91
|
```
|
|
74
92
|
|
|
75
93
|
and in an application that talks to a running server:
|
|
@@ -96,10 +114,16 @@ boot. Measured on an M-series mac, `validate --json`: **70–90 ms compiled agai
|
|
|
96
114
|
Node**.
|
|
97
115
|
|
|
98
116
|
```bash
|
|
99
|
-
brew
|
|
100
|
-
brew install moeen-mahmud/dispach/dispach
|
|
117
|
+
brew install moeen-mahmud/tap/dispach
|
|
101
118
|
```
|
|
102
119
|
|
|
120
|
+
The name is fully qualified on purpose. Homebrew taps from it with no separate `brew tap`, and
|
|
121
|
+
naming a formula in full is *itself* what Homebrew accepts as consent to load a third-party tap —
|
|
122
|
+
`brew install dispach` after a plain `brew tap moeen-mahmud/tap` is the same install and refuses
|
|
123
|
+
until `brew trust moeen-mahmud/tap` is run, because a bare name carries no such consent.
|
|
124
|
+
|
|
125
|
+
`brew services start dispach` then runs the always-on server; `brew info` prints the rest.
|
|
126
|
+
|
|
103
127
|
Or take the asset straight from a release — `darwin-arm64`, `darwin-x64`, `linux-x64` and
|
|
104
128
|
`linux-arm64`, each with a `.sha256` beside it:
|
|
105
129
|
|
|
@@ -137,7 +161,7 @@ bun run build # builds every package the binary imports
|
|
|
137
161
|
cd packages/cli && bun link # puts `dispach` on your PATH
|
|
138
162
|
cd ../..
|
|
139
163
|
|
|
140
|
-
dispach --version # 0.1.
|
|
164
|
+
dispach --version # 0.1.2
|
|
141
165
|
dispach --help
|
|
142
166
|
```
|
|
143
167
|
|
|
@@ -182,6 +206,24 @@ passed on the command line lands in shell history — so a scripted run
|
|
|
182
206
|
(`init --user Ada --name Scout --preset ollama --yes`) leaves the line blank and says where to fill
|
|
183
207
|
it in.
|
|
184
208
|
|
|
209
|
+
**`--preset` carries the endpoints worth not typing from memory** — OpenAI, Anthropic, DeepSeek,
|
|
210
|
+
OpenRouter, Groq, NVIDIA NIM, and Ollama both local and hosted — and `custom` is a first-class
|
|
211
|
+
answer for anything else. Any OpenAI-compatible `/chat/completions` endpoint works, because there is
|
|
212
|
+
no provider branch in the transport: one POST, one body builder. What a preset actually buys is
|
|
213
|
+
getting the base URL's *shape* right, which is the part that is easy to get wrong. It must end at
|
|
214
|
+
the version segment; the runtime appends `/chat/completions` itself, so a URL copied from a
|
|
215
|
+
provider's docs with the full path is refused.
|
|
216
|
+
|
|
217
|
+
Local Ollama and Ollama Cloud are **two presets on purpose.** Local needs no key, and the absent
|
|
218
|
+
`apiKeyEnv` is what makes the manifest omit the field and the provider send no `authorization`
|
|
219
|
+
header at all. The hosted endpoint needs one. With a single preset, choosing it and then editing the
|
|
220
|
+
base URL to the hosted endpoint — the obvious move — produced a keyless manifest with no route to a
|
|
221
|
+
key short of hand-editing the field back in.
|
|
222
|
+
|
|
223
|
+
**The HTTP API is on by default**, and there is no longer a question about it. It used to ask, and
|
|
224
|
+
default to *No*, which is asking whether you want the product: an always-on server is what this is,
|
|
225
|
+
and `run` and `dispach web run` are views that attach to it. `--server none` is the opt-out.
|
|
226
|
+
|
|
185
227
|
## Changing an agent afterwards
|
|
186
228
|
|
|
187
229
|
Nothing about an agent is fixed at `init`. `config` is the person's editor for it — the agent has its
|
|
@@ -196,6 +238,15 @@ dispach config env milo MODEL_API_KEY # prompted, masked, written
|
|
|
196
238
|
dispach config allow milo @your_handle # who a channel accepts messages from
|
|
197
239
|
```
|
|
198
240
|
|
|
241
|
+
Since 0.1.1 the **browser does the same job**, against a running server rather than a file on this
|
|
242
|
+
machine: `GET` and `PATCH /v1/agents/:id/config` are the same editor reached remotely, and the
|
|
243
|
+
Settings panel is generated from the one table in core that both surfaces read, so neither can offer
|
|
244
|
+
a field the other does not. It covers tools, policy, model, limits, channels, delivery, schedules and
|
|
245
|
+
the server block, asks the same two confirmations, and reports the write and whether it is *in force*
|
|
246
|
+
separately — an edit made while a turn is running is saved and applied at the next start rather than
|
|
247
|
+
being reported as a failure. Schedules are editable there too; one the manifest declares is shown and
|
|
248
|
+
refused, because reconciliation would restore it from the file at the next boot.
|
|
249
|
+
|
|
199
250
|
`config <agent>` with no action opens the editor, which covers the same fields plus one `allowFrom` row
|
|
200
251
|
per channel and every secret the manifest depends on — masked as you type, and never shown afterwards.
|
|
201
252
|
Each row is written when you confirm it, so there is no unsaved state to lose; a value the schema
|
|
@@ -296,18 +347,43 @@ in flight, and exits 0.
|
|
|
296
347
|
|
|
297
348
|
## Hosting with Compose
|
|
298
349
|
|
|
299
|
-
The one-command path. `docker compose up` brings up a server with
|
|
300
|
-
**web UI on the same origin** — nothing to configure but a
|
|
350
|
+
The one-command path. `docker compose up` brings up a server with **no agents**, an exposed API,
|
|
351
|
+
the **web UI on the same origin** and the API reference beside it — nothing to configure but a
|
|
352
|
+
token.
|
|
301
353
|
|
|
302
354
|
```bash
|
|
303
|
-
cp .env.example .env # then DISPACH_API_TOKEN
|
|
355
|
+
cp .env.example .env # then DISPACH_API_TOKEN
|
|
304
356
|
docker compose up -d --build --wait
|
|
305
|
-
curl localhost:7420/v1/ready
|
|
306
|
-
docker compose logs
|
|
357
|
+
curl localhost:7420/v1/ready # {"status":"ready","agents":0}
|
|
358
|
+
docker compose logs server # the claim link — open it once to get a browser key
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
**Zero agents is the supported first state, not an empty one.** The API and the page exist before
|
|
362
|
+
there is anything to talk to, which is what makes provisioning through them possible at all — and
|
|
363
|
+
it is why no model key is required to start. An earlier version of this file defaulted to mounting
|
|
364
|
+
the repository's own `examples/minimal`, so a fresh clone came up hosting a sample assistant nobody
|
|
365
|
+
asked for; a sample is a thing you ask for. `http://localhost:7420/docs` is the reference, and
|
|
366
|
+
`/v1/openapi.json` is the document behind it — both unauthenticated, because the moment a reference
|
|
367
|
+
is most useful is before you have a credential.
|
|
368
|
+
|
|
369
|
+
An agent reaches the container two ways, and `serve` needs no argument for either:
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
docker compose exec server dispach init --user "<you>" --name milo # inside, onto the volume
|
|
373
|
+
echo 'AGENT_DIR=./my-agent' >> .env # or mount one; see the
|
|
374
|
+
# commented block in compose
|
|
307
375
|
```
|
|
308
376
|
|
|
377
|
+
`init` leaves `MODEL_API_KEY=` empty in the agent's `.env` on purpose — filling it is step 1 of what
|
|
378
|
+
it prints. Until it is filled the server **names that agent as not served and stays up**, which it
|
|
379
|
+
did not always do: one half-provisioned agent used to exit the host, and `restart: unless-stopped`
|
|
380
|
+
turned that into a crash loop that took the API and the page down with it. A host does not get to
|
|
381
|
+
fail because one of N agents is misconfigured.
|
|
382
|
+
|
|
309
383
|
Then open `http://localhost:7420` and paste nothing: the claim link in the logs carries a one-time
|
|
310
|
-
token the page exchanges for a key it keeps.
|
|
384
|
+
token the page exchanges for a key it keeps. From there the page creates agents, holds a streaming
|
|
385
|
+
conversation with one, and — since 0.1.1 — changes its settings and schedules; the tool, channel and
|
|
386
|
+
key panels remain reports. Reading the container's own output is what confers
|
|
311
387
|
first ownership, which grants nothing new to anyone who could already run `docker compose logs`.
|
|
312
388
|
|
|
313
389
|
**`--build` is not optional after the first run.** `image: dispach:local` names a tag, and compose
|
|
@@ -335,9 +411,13 @@ One thing the claim link cannot know: it is built from the port the server **bou
|
|
|
335
411
|
always 7420 inside the container. Set `HOST_PORT` to anything else and the link needs that port
|
|
336
412
|
substituted by hand.
|
|
337
413
|
|
|
338
|
-
|
|
414
|
+
Five things in that file are answers to defaults that bite, and they are commented there rather
|
|
339
415
|
than left to be discovered:
|
|
340
416
|
|
|
417
|
+
- **`name: dispach`.** Compose names a container `<project>-<service>-<n>` and takes the project
|
|
418
|
+
from the *directory name*, so this container was `castellan-agent-1` for as long as the checkout
|
|
419
|
+
kept the pre-rename name — a stale brand with nothing in the tree for `git grep` to find, since
|
|
420
|
+
the string was never in a file. Set explicitly, it is `dispach-server-1` wherever you clone to.
|
|
341
421
|
- **No `command:` override.** The image's CMD carries `--host 0.0.0.0`; a compose `command:`
|
|
342
422
|
replaces CMD wholesale, so adding one drops the host flag and the process listens on loopback
|
|
343
423
|
*inside* the container, which no published port can reach.
|
|
@@ -349,16 +429,19 @@ than left to be discovered:
|
|
|
349
429
|
- **`/agent` is read-write.** The skills cache and `memory_write` both write beside the manifest.
|
|
350
430
|
- **`stop_grace_period: 30s`.** The 10 s default can SIGKILL an outbox flush mid-write.
|
|
351
431
|
|
|
352
|
-
|
|
353
|
-
manifest, which is the documented precedence: the ambient environment beats an agent's own
|
|
354
|
-
so an operator can configure the agent their container runs.
|
|
432
|
+
A **mounted** agent takes its model through the *environment* rather than through a `.env` beside
|
|
433
|
+
the manifest, which is the documented precedence: the ambient environment beats an agent's own
|
|
434
|
+
file, so an operator can configure the agent their container runs. Those three variables are
|
|
435
|
+
commented out alongside the mount they belong to — an agent created *inside* the container has its
|
|
436
|
+
own `.env` and needs none of them.
|
|
355
437
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
other's schedules.
|
|
438
|
+
A second agent needs **no second container**: one process hosts N agents (decision 8.5) and a bare
|
|
439
|
+
`serve` hosts every enabled agent in the sandbox, so `dispach init` inside this one is enough. A
|
|
440
|
+
second container is for *isolation* rather than capacity — a shared process means one agent's
|
|
441
|
+
runaway `exec` starves the others — and it needs its own port and **its own home volume**, since
|
|
442
|
+
two sharing one would share a `store.db` whose rows are keyed by agent id and each boot would
|
|
443
|
+
delete the other's schedules while reporting success. A commented example in the compose file shows
|
|
444
|
+
the shape.
|
|
362
445
|
|
|
363
446
|
## Developing against the container
|
|
364
447
|
|
|
@@ -370,17 +453,22 @@ and different `realpath` semantics. Those have never been exercised until now.
|
|
|
370
453
|
|
|
371
454
|
```bash
|
|
372
455
|
cp .env.example .env # token + a model key
|
|
456
|
+
# uncomment the /agent mount and the MODEL_* block in docker-compose.yml, then:
|
|
373
457
|
echo 'AGENT_DIR=./examples/shell-agent' >> .env # an agent that can actually run things
|
|
374
458
|
docker compose up -d --build --wait
|
|
375
459
|
```
|
|
376
460
|
|
|
461
|
+
`AGENT_DIR` on its own does nothing now — the mount it feeds is commented out, so that no clone
|
|
462
|
+
comes up hosting an example. Uncommenting is the opt-in, and it is two adjacent blocks rather than
|
|
463
|
+
one because a mounted agent needs the model variables the server itself does not.
|
|
464
|
+
|
|
377
465
|
Then the loop. `--build` on `up` rebuilds only what changed, and layer caching means a source-only
|
|
378
466
|
edit re-runs `bun run build` and nothing before it:
|
|
379
467
|
|
|
380
468
|
```bash
|
|
381
469
|
docker compose up -d --build --wait # after any source change
|
|
382
470
|
docker compose logs -f # what it is saying
|
|
383
|
-
docker compose exec
|
|
471
|
+
docker compose exec server sh # a shell in the container, as uid 1000
|
|
384
472
|
docker compose down # stop; down -v also discards the home volume
|
|
385
473
|
```
|
|
386
474
|
|
|
@@ -450,8 +538,10 @@ deliberately. A Telegram outage must not read as an unhealthy container and get
|
|
|
450
538
|
the same outage, so the probe answers "can it serve a turn" rather than "is everything connected".
|
|
451
539
|
Channel state lives on the agent resource instead.
|
|
452
540
|
|
|
453
|
-
Measured on an arm64 Docker Desktop
|
|
454
|
-
|
|
541
|
+
Measured on an arm64 Docker Desktop: the image is **542 MB** against a 700 MB ceiling
|
|
542
|
+
(re-measured 2026-09-22; it was 570 MB on 2026-09-17, and the delta is the base image moving
|
|
543
|
+
underneath rather than anything in this tree — which is why the CI `docker` job re-measures on
|
|
544
|
+
every push instead of trusting the number in this sentence) and `docker compose up -d --wait` reaches healthy in **5.7 s** —
|
|
455
545
|
the same as before, because readiness is tens of milliseconds in-process and almost all of that is
|
|
456
546
|
waiting for the first healthcheck probe. Where the size goes: 109 MB debian-slim, 180 MB of apt
|
|
457
547
|
packages (of which `git` alone is **92 MB**, because Debian's git pulls perl), 47 MB of `uv`, and
|
|
@@ -550,8 +640,10 @@ thing that will distinguish a plugin from a scramble when enforcement lands.
|
|
|
550
640
|
|
|
551
641
|
## Commands
|
|
552
642
|
|
|
553
|
-
`dispach --help`
|
|
554
|
-
|
|
643
|
+
`dispach --help` is generated from the same `CommandSpec` table the parser uses, so *it* cannot
|
|
644
|
+
drift. **This table is hand-written and had**: it was missing `schedules`, `plugins`, `credential`,
|
|
645
|
+
`start` and `web` — including the one command that mints an API key. `dispach --help` is the
|
|
646
|
+
authority; read this as a map. `dispach <command> --help` has the flags.
|
|
555
647
|
|
|
556
648
|
| Command | What it does |
|
|
557
649
|
| --- | --- |
|
|
@@ -562,16 +654,21 @@ thing that will distinguish a plugin from a scramble when enforcement lands.
|
|
|
562
654
|
| `stop` | stop everything — services and any loose `serve` |
|
|
563
655
|
| `remove` | delete an agent: directory, sessions, memory, logs, service |
|
|
564
656
|
| `config` | read and change an agent's settings, and fill in its secrets |
|
|
657
|
+
| `start` | switch a stopped agent back on, and have a running host adopt it now |
|
|
658
|
+
| `web` | open the browser view of a running agent |
|
|
659
|
+
| `schedules` | what runs unattended: when each fires next, and how the last run went |
|
|
565
660
|
| `sessions` | list stored conversations, or inspect one |
|
|
566
661
|
| `memory` | search what an agent remembers, or rebuild the index |
|
|
567
662
|
| `skills` | browse the catalogues and install, or check one agent's skills |
|
|
568
663
|
| `sources` | the repositories skills come from: list, add, search |
|
|
569
664
|
| `tools` | the resolved tool catalogue, or warm a remote provider's cache |
|
|
665
|
+
| `plugins` | what each plugin this agent loaded registered, and what it declared |
|
|
666
|
+
| `credential` | mint, list and revoke operator keys for the API, optionally scoped |
|
|
570
667
|
| `validate` | load a manifest and report what it resolved to |
|
|
571
668
|
| `workspace` | check the workspace files against the authoring rules |
|
|
572
669
|
| `soul` | scaffold a compact identity file from a long-form one |
|
|
573
670
|
| `agents` | what one or more manifest *paths* produce |
|
|
574
|
-
| `keys` | press a chord and see the bytes, Ink's reading of them, and the intent |
|
|
671
|
+
| `keys` | a keyboard diagnostic — press a chord and see the bytes, Ink's reading of them, and the intent. **Not credentials; that is `credential`** |
|
|
575
672
|
| `model probe` | ask the endpoint what it can actually do — window, output cap, prompt caching |
|
|
576
673
|
| `terminal-setup` | teach a terminal to send shift+enter as a newline |
|
|
577
674
|
|
|
@@ -588,6 +685,9 @@ thing that will distinguish a plugin from a scramble when enforcement lands.
|
|
|
588
685
|
| `docs/09-API-GUIDE.md` | The agent server, walked through from `compose up` to a streamed reply |
|
|
589
686
|
| `packages/client/README.md` | The typed client — turns, streams, reattach, typed errors |
|
|
590
687
|
| `docs/07-SPEC-WORKSPACE.md` | Workspace file tiers, budgets, and prompt-style rendering |
|
|
688
|
+
| `docs/08-MEMORY.md` | How memory is stored, retrieved and injected, with the measured numbers |
|
|
689
|
+
| `docs/12-OPENCLAW-CUTOVER.md` | Moving off the runtime this one replaces |
|
|
690
|
+
| `.changeset/README.md` | How a release is cut, and why the tag stays a human action |
|
|
591
691
|
| `CLAUDE.md` | The standing brief: hard rules and the hazards already paid for |
|
|
592
692
|
| `evals/` | Every performance claim, with the number and a script to reproduce it |
|
|
593
693
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{e,R}from"./index-tv4yv7d2.js";import{o,qo,Go,u,oe,S,I}from"./index-d4x6yvqh.js";import{an,dt,ln}from"./index-9r0wyj6w.js";import{de}from"./index-v8e92nfw.js";import{ir}from"./index-cqqb6gaq.js";import{wn,bn}from"./index-02dn6m2j.js";import{Yn,yo,wo,on,sn,$t,lt,vo,yr,xo,Eo}from"./index-258d8bzg.js";import{re}from"./index-0d93hyfc.js";import"./index-ttwyrdjs.js";import{le,It}from"./index-whaw4b18.js";import{at,rn}from"./index-ff514z3y.js";import"./index-tf71ap9v.js";import{ge}from"./index-s9mbq7h6.js";import{rr,q}from"./index-h9mw7b9d.js";import"./index-j7gyr5nx.js";import{D,Ut,kt,V,Uo,kn,jt}from"./index-j55s3ehk.js";import{j,lr,An,On,rs,as,ls,ds,cs,dr,Bt,fs}from"./index-vgc3y3rm.js";import{Box as W,Text as Z,useApp as Zt,useInput as ot}from"ink";import{useCallback as rt,useEffect as it,useMemo as st,useRef as Jt,useState as B}from"react";import{Box as Oe,Text as me}from"ink";import{jsx as Se,jsxs as fe}from"react/jsx-runtime";function cn({lines:n,label:t,offset:r,maxRows:i,code:s}){if(n===void 0)return Se(Oe,{marginLeft:2,children:Se(de,{label:`running ${t}`})});if(n.length===0)return Se(Oe,{marginLeft:2,children:fe(me,{color:o.muted,children:[t," printed nothing"]})});let{from:a,to:c}=I(n.length,Math.min(r+Math.floor(i/2),n.length-1),i),m=n.slice(a,c).map((f,b)=>({row:a+b,text:f}));return fe(Oe,{flexDirection:"column",children:[s!==void 0&&s!==0?fe(me,{color:o.error,wrap:"truncate",children:[u.error,t," exited ",s]}):null,a>0?fe(me,{dimColor:!0,wrap:"truncate",children:[" ",u.ellipsis," ",a," line",a===1?"":"s"," above"]}):null,m.map((f)=>Se(me,{wrap:"truncate",children:f.text},f.row)),c<n.length?fe(me,{dimColor:!0,wrap:"truncate",children:[" ",u.ellipsis," ",n.length-c," line",n.length-c===1?"":"s"," ","below"]}):null]})}import{Box as yt,Text as U}from"ink";import{jsx as pe,jsxs as Te}from"react/jsx-runtime";function un({editor:n,width:t,maxRows:r}){let i=n.search;if(i===void 0)return null;let s=Ut(n),a=Math.min(i.index,Math.max(0,s.length-1)),{from:c,to:m}=I(s.length,a,r),f=Math.max(8,t-4);return Te(yt,{flexDirection:"column",children:[s.length===0?Te(U,{color:o.muted,wrap:"truncate",children:[" ","nothing you have sent matches that"]}):s.slice(c,m).map((b,v)=>{let x=c+v===a;return Te(U,{wrap:"truncate",children:[pe(U,{color:o.accent,children:x?u.pointer:" "}),pe(U,{bold:x,dimColor:!x,children:S(b.replace(/\s+/g," "),f)})]},b)}),Te(U,{wrap:"truncate",children:[pe(U,{color:o.muted,children:" search: "}),i.query,pe(U,{inverse:!0,children:" "}),s.length>1?pe(U,{color:o.muted,children:` ${a+1} of ${s.length}`}):null]})]})}import{Box as St,Text as mn}from"ink";import{jsxs as Ie}from"react/jsx-runtime";function fn({live:n,showReasoning:t,columns:r}){let i=t&&n.reasoning!==""&&n.text==="",s=i?n.reasoning:n.text;if(s==="")return null;let a=i?"· reasoning · ":"",c=ir(s,r-[...a].length,lr),m=c.lines.map((f,b)=>({at:b,text:f}));return Ie(St,{flexDirection:"column",children:[c.hidden>0?Ie(mn,{dimColor:!0,wrap:"truncate",children:["… ",c.hidden," earlier row(s) hidden while streaming"]}):null,m.map((f)=>Ie(mn,{dimColor:i,wrap:"truncate",children:[f.at===0?a:"",f.text]},`row-${f.at}`))]})}import{Box as Tt,Text as Y}from"ink";import{jsx as De,jsxs as ae}from"react/jsx-runtime";function Rt(n){return n.matches.reduce((t,r)=>Math.max(t,r.word.length),0)}function pn({palette:n,index:t,width:r,maxRows:i}){if(n.matches.length===0)return ae(Y,{color:o.muted,wrap:"truncate",children:[" ","no command starts with /",n.query]});let s=Math.min(t,n.matches.length-1),{from:a,to:c}=I(n.matches.length,s,i),m=Rt(n),f=Math.max(8,r-(2+m+2));return ae(Tt,{flexDirection:"column",children:[a>0?ae(Y,{dimColor:!0,wrap:"truncate",children:[" ",u.ellipsis," ",a," above"]}):null,n.matches.slice(a,c).map((b,v)=>{let M=a+v===s;return ae(Y,{wrap:"truncate",children:[De(Y,{color:o.accent,children:M?u.pointer:" "}),De(Y,{bold:M,...M?{color:o.accent}:{},children:b.word.padEnd(m)})," ",De(Y,{dimColor:!0,children:S(b.summary,f)})]},b.word)}),c<n.matches.length?ae(Y,{dimColor:!0,wrap:"truncate",children:[" ",u.ellipsis," ",n.matches.length-c," below"]}):null,ae(Y,{dimColor:!0,wrap:"truncate",children:[" ","↑↓ move · tab complete · enter run · esc close"]})]})}import{Box as hn,Text as Pt}from"ink";import{jsx as xn,jsxs as gn}from"react/jsx-runtime";function yn({editor:n,busy:t,placeholder:r,columns:i}){let s=n.value.split(`
|
|
3
|
+
`).length,a=Math.max(1,i-4);return gn(hn,{flexDirection:"column",children:[xn(hn,{borderStyle:oe,borderColor:t?o.border:o.borderActive,width:i,paddingX:1,children:xn(bn,{editor:n,gutter:An,maxRows:On,columns:a,...r===void 0?{}:{placeholder:r}})}),s>1?gn(Pt,{dimColor:!0,wrap:"truncate",children:[" ",yo]}):null]})}import{Text as ke}from"ink";import{jsx as Rn,jsxs as Tn}from"react/jsx-runtime";var Et={idle:"ready",thinking:"thinking",streaming:"replying",working:"running a tool",cancelling:"cancelling"};function Mt(n){return`${(n/1000).toFixed(1)}s`}function Sn(n,t){if(n!=="idle")return" · ^C cancels";return t?" · ^C again to leave":" · ^C twice to leave · /exit"}function vt(n){if(n!=="idle")return"";return" · ^O show reasoning"}var Ct=0.5,At=0.8;function Pn({status:n,model:t,sessionKey:r,elapsedMs:i,last:s,quiet:a,armed:c,pressure:m,phase:f}){return Tn(ke,{dimColor:!0,wrap:"truncate",children:[Tn(ke,{color:qo[n],children:[u.dot,Et[n]]}),n==="idle"?"":` ${Mt(i)}`,` · ${t} · ${r}`,f===void 0||a?"":` · ${f}`,m===void 0||m<Ct||a?"":Rn(ke,{...m>=At?{color:o.warning}:{},children:` · ctx ${Math.round(m*100)}%`}),s===void 0||a?"":` · last ${yr(s)}`,vt(n),c===!0?Rn(ke,{color:o.warning,children:Sn(n,!0)}):Sn(n,!1)]})}import{Box as Lt,Text as Re}from"ink";var z={offset:0,pinned:!0};function En(n,t){return Math.max(0,n-t)}function Mn(n,t,r){let i=En(t,r);return n.pinned?i:Math.max(0,Math.min(n.offset,i))}function vn(n,t,r,i){if(t==="bottom")return z;let s=En(r,i);if(s===0)return z;if(t==="top")return{offset:0,pinned:!1};let a=t==="pageUp"||t==="pageDown"?Math.max(1,i-1):1,c=t==="down"||t==="pageDown"?a:-a,m=Mn(n,r,i)+c;if(m>=s)return z;return{offset:Math.max(0,m),pinned:!1}}function Cn(n,t,r){if(r<=0)return{from:0,to:0,above:t,below:0};let i=Mn(n,t,r),s=Math.min(t,i+r);return{from:i,to:s,above:i,below:t-s}}function _n(n,t){return Math.max(as,n-t-1)}function $n(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 Ln(n){return{anchor:n,focus:n,dragging:!0}}function He(n,t){if(!n.dragging)return n;return{...n,focus:t}}function Bn(n){return{...n,dragging:!1}}function In(n,t){return{...n,focus:t,dragging:!1}}function _t(n,t){return n.row<t.row||n.row===t.row&&n.column<=t.column}function Dn(n){if(n===void 0)return;let{anchor:t,focus:r}=n;if(t.row===r.row&&t.column===r.column)return;return _t(t,r)?{start:t,end:r}:{start:r,end:t}}function We(n,t,r){let i=Dn(n);if(i===void 0)return;if(t<i.start.row||t>i.end.row)return;let s=t===i.start.row?Math.min(i.start.column,r):0,a=t===i.end.row?Math.min(i.end.column,r):r;return a<=s?void 0:{from:s,to:a}}function Nn(n,t){let r=Dn(t);if(r===void 0)return"";let i=[];for(let s=r.start.row;s<=r.end.row;s+=1){let a=n[s];if(a===void 0)continue;let c=[...a.text],m=We(t,s,c.length),f=m===void 0?"":c.slice(Math.max(m.from,a.lead),m.to).join("");if(a.continuation&&i.length>0){i[i.length-1]+=f;continue}i.push(f)}return i.map((s)=>s.replace(/\s+$/,"")).join(`
|
|
4
|
+
`)}function Ne(n){return n!==void 0&&!/\s/.test(n)}function Hn(n,t){let r=n[t.row];if(r===void 0)return{anchor:t,focus:t,dragging:!1};let i=[...r.text];if(!Ne(i[t.column]))return Fe(n,t);let{column:s,column:a}=t;while(s>r.lead&&Ne(i[s-1]))s-=1;while(a<i.length&&Ne(i[a]))a+=1;return{anchor:{row:t.row,column:s},focus:{row:t.row,column:a},dragging:!1}}function Fe(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 Ge,jsxs as Wn}from"react/jsx-runtime";function Fn({rows:n,slice:t,selection:r}){let i=n.slice(t.from,t.to),s=$n(t);return Wn(Lt,{flexDirection:"column",children:[Ge(Re,{color:o.muted,wrap:"truncate",children:s===""?" ":s}),i.map((a,c)=>{let m=a.dim===!0?o.muted:Go[a.role],f=[...a.text],b=We(r,t.from+c,f.length);if(b===void 0)return Ge(Re,{wrap:"truncate",bold:a.bold===!0,...m===void 0?{}:{color:m},children:a.text===""?" ":a.text},a.key);let v=Math.max(b.from,a.lead);return Wn(Re,{wrap:"truncate",bold:a.bold===!0,...m===void 0?{}:{color:m},children:[f.slice(0,v).join(""),Ge(Re,{backgroundColor:o.selection,children:f.slice(v,b.to).join("")}),f.slice(b.to).join("")]},a.key)})]})}import{useEffect as Ot,useState as Dt}from"react";var Nt=100;function Gn(n){let[t,r]=Dt(0);return Ot(()=>{if(!n){r(0);return}let i=Date.now();r(0);let s=setInterval(()=>r(Date.now()-i),Nt);return()=>clearInterval(s)},[n]),t}import{useCallback as Pe,useEffect as Ht,useReducer as Wt,useRef as Un}from"react";function Vn(n){let{source:t,sessionKey:r,initial:i}=n,[s,a]=Wt(vo,i),c=Un(void 0),m=Un(t.streamFilter());Ht(()=>t.subscribe((x)=>{if(x.sessionKey!==void 0&&x.sessionKey!==r)return;if(x.type==="model.chunk"){let{delta:O,kind:N}=x.data;if(N==="reasoning"){a({kind:"delta",of:"reasoning",text:O});return}a({kind:"delta",of:"text",text:m.current.push(O)});return}if(x.type==="model.result"){a({kind:"delta",of:"text",text:m.current.endStep()});return}if(x.type==="turn.end")a({kind:"delta",of:"text",text:m.current.end()}),m.current=t.streamFilter();a({kind:"event",event:x})}),[t,r]);let f=Pe((x)=>{a({kind:"user",text:x});let O=new AbortController;c.current=O,t.send(x,{sessionKey:r,signal:O.signal}).catch((N)=>{a({kind:"event",event:{v:1,ts:new Date().toISOString(),runtimeId:"cli",sessionKey:r,type:"error",data:{code:"cli_turn_failed",message:N instanceof Error?N.message:String(N),hint:"This escaped the turn loop's own error handling. Re-run with DEBUG=1 for a stack trace."}}})}).finally(()=>{if(c.current===O)c.current=void 0})},[t,r]),b=Pe(()=>{let x=c.current;if(x===void 0||x.signal.aborted)return;a({kind:"cancelling"}),x.abort()},[]),v=Pe((x)=>a({kind:"note",text:x}),[]),M=Pe(()=>a({kind:"trim"}),[]);return{state:s,busy:s.status!=="idle",send:f,cancel:b,note:v,trim:M}}var Xn=1,Kn=1,Ye=1,jn=2,Ue=4,Ve=2,Ft=14;function zn(n,t){let{rows:r,caretRow:i}=wn(n,Math.max(1,t-Ue-Ve)),s=r.length,{from:a,to:c}=I(s,i,Math.max(1,Math.min(s,On)));return jn+(c-a)+(a>0?1:0)+(s-c>0?1:0)+(n.value.includes(`
|
|
5
|
+
`)?1:0)}function Gt(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 Vt(n,t){if(n.search===void 0)return 0;let r=Ut(n);return(r.length===0?1:Math.min(r.length,t))+1}function Zn(n){let t=n.live,r=t===void 0?"":n.showReasoning&&t.reasoning!==""&&t.text===""?t.reasoning:t.text,i=Xn+Kn+ir(r,n.columns-Ft,lr).rows+Gt(n.palette,n.paletteMaxRows)+Vt(n.editor,n.searchMaxRows)+zn(n.editor,n.columns)+(n.confirming?1:0)+(n.hint?1:0),s=_n(n.rows,i);return{brand:n.landing?Math.max(0,s-ds-dr):0,body:s,transcript:Math.max(1,s-Ye),pane:Math.max(1,s-3)}}function Jn(n,t){let r=(t.brandLines===0?0:t.brandLines+dr)+Xn+Ye,i=n.row-r;if(i<0)return;let s=t.from+i;if(s>=t.to)return;return{row:s,column:n.column}}function Qn(n,t){let r=wn(t.editor,Math.max(1,t.columns-Ue-Ve)),i=r.rows.length,{from:s,to:a}=I(i,r.caretRow,Math.max(1,Math.min(i,On))),c=s>0?1:0,m=zn(t.editor,t.columns),b=t.rows-Kn-(t.hint?1:0)-m+jn/2+c,v=n.row-b;if(v<0||v>=a-s)return;let M=r.rows[s+v];if(M===void 0)return;let x=n.column-Ue/2-Ve;if(x<0)return M.start;return Math.min(M.end,M.start+Math.max(0,x-M.lead))}function qn(n,t){let r=t===0?0:t+dr;return Math.max(1,n.body-r-Ye)}var Yt=[{command:"pbcopy",args:[]},{command:"wl-copy",args:[]},{command:"xclip",args:["-selection","clipboard"]},{command:"xsel",args:["--clipboard","--input"]}];async function Xe(n){if(n==="")return{copied:!1,problem:"nothing selected"};let t=[];for(let r of Yt){let i=await ge({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 Ee(){let n=Yn.map((i)=>({word:i.word,summary:i.summary,kind:"session"})),t=new Set(n.map((i)=>i.word)),r=le.filter((i)=>i.inSession!=="hidden").filter((i)=>!t.has(`/${i.name}`)).map((i)=>({word:`/${i.name}`,summary:i.summary,kind:i.inSession==="view"?"view":"output",spec:i}));return[...n,...r]}function et(n,t=Ee()){if(!/^\/[A-Za-z-]*$/.test(n))return;let r=n.slice(1).toLowerCase(),i=t.filter((s)=>s.word.slice(1).toLowerCase().startsWith(r));return{query:r,matches:i}}function Ke(n,t){if(n.matches.length===0)return;return n.matches[Math.max(0,Math.min(t,n.matches.length-1))]}function nt(){return Ee().filter((n)=>n.kind!=="session").map((n)=>n.word.slice(1))}function Xt(n){return It(n)?.args.findIndex((t)=>t.name==="manifest")??-1}function Kt(n){let t=n.rest.trim()===""?[]:n.rest.trim().split(/\s+/),r=Xt(n.name),i=r===-1||t.length<r?t:[...t.slice(0,r),n.manifestPath,...t.slice(r)];return[n.name,...i,"--plain"]}function zt(n){let t=It(n.name);if(t===void 0)return;let r=t.flags.find((a)=>a.name==="follow");if(r===void 0)return;if(!n.rest.trim().split(/\s+/).some((a)=>a==="--follow"||r.short!==void 0&&a===`-${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 tt(n){let t=zt(n);if(t!==void 0)return{lines:[t],code:1};let r=n.interpreter??process.execPath,i=n.script??process.argv[1]??"",s=await ge({command:r,args:[i,...Kt(n)],...n.env===void 0?{}:{env:n.env},timeoutMs:n.timeoutMs??30000}),a=[s.stdout,s.stderr].filter((m)=>m.trim()!=="").join(`
|
|
6
|
+
`),c=a===""?[]:a.replace(/\n+$/,"").split(`
|
|
7
|
+
`);if(s.notFound)return{lines:[`could not run ${r}`],code:1};if(s.signalled)return{lines:[...c,`${n.name} was stopped before it finished`],code:1};return{lines:c,code:s.code}}import{jsx as w,jsxs as J,Fragment as Qt}from"react/jsx-runtime";function Qr({source:n,sessionKey:t,model:r,agentName:i,warnings:s,freshSession:a,initial:c,correctKeys:m,showReasoning:f,quiet:b,onRestart:v,onSwitch:M,onNew:x,sessions:O,initialDraft:N,manifestPath:F,catalogue:ce,status:je,contextView:ze}){let{exit:Q}=Zt(),ee=re(),P=q(ee.columns,j),{state:C,busy:he,send:ct,cancel:ut,note:g,trim:Ze}=Vn({source:n,sessionKey:t,initial:c}),[L,H]=B(()=>N===void 0||N===""?D:{...D,value:N,cursor:[...N].length}),[k,_]=B({kind:"none"}),[Je,mt]=B(void 0),[Qe,ft]=B(void 0),[qe,pt]=B(void 0),[xe,Me]=B(z),[ue,ve]=B(!1),[Ce,en]=B(!1),[nn,ht]=B(!1),[ne,X]=B(void 0),Ae=Jt(void 0),G=k.kind==="none"?et(L.value):void 0,[_e,we]=B(0),xt=Gn(he),gt=st(()=>xo(C.items),[C.items]),te=st(()=>Eo(C.items,{showReasoning:f,quiet:b,columns:P,expandReasoning:nn}),[C.items,f,b,P,nn]),ie=a===!0&&!C.items.some((h)=>h.role==="user"),be=ie?ls:rs,se=Zn({rows:ee.rows,columns:P,editor:L,live:C.live,showReasoning:f,palette:G,paletteMaxRows:be,searchMaxRows:be,confirming:Ce,landing:ie,hint:ie}),ye=se.brand>0?ln(e.name,{columns:P-dt,rows:se.brand}):void 0,$e=Cn(xe,te.length,qn(se,ye?.lines.length??0));it(()=>{if(!xe.pinned)return;X(void 0),Ze()},[xe.pinned,C.items.length,Ze]),it(()=>{if(!ue)return;let h=setTimeout(()=>ve(!1),fs);return()=>clearTimeout(h)},[ue]);let tn=(h,y)=>{let p=on(h,nt());if(p!==void 0)switch(p.kind){case"exit":en(!0);return;case"restart":{let d=n.reload;if(d===void 0){v?.(y),Q();return}g("asking the host to reload this agent…"),d().then((l)=>g(`reloaded ${l.join(", ")} — this conversation continues`)).catch((l)=>g(`could not reload: ${l instanceof Error?l.message:String(l)}`));return}case"new":x?.(y),Q();return;case"help":g(sn());return;case"tools":n.tools().then((d)=>g(lt(d))).catch((d)=>g(`could not read the tools: ${d instanceof Error?d.message:String(d)}`));return;case"context":if(ze===void 0){g("context is unavailable in this session");return}ze().then(g).catch((d)=>g(`could not read the context: ${d instanceof Error?d.message:String(d)}`));return;case"status":if(je===void 0){g("status is unavailable in this session");return}je().then(g).catch((d)=>g(`could not read the status: ${d instanceof Error?d.message:String(d)}`));return;case"reset":n.clearSession(t).then(()=>g("session cleared — memory files on disk are untouched")).catch((d)=>g(`could not clear the session: ${d instanceof Error?d.message:String(d)}`));return;case"command":if(dn(`/${p.name}`,p.rest))return;g($t({word:`/${p.name}`}));return;case"unknown":g($t(p));return}if(he){g("a turn is still running — ^C cancels it, then send again");return}ct(h)},Le=rt((h,y)=>{_({kind:"output",label:`/${h}`,lines:void 0,offset:0}),tt({name:h,rest:y,manifestPath:F??""}).then((p)=>_({kind:"output",label:`/${h}`,lines:p.lines,code:p.code,offset:0})).catch((p)=>_({kind:"output",label:`/${h}`,lines:[p instanceof Error?p.message:String(p)],code:1,offset:0}))},[F]),dn=rt((h,y)=>{let p=Ee().find((d)=>d.word===h);if(p===void 0)return!1;if(p.kind==="view"){if(p.word==="/sessions"&&O!==void 0&&M!==void 0)return _({kind:"sessions",stored:void 0}),import("./SessionPicker-zyqkg4dn.js").then((d)=>pt(()=>d.SessionPicker)),O().then((d)=>_({kind:"sessions",stored:d})).catch((d)=>{_({kind:"none"}),g(`could not read the stored conversations: ${d instanceof Error?d.message:String(d)}`)}),!0;if(p.word==="/config"&&(y.trim()===""||y.trim()==="edit")){if(F===void 0)return g("this session has no manifest path, so there is nothing to edit"),!0;return _({kind:"config",rows:at(F)}),import("./ConfigEditor-n8hdw6r7.js").then((d)=>ft(()=>d.ConfigEditor)),!0}if(p.word==="/skills"&&ce!==void 0)return _({kind:"skills"}),import("./SkillBrowser-3qdp8080.js").then((d)=>mt(()=>d.SkillBrowser)),!0;return Le(p.word.slice(1),y),!0}if(p.kind==="output")return Le(p.word.slice(1),y),!0;return!1},[Le,ce,O,M,g,F]);if(ot((h,y)=>{if(k.kind!=="output")return;if(y.escape||h==="q"){_({kind:"none"});return}let p=k.lines?.length??0,d=y.pageDown||y.pageUp?se.pane:1,l=y.downArrow||y.pageDown?d:y.upArrow||y.pageUp?-d:0;if(l!==0)_({...k,offset:Math.max(0,Math.min(k.offset+l,Math.max(0,p-1)))})},{isActive:k.kind==="output"}),ot((h,y)=>{let p=m===void 0?y:m(y,h);if(Ce){if(en(!1),h.toLowerCase()==="y"||p.return)Q();return}if(G!==void 0){if(p.escape){H((E)=>V(E,{kind:"killToStart"})),we(0);return}if(p.upArrow||p.downArrow){we((E)=>Math.max(0,Math.min(E+(p.downArrow?1:-1),G.matches.length-1)));return}if(p.tab){let E=Ke(G,_e);if(E!==void 0)H((A)=>V({...A,value:"",cursor:0},{kind:"insert",text:E.word}));return}let l=Ke(G,_e);if(p.return&&l!==void 0){let E=l;if(we(0),H((A)=>({...A,value:"",cursor:0})),E.kind==="session")tn(E.word,"");else dn(E.word,"");return}}let d=jt(h,p,kn(L,he,{armed:ue,scrolled:!xe.pinned}));if(ue&&d.kind!=="exit")ve(!1);if(d.kind==="arm"){ve(!0);return}if(d.kind==="scroll"){let l=Math.max(1,d.times??1);Me((E)=>{let A=E;for(let T=0;T<l;T+=1)A=vn(A,d.move,te.length,se.transcript);return A});return}if(d.kind==="pointer"){let l=Jn({column:d.column,row:d.row},{brandLines:ye?.lines.length??0,from:$e.from,to:$e.to});if(l===void 0){let T=Qn({column:d.column,row:d.row},{editor:L,columns:P,rows:ee.rows,hint:ie});if(T===void 0){if(d.gesture==="press")X(void 0),H((K)=>({...K,anchor:void 0}));return}X(void 0),H((K)=>d.gesture==="press"&&!d.shift?{...K,cursor:T,anchor:T}:{...K,cursor:T,anchor:K.anchor??K.cursor});return}if(d.gesture==="press"){if(d.shift&&ne!==void 0){X(In(ne,l)),Ae.current=void 0;return}let T=Ae.current,Be=T!==void 0&&Date.now()-T.when<=cs&&T.at.row===l.row&&T.at.column===l.column?T.clicks%3+1:1;Ae.current={at:l,when:Date.now(),clicks:Be},H((bt)=>({...bt,anchor:void 0})),X(Be===3?Fe(te,l):Be===2?Hn(te,l):Ln(l));return}if(d.gesture==="drag"){X((T)=>T===void 0?void 0:He(T,l));return}let E=ne===void 0?void 0:Bn(He(ne,l));X(E);let A=Nn(te,E);if(A!=="")Xe(A).then((T)=>{if(!T.copied&&T.problem!=="nothing selected")g(`could not copy: ${T.problem??"unknown"}`)});return}if(d.kind==="copySelection"||d.kind==="cutSelection"){let l=kt(L);if(l===void 0){g("nothing selected — hold shift with a motion, or drag in the box");return}let E=[...L.value].slice(l.start,l.end).join("");if(d.kind==="cutSelection")H((A)=>V(A,d));Xe(E).then((A)=>{if(!A.copied)g(`could not copy: ${A.problem??"unknown"}`)});return}if(d.kind==="reasoning"){if(!f){g("reasoning is off: either this model does not stream it, or --no-reasoning is set");return}if(!C.items.some((l)=>l.role==="reasoning")){g("no reasoning to show yet — this expands it once a turn has streamed some");return}ht((l)=>!l),Me(z);return}if(d.kind==="exit"){Q();return}if(d.kind==="cancel"){ut();return}if(d.kind==="submit"){let l=Uo(L);if(H(l.state),Me(z),l.text!=="")tn(l.text,l.state.value);return}if(d.kind==="paste"){H((l)=>V(l,{kind:"insert",text:d.lines.join(`
|
|
8
|
+
`)}));return}if(G!==void 0)we(0);H((l)=>V(l,d))},{isActive:k.kind==="none"}),k.kind==="config")return J(W,{flexDirection:"column",width:P,height:ee.rows,children:[w(Z,{color:o.accent,bold:!0,wrap:"truncate",children:rr({title:`${e.name} ${R}`,summary:"settings"},P)}),Qe===void 0?w(W,{marginLeft:2,children:w(de,{label:"reading the settings"})}):w(Qe,{rows:k.rows,apply:(h,y)=>rn(F??"",h,y),reload:()=>at(F??""),columns:P,window:Bt,onDone:(h)=>{if(_({kind:"none"}),h)v?.(L.value),Q()}}),w(W,{flexGrow:1})]});if(k.kind==="sessions")return J(W,{flexDirection:"column",width:P,height:ee.rows,children:[w(Z,{color:o.accent,bold:!0,wrap:"truncate",children:rr({title:`${e.name} ${R}`,summary:"pick a conversation"},P)}),w(W,{flexGrow:1}),k.stored===void 0||qe===void 0?w(W,{marginLeft:2,children:w(de,{label:"reading the stored conversations"})}):w(qe,{sessions:k.stored,now:Date.now(),columns:P,maxRows:Bt,current:t,onDone:(h)=>{if(h===void 0||h===t){_({kind:"none"});return}M?.(h,L.value),Q()}}),w(W,{flexGrow:1})]});if(k.kind==="skills"&&ce!==void 0&&Je!==void 0)return w(Je,{title:`${e.name} ${R}`,agents:[],target:F??"",load:ce.load,install:ce.install,onDone:()=>_({kind:"none"})});let wt=rr({title:`${e.name} ${R}`,summary:"",agent:{name:i,model:r},...s===void 0||s.length===0?{}:{warnings:s}},P);return J(W,{flexDirection:"column",width:P,height:ee.rows,children:[ye===void 0?null:J(Qt,{children:[w(an,{lines:ye.lines}),w(Z,{children:" "})]}),w(Z,{color:o.accent,bold:!0,wrap:"truncate",children:wt}),k.kind==="output"?J(W,{flexDirection:"column",children:[w(cn,{lines:k.lines,label:k.label,offset:k.offset,maxRows:se.pane,...k.code===void 0?{}:{code:k.code}}),J(Z,{dimColor:!0,wrap:"truncate",children:[" ","↑↓ scroll · esc back to the prompt"]})]}):w(Fn,{rows:te,slice:$e,...ne===void 0?{}:{selection:ne}}),w(W,{flexGrow:1}),C.live===void 0?null:w(fn,{live:C.live,showReasoning:f,columns:P}),G===void 0?null:w(pn,{palette:G,index:_e,width:P,maxRows:be}),w(un,{editor:L,width:P,maxRows:be}),Ce?w(Z,{color:o.warning,wrap:"truncate",children:" leave this session? press y to confirm · any other key stays"}):null,w(yn,{editor:L,busy:he,columns:P,...ie?{placeholder:"Ask anything…"}:{}}),ie?J(Z,{dimColor:!0,wrap:"truncate",children:[" ",wo]}):null,w(Pn,{status:C.status,model:r,sessionKey:t,elapsedMs:xt,last:gt,quiet:b,armed:ue,...C.pressure===void 0?{}:{pressure:C.pressure},...C.phase===void 0?{}:{phase:C.phase}})]})}export{Qr as App};
|
|
9
|
+
|
|
10
|
+
//# debugId=EDBCE5697F239D7E64756E2164756E21
|
|
11
|
+
//# sourceMappingURL=App-b1yrwrcq.js.map
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
"/**\n * Running one of this binary's own commands, for a pane inside a session.\n *\n * ## Why a child process rather than calling the function\n *\n * The obvious implementation is to call `validateCommand()` and swap `process.stdout.write` for a\n * collector. It is also wrong here: Ink *owns* stdout while a session is mounted, and it writes a frame\n * whenever anything re-renders. A frame drawn during the capture window lands in the collector instead of\n * on the terminal — so the screen silently misses a repaint and the pane shows a frame of itself. Nothing\n * errors; the display is just wrong, intermittently, depending on timing.\n *\n * A child writes to its own pipe. Nothing is hijacked, the frame keeps rendering, and the pane shows\n * exactly what the command prints — which is also the honest thing to show, since \"run this command\" is\n * what the palette offered. The cost is process startup, which is the same ~100 ms every command in this\n * CLI already pays and is invisible next to reading the result.\n *\n * `--plain` is forced, for the reason it exists: a child that thought it had a terminal would return\n * escape sequences, and the pane would render them as text.\n */\n\nimport { findCommand } from \"#lib/commands\"\nimport { spawnCaptureAsync } from \"#lib/spawn\"\n\nexport interface SubcommandResult {\n readonly lines: readonly string[]\n readonly code: number\n}\n\nexport interface SubcommandRequest {\n readonly name: string\n /** Arguments as typed after the command word, split on whitespace. */\n readonly rest: string\n /** The agent this session is running, passed to any command that takes a manifest. */\n readonly manifestPath: string\n /** Injected by tests. `process.execPath` and `process.argv[1]` otherwise. */\n readonly interpreter?: string\n readonly script?: string\n readonly env?: Readonly<Record<string, string | undefined>>\n readonly timeoutMs?: number\n}\n\n/**\n * Where this command wants the manifest among its positionals, or `-1` for one that takes none.\n *\n * Read off the command's own spec rather than a hand-kept list, which was wrong in both directions at\n * once. `NO_MANIFEST` held four names: `soul` takes an *action* first and was not listed, so\n * `/soul distill` ran as `soul <manifestPath> distill` and the action became a path — broken in-session\n * for as long as it has been offered there; and `agents` takes a variadic manifest first and *was*\n * listed, so it ran with none at all.\n *\n * It also could not express the real shape. `config` and `memory` take an action and *then* a manifest,\n * so \"prepend or not\" has no right answer for them — the path belongs at index 1. `soul`'s second\n * positional is a `file` (a long-form identity document, not a manifest), which is why matching on the\n * name matters rather than on the position.\n *\n * The same drift `session-commands.ts` exists to end: a second list describing `COMMANDS` disagrees with\n * it on the first command either one grows. Derived, a new command is covered with nothing to remember.\n */\nfunction manifestIndex(name: string): number {\n return findCommand(name)?.args.findIndex((arg) => arg.name === \"manifest\") ?? -1\n}\n\n/**\n * The argv for a request.\n *\n * Pure and exported so the assembly is testable without starting anything — which matters because\n * getting it wrong means a command runs against the wrong agent, and that is not visible in the output.\n */\nexport function subcommandArgv(request: SubcommandRequest): readonly string[] {\n const rest = request.rest.trim() === \"\" ? [] : request.rest.trim().split(/\\s+/)\n const at = manifestIndex(request.name)\n // Inserted only when everything before it was typed. `/skills` bare would otherwise become\n // `skills <manifestPath>`, putting a path where the action goes — and a command that resolves the\n // agent from the cwd instead is the lesser wrong: it may pick a different agent, where this one\n // cannot run at all. `--plain` stays last, so it cannot be swallowed as a flag's value.\n const positionals =\n at === -1 || rest.length < at\n ? rest\n : [...rest.slice(0, at), request.manifestPath, ...rest.slice(at)]\n return [request.name, ...positionals, \"--plain\"]\n}\n\n/**\n * Why a pane must not run this request, if it must not.\n *\n * A pane captures a child to completion, so a command that never finishes is a pane that shows a spinner\n * until the timeout fires and then reports being killed — thirty seconds of a frozen surface for a flag\n * that worked perfectly at a shell. `daemon logs --follow` is the case: it exists precisely to keep\n * printing until interrupted, and there is nothing for it to be interrupted *by* in here.\n *\n * Refused rather than quietly dropped. Dropping the flag would hand back the tail, which looks like a\n * following command that stopped immediately — a wrong answer that reads as a right one. Keyed off the\n * command's own spec, so a second command that grows a `follow` flag is covered with nothing to remember.\n */\nexport function paneRefusal(request: SubcommandRequest): string | undefined {\n const spec = findCommand(request.name)\n if (spec === undefined) return undefined\n const follow = spec.flags.find((flag) => flag.name === \"follow\")\n if (follow === undefined) return undefined\n const tokens = request.rest.trim().split(/\\s+/)\n const asked = tokens.some(\n (token) =>\n token === \"--follow\" || (follow.short !== undefined && token === `-${follow.short}`),\n )\n if (!asked) return undefined\n return `--follow keeps printing until it is interrupted, and a pane has nothing to interrupt it with. Run it in its own terminal: ${request.name} ${request.rest.trim()}`\n}\n\nexport async function runSubcommand(request: SubcommandRequest): Promise<SubcommandResult> {\n const refusal = paneRefusal(request)\n // Non-zero, because it did not do what was asked. A refusal reported as success is the shape hard\n // rule 8 forbids, whatever the message says.\n if (refusal !== undefined) return { lines: [refusal], code: 1 }\n\n const interpreter = request.interpreter ?? process.execPath\n const script = request.script ?? process.argv[1] ?? \"\"\n const result = await spawnCaptureAsync({\n command: interpreter,\n args: [script, ...subcommandArgv(request)],\n ...(request.env === undefined ? {} : { env: request.env }),\n timeoutMs: request.timeoutMs ?? 30_000,\n })\n\n // stderr is shown, not dropped. A command that failed says why on stderr, and a pane that showed only\n // stdout would render an empty box for the case a person most needs to read.\n const body = [result.stdout, result.stderr].filter((part) => part.trim() !== \"\").join(\"\\n\")\n const lines = body === \"\" ? [] : body.replace(/\\n+$/, \"\").split(\"\\n\")\n if (result.notFound) {\n return { lines: [`could not run ${interpreter}`], code: 1 }\n }\n if (result.signalled) {\n return { lines: [...lines, `${request.name} was stopped before it finished`], code: 1 }\n }\n return { lines, code: result.code }\n}\n"
|
|
21
21
|
],
|
|
22
22
|
"mappings": ";0rBA2BA,cAAS,UAAK,YAAM,eAAQ,aAC5B,sBAA6B,gBAAa,cAAW,aAAS,eAAQ,cCVtE,cAAS,WAAK,iEAgBP,SAAS,EAAa,EAAG,QAAO,QAAO,SAAQ,UAAS,QAA4B,CACvF,GAAI,IAAU,OACV,OACI,GAEE,GAFF,CAAK,WAAY,EAAjB,SACI,GAAC,GAAD,CAAS,MAAO,WAAW,IAAS,EACtC,EAIV,GAAI,EAAM,SAAW,EACjB,OACI,GAEE,GAFF,CAAK,WAAY,EAAjB,SACI,GAAmD,GAAnD,CAAM,MAAO,EAAM,MAAnB,SAAmD,CAAxB,EAA3B,oBAAmD,EACrD,EAMV,IAAQ,OAAM,MAAO,EACjB,EAAM,OACN,KAAK,IAAI,EAAS,KAAK,MAAM,EAAU,CAAC,EAAG,EAAM,OAAS,CAAC,EAC3D,CACJ,EAEM,EAAU,EAAM,MAAM,EAAM,CAAE,EAAE,IAAI,CAAC,EAAM,KAAQ,CAAE,IAAK,EAAO,EAAI,MAAK,EAAE,EAElF,OACI,GA4BE,GA5BF,CAAK,cAAc,SAAnB,SA4BE,CA3BG,IAAS,QAAa,IAAS,EAC5B,GAGE,GAHF,CAAM,MAAO,EAAM,MAAO,KAAK,WAA/B,SAGE,CAFG,EAAM,MACN,EAFL,WAEoB,GAClB,EACF,KACH,EAAO,EACJ,GAGE,GAHF,CAAM,SAAQ,GAAC,KAAK,WAApB,SAGE,CAFG,KACA,EAAM,SAFX,IAEsB,EAFtB,QAEiC,IAAS,EAAI,GAAK,IAFnD,UAGE,EACF,KACH,EAAQ,IAAI,CAAC,IAIV,GAEE,GAFF,CAAsB,KAAK,WAA3B,SACK,EAAM,MADA,EAAM,GAEf,CACL,EACA,EAAK,EAAM,OACR,GAIE,GAJF,CAA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EAGE,EAHF,CAAM,SAAQ,GAAC,KAAK,WAApB,SAGE,CAFG,KACA,IACH,EACF,KAGJ,EAAC,GAAD,CACI,OAAQ,EAAM,OACd,MAAO,EACP,WAAY,EACZ,UAAW,GACX,KAAM,GACN,MAAO,EACP,MAAO,MACF,EAAM,WAAa,OAAY,CAAC,EAAI,CAAE,SAAU,EAAM,QAAS,KAC/D,EAAM,QAAU,OAAY,CAAC,EAAI,CAAE,MAAO,EAAM,KAAM,EAC/D,GACF",
|
|
23
|
-
"debugId": "
|
|
23
|
+
"debugId": "EDBCE5697F239D7E64756E2164756E21",
|
|
24
24
|
"names": []
|
|
25
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./index-
|
|
3
|
-
${e.label}`});let l=S(A(e),Math.min(34,Math.max(12,Math.floor(r*0.34)))),m=S(B(e),Math.max(8,r-l.length-8));return x(d,{wrap:"truncate",children:[t?a(d,{color:o.accent,children:" ❯ "}):a(d,{children:" "}),a(d,{children:l.padEnd(Math.min(34,Math.max(12,Math.floor(r*0.34))))}),a(d,{color:o.muted,children:` ${m}`})]})}function Q(e,t){switch(e.kind){case"up":return t.cursor-1;case"down":return t.cursor+1;case"first":return 0;case"last":return t.rows.length-1;case"jump":return e.index}}function A(e){switch(e.kind){case"setting":return e.setting.path;case"allow":return`${e.channelId}.allowFrom`;case"secret":return e.name;case"heading":return e.label}}function B(e){switch(e.kind){case"setting":return e.value===void 0||e.value===null?"(not set)":typeof e.value==="string"?e.value:JSON.stringify(e.value);case"allow":return e.handles.length===0?"(nobody)":e.handles.join(" ");case"secret":return e.present?"(set)":"(not set)";case"heading":return""}}function U(e){let t=B(e);return t.length<=
|
|
2
|
+
import"./index-cqqb6gaq.js";import{o,S,I}from"./index-d4x6yvqh.js";import"./index-02dn6m2j.js";import{nn}from"./index-6q4wf8e3.js";import{re}from"./index-0d93hyfc.js";import{D,V,Sn}from"./index-j55s3ehk.js";import{Ge,Ve,Nn}from"./index-vgc3y3rm.js";import{Box as H,Text as d,useInput as Y}from"ink";import{useState as z}from"react";function E(e){return e!==void 0&&e.kind!=="heading"}function k(e){switch(e.kind){case"setting":return`setting:${e.setting.path}`;case"allow":return`allow:${e.channelId}`;case"secret":return`secret:${e.name}`;case"heading":return`heading:${e.label}`}}function L(e){let t=e.findIndex((r)=>E(r));return t===-1?0:t}function T(e){return{rows:e,cursor:L(e),mode:"browse",editor:D,busy:!1}}function M(e,t){let r=e.rows.length;if(r===0)return e;let l=Math.max(0,Math.min(r-1,t)),h=l>=e.cursor?1:-1;for(let i=l;i>=0&&i<r;i+=h)if(E(e.rows[i]))return{...e,cursor:i};for(let i=l;i>=0&&i<r;i-=h)if(E(e.rows[i]))return{...e,cursor:i};return e}function w(e){return e.rows[e.cursor]}function G(e){switch(e.kind){case"setting":return e.value===void 0||e.value===null?"":typeof e.value==="string"?e.value:JSON.stringify(e.value);case"allow":return e.handles.join(" ");case"secret":case"heading":return""}}function O(e){let t=w(e);if(t===void 0||!E(t)||e.busy)return e;let r=G(t);return{...e,mode:"editing",editor:{...D,value:r,cursor:[...r].length},note:void 0}}function _(e){if(e.mode!=="editing")return e;return{...e,mode:"browse",editor:D,note:void 0}}function W(e,t){return{...e,editor:t,note:void 0}}function F(e){return{...e,busy:!0}}function N(e,t,r){return{...e,rows:t,cursor:Math.min(e.cursor,Math.max(0,t.length-1)),mode:"browse",editor:D,busy:!1,note:r}}function P(e,t){return{...e,busy:!1,note:t}}import{jsx as a,jsxs as x}from"react/jsx-runtime";function ge({rows:e,apply:t,reload:r,columns:l,window:m,focused:h=!0,onDone:i}){let K=re(),v=Math.max(Ge,Math.min(m,K.rows-Ve)),[n,u]=z(()=>T(e)),[C,j]=z(!1),g=w(n);Y((f,c)=>{if(n.busy)return;let s=Sn(f,c,{select:n.mode==="browse",empty:n.editor.value===""});if(s.kind==="abort"){i(C);return}if(s.kind==="back"){if(n.mode==="editing")u(_);else i(C);return}if(s.kind==="list"){if(s.intent.kind==="move"){let y=s.intent.move;u((R)=>M(R,Q(y,R)))}return}if(s.kind==="commit"){if(n.mode==="browse"){u(O);return}J();return}u((y)=>W(y,V(y.editor,s.intent)))},{isActive:h});async function J(){let f=w(n);if(f===void 0)return;u(F);try{let c=await t(f,n.editor.value);j(!0),u((s)=>N(s,r(),c))}catch(c){u((s)=>P(s,c instanceof Error?c.message:String(c)))}}if(n.mode==="editing"&&g!==void 0)return x(H,{flexDirection:"column",children:[a(d,{color:o.muted,wrap:"truncate",children:` ${Z(g)}`}),a(nn,{label:A(g),editor:n.editor,secret:g.kind==="secret",columns:l,maxRows:Math.max(Nn,v-2),...n.note===void 0?{}:{error:n.note}}),a(d,{dimColor:!0,wrap:"truncate",children:n.busy?" writing…":` enter writes it · ${U(g)} · ^C closes`})]});let{from:p,to:b}=I(n.rows.length,n.cursor,v);return x(H,{flexDirection:"column",children:[p>0?a(d,{dimColor:!0,wrap:"truncate",children:` ↑ ${p} above`}):void 0,n.rows.slice(p,b).map((f,c)=>a(q,{row:f,selected:p+c===n.cursor,columns:l},k(f))),b<n.rows.length?a(d,{dimColor:!0,wrap:"truncate",children:` ↓ ${n.rows.length-b} below`}):void 0,a(d,{color:n.note===void 0?o.muted:o.accent,wrap:"truncate",children:n.note===void 0?" ↑↓ move · enter changes it · esc closes":` ${n.note}`})]})}function q({row:e,selected:t,columns:r}){if(e.kind==="heading")return a(d,{color:o.muted,wrap:"truncate",children:`
|
|
3
|
+
${e.label}`});let l=S(A(e),Math.min(34,Math.max(12,Math.floor(r*0.34)))),m=S(B(e),Math.max(8,r-l.length-8));return x(d,{wrap:"truncate",children:[t?a(d,{color:o.accent,children:" ❯ "}):a(d,{children:" "}),a(d,{children:l.padEnd(Math.min(34,Math.max(12,Math.floor(r*0.34))))}),a(d,{color:o.muted,children:` ${m}`})]})}function Q(e,t){switch(e.kind){case"up":return t.cursor-1;case"down":return t.cursor+1;case"first":return 0;case"last":return t.rows.length-1;case"jump":return e.index}}function A(e){switch(e.kind){case"setting":return e.setting.path;case"allow":return`${e.channelId}.allowFrom`;case"secret":return e.name;case"heading":return e.label}}function B(e){switch(e.kind){case"setting":return e.value===void 0||e.value===null?"(not set)":typeof e.value==="string"?e.value:JSON.stringify(e.value);case"allow":return e.handles.length===0?"(nobody)":e.handles.join(" ");case"secret":return e.present?"(set)":"(not set)";case"heading":return""}}function U(e){let t=B(e);return t.length<=X?`esc keeps ${t}`:"esc cancels"}var X=24;function Z(e){switch(e.kind){case"setting":return e.setting.means;case"allow":return"handles this channel accepts messages from, separated by spaces. Empty refuses everyone";case"secret":return e.why;case"heading":return e.label}}export{ge as ConfigEditor};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
6
|
-
//# sourceMappingURL=ConfigEditor-
|
|
5
|
+
//# debugId=6ECE33C1BB078EEF64756E2164756E21
|
|
6
|
+
//# sourceMappingURL=ConfigEditor-n8hdw6r7.js.map
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"/**\n * The config editor as a pure reducer: what the rows are, where the cursor is, what is being typed.\n *\n * Same grain as `lib/wizard.ts` and `lib/select.ts` — the screen root owns one `useInput` and the\n * arithmetic lives here, so navigating a list and rejecting a bad handle are assertable as data rather\n * than by driving a terminal.\n *\n * ## Why a row is not just a setting\n *\n * The catalogue in core answers \"what fields exist\". An editor has to answer \"what can I change from\n * here\", and three of those are not dotted paths:\n *\n * - **A secret.** `.env` is a protected path precisely so the agent cannot write it, which leaves the\n * person as the only actor who can — and the editor is where they are. Masked as it is typed.\n * - **`allowFrom`, once per channel.** It lives inside a list entry, so `channels[].allowFrom` is one\n * catalogue row and *n* editable ones. Expanded here, keyed by the channel's declared id.\n * - **A heading.** Unselectable, and the cursor must step over it in the direction it was moving —\n * parking on one draws no cursor at all, which reads as a broken keyboard rather than a skipped row.\n *\n * ## Why every confirmed edit is written immediately\n *\n * There is no staged set and no unsaved state. Each confirmation goes through the same `editManifest`\n * call `config set` makes, so every state the file is ever in is valid, a closed pane cannot discard\n * work, and two edits that are individually fine cannot combine into an invalid document nobody\n * reviewed. The cost is stated rather than hidden: there is no cancel-all, and undo is `config set`\n * with the old value, which the row still shows until the write lands.\n */\n\nimport type { Setting } from \"@dispach/core\"\nimport { EMPTY_EDITOR } from \"#editor\"\nimport type { EditorState } from \"#lib/types\"\n\n/** One line of the editor. Only three kinds are selectable. */\nexport type EditorRow =\n /** A dotted path, edited as the text that would appear in the file. */\n | { readonly kind: \"setting\"; readonly setting: Setting; readonly value: unknown }\n /** One channel's inbound allowlist, edited as space-separated handles. */\n | {\n readonly kind: \"allow\"\n readonly channelId: string\n readonly channelType: string\n readonly handles: readonly string[]\n }\n /** An env variable the manifest depends on. Never displays its value, only whether it is set. */\n | {\n readonly kind: \"secret\"\n readonly name: string\n readonly why: string\n readonly present: boolean\n }\n /** A group label. Never selectable. */\n | { readonly kind: \"heading\"; readonly label: string }\n\nexport interface ConfigEditorState {\n readonly rows: readonly EditorRow[]\n readonly cursor: number\n readonly mode: \"browse\" | \"editing\"\n /** The buffer while editing. Empty and unused while browsing. */\n readonly editor: EditorState\n /**\n * The result of the last write, or why one was refused. Cleared as soon as anything is typed.\n *\n * `| undefined` rather than merely optional: under `exactOptionalPropertyTypes` an omitted key and an\n * explicit `undefined` are different types, and this one is *cleared* far more often than it is left\n * out — a spread that had to omit the key to reset it would be unreadable.\n */\n readonly note?: string | undefined\n /** Set while a write is in flight, so the row cannot be confirmed twice. */\n readonly busy: boolean\n}\n\nexport function isSelectable(row: EditorRow | undefined): boolean {\n return row !== undefined && row.kind !== \"heading\"\n}\n\n/** A stable identity for a row, for React keys and for tests. */\nexport function rowKey(row: EditorRow): string {\n switch (row.kind) {\n case \"setting\":\n return `setting:${row.setting.path}`\n case \"allow\":\n return `allow:${row.channelId}`\n case \"secret\":\n return `secret:${row.name}`\n case \"heading\":\n return `heading:${row.label}`\n }\n}\n\n/** The path or name a row writes to, for a caller reporting what happened. */\nexport function rowTarget(row: EditorRow): string {\n switch (row.kind) {\n case \"setting\":\n return row.setting.path\n case \"allow\":\n return `${row.channelId}.allowFrom`\n case \"secret\":\n return row.name\n case \"heading\":\n return row.label\n }\n}\n\nexport function firstSelectable(rows: readonly EditorRow[]): number {\n const at = rows.findIndex((row) => isSelectable(row))\n return at === -1 ? 0 : at\n}\n\nexport function openEditor(rows: readonly EditorRow[]): ConfigEditorState {\n return {\n rows,\n cursor: firstSelectable(rows),\n mode: \"browse\",\n editor: EMPTY_EDITOR,\n busy: false,\n }\n}\n\n/**\n * Move the cursor, stepping over headings in the direction of travel.\n *\n * Walk that way, then reverse, then stay put — and read the direction off the *indices* rather than the\n * kind of move, because `first` travels backwards to row 0 and must then search forwards. A cursor that\n * runs out of list stays where it is; it never lands on a row where enter does nothing.\n */\nexport function moveCursor(state: ConfigEditorState, to: number): ConfigEditorState {\n const total = state.rows.length\n if (total === 0) return state\n const clamped = Math.max(0, Math.min(total - 1, to))\n const forwards = clamped >= state.cursor\n const step = forwards ? 1 : -1\n\n for (let at = clamped; at >= 0 && at < total; at += step) {\n if (isSelectable(state.rows[at])) return { ...state, cursor: at }\n }\n // Nothing that way. Try the other, which is what makes the ends of the list behave.\n for (let at = clamped; at >= 0 && at < total; at -= step) {\n if (isSelectable(state.rows[at])) return { ...state, cursor: at }\n }\n return state\n}\n\n/** The row the cursor is on, or `undefined` for an empty list. */\nexport function current(state: ConfigEditorState): EditorRow | undefined {\n return state.rows[state.cursor]\n}\n\n/**\n * What a row's value looks like in the buffer when editing starts.\n *\n * A secret starts **empty**, never seeded with what is there: the point of the masked field is that the\n * value is not on screen, and pre-filling it would put it in the frame in every sense that matters.\n */\nexport function seedFor(row: EditorRow): string {\n switch (row.kind) {\n case \"setting\":\n return row.value === undefined || row.value === null\n ? \"\"\n : typeof row.value === \"string\"\n ? row.value\n : JSON.stringify(row.value)\n case \"allow\":\n return row.handles.join(\" \")\n case \"secret\":\n case \"heading\":\n return \"\"\n }\n}\n\nexport function beginEdit(state: ConfigEditorState): ConfigEditorState {\n const row = current(state)\n if (row === undefined || !isSelectable(row) || state.busy) return state\n const seed = seedFor(row)\n return {\n ...state,\n mode: \"editing\",\n editor: { ...EMPTY_EDITOR, value: seed, cursor: [...seed].length },\n note: undefined,\n }\n}\n\nexport function cancelEdit(state: ConfigEditorState): ConfigEditorState {\n if (state.mode !== \"editing\") return state\n return { ...state, mode: \"browse\", editor: EMPTY_EDITOR, note: undefined }\n}\n\n/** Replace the buffer, which is what the host does after applying a keystroke to it. */\nexport function typing(state: ConfigEditorState, editor: EditorState): ConfigEditorState {\n // The note describes the previous write, so the first keystroke of the next edit retires it.\n return { ...state, editor, note: undefined }\n}\n\nexport function beginWrite(state: ConfigEditorState): ConfigEditorState {\n return { ...state, busy: true }\n}\n\n/**\n * A write finished. `rows` is re-read from the file rather than patched in place.\n *\n * Patching would drift: `editManifest` validates and may normalise, an `allowFrom` write rewrites the\n * whole `channels` list, and a secret changes a row's `present` without touching the manifest at all.\n * Re-reading is one source of truth and costs a file read nobody notices.\n */\nexport function settle(\n state: ConfigEditorState,\n rows: readonly EditorRow[],\n note: string,\n): ConfigEditorState {\n return {\n ...state,\n rows,\n cursor: Math.min(state.cursor, Math.max(0, rows.length - 1)),\n mode: \"browse\",\n editor: EMPTY_EDITOR,\n busy: false,\n note,\n }\n}\n\n/** A write was refused. The buffer stays, so the value can be corrected rather than retyped. */\nexport function refuse(state: ConfigEditorState, note: string): ConfigEditorState {\n return { ...state, busy: false, note }\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";yPA0BA,cAAS,UAAK,cAAM,YACpB,mBAAS,cC4CF,SAAS,CAAY,CAAC,EAAqC,CAC9D,OAAO,IAAQ,QAAa,EAAI,OAAS,UAItC,SAAS,CAAM,CAAC,EAAwB,CAC3C,OAAQ,EAAI,UACH,UACD,MAAO,WAAW,EAAI,QAAQ,WAC7B,QACD,MAAO,SAAS,EAAI,gBACnB,SACD,MAAO,UAAU,EAAI,WACpB,UACD,MAAO,WAAW,EAAI,SAkB3B,SAAS,CAAe,CAAC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,EAAM,MAAnB,SAA2B,KAAK,IAAU,GAC5C,EAWV,SAAS,CAAQ,CAAC,EAAkB,EAAkC,CAClE,OAAQ,EAAK,UACJ,KACD,OAAO,EAAM,OAAS,MACrB,OACD,OAAO,EAAM,OAAS,MACrB,QACD,MAAO,OACN,OACD,OAAO,EAAM,KAAK,OAAS,MAC1B,OACD,OAAO,EAAK,OAKjB,SAAS,CAAQ,CAAC,EAAwB,CAC7C,OAAQ,EAAI,UACH,UACD,OAAO,EAAI,QAAQ,SAClB,QACD,MAAO,GAAG,EAAI,0BACb,SACD,OAAO,EAAI,SACV,UACD,OAAO,EAAI,OAWhB,SAAS,CAAQ,CAAC,EAAwB,CAC7C,OAAQ,EAAI,UACH,UACD,OAAO,EAAI,QAAU,QAAa,EAAI,QAAU,KAC1C,YACA,OAAO,EAAI,QAAU,SACnB,EAAI,MACJ,KAAK,UAAU,EAAI,KAAK,MAC/B,QACD,OAAO,EAAI,QAAQ,SAAW,EAAI,WAAa,EAAI,QAAQ,KAAK,GAAG,MAClE,SACD,OAAO,EAAI,QAAU,QAAU,gBAC9B,UACD,MAAO,IAWnB,SAAS,CAAQ,CAAC,EAAwB,CACtC,IAAM,EAAQ,EAAS,CAAG,EAC1B,OAAO,EAAM,QAAU,EAAkB,aAAa,IAAU,cAIpE,IAAM,EAAkB,GAGxB,SAAS,CAAW,CAAC,EAAwB,CACzC,OAAQ,EAAI,UACH,UACD,OAAO,EAAI,QAAQ,UAClB,QACD,MAAO,8FACN,SACD,OAAO,EAAI,QACV,UACD,OAAO,EAAI",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "6ECE33C1BB078EEF64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{o,
|
|
2
|
+
import{o,Tn}from"./index-d4x6yvqh.js";import{D,kn,jt}from"./index-j55s3ehk.js";import{Box as x,Text as a,useInput as I}from"ink";import{useState as k}from"react";function P(e){return[...new TextEncoder().encode(e)].map((t)=>t.toString(16).padStart(2,"0")).join(" ")}function E(e){let t=[];if(e.ctrl)t.push("ctrl");if(e.meta)t.push("meta");if(e.super)t.push("super");if(e.shift)t.push("shift");for(let[r,s]of[["up",e.upArrow],["down",e.downArrow],["left",e.leftArrow],["right",e.rightArrow],["pageUp",e.pageUp],["pageDown",e.pageDown],["home",e.home],["end",e.end],["return",e.return],["escape",e.escape],["tab",e.tab],["backspace",e.backspace],["delete",e.delete]])if(s)t.push(r);if(e.eventType!==void 0&&e.eventType!=="press")t.push(e.eventType);return t.length===0?"—":t.join(" ")}function R(e){return e.super||e.eventType!==void 0}function y(e,t){if(!t)return"not requested — the override is set, so cmd chords cannot arrive";if(e.some((r)=>R(r.key)))return"active — a keystroke carried a modifier only the protocol can express";return"requested; nothing pressed yet has proved it — try cmd+left, or option+r"}function m(e){let t=[...e.bytes].map((r)=>{let s=r.codePointAt(0)??0;return s<32||s===127?".":r}).join("");return[`bytes ${P(e.bytes)}${t===""?"":` ${t}`}`,`ink ${E(e.key)}${e.input===""?"":` input ${JSON.stringify(e.input)}`}`,`intent ${e.intent.kind}`]}import{jsx as i,jsxs as d}from"react/jsx-runtime";var A=6,h=0;function H({columns:e,asked:t,terminal:r,takeRaw:s,correctKeys:u,onDone:g}){let[l,b]=k([]);return I((n,c)=>{let w=s?.(),f=c,p=u===void 0?f:u(f,n);if(n==="q"&&!p.ctrl&&!p.meta&&!p.super){g();return}let T=jt(n,p,kn(D,!1));h+=1;let K=h,S=w??n;b((v)=>[...v,{at:K,bytes:S,input:n,key:p,intent:T}].slice(-A))}),d(x,{flexDirection:"column",children:[d(a,{color:o.accent,bold:!0,wrap:"truncate",children:["key probe · ",r]}),d(a,{color:o.muted,wrap:"truncate",children:["protocol ",y(l,t)]}),i(a,{children:" "}),l.length===0?i(a,{color:o.muted,wrap:"truncate",children:"press any chord — the bytes, Ink's reading of them, and the resolved intent"}):null,l.map((n)=>d(x,{flexDirection:"column",children:[i(a,{color:o.border,wrap:"truncate",children:Tn("",e)}),m(n).map((c)=>i(a,{wrap:"truncate",children:c},c))]},`stroke-${n.at}`)),i(a,{children:" "}),i(a,{dimColor:!0,wrap:"truncate",children:" q leaves · every other key is recorded, ^C included"})]})}export{H as KeyProbe};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=KeyProbe-
|
|
4
|
+
//# debugId=811A621DD931485C64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=KeyProbe-9jjeze5r.js.map
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"/**\n * What a keystroke actually was, rendered for a person to paste into a bug report.\n *\n * ## Why this exists\n *\n * CLAUDE.md's rule is that a key chord is verified against a real terminal and never against the parser,\n * and for ten rounds of TUI work there was no way to do that: the only instrument was Ink reporting *a*\n * key, which says nothing about the bytes a terminal sent. So `⌥r` was documented, bound, handled, and\n * silently arriving as the composed character `®`, and every round diagnosed it by guessing.\n *\n * A probe ends that. It prints the bytes, Ink's reading of them, and the intent this repo's own keymap\n * resolved — three layers, so a failure names which one is wrong instead of leaving three suspects.\n *\n * Pure, so every line of it is asserted without a terminal. The component around it does nothing but\n * mount a `useInput` and hand what arrives to these functions.\n */\n\nimport type { Intent, KeyState } from \"#lib/types\"\n\n/** One keystroke, as all three layers saw it. */\nexport interface Keystroke {\n /**\n * What the terminal actually wrote, tapped off stdin.\n *\n * Distinct from `input` because for a special key they differ completely: `CSI 1;9:1D` reaches a\n * handler as `input: \"\"` with flags set, so a probe reporting only `input` prints an empty byte row\n * for every arrow, Home, and cmd chord — the exact keys worth probing. Measured under a pty, not\n * reasoned about.\n */\n readonly bytes: string\n /** What Ink handed the handler. Empty for a special key, which is itself the point. */\n readonly input: string\n readonly key: KeyState\n readonly intent: Intent\n}\n\n/**\n * The bytes, in hex, as UTF-8 — which is what the terminal actually wrote.\n *\n * Not `charCodeAt`: that reports UTF-16 code units, so a composed `®` or an emoji would print a number\n * no terminal ever sent. The point of a byte probe is the bytes.\n */\nexport function hexOf(text: string): string {\n return [...new TextEncoder().encode(text)]\n .map((byte) => byte.toString(16).padStart(2, \"0\"))\n .join(\" \")\n}\n\n/** The modifier and key flags Ink set, named. Empty when it set none, which is itself information. */\nexport function flagsOf(key: KeyState): string {\n const named: string[] = []\n if (key.ctrl) named.push(\"ctrl\")\n if (key.meta) named.push(\"meta\")\n if (key.super) named.push(\"super\")\n if (key.shift) named.push(\"shift\")\n for (const [name, held] of [\n [\"up\", key.upArrow],\n [\"down\", key.downArrow],\n [\"left\", key.leftArrow],\n [\"right\", key.rightArrow],\n [\"pageUp\", key.pageUp],\n [\"pageDown\", key.pageDown],\n [\"home\", key.home],\n [\"end\", key.end],\n [\"return\", key.return],\n [\"escape\", key.escape],\n [\"tab\", key.tab],\n [\"backspace\", key.backspace],\n [\"delete\", key.delete],\n ] as const) {\n if (held) named.push(name)\n }\n if (key.eventType !== undefined && key.eventType !== \"press\") named.push(key.eventType)\n return named.length === 0 ? \"—\" : named.join(\" \")\n}\n\n/**\n * Whether the keystroke is evidence that the kitty protocol negotiated.\n *\n * Ink does not expose whether its handshake succeeded, and asking the terminal a second time from here\n * would be a different question than the one Ink asked. So this reports *evidence* rather than a claim:\n * `super` cannot be expressed without the protocol, and an `eventType` only arrives under\n * `reportEventTypes`. Either one proves it is on. Neither one appearing proves nothing either way, which\n * the verdict below says in as many words rather than defaulting to \"off\".\n */\nexport function provesProtocol(key: KeyState): boolean {\n return key.super || key.eventType !== undefined\n}\n\n/** What can honestly be said about the protocol, given what has been pressed so far. */\nexport function protocolVerdict(seen: readonly Keystroke[], asked: boolean): string {\n if (!asked) return \"not requested — the override is set, so cmd chords cannot arrive\"\n if (seen.some((stroke) => provesProtocol(stroke.key))) {\n return \"active — a keystroke carried a modifier only the protocol can express\"\n }\n return \"requested; nothing pressed yet has proved it — try cmd+left, or option+r\"\n}\n\n/** One keystroke as three labelled lines, deepest layer last. */\nexport function keystrokeRows(stroke: Keystroke): readonly string[] {\n // Code points rather than a character-class regex: a control character written into a regex is a\n // lint error for a good reason (it is invisible in the source), and `printableOnly` in `keymap.ts`\n // already draws this line the same way.\n const printable = [...stroke.bytes]\n .map((char) => {\n const code = char.codePointAt(0) ?? 0\n return code < 0x20 || code === 0x7f ? \".\" : char\n })\n .join(\"\")\n return [\n `bytes ${hexOf(stroke.bytes)}${printable === \"\" ? \"\" : ` ${printable}`}`,\n `ink ${flagsOf(stroke.key)}${stroke.input === \"\" ? \"\" : ` input ${JSON.stringify(stroke.input)}`}`,\n `intent ${stroke.intent.kind}`,\n ]\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";+EAWA,cAAS,UAAK,cAAM,YACpB,mBAAS,cC8BF,SAAS,CAAK,CAAC,EAAsB,CACxC,MAAO,CAAC,GAAG,IAAI,YAAY,EAAE,OAAO,CAAI,CAAC,EACpC,IAAI,CAAC,IAAS,EAAK,SAAS,EAAE,EAAE,SAAS,EAAG,GAAG,CAAC,EAChD,KAAK,GAAG,EAIV,SAAS,CAAO,CAAC,EAAuB,CAC3C,IAAM,EAAkB,CAAC,EACzB,GAAI,EAAI,KAAM,EAAM,KAAK,MAAM,EAC/B,GAAI,EAAI,KAAM,EAAM,KAAK,MAAM,EAC/B,GAAI,EAAI,MAAO,EAAM,KAAK,OAAO,EACjC,GAAI,EAAI,MAAO,EAAM,KAAK,OAAO,EACjC,QAAY,EAAM,IAAS,CACvB,CAAC,KAAM,EAAI,OAAO,EAClB,CAAC,OAAQ,EAAI,SAAS,EACtB,CAAC,OAAQ,EAAI,SAAS,EACtB,CAAC,QAAS,EAAI,UAAU,EACxB,CAAC,SAAU,EAAI,MAAM,EACrB,CAAC,WAAY,EAAI,QAAQ,EACzB,CAAC,OAAQ,EAAI,IAAI,EACjB,CAAC,MAAO,EAAI,GAAG,EACf,CAAC,SAAU,EAAI,MAAM,EACrB,CAAC,SAAU,EAAI,MAAM,EACrB,CAAC,MAAO,EAAI,GAAG,EACf,CAAC,YAA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AO,GAAW,EAAc,EAAK,CAAC,EACxE,GAAW,EACX,IAAM,EAAK,EAGL,EAAQ,GAAO,EACrB,EAAQ,CAAC,IAAY,CAAC,GAAG,EAAS,CAAE,KAAI,QAAO,QAAO,IAAK,EAAO,QAAO,CAAC,EAAE,MAAM,CAAC,CAAI,CAAC,EAC3F,EAGG,EA6BE,EA7BF,CAAK,cAAc,SAAnB,SA6BE,CA5BE,EAEE,EAFF,CAAM,MAAO,EAAM,OAAQ,KAAI,GAAC,KAAK,WAArC,SAEE,CAFF,eACiB,GACf,EACF,EAEE,EAFF,CAAM,MAAO,EAAM,MAAO,KAAK,WAA/B,SAEE,CAFF,YACc,EAAgB,EAAM,CAAK,GACvC,EACF,EAAS,EAAT,cAAS,EACR,EAAK,SAAW,EACb,EAEE,EAFF,CAAM,MAAO,EAAM,MAAO,KAAK,WAA/B,uFAEE,EACF,KACH,EAAK,IAAI,CAAC,IACP,EASE,EATF,CAAiC,cAAc,SAA/C,SASE,CARE,EAEE,EAFF,CAAM,MAAO,EAAM,OAAQ,KAAK,WAAhC,SACK,GAAY,GAAI,CAAO,EAC1B,EACD,EAAc,CAAM,EAAE,IAAI,CAAC,IACxB,EAEE,EAFF,CAAgB,KAAK,WAArB,SACK,GADM,CAET,CACL,IARK,UAAU,EAAO,IASzB,CACL,EACD,EAAS,EAAT,cAAS,EACT,EAEE,EAFF,CAAM,SAAQ,GAAC,KAAK,WAApB,SACK,wDACH,GACJ",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "811A621DD931485C64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{u}from"./index-
|
|
2
|
+
import{u}from"./index-d4x6yvqh.js";import{it}from"./index-4z7axw4r.js";import{ae,W}from"./index-gz9x25tz.js";import{be}from"./index-j55s3ehk.js";import{Box as l,useApp as k,useInput as x}from"ink";import{useCallback as b,useState as y}from"react";import{jsx as r,jsxs as P}from"react/jsx-runtime";function I({title:m,agents:n,onDone:i}){let{exit:o}=k(),[s,d]=y({index:0,count:n.length+1}),a=b((e)=>{i(e),o()},[i,o]);x((e,f)=>{let c=be(e,f);switch(c.kind){case"move":d((t)=>W(t,c.move));return;case"choose":{let t=n[s.index];a(t===void 0?{kind:"create"}:{kind:"run",manifestPath:t.manifestPath});return}case"back":case"exit":a({kind:"quit"});return;case"none":return}});let p=[...n.map((e)=>({label:e.name??e.ref,hint:e.problem!==void 0?`⚠ ${e.problem}`:`${e.modelId??"?"} ${u.bullet}${e.ref}`})),{label:`${u.create}create a new agent`}];return P(l,{flexDirection:"column",children:[r(it,{title:m,lines:["pick an agent · enter runs it · esc quits"]}),r(l,{marginTop:1,children:r(ae,{items:p,index:s.index,numbered:!0})})]})}export{I as Picker};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=Picker-
|
|
4
|
+
//# debugId=0CA88FD304F39B3D64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=Picker-hfeh1g6m.js.map
|