@dreb/coding-agent 2.40.2 → 2.42.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 +22 -9
- package/dist/core/agent-session.d.ts +2 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +8 -4
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/context-trust.d.ts +44 -0
- package/dist/core/context-trust.d.ts.map +1 -0
- package/dist/core/context-trust.js +117 -0
- package/dist/core/context-trust.js.map +1 -0
- package/dist/core/nested-context.d.ts +4 -3
- package/dist/core/nested-context.d.ts.map +1 -1
- package/dist/core/nested-context.js +34 -9
- package/dist/core/nested-context.js.map +1 -1
- package/dist/core/resource-loader.d.ts +3 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +29 -11
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/settings-manager.d.ts +38 -2
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +161 -6
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/modes/index.d.ts +1 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +2 -2
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/rpc/index.d.ts +1 -1
- package/dist/modes/rpc/index.d.ts.map +1 -1
- package/dist/modes/rpc/index.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +22 -8
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +67 -6
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +57 -7
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +341 -70
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +114 -3
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/docs/dashboard.md +29 -9
- package/docs/rpc.md +184 -10
- package/docs/settings.md +32 -5
- package/package.json +1 -1
package/docs/rpc.md
CHANGED
|
@@ -191,6 +191,9 @@ Response:
|
|
|
191
191
|
{"provider": "anthropic", "id": "claude-sonnet-4-5", "name": "Claude Sonnet 4.5", "reasoning": true, "thinkingLevel": "high"}
|
|
192
192
|
],
|
|
193
193
|
"usingSubscription": false,
|
|
194
|
+
"tasks": [
|
|
195
|
+
{"id": "inspect", "title": "Inspect the implementation", "status": "in_progress"}
|
|
196
|
+
],
|
|
194
197
|
"thinkingLevel": "medium",
|
|
195
198
|
"isStreaming": false,
|
|
196
199
|
"isCompacting": false,
|
|
@@ -215,6 +218,25 @@ The `model` field is a full [Model](#model) object or `null`. `scopedModels` is
|
|
|
215
218
|
|
|
216
219
|
`contextUsage` carries the same numbers the TUI footer shows, computed by the session itself — clients must render these rather than deriving their own estimate. `tokens` and `percent` are `null` when usage is unknown (right after compaction, before the next LLM response). The whole field is omitted when no model is set or the model has no context window.
|
|
217
220
|
|
|
221
|
+
`tasks` is the current `RpcSessionState` task list. Every task has a stable `id`, `title`, and `pending`, `in_progress`, or `completed` status. It is replaced atomically by each [`tasks_update`](#event-types) event; clients restoring state after a hard refresh or recovery gap should use this snapshot rather than reconstructing tasks from a partial event history.
|
|
222
|
+
|
|
223
|
+
#### get_dashboard_snapshot
|
|
224
|
+
|
|
225
|
+
Capture the dashboard-visible parent-session state, full parent transcript, and background-agent registry at one RPC command boundary. This is for authoritative recovery, not ordinary incremental refreshes.
|
|
226
|
+
|
|
227
|
+
```json
|
|
228
|
+
{"id": "snapshot-7", "type": "get_dashboard_snapshot"}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
The `RpcDashboardSnapshot` result is a `snapshotId`, a complete `RpcSessionState` (including `tasks`), `messages`, and `backgroundAgents`. The RPC child writes a `RpcDashboardSnapshotBarrierEvent` to stdout **immediately before** the matching response line:
|
|
232
|
+
|
|
233
|
+
```json
|
|
234
|
+
{"type":"dashboard_snapshot_barrier","snapshotId":"snapshot-7"}
|
|
235
|
+
{"id":"snapshot-7","type":"response","command":"get_dashboard_snapshot","success":true,"data":{"snapshotId":"snapshot-7","state":{...},"messages":[...],"backgroundAgents":[...]}}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Stdout JSONL ordering is the contract: a relay records its current event-stream sequence when the marker arrives, before resolving the response, and pairs the snapshot only with that exact marker. The dashboard returns that captured sequence as `/api/resync.barrierSeq`; consumers discard queued events through it and replay only later events. The marker itself is not broadcast as another browser event, so one recovering client does not interrupt healthy clients. Do not infer ordering from request/response timing; see [dashboard recovery](dashboard.md#live-connection-and-recovery).
|
|
239
|
+
|
|
218
240
|
#### get_resources
|
|
219
241
|
|
|
220
242
|
Get loaded resource metadata for the current session. This returns paths/names/descriptions only — it does not include context file contents, prompt bodies, skill bodies, or system prompt text.
|
|
@@ -1219,16 +1241,17 @@ Note: with `summarize: true` the command is LLM-bound and can take a while. `Rpc
|
|
|
1219
1241
|
|
|
1220
1242
|
### Settings
|
|
1221
1243
|
|
|
1222
|
-
Persistent
|
|
1244
|
+
Persistent settings, backed by the settings file (see [settings.md](settings.md)). They are normally distinct from live session state, with one security-policy exception:
|
|
1223
1245
|
|
|
1224
|
-
- **Persistent defaults** (`get_settings` / `set_settings`):
|
|
1246
|
+
- **Persistent defaults** (`get_settings` / `set_settings`): provider/model, thinking level, queue modes, compaction/retry/image/skill/thinking-display/transport toggles, and per-agent model fallback lists seed fresh runtimes. Writing these ordinary defaults does **not** change a running session.
|
|
1247
|
+
- **Global nested-context trust policy** (`autoLoadNestedContext`, `trustedContextFolders`, `effectiveTrustedContextRoots`, and the trust commands below): this is read from `~/.dreb/agent/settings.json` only, never project settings. Active main/subagent processes observe it for **future lazy nested/out-of-cwd loads**; it cannot remove content already injected into a conversation. It does not govern the separate initial upward context scan from the launch cwd.
|
|
1225
1248
|
- **Runtime state** (`get_state` / `set_model` / `set_thinking_level` / `set_steering_mode` / `set_follow_up_mode` / `set_auto_compaction` / `set_auto_retry`): the state of the live session. Note that the runtime setters also persist their values as new defaults as a side effect.
|
|
1226
1249
|
|
|
1227
|
-
A dashboard settings tab typically reads
|
|
1250
|
+
A dashboard settings tab typically reads `get_state` for what is active now and `get_settings` for persistent defaults plus the current global context-trust policy.
|
|
1228
1251
|
|
|
1229
1252
|
#### get_settings
|
|
1230
1253
|
|
|
1231
|
-
Get
|
|
1254
|
+
Get persistent settings. Before replying, RPC flushes pending settings writes, reloads durable global and project settings, and then reads the merged view; reopening dashboard Settings therefore sees external file edits. A pending write failure, unreadable file, parse error, or reload failure returns an explicit RPC error rather than a stale snapshot. Ordinary fields are the merged global + project view; the nested-context trust fields are always global-only.
|
|
1232
1255
|
|
|
1233
1256
|
```json
|
|
1234
1257
|
{"type": "get_settings"}
|
|
@@ -1251,7 +1274,9 @@ Response:
|
|
|
1251
1274
|
"imageAutoResize": true,
|
|
1252
1275
|
"blockImages": false,
|
|
1253
1276
|
"enableSkillCommands": true,
|
|
1254
|
-
"autoLoadNestedContext":
|
|
1277
|
+
"autoLoadNestedContext": false,
|
|
1278
|
+
"trustedContextFolders": ["/home/user/src/my-company"],
|
|
1279
|
+
"effectiveTrustedContextRoots": ["/home/user/src/my-company"],
|
|
1255
1280
|
"transport": "sse",
|
|
1256
1281
|
"hideThinkingBlock": false,
|
|
1257
1282
|
"agentModels": {
|
|
@@ -1263,6 +1288,8 @@ Response:
|
|
|
1263
1288
|
|
|
1264
1289
|
`defaultProvider`, `defaultModel`, and `defaultThinkingLevel` are absent if never set. `agentModels` is the merged global + project view; project entries win per agent name.
|
|
1265
1290
|
|
|
1291
|
+
`trustedContextFolders` is the raw global configured list, including invalid legacy paths that are ignored fail-closed. `effectiveTrustedContextRoots` is the canonical, existing root set actually enforced after `~` expansion, native `realpath`, deduplication, and ancestor subsumption. `autoLoadNestedContext` defaults to `false`; when `true` it is global expert trust-all for every resolvable target, not a project override. Project `.dreb/settings.json` cannot affect any of these three fields.
|
|
1292
|
+
|
|
1266
1293
|
#### set_settings
|
|
1267
1294
|
|
|
1268
1295
|
Update persistent default settings. Takes a partial payload — only the supplied keys change. The whole payload is validated before anything is applied: on any invalid field, nothing changes and the response is an explicit error. Writes target the global settings file (same scope as every runtime setter).
|
|
@@ -1271,6 +1298,14 @@ Update persistent default settings. Takes a partial payload — only the supplie
|
|
|
1271
1298
|
{"type": "set_settings", "settings": {"defaultThinkingLevel": "low", "retryEnabled": false}}
|
|
1272
1299
|
```
|
|
1273
1300
|
|
|
1301
|
+
Replace the global trusted-root list atomically (paths must be existing directories and are persisted as canonical roots):
|
|
1302
|
+
|
|
1303
|
+
```json
|
|
1304
|
+
{"type": "set_settings", "settings": {"trustedContextFolders": ["/home/user/src/my-company"]}}
|
|
1305
|
+
```
|
|
1306
|
+
|
|
1307
|
+
Set `autoLoadNestedContext: true` only as an expert global trust-all choice: it permits lazy context from any resolvable directory, including untrusted prompt-injection content. `set_settings` writes this policy globally even when the RPC session has project settings; project `.dreb/settings.json` cannot add, override, or enable it. Active processes use the result for later lazy loads, not to retract prior injections. The separate initial upward scan from the launch cwd is unaffected.
|
|
1308
|
+
|
|
1274
1309
|
Setting the default model (both keys required together, validated against available models — the provider must have credentials configured, same rule as `set_model`):
|
|
1275
1310
|
|
|
1276
1311
|
```json
|
|
@@ -1311,7 +1346,9 @@ Response is the full settings snapshot after the write (same shape as `get_setti
|
|
|
1311
1346
|
"imageAutoResize": true,
|
|
1312
1347
|
"blockImages": false,
|
|
1313
1348
|
"enableSkillCommands": true,
|
|
1314
|
-
"autoLoadNestedContext":
|
|
1349
|
+
"autoLoadNestedContext": false,
|
|
1350
|
+
"trustedContextFolders": ["/home/user/src/my-company"],
|
|
1351
|
+
"effectiveTrustedContextRoots": ["/home/user/src/my-company"],
|
|
1315
1352
|
"transport": "sse",
|
|
1316
1353
|
"hideThinkingBlock": false,
|
|
1317
1354
|
"agentModels": {}
|
|
@@ -1334,7 +1371,9 @@ Project-shadow warning example (the global write still lands, but the returned m
|
|
|
1334
1371
|
"imageAutoResize": true,
|
|
1335
1372
|
"blockImages": false,
|
|
1336
1373
|
"enableSkillCommands": true,
|
|
1337
|
-
"autoLoadNestedContext":
|
|
1374
|
+
"autoLoadNestedContext": false,
|
|
1375
|
+
"trustedContextFolders": [],
|
|
1376
|
+
"effectiveTrustedContextRoots": [],
|
|
1338
1377
|
"transport": "sse",
|
|
1339
1378
|
"hideThinkingBlock": false,
|
|
1340
1379
|
"agentModels": {
|
|
@@ -1360,7 +1399,8 @@ Valid keys and values:
|
|
|
1360
1399
|
| `imageAutoResize` | boolean |
|
|
1361
1400
|
| `blockImages` | boolean |
|
|
1362
1401
|
| `enableSkillCommands` | boolean |
|
|
1363
|
-
| `autoLoadNestedContext` | boolean |
|
|
1402
|
+
| `autoLoadNestedContext` | boolean; global-only expert trust-all for lazy nested/out-of-cwd loading; defaults to `false` |
|
|
1403
|
+
| `trustedContextFolders` | Replaces the global list atomically. Array of non-empty paths that expand to absolute, existing directories; each is canonicalized with native `realpath`, then deduplicated/subsumed. Relative, missing, non-directory, and broken-symlink entries are rejected. |
|
|
1364
1404
|
| `transport` | `"sse"`, `"websocket"`, `"auto"` |
|
|
1365
1405
|
| `hideThinkingBlock` | boolean |
|
|
1366
1406
|
| `agentModels` | Plain object mapping agent names to arrays of non-empty model id strings; empty arrays remove the global entry for that agent |
|
|
@@ -1374,6 +1414,7 @@ Errors are explicit `success: false` responses (nothing is applied on any of the
|
|
|
1374
1414
|
- Non-boolean toggle: `Invalid retryEnabled: "yes". Must be a boolean`
|
|
1375
1415
|
- Invalid `agentModels` object: `Invalid agentModels: must be a plain object mapping agent names to model fallback arrays`
|
|
1376
1416
|
- Invalid `agentModels` entry (the offending agent key is named): `Invalid agentModels["Explore"]: expected an array of non-empty strings`
|
|
1417
|
+
- Invalid trusted-root list: `trustedContextFolders must be an array of non-empty path strings` or `Invalid trustedContextFolders[0]: path must be absolute after ~ expansion` / `path must be an existing directory`
|
|
1377
1418
|
- Provider without model (or vice versa): `defaultProvider and defaultModel must be set together`
|
|
1378
1419
|
- Unavailable model: `Model not found: provider/model-id`
|
|
1379
1420
|
- Corrupt settings file: `Cannot write settings: the global settings file failed to load (fix or remove the corrupt settings.json first)` — without this guard the write would silently no-op
|
|
@@ -1381,6 +1422,138 @@ Errors are explicit `success: false` responses (nothing is applied on any of the
|
|
|
1381
1422
|
|
|
1382
1423
|
Unlike `set_thinking_level` (which silently clamps to the current model's capabilities), `set_settings` rejects invalid values loudly — a dashboard needs the error, not a silent correction.
|
|
1383
1424
|
|
|
1425
|
+
#### evaluate_context_trust
|
|
1426
|
+
|
|
1427
|
+
Evaluate one directory against the current **global** lazy nested-context policy. This is useful for a Files view; it does not load context or change settings.
|
|
1428
|
+
|
|
1429
|
+
```json
|
|
1430
|
+
{"type": "evaluate_context_trust", "path": "/home/user/src/my-company/package"}
|
|
1431
|
+
```
|
|
1432
|
+
|
|
1433
|
+
Success response:
|
|
1434
|
+
|
|
1435
|
+
```json
|
|
1436
|
+
{
|
|
1437
|
+
"type": "response",
|
|
1438
|
+
"command": "evaluate_context_trust",
|
|
1439
|
+
"success": true,
|
|
1440
|
+
"data": {
|
|
1441
|
+
"canonicalTarget": "/home/user/src/my-company/package",
|
|
1442
|
+
"state": "trusted-root",
|
|
1443
|
+
"grantingRoot": "/home/user/src/my-company"
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
```
|
|
1447
|
+
|
|
1448
|
+
`canonicalTarget` is the existing directory after strict native `realpath`. `state` is exactly one of:
|
|
1449
|
+
|
|
1450
|
+
- `"untrusted"` — no global root covers the target.
|
|
1451
|
+
- `"trusted-root"` — a configured canonical root covers it; `grantingRoot` is present, including for inherited descendant access.
|
|
1452
|
+
- `"unrestricted"` — global `autoLoadNestedContext` is true; `grantingRoot` is omitted because folder roots are not the grant.
|
|
1453
|
+
|
|
1454
|
+
Invalid paths return `success: false`: `path` must be a non-empty string, absolute after `~` expansion, and an existing directory. Error text is prefixed `Invalid context trust path: ` (for example, `Invalid context trust path: path must be an existing directory`). Symlinks are resolved before evaluation, so a lexical descendant that resolves outside a trusted root evaluates as untrusted.
|
|
1455
|
+
|
|
1456
|
+
#### trust_context_folder
|
|
1457
|
+
|
|
1458
|
+
Add a directory as a global trusted root, then durably flush the settings write. The request path has the same strict validation and canonicalization as `evaluate_context_trust`.
|
|
1459
|
+
|
|
1460
|
+
```json
|
|
1461
|
+
{"type": "trust_context_folder", "path": "/home/user/src/my-company"}
|
|
1462
|
+
```
|
|
1463
|
+
|
|
1464
|
+
Success response (the nested `settings` object is abbreviated here to its trust fields):
|
|
1465
|
+
|
|
1466
|
+
```json
|
|
1467
|
+
{
|
|
1468
|
+
"type": "response",
|
|
1469
|
+
"command": "trust_context_folder",
|
|
1470
|
+
"success": true,
|
|
1471
|
+
"data": {
|
|
1472
|
+
"evaluation": {
|
|
1473
|
+
"canonicalTarget": "/home/user/src/my-company",
|
|
1474
|
+
"state": "trusted-root",
|
|
1475
|
+
"grantingRoot": "/home/user/src/my-company"
|
|
1476
|
+
},
|
|
1477
|
+
"addedRoot": "/home/user/src/my-company",
|
|
1478
|
+
"settings": {
|
|
1479
|
+
"autoLoadNestedContext": false,
|
|
1480
|
+
"trustedContextFolders": ["/home/user/src/my-company"],
|
|
1481
|
+
"effectiveTrustedContextRoots": ["/home/user/src/my-company"]
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
```
|
|
1486
|
+
|
|
1487
|
+
`settings` is the complete `get_settings` snapshot after the durable global write. `addedRoot` is the canonical target when it is retained as a root; it is omitted when an existing ancestor already covers that target. Existing malformed legacy roots are discarded by this mutation; the resulting root list is canonical, deduplicated, and ancestor-subsumed. Invalid paths use the same `Invalid context trust path: ...` errors. A corrupt global settings file or failed durable write returns `success: false` with `Cannot write settings: ...` or `Failed to persist settings: ...`; no merely in-memory trust is reported as success.
|
|
1488
|
+
|
|
1489
|
+
#### untrust_context_folder
|
|
1490
|
+
|
|
1491
|
+
Remove the actual canonical root granting trust to a target, rather than only removing a selected descendant. This is the companion for an inherited Files-view trust badge.
|
|
1492
|
+
|
|
1493
|
+
```json
|
|
1494
|
+
{"type": "untrust_context_folder", "path": "/home/user/src/my-company/package"}
|
|
1495
|
+
```
|
|
1496
|
+
|
|
1497
|
+
If `/home/user/src/my-company` grants this descendant's access, a successful response is (with `settings` abbreviated to its trust fields):
|
|
1498
|
+
|
|
1499
|
+
```json
|
|
1500
|
+
{
|
|
1501
|
+
"type": "response",
|
|
1502
|
+
"command": "untrust_context_folder",
|
|
1503
|
+
"success": true,
|
|
1504
|
+
"data": {
|
|
1505
|
+
"evaluation": {
|
|
1506
|
+
"canonicalTarget": "/home/user/src/my-company/package",
|
|
1507
|
+
"state": "untrusted"
|
|
1508
|
+
},
|
|
1509
|
+
"removedRoot": "/home/user/src/my-company",
|
|
1510
|
+
"settings": {
|
|
1511
|
+
"autoLoadNestedContext": false,
|
|
1512
|
+
"trustedContextFolders": [],
|
|
1513
|
+
"effectiveTrustedContextRoots": []
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
```
|
|
1518
|
+
|
|
1519
|
+
`removedRoot` is the canonical root removed for the target and therefore revokes its descendants too. If the target was already `untrusted`, this is a successful no-op: `settings` and an `untrusted` evaluation are returned without `removedRoot`. If global expert trust-all is enabled, it fails rather than pretending a folder change can narrow it:
|
|
1520
|
+
|
|
1521
|
+
```json
|
|
1522
|
+
{"type":"response","command":"untrust_context_folder","success":false,"error":"Cannot untrust a context folder while unrestricted nested context loading is enabled; disable autoLoadNestedContext first"}
|
|
1523
|
+
```
|
|
1524
|
+
|
|
1525
|
+
Invalid paths and write failures have the same semantics as `trust_context_folder`.
|
|
1526
|
+
|
|
1527
|
+
#### remove_trusted_context_folder
|
|
1528
|
+
|
|
1529
|
+
Remove a configured global trusted-folder string by **exact** match, then durably flush the settings write. This is intentionally different from `untrust_context_folder`: the request path is treated as the configured string to delete and performs no directory/path resolution — no `~` expansion, absolute-path requirement, directory existence check, symlink resolution, canonicalization, or granting-root lookup.
|
|
1530
|
+
|
|
1531
|
+
```json
|
|
1532
|
+
{"type": "remove_trusted_context_folder", "path": "/legacy/or/moved/path"}
|
|
1533
|
+
```
|
|
1534
|
+
|
|
1535
|
+
Success response (the nested `settings` object is abbreviated here to its trust fields):
|
|
1536
|
+
|
|
1537
|
+
```json
|
|
1538
|
+
{
|
|
1539
|
+
"type": "response",
|
|
1540
|
+
"command": "remove_trusted_context_folder",
|
|
1541
|
+
"success": true,
|
|
1542
|
+
"data": {
|
|
1543
|
+
"settings": {
|
|
1544
|
+
"autoLoadNestedContext": false,
|
|
1545
|
+
"trustedContextFolders": [],
|
|
1546
|
+
"effectiveTrustedContextRoots": []
|
|
1547
|
+
},
|
|
1548
|
+
"removedFolder": "/legacy/or/moved/path"
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
```
|
|
1552
|
+
|
|
1553
|
+
`settings` is the complete `get_settings` snapshot after the durable global write. `removedFolder` is the configured folder string requested for exact removal; the command is a successful no-op if the exact string was not present. Only a non-empty string `path` is required, so this command can revoke invalid, legacy, or stale configured entries that `untrust_context_folder` cannot validate or resolve. It is not gated by global expert trust-all (`autoLoadNestedContext: true`), because it edits the configured list directly rather than pretending to narrow unrestricted loading. A corrupt global settings file or failed durable write returns `success: false` with `Cannot write settings: ...` or `Failed to persist settings: ...`; no merely in-memory trust removal is reported as success.
|
|
1554
|
+
|
|
1555
|
+
All four context-trust commands concern only future lazy nested/out-of-cwd loads in active main/subagent processes; they never alter the separate initial upward scan or retract context already injected into a conversation.
|
|
1556
|
+
|
|
1384
1557
|
### Version
|
|
1385
1558
|
|
|
1386
1559
|
#### get_version
|
|
@@ -1403,7 +1576,7 @@ Response:
|
|
|
1403
1576
|
|
|
1404
1577
|
## Events
|
|
1405
1578
|
|
|
1406
|
-
|
|
1579
|
+
`RpcEvent` messages are streamed to stdout as JSON lines during agent operation. Agent/session events and `dashboard_snapshot_barrier` do not include an `id` field; extension UI requests include an `id` so clients can respond.
|
|
1407
1580
|
|
|
1408
1581
|
### Event Types
|
|
1409
1582
|
|
|
@@ -1430,7 +1603,8 @@ Events are streamed to stdout as JSON lines during agent operation. Events do NO
|
|
|
1430
1603
|
| `background_agent_event` | Relayed event from a background subagent's own stream |
|
|
1431
1604
|
| `parent_paused_for_background_agents` | Parent paused waiting on background agents |
|
|
1432
1605
|
| `session_name_changed` | Session display name changed (manual rename, extension rename, or auto-title) |
|
|
1433
|
-
| `tasks_update` | Session task list replaced (
|
|
1606
|
+
| `tasks_update` | Session task list atomically replaced (each task has `id`, `title`, and status) |
|
|
1607
|
+
| `dashboard_snapshot_barrier` | Ordering marker emitted immediately before a successful `get_dashboard_snapshot` response; pair only the matching `snapshotId` (see [Dashboard snapshots](#get_dashboard_snapshot)) |
|
|
1434
1608
|
| `suggest_next` | Agent suggested a next command |
|
|
1435
1609
|
| `extension_error` | Extension threw an error |
|
|
1436
1610
|
|
package/docs/settings.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Settings
|
|
2
2
|
|
|
3
|
-
dreb uses JSON settings files with project settings overriding global settings.
|
|
3
|
+
dreb uses JSON settings files with project settings overriding global settings, except where a setting is explicitly global-only (notably nested-context trust).
|
|
4
4
|
|
|
5
5
|
| Location | Scope |
|
|
6
6
|
|----------|-------|
|
|
@@ -113,13 +113,36 @@ After the configured number of tool calls, dreb fires a single background LLM ca
|
|
|
113
113
|
|
|
114
114
|
### Context
|
|
115
115
|
|
|
116
|
+
At startup, dreb always performs an **initial upward scan** from the launch cwd for `AGENTS.md`/`CLAUDE.md`. This is separate from lazy nested/out-of-cwd loading and is not enabled, disabled, or scoped by either context setting below. It is not a claim that the initial scan has a fixed boundary: it follows the startup upward-walk behavior for that cwd.
|
|
117
|
+
|
|
116
118
|
| Setting | Type | Default | Description |
|
|
117
119
|
|---------|------|---------|-------------|
|
|
118
|
-
| `context.
|
|
120
|
+
| `context.trustedFolders` | string[] | `[]` | **Global-only.** Explicit existing directory roots whose canonical descendants may lazy-load context |
|
|
121
|
+
| `context.autoLoadNested` | boolean | `false` | **Global-only expert trust-all.** Allow lazy loading from every resolvable directory |
|
|
122
|
+
|
|
123
|
+
Both settings belong only in `~/.dreb/agent/settings.json`. Project `.dreb/settings.json` cannot enable, disable, or extend nested-context trust: it cannot enable unrestricted loading, add trusted roots, override global roots, or otherwise widen this trust boundary. A cloned repository therefore cannot grant itself trust.
|
|
124
|
+
|
|
125
|
+
#### `context.trustedFolders`
|
|
126
|
+
|
|
127
|
+
Use explicit roots for directories whose instructions you control:
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"context": {
|
|
132
|
+
"trustedFolders": ["~/src/my-company", "/srv/controlled-repos"]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Each root authorizes itself and its descendants for lazy loading. Paths are expanded (`~` is supported) and canonically resolved with native `realpath`; the target is independently canonicalized for every decision. Roots must be absolute after expansion, existing directories, and must not be broken symlinks. Invalid/missing legacy entries are ignored fail-closed; RPC/settings updates reject invalid entries atomically. Canonical duplicates are deduplicated, and a descendant root is subsumed by its trusted ancestor. This realpath matching prevents symlink escape: a path that is lexically below a trusted folder but resolves outside it is not trusted.
|
|
119
138
|
|
|
120
|
-
|
|
139
|
+
For a trusted target, the first matching path-bearing tool (`read`, `edit`, `write`, `grep`, `find`, `ls`) — or `bash` beginning with `cd <dir>` — can append its context to the tool result. The walk is bounded by the trusted root (or the normal cwd/repository/context-file ceiling when expert trust-all is in effect). Main agents and subagents read the same global policy. Active processes re-read it for later lazy-load decisions, so a trust/untrust change affects **future** loads without a restart; text already injected into a conversation cannot be retracted.
|
|
121
140
|
|
|
122
|
-
|
|
141
|
+
In the dashboard, the Files view is the primary grant flow: trust the displayed folder and descendants, or untrust the actual granting root. The Settings screen lists every configured trusted root for audit and revoke, and offers a simple add-by-path control. These controls change only lazy nested/out-of-cwd loading; they do not alter the separate initial upward scan described above.
|
|
142
|
+
|
|
143
|
+
#### `context.autoLoadNested`
|
|
144
|
+
|
|
145
|
+
**Expert setting — prompt-injection warning.** Set this to `true` only in global settings to allow lazy loading from **any** resolvable target directory:
|
|
123
146
|
|
|
124
147
|
```json
|
|
125
148
|
{
|
|
@@ -129,6 +152,10 @@ When enabled, dreb loads nested context files that the startup upward-walk misse
|
|
|
129
152
|
}
|
|
130
153
|
```
|
|
131
154
|
|
|
155
|
+
This includes untrusted or third-party repositories and can inject prompt-injection content. Prefer `trustedFolders`; leave this setting `false` unless you intentionally trust all such targets. A project settings file cannot enable it.
|
|
156
|
+
|
|
157
|
+
For either permitted lazy-load path, each context file is realpath-deduplicated and injected at most once per session; files already obtained during the initial upward scan are not repeated. If the triggering tool already returns a context file in full, it is marked loaded without a duplicate injection. Auto-loaded content is secret-scrubbed before injection and is appended after extension `tool_result` transforms, so those transforms intentionally do not see it. See [Context Files](../README.md#context-files).
|
|
158
|
+
|
|
132
159
|
### Compaction
|
|
133
160
|
|
|
134
161
|
| Setting | Type | Default | Description |
|
|
@@ -357,7 +384,7 @@ See [packages.md](packages.md) for package management details.
|
|
|
357
384
|
|
|
358
385
|
## Project Overrides
|
|
359
386
|
|
|
360
|
-
Project settings (`.dreb/settings.json`) override global settings. Nested objects are merged:
|
|
387
|
+
Project settings (`.dreb/settings.json`) override global settings. Nested objects are merged. **Exception:** `context.trustedFolders` and `context.autoLoadNested` are global-only security policy: project settings cannot add, replace, override, or enable either one. Nested context from the initial startup upward scan remains separate from this lazy-load policy.
|
|
361
388
|
|
|
362
389
|
```json
|
|
363
390
|
// ~/.dreb/agent/settings.json (global)
|