@joeyshi12/casper 0.15.7 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +39 -104
  2. package/dist/mcp.js +1 -1
  3. package/dist/server.js +1807 -774
  4. package/dist/web/assets/{abnfDiagram-N423BO3Z-jvSYyvNw.js → abnfDiagram-N423BO3Z-Bo2zpD_r.js} +1 -1
  5. package/dist/web/assets/{arc-BiHYHdUQ.js → arc-eMfj-v5r.js} +1 -1
  6. package/dist/web/assets/{architectureDiagram-T3A2C74G-4Eqc-u3C.js → architectureDiagram-T3A2C74G-SMny_PQB.js} +1 -1
  7. package/dist/web/assets/{blockDiagram-VBNYF7ZC-BcOcmlBN.js → blockDiagram-VBNYF7ZC-DSEqDPwv.js} +1 -1
  8. package/dist/web/assets/{c4Diagram-5PPSVZJV-BUudyYqU.js → c4Diagram-5PPSVZJV-CpqtaVod.js} +1 -1
  9. package/dist/web/assets/channel-BsxsiUCc.js +1 -0
  10. package/dist/web/assets/{chunk-2GRJ4B5K-bTMhoJSQ.js → chunk-2GRJ4B5K-AuFfmAbN.js} +1 -1
  11. package/dist/web/assets/{chunk-2Q5K7J3B-BYp6dfdp.js → chunk-2Q5K7J3B-iOn5T_gD.js} +1 -1
  12. package/dist/web/assets/{chunk-5RXB4S5H-Dg3ASlI5.js → chunk-5RXB4S5H-4T8n_Vjj.js} +1 -1
  13. package/dist/web/assets/{chunk-5VM5RSS4-B7uwpCHf.js → chunk-5VM5RSS4-BXZGGB8b.js} +1 -1
  14. package/dist/web/assets/{chunk-6Q2QTUOP-DVTiWdGW.js → chunk-6Q2QTUOP-CaHKdpZm.js} +1 -1
  15. package/dist/web/assets/{chunk-GF5L2VYU-C2LdpbyU.js → chunk-GF5L2VYU-JzGg4vgu.js} +1 -1
  16. package/dist/web/assets/{chunk-JWPE2WC7-CMX4-S8P.js → chunk-JWPE2WC7-CsXwzKxD.js} +1 -1
  17. package/dist/web/assets/{chunk-KBJHAD2P-D92STFuF.js → chunk-KBJHAD2P-4iRbBEYU.js} +1 -1
  18. package/dist/web/assets/{chunk-RYQCIY6F-B2PLxj_Q.js → chunk-RYQCIY6F-D-VbfyMB.js} +1 -1
  19. package/dist/web/assets/{chunk-XXDRQBXY-DCpI_0Ix.js → chunk-XXDRQBXY-CeFbm4g1.js} +1 -1
  20. package/dist/web/assets/classDiagram-JCYQIIEL-CRUWBeef.js +1 -0
  21. package/dist/web/assets/classDiagram-v2-OCEON4UE-CRUWBeef.js +1 -0
  22. package/dist/web/assets/{cose-bilkent-JH36ORCC-KtY-8vxF.js → cose-bilkent-JH36ORCC-CYNfxa8A.js} +1 -1
  23. package/dist/web/assets/{cynefin-VYW2F7L2-DkTsGV_4.js → cynefin-VYW2F7L2-rvO1KlAd.js} +1 -1
  24. package/dist/web/assets/{cynefinDiagram-MW4NZA55-BVPMHgGu.js → cynefinDiagram-MW4NZA55-DvzcG3NL.js} +1 -1
  25. package/dist/web/assets/{dagre-VZM6K2ZE-DT-S1NOU.js → dagre-VZM6K2ZE-BgutGA8k.js} +1 -1
  26. package/dist/web/assets/{diagram-7IWD3JNH-DUJvV7wV.js → diagram-7IWD3JNH-BoLPEgBs.js} +1 -1
  27. package/dist/web/assets/{diagram-B4RE2ZJO-DmpnY7ob.js → diagram-B4RE2ZJO-BaaHgQLy.js} +1 -1
  28. package/dist/web/assets/{diagram-LBJQPF4R-nEMZNwen.js → diagram-LBJQPF4R-Bc7jkgiW.js} +1 -1
  29. package/dist/web/assets/{diagram-Q27KOJAE-Dr-59ElI.js → diagram-Q27KOJAE-p311g83v.js} +1 -1
  30. package/dist/web/assets/{diagram-UB23O5K3-4wvmRauY.js → diagram-UB23O5K3-ALwvcWzK.js} +1 -1
  31. package/dist/web/assets/{ebnfDiagram-BXEA7PRR-055xAlHi.js → ebnfDiagram-BXEA7PRR-DveTtKRe.js} +1 -1
  32. package/dist/web/assets/{erDiagram-JOGREHBK-DqWTDG8u.js → erDiagram-JOGREHBK-D3kM5uf0.js} +1 -1
  33. package/dist/web/assets/{flowDiagram-UKHOOZJN-D3lUh0yb.js → flowDiagram-UKHOOZJN-h_YgCdts.js} +1 -1
  34. package/dist/web/assets/{ganttDiagram-PKOTCBZU-aV5l2zrT.js → ganttDiagram-PKOTCBZU-DpMVjZz3.js} +1 -1
  35. package/dist/web/assets/{gitGraphDiagram-DS77QQ5N-BK2KCI35.js → gitGraphDiagram-DS77QQ5N-OJ0-BsVV.js} +1 -1
  36. package/dist/web/assets/index-BYjBvJ2T.css +1 -0
  37. package/dist/web/assets/index-C0MiltSe.js +245 -0
  38. package/dist/web/assets/{index-Dv1My9Ob.js → index-DHJZ0QFt.js} +1 -1
  39. package/dist/web/assets/{infoDiagram-6WML65LV-BcSXYnWm.js → infoDiagram-6WML65LV-C3dDMfD2.js} +1 -1
  40. package/dist/web/assets/{ishikawaDiagram-WSZJBQD7-C0LFAfcz.js → ishikawaDiagram-WSZJBQD7-QSccwWZc.js} +1 -1
  41. package/dist/web/assets/{journeyDiagram-NVQOT4AX-1Zs22Gpd.js → journeyDiagram-NVQOT4AX-BBse3ziF.js} +1 -1
  42. package/dist/web/assets/{kanban-definition-27J2QSJJ-DW6RwD7S.js → kanban-definition-27J2QSJJ-DrbZwvww.js} +1 -1
  43. package/dist/web/assets/{linear-Cfzhrbed.js → linear-DSPm6cs7.js} +1 -1
  44. package/dist/web/assets/{mermaid.core-D0VPssrU.js → mermaid.core-DXBmt4hx.js} +4 -4
  45. package/dist/web/assets/{mindmap-definition-FAOFIHXS-BeD5KiWO.js → mindmap-definition-FAOFIHXS-DnF7VGZ2.js} +1 -1
  46. package/dist/web/assets/{pegDiagram-VL7TDLO6-JDLyI4Gc.js → pegDiagram-VL7TDLO6-DU79M4ax.js} +1 -1
  47. package/dist/web/assets/{pieDiagram-7S7Q4E2Y-BY3XpjEU.js → pieDiagram-7S7Q4E2Y-D_kGXiwY.js} +1 -1
  48. package/dist/web/assets/{quadrantDiagram-CIZ2JOQS-C4oT4Lqc.js → quadrantDiagram-CIZ2JOQS-Sy59mKJK.js} +1 -1
  49. package/dist/web/assets/{railroadDiagram-AXF67PYL-lfzvVyK7.js → railroadDiagram-AXF67PYL-i-7HN_g3.js} +1 -1
  50. package/dist/web/assets/{requirementDiagram-LRYGKXZP-wGnOD5SS.js → requirementDiagram-LRYGKXZP-MbXlWZ5N.js} +1 -1
  51. package/dist/web/assets/{sankeyDiagram-W5VNT64P-DJQ2VW0G.js → sankeyDiagram-W5VNT64P-BhU2pRtd.js} +1 -1
  52. package/dist/web/assets/{sequenceDiagram-SI44F4Z6-Bz_rjvWZ.js → sequenceDiagram-SI44F4Z6-ju70uzxa.js} +1 -1
  53. package/dist/web/assets/{sizeCapture-X5ZJPWSS-BgxIA36S.js → sizeCapture-X5ZJPWSS-Oy3UrbXL.js} +1 -1
  54. package/dist/web/assets/{stateDiagram-OKZ733FA-DpL_B9Mu.js → stateDiagram-OKZ733FA-DzSL7BOW.js} +1 -1
  55. package/dist/web/assets/stateDiagram-v2-UEYNNEHI-TGjHDp18.js +1 -0
  56. package/dist/web/assets/{swimlanes-SLNWSIFB-B6uTv46X.js → swimlanes-SLNWSIFB-a_3Pai9c.js} +2 -2
  57. package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-Dq3BU0bp.js +8 -0
  58. package/dist/web/assets/{timeline-definition-Z64GVDOM-DvMUcNNs.js → timeline-definition-Z64GVDOM-CdYiXKKc.js} +1 -1
  59. package/dist/web/assets/{vennDiagram-T6HMQDX7-K_9U-J2A.js → vennDiagram-T6HMQDX7-CNquHYyi.js} +1 -1
  60. package/dist/web/assets/{wardleyDiagram-T6FBY63Y-DwMi4kCd.js → wardleyDiagram-T6FBY63Y-D-dCSbF5.js} +1 -1
  61. package/dist/web/assets/{xychartDiagram-ELKLHX3M-BkcnShpk.js → xychartDiagram-ELKLHX3M-BZCQNI1R.js} +1 -1
  62. package/dist/web/index.html +2 -2
  63. package/dist/web/sw.js +1 -1
  64. package/package.json +1 -1
  65. package/dist/web/assets/channel-BueZNEdT.js +0 -1
  66. package/dist/web/assets/classDiagram-JCYQIIEL-CSEqsvyn.js +0 -1
  67. package/dist/web/assets/classDiagram-v2-OCEON4UE-CSEqsvyn.js +0 -1
  68. package/dist/web/assets/index-B5ZDbS-R.js +0 -244
  69. package/dist/web/assets/index-CRxbcY2R.css +0 -1
  70. package/dist/web/assets/stateDiagram-v2-UEYNNEHI-DsD9j9Fu.js +0 -1
  71. package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-BxNKQaPC.js +0 -8
package/README.md CHANGED
@@ -19,133 +19,72 @@ exactly what it missed.
19
19
 
20
20
  ## Features
21
21
 
22
- - **Sessions** you can create, search, rename and delete. Live ones run in a
23
- bounded process pool; idle ones go dormant and resume on demand.
24
- - **Per-session model and agent**, from the live model list and kiro's agents.
25
- - **Rich rendering** of Markdown, Mermaid, syntax-highlighted code, and MCP tool
26
- calls with their status, input and output.
27
- - **File browser** for the session's workspace, previewing text, images and PDFs.
28
- HTML renders as a live page, sandboxed, and either can go fullscreen.
29
- - **Subagents** listed under the call that started them, each opening to its own
30
- transcript, read back from kiro's session files so they survive a reload.
31
- - **Widgets**: the agent calls a `show_widget` tool over MCP and the result renders
32
- inline as a live page. Charts, simulations, animated diagrams. Sandboxed, and they
33
- can send a message back.
34
- - **Context-window usage** shown live, with one tap to compact.
35
- - **PWA** that installs to a home screen and reconnects when the network returns.
22
+ - **Chats** you can search, rename, pin, group by date, edit and branch. Idle ones go
23
+ dormant and resume on demand.
24
+ - **Model, effort and agent** per chat, with titles from kiro and live context usage
25
+ and credits.
26
+ - **Rich rendering** of Markdown, Mermaid, code and tool calls, a file browser for the
27
+ workspace, subagent transcripts, and inline widgets from a `show_widget` MCP tool.
28
+ - **Settings** for kiro's defaults, MCP servers and skills, and your logged-in devices.
29
+ - **PWA** that installs to a home screen.
36
30
 
37
31
  ## Install
38
32
 
39
- Needs Node 24+, since Casper keeps its state in SQLite via the built-in
40
- `node:sqlite`. It also needs [`kiro-cli`](https://kiro.dev) installed and logged in.
41
- Casper is a client for it, so nothing works without it.
42
-
43
- **kiro-cli 2.x, tested against 2.11 to 2.19. Not yet compatible with 3.0.**
33
+ Needs Node 24+ and [`kiro-cli`](https://kiro.dev) 3.x, installed and logged in.
44
34
 
45
35
  ```bash
46
36
  npm install -g @joeyshi12/casper
47
- casper
48
- ```
49
-
50
- The first run generates an access token, prints it in a bordered block, and drops
51
- the `casper` agent into `~/.kiro/agents`. Open the printed URL and paste the token.
52
-
53
- To survive reboots, install the systemd user service:
54
-
55
- ```bash
56
- casper service install
37
+ casper # prints an access token and the URL to open
38
+ casper service install # optional: a systemd user service that survives reboots
57
39
  ```
58
40
 
59
- systemd is optional. Without it, run `casper` from your own init system, under
60
- `nohup`, or in tmux.
61
-
62
41
  | Command | |
63
42
  |---|---|
64
- | `casper` | Run the server in the foreground |
65
43
  | `casper token` | Print the access token |
66
44
  | `casper reset-token [value]` | Set a new token and sign every device out |
67
45
  | `casper doctor` | Check kiro-cli, settings, data directory, web app and MCP server |
68
46
  | `casper mcp` | Run the widget MCP server on stdio (kiro spawns this for you) |
69
- | `casper service install` | Run as a systemd user service |
70
- | `casper service uninstall` | Remove the service, keeping settings and sessions |
71
- | `casper service status` | Show the service status |
72
-
73
- The `casper` agent gets the widget tools automatically. To give them to another
74
- agent, point it at the same server:
75
-
76
- ```bash
77
- kiro-cli mcp add --name casper --agent <agent> --command casper --args mcp
78
- ```
47
+ | `casper service install \| uninstall \| status` | Manage the systemd user service |
79
48
 
80
- To update, `npm install -g @joeyshi12/casper@latest`. Re-run
81
- `casper service install` afterwards if you use the service: the unit records
82
- absolute node and package paths, and both move on upgrade. Your token and sessions
83
- survive.
49
+ The `casper` agent gets the widget tools. To give them to another agent:
50
+ `kiro-cli mcp add --name casper --agent <agent> --command casper --args mcp`.
84
51
 
85
- To remove it:
86
-
87
- ```bash
88
- casper service uninstall
89
- npm uninstall -g @joeyshi12/casper
90
- rm -rf ~/.casper ~/.config/casper # only if you want sessions and settings gone too
91
- ```
52
+ To update, install `@joeyshi12/casper@latest` and re-run `casper service install`,
53
+ since the unit records paths that move on upgrade. To remove it, run
54
+ `casper service uninstall`, `npm uninstall -g @joeyshi12/casper`, and delete
55
+ `~/.casper` and `~/.config/casper` if you want the data gone.
92
56
 
93
57
  ## Configuration
94
58
 
95
- Settings live in `~/.config/casper/config.json` (or `$XDG_CONFIG_HOME/casper/`),
96
- written `0600` because it holds the token:
97
-
98
- ```json
99
- {
100
- "port": 4319,
101
- "defaultCwd": "/home/you/projects",
102
- "fileRoot": "/home/you",
103
- "defaultAgent": "casper"
104
- }
105
- ```
106
-
107
- A missing or malformed file is ignored with a warning rather than failing startup,
108
- and unrecognised keys are reported so a typo doesn't pass silently.
109
-
110
- Every setting also works as an environment variable, and **the environment wins**,
111
- which is handy for containers and one-off runs. Two are environment-only:
112
- `CASPER_DATA_DIR`, because it says where data lives and so can't be read from
113
- inside it, and `CASPER_WEB_DIST`, which is install layout rather than a preference.
59
+ Settings live in `~/.config/casper/config.json` (written `0600`). Each also works as
60
+ an environment variable, and the environment wins.
114
61
 
115
62
  | Variable | Config key | Default | |
116
63
  |---|---|---|---|
117
64
  | `HOST` | `host` | `0.0.0.0` | Bind address |
118
65
  | `PORT` | `port` | `4319` | Server port |
119
- | `CASPER_TOKEN` | `token` | _(generated)_ | Entered once at login, exchanged for a per-device cookie |
120
- | `CASPER_SESSION_TTL_SECONDS` | `sessionTtlSeconds` | `604800` | Device-login lifetime, slid forward on activity |
121
- | `KIRO_BIN` | `kiroBin` | `kiro-cli` | Path to the kiro-cli binary |
122
- | `CASPER_KIRO_SESSIONS_DIR` | `kiroSessionsDir` | `~/.kiro/sessions/cli` | Where kiro-cli keeps its own session files, which Casper reads |
123
- | `DEFAULT_CWD` | `defaultCwd` | cwd | Working directory for new sessions |
124
- | `DEFAULT_AGENT` | `defaultAgent` | `casper` | Agent for new sessions, so widgets work out of the box. If it is missing, kiro falls back to `kiro_default` on its own |
125
- | `CASPER_FILE_ROOT` | `fileRoot` | `/` | Confines the file browser. Defaults to everything the server can read; narrow it to keep authenticated users out of system files |
126
- | `MAX_LIVE_SESSIONS` | `maxLiveSessions` | `6` | Concurrent live kiro processes |
127
- | `EVENT_BUFFER_SIZE` | `eventBufferSize` | `5000` | Events kept per session for replay on reconnect; a client older than the buffer refetches instead |
128
- | `CASPER_MAX_UPLOAD_BYTES` | `maxUploadBytes` | `104857600` | Largest single uploaded file |
129
- | `CASPER_DATA_DIR` | _(env only)_ | `~/.casper` | Where `casper.db` and uploaded files live |
66
+ | `CASPER_TOKEN` | `token` | _(generated)_ | Exchanged at login for a per-device cookie |
67
+ | `CASPER_SESSION_TTL_SECONDS` | `sessionTtlSeconds` | `604800` | Device-login lifetime, extended on activity |
68
+ | `KIRO_BIN` | `kiroBin` | `kiro-cli` | Path to kiro-cli |
69
+ | `CASPER_KIRO_SESSIONS_DIR` | `kiroSessionsDir` | `~/.kiro/sessions` | kiro's session files, which Casper reads |
70
+ | `DEFAULT_CWD` | `defaultCwd` | cwd | Working directory for new chats |
71
+ | `DEFAULT_AGENT` | `defaultAgent` | `casper` | Agent for new chats when kiro's `chat.defaultAgent` is unset |
72
+ | `CASPER_FILE_ROOT` | `fileRoot` | `/` | The only folder the file browser can read |
73
+ | `MAX_LIVE_SESSIONS` | `maxLiveSessions` | `6` | Concurrent kiro processes |
74
+ | `EVENT_BUFFER_SIZE` | `eventBufferSize` | `5000` | Events kept per chat for replay on reconnect |
75
+ | `CASPER_MAX_UPLOAD_BYTES` | `maxUploadBytes` | `104857600` | Largest uploaded file |
76
+ | `CASPER_DATA_DIR` | _(env only)_ | `~/.casper` | Where `casper.db` and uploads live |
130
77
  | `CASPER_WEB_DIST` | _(env only)_ | beside the bundle | Built web app to serve |
131
78
 
132
- Beyond your LAN, put a TLS-terminating reverse proxy in front of
133
- `http://127.0.0.1:4319`, forwarding WebSocket upgrades with a long read timeout for
134
- lengthy turns. PWA install and reliable reconnects need HTTPS.
79
+ Beyond your LAN, put a TLS reverse proxy in front that forwards WebSocket upgrades
80
+ with a long read timeout. The PWA needs HTTPS.
135
81
 
136
82
  ## Security
137
83
 
138
- Casper launches kiro with `--trust-all-tools` so unattended runs never block on
139
- approvals. The agent can run commands and write files without asking, so treat
140
- access to Casper as equivalent to a shell on the machine.
141
-
142
- `CASPER_FILE_ROOT` is the only limit on what the file endpoints will read, and it defaults
143
- to everything the server can read. Narrow it if that matters to you.
144
-
145
- The token is 24 random bytes, generated for you and exchanged at login for a
146
- per-device cookie; only its hash is stored. Comparison is constant-time, and
147
- `/api/login` allows ten failures per quarter hour per address before answering 429.
148
- The settings file and the database are both `0600`.
84
+ Casper allows every tool call kiro asks about, once, so treat access to Casper as a
85
+ shell on the machine. kiro's deny rules still apply, and no "always allow" rule is
86
+ saved. The token is stored only as a hash, and `/api/login` allows ten failures per
87
+ quarter hour per address.
149
88
 
150
89
  ## Develop
151
90
 
@@ -156,9 +95,5 @@ npm test
156
95
  npm run e2e # prompt, disconnect mid-turn, reconnect, replay
157
96
  ```
158
97
 
159
- `unset NODE_ENV` first if you have it set: a stray `production` breaks installs and
160
- builds here.
161
-
162
- The repo is an npm workspace: `shared/` for types, `web/` for the React app, and
163
- `server/`, which is the package published to npm. `npm run build` bundles the server
164
- with esbuild and copies the built web app in beside it.
98
+ `shared/` holds the types, `web/` the React app, and `server/` the published package.
99
+ See [AGENTS.md](AGENTS.md) for the rest.
package/dist/mcp.js CHANGED
@@ -369,7 +369,7 @@ function handleMessage(req, version) {
369
369
  }
370
370
 
371
371
  // server/src/mcp/server.ts
372
- var VERSION = true ? "0.15.7" : "dev";
372
+ var VERSION = true ? "0.17.0" : "dev";
373
373
  function runMcpServer() {
374
374
  const rl = createInterface({ input: process.stdin });
375
375
  rl.on("line", (line) => {