@joeyshi12/casper 0.6.0 → 0.6.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Joey Shi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,136 @@
1
+ <p align="center">
2
+ <img src="/assets/banner.svg" alt="Casper banner" width="100%"/>
3
+ </p>
4
+
5
+ <p align="center">
6
+ <a href="https://github.com/joeyshi12/casper/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-yellow.svg" alt="License: MIT"/></a>
7
+ <a href="https://www.npmjs.com/package/@joeyshi12/casper"><img src="https://img.shields.io/npm/v/@joeyshi12/casper.svg" alt="npm"/></a>
8
+ <a href="https://github.com/joeyshi12/casper/actions/workflows/test.yml"><img src="https://github.com/joeyshi12/casper/actions/workflows/test.yml/badge.svg" alt="Tests"/></a>
9
+ <a href="https://github.com/joeyshi12/casper/actions/workflows/publish.yml"><img src="https://github.com/joeyshi12/casper/actions/workflows/publish.yml/badge.svg" alt="Publish"/></a>
10
+ </p>
11
+
12
+ A web client for `kiro-cli`, over its Agent Client Protocol (ACP). Start a long
13
+ Kiro task and it keeps running server-side; on reconnect the client replays
14
+ exactly what it missed.
15
+
16
+ ## Features
17
+
18
+ - **Sessions** you can create, search, rename and delete. Live ones run in a
19
+ bounded process pool; idle ones go dormant and resume on demand.
20
+ - **Per-session model and agent**, from the live model list and kiro's agents.
21
+ - **Rich rendering** - Markdown, Mermaid, syntax-highlighted code, and MCP tool
22
+ calls with their status, input and output.
23
+ - **File browser** for the session's workspace, with previews for text, images
24
+ and PDFs.
25
+ - **Observability** - credits spent, context-window usage, turn duration.
26
+ - **PWA** - installable, responsive, reconnects when the network returns.
27
+
28
+ ## Install
29
+
30
+ Needs Node 24+ (Casper keeps its state in SQLite via the built-in `node:sqlite`)
31
+ and [`kiro-cli`](https://kiro.dev) installed and logged in — Casper is a client
32
+ for it, so nothing works without it.
33
+
34
+ ```bash
35
+ npm install -g @joeyshi12/casper
36
+ casper
37
+ ```
38
+
39
+ The first run generates an access token, prints it in a bordered block, and drops
40
+ the `casper` agent into `~/.kiro/agents`. Open the printed URL and paste the token.
41
+
42
+ To survive reboots, install the systemd user service:
43
+
44
+ ```bash
45
+ casper service install
46
+ ```
47
+
48
+ systemd is optional. Without it, start Casper however you prefer — your own init
49
+ system, `nohup casper &`, tmux.
50
+
51
+ | Command | |
52
+ |---|---|
53
+ | `casper` | Run the server in the foreground |
54
+ | `casper token` | Print the access token |
55
+ | `casper reset-token [value]` | Set a new token and sign every device out |
56
+ | `casper doctor` | Check kiro-cli, settings, data directory and web app |
57
+ | `casper service install` | Run as a systemd user service |
58
+ | `casper service uninstall` | Remove the service, keeping settings and sessions |
59
+ | `casper service status` | Show the service status |
60
+
61
+ To update, `npm install -g @joeyshi12/casper@latest`. Re-run
62
+ `casper service install` afterwards if you use the service: the unit records
63
+ absolute node and package paths, and both move on upgrade. Your token and sessions
64
+ survive.
65
+
66
+ To remove it:
67
+
68
+ ```bash
69
+ casper service uninstall
70
+ npm uninstall -g @joeyshi12/casper
71
+ rm -rf ~/.casper ~/.config/casper # only if you want sessions and settings gone too
72
+ ```
73
+
74
+ ## Configuration
75
+
76
+ Settings live in `~/.config/casper/config.json` (or `$XDG_CONFIG_HOME/casper/`),
77
+ written `0600` because it holds the token:
78
+
79
+ ```json
80
+ {
81
+ "port": 4319,
82
+ "defaultCwd": "/home/you/projects",
83
+ "fileRoot": "/home/you",
84
+ "defaultAgent": "casper"
85
+ }
86
+ ```
87
+
88
+ A missing or malformed file is ignored with a warning rather than failing startup,
89
+ and unrecognised keys are reported so a typo doesn't pass silently.
90
+
91
+ Every setting also works as an environment variable, and **the environment wins**,
92
+ which is handy for containers and one-off runs. Two are environment-only:
93
+ `CASPER_DATA_DIR`, because it says where data lives and so can't be read from
94
+ inside it, and `CASPER_WEB_DIST`, which is install layout rather than a preference.
95
+
96
+ | Variable | Config key | Default | |
97
+ |---|---|---|---|
98
+ | `HOST` | `host` | `0.0.0.0` | Bind address |
99
+ | `PORT` | `port` | `4319` | Server port |
100
+ | `CASPER_TOKEN` | `token` | _(generated)_ | Entered once at login, exchanged for a per-device cookie |
101
+ | `CASPER_SESSION_TTL_SECONDS` | `sessionTtlSeconds` | `604800` | Device-login lifetime, slid forward on activity |
102
+ | `KIRO_BIN` | `kiroBin` | `kiro-cli` | Path to the kiro-cli binary |
103
+ | `DEFAULT_CWD` | `defaultCwd` | cwd | Working directory for new sessions |
104
+ | `DEFAULT_AGENT` | `defaultAgent` | `kiro_default` | Agent for new sessions |
105
+ | `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 |
106
+ | `MAX_LIVE_SESSIONS` | `maxLiveSessions` | `6` | Concurrent live kiro processes |
107
+ | `CASPER_DATA_DIR` | _(env only)_ | `~/.casper` | Where `casper.db` lives |
108
+ | `CASPER_WEB_DIST` | _(env only)_ | beside the bundle | Built web app to serve |
109
+
110
+ Beyond your LAN, put a TLS-terminating reverse proxy in front of
111
+ `http://127.0.0.1:4319`, forwarding WebSocket upgrades with a long read timeout for
112
+ lengthy turns. PWA install and reliable reconnects need HTTPS.
113
+
114
+ ## Security
115
+
116
+ Casper launches kiro with `--trust-all-tools`, so unattended runs never block on
117
+ approvals — the agent can run commands and write files without asking. Treat access
118
+ to Casper as equivalent to a shell on the machine.
119
+
120
+ The token is 24 random bytes, generated for you and exchanged at login for a
121
+ per-device cookie; only its hash is stored. Comparison is constant-time, `/api/login`
122
+ allows ten failures per quarter hour per address before answering 429, and the
123
+ settings file and database are `0600`.
124
+
125
+ ## Develop
126
+
127
+ ```bash
128
+ npm install
129
+ CASPER_TOKEN=dev npm run dev # server and web dev servers together
130
+ npm test
131
+ npm run e2e # prompt, disconnect mid-turn, reconnect, replay
132
+ ```
133
+
134
+ The repo is an npm workspace: `shared/` for types, `web/` for the React app, and
135
+ `server/`, which is the package published to npm. `npm run build` bundles the server
136
+ with esbuild and copies the built web app in beside it.
package/dist/server.js CHANGED
@@ -6746,7 +6746,7 @@ var program = new Command();
6746
6746
  // server/src/cli/program.ts
6747
6747
  init_paths();
6748
6748
  init_settings();
6749
- var VERSION = true ? "0.6.0" : "dev";
6749
+ var VERSION = true ? "0.6.1" : "dev";
6750
6750
  async function bootstrap() {
6751
6751
  const file = configFilePath();
6752
6752
  const settings = readSettings(file);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joeyshi12/casper",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Web client for kiro-cli over the Agent Client Protocol",
5
5
  "license": "MIT",
6
6
  "author": "Joey Shi",