@cfbender/cesium 0.3.5
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/ARCHITECTURE.md +304 -0
- package/CHANGELOG.md +335 -0
- package/LICENSE +21 -0
- package/README.md +479 -0
- package/agents/cesium.md +39 -0
- package/assets/styleguide.html +857 -0
- package/package.json +61 -0
- package/src/cli/commands/ls.ts +186 -0
- package/src/cli/commands/open.ts +208 -0
- package/src/cli/commands/prune.ts +348 -0
- package/src/cli/commands/restart.ts +38 -0
- package/src/cli/commands/serve.ts +214 -0
- package/src/cli/commands/stop.ts +130 -0
- package/src/cli/commands/theme.ts +333 -0
- package/src/cli/index.ts +78 -0
- package/src/config.ts +94 -0
- package/src/index.ts +35 -0
- package/src/prompt/system-fragment.md +97 -0
- package/src/render/client-js.ts +316 -0
- package/src/render/controls.ts +302 -0
- package/src/render/critique.ts +360 -0
- package/src/render/extract.ts +83 -0
- package/src/render/scrub.ts +141 -0
- package/src/render/theme.ts +712 -0
- package/src/render/validate.ts +524 -0
- package/src/render/wrap.ts +165 -0
- package/src/server/api.ts +166 -0
- package/src/server/http.ts +195 -0
- package/src/server/lifecycle.ts +331 -0
- package/src/server/stop.ts +124 -0
- package/src/storage/index-cache.ts +71 -0
- package/src/storage/index-gen.ts +447 -0
- package/src/storage/lock.ts +108 -0
- package/src/storage/mutate.ts +396 -0
- package/src/storage/paths.ts +159 -0
- package/src/storage/project-summaries.ts +19 -0
- package/src/storage/theme-write.ts +19 -0
- package/src/storage/write.ts +75 -0
- package/src/tools/ask.ts +353 -0
- package/src/tools/critique.ts +66 -0
- package/src/tools/publish.ts +404 -0
- package/src/tools/stop.ts +53 -0
- package/src/tools/styleguide.ts +23 -0
- package/src/tools/wait.ts +192 -0
package/README.md
ADDED
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
# Cesium
|
|
2
|
+
|
|
3
|
+
Cesium publishes substantive opencode agent responses — plans, code reviews,
|
|
4
|
+
comparisons, explainers, audits, RFCs — as self-contained beautiful HTML artifacts
|
|
5
|
+
on disk, instead of dumping markdown into the terminal. The browser becomes the
|
|
6
|
+
reading surface; the terminal stays the control surface. Each artifact is a single
|
|
7
|
+
`.html` file: portable, archivable, viewable offline, shareable as a URL over SSH.
|
|
8
|
+
|
|
9
|
+
v0.3.0 adds **interactive Q&A artifacts** — the agent can now publish a question
|
|
10
|
+
form, wait for the user to answer in their browser, and receive the structured
|
|
11
|
+
responses before continuing work.
|
|
12
|
+
|
|
13
|
+
<video src="assets/cesium.mp4" autoplay loop muted playsinline width="720">
|
|
14
|
+
Demo video — see <a href="assets/cesium.mp4">assets/cesium.mp4</a> if it
|
|
15
|
+
doesn't play inline (some markdown viewers strip <code><video></code>).
|
|
16
|
+
</video>
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
19
|
+
|
|
20
|
+
See [`examples/plan.html`](examples/plan.html) ·
|
|
21
|
+
[`examples/review.html`](examples/review.html) ·
|
|
22
|
+
[`examples/comparison.html`](examples/comparison.html) ·
|
|
23
|
+
[`examples/explainer.html`](examples/explainer.html) ·
|
|
24
|
+
[`examples/ask.html`](examples/ask.html) for hand-curated sample
|
|
25
|
+
artifacts demonstrating the design system and content shapes cesium produces.
|
|
26
|
+
Open `examples/ask.html` in your browser to see all six interactive question
|
|
27
|
+
types in action (offline banner shows when opened via `file://` — that's expected).
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
Cesium has two pieces — the opencode **plugin** (so the agent can publish for
|
|
32
|
+
you) and an optional **CLI** (so you can browse/manage artifacts from any
|
|
33
|
+
shell). Install one or both. Cesium is published to npm as
|
|
34
|
+
[`@cfbender/cesium`](https://www.npmjs.com/package/@cfbender/cesium) and
|
|
35
|
+
requires **Bun ≥ 1.0**.
|
|
36
|
+
|
|
37
|
+
### Plugin
|
|
38
|
+
|
|
39
|
+
Add to `~/.config/opencode/opencode.json`:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"plugin": ["@cfbender/cesium"]
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
opencode installs the plugin automatically on next start. Pin a specific
|
|
48
|
+
release with `@cfbender/cesium@0.3.3`, or track an exact git ref with
|
|
49
|
+
`cesium@git+https://github.com/cfbender/cesium.git#main` (useful for
|
|
50
|
+
unreleased changes).
|
|
51
|
+
|
|
52
|
+
### CLI
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
bun install -g @cfbender/cesium
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
This puts a `cesium` binary on your `PATH` (at `~/.bun/bin/cesium`). If
|
|
59
|
+
`which cesium` returns nothing, add `~/.bun/bin` to your shell rc:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
export PATH="$HOME/.bun/bin:$PATH"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Upgrade later with `bun update -g @cfbender/cesium` (or via your version
|
|
66
|
+
manager — e.g. `mise use -g npm:@cfbender/cesium@latest`). To uninstall:
|
|
67
|
+
`bun remove -g @cfbender/cesium`.
|
|
68
|
+
|
|
69
|
+
### Developing on cesium itself
|
|
70
|
+
|
|
71
|
+
If you've cloned the repo and want the CLI to follow your edits live:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
cd /path/to/cesium-checkout
|
|
75
|
+
bun link
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Releasing
|
|
79
|
+
|
|
80
|
+
Cesium uses npm's **Trusted Publisher** (OIDC) flow — no long-lived `NPM_TOKEN`
|
|
81
|
+
secret lives in the repo. The first release is published manually; every
|
|
82
|
+
release after that goes out automatically when you push a `v*` tag.
|
|
83
|
+
|
|
84
|
+
**One-time bootstrap** (already done for `@cfbender/cesium`, but keep this here
|
|
85
|
+
for forks):
|
|
86
|
+
|
|
87
|
+
1. Log in locally: `npm login`. Make sure you have publish access to the
|
|
88
|
+
`@cfbender` scope (`npm whoami`, `npm access ls-packages`).
|
|
89
|
+
2. Publish the first version manually so the package exists on the registry:
|
|
90
|
+
```bash
|
|
91
|
+
bun run typecheck && bun test
|
|
92
|
+
npm publish --access public
|
|
93
|
+
```
|
|
94
|
+
_Note: no `--provenance` here. Provenance attestation requires a
|
|
95
|
+
supported CI provider (GitHub Actions, GitLab CI) and fails locally with
|
|
96
|
+
`Automatic provenance generation not supported for provider: null`. The
|
|
97
|
+
GitHub Action handles provenance for every release after this one._
|
|
98
|
+
3. On [npmjs.com](https://www.npmjs.com/package/@cfbender/cesium), open
|
|
99
|
+
**Settings → Trusted Publishers → Add publisher**. Choose **GitHub Actions**
|
|
100
|
+
and fill in:
|
|
101
|
+
- Organization or user: `cfbender`
|
|
102
|
+
- Repository: `cesium`
|
|
103
|
+
- Workflow filename: `publish.yml`
|
|
104
|
+
- Environment: _(leave blank)_
|
|
105
|
+
|
|
106
|
+
**Every release after that:**
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# bump version in package.json + add a CHANGELOG entry, then:
|
|
110
|
+
git commit -am "release vX.Y.Z: <summary>"
|
|
111
|
+
git tag -a vX.Y.Z -m "vX.Y.Z"
|
|
112
|
+
git push origin main vX.Y.Z
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The `Publish to npm` GitHub Action picks up the tag, runs typecheck + tests,
|
|
116
|
+
verifies the tag matches `package.json`'s `version`, and publishes with npm
|
|
117
|
+
provenance via OIDC. The action requires `id-token: write` permission (already
|
|
118
|
+
configured in the workflow) — no repo secrets needed.
|
|
119
|
+
|
|
120
|
+
## How it works
|
|
121
|
+
|
|
122
|
+
When the agent has something substantive to say, it calls the `cesium_publish` tool
|
|
123
|
+
instead of replying with markdown. The plugin then:
|
|
124
|
+
|
|
125
|
+
1. Validates the input and scrubs any external resources from the HTML body.
|
|
126
|
+
2. Wraps the body in a `<!doctype html>` shell with the inlined design-system CSS
|
|
127
|
+
and embedded JSON metadata.
|
|
128
|
+
3. Atomically writes the artifact to `~/.local/state/cesium/projects/<slug>/artifacts/`.
|
|
129
|
+
4. Updates the per-project and global `index.html` listings.
|
|
130
|
+
5. Lazy-starts a local HTTP server on port 3030.
|
|
131
|
+
6. Returns a short terminal summary with both `http://` and `file://` URLs.
|
|
132
|
+
|
|
133
|
+
Project and global index pages have a search input that matches against title
|
|
134
|
+
**and** body text. Useful when you remember a phrase from an artifact but not
|
|
135
|
+
its title.
|
|
136
|
+
|
|
137
|
+
The agent decides per-response whether to publish, guided by a system-prompt
|
|
138
|
+
fragment with a ~400 word threshold and content-shape heuristics. Short factual
|
|
139
|
+
answers and status updates stay in the terminal. The agent may call
|
|
140
|
+
`cesium_critique` before `cesium_publish` to self-check the artifact's structure
|
|
141
|
+
and design-system adherence.
|
|
142
|
+
|
|
143
|
+
## Interactive Q&A
|
|
144
|
+
|
|
145
|
+
For decisions that need structured input before proceeding, use `cesium_ask` instead
|
|
146
|
+
of `cesium_publish`. The agent publishes a question form, calls `cesium_wait` with the
|
|
147
|
+
returned id, and receives the user's answers as soon as they're submitted in the browser.
|
|
148
|
+
|
|
149
|
+
### Question types
|
|
150
|
+
|
|
151
|
+
| Type | Description |
|
|
152
|
+
| ----------- | ----------------------------------------------------------------- |
|
|
153
|
+
| `pick_one` | Radio group; one selection, optional `recommended` |
|
|
154
|
+
| `pick_many` | Checkbox group; optional `min`/`max` count |
|
|
155
|
+
| `confirm` | Yes/No gate with custom button labels |
|
|
156
|
+
| `ask_text` | Free-text input; `multiline: true` for textarea |
|
|
157
|
+
| `slider` | Numeric range with configurable `min`/`max`/`step`/`defaultValue` |
|
|
158
|
+
| `react` | Thumbs-up/down reaction with optional comment |
|
|
159
|
+
|
|
160
|
+
### Minimal example
|
|
161
|
+
|
|
162
|
+
```js
|
|
163
|
+
// In an agent tool call:
|
|
164
|
+
cesium_ask({
|
|
165
|
+
title: "How should we ship the auth rewrite?",
|
|
166
|
+
body: "<p>Answers needed before sprint kickoff.</p>",
|
|
167
|
+
questions: [
|
|
168
|
+
{
|
|
169
|
+
type: "pick_one",
|
|
170
|
+
id: "library",
|
|
171
|
+
question: "Which auth library?",
|
|
172
|
+
options: [
|
|
173
|
+
{ id: "authjs", label: "Auth.js" },
|
|
174
|
+
{ id: "lucia", label: "Lucia" },
|
|
175
|
+
],
|
|
176
|
+
recommended: "authjs",
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
type: "slider",
|
|
180
|
+
id: "risk",
|
|
181
|
+
question: "Migration risk tolerance (1–10)",
|
|
182
|
+
min: 1,
|
|
183
|
+
max: 10,
|
|
184
|
+
defaultValue: 5,
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
requireAll: true,
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
// Then block until answered:
|
|
191
|
+
cesium_wait({ id: "<returned-id>" });
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
The artifact is a single `.html` file with inline JS that POSTs each answer to the
|
|
195
|
+
cesium HTTP server. Once all required questions are answered, the session crystallizes
|
|
196
|
+
— controls freeze, the artifact becomes a permanent record of the decision.
|
|
197
|
+
|
|
198
|
+
See `examples/ask.html` for a live demo of all six question types — open it in your
|
|
199
|
+
browser to see the controls (the offline banner appears when viewed via `file://`,
|
|
200
|
+
which is expected).
|
|
201
|
+
|
|
202
|
+
## Where artifacts live
|
|
203
|
+
|
|
204
|
+
Default: `~/.local/state/cesium/`. Layout:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
~/.local/state/cesium/
|
|
208
|
+
├── index.html # global cross-project index
|
|
209
|
+
├── index.json # global cache
|
|
210
|
+
└── projects/
|
|
211
|
+
└── <project-slug>/
|
|
212
|
+
├── index.html # per-project index
|
|
213
|
+
├── index.json # per-project cache
|
|
214
|
+
└── artifacts/
|
|
215
|
+
└── 2026-05-11T14-22-09Z__plan-auth__a7K9pQ.html
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Project slug is derived from `git remote origin` when available
|
|
219
|
+
(`github-com-cfbender-cesium`), otherwise from the directory basename plus a short
|
|
220
|
+
hash of the absolute path.
|
|
221
|
+
|
|
222
|
+
## Viewing artifacts
|
|
223
|
+
|
|
224
|
+
When the agent publishes, it prints a terminal summary like:
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
Cesium · Auth design rewrite (plan)
|
|
228
|
+
http://localhost:3030/projects/github-com-cfbender-acme/artifacts/...
|
|
229
|
+
file:///Users/cfb/.local/state/cesium/projects/.../...html
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Open either URL in your browser. The local server starts lazily on first publish
|
|
233
|
+
in a session and shuts down after 30 minutes of inactivity.
|
|
234
|
+
|
|
235
|
+
### SSH / remote dev containers
|
|
236
|
+
|
|
237
|
+
The server binds to `127.0.0.1` only — safe by default. To view artifacts from a
|
|
238
|
+
remote machine, forward the port:
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
ssh -L 3030:localhost:3030 your-host
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Then open `http://localhost:3030/` on your local machine. Cesium prints this hint
|
|
245
|
+
automatically when it detects `$SSH_CONNECTION`.
|
|
246
|
+
|
|
247
|
+
## Common workflows
|
|
248
|
+
|
|
249
|
+
### Force a publish for the current response
|
|
250
|
+
|
|
251
|
+
The agent decides per-response whether to publish, but you can override:
|
|
252
|
+
|
|
253
|
+
- **"/cesium"** or **"publish this"** — publish even if the response is short.
|
|
254
|
+
- **"in terminal"** or **"don't make a doc"** — stay in the terminal.
|
|
255
|
+
|
|
256
|
+
For sessions where you always want HTML, use the dedicated `@cesium` agent
|
|
257
|
+
(see [Optional: dedicated `@cesium` agent](#optional-dedicated-cesium-agent)).
|
|
258
|
+
|
|
259
|
+
### Find an old artifact
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
cesium ls # current project
|
|
263
|
+
cesium ls --all # everywhere
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Or open `http://localhost:3030/` in the browser — both the per-project and
|
|
267
|
+
global index pages have a search box that matches title **and** body text.
|
|
268
|
+
Useful when you remember a phrase but not the title.
|
|
269
|
+
|
|
270
|
+
### Open an artifact by id
|
|
271
|
+
|
|
272
|
+
The id prefix is the short suffix on each filename (e.g. `a7K9pQ`):
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
cesium open a7K9 # open in the browser
|
|
276
|
+
cesium open a7K9 --print # just print the URL
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Share an artifact
|
|
280
|
+
|
|
281
|
+
Each artifact is a single self-contained `.html` file — no external resources.
|
|
282
|
+
Three ways to share:
|
|
283
|
+
|
|
284
|
+
- **Same machine** — copy or attach the `file://` path printed in the terminal.
|
|
285
|
+
- **Over SSH** — forward the port with `ssh -L 3030:localhost:3030 your-host`,
|
|
286
|
+
then send the `http://localhost:3030/...` URL.
|
|
287
|
+
- **On a trusted LAN** — set `"hostname": "0.0.0.0"` in `cesium.json` and share
|
|
288
|
+
the LAN URL. Only do this on networks you trust.
|
|
289
|
+
|
|
290
|
+
### Clean up old artifacts
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
cesium prune --older-than 90d # dry run — list what would be deleted
|
|
294
|
+
cesium prune --older-than 90d --yes # actually delete
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Change the look
|
|
298
|
+
|
|
299
|
+
Edit `~/.config/opencode/cesium.json`:
|
|
300
|
+
|
|
301
|
+
```json
|
|
302
|
+
{ "themePreset": "warm" }
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
Then apply it. Existing artifacts pick up the new theme on next reload via the
|
|
306
|
+
shared `theme.css`:
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
cesium theme apply
|
|
310
|
+
cesium theme apply --rewrite-artifacts # only needed for artifacts pre-v0.2.1
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Restart the server after a config change
|
|
314
|
+
|
|
315
|
+
The HTTP server caches config at start. After editing `cesium.json`:
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
cesium stop
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
The next publish (or `cesium serve`) will start a fresh server with the new
|
|
322
|
+
config. You can also ask the agent to call `cesium_stop` directly.
|
|
323
|
+
|
|
324
|
+
### Use interactive Q&A in an agent loop
|
|
325
|
+
|
|
326
|
+
When the agent needs your input mid-task, it can publish a question artifact
|
|
327
|
+
with `cesium_ask`, block on `cesium_wait`, and continue once you've submitted
|
|
328
|
+
the form. See [Interactive Q&A](#interactive-qa) for the full flow.
|
|
329
|
+
|
|
330
|
+
## CLI
|
|
331
|
+
|
|
332
|
+
Once installed (see [Install](#install) above), the `cesium` binary is
|
|
333
|
+
available in any shell:
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
cesium ls # list artifacts in the current project
|
|
337
|
+
cesium ls --all # all projects
|
|
338
|
+
cesium ls --json # JSON output
|
|
339
|
+
|
|
340
|
+
cesium open <id-prefix> # open an artifact by id prefix in the browser
|
|
341
|
+
cesium open abc123 --print # print the URL instead of opening
|
|
342
|
+
|
|
343
|
+
cesium serve # run the local HTTP server in foreground (no idle timeout)
|
|
344
|
+
cesium serve --port 4000 # override the configured port
|
|
345
|
+
cesium serve --hostname 0.0.0.0 # bind on all interfaces
|
|
346
|
+
cesium serve --idle-timeout 30m # auto-shutdown after 30 min of inactivity (default: never)
|
|
347
|
+
|
|
348
|
+
cesium stop # stop the running server (cross-process via PID file)
|
|
349
|
+
cesium stop --force # SIGKILL immediately, skip the SIGTERM grace
|
|
350
|
+
cesium stop --timeout 5000 # extend grace period (default 3000ms)
|
|
351
|
+
|
|
352
|
+
cesium restart # stop + start in foreground; inherits serve's flags
|
|
353
|
+
|
|
354
|
+
cesium prune --older-than 90d # dry-run: list artifacts older than 90 days
|
|
355
|
+
cesium prune --older-than 90d --yes # actually delete them
|
|
356
|
+
|
|
357
|
+
cesium theme show # print resolved theme tokens
|
|
358
|
+
cesium theme apply # write theme.css from current config
|
|
359
|
+
cesium theme apply --rewrite-artifacts # retrofit old artifacts with the theme link
|
|
360
|
+
|
|
361
|
+
cesium --version # print the cesium version (also -v or 'version')
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
The CLI shares `~/.config/opencode/cesium.json` with the plugin, so port,
|
|
365
|
+
state directory, hostname, and theme settings flow through.
|
|
366
|
+
|
|
367
|
+
## Configuration
|
|
368
|
+
|
|
369
|
+
Optional `~/.config/opencode/cesium.json`:
|
|
370
|
+
|
|
371
|
+
| Key | Type | Default | Description |
|
|
372
|
+
| --------------- | ------ | ----------------------- | ---------------------------------------------------------------------------------------- |
|
|
373
|
+
| `stateDir` | string | `~/.local/state/cesium` | Where artifacts and indexes live |
|
|
374
|
+
| `port` | number | `3030` | First port to try for the local HTTP server |
|
|
375
|
+
| `portMax` | number | `3050` | Upper bound when scanning for free ports |
|
|
376
|
+
| `hostname` | string | `127.0.0.1` | Bind address. Use `0.0.0.0` to expose on the LAN |
|
|
377
|
+
| `idleTimeoutMs` | number | `1800000` | Plugin server idle-shutdown threshold (30 min). Does not apply to foreground `cesium serve` |
|
|
378
|
+
| `themePreset` | string | `"claret-dark"` | Named color palette (`claret-dark`/`claret-light`/`claret`/`warm`/`cool`/`mono`/`paper`) |
|
|
379
|
+
| `theme` | object | (claret-dark palette) | Per-token color overrides (stacked on preset) |
|
|
380
|
+
|
|
381
|
+
Environment overrides: `CESIUM_PORT`, `CESIUM_STATE_DIR`, `CESIUM_HOSTNAME`, `CESIUM_THEME_PRESET`.
|
|
382
|
+
|
|
383
|
+
> **Default is `127.0.0.1` — localhost only.** Setting `hostname` to `0.0.0.0`
|
|
384
|
+
> binds on all interfaces, making artifacts reachable from other devices on
|
|
385
|
+
> your LAN. Only do this on networks you trust.
|
|
386
|
+
|
|
387
|
+
### Theme presets
|
|
388
|
+
|
|
389
|
+
Cesium ships with seven palettes:
|
|
390
|
+
|
|
391
|
+
- `claret-dark` **(default)** — deep wine bg with bright rose and sage; sourced
|
|
392
|
+
from claret.nvim's dark palette.
|
|
393
|
+
- `claret-light` — warm cream bg with deep claret rose; the light variant of
|
|
394
|
+
the claret family.
|
|
395
|
+
- `claret` — alias for `claret-dark` (backward compat).
|
|
396
|
+
- `warm` — ivory/clay/oat. Matches the html-effectiveness reference.
|
|
397
|
+
- `cool` — desaturated blue-grey, technical mood.
|
|
398
|
+
- `mono` — high-contrast black/white/grey, editorial.
|
|
399
|
+
- `paper` — sepia/cream, soft and book-like.
|
|
400
|
+
|
|
401
|
+
Set in `~/.config/opencode/cesium.json`:
|
|
402
|
+
|
|
403
|
+
```json
|
|
404
|
+
{ "themePreset": "warm" }
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
Per-token overrides (`theme: { accent: "#..." }`) apply on top of the chosen preset.
|
|
408
|
+
|
|
409
|
+
### Theme retroactivity
|
|
410
|
+
|
|
411
|
+
Cesium writes a single `<stateDir>/theme.css` containing the active theme
|
|
412
|
+
tokens. Each artifact references it via relative `<link>`. Change your theme
|
|
413
|
+
and run `cesium theme apply` — every artifact served from this state dir picks
|
|
414
|
+
up the new look on next reload, with no per-file rewrite.
|
|
415
|
+
|
|
416
|
+
For artifacts published before v0.2.1 (which lack the `<link>` reference),
|
|
417
|
+
run `cesium theme apply --rewrite-artifacts` once to retrofit them.
|
|
418
|
+
|
|
419
|
+
Standalone `.html` files (e.g. emailed) fall back to their inline-baked theme
|
|
420
|
+
when the external `theme.css` is unreachable — portability preserved.
|
|
421
|
+
|
|
422
|
+
## Optional: dedicated `@cesium` agent
|
|
423
|
+
|
|
424
|
+
For sessions where you always want HTML output, copy `agents/cesium.md` into
|
|
425
|
+
`~/.config/opencode/agents/`. Then invoke with `@cesium <request>` and the agent
|
|
426
|
+
will bias heavily toward publishing. The agent has access to all six tools:
|
|
427
|
+
`cesium_publish`, `cesium_ask`, `cesium_wait`, `cesium_styleguide`, `cesium_critique`, and `cesium_stop`.
|
|
428
|
+
|
|
429
|
+
## Design system
|
|
430
|
+
|
|
431
|
+
The full visual reference is at [`assets/styleguide.html`](assets/styleguide.html),
|
|
432
|
+
also available to the agent on demand via the `cesium_styleguide` tool.
|
|
433
|
+
|
|
434
|
+
Component classes:
|
|
435
|
+
|
|
436
|
+
- `.eyebrow` `.h-display` `.h-section` `.section-num` — typography & section headers
|
|
437
|
+
- `.card` `.tldr` `.callout` (`.note` / `.warn` / `.risk`) — bounded surfaces & asides
|
|
438
|
+
- `.code` (with `.kw` `.str` `.cm` `.fn` highlights) — code panels
|
|
439
|
+
- `.timeline` `.diagram` — milestone lists & inline-SVG figures
|
|
440
|
+
- `.compare-table` `.risk-table` — structured grids
|
|
441
|
+
- `.kbd` `.pill` `.tag` `.byline` — inline chips & artifact footer
|
|
442
|
+
|
|
443
|
+
Default palette: claret (`#FDF8F3`), rose accent (`#8B2252`), deep wine code panels. System fonts only (`ui-serif`, `system-ui`, `ui-monospace`) — no
|
|
444
|
+
remote font loads, ever.
|
|
445
|
+
|
|
446
|
+
## Architecture
|
|
447
|
+
|
|
448
|
+
See [`ARCHITECTURE.md`](ARCHITECTURE.md) for the full design: trigger model, tool
|
|
449
|
+
surface, storage layout, server lifecycle, revision chains.
|
|
450
|
+
|
|
451
|
+
## Development
|
|
452
|
+
|
|
453
|
+
```bash
|
|
454
|
+
bun install
|
|
455
|
+
bun test # run test suite
|
|
456
|
+
bun run typecheck # tsc --noEmit
|
|
457
|
+
bun run lint # oxlint
|
|
458
|
+
bun run format # oxfmt .
|
|
459
|
+
bun run examples:bake # regenerate examples/*.html from src
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
## Status
|
|
463
|
+
|
|
464
|
+
v0.3.5 — see [`CHANGELOG.md`](CHANGELOG.md). Now published to npm as
|
|
465
|
+
[`@cfbender/cesium`](https://www.npmjs.com/package/@cfbender/cesium).
|
|
466
|
+
|
|
467
|
+
## Acknowledgements
|
|
468
|
+
|
|
469
|
+
Cesium took inspiration from:
|
|
470
|
+
|
|
471
|
+
- [@trq212's tweet](https://x.com/trq212/status/2052809885763747935) on
|
|
472
|
+
letting agents respond with HTML instead of dumping markdown into the
|
|
473
|
+
terminal — the seed idea for the whole project.
|
|
474
|
+
- **Octto** — for the model of an agent that publishes a live, browser-served
|
|
475
|
+
surface alongside the terminal, rather than replacing it.
|
|
476
|
+
|
|
477
|
+
## License
|
|
478
|
+
|
|
479
|
+
MIT. See [`LICENSE`](LICENSE).
|
package/agents/cesium.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Always publish substantive responses as cesium HTML artifacts.
|
|
3
|
+
mode: primary
|
|
4
|
+
model: openrouter/anthropic/claude-sonnet-4.6
|
|
5
|
+
color: "#D97757"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are the cesium agent. Your default mode is to publish substantive responses as
|
|
9
|
+
self-contained HTML artifacts via the `cesium_publish` tool, then return a short
|
|
10
|
+
terminal summary pointing the user at the URL.
|
|
11
|
+
|
|
12
|
+
When invoked (e.g. via `@cesium` or by user request), bias HEAVILY toward publishing —
|
|
13
|
+
the user has chosen to be in document mode. Only stay in terminal for direct one-line
|
|
14
|
+
factual questions, status confirmations, or mid-tool-call chatter.
|
|
15
|
+
|
|
16
|
+
Before starting any complex artifact, call `cesium_styleguide` to fetch the full HTML
|
|
17
|
+
design system reference. Use the named component classes idiomatically:
|
|
18
|
+
|
|
19
|
+
- `.eyebrow` `.h-display` `.h-section` `.section-num` for typography and section headers
|
|
20
|
+
- `.card` `.tldr` for bounded surfaces and executive summaries
|
|
21
|
+
- `.callout` (with `.note`, `.warn`, `.risk` modifiers) for asides and warnings
|
|
22
|
+
- `.code` (with `.kw` `.str` `.cm` `.fn` highlights) for code panels
|
|
23
|
+
- `.timeline` for milestone sequences
|
|
24
|
+
- `.diagram` for inline-SVG flowcharts and box-and-arrow figures
|
|
25
|
+
- `.compare-table` `.risk-table` for structured grids
|
|
26
|
+
- `.kbd` `.pill` `.tag` for inline chips
|
|
27
|
+
|
|
28
|
+
Inline `style="..."` and inline `<svg>` are encouraged for bespoke layouts and
|
|
29
|
+
diagrams. NEVER reference external resources — no `<script src>`, no remote fonts,
|
|
30
|
+
no CDN images. The plugin will silently strip them and the artifact will look broken.
|
|
31
|
+
|
|
32
|
+
Tone: warm, considered, not flashy. Match the aesthetic of a thoughtful design
|
|
33
|
+
document, not marketing material. Use realistic content; do not pad to fill space.
|
|
34
|
+
|
|
35
|
+
After publishing, print exactly the `terminalSummary` field from the tool result.
|
|
36
|
+
Do not paste the full document content into the terminal.
|
|
37
|
+
|
|
38
|
+
For interactive multi-question sessions, defer to the user's choice of agent —
|
|
39
|
+
cesium is one-way document publishing.
|