create-done-coding 0.11.24-alpha.3 → 0.11.24-alpha.4

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/es/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { c as m } from "./main-8a95c6cc.js";
2
+ import { c as m } from "./main-e22325b3.js";
3
3
  import "@done-coding/cli-utils";
4
4
  import "node:fs";
5
5
  import "node:path";
package/es/index.mjs CHANGED
@@ -1,38 +1,38 @@
1
1
  #!/usr/bin/env node
2
- import { i as r, F as n, g as c } from "./main-8a95c6cc.js";
3
- import { G as j, S as w, e as G, a as I, b as O, h as H, d as J } from "./main-8a95c6cc.js";
4
- import { outputConsole as i, hijackChildProcess as p, params2cliParams as l, updateEnvConfig as u } from "@done-coding/cli-utils";
5
- import { getMcpCommonToolParams as d, createServer as g } from "@done-coding/mcp-utils";
6
- import { fileURLToPath as f } from "node:url";
2
+ import { i as s, F as n, g as c } from "./main-e22325b3.js";
3
+ import { G as S, S as j, e as G, a as M, b as I, h as O, d as H } from "./main-e22325b3.js";
4
+ import { outputConsole as i, hijackChildProcess as l, params2cliParams as p, updateEnvConfig as u } from "@done-coding/cli-utils";
5
+ import { createServer as d } from "@done-coding/mcp-utils";
6
+ import { fileURLToPath as g } from "node:url";
7
7
  import a from "node:path";
8
8
  import "node:fs";
9
9
  import "@done-coding/cli-template";
10
10
  import "@done-coding/cli-git";
11
11
  import "node:child_process";
12
- const C = f(import.meta.url), T = a.dirname(C), E = [
13
- (o, s) => o.registerTool(
14
- r.cliConfig.moduleName,
12
+ const f = g(import.meta.url), C = a.dirname(f), E = [
13
+ (o, r) => o.registerTool(
14
+ s.cliConfig.moduleName,
15
15
  {
16
- title: `创建项目工具 - ${r.name}`,
16
+ title: `创建项目工具 - ${s.name}`,
17
17
  description: "根据用户提供的项目名称、模板地址和分支创建新项目",
18
- inputSchema: s.object({
19
- [n.PROJECT_NAME]: s.string().min(1, "项目名称不能为空").describe("项目名称"),
20
- [n.TEMPLATE_GIT_PATH]: s.string().min(1, "模板仓库地址不能为空").describe("模板仓库地址"),
21
- [n.TEMPLATE_GIT_BRANCH]: s.string().optional().describe("对应的 Git 分支名称"),
22
- ...d(s)
18
+ inputSchema: r.object({
19
+ [n.PROJECT_NAME]: r.string().min(1, "项目名称不能为空").describe("项目名称"),
20
+ [n.TEMPLATE_GIT_PATH]: r.string().min(1, "模板仓库地址不能为空").describe("模板仓库地址"),
21
+ [n.TEMPLATE_GIT_BRANCH]: r.string().optional().describe("对应的 Git 分支名称"),
22
+ cwd: r.string().min(1, "创建项目的目录绝对路径不能为空").describe("创建项目的目录绝对路径")
23
23
  })
24
24
  },
25
25
  async (e) => {
26
- i.info(`当前运行目录: ${process.cwd()}`);
26
+ i.info(`当前运行目录: ${e.cwd}`);
27
27
  try {
28
28
  const t = {
29
29
  ...e,
30
30
  skipTemplateCompile: !0,
31
31
  openGitDetailOptimize: !1
32
- }, m = a.resolve(T, "./cli.mjs");
33
- return await p({
32
+ }, m = a.resolve(C, "./cli.mjs");
33
+ return await l({
34
34
  command: "node",
35
- args: [m, ...l(t)],
35
+ args: [m, ...p(t)],
36
36
  cwd: e.cwd,
37
37
  env: process.env
38
38
  }), i.success("项目创建成功"), {
@@ -53,22 +53,22 @@ const C = f(import.meta.url), T = a.dirname(C), E = [
53
53
  }
54
54
  }
55
55
  )
56
- ], h = [
56
+ ], T = [
57
57
  (o) => o.registerResource(
58
- `${r.cliConfig.moduleName}/templates`,
59
- `resource:///${r.cliConfig.moduleName}/templates`,
58
+ `${s.cliConfig.moduleName}/templates`,
59
+ `resource:///${s.cliConfig.moduleName}/templates`,
60
60
  {
61
61
  title: "可用项目模板列表",
62
62
  description: "包含所有可用的项目模板信息、仓库地址及可选分支"
63
63
  },
64
- async (s) => {
64
+ async (r) => {
65
65
  try {
66
66
  i.stage("获取可用项目模板列表");
67
67
  const e = await c();
68
68
  return i.success("获取可用项目模板列表成功"), {
69
69
  contents: [
70
70
  {
71
- uri: s.href,
71
+ uri: r.href,
72
72
  text: JSON.stringify(e, null, 2),
73
73
  mimeType: "application/json"
74
74
  }
@@ -79,7 +79,7 @@ const C = f(import.meta.url), T = a.dirname(C), E = [
79
79
  isError: !0,
80
80
  contents: [
81
81
  {
82
- uri: s.href,
82
+ uri: r.href,
83
83
  type: "text",
84
84
  text: `❌ 获取可用项目模板列表失败: ${(e == null ? void 0 : e.message) || e}`
85
85
  }
@@ -88,9 +88,9 @@ const C = f(import.meta.url), T = a.dirname(C), E = [
88
88
  }
89
89
  }
90
90
  )
91
- ], x = [
91
+ ], h = [
92
92
  (o) => o.registerPrompt(
93
- `${r.cliConfig.moduleName}/create-project-assistant`,
93
+ `${s.cliConfig.moduleName}/create-project-assistant`,
94
94
  {
95
95
  title: "创建项目助手",
96
96
  description: "基于自然语言诉求创建项目"
@@ -101,34 +101,34 @@ const C = f(import.meta.url), T = a.dirname(C), E = [
101
101
  role: "user",
102
102
  content: {
103
103
  type: "text",
104
- text: `你是一个专业的项目初始化助手, 根据用户的自然语言诉求,从可用项目模板列表中挑选最匹配的选项来调用${r.cliConfig.moduleName}工具创建项目`
104
+ text: `你是一个专业的项目初始化助手, 根据用户的自然语言诉求,从可用项目模板列表中挑选最匹配的选项来调用${s.cliConfig.moduleName}工具创建项目`
105
105
  }
106
106
  }
107
107
  ]
108
108
  })
109
109
  )
110
- ], A = async () => {
110
+ ], $ = async () => {
111
111
  u({
112
112
  consoleLog: !1
113
- }), await g({
113
+ }), await d({
114
114
  toolRegisterList: E,
115
- resourceRegisterList: h,
116
- promptRegisterList: x,
117
- name: r.name,
118
- version: r.version
115
+ resourceRegisterList: T,
116
+ promptRegisterList: h,
117
+ name: s.name,
118
+ version: s.version
119
119
  }).catch((o) => {
120
120
  i.error("MCP 服务启动失败:", o), process.exit(1);
121
121
  });
122
122
  };
123
123
  export {
124
124
  n as FormNameEnum,
125
- j as GitRemoteRepoAliasNameEnum,
126
- w as SubcommandEnum,
125
+ S as GitRemoteRepoAliasNameEnum,
126
+ j as SubcommandEnum,
127
127
  G as commandCliInfo,
128
- I as crateAsSubcommand,
129
- O as createCommandCliInfo,
130
- H as createHandler,
131
- J as handler,
132
- r as injectInfo,
133
- A as setupMcpServer
128
+ M as crateAsSubcommand,
129
+ I as createCommandCliInfo,
130
+ O as createHandler,
131
+ H as handler,
132
+ s as injectInfo,
133
+ $ as setupMcpServer
134
134
  };
@@ -7,7 +7,7 @@ import { getTargetRepoUrl as Qo } from "@done-coding/cli-git";
7
7
  import { execSync as F } from "node:child_process";
8
8
  const ie = {
9
9
  name: "create-done-coding",
10
- version: "0.11.24-alpha.3",
10
+ version: "0.11.24-alpha.4",
11
11
  description: "项目创建命令行工具",
12
12
  bin: {
13
13
  "create-done-coding": "es/cli.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-done-coding",
3
- "version": "0.11.24-alpha.3",
3
+ "version": "0.11.24-alpha.4",
4
4
  "description": "项目创建命令行工具",
5
5
  "module": "es/index.mjs",
6
6
  "type": "module",
@@ -49,10 +49,10 @@
49
49
  "@done-coding/cli-git": "0.6.14-alpha.0",
50
50
  "@done-coding/cli-template": "0.8.9-alpha.0",
51
51
  "@done-coding/cli-utils": "0.8.3-alpha.0",
52
- "@done-coding/mcp-utils": "0.0.2-alpha.1"
52
+ "@done-coding/mcp-utils": "0.0.2-alpha.2"
53
53
  },
54
54
  "engines": {
55
55
  "node": ">=18.0.0"
56
56
  },
57
- "gitHead": "1f2d75bb2f3cfc402ea408de63c174a7337b9577"
57
+ "gitHead": "9ef471070bc3f5010365ee288d3ef2a2a553ab02"
58
58
  }
package/types/index.d.ts CHANGED
@@ -121,7 +121,7 @@ export declare const handler: (command: SubcommandEnum, argv: CliHandlerArgv<any
121
121
 
122
122
  export declare const injectInfo: {
123
123
  "name": "create-done-coding",
124
- "version": "0.11.24-alpha.3",
124
+ "version": "0.11.24-alpha.4",
125
125
  "description": "项目创建命令行工具",
126
126
  "bin": {
127
127
  "create-done-coding": "es/cli.mjs",