@vercel/dream 0.2.4 → 0.2.5
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/dream.js +4 -21
- package/package.json +4 -8
package/dist/dream.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as fs from "fs";
|
|
5
5
|
import * as path from "path";
|
|
6
6
|
import { createOpencode } from "@opencode-ai/sdk/v2";
|
|
7
|
+
import { init } from "@vercel/dream-init";
|
|
7
8
|
import { program } from "commander";
|
|
8
9
|
var STOP_WORD = "<DREAM DONE>";
|
|
9
10
|
var SYSTEM_PROMPT = `# Dream Agent
|
|
@@ -167,34 +168,16 @@ var log = console.log;
|
|
|
167
168
|
program.name("dream").description("Run OpenCode in a loop until specs are complete").version("0.1.0").option("-d, --dir <directory>", "Working directory", ".");
|
|
168
169
|
program.command("init").description("Initialize a new dream project").action(() => {
|
|
169
170
|
const workDir = path.resolve(program.opts().dir);
|
|
170
|
-
const specsDir = path.join(workDir, "specs");
|
|
171
|
-
const packageJsonPath = path.join(workDir, "package.json");
|
|
172
171
|
log(`
|
|
173
172
|
${bold("\u25B2 dream")} ${dim("\xB7 init")}
|
|
174
173
|
`);
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
if (!fs.existsSync(specsDir)) {
|
|
179
|
-
fs.mkdirSync(specsDir);
|
|
180
|
-
fs.writeFileSync(
|
|
181
|
-
path.join(specsDir, "sample.md"),
|
|
182
|
-
"# Sample Spec\n\n## Context\n\nDescribe what you want to build here.\n\n## Tasks\n\n- [ ] First task\n- [ ] Second task\n"
|
|
183
|
-
);
|
|
174
|
+
const result = init({ dir: workDir, version: "^0.2.1" });
|
|
175
|
+
if (result.specsCreated) {
|
|
184
176
|
log(` ${green("+")} specs/sample.md`);
|
|
185
177
|
} else {
|
|
186
178
|
log(` ${dim("\xB7")} specs/ ${dim("already exists")}`);
|
|
187
179
|
}
|
|
188
|
-
if (
|
|
189
|
-
const pkg = {
|
|
190
|
-
name: path.basename(workDir),
|
|
191
|
-
version: "0.1.0",
|
|
192
|
-
private: true,
|
|
193
|
-
scripts: { build: "dream" },
|
|
194
|
-
dependencies: { "@vercel/dream": "^0.1.0" }
|
|
195
|
-
};
|
|
196
|
-
fs.writeFileSync(packageJsonPath, `${JSON.stringify(pkg, null, " ")}
|
|
197
|
-
`);
|
|
180
|
+
if (result.packageJsonCreated) {
|
|
198
181
|
log(` ${green("+")} package.json`);
|
|
199
182
|
} else {
|
|
200
183
|
log(` ${dim("\xB7")} package.json ${dim("already exists")}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/dream",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "A CLI that runs OpenCode in a loop until specs are complete",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -14,13 +14,11 @@
|
|
|
14
14
|
"@opencode-ai/sdk": "^1.1.0",
|
|
15
15
|
"agent-browser": ">=0.9.0",
|
|
16
16
|
"commander": "^12.0.0",
|
|
17
|
-
"opencode-ai": ">=1.0.0"
|
|
17
|
+
"opencode-ai": ">=1.0.0",
|
|
18
|
+
"@vercel/dream-init": "0.2.1"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
|
-
"@biomejs/biome": "^1.9.0",
|
|
21
|
-
"@changesets/cli": "^2.29.8",
|
|
22
21
|
"@types/node": "^22.0.0",
|
|
23
|
-
"lefthook": "^2.1.0",
|
|
24
22
|
"tsup": "^8.5.1",
|
|
25
23
|
"tsx": "^4.0.0",
|
|
26
24
|
"typescript": "^5.4.0"
|
|
@@ -37,8 +35,6 @@
|
|
|
37
35
|
"build": "tsup",
|
|
38
36
|
"dev": "tsx bin/dream.ts",
|
|
39
37
|
"check": "biome check .",
|
|
40
|
-
"check:fix": "biome check --write ."
|
|
41
|
-
"version": "changeset version",
|
|
42
|
-
"release": "pnpm build && changeset publish"
|
|
38
|
+
"check:fix": "biome check --write ."
|
|
43
39
|
}
|
|
44
40
|
}
|