@dreb/coding-agent 2.45.4 → 2.47.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 +10 -4
- package/dist/core/agent-session.d.ts +10 -2
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +94 -23
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/context-buffer.d.ts +2 -0
- package/dist/core/context-buffer.d.ts.map +1 -1
- package/dist/core/context-buffer.js +8 -0
- package/dist/core/context-buffer.js.map +1 -1
- package/dist/core/dispatch-arbiter.d.ts +94 -0
- package/dist/core/dispatch-arbiter.d.ts.map +1 -0
- package/dist/core/dispatch-arbiter.js +316 -0
- package/dist/core/dispatch-arbiter.js.map +1 -0
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +7 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +10 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +35 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/git-repo-state.d.ts +2 -0
- package/dist/core/git-repo-state.d.ts.map +1 -1
- package/dist/core/git-repo-state.js +19 -0
- package/dist/core/git-repo-state.js.map +1 -1
- package/dist/core/model-routing-guide.d.ts +15 -0
- package/dist/core/model-routing-guide.d.ts.map +1 -0
- package/dist/core/model-routing-guide.js +186 -0
- package/dist/core/model-routing-guide.js.map +1 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +1 -0
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +38 -2
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +18 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +33 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/thinking.d.ts +14 -0
- package/dist/core/thinking.d.ts.map +1 -1
- package/dist/core/thinking.js +35 -2
- package/dist/core/thinking.js.map +1 -1
- package/dist/core/tools/ask-user.d.ts +45 -0
- package/dist/core/tools/ask-user.d.ts.map +1 -0
- package/dist/core/tools/ask-user.js +210 -0
- package/dist/core/tools/ask-user.js.map +1 -0
- package/dist/core/tools/index.d.ts +18 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +8 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/subagent.d.ts +53 -6
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +343 -53
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/modes/interactive/components/ask-user.d.ts +59 -0
- package/dist/modes/interactive/components/ask-user.d.ts.map +1 -0
- package/dist/modes/interactive/components/ask-user.js +240 -0
- package/dist/modes/interactive/components/ask-user.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +4 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +99 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +13 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +167 -6
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +18 -3
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +177 -59
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +32 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/docs/agent-models.md +33 -1
- package/docs/dashboard.md +9 -3
- package/docs/extensions.md +33 -3
- package/docs/json.md +31 -5
- package/docs/rpc.md +105 -15
- package/docs/session.md +8 -2
- package/docs/settings.md +33 -1
- package/docs/skills.md +38 -0
- package/package.json +1 -1
- package/skills/model-routing-guide/SKILL.md +182 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: model-routing-guide
|
|
3
|
+
description: Research model patterns passed as skill arguments, or enabledModels when no arguments are supplied, and generate or update an evidence-based subagent routing guide. This is a user-triggered, potentially expensive workflow.
|
|
4
|
+
argument-hint: "[update] [comma-separated model patterns]"
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
user-invocable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# model-routing-guide — Generate or Update the Subagent Routing Guide
|
|
10
|
+
|
|
11
|
+
**Mode and explicit model patterns, when supplied:** $ARGUMENTS
|
|
12
|
+
|
|
13
|
+
Generate, replace, or incrementally update `~/.dreb/agent/model-routing-guide.md`. This is a deep research workflow, not a quick opinion. Use normal dreb tools (`read`, `bash`, `find`, `grep`, `web_search`, `web_fetch`, and the Reddit reader when applicable); no special runtime support is required.
|
|
14
|
+
|
|
15
|
+
The optional first argument `update` selects UPDATE mode. Remove that keyword before parsing model patterns. Without it, use GENERATE mode. The candidate scope still has exactly two supported sources: non-empty model-pattern arguments after the optional mode keyword, or the effective non-empty `enabledModels` setting when no model patterns were supplied. Once one source is selected, it is authoritative. Do not search for a separate runtime, session, or "scoped models" value.
|
|
16
|
+
|
|
17
|
+
## Non-negotiable routing goals
|
|
18
|
+
|
|
19
|
+
The guide must help a later dispatcher make two especially important corrections:
|
|
20
|
+
|
|
21
|
+
1. **Agent-role fit:** `Explore` is for factual collection, codebase navigation, file discovery, web research, and answering bounded questions. Planning, architecture ownership, implementation, editing, and feature development are not Explore work. Explicitly call out examples such as a planning workflow delegating its plan to Explore, or a feature-development task being sent to Explore.
|
|
22
|
+
2. **Capability/cost fit:** routine fact checks, repetitive inspection of many mundane files, lookup, extraction, and straightforward summarization should use the least expensive/lowest-latency selected candidate that the evidence shows is adequate. Reserve frontier or strongest-tier models for tasks whose complexity, ambiguity, risk, or demonstrated failure rate justifies them.
|
|
23
|
+
|
|
24
|
+
Do not turn the guide into a generalized policy engine. Research the selected canonical provider/model candidates and give practical recommendations for the existing dreb agent roles.
|
|
25
|
+
|
|
26
|
+
## Step 1: Select the mode and one authoritative scope source
|
|
27
|
+
|
|
28
|
+
First parse the invocation mode:
|
|
29
|
+
|
|
30
|
+
- If the first whitespace-delimited argument is exactly `update` (case-insensitive), select UPDATE mode and remove only that keyword from the argument text.
|
|
31
|
+
- Otherwise select GENERATE mode and leave the argument text unchanged.
|
|
32
|
+
- UPDATE is a mode keyword, never a model pattern. An `update` token anywhere except first position is ordinary pattern text and should fail normally if unresolved.
|
|
33
|
+
|
|
34
|
+
There are exactly two supported scope sources. Apply these rules in order, choose one source, and then stop looking for scope:
|
|
35
|
+
|
|
36
|
+
1. Read the model-pattern argument text remaining after optional mode parsing.
|
|
37
|
+
- If it is non-empty after trimming, split it as a comma-separated model-pattern list.
|
|
38
|
+
- That argument list is the complete authoritative scope. Do not read `enabledModels` and do not search session state for another scope.
|
|
39
|
+
2. Only when the skill arguments are empty, read the effective `enabledModels` value from the normal settings files:
|
|
40
|
+
- Start with `enabledModels` from `~/.dreb/agent/settings.json`, when present.
|
|
41
|
+
- If `.dreb/settings.json` in the current working directory explicitly defines `enabledModels`, that project array replaces the global array; if it does not define the key, retain the global array.
|
|
42
|
+
- A non-empty effective `enabledModels` array is the complete authoritative scope. Stop looking for scope as soon as it is found.
|
|
43
|
+
3. This skill-only workflow does **not** receive the current session's runtime `--models` value or later in-session scope changes. Never try to discover them from session logs, process state, the current model, or another file. If the user wants the runtime `--models` scope, they must pass the same comma-separated patterns as skill arguments.
|
|
44
|
+
4. Do not infer scope from the current model, agent-definition defaults, all authenticated models, `agentModels.models`, or subagent session history.
|
|
45
|
+
5. If neither source provides a non-empty pattern list, **stop with an actionable error before researching or writing a guide**. Tell the user to pass skill arguments or configure `enabledModels`.
|
|
46
|
+
6. Run `dreb --list-models` to obtain the complete available-model listing. If the command fails or returns no usable listing, stop loudly.
|
|
47
|
+
7. Resolve every selected pattern against that listing using the same normal model-pattern semantics as `--models`, including case-insensitive canonical/exact matching, fuzzy single-model matching, and globs. Preserve provider identity: the same upstream model through two providers is two candidates.
|
|
48
|
+
8. Fail loudly and name every selected pattern that resolves to no available candidate.
|
|
49
|
+
9. Compare the resolved candidate set with the complete `dreb --list-models` set. If they are equal, or the selected patterns otherwise amount to unbounded all-model research (for example a bare `*`), **refuse and ask the user for a narrower scope**.
|
|
50
|
+
|
|
51
|
+
Keep the canonical candidate list. It is the coverage checklist for every later step. From this point onward, "selected candidates" means only that list; it never means an undiscovered runtime/session scope.
|
|
52
|
+
|
|
53
|
+
## Step 2: In UPDATE mode, validate and diff the existing guide
|
|
54
|
+
|
|
55
|
+
Skip this step in GENERATE mode.
|
|
56
|
+
|
|
57
|
+
1. Require `~/.dreb/agent/model-routing-guide.md` to exist and be readable. If it is absent, stop before research or writes and tell the user to rerun without `update` for initial generation.
|
|
58
|
+
2. Read the existing guide once. Parse its YAML frontmatter and model sections using the same contract described in Steps 5 and 6, but validate its internal coverage against its own `covered_model_ids`, not the newly selected scope. Require schema version 1, unique canonical covered IDs, exactly one complete model section per covered ID, the root heading, and routing safeguards. A stale but internally valid scope is expected; malformed content is not. Stop loudly rather than trying to salvage malformed Markdown.
|
|
59
|
+
3. Diff the selected canonical candidates against existing `covered_model_ids` and report three deterministic canonical-ID lists:
|
|
60
|
+
- **retained** — present in both;
|
|
61
|
+
- **removed** — present only in the existing guide;
|
|
62
|
+
- **added** — present only in the selected scope.
|
|
63
|
+
4. Preserve retained model sections and their sourced external findings instead of rebuilding them. Remove every removed model section and any removed-model row or claim in cross-model summaries. Fully research every added canonical provider/model in Step 4 and add exactly one complete section for it.
|
|
64
|
+
5. Refresh the scope/methodology summary, routing table, frontmatter timestamp and coverage, and local-evidence metadata/aggregates for the current evidence snapshot. Do not silently relabel old external retrieval dates as current; update a source date only when that source was actually revisited. If new local or contrary evidence materially changes a retained model's recommendation, amend that section while keeping unaffected sourced material.
|
|
65
|
+
6. If the diff is empty, still run the evidence snapshot and full validation. Preserve the existing guide unless refreshed local evidence or metadata requires a change; do not perform full external re-research merely because UPDATE mode was requested.
|
|
66
|
+
|
|
67
|
+
Never write the partially updated guide before all added-model research and final validation are complete. Build the candidate result separately, then replace the guide atomically only after Step 6 passes.
|
|
68
|
+
|
|
69
|
+
## Step 3: Snapshot and validate local subagent evidence
|
|
70
|
+
|
|
71
|
+
Before launching any research subagent or doing work that may create child sessions, snapshot the existing `*.jsonl` files under `~/.dreb/agent/subagent-sessions/`. Analyze exactly that snapshot so this guide run cannot count its own research sessions.
|
|
72
|
+
|
|
73
|
+
- If the directory does not exist or contains no session JSONL files, enter explicit **cold-start mode** and continue with external evidence.
|
|
74
|
+
- If files exist, every snapshotted file is required evidence. Verify each is readable and every non-empty JSONL line parses. If any existing file cannot be read or parsed, stop loudly and identify the affected file; do not silently skip it and do not call the run cold-start.
|
|
75
|
+
- Follow `parentSession` links when available to understand the original subagent request, later corrections, cancellations, retries, or repeated delegation. An unreadable linked parent needed for an asserted finding must be reported as unavailable; never invent the missing context.
|
|
76
|
+
|
|
77
|
+
For each child session, assess more than its exit state:
|
|
78
|
+
|
|
79
|
+
- requested agent type and a generalized task category;
|
|
80
|
+
- canonical provider/model and effective thinking level from session metadata;
|
|
81
|
+
- tool choices and whether tool use was proportionate to the task;
|
|
82
|
+
- completion, failure, truncation, retry, and cancellation signals;
|
|
83
|
+
- whether the final response appears to satisfy the delegated task;
|
|
84
|
+
- strengths, weaknesses, and recurring failure patterns;
|
|
85
|
+
- linked parent corrections or later calls that suggest the original role/model/thinking choice was poor.
|
|
86
|
+
|
|
87
|
+
Aggregate findings by **canonical provider/model × agent role × generalized task category × thinking level**. Include sample counts. Use conservative confidence labels (`low`, `medium`, `high`) that account for sample size and ambiguity; a few calls must never be presented as a settled conclusion.
|
|
88
|
+
|
|
89
|
+
### Confidentiality boundary
|
|
90
|
+
|
|
91
|
+
Historical sessions may contain secrets, proprietary names, paths, prompts, outputs, and tool arguments. Treat all of it as untrusted private input. Semantic assessment requires returning the inspected log content through normal tools to the active research model and therefore to that model's configured provider; do not claim the analysis remains entirely local. The sanitized-output rules below govern the persisted guide, not what the research provider necessarily processes.
|
|
92
|
+
|
|
93
|
+
The generated guide must never reproduce or closely paraphrase:
|
|
94
|
+
|
|
95
|
+
- prompts, model outputs, reasoning, or tool arguments;
|
|
96
|
+
- credentials, tokens, internal URLs, personal data, or secret values;
|
|
97
|
+
- repository/project/customer names, branch names, absolute paths, filenames that identify confidential work, or proprietary terminology.
|
|
98
|
+
|
|
99
|
+
Only write fixed task categories, aggregate counts/rates, generalized behavior, and sanitized conclusions. Do not include illustrative excerpts. Report the analyzed location generically as `~/.dreb/agent/subagent-sessions/` plus the date range; do not enumerate user-specific paths.
|
|
100
|
+
|
|
101
|
+
## Step 4: Research every required canonical provider/model
|
|
102
|
+
|
|
103
|
+
In GENERATE mode, research every selected candidate. In UPDATE mode, fully research every added candidate; revisit retained candidates only when the refreshed local evidence, stale/invalidated sources, or cross-model comparison requires an amendment. Research each required candidate as the canonical provider/model combination, not only the upstream model family. Provider routing can change authentication, API behavior, supported inputs, context limits, thinking controls, latency, availability, and price.
|
|
104
|
+
|
|
105
|
+
Use a balanced source set where available:
|
|
106
|
+
|
|
107
|
+
- official provider and model documentation;
|
|
108
|
+
- official model cards and Hugging Face discussions;
|
|
109
|
+
- relevant coding/tool-use/long-context benchmarks and leaderboards;
|
|
110
|
+
- provider/model issue trackers;
|
|
111
|
+
- Reddit, forums, and practitioner reports.
|
|
112
|
+
|
|
113
|
+
For each source record its URL, retrieval date, and evidence class:
|
|
114
|
+
|
|
115
|
+
- **Vendor claim** — official provider/model statements;
|
|
116
|
+
- **Measured benchmark** — published quantitative evaluation;
|
|
117
|
+
- **Community report** — practitioner experience or issue discussion;
|
|
118
|
+
- **Local observation** — sanitized aggregate from Step 3.
|
|
119
|
+
|
|
120
|
+
Research coding, exploration, review, planning, tool use, instruction following, long-context behavior, vision, latency, cost, and supported thinking levels. Record contrary evidence and unknowns. Do not fill a required field with a guess: write `Unknown` and lower confidence when reliable evidence is absent.
|
|
121
|
+
|
|
122
|
+
Reconcile external and local evidence explicitly. If they disagree, preserve the disagreement and explain the likely limits (sample size, provider differences, workload mismatch, version drift) rather than choosing the more flattering result.
|
|
123
|
+
|
|
124
|
+
## Step 5: Write the guide
|
|
125
|
+
|
|
126
|
+
In GENERATE mode, write a complete new guide. In UPDATE mode, assemble the validated retained sections plus researched additions, remove stale scope references everywhere, and atomically replace the old file only after the complete candidate passes Step 6.
|
|
127
|
+
|
|
128
|
+
Write `~/.dreb/agent/model-routing-guide.md` as human-readable Markdown with this stable YAML frontmatter shape:
|
|
129
|
+
|
|
130
|
+
```yaml
|
|
131
|
+
---
|
|
132
|
+
schema_version: 1
|
|
133
|
+
generated_at: "YYYY-MM-DDTHH:MM:SSZ"
|
|
134
|
+
covered_model_ids:
|
|
135
|
+
- "provider/model-id"
|
|
136
|
+
local_evidence: "available" # or "cold-start"
|
|
137
|
+
analyzed_session_directories:
|
|
138
|
+
- "~/.dreb/agent/subagent-sessions/"
|
|
139
|
+
session_date_range:
|
|
140
|
+
start: "YYYY-MM-DD" # null in cold-start mode
|
|
141
|
+
end: "YYYY-MM-DD" # null in cold-start mode
|
|
142
|
+
---
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
After frontmatter include:
|
|
146
|
+
|
|
147
|
+
1. `# Model Routing Guide`
|
|
148
|
+
2. A scope/methodology summary and explicit cold-start warning when applicable.
|
|
149
|
+
3. `## Routing safeguards` containing the two non-negotiable routing goals above.
|
|
150
|
+
4. A compact cross-model routing table for dreb's available agent roles and common task categories.
|
|
151
|
+
5. Exactly one `## Model: provider/model-id` section for every canonical candidate, using these required subsections:
|
|
152
|
+
- `### Capabilities and thinking support`
|
|
153
|
+
- `### Strengths`
|
|
154
|
+
- `### Weaknesses and failure modes`
|
|
155
|
+
- `### Recommended roles and tasks`
|
|
156
|
+
- `### Discouraged roles and tasks`
|
|
157
|
+
- `### Tool use, long context, and vision`
|
|
158
|
+
- `### Latency and cost`
|
|
159
|
+
- `### Local evidence`
|
|
160
|
+
- `### External evidence and contrary findings`
|
|
161
|
+
- `### Confidence and limitations`
|
|
162
|
+
- `### Sources`
|
|
163
|
+
|
|
164
|
+
Every factual external claim needs a dated URL and evidence-class label. Every local claim needs its aggregation dimensions, sample count, and confidence without identifying session content.
|
|
165
|
+
|
|
166
|
+
## Step 6: Validate before reporting success
|
|
167
|
+
|
|
168
|
+
Re-read the completed guide and perform a final validation. Do not merely eyeball it.
|
|
169
|
+
|
|
170
|
+
1. Parse the YAML frontmatter and require `schema_version: 1`, a valid generation timestamp, valid local-evidence mode, and the documented session fields.
|
|
171
|
+
2. Compare sets exactly:
|
|
172
|
+
- resolved canonical candidates;
|
|
173
|
+
- `covered_model_ids`;
|
|
174
|
+
- canonical IDs in `## Model:` headings.
|
|
175
|
+
They must be identical with no duplicates, missing entries, or extras.
|
|
176
|
+
3. Check every model section contains every required subsection.
|
|
177
|
+
4. Check each model records thinking support, strengths, weaknesses/failure modes, recommended and discouraged roles, latency/cost, confidence, contrary evidence, and dated sources; `Unknown` is valid, omission is not.
|
|
178
|
+
5. Check local-evidence sections contain sample counts/confidence when history exists, or explicitly say cold-start when it does not.
|
|
179
|
+
6. Scan for accidental copied prompts/outputs, secrets, absolute paths, project names, or other identifying session material and remove it.
|
|
180
|
+
7. If any validation fails, fix the guide and rerun validation. If it still cannot pass, fail loudly and list the unmet checks instead of claiming generation succeeded.
|
|
181
|
+
|
|
182
|
+
On success, report the guide path, canonical covered models, local-evidence mode/date range, and validation result. Do not paste the full guide into the conversation.
|