create-deepagent-server 0.2.0 → 1.0.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 CHANGED
@@ -101,6 +101,7 @@ my-agent/
101
101
  ├── scripts/ # 交互终端 + 预检脚本
102
102
  ├── deployment/ # Dockerfile + docker-compose
103
103
  ├── .editorconfig
104
+ ├── .env # 已生成,填入 MODEL_API_KEY
104
105
  ├── .env.example
105
106
  ├── package.json
106
107
  └── tsconfig.json # 仅 TypeScript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-deepagent-server",
3
- "version": "0.2.0",
3
+ "version": "1.0.0",
4
4
  "description": "快速创建生产可用的 Deep Agents(deepagents + LangGraph)项目,支持 JavaScript/TypeScript,仅使用 ESM。",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -58,10 +58,7 @@ const printNextSteps = ({ targetDir, cwd, packageManager, installed, language })
58
58
  console.log(` ${installCommandText(packageManager)}`);
59
59
  }
60
60
 
61
- const copyEnvCommand =
62
- process.platform === "win32" ? "copy .env.example .env" : "cp .env.example .env";
63
-
64
- console.log(` ${copyEnvCommand} ${dim("# 填入 MODEL_API_KEY")}`);
61
+ console.log(` ${dim("# 编辑 .env,填入 MODEL_API_KEY")}`);
65
62
  console.log(` ${runScriptText(packageManager, "check")} ${dim("# 可选:环境预检")}`);
66
63
  console.log(
67
64
  ` ${runScriptText(packageManager, "dev")} ${dim("# http://localhost:3000/health")}`,
package/src/scaffold.js CHANGED
@@ -174,6 +174,21 @@ export const scaffold = async ({
174
174
  );
175
175
  writtenFiles.push("package.json");
176
176
 
177
+ // 默认生成可直接编辑的 .env;写入已有目录(--force)时不覆盖用户配置。
178
+ const envCreated = await fs
179
+ .copyFile(
180
+ path.join(targetDir, ".env.example"),
181
+ path.join(targetDir, ".env"),
182
+ fs.constants.COPYFILE_EXCL,
183
+ )
184
+ .then(() => true)
185
+ .catch((error) => {
186
+ if (error?.code === "EEXIST") return false;
187
+ throw error;
188
+ });
189
+
190
+ if (envCreated) writtenFiles.push(".env");
191
+
177
192
  return {
178
193
  targetDir,
179
194
  files: writtenFiles.sort(),
package/src/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.2.0";
1
+ export const VERSION = "1.0.0";
@@ -12,7 +12,7 @@
12
12
  ## 快速开始
13
13
 
14
14
  ```bash
15
- cp .env.example .env # 填入 MODEL_API_KEY(示例默认 MiniMax M3)
15
+ # .env 已自动生成,填入 MODEL_API_KEY 即可(示例默认 MiniMax M3)
16
16
  npm run check # 可选:启动前环境检查
17
17
  npm run dev # http://localhost:3000/health
18
18
  ```