@dreb/coding-agent 2.66.1 → 2.66.3

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/docs/dashboard.md CHANGED
@@ -132,8 +132,8 @@ networking window above.
132
132
 
133
133
  | Screen | What it does |
134
134
  |---|---|
135
- | **Fleet** | Home. Live-first: one grid of every live session at the top — status chip (● running / ◆ needs-attention / ○ idle / ✕ error), project path, activity line, live subagent lines, tasks progress, ctx%, model, terminal provider-error reason, last activity. Live cards keep a deterministic order by project path, then session start time; needs-attention cards badge the browser tab without jumping around. Below the grid: past sessions grouped by project, three compact rows per group with an "all N on disk" expander, resume and delete. |
136
- | **Session view** | Full chat drill-in. Markdown streaming transcript (text, thinking blocks with expand preference, inline provider/API failures with partial output preserved, agent-result cards, tool cards with bespoke read/write/edit/bash bodies plus full expandable inputs, markdown-rendered results for markdown-contract tools like subagent/skill/web_fetch/suggest_next, and inline tool-result images, compaction/branch summaries, custom messages), per-message copy, tasks panel, a bounded scrollable subagent panel that lists every retained agent newest-first with full running/done counts, a shared dismissible banner region for model fallback, extension notices, retry/compaction/paused/provider status, and local action results, a controls-only dock line with elapsed time plus ■ stop and explicitly labelled retry/compaction aborts, a persistent session-header live indicator, and an info bar with cwd, branch, session name, token breakdown, cost/(sub)/daily rollup, ctx%, a TUI-parity latest-100 median TPS indicator (`~31 tok/s [100] · 10% ↑ median [10000]`), and a stats popover. A fleet sidebar lists every other live session beside the transcript with the fleet cards' project, status/reasons, activity/latest-assistant preview, running/done subagent summaries, task progress, model, context, cost, message count, and last activity, deterministically ordered by project path then session start time (the fleet page's comparator), so needs-attention/error entries are emphasized — a filled attention chip or outlined error chip plus an entry border — without moving position; clicking an entry navigates to that session, desktop collapse and pointer/keyboard-resizable width persist browser-locally (default expanded, 260px), the hidden toggle border reflects the highest-priority other-session status, and neither sidebar nor toggle renders when no other live sessions exist. The subagent drill-in shows the same sidebar with its parent session excluded. Composer supports auto-grow, history, `/` autocomplete from `get_commands`, image attach/paste with sent images retained as user-message previews, queued-message chips with restore-all, steer/follow-up modes, and suggest-next. Registered built-in slash commands are discovered generically, deduplicated ahead of colliding resource commands, and intercepted before prompting: dashboard actions cover settings, model, scoped-models, export/import, name/session stats, fork/tree, new/compact/dream, resume/reload, and quit. `/scoped-models` deep-links to the Settings editor with the session's current cwd as project context; login/logout show an explicit not-yet-implemented notice, while copy/hotkeys/buddy give terminal-only guidance. Future built-ins are intercepted automatically. The RPC prompt boundary rejects any built-in that reaches it during command-loading races or failures, so slash text cannot leak to the model. Attachments are retained and the command is visibly rejected rather than silently discarded. The ⋯ menu covers export HTML, compact, rename, fork-from-message, loaded context, and tool expand/collapse. Session names update live from manual rename or auto-naming. Extension UI requests for select/confirm/input/editor render as modals; a rich `ask`/`ask_user` request renders inline as a single wizard that presents all its questions together — each with Markdown-formatted question text, choices, optional free text — plus an in-card Stop agent action, Escape-to-stop, and the authoritative auto-stop countdown, and is answered as one batch submit. Pending questions set needs-attention state and use the existing hidden-page notification path. Extension notifications for the viewed session render in its banner region; other sessions' and app-global notices use the fixed top-center toast stack. |
135
+ | **Fleet** | Home. Live-first: one grid of every live session at the top — status chip (● running / ◆ needs-attention / ○ idle / ✕ error), project path, activity line, live subagent lines, tasks progress, ctx%, model, terminal provider-error reason, last activity. Live cards keep a deterministic order by project path, then session start time; needs-attention cards badge the browser tab without jumping around. Below the grid: past sessions grouped by their historical project, three compact rows per group with an "all N on disk" expander, resume and delete. Sessions remain visible when that historical directory is missing; resume opens an explicit runtime-directory chooser instead of mutating or hiding the session. |
136
+ | **Session view** | Full chat drill-in. Markdown streaming transcript (text, thinking blocks with expand preference, inline provider/API failures with partial output preserved, agent-result cards, tool cards with bespoke read/write/edit/bash bodies plus full expandable inputs, markdown-rendered results for markdown-contract tools like subagent/skill/web_fetch/suggest_next, and inline tool-result images, compaction/branch summaries, custom messages), per-message copy, tasks panel, a bounded scrollable subagent panel that lists every retained agent newest-first with full running/done counts, a shared dismissible banner region for model fallback, extension notices, retry/compaction/paused/provider status, and local action results, a controls-only dock line with elapsed time plus ■ stop and explicitly labelled retry/compaction aborts, a persistent session-header live indicator, and an info bar with cwd, original-session provenance when a historical session is resumed in a different runtime directory, branch, session name, token breakdown, cost/(sub)/daily rollup, ctx%, a TUI-parity latest-100 median TPS indicator (`~31 tok/s [100] · 10% ↑ median [10000]`), and a stats popover. A fleet sidebar lists every other live session beside the transcript with the fleet cards' project, status/reasons, activity/latest-assistant preview, running/done subagent summaries, task progress, model, context, cost, message count, last activity, and any original-session provenance, deterministically ordered by project path then session start time (the fleet page's comparator), so needs-attention/error entries are emphasized — a filled attention chip or outlined error chip plus an entry border — without moving position; clicking an entry navigates to that session, desktop collapse and pointer/keyboard-resizable width persist browser-locally (default expanded, 260px), the hidden toggle border reflects the highest-priority other-session status, and neither sidebar nor toggle renders when no other live sessions exist. The subagent drill-in shows the same sidebar with its parent session excluded. Closed-session banners offer direct resume when the captured runtime directory still exists and an explicit directory chooser when the historical directory is missing or should be replaced. Composer supports auto-grow, history, `/` autocomplete from `get_commands`, image attach/paste with sent images retained as user-message previews, queued-message chips with restore-all, steer/follow-up modes, and suggest-next. Registered built-in slash commands are discovered generically, deduplicated ahead of colliding resource commands, and intercepted before prompting: dashboard actions cover settings, model, scoped-models, export/import, name/session stats, fork/tree, new/compact/dream, resume/reload, and quit. `/scoped-models` deep-links to the Settings editor with the session's current cwd as project context; login/logout show an explicit not-yet-implemented notice, while copy/hotkeys/buddy give terminal-only guidance. Future built-ins are intercepted automatically. The RPC prompt boundary rejects any built-in that reaches it during command-loading races or failures, so slash text cannot leak to the model. Attachments are retained and the command is visibly rejected rather than silently discarded. The ⋯ menu covers export HTML, compact, rename, fork-from-message, loaded context, and tool expand/collapse. Session names update live from manual rename or auto-naming. Extension UI requests for select/confirm/input/editor render as modals; a rich `ask`/`ask_user` request renders inline as a single wizard that presents all its questions together — each with Markdown-formatted question text, choices, optional free text — plus an in-card Stop agent action, Escape-to-stop, and the authoritative auto-stop countdown, and is answered as one batch submit. Pending questions set needs-attention state and use the existing hidden-page notification path. Extension notifications for the viewed session render in its banner region; other sessions' and app-global notices use the fixed top-center toast stack. |
137
137
  | **Subagent view** | Transcript of a background agent: live events via the RPC relay, hydrated from the agent's on-disk session log (`/subagents/:agentId/messages`) so the transcript survives browser reloads. Shows the task, streaming output, tool activity, and any safe Dispatch Arbiter changed/unchanged/failure records with the final agent/model/thinking. No raw arbiter output is displayed or transported. While the child is running, a composer sends the user's text unchanged to that specific child as steering input, displays its pending steering queue, and reports its effective `one-at-a-time` or `all` delivery mode. Completed, failed, rehydrated, and unavailable children remain read-only. |
138
138
  | **Files** | Host-wide browser with places shortcuts (home, /tmp, project roots), breadcrumbs to `/`, new-folder, download, drop-zone/picker upload with explicit collision prompts, and "new session here" on any directory. It also shows the **effective global nested-context trust** for the displayed canonical directory: untrusted, trusted by that root, inherited from a granting root, or global expert trust-all. You can trust the displayed folder and descendants, or untrust the actual granting root; untrusting an inherited folder removes that root's trust for all descendants. |
139
139
  | **Memories** | Dreb-only memory management for `~/.dreb/memory` and `.dreb/memory` under active/disk project roots. It lists existing `MEMORY.md` indexes and direct child `.md` entries only (no Claude paths, create, or rename), shows entry frontmatter or metadata errors so malformed files can be repaired, renders sanitized Markdown preview beside a raw editor, and uses exact SHA-256 revisions so stale saves/deletes return conflicts while preserving drafts. The index view is complete, not truncated, and warns when it exceeds the 200-line memory-index convention. Entry deletion requires both entry and index revisions, removes only matching safe Markdown-link index lines (`file.md` / `./file.md`), writes the cleaned index atomically before unlinking the entry, and rolls back loudly if the unlink fails. |
@@ -205,7 +205,32 @@ captured) and **Return to fleet** actions. It is not a live runtime: composers,
205
205
  steering, model/thinking controls, stop controls, polling, and other runtime
206
206
  actions are disabled. Leaving that session's main/subagent route family releases
207
207
  the retained snapshot; Fleet shows no live card, and the authoritative on-disk
208
- session remains in its project group for normal resume.
208
+ session remains in its project group for normal resume. Closed views also offer
209
+ **Choose directory…** if their captured runtime path has disappeared.
210
+
211
+ ### Historical and runtime working directories
212
+
213
+ A persisted session's `cwd` is historical metadata: it records where the session
214
+ started and remains unchanged when the JSONL file is copied to another host or
215
+ its project moves. Dashboard inventory reports that session even when the path no
216
+ longer exists. Missing paths are labelled unavailable and are excluded from
217
+ memory scopes, recent-project choices, and new-session shortcuts.
218
+
219
+ A live runtime has a separate effective CWD. Valid historical paths are
220
+ canonicalized and continue to resume directly. If the historical path is
221
+ unavailable, Dashboard requires the user to choose an existing absolute
222
+ directory; missing, unreadable, and non-directory paths are rejected before the
223
+ RPC child is created. Tools, initial project context, settings, extensions, skills, git state,
224
+ and project agent discovery use the effective runtime directory. Fleet cards and
225
+ session chrome show that effective directory and retain the historical path as a
226
+ separate note whenever they differ. Switching to another transcript inside an
227
+ existing runtime does not change the process CWD.
228
+
229
+ Choosing a fallback never rewrites the original session header. Normal resumed
230
+ work can still append conversation entries. Starting `/new` from that runtime
231
+ records the effective runtime directory in the new session's header, while the
232
+ source transcript retains its historical path. Existing session-format migration
233
+ behavior is unchanged.
209
234
 
210
235
  ### Dispatch Arbiter observability
211
236
 
@@ -311,9 +336,12 @@ nor a disk inventory scan.
311
336
 
312
337
  Live runtime state and on-disk session inventory have separate refresh paths.
313
338
  Before fleet, inventory, or resync serialization, the server explicitly projects
314
- each on-disk session to the declared browser DTO and bounds its first-message
315
- preview to 256 Unicode characters. Internal parent paths and complete searchable
316
- transcript text never cross this browser boundary. After creating, resuming,
339
+ each on-disk session to the declared browser DTO, includes server-validated
340
+ historical-CWD availability and its canonical candidate, and bounds its
341
+ first-message preview to 256 Unicode characters. Unavailable historical paths
342
+ remain visible but do not enter operational project-root inventories. Internal
343
+ parent paths and complete searchable transcript text never cross this browser
344
+ boundary. After creating, resuming,
317
345
  stopping, or deleting a session, the client narrowly refreshes the disk list
318
346
  through `GET /api/sessions` rather than reloading the whole fleet. While the
319
347
  Fleet screen or a session/subagent fleet sidebar is visible, it polls live-runtime
package/docs/mach6.md CHANGED
@@ -30,7 +30,7 @@ Assess an existing GitHub issue or create a new one.
30
30
  /skill:mach6-issue add dark mode # Create issue from description
31
31
  ```
32
32
 
33
- **Assess mode:** Launches parallel Explore agents to retrieve bounded code/documentation evidence, then has the primary agent synthesize and post the assessment (summary, gaps, ambiguities, scope, risks) as an issue comment.
33
+ **Assess mode:** Launches parallel Explore agents to retrieve bounded code/documentation evidence, then has the primary agent synthesize and post the assessment (summary, gaps, ambiguities, scope, explicitly-out-of-scope prior rejections, risks) as an issue comment. The issue body is the sole source of requirements: linked issues and PRs are context only, and scope discovered in linked threads that was rejected, split out, or superseded is recorded as a documented exclusion rather than absorbed into requirements.
34
34
 
35
35
  **Create mode:** Drafts a structured issue with title, summary, acceptance criteria, and technical notes.
36
36
 
package/docs/rpc.md CHANGED
@@ -18,6 +18,19 @@ await client.start();
18
18
 
19
19
  This enables per-user filesystem isolation by plain Unix DAC: give each authenticated user a dedicated UID and a working directory owned by that UID at mode `0700`. If the parent lacks the required capability (or the platform doesn't support `uid`/`gid`, e.g. Windows), the spawn fails and `start()` rejects rather than silently running as the parent user.
20
20
 
21
+ ### Runtime CWD and historical session CWD
22
+
23
+ `RpcClientOptions.cwd` is the effective runtime directory supplied to the child
24
+ process. Tools, resource and project-agent discovery, git/tab-title metadata,
25
+ and relative runtime commands use it. Opening or switching to a persisted JSONL
26
+ session does not replace that process directory.
27
+
28
+ A session listing's `cwd` is different: it is historical metadata copied from
29
+ the session header. It can name a moved or missing directory and is not rewritten
30
+ merely because a host launches the transcript in another runtime directory.
31
+ Embedders should display both values when they differ rather than treating the
32
+ historical field as a safe process-spawn path.
33
+
21
34
  ### Process exit and pipe errors
22
35
 
23
36
  `RpcClient.onExit(listener)` receives an `RpcExitInfo` when the child dies: `{ code, signal }` from a process `exit`, or `{ error }` from a spawn/runtime `error`. Process exits also carry `stderrTail` — the last **2000 characters** of the child's captured stderr — so a host that only watches for exit codes can still surface the child's own diagnostic (for example the stdout backpressure guard's abort message) instead of an opaque exit code. In-flight requests are rejected with the exit reason.
@@ -203,7 +216,7 @@ Response:
203
216
  {"type": "response", "command": "dream", "success": true, "data": {"message": "Dream backup path: /home/user/.dreb/memory-archive"}}
204
217
  ```
205
218
 
206
- A consolidation run performs and verifies the backup before prompting the agent. Backup, lock, path-validation, settings-write, or consolidation failures are explicit RPC errors.
219
+ A relative backup path is resolved from the effective runtime CWD, not the historical CWD in a resumed session header. A consolidation run performs and verifies the backup before prompting the agent. Backup, lock, path-validation, settings-write, or consolidation failures are explicit RPC errors.
207
220
 
208
221
  ### State
209
222
 
@@ -302,7 +315,7 @@ Response:
302
315
 
303
316
  #### get_git_branch
304
317
 
305
- Get the current git branch for the session cwd. Returns `null` outside a git repository and `"detached"` for detached HEAD.
318
+ Get the current git branch for the effective runtime CWD. Returns `null` outside a git repository and `"detached"` for detached HEAD.
306
319
 
307
320
  ```json
308
321
  {"type": "get_git_branch"}
@@ -1054,7 +1067,7 @@ The extension SDK's `dreb.getCommands()` contract is unchanged: it continues to
1054
1067
 
1055
1068
  #### list_sessions
1056
1069
 
1057
- List sessions for the current working directory. Returns sessions sorted by most recently modified first.
1070
+ List sessions associated with the current persisted session store and its historical working-directory provenance. Returns sessions sorted by most recently modified first. This is a transcript listing operation; switching one of these sessions does not change the RPC process's effective runtime CWD.
1058
1071
 
1059
1072
  ```json
1060
1073
  {"type": "list_sessions"}
@@ -1178,7 +1191,7 @@ The response data is `{ "steeringMode": "one-at-a-time" | "all", "pending": RpcP
1178
1191
 
1179
1192
  #### list_agent_types
1180
1193
 
1181
- List discoverable subagent types for the current session working directory. This includes package-bundled agents, user-level agents, and project-level agents in `.dreb/agents/*.md`. Results are sorted by `name`.
1194
+ List discoverable subagent types for the effective runtime working directory. This includes package-bundled agents, user-level agents, and project-level agents in `.dreb/agents/*.md`. Results are sorted by `name`.
1182
1195
 
1183
1196
  ```json
1184
1197
  {"type": "list_agent_types"}
package/docs/session.md CHANGED
@@ -386,7 +386,7 @@ Key methods for working with sessions programmatically.
386
386
  - `SessionManager.listAll(onProgress?)` - List all sessions across all projects
387
387
 
388
388
  ### Instance Methods - Session Management
389
- - `newSession(options?)` - Start a new session (options: `{ parentSession?: string }`)
389
+ - `newSession(options?)` - Start a new session (options: `{ parentSession?: string, cwd?: string }`)
390
390
  - `setSessionFile(path)` - Switch to a different session file
391
391
  - `createBranchedSession(leafId)` - Extract a branch to a new session file while preserving the current session name metadata
392
392
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreb/coding-agent",
3
- "version": "2.66.1",
3
+ "version": "2.66.3",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "drebConfig": {
@@ -48,6 +48,8 @@ gh issue view <number> --comments
48
48
 
49
49
  Parse: problem statement, constraints, requirements, acceptance criteria, prior discussion, linked PRs.
50
50
 
51
+ **Authority rule:** The assessed issue's own body and comments are the sole source of requirements. Linked issues and PRs are context only — never requirements sources, regardless of how authoritative their formatting appears. Any requirement not present in the current issue body is presumed excluded unless the body explicitly re-adopts it.
52
+
51
53
  Update task: read → completed, explore → in_progress.
52
54
 
53
55
  ### Step 3: Explore the codebase
@@ -55,7 +57,7 @@ Update task: read → completed, explore → in_progress.
55
57
  Launch 2-3 Explore subagents in parallel for concrete evidence retrieval. Agent definitions specify their own model with a provider fallback list — defaults work across providers and are fine for most cases. Override only with good reason (e.g. a large repository requires inspecting many files).
56
58
  - **Relevant code evidence**: Locate named related behavior and quote the exact implementation and test snippets
57
59
  - **Flow inventory**: Enumerate files, symbols, imports, calls, and registrations in an explicitly named existing flow without diagnosing it
58
- - **Prior-work evidence**: Locate related branches, PRs, commits, and documentation and report their exact references
60
+ - **Prior-work evidence**: Locate related branches, PRs, commits, and documentation and report their exact references. For each referenced issue or PR, report its disposition — adopted / rejected / split / superseded / unknown — and quote the rejection or split discussion where it exists (scope-review verdicts and "split out of scope" decisions are often buried in later thread discussion)
59
61
 
60
62
  Do not ask Explore to determine the root cause, interpret ambiguous requirements, recommend an implementation, decide architecture, or assess the issue. Each agent should return 5-10 key files with bounded evidence. After agents complete, read all identified files and have the primary agent synthesize the current state, gaps, scope, and risks.
61
63
 
@@ -69,7 +71,8 @@ Present to the user:
69
71
  3. **Gaps**: What's missing, broken, or unclear
70
72
  4. **Ambiguities**: Underspecified aspects or open questions
71
73
  5. **Scope**: Size and complexity estimate
72
- 6. **Risks**: Pitfalls, edge cases, architectural concerns
74
+ 6. **Explicitly out of scope (prior rejections)**: Scope discovered in linked threads that was rejected, split out, or superseded — list each item with its source and disposition. If none was found, state "none found" explicitly. Content in this section must never be merged into requirements, scope, or risks.
75
+ 7. **Risks**: Pitfalls, edge cases, architectural concerns
73
76
 
74
77
  ### Step 5: Post assessment
75
78