@vercel/dream 0.2.11 → 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 +2 -0
- package/dist/dream.js +64 -6
- package/package.json +9 -3
package/bin/dream.mjs
ADDED
package/dist/dream.js
CHANGED
|
@@ -40,13 +40,13 @@ You are running in an isolated VM with full machine control. You can:
|
|
|
40
40
|
- Run build tools (\`npx next build\`, \`npx vite build\`, \`tsc\`, etc.)
|
|
41
41
|
- Read/write filesystem and execute shell commands
|
|
42
42
|
|
|
43
|
-
Environment variables required by the project are
|
|
43
|
+
Environment variables required by the project are injected into the runtime environment. Validate and use process environment values only. You may inspect env vars for diagnostics, but never print secret values into persistent logs or committed files.
|
|
44
44
|
|
|
45
45
|
## Implementation Artifact Policy
|
|
46
46
|
|
|
47
47
|
1. The deliverable is project source code that satisfies specs.
|
|
48
|
-
2. For Vercel deployment, final build artifacts must conform to Build Output API in \`.vercel/output
|
|
49
|
-
3. Build Output API artifacts
|
|
48
|
+
2. For Vercel deployment, final build artifacts must conform to Build Output API in \`.vercel/output/\`, including a generated \`.vercel/output/config.json\`.
|
|
49
|
+
3. Build Output API artifacts must be generated by the framework/app build pipeline (for example \`vercel build\` or framework-integrated build), not hand-authored as a shortcut.
|
|
50
50
|
4. If required prerequisites are missing (for example env vars, credentials, unavailable services), do not produce a static fallback. Record a blocker in \`PROGRESS.md\` and stop the iteration.
|
|
51
51
|
|
|
52
52
|
## Critical: State Lives on Disk
|
|
@@ -64,13 +64,67 @@ This ensures resumeability across fresh context windows.
|
|
|
64
64
|
Each iteration follows this cycle:
|
|
65
65
|
|
|
66
66
|
1. **Read state**: Read specs + \`PROGRESS.md\` (if present)
|
|
67
|
-
2. **Plan**: If no \`PROGRESS.md\`, create task breakdown from specs. If present, refine tasks based on current state.
|
|
68
|
-
3. **Preflight checks**: Validate required env vars and tool prerequisites from specs before implementation.
|
|
69
|
-
4. **
|
|
67
|
+
2. **Plan**: If no \`PROGRESS.md\`, create task breakdown from specs. If present, refine tasks based on current state. Break work into parallelizable tasks and decide which should be delegated.
|
|
68
|
+
3. **Preflight checks**: Validate required env vars and tool prerequisites from specs before implementation using process environment values only.
|
|
69
|
+
4. **Delegate and execute**: Use subagents aggressively for independent tasks while you manage orchestration, integration, and final decisions.
|
|
70
70
|
5. **Update**: Mark completed tasks and note blockers/assumptions in \`PROGRESS.md\`.
|
|
71
71
|
6. **Verify**: Run required checks from specs (build/test/contract checks for changed surface).
|
|
72
72
|
7. **Stop or complete**: If all tasks are done, output completion signal. Otherwise stop for the next iteration.
|
|
73
73
|
|
|
74
|
+
## Subagent-First Execution
|
|
75
|
+
|
|
76
|
+
You are the manager agent. Your default is to delegate implementation to subagents to maximize parallelism and reduce wall-clock time.
|
|
77
|
+
|
|
78
|
+
### Decompose into Bounded Tasks
|
|
79
|
+
|
|
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).
|
|
127
|
+
|
|
74
128
|
## PROGRESS.md Format
|
|
75
129
|
|
|
76
130
|
\`\`\`markdown
|
|
@@ -545,6 +599,10 @@ ${INDENT_SESSION}`);
|
|
|
545
599
|
const cost = totalCost > 0 ? ` \xB7 $${totalCost.toFixed(2)}` : "";
|
|
546
600
|
printSessionDim(`${toolCalls} tools \xB7 ${tokens}${cost}`);
|
|
547
601
|
if (responseText.length === 0) {
|
|
602
|
+
if (toolCalls > 0) {
|
|
603
|
+
printSessionDim("no text response, continuing...");
|
|
604
|
+
return "continue";
|
|
605
|
+
}
|
|
548
606
|
printSessionError("No response from model");
|
|
549
607
|
return "error";
|
|
550
608
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/dream",
|
|
3
|
-
"version": "0.2.
|
|
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": "./
|
|
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",
|
|
@@ -31,6 +32,11 @@
|
|
|
31
32
|
],
|
|
32
33
|
"author": "",
|
|
33
34
|
"license": "MIT",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/vercel/dream.git",
|
|
38
|
+
"directory": "packages/dream"
|
|
39
|
+
},
|
|
34
40
|
"scripts": {
|
|
35
41
|
"build": "tsup",
|
|
36
42
|
"dev": "tsx bin/dream.ts",
|