@wrongstack/core 0.275.1 → 0.276.3
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/dist/{agent-bridge-D9JkPvJ0.d.ts → agent-bridge-D7A-eu3C.d.ts} +1 -1
- package/dist/{agent-subagent-runner-CArSFKFl.d.ts → agent-subagent-runner-CEuw4ATz.d.ts} +16 -10
- package/dist/{brain-DCkB5_e7.d.ts → brain-BLOyN5ZP.d.ts} +127 -1
- package/dist/{compactor-CzSvxM1g.d.ts → compactor-DcBpaJsI.d.ts} +1 -1
- package/dist/{config-BzFRKkg7.d.ts → config-Bf5mj-ad.d.ts} +20 -2
- package/dist/{context-BrLe8pJy.d.ts → context-CLnUMW5g.d.ts} +40 -2
- package/dist/coordination/index.d.ts +43 -24
- package/dist/coordination/index.js +849 -648
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +28 -28
- package/dist/defaults/index.js +1636 -845
- package/dist/defaults/index.js.map +1 -1
- package/dist/execution/index.d.ts +16 -16
- package/dist/execution/index.js +218 -49
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/prompt-enhancer.d.ts +1 -1
- package/dist/extension/index.d.ts +7 -7
- package/dist/extension/index.js.map +1 -1
- package/dist/{global-mailbox-CXkugtNQ.d.ts → global-mailbox-Iqfkgmwu.d.ts} +3 -3
- package/dist/{goal-store-DUwdbdoY.d.ts → goal-store-DGb6b5Ed.d.ts} +1 -1
- package/dist/hq/index.d.ts +6 -6
- package/dist/hq/index.js +178 -75
- package/dist/hq/index.js.map +1 -1
- package/dist/{index-CtlizLTK.d.ts → index-Cn0NOshr.d.ts} +10 -5
- package/dist/{index-neOCEy6q.d.ts → index-L4RZN9jJ.d.ts} +2 -2
- package/dist/index.d.ts +56 -48
- package/dist/index.js +2789 -1546
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +6 -6
- package/dist/infrastructure/index.js +26 -7
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +20 -12
- package/dist/kernel/index.js +55 -9
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mailbox-types-_7gaY0Rl.d.ts → mailbox-types-DTl7bRH3.d.ts} +3 -1
- package/dist/{mcp-servers-MLL6bMlv.d.ts → mcp-servers-CuZGf9fI.d.ts} +4 -4
- package/dist/models/index.d.ts +5 -5
- package/dist/models/index.js +223 -139
- package/dist/models/index.js.map +1 -1
- package/dist/{models-registry-CrkcxQ-g.d.ts → models-registry-8XOdxWQu.d.ts} +16 -1
- package/dist/{multi-agent-coordinator-Dc_HuG9p.d.ts → multi-agent-coordinator-CiRtKVTk.d.ts} +8 -1
- package/dist/{null-fleet-bus-BMZwMin7.d.ts → null-fleet-bus-d9G-bVy9.d.ts} +26 -22
- package/dist/observability/index.d.ts +2 -2
- package/dist/{path-resolver-uVK4BatM.d.ts → path-resolver-BhIb6mtd.d.ts} +8 -3
- package/dist/{permission-CJR1qfOi.d.ts → permission-BCbQDR2s.d.ts} +1 -1
- package/dist/{permission-policy-DLVKKk4w.d.ts → permission-policy-C0ikndX_.d.ts} +2 -18
- package/dist/{pipeline-BYR-Vdau.d.ts → pipeline-Dl6XbfE7.d.ts} +10 -6
- package/dist/{provider-model-resolve-iREK_1lG.d.ts → provider-model-resolve-B70epO19.d.ts} +3 -3
- package/dist/{provider-runner-i7SQXZuC.d.ts → provider-runner-DZ808MSM.d.ts} +3 -3
- package/dist/{retry-policy-BmY5ooh3.d.ts → retry-policy-Dt3_z8Aj.d.ts} +1 -1
- package/dist/sdd/index.d.ts +19 -10
- package/dist/sdd/index.js +411 -240
- package/dist/sdd/index.js.map +1 -1
- package/dist/{secret-vault-C9leEMzr.d.ts → secret-vault-BUJ2d1gB.d.ts} +1 -1
- package/dist/security/index.d.ts +5 -5
- package/dist/security/index.js +30 -6
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-qjpee9BF.d.ts → selector-BCkWgdwy.d.ts} +1 -1
- package/dist/{session-event-bridge-m7y--I-H.d.ts → session-event-bridge-CMvIO59_.d.ts} +1 -1
- package/dist/{session-reader-BjLH4V9n.d.ts → session-reader-C8aiChUu.d.ts} +1 -1
- package/dist/skills/index.js +1 -0
- package/dist/skills/index.js.map +1 -1
- package/dist/storage/index.d.ts +68 -30
- package/dist/storage/index.js +839 -528
- package/dist/storage/index.js.map +1 -1
- package/dist/{strategy-compactor-C2bmlWYg.d.ts → strategy-compactor-DI1OHVbB.d.ts} +10 -10
- package/dist/{todos-checkpoint-oDS9IBNS.d.ts → todos-checkpoint-Ddd2CGr0.d.ts} +56 -9
- package/dist/{tool-executor-D4YdaJ-M.d.ts → tool-executor-Bmd5Ygoo.d.ts} +45 -10
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/types/index.d.ts +20 -20
- package/dist/types/index.js +331 -98
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +16 -3
- package/dist/utils/index.js +159 -83
- package/dist/utils/index.js.map +1 -1
- package/dist/{worktree-manager-A1Efnvs0.d.ts → worktree-manager-DBdl_5rs.d.ts} +4 -1
- package/instructions/agents/shadow-agent.md +3 -3
- package/instructions/coordination/director-preamble.md +3 -3
- package/instructions/modes/research-web.md +4 -4
- package/package.json +1 -1
- package/skills/research-web/SKILL.md +26 -26
- package/skills/research-web/SKILL.save.md +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EventBus } from './brain-
|
|
1
|
+
import { E as EventBus } from './brain-BLOyN5ZP.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Lifecycle of a single worktree handle.
|
|
@@ -73,6 +73,7 @@ interface RunResult {
|
|
|
73
73
|
interface WorktreeManagerOptions {
|
|
74
74
|
projectRoot: string;
|
|
75
75
|
events?: EventBus | undefined;
|
|
76
|
+
sessionId?: string | (() => string | undefined) | undefined;
|
|
76
77
|
gitBin?: string | undefined;
|
|
77
78
|
/**
|
|
78
79
|
* Test seam. When provided, replaces the real `git` spawn so the manager's
|
|
@@ -89,6 +90,7 @@ interface WorktreeManagerOptions {
|
|
|
89
90
|
declare class WorktreeManager {
|
|
90
91
|
private readonly projectRoot;
|
|
91
92
|
private readonly events?;
|
|
93
|
+
private readonly sessionIdSource;
|
|
92
94
|
private readonly gitBin;
|
|
93
95
|
private readonly runGit;
|
|
94
96
|
/** Keyed by ownerId. */
|
|
@@ -262,6 +264,7 @@ declare class WorktreeManager {
|
|
|
262
264
|
private fail;
|
|
263
265
|
private setStatus;
|
|
264
266
|
private emit;
|
|
267
|
+
private currentSessionId;
|
|
265
268
|
private defaultRun;
|
|
266
269
|
}
|
|
267
270
|
/** Throw if `dir` resolves outside `projectRoot`. */
|
|
@@ -6,7 +6,7 @@ Your job is to inspect the fleet when the host explicitly assigns a Shadow pass,
|
|
|
6
6
|
|
|
7
7
|
1. **Fleet Monitoring** (host-assigned one-shot checks)
|
|
8
8
|
- The host assigns one-shot check tasks; it does not expect routine heartbeats
|
|
9
|
-
- On each assigned check, call `
|
|
9
|
+
- On each assigned check, call `fleet` with `action: "status"` and `action: "health"`
|
|
10
10
|
- Track what each agent is doing (task descriptions)
|
|
11
11
|
- Detect stuck agents (>5min no events), idle agents, crashed agents
|
|
12
12
|
|
|
@@ -95,7 +95,7 @@ When `hoop` command received:
|
|
|
95
95
|
|
|
96
96
|
## Startup Sequence
|
|
97
97
|
|
|
98
|
-
1. Run one fleet snapshot with `
|
|
98
|
+
1. Run one fleet snapshot with `fleet` (`action: "status"` + `action: "health"`)
|
|
99
99
|
2. Check `mail_inbox` for explicit control messages
|
|
100
100
|
3. If healthy, do not send mail; final answer may be exactly `shadow: quiet`
|
|
101
101
|
|
|
@@ -106,6 +106,6 @@ When `hoop` command received:
|
|
|
106
106
|
|
|
107
107
|
## Skills in scope
|
|
108
108
|
|
|
109
|
-
-
|
|
109
|
+
- fleet (action: status/health) — for fleet snapshots
|
|
110
110
|
- terminate_subagent — for intervention
|
|
111
111
|
- mail_send, mail_inbox — for messaging and monitoring
|
|
@@ -9,8 +9,8 @@ Core fleet tools available to you:
|
|
|
9
9
|
- ask_subagent — synchronously query a running subagent via the bridge
|
|
10
10
|
- roll_up — aggregate finished tasks into a markdown/json summary
|
|
11
11
|
- terminate_subagent — abort a stuck worker (use sparingly)
|
|
12
|
-
-
|
|
13
|
-
-
|
|
12
|
+
- fleet — snapshot of all subagents and pending tasks (action: status)
|
|
13
|
+
- fleet — token + cost breakdown per subagent and total (action: usage)
|
|
14
14
|
|
|
15
15
|
Working rules:
|
|
16
16
|
1. Decompose first. Before spawning, decide which sub-tasks are
|
|
@@ -22,7 +22,7 @@ Working rules:
|
|
|
22
22
|
the user a single coherent answer at the end.
|
|
23
23
|
4. Roll up before deciding. After await_tasks resolves, call roll_up so
|
|
24
24
|
the results are folded back into your context in a compact form.
|
|
25
|
-
5. Budget is real. Check
|
|
25
|
+
5. Budget is real. Check `fleet` with `action: "usage"` periodically. If a subagent is
|
|
26
26
|
thrashing, terminate it rather than letting cost climb silently.
|
|
27
27
|
6. Never claim a subagent's work as your own without verifying it. If a
|
|
28
28
|
result looks wrong, ask_subagent for clarification before passing it
|
|
@@ -12,8 +12,8 @@ changes must be verified against live sources.
|
|
|
12
12
|
- You realize your knowledge may be >6 months old on a fast-moving topic
|
|
13
13
|
|
|
14
14
|
### Research methodology
|
|
15
|
-
1. **Search first, fetch selectively.** Use
|
|
16
|
-
broad queries. Then
|
|
15
|
+
1. **Search first, fetch selectively.** Use `search` with 5-8 results for
|
|
16
|
+
broad queries. Then `fetch` the 1-2 most authoritative results for detail.
|
|
17
17
|
Don't fetch every result — you'll burn tokens on noise.
|
|
18
18
|
2. **Cross-reference.** One source is a data point. Two sources that agree
|
|
19
19
|
is a signal. Three is confirmation. Flag single-source claims as tentative.
|
|
@@ -30,9 +30,9 @@ changes must be verified against live sources.
|
|
|
30
30
|
When you discover current data mid-research, inject it so subsequent turns
|
|
31
31
|
benefit without re-searching:
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
search("Next.js middleware breaking changes 2025")
|
|
34
34
|
→ Surfaced: Next.js 15.2 changed middleware runtime from edge to node
|
|
35
|
-
|
|
35
|
+
fetch("https://nextjs.org/docs/messages/middleware-upgrade-guide")
|
|
36
36
|
→ Confirmed: middleware now runs on Node.js runtime by default
|
|
37
37
|
context_manager: add_note(
|
|
38
38
|
"## Research: Next.js middleware
|
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@ provides the deep methodology and patterns the mode prompt can't fit.
|
|
|
32
32
|
4. Respect the stop rule. 2-3 searches + 1-2 fetches per topic. If no clear
|
|
33
33
|
answer after that, surface the ambiguity rather than research-looping.
|
|
34
34
|
5. Cite every claim. Domain name minimum; date if visible on the page.
|
|
35
|
-
6. Match tool to task. `
|
|
35
|
+
6. Match tool to task. `search` for discovery, `fetch` for detail,
|
|
36
36
|
`fetch` for raw API responses, `search` for source-code-specific queries.
|
|
37
37
|
|
|
38
38
|
## Research Workflow Taxonomy
|
|
@@ -43,8 +43,8 @@ Not every research task needs the same approach. Match the workflow to the need:
|
|
|
43
43
|
**When**: "What's the latest version of React?" "Is package X still maintained?"
|
|
44
44
|
**Pattern**:
|
|
45
45
|
```
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
search("React latest stable version 2025") → discover version
|
|
47
|
+
fetch("https://react.dev/versions") → confirm from authoritative source
|
|
48
48
|
context_manager add_note("## Research: React version\n- 19.2.0 (March 2025)\n- Source: react.dev")
|
|
49
49
|
```
|
|
50
50
|
**Budget**: 1 search + 1 fetch = ~2000 tokens. Done in one turn.
|
|
@@ -53,8 +53,8 @@ context_manager add_note("## Research: React version\n- 19.2.0 (March 2025)\n- S
|
|
|
53
53
|
**When**: "How has Next.js middleware changed across 14.x → 15.x?"
|
|
54
54
|
**Pattern**:
|
|
55
55
|
```
|
|
56
|
-
Turn 1:
|
|
57
|
-
Turn 2:
|
|
56
|
+
Turn 1: search("Next.js middleware changes 14 to 15") → collect URLs
|
|
57
|
+
Turn 2: fetch(upgrade guide), fetch(changelog) → parallel fetches
|
|
58
58
|
Turn 3: cross-reference, inject structured findings
|
|
59
59
|
```
|
|
60
60
|
**Budget**: 2 searches + 2-3 fetches = ~5000 tokens. Use parallel fetches.
|
|
@@ -68,10 +68,10 @@ See "Subagent Delegation" section below.
|
|
|
68
68
|
|
|
69
69
|
| Tool | Best for | Avoid for |
|
|
70
70
|
|------|----------|-----------|
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `search` | Technical docs, source code, API references (DuckDuckGo) | General web queries (use `
|
|
74
|
-
| `fetch` | Raw API responses (JSON), registry endpoints, structured data | HTML pages (use `
|
|
71
|
+
| `search` | Broad discovery, finding current URLs, getting an overview | Deep detail (use `fetch` after) |
|
|
72
|
+
| `fetch` | Reading a specific page for detail, authoritative confirmation | Broad queries (use `search` first) |
|
|
73
|
+
| `search` | Technical docs, source code, API references (DuckDuckGo) | General web queries (use `search`) |
|
|
74
|
+
| `fetch` | Raw API responses (JSON), registry endpoints, structured data | HTML pages (use `fetch` for markdown conversion) |
|
|
75
75
|
| `context_manager` | Injecting research findings into conversation for future turns | Research itself (this is the *output* tool) |
|
|
76
76
|
|
|
77
77
|
### Decision heuristic
|
|
@@ -83,7 +83,7 @@ See "Subagent Delegation" section below.
|
|
|
83
83
|
▼ ▼ ▼
|
|
84
84
|
"Discover URLs" "Read a page" "Raw API data"
|
|
85
85
|
│ │ │
|
|
86
|
-
|
|
86
|
+
search fetch fetch
|
|
87
87
|
│ │
|
|
88
88
|
└────────┬───────┘
|
|
89
89
|
▼
|
|
@@ -238,8 +238,8 @@ Source A (GitHub issue comment): "This API is being removed in v4"
|
|
|
238
238
|
|
|
239
239
|
| Action | Approximate cost | When to use |
|
|
240
240
|
|--------|-----------------|-------------|
|
|
241
|
-
| `
|
|
242
|
-
| `
|
|
241
|
+
| `search` (5 results) | ~500 tokens | Always first — cheap discovery |
|
|
242
|
+
| `fetch` (single page) | ~1000-2000 tokens | Only for authoritative sources |
|
|
243
243
|
| `context_manager add_note` | ~0 tokens (metadata op) | After every research cycle |
|
|
244
244
|
| `delegate` (quick lookup subagent) | ~$0.05-0.15 | When research would bloat your context |
|
|
245
245
|
| `delegate` (deep investigation) | ~$0.20-0.50 | Landscape surveys only |
|
|
@@ -254,7 +254,7 @@ architecture decision might be worth $2.00.
|
|
|
254
254
|
|
|
255
255
|
```typescript
|
|
256
256
|
// ❌ Turn 5: Agent forgets it already researched React version
|
|
257
|
-
|
|
257
|
+
search("React latest version")
|
|
258
258
|
|
|
259
259
|
// ✅ Turn 2: Agent injected findings via add_note
|
|
260
260
|
// Turn 3-5: Agent sees the note in conversation — skips re-search
|
|
@@ -264,11 +264,11 @@ web_search("React latest version")
|
|
|
264
264
|
|
|
265
265
|
```typescript
|
|
266
266
|
// ❌ Guessing URLs wastes fetches
|
|
267
|
-
|
|
267
|
+
fetch("https://react.dev/blog/2025/03/15/react-19-2") // 404
|
|
268
268
|
|
|
269
269
|
// ✅ Search discovers the real URL first
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
search("React 19.2 release blog post")
|
|
271
|
+
fetch(<result from search>)
|
|
272
272
|
```
|
|
273
273
|
|
|
274
274
|
### Injecting raw dumps
|
|
@@ -296,16 +296,16 @@ One 2023 article suggests X, but this appears outdated."
|
|
|
296
296
|
|
|
297
297
|
```typescript
|
|
298
298
|
// ❌ 7 searches on the same topic, each slightly rephrased
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
299
|
+
search("React 19 new features")
|
|
300
|
+
search("React 19 what changed")
|
|
301
|
+
search("React 19 release notes changes")
|
|
302
|
+
search("React 19 difference from 18")
|
|
303
303
|
// ...
|
|
304
304
|
|
|
305
305
|
// ✅ 1-2 broad searches, then targeted fetches
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
306
|
+
search("React 19 release notes breaking changes")
|
|
307
|
+
fetch(<react.dev blog>)
|
|
308
|
+
fetch(<GitHub releases>)
|
|
309
309
|
// Done. Inject findings.
|
|
310
310
|
```
|
|
311
311
|
|
|
@@ -314,7 +314,7 @@ web_fetch(<GitHub releases>)
|
|
|
314
314
|
```typescript
|
|
315
315
|
// ❌ User asks for a quick null-check fix, agent starts web searching
|
|
316
316
|
User: "fix the null deref in auth.ts line 42"
|
|
317
|
-
Agent:
|
|
317
|
+
Agent: search("TypeScript null check best practices") // NO
|
|
318
318
|
|
|
319
319
|
// ✅ Research mode is for analysis/discussion phases, not tactical edits
|
|
320
320
|
// The agent already knows how to fix a null deref — just fix it.
|
|
@@ -325,8 +325,8 @@ Agent: web_search("TypeScript null check best practices") // NO
|
|
|
325
325
|
```
|
|
326
326
|
1. TRIGGER — User asks for current data OR agent realizes knowledge is stale
|
|
327
327
|
2. CLASSIFY — Quick lookup? Deep investigation? Landscape survey?
|
|
328
|
-
3. SEARCH —
|
|
329
|
-
4. FETCH —
|
|
328
|
+
3. SEARCH — search with 5-8 results for broad discovery
|
|
329
|
+
4. FETCH — fetch 1-2 authoritative results for detail (parallelize if >1)
|
|
330
330
|
5. VALIDATE — Cross-reference: 2+ sources agree? Flag single-source claims
|
|
331
331
|
6. INJECT — context_manager add_note with structured findings
|
|
332
332
|
7. CITE — In your response, cite sources for every factual claim
|
|
@@ -8,7 +8,7 @@ Conducts current-data web research with discipline: when to search, how to cross
|
|
|
8
8
|
2. Two-source minimum: single-source is tentative, two agreeing is signal.
|
|
9
9
|
3. Inject, don't repeat — use context_manager add_note after research.
|
|
10
10
|
4. Respect the stop rule: 2-3 searches + 1-2 fetches per topic.
|
|
11
|
-
5. Match tool to task:
|
|
11
|
+
5. Match tool to task: search/fetch for discovery, search/fetch for detail.
|
|
12
12
|
|
|
13
13
|
## Workflow
|
|
14
14
|
|