@dreb/coding-agent 2.30.0 → 2.31.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 +12 -1
- package/dist/core/agent-session.d.ts +16 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +58 -2
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/nested-context.d.ts +60 -0
- package/dist/core/nested-context.d.ts.map +1 -0
- package/dist/core/nested-context.js +276 -0
- package/dist/core/nested-context.js.map +1 -0
- package/dist/core/resource-loader.d.ts +5 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +12 -12
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/settings-manager.d.ts +10 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +11 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/modes/interactive/components/copy-selector.d.ts +3 -3
- package/dist/modes/interactive/components/copy-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/copy-selector.js +4 -5
- package/dist/modes/interactive/components/copy-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +10 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +29 -13
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +47 -10
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/message-text.d.ts +12 -0
- package/dist/utils/message-text.d.ts.map +1 -1
- package/dist/utils/message-text.js +31 -19
- package/dist/utils/message-text.js.map +1 -1
- package/docs/settings.md +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -173,7 +173,7 @@ Type `/` in the editor to trigger commands. [Extensions](#extensions) can regist
|
|
|
173
173
|
| `/tree` | Jump to any point in the session and continue from there |
|
|
174
174
|
| `/fork` | Create a new session from the current branch |
|
|
175
175
|
| `/compact [prompt]` | Manually compact context, optional custom instructions |
|
|
176
|
-
| `/copy` | Open multi-select message picker to copy any messages to clipboard |
|
|
176
|
+
| `/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. |
|
|
177
177
|
| `/dream` | Consolidate and prune memories — backs up, merges duplicates, scans sessions for patterns |
|
|
178
178
|
| `/export [file]` | Export session to HTML file |
|
|
179
179
|
| `/buddy` | Terminal companion — hatch, pet, reroll, set model, or hide. See [docs/buddy.md](docs/buddy.md) |
|
|
@@ -288,6 +288,17 @@ dreb loads `AGENTS.md` (or `CLAUDE.md`) at startup from:
|
|
|
288
288
|
|
|
289
289
|
Use for project instructions, conventions, common commands. All matching files are concatenated.
|
|
290
290
|
|
|
291
|
+
### Nested context auto-load
|
|
292
|
+
|
|
293
|
+
The startup scan only walks **upward** from cwd, so an `AGENTS.md`/`CLAUDE.md` that lives in a **subdirectory** (e.g. a monorepo subpackage) is not loaded until the agent actually works there. When `context.autoLoadNested` is enabled (default), the first time any tool operates in a directory, dreb loads that directory's context files and appends them to the tool result — explaining why the load happened and headering each file with its source path.
|
|
294
|
+
|
|
295
|
+
- Triggers on path-bearing tools (`read`, `edit`, `write`, `grep`, `find`, `ls`) and on `bash` commands that begin with `cd <dir>`.
|
|
296
|
+
- Walks up from the target directory to a sensible ceiling: the session cwd (for in-tree targets), otherwise the outermost git repo root, otherwise the outermost directory containing a context file.
|
|
297
|
+
- Each file is injected at most once per session, and files already loaded at startup are never repeated. Applies to subagents too — including subagents that work in a different repo than the parent.
|
|
298
|
+
- Disable with `context.autoLoadNested: false` in settings, or toggle "Auto-load nested context" in `/settings`.
|
|
299
|
+
|
|
300
|
+
**Security caution:** when working across untrusted or third-party repositories, their `AGENTS.md`/`CLAUDE.md` files may be auto-injected into the agent's context, which is a prompt-injection consideration. Auto-loaded content is secret-scrubbed before injection, but extension `tool_result` transforms do not see it because nested context is injected after those transforms for cache safety.
|
|
301
|
+
|
|
291
302
|
### System Prompt
|
|
292
303
|
|
|
293
304
|
Replace the default system prompt with `.dreb/SYSTEM.md` (project) or `~/.dreb/agent/SYSTEM.md` (global). Append without replacing via `APPEND_SYSTEM.md`.
|
|
@@ -185,6 +185,14 @@ export declare class AgentSession {
|
|
|
185
185
|
private _customTools;
|
|
186
186
|
private _baseToolDefinitions;
|
|
187
187
|
private _cwd;
|
|
188
|
+
/**
|
|
189
|
+
* Per-session realpaths of context files already loaded (seeded lazily from the
|
|
190
|
+
* session-start context set). Ensures each nested AGENTS.md/CLAUDE.md is injected
|
|
191
|
+
* at most once. `undefined` until first use.
|
|
192
|
+
*/
|
|
193
|
+
private _nestedContextLoaded;
|
|
194
|
+
/** Negative cache of target directories already scanned for nested context. */
|
|
195
|
+
private _nestedContextScannedDirs;
|
|
188
196
|
private _extensionRunnerRef?;
|
|
189
197
|
private _initialActiveToolNames?;
|
|
190
198
|
private _baseToolsOverride?;
|
|
@@ -223,6 +231,14 @@ export declare class AgentSession {
|
|
|
223
231
|
* happens here instead of in wrappers.
|
|
224
232
|
*/
|
|
225
233
|
private _installAgentToolHooks;
|
|
234
|
+
/**
|
|
235
|
+
* Compute a nested-context injection block for a tool call, or `null` when nothing
|
|
236
|
+
* should be injected. Resolves the directory the tool operates in, walks up to a
|
|
237
|
+
* sensible ceiling collecting not-yet-loaded AGENTS.md/CLAUDE.md files, and formats
|
|
238
|
+
* them. Each directory is scanned at most once (negative cache) and each file is
|
|
239
|
+
* injected at most once per session (realpath dedup). Gated by `context.autoLoadNested`.
|
|
240
|
+
*/
|
|
241
|
+
private _computeNestedContextBlock;
|
|
226
242
|
/**
|
|
227
243
|
* Install guardrails for background agent interactions:
|
|
228
244
|
* - Layer B: Sentinel monitor — steer if the parent model generates suspicious tokens
|