chamba 0.2.0 → 0.3.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.
Files changed (77) hide show
  1. package/README.md +6 -7
  2. package/dist/cli.js +534 -643
  3. package/dist/server.js +1395 -1483
  4. package/inject/annotate.js +18 -49
  5. package/package.json +5 -7
  6. package/skill/SKILL.md +67 -259
  7. package/web/assets/highlighted-body-OFNGDK62-Bn4Eu7CG.js +1 -0
  8. package/web/assets/index-B9DI4F1Z.js +202 -0
  9. package/web/assets/index-DK_n6CTo.css +2 -0
  10. package/web/assets/mermaid-GHXKKRXX-CEMduc-U.js +1 -0
  11. package/web/index.html +2 -2
  12. package/web/assets/abnfDiagram-VRR7QNED-C5V2hrtE.js +0 -1
  13. package/web/assets/arc-d7OTmxZy.js +0 -1
  14. package/web/assets/architectureDiagram-ZJ3FMSHR--CztaeAS.js +0 -36
  15. package/web/assets/blockDiagram-677ZJIJ3-DkA5Z_uK.js +0 -132
  16. package/web/assets/c4Diagram-LMCZKHZV-C78dI0l-.js +0 -10
  17. package/web/assets/channel-D9AxU8kk.js +0 -1
  18. package/web/assets/chunk-2Q5K7J3B-LBNP12XV.js +0 -1
  19. package/web/assets/chunk-32BRIVSS-DZoXrhCs.js +0 -1
  20. package/web/assets/chunk-5VM5RSS4-CPjoRxF_.js +0 -15
  21. package/web/assets/chunk-EX3LRPZG-DSlL8FE9.js +0 -231
  22. package/web/assets/chunk-JWPE2WC7-BjbBLYge.js +0 -1
  23. package/web/assets/chunk-MOJQB5TN-DCKqdaDr.js +0 -88
  24. package/web/assets/chunk-RYQCIY6F-D5yAURhE.js +0 -1
  25. package/web/assets/chunk-V7JOEXUC-DKY2sn06.js +0 -206
  26. package/web/assets/chunk-VR4S4FIN-DGiVMHh6.js +0 -1
  27. package/web/assets/chunk-XXDRQBXY-CUI1Tkrr.js +0 -1
  28. package/web/assets/classDiagram-OUVF2IWQ-D7gWuzIF.js +0 -1
  29. package/web/assets/classDiagram-v2-EOCWNBFH-D7gWuzIF.js +0 -1
  30. package/web/assets/cose-bilkent-JH36ORCC-Ao3LzalV.js +0 -1
  31. package/web/assets/cynefin-VYW2F7L2-7JQwpRwH.js +0 -178
  32. package/web/assets/cynefinDiagram-TSTJHNR4-BfuANy_V.js +0 -62
  33. package/web/assets/cytoscape.esm-DTSO7Bv0.js +0 -331
  34. package/web/assets/dagre-VKFMJZFB-DHVnVJCL.js +0 -4
  35. package/web/assets/defaultLocale-DX6XiGOO.js +0 -1
  36. package/web/assets/diagram-FQU43EPY-OYrtwA2f.js +0 -3
  37. package/web/assets/diagram-G47NLZAW-CbkLZxYp.js +0 -24
  38. package/web/assets/diagram-NH7WQ7WH-B0z_jTdi.js +0 -24
  39. package/web/assets/diagram-OA4YK3LP-BRu_2nwx.js +0 -30
  40. package/web/assets/diagram-WEI45ONY-B9cpw86D.js +0 -41
  41. package/web/assets/ebnfDiagram-CCIWWBDH-DaBQ7T4R.js +0 -1
  42. package/web/assets/erDiagram-Q63AITRT-D6PQiFj3.js +0 -85
  43. package/web/assets/flowDiagram-23GEKE2U-p_8Wj7It.js +0 -156
  44. package/web/assets/ganttDiagram-NO4QXBWP-BZBwuqu3.js +0 -292
  45. package/web/assets/gitGraphDiagram-IHSO6WYX-DyPcQ-91.js +0 -106
  46. package/web/assets/graph-C9eacEi8.js +0 -1
  47. package/web/assets/highlighted-body-OFNGDK62-Cq7RJZcn.js +0 -1
  48. package/web/assets/index-BN-QUr5b.js +0 -350
  49. package/web/assets/index-D6-LVQ5m.css +0 -1
  50. package/web/assets/infoDiagram-FWYZ7A6U-sAgBAeWC.js +0 -2
  51. package/web/assets/init-Gi6I4Gst.js +0 -1
  52. package/web/assets/ishikawaDiagram-FXEZZL3T-COEn9wCs.js +0 -70
  53. package/web/assets/journeyDiagram-5HDEW3XC-BPddPRXW.js +0 -139
  54. package/web/assets/kanban-definition-HUTT4EX6-B8TW97Oy.js +0 -89
  55. package/web/assets/katex-C5jXJg4s.js +0 -257
  56. package/web/assets/layout-DEXfKzaS.js +0 -1
  57. package/web/assets/linear-CnW5uQ_k.js +0 -1
  58. package/web/assets/map-Czzmt4hB.js +0 -1
  59. package/web/assets/mermaid.core-bOV5iNX_.js +0 -314
  60. package/web/assets/mindmap-definition-LN4V7U3C-Dtr4xW_-.js +0 -96
  61. package/web/assets/ordinal-Cboi1Yqb.js +0 -1
  62. package/web/assets/pegDiagram-2B236MQR-DqBITK5N.js +0 -1
  63. package/web/assets/pieDiagram-ENE6RG2P-DXjxZgy3.js +0 -39
  64. package/web/assets/quadrantDiagram-ABIIQ3AL-D4MXx3U7.js +0 -7
  65. package/web/assets/railroadDiagram-RFXS5EU6-LPfpHg4_.js +0 -1
  66. package/web/assets/requirementDiagram-TGXJPOKE-CiDswbjt.js +0 -84
  67. package/web/assets/sankeyDiagram-HTMAVEWB-VfN_qTEI.js +0 -40
  68. package/web/assets/sequenceDiagram-DBY2YBRQ-kJRIx4zm.js +0 -162
  69. package/web/assets/sizeCapture-X5ZJPWSS-D8vJbAt-.js +0 -1
  70. package/web/assets/stateDiagram-2N3HPSRC-9qku-qAj.js +0 -1
  71. package/web/assets/stateDiagram-v2-6OUMAXLB-DbOQICyv.js +0 -1
  72. package/web/assets/swimlanes-5IMT3BWC-Cdb5FDUM.js +0 -2
  73. package/web/assets/swimlanesDiagram-G3AALYLV-EDpLmqQv.js +0 -8
  74. package/web/assets/timeline-definition-FHXFAJF6-D0hyJCMm.js +0 -120
  75. package/web/assets/vennDiagram-L72KCM5P-KsCkGMtr.js +0 -34
  76. package/web/assets/wardleyDiagram-EHGQE667-B4jT_1ak.js +0 -78
  77. package/web/assets/xychartDiagram-FW5EYKEG-Bmy0rt8j.js +0 -7
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "chamba",
3
- "version": "0.2.0",
4
- "description": "A browser workspace paired to your terminal coding agent over one shared conversation.",
3
+ "version": "0.3.1",
4
+ "description": "A browser workspace beside your terminal coding agent - a rich parallel interface to the terminal chat.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "chamba": "dist/cli.js"
8
8
  },
9
9
  "engines": {
10
- "node": ">=20"
10
+ "node": ">=20.19.0"
11
11
  },
12
12
  "files": [
13
13
  "dist",
@@ -17,11 +17,9 @@
17
17
  "README.md"
18
18
  ],
19
19
  "dependencies": {
20
- "hono": "4.12.27",
20
+ "hono": "4.12.30",
21
21
  "@hono/node-server": "1.19.14",
22
22
  "@hono/node-ws": "1.3.1",
23
- "ws": "8.21.0",
24
- "marked": "18.0.5",
25
- "zod": "3.25.76"
23
+ "zod": "4.4.3"
26
24
  }
27
25
  }
package/skill/SKILL.md CHANGED
@@ -1,285 +1,93 @@
1
1
  ---
2
2
  name: chamba
3
- description: Open a browser workspace paired to this terminal session so the human can see rendered markdown, paste screenshots the agent can read, and point at UI - one shared conversation between the terminal agent and the browser. Use when the user says /chamba, asks to "open chamba", wants to share or receive images, or wants a visual workspace alongside the terminal.
4
- when_to_use: The user typed /chamba, asked to open the chamba workspace, wants to paste or be shown an image/screenshot, or wants a browser surface paired with this terminal session.
3
+ description: Open a browser workspace beside this terminal session - a second, parallel conversation where the human can see rendered markdown, paste screenshots the agent can read, point at UI, and view rich HTML pages the agent renders. Use when the user says /chamba, asks to "open chamba", wants to share or receive images, or wants a visual workspace alongside the terminal.
4
+ when_to_use: The user typed /chamba, asked to open the chamba workspace, wants to paste or be shown an image/screenshot, or wants a browser surface beside this terminal session.
5
5
  ---
6
6
 
7
7
  # chamba
8
8
 
9
- chamba pairs this terminal session with a browser workspace over one shared
10
- conversation. The terminal stays home base; the browser is where the human reads
11
- rendered markdown, pastes screenshots you can open, and points at UI. A pasted
12
- image arrives as a real file path you can `Read`; anything you send back with a
13
- file renders inline in their browser.
14
-
15
- Every command is `npx chamba@latest <command>`. Conversation content prints on
16
- stdout (what you read and act on); status and hints go to stderr, so a command's
17
- stdout is just the messages. Using `@latest` resolves the newest published
18
- version rather than a stale one npx may have cached.
19
-
20
- ## First run: the workspace
21
-
22
- chamba keeps everything under a `.chamba/` directory in the project. The first
23
- `open` creates it at the git repo root and says where (`created chamba workspace
24
- at ...`); each project gets its own server on a port derived from that location,
25
- so several projects run side by side without colliding. If the project has no
26
- `.git`, `open` will not guess a location - ask the human where the workspace
27
- should live and run `npx chamba@latest init <dir>` once (or `init --here` for the
28
- current directory), then `open`. `npx chamba@latest` with no arguments (a bare
29
- status) tells you whether a workspace exists yet.
30
-
31
- ## Opening a session
32
-
33
- ```
34
- npx chamba@latest open --title "what this is about"
35
- ```
36
-
37
- This prints a URL on stdout - give that URL to the human and ask them to open it.
38
- The server starts automatically if it is not already running.
39
-
40
- With no `--kind`, the session opens undecided: the browser shows the human a
41
- chooser as their first interaction, and their pick sets the kind on this same
42
- session. Your next `poll` reports the choice as a `· Session set to spec` or
43
- Session set to everyday` line - drive the session accordingly from there. Pass
44
- `--kind spec` (or `--kind everyday`) to decide up front and skip the chooser; spec
45
- work adds the Draft/Mock/Diagram surfaces.
46
-
47
- ## The app tab: connecting annotation
48
-
49
- The browser's "Your app" tab loads the human's running dev app in a frame so they can point at real UI and send you annotations.
50
- That needs chamba's annotation client running inside their app: one `<script>` tag that loads `/inject/annotate.js` from this chamba server.
51
- Until the app serves that script, the tab shows "Annotation layer not detected".
52
-
53
- Wire it in when the human asks - the app tab has an "Ask the agent to set this up" button that sends you exactly that request, and it may also come in their own words:
54
-
55
- - Use the exact tag the "not detected" banner shows; it already carries the right `src` (the origin the browser uses to reach chamba).
56
- If you cannot see the banner, the tag is `<script src="<chamba-origin>/inject/annotate.js"></script>`, where `<chamba-origin>` is this project's chamba server URL - the same host and port as the `open` URL.
57
- - Add it to the app's HTML entry or root layout, and guard it to development so it never ships to production.
58
- Where that goes depends on the project, so adapt to what you find: the `<head>` of `index.html` for Vite, a dev-only `<Script>` in `app/layout.tsx` (or `pages/_document`) for Next, `public/index.html` for Create React App, or the real HTML entry of anything else.
59
- - Have the human reload the app in the tab afterwards (or reload it yourself if you drive its dev server); the banner clears and the tab reads "connected" once the client is in.
60
-
61
- This is one-time setup per app: once the tag is in, annotation works for every session.
62
-
63
- ## The loop
64
-
65
- After opening (or `attach`), wait for the human:
66
-
67
- ```
68
- npx chamba@latest poll
69
- ```
70
-
71
- `poll` blocks until there is something to read, then prints it and returns. It
72
- keeps waiting across quiet windows on its own, so a single `poll` is normally all
73
- you run between actions - it returns the moment a batch arrives. After a few minutes
74
- with nothing it prints `still listening - re-run chamba poll to keep waiting` to
75
- stderr and exits 0; just run it again. Give it a generous command timeout, since one
76
- call may block for minutes. It is safe to re-run - a batch re-delivers if you were
77
- interrupted before acting.
78
-
79
- Once you are attending a session, every exchange with the human goes through this
80
- loop - `poll` to receive, `reply` to send - and that includes your own questions,
81
- status updates, and "what should I do next?" checks. The human cannot see your
82
- terminal, so anything you write there is invisible to them; never stop polling to
83
- say or ask something in the terminal. `· Session ended` is the only line that ends the loop:
84
- it means the human handed back (clicked "Hand back", ended the session, or told you
85
- to stop, at which point you may run `end`). Nothing else is a reason to stop - not a
86
- heartbeat, not a quiet stretch, not finishing the task, not having a question. When
87
- in doubt, `poll` again. (`poll --once` does a single bounded check instead, for
88
- scripts.) React to what each line says:
89
-
90
- - A message from the human (`you: ...`): do the work, then answer with `reply` and
91
- poll again. If you need something back first - a question, a choice, a
92
- clarification - send that with `reply` too and keep polling for their answer;
93
- never pause the loop to raise it in the terminal.
94
- - An attachment line (` [file] name -> /abs/path`): that path is a real file on
95
- disk. `Read` it (screenshots, mockups, logs) and act on what you see.
96
- - An annotation batch (`you [N annotations]:`): the human pointed at elements in
97
- the app tab. Each numbered item carries the comment, the `selector`, the `page`
98
- and `viewport`, a `[shot]` screenshot path to `Read`, and - when the app is
99
- React/Next - the `component:` name and its source `file:line`. Use the source
100
- and selector to find the code, `Read` the shot to see the problem, fix each item,
101
- then `reply`. (React 19 shows the component name but may omit `file:line` unless
102
- the app opted into bippy's source tier; fall back to the selector then.)
103
- - `· Session set to spec` / `· Session set to everyday`: the human picked the kind
104
- for a session that opened undecided. From here drive it accordingly - spec means
105
- the interview flow (`ask`, `decision`, `artifact`); everyday is open conversation.
106
- - `· You moved to another session (<id>)`: the human switched sessions. Hand off
107
- with `npx chamba@latest attach <id>`, then keep polling that one.
108
- - `· The user moved away`: a hand-off with no target session. Informational only -
109
- keep polling this session.
110
- - `· Session ended`: the human handed back to the terminal. This is the only line
111
- that ends the loop - stop polling and resume terminal work.
9
+ chamba is a browser conversation running beside this terminal one - two separate channels you attend at the same time.
10
+ Every command is `npx chamba@latest <command>`; conversation content prints on stdout, hints and status on stderr.
11
+
12
+ ## Protocol
13
+
14
+ 1. `npx chamba@latest open --title "what this is about"` - prints the session URL.
15
+ Say exactly: `Chamba available at: <url>` and nothing more.
16
+ 2. Launch `npx chamba@latest poll` as a background task.
17
+ It parks silently until the human sends something - hours or days, zero cost.
18
+ 3. When a poll returns: say `From chamba: <one-line gist of what arrived>`, act on it, answer with `reply`, and relaunch the background `poll` immediately.
19
+ While no poll is parked the browser tells the human no agent is listening.
20
+ 4. While the browser exchange is live, tighten the loop: poll in the foreground with `poll --for 240000` (give the command a generous timeout), reply, re-poll.
21
+ When it goes quiet, drop back to a background `poll`.
22
+ 5. Stop only when the session ends (see the cheatsheet).
23
+ Then say exactly: `Chamba stopped. Say the word to reopen.`
24
+
25
+ Do not narrate opening, polling, or switching beyond those one-liners.
26
+ The session is stateless to you: everything lives on disk plus your read cursor, so after any interruption `open` + `poll` puts you exactly back.
27
+ Re-running `open` in the same agent session reconnects to the same session (`--new` forces fresh, `--last` rebinds to the newest active one).
28
+ If `open` reports no git root, ask where the workspace should live and run `init <dir>` once.
29
+
30
+ ## What arrives -> what you do
31
+
32
+ | You see | It means | You do |
33
+ | --- | --- | --- |
34
+ | `you: ...` | a message from the browser | act, then `reply <text>` |
35
+ | `you [re #42 agent: "..."]: ...` | a reply to earlier event #42; the bracket is that event's gist | act with that context; use `reply --to 42` when answering that event specifically |
36
+ | `you [answer in terminal]: ...` | the human wants the answer HERE, in the terminal | answer in the terminal conversation; do not `reply` |
37
+ | ` [file] name -> /abs/path` | an attachment on the message above | `Read` the path (screenshots, mockups, logs) |
38
+ | `you [N annotations]:` | numbered element comments from the app tab or your page | per item: use `selector`/`component`/`file:line` to find the code, `Read` the `[shot]`, fix, then `reply` |
39
+ | `[chamba <id>#<seq> "..."]` pasted here in the terminal | the human is referencing a browser message | run `npx chamba@latest get <id>#<seq>` to print it, then answer in the terminal |
40
+ | Session ended` | the human handed back | stop the loop; say the stop line |
41
+ | `chamba server stopped` | deliberate stop | stop the loop; `open` again only if work should continue |
42
+
43
+ Anything else on stderr (heartbeat, retry note, quiet stretch) means: relaunch `poll` and keep listening.
44
+ Polling is at-least-once: a batch re-delivers if you were interrupted before acting on it.
45
+
46
+ ## Answer where you were asked
47
+
48
+ Terminal input is answered in the terminal; browser input is answered with `reply`.
49
+ Never mirror content between the channels.
50
+ The only overrides are explicit: `[answer in terminal]` and a pasted `[chamba ...]` reference both move that one answer to the terminal.
112
51
 
113
52
  ## Replying
114
53
 
115
54
  ```
116
55
  npx chamba@latest reply on it - here is the diff you asked about
56
+ npx chamba@latest reply here's the chart --image /abs/chart.png
57
+ npx chamba@latest reply --to 42 yes, exactly that one
117
58
  ```
118
59
 
119
- Send a file back (renders in their browser); text is optional alongside it:
60
+ `--file a,b` / `--image a,b` attach files (comma-separated); text is optional alongside them.
61
+ `--to <seq>` threads the reply to a specific earlier event - use it when answering something older than the latest message.
120
62
 
121
- ```
122
- npx chamba@latest reply here's the chart --image /abs/path/to/chart.png
123
- ```
124
-
125
- Use `--file a,b` / `--image a,b` (comma-separated) for several files.
126
-
127
- ## Handing back
63
+ ## Illustration pages
128
64
 
129
65
  ```
130
- npx chamba@latest end
66
+ npx chamba@latest show /abs/page.html --name architecture
131
67
  ```
132
68
 
133
- Run this only when the human explicitly asks to stop or hand back - never on your
134
- own initiative to leave the loop. It ends the session from the terminal (the browser
135
- goes read-only). The human can also hand back from the browser, which you will see
136
- as `· Session ended` on your next poll.
69
+ Renders a full HTML page in the browser's Illustration tab - use it proactively for diagrams, mockups, comparisons, anything richer than markdown.
137
70
 
138
- ## Spec sessions
71
+ - The page must be fully self-contained: inline all CSS/JS/SVG; it runs in a sandboxed iframe (`allow-scripts` only) with no network access.
72
+ - Re-`show` the same `--name` to revise in place; a new name adds a page.
73
+ - The human can annotate your page like any app - comments arrive as an annotation batch with selectors into your own HTML.
139
74
 
140
- A spec session is chamba's deepest use: a structured interview that produces a
141
- spec package - a canonical markdown draft, mockups, diagrams, and a decision log -
142
- in the same shared thread and the same annotation system.
143
- Open one with `--kind spec`:
144
-
145
- ```
146
- npx chamba@latest open --kind spec --title "checkout redesign spec"
147
- ```
75
+ ## The app tab
148
76
 
149
- This unlocks three surface tabs beside "Your app" - Draft, Mock, Diagram - each
150
- annotatable exactly like the app tab.
151
- You drive the session from the terminal with four commands (`ask`, `decision`,
152
- `artifact`, `export`); the human answers, points, and annotates from the browser.
77
+ The "Your app" tab frames the human's dev app for annotation; it needs chamba's client script inside that app.
78
+ When asked to set it up (the tab has a button that sends you the request), add the tag from the "not detected" banner - `<script src="<chamba-origin>/inject/annotate.js"></script>`, chamba-origin being the same host/port as the `open` URL - to the app's HTML entry or root layout, guarded to development.
79
+ Then have the app reloaded in the tab.
80
+ One-time per app.
153
81
 
154
- ### Intake: infer the kind of work, then confirm it
155
-
156
- A spec session opens with a free-form dump - text, pasted images, files.
157
- Read all of it, infer which of four kinds of spec work this is, and confirm your
158
- read with the human before diving in (they can override).
159
- Record the confirmed kind with `decision` so it is on the log.
160
-
161
- The four kinds are behaviorally distinct - they change what you do, not just a label:
162
-
163
- - **co-spec** - no spec exists yet; you build one from scratch.
164
- Start wide (goals, users, constraints, what success means), then converge; most
165
- of the work is net-new question cards and a draft that grows from nothing.
166
- - **review** - a spec or feature already exists and the human wants it pressure-tested.
167
- Read it first against the codebase, then lead with the gaps, contradictions, and
168
- unstated assumptions you find rather than with open-ended questions.
169
- - **refine** - a draft exists and is roughly right; the work is sharpening.
170
- Hunt vague terms, unclear edges, and missing error/empty/loading states,
171
- then propose precise wording and confirm it.
172
- - **feedback** - the human has a running thing and reactions to it.
173
- Lean on the Your app tab and annotations: turn each pointed-at problem into a
174
- decision and a draft revision.
175
-
176
- ### The interview doctrine
177
-
178
- - Hunt ambiguity relentlessly; every vague term ("fast", "simple", "secure") is a
179
- question waiting to be asked.
180
- - Assume the highest standard: when you offer options, mark the one you would
181
- choose as `recommended` and say why in its description.
182
- - Give development cost low weight - prefer quality, simplicity, robustness,
183
- scalability, and long-term maintainability; surface the trade-off and let the
184
- human decide.
185
- - Cross-reference every claim against the actual code as `path:line`; do not assert
186
- what the codebase does from memory.
187
- - Never let anything unresolved silently vanish: if you cannot get an answer,
188
- record it as an `assumed` decision so it surfaces as an open question.
189
- - The human can stop anytime; the card always carries a stop affordance, so honor it.
190
-
191
- ### Asking - question cards
192
-
193
- Post a structured question with `ask`.
194
- Options are structured (a label, a description, an optional `recommended` flag), so
195
- the card is passed as JSON - inline via `--json` or as a file path positional:
196
-
197
- ```
198
- npx chamba@latest ask --json '{
199
- "question": "How should an expired checkout session behave?",
200
- "options": [
201
- {"label": "Silent refresh", "description": "Start a new session, keep the cart, no interruption.", "recommended": true},
202
- {"label": "Prompt to resume", "description": "Show a resume dialog before restoring the cart."},
203
- {"label": "Hard reset", "description": "Discard the cart and start over."}
204
- ]
205
- }'
206
- ```
207
-
208
- Offer as many options as the question genuinely has (up to six); do not pad to a
209
- number, and do not collapse real choices to fit.
210
- You never add a "let me type my own" option or a "leave a note" option: the card
211
- always shows a free-text custom-answer field and always lets the human annotate
212
- their choice, with voice on both.
213
- The answer returns as a normal message on your next `poll` - there is no separate
214
- answer command - and `ask` fills in the card id for you.
215
-
216
- ### Recording decisions
217
-
218
- Every material choice goes on the decision log, marked `confirmed` (the human chose
219
- it) or `assumed` (you chose it provisionally on their behalf):
220
-
221
- ```
222
- npx chamba@latest decision --status confirmed --summary "Expired sessions refresh silently, cart preserved"
223
- npx chamba@latest decision --status assumed --summary "Guest checkout is in scope" --detail "Unconfirmed; revisit before finalizing"
224
- ```
225
-
226
- `assumed` entries are the ones that surface as open questions on export, so record
227
- them honestly rather than guessing silently.
228
-
229
- ### Building artifacts - draft, mock, diagram
230
-
231
- Publish a draft, mock, or diagram from a file with `artifact`; the matching surface
232
- tab renders it, annotatable like the app:
233
-
234
- ```
235
- npx chamba@latest artifact --kind draft --name spec --file /abs/spec.md
236
- npx chamba@latest artifact --kind mock --name checkout --file /abs/checkout.html
237
- npx chamba@latest artifact --kind diagram --name flow --file /abs/flow.mmd
238
- ```
239
-
240
- - `draft` is markdown (rendered), `mock` is HTML (served sandboxed with the
241
- annotation layer injected), `diagram` is mermaid.
242
- - Build the draft live: re-post the same `--kind draft --name <name>` as you write,
243
- and its tab reloads to the new revision each time - this is how the spec builds in
244
- front of the human.
245
- - Keep one draft name (e.g. `spec`) as the canonical draft; it becomes `spec.md` on
246
- export, and any other draft names land in `assets/`.
247
- - Mocks and diagrams are annotated through the same select -> comment -> card flow as
248
- the app tab; a batch of mock annotations arrives on `poll` just like app ones.
249
-
250
- ### Exporting the package
251
-
252
- Nothing leaves `.chamba/` automatically.
253
- When the spec is ready to be official, copy the self-contained package to a
254
- destination the human names (usually under `docs/`):
255
-
256
- ```
257
- npx chamba@latest export docs/checkout-spec
258
- ```
82
+ ## Ending
259
83
 
260
- This writes `spec.md` (the canonical draft), `assets/` (mocks and diagrams), and
261
- `decisions.md` (the log, grouped confirmed vs. assumed/open).
84
+ `npx chamba@latest end` - only when the human explicitly asks to stop or hand back, never on your own initiative.
262
85
 
263
86
  ## Notes
264
87
 
265
- - All commands talk to a local server that shares this container. Each project has
266
- its own server on a port derived from its `.chamba` location, so you never set a
267
- port by hand.
268
- - Presence is automatic and honest: a parked `poll` shows the agent as "here"
269
- (attending, waiting for input); the moment a poll returns carrying the human's
270
- message and you go act on it, the browser shows "working"; a reply or your next
271
- poll returns it to "here". It flips to "away" only after a long idle stretch with
272
- no poll, or promptly when the `poll` process exits (killed or crashed).
273
- - There is no channel from the browser back into your terminal: anything you print
274
- there is invisible to the human, so never break the `poll` loop to talk to them -
275
- keep it running for the whole life of the session. If the human wants you on a
276
- session you are not polling, they resume it from their side: by running `chamba
277
- attach <id>` in the terminal, or - when you are attending another session -
278
- clicking "Activate this session" in the browser, which you pick up as a `· You
279
- moved to another session` line and follow with `attach`.
280
- - The server shuts itself down after a spell with no browser open and no parked
281
- poll; the next `open`/`attach` starts a fresh one. Nothing sent is lost - it is
282
- durable on disk and re-delivered when you next `poll`. To stop it deliberately
283
- (for example before closing out the project), run `npx chamba@latest stop`.
284
- - Past sessions stay readable: `npx chamba@latest attach <id>` reloads any session's
285
- recent history.
88
+ - Each project has its own `.chamba/` workspace (created at the git root on first `open`) and its own server on a derived port; never set a port by hand.
89
+ - Presence is automatic: a parked poll shows "listening", a delivered batch flips to "working", a reply or the next poll flips back.
90
+ No poll parked shows "away".
91
+ - If the server crashed, a parked poll respawns it by itself; after a deliberate `stop` it exits cleanly.
92
+ Every message is durable on disk either way.
93
+ - Past sessions stay readable in the browser; an ended session opens read-only.
@@ -0,0 +1 @@
1
+ import{a as e,n as t,o as n,r,s as i,t as a}from"./index-B9DI4F1Z.js";var o=i(n(),1),s=e(),c=({code:e,language:n,raw:i,className:c,startLine:l,lineNumbers:u,...d})=>{let{shikiTheme:f}=(0,o.useContext)(r),p=t(),[m,h]=(0,o.useState)(i);return(0,o.useEffect)(()=>{if(!p){h(i);return}let t=p.highlight({code:e,language:n,themes:f},e=>{h(e)});t&&h(t)},[e,n,f,p,i]),(0,s.jsx)(a,{className:c,language:n,lineNumbers:u,result:m,startLine:l,...d})};export{c as HighlightedCodeBlockBody};