@joeyshi12/casper 0.16.0 → 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 -108
  2. package/dist/mcp.js +1 -1
  3. package/dist/server.js +1092 -156
  4. package/dist/web/assets/{abnfDiagram-N423BO3Z-DQdd062N.js → abnfDiagram-N423BO3Z-Bo2zpD_r.js} +1 -1
  5. package/dist/web/assets/{arc-WhOJ_KR1.js → arc-eMfj-v5r.js} +1 -1
  6. package/dist/web/assets/{architectureDiagram-T3A2C74G-3zZgBQZT.js → architectureDiagram-T3A2C74G-SMny_PQB.js} +1 -1
  7. package/dist/web/assets/{blockDiagram-VBNYF7ZC-CW9mWWLl.js → blockDiagram-VBNYF7ZC-DSEqDPwv.js} +1 -1
  8. package/dist/web/assets/{c4Diagram-5PPSVZJV-xXmfR_aG.js → c4Diagram-5PPSVZJV-CpqtaVod.js} +1 -1
  9. package/dist/web/assets/channel-BsxsiUCc.js +1 -0
  10. package/dist/web/assets/{chunk-2GRJ4B5K-CuCN8EG_.js → chunk-2GRJ4B5K-AuFfmAbN.js} +1 -1
  11. package/dist/web/assets/{chunk-2Q5K7J3B-BC-h61jv.js → chunk-2Q5K7J3B-iOn5T_gD.js} +1 -1
  12. package/dist/web/assets/{chunk-5RXB4S5H-BqZ4ICSN.js → chunk-5RXB4S5H-4T8n_Vjj.js} +1 -1
  13. package/dist/web/assets/{chunk-5VM5RSS4-_EcX9Eg6.js → chunk-5VM5RSS4-BXZGGB8b.js} +1 -1
  14. package/dist/web/assets/{chunk-6Q2QTUOP-Rjg4xt7f.js → chunk-6Q2QTUOP-CaHKdpZm.js} +1 -1
  15. package/dist/web/assets/{chunk-GF5L2VYU-CllNzjfD.js → chunk-GF5L2VYU-JzGg4vgu.js} +1 -1
  16. package/dist/web/assets/{chunk-JWPE2WC7-Cc24s09e.js → chunk-JWPE2WC7-CsXwzKxD.js} +1 -1
  17. package/dist/web/assets/{chunk-KBJHAD2P-DYClY3b3.js → chunk-KBJHAD2P-4iRbBEYU.js} +1 -1
  18. package/dist/web/assets/{chunk-RYQCIY6F-C5PSe7M_.js → chunk-RYQCIY6F-D-VbfyMB.js} +1 -1
  19. package/dist/web/assets/{chunk-XXDRQBXY-DK8-XmXo.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-Dxs4GA2q.js → cose-bilkent-JH36ORCC-CYNfxa8A.js} +1 -1
  23. package/dist/web/assets/{cynefin-VYW2F7L2-kzjViLcF.js → cynefin-VYW2F7L2-rvO1KlAd.js} +1 -1
  24. package/dist/web/assets/{cynefinDiagram-MW4NZA55-B9zBzt3B.js → cynefinDiagram-MW4NZA55-DvzcG3NL.js} +1 -1
  25. package/dist/web/assets/{dagre-VZM6K2ZE-BNwMkCZi.js → dagre-VZM6K2ZE-BgutGA8k.js} +1 -1
  26. package/dist/web/assets/{diagram-7IWD3JNH-DpIoQsS7.js → diagram-7IWD3JNH-BoLPEgBs.js} +1 -1
  27. package/dist/web/assets/{diagram-B4RE2ZJO-BKWdzhKi.js → diagram-B4RE2ZJO-BaaHgQLy.js} +1 -1
  28. package/dist/web/assets/{diagram-LBJQPF4R-DBbKFigX.js → diagram-LBJQPF4R-Bc7jkgiW.js} +1 -1
  29. package/dist/web/assets/{diagram-Q27KOJAE-B7qLPRw9.js → diagram-Q27KOJAE-p311g83v.js} +1 -1
  30. package/dist/web/assets/{diagram-UB23O5K3-DVncy6q5.js → diagram-UB23O5K3-ALwvcWzK.js} +1 -1
  31. package/dist/web/assets/{ebnfDiagram-BXEA7PRR-B9rA3ylb.js → ebnfDiagram-BXEA7PRR-DveTtKRe.js} +1 -1
  32. package/dist/web/assets/{erDiagram-JOGREHBK-BExDcOc7.js → erDiagram-JOGREHBK-D3kM5uf0.js} +1 -1
  33. package/dist/web/assets/{flowDiagram-UKHOOZJN-B1xPLh9u.js → flowDiagram-UKHOOZJN-h_YgCdts.js} +1 -1
  34. package/dist/web/assets/{ganttDiagram-PKOTCBZU-BYS5NkM6.js → ganttDiagram-PKOTCBZU-DpMVjZz3.js} +1 -1
  35. package/dist/web/assets/{gitGraphDiagram-DS77QQ5N-CN4An7lt.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-BuQTY976.js → index-DHJZ0QFt.js} +1 -1
  39. package/dist/web/assets/{infoDiagram-6WML65LV-sk97M0G1.js → infoDiagram-6WML65LV-C3dDMfD2.js} +1 -1
  40. package/dist/web/assets/{ishikawaDiagram-WSZJBQD7-BzW2rVh6.js → ishikawaDiagram-WSZJBQD7-QSccwWZc.js} +1 -1
  41. package/dist/web/assets/{journeyDiagram-NVQOT4AX-iaCo98OS.js → journeyDiagram-NVQOT4AX-BBse3ziF.js} +1 -1
  42. package/dist/web/assets/{kanban-definition-27J2QSJJ-Ce38xzYm.js → kanban-definition-27J2QSJJ-DrbZwvww.js} +1 -1
  43. package/dist/web/assets/{linear-BoUX9N6W.js → linear-DSPm6cs7.js} +1 -1
  44. package/dist/web/assets/{mermaid.core-CC54dZcH.js → mermaid.core-DXBmt4hx.js} +4 -4
  45. package/dist/web/assets/{mindmap-definition-FAOFIHXS-BxRXpNJ-.js → mindmap-definition-FAOFIHXS-DnF7VGZ2.js} +1 -1
  46. package/dist/web/assets/{pegDiagram-VL7TDLO6-Cg0-J9c8.js → pegDiagram-VL7TDLO6-DU79M4ax.js} +1 -1
  47. package/dist/web/assets/{pieDiagram-7S7Q4E2Y-DUjXAJq4.js → pieDiagram-7S7Q4E2Y-D_kGXiwY.js} +1 -1
  48. package/dist/web/assets/{quadrantDiagram-CIZ2JOQS-q1HsW0pP.js → quadrantDiagram-CIZ2JOQS-Sy59mKJK.js} +1 -1
  49. package/dist/web/assets/{railroadDiagram-AXF67PYL-ats1_veK.js → railroadDiagram-AXF67PYL-i-7HN_g3.js} +1 -1
  50. package/dist/web/assets/{requirementDiagram-LRYGKXZP-CV2_uFpI.js → requirementDiagram-LRYGKXZP-MbXlWZ5N.js} +1 -1
  51. package/dist/web/assets/{sankeyDiagram-W5VNT64P-BwyC8qNn.js → sankeyDiagram-W5VNT64P-BhU2pRtd.js} +1 -1
  52. package/dist/web/assets/{sequenceDiagram-SI44F4Z6-72yj0uCA.js → sequenceDiagram-SI44F4Z6-ju70uzxa.js} +1 -1
  53. package/dist/web/assets/{sizeCapture-X5ZJPWSS-CV7PeUrN.js → sizeCapture-X5ZJPWSS-Oy3UrbXL.js} +1 -1
  54. package/dist/web/assets/{stateDiagram-OKZ733FA-B08_WgjO.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-DnBKpTQH.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-BAoT5Fu8.js → timeline-definition-Z64GVDOM-CdYiXKKc.js} +1 -1
  59. package/dist/web/assets/{vennDiagram-T6HMQDX7-VLzfwvza.js → vennDiagram-T6HMQDX7-CNquHYyi.js} +1 -1
  60. package/dist/web/assets/{wardleyDiagram-T6FBY63Y-QaCRHB2e.js → wardleyDiagram-T6FBY63Y-D-dCSbF5.js} +1 -1
  61. package/dist/web/assets/{xychartDiagram-ELKLHX3M-DCUP6k1x.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-QybFlytR.js +0 -1
  66. package/dist/web/assets/classDiagram-JCYQIIEL-CcJ6l3H0.js +0 -1
  67. package/dist/web/assets/classDiagram-v2-OCEON4UE-CcJ6l3H0.js +0 -1
  68. package/dist/web/assets/index-BwBYAAwi.js +0 -244
  69. package/dist/web/assets/index-CRxbcY2R.css +0 -1
  70. package/dist/web/assets/stateDiagram-v2-UEYNNEHI-80B2GltS.js +0 -1
  71. package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-CeWA7IPZ.js +0 -8
package/README.md CHANGED
@@ -19,137 +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 3.x, tested against 3.1.** Casper runs kiro's V3 engine
44
- (`kiro-cli acp --agent-engine v3`) and reads only its session store, so chats from a
45
- Casper that ran kiro 2.x do not open.
33
+ Needs Node 24+ and [`kiro-cli`](https://kiro.dev) 3.x, installed and logged in.
46
34
 
47
35
  ```bash
48
36
  npm install -g @joeyshi12/casper
49
- casper
50
- ```
51
-
52
- The first run generates an access token, prints it in a bordered block, and drops
53
- the `casper` agent into `~/.kiro/agents`. Open the printed URL and paste the token.
54
-
55
- To survive reboots, install the systemd user service:
56
-
57
- ```bash
58
- 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
59
39
  ```
60
40
 
61
- systemd is optional. Without it, run `casper` from your own init system, under
62
- `nohup`, or in tmux.
63
-
64
41
  | Command | |
65
42
  |---|---|
66
- | `casper` | Run the server in the foreground |
67
43
  | `casper token` | Print the access token |
68
44
  | `casper reset-token [value]` | Set a new token and sign every device out |
69
45
  | `casper doctor` | Check kiro-cli, settings, data directory, web app and MCP server |
70
46
  | `casper mcp` | Run the widget MCP server on stdio (kiro spawns this for you) |
71
- | `casper service install` | Run as a systemd user service |
72
- | `casper service uninstall` | Remove the service, keeping settings and sessions |
73
- | `casper service status` | Show the service status |
74
-
75
- The `casper` agent gets the widget tools automatically. To give them to another
76
- agent, point it at the same server:
77
-
78
- ```bash
79
- kiro-cli mcp add --name casper --agent <agent> --command casper --args mcp
80
- ```
47
+ | `casper service install \| uninstall \| status` | Manage the systemd user service |
81
48
 
82
- To update, `npm install -g @joeyshi12/casper@latest`. Re-run
83
- `casper service install` afterwards if you use the service: the unit records
84
- absolute node and package paths, and both move on upgrade. Your token and sessions
85
- 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`.
86
51
 
87
- To remove it:
88
-
89
- ```bash
90
- casper service uninstall
91
- npm uninstall -g @joeyshi12/casper
92
- rm -rf ~/.casper ~/.config/casper # only if you want sessions and settings gone too
93
- ```
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.
94
56
 
95
57
  ## Configuration
96
58
 
97
- Settings live in `~/.config/casper/config.json` (or `$XDG_CONFIG_HOME/casper/`),
98
- written `0600` because it holds the token:
99
-
100
- ```json
101
- {
102
- "port": 4319,
103
- "defaultCwd": "/home/you/projects",
104
- "fileRoot": "/home/you",
105
- "defaultAgent": "casper"
106
- }
107
- ```
108
-
109
- A missing or malformed file is ignored with a warning rather than failing startup,
110
- and unrecognised keys are reported so a typo doesn't pass silently.
111
-
112
- Every setting also works as an environment variable, and **the environment wins**,
113
- which is handy for containers and one-off runs. Two are environment-only:
114
- `CASPER_DATA_DIR`, because it says where data lives and so can't be read from
115
- 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.
116
61
 
117
62
  | Variable | Config key | Default | |
118
63
  |---|---|---|---|
119
64
  | `HOST` | `host` | `0.0.0.0` | Bind address |
120
65
  | `PORT` | `port` | `4319` | Server port |
121
- | `CASPER_TOKEN` | `token` | _(generated)_ | Entered once at login, exchanged for a per-device cookie |
122
- | `CASPER_SESSION_TTL_SECONDS` | `sessionTtlSeconds` | `604800` | Device-login lifetime, slid forward on activity |
123
- | `KIRO_BIN` | `kiroBin` | `kiro-cli` | Path to the kiro-cli binary |
124
- | `CASPER_KIRO_SESSIONS_DIR` | `kiroSessionsDir` | `~/.kiro/sessions` | Where kiro-cli keeps its own session files, which Casper reads |
125
- | `DEFAULT_CWD` | `defaultCwd` | cwd | Working directory for new sessions |
126
- | `DEFAULT_AGENT` | `defaultAgent` | `casper` | Agent for new sessions, so widgets work out of the box. If it is missing, kiro falls back to its Default mode on its own |
127
- | `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 |
128
- | `MAX_LIVE_SESSIONS` | `maxLiveSessions` | `6` | Concurrent live kiro processes |
129
- | `EVENT_BUFFER_SIZE` | `eventBufferSize` | `5000` | Events kept per session for replay on reconnect; a client older than the buffer refetches instead |
130
- | `CASPER_MAX_UPLOAD_BYTES` | `maxUploadBytes` | `104857600` | Largest single uploaded file |
131
- | `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 |
132
77
  | `CASPER_WEB_DIST` | _(env only)_ | beside the bundle | Built web app to serve |
133
78
 
134
- Beyond your LAN, put a TLS-terminating reverse proxy in front of
135
- `http://127.0.0.1:4319`, forwarding WebSocket upgrades with a long read timeout for
136
- 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.
137
81
 
138
82
  ## Security
139
83
 
140
- Casper allows every tool call kiro asks about, once, so unattended runs never block
141
- on approvals. It never picks "always allow", so no rule is saved that would apply
142
- outside Casper, and kiro's deny rules still apply. The agent can run commands and
143
- write files without asking, so treat access to Casper as equivalent to a shell on the
144
- machine.
145
-
146
- `CASPER_FILE_ROOT` is the only limit on what the file endpoints will read, and it defaults
147
- to everything the server can read. Narrow it if that matters to you.
148
-
149
- The token is 24 random bytes, generated for you and exchanged at login for a
150
- per-device cookie; only its hash is stored. Comparison is constant-time, and
151
- `/api/login` allows ten failures per quarter hour per address before answering 429.
152
- 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.
153
88
 
154
89
  ## Develop
155
90
 
@@ -160,9 +95,5 @@ npm test
160
95
  npm run e2e # prompt, disconnect mid-turn, reconnect, replay
161
96
  ```
162
97
 
163
- `unset NODE_ENV` first if you have it set: a stray `production` breaks installs and
164
- builds here.
165
-
166
- The repo is an npm workspace: `shared/` for types, `web/` for the React app, and
167
- `server/`, which is the package published to npm. `npm run build` bundles the server
168
- 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.16.0" : "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) => {