spequi 0.1.0 → 0.1.2

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.
@@ -8,18 +8,18 @@ There is no `await invokeSkill()` implementation. A skill is an instruction docu
8
8
 
9
9
  ## 1. The components
10
10
 
11
- | Component | Responsibility | Implementation |
12
- | --- | --- | --- |
13
- | Browser UI | Submit actions, display progress, collect answers | [public/lifecycle.js](../public/lifecycle.js), [src/studio-view.mjs](../src/studio-view.mjs) |
14
- | Local server | Protect browser mutations, route actions and replies, notify the UI | [src/server.mjs](../src/server.mjs) |
15
- | Lifecycle layer | Check readiness and enqueue the requested action | [src/lifecycle.mjs](../src/lifecycle.mjs) |
16
- | Job queue | Persist requests, claim ownership, choose workflows, store results | [src/jobs.mjs](../src/jobs.mjs) |
17
- | Agent CLI | Report a session, poll, ask, wait, log, finish or fail | [bin/spequi.mjs](../bin/spequi.mjs) |
18
- | Session evidence | Store credential-free agent/MCP reports and evaluate freshness | [src/agent-session.mjs](../src/agent-session.mjs) |
19
- | Question storage | Retain questions and answers on the same owned job | [src/job-dialogue.mjs](../src/job-dialogue.mjs) |
20
- | Agent skill | Instruct the current agent to coordinate the loop | [spequi SKILL.md](../skills/spequi/SKILL.md) |
21
-
22
- The browser talks to the server over local HTTP and receives WebSocket notifications. The agent's CLI commands communicate through project-local files. They do not send prompts over the browser's WebSocket connection.
11
+ | Component | Responsibility | Implementation |
12
+ | ---------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
13
+ | Browser UI | Submit actions, display progress, collect answers | [public/workflow.js](../public/workflow.js), [src/studio-view.mjs](../src/studio-view.mjs) |
14
+ | Local server | Protect browser mutations, route actions and replies, notify the UI | [src/server.mjs](../src/server.mjs) |
15
+ | Lifecycle layer | Check readiness and enqueue the requested action | [src/lifecycle.mjs](../src/lifecycle.mjs) |
16
+ | Job queue | Persist requests, claim ownership, choose workflows, store results | [src/jobs.mjs](../src/jobs.mjs) |
17
+ | Agent CLI | Report a session, poll, ask, wait, log, finish or fail | [bin/spequi.mjs](../bin/spequi.mjs) |
18
+ | Session evidence | Store credential-free agent/MCP reports and evaluate freshness | [src/agent-session.mjs](../src/agent-session.mjs) |
19
+ | Question storage | Retain questions and answers on the same owned job | [src/job-dialogue.mjs](../src/job-dialogue.mjs) |
20
+ | Agent skill | Instruct the current agent to coordinate the loop | [spequi SKILL.md](../skills/spequi/SKILL.md) |
21
+
22
+ The browser talks to the server over local HTTP and receives WebSocket notifications. The agent’s CLI commands use the project server’s authenticated loopback protocol when it is running. `.spequi/server.json` binds that connection to the project root; an unavailable saved connection is an explicit restart error. Headless commands without a server retain the file protocol. They do not send prompts over the browser's WebSocket connection.
23
23
 
24
24
  Typical retained state looks like:
25
25
 
@@ -27,6 +27,8 @@ Typical retained state looks like:
27
27
  .spequi/
28
28
  cli.mjs Project launcher for the initialized package
29
29
  server.mjs Project server launcher
30
+ server.json Private root-bound agent protocol connection
31
+ drafts/ Autosaved ideas and unfinished planning references
30
32
  agent.json Latest agent heartbeat
31
33
  agent-session.json Session ID and reported MCP metadata
32
34
  jobs/
@@ -89,14 +91,14 @@ const report = {
89
91
  agent,
90
92
  sessionId: id,
91
93
  reportedAt: Date.now(),
92
- mcps: { supported: mcps.supported, connections }
94
+ mcps: { supported: mcps.supported, connections },
93
95
  };
94
96
 
95
- await writeJSON(runtime(root, 'agent-session.json'), report);
96
- await writeJSON(runtime(root, 'agent.json'), {
97
+ await writeJSON(runtime(root, "agent-session.json"), report);
98
+ await writeJSON(runtime(root, "agent.json"), {
97
99
  agent,
98
100
  sessionId: id,
99
- at: Date.now()
101
+ at: Date.now(),
100
102
  });
101
103
  ```
102
104
 
@@ -104,38 +106,25 @@ Source: [`reportSession()`](../src/agent-session.mjs).
104
106
 
105
107
  This session ID belongs to the viewer attachment. It is not a provider API credential or an integration with the coding tool's internal conversation ID. The agent retains it and uses it on subsequent polls.
106
108
 
107
- ### Poll for work
109
+ ### Wait, then claim
108
110
 
109
111
  ```bash
110
- node .spequi/cli.mjs agent next \
111
- --wait 20 \
112
- --name Codex \
113
- --session-id example-attachment
112
+ node .spequi/cli.mjs agent wait --wait 300 \
113
+ --name Codex --session-id example-attachment
114
114
  ```
115
115
 
116
- The CLI checks for queued work once per second during that bounded wait. It returns immediately when it claims a job; otherwise it returns `{"job":null}` after the timeout. The agent then polls again while the skill remains active.
116
+ In GigaCode, launch this bounded wait and the retained server using the host Shell tool’s `is_background: true` argument. Keep the task ID and monitor the completion result. The wait refreshes consumer liveness and returns `available: true` when work is available, without claiming it. Once this session receives the output, claim in the foreground:
117
117
 
118
- The following is the actual polling structure, shortened to show the relevant branch:
119
-
120
- ```js
121
- const wait = Math.min(60, Math.max(0, Number(option('wait', 0)) || 0));
122
- const deadline = Date.now() + wait * 1000;
123
- let job;
124
-
125
- do {
126
- job = await claimNext(
127
- root,
128
- option('name', 'Skill agent'),
129
- option('session-id')
130
- );
131
- if (job || Date.now() >= deadline) break;
132
- await delay(1000);
133
- } while (true);
134
-
135
- print({ job });
118
+ ```bash
119
+ node .spequi/cli.mjs agent next --wait 0 \
120
+ --name Codex --session-id example-attachment
136
121
  ```
137
122
 
138
- Source: [`agent next` in the CLI](../bin/spequi.mjs).
123
+ A first-attachment `agent wait --wait 1` checks host completion delivery. If GigaCode does not resume the session automatically, use its task monitor or retained foreground polling; a background process alone cannot wake the model. Attachment lasts while the coding session remains open, including idle periods supported by that notification mechanism.
124
+
125
+ Waits are bounded at five minutes and check for work every 250 ms. An empty result includes queue state. Contention and blocked locks are errors, never an empty queue. An owned active request blocks additional claims. Finish or answer it before claiming another; review partial planning work before any retry.
126
+
127
+ Source: [agent CLI](../bin/spequi.mjs), [root-bound client](../src/agent-client.mjs), and [agent protocol routes](../src/server.mjs).
139
128
 
140
129
  ## 3. A UI action becomes a durable job
141
130
 
@@ -143,17 +132,17 @@ For example, a user requests an implementation preview. The browser submits the
143
132
 
144
133
  ```js
145
134
  // Simplified browser request. The selected change must already be ready.
146
- await fetch('/api/lifecycle/actions', {
147
- method: 'POST',
135
+ await fetch("/api/lifecycle/actions", {
136
+ method: "POST",
148
137
  headers: {
149
- 'Content-Type': 'application/json',
150
- Accept: 'application/json',
151
- 'X-CSRF-Token': document.querySelector('meta[name=csrf-token]').content
138
+ "Content-Type": "application/json",
139
+ Accept: "application/json",
140
+ "X-CSRF-Token": document.querySelector("meta[name=csrf-token]").content,
152
141
  },
153
142
  body: JSON.stringify({
154
- action: 'preview',
155
- change: 'example-change'
156
- })
143
+ action: "preview",
144
+ change: "example-change",
145
+ }),
157
146
  });
158
147
  ```
159
148
 
@@ -175,7 +164,7 @@ Source: [`requestLifecycle()`](../src/lifecycle.mjs) and [`createJob()` / `enque
175
164
 
176
165
  ## 4. Claiming establishes ownership and selects the skill
177
166
 
178
- `claimNext()` updates the heartbeat, acquires the queue lock and selects the oldest queued request. It changes the job to `running`, assigns a random claim token and records the agent attachment identity.
167
+ `claimNext()` updates the heartbeat, acquires the queue lock and selects the oldest queued request. It changes the job to `running`, assigns a random claim token and records the agent attachment identity. Only one workflow runs per project. The short claim releases the queue lock before snapshot copying or plan capture; preparation failures are retained as failed requests. Locks record their process owner and recover abandoned dead-owner or aged legacy empty files. Live lock contention remains explicit.
179
168
 
180
169
  The claim token is required for the agent's subsequent log, question, input and completion commands. A second agent cannot complete the same job just by knowing its ID.
181
170
 
@@ -183,18 +172,18 @@ The action-to-skill mapping currently includes:
183
172
 
184
173
  ```js
185
174
  const skillRoutes = {
186
- explore: { skill: 'openspec-explore', required: false },
187
- propose: { skill: 'openspec-propose', required: true },
188
- preview: { skill: 'openspec-apply-change', required: true },
189
- verify: { skill: 'openspec-verify-change', required: false },
190
- archive: { skill: 'openspec-archive-change', required: true },
175
+ explore: { skill: "openspec-explore", required: false },
176
+ propose: { skill: "openspec-propose", required: true },
177
+ preview: { skill: "openspec-apply-change", required: true },
178
+ verify: { skill: "openspec-verify-change", required: false },
179
+ archive: { skill: "openspec-archive-change", required: true },
191
180
  impact: { skill: null, required: false },
192
- 'update-specs': { skill: 'openspec-update-change', required: true },
193
- 'create-change': { skill: null, required: false },
194
- 'start-plan': { skill: null, required: false },
195
- 'plan-next': { skill: null, required: false },
196
- 'revise-plan': { skill: 'openspec-update-change', required: true },
197
- 'sync-specs': { skill: 'openspec-sync-specs', required: true }
181
+ "update-specs": { skill: "openspec-update-change", required: true },
182
+ "create-change": { skill: null, required: false },
183
+ "start-plan": { skill: null, required: false },
184
+ "plan-next": { skill: null, required: false },
185
+ "revise-plan": { skill: "openspec-update-change", required: true },
186
+ "sync-specs": { skill: "openspec-sync-specs", required: true },
198
187
  };
199
188
  ```
200
189
 
@@ -203,18 +192,17 @@ Full-plan `start-plan` requests use the proposal route. Next-artifact requests u
203
192
  After selecting the route, `claimNext()` constructs the workflow:
204
193
 
205
194
  ```js
206
- job.workingDirectory = job.action === 'preview'
207
- ? await createPreview(root, job.id)
208
- : root;
195
+ job.workingDirectory =
196
+ job.action === "preview" ? await createPreview(root, job.id) : root;
209
197
 
210
198
  job.workflow = {
211
- mode: 'same-session',
212
- ...(job.action === 'start-plan' && job.planMode === 'full'
199
+ mode: "same-session",
200
+ ...(job.action === "start-plan" && job.planMode === "full"
213
201
  ? skillRoutes.propose
214
202
  : skillRoutes[job.action]),
215
203
  directory: job.workingDirectory,
216
204
  protocolDirectory: root,
217
- change: job.change
205
+ change: job.change,
218
206
  };
219
207
 
220
208
  job.instructions = instructions(job);
@@ -269,10 +257,10 @@ The behavior contract lives in the [same-session routing section of the skill](.
269
257
 
270
258
  For an implementation preview:
271
259
 
272
- | Directory | What happens there |
273
- | --- | --- |
274
- | `workflow.directory` | Read the copied planning context, implement, install needed dependencies and run checks inside the isolated copy |
275
- | `workflow.protocolDirectory` | Run `agent log`, `ask`, `input`, `finish` and `fail` against the original project's queue |
260
+ | Directory | What happens there |
261
+ | ---------------------------- | ---------------------------------------------------------------------------------------------------------------- |
262
+ | `workflow.directory` | Read the copied planning context, implement, install needed dependencies and run checks inside the isolated copy |
263
+ | `workflow.protocolDirectory` | Run `agent log`, `ask`, `input`, `finish` and `fail` against the original project's queue |
276
264
 
277
265
  All implementation edits, including task checkboxes, stay inside the preview copy. The agent must re-resolve OpenSpec roots there and refuse paths that escape it. The snapshot is not an OS sandbox; the agent must honor that boundary.
278
266
 
@@ -327,21 +315,21 @@ const question = {
327
315
  id: randomUUID(),
328
316
  message: message.trim(),
329
317
  options,
330
- askedAt: new Date().toISOString()
318
+ askedAt: new Date().toISOString(),
331
319
  };
332
320
 
333
321
  (job.questions ||= []).push(question);
334
- job.status = 'awaiting-input';
322
+ job.status = "awaiting-input";
335
323
  ```
336
324
 
337
325
  The agent then waits with:
338
326
 
339
327
  ```bash
340
328
  node .spequi/cli.mjs agent input JOB_ID \
341
- --token CLAIM_TOKEN --wait 20
329
+ --token CLAIM_TOKEN --wait 300
342
330
  ```
343
331
 
344
- The CLI reads the job once per second until the status changes or the timeout expires. If it is still `awaiting-input`, the agent repeats the bounded wait. It does not release the job or make a second claim.
332
+ The CLI checks the owned job every 250 ms until the status changes or the bounded wait expires. If it is still `awaiting-input`, the agent repeats the bounded wait. It does not release the job or make a second claim.
345
333
 
346
334
  The user answers through this protected browser route:
347
335
 
@@ -354,7 +342,7 @@ POST /api/lifecycle/jobs/<job-id>/reply
354
342
  ```js
355
343
  question.answer = answer.trim();
356
344
  question.answeredAt = new Date().toISOString();
357
- job.status = 'running';
345
+ job.status = "running";
358
346
  ```
359
347
 
360
348
  The next `agent input` result contains that retained answer. The current agent reads it and resumes the same workflow. If the request is cancelled instead, the agent stops that work rather than continuing or waiting indefinitely. Browser reloads do not discard the question or answer because both are stored on the job.
@@ -390,13 +378,13 @@ node .spequi/cli.mjs agent fail JOB_ID \
390
378
  `updateJob()` checks the token and current state. It performs action-specific completion checks, such as requiring actual new planning artifacts, checking full-plan readiness, validating an impact report or freezing an implementation preview. It then persists the result:
391
379
 
392
380
  ```js
393
- job.status = 'completed';
394
- job.result = message || 'Completed';
381
+ job.status = "completed";
382
+ job.result = message || "Completed";
395
383
  ```
396
384
 
397
385
  The app waits for this explicit completion. It does not infer completion because the agent read a skill, produced a chat response, checked some task boxes, or stopped polling. The checks also do not prove every instruction was followed or every behavior is correct; verification and code review still matter.
398
386
 
399
- After finishing or failing, the agent returns to `agent next` while attached.
387
+ After finishing or failing, the agent returns to `agent wait`, then claims in the foreground while attached.
400
388
 
401
389
  Source: [`updateJob()`](../src/jobs.mjs).
402
390
 
@@ -410,7 +398,7 @@ const connected = Boolean(state && Date.now() - state.at < 45000);
410
398
 
411
399
  A recent heartbeat means the attachment has recently communicated. It does not prove a particular model request is progressing. Likewise, a missing heartbeat does not prove the coding process crashed: a long tool call or an agent that stopped running the loop can also make the attachment appear unresponsive.
412
400
 
413
- Polling and owned log/input/question calls refresh the heartbeat. The agent must keep communicating during work; the implementation does not start an independent background heartbeat daemon.
401
+ Polling and owned log/input/question calls refresh the heartbeat. A session report alone means connected, not ready. Ready additionally requires a current consumer wait lease; finishing or disconnecting that wait clears readiness. Working and awaiting-input states follow the owned request. The header exposes queued counts, last heartbeat and blocked/stalled ownership separately. The agent must keep communicating during work; the implementation does not start an independent background heartbeat daemon.
414
402
 
415
403
  MCP status is a separate report. The host must supply authoritative connection evidence; a configured server or a tool catalog alone is insufficient. Reports contain display names and allowed connection states, not credentials or transport configuration. MCP evidence also expires after five minutes and must match the current attachment.
416
404
 
@@ -437,7 +425,7 @@ sequenceDiagram
437
425
  participant Skill as Installed SKILL.md
438
426
 
439
427
  User->>Agent: Invoke spequi
440
- Agent->>App: agent report and agent next
428
+ Agent->>App: agent report and monitored agent wait
441
429
  User->>UI: Request a workflow
442
430
  UI->>App: POST lifecycle action
443
431
  App->>App: Persist queued job
@@ -451,7 +439,7 @@ sequenceDiagram
451
439
  App-->>UI: Question available
452
440
  par Agent waits
453
441
  loop While awaiting-input
454
- Agent->>App: agent input --wait 20
442
+ Agent->>App: agent input --wait 300
455
443
  App-->>Agent: Current question and status
456
444
  end
457
445
  and User answers
@@ -464,7 +452,46 @@ sequenceDiagram
464
452
  Agent->>App: agent finish or agent fail
465
453
  App->>App: Validate completion and persist result
466
454
  App-->>UI: Updated status and result
467
- Agent->>App: Return to agent next
455
+ Agent->>App: Return to monitored agent wait
468
456
  ```
469
457
 
470
458
  The queue, ownership, persistence, questions and status checks are application code. Carrying out a selected skill is the cooperating agent's work in its existing session. Keeping those responsibilities explicit explains both why the flow works across skill-capable coding tools and why it pauses when the agent stops serving the queue.
459
+
460
+ # Agent liveness and MCP reports
461
+
462
+ > Merge this section into your existing `docs/agent-workflow.md` (it already covers queue, skill routing and spec links).
463
+
464
+ The header's agent indicator reflects a recent agent heartbeat, independent of the browser's connection to the local server.
465
+ It distinguishes: live, working, awaiting an answer, not responding, and unattached.
466
+ Connection details show the last heartbeat and MCP metadata reported by the current session.
467
+
468
+ **Reconnect agent** opens instructions to resume the spequi skill in the same coding session, with a **Check connection** action.
469
+ Requests and answers stay saved. Spequi never restarts an agent automatically.
470
+
471
+ ## Reporting MCP status
472
+
473
+ The agent can write a credential-free report under `.spequi`, then run:
474
+
475
+ ```bash
476
+ node .spequi/cli.mjs agent report --file .spequi/session-report.json --name "Spequi Agent"
477
+ ```
478
+
479
+ ```json
480
+ {
481
+ "sessionId": "a-stable-random-id-for-this-attachment",
482
+ "mcps": {
483
+ "supported": true,
484
+ "connections": [{ "name": "Filesystem", "status": "connected" }]
485
+ }
486
+ }
487
+ ```
488
+
489
+ - Allowed statuses: `connected`, `disconnected`, `unavailable`, `unknown`.
490
+ - Only display names and statuses are accepted. Omit credentials, server URLs, environment variables and transport configuration.
491
+ - If the host cannot enumerate connection status, report `{"mcps":{"supported":false,"connections":[]}}`.
492
+ - A tool catalog or a configured server alone is not evidence of a healthy connection.
493
+ - Keep the returned session ID for refreshes, pass it as `agent next --session-id <id>`, and use the same agent name when polling.
494
+ - Refresh at least every five minutes or whenever connections change.
495
+ - Missing, expired or disconnected-session reports show as unknown, never as a fabricated count.
496
+ - The header shows **MCPs** when the session has not supplied evidence, and **0 MCPs** only when a fresh supported report confirms zero.
497
+ - Reporting does not replace serving the agent queue.
package/package.json CHANGED
@@ -1,23 +1,25 @@
1
1
  {
2
2
  "name": "spequi",
3
- "version": "0.1.0",
4
- "description": "A local workspace for planning, implementation previews, and OpenSpec code review",
3
+ "version": "0.1.2",
4
+ "description": "Local web UI for OpenSpec: plan specs with your coding agent, review spec-linked diffs, apply only what you approve.",
5
+ "keywords": [
6
+ "openspec",
7
+ "spec-driven-development",
8
+ "code-review",
9
+ "coding-agents",
10
+ "ai-agents",
11
+ "claude-code",
12
+ "codex",
13
+ "diff-viewer"
14
+ ],
15
+ "homepage": "https://github.com/rahulnjs/spequi#readme",
5
16
  "repository": {
6
17
  "type": "git",
7
18
  "url": "git+https://github.com/rahulnjs/spequi.git"
8
19
  },
9
- "homepage": "https://github.com/rahulnjs/spequi#readme",
10
20
  "bugs": {
11
21
  "url": "https://github.com/rahulnjs/spequi/issues"
12
22
  },
13
- "keywords": [
14
- "openspec",
15
- "code-review",
16
- "diff",
17
- "specifications",
18
- "htmx",
19
- "agents"
20
- ],
21
23
  "type": "module",
22
24
  "bin": {
23
25
  "spequi": "bin/spequi.mjs"
@@ -35,21 +37,27 @@
35
37
  "public/diff.css",
36
38
  "public/review.css",
37
39
  "public/review.js",
38
- "public/lifecycle.css",
39
- "public/lifecycle.js",
40
+ "public/workflow.js",
40
41
  "public/studio.css",
41
42
  "public/studio.js",
42
43
  "skills/",
43
44
  "templates/",
44
45
  "README.md",
46
+ "CHANGELOG.md",
45
47
  "LICENSE",
46
48
  "public/session.js",
47
- "docs/agent-workflow.md"
49
+ "docs/agent-workflow.md",
50
+ "public/requests.js"
48
51
  ],
49
52
  "scripts": {
50
53
  "prepublishOnly": "npm run check",
51
54
  "start": "node bin/spequi.mjs start",
52
- "check": "node --check bin/spequi.mjs && node --check src/server.mjs && node --check src/project.mjs && node --check src/openspec-cli.mjs && node --check src/spec-context.mjs && node --check src/spec-context-view.mjs && node --check templates/cli.mjs && node --check public/app.js && node --check public/review.js && node --check public/lifecycle.js && node --check public/studio.js && node --check src/studio-view.mjs && node --check src/studio-plans.mjs && node --check src/studio-documents.mjs && node --check src/creation-view.mjs && node --check src/commands.mjs && node --check src/agent-session.mjs && node --check public/session.js"
55
+ "check": "node --check bin/spequi.mjs && node --check src/server.mjs && node --check src/project.mjs && node --check src/openspec-cli.mjs && node --check src/spec-context.mjs && node --check src/spec-context-view.mjs && node --check templates/cli.mjs && node --check public/app.js && node --check public/review.js && node --check public/workflow.js && node --check public/studio.js && node --check src/studio-view.mjs && node --check src/studio-plans.mjs && node --check src/studio-documents.mjs && node --check src/creation-view.mjs && node --check src/commands.mjs && node --check src/agent-session.mjs && node --check public/session.js && node --check src/files.mjs && node --check src/jobs.mjs && node --check src/drafts.mjs && node --check src/requests.mjs && node --check src/agent-client.mjs && node --check src/workspace-state.mjs && node --check public/requests.js",
56
+ "test": "node --test test/*.test.mjs",
57
+ "check:package": "node scripts/check-package.mjs",
58
+ "smoke:package": "node scripts/smoke-package.mjs",
59
+ "smoke:npx": "node scripts/smoke-npx.mjs",
60
+ "prepare:test-cli": "node scripts/prepare-test-cli.mjs"
53
61
  },
54
62
  "engines": {
55
63
  "node": ">=20"
@@ -68,5 +76,8 @@
68
76
  "marked": "^17.0.1",
69
77
  "shiki": "^4.6.0",
70
78
  "ws": "^8.18.3"
79
+ },
80
+ "devDependencies": {
81
+ "linkedom": "^0.18.12"
71
82
  }
72
83
  }
package/public/app.css CHANGED
@@ -33,10 +33,17 @@
33
33
  .diff-version-form select{font-size:10px;max-width:220px;padding:7px 24px 7px 8px}
34
34
  .generate-diff-form{margin:0}
35
35
  .generate-diff-form .button{white-space:nowrap}
36
- .diff-empty-state .empty-state{max-width:720px;min-height:430px}
37
- .diff-empty-state .empty-state>svg{width:38px;height:38px}
38
- .diff-attach-hint{font-size:11px!important;line-height:1.8!important;max-width:50ch!important;margin-top:18px!important}
39
- .diff-attach-hint code{font-size:10px;white-space:nowrap}
36
+ .diff-empty-state{display:flex;align-items:center;justify-content:center;flex:1;min-width:0;padding:32px 16px}
37
+ .diff-empty-state .empty-state{width:100%;max-width:560px;min-height:0;padding:24px 20px}
38
+ .diff-empty-state .empty-state>svg{width:30px;height:30px;margin-bottom:16px}
39
+ .diff-empty-state .empty-state h2{font-size:22px;line-height:1.3;margin:0 0 10px;text-wrap:balance}
40
+ .diff-empty-state .empty-state>p{font-size:13px;line-height:1.7;margin:0;max-width:52ch}
41
+ .diff-empty-actions{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:20px}
42
+ .diff-empty-actions form{margin:0}
43
+ .diff-empty-actions .button{min-height:36px;padding:8px 12px;font-size:12px;line-height:18px}
44
+ .diff-empty-state .empty-state>.diff-agent-note{margin-top:16px;font-size:11px;line-height:1.6}
45
+ .diff-empty-state .empty-state>.error-message{margin-top:16px;font-size:12px;text-align:left;padding:10px 12px}
46
+ .diff-empty-state [role=status]:empty{display:none}
40
47
  .diff-generation-status{width:100%;max-width:55ch;background:var(--panel);padding:15px;margin-top:18px;text-align:left;border-radius:6px}
41
48
  .diff-generation-status p{font-size:11px;line-height:1.7;margin:8px 0 0}
42
49
  .diff-pending-note{font-size:11px;margin-top:12px!important}
@@ -54,9 +61,111 @@
54
61
  .split-diff-table .addition{background:var(--green-bg);color:var(--green)}
55
62
  .split-diff-table .deletion{background:var(--red-bg);color:var(--red)}
56
63
  .split-diff-table .diff-gap{background:var(--panel)}
57
- @media(max-width:760px){.changed-files-nav{max-height:45dvh}.file-review-intro{padding:20px 16px}.diff-version-form select{max-width:210px}.diff-empty-state .empty-state{min-height:360px;padding:35px 22px}.file-review-intro .preview-actions{gap:8px}.file-review-intro .preview-actions>span{flex-basis:100%;margin-bottom:2px}.file-review-intro .button{min-height:36px}}
64
+ @media(max-width:760px){.changed-files-nav{max-height:45dvh}.file-review-intro{padding:20px 16px}.diff-version-form select{max-width:210px}.diff-empty-state{padding:24px 12px}.diff-empty-state .empty-state{padding:20px 8px}.diff-empty-actions .button{min-height:44px}.file-review-intro .preview-actions{gap:8px}.file-review-intro .preview-actions>span{flex-basis:100%;margin-bottom:2px}.file-review-intro .button{min-height:36px}}
58
65
  /* Markdown task checkboxes stay legible even though they are read-only. */
59
66
  .prose input[type=checkbox]{appearance:none;-webkit-appearance:none;display:inline-grid;place-content:center;inline-size:15px;block-size:15px;padding:0;border:1px solid var(--muted);border-radius:3px;background:var(--surface);opacity:1;vertical-align:-2px}
60
67
  .prose input[type=checkbox]:checked{border-color:var(--green);background:var(--green)}
61
68
  .prose input[type=checkbox]:checked::after{content:"";display:block;inline-size:12px;block-size:12px;background:var(--surface);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.5 3.5 3.5L13 4.5' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.5 3.5 3.5L13 4.5' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat}
62
69
  @media(forced-colors:active){.prose input[type=checkbox],.prose input[type=checkbox]:checked{appearance:auto;-webkit-appearance:auto;background:Canvas;color:CanvasText;border-color:CanvasText}.prose input[type=checkbox]:checked::after{content:none}}
70
+ /* Requests and saved ideas extend the existing desktop workspace. */
71
+ .requests-toggle{gap:7px;font-size:12px}.requests-icon{position:relative;display:inline-flex;align-items:center;flex-shrink:0}.requests-icon>svg{width:16px;height:16px}.requests-icon .requests-attention{position:absolute;top:-3px;right:-3px;width:8px;height:8px;border:2px solid var(--surface);border-radius:50%;background:var(--red);font-size:0;overflow:hidden}.requests-attention[hidden]{display:none}
72
+ [data-drafts-navigation]:not([hidden]){margin-bottom:24px}.nav-change [data-job-state]:empty{display:none}.nav-change [data-job-state]:not(:empty){color:var(--accent-text);font-size:10px;margin-top:3px}
73
+ .requests-panel{position:fixed;z-index:80;right:16px;top:64px;width:min(440px,calc(100vw - 32px));max-height:min(640px,calc(100dvh - 80px));background:var(--surface);border:1px solid var(--line);border-radius:10px;display:flex;flex-direction:column;overflow:hidden}
74
+ .requests-panel[hidden],.requests-panel [hidden]{display:none}
75
+ .requests-panel>header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:54px;padding:10px 14px;border-bottom:1px solid var(--line);flex-shrink:0}
76
+ .requests-panel h2{font-size:15px;font-weight:600;margin:0;line-height:1.4}
77
+ .requests-tools{display:flex;align-items:center;gap:8px;min-width:0}
78
+ .requests-tools select{width:130px;min-height:30px;padding:5px 25px 5px 9px;font-size:11px;line-height:18px;background:var(--panel);border-color:transparent;border-radius:5px}
79
+ .requests-panel .icon-button{display:inline-flex;align-items:center;justify-content:center;width:28px;min-height:28px;padding:5px;border:0;border-radius:5px;background:transparent;color:var(--muted)}
80
+ .requests-panel .icon-button:hover{background:var(--rail);color:var(--text)}
81
+ .requests-panel .icon-button svg{width:16px;height:16px}
82
+ .requests-panel [data-request-list]{overflow:auto;min-height:0;overscroll-behavior:contain;scrollbar-color:var(--line) var(--surface)}
83
+ .requests-panel>footer{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:34px;padding:5px 14px;border-top:1px solid var(--line);background:var(--panel);color:var(--muted);font-size:11px;flex-shrink:0;font-variant-numeric:tabular-nums}
84
+ .requests-panel>footer nav{display:flex;gap:4px}
85
+ .requests-panel [data-request-page=previous] svg{transform:rotate(180deg)}
86
+ .requests-panel [data-requests-feedback]:not(:empty){padding:10px 14px;margin:0;border-bottom:1px solid var(--line);font-size:12px;line-height:1.6}
87
+ .requests-loading{padding:32px 16px;margin:0;text-align:center;font-size:12px;color:var(--muted)}
88
+ .request-row{padding:12px 14px;border-top:1px solid var(--line)}
89
+ .request-row:first-child{border-top:0}
90
+ .request-heading{display:flex;justify-content:space-between;gap:12px;align-items:center}
91
+ .request-heading strong{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;line-height:20px}
92
+ .request-state{display:inline-flex;align-items:center;gap:5px;padding:2px 6px;border-radius:4px;background:var(--panel);color:var(--muted);font-size:10px;font-weight:500;line-height:16px;white-space:nowrap;flex-shrink:0}
93
+ .request-state::before{content:"";width:4px;height:4px;border-radius:50%;background:currentColor;flex-shrink:0}
94
+ .request-state[data-state=completed]{background:var(--green-bg);color:var(--green)}
95
+ .request-state[data-state=failed],.request-state[data-state=stalled]{background:var(--red-bg);color:var(--red)}
96
+ .request-state[data-state=running],.request-state[data-state=awaiting-input]{background:var(--accent-soft);color:var(--accent-text)}
97
+ .request-row details{min-width:0;font-size:12px;line-height:1.65;overflow-wrap:anywhere}
98
+ .request-row summary{display:flex;align-items:flex-start;gap:8px;min-height:24px;margin:6px 0 4px;padding:2px 0;list-style:none;cursor:pointer;color:var(--muted);border-radius:3px}
99
+ .request-row summary::-webkit-details-marker{display:none}
100
+ .request-summary-text{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
101
+ .request-row summary:hover{color:var(--text)}
102
+ .request-row summary .request-action-icon{margin-top:3px}
103
+ .request-row summary svg{width:12px;height:12px;transition:transform .15s}
104
+ .request-row details[open] summary svg{transform:rotate(90deg)}
105
+ .request-row details[open] .request-summary-text{white-space:pre-wrap;color:var(--text)}
106
+ .request-detail-body{padding:2px 0 6px}
107
+ .request-detail-body h3{font-size:11px;font-weight:600;color:var(--muted);margin:8px 0 4px}
108
+ .request-detail-body ol{max-height:160px;overflow:auto;padding-left:18px;margin:4px 0 10px;color:var(--muted);font-size:11px}
109
+ .request-detail-body li+li{margin-top:4px}
110
+ .request-result{white-space:pre-wrap;max-height:200px;overflow:auto;margin:4px 0;font-size:12px}
111
+ .request-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
112
+ .request-meta{display:flex;align-items:center;min-width:0;flex:1 1 130px;color:var(--muted);font-size:11px;line-height:18px}
113
+ .request-kind{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
114
+ .request-meta time{white-space:nowrap;flex-shrink:0;font-variant-numeric:tabular-nums}
115
+ .request-meta time::before{content:"·";padding:0 6px}
116
+ .request-controls{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
117
+ .request-controls .button{font-size:11px;padding:4px 6px;min-height:28px;border-color:transparent;background:transparent;white-space:nowrap;line-height:18px}
118
+ .request-controls .button:hover{background:var(--rail)}
119
+ .request-controls .request-open{gap:4px;color:var(--accent-text)}
120
+ .request-controls .request-open:hover{background:var(--accent-soft)}
121
+ .request-action-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
122
+ .request-controls .request-delete,.request-controls .request-dismiss{width:28px;padding:5px;color:var(--muted)}
123
+ .request-controls .request-delete:hover{color:var(--red);background:var(--red-bg)}
124
+ .request-controls .request-delete:focus-visible{outline-color:var(--red)}
125
+ .request-group-count{font-size:10px;color:var(--muted);white-space:nowrap;flex-shrink:0}
126
+ .requests-section-title{font-size:11px;font-weight:600;color:var(--muted);margin:0;padding:10px 14px 2px}
127
+ .requests-section-title+.request-row{border-top:0}
128
+ .requests-recent{border-top:1px solid var(--line)}
129
+ .requests-recent>summary{display:flex;align-items:center;gap:8px;cursor:pointer;list-style:none;padding:10px 14px;font-size:12px;font-weight:550;color:var(--muted)}
130
+ .requests-recent>summary::-webkit-details-marker{display:none}
131
+ .requests-recent>summary:hover{background:var(--panel);color:var(--text)}
132
+ .requests-recent>summary small{margin-left:auto;font-size:10px;font-weight:400;font-variant-numeric:tabular-nums}
133
+ .requests-recent>summary svg{width:12px;height:12px;transition:transform .15s}
134
+ .requests-recent[open]>summary svg{transform:rotate(90deg)}
135
+ .requests-recent>.request-row:nth-child(2){border-top:0}
136
+ .request-controls .request-dismiss:hover{background:var(--rail);color:var(--text)}
137
+ .requests-empty{max-width:300px;margin:32px auto;padding:0 24px;text-align:center;color:var(--muted)}
138
+ .requests-empty-icon{display:block;margin-bottom:12px}
139
+ .requests-empty h3{font-size:15px;font-weight:600;color:var(--text);margin:0 0 8px}
140
+ .requests-empty p{font-size:12px;line-height:1.65;margin:0;text-wrap:pretty}
141
+ .requests-empty .button{margin-top:16px}
142
+ @media(max-width:520px){.requests-panel{right:8px;width:calc(100vw - 16px);max-height:calc(100dvh - 72px)}.requests-tools select{font-size:12px;min-height:36px}.requests-panel .icon-button,.request-controls .button{min-height:36px}.requests-panel .icon-button,.request-controls .request-delete,.request-controls .request-dismiss{width:36px}.request-meta{font-size:11px}.request-row summary{font-size:13px}}
143
+ @media(pointer:coarse){.requests-panel .icon-button,.request-controls .button,.requests-tools select{min-height:44px}.requests-panel .icon-button,.request-controls .request-delete,.request-controls .request-dismiss{width:44px}.request-row summary{min-height:36px}}
144
+ #request-delete-dialog label,#draft-delete-dialog label{display:flex;align-items:start;gap:9px;line-height:1.6}#draft-delete-dialog [hidden]{display:none}#request-delete-dialog input,#draft-delete-dialog input{margin-top:4px}
145
+ .studio-message form .button{margin-top:12px}.studio-action .text-button,.studio-change-summary .text-button{padding:7px 10px;min-height:32px}.studio-creation-scroll [data-draft-delete]{margin:8px 0 16px}.studio-header>[data-draft-delete]{margin-left:auto;font-size:11px;white-space:nowrap}
146
+
147
+ .studio-creation-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.studio-creation-actions form{margin:0}.studio-creation-actions .button{width:auto;white-space:nowrap}
148
+ /* Destructive actions share one treatment in toolbars and confirmation dialogs. */
149
+ .button.danger{color:var(--red);border-color:color-mix(in srgb,var(--red) 45%,var(--line));background:var(--surface)}
150
+ .button.danger:hover{background:var(--red-bg);border-color:var(--red)}
151
+ .button.danger-solid{color:var(--surface);border-color:var(--red);background:var(--red)}
152
+ .button.danger-solid:hover{background:color-mix(in srgb,var(--red) 88%,var(--text));border-color:var(--red)}
153
+ .button.danger:focus-visible,.button.danger-solid:focus-visible{outline-color:var(--red)}
154
+ #toast{z-index:100;display:flex;align-items:center;gap:16px;line-height:1.6}
155
+ #toast.visible{pointer-events:auto}#toast a{color:inherit;text-decoration:underline;text-underline-offset:3px;white-space:nowrap}
156
+
157
+ .new-change-link{margin-bottom:16px;justify-content:center}
158
+ .sidebar-community{margin-top:auto;padding:20px 8px 4px;font-size:11px;line-height:1.6}
159
+ .sidebar-community-invite{display:flex;align-items:center;gap:10px;padding:12px 0;border-top:1px solid var(--line);color:var(--text);text-decoration:none}
160
+ .sidebar-community-invite>svg{flex-shrink:0;width:17px;height:17px;color:var(--muted)}
161
+ .sidebar-community-invite>svg:last-child{margin-left:auto;width:14px;height:14px;transition:transform .15s ease}
162
+ .sidebar-community-invite strong{display:block;font-size:12px;font-weight:550}
163
+ .sidebar-community-invite small{display:block;margin-top:2px;font-size:10px;color:var(--muted)}
164
+ .sidebar-community-invite:hover{color:var(--accent-text)}
165
+ .sidebar-community-invite:hover>svg:last-child{transform:translateX(3px)}
166
+ .sidebar-community-credit{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--muted);font-size:10px}
167
+ .sidebar-community-credit a{color:inherit;text-decoration:none;text-underline-offset:3px}
168
+ .sidebar-community-credit a:hover{color:var(--accent-text);text-decoration:underline}
169
+ @media(prefers-reduced-motion:reduce){.sidebar-community-invite>svg:last-child{transition:none;transform:none}}
170
+ .preview-blocker{font-size:11px;color:var(--muted);line-height:1.6;margin:7px 0 12px}
171
+ .guided-file-actions{gap:12px;flex-wrap:wrap}.guided-file-actions>span{margin-right:auto}.guided-file-actions .preview-followup{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.guided-file-actions .preview-blocker{flex-basis:100%;margin:0}