@dreb/coding-agent 2.52.0 → 2.53.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.
package/docs/rpc.md CHANGED
@@ -82,6 +82,8 @@ If the agent is streaming and no `streamingBehavior` is specified, the command r
82
82
 
83
83
  **Input expansion**: Skill commands (`/skill:name`) and prompt templates (`/template`) are expanded before sending/queueing.
84
84
 
85
+ **Built-in commands are client actions, not model prompts.** Registered built-ins such as `/fork` are rejected by `prompt`, `steer`, and `follow_up` with `success: false`; the message is not queued or sent to the model. Discover them through [`get_commands`](#get_commands), then invoke the corresponding RPC operation or client UI. Matching uses the complete first slash token: `/fork` and `/fork anything` are recognized, while `/forklift` and unknown slash commands remain ordinary prompt text.
86
+
85
87
  Response:
86
88
  ```json
87
89
  {"id": "req-1", "type": "response", "command": "prompt", "success": true}
@@ -169,6 +171,34 @@ If an extension cancelled:
169
171
  {"type": "response", "command": "new_session", "success": true, "data": {"cancelled": true}}
170
172
  ```
171
173
 
174
+ #### reload
175
+
176
+ Reload session resources (extensions, skills, prompt templates, context, and themes) using the same core reload operation as the interactive command.
177
+
178
+ ```json
179
+ {"type": "reload"}
180
+ ```
181
+
182
+ Response:
183
+ ```json
184
+ {"type": "response", "command": "reload", "success": true}
185
+ ```
186
+
187
+ #### dream
188
+
189
+ Run memory consolidation or manage its archive path. `args` is the text after `/dream`: omit it to run consolidation, use `"backup"` to read the archive path, or `"backup <path>"` to set it.
190
+
191
+ ```json
192
+ {"type": "dream", "args": "backup"}
193
+ ```
194
+
195
+ Response:
196
+ ```json
197
+ {"type": "response", "command": "dream", "success": true, "data": {"message": "Dream backup path: /home/user/.dreb/memory-archive"}}
198
+ ```
199
+
200
+ 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.
201
+
172
202
  ### State
173
203
 
174
204
  #### get_state
@@ -800,6 +830,19 @@ Response:
800
830
  }
801
831
  ```
802
832
 
833
+ #### import_jsonl
834
+
835
+ Import a JSONL session into the current runtime. This can be cancelled by a session-switch extension hook.
836
+
837
+ ```json
838
+ {"type": "import_jsonl", "inputPath": "/tmp/session.jsonl"}
839
+ ```
840
+
841
+ Response:
842
+ ```json
843
+ {"type": "response", "command": "import_jsonl", "success": true, "data": {"cancelled": false}}
844
+ ```
845
+
803
846
  #### switch_session
804
847
 
805
848
  Load a different session file. Can be cancelled by a `session_before_switch` extension event handler.
@@ -945,7 +988,7 @@ The current session name is available via `get_state` in the `sessionName` field
945
988
 
946
989
  #### get_commands
947
990
 
948
- Get available commands (extension commands, prompt templates, and skills). These can be invoked via the `prompt` command by prefixing with `/`.
991
+ Discover extension commands, prompt templates, skills, and registered built-ins. Resource commands can be invoked through `prompt`; built-ins have `source: "builtin"` and require client-side handling through the corresponding RPC operation or UI. Sending a recognized built-in through `prompt`, `steer`, or `follow_up` is rejected fail-closed.
949
992
 
950
993
  ```json
951
994
  {"type": "get_commands"}
@@ -959,28 +1002,26 @@ Response:
959
1002
  "success": true,
960
1003
  "data": {
961
1004
  "commands": [
962
- {"name": "session-name", "description": "Set or clear session name", "source": "extension", "path": "/home/user/.dreb/agent/extensions/session.ts"},
963
- {"name": "fix-tests", "description": "Fix failing tests", "source": "prompt", "location": "project", "path": "/home/user/myproject/.dreb/agent/prompts/fix-tests.md"},
964
- {"name": "skill:brave-search", "description": "Web search via Brave API", "source": "skill", "location": "user", "path": "/home/user/.dreb/agent/skills/brave-search/SKILL.md"}
1005
+ {"name": "session-name", "description": "Set or clear session name", "source": "extension", "sourceInfo": {"path": "/home/user/.dreb/agent/extensions/session.ts"}},
1006
+ {"name": "fix-tests", "description": "Fix failing tests", "source": "prompt", "sourceInfo": {"path": "/home/user/myproject/.dreb/agent/prompts/fix-tests.md"}},
1007
+ {"name": "skill:brave-search", "description": "Web search via Brave API", "source": "skill", "sourceInfo": {"path": "/home/user/.dreb/agent/skills/brave-search/SKILL.md"}},
1008
+ {"name": "fork", "description": "Create a new fork from a previous message", "source": "builtin", "dashboard": true},
1009
+ {"name": "copy", "description": "Copy last agent message to clipboard", "source": "builtin", "dashboard": false}
965
1010
  ]
966
1011
  }
967
1012
  }
968
1013
  ```
969
1014
 
970
- Each command has:
971
- - `name`: Command name (invoke with `/name`)
972
- - `description`: Human-readable description (optional for extension commands)
973
- - `source`: What kind of command:
974
- - `"extension"`: Registered via `dreb.registerCommand()` in an extension
975
- - `"prompt"`: Loaded from a prompt template `.md` file
976
- - `"skill"`: Loaded from a skill directory (name is prefixed with `skill:`)
977
- - `location`: Where it was loaded from (optional, not present for extensions):
978
- - `"user"`: User-level (`~/.dreb/agent/`)
979
- - `"project"`: Project-level (`./.dreb/agent/`)
980
- - `"path"`: Explicit path via CLI or settings
981
- - `path`: Absolute file path to the command source (optional)
1015
+ Every command has `name`, optional `description`, and a `source`:
1016
+
1017
+ - `"extension"`: registered via `dreb.registerCommand()`; prompt-invokable and includes `sourceInfo`.
1018
+ - `"prompt"`: loaded prompt template; prompt-invokable and includes `sourceInfo`.
1019
+ - `"skill"`: loaded skill (name prefixed with `skill:`); prompt-invokable and includes `sourceInfo`.
1020
+ - `"builtin"`: core slash command; not prompt-invokable, has no file `sourceInfo`, and includes `dashboard`. A false value means dashboard clients should omit it from autocomplete while still intercepting typed use with terminal-only guidance.
1021
+
1022
+ Names are deduplicated, with a built-in taking precedence over a colliding resource command. Future registry entries appear automatically. Hidden development commands are intentionally not registered and do not appear.
982
1023
 
983
- **Note**: Built-in TUI commands (`/settings`, `/hotkeys`, etc.) are not included. They are handled only in interactive mode and would not execute if sent via `prompt`.
1024
+ The extension SDK's `dreb.getCommands()` contract is unchanged: it continues to return only commands invokable via `prompt`, with required resource provenance. Built-ins are added only to this RPC discovery surface.
984
1025
 
985
1026
  ### Session Listing
986
1027
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreb/coding-agent",
3
- "version": "2.52.0",
3
+ "version": "2.53.1",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "drebConfig": {