@lysyi3m/sidecar 1.6.0 → 1.7.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.
package/README.md CHANGED
@@ -33,48 +33,58 @@ measurement.
33
33
 
34
34
  ## How it works
35
35
 
36
- ```mermaid
37
- flowchart LR
38
- user(("You"))
39
- driver["Driver<br/>Claude Code, Codex or<br/>the Claude desktop app"]
40
- ws[/"Workspace"/]
41
- nav["Navigator<br/>headless, read-only"]
42
-
43
- subgraph sidecar
44
- mcp["MCP server<br/>one per CLI session or desktop app"]
45
- runner["Runner<br/>one per turn"]
46
- store[("Case log<br/>~/.sidecar/cases")]
47
- end
48
- dash["Dashboard<br/>user service"]
49
-
50
- user -- "prompt" --> driver
51
- driver -- "open, ask, record, close" --> mcp
52
- mcp -- "starts" --> runner
53
- runner -- "one turn" --> nav
54
- mcp <-- "events" --> store
55
- runner -- "turn events" --> store
56
- store --> dash
57
- user -- "browser" --> dash
58
- driver -- "edits" --> ws
59
- nav -. "reads" .-> ws
36
+ ```text
37
+ prompt
38
+ You ───────────────────────────────> Driver ──── edits ────> Workspace
39
+ │ Claude Code, Codex or ^
40
+ │ the Claude desktop app ╎ reads
41
+ │ │ ╎
42
+ │ │ open, ask, record, close ╎
43
+ │ │ ╎
44
+ │ ┌─ sidecar ────────────────────┼────────────────┐ ╎
45
+ │ │ v │ ╎
46
+ │ │ Case log <──── events ───> MCP server │ ╎
47
+ │ │ ~/.sidecar/cases one per session │ ╎
48
+ │ │ │ ^ │ │ ╎
49
+ │ │ │ │ turn events │ starts │ ╎
50
+ │ │ │ │ v │ one turn ╎
51
+ │ │ │ └──────────────────── Runner ──────────┼─────> Navigator
52
+ │ │ │ one per turn │ headless, read-only
53
+ │ │ │ │
54
+ │ └────┼──────────────────────────────────────────┘
55
+ │ v
56
+ └────────> Dashboard user service
57
+ browser
60
58
  ```
61
59
 
62
60
  One ask:
63
61
 
64
- ```mermaid
65
- sequenceDiagram
66
- participant D as Driver
67
- participant S as sidecar
68
- participant N as Navigator
69
- D->>S: sidecar_ask(claim and path:line evidence)
70
- S->>N: start or resume the navigator session: one headless turn
71
- N-->>N: read the workspace
72
- N->>S: opinion: verdict, points, limits, reviews
73
- S->>D: opinion, or pending, busy, failed
74
- D->>S: sidecar_record(a decision on each point)
75
- Note over D,N: the next ask, or sidecar_review, shows the decisions to the navigator,<br/>which confirms, reopens or holds each point
62
+ ```text
63
+ Driver sidecar Navigator
64
+ │ │ │
65
+ │ sidecar_ask: a claim │ │
66
+ │ with path:line evidence │ │
67
+ │ ──────────────────────────> │ │
68
+ │ │ start or resume the │
69
+ │ │ session: one headless turn │
70
+ │ │ ──────────────────────────> │
71
+ │ │ │ ─┐ reads the
72
+ │ │ │ <┘ workspace
73
+ │ │ opinion: verdict, points, │
74
+ │ │ limits, reviews │
75
+ │ │ <────────────────────────── │
76
+ │ opinion, or pending, │ │
77
+ │ busy, failed │ │
78
+ │ <────────────────────────── │ │
79
+ │ sidecar_record: a │ │
80
+ │ decision on each point │ │
81
+ │ ──────────────────────────> │ │
82
+ │ │ │
76
83
  ```
77
84
 
85
+ The next ask, or `sidecar_review`, shows the decisions to the navigator, which confirms, reopens or
86
+ holds each point.
87
+
78
88
  - **On demand.** The navigator runs only while it answers. Between asks nothing runs.
79
89
  - **Bounded.** Every wait has a limit. An ask returns `pending` after its budget (240 s, 45 s for
80
90
  the Claude desktop app), and the driver keeps waiting with `sidecar_wait`. A turn ends after 15
@@ -3,6 +3,7 @@ import { effortLabel, modelLabel } from "../adapters/index.js";
3
3
  import { html, raw } from "./html.js";
4
4
  import { MARKS, markUrl } from "./marks.js";
5
5
  import { decisionState, flagsOf, reviewsOf } from "../cases/items.js";
6
+ import { SIDECAR_VERSION } from "../lib/version.js";
6
7
  import { foundNothingToReview } from "../turns/prompt.js";
7
8
  // The dashboard's markup, rendered on the server from the view model. Every element the live
8
9
  // stream may replace carries a stable id: the case header, and one id per timeline entry.
@@ -143,10 +144,10 @@ function shell(opts) {
143
144
  <link rel="stylesheet" href="/assets/app.css">
144
145
  <script type="module" src="/assets/app.js"></script>
145
146
  </head>
146
- <body>
147
+ <body data-sidecar-version="${SIDECAR_VERSION}">
147
148
  <div class="shell${opts.chrome.collapsed ? " is-collapsed" : ""}">
148
149
  <aside class="sidebar">
149
- <div class="sidebar-head"><a class="brand" href="/">${BRAND_MARK}sidecar</a></div>
150
+ <div class="sidebar-head"><a class="brand" href="/">${BRAND_MARK}sidecar</a><span class="brand-version">v${SIDECAR_VERSION}</span></div>
150
151
  ${sideList(opts.cases, opts.activeCase)}
151
152
  </aside>
152
153
  <main class="main"><div class="page">
@@ -227,7 +228,8 @@ export function casePage(model, cases, chrome = { collapsed: false }) {
227
228
  const content = html `${caseHead(model)}
228
229
  ${brief(model)}
229
230
  <p class="message problem" role="alert" data-problem hidden></p>
230
- <div class="timeline" id="timeline" data-stream="/api/cases/${model.caseId}/stream?after=${last}">${timelineUnits(model).map((u) => u.html)}</div>`;
231
+ <div class="timeline" id="timeline" data-stream="/api/cases/${model.caseId}/stream?after=${last}">${timelineUnits(model).map((u) => u.html)}</div>
232
+ <div class="to-top" data-to-top><a class="ref" href="#top">↑ Back to top</a></div>`;
231
233
  return shell({
232
234
  title: `${String(opened.title)} — sidecar`,
233
235
  cases,
@@ -119,6 +119,13 @@ button {
119
119
  text-decoration: none;
120
120
  }
121
121
 
122
+ .brand-version {
123
+ margin-left: 8px;
124
+ font-family: var(--font-mono);
125
+ font-size: 12px;
126
+ color: var(--ink-3);
127
+ }
128
+
122
129
  /* The mark: two linked squares — a driver and its navigator. */
123
130
  .brand-mark {
124
131
  width: 18px;
@@ -187,12 +194,39 @@ button {
187
194
  }
188
195
 
189
196
  .page {
197
+ --page-gap: 22px;
198
+ --page-end: 96px;
199
+ --entry-end: 16px;
200
+ --service-end: 10px;
190
201
  max-width: 1080px;
191
202
  margin: 0 auto;
192
- padding: 26px 32px 96px;
203
+ padding: 26px 32px var(--page-end);
193
204
  display: flex;
194
205
  flex-direction: column;
195
- gap: 22px;
206
+ gap: var(--page-gap);
207
+ }
208
+
209
+ /*
210
+ * A link back to the top of a long case. It fills the empty band between the last entry and the
211
+ * end of the page, centred in it, without making the page taller: the top margin takes back the
212
+ * flex gap and the last entry's bottom padding, the bottom margin the page's end padding. It shows
213
+ * only once the timeline holds more than 10 entries; CSS counts them, so streamed entries count too.
214
+ */
215
+ .to-top {
216
+ --last-end: var(--entry-end);
217
+ display: none;
218
+ align-items: center;
219
+ justify-content: center;
220
+ height: calc(var(--last-end) + var(--page-end));
221
+ margin: calc(-1 * (var(--page-gap) + var(--last-end))) 0 calc(-1 * var(--page-end));
222
+
223
+ .timeline:has(> .entry.service:last-child) + & {
224
+ --last-end: var(--service-end);
225
+ }
226
+
227
+ .timeline:has(> .entry:nth-child(11)) + & {
228
+ display: flex;
229
+ }
196
230
  }
197
231
 
198
232
  .topbar {
@@ -772,7 +806,7 @@ tbody td:first-child {
772
806
  }
773
807
 
774
808
  .entry-body {
775
- padding: 6px 0 16px;
809
+ padding: 6px 0 var(--entry-end);
776
810
  min-width: 0;
777
811
  }
778
812
 
@@ -993,7 +1027,7 @@ tbody td:first-child {
993
1027
  }
994
1028
 
995
1029
  .entry.service .entry-body {
996
- padding: 0 0 10px;
1030
+ padding: 0 0 var(--service-end);
997
1031
  }
998
1032
 
999
1033
  .entry.service .marker {
@@ -1053,7 +1087,8 @@ tbody td:first-child {
1053
1087
  }
1054
1088
 
1055
1089
  .page {
1056
- padding: 18px 16px 72px;
1090
+ --page-end: 72px;
1091
+ padding: 18px 16px var(--page-end);
1057
1092
  }
1058
1093
 
1059
1094
  /* The time moves from its gutter onto a line of its own above the entry. */
@@ -118,6 +118,7 @@ async function exportCase(caseId) {
118
118
  const page = document.querySelector(".page").cloneNode(true);
119
119
  page.querySelector(".topbar")?.remove();
120
120
  page.querySelector("[data-problem]")?.remove();
121
+ page.querySelector("[data-to-top]")?.remove();
121
122
  for (const node of page.querySelectorAll("[data-stream], [data-refresh]")) {
122
123
  node.removeAttribute("data-stream");
123
124
  node.removeAttribute("data-refresh");
@@ -136,7 +137,8 @@ async function exportCase(caseId) {
136
137
  }
137
138
  const note = document.createElement("footer");
138
139
  note.className = "export-note";
139
- note.textContent = `Exported from sidecar on ${utc(new Date().toISOString())}.`;
140
+ const version = document.body.dataset.sidecarVersion;
141
+ note.textContent = `Exported from sidecar v${version} on ${utc(new Date().toISOString())}.`;
140
142
  page.append(note);
141
143
 
142
144
  const file = document.implementation.createHTMLDocument(document.title);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lysyi3m/sidecar",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Lets one coding agent consult another mid-task: a driver asks, a read-only navigator answers",
5
5
  "license": "MIT",
6
6
  "repository": {