dispach 0.1.2 → 0.2.0-pilot.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +196 -118
- package/dist/APEv2Parser-2wqk09q7.js +5 -0
- package/dist/APEv2Parser-2wqk09q7.js.map +9 -0
- package/dist/AiffParser-zw4g2bdd.js +5 -0
- package/dist/AiffParser-zw4g2bdd.js.map +12 -0
- package/dist/App-ez7ve0yp.js +11 -0
- package/dist/{App-b1yrwrcq.js.map → App-ez7ve0yp.js.map} +6 -7
- package/dist/AsfParser-2hfcf5z2.js +5 -0
- package/dist/AsfParser-2hfcf5z2.js.map +14 -0
- package/dist/ConfigEditor-aamadrx3.js +6 -0
- package/dist/{ConfigEditor-n8hdw6r7.js.map → ConfigEditor-aamadrx3.js.map} +2 -2
- package/dist/DsdiffParser-n8smktvb.js +5 -0
- package/dist/DsdiffParser-n8smktvb.js.map +11 -0
- package/dist/DsfParser-npmjp4vr.js +5 -0
- package/dist/DsfParser-npmjp4vr.js.map +11 -0
- package/dist/FlacParser-xpbs2zmb.js +5 -0
- package/dist/FlacParser-xpbs2zmb.js.map +9 -0
- package/dist/KeyProbe-4fp152yv.js +5 -0
- package/dist/{KeyProbe-9jjeze5r.js.map → KeyProbe-4fp152yv.js.map} +2 -2
- package/dist/MP4Parser-es3afcmw.js +5 -0
- package/dist/MP4Parser-es3afcmw.js.map +12 -0
- package/dist/MatroskaParser-kxysj649.js +5 -0
- package/dist/MatroskaParser-kxysj649.js.map +13 -0
- package/dist/MpegParser-b3rr7b0f.js +5 -0
- package/dist/MpegParser-b3rr7b0f.js.map +13 -0
- package/dist/MusepackParser-sgjzmq0r.js +5 -0
- package/dist/MusepackParser-sgjzmq0r.js.map +16 -0
- package/dist/OggParser-x8h54ynf.js +5 -0
- package/dist/OggParser-x8h54ynf.js.map +18 -0
- package/dist/Picker-rq015kzc.js +5 -0
- package/dist/{Picker-hfeh1g6m.js.map → Picker-rq015kzc.js.map} +2 -2
- package/dist/SessionPicker-03zyvd2f.js +5 -0
- package/dist/{SessionPicker-zyqkg4dn.js.map → SessionPicker-03zyvd2f.js.map} +2 -2
- package/dist/SkillBrowser-8s8rjv98.js +5 -0
- package/dist/{SkillBrowser-3qdp8080.js.map → SkillBrowser-8s8rjv98.js.map} +2 -2
- package/dist/WavPackParser-w515nnw2.js +5 -0
- package/dist/WavPackParser-w515nnw2.js.map +11 -0
- package/dist/WaveParser-sb0w9m20.js +5 -0
- package/dist/WaveParser-sb0w9m20.js.map +13 -0
- package/dist/WizardApp-wr1tftcr.js +5 -0
- package/dist/{WizardApp-vzpbydy3.js.map → WizardApp-wr1tftcr.js.map} +3 -3
- package/dist/agents.d.ts +19 -3
- package/dist/agents.d.ts.map +1 -1
- package/dist/channels-gx951qdp.js +31 -0
- package/dist/channels-gx951qdp.js.map +10 -0
- package/dist/channels.d.ts +26 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/client.js +11 -11
- package/dist/client.js.map +3 -3
- package/dist/config-wvjeejgd.js +24 -0
- package/dist/{config-g7za9x13.js.map → config-wvjeejgd.js.map} +2 -2
- package/dist/credential-10dn3fxj.js +19 -0
- package/dist/{credential-npr6z8c8.js.map → credential-10dn3fxj.js.map} +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/index-10009hp8.js +11 -0
- package/dist/index-10009hp8.js.map +11 -0
- package/dist/index-1xwrkwh5.js +14 -0
- package/dist/index-1xwrkwh5.js.map +50 -0
- package/dist/index-34p39yfc.js +47 -0
- package/dist/index-34p39yfc.js.map +15 -0
- package/dist/index-3y96s740.js +6 -0
- package/dist/{index-hwpvhaza.js.map → index-3y96s740.js.map} +1 -1
- package/dist/index-4ybeefmn.js +6 -0
- package/dist/index-4ybeefmn.js.map +11 -0
- package/dist/index-59z88wrb.js +6 -0
- package/dist/{index-h9mw7b9d.js.map → index-59z88wrb.js.map} +2 -2
- package/dist/index-5fwzn21m.js +6 -0
- package/dist/{index-gz9x25tz.js.map → index-5fwzn21m.js.map} +2 -2
- package/dist/index-6dvnfk8y.js +6 -0
- package/dist/index-6dvnfk8y.js.map +10 -0
- package/dist/index-6p70fnb7.js +153 -0
- package/dist/index-6p70fnb7.js.map +20 -0
- package/dist/index-6s471ydn.js +12 -0
- package/dist/{index-j55s3ehk.js.map → index-6s471ydn.js.map} +2 -2
- package/dist/index-87wcawta.js +6 -0
- package/dist/{index-0d93hyfc.js.map → index-87wcawta.js.map} +2 -2
- package/dist/index-92gfcbw0.js +6 -0
- package/dist/index-92gfcbw0.js.map +9 -0
- package/dist/index-a0h0p20f.js +991 -0
- package/dist/{index-tv4yv7d2.js.map → index-a0h0p20f.js.map} +27 -23
- package/dist/index-bamw24xc.js +6 -0
- package/dist/{index-6q4wf8e3.js.map → index-bamw24xc.js.map} +1 -1
- package/dist/index-c8ge88a9.js +12 -0
- package/dist/{index-258d8bzg.js.map → index-c8ge88a9.js.map} +4 -3
- package/dist/index-cb2q8nae.js +6 -0
- package/dist/index-cb2q8nae.js.map +13 -0
- package/dist/index-ct6bw0a6.js +6 -0
- package/dist/{index-4z7axw4r.js.map → index-ct6bw0a6.js.map} +1 -1
- package/dist/index-cz6yjxyz.js +10 -0
- package/dist/index-cz6yjxyz.js.map +42 -0
- package/dist/index-d0c5abkw.js +6 -0
- package/dist/{index-vgc3y3rm.js.map → index-d0c5abkw.js.map} +3 -3
- package/dist/index-d0vagham.js +31 -0
- package/dist/index-d0vagham.js.map +188 -0
- package/dist/index-d0zxvr99.js +90 -0
- package/dist/index-d0zxvr99.js.map +13 -0
- package/dist/{index-s9mbq7h6.js → index-d9c97ver.js} +4 -4
- package/dist/{index-s9mbq7h6.js.map → index-d9c97ver.js.map} +1 -1
- package/dist/index-e508e0vt.js +6 -0
- package/dist/{index-tf71ap9v.js.map → index-e508e0vt.js.map} +1 -1
- package/dist/index-esq0knqx.js +6 -0
- package/dist/index-esq0knqx.js.map +10 -0
- package/dist/index-featyhps.js +6 -0
- package/dist/index-featyhps.js.map +10 -0
- package/dist/index-fnq44zdt.js +45 -0
- package/dist/index-fnq44zdt.js.map +74 -0
- package/dist/index-gmn80dwc.js +7 -0
- package/dist/{index-02dn6m2j.js.map → index-gmn80dwc.js.map} +2 -2
- package/dist/index-gwhx69qs.js +66 -0
- package/dist/index-gwhx69qs.js.map +12 -0
- package/dist/index-kjgzhf3w.js +9 -0
- package/dist/{index-6p999cx4.js.map → index-kjgzhf3w.js.map} +4 -6
- package/dist/index-m68cd91a.js +12 -0
- package/dist/index-m68cd91a.js.map +23 -0
- package/dist/{index-3g3ny01d.js → index-mhmgw54j.js} +4 -4
- package/dist/{index-3g3ny01d.js.map → index-mhmgw54j.js.map} +1 -1
- package/dist/{index-gme2egyq.js → index-qm612hwa.js} +4 -4
- package/dist/{index-gme2egyq.js.map → index-qm612hwa.js.map} +1 -1
- package/dist/{index-j7gyr5nx.js → index-qwntpbwe.js} +7 -7
- package/dist/{index-j7gyr5nx.js.map → index-qwntpbwe.js.map} +1 -1
- package/dist/index-qx3xdk4x.js +6 -0
- package/dist/{index-d4x6yvqh.js.map → index-qx3xdk4x.js.map} +3 -4
- package/dist/{index-4cf6v9nb.js → index-rh0meegk.js} +4 -4
- package/dist/{index-4cf6v9nb.js.map → index-rh0meegk.js.map} +1 -1
- package/dist/index-ryb159ff.js +9 -0
- package/dist/{index-ff514z3y.js.map → index-ryb159ff.js.map} +3 -5
- package/dist/{index-ammv5st7.js → index-s6zfpyqa.js} +6 -6
- package/dist/{index-ammv5st7.js.map → index-s6zfpyqa.js.map} +1 -1
- package/dist/index-s9va2kmc.js +429 -0
- package/dist/index-s9va2kmc.js.map +11 -0
- package/dist/index-v5dmsgpx.js +7 -0
- package/dist/index-v5dmsgpx.js.map +11 -0
- package/dist/index-vaj3mn3a.js +6 -0
- package/dist/index-vaj3mn3a.js.map +14 -0
- package/dist/index-vy0rbzws.js +6 -0
- package/dist/{index-fex44816.js.map → index-vy0rbzws.js.map} +2 -2
- package/dist/index-w0s77wfx.js +6 -0
- package/dist/{index-v8e92nfw.js.map → index-w0s77wfx.js.map} +1 -1
- package/dist/index-wx1jzjzr.js +6 -0
- package/dist/{index-qdbq8crg.js.map → index-wx1jzjzr.js.map} +2 -2
- package/dist/index-xbn26c8g.js +126 -0
- package/dist/index-xbn26c8g.js.map +14 -0
- package/dist/index-ytvwyp6k.js +6 -0
- package/dist/{index-9r0wyj6w.js.map → index-ytvwyp6k.js.map} +2 -2
- package/dist/{index-cqqb6gaq.js → index-yvnwpxbb.js} +5 -5
- package/dist/{index-cqqb6gaq.js.map → index-yvnwpxbb.js.map} +1 -1
- package/dist/index.js +379 -448
- package/dist/index.js.map +26 -28
- package/dist/init.d.ts.map +1 -1
- package/dist/lib/agent-secrets.d.ts +38 -0
- package/dist/lib/agent-secrets.d.ts.map +1 -0
- package/dist/lib/agent-template.d.ts +54 -0
- package/dist/lib/agent-template.d.ts.map +1 -0
- 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/daemon-plan.d.ts.map +1 -1
- package/dist/lib/help.d.ts.map +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 +32 -0
- 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 +13 -0
- 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 +17 -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-61cjhpv2.js +14 -0
- package/dist/{web-vkb16r62.js.map → web-61cjhpv2.js.map} +3 -3
- package/dist/web.d.ts +2 -13
- package/dist/web.d.ts.map +1 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/wrapper-9msjh1xg.js +5 -0
- package/dist/wrapper-9msjh1xg.js.map +9 -0
- package/package.json +6 -3
- package/dist/App-b1yrwrcq.js +0 -11
- package/dist/ConfigEditor-n8hdw6r7.js +0 -6
- package/dist/KeyProbe-9jjeze5r.js +0 -5
- package/dist/Picker-hfeh1g6m.js +0 -5
- package/dist/SessionPicker-zyqkg4dn.js +0 -5
- package/dist/SkillBrowser-3qdp8080.js +0 -5
- package/dist/WizardApp-vzpbydy3.js +0 -5
- package/dist/config-g7za9x13.js +0 -24
- package/dist/credential-npr6z8c8.js +0 -19
- package/dist/index-02dn6m2j.js +0 -7
- package/dist/index-0d93hyfc.js +0 -6
- package/dist/index-1c5113t4.js +0 -66
- package/dist/index-1c5113t4.js.map +0 -12
- package/dist/index-258d8bzg.js +0 -12
- package/dist/index-4z7axw4r.js +0 -6
- package/dist/index-6p999cx4.js +0 -9
- package/dist/index-6q4wf8e3.js +0 -6
- package/dist/index-9r0wyj6w.js +0 -6
- package/dist/index-d4x6yvqh.js +0 -6
- package/dist/index-fecm8xe7.js +0 -77
- package/dist/index-fecm8xe7.js.map +0 -12
- package/dist/index-fex44816.js +0 -6
- package/dist/index-ff514z3y.js +0 -14
- package/dist/index-gz9x25tz.js +0 -6
- package/dist/index-h9mw7b9d.js +0 -6
- package/dist/index-hwpvhaza.js +0 -6
- package/dist/index-j55s3ehk.js +0 -12
- package/dist/index-mtn0g9vc.js +0 -7
- package/dist/index-mtn0g9vc.js.map +0 -11
- package/dist/index-qdbq8crg.js +0 -6
- package/dist/index-tf71ap9v.js +0 -6
- package/dist/index-ttwyrdjs.js +0 -427
- package/dist/index-ttwyrdjs.js.map +0 -11
- package/dist/index-tv4yv7d2.js +0 -903
- package/dist/index-ty24n0jh.js +0 -167
- package/dist/index-ty24n0jh.js.map +0 -19
- package/dist/index-v8e92nfw.js +0 -6
- package/dist/index-vgc3y3rm.js +0 -6
- package/dist/index-whaw4b18.js +0 -6
- package/dist/index-whaw4b18.js.map +0 -10
- package/dist/web-vkb16r62.js +0 -14
package/README.md
CHANGED
|
@@ -1,49 +1,72 @@
|
|
|
1
1
|
# Dispach
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An open-source, self-hosted agent runtime your product calls over HTTP.
|
|
4
4
|
|
|
5
|
-
Dispach
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
Your backend calls one API and Dispach runs the agents: each has its own memory, tools, schedules,
|
|
6
|
+
channels and approvals, on any OpenAI-compatible model (including small local ones), on
|
|
7
|
+
infrastructure you control. Every turn is detached and reattachable, every write takes an
|
|
8
|
+
idempotency key, and the wire contract is published as OpenAPI 3.1 and checked in CI. One process
|
|
9
|
+
hosts many agents, and scoped keys fence each one off. TypeScript, shipped on Node, Apache-2.0.
|
|
10
|
+
|
|
11
|
+
**Where it is going: the multiplayer agent runtime.** 0.2.0 gives every user and every team in your
|
|
12
|
+
product their own isolated runtime of agents. Those agents share rooms and memory with the people
|
|
13
|
+
they work for, and stand in for them, openly, when they are away. That half is being built. Every
|
|
14
|
+
other feature described in this README runs today.
|
|
9
15
|
|
|
10
16
|
> To dispatch is to send a thing on its way with the authority to see it done — to decide
|
|
11
17
|
> what handles it, hand it over, and answer for the result.
|
|
12
18
|
|
|
13
|
-
##
|
|
19
|
+
## Call it over HTTP
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git clone https://github.com/moeen-mahmud/dispach && cd dispach
|
|
23
|
+
cp .env.example .env # set DISPACH_API_TOKEN; no model key needed to start
|
|
24
|
+
docker compose up -d --build --wait
|
|
25
|
+
export TOKEN=$(grep DISPACH_API_TOKEN .env | cut -d= -f2-)
|
|
26
|
+
|
|
27
|
+
curl -s -H "Authorization: Bearer $TOKEN" -H 'content-type: application/json' \
|
|
28
|
+
-d '{"answers":{"user":"you","name":"milo","apiKey":"sk-…"}}' localhost:7420/v1/agents
|
|
29
|
+
# → 201 {"id":"milo",…,"adopted":["milo"]}: live now, no restart
|
|
30
|
+
|
|
31
|
+
curl -s -H "Authorization: Bearer $TOKEN" -H 'content-type: application/json' \
|
|
32
|
+
-d '{"text":"what can you do?"}' localhost:7420/v1/agents/milo/messages
|
|
33
|
+
# → 202 {"turnId":"t_…","sessionKey":"api:default"}: the turn runs whether or not you stay
|
|
34
|
+
```
|
|
14
35
|
|
|
15
|
-
|
|
36
|
+
The defaults are OpenAI's. For another endpoint, add `"model"` and `"baseUrl"` to the answers;
|
|
37
|
+
`GET /v1/provision` lists every question with its default and choices.
|
|
16
38
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
39
|
+
**[`docs/09-API-GUIDE.md`](docs/09-API-GUIDE.md) is the walkthrough**: provisioning over the wire,
|
|
40
|
+
streaming, reattaching after a dropped connection, approvals and keys. The reference is served at
|
|
41
|
+
`http://localhost:7420/docs`, the contract is [`docs/04-SPEC-WIRE.md`](docs/04-SPEC-WIRE.md), and
|
|
42
|
+
`dispach/client` is the typed client. The CLI and the full-screen terminal UI below are the same
|
|
43
|
+
runtime from a terminal.
|
|
22
44
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
45
|
+
## Status
|
|
46
|
+
|
|
47
|
+
**Pre-release, and it runs: 0.1.3**, from npm, Homebrew or the container image. Every install runs
|
|
48
|
+
under Node. [`CHANGELOG.md`](CHANGELOG.md) has what landed in each release.
|
|
26
49
|
|
|
27
|
-
|
|
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.
|
|
50
|
+
Built and in use:
|
|
33
51
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
WhatsApp
|
|
52
|
+
- **Core runtime:** the agent loop with the NLT and native tool dialects, the manifest, the tiered
|
|
53
|
+
workspace, the compaction ladder, phase-scoped tools, memory that carries across sessions, skills
|
|
54
|
+
with two catalogues, and scheduling (cron, interval and one-shot, DST-correct).
|
|
55
|
+
- **Serving and API:** the HTTP/SSE/WS server with detached turns, the typed client, scoped operator
|
|
56
|
+
keys, approvals over the wire, and provisioning an agent over HTTP with no restart.
|
|
57
|
+
- **Channels and tools:** Telegram and WhatsApp (the latter a bundled plugin, with a warning;
|
|
58
|
+
[see below](#whatsapp)), the plugin API with all four middleware wrap points, and system and web
|
|
59
|
+
tool providers under a policy engine.
|
|
60
|
+
- **Coordination and delivery:** supervisor delegation with typed handoffs, and an idempotent
|
|
61
|
+
outbox.
|
|
62
|
+
- **Front ends and hosting:** a browser UI on the same origin as the API, the TUI, launchd
|
|
63
|
+
services, and the Docker image with a compose front door.
|
|
40
64
|
|
|
41
|
-
**MCP
|
|
42
|
-
tool provider among several, never the substrate*
|
|
43
|
-
so a `tools-mcp` provider is
|
|
44
|
-
listed the package in its tree for months anyway; it has never existed on any branch.
|
|
65
|
+
Not built: **MCP as a tool provider.** It is planned, not refused. Decision 4.7 keeps it as *one
|
|
66
|
+
tool provider among several, never the substrate* (Composio is called directly for that reason),
|
|
67
|
+
so a `tools-mcp` provider is something that could be written and has not been.
|
|
45
68
|
|
|
46
|
-
`docs/05-PLAN.md` has every phase with its acceptance criteria and what is ticked.
|
|
69
|
+
`docs/05-PLAN.md` has every 0.1.x phase with its acceptance criteria and what is ticked.
|
|
47
70
|
|
|
48
71
|
## Scope
|
|
49
72
|
|
|
@@ -106,17 +129,16 @@ so there is one thing to install, one thing to version and one thing to trust. `
|
|
|
106
129
|
pulls in no terminal UI — asserted by the package's own tests, because an HTTP client has no
|
|
107
130
|
business paying the ~170-210 ms that importing Ink and React costs.
|
|
108
131
|
|
|
109
|
-
### Or
|
|
110
|
-
|
|
111
|
-
One file, no Node and no `node_modules`. `bun build --compile` embeds the runtime, which is also
|
|
112
|
-
why it starts *faster* than a `node_modules` install — there is no module resolution left to do at
|
|
113
|
-
boot. Measured on an M-series mac, `validate --json`: **70–90 ms compiled against 90–110 ms through
|
|
114
|
-
Node**.
|
|
132
|
+
### Or with Homebrew
|
|
115
133
|
|
|
116
134
|
```bash
|
|
117
135
|
brew install moeen-mahmud/tap/dispach
|
|
118
136
|
```
|
|
119
137
|
|
|
138
|
+
The formula depends on `node` and installs the same npm tarball, so a brew install and an npm
|
|
139
|
+
install run identical code — one runtime, one artefact to checksum. (Until 0.1.3 the formula shipped
|
|
140
|
+
a Bun-compiled binary, and Bun cannot complete the WhatsApp handshake; see below.)
|
|
141
|
+
|
|
120
142
|
The name is fully qualified on purpose. Homebrew taps from it with no separate `brew tap`, and
|
|
121
143
|
naming a formula in full is *itself* what Homebrew accepts as consent to load a third-party tap —
|
|
122
144
|
`brew install dispach` after a plain `brew tap moeen-mahmud/tap` is the same install and refuses
|
|
@@ -124,30 +146,15 @@ until `brew trust moeen-mahmud/tap` is run, because a bare name carries no such
|
|
|
124
146
|
|
|
125
147
|
`brew services start dispach` then runs the always-on server; `brew info` prints the rest.
|
|
126
148
|
|
|
127
|
-
Or
|
|
128
|
-
`linux-arm64`, each with a `.sha256` beside it:
|
|
149
|
+
### Or the container
|
|
129
150
|
|
|
130
151
|
```bash
|
|
131
|
-
|
|
132
|
-
curl -fsSL -O "$base/dispach-darwin-arm64"
|
|
133
|
-
curl -fsSL -O "$base/dispach-darwin-arm64.sha256"
|
|
134
|
-
shasum -a 256 -c dispach-darwin-arm64.sha256 # must print "OK"
|
|
135
|
-
chmod +x dispach-darwin-arm64
|
|
136
|
-
sudo mv dispach-darwin-arm64 /usr/local/bin/dispach
|
|
152
|
+
docker pull ghcr.io/moeen-mahmud/dispach:0.1.3
|
|
137
153
|
```
|
|
138
154
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
Two things worth knowing about the macOS asset, because the failure has no error message:
|
|
143
|
-
|
|
144
|
-
- **The release binary is ad-hoc signed, and it has to be.** A compiled Bun binary arrives
|
|
145
|
-
*linker-signed*, which macOS refuses on exec — **exit 137 with no output at all**, which reads as
|
|
146
|
-
a crash rather than as a policy. `codesign -dv` reports such a file as signed, so the obvious
|
|
147
|
-
check passes on a binary that cannot run. The release re-signs every darwin asset, and
|
|
148
|
-
`scripts/build-binary.ts` refuses to produce an unsigned one.
|
|
149
|
-
- **Gatekeeper still applies to a downloaded file.** A binary fetched with a browser carries a
|
|
150
|
-
quarantine attribute; `xattr -d com.apple.quarantine dispach` clears it. `curl` does not set it.
|
|
155
|
+
The [Docker](#docker) and [Compose](#hosting-with-compose) sections below have the run lines and
|
|
156
|
+
the reasons behind them. The image is `node:24-trixie-slim` with `git`, `python3`, `uv` and `jq`,
|
|
157
|
+
because the agent has a shell.
|
|
151
158
|
|
|
152
159
|
### Or from a checkout
|
|
153
160
|
|
|
@@ -175,8 +182,8 @@ Four things that are not obvious:
|
|
|
175
182
|
`tools-system`, `tools-web`, `tools-composio` and `channel-telegram` from their `dist`, so building
|
|
176
183
|
only `core` and `cli` leaves the binary running yesterday's provider code — and the symptom is the
|
|
177
184
|
worst kind: your change is correct, a test fails, and the stack trace points into a stale `dist`.
|
|
178
|
-
- **Node 24+ must be on your `PATH`.** The built
|
|
179
|
-
it and Node runs it.
|
|
185
|
+
- **Node 24+ must be on your `PATH`.** The built entry's shebang is `#!/usr/bin/env node`; Bun builds
|
|
186
|
+
it and Node runs it — the same runtime every install ships.
|
|
180
187
|
- **`DISPACH_HOME` relocates the whole sandbox.** Point it at a temporary directory and every agent,
|
|
181
188
|
the store and the logs go there instead of `~/.dispach` — which is how to try things out, and how
|
|
182
189
|
every test in this repo avoids touching a real one.
|
|
@@ -306,13 +313,17 @@ connects a channel, because a REPL that quietly started answering Telegram while
|
|
|
306
313
|
would be a surprise — and because a messaging provider allows exactly one listener per token, so
|
|
307
314
|
the two would fight over your bot.
|
|
308
315
|
|
|
309
|
-
`serve` still dies with its terminal.
|
|
316
|
+
`serve` still dies with its terminal. So `init` asks whether to keep it running — the default is
|
|
317
|
+
yes — and puts the service up itself: one service hosts every agent in the sandbox, and the agent
|
|
318
|
+
just written is adopted by it before the wizard finishes. By hand, and afterwards:
|
|
310
319
|
|
|
311
320
|
```bash
|
|
312
|
-
dispach daemon install
|
|
313
|
-
dispach
|
|
314
|
-
dispach
|
|
315
|
-
dispach
|
|
321
|
+
dispach daemon install # one service for every agent; checks it will boot first
|
|
322
|
+
dispach status # the service, every agent, every channel — one screen
|
|
323
|
+
dispach restart milo # reload one agent in place, after editing agent.yaml or .env
|
|
324
|
+
dispach restart # the whole service
|
|
325
|
+
dispach logs -f # the server's stderr; the same as `daemon logs`
|
|
326
|
+
dispach agents # what the sandbox holds and who is serving it
|
|
316
327
|
```
|
|
317
328
|
|
|
318
329
|
If you want everything off — services *and* a `serve` you left in a tab three days ago — there is
|
|
@@ -338,12 +349,12 @@ plaintext to any local process, so the agent reads its credentials from the `.en
|
|
|
338
349
|
manifest — which `init` writes `0600` — and the plist carries only `HOME`, `PATH` and the two brand
|
|
339
350
|
variables.
|
|
340
351
|
|
|
341
|
-
**Linux and containers.**
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
in flight, and exits 0.
|
|
352
|
+
**Linux and containers.** On Linux `daemon install` writes a systemd **user** unit and prints the
|
|
353
|
+
two commands that start it — it does not run them, because nothing in this project's test
|
|
354
|
+
environment can execute `systemctl`, and a unit nobody has started is how a "supported" platform
|
|
355
|
+
turns out not to be. Mind `loginctl enable-linger`, or the unit stops with your last session. In a
|
|
356
|
+
container, the image's own `serve` is the process and the container runtime supervises it — it
|
|
357
|
+
handles SIGTERM, finishes the delivery in flight, and exits 0.
|
|
347
358
|
|
|
348
359
|
## Hosting with Compose
|
|
349
360
|
|
|
@@ -396,7 +407,7 @@ container around it, and the same tell — everything works, nothing is current.
|
|
|
396
407
|
curl -s -H "Authorization: Bearer $DISPACH_API_TOKEN" \
|
|
397
408
|
-H 'content-type: application/json' \
|
|
398
409
|
-d '{"text":"what can you do?"}' \
|
|
399
|
-
localhost:7420/v1/agents/
|
|
410
|
+
localhost:7420/v1/agents/milo/messages
|
|
400
411
|
# → {"turnId":"t_…","sessionKey":"api:default"}
|
|
401
412
|
```
|
|
402
413
|
|
|
@@ -415,8 +426,7 @@ Five things in that file are answers to defaults that bite, and they are comment
|
|
|
415
426
|
than left to be discovered:
|
|
416
427
|
|
|
417
428
|
- **`name: dispach`.** Compose names a container `<project>-<service>-<n>` and takes the project
|
|
418
|
-
from the *directory name*,
|
|
419
|
-
kept the pre-rename name — a stale brand with nothing in the tree for `git grep` to find, since
|
|
429
|
+
from the *directory name*, a stale brand with nothing in the tree for `git grep` to find, since
|
|
420
430
|
the string was never in a file. Set explicitly, it is `dispach-server-1` wherever you clone to.
|
|
421
431
|
- **No `command:` override.** The image's CMD carries `--host 0.0.0.0`; a compose `command:`
|
|
422
432
|
replaces CMD wholesale, so adding one drops the host flag and the process listens on loopback
|
|
@@ -477,8 +487,8 @@ fenced as untrusted. What the agent's shell can reach is `sh`, `bash`, `git`, `p
|
|
|
477
487
|
and `curl` — `git` because the skills catalogue is fetched with it and its absence *deletes* that
|
|
478
488
|
feature rather than degrading it, `python3` and `uv` because a skill shipping scripts needs them.
|
|
479
489
|
|
|
480
|
-
What is **absent on purpose**, and asserted as such: no Bun
|
|
481
|
-
|
|
490
|
+
What is **absent on purpose**, and asserted as such: no Bun — the application is the published npm
|
|
491
|
+
package running under Node, exactly what a laptop runs; no `wget`, so there is one obvious HTTP client rather than two; and no pager
|
|
482
492
|
and no editor, because `exec` hands a child a file descriptor and never a TTY — anything that pages
|
|
483
493
|
or prompts blocks until its deadline and reads as a hung agent. The CI `docker` job asserts both
|
|
484
494
|
lists, that the image is glibc, that a C-extension wheel installs with no compiler present, that a
|
|
@@ -505,13 +515,13 @@ consequence: run it on a laptop and the policy is the only boundary there is.
|
|
|
505
515
|
## Docker
|
|
506
516
|
|
|
507
517
|
```bash
|
|
508
|
-
docker build -f docker/Dockerfile -t dispach .
|
|
518
|
+
docker pull ghcr.io/moeen-mahmud/dispach:0.1.3 # or build it: docker build -f docker/Dockerfile -t dispach .
|
|
509
519
|
docker run --rm -p 7420:7420 \
|
|
510
520
|
--env-file examples/minimal/.env \
|
|
511
521
|
-e DISPACH_API_TOKEN=pick-something \
|
|
512
522
|
-v "$PWD/examples/minimal:/agent" \
|
|
513
523
|
-v dispach-home:/home/dispach \
|
|
514
|
-
dispach
|
|
524
|
+
ghcr.io/moeen-mahmud/dispach:0.1.3
|
|
515
525
|
```
|
|
516
526
|
|
|
517
527
|
The token is not optional and is not boilerplate. The image binds `0.0.0.0`, because a process
|
|
@@ -525,8 +535,10 @@ as anything `dispach init` creates inside the container. There is **one agents d
|
|
|
525
535
|
there was not before: the image used to set `DISPACH_HOME=/state`, so `init` wrote to `/state/agents`
|
|
526
536
|
while the CMD served `/agent`, and an agent created in the container was invisible to every listing.
|
|
527
537
|
|
|
528
|
-
The image is `
|
|
529
|
-
|
|
538
|
+
The image is `node:24-trixie-slim` and the runtime stage installs **the published npm tarball** with
|
|
539
|
+
`npm i -g` — the container runs byte-for-byte what `npm i -g dispach` runs on a laptop. No Bun: it
|
|
540
|
+
is the dev toolchain, and the runtime that cannot finish a WhatsApp pairing. glibc rather than musl
|
|
541
|
+
is deliberate and is about Python: PyPI's
|
|
530
542
|
C-extension wheels are `manylinux`, so on alpine anything without a `musllinux` build compiles from
|
|
531
543
|
source, and this image ships no compiler — a wheel would fail *inside a tool call*. Non-root as
|
|
532
544
|
`dispach` (uid 1000) — **a host directory bind-mounted at `/home/dispach` has to be writable by
|
|
@@ -538,15 +550,14 @@ deliberately. A Telegram outage must not read as an unhealthy container and get
|
|
|
538
550
|
the same outage, so the probe answers "can it serve a turn" rather than "is everything connected".
|
|
539
551
|
Channel state lives on the agent resource instead.
|
|
540
552
|
|
|
541
|
-
Measured on an arm64 Docker Desktop: the image is **
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
install rather than compile. The healthcheck reports healthy, an
|
|
553
|
+
Measured on an arm64 Docker Desktop at 0.1.3: the image is **701 MB** against an 800 MB ceiling,
|
|
554
|
+
and `docker compose up -d --wait` reaches healthy in about six seconds — readiness is tens of
|
|
555
|
+
milliseconds in-process and almost all of that is waiting for the first healthcheck probe. Where the
|
|
556
|
+
size goes: 110 MB Debian, 160 MB of Node (with npm and corepack, kept so the agent's shell has a
|
|
557
|
+
Node toolchain), 158 MB of apt packages (of which `git` alone is **92 MB**, because Debian's git
|
|
558
|
+
pulls perl), 47 MB of `uv`, and 58 MB for the installed package with `ink` and `react`. Node costs
|
|
559
|
+
about 75 MB more than the compiled binary it replaced in 0.1.3, and buys the one thing the binary
|
|
560
|
+
could not do: pair WhatsApp. The healthcheck reports healthy, an
|
|
550
561
|
unauthenticated write is refused with 401, `store.db` lands on the home volume owned by uid 1000,
|
|
551
562
|
and a real streaming turn against DeepSeek reconstructs from 26 `model.chunk` frames. The CI
|
|
552
563
|
`docker` job rebuilds and re-measures on every push, because a figure nobody re-checks is a figure
|
|
@@ -634,43 +645,101 @@ Stated plainly, because the alternative is someone assuming otherwise:
|
|
|
634
645
|
> the startup time and simplicity this project exists to preserve. If you need to run
|
|
635
646
|
> untrusted plugin code, run the whole agent in a container and treat that as the boundary.
|
|
636
647
|
|
|
637
|
-
`dispach plugins <
|
|
648
|
+
`dispach plugins list <agent>` prints what each plugin registered and what it declared, with that
|
|
638
649
|
last sentence repeated above the list. Declaring accurately costs nothing today and is the only
|
|
639
650
|
thing that will distinguish a plugin from a scramble when enforcement lands.
|
|
640
651
|
|
|
652
|
+
### WhatsApp
|
|
653
|
+
|
|
654
|
+
Bundled, like Telegram — no `plugins add` step. But read this first: Baileys reverse-engineers
|
|
655
|
+
WhatsApp Web, WhatsApp's terms do not permit it, and there is no appeal path when a number is
|
|
656
|
+
banned — including during development. **Pair a spare number.**
|
|
657
|
+
|
|
658
|
+
`init --whatsapp connected --whatsapp-number <digits>` writes the channel with `pairWith` set to the
|
|
659
|
+
account's own number; pairing is then an eight-character code typed into the phone under *Linked
|
|
660
|
+
devices › Link with phone number*, offered where the number was typed. Afterwards:
|
|
661
|
+
|
|
662
|
+
```bash
|
|
663
|
+
dispach channels pair milo wa # start a host if none is up, adopt milo, show the code, wait
|
|
664
|
+
dispach channels list milo # what it is reachable on, and whether it is paired
|
|
665
|
+
dispach channels unpair milo wa # forget the session
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
`pairWith` is the account the agent *runs as*; `allowFrom` is who may message it, and the paired
|
|
669
|
+
account is always admitted — `allowFrom` means who *else*. Numbers take a `+` and separators
|
|
670
|
+
anywhere they are typed.
|
|
671
|
+
|
|
672
|
+
`deviceName: milo` on the channel shows as `Google Chrome (milo)` under Linked devices. The left
|
|
673
|
+
half is fixed by the protocol; the bracket is yours. Some accounts refuse a non-standard name under
|
|
674
|
+
pairing-by-code — the refusal says so, and removing the field fixes it. New pairings only.
|
|
675
|
+
|
|
676
|
+
**It pairs under Node and not under Bun**, measured against the same bundle, which is why every
|
|
677
|
+
install of `dispach` runs under Node since 0.1.3. From a checkout under `bun run` the channel says
|
|
678
|
+
so at start rather than connecting to nothing in silence.
|
|
679
|
+
|
|
680
|
+
### Installing one
|
|
681
|
+
|
|
682
|
+
```bash
|
|
683
|
+
dispach plugins add <agent> moeen-mahmud/some-plugin --ref v1.0.0
|
|
684
|
+
dispach plugins list <agent>
|
|
685
|
+
dispach plugins remove <agent> some-plugin
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
`add` clones with git into `~/.dispach/plugins/<name>/`, loads it there to read its declarations,
|
|
689
|
+
prints them, and only then writes the `plugins:` entry — because a manifest naming a plugin that
|
|
690
|
+
will not load *does not load*, so writing the entry first would brick the agent and report success.
|
|
691
|
+
The verification is the same `conformance()` suite the plugin's own author runs.
|
|
692
|
+
|
|
693
|
+
**A plugin is one self-contained bundle.** Nothing is installed while this runtime runs (hard rule
|
|
694
|
+
5), so a tree that declares runtime dependencies and ships no `node_modules` is refused by name
|
|
695
|
+
rather than half-loading at your next boot. That rule is what makes the npm install and the
|
|
696
|
+
container — whose `node_modules` holds only the two declared dependencies — resolve a plugin
|
|
697
|
+
exactly as a checkout does.
|
|
698
|
+
|
|
699
|
+
What git costs, said rather than discovered: no version resolution and no integrity check. `--ref`
|
|
700
|
+
pins a tag or a commit, the resolved commit is recorded beside the code and printed by `plugins
|
|
701
|
+
list`, and the `dispachApi` gate checks **compatibility, not authenticity** — nothing here verifies
|
|
702
|
+
who published what. A local path is accepted too, which is how you test a bundle before publishing
|
|
703
|
+
it.
|
|
704
|
+
|
|
641
705
|
## Commands
|
|
642
706
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
authority; read this as a map. `dispach <command> --help` has the flags.
|
|
707
|
+
Generated from the same `CommandSpec` table the parser and `dispach --help` use — by
|
|
708
|
+
`bun scripts/readme-commands.ts`, and a test fails when this copy is stale. It used to be
|
|
709
|
+
hand-written, and was missing five commands at once. `dispach <command> --help` has the flags.
|
|
647
710
|
|
|
711
|
+
<!-- commands:begin — generated by scripts/readme-commands.ts; do not edit by hand -->
|
|
648
712
|
| Command | What it does |
|
|
649
713
|
| --- | --- |
|
|
650
|
-
| `init` | create
|
|
651
|
-
| `run` | an interactive session
|
|
652
|
-
| `
|
|
653
|
-
| `
|
|
654
|
-
| `
|
|
655
|
-
| `remove` | delete an agent: directory, sessions, memory, logs, service |
|
|
714
|
+
| `init` | create a new agent: manifest, workspace, and env files |
|
|
715
|
+
| `run` | start an interactive session — bare `run` picks from the sandbox |
|
|
716
|
+
| `schedules` | list schedules, when they next fire, and how the last run went |
|
|
717
|
+
| `sessions` | list stored sessions, or inspect one |
|
|
718
|
+
| `memory` | search what the agent remembers, or rebuild the index from the files |
|
|
656
719
|
| `config` | read and change an agent's settings, and fill in its secrets |
|
|
657
|
-
| `
|
|
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 |
|
|
660
|
-
| `sessions` | list stored conversations, or inspect one |
|
|
661
|
-
| `memory` | search what an agent remembers, or rebuild the index |
|
|
662
|
-
| `skills` | browse the catalogues and install, or check one agent's skills |
|
|
663
|
-
| `sources` | the repositories skills come from: list, add, search |
|
|
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 |
|
|
667
|
-
| `validate` | load a manifest and report what it resolved to |
|
|
720
|
+
| `validate` | load and validate a manifest, then exit |
|
|
668
721
|
| `workspace` | check the workspace files against the authoring rules |
|
|
669
|
-
| `soul` | scaffold a compact identity
|
|
670
|
-
| `
|
|
671
|
-
| `
|
|
672
|
-
| `
|
|
673
|
-
| `
|
|
722
|
+
| `soul` | scaffold a hand-edited compact identity from a long-form document |
|
|
723
|
+
| `skills` | browse the catalogue and install — or list, scaffold, check one agent's skills |
|
|
724
|
+
| `sources` | the repositories skills come from: list, add, search |
|
|
725
|
+
| `channels` | what an agent is reachable on: connect, disconnect, set a credential, unpair |
|
|
726
|
+
| `plugins` | install a plugin, list what an agent loaded, or remove one |
|
|
727
|
+
| `agents` | the agents in the sandbox, and whether anything is serving them |
|
|
728
|
+
| `restart` | reload one agent on the running host, or restart the whole service |
|
|
729
|
+
| `status` | the service, the hosts, every agent and its channels — one screen |
|
|
730
|
+
| `logs` | the server's stderr tail — the same as `daemon logs` |
|
|
731
|
+
| `tools` | show the resolved tool catalogue, or fetch a remote provider's schemas into the cache |
|
|
732
|
+
| `serve` | run the HTTP API and connect the agents' channels |
|
|
733
|
+
| `credential` | mint, list and revoke operator credentials, optionally scoped |
|
|
734
|
+
| `keys` | press a chord and see the bytes, Ink's reading of them, and the intent |
|
|
735
|
+
| `terminal-setup` | teach this terminal to send shift+enter as a new line |
|
|
736
|
+
| `remove` | delete a sandbox agent: its directory, sessions, memory, logs and service |
|
|
737
|
+
| `stop` | stop one agent for good, or everything — named, it stays stopped across restarts |
|
|
738
|
+
| `start` | switch an agent back on, and have a running host adopt it now |
|
|
739
|
+
| `model` | ask the endpoint what it can actually do — window, output cap, prompt caching |
|
|
740
|
+
| `web` | open the browser view of a running agent |
|
|
741
|
+
| `daemon` | keep an agent serving in the background — starts at login, restarts on crash |
|
|
742
|
+
<!-- commands:end -->
|
|
674
743
|
|
|
675
744
|
## Documentation
|
|
676
745
|
|
|
@@ -687,10 +756,19 @@ authority; read this as a map. `dispach <command> --help` has the flags.
|
|
|
687
756
|
| `docs/07-SPEC-WORKSPACE.md` | Workspace file tiers, budgets, and prompt-style rendering |
|
|
688
757
|
| `docs/08-MEMORY.md` | How memory is stored, retrieved and injected, with the measured numbers |
|
|
689
758
|
| `docs/12-OPENCLAW-CUTOVER.md` | Moving off the runtime this one replaces |
|
|
690
|
-
|
|
|
759
|
+
| `RELEASING.md` | How a release is cut: the changelog, `bun run release`, and what the tag publishes |
|
|
760
|
+
| `CHANGELOG.md` | What changed in each release, in bullets |
|
|
691
761
|
| `CLAUDE.md` | The standing brief: hard rules and the hazards already paid for |
|
|
692
762
|
| `evals/` | Every performance claim, with the number and a script to reproduce it |
|
|
693
763
|
|
|
694
764
|
## License
|
|
695
765
|
|
|
696
|
-
|
|
766
|
+
The runtime — every package this README describes, and everything published to npm, Homebrew and
|
|
767
|
+
the container registry — is **Apache-2.0**, and stays Apache-2.0. Copyright 2026 Moeen Mahmud.
|
|
768
|
+
|
|
769
|
+
**One directory is licensed differently: `packages/control`**, the control plane that places and
|
|
770
|
+
suspends one runtime per user, is **FSL-1.1-ALv2** (its own `LICENSE.md`). Anyone may use it,
|
|
771
|
+
commercially too, except to offer a competing hosted service, and each release becomes Apache-2.0
|
|
772
|
+
two years after it ships. It is never published with the runtime. It imports nothing from the
|
|
773
|
+
runtime and nothing in the runtime imports it — `bun run check:deps` enforces both directions, and
|
|
774
|
+
`verify:package` checks the npm tarball.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{B,he,S,C,h,s,T,a,D,k,m}from"./index-cz6yjxyz.js";import{ce}from"./index-cb2q8nae.js";import{g}from"./index-92gfcbw0.js";var w=g(S(),1);var f={NONE:"not compressed\tPCM\tApple Computer",sowt:"PCM (byte swapped)",fl32:"32-bit floating point IEEE 32-bit float",fl64:"64-bit floating point IEEE 64-bit float\tApple Computer",alaw:"ALaw 2:1\t8-bit ITU-T G.711 A-law",ulaw:"µLaw 2:1\t8-bit ITU-T G.711 µ-law\tApple Computer",ULAW:"CCITT G.711 u-law 8-bit ITU-T G.711 µ-law",ALAW:"CCITT G.711 A-law 8-bit ITU-T G.711 A-law",FL32:"Float 32\tIEEE 32-bit float "};class r extends D("AIFF"){}class l{constructor(t,e){this.isAifc=e;let i=e?22:18;if(t.chunkSize<i)throw new r(`COMMON CHUNK size should always be at least ${i}`);this.len=t.chunkSize}get(t,e){let i=h.get(t,e+8)-16398,n=h.get(t,e+8+2),o={numChannels:h.get(t,e),numSampleFrames:s.get(t,e+2),sampleSize:h.get(t,e+6),sampleRate:i<0?n>>Math.abs(i):n<<i};if(this.isAifc){if(o.compressionType=m.get(t,e+18),this.len>22){let c=C.get(t,e+22);if(c>0){let F=(c+1)%2;if(23+c+F===this.len)o.compressionName=new a(c,"latin1").get(t,e+23);else throw new r("Illegal pstring length")}else o.compressionName=void 0}}else o.compressionName="PCM";return o}}var p={len:8,get:(t,e)=>({chunkID:m.get(t,e),chunkSize:Number(BigInt(s.get(t,e+4)))})};var u=w.default("music-metadata:parser:aiff");class A extends k{constructor(){super(...arguments);this.isCompressed=null}async parse(){if((await this.tokenizer.readToken(p)).chunkID!=="FORM")throw new r("Invalid Chunk-ID, expected 'FORM'");let e=await this.tokenizer.readToken(m);switch(e){case"AIFF":this.metadata.setFormat("container",e),this.isCompressed=!1;break;case"AIFC":this.metadata.setFormat("container","AIFF-C"),this.isCompressed=!0;break;default:throw new r(`Unsupported AIFF type: ${e}`)}this.metadata.setFormat("lossless",!this.isCompressed),this.metadata.setAudioOnly();try{while(!this.tokenizer.fileInfo.size||this.tokenizer.fileInfo.size-this.tokenizer.position>=p.len){u(`Reading AIFF chunk at offset=${this.tokenizer.position}`);let i=await this.tokenizer.readToken(p),n=2*Math.round(i.chunkSize/2),o=await this.readData(i);await this.tokenizer.ignore(n-o)}}catch(i){if(i instanceof B)u("End-of-stream");else throw i}}async readData(t){switch(t.chunkID){case"COMM":{if(this.isCompressed===null)throw new r("Failed to parse AIFF.COMM chunk when compression type is unknown");let e=await this.tokenizer.readToken(new l(t,this.isCompressed));if(this.metadata.setFormat("bitsPerSample",e.sampleSize),this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("numberOfChannels",e.numChannels),this.metadata.setFormat("numberOfSamples",e.numSampleFrames),this.metadata.setFormat("duration",e.numSampleFrames/e.sampleRate),e.compressionName||e.compressionType)this.metadata.setFormat("codec",e.compressionName??f[e.compressionType]);return t.chunkSize}case"ID3 ":{let e=await this.tokenizer.readToken(new T(t.chunkSize)),i=he(e);return await new ce().parse(this.metadata,i,this.options),t.chunkSize}case"SSND":if(this.metadata.format.duration)this.metadata.setFormat("bitrate",8*t.chunkSize/this.metadata.format.duration);return 0;case"NAME":case"AUTH":case"(c) ":case"ANNO":return this.readTextChunk(t);default:return u(`Ignore chunk id=${t.chunkID}, size=${t.chunkSize}`),0}}async readTextChunk(t){let i=(await this.tokenizer.readToken(new a(t.chunkSize,"ascii"))).split("\x00").map((n)=>n.trim()).filter((n)=>n?.length);return await Promise.all(i.map((n)=>this.metadata.addTag("AIFF",t.chunkID,n))),t.chunkSize}}export{A as AIFFParser};
|
|
3
|
+
|
|
4
|
+
//# debugId=98EB5A1DFD5686DD64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=AiffParser-zw4g2bdd.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../node_modules/.bun/music-metadata@11.15.0/node_modules/music-metadata/lib/aiff/AiffParser.js", "../../../node_modules/.bun/music-metadata@11.15.0/node_modules/music-metadata/lib/aiff/AiffToken.js", "../../../node_modules/.bun/music-metadata@11.15.0/node_modules/music-metadata/lib/iff/index.js"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import * as Token from 'token-types';\nimport initDebug from 'debug';\nimport * as strtok3 from 'strtok3';\nimport { ID3v2Parser } from '../id3v2/ID3v2Parser.js';\nimport { FourCcToken } from '../common/FourCC.js';\nimport { BasicParser } from '../common/BasicParser.js';\nimport * as AiffToken from './AiffToken.js';\nimport { AiffContentError, compressionTypes } from './AiffToken.js';\nimport * as iff from '../iff/index.js';\nconst debug = initDebug('music-metadata:parser:aiff');\n/**\n * AIFF - Audio Interchange File Format\n *\n * Ref:\n * - http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/AIFF/AIFF.html\n * - http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/AIFF/Docs/AIFF-1.3.pdf\n */\nexport class AIFFParser extends BasicParser {\n constructor() {\n super(...arguments);\n this.isCompressed = null;\n }\n async parse() {\n const header = await this.tokenizer.readToken(iff.Header);\n if (header.chunkID !== 'FORM')\n throw new AiffContentError('Invalid Chunk-ID, expected \\'FORM\\''); // Not AIFF format\n const type = await this.tokenizer.readToken(FourCcToken);\n switch (type) {\n case 'AIFF':\n this.metadata.setFormat('container', type);\n this.isCompressed = false;\n break;\n case 'AIFC':\n this.metadata.setFormat('container', 'AIFF-C');\n this.isCompressed = true;\n break;\n default:\n throw new AiffContentError(`Unsupported AIFF type: ${type}`);\n }\n this.metadata.setFormat('lossless', !this.isCompressed);\n this.metadata.setAudioOnly();\n try {\n while (!this.tokenizer.fileInfo.size || this.tokenizer.fileInfo.size - this.tokenizer.position >= iff.Header.len) {\n debug(`Reading AIFF chunk at offset=${this.tokenizer.position}`);\n const chunkHeader = await this.tokenizer.readToken(iff.Header);\n const nextChunk = 2 * Math.round(chunkHeader.chunkSize / 2);\n const bytesRead = await this.readData(chunkHeader);\n await this.tokenizer.ignore(nextChunk - bytesRead);\n }\n }\n catch (err) {\n if (err instanceof strtok3.EndOfStreamError) {\n debug(\"End-of-stream\");\n }\n else {\n throw err;\n }\n }\n }\n async readData(header) {\n switch (header.chunkID) {\n case 'COMM': { // The Common Chunk\n if (this.isCompressed === null) {\n throw new AiffContentError('Failed to parse AIFF.COMM chunk when compression type is unknown');\n }\n const common = await this.tokenizer.readToken(new AiffToken.Common(header, this.isCompressed));\n this.metadata.setFormat('bitsPerSample', common.sampleSize);\n this.metadata.setFormat('sampleRate', common.sampleRate);\n this.metadata.setFormat('numberOfChannels', common.numChannels);\n this.metadata.setFormat('numberOfSamples', common.numSampleFrames);\n this.metadata.setFormat('duration', common.numSampleFrames / common.sampleRate);\n if (common.compressionName || common.compressionType) {\n this.metadata.setFormat('codec', common.compressionName ?? compressionTypes[common.compressionType]);\n }\n return header.chunkSize;\n }\n case 'ID3 ': { // ID3-meta-data\n const id3_data = await this.tokenizer.readToken(new Token.Uint8ArrayType(header.chunkSize));\n const rst = strtok3.fromBuffer(id3_data);\n await new ID3v2Parser().parse(this.metadata, rst, this.options);\n return header.chunkSize;\n }\n case 'SSND': // Sound Data Chunk\n if (this.metadata.format.duration) {\n this.metadata.setFormat('bitrate', 8 * header.chunkSize / this.metadata.format.duration);\n }\n return 0;\n case 'NAME': // Sample name chunk\n case 'AUTH': // Author chunk\n case '(c) ': // Copyright chunk\n case 'ANNO': // Annotation chunk\n return this.readTextChunk(header);\n default:\n debug(`Ignore chunk id=${header.chunkID}, size=${header.chunkSize}`);\n return 0;\n }\n }\n async readTextChunk(header) {\n const value = await this.tokenizer.readToken(new Token.StringType(header.chunkSize, 'ascii'));\n const values = value.split('\\0').map(v => v.trim()).filter(v => v?.length);\n await Promise.all(values.map(v => this.metadata.addTag('AIFF', header.chunkID, v)));\n return header.chunkSize;\n }\n}\n",
|
|
6
|
+
"import * as Token from 'token-types';\nimport { FourCcToken } from '../common/FourCC.js';\nimport { makeUnexpectedFileContentError } from '../ParseError.js';\nexport const compressionTypes = {\n NONE: 'not compressed\tPCM\tApple Computer',\n sowt: 'PCM (byte swapped)',\n fl32: '32-bit floating point IEEE 32-bit float',\n fl64: '64-bit floating point IEEE 64-bit float\tApple Computer',\n alaw: 'ALaw 2:1\t8-bit ITU-T G.711 A-law',\n ulaw: 'µLaw 2:1\t8-bit ITU-T G.711 µ-law\tApple Computer',\n ULAW: 'CCITT G.711 u-law 8-bit ITU-T G.711 µ-law',\n ALAW: 'CCITT G.711 A-law 8-bit ITU-T G.711 A-law',\n FL32: 'Float 32\tIEEE 32-bit float '\n};\nexport class AiffContentError extends makeUnexpectedFileContentError('AIFF') {\n}\nexport class Common {\n constructor(header, isAifc) {\n this.isAifc = isAifc;\n const minimumChunkSize = isAifc ? 22 : 18;\n if (header.chunkSize < minimumChunkSize)\n throw new AiffContentError(`COMMON CHUNK size should always be at least ${minimumChunkSize}`);\n this.len = header.chunkSize;\n }\n get(buf, off) {\n // see: https://cycling74.com/forums/aiffs-80-bit-sample-rate-value\n const shift = Token.UINT16_BE.get(buf, off + 8) - 16398;\n const baseSampleRate = Token.UINT16_BE.get(buf, off + 8 + 2);\n const res = {\n numChannels: Token.UINT16_BE.get(buf, off),\n numSampleFrames: Token.UINT32_BE.get(buf, off + 2),\n sampleSize: Token.UINT16_BE.get(buf, off + 6),\n sampleRate: shift < 0 ? baseSampleRate >> Math.abs(shift) : baseSampleRate << shift\n };\n if (this.isAifc) {\n res.compressionType = FourCcToken.get(buf, off + 18);\n if (this.len > 22) {\n const strLen = Token.UINT8.get(buf, off + 22);\n if (strLen > 0) {\n const padding = (strLen + 1) % 2;\n if (23 + strLen + padding === this.len) {\n res.compressionName = new Token.StringType(strLen, 'latin1').get(buf, off + 23);\n }\n else {\n throw new AiffContentError('Illegal pstring length');\n }\n }\n else {\n res.compressionName = undefined;\n }\n }\n }\n else {\n res.compressionName = 'PCM';\n }\n return res;\n }\n}\n",
|
|
7
|
+
"import * as Token from 'token-types';\nimport { FourCcToken } from '../common/FourCC.js';\n/**\n * Common AIFF chunk header\n */\nexport const Header = {\n len: 8,\n get: (buf, off) => {\n return {\n // Chunk type ID\n chunkID: FourCcToken.get(buf, off),\n // Chunk size\n chunkSize: Number(BigInt(Token.UINT32_BE.get(buf, off + 4)))\n };\n }\n};\n"
|
|
8
|
+
],
|
|
9
|
+
"mappings": ";+HACA,eCEO,IAAM,EAAmB,CAC5B,KAAM,sCACN,KAAM,qBACN,KAAM,0CACN,KAAM,0DACN,KAAM,oCACN,KAAM,oDACN,KAAM,4CACN,KAAM,4CACN,KAAM,8BACV,EACO,MAAM,UAAyB,EAA+B,MAAM,CAAE,CAC7E,CACO,MAAM,CAAO,CAChB,WAAW,CAAC,EAAQ,EAAQ,CACxB,KAAK,OAAS,EACd,IAAM,EAAmB,EAAS,GAAK,GACvC,GAAI,EAAO,UAAY,EACnB,MAAM,IAAI,EAAiB,+CAA+C,GAAkB,EAChG,KAAK,IAAM,EAAO,UAEtB,GAAG,CAAC,EAAK,EAAK,CAEV,IAAM,EAAc,EAAU,IAAI,EAAK,EAAM,CAAC,EAAI,MAC5C,EAAuB,EAAU,IAAI,EAAK,EAAM,EAAI,CAAC,EACrD,EAAM,CACR,YAAmB,EAAU,IAAI,EAAK,CAAG,EACzC,gBAAuB,EAAU,IAAI,EAAK,EAAM,CAAC,EACjD,WAAkB,EAAU,IAAI,EAAK,EAAM,CAAC,EAC5C,WAAY,EAAQ,EAAI,GAAkB,KAAK,IAAI,CAAK,EAAI,GAAkB,CAClF,EACA,GAAI,KAAK,QAEL,GADA,EAAI,gBAAkB,EAAY,IAAI,EAAK,EAAM,EAAE,EAC/C,KAAK,IAAM,GAAI,CACf,IAAM,EAAe,EAAM,IAAI,EAAK,EAAM,EAAE,EAC5C,GAAI,EAAS,EAAG,CACZ,IAAM,GAAW,EAAS,GAAK,EAC/B,GAAI,GAAK,EAAS,IAAY,KAAK,IAC/B,EAAI,gBAAkB,IAAU,EAAW,EAAQ,QAAQ,EAAE,IAAI,EAAK,EAAM,EAAE,EAG9E,WAAM,IAAI,EAAiB,wBAAwB,EAIvD,OAAI,gBAAkB,QAK9B,OAAI,gBAAkB,MAE1B,OAAO,EAEf,CCpDO,IAAM,EAAS,CAClB,IAAK,EACL,IAAK,CAAC,EAAK,KACA,CAEH,QAAS,EAAY,IAAI,EAAK,CAAG,EAEjC,UAAW,OAAO,OAAa,EAAU,IAAI,EAAK,EAAM,CAAC,CAAC,CAAC,CAC/D,EAER,EFNA,IAAM,EAAQ,UAAU,4BAA4B,EAQ7C,MAAM,UAAmB,CAAY,CACxC,WAAW,EAAG,CACV,MAAM,GAAG,SAAS,EAClB,KAAK,aAAe,UAElB,MAAK,EAAG,CAEV,IADe,MAAM,KAAK,UAAU,UAAc,CAAM,GAC7C,UAAY,OACnB,MAAM,IAAI,EAAiB,mCAAqC,EACpE,IAAM,EAAO,MAAM,KAAK,UAAU,UAAU,CAAW,EACvD,OAAQ,OACC,OACD,KAAK,SAAS,UAAU,YAAa,CAAI,EACzC,KAAK,aAAe,GACpB,UACC,OACD,KAAK,SAAS,UAAU,YAAa,QAAQ,EAC7C,KAAK,aAAe,GACpB,cAEA,MAAM,IAAI,EAAiB,0BAA0B,GAAM,EAEnE,KAAK,SAAS,UAAU,WAAY,CAAC,KAAK,YAAY,EACtD,KAAK,SAAS,aAAa,EAC3B,GAAI,CACA,MAAO,CAAC,KAAK,UAAU,SAAS,MAAQ,KAAK,UAAU,SAAS,KAAO,KAAK,UAAU,UAAgB,EAAO,IAAK,CAC9G,EAAM,gCAAgC,KAAK,UAAU,UAAU,EAC/D,IAAM,EAAc,MAAM,KAAK,UAAU,UAAc,CAAM,EACvD,EAAY,EAAI,KAAK,MAAM,EAAY,UAAY,CAAC,EACpD,EAAY,MAAM,KAAK,SAAS,CAAW,EACjD,MAAM,KAAK,UAAU,OAAO,EAAY,CAAS,GAGzD,MAAO,EAAK,CACR,GAAI,aAAuB,EACvB,EAAM,eAAe,EAGrB,WAAM,QAIZ,SAAQ,CAAC,EAAQ,CACnB,OAAQ,EAAO,aACN,OAAQ,CACT,GAAI,KAAK,eAAiB,KACtB,MAAM,IAAI,EAAiB,kEAAkE,EAEjG,IAAM,EAAS,MAAM,KAAK,UAAU,UAAU,IAAc,EAAO,EAAQ,KAAK,YAAY,CAAC,EAM7F,GALA,KAAK,SAAS,UAAU,gBAAiB,EAAO,UAAU,EAC1D,KAAK,SAAS,UAAU,aAAc,EAAO,UAAU,EACvD,KAAK,SAAS,UAAU,mBAAoB,EAAO,WAAW,EAC9D,KAAK,SAAS,UAAU,kBAAmB,EAAO,eAAe,EACjE,KAAK,SAAS,UAAU,WAAY,EAAO,gBAAkB,EAAO,UAAU,EAC1E,EAAO,iBAAmB,EAAO,gBACjC,KAAK,SAAS,UAAU,QAAS,EAAO,iBAAmB,EAAiB,EAAO,gBAAgB,EAEvG,OAAO,EAAO,SAClB,KACK,OAAQ,CACT,IAAM,EAAW,MAAM,KAAK,UAAU,UAAU,IAAU,EAAe,EAAO,SAAS,CAAC,EACpF,EAAc,GAAW,CAAQ,EAEvC,OADA,MAAM,IAAI,GAAY,EAAE,MAAM,KAAK,SAAU,EAAK,KAAK,OAAO,EACvD,EAAO,SAClB,KACK,OACD,GAAI,KAAK,SAAS,OAAO,SACrB,KAAK,SAAS,UAAU,UAAW,EAAI,EAAO,UAAY,KAAK,SAAS,OAAO,QAAQ,EAE3F,MAAO,OACN,WACA,WACA,WACA,OACD,OAAO,KAAK,cAAc,CAAM,UAGhC,OADA,EAAM,mBAAmB,EAAO,iBAAiB,EAAO,WAAW,EAC5D,QAGb,cAAa,CAAC,EAAQ,CAExB,IAAM,GADQ,MAAM,KAAK,UAAU,UAAU,IAAU,EAAW,EAAO,UAAW,OAAO,CAAC,GACvE,MAAM,MAAI,EAAE,IAAI,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,GAAG,MAAM,EAEzE,OADA,MAAM,QAAQ,IAAI,EAAO,IAAI,KAAK,KAAK,SAAS,OAAO,OAAQ,EAAO,QAAS,CAAC,CAAC,CAAC,EAC3E,EAAO,UAEtB",
|
|
10
|
+
"debugId": "98EB5A1DFD5686DD64756E2164756E21",
|
|
11
|
+
"names": []
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{A,H}from"./index-a0h0p20f.js";import{i,Xr,$r,y,ve}from"./index-qx3xdk4x.js";import{Wt,XA,zt}from"./index-ytvwyp6k.js";import{He}from"./index-w0s77wfx.js";import{xn}from"./index-yvnwpxbb.js";import{en,An}from"./index-gmn80dwc.js";import{Yi,Ji,sn,an,Ot,tt,Io,qi,zo,gn,Vi,Zo,Zi,Xi}from"./index-c8ge88a9.js";import{Te}from"./index-87wcawta.js";import"./index-s9va2kmc.js";import{rt}from"./index-6dvnfk8y.js";import{zA,Vt}from"./index-ryb159ff.js";import{se,St,At,De,xi,tn,Dt}from"./index-6s471ydn.js";import"./index-e508e0vt.js";import"./index-10009hp8.js";import{nA}from"./index-d9c97ver.js";import{vo,Se}from"./index-59z88wrb.js";import"./index-qwntpbwe.js";import{U,te}from"./index-featyhps.js";import{Ce,Wn,zn,$n,as,ls,Es,Cs,us,Ko,xt,Bs}from"./index-d0c5abkw.js";import{Box as O,Text as K,useApp as Ut,useInput as Zn}from"ink";import{useCallback as qn,useEffect as et,useMemo as nt,useRef as Yt,useState as _}from"react";import{Box as Ae,Text as re}from"ink";import{jsx as me,jsxs as ie}from"react/jsx-runtime";function dn({lines:e,label:n,offset:t,maxRows:o,code:s}){if(e===void 0)return me(Ae,{marginLeft:2,children:me(He,{label:`running ${n}`})});if(e.length===0)return me(Ae,{marginLeft:2,children:ie(re,{color:i.muted,children:[n," printed nothing"]})});let{from:r,to:d}=te(e.length,Math.min(t+Math.floor(o/2),e.length-1),o),c=e.slice(r,d).map((u,g)=>({row:r+g,text:u}));return ie(Ae,{flexDirection:"column",children:[s!==void 0&&s!==0?ie(re,{color:i.error,wrap:"truncate",children:[y.error,n," exited ",s]}):null,r>0?ie(re,{dimColor:!0,wrap:"truncate",children:[" ",y.ellipsis," ",r," line",r===1?"":"s"," above"]}):null,c.map((u)=>me(re,{wrap:"truncate",children:u.text},u.row)),d<e.length?ie(re,{dimColor:!0,wrap:"truncate",children:[" ",y.ellipsis," ",e.length-d," line",e.length-d===1?"":"s"," ","below"]}):null]})}import{Box as pt,Text as W}from"ink";import{jsx as ae,jsxs as fe}from"react/jsx-runtime";function ln({editor:e,width:n,maxRows:t}){let o=e.search;if(o===void 0)return null;let s=St(e),r=Math.min(o.index,Math.max(0,s.length-1)),{from:d,to:c}=te(s.length,r,t),u=Math.max(8,n-4);return fe(pt,{flexDirection:"column",children:[s.length===0?fe(W,{color:i.muted,wrap:"truncate",children:[" ","nothing you have sent matches that"]}):s.slice(d,c).map((g,M)=>{let p=d+M===r;return fe(W,{wrap:"truncate",children:[ae(W,{color:i.accent,children:p?y.pointer:" "}),ae(W,{bold:p,dimColor:!p,children:U(g.replace(/\s+/g," "),u)})]},g)}),fe(W,{wrap:"truncate",children:[ae(W,{color:i.muted,children:" search: "}),o.query,ae(W,{inverse:!0,children:" "}),s.length>1?ae(W,{color:i.muted,children:` ${r+1} of ${s.length}`}):null]})]})}import{Box as ht,Text as cn}from"ink";import{jsxs as _e}from"react/jsx-runtime";function un({live:e,showReasoning:n,columns:t}){let o=n&&e.reasoning!==""&&e.text==="",s=o?e.reasoning:e.text;if(s==="")return null;let r=o?"· reasoning · ":"",d=xn(s,t-[...r].length,Wn),c=d.lines.map((u,g)=>({at:g,text:u}));return _e(ht,{flexDirection:"column",children:[d.hidden>0?_e(cn,{dimColor:!0,wrap:"truncate",children:["… ",d.hidden," earlier row(s) hidden while streaming"]}):null,c.map((u)=>_e(cn,{dimColor:o,wrap:"truncate",children:[u.at===0?r:"",u.text]},`row-${u.at}`))]})}import{Box as gt,Text as G}from"ink";import{jsx as Le,jsxs as ee}from"react/jsx-runtime";function wt(e){return e.matches.reduce((n,t)=>Math.max(n,t.word.length),0)}function mn({palette:e,index:n,width:t,maxRows:o}){if(e.matches.length===0)return ee(G,{color:i.muted,wrap:"truncate",children:[" ","no command starts with /",e.query]});let s=Math.min(n,e.matches.length-1),{from:r,to:d}=te(e.matches.length,s,o),c=wt(e),u=Math.max(8,t-(2+c+2));return ee(gt,{flexDirection:"column",children:[r>0?ee(G,{dimColor:!0,wrap:"truncate",children:[" ",y.ellipsis," ",r," above"]}):null,e.matches.slice(r,d).map((g,M)=>{let R=r+M===s;return ee(G,{wrap:"truncate",children:[Le(G,{color:i.accent,children:R?y.pointer:" "}),Le(G,{bold:R,...R?{color:i.accent}:{},children:g.word.padEnd(c)})," ",Le(G,{dimColor:!0,children:U(g.summary,u)})]},g.word)}),d<e.matches.length?ee(G,{dimColor:!0,wrap:"truncate",children:[" ",y.ellipsis," ",e.matches.length-d," below"]}):null,ee(G,{dimColor:!0,wrap:"truncate",children:[" ","↑↓ move · tab complete · enter run · esc close"]})]})}import{Box as fn,Text as bt}from"ink";import{jsx as pn,jsxs as hn}from"react/jsx-runtime";function wn({editor:e,busy:n,placeholder:t,columns:o}){let s=e.value.split(`
|
|
3
|
+
`).length,r=Math.max(1,o-4);return hn(fn,{flexDirection:"column",children:[pn(fn,{borderStyle:ve,borderColor:n?i.border:i.borderActive,width:o,paddingX:1,children:pn(An,{editor:e,gutter:zn,maxRows:$n,columns:r,...t===void 0?{}:{placeholder:t}})}),s>1?hn(bt,{dimColor:!0,wrap:"truncate",children:[" ",Yi]}):null]})}import{Text as pe}from"ink";import{jsx as Tn,jsxs as yn}from"react/jsx-runtime";var yt={idle:"ready",thinking:"thinking",streaming:"replying",working:"running a tool",cancelling:"cancelling"};function Tt(e){return`${(e/1000).toFixed(1)}s`}function bn(e,n){if(e!=="idle")return" · ^C cancels";return n?" · ^C again to leave":" · ^C twice to leave · /exit"}function kt(e){if(e!=="idle")return"";return" · ^O show reasoning"}var Rt=0.5,Mt=0.8;function Sn({status:e,model:n,sessionKey:t,elapsedMs:o,last:s,quiet:r,armed:d,pressure:c,phase:u}){return yn(pe,{dimColor:!0,wrap:"truncate",children:[yn(pe,{color:Xr[e],children:[y.dot,yt[e]]}),e==="idle"?"":` ${Tt(o)}`,` · ${n} · ${t}`,u===void 0||r?"":` · ${u}`,c===void 0||c<Rt||r?"":Tn(pe,{...c>=Mt?{color:i.warning}:{},children:` · ctx ${Math.round(c*100)}%`}),s===void 0||r?"":` · last ${Zo(s)}`,kt(e),d===!0?Tn(pe,{color:i.warning,children:bn(e,!0)}):bn(e,!1)]})}import{Box as Pt,Text as he}from"ink";var X={offset:0,pinned:!0};function kn(e,n){return Math.max(0,e-n)}function Rn(e,n,t){let o=kn(n,t);return e.pinned?o:Math.max(0,Math.min(e.offset,o))}function Mn(e,n,t,o){if(n==="bottom")return X;let s=kn(t,o);if(s===0)return X;if(n==="top")return{offset:0,pinned:!1};let r=n==="pageUp"||n==="pageDown"?Math.max(1,o-1):1,d=n==="down"||n==="pageDown"?r:-r,c=Rn(e,t,o)+d;if(c>=s)return X;return{offset:Math.max(0,c),pinned:!1}}function En(e,n,t){if(t<=0)return{from:0,to:0,above:n,below:0};let o=Rn(e,n,t),s=Math.min(n,o+t);return{from:o,to:s,above:o,below:n-s}}function Pn(e,n){return Math.max(ls,e-n-1)}function vn(e){let n=[];if(e.above>0)n.push(`↑ ${e.above} row${e.above===1?"":"s"} above`);if(e.below>0)n.push(`↓ ${e.below} row${e.below===1?"":"s"} below`,"esc returns");return n.length===0?"":` ${n.join(" · ")}`}function Cn(e){return{anchor:e,focus:e,dragging:!0}}function $e(e,n){if(!e.dragging)return e;return{...e,focus:n}}function _n(e){return{...e,dragging:!1}}function Ln(e,n){return{...e,focus:n,dragging:!1}}function Et(e,n){return e.row<n.row||e.row===n.row&&e.column<=n.column}function Bn(e){if(e===void 0)return;let{anchor:n,focus:t}=e;if(n.row===t.row&&n.column===t.column)return;return Et(n,t)?{start:n,end:t}:{start:t,end:n}}function Ie(e,n,t){let o=Bn(e);if(o===void 0)return;if(n<o.start.row||n>o.end.row)return;let s=n===o.start.row?Math.min(o.start.column,t):0,r=n===o.end.row?Math.min(o.end.column,t):t;return r<=s?void 0:{from:s,to:r}}function In(e,n){let t=Bn(n);if(t===void 0)return"";let o=[];for(let s=t.start.row;s<=t.end.row;s+=1){let r=e[s];if(r===void 0)continue;let d=[...r.text],c=Ie(n,s,d.length),u=c===void 0?"":d.slice(Math.max(c.from,r.lead),c.to).join("");if(r.continuation&&o.length>0){o[o.length-1]+=u;continue}o.push(u)}return o.map((s)=>s.replace(/\s+$/,"")).join(`
|
|
4
|
+
`)}function Be(e){return e!==void 0&&!/\s/.test(e)}function On(e,n){let t=e[n.row];if(t===void 0)return{anchor:n,focus:n,dragging:!1};let o=[...t.text];if(!Be(o[n.column]))return Oe(e,n);let{column:s,column:r}=n;while(s>t.lead&&Be(o[s-1]))s-=1;while(r<o.length&&Be(o[r]))r+=1;return{anchor:{row:n.row,column:s},focus:{row:n.row,column:r},dragging:!1}}function Oe(e,n){let t=e[n.row],o=t===void 0?0:[...t.text].length;return{anchor:{row:n.row,column:t?.lead??0},focus:{row:n.row,column:o},dragging:!1}}import{jsx as Ne,jsxs as Dn}from"react/jsx-runtime";function Hn({rows:e,slice:n,selection:t}){let o=e.slice(n.from,n.to),s=vn(n);return Dn(Pt,{flexDirection:"column",children:[Ne(he,{color:i.muted,wrap:"truncate",children:s===""?" ":s}),o.map((r,d)=>{let c=r.dim===!0?i.muted:$r[r.role],u=[...r.text],g=Ie(t,n.from+d,u.length);if(g===void 0)return Ne(he,{wrap:"truncate",bold:r.bold===!0,...c===void 0?{}:{color:c},children:r.text===""?" ":r.text},r.key);let M=Math.max(g.from,r.lead);return Dn(he,{wrap:"truncate",bold:r.bold===!0,...c===void 0?{}:{color:c},children:[u.slice(0,M).join(""),Ne(he,{backgroundColor:i.selection,children:u.slice(M,g.to).join("")}),u.slice(g.to).join("")]},r.key)})]})}import{useEffect as vt,useState as Ct}from"react";var _t=100;function Nn(e){let[n,t]=Ct(0);return vt(()=>{if(!e){t(0);return}let o=Date.now();t(0);let s=setInterval(()=>t(Date.now()-o),_t);return()=>clearInterval(s)},[e]),n}import{useCallback as xe,useEffect as Lt,useReducer as Bt,useRef as Gn}from"react";function Fn(e){let{source:n,sessionKey:t,initial:o}=e,[s,r]=Bt(Vi,o),d=Gn(void 0),c=Gn(n.streamFilter());Lt(()=>n.subscribe((p)=>{if(p.sessionKey!==void 0&&p.sessionKey!==t)return;if(p.type==="model.chunk"){let{delta:L,kind:B}=p.data;if(B==="reasoning"){r({kind:"delta",of:"reasoning",text:L});return}r({kind:"delta",of:"text",text:c.current.push(L)});return}if(p.type==="model.result"){r({kind:"delta",of:"text",text:c.current.endStep()});return}if(p.type==="turn.end")r({kind:"delta",of:"text",text:c.current.end()}),c.current=n.streamFilter();r({kind:"event",event:p})}),[n,t]);let u=xe((p)=>{r({kind:"user",text:p});let L=new AbortController;d.current=L,n.send(p,{sessionKey:t,signal:L.signal}).catch((B)=>{r({kind:"event",event:{v:1,ts:new Date().toISOString(),runtimeId:"cli",sessionKey:t,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(d.current===L)d.current=void 0})},[n,t]),g=xe(()=>{let p=d.current;if(p===void 0||p.signal.aborted)return;r({kind:"cancelling"}),p.abort()},[]),M=xe((p)=>r({kind:"note",text:p}),[]),R=xe(()=>r({kind:"trim"}),[]);return{state:s,busy:s.status!=="idle",send:u,cancel:g,note:M,trim:R}}var We=1,Ge=1,Ye=1,Yn=2,Fe=4,Ue=2,Un=14;function Ve(e,n){let{rows:t,caretRow:o}=en(e,Math.max(1,n-Fe-Ue)),s=t.length,{from:r,to:d}=te(s,o,Math.max(1,Math.min(s,$n)));return Yn+(d-r)+(r>0?1:0)+(s-d>0?1:0)+(e.value.includes(`
|
|
5
|
+
`)?1:0)}var $t=2;function It(e,n){if(e===void 0)return 0;if(e.matches.length===0)return 1;let t=Math.min(e.matches.length,n),o=e.matches.length>t?1:0;return t+o+1}function Vn(e,n){if(e.search===void 0)return 0;let t=St(e);return(t.length===0?1:Math.min(t.length,n))+1}function Xn(e){let n=e.live,t=n===void 0?"":e.showReasoning&&n.reasoning!==""&&n.text===""?n.reasoning:n.text,o=We+Ge+xn(t,e.columns-Un,Wn).rows+Vn(e.editor,e.searchMaxRows)+Ve(e.editor,e.columns)+(e.confirming?1:0)+(e.hint?1:0),s=Math.max(1,Math.min(e.paletteMaxRows,e.rows-o-$t-1)),r=We+Ge+xn(t,e.columns-Un,Wn).rows+It(e.palette,s)+Vn(e.editor,e.searchMaxRows)+Ve(e.editor,e.columns)+(e.confirming?1:0)+(e.hint?1:0),d=Pn(e.rows,r),c=e.landing?Math.max(0,d-Cs-Ko):0;return{paletteRows:s,brand:c,body:d,transcript:Math.max(1,d-Ye),pane:Math.max(1,d-3)}}function Kn(e,n){let t=(n.brandLines===0?0:n.brandLines+Ko)+We+Ye,o=e.row-t;if(o<0)return;let s=n.from+o;if(s>=n.to)return;return{row:s,column:e.column}}function jn(e,n){let t=en(n.editor,Math.max(1,n.columns-Fe-Ue)),o=t.rows.length,{from:s,to:r}=te(o,t.caretRow,Math.max(1,Math.min(o,$n))),d=s>0?1:0,c=Ve(n.editor,n.columns),g=n.rows-Ge-(n.hint?1:0)-c+Yn/2+d,M=e.row-g;if(M<0||M>=r-s)return;let R=t.rows[s+M];if(R===void 0)return;let p=e.column-Fe/2-Ue;if(p<0)return R.start;return Math.min(R.end,R.start+Math.max(0,p-R.lead))}function Jn(e,n){let t=n===0?0:n+Ko;return Math.max(1,e.body-t-Ye)}var Ht=[{command:"pbcopy",args:[]},{command:"wl-copy",args:[]},{command:"xclip",args:["-selection","clipboard"]},{command:"xsel",args:["--clipboard","--input"]}];async function Xe(e){if(e==="")return{copied:!1,problem:"nothing selected"};let n=[];for(let t of Ht){let o=await nA({command:t.command,args:t.args,input:e,timeoutMs:2000});if(o.notFound){n.push(t.command);continue}if(o.code===0)return{copied:!0,using:t.command};return{copied:!1,using:t.command,problem:o.stderr.trim()||`${t.command} exited ${o.code}`}}return{copied:!1,problem:`no clipboard command found (tried ${n.join(", ")})`}}function Nt(e){return rt(e)?.args.findIndex((n)=>n.name==="manifest")??-1}function Gt(e){let n=e.rest.trim()===""?[]:e.rest.trim().split(/\s+/),t=Nt(e.name),o=t===-1||n.length<t?n:[...n.slice(0,t),e.manifestPath,...n.slice(t)];return[e.name,...o,"--plain"]}function Ft(e){let n=rt(e.name);if(n===void 0)return;let t=n.flags.find((r)=>r.name==="follow");if(t===void 0)return;if(!e.rest.trim().split(/\s+/).some((r)=>r==="--follow"||t.short!==void 0&&r===`-${t.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: ${e.name} ${e.rest.trim()}`}async function Qn(e){let n=Ft(e);if(n!==void 0)return{lines:[n],code:1};let t=e.interpreter??process.execPath,o=e.script??(e.interpreter!==void 0?"":process.argv[1]??""),s=await nA({command:t,args:[o,...Gt(e)],...e.env===void 0?{}:{env:e.env},timeoutMs:e.timeoutMs??30000}),r=[s.stdout,s.stderr].filter((c)=>c.trim()!=="").join(`
|
|
6
|
+
`),d=r===""?[]:r.replace(/\n+$/,"").split(`
|
|
7
|
+
`);if(s.notFound)return{lines:[`could not run ${t}`],code:1};if(s.signalled)return{lines:[...d,`${e.name} was stopped before it finished`],code:1};return{lines:d,code:s.code}}import{jsx as x,jsxs as j,Fragment as Xt}from"react/jsx-runtime";function Dr({source:e,sessionKey:n,model:t,agentName:o,warnings:s,freshSession:r,initial:d,correctKeys:c,showReasoning:u,quiet:g,onRestart:M,onSwitch:R,onNew:p,sessions:L,initialDraft:B,manifestPath:D,catalogue:ne,status:Ke,contextView:je}){let{exit:z}=Ut(),J=Te(),S=Se(J.columns,Ce),{state:E,busy:de,send:ot,cancel:it,note:h,trim:ze}=Fn({source:e,sessionKey:n,initial:d}),[C,I]=_(()=>B===void 0||B===""?se:{...se,value:B,cursor:[...B].length}),[T,v]=_({kind:"none"}),[Je,st]=_(void 0),[Qe,at]=_(void 0),[Ze,dt]=_(void 0),[le,ge]=_(X),[oe,we]=_(!1),[be,qe]=_(!1),[nn,lt]=_(!1),[Q,F]=_(void 0),ye=Yt(void 0),N=T.kind==="none"?qi(C.value):void 0,[ke,ce]=_(0),ct=Nn(de),ut=nt(()=>Zi(E.items),[E.items]),Z=nt(()=>Xi(E.items,{showReasoning:u,quiet:g,columns:S,expandReasoning:nn}),[E.items,u,g,S,nn]),q=r===!0&&!E.items.some((f)=>f.role==="user"),Re=q?Es:as,V=Xn({rows:J.rows,columns:S,editor:C,live:E.live,showReasoning:u,palette:N,paletteMaxRows:Re,searchMaxRows:Re,confirming:be,landing:q,hint:q}),ue=V.brand>0?zt(A.name,{columns:S-XA,rows:V.brand}):void 0,Me=En(le,Z.length,Jn(V,ue?.lines.length??0));et(()=>{if(!le.pinned)return;F(void 0),ze()},[le.pinned,E.items.length,ze]),et(()=>{if(!oe)return;let f=setTimeout(()=>we(!1),Bs);return()=>clearTimeout(f)},[oe]);let on=(f,w)=>{let m=sn(f,gn());if(m!==void 0)switch(m.kind){case"exit":qe(!0);return;case"restart":{let a=e.reload;if(a===void 0){M?.(w),z();return}h("asking the host to reload this agent…"),a().then((l)=>h(`reloaded ${l.join(", ")} — this conversation continues`)).catch((l)=>h(`could not reload: ${l instanceof Error?l.message:String(l)}`));return}case"new":p?.(w),z();return;case"help":h(an());return;case"tools":e.tools().then((a)=>h(tt(a))).catch((a)=>h(`could not read the tools: ${a instanceof Error?a.message:String(a)}`));return;case"context":if(je===void 0){h("context is unavailable in this session");return}je().then(h).catch((a)=>h(`could not read the context: ${a instanceof Error?a.message:String(a)}`));return;case"status":if(Ke===void 0){h("status is unavailable in this session");return}Ke().then(h).catch((a)=>h(`could not read the status: ${a instanceof Error?a.message:String(a)}`));return;case"reset":e.clearSession(n).then(()=>h("session cleared — memory files on disk are untouched")).catch((a)=>h(`could not clear the session: ${a instanceof Error?a.message:String(a)}`));return;case"command":if(rn(`/${m.name}`,m.rest))return;h(Ot({word:`/${m.name}`}));return;case"unknown":h(Ot(m));return}if(de){h("a turn is still running — ^C cancels it, then send again");return}ot(f)},Ee=qn((f,w)=>{v({kind:"output",label:`/${f}`,lines:void 0,offset:0}),Qn({name:f,rest:w,manifestPath:D??""}).then((m)=>v({kind:"output",label:`/${f}`,lines:m.lines,code:m.code,offset:0})).catch((m)=>v({kind:"output",label:`/${f}`,lines:[m instanceof Error?m.message:String(m)],code:1,offset:0}))},[D]),rn=qn((f,w)=>{let m=Io().find((a)=>a.word===f);if(m===void 0)return!1;if(m.kind==="view"){if(m.word==="/sessions"&&L!==void 0&&R!==void 0)return v({kind:"sessions",stored:void 0}),import("./SessionPicker-03zyvd2f.js").then((a)=>dt(()=>a.SessionPicker)),L().then((a)=>v({kind:"sessions",stored:a})).catch((a)=>{v({kind:"none"}),h(`could not read the stored conversations: ${a instanceof Error?a.message:String(a)}`)}),!0;if(m.word==="/config"&&(w.trim()===""||w.trim()==="edit")){if(D===void 0)return h("this session has no manifest path, so there is nothing to edit"),!0;return v({kind:"config",rows:zA(D)}),import("./ConfigEditor-aamadrx3.js").then((a)=>at(()=>a.ConfigEditor)),!0}if(m.word==="/skills"&&ne!==void 0)return v({kind:"skills"}),import("./SkillBrowser-8s8rjv98.js").then((a)=>st(()=>a.SkillBrowser)),!0;return Ee(m.word.slice(1),w),!0}if(m.kind==="output")return Ee(m.word.slice(1),w),!0;return!1},[Ee,ne,L,R,h,D]);if(Zn((f,w)=>{if(T.kind!=="output")return;if(w.escape||f==="q"){v({kind:"none"});return}let m=T.lines?.length??0,a=w.pageDown||w.pageUp?V.pane:1,l=w.downArrow||w.pageDown?a:w.upArrow||w.pageUp?-a:0;if(l!==0)v({...T,offset:Math.max(0,Math.min(T.offset+l,Math.max(0,m-1)))})},{isActive:T.kind==="output"}),Zn((f,w)=>{let m=c===void 0?w:c(w,f);if(be){if(qe(!1),f.toLowerCase()==="y"||m.return)z();return}if(N!==void 0){if(m.escape){I((k)=>De(k,{kind:"killToStart"})),ce(0);return}if(m.upArrow||m.downArrow){ce((k)=>Math.max(0,Math.min(k+(m.downArrow?1:-1),N.matches.length-1)));return}if(m.tab){let k=zo(N,ke);if(k!==void 0)I((P)=>De({...P,value:"",cursor:0},{kind:"insert",text:k.word}));return}let l=zo(N,ke);if(m.return&&l!==void 0){let k=l;if(ce(0),I((P)=>({...P,value:"",cursor:0})),k.kind==="session")on(k.word,"");else rn(k.word,"");return}}let a=Dt(f,m,tn(C,de,{armed:oe,scrolled:!le.pinned}));if(oe&&a.kind!=="exit")we(!1);if(a.kind==="arm"){we(!0);return}if(a.kind==="scroll"){let l=Math.max(1,a.times??1);ge((k)=>{let P=k;for(let b=0;b<l;b+=1)P=Mn(P,a.move,Z.length,V.transcript);return P});return}if(a.kind==="pointer"){let l=Kn({column:a.column,row:a.row},{brandLines:ue?.lines.length??0,from:Me.from,to:Me.to});if(l===void 0){let b=jn({column:a.column,row:a.row},{editor:C,columns:S,rows:J.rows,hint:q});if(b===void 0){if(a.gesture==="press")F(void 0),I((Y)=>({...Y,anchor:void 0}));return}F(void 0),I((Y)=>a.gesture==="press"&&!a.shift?{...Y,cursor:b,anchor:b}:{...Y,cursor:b,anchor:Y.anchor??Y.cursor});return}if(a.gesture==="press"){if(a.shift&&Q!==void 0){F(Ln(Q,l)),ye.current=void 0;return}let b=ye.current,Pe=b!==void 0&&Date.now()-b.when<=us&&b.at.row===l.row&&b.at.column===l.column?b.clicks%3+1:1;ye.current={at:l,when:Date.now(),clicks:Pe},I((ft)=>({...ft,anchor:void 0})),F(Pe===3?Oe(Z,l):Pe===2?On(Z,l):Cn(l));return}if(a.gesture==="drag"){F((b)=>b===void 0?void 0:$e(b,l));return}let k=Q===void 0?void 0:_n($e(Q,l));F(k);let P=In(Z,k);if(P!=="")Xe(P).then((b)=>{if(!b.copied&&b.problem!=="nothing selected")h(`could not copy: ${b.problem??"unknown"}`)});return}if(a.kind==="copySelection"||a.kind==="cutSelection"){let l=At(C);if(l===void 0){h("nothing selected — hold shift with a motion, or drag in the box");return}let k=[...C.value].slice(l.start,l.end).join("");if(a.kind==="cutSelection")I((P)=>De(P,a));Xe(k).then((P)=>{if(!P.copied)h(`could not copy: ${P.problem??"unknown"}`)});return}if(a.kind==="reasoning"){if(!u){h("reasoning is off: either this model does not stream it, or --no-reasoning is set");return}if(!E.items.some((l)=>l.role==="reasoning")){h("no reasoning to show yet — this expands it once a turn has streamed some");return}lt((l)=>!l),ge(X);return}if(a.kind==="exit"){z();return}if(a.kind==="cancel"){it();return}if(a.kind==="submit"){let l=xi(C);if(I(l.state),ge(X),l.text!=="")on(l.text,l.state.value);return}if(a.kind==="paste"){I((l)=>De(l,{kind:"insert",text:a.lines.join(`
|
|
8
|
+
`)}));return}if(N!==void 0)ce(0);I((l)=>De(l,a))},{isActive:T.kind==="none"}),T.kind==="config")return j(O,{flexDirection:"column",width:S,height:J.rows,children:[x(K,{color:i.accent,bold:!0,wrap:"truncate",children:vo({title:`${A.name} ${H}`,summary:"settings"},S)}),Qe===void 0?x(O,{marginLeft:2,children:x(He,{label:"reading the settings"})}):x(Qe,{rows:T.rows,apply:(f,w)=>Vt(D??"",f,w),reload:()=>zA(D??""),columns:S,window:xt,onDone:(f)=>{if(v({kind:"none"}),f)M?.(C.value),z()}}),x(O,{flexGrow:1})]});if(T.kind==="sessions")return j(O,{flexDirection:"column",width:S,height:J.rows,children:[x(K,{color:i.accent,bold:!0,wrap:"truncate",children:vo({title:`${A.name} ${H}`,summary:"pick a conversation"},S)}),x(O,{flexGrow:1}),T.stored===void 0||Ze===void 0?x(O,{marginLeft:2,children:x(He,{label:"reading the stored conversations"})}):x(Ze,{sessions:T.stored,now:Date.now(),columns:S,maxRows:xt,current:n,onDone:(f)=>{if(f===void 0||f===n){v({kind:"none"});return}R?.(f,C.value),z()}}),x(O,{flexGrow:1})]});if(T.kind==="skills"&&ne!==void 0&&Je!==void 0)return x(Je,{title:`${A.name} ${H}`,agents:[],target:D??"",load:ne.load,install:ne.install,onDone:()=>v({kind:"none"})});let mt=vo({title:`${A.name} ${H}`,summary:"",agent:{name:o,model:t},...s===void 0||s.length===0?{}:{warnings:s}},S);return j(O,{flexDirection:"column",width:S,height:J.rows,children:[ue===void 0?null:j(Xt,{children:[x(Wt,{lines:ue.lines}),x(K,{children:" "})]}),x(K,{color:i.accent,bold:!0,wrap:"truncate",children:mt}),T.kind==="output"?j(O,{flexDirection:"column",children:[x(dn,{lines:T.lines,label:T.label,offset:T.offset,maxRows:V.pane,...T.code===void 0?{}:{code:T.code}}),j(K,{dimColor:!0,wrap:"truncate",children:[" ","↑↓ scroll · esc back to the prompt"]})]}):x(Hn,{rows:Z,slice:Me,...Q===void 0?{}:{selection:Q}}),x(O,{flexGrow:1}),E.live===void 0?null:x(un,{live:E.live,showReasoning:u,columns:S}),N===void 0?null:x(mn,{palette:N,index:ke,width:S,maxRows:V.paletteRows}),x(ln,{editor:C,width:S,maxRows:Re}),be?x(K,{color:i.warning,wrap:"truncate",children:" leave this session? press y to confirm · any other key stays"}):null,x(wn,{editor:C,busy:de,columns:S,...q?{placeholder:"Ask anything…"}:{}}),q?j(K,{dimColor:!0,wrap:"truncate",children:[" ",Ji]}):null,x(Sn,{status:E.status,model:t,sessionKey:n,elapsedMs:ct,last:ut,quiet:g,armed:oe,...E.pressure===void 0?{}:{pressure:E.pressure},...E.phase===void 0?{}:{phase:E.phase}})]})}export{Dr as App};
|
|
9
|
+
|
|
10
|
+
//# debugId=6C7BBB73E621BE2564756E2164756E21
|
|
11
|
+
//# sourceMappingURL=App-ez7ve0yp.js.map
|