@vercel/dream 0.2.12 → 0.2.13

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/bin/dream.mjs ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ await import("../dist/dream.js");
package/dist/dream.js CHANGED
@@ -73,16 +73,57 @@ Each iteration follows this cycle:
73
73
 
74
74
  ## Subagent-First Execution
75
75
 
76
- Treat yourself as the manager agent. Your default execution model is to delegate implementation to subagents whenever it can reduce wall-clock time.
76
+ You are the manager agent. Your default is to delegate implementation to subagents to maximize parallelism and reduce wall-clock time.
77
77
 
78
- 1. Decompose requested work into bounded tasks with clear inputs/outputs.
79
- 2. Run independent tasks in parallel using multiple subagents.
80
- 3. Keep shared-state edits coordinated: assign file ownership or sequence dependent steps to avoid conflicts.
81
- 4. Reserve manager-only responsibilities for orchestration: planning, assigning work, resolving conflicts, integrating changes, and final verification.
82
- 5. After subagents finish, validate results, apply fixes for integration issues, then run required checks.
83
- 6. If a task is small but blocks a broader parallel plan, still delegate it when practical to keep throughput high.
78
+ ### Decompose into Bounded Tasks
84
79
 
85
- Prefer subagent parallelism over sequential single-agent implementation unless tasks are tightly coupled or delegation overhead is clearly higher than direct execution.
80
+ 1. Group work by independent domain \u2014 different routes, subsystems, or data models are natural boundaries.
81
+ 2. Each task must have a clear input (what exists), output (what should exist after), and scope (which files to touch).
82
+ 3. If two tasks must edit the same file, sequence them \u2014 never dispatch parallel subagents to the same file.
83
+ 4. If tasks are tightly coupled or you don't yet understand the problem, investigate sequentially first, then parallelize.
84
+
85
+ ### Subagent Prompt Template
86
+
87
+ When dispatching a subagent, provide a self-contained prompt with this structure:
88
+
89
+ \`\`\`
90
+ You are implementing: [task name]
91
+
92
+ ## Task
93
+ [Full text of what to build \u2014 paste requirements inline, never tell subagent to read spec files]
94
+
95
+ ## Context
96
+ [Where this fits: what already exists, dependencies, architectural constraints from specs]
97
+
98
+ ## Scope
99
+ - Files you may create/edit: [explicit list]
100
+ - Files you must NOT touch: [explicit list or "anything not listed above"]
101
+
102
+ ## Constraints
103
+ [Framework requirements, env var rules, forbidden patterns from specs]
104
+
105
+ ## When Done
106
+ Report: what you implemented, files changed, commands to verify, any issues or blockers found.
107
+ \`\`\`
108
+
109
+ Key rules:
110
+ - Provide all context inline \u2014 subagents start with empty context and cannot read your history.
111
+ - Be specific about file scope to prevent edit conflicts between parallel subagents.
112
+ - Include verification commands so the subagent can self-check before reporting.
113
+ - If a subagent encounters something unclear, it should report a blocker rather than guess.
114
+
115
+ ### After Subagents Return
116
+
117
+ 1. Read each subagent's report. Do not trust claims blindly \u2014 verify against actual files.
118
+ 2. Check for conflicts: did any subagent edit files outside its scope or overlap with another?
119
+ 3. Run integration verification (build, type check, tests) on the combined changes.
120
+ 4. Fix integration issues yourself \u2014 do not re-dispatch for small glue work.
121
+
122
+ ### When NOT to Parallelize
123
+
124
+ - Tasks share mutable state (same database migration, same config file).
125
+ - You are debugging \u2014 investigate root cause sequentially before dispatching fixes.
126
+ - The overhead of writing a self-contained prompt exceeds the time saved by parallelism (trivial single-file edits).
86
127
 
87
128
  ## PROGRESS.md Format
88
129
 
@@ -558,6 +599,10 @@ ${INDENT_SESSION}`);
558
599
  const cost = totalCost > 0 ? ` \xB7 $${totalCost.toFixed(2)}` : "";
559
600
  printSessionDim(`${toolCalls} tools \xB7 ${tokens}${cost}`);
560
601
  if (responseText.length === 0) {
602
+ if (toolCalls > 0) {
603
+ printSessionDim("no text response, continuing...");
604
+ return "continue";
605
+ }
561
606
  printSessionError("No response from model");
562
607
  return "error";
563
608
  }
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@vercel/dream",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "description": "A CLI that runs OpenCode in a loop until specs are complete",
5
5
  "type": "module",
6
6
  "bin": {
7
- "dream": "./dist/dream.js"
7
+ "dream": "./bin/dream.mjs"
8
8
  },
9
9
  "files": [
10
- "dist"
10
+ "dist",
11
+ "bin/dream.mjs"
11
12
  ],
12
13
  "dependencies": {
13
14
  "@ai-sdk/gateway": "^3.0.39",