create-done-coding 0.11.24-alpha.6 → 0.11.24-alpha.7
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 +1 -1
- package/es/{main-9f9ce081.js → index-722e0050.js} +3 -5
- package/es/index.mjs +12 -127
- package/package.json +7 -9
- package/types/index.d.ts +2 -6
- package/types/mcp/server-config.d.ts +7 -0
- package/types/mcp/server.d.ts +2 -0
- package/types/mcp-server.d.ts +1 -1
- package/es/mcp-server.mjs +0 -3
package/es/cli.mjs
CHANGED
|
@@ -6,11 +6,10 @@ import { getConfigPath as zo, batchCompileHandler as Vo, MODULE_DEFAULT_CONFIG_R
|
|
|
6
6
|
import { getTargetRepoUrl as Qo } from "@done-coding/cli-git";
|
|
7
7
|
const ie = {
|
|
8
8
|
name: "create-done-coding",
|
|
9
|
-
version: "0.11.24-alpha.
|
|
9
|
+
version: "0.11.24-alpha.7",
|
|
10
10
|
description: "项目创建命令行工具",
|
|
11
11
|
bin: {
|
|
12
|
-
"create-done-coding": "es/cli.mjs"
|
|
13
|
-
"mcp-server": "es/mcp-server.mjs"
|
|
12
|
+
"create-done-coding": "es/cli.mjs"
|
|
14
13
|
},
|
|
15
14
|
cliConfig: {
|
|
16
15
|
namespaceDir: ".done-coding",
|
|
@@ -3608,7 +3607,7 @@ const lp = 3e4, Kn = Math.random(), Ro = {
|
|
|
3608
3607
|
}
|
|
3609
3608
|
}), tn = {
|
|
3610
3609
|
name: "@done-coding/cli-git",
|
|
3611
|
-
version: "0.6.14-alpha.
|
|
3610
|
+
version: "0.6.14-alpha.3",
|
|
3612
3611
|
description: "git跨平台操作命令行工具",
|
|
3613
3612
|
bin: {
|
|
3614
3613
|
"dc-git": "es/cli.mjs"
|
|
@@ -4380,7 +4379,6 @@ export {
|
|
|
4380
4379
|
sh as c,
|
|
4381
4380
|
oh as d,
|
|
4382
4381
|
Ao as e,
|
|
4383
|
-
Yo as g,
|
|
4384
4382
|
Co as h,
|
|
4385
4383
|
ie as i
|
|
4386
4384
|
};
|
package/es/index.mjs
CHANGED
|
@@ -1,133 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
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
|
-
import a from "node:path";
|
|
2
|
+
import { F as s, G as t, S as d, e as c, a as p, b as u, h as l, d as b, i as f } from "./index-722e0050.js";
|
|
3
|
+
import "@done-coding/cli-utils";
|
|
8
4
|
import "node:fs";
|
|
5
|
+
import "node:path";
|
|
9
6
|
import "@done-coding/cli-template";
|
|
10
7
|
import "@done-coding/cli-git";
|
|
11
|
-
const f = g(import.meta.url), C = a.dirname(f), E = [
|
|
12
|
-
(o, s) => o.registerTool(
|
|
13
|
-
r.cliConfig.moduleName,
|
|
14
|
-
{
|
|
15
|
-
title: `创建项目工具 - ${r.name}`,
|
|
16
|
-
description: "根据用户提供的项目名称、模板地址和分支创建新项目",
|
|
17
|
-
inputSchema: s.object({
|
|
18
|
-
[n.PROJECT_NAME]: s.string().min(1, "项目名称不能为空").describe("项目名称"),
|
|
19
|
-
[n.TEMPLATE_GIT_PATH]: s.string().min(1, "模板仓库地址不能为空").describe("模板仓库地址"),
|
|
20
|
-
[n.TEMPLATE_GIT_BRANCH]: s.string().optional().describe("对应的 Git 分支名称"),
|
|
21
|
-
cwd: s.string().min(1, "创建项目的目录绝对路径不能为空").describe("创建项目的目录绝对路径")
|
|
22
|
-
})
|
|
23
|
-
},
|
|
24
|
-
async (e) => {
|
|
25
|
-
i.info(`当前运行目录: ${e.cwd}`);
|
|
26
|
-
try {
|
|
27
|
-
const t = {
|
|
28
|
-
...e,
|
|
29
|
-
skipTemplateCompile: !0,
|
|
30
|
-
openGitDetailOptimize: !1
|
|
31
|
-
}, c = a.resolve(C, "./cli.mjs");
|
|
32
|
-
return await l({
|
|
33
|
-
command: "node",
|
|
34
|
-
args: [c, ...p(t)],
|
|
35
|
-
cwd: e.cwd,
|
|
36
|
-
env: process.env
|
|
37
|
-
}), i.success("项目创建成功"), {
|
|
38
|
-
content: [
|
|
39
|
-
{
|
|
40
|
-
type: "text",
|
|
41
|
-
text: `✅ 项目 [${e[n.PROJECT_NAME]}] 创建成功!`
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
};
|
|
45
|
-
} catch (t) {
|
|
46
|
-
return i.error("项目创建失败", (t == null ? void 0 : t.message) || t), {
|
|
47
|
-
isError: !0,
|
|
48
|
-
content: [
|
|
49
|
-
{ type: "text", text: `❌ 创建失败: ${(t == null ? void 0 : t.message) || t}` }
|
|
50
|
-
]
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
)
|
|
55
|
-
], T = [
|
|
56
|
-
(o) => o.registerResource(
|
|
57
|
-
`${r.cliConfig.moduleName}/templates`,
|
|
58
|
-
`resource:///${r.cliConfig.moduleName}/templates`,
|
|
59
|
-
{
|
|
60
|
-
title: "可用项目模板列表",
|
|
61
|
-
description: "包含所有可用的项目模板信息、仓库地址及可选分支"
|
|
62
|
-
},
|
|
63
|
-
async (s) => {
|
|
64
|
-
try {
|
|
65
|
-
i.stage("获取可用项目模板列表");
|
|
66
|
-
const e = await m();
|
|
67
|
-
return i.success("获取可用项目模板列表成功"), {
|
|
68
|
-
contents: [
|
|
69
|
-
{
|
|
70
|
-
uri: s.href,
|
|
71
|
-
text: JSON.stringify(e, null, 2),
|
|
72
|
-
mimeType: "application/json"
|
|
73
|
-
}
|
|
74
|
-
]
|
|
75
|
-
};
|
|
76
|
-
} catch (e) {
|
|
77
|
-
return {
|
|
78
|
-
isError: !0,
|
|
79
|
-
contents: [
|
|
80
|
-
{
|
|
81
|
-
uri: s.href,
|
|
82
|
-
type: "text",
|
|
83
|
-
text: `❌ 获取可用项目模板列表失败: ${(e == null ? void 0 : e.message) || e}`
|
|
84
|
-
}
|
|
85
|
-
]
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
)
|
|
90
|
-
], h = [
|
|
91
|
-
(o) => o.registerPrompt(
|
|
92
|
-
`${r.cliConfig.moduleName}/create-project-assistant`,
|
|
93
|
-
{
|
|
94
|
-
title: "创建项目助手",
|
|
95
|
-
description: "基于自然语言诉求创建项目"
|
|
96
|
-
},
|
|
97
|
-
async () => ({
|
|
98
|
-
messages: [
|
|
99
|
-
{
|
|
100
|
-
role: "user",
|
|
101
|
-
content: {
|
|
102
|
-
type: "text",
|
|
103
|
-
text: `你是一个专业的项目初始化助手, 根据用户的自然语言诉求,从可用项目模板列表中挑选最匹配的选项来调用${r.cliConfig.moduleName}工具创建项目`
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
})
|
|
108
|
-
)
|
|
109
|
-
], L = async () => {
|
|
110
|
-
u({
|
|
111
|
-
consoleLog: !1
|
|
112
|
-
}), await d({
|
|
113
|
-
toolRegisterList: E,
|
|
114
|
-
resourceRegisterList: T,
|
|
115
|
-
promptRegisterList: h,
|
|
116
|
-
name: r.name,
|
|
117
|
-
version: r.version
|
|
118
|
-
}).catch((o) => {
|
|
119
|
-
i.error("MCP 服务启动失败:", o), process.exit(1);
|
|
120
|
-
});
|
|
121
|
-
};
|
|
122
8
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
L as setupMcpServer
|
|
9
|
+
s as FormNameEnum,
|
|
10
|
+
t as GitRemoteRepoAliasNameEnum,
|
|
11
|
+
d as SubcommandEnum,
|
|
12
|
+
c as commandCliInfo,
|
|
13
|
+
p as crateAsSubcommand,
|
|
14
|
+
u as createCommandCliInfo,
|
|
15
|
+
l as createHandler,
|
|
16
|
+
b as handler,
|
|
17
|
+
f as injectInfo
|
|
133
18
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-done-coding",
|
|
3
|
-
"version": "0.11.24-alpha.
|
|
3
|
+
"version": "0.11.24-alpha.7",
|
|
4
4
|
"description": "项目创建命令行工具",
|
|
5
5
|
"module": "es/index.mjs",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "types/index.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"create-done-coding": "es/cli.mjs"
|
|
10
|
-
"mcp-server": "es/mcp-server.mjs"
|
|
9
|
+
"create-done-coding": "es/cli.mjs"
|
|
11
10
|
},
|
|
12
11
|
"exports": {
|
|
13
12
|
".": {
|
|
@@ -38,7 +37,7 @@
|
|
|
38
37
|
"license": "MIT",
|
|
39
38
|
"sideEffects": false,
|
|
40
39
|
"devDependencies": {
|
|
41
|
-
"@done-coding/cli-inject": "0.5.22-alpha.
|
|
40
|
+
"@done-coding/cli-inject": "0.5.22-alpha.3",
|
|
42
41
|
"@types/node": "^18.0.0",
|
|
43
42
|
"@types/yargs": "^17.0.28",
|
|
44
43
|
"typescript": "^5.8.3",
|
|
@@ -46,13 +45,12 @@
|
|
|
46
45
|
"vite-plugin-dts": "^3.6.0"
|
|
47
46
|
},
|
|
48
47
|
"dependencies": {
|
|
49
|
-
"@done-coding/cli-git": "0.6.14-alpha.
|
|
50
|
-
"@done-coding/cli-template": "0.8.9-alpha.
|
|
51
|
-
"@done-coding/cli-utils": "0.8.3-alpha.
|
|
52
|
-
"@done-coding/mcp-utils": "0.0.2-alpha.2"
|
|
48
|
+
"@done-coding/cli-git": "0.6.14-alpha.3",
|
|
49
|
+
"@done-coding/cli-template": "0.8.9-alpha.3",
|
|
50
|
+
"@done-coding/cli-utils": "0.8.3-alpha.3"
|
|
53
51
|
},
|
|
54
52
|
"engines": {
|
|
55
53
|
"node": ">=18.0.0"
|
|
56
54
|
},
|
|
57
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "30a4e6c8721e6bcafa72d4e05b35b5ed5fc75c0d"
|
|
58
56
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -121,11 +121,10 @@ 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.
|
|
124
|
+
"version": "0.11.24-alpha.7",
|
|
125
125
|
"description": "项目创建命令行工具",
|
|
126
126
|
"bin": {
|
|
127
|
-
"create-done-coding": "es/cli.mjs"
|
|
128
|
-
"mcp-server": "es/mcp-server.mjs"
|
|
127
|
+
"create-done-coding": "es/cli.mjs"
|
|
129
128
|
},
|
|
130
129
|
"cliConfig": {
|
|
131
130
|
"namespaceDir": ".done-coding",
|
|
@@ -145,9 +144,6 @@ export declare interface McpCreateToolParams extends McpCommonToolParams {
|
|
|
145
144
|
[FormNameEnum.TEMPLATE_GIT_BRANCH]?: string;
|
|
146
145
|
}
|
|
147
146
|
|
|
148
|
-
/** 启动 MCP 服务 */
|
|
149
|
-
export declare const setupMcpServer: () => Promise<void>;
|
|
150
|
-
|
|
151
147
|
export declare enum SubcommandEnum {
|
|
152
148
|
CREATE = "create"
|
|
153
149
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { McpToolRegisterItem, McpResourceRegisterItem, McpPromptRegisterItem } from "@done-coding/mcp-utils";
|
|
2
|
+
/** mcp服务 工具注册列表 */
|
|
3
|
+
export declare const toolRegisterList: McpToolRegisterItem[];
|
|
4
|
+
/** mcp服务 资源注册列表 */
|
|
5
|
+
export declare const resourceRegisterList: McpResourceRegisterItem[];
|
|
6
|
+
/** mcp服务 提示词注册列表 */
|
|
7
|
+
export declare const promptRegisterList: McpPromptRegisterItem[];
|
package/types/mcp-server.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/es/mcp-server.mjs
DELETED