@dreb/coding-agent 2.60.1 → 2.61.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 +2 -2
- package/dist/core/agent-session.d.ts +47 -6
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +111 -22
- package/dist/core/agent-session.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts +7 -2
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +19 -12
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +27 -12
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +1 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +2 -1
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +1 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +1 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/docs/rpc.md +16 -6
- package/docs/tree.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -175,7 +175,7 @@ Type `/` in the editor to trigger commands. [Extensions](#extensions) can regist
|
|
|
175
175
|
| `/name <name>` | Set session display name |
|
|
176
176
|
| `/session` | Show session info (path, tokens, cost) |
|
|
177
177
|
| `/tree` | Jump to any point in the session and continue from there |
|
|
178
|
-
| `/fork` |
|
|
178
|
+
| `/fork` | Branch a new session from any user or assistant message (assistant = continue from that answer, user = rewind and re-ask) |
|
|
179
179
|
| `/compact [prompt]` | Manually compact context, optional custom instructions |
|
|
180
180
|
| `/copy` | Open multi-select message picker to copy any messages to clipboard. Assistant reasoning is excluded by default and offered as a separate, selectable `Thinking` row. |
|
|
181
181
|
| `/dream` | Consolidate and prune memories — backs up, merges duplicates, scans sessions for patterns |
|
|
@@ -243,7 +243,7 @@ dreb --fork <path> # Fork specific session file or ID into a new session
|
|
|
243
243
|
- Filter modes (Ctrl+O): default → no-tools → user-only → labeled-only → all
|
|
244
244
|
- Press `L` (Shift+L) to label entries as bookmarks
|
|
245
245
|
|
|
246
|
-
**`/fork`** - Create a new session file from the current
|
|
246
|
+
**`/fork`** - Create a new session file by branching from any point in the current conversation. Opens a selector listing every user and assistant message: picking an **assistant** message keeps that response and everything before it (continue from that answer) with an empty editor; picking a **user** message rewinds to before it (dropping it and everything after) and places its text in the editor for re-asking.
|
|
247
247
|
|
|
248
248
|
**`--fork <path|id>`** - Fork an existing session file or partial session UUID directly from the CLI. This copies the full source session into a new session file in the current project.
|
|
249
249
|
|
|
@@ -722,18 +722,29 @@ export declare class AgentSession {
|
|
|
722
722
|
*/
|
|
723
723
|
setSessionName(name: string): void;
|
|
724
724
|
/**
|
|
725
|
-
* Create a fork from a specific entry.
|
|
725
|
+
* Create a fork from a specific entry. The fork point may be any user or
|
|
726
|
+
* assistant message in the transcript; branch semantics depend on the role:
|
|
727
|
+
*
|
|
728
|
+
* - **Assistant message** -> the new branch *includes* the selected response
|
|
729
|
+
* (and everything before it); no editor pre-fill. "Continue from this answer."
|
|
730
|
+
* Forking at the last assistant message keeps the entire current state.
|
|
731
|
+
* - **User message** -> rewind to *before* the selected message (branch from its
|
|
732
|
+
* parent, dropping the message and everything after it) and offer its text as
|
|
733
|
+
* editor pre-fill. "Edit / re-ask this question."
|
|
734
|
+
*
|
|
726
735
|
* Emits before_fork/fork session events to extensions.
|
|
727
736
|
*
|
|
728
|
-
* @param entryId ID of the entry to fork from
|
|
737
|
+
* @param entryId ID of the message entry to fork from
|
|
729
738
|
* @returns Object with:
|
|
730
|
-
* - selectedText: The
|
|
739
|
+
* - selectedText: The selected user message text for editor pre-fill (empty
|
|
740
|
+
* when forking at an assistant message).
|
|
731
741
|
* - cancelled: True if an extension cancelled the fork
|
|
732
742
|
*/
|
|
733
743
|
fork(entryId: string): Promise<{
|
|
734
744
|
selectedText: string;
|
|
735
745
|
cancelled: boolean;
|
|
736
746
|
}>;
|
|
747
|
+
private _performFork;
|
|
737
748
|
/**
|
|
738
749
|
* Navigate to a different node in the session tree.
|
|
739
750
|
* Unlike fork() which creates a new session file, this stays in the same file.
|
|
@@ -757,13 +768,43 @@ export declare class AgentSession {
|
|
|
757
768
|
summaryEntry?: BranchSummaryEntry;
|
|
758
769
|
}>;
|
|
759
770
|
/**
|
|
760
|
-
* Get all
|
|
771
|
+
* Get all forkable messages (user *and* assistant) for the fork selector.
|
|
772
|
+
*
|
|
773
|
+
* Each entry carries its role so callers can label it and choose the right
|
|
774
|
+
* fork semantics (assistant = continue-from-answer, user = rewind + re-ask).
|
|
775
|
+
* A forkable assistant turn with no renderable text (e.g. a thinking-only
|
|
776
|
+
* turn) still appears as a fork point, with a generic label.
|
|
777
|
+
*
|
|
778
|
+
* Assistant turns that cannot be safely branched from (interrupted turns, or
|
|
779
|
+
* turns containing a tool call whose result lives in a descendant entry) are
|
|
780
|
+
* excluded — see _isForkableAssistant.
|
|
761
781
|
*/
|
|
762
|
-
|
|
782
|
+
getForkableMessages(): Array<{
|
|
763
783
|
entryId: string;
|
|
764
784
|
text: string;
|
|
785
|
+
role: "user" | "assistant";
|
|
765
786
|
}>;
|
|
766
|
-
|
|
787
|
+
/**
|
|
788
|
+
* Whether an assistant turn can be safely used as a fork point.
|
|
789
|
+
*
|
|
790
|
+
* Forking anchors on the entry's ancestors only (SessionManager.getBranch
|
|
791
|
+
* walks parentId upward), and errored/aborted turns are dropped by
|
|
792
|
+
* transformMessages() before every request. Two kinds of assistant turn
|
|
793
|
+
* therefore produce a branch that silently does NOT match what was selected:
|
|
794
|
+
*
|
|
795
|
+
* - stopReason "error"/"aborted": transformMessages() skips the turn, so the
|
|
796
|
+
* reply vanishes from context on the next request (defeating "continue from
|
|
797
|
+
* this answer", and risking back-to-back user messages on strict providers).
|
|
798
|
+
* - turns containing tool calls: their tool results are *descendant* entries a
|
|
799
|
+
* branch cannot include, so transformMessages() substitutes a fabricated
|
|
800
|
+
* "No result provided" (isError) result — telling the model a successful
|
|
801
|
+
* tool call failed.
|
|
802
|
+
*
|
|
803
|
+
* A completed answer (the intended "continue from here" target) has a terminal
|
|
804
|
+
* stopReason and no unresolved tool calls, so it passes.
|
|
805
|
+
*/
|
|
806
|
+
private _isForkableAssistant;
|
|
807
|
+
private _extractMessageText;
|
|
767
808
|
/**
|
|
768
809
|
* Get session statistics.
|
|
769
810
|
*/
|